frontile 0.18.0 → 0.18.2

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 (155) hide show
  1. package/declarations/-private/get-config.d.ts.map +1 -1
  2. package/declarations/-private/timer.d.ts +3 -3
  3. package/declarations/-private/timer.d.ts.map +1 -1
  4. package/declarations/components/buttons/chip.d.ts +1 -1
  5. package/declarations/components/buttons/chip.d.ts.map +1 -1
  6. package/declarations/components/buttons/close-button.d.ts +2 -2
  7. package/declarations/components/buttons/close-button.d.ts.map +1 -1
  8. package/declarations/components/collections/listbox/item.d.ts +2 -2
  9. package/declarations/components/collections/listbox/item.d.ts.map +1 -1
  10. package/declarations/components/collections/simple-table/column.d.ts +6 -0
  11. package/declarations/components/collections/simple-table/column.d.ts.map +1 -1
  12. package/declarations/components/collections/simple-table/footer.d.ts +2 -1
  13. package/declarations/components/collections/simple-table/footer.d.ts.map +1 -1
  14. package/declarations/components/collections/simple-table/header.d.ts +2 -1
  15. package/declarations/components/collections/simple-table/header.d.ts.map +1 -1
  16. package/declarations/components/collections/simple-table/index.d.ts +1 -1
  17. package/declarations/components/collections/simple-table/index.d.ts.map +1 -1
  18. package/declarations/components/collections/table/checkbox.d.ts +1 -1
  19. package/declarations/components/collections/table/checkbox.d.ts.map +1 -1
  20. package/declarations/components/collections/table/column-visibility.d.ts +2 -2
  21. package/declarations/components/collections/table/column-visibility.d.ts.map +1 -1
  22. package/declarations/components/collections/table/table.d.ts +9 -7
  23. package/declarations/components/collections/table/table.d.ts.map +1 -1
  24. package/declarations/components/forms/autocomplete.d.ts +12 -12
  25. package/declarations/components/forms/checkbox.d.ts +2 -2
  26. package/declarations/components/forms/checkbox.d.ts.map +1 -1
  27. package/declarations/components/forms/date-input/clipboard.d.ts +34 -0
  28. package/declarations/components/forms/date-input/clipboard.d.ts.map +1 -0
  29. package/declarations/components/forms/date-input/date-input.d.ts +93 -0
  30. package/declarations/components/forms/date-input/date-input.d.ts.map +1 -0
  31. package/declarations/components/forms/date-input/segment-group.d.ts +132 -0
  32. package/declarations/components/forms/date-input/segment-group.d.ts.map +1 -0
  33. package/declarations/components/forms/date-input/segments.d.ts +163 -0
  34. package/declarations/components/forms/date-input/segments.d.ts.map +1 -0
  35. package/declarations/components/forms/date-input/types.d.ts +175 -0
  36. package/declarations/components/forms/date-input/types.d.ts.map +1 -0
  37. package/declarations/components/forms/date-input.d.ts +6 -0
  38. package/declarations/components/forms/date-input.d.ts.map +1 -0
  39. package/declarations/components/forms/date-picker/date-picker.d.ts +263 -15
  40. package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -1
  41. package/declarations/components/forms/date-picker/end-content.d.ts +33 -3
  42. package/declarations/components/forms/date-picker/end-content.d.ts.map +1 -1
  43. package/declarations/components/forms/date-picker/types.d.ts +45 -2
  44. package/declarations/components/forms/date-picker/types.d.ts.map +1 -1
  45. package/declarations/components/forms/date-picker/value.d.ts +21 -5
  46. package/declarations/components/forms/date-picker/value.d.ts.map +1 -1
  47. package/declarations/components/forms/field.d.ts +7 -5
  48. package/declarations/components/forms/field.d.ts.map +1 -1
  49. package/declarations/components/forms/form.d.ts +5 -5
  50. package/declarations/components/forms/form.d.ts.map +1 -1
  51. package/declarations/components/forms/index.d.ts +1 -0
  52. package/declarations/components/forms/index.d.ts.map +1 -1
  53. package/declarations/components/forms/input-otp.d.ts +5 -5
  54. package/declarations/components/forms/input-otp.d.ts.map +1 -1
  55. package/declarations/components/forms/input.d.ts +15 -15
  56. package/declarations/components/forms/input.d.ts.map +1 -1
  57. package/declarations/components/forms/native-select.d.ts +10 -10
  58. package/declarations/components/forms/native-select.d.ts.map +1 -1
  59. package/declarations/components/forms/radio.d.ts +2 -2
  60. package/declarations/components/forms/radio.d.ts.map +1 -1
  61. package/declarations/components/forms/select/select.d.ts +16 -16
  62. package/declarations/components/forms/textarea.d.ts +10 -10
  63. package/declarations/components/forms/textarea.d.ts.map +1 -1
  64. package/declarations/components/navigation/pagination/pagination.d.ts +32 -1
  65. package/declarations/components/navigation/pagination/pagination.d.ts.map +1 -1
  66. package/declarations/components/overlays/overlay.d.ts +4 -4
  67. package/declarations/components/overlays/overlay.d.ts.map +1 -1
  68. package/declarations/components/utilities/avatar.d.ts +35 -2
  69. package/declarations/components/utilities/avatar.d.ts.map +1 -1
  70. package/declarations/components/utilities/collapsible.d.ts +16 -0
  71. package/declarations/components/utilities/collapsible.d.ts.map +1 -1
  72. package/declarations/test-support.d.ts +30 -0
  73. package/declarations/test-support.d.ts.map +1 -1
  74. package/declarations/utils/forms-utils-index.d.ts +1 -1
  75. package/declarations/utils/forms-utils-index.d.ts.map +1 -1
  76. package/declarations/utils/nested-data.d.ts +17 -0
  77. package/declarations/utils/nested-data.d.ts.map +1 -1
  78. package/dist/components/buttons/chip.js.map +1 -1
  79. package/dist/components/buttons/close-button.js +5 -12
  80. package/dist/components/buttons/close-button.js.map +1 -1
  81. package/dist/components/collections/listbox/item.js +4 -11
  82. package/dist/components/collections/listbox/item.js.map +1 -1
  83. package/dist/components/collections/simple-table/column.js +2 -2
  84. package/dist/components/collections/simple-table/column.js.map +1 -1
  85. package/dist/components/collections/simple-table/footer.js +1 -1
  86. package/dist/components/collections/simple-table/footer.js.map +1 -1
  87. package/dist/components/collections/simple-table/header.js +1 -1
  88. package/dist/components/collections/simple-table/header.js.map +1 -1
  89. package/dist/components/collections/simple-table/index.js +1 -1
  90. package/dist/components/collections/simple-table/index.js.map +1 -1
  91. package/dist/components/collections/table/checkbox.js +2 -7
  92. package/dist/components/collections/table/checkbox.js.map +1 -1
  93. package/dist/components/collections/table/column-visibility.js +2 -7
  94. package/dist/components/collections/table/column-visibility.js.map +1 -1
  95. package/dist/components/forms/checkbox.js +4 -12
  96. package/dist/components/forms/checkbox.js.map +1 -1
  97. package/dist/components/forms/date-input/clipboard.js +231 -0
  98. package/dist/components/forms/date-input/clipboard.js.map +1 -0
  99. package/dist/components/forms/date-input/date-input.js +204 -0
  100. package/dist/components/forms/date-input/date-input.js.map +1 -0
  101. package/dist/components/forms/date-input/segment-group.js +292 -0
  102. package/dist/components/forms/date-input/segment-group.js.map +1 -0
  103. package/dist/components/forms/date-input/segments.js +562 -0
  104. package/dist/components/forms/date-input/segments.js.map +1 -0
  105. package/dist/components/forms/date-input/types.js +2 -0
  106. package/dist/components/forms/date-input/types.js.map +1 -0
  107. package/dist/components/forms/date-input.js +4 -0
  108. package/dist/components/forms/date-input.js.map +1 -0
  109. package/dist/components/forms/date-picker/date-picker.js +361 -20
  110. package/dist/components/forms/date-picker/date-picker.js.map +1 -1
  111. package/dist/components/forms/date-picker/end-content.js +17 -4
  112. package/dist/components/forms/date-picker/end-content.js.map +1 -1
  113. package/dist/components/forms/date-picker/value.js +44 -6
  114. package/dist/components/forms/date-picker/value.js.map +1 -1
  115. package/dist/components/forms/field.js +12 -20
  116. package/dist/components/forms/field.js.map +1 -1
  117. package/dist/components/forms/form.js +11 -27
  118. package/dist/components/forms/form.js.map +1 -1
  119. package/dist/components/forms/index.js +5 -2
  120. package/dist/components/forms/index.js.map +1 -1
  121. package/dist/components/forms/input-otp.js +10 -26
  122. package/dist/components/forms/input-otp.js.map +1 -1
  123. package/dist/components/forms/input.js +9 -22
  124. package/dist/components/forms/input.js.map +1 -1
  125. package/dist/components/forms/native-select.js +5 -12
  126. package/dist/components/forms/native-select.js.map +1 -1
  127. package/dist/components/forms/radio.js +4 -12
  128. package/dist/components/forms/radio.js.map +1 -1
  129. package/dist/components/forms/textarea.js +6 -17
  130. package/dist/components/forms/textarea.js.map +1 -1
  131. package/dist/components/navigation/pagination/pagination.js +18 -2
  132. package/dist/components/navigation/pagination/pagination.js.map +1 -1
  133. package/dist/components/notifications/index.js +1 -1
  134. package/dist/components/overlays/overlay.js +8 -21
  135. package/dist/components/overlays/overlay.js.map +1 -1
  136. package/dist/components/utilities/avatar.js +26 -5
  137. package/dist/components/utilities/avatar.js.map +1 -1
  138. package/dist/components/utilities/collapsible.js +47 -3
  139. package/dist/components/utilities/collapsible.js.map +1 -1
  140. package/dist/forms.js +5 -2
  141. package/dist/forms.js.map +1 -1
  142. package/dist/index.js +6 -3
  143. package/dist/index.js.map +1 -1
  144. package/dist/{manager-jDaRVZ5o.js → manager-Dge4r8Vn.js} +9 -19
  145. package/dist/manager-Dge4r8Vn.js.map +1 -0
  146. package/dist/notifications.js +1 -1
  147. package/dist/services/notifications.js +1 -1
  148. package/dist/test-support.js +903 -389
  149. package/dist/test-support.js.map +1 -1
  150. package/dist/utils/forms-utils-index.js +1 -1
  151. package/dist/utils/forms-utils-index.js.map +1 -1
  152. package/dist/utils/nested-data.js +28 -1
  153. package/dist/utils/nested-data.js.map +1 -1
  154. package/package.json +10 -10
  155. package/dist/manager-jDaRVZ5o.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { ControlBlurTracker } from '../../../-private/control-blur';
