flatpickr-ce 4.9.0 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -1
- package/dist/esm/index.js +172 -90
- package/dist/esm/l10n/af.js +68 -0
- package/dist/esm/l10n/ar-dz.js +2 -1
- package/dist/esm/l10n/ar-sy.js +50 -0
- package/dist/esm/l10n/ar.js +1 -0
- package/dist/esm/l10n/az.js +1 -0
- package/dist/esm/l10n/br.js +1 -0
- package/dist/esm/l10n/ckb.js +1 -9
- package/dist/esm/l10n/da.js +1 -0
- package/dist/esm/l10n/de.js +1 -0
- package/dist/esm/l10n/default.js +1 -0
- package/dist/esm/l10n/es.js +1 -0
- package/dist/esm/l10n/eu.js +65 -0
- package/dist/esm/l10n/fi.js +2 -0
- package/dist/esm/l10n/fr.js +1 -0
- package/dist/esm/l10n/ga.js +1 -1
- package/dist/esm/l10n/gl.js +1 -0
- package/dist/esm/l10n/gr.js +2 -1
- package/dist/esm/l10n/hy.js +1 -0
- package/dist/esm/l10n/id.js +1 -1
- package/dist/esm/l10n/index.js +15 -0
- package/dist/esm/l10n/ja.js +1 -0
- package/dist/esm/l10n/ko.js +1 -0
- package/dist/esm/l10n/no.js +1 -1
- package/dist/esm/l10n/pl.js +1 -0
- package/dist/esm/l10n/pt.js +1 -0
- package/dist/esm/l10n/sq.js +1 -0
- package/dist/esm/l10n/sv.js +1 -0
- package/dist/esm/l10n/tk.js +80 -0
- package/dist/esm/l10n/uk.js +1 -0
- package/dist/esm/l10n/vn.js +1 -1
- package/dist/esm/l10n/zh.js +2 -0
- package/dist/esm/l10n/zh_tw.js +1 -0
- package/dist/esm/plugins/momentPlugin.js +3 -3
- package/dist/esm/plugins/monthSelect/index.js +13 -9
- package/dist/esm/plugins/rangePlugin.js +6 -0
- package/dist/esm/plugins/weekSelect/weekSelect.js +1 -0
- package/dist/esm/utils/dates.js +9 -4
- package/dist/flatpickr.css +2 -1
- package/dist/flatpickr.js +274 -96
- package/dist/flatpickr.min.css +1 -1
- package/dist/flatpickr.min.js +2 -2
- package/dist/l10n/af.d.ts +84 -0
- package/dist/l10n/af.js +81 -0
- package/dist/l10n/ar-dz.d.ts +9 -0
- package/dist/l10n/ar-dz.js +2 -1
- package/dist/l10n/ar-sy.d.ts +84 -0
- package/dist/l10n/ar-sy.js +63 -0
- package/dist/l10n/ar.d.ts +9 -0
- package/dist/l10n/ar.js +1 -0
- package/dist/l10n/at.d.ts +9 -0
- package/dist/l10n/az.d.ts +9 -0
- package/dist/l10n/az.js +1 -0
- package/dist/l10n/be.d.ts +9 -0
- package/dist/l10n/bg.d.ts +9 -0
- package/dist/l10n/bn.d.ts +9 -0
- package/dist/l10n/br.d.ts +9 -0
- package/dist/l10n/br.js +1 -0
- package/dist/l10n/bs.d.ts +9 -0
- package/dist/l10n/cat.d.ts +9 -0
- package/dist/l10n/ckb.d.ts +9 -0
- package/dist/l10n/ckb.js +1 -9
- package/dist/l10n/cs.d.ts +9 -0
- package/dist/l10n/cy.d.ts +9 -0
- package/dist/l10n/da.d.ts +9 -0
- package/dist/l10n/da.js +1 -0
- package/dist/l10n/de.d.ts +9 -0
- package/dist/l10n/de.js +1 -0
- package/dist/l10n/default.js +1 -0
- package/dist/l10n/eo.d.ts +9 -0
- package/dist/l10n/es.d.ts +9 -0
- package/dist/l10n/es.js +1 -0
- package/dist/l10n/et.d.ts +9 -0
- package/dist/l10n/eu.d.ts +84 -0
- package/dist/l10n/eu.js +78 -0
- package/dist/l10n/fa.d.ts +9 -0
- package/dist/l10n/fi.d.ts +9 -0
- package/dist/l10n/fi.js +2 -0
- package/dist/l10n/fo.d.ts +9 -0
- package/dist/l10n/fr.d.ts +9 -0
- package/dist/l10n/fr.js +1 -0
- package/dist/l10n/ga.d.ts +9 -0
- package/dist/l10n/ga.js +1 -1
- package/dist/l10n/gl.d.ts +9 -0
- package/dist/l10n/gl.js +1 -0
- package/dist/l10n/gr.d.ts +9 -0
- package/dist/l10n/gr.js +2 -1
- package/dist/l10n/he.d.ts +9 -0
- package/dist/l10n/hi.d.ts +9 -0
- package/dist/l10n/hr.d.ts +9 -0
- package/dist/l10n/hu.d.ts +9 -0
- package/dist/l10n/hy.d.ts +9 -0
- package/dist/l10n/hy.js +1 -0
- package/dist/l10n/id.d.ts +9 -0
- package/dist/l10n/id.js +1 -1
- package/dist/l10n/index.js +599 -204
- package/dist/l10n/is.d.ts +9 -0
- package/dist/l10n/it.d.ts +9 -0
- package/dist/l10n/ja.d.ts +9 -0
- package/dist/l10n/ja.js +1 -0
- package/dist/l10n/ka.d.ts +9 -0
- package/dist/l10n/km.d.ts +9 -0
- package/dist/l10n/ko.d.ts +9 -0
- package/dist/l10n/ko.js +1 -0
- package/dist/l10n/kz.d.ts +9 -0
- package/dist/l10n/lt.d.ts +9 -0
- package/dist/l10n/lv.d.ts +9 -0
- package/dist/l10n/mk.d.ts +9 -0
- package/dist/l10n/mn.d.ts +9 -0
- package/dist/l10n/ms.d.ts +9 -0
- package/dist/l10n/my.d.ts +9 -0
- package/dist/l10n/nl.d.ts +9 -0
- package/dist/l10n/nn.d.ts +9 -0
- package/dist/l10n/no.d.ts +9 -0
- package/dist/l10n/no.js +1 -1
- package/dist/l10n/pa.d.ts +9 -0
- package/dist/l10n/pl.d.ts +9 -0
- package/dist/l10n/pl.js +1 -0
- package/dist/l10n/pt.d.ts +9 -0
- package/dist/l10n/pt.js +1 -0
- package/dist/l10n/ro.d.ts +9 -0
- package/dist/l10n/ru.d.ts +9 -0
- package/dist/l10n/si.d.ts +9 -0
- package/dist/l10n/sk.d.ts +9 -0
- package/dist/l10n/sl.d.ts +9 -0
- package/dist/l10n/sq.d.ts +9 -0
- package/dist/l10n/sq.js +1 -0
- package/dist/l10n/sr-cyr.d.ts +9 -0
- package/dist/l10n/sr.d.ts +9 -0
- package/dist/l10n/sv.d.ts +9 -0
- package/dist/l10n/sv.js +1 -0
- package/dist/l10n/tg.d.ts +9 -0
- package/dist/l10n/th.d.ts +9 -0
- package/dist/l10n/tk.d.ts +84 -0
- package/dist/l10n/tk.js +93 -0
- package/dist/l10n/tr.d.ts +9 -0
- package/dist/l10n/uk.d.ts +9 -0
- package/dist/l10n/uk.js +1 -0
- package/dist/l10n/uz.d.ts +9 -0
- package/dist/l10n/uz_latn.d.ts +9 -0
- package/dist/l10n/vn.d.ts +9 -0
- package/dist/l10n/vn.js +1 -1
- package/dist/l10n/zh.d.ts +9 -0
- package/dist/l10n/zh.js +2 -0
- package/dist/l10n/zh_tw.d.ts +9 -0
- package/dist/l10n/zh_tw.js +1 -0
- package/dist/plugins/minMaxTimePlugin.js +3 -1
- package/dist/plugins/momentPlugin.js +3 -3
- package/dist/plugins/monthSelect/index.js +17 -10
- package/dist/plugins/rangePlugin.js +12 -0
- package/dist/plugins/weekSelect/weekSelect.js +2 -0
- package/dist/themes/airbnb.css +11 -11
- package/dist/themes/confetti.css +1 -0
- package/dist/themes/dark.css +1 -0
- package/dist/themes/light.css +1 -0
- package/dist/themes/material_blue.css +1 -0
- package/dist/themes/material_green.css +1 -0
- package/dist/themes/material_orange.css +1 -0
- package/dist/themes/material_red.css +1 -0
- package/dist/types/instance.d.ts +2 -0
- package/dist/types/locale.d.ts +3 -1
- package/dist/types/options.d.ts +2 -0
- package/dist/typings.d.ts +1 -1
- package/dist/utils/dates.d.ts +1 -1
- package/package.json +6 -1
- package/src/style/flatpickr.styl +8 -1
- package/src/style/themes/airbnb.styl +4 -8
package/README.md
CHANGED
|
@@ -42,6 +42,75 @@ npm install flatpickr@npm:flatpickr-ce
|
|
|
42
42
|
|
|
43
43
|
## What's changed since flatpickr 4.6.13
|
|
44
44
|
|
|
45
|
+
### 4.11.0
|
|
46
|
+
|
|
47
|
+
- Closing the calendar after browsing to other months without picking a day no longer leaves it there: it reopens on the selected date ([#2835](https://github.com/flatpickr/flatpickr/issues/2835))
|
|
48
|
+
- The focus stays on the day just picked, so keyboard users keep their place in multiple mode, with `closeOnSelect: false` and with several months shown ([#2791](https://github.com/flatpickr/flatpickr/issues/2791))
|
|
49
|
+
- Picking a day that leaves the selection as it was no longer fires `onChange`, nor change and input on the input ([#2700](https://github.com/flatpickr/flatpickr/issues/2700))
|
|
50
|
+
- On touch screens, scrolling or zooming the page no longer closes the calendar; a tap outside closes it when the finger lifts ([#2680](https://github.com/flatpickr/flatpickr/issues/2680))
|
|
51
|
+
- `minDate`, `maxDate`, `enable` and `disable` strings with month or weekday names or AM/PM are read in the instance's locale ([#2721](https://github.com/flatpickr/flatpickr/issues/2721))
|
|
52
|
+
- A custom locale whose `weekdays` or `months` gives only `shorthand` or only `longhand` no longer throws; the other list is the default locale's ([#2654](https://github.com/flatpickr/flatpickr/issues/2654), [#2693](https://github.com/flatpickr/flatpickr/issues/2693))
|
|
53
|
+
- With rangePlugin and `enableTime`, a day picked anew for an end keeps that end's time, and the time inputs stay on it ([#2712](https://github.com/flatpickr/flatpickr/issues/2712))
|
|
54
|
+
- With `enableTime` and no date selected, `set("minDate")` and `set("maxDate")` put the default time on the time inputs ([#1869](https://github.com/flatpickr/flatpickr/issues/1869))
|
|
55
|
+
- `null` for `appendTo`, `formatDate` and `conjunction`, and `null` or `undefined` for `enable`, are taken as unset, as the docs list them ([#2725](https://github.com/flatpickr/flatpickr/issues/2725))
|
|
56
|
+
- The calendar is positioned by its full height, padding and border included ([#2628](https://github.com/flatpickr/flatpickr/issues/2628))
|
|
57
|
+
- With `showMonths` above 1, the days stay under their weekdays on a page whose `.hidden` rule sets `display: none`, as Tailwind's does ([#2822](https://github.com/flatpickr/flatpickr/issues/2822))
|
|
58
|
+
- In the default styles and the airbnb theme, the month dropdown's options are drawn on the calendar's background, so they stay readable when the browser's popup is dark ([#2629](https://github.com/flatpickr/flatpickr/issues/2629))
|
|
59
|
+
- The weekday labels carry no surrounding whitespace, so a page that preserves white-space shows the header aligned ([#2749](https://github.com/flatpickr/flatpickr/issues/2749))
|
|
60
|
+
- In Safari, an inline calendar no longer gets an arrow or a popup's positioning at init ([#2787](https://github.com/flatpickr/flatpickr/issues/2787), [#1377](https://github.com/flatpickr/flatpickr/issues/1377))
|
|
61
|
+
- weekSelect shows its calendar on mobile devices instead of failing to initialize ([#2824](https://github.com/flatpickr/flatpickr/issues/2824))
|
|
62
|
+
- The native mobile input's value is put on its step, so a date with seconds no longer keeps its form from submitting ([#2393](https://github.com/flatpickr/flatpickr/issues/2393)); it takes the original input's tabindex instead of 1 ([#2672](https://github.com/flatpickr/flatpickr/issues/2672)); `open()` opens its picker with `showPicker()` where the browser has it, as Firefox for Android needs ([#2726](https://github.com/flatpickr/flatpickr/issues/2726))
|
|
63
|
+
- With `enableSeconds`, the seconds input has an aria-label, the locale's new `secondAriaLabel` ([#2821](https://github.com/flatpickr/flatpickr/pull/2821))
|
|
64
|
+
- In IE, committing typed input, hovering a range and stepping a time input with momentPlugin no longer throw ([#2709](https://github.com/flatpickr/flatpickr/issues/2709))
|
|
65
|
+
- Locales: new Turkmen (`tk`), Basque (`eu`), Afrikaans (`af`) and Levantine Arabic (`ar_sy`); Greek is also registered as `el`, and Algerian Arabic as `ar_dz` instead of over `ar`; Mandarin writes AM and PM as 上午 and 下午, and Ukrainian ranges are separated with an em dash ([#2664](https://github.com/flatpickr/flatpickr/pull/2664), [#2706](https://github.com/flatpickr/flatpickr/pull/2706), [#2765](https://github.com/flatpickr/flatpickr/pull/2765), [#2774](https://github.com/flatpickr/flatpickr/pull/2774), [#2796](https://github.com/flatpickr/flatpickr/issues/2796), [#2830](https://github.com/flatpickr/flatpickr/pull/2830), [#2771](https://github.com/flatpickr/flatpickr/pull/2771), [#2826](https://github.com/flatpickr/flatpickr/pull/2826))
|
|
66
|
+
- The bug report template and the Contributing section link a JSFiddle that runs flatpickr-ce ([#2759](https://github.com/flatpickr/flatpickr/issues/2759))
|
|
67
|
+
|
|
68
|
+
Behavior changes to check when upgrading:
|
|
69
|
+
|
|
70
|
+
- Mandarin's AM/PM is 上午/下午, and in a value saved with AM or PM under a format with `K`, the AM or PM is skipped and the hour read as `h` gives it. Replace them in stored values, or keep them with `locale: { ...Mandarin, amPM: ["AM", "PM"] }`.
|
|
71
|
+
- Ukrainian ranges saved with " to " read as a same-day range of their first date, or a start alone with `enableTime`. Replace the separator in stored values, or keep it with `locale: { ...Ukrainian, rangeSeparator: " to " }`.
|
|
72
|
+
- With ar-dz.js loaded, `locale: "ar"` no longer gives Algerian Arabic; use `"ar_dz"`.
|
|
73
|
+
- Picking a day that leaves the selected dates and times as they were fires no `onChange`, change or input event, so plugins and handlers that act in `onChange` don't run for it; `onValueUpdate` still fires.
|
|
74
|
+
- On windows with touch and pointer events, a tap outside closes the calendar on `pointerup`, and a mouse there closes it on `pointerdown`. A page that keeps the calendar open by stopping `touchstart` or `mousedown` has to stop `pointerup` or `pointerdown` instead, or list the element in `ignoredFocusElements`.
|
|
75
|
+
- Closing after browsing away, with no selected date in view, moves the view back: the days are rebuilt, then `onYearChange` (when the year changes) and `onMonthChange` fire, before `onClose`.
|
|
76
|
+
- Without time inputs, the day picked takes the focus; in single mode with `closeOnSelect`, it holds it for a moment before the input does.
|
|
77
|
+
- With `enableTime` and no date selected, `set("minDate")` puts the default time on the time inputs instead of minDate's own time, so a picker whose `minDate` follows another picker's date no longer copies its time.
|
|
78
|
+
- With the native mobile input and `enableTime` but not `enableSeconds`, its value has no seconds. It gets `tabindex="0"` instead of `"1"`. Where `showPicker()` exists, `open()` no longer dispatches a click on it, and uses up the page's user activation.
|
|
79
|
+
- Weekday names in a custom locale are written as text, no longer parsed as HTML.
|
|
80
|
+
- An explicit `conjunction: undefined` joins dates with ", " instead of ",".
|
|
81
|
+
- TypeScript: the `Locale` type has a required `secondAriaLabel`; `CustomLocale` takes it as optional.
|
|
82
|
+
|
|
83
|
+
### 4.10.0
|
|
84
|
+
|
|
85
|
+
- The native mobile input follows `set("minDate")` and `set("maxDate")`, and its `min` and `max` are a date and time with `enableTime` and a time with `noCalendar`, on a time its picker can offer ([#2860](https://github.com/flatpickr/flatpickr/issues/2860))
|
|
86
|
+
- With `enableSeconds`, the native mobile input shows and picks seconds ([#2908](https://github.com/flatpickr/flatpickr/issues/2908))
|
|
87
|
+
- New `secondIncrement` option for the seconds input; without it the seconds step by `minuteIncrement` as before ([#2912](https://github.com/flatpickr/flatpickr/pull/2912))
|
|
88
|
+
- A time off its increment, as `minDate` can give, no longer keeps a form with the calendar inside it from submitting, and `set("hourIncrement")` and `set("minuteIncrement")` apply at once ([#2923](https://github.com/flatpickr/flatpickr/issues/2923))
|
|
89
|
+
- `enable` and `disable` are checked by day for a value with a time, as for a click ([#2855](https://github.com/flatpickr/flatpickr/issues/2855))
|
|
90
|
+
- The default time is held to `minDate` and `maxDate` only on their own day, so a date-only `maxDate` no longer turns it into 00:00 ([#2894](https://github.com/flatpickr/flatpickr/issues/2894))
|
|
91
|
+
- In multiple mode, dates typed without the space after the conjunction, such as `01/08/2023,02/08/2023`, are read as separate dates ([#2922](https://github.com/flatpickr/flatpickr/issues/2922))
|
|
92
|
+
- monthSelect's multiple mode adds and removes months on click ([#2849](https://github.com/flatpickr/flatpickr/issues/2849), [#2858](https://github.com/flatpickr/flatpickr/issues/2858))
|
|
93
|
+
- In range mode, a tapped end can no longer cross a disabled day ([#2974](https://github.com/flatpickr/flatpickr/pull/2974))
|
|
94
|
+
- With `allowInput`, Escape in the input closes the calendar ([#2915](https://github.com/flatpickr/flatpickr/pull/2915))
|
|
95
|
+
- `set("locale")` switches the time inputs to the locale's 12- or 24-hour form and AM/PM ([#2954](https://github.com/flatpickr/flatpickr/issues/2954))
|
|
96
|
+
- A year past what a Date can hold leaves the calendar as it was instead of breaking it ([#2906](https://github.com/flatpickr/flatpickr/issues/2906))
|
|
97
|
+
- `element._flatpickr` is the instance in the hooks `init` fires and in plugins ([#2977](https://github.com/flatpickr/flatpickr/issues/2977))
|
|
98
|
+
- The airbnb theme's IE rule is a media query that CSS parsers such as lightningcss accept ([#2976](https://github.com/flatpickr/flatpickr/issues/2976))
|
|
99
|
+
- The main entry is typed as `export =`, so the default import works under `moduleResolution` `node16` and `nodenext` ([#2857](https://github.com/flatpickr/flatpickr/pull/2857))
|
|
100
|
+
- Locales: Finnish ranges are separated with an en dash and Indonesian ones with "sampai"; Irish is registered as `ga`, Vietnamese also as `vi` and Norwegian also as `nb`; the Kurdish (Sorani) weekday shorthand is abbreviated ([#2842](https://github.com/flatpickr/flatpickr/pull/2842), [#2966](https://github.com/flatpickr/flatpickr/pull/2966), [#2848](https://github.com/flatpickr/flatpickr/pull/2848), [#2867](https://github.com/flatpickr/flatpickr/pull/2867), [#2904](https://github.com/flatpickr/flatpickr/pull/2904), [#2895](https://github.com/flatpickr/flatpickr/pull/2895))
|
|
101
|
+
|
|
102
|
+
Behavior changes to check when upgrading:
|
|
103
|
+
|
|
104
|
+
- Finnish ranges saved with " to " and Indonesian ones saved with " - " read as a same-day range of their first date. Replace the separator in stored values, or keep it with `locale: { ...Finnish, rangeSeparator: " to " }`.
|
|
105
|
+
- `locale: "hr"` no longer gives Irish; use `"ga"`.
|
|
106
|
+
- TypeScript: under `moduleResolution` `node` with neither `esModuleInterop` nor `allowSyntheticDefaultImports`, the default import is an error (TS1259); turn on `allowSyntheticDefaultImports`. `import * as flatpickr` is typed as the function itself, so `flatpickr.default(...)` no longer compiles.
|
|
107
|
+
- A value with a time (`defaultDate`, `setDate`, typed text) on a day `disable` lists is dropped, and one on a day `enable` lists is kept; an `enable` or `disable` function is called with midnight of its day, as for a click.
|
|
108
|
+
- In multiple mode, a conjunction without leading whitespace whose trimmed part appears in `dateFormat`, such as the default ", " with `"j,M,Y"`, now splits a date apart. A custom `parseDate` gets each date with the whitespace around it trimmed.
|
|
109
|
+
- With the native mobile input and `enableTime` or `noCalendar`, the native picker keeps to `minDate` and `maxDate`, which it ignored. A value kept outside them, as `allowInvalidPreload` keeps one, leaves the input invalid, so its form doesn't submit until it's changed.
|
|
110
|
+
- The calendar's hour, minute and second inputs have no `step` attribute.
|
|
111
|
+
- With `enableTime`, `set("locale")` rebuilds the time inputs, so listeners attached directly to them are lost, as on `set("time_24hr")`.
|
|
112
|
+
- In monthSelect, the view stays on the year of the month picked.
|
|
113
|
+
|
|
45
114
|
### 4.9.0
|
|
46
115
|
|
|
47
116
|
- New yearSelect plugin: a year-only picker modeled on monthSelect, for single, multiple and range mode ([#5](https://github.com/colinli007/flatpickr-ce/issues/5), [#6](https://github.com/colinli007/flatpickr-ce/pull/6))
|
|
@@ -139,13 +208,15 @@ Framework addons (they depend on the `flatpickr` package, so use the alias above
|
|
|
139
208
|
|
|
140
209
|
### Options are trusted
|
|
141
210
|
|
|
142
|
-
A few options are inserted into the calendar as HTML, not text: `prevArrow`, `nextArrow`, what `getWeek` returns
|
|
211
|
+
A few options are inserted into the calendar as HTML, not text: `prevArrow`, `nextArrow`, what `getWeek` returns and confirmDate's `confirmIcon`. Like the rest of the config, they are meant to come from your code: don't build them from user input or other untrusted data without escaping it.
|
|
143
212
|
|
|
144
213
|
|
|
145
214
|
## Contributing
|
|
146
215
|
|
|
147
216
|
Bug reports, triage and pull requests are all welcome. Fixes that are still open upstream can be reopened here.
|
|
148
217
|
|
|
218
|
+
To report a bug, start from [this fiddle](https://jsfiddle.net/gh/get/library/pure/colinli007/flatpickr-ce/tree/main/.github/repro), which loads the latest flatpickr-ce from jsDelivr: reproduce the bug there, save it and link it in the issue.
|
|
219
|
+
|
|
149
220
|
```sh
|
|
150
221
|
npm install
|
|
151
222
|
npm test # typecheck + unit tests
|