@3mo/date-time-fields 0.17.0 โ†’ 0.17.1

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/README.md +443 -0
  3. package/dist/FieldDateTimePrecision.d.ts +1 -1
  4. package/dist/custom-elements.json +121 -2702
  5. package/dist/date-time/FieldDate.d.ts +6 -0
  6. package/dist/date-time/FieldDate.d.ts.map +1 -1
  7. package/dist/date-time/FieldDate.js +6 -0
  8. package/dist/date-time/FieldDateTime.d.ts +6 -0
  9. package/dist/date-time/FieldDateTime.d.ts.map +1 -1
  10. package/dist/date-time/FieldDateTime.js +6 -0
  11. package/dist/date-time/FieldDateTimeBase.d.ts +1 -1
  12. package/dist/date-time/FieldDateTimeBase.d.ts.map +1 -1
  13. package/dist/date-time/FieldDateTimeController.d.ts +3 -3
  14. package/dist/date-time/FieldDateTimeController.d.ts.map +1 -1
  15. package/dist/date-time/FieldDateTimeControllerBase.d.ts +3 -3
  16. package/dist/date-time/FieldDateTimeControllerBase.d.ts.map +1 -1
  17. package/dist/date-time-range/DateRangeParser.d.ts +1 -1
  18. package/dist/date-time-range/DateRangeParser.d.ts.map +1 -1
  19. package/dist/date-time-range/FieldDateRange.d.ts +9 -1
  20. package/dist/date-time-range/FieldDateRange.d.ts.map +1 -1
  21. package/dist/date-time-range/FieldDateRange.js +9 -1
  22. package/dist/date-time-range/FieldDateTimeRange.d.ts +9 -1
  23. package/dist/date-time-range/FieldDateTimeRange.d.ts.map +1 -1
  24. package/dist/date-time-range/FieldDateTimeRange.js +9 -1
  25. package/dist/date-time-range/FieldDateTimeRangeController.d.ts +3 -3
  26. package/dist/date-time-range/FieldDateTimeRangeController.d.ts.map +1 -1
  27. package/dist/dateTimeConverter.d.ts +1 -1
  28. package/dist/dateTimeConverter.d.ts.map +1 -1
  29. package/dist/segments/DateTimeSegmenter.d.ts +1 -1
  30. package/dist/segments/DateTimeSegmentsController.d.ts +1 -1
  31. package/dist/segments/DateTimeSegmentsController.d.ts.map +1 -1
  32. package/dist/selection/Calendar.d.ts +2 -2
  33. package/dist/selection/Calendar.d.ts.map +1 -1
  34. package/dist/selection/CalendarDatesController.d.ts +5 -5
  35. package/dist/selection/CalendarDatesController.d.ts.map +1 -1
  36. package/dist/time/FieldTime.d.ts +6 -4
  37. package/dist/time/FieldTime.d.ts.map +1 -1
  38. package/dist/time/FieldTime.js +5 -3
  39. package/dist/time/FieldTimeController.d.ts +2 -2
  40. package/dist/time/FieldTimeController.d.ts.map +1 -1
  41. package/package.json +15 -8
  42. package/dist/tsconfig.tsbuildinfo +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,113 @@