3
3
  import type { CalendarMode, CalendarValue } from '../../collections/calendar/types';
4
+ import type { Part, TimeOptions } from '../date-input/types';
4
5
  import type { DatePickerArgs, DatePickerValueBlockArg, DatePickerCalendarArgs, DatePickerFooterArg } from './types';
5
6
  interface DatePickerSignature<M extends CalendarMode = 'single'> {
6
7
  Args: DatePickerArgs<M>;
@@ -12,11 +13,15 @@ interface DatePickerSignature<M extends CalendarMode = 'single'> {
12
13
  Element: HTMLDivElement;
13
14
  }
14
15
  /**
15
- * A date field: a button trigger showing the formatted value, and a calendar
16
- * in a popover. `@mode="range"` switches both the calendar and the value shape
17
- * to a `{ start, end }` range.
16
+ * A date field: segments the value can be typed into, a calendar button that
17
+ * opens a calendar in a popover, and -- under `@isEditable={{false}}` -- the
18
+ * older button trigger showing the formatted value instead. `@mode="range"`
19
+ * switches both the calendar and the value shape to a `{ start, end }` range,
20
+ * and -- when editable -- renders two groups of segments with a separator
21
+ * between them.
18
22
  */
19
23
  declare class DatePicker<M extends CalendarMode = 'single'> extends Component<DatePickerSignature<M>> {
24
+ #private;
20
25
  triggerRef: import("../../utilities").Ref<HTMLButtonElement>;
21
26
  containerRef: import("../../utilities").Ref<HTMLElement>;
22
27
  /**
@@ -28,7 +33,47 @@ declare class DatePicker<M extends CalendarMode = 'single'> extends Component<Da
28
33
  */
29
34
  internalValue: CalendarValue<M> | null;
30
35
  isOpen: boolean;
36
+ /**
37
+ * The segments, on the editable path. They are not a second source of truth
38
+ * for the value -- {@link internalValue} is -- but they cannot be derived
39
+ * from it either: mid-entry they hold digits that compose to no date at all,
40
+ * which no `Date` can represent. The calendar writes here through
41
+ * {@link commitValue}; typing writes there through {@link handlePartsChange}.
42
+ */
43
+ private trackedParts;
44
+ /**
45
+ * The second group, in `@mode="range"` only. {@link trackedParts} is that
46
+ * mode's *start* group, so every path that writes one writes both.
47
+ */
48
+ private trackedEndParts;
31
49
  constructor(owner: unknown, args: DatePickerArgs<M>);
50
+ get parts(): Part[];
51
+ get endParts(): Part[];
52
+ private setParts;
53
+ private setEndParts;
54
+ /**
55
+ * Writes a value across the segments, whichever mode is in play.
56
+ *
57
+ * `onto` supplies the list each group is written into -- the current
58
+ * segments when a value moved, a freshly built row when the locale or the
59
+ * format changed. It is a function because range mode needs two independent
60
+ * lists and must not hand the same array to both groups.
61
+ */
62
+ private writeParts;
63
+ /** Whether the value is typed rather than only picked. */
64
+ get isSegmented(): boolean;
65
+ /**
66
+ * The format the segments are built from. The editable default is numeric;
67
+ * `{ dateStyle: 'medium' }` -- this component's own button default --
68
+ * renders "Jan" and has no numeric segment to type into, so a textual
69
+ * format falls back to the numeric default rather than rendering a field
70
+ * nobody can type in.
71
+ */
72
+ get segmentFormat(): Intl.DateTimeFormatOptions | undefined;
73
+ get placeholderValue(): Date;
74
+ /** The time segments the field adds to the date, if any. */
75
+ get timeOptions(): TimeOptions;
76
+ get hasTime(): boolean;
32
77
  get mode(): M;
33
78
  get locale(): string;
34
79
  /**
@@ -56,6 +101,19 @@ declare class DatePicker<M extends CalendarMode = 'single'> extends Component<Da
56
101
  };
57
102
  Element: HTMLDivElement;
58
103
  }>;
104
+ /**
105
+ * Rebuilds the segment order when the locale or format changes, carrying the
106
+ * current value across so switching en-US to en-GB reorders the field
107
+ * without emptying it. Reads no tracked state, so it runs on an argument
108
+ * change and never on a keystroke.
109
+ */
110
+ syncSegmentFormat: import("ember-modifier").FunctionBasedModifier<{
111
+ Args: {
112
+ Positional: [string, Intl.DateTimeFormatOptions | undefined, TimeOptions];
113
+ Named: import("ember-modifier/-private/signature").EmptyObject;
114
+ };
115
+ Element: HTMLDivElement;
116
+ }>;
59
117
  get formatted(): string;
60
118
  get isEmpty(): boolean;
61
119
  get valueBlockArg(): DatePickerValueBlockArg<M>;
@@ -97,13 +155,101 @@ declare class DatePicker<M extends CalendarMode = 'single'> extends Component<Da
97
155
  * away -- closing would just make them reopen it.
98
156
  */
99
157
  clear: () => void;
158
+ /**
159
+ * Whatever the field's own focusable thing is: the button trigger, or --
160
+ * when segmented -- the segment the user was last in, falling back to the
161
+ * first one. A recorded segment that has left the DOM is not one focus can
162
+ * go back to.
163
+ */
164
+ private focusTarget;
165
+ private focusField;
100
166
  /**
101
167
  * Whether the selection is finished, and the popover should therefore close.
102
168
  * A range with only its anchor set is not: the user still owes a second
103
169
  * click, and closing would throw away the half they just made.
104
170
  */
105
171
  private isComplete;
172
+ /**
173
+ * The one path a value change takes, whichever editor produced it.
174
+ *
175
+ * `writeParts` says whether the segments are that editor's output or its
176
+ * input. The calendar, the `:footer` block and the clear button are all
177
+ * *other* editors, and the segments have to be rewritten to show what they
178
+ * did. Typing is the segments themselves: rewriting them there would
179
+ * overwrite the buffer the user is still typing into, turning a half-typed
180
+ * year back into a padded one on every completed keystroke.
181
+ */
182
+ private commitValue;
106
183
  handleChange: (value: CalendarValue<M>) => void;
184
+ /**
185
+ * A day picked in the calendar. The calendar knows days only, so under an
186
+ * `hour` or `minute` granularity the pick takes the time the field already
187
+ * shows -- each end of a range its own -- or midnight when there is none.
188
+ */
189
+ handleCalendarChange: (value: CalendarValue<M>) => void;
190
+ /**
191
+ * The time one end of the field holds: what its segments show -- typed in
192
+ * even before any day was -- or, on the button trigger, which has no
193
+ * segments, the current value's. Midnight when there is none.
194
+ */
195
+ private timeAt;
196
+ /**
197
+ * Whether an incoming value differs from what the segments already compose.
198
+ *
199
+ * Compared edge by edge in range mode rather than by identity: the two are
200
+ * distinct objects on every report, so an object comparison would always
201
+ * say "changed" and defeat the guard entirely.
202
+ */
203
+ private segmentsWouldChange;
204
+ /**
205
+ * The segments changed. Only value *transitions* are reported: the four
206
+ * keystrokes that fill a month and a day compose no date at all, and report
207
+ * nothing. The popover is deliberately left alone -- typing never opened it,
208
+ * so completing a date by typing has nothing to close.
209
+ */
210
+ handlePartsChange: (parts: Part[]) => void;
211
+ /**
212
+ * The two range groups report separately, but a range is one value: each
213
+ * one recomposes the whole thing and reports only what moved.
214
+ */
215
+ handleStartParts: (parts: Part[]) => void;
216
+ handleEndParts: (parts: Part[]) => void;
217
+ /** Two dates pasted into the start group, which fill both. */
218
+ handleRangePaste: (start: Part[], end: Part[]) => void;
219
+ /**
220
+ * The range the two groups currently compose, or `null`.
221
+ *
222
+ * `DateRange.start` is a `Date`, not `Date | null`: a range is anchored at
223
+ * its start, and the half-open shape the calendar produces mid-selection is
224
+ * `{ start, end: null }` -- never the other way round. So segments that
225
+ * compose no start compose no range at all, however complete the end group
226
+ * is. That is what makes clearing the start report `null` rather than
227
+ * leaving a consumer holding a range the field no longer shows; the end's
228
+ * digits stay on screen, exactly as a half-typed single date's do.
229
+ */
230
+ private rangeFromParts;
231
+ /**
232
+ * Reports the range only if it moved, which is the single-mode contract
233
+ * applied to two ends: the keystrokes that fill a month and a day compose
234
+ * nothing and report nothing, and either end changing is a change.
235
+ */
236
+ private reportRange;
237
+ /**
238
+ * The start and end groups' accessible names. Two `role="group"`s cannot
239
+ * share one id or one name, and `FormControl`'s label can only be
240
+ * associated with one element -- so each group names itself, deriving from
241
+ * `@label` so that the visible label is contained in both names.
242
+ */
243
+ get startLabel(): string;
244
+ get endLabel(): string;
245
+ /**
246
+ * The segment that last held focus, so that closing the calendar can hand
247
+ * focus back to where the user was. Recorded from the group's `focusin`
248
+ * rather than captured when the popover opens, because the calendar button
249
+ * is clicked *after* focus has already left the segment.
250
+ */
251
+ private lastFocusedSegment;
252
+ handleSegmentFocusIn: (event: FocusEvent) => void;
107
253
  /**
108
254
  * Tells an enclosing `Form` the value moved.
109
255
  *
@@ -136,112 +282,214 @@ declare class DatePicker<M extends CalendarMode = 'single'> extends Component<Da
136
282
  get classes(): {
137
283
  base: (slotProps?: ({
138
284
  size?: "sm" | "md" | "lg" | undefined;
139
- endContentPointerEvents?: "none" | "auto" | undefined;
140
285
  hasStartContent?: boolean | undefined;
141
286
  hasEndContent?: boolean | undefined;
142
287
  hasChips?: boolean | undefined;
143
288
  startContentPointerEvents?: "none" | "auto" | undefined;
289
+ endContentPointerEvents?: "none" | "auto" | undefined;
290
+ isSegmented?: boolean | undefined;
291
+ isRange?: boolean | undefined;
144
292
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
145
293
  innerContainer: (slotProps?: ({
146
294
  size?: "sm" | "md" | "lg" | undefined;
147
- endContentPointerEvents?: "none" | "auto" | undefined;
148
295
  hasStartContent?: boolean | undefined;
149
296
  hasEndContent?: boolean | undefined;
150
297
  hasChips?: boolean | undefined;
151
298
  startContentPointerEvents?: "none" | "auto" | undefined;
299
+ endContentPointerEvents?: "none" | "auto" | undefined;
300
+ isSegmented?: boolean | undefined;
301
+ isRange?: boolean | undefined;
152
302
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
153
303
  startContent: (slotProps?: ({
154
304
  size?: "sm" | "md" | "lg" | undefined;
155
- endContentPointerEvents?: "none" | "auto" | undefined;
156
305
  hasStartContent?: boolean | undefined;
157
306
  hasEndContent?: boolean | undefined;
158
307
  hasChips?: boolean | undefined;
159
308
  startContentPointerEvents?: "none" | "auto" | undefined;
309
+ endContentPointerEvents?: "none" | "auto" | undefined;
310
+ isSegmented?: boolean | undefined;
311
+ isRange?: boolean | undefined;
160
312
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
161
313
  endContent: (slotProps?: ({
162
314
  size?: "sm" | "md" | "lg" | undefined;
163
- endContentPointerEvents?: "none" | "auto" | undefined;
164
315
  hasStartContent?: boolean | undefined;
165
316
  hasEndContent?: boolean | undefined;
166
317
  hasChips?: boolean | undefined;
167
318
  startContentPointerEvents?: "none" | "auto" | undefined;
319
+ endContentPointerEvents?: "none" | "auto" | undefined;
320
+ isSegmented?: boolean | undefined;
321
+ isRange?: boolean | undefined;
168
322
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
169
323
  input: (slotProps?: ({
170
324
  size?: "sm" | "md" | "lg" | undefined;
171
- endContentPointerEvents?: "none" | "auto" | undefined;
172
325
  hasStartContent?: boolean | undefined;
173
326
  hasEndContent?: boolean | undefined;
174
327
  hasChips?: boolean | undefined;
175
328
  startContentPointerEvents?: "none" | "auto" | undefined;
329
+ endContentPointerEvents?: "none" | "auto" | undefined;
330
+ isSegmented?: boolean | undefined;
331
+ isRange?: boolean | undefined;
176
332
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
177
333
  } & {
178
- base: (slotProps?: ({
334
+ separator: (slotProps?: ({
335
+ size?: "sm" | "md" | "lg" | undefined;
336
+ hasStartContent?: boolean | undefined;
337
+ hasEndContent?: boolean | undefined;
338
+ hasChips?: boolean | undefined;
339
+ startContentPointerEvents?: "none" | "auto" | undefined;
340
+ endContentPointerEvents?: "none" | "auto" | undefined;
341
+ isSegmented?: boolean | undefined;
342
+ isRange?: boolean | undefined;
343
+ } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
344
+ calendarButton: (slotProps?: ({
179
345
  size?: "sm" | "md" | "lg" | undefined;
346
+ hasStartContent?: boolean | undefined;
347
+ hasEndContent?: boolean | undefined;
348
+ hasChips?: boolean | undefined;
349
+ startContentPointerEvents?: "none" | "auto" | undefined;
180
350
  endContentPointerEvents?: "none" | "auto" | undefined;
351
+ isSegmented?: boolean | undefined;
352
+ isRange?: boolean | undefined;
353
+ } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
354
+ group: (slotProps?: ({
355
+ size?: "sm" | "md" | "lg" | undefined;
181
356
  hasStartContent?: boolean | undefined;
182
357
  hasEndContent?: boolean | undefined;
183
358
  hasChips?: boolean | undefined;
184
359
  startContentPointerEvents?: "none" | "auto" | undefined;
360
+ endContentPointerEvents?: "none" | "auto" | undefined;
361
+ isSegmented?: boolean | undefined;
362
+ isRange?: boolean | undefined;
185
363
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
186
- placeholder: (slotProps?: ({
364
+ segment: (slotProps?: ({
365
+ size?: "sm" | "md" | "lg" | undefined;
366
+ hasStartContent?: boolean | undefined;
367
+ hasEndContent?: boolean | undefined;
368
+ hasChips?: boolean | undefined;
369
+ startContentPointerEvents?: "none" | "auto" | undefined;
370
+ endContentPointerEvents?: "none" | "auto" | undefined;
371
+ isSegmented?: boolean | undefined;
372
+ isRange?: boolean | undefined;
373
+ } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
374
+ literal: (slotProps?: ({
187
375
  size?: "sm" | "md" | "lg" | undefined;
376
+ hasStartContent?: boolean | undefined;
377
+ hasEndContent?: boolean | undefined;
378
+ hasChips?: boolean | undefined;
379
+ startContentPointerEvents?: "none" | "auto" | undefined;
188
380
  endContentPointerEvents?: "none" | "auto" | undefined;
381
+ isSegmented?: boolean | undefined;
382
+ isRange?: boolean | undefined;
383
+ } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
384
+ base: (slotProps?: ({
385
+ size?: "sm" | "md" | "lg" | undefined;
189
386
  hasStartContent?: boolean | undefined;
190
387
  hasEndContent?: boolean | undefined;
191
388
  hasChips?: boolean | undefined;
192
389
  startContentPointerEvents?: "none" | "auto" | undefined;
390
+ endContentPointerEvents?: "none" | "auto" | undefined;
391
+ isSegmented?: boolean | undefined;
392
+ isRange?: boolean | undefined;
393
+ } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
394
+ placeholder: (slotProps?: ({
395
+ size?: "sm" | "md" | "lg" | undefined;
396
+ hasStartContent?: boolean | undefined;
397
+ hasEndContent?: boolean | undefined;
398
+ hasChips?: boolean | undefined;
399
+ startContentPointerEvents?: "none" | "auto" | undefined;
400
+ endContentPointerEvents?: "none" | "auto" | undefined;
401
+ isSegmented?: boolean | undefined;
402
+ isRange?: boolean | undefined;
193
403
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
194
404
  input: (slotProps?: ({
195
405
  size?: "sm" | "md" | "lg" | undefined;
406
+ hasStartContent?: boolean | undefined;
407
+ hasEndContent?: boolean | undefined;
408
+ hasChips?: boolean | undefined;
409
+ startContentPointerEvents?: "none" | "auto" | undefined;
196
410
  endContentPointerEvents?: "none" | "auto" | undefined;
411
+ isSegmented?: boolean | undefined;
412
+ isRange?: boolean | undefined;
413
+ } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
414
+ innerContainer: (slotProps?: ({
415
+ size?: "sm" | "md" | "lg" | undefined;
197
416
  hasStartContent?: boolean | undefined;
198
417
  hasEndContent?: boolean | undefined;
199
418
  hasChips?: boolean | undefined;
200
419
  startContentPointerEvents?: "none" | "auto" | undefined;
420
+ endContentPointerEvents?: "none" | "auto" | undefined;
421
+ isSegmented?: boolean | undefined;
422
+ isRange?: boolean | undefined;
201
423
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
202
- calendar: (slotProps?: ({
424
+ endContent: (slotProps?: ({
203
425
  size?: "sm" | "md" | "lg" | undefined;
426
+ hasStartContent?: boolean | undefined;
427
+ hasEndContent?: boolean | undefined;
428
+ hasChips?: boolean | undefined;
429
+ startContentPointerEvents?: "none" | "auto" | undefined;
204
430
  endContentPointerEvents?: "none" | "auto" | undefined;
431
+ isSegmented?: boolean | undefined;
432
+ isRange?: boolean | undefined;
433
+ } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
434
+ calendar: (slotProps?: ({
435
+ size?: "sm" | "md" | "lg" | undefined;
205
436
  hasStartContent?: boolean | undefined;
206
437
  hasEndContent?: boolean | undefined;
207
438
  hasChips?: boolean | undefined;
208
439
  startContentPointerEvents?: "none" | "auto" | undefined;
440
+ endContentPointerEvents?: "none" | "auto" | undefined;
441
+ isSegmented?: boolean | undefined;
442
+ isRange?: boolean | undefined;
209
443
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
210
444
  footer: (slotProps?: ({
211
445
  size?: "sm" | "md" | "lg" | undefined;
212
- endContentPointerEvents?: "none" | "auto" | undefined;
213
446
  hasStartContent?: boolean | undefined;
214
447
  hasEndContent?: boolean | undefined;
215
448
  hasChips?: boolean | undefined;
216
449
  startContentPointerEvents?: "none" | "auto" | undefined;
450
+ endContentPointerEvents?: "none" | "auto" | undefined;
451
+ isSegmented?: boolean | undefined;
452
+ isRange?: boolean | undefined;
217
453
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
218
454
  icon: (slotProps?: ({
219
455
  size?: "sm" | "md" | "lg" | undefined;
220
- endContentPointerEvents?: "none" | "auto" | undefined;
221
456
  hasStartContent?: boolean | undefined;
222
457
  hasEndContent?: boolean | undefined;
223
458
  hasChips?: boolean | undefined;
224
459
  startContentPointerEvents?: "none" | "auto" | undefined;
460
+ endContentPointerEvents?: "none" | "auto" | undefined;
461
+ isSegmented?: boolean | undefined;
462
+ isRange?: boolean | undefined;
225
463
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
226
464
  clearButton: (slotProps?: ({
227
465
  size?: "sm" | "md" | "lg" | undefined;
228
- endContentPointerEvents?: "none" | "auto" | undefined;
229
466
  hasStartContent?: boolean | undefined;
230
467
  hasEndContent?: boolean | undefined;
231
468
  hasChips?: boolean | undefined;
232
469
  startContentPointerEvents?: "none" | "auto" | undefined;
470
+ endContentPointerEvents?: "none" | "auto" | undefined;
471
+ isSegmented?: boolean | undefined;
472
+ isRange?: boolean | undefined;
233
473
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
234
474
  } & {
235
475
  base: (slotProps?: ({
236
476
  size?: "sm" | "md" | "lg" | undefined;
237
- endContentPointerEvents?: "none" | "auto" | undefined;
238
477
  hasStartContent?: boolean | undefined;
239
478
  hasEndContent?: boolean | undefined;
240
479
  hasChips?: boolean | undefined;
241
480
  startContentPointerEvents?: "none" | "auto" | undefined;
481
+ endContentPointerEvents?: "none" | "auto" | undefined;
482
+ isSegmented?: boolean | undefined;
483
+ isRange?: boolean | undefined;
242
484
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
243
485
  };
244
486
  get isRangeMode(): boolean;
487
+ /**
488
+ * The segmented field has no button trigger for a click to fall through to,
489
+ * and its calendar icon is a real button, so the cluster has to take pointer
490
+ * events. An explicit argument still wins.
491
+ */
492
+ get endContentPointerEvents(): 'none' | 'auto';
245
493
  /**
246
494
  * The single-mode wire value, or `''` when there is nothing selected. Only
247
495
  * read from the single-mode branch of the template, so it does not repeat
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/date-picker.gts"],"names":[],"mappings":"AAydA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAW3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AASpE,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EAEd,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,UAAU,mBAA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;;;OAUG;IACH,KAAK,QAAO,IAAI,CAKd;IAEF;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAMlB,YAAY,GAAI,OAAO,aAAa,CAAC,CAAC,CAAC,KAAG,IAAI,CAW5C;IAEF;;;;;;;;;;OAUG;IACH,OAAO,CAAC,UAAU;IAIlB;;;;;;;;;;OAUG;IACH,YAAY,GAAI,QAAQ,OAAO,KAAG,IAAI,CAMpC;IAEF;;;OAGG;IACH,KAAK,QAAO,IAAI,CAGd;IAEF,IACI,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAGV;IAED,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,IACI,gBAAgB,IAAI,sBAAsB,CAAC,CAAC,CAAC,CAgBhD;IAED,IACI,cAAc,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAU3C;CA6MF;AAED,OAAO,EAAE,UAAU,EAAE,KAAK,mBAAmB,EAAE,CAAC;AAChD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/date-picker.gts"],"names":[],"mappings":"AAq+BA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAsB3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAWpE,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EAEd,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,SAAS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 +1,5 @@
1
1
  import type { TOC } from '@ember/component/template-only';
2
+ import type { ModifierLike } from '@glint/template';
2
3
  import type { SlotsToClasses, DatePickerSlots } from '@frontile/theme';
3
4
  import type { DatePickerClasses } from './types';
4
5
  interface DatePickerEndContentSignature {
@@ -7,6 +8,24 @@ interface DatePickerEndContentSignature {
7
8
  userClasses?: SlotsToClasses<DatePickerSlots>;
8
9
  isClearable: boolean;
9
10
  onClear: () => void;
11
+ /**
12
+ * Whether the field is segmented. There is no button trigger on that path,
13
+ * so the calendar icon becomes the button that opens the popover -- the
14
+ * one thing a segmented field cannot do by clicking the value itself,
15
+ * because clicking a segment has to put the caret in it.
16
+ */
17
+ isEditable?: boolean;
18
+ /**
19
+ * The popover's `trigger` modifier, for the calendar button. Required
20
+ * rather than optional because the calendar button is unreachable without
21
+ * it, and an unapplied modifier is a silent dead control.
22
+ */
23
+ trigger: ModifierLike<{
24
+ Element: HTMLElement;
25
+ }>;
26
+ /** Names the calendar button, which has no text of its own. */
27
+ label?: string;
28
+ isDisabled?: boolean;
10
29
  /**
11
30
  * Defaults to `none` so clicks fall through to the trigger; content that
12
31
  * needs its own events opts back in per element.
@@ -21,9 +40,20 @@ interface DatePickerEndContentSignature {
21
40
  Element: HTMLDivElement;
22
41
  }
23
42
  /**
24
- * The cluster at the end of the field: exactly one of the clear button or the
25
- * calendar icon. Pointer events are off so a click anywhere in the field still
26
- * reaches the trigger; the clear button opts back in.
43
+ * The cluster at the end of the field.
44
+ *
45
+ * The segmented field shows the clear button *and* the calendar button: the
46
+ * calendar button is the only way to open the popover on that path, so
47
+ * swapping it out for a clear button would mean a clearable picker holding a
48
+ * value could not be picked from at all.
49
+ *
50
+ * The button-trigger path keeps the either/or it shipped with. There the
51
+ * trigger itself opens the popover and the calendar icon is decorative, so the
52
+ * clear button takes its place with nothing lost.
53
+ *
54
+ * Pointer events are off on that path so a click anywhere in the field still
55
+ * reaches the trigger; the clear button opts back in per element, and the
56
+ * segmented field turns them on for the whole cluster.
27
57
  */
28
58
  declare const DatePickerEndContent: TOC<DatePickerEndContentSignature>;
29
59
  export { DatePickerEndContent, type DatePickerEndContentSignature };
@@ -1 +1 @@
1
- {"version":3,"file":"end-content.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/end-content.gts"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD,UAAU,6BAA6B;IACrC,IAAI,EAAE;QACJ,OAAO,EAAE,iBAAiB,CAAC;QAC3B,WAAW,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;QAC9C,WAAW,EAAE,OAAO,CAAC;QACrB,OAAO,EAAE,MAAM,IAAI,CAAC;QAEpB;;;;;;;;WAQG;QACH,uBAAuB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC3C,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;GAIG;AACH,QAAA,MAAM,oBAAoB,EAAE,GAAG,CAAC,6BAA6B,CAqC3D,CAAC;AAEH,OAAO,EAAE,oBAAoB,EAAE,KAAK,6BAA6B,EAAE,CAAC"}
1
+ {"version":3,"file":"end-content.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/end-content.gts"],"names":[],"mappings":"AAoHA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD,UAAU,6BAA6B;IACrC,IAAI,EAAE;QACJ,OAAO,EAAE,iBAAiB,CAAC;QAC3B,WAAW,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;QAC9C,WAAW,EAAE,OAAO,CAAC;QACrB,OAAO,EAAE,MAAM,IAAI,CAAC;QAEpB;;;;;WAKG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;;;WAIG;QACH,OAAO,EAAE,YAAY,CAAC;YAAE,OAAO,EAAE,WAAW,CAAA;SAAE,CAAC,CAAC;QAEhD,+DAA+D;QAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;;;;;;;WAQG;QACH,uBAAuB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC3C,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,oBAAoB,EAAE,GAAG,CAAC,6BAA6B,CA0E3D,CAAC;AAEH,OAAO,EAAE,oBAAoB,EAAE,KAAK,6BAA6B,EAAE,CAAC"}
@@ -4,6 +4,7 @@ import type { CalendarArgs } from '../../collections/calendar/calendar';
4
4
  import type { CalendarMode, CalendarValue, DateRange, WeekDay } from '../../collections/calendar/types';
5
5
  import type { FormControlSharedArgs } from '../form-control';
6
6
  import type { DatePickerInput, DatePickerRangeInput } from './value';
7
+ import type { Granularity, SegmentType } from '../date-input/types';
7
8
  interface BaseDatePickerArgs extends Pick<CalendarArgs, 'color' | 'minValue' | 'maxValue' | 'isDateUnavailable' | 'locale' | 'weekStartsOn' | 'visibleMonths' | 'captionLayout' | 'fixedWeeks' | 'showOutsideDays' | 'isReadOnly'>, Pick<PopoverSignature['Args'], 'placement' | 'flipOptions' | 'shiftOptions' | 'offsetOptions' | 'strategy' | 'didClose'>, Pick<ContentSignature['Args'], 'renderInPlace' | 'target' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'transitionDuration' | 'disableTransitions'>, FormControlSharedArgs {
8
9
  /** The unique identifier for the control. */
9
10
  id?: string;
@@ -15,14 +16,52 @@ interface BaseDatePickerArgs extends Pick<CalendarArgs, 'color' | 'minValue' | '
15
16
  * `shiftOptions` cover. Forwarded to `Popover`'s own `@middleware`.
16
17
  */
17
18
  middleware?: PopoverSignature['Args']['middleware'];
19
+ /**
20
+ * Whether the value can be typed into segments. `false` restores the button
21
+ * trigger showing the formatted value, which is what `@placeholder`,
22
+ * `@formatOptions` and the `:value` block describe.
23
+ *
24
+ * `@mode="range"` is segmented too: two groups with a separator between
25
+ * them, one for each end of the range.
26
+ *
27
+ * @defaultValue true
28
+ */
29
+ isEditable?: boolean;
30
+ /**
31
+ * Where ArrowUp on an empty segment starts. Only read on the segmented
32
+ * path.
33
+ *
34
+ * @defaultValue today
35
+ */
36
+ placeholderValue?: Date;
37
+ /**
38
+ * The accessible names of the segments, for localizing them.
39
+ *
40
+ * @defaultValue { year: 'year', month: 'month', day: 'day' }
41
+ */
42
+ segmentLabels?: Partial<Record<SegmentType, string>>;
18
43
  /** Text shown in the trigger when there is no value. */
19
44
  placeholder?: string;
20
45
  /**
21
46
  * How the value is rendered in the trigger. Localized with `@locale`.
22
47
  *
23
- * @defaultValue { dateStyle: 'medium' }
48
+ * @defaultValue { dateStyle: 'medium' }, plus `timeStyle: 'short'` under an `hour` or `minute` granularity
24
49
  */
25
50
  formatOptions?: Intl.DateTimeFormatOptions;
51
+ /**
52
+ * The smallest unit the field edits. `hour` and `minute` add time segments
53
+ * after the date ones; picking a day in the calendar keeps the time already
54
+ * entered, or starts at midnight.
55
+ *
56
+ * @defaultValue 'day'
57
+ */
58
+ granularity?: Granularity;
59
+ /**
60
+ * Forces a 12- or 24-hour clock. A 12-hour one adds an AM/PM segment.
61
+ *
62
+ * @defaultValue the locale's
63
+ */
64
+ hourCycle?: 12 | 24;
26
65
  /** The size of the field. Matches Select's `@inputSize`. */
27
66
  inputSize?: DatePickerVariants['size'];
28
67
  /**
@@ -49,7 +88,11 @@ interface BaseDatePickerArgs extends Pick<CalendarArgs, 'color' | 'minValue' | '
49
88
  * included -- falls through to the trigger and opens the picker. The clear
50
89
  * button opts back in on its own.
51
90
  *
52
- * @defaultValue 'none'
91
+ * The segmented path defaults to `'auto'` instead: there is no button
92
+ * trigger for a click to fall through to, and the calendar icon is itself
93
+ * the button that opens the popover.
94
+ *
95
+ * @defaultValue 'none', or 'auto' when the field is segmented
53
96
  */
54
97
  endContentPointerEvents?: 'none' | 'auto';
55
98
  /** Fires when focus leaves the trigger *and* the popover. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,OAAO,EACR,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAErE,UAAU,kBACR,SACE,IAAI,CACF,YAAY,EACV,OAAO,GACP,UAAU,GACV,UAAU,GACV,mBAAmB,GACnB,QAAQ,GACR,cAAc,GACd,eAAe,GACf,eAAe,GACf,YAAY,GACZ,iBAAiB,GACjB,YAAY,CACf,EACD,IAAI,CACF,gBAAgB,CAAC,MAAM,CAAC,EACtB,WAAW,GACX,aAAa,GACb,cAAc,GACd,eAAe,GACf,UAAU,GACV,UAAU,CACb,EACD,IAAI,CACF,gBAAgB,CAAC,MAAM,CAAC,EACtB,eAAe,GACf,QAAQ,GACR,qBAAqB,GACrB,kBAAkB,GAClB,oBAAoB,GACpB,oBAAoB,CACvB,EACD,qB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AC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,uEAAuE;AACvE,UAAU,mBAAmB,CAAC,CAAC,SAAS,YAAY,GAAG,QAAQ;IAC7D,sEAAsE;IACtE,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC5C,2DAA2D;IAC3D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EAClB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,OAAO,EACR,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEpE,UAAU,kBACR,SACE,IAAI,CACF,YAAY,EACV,OAAO,GACP,UAAU,GACV,UAAU,GACV,mBAAmB,GACnB,QAAQ,GACR,cAAc,GACd,eAAe,GACf,eAAe,GACf,YAAY,GACZ,i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;;;;;;GAWG;AACH,UAAU,sBAAsB,CAAC,CAAC,SAAS,YAAY,GAAG,QAAQ;IAChE,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC9B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,uEAAuE;AACvE,UAAU,mBAAmB,CAAC,CAAC,SAAS,YAAY,GAAG,QAAQ;IAC7D,sEAAsE;IACtE,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC5C,2DAA2D;IAC3D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EAClB,CAAC"}
@@ -1,7 +1,9 @@
1
+ import type { Granularity } from '../date-input/types';
1
2
  import type { CalendarMode, CalendarValue, DateRange } from '../../collections/calendar/types';
2
3
  /**
3
- * A date as accepted from a consumer: a `Date`, or the same `yyyy-MM-dd`
4
- * string this component writes to its hidden inputs.
4
+ * A date as accepted from a consumer: a `Date`, or the same `yyyy-MM-dd` (or,
5
+ * with a time, local `yyyy-MM-ddTHH:mm`) string this component writes to its
6
+ * hidden inputs.
5
7
  *
6
8
  * Strings are accepted because `Field` feeds form data — which is always
7
9
  * strings — straight back into `@value`. It also means a value hydrated from
@@ -28,8 +30,22 @@ declare function parseDate(value: DatePickerInput | null | undefined): Date | nu
28
30
  * and the trigger must still show the anchor.
29
31
  */
30
32
  declare function parseRange(value: DatePickerRangeInput | null | undefined): DateRange | null;
31
- /** The value as it is submitted: `yyyy-MM-dd`, from local calendar fields. */
32
- declare function toWire(date: Date | null | undefined): string;
33
+ /**
34
+ * The value as it is submitted: `yyyy-MM-dd` from local calendar fields, and
35
+ * under an `hour` or `minute` granularity the local `yyyy-MM-ddTHH:mm` that
36
+ * `datetime-local` uses too.
37
+ */
38
+ declare function toWire(date: Date | null | undefined, granularity?: Granularity): string;
39
+ /**
40
+ * Copies the wall-clock time of `from` onto the day of `day`. Picking a day in
41
+ * the calendar keeps the time the field already holds.
42
+ */
43
+ declare function withTimeOf(day: Date, from: {
44
+ hours: number;
45
+ minutes: number;
46
+ }): Date;
47
+ /** The button trigger's default once the value carries a time. */
48
+ declare const DEFAULT_TIME_FORMAT: Intl.DateTimeFormatOptions;
33
49
  /**
34
50
  * The trigger's text for a value in either mode. An en dash (not a hyphen)
35
51
  * joins a range, matching how date ranges are set in running text.
@@ -40,5 +56,5 @@ declare function formatValue<M extends CalendarMode>(value: CalendarValue<M> | n
40
56
  * empty — its start is already chosen and must be visible.
41
57
  */
42
58
  declare function isEmptyValue(value: unknown): boolean;
43
- export { parseDate, parseRange, toWire, formatValue, isEmptyValue, type DatePickerInput, type DatePickerRangeInput };
59
+ export { parseDate, parseRange, toWire, withTimeOf, DEFAULT_TIME_FORMAT, formatValue, isEmptyValue, type DatePickerInput, type DatePickerRangeInput };
44
60
  //# sourceMappingURL=value.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/value.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACV,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;GAQG;AACH,KAAK,eAAe,GAAG,IAAI,GAAG,MAAM,CAAC;AAErC,UAAU,oBAAoB;IAC5B,KAAK,EAAE,eAAe,CAAC;IACvB,GAAG,EAAE,eAAe,GAAG,IAAI,CAAC;CAC7B;AAID;;;;;;;GAOG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAazE;AAED;;;;GAIG;AACH,iBAAS,UAAU,CACjB,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAC7C,SAAS,GAAG,IAAI,CASlB;AAED,8EAA8E;AAC9E,iBAAS,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGrD;AAuBD;;;GAGG;AACH,iBAAS,WAAW,CAAC,CAAC,SAAS,YAAY,EACzC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,EAC1C,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GACnC,MAAM,CAcR;AAED;;;GAGG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK7C;AAED,OAAO,EACL,SAAS,EACT,UAAU,EACV,MAAM,EACN,WAAW,EACX,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,CAAC"}
1
+ {"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/value.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EACV,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