flatpickr-ce 4.7.2 → 4.9.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 +53 -0
- package/dist/esm/index.js +372 -221
- package/dist/esm/l10n/az.js +4 -0
- package/dist/esm/l10n/bg.js +1 -0
- package/dist/esm/l10n/br.js +67 -0
- package/dist/esm/l10n/da.js +4 -0
- package/dist/esm/l10n/de.js +4 -0
- package/dist/esm/l10n/es.js +4 -0
- package/dist/esm/l10n/fi.js +4 -0
- package/dist/esm/l10n/fr.js +4 -0
- package/dist/esm/l10n/gl.js +62 -0
- package/dist/esm/l10n/he.js +1 -1
- package/dist/esm/l10n/index.js +6 -0
- package/dist/esm/l10n/ko.js +4 -0
- package/dist/esm/l10n/pl.js +4 -0
- package/dist/esm/l10n/pt.js +4 -0
- package/dist/esm/l10n/sv.js +4 -0
- package/dist/esm/l10n/tg.js +62 -0
- package/dist/esm/l10n/zh.js +4 -0
- package/dist/esm/l10n/zh_tw.js +4 -0
- package/dist/esm/plugins/confirmDate/confirmDate.js +5 -2
- package/dist/esm/plugins/monthSelect/index.js +16 -49
- package/dist/esm/plugins/rangePlugin.js +60 -38
- package/dist/esm/plugins/yearSelect/index.js +341 -0
- package/dist/esm/types/options.js +2 -0
- package/dist/esm/utils/dates.js +18 -7
- package/dist/esm/utils/formatting.js +43 -35
- package/dist/flatpickr.js +523 -266
- package/dist/flatpickr.min.js +2 -2
- package/dist/l10n/ar-dz.d.ts +3 -0
- package/dist/l10n/ar.d.ts +3 -0
- package/dist/l10n/at.d.ts +3 -0
- package/dist/l10n/az.d.ts +3 -0
- package/dist/l10n/az.js +4 -0
- package/dist/l10n/be.d.ts +3 -0
- package/dist/l10n/bg.d.ts +3 -0
- package/dist/l10n/bg.js +1 -0
- package/dist/l10n/bn.d.ts +3 -0
- package/dist/l10n/br.d.ts +75 -0
- package/dist/l10n/br.js +80 -0
- package/dist/l10n/bs.d.ts +3 -0
- package/dist/l10n/cat.d.ts +3 -0
- package/dist/l10n/ckb.d.ts +3 -0
- package/dist/l10n/cs.d.ts +3 -0
- package/dist/l10n/cy.d.ts +3 -0
- package/dist/l10n/da.d.ts +3 -0
- package/dist/l10n/da.js +4 -0
- package/dist/l10n/de.d.ts +3 -0
- package/dist/l10n/de.js +4 -0
- package/dist/l10n/eo.d.ts +3 -0
- package/dist/l10n/es.d.ts +3 -0
- package/dist/l10n/es.js +4 -0
- package/dist/l10n/et.d.ts +3 -0
- package/dist/l10n/fa.d.ts +3 -0
- package/dist/l10n/fi.d.ts +3 -0
- package/dist/l10n/fi.js +4 -0
- package/dist/l10n/fo.d.ts +3 -0
- package/dist/l10n/fr.d.ts +3 -0
- package/dist/l10n/fr.js +4 -0
- package/dist/l10n/ga.d.ts +3 -0
- package/dist/l10n/gl.d.ts +75 -0
- package/dist/l10n/gl.js +75 -0
- package/dist/l10n/gr.d.ts +3 -0
- package/dist/l10n/he.d.ts +3 -0
- package/dist/l10n/he.js +1 -1
- package/dist/l10n/hi.d.ts +3 -0
- package/dist/l10n/hr.d.ts +3 -0
- package/dist/l10n/hu.d.ts +3 -0
- package/dist/l10n/hy.d.ts +3 -0
- package/dist/l10n/id.d.ts +3 -0
- package/dist/l10n/index.js +418 -171
- package/dist/l10n/is.d.ts +3 -0
- package/dist/l10n/it.d.ts +3 -0
- package/dist/l10n/ja.d.ts +3 -0
- package/dist/l10n/ka.d.ts +3 -0
- package/dist/l10n/km.d.ts +3 -0
- package/dist/l10n/ko.d.ts +3 -0
- package/dist/l10n/ko.js +4 -0
- package/dist/l10n/kz.d.ts +3 -0
- package/dist/l10n/lt.d.ts +3 -0
- package/dist/l10n/lv.d.ts +3 -0
- package/dist/l10n/mk.d.ts +3 -0
- package/dist/l10n/mn.d.ts +3 -0
- package/dist/l10n/ms.d.ts +3 -0
- package/dist/l10n/my.d.ts +3 -0
- package/dist/l10n/nl.d.ts +3 -0
- package/dist/l10n/nn.d.ts +3 -0
- package/dist/l10n/no.d.ts +3 -0
- package/dist/l10n/pa.d.ts +3 -0
- package/dist/l10n/pl.d.ts +3 -0
- package/dist/l10n/pl.js +4 -0
- package/dist/l10n/pt.d.ts +3 -0
- package/dist/l10n/pt.js +4 -0
- package/dist/l10n/ro.d.ts +3 -0
- package/dist/l10n/ru.d.ts +3 -0
- package/dist/l10n/si.d.ts +3 -0
- package/dist/l10n/sk.d.ts +3 -0
- package/dist/l10n/sl.d.ts +3 -0
- package/dist/l10n/sq.d.ts +3 -0
- package/dist/l10n/sr-cyr.d.ts +3 -0
- package/dist/l10n/sr.d.ts +3 -0
- package/dist/l10n/sv.d.ts +3 -0
- package/dist/l10n/sv.js +4 -0
- package/dist/l10n/tg.d.ts +75 -0
- package/dist/l10n/tg.js +76 -0
- package/dist/l10n/th.d.ts +3 -0
- package/dist/l10n/tr.d.ts +3 -0
- package/dist/l10n/uk.d.ts +3 -0
- package/dist/l10n/uz.d.ts +3 -0
- package/dist/l10n/uz_latn.d.ts +3 -0
- package/dist/l10n/vn.d.ts +3 -0
- package/dist/l10n/zh.d.ts +3 -0
- package/dist/l10n/zh.js +4 -0
- package/dist/l10n/zh_tw.d.ts +3 -0
- package/dist/l10n/zh_tw.js +4 -0
- package/dist/plugins/confirmDate/confirmDate.js +6 -2
- package/dist/plugins/minMaxTimePlugin.js +1 -0
- package/dist/plugins/monthSelect/index.js +20 -49
- package/dist/plugins/rangePlugin.js +85 -38
- package/dist/plugins/yearSelect/index.d.ts +14 -0
- package/dist/plugins/yearSelect/index.js +412 -0
- package/dist/plugins/yearSelect/style.css +108 -0
- package/dist/types/instance.d.ts +2 -0
- package/dist/types/locale.d.ts +1 -1
- package/dist/types/options.d.ts +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,55 @@ npm install flatpickr@npm:flatpickr-ce
|
|
|
42
42
|
|
|
43
43
|
## What's changed since flatpickr 4.6.13
|
|
44
44
|
|
|
45
|
+
### 4.9.0
|
|
46
|
+
|
|
47
|
+
- 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))
|
|
48
|
+
- In range mode, a same-day range written as one date reads back as that range instead of a start that a click outside drops ([#3010](https://github.com/flatpickr/flatpickr/issues/3010))
|
|
49
|
+
- rangePlugin with `allowInput` commits what is typed into its two inputs as one range: a click outside keeps the range, and `onChange` fires once per commit
|
|
50
|
+
- A date or time with a field out of range, such as `02/31/2025` or `24:00`, is invalid instead of rolling over ([#2988](https://github.com/flatpickr/flatpickr/issues/2988))
|
|
51
|
+
- Month names, weekday names and AM/PM are parsed in any case ([#3057](https://github.com/flatpickr/flatpickr/pull/3057))
|
|
52
|
+
- `allowInvalidPreload` no longer throws on a value it can't parse ([#3000](https://github.com/flatpickr/flatpickr/issues/3000), [#2760](https://github.com/flatpickr/flatpickr/issues/2760), [#2856](https://github.com/flatpickr/flatpickr/issues/2856))
|
|
53
|
+
- `clear()`, and `set("minDate")` or `set("maxDate")`, keep the view within the current limits ([#3002](https://github.com/flatpickr/flatpickr/issues/3002))
|
|
54
|
+
- With `showMonths > 1`, picking a day in a shown month of the next year keeps the view ([#3003](https://github.com/flatpickr/flatpickr/issues/3003))
|
|
55
|
+
- Enter and the arrow keys in the month dropdown no longer change the year or move the focus ([#3045](https://github.com/flatpickr/flatpickr/pull/3045))
|
|
56
|
+
- Seconds are only clamped to `minTime`/`maxTime` within their hour ([#3023](https://github.com/flatpickr/flatpickr/issues/3023), [#3024](https://github.com/flatpickr/flatpickr/pull/3024))
|
|
57
|
+
- With `wrap`, `static` and `altInput`, the altInput stays next to the input ([#3037](https://github.com/flatpickr/flatpickr/issues/3037))
|
|
58
|
+
- The Hebrew range separator is " עד ", and the Breton name of Wednesday is fixed ([#3014](https://github.com/flatpickr/flatpickr/issues/3014), [#3088](https://github.com/flatpickr/flatpickr/pull/3088))
|
|
59
|
+
|
|
60
|
+
Behavior changes to check when upgrading:
|
|
61
|
+
|
|
62
|
+
- In range mode without `enableTime`, a string with one date (the input's value, `defaultDate`, `setDate`, typed text) is a same-day range, so the next day picked starts a new range instead of finishing it. With rangePlugin, `setDate("2024-04-19")` sets a same-day range in both inputs.
|
|
63
|
+
- A date with a field out of range is reported to `errorHandler` and selects nothing, also in `minDate`, `maxDate`, `enable` and `disable`. `maxTime: "24:00"` is dropped; use `"23:59"`.
|
|
64
|
+
- Hebrew ranges saved with " אל " read as a same-day range of their first date. Replace the separator in stored values, or keep it with `locale: { ...Hebrew, rangeSeparator: " אל " }`.
|
|
65
|
+
- With rangePlugin and `allowInput`, an emptied or unparsable end leaves the other end as both ends instead of clearing the range, and an end typed before the start takes the start along.
|
|
66
|
+
- With `wrap`, `static` and `altInput`, the altInput is inside the wrap element, which changes DOM snapshots.
|
|
67
|
+
|
|
68
|
+
### 4.8.0
|
|
69
|
+
|
|
70
|
+
- A typed value is committed the same way on Enter, blur and a click outside, and `onChange` now fires when a click outside commits it ([#2941](https://github.com/flatpickr/flatpickr/issues/2941), [#3136](https://github.com/flatpickr/flatpickr/pull/3136))
|
|
71
|
+
- The arrow keys move by date, also across years with `showMonths > 1`, and skip past months where every day is disabled ([#3099](https://github.com/flatpickr/flatpickr/issues/3099), [#3140](https://github.com/flatpickr/flatpickr/pull/3140), [#3064](https://github.com/flatpickr/flatpickr/issues/3064))
|
|
72
|
+
- `set("enableTime")`, `set("time_24hr")` and `set("enableSeconds")` take effect ([#3083](https://github.com/flatpickr/flatpickr/issues/3083))
|
|
73
|
+
- Formats with numeric month names parse correctly ([#3115](https://github.com/flatpickr/flatpickr/issues/3115), [#3139](https://github.com/flatpickr/flatpickr/pull/3139)), and with `noCalendar` a date no longer rolls over depending on today's day ([#3078](https://github.com/flatpickr/flatpickr/issues/3078))
|
|
74
|
+
- A `range` value with an end ruled out by `minDate`, `maxDate`, `enable` or `disable` is dropped as a whole instead of leaving half a range; `allowInvalidPreload` keeps the whole range ([#3108](https://github.com/flatpickr/flatpickr/issues/3108))
|
|
75
|
+
- The calendar lines up with its input under scroll locks that fix `<html>` in place, such as Vuetify's dialogs ([#3122](https://github.com/flatpickr/flatpickr/issues/3122)), and one that fits neither above nor below its input is kept in the viewport ([#3094](https://github.com/flatpickr/flatpickr/issues/3094))
|
|
76
|
+
- The document and window listeners are only bound while the calendar is open ([#3069](https://github.com/flatpickr/flatpickr/issues/3069)), and the calendar's own fields have ids, so Chrome no longer flags them ([#3118](https://github.com/flatpickr/flatpickr/issues/3118))
|
|
77
|
+
- The native mobile input isn't rewritten while it's being typed into ([#3144](https://github.com/flatpickr/flatpickr/issues/3144), [#3145](https://github.com/flatpickr/flatpickr/pull/3145)), and moving to another year without a calendar no longer throws
|
|
78
|
+
- monthSelect stays in sync after `setDate` and typed input, and shows its own grid on mobile devices ([#3067](https://github.com/flatpickr/flatpickr/issues/3067), [#3109](https://github.com/flatpickr/flatpickr/issues/3109), [#3119](https://github.com/flatpickr/flatpickr/issues/3119)); plugins can rebuild their cells on the new `onDaysBuilt` hook
|
|
79
|
+
- rangePlugin fires `onOpen` once per opening, lets `defaultDate` override a prefilled second input, and parses that input in the format it displays ([#3114](https://github.com/flatpickr/flatpickr/issues/3114))
|
|
80
|
+
- New Galician, Breton and Tajik locales, a Bulgarian range separator, and localized aria labels in 12 more locales ([#3137](https://github.com/flatpickr/flatpickr/pull/3137), [#3088](https://github.com/flatpickr/flatpickr/pull/3088), [#3106](https://github.com/flatpickr/flatpickr/pull/3106), [#3081](https://github.com/flatpickr/flatpickr/pull/3081), [#3131](https://github.com/flatpickr/flatpickr/pull/3131), [#3079](https://github.com/flatpickr/flatpickr/pull/3079))
|
|
81
|
+
|
|
82
|
+
Behavior changes to check when upgrading:
|
|
83
|
+
|
|
84
|
+
- Enter no longer fires `onChange` for an unchanged value, and typed times are held within `minTime`/`maxTime`.
|
|
85
|
+
- `fp.isMobile` isn't set yet while plugin factories run; read it in a hook. Options a plugin returns (such as `disableMobile`) now decide whether the native mobile input is used.
|
|
86
|
+
- With `noCalendar`, a format with a month but no day (e.g. `m/Y`) lands on the 1st.
|
|
87
|
+
- A selected date that is disabled carries the `selected` class next to `flatpickr-disabled`.
|
|
88
|
+
- A calendar that fits neither above nor below its input may cover it, and shows no arrow.
|
|
89
|
+
- Listeners a page adds to the document after creating the picker and before opening it now run before flatpickr's.
|
|
90
|
+
- The month dropdown, year and time inputs have ids (`flatpickr-<n>-month`, `-year-<i>`, `-hour`, `-minute`, `-second`), which changes DOM snapshots.
|
|
91
|
+
|
|
92
|
+
### 4.7.0 – 4.7.2
|
|
93
|
+
|
|
45
94
|
- Elements from another window or an iframe are now supported ([#3138](https://github.com/flatpickr/flatpickr/issues/3138), [#3096](https://github.com/flatpickr/flatpickr/issues/3096))
|
|
46
95
|
- Removed a dead `Event.path` check in the outside-click handler ([#2766](https://github.com/flatpickr/flatpickr/issues/2766))
|
|
47
96
|
- The calendar is now positioned correctly when `appendTo` is a positioned element, such as a container inside shadow DOM, a fixed or transformed modal, or a scrolling container ([#1024](https://github.com/flatpickr/flatpickr/issues/1024), [#2362](https://github.com/flatpickr/flatpickr/pull/2362))
|
|
@@ -88,6 +137,10 @@ Framework addons (they depend on the `flatpickr` package, so use the alias above
|
|
|
88
137
|
* [vue-flatpickr component](https://github.com/ankurk91/vue-flatpickr-component)
|
|
89
138
|
* [lit-flatpickr component](https://github.com/Matsuuu/lit-flatpickr)
|
|
90
139
|
|
|
140
|
+
### Options are trusted
|
|
141
|
+
|
|
142
|
+
A few options are inserted into the calendar as HTML, not text: `prevArrow`, `nextArrow`, what `getWeek` returns, the locale's short weekday names, 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
|
+
|
|
91
144
|
|
|
92
145
|
## Contributing
|
|
93
146
|
|