Skip to content

Commit 5a94680

Browse files
committed
docs: Add applyBlur for text-input prop
1 parent 9cc245e commit 5a94680

File tree

1 file changed

+2
-124
lines changed

1 file changed

+2
-124
lines changed

docs/props/modes-configuration/index.md

Lines changed: 2 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -281,130 +281,6 @@ When using disabled dates with `minRange` or `mixRange`, disabled dates are not
281281
```
282282
:::
283283

284-
[//]: # (## preset-dates)
285-
286-
[//]: # ()
287-
[//]: # (When configured, it will provide a sidebar with configured range/date that user can select)
288-
289-
[//]: # ()
290-
[//]: # (::: tip Info)
291-
292-
[//]: # (- If the `timezone` prop is provided, values from preset dates will be converted to the provided timezone. If you don't want that, pass `noTz: true` to all presets)
293-
294-
[//]: # (- `testId` (if provided) will add `data-test` attribute on the preset button)
295-
296-
[//]: # (:::)
297-
298-
[//]: # ()
299-
[//]: # (- Type: `PresetDate[]`)
300-
301-
[//]: # (- Default: `[]`)
302-
303-
[//]: # ()
304-
[//]: # (```ts)
305-
306-
[//]: # (import type { MaybeRefOrGetter } from "vue";)
307-
308-
[//]: # ()
309-
[//]: # (interface PresetDate {)
310-
311-
[//]: # ( label: string;)
312-
313-
[//]: # ( value: MaybeRefOrGetter<Date[] | string[] | Date | string>;)
314-
315-
[//]: # ( style?: Record<string, string>;)
316-
317-
[//]: # ( slot?: string;)
318-
319-
[//]: # ( noTz?: boolean;)
320-
321-
[//]: # ( testId?: string;)
322-
323-
[//]: # (})
324-
325-
[//]: # (```)
326-
327-
[//]: # ()
328-
[//]: # (<PresetRange></PresetRange>)
329-
330-
[//]: # ()
331-
[//]: # (::: details Code Example)
332-
333-
[//]: # (```vue)
334-
335-
[//]: # (<template>)
336-
337-
[//]: # ( <VueDatePicker v-model="date" range :preset-dates="presetDates">)
338-
339-
[//]: # ( <template #preset-date-range-button="{ label, value, presetDate }">)
340-
341-
[//]: # ( <span )
342-
343-
[//]: # ( role="button")
344-
345-
[//]: # ( :tabindex="0")
346-
347-
[//]: # ( @click="presetDate&#40;value&#41;")
348-
349-
[//]: # ( @keyup.enter.prevent="presetDate&#40;value&#41;")
350-
351-
[//]: # ( @keyup.space.prevent="presetDate&#40;value&#41;">)
352-
353-
[//]: # ( {{ label }})
354-
355-
[//]: # ( </span>)
356-
357-
[//]: # ( </template>)
358-
359-
[//]: # ( </VueDatePicker>)
360-
361-
[//]: # (</template>)
362-
363-
[//]: # ()
364-
[//]: # (<script setup>)
365-
366-
[//]: # (import { ref } from 'vue';)
367-
368-
[//]: # (import { endOfMonth, endOfYear, startOfMonth, startOfYear, subMonths } from 'date-fns';)
369-
370-
[//]: # ()
371-
[//]: # (const date = ref&#40;&#41;;)
372-
373-
[//]: # ()
374-
[//]: # (const presetDates = ref&#40;[)
375-
376-
[//]: # ( { label: 'Today', value: [new Date&#40;&#41;, new Date&#40;&#41;] },)
377-
378-
[//]: # ( {)
379-
380-
[//]: # ( label: 'Today &#40;Slot&#41;',)
381-
382-
[//]: # ( value: [new Date&#40;&#41;, new Date&#40;&#41;],)
383-
384-
[//]: # ( slot: 'preset-date-range-button')
385-
386-
[//]: # ( },)
387-
388-
[//]: # ( { label: 'This month', value: [startOfMonth&#40;new Date&#40;&#41;&#41;, endOfMonth&#40;new Date&#40;&#41;&#41;] },)
389-
390-
[//]: # ( {)
391-
392-
[//]: # ( label: 'Last month',)
393-
394-
[//]: # ( value: [startOfMonth&#40;subMonths&#40;new Date&#40;&#41;, 1&#41;&#41;, endOfMonth&#40;subMonths&#40;new Date&#40;&#41;, 1&#41;&#41;],)
395-
396-
[//]: # ( },)
397-
398-
[//]: # ( { label: 'This year', value: [startOfYear&#40;new Date&#40;&#41;&#41;, endOfYear&#40;new Date&#40;&#41;&#41;] },)
399-
400-
[//]: # (]&#41;;)
401-
402-
[//]: # (</script>)
403-
404-
[//]: # (```)
405-
406-
[//]: # (:::)
407-
408284
## `multi-calendars` configuration
409285

410286
`multi-calendars` prop can be extended with the configuration object, instead of passing a `boolean` or `number` values,
@@ -477,6 +353,7 @@ interface TextInputOptions {
477353
format?: string | string[] | ((value: string) => Date | null);
478354
escClose?: boolean;
479355
maskFormat?: string;
356+
applyOnBlur?: boolean;
480357
}
481358
```
482359
- Default: `{ enterSubmit: true, tabSubmit: true, openMenu: 'open', rangeSeparator: '-' }`
@@ -490,6 +367,7 @@ interface TextInputOptions {
490367
- `selectOnFocus`: Selects the input text when input is focused
491368
- `escClose`: Closes calendar on `esc` key press
492369
- `maskFormat`: Check [here](#maskformat)
370+
- `applyOnBlur`: Tries to select a typed date when the input loses focus (has no effect if `auto-apply` is enabled)
493371
:::
494372

495373
:::info

0 commit comments

Comments
 (0)