1
+ ## 0.17.1 (2026-09-27)
2
+ - **๐Ÿงน Chore**: Ship the README and declare shared packages as peer dependencies ([cef5987](https://github.com/3mo-esolutions/web-components/commit/cef5987de36b0d7f97445aa9c25fc09ae5330aa1))
3
+
4
+ ## 0.17.0 (2026-09-23)
5
+ - **๐Ÿš€ Feature**: Segmented date, date-time, date-range, and date-time-range fields ([109029d](https://github.com/3mo-esolutions/web-components/commit/109029dee38435bd2af1eb1b3546364dc9bacb1e))
6
+
7
+ ## 0.16.1 (2026-09-23)
8
+ - **๐Ÿงน Chore**: Add the time field controller ([4d80137](https://github.com/3mo-esolutions/web-components/commit/4d8013719c70206b0865b4c99a0bccb99a533c8e))
9
+
10
+ ## 0.16.0 (2026-09-23)
11
+ - **๐Ÿš€ Feature**: Segmented time fields ([daf05d6](https://github.com/3mo-esolutions/web-components/commit/daf05d66160fdeaf9a5d63b166f3ed896857f7cc))
12
+
13
+ ## 0.15.1 (2026-08-26)
14
+ - **๐Ÿ› Fix**: Rebuild the calendar when the language changes ([440ac56](https://github.com/3mo-esolutions/web-components/commit/440ac56956712c680a493225bb94167a46ab85ad))
15
+
16
+ ## 0.15.0 (2026-05-04)
17
+ - **๐Ÿงน Chore**: Upgrade scroller to v0.5 ([dcfbeb1](https://github.com/3mo-esolutions/web-components/commit/dcfbeb1e25b9700048ed91f1d170c346aa509114))
18
+
19
+ ## 0.14.2 (2026-04-13)
20
+ - **๐Ÿ› Fix**: Improve default label based on the precision ([137cffc](https://github.com/3mo-esolutions/web-components/commit/137cffcdaa7a5bb8e036a4ccae2c105e185dcfe6))
21
+
22
+ ## 0.14.0 (2026-03-30)
23
+ - **๐Ÿš€ Feature**: Add `min`, `max`, and `dateDisabled` properties to allow limiting the selection ([66dcedf](https://github.com/3mo-esolutions/web-components/commit/66dcedfb38263f6613580c7cd177b15d019c15bf))
24
+
25
+ ## 0.13.0 (2025-10-08)
26
+ - **๐Ÿš€ Feature**: Add `week` precision ([30eb53f](https://github.com/3mo-esolutions/web-components/commit/30eb53f552fe25b2f400cfa4b2a85a1816f370e3))
27
+
28
+ ## 0.12.0 (2025-06-24)
29
+ - **๐Ÿš€ Feature**: Add presets to date-time fields ([9cfc75a](https://github.com/3mo-esolutions/web-components/commit/9cfc75a55013165aef550e573919e48834abdeb5))
30
+
31
+ ## 0.11.1 (2025-06-02)
32
+ - **๐Ÿš€ Feature**: Unified Calendar View (#120) ([b95a1d8](https://github.com/3mo-esolutions/web-components/commit/b95a1d84f75c872190fd4453d7032fbf92efba43))
33
+
34
+ ## 0.10.3 (2025-05-30)
35
+ - **๐Ÿ› Fix**: Fix changing the current language not leading to switching the default calendar ([b0d58cc](https://github.com/3mo-esolutions/web-components/commit/b0d58cc4636aaf257b402c01640d7537750f79df))
36
+
37
+ ## 0.10.2 (2025-05-26)
38
+ - **โšก๏ธ Performance Improvement**: Group calendar days by CSS (#119) ([f84c44a](https://github.com/3mo-esolutions/web-components/commit/f84c44ad8d6bab92f28495cb0f0cc64004b1fb5b))
39
+
40
+ ## 0.10.1 (2025-05-19)
41
+ - **๐Ÿ› ๏ธ Refactoring**: Refactor `FieldDateTimePrecision` (#118) ([cfae6b8](https://github.com/3mo-esolutions/web-components/commit/cfae6b81bc68df40e1e9af85c67b2a6ded92b8d4))
42
+
43
+ ## 0.9.1 (2025-04-25)
44
+ - **๐Ÿงน Chore**: Update popover dependency ([13e46c7](https://github.com/3mo-esolutions/web-components/commit/13e46c7bf7e1ea827707fbb44614c9d4acff2c2c))
45
+
46
+ ## 0.9.0 (2025-03-17)
47
+ - **๐Ÿš€ Feature**: Add selection preview for date-time-range fields ([b8a7108](https://github.com/3mo-esolutions/web-components/commit/b8a71089efdd7effdb56d240083eeb3db74e1cf2))
48
+
49
+ ## 0.8.0 (2025-02-09)
50
+ - **๐Ÿš€ Feature**: Add a clear icon-button when focused on a non-empty field ([2eba8bb](https://github.com/3mo-esolutions/web-components/commit/2eba8bb90a2bfc2f57de96e69f2455881d9c1363))
51
+
52
+ ## 0.7.0 (2025-01-20)
53
+ - **๐Ÿงน Chore**: Dispatch the `change` event on every change instead of when clicking outside ([7a1b919](https://github.com/3mo-esolutions/web-components/commit/7a1b9193f74220d4e80cc1b89f13e879ca95da39))
54
+
55
+ ## 0.6.0 (2024-10-19)
56
+ - **๐Ÿš€ Feature**: Improve navigation ergonomics (#100) ([1c3eaf4](https://github.com/3mo-esolutions/web-components/commit/1c3eaf45a175c3604d27ae71d2cbc412682ebc50))
57
+
58
+ ## 0.5.11 (2024-08-28)
59
+ - **๐Ÿš€ Feature**: Add default labels with translations ([89c7a1d](https://github.com/3mo-esolutions/web-components/commit/89c7a1de68bffd56ade2432539e1aabfa3bf20f6))
60
+
61
+ ## 0.5.9 (2024-08-27)
62
+ - **๐Ÿงน Chore**: Change the date-time elements' default font-size to 0.875rem ([b2700f3](https://github.com/3mo-esolutions/web-components/commit/b2700f33953d359e3a2ad265df507611d4e02c07))
63
+
64
+ ## 0.5.6 (2024-05-10)
65
+ - **๐Ÿ› Fix**: Fix calendar opening for disabled date-time fields ([ea65dad](https://github.com/3mo-esolutions/web-components/commit/ea65daded4dd0250c28779cb3c2cc3e7d7e0938e))
66
+
67
+ ## 0.5.5 (2024-04-23)
68
+ - **๐Ÿงน Chore**: More reliable popovers ([84ee80c](https://github.com/3mo-esolutions/web-components/commit/84ee80cad5511aad4d7b9558cdb39fe05b713a8b))
69
+
70
+ ## 0.5.4 (2024-04-22)
71
+ - **๐Ÿ› Fix**: Fix days not being selectable in Safari ([a455f59](https://github.com/3mo-esolutions/web-components/commit/a455f595c951b315743a35c24d48b2c8e13d3dba))
72
+
73
+ ## 0.5.1 (2024-03-11)
74
+ - **๐Ÿš€ Feature**: Add toggleable date-time-range field ([d4ea3d6](https://github.com/3mo-esolutions/web-components/commit/d4ea3d669482115662c2daf6535658d257aba7e5))
75
+
76
+ ## 0.4.1 (2024-02-14)
77
+ - **๐Ÿ› Fix**: Fix year list not scrolling into view (#25) ([0c187b7](https://github.com/3mo-esolutions/web-components/commit/0c187b7868a18ef38ae840eaf87926cda816b924))
78
+
79
+ ## 0.3.4 (2023-12-15)
80
+ - **๐Ÿ› Fix**: Hide placeholder in dense date-time fields ([f1df717](https://github.com/3mo-esolutions/web-components/commit/f1df7177095f0848d55d1b9eb6f2962195872d6f))
81
+
82
+ ## 0.3.3 (2023-11-17)
83
+ - **๐Ÿงน Chore**: Fix ESBuild's minimization not being able to handle method calls on literal numbers ([d3200df](https://github.com/3mo-esolutions/web-components/commit/d3200dfb558702330d3bdaf971b7a27b7fe037ff))
84
+
85
+ ## 0.3.1 (2023-11-09)
86
+ - **๐Ÿ› Fix**: Fix 31st of December not showing in the calendar ([7d9bf56](https://github.com/3mo-esolutions/web-components/commit/7d9bf56c2be13eb63cfd4e4a08e203873a3540ea))
87
+
88
+ ## 0.3.0 (2023-10-17)
89
+ - **๐Ÿงน Chore**: Rename `hideDatePicker` property to `pickerHidden` ([739a40c](https://github.com/3mo-esolutions/web-components/commit/739a40c012ad2e87b8ee55df0382a02c60773eea))
90
+
91
+ ## 0.2.1 (2023-09-25)
92
+ - **๐Ÿ› Fix**: Fix change event being fired without value changes sometimes ([5f3c66d](https://github.com/3mo-esolutions/web-components/commit/5f3c66dbd4b3d4c0341c1bd42b97ea81b8c624db))
93
+
94
+ ## 0.1.6 (2023-08-30)
95
+ - **๐Ÿงน Chore**: Non toggle calendar icon ([751dcae](https://github.com/3mo-esolutions/web-components/commit/751dcae02ed53ef861c523f382b596698e15db2c))
96
+
97
+ ## 0.1.3 (2023-08-09)
98
+ - **๐Ÿ› Fix**: Fix date-time-range field not supporting localization agnostic border radius ([98a263f](https://github.com/3mo-esolutions/web-components/commit/98a263f2af74f9314df0e45ca6ef2f43b0af7c7d))
99
+
100
+ ## 0.1.2 (2023-08-04)
101
+ - **๐Ÿš€ Feature**: Revamp date-time fields with support for time, precision, localization, support for other calendars, etc. ([af06c2b](https://github.com/3mo-esolutions/web-components/commit/af06c2bf75d29e3f892a7d793c3972ccb9789d94))
102
+
103
+ ## 0.0.15 (2023-05-26)
104
+ - **๐Ÿ› Fix**: Fixed popover to overcome boundary issues for now ([2ca97f7](https://github.com/3mo-esolutions/web-components/commit/2ca97f7fecb31ed5ad707330758e823699c0ba5a))
105
+
106
+ ## 0.0.13 (2023-05-13)
107
+ - **โšก๏ธ Performance Improvement**: Cache the rendering of calendar ([6597fab](https://github.com/3mo-esolutions/web-components/commit/6597fab67cd7d205a4f6665c08fa308e3762222c))
108
+
109
+ ## 0.0.8 (2023-05-11)
110
+ - **๐Ÿ› Fix**: Fix the menu of date-time fields ([6fe3994](https://github.com/3mo-esolutions/web-components/commit/6fe3994eabe786ec97b5134cb0424e13ebb20268))
111
+
112
+ ## 0.0.6 (2023-04-28)
113
+ - **๐Ÿ› Fix**: Fix popover staying open ([4545c50](https://github.com/3mo-esolutions/web-components/commit/4545c50130ba0a99e691e6dfda9128778d3d41f3))
package/README.md ADDED
@@ -0,0 +1,443 @@
1
+ # Date Time Fields
2
+
3
+ Web components for date, date-time, time and range fields with locale-aware segmented entry and a calendar picker.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@3mo/date-time-fields?style=flat-square&color=0077c8)](https://www.npmjs.com/package/@3mo/date-time-fields) [![Documentation](https://img.shields.io/badge/docs-storybook-ff4785?style=flat-square&logo=storybook&logoColor=white)](https://3mo-esolutions.github.io/web-components/?path=/docs/inputs-date-time-fields-date-field--overview)
6
+
7
+ `mo-field-date` โ€” A date field, typed into segments in the language's order or picked from a calendar, at the precision of a day, a week, a month or a year.
8
+
9
+ `mo-field-date-range` โ€” A date range field, with segments for each end and a calendar that picks the start and then the end.
10
+
11
+ `mo-field-date-time` โ€” A date and time field, typed into segments in the language's order or picked from a calendar and time lists.
12
+
13
+ Its behaviour is `FieldDateTimeController`, for a date field of another design.
14
+
15
+ `mo-field-date-time-range` โ€” A date and time range field, with segments for each end and a picker that edits one end at a time.
16
+
17
+ Its behaviour is `FieldDateTimeRangeController`, for a date range field of another design.
18
+
19
+ `mo-field-time` โ€” A time-of-day field whose value is the `HH:mm` string of a native time input, while its segments follow the language's clock.
20
+
21
+ Its behaviour is `FieldTimeController`, for a time field of another design.
22
+
23
+ ## Installation
24
+
25
+ ```sh
26
+ npm install @3mo/date-time-fields
27
+ ```
28
+
29
+ ```ts
30
+ import '@3mo/date-time-fields'
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ ```html
36
+ <mo-field-date label='Due date' precision='day'></mo-field-date>
37
+ ```
38
+
39
+ ## Examples
40
+
41
+ - [Keyboard](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-field--keyboard) โ€” Digits fill the segments, which move on when full; ArrowUp and ArrowDown step a unit and Alt+ArrowDown opens the calendar.
42
+ - [Shortcut Reference Date](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-field--shortcut-reference-date) โ€” Shortcuts count from `shortcutReferenceDate` instead of today: `+1` here is 16 January 2030.
43
+ - [Precisions](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-field--precisions) โ€” `precision` picks a year, a month, a week or a day.
44
+ - [Min And Max](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-field--min-and-max) โ€” Days outside `min` and `max` are disabled in the calendar, presets outside them are left out, and a typed one makes the field invalid.
45
+ - [Date Disabled](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-field--date-disabled) โ€” `dateDisabled` refuses the dates it returns `true` for, here weekends.
46
+ - [Picker Hidden](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-field--picker-hidden) โ€” `pickerHidden` removes the calendar, leaving the segments to type into.
47
+ - [States](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-field--states) โ€” A required field turns invalid once left empty; a disabled one ignores input, a readonly one only shows its value, and a dense one is shorter.
48
+
49
+ ### Date Range Field
50
+
51
+ - [Default](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-range-field--default)
52
+ - [Keyboard](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-range-field--keyboard) โ€” Each end has its own segments, and the arrow keys cross between them.
53
+ - [Value](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-range-field--value) โ€” `value` is a `DateTimeRange`, and either end may be left open.
54
+ - [Precisions](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-range-field--precisions) โ€” At `month` or `year` precision each end is a whole month or year, and the presets offer only ranges of those.
55
+ - [Date Disabled](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-range-field--date-disabled) โ€” `dateDisabled` refuses the dates it returns `true` for, here weekends, at either end.
56
+ - [States](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-range-field--states) โ€” A required field turns invalid once left empty; a disabled one ignores input and a readonly one only shows its value.
57
+
58
+ ### Date Time Field
59
+
60
+ - [Default](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-time-field--default)
61
+ - [Precisions](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-time-field--precisions) โ€” Beyond the day, `precision` adds the hour, the minute or the second; the picker shows a list per unit beside the calendar.
62
+ - [Hour Cycle](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-time-field--hour-cycle) โ€” The time follows the language's clock unless `hourCycle` sets one: `h12` with AM and PM, or `h23`.
63
+ - [Date Disabled](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-time-field--date-disabled) โ€” `dateDisabled` refuses the dates it returns `true` for, here weekends.
64
+ - [Custom Date Time Field](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-time-field--custom-date-time-field) โ€” `FieldDateTimeController` carries everything the field does - the segments, the picker, the presets, `min`, `max` and the validity - so a date field of another design only renders it.
65
+
66
+ ### Date Time Range Field
67
+
68
+ - [Default](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-time-range-field--default)
69
+ - [Value](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-time-range-field--value) โ€” The picker edits one end at a time, chosen by its tabs or by entering that end's segments.
70
+ - [Date Disabled](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-time-range-field--date-disabled) โ€” `dateDisabled` refuses the dates it returns `true` for, here weekends, at either end.
71
+ - [Custom Range Field](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-date-time-range-field--custom-range-field) โ€” `FieldDateTimeRangeController` carries everything the field does - a group of segments per end, the end the picker edits, range shortcuts, the presets and the validity - so a range field of another design only renders it.
72
+
73
+ ### Time Field
74
+
75
+ - [Default](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-time-field--default)
76
+ - [Value](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-time-field--value) โ€” `value` is the 24-hour `HH:mm` string of a native time input, while the segments follow the language's clock - switch the language to see it.
77
+ - [Seconds](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-time-field--seconds) โ€” `precision='second'` adds the seconds, and the value becomes `HH:mm:ss`.
78
+ - [Hour Cycle](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-time-field--hour-cycle) โ€” `hourCycle` sets the clock regardless of the language: `h12` with AM and PM, or `h23`.
79
+ - [Picker Hidden](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-time-field--picker-hidden) โ€” `pickerHidden` removes the hour and minute lists, leaving the segments to type into.
80
+ - [Custom Time Field](https://3mo-esolutions.github.io/web-components/?path=/story/inputs-date-time-fields-time-field--custom-time-field) โ€” `FieldTimeController` carries everything the field does - the segments, the `HH:mm` value, the picker key and the validity - so a time field of another design only renders it.
81
+
82
+ ## Accessibility
83
+
84
+ The segments follow the [segmented input](https://3mo-esolutions.github.io/web-components/?path=/docs/behaviors-segmented-input--overview): a `group` named after the `label`, with one `spinbutton` per part, and one tab stop for the group. `aria-invalid`, `aria-required` and `aria-readonly` follow the field.
85
+ `Alt` `ArrowDown` opens the picker. The picker's calendar cannot be operated with the keyboard yet, so the segments are the keyboard's way in.
86
+
87
+ ## API
88
+
89
+ ### `mo-field-date`
90
+
91
+ #### Properties
92
+
93
+ | Name | Attribute | Type | Default | Description |
94
+ | --- | --- | --- | --- | --- |
95
+ | `controller` | | `FieldDateTimeController<this>` | | The field's behaviour, for a date field of another design. |
96
+ | `open` | `open` | `boolean` | `false` | Whether the date picker is open |
97
+ | `pickerHidden` | `pickerHidden` | `boolean` | `false` | Hide the date picker |
98
+ | `dense` | `dense` | `boolean` | `false` | Whether the field is dense |
99
+ | `shortcutReferenceDate` | `shortcutReferenceDate` | `DateTime` | `"new DateTime()"` | The date to use as a reference for shortcuts and for the units the user leaves out |
100
+ | `precision` | `precision` | `FieldDateTimePrecision` | `"Day"` | The precision of the date picker. Defaults to 'minute' |
101
+ | `hourCycle` | `hourCycle` | `HourCycle \| undefined` | | The hour cycle of the time segments ('h11', 'h12', 'h23' or 'h24'). Defaults to the language's convention. |
102
+ | `min` | `min` | `DateTime \| undefined` | | The minimum selectable date (inclusive). Dates before this are disabled. |
103
+ | `max` | `max` | `DateTime \| undefined` | | The maximum selectable date (inclusive). Dates after this are disabled. |
104
+ | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean. |
105
+ | `value` | `value` | `Date \| undefined` | | The field's value |
106
+ | `label` | `label` | `string` | `""` | The field's label |
107
+ | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
108
+ | `disabled` | `disabled` | `boolean` | `false` | Whether the field is disabled |
109
+ | `required` | `required` | `boolean` | `false` | Whether the field is required |
110
+
111
+ #### Events
112
+
113
+ | Name | Detail | Description |
114
+ | --- | --- | --- |
115
+ | `change` | `T \| undefined` | Dispatched with the value when the user commits it |
116
+ | `input` | `T \| undefined` | Dispatched with the value while the user edits it |
117
+ | `validityChange` | `boolean` | Dispatched with whether the value is valid, after every validation |
118
+
119
+ #### Slots
120
+
121
+ | Name | Description |
122
+ | --- | --- |
123
+ | (default) | The field's content |
124
+ | `start` | Content to be placed at the start of the field |
125
+ | `end` | Content to be placed at the end of the field |
126
+
127
+ #### CSS parts
128
+
129
+ | Name | Description |
130
+ | --- | --- |
131
+ | `segments` | The group of segments making up one date-time value |
132
+ | `segment` | An editable unit of the value |
133
+ | `literal` | A separator between the units |
134
+ | `container` | Field's container |
135
+
136
+ ### `mo-field-date-range`
137
+
138
+ #### Properties
139
+
140
+ | Name | Attribute | Type | Default | Description |
141
+ | --- | --- | --- | --- | --- |
142
+ | `controller` | | `FieldDateTimeRangeController<this>` | | The field's behaviour, for a date field of another design. |
143
+ | `open` | `open` | `boolean` | `false` | Whether the date picker is open |
144
+ | `pickerHidden` | `pickerHidden` | `boolean` | `false` | Hide the date picker |
145
+ | `dense` | `dense` | `boolean` | `false` | Whether the field is dense |
146
+ | `shortcutReferenceDate` | `shortcutReferenceDate` | `DateTime` | `"new DateTime()"` | The date to use as a reference for shortcuts and for the units the user leaves out |
147
+ | `precision` | `precision` | `FieldDateTimePrecision` | `"Day"` | The precision of the date picker. Defaults to 'minute' |
148
+ | `hourCycle` | `hourCycle` | `HourCycle \| undefined` | | The hour cycle of the time segments ('h11', 'h12', 'h23' or 'h24'). Defaults to the language's convention. |
149
+ | `min` | `min` | `DateTime \| undefined` | | The minimum selectable date (inclusive). Dates before this are disabled. |
150
+ | `max` | `max` | `DateTime \| undefined` | | The maximum selectable date (inclusive). Dates after this are disabled. |
151
+ | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean. |
152
+ | `value` | `value` | `DateTimeRange \| undefined` | | The selected date range. |
153
+ | `label` | `label` | `string` | `""` | The field's label |
154
+ | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
155
+ | `disabled` | `disabled` | `boolean` | `false` | Whether the field is disabled |
156
+ | `required` | `required` | `boolean` | `false` | Whether the field is required |
157
+
158
+ #### Events
159
+
160
+ | Name | Detail | Description |
161
+ | --- | --- | --- |
162
+ | `change` | `T \| undefined` | Dispatched with the value when the user commits it |
163
+ | `input` | `T \| undefined` | Dispatched with the value while the user edits it |
164
+ | `validityChange` | `boolean` | Dispatched with whether the value is valid, after every validation |
165
+
166
+ #### Slots
167
+
168
+ | Name | Description |
169
+ | --- | --- |
170
+ | (default) | The field's content |
171
+ | `start` | Content to be placed at the start of the field |
172
+ | `end` | Content to be placed at the end of the field |
173
+
174
+ #### CSS parts
175
+
176
+ | Name | Description |
177
+ | --- | --- |
178
+ | `segments-range` | Both ends' segments and the delimiter between them |
179
+ | `segments` | The group of segments making up one date-time value |
180
+ | `segment` | An editable unit of the value |
181
+ | `literal` | A separator between the units |
182
+ | `container` | Field's container |
183
+
184
+ ### `mo-field-date-time`
185
+
186
+ #### Properties
187
+
188
+ | Name | Attribute | Type | Default | Description |
189
+ | --- | --- | --- | --- | --- |
190
+ | `controller` | | `FieldDateTimeController<this>` | | The field's behaviour, for a date field of another design. |
191
+ | `open` | `open` | `boolean` | `false` | Whether the date picker is open |
192
+ | `pickerHidden` | `pickerHidden` | `boolean` | `false` | Hide the date picker |
193
+ | `dense` | `dense` | `boolean` | `false` | Whether the field is dense |
194
+ | `shortcutReferenceDate` | `shortcutReferenceDate` | `DateTime` | `"new DateTime()"` | The date to use as a reference for shortcuts and for the units the user leaves out |
195
+ | `precision` | `precision` | `FieldDateTimePrecision` | `"Minute"` | The precision of the date picker. Defaults to 'minute' |
196
+ | `hourCycle` | `hourCycle` | `HourCycle \| undefined` | | The hour cycle of the time segments ('h11', 'h12', 'h23' or 'h24'). Defaults to the language's convention. |
197
+ | `min` | `min` | `DateTime \| undefined` | | The minimum selectable date (inclusive). Dates before this are disabled. |
198
+ | `max` | `max` | `DateTime \| undefined` | | The maximum selectable date (inclusive). Dates after this are disabled. |
199
+ | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean. |
200
+ | `value` | `value` | `Date \| undefined` | | The field's value |
201
+ | `label` | `label` | `string` | `""` | The field's label |
202
+ | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
203
+ | `disabled` | `disabled` | `boolean` | `false` | Whether the field is disabled |
204
+ | `required` | `required` | `boolean` | `false` | Whether the field is required |
205
+
206
+ #### Events
207
+
208
+ | Name | Detail | Description |
209
+ | --- | --- | --- |
210
+ | `change` | `T \| undefined` | Dispatched with the value when the user commits it |
211
+ | `input` | `T \| undefined` | Dispatched with the value while the user edits it |
212
+ | `validityChange` | `boolean` | Dispatched with whether the value is valid, after every validation |
213
+
214
+ #### Slots
215
+
216
+ | Name | Description |
217
+ | --- | --- |
218
+ | (default) | The field's content |
219
+ | `start` | Content to be placed at the start of the field |
220
+ | `end` | Content to be placed at the end of the field |
221
+
222
+ #### CSS parts
223
+
224
+ | Name | Description |
225
+ | --- | --- |
226
+ | `segments` | The group of segments making up one date-time value |
227
+ | `segment` | An editable unit of the value |
228
+ | `literal` | A separator between the units |
229
+ | `container` | Field's container |
230
+
231
+ ### `mo-field-date-time-range`
232
+
233
+ #### Properties
234
+
235
+ | Name | Attribute | Type | Default | Description |
236
+ | --- | --- | --- | --- | --- |
237
+ | `controller` | | `FieldDateTimeRangeController<this>` | | The field's behaviour, for a date field of another design. |
238
+ | `open` | `open` | `boolean` | `false` | Whether the date picker is open |
239
+ | `pickerHidden` | `pickerHidden` | `boolean` | `false` | Hide the date picker |
240
+ | `dense` | `dense` | `boolean` | `false` | Whether the field is dense |
241
+ | `shortcutReferenceDate` | `shortcutReferenceDate` | `DateTime` | `"new DateTime()"` | The date to use as a reference for shortcuts and for the units the user leaves out |
242
+ | `precision` | `precision` | `FieldDateTimePrecision` | `"Minute"` | The precision of the date picker. Defaults to 'minute' |
243
+ | `hourCycle` | `hourCycle` | `HourCycle \| undefined` | | The hour cycle of the time segments ('h11', 'h12', 'h23' or 'h24'). Defaults to the language's convention. |
244
+ | `min` | `min` | `DateTime \| undefined` | | The minimum selectable date (inclusive). Dates before this are disabled. |
245
+ | `max` | `max` | `DateTime \| undefined` | | The maximum selectable date (inclusive). Dates after this are disabled. |
246
+ | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean. |
247
+ | `value` | `value` | `DateTimeRange \| undefined` | | The selected date range. |
248
+ | `label` | `label` | `string` | `""` | The field's label |
249
+ | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
250
+ | `disabled` | `disabled` | `boolean` | `false` | Whether the field is disabled |
251
+ | `required` | `required` | `boolean` | `false` | Whether the field is required |
252
+
253
+ #### Events
254
+
255
+ | Name | Detail | Description |
256
+ | --- | --- | --- |
257
+ | `change` | `T \| undefined` | Dispatched with the value when the user commits it |
258
+ | `input` | `T \| undefined` | Dispatched with the value while the user edits it |
259
+ | `validityChange` | `boolean` | Dispatched with whether the value is valid, after every validation |
260
+
261
+ #### Slots
262
+
263
+ | Name | Description |
264
+ | --- | --- |
265
+ | (default) | The field's content |
266
+ | `start` | Content to be placed at the start of the field |
267
+ | `end` | Content to be placed at the end of the field |
268
+
269
+ #### CSS parts
270
+
271
+ | Name | Description |
272
+ | --- | --- |
273
+ | `segments-range` | Both ends' segments and the delimiter between them |
274
+ | `segments` | The group of segments making up one date-time value |
275
+ | `segment` | An editable unit of the value |
276
+ | `literal` | A separator between the units |
277
+ | `container` | Field's container |
278
+
279
+ ### `mo-field-time`
280
+
281
+ #### Properties
282
+
283
+ | Name | Attribute | Type | Default | Description |
284
+ | --- | --- | --- | --- | --- |
285
+ | `open` | `open` | `boolean` | `false` | Whether the time picker is open |
286
+ | `pickerHidden` | `pickerHidden` | `boolean` | `false` | Hide the time picker |
287
+ | `dense` | `dense` | `boolean` | `false` | Whether the field is dense |
288
+ | `precision` | `precision` | `FieldDateTimePrecision` | `"Minute"` | 'minute' (default) or 'second' |
289
+ | `hourCycle` | `hourCycle` | `HourCycle \| undefined` | | The hour cycle of the segments ('h11', 'h12', 'h23' or 'h24'). Defaults to the language's convention. |
290
+ | `shortcutReferenceDate` | `shortcutReferenceDate` | `DateTime` | `"new DateTime()"` | The date the units the user leaves out are taken from. Defaults to now. |
291
+ | `value` | `value` | `string \| undefined` | | The time as `HH:mm` or `HH:mm:ss` |
292
+ | `label` | `label` | `string` | `"t('Time')"` | The field's label |
293
+ | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
294
+ | `disabled` | `disabled` | `boolean` | `false` | Whether the field is disabled |
295
+ | `required` | `required` | `boolean` | `false` | Whether the field is required |
296
+
297
+ #### Events
298
+
299
+ | Name | Detail | Description |
300
+ | --- | --- | --- |
301
+ | `change` | `T \| undefined` | Dispatched with the value when the user commits it |
302
+ | `input` | `T \| undefined` | Dispatched with the value while the user edits it |
303
+ | `validityChange` | `boolean` | Dispatched with whether the value is valid, after every validation |
304
+
305
+ #### Slots
306
+
307
+ | Name | Description |
308
+ | --- | --- |
309
+ | (default) | The field's content |
310
+ | `start` | Content to be placed at the start of the field |
311
+ | `end` | Content to be placed at the end of the field |
312
+
313
+ #### CSS parts
314
+
315
+ | Name | Description |
316
+ | --- | --- |
317
+ | `segments` | The group of segments making up the time |
318
+ | `segment` | An editable unit of the time |
319
+ | `literal` | A separator between the units |
320
+ | `container` | Field's container |
321
+
322
+ ### `mo-field-toggleable-date-time-range`
323
+
324
+ #### Properties
325
+
326
+ | Name | Attribute | Type | Default | Description |
327
+ | --- | --- | --- | --- | --- |
328
+ | `controller` | | `FieldDateTimeRangeController<this>` | | The field's behaviour, for a date field of another design. |
329
+ | `open` | `open` | `boolean` | `false` | Whether the date picker is open |
330
+ | `pickerHidden` | `pickerHidden` | `boolean` | `false` | Hide the date picker |
331
+ | `dense` | `dense` | `boolean` | `false` | Whether the field is dense |
332
+ | `shortcutReferenceDate` | `shortcutReferenceDate` | `DateTime` | `"new DateTime()"` | The date to use as a reference for shortcuts and for the units the user leaves out |
333
+ | `precision` | `precision` | `FieldDateTimePrecision` | `"Day"` | The precision of the date picker. Defaults to 'minute' |
334
+ | `hourCycle` | `hourCycle` | `HourCycle \| undefined` | | The hour cycle of the time segments ('h11', 'h12', 'h23' or 'h24'). Defaults to the language's convention. |
335
+ | `min` | `min` | `DateTime \| undefined` | | The minimum selectable date (inclusive). Dates before this are disabled. |
336
+ | `max` | `max` | `DateTime \| undefined` | | The maximum selectable date (inclusive). Dates after this are disabled. |
337
+ | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | | A function that determines whether a date should be disabled. Receives a DateTime object and should return a boolean. |
338
+ | `value` | `value` | `DateTimeRange \| undefined` | | The selected date range. |
339
+ | `label` | `label` | `string` | `""` | The field's label |
340
+ | `readonly` | `readonly` | `boolean` | `false` | Whether the field is readonly |
341
+ | `disabled` | `disabled` | `boolean` | `false` | Whether the field is disabled |
342
+ | `required` | `required` | `boolean` | `false` | Whether the field is required |
343
+
344
+ #### Events
345
+
346
+ | Name | Detail | Description |
347
+ | --- | --- | --- |
348
+ | `change` | `T \| undefined` | Dispatched with the value when the user commits it |
349
+ | `input` | `T \| undefined` | Dispatched with the value while the user edits it |
350
+ | `validityChange` | `boolean` | Dispatched with whether the value is valid, after every validation |
351
+
352
+ #### Slots
353
+
354
+ | Name | Description |
355
+ | --- | --- |
356
+ | (default) | The field's content |
357
+ | `start` | Content to be placed at the start of the field |
358
+ | `end` | Content to be placed at the end of the field |
359
+
360
+ #### CSS parts
361
+
362
+ | Name | Description |
363
+ | --- | --- |
364
+ | `segments-range` | Both ends' segments and the delimiter between them |
365
+ | `segments` | The group of segments making up one date-time value |
366
+ | `segment` | An editable unit of the value |
367
+ | `literal` | A separator between the units |
368
+ | `container` | Field's container |
369
+
370
+ ### `mo-calendar`
371
+
372
+ #### Properties
373
+
374
+ | Name | Attribute | Type | Default |
375
+ | --- | --- | --- | --- |
376
+ | `value` | `value` | `DateTimeRange \| undefined` | |
377
+ | `precision` | `precision` | `FieldDateTimePrecision` | |
378
+ | `includeWeek` | `includeWeek` | `boolean` | `false` |
379
+ | `min` | `min` | `DateTime \| undefined` | |
380
+ | `max` | `max` | `DateTime \| undefined` | |
381
+ | `dateDisabled` | `dateDisabled` | `((date: DateTime) => boolean) \| undefined` | |
382
+
383
+ #### Events
384
+
385
+ | Name | Detail | Description |
386
+ | --- | --- | --- |
387
+ | `dateClick` | `DateTime` | Dispatched when a date is clicked, with the clicked date as detail. |
388
+
389
+ ### `mo-hour-list`
390
+
391
+ #### Properties
392
+
393
+ | Name | Attribute | Type | Default | Description |
394
+ | --- | --- | --- | --- | --- |
395
+ | `hourCycle` | `hourCycle` | `"h11" \| "h12" \| "h23" \| "h24" \| undefined` | | Defaults to the language's convention, so English lists "02 PM" where German lists "14". |
396
+ | `navigationDate` | `navigationDate` | `DateTime` | | |
397
+ | `value` | `value` | `DateTime \| undefined` | | |
398
+
399
+ #### Events
400
+
401
+ | Name | Detail |
402
+ | --- | --- |
403
+ | `navigate` | `DateTime` |
404
+
405
+ ### `mo-minute-list`
406
+
407
+ #### Properties
408
+
409
+ | Name | Attribute | Type | Default |
410
+ | --- | --- | --- | --- |
411
+ | `navigationDate` | `navigationDate` | `DateTime` | |
412
+ | `value` | `value` | `DateTime \| undefined` | |
413
+
414
+ #### Events
415
+
416
+ | Name | Detail |
417
+ | --- | --- |
418
+ | `navigate` | `DateTime` |
419
+
420
+ ### `mo-second-list`
421
+
422
+ #### Properties
423
+
424
+ | Name | Attribute | Type | Default |
425
+ | --- | --- | --- | --- |
426
+ | `navigationDate` | `navigationDate` | `DateTime` | |
427
+ | `value` | `value` | `DateTime \| undefined` | |
428
+
429
+ #### Events
430
+
431
+ | Name | Detail |
432
+ | --- | --- |
433
+ | `navigate` | `DateTime` |
434
+
435
+ ## Links
436
+
437
+ - [Documentation](https://3mo-esolutions.github.io/web-components/?path=/docs/inputs-date-time-fields-date-field--overview)
438
+ - [Changelog](https://3mo-esolutions.github.io/web-components/?path=/docs/inputs-date-time-fields-date-field--overview)
439
+ - [Source](https://github.com/3mo-esolutions/web-components/tree/main/packages/DateTimeFields)
440
+
441
+ ## License
442
+
443
+ MIT ยฉ 3MO GmbH
@@ -14,7 +14,7 @@ export declare class FieldDateTimePrecision {
14
14
  static readonly Second: FieldDateTimePrecision;
15
15
  private constructor();
16
16
  get formatOptions(): Intl.DateTimeFormatOptions;
17
- getRange(date: DateTime): import("@3mo/date-time/DateTimeRange.js").DateTimeRange;
17
+ getRange(date: DateTime): import("@3mo/date-time").DateTimeRange;
18
18
  equals(left: DateTime, right: DateTime): boolean;
19
19
  isSmallerThan(left: DateTime, right: DateTime): boolean;
20
20
  valueOf(): number;