frontile 0.18.0-beta.5 → 0.18.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 (70) hide show
  1. package/declarations/components/buttons/chip.d.ts +1 -1
  2. package/declarations/components/buttons/chip.d.ts.map +1 -1
  3. package/declarations/components/collections/dropdown/menu-context.d.ts +10 -0
  4. package/declarations/components/collections/dropdown/menu-context.d.ts.map +1 -1
  5. package/declarations/components/collections/dropdown/sub.d.ts +34 -0
  6. package/declarations/components/collections/dropdown/sub.d.ts.map +1 -1
  7. package/declarations/components/forms/autocomplete.d.ts +12 -12
  8. package/declarations/components/forms/date-input/clipboard.d.ts +34 -0
  9. package/declarations/components/forms/date-input/clipboard.d.ts.map +1 -0
  10. package/declarations/components/forms/date-input/date-input.d.ts +91 -0
  11. package/declarations/components/forms/date-input/date-input.d.ts.map +1 -0
  12. package/declarations/components/forms/date-input/segment-group.d.ts +130 -0
  13. package/declarations/components/forms/date-input/segment-group.d.ts.map +1 -0
  14. package/declarations/components/forms/date-input/segments.d.ts +137 -0
  15. package/declarations/components/forms/date-input/segments.d.ts.map +1 -0
  16. package/declarations/components/forms/date-input/types.d.ts +134 -0
  17. package/declarations/components/forms/date-input/types.d.ts.map +1 -0
  18. package/declarations/components/forms/date-input.d.ts +6 -0
  19. package/declarations/components/forms/date-input.d.ts.map +1 -0
  20. package/declarations/components/forms/date-picker/date-picker.d.ts +248 -15
  21. package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -1
  22. package/declarations/components/forms/date-picker/end-content.d.ts +33 -3
  23. package/declarations/components/forms/date-picker/end-content.d.ts.map +1 -1
  24. package/declarations/components/forms/date-picker/types.d.ts +30 -1
  25. package/declarations/components/forms/date-picker/types.d.ts.map +1 -1
  26. package/declarations/components/forms/field.d.ts +3 -0
  27. package/declarations/components/forms/field.d.ts.map +1 -1
  28. package/declarations/components/forms/index.d.ts +1 -0
  29. package/declarations/components/forms/index.d.ts.map +1 -1
  30. package/declarations/components/forms/input.d.ts +11 -11
  31. package/declarations/components/forms/native-select.d.ts +8 -8
  32. package/declarations/components/forms/select/select.d.ts +16 -16
  33. package/declarations/components/forms/textarea.d.ts +7 -7
  34. package/declarations/components/utilities/avatar.d.ts +35 -2
  35. package/declarations/components/utilities/avatar.d.ts.map +1 -1
  36. package/declarations/test-support.d.ts +30 -0
  37. package/declarations/test-support.d.ts.map +1 -1
  38. package/dist/components/buttons/chip.js.map +1 -1
  39. package/dist/components/collections/dropdown/menu-context.js.map +1 -1
  40. package/dist/components/collections/dropdown/sub.js +76 -11
  41. package/dist/components/collections/dropdown/sub.js.map +1 -1
  42. package/dist/components/forms/date-input/clipboard.js +162 -0
  43. package/dist/components/forms/date-input/clipboard.js.map +1 -0
  44. package/dist/components/forms/date-input/date-input.js +194 -0
  45. package/dist/components/forms/date-input/date-input.js.map +1 -0
  46. package/dist/components/forms/date-input/segment-group.js +271 -0
  47. package/dist/components/forms/date-input/segment-group.js.map +1 -0
  48. package/dist/components/forms/date-input/segments.js +379 -0
  49. package/dist/components/forms/date-input/segments.js.map +1 -0
  50. package/dist/components/forms/date-input/types.js +2 -0
  51. package/dist/components/forms/date-input/types.js.map +1 -0
  52. package/dist/components/forms/date-input.js +4 -0
  53. package/dist/components/forms/date-input.js.map +1 -0
  54. package/dist/components/forms/date-picker/date-picker.js +301 -14
  55. package/dist/components/forms/date-picker/date-picker.js.map +1 -1
  56. package/dist/components/forms/date-picker/end-content.js +17 -4
  57. package/dist/components/forms/date-picker/end-content.js.map +1 -1
  58. package/dist/components/forms/field.js +4 -1
  59. package/dist/components/forms/field.js.map +1 -1
  60. package/dist/components/forms/index.js +3 -0
  61. package/dist/components/forms/index.js.map +1 -1
  62. package/dist/components/utilities/avatar.js +30 -5
  63. package/dist/components/utilities/avatar.js.map +1 -1
  64. package/dist/forms.js +3 -0
  65. package/dist/forms.js.map +1 -1
  66. package/dist/index.js +3 -0
  67. package/dist/index.js.map +1 -1
  68. package/dist/test-support.js +480 -1
  69. package/dist/test-support.js.map +1 -1
  70. package/package.json +3 -3
@@ -0,0 +1,379 @@
1
+ import { warn } from '@ember/debug';
2
+
3
+ /**
4
+ * The format an editable field uses when the consumer supplies none.
5
+ * Deliberately not `{ dateStyle: 'medium' }` -- DatePicker's button default --
6
+ * which renders a month name and has no numeric segment to type into.
7
+ */
8
+ const DEFAULT_FORMAT = {
9
+ year: 'numeric',
10
+ month: '2-digit',
11
+ day: '2-digit'
12
+ };
13
+ const BOUNDS = {
14
+ // Upper bound for the day is the widest any month gets; `toDate` clamps to
15
+ // the real length of the chosen month, which is not known segment-locally.
16
+ day: {
17
+ min: 1,
18
+ max: 31,
19
+ width: 2,
20
+ placeholder: 'dd'
21
+ },
22
+ month: {
23
+ min: 1,
24
+ max: 12,
25
+ width: 2,
26
+ placeholder: 'mm'
27
+ },
28
+ year: {
29
+ min: 1,
30
+ max: 9999,
31
+ width: 4,
32
+ placeholder: 'yyyy'
33
+ }
34
+ };
35
+ function isSegment(part) {
36
+ return part.kind === 'segment';
37
+ }
38
+ function emptySegment(type) {
39
+ const {
40
+ min,
41
+ max,
42
+ width,
43
+ placeholder
44
+ } = BOUNDS[type];
45
+ return {
46
+ kind: 'segment',
47
+ type,
48
+ value: null,
49
+ min,
50
+ max,
51
+ width,
52
+ placeholder,
53
+ buffer: '',
54
+ isCommitted: false
55
+ };
56
+ }
57
+
58
+ /**
59
+ * Derives the segments and their separators from the locale, so `mm/dd/yyyy`,
60
+ * `dd/mm/yyyy` and `yyyy年mm月dd日` all fall out of `Intl` rather than being
61
+ * hardcoded.
62
+ *
63
+ * A format producing a textual month ('Jan') has no editable numeric
64
+ * representation, so that part becomes a numeric month segment anyway. The
65
+ * component warns; this function stays pure.
66
+ */
67
+ function buildParts(locale, formatOptions = DEFAULT_FORMAT) {
68
+ const formatter = new Intl.DateTimeFormat(locale, formatOptions);
69
+ // A reference date, only ever used to make the formatter emit its parts.
70
+ const parts = formatter.formatToParts(new Date(2026, 0, 20));
71
+ const out = [];
72
+ for (const part of parts) {
73
+ if (part.type === 'year' || part.type === 'month' || part.type === 'day') {
74
+ out.push(emptySegment(part.type));
75
+ } else if (part.type === 'literal') {
76
+ out.push({
77
+ kind: 'literal',
78
+ text: part.value
79
+ });
80
+ }
81
+ // Everything else -- era, weekday, relatedYear -- is dropped: day
82
+ // granularity has no segment for it.
83
+ }
84
+ return out;
85
+ }
86
+
87
+ /**
88
+ * A bare `yy` resolves into the hundred years running from 80 back to 19
89
+ * forward -- so a birth date reaches the past while a card expiry reaches the
90
+ * near future. Three or four digits are a year the user spelled out and are
91
+ * taken literally.
92
+ */
93
+ function resolveTwoDigitYear(digits, now = new Date()) {
94
+ const n = Number(digits);
95
+ if (digits.length > 2) return n;
96
+ const currentYear = now.getFullYear();
97
+ const start = currentYear - 80;
98
+ const century = Math.floor(start / 100) * 100;
99
+ const candidate = century + n;
100
+ return candidate < start ? candidate + 100 : candidate;
101
+ }
102
+
103
+ /**
104
+ * The numeric value a buffer represents, or null when it represents none.
105
+ *
106
+ * A buffer is always its literal number, including a year's: `26` is the year
107
+ * 26 here, not 2026. The two-digit window is applied once, by `commitSegment`,
108
+ * at the moment the user is finished with the segment -- applying it per
109
+ * keystroke would make the first digit of `2026` compose the year 2002 and
110
+ * push a date nobody typed out to `@onChange` and the calendar.
111
+ */
112
+ function bufferValue(segment, buffer) {
113
+ if (buffer === '') return null;
114
+ const n = Number(buffer);
115
+ return n < segment.min ? null : n;
116
+ }
117
+
118
+ /**
119
+ * Appends one typed digit.
120
+ *
121
+ * `isFull` is the signal to advance focus. It is true when the segment cannot
122
+ * take another digit -- either it has reached its width, or any further digit
123
+ * would exceed `max`. That is what makes typing `5` into a month jump straight
124
+ * to the day, while typing `1` waits to see whether `12` is coming.
125
+ */
126
+ function applyDigit(segment, digit) {
127
+ if (!/^\d$/.test(digit)) return {
128
+ segment,
129
+ isFull: false
130
+ };
131
+ let buffer = segment.buffer + digit;
132
+ let value = bufferValue(segment, buffer);
133
+
134
+ // The accumulated digits no longer fit the segment, so this keystroke starts
135
+ // a fresh entry instead of being discarded. Width is checked as well as the
136
+ // bound because leading zeros pile up without ever exceeding it: `00` then
137
+ // `1` in a month is the buffer `001`, which is still only January and would
138
+ // render three characters wide in a two-character segment.
139
+ if (buffer.length > segment.width || value !== null && value > segment.max) {
140
+ buffer = digit;
141
+ value = bufferValue(segment, buffer);
142
+ // A single digit that still overflows cannot be entered at all.
143
+ if (value !== null && value > segment.max) return {
144
+ segment,
145
+ isFull: false
146
+ };
147
+ }
148
+ const atWidth = buffer.length >= segment.width;
149
+ // Would any digit 0-9 appended here still fit? If not, there is nothing
150
+ // left to wait for. `bufferValue` returning null (below `min`) behaves like
151
+ // 0 here, same as the original non-null-assertion-based comparison did.
152
+ const extended = bufferValue(segment, buffer + '0') ?? 0;
153
+ const isFull = atWidth || extended > segment.max;
154
+
155
+ // A segment that can take no further digit is finished, so it commits here
156
+ // rather than waiting for focus to leave.
157
+ const next = {
158
+ ...segment,
159
+ buffer,
160
+ value,
161
+ isCommitted: isFull
162
+ };
163
+ return {
164
+ segment: next,
165
+ isFull
166
+ };
167
+ }
168
+
169
+ /**
170
+ * Marks a segment as the user's finished answer, expanding a one- or
171
+ * two-digit year through the sliding window on the way: typing `26` and
172
+ * moving on means 2026, while `0026` typed in full means the year 26.
173
+ *
174
+ * An empty segment has nothing to commit and stays uncommitted, so leaving a
175
+ * blank field does not invent a value for it.
176
+ */
177
+ function commitSegment(segment) {
178
+ if (segment.value === null) return segment;
179
+ if (segment.type === 'year' && segment.buffer.length > 0 && segment.buffer.length <= 2) {
180
+ return withValue(segment, resolveTwoDigitYear(segment.buffer));
181
+ }
182
+ return {
183
+ ...segment,
184
+ isCommitted: true
185
+ };
186
+ }
187
+
188
+ /**
189
+ * A segment holding `value` as a finished answer.
190
+ *
191
+ * The zero-padded buffer is the paired invariant of `displaySegment`, which
192
+ * reads the buffer back out -- so every path that sets a value goes through
193
+ * here rather than restating the padding and risking the two drifting.
194
+ */
195
+ function withValue(segment, value) {
196
+ return {
197
+ ...segment,
198
+ value,
199
+ buffer: String(value).padStart(segment.width, '0'),
200
+ isCommitted: true
201
+ };
202
+ }
203
+
204
+ /** Clears both the value and the digits behind it. */
205
+ function clearSegment(segment) {
206
+ return {
207
+ ...segment,
208
+ value: null,
209
+ buffer: '',
210
+ isCommitted: false
211
+ };
212
+ }
213
+
214
+ /** Drops the last digit typed, for Backspace. */
215
+ function deleteDigit(segment) {
216
+ const buffer = segment.buffer.slice(0, -1);
217
+ // Un-commits: a year being backspaced through is being typed again, and the
218
+ // 202 it passes through must not compose a date.
219
+ return {
220
+ ...segment,
221
+ buffer,
222
+ value: bufferValue(segment, buffer),
223
+ isCommitted: false
224
+ };
225
+ }
226
+
227
+ /** The unit of `placeholderValue` this segment seeds from when empty. */
228
+ function seedFrom(type, placeholderValue) {
229
+ if (type === 'year') return placeholderValue.getFullYear();
230
+ if (type === 'month') return placeholderValue.getMonth() + 1;
231
+ return placeholderValue.getDate();
232
+ }
233
+
234
+ /**
235
+ * Arrow and page keys. An empty segment does not step from zero -- it adopts
236
+ * `placeholderValue`, so ArrowUp on a blank year offers this year rather than
237
+ * the year 1.
238
+ */
239
+ function step(segment, delta, placeholderValue) {
240
+ if (segment.value === null) {
241
+ return withValue(segment, seedFrom(segment.type, placeholderValue));
242
+ }
243
+ const span = segment.max - segment.min + 1;
244
+ const offset = segment.value - segment.min + delta;
245
+ // Modulo twice: JavaScript's % keeps the sign of the dividend, so a
246
+ // decrement past the floor would otherwise land on a negative value.
247
+ const wrapped = (offset % span + span) % span;
248
+ return withValue(segment, wrapped + segment.min);
249
+ }
250
+
251
+ /**
252
+ * The segment's display text: the digits behind it, or its placeholder when
253
+ * empty. A year still being typed shows exactly what has been typed --
254
+ * `26` on the way to `2026` -- because padding it would claim digits the
255
+ * user has not entered. Every other segment, and a committed year, is padded
256
+ * to its full width.
257
+ *
258
+ * This is the single source of truth for "what does this segment read as
259
+ * right now" -- both the rendered cell text and `formatForClipboard` call
260
+ * it, so a mid-entry copy always matches what is on screen.
261
+ */
262
+ function displaySegment(segment) {
263
+ if (segment.value === null) return segment.placeholder;
264
+ const digits = segment.buffer;
265
+ return segment.type === 'year' && !segment.isCommitted ? digits : digits.padStart(segment.width, '0');
266
+ }
267
+ function findSegment(parts, type) {
268
+ return parts.find(p => isSegment(p) && p.type === type);
269
+ }
270
+
271
+ /** Days in a month, via the zeroth day of the next one. */
272
+ function daysInMonth(year, month) {
273
+ return new Date(year, month, 0).getDate();
274
+ }
275
+
276
+ /** A segment holding a finished value, as opposed to one mid-entry. */
277
+ function isReady(segment) {
278
+ return segment !== undefined && segment.value !== null && segment.isCommitted;
279
+ }
280
+
281
+ /**
282
+ * The composed value, or `null` while any segment is still empty or still
283
+ * being typed. The day is clamped to the chosen month's real length: a 31 left
284
+ * over from January must resolve to the 28th in February, not roll forward
285
+ * into March the way the `Date` constructor would.
286
+ */
287
+ function toDate(parts) {
288
+ const year = findSegment(parts, 'year');
289
+ const month = findSegment(parts, 'month');
290
+ const day = findSegment(parts, 'day');
291
+
292
+ // Uncommitted counts as empty: half a year is not a date.
293
+ if (!isReady(year) || !isReady(month) || !isReady(day)) return null;
294
+ const clamped = Math.min(day.value, daysInMonth(year.value, month.value));
295
+ return new Date(year.value, month.value - 1, clamped);
296
+ }
297
+
298
+ /**
299
+ * Carries the segments' state onto a freshly built list, matching by type.
300
+ *
301
+ * Used when the locale or the format changes under a field that is already
302
+ * holding something. Going via `toDate` instead would discard a half-typed
303
+ * entry, because a partial entry composes no date -- and losing the user's
304
+ * digits to a locale switch is exactly the failure this component exists to
305
+ * avoid. A segment the new format has no place for is simply dropped.
306
+ */
307
+ function carryOver(next, previous) {
308
+ return next.map(part => {
309
+ if (!isSegment(part)) return part;
310
+ const was = findSegment(previous, part.type);
311
+ if (!was || was.value === null) return part;
312
+ return {
313
+ ...part,
314
+ value: was.value,
315
+ buffer: was.buffer,
316
+ isCommitted: was.isCommitted
317
+ };
318
+ });
319
+ }
320
+
321
+ /**
322
+ * Whether a format would render a month no one can type into -- either a
323
+ * textual month outright, or a `dateStyle` preset, which picks its own and
324
+ * cannot be reasoned about field by field.
325
+ */
326
+ function hasTextualMonth(options) {
327
+ return options.dateStyle !== undefined || options.month === 'long' || options.month === 'short' || options.month === 'narrow';
328
+ }
329
+
330
+ /**
331
+ * The nearest typeable format to the one asked for.
332
+ *
333
+ * A textual month is swapped for a numeric one and *everything else is left
334
+ * alone*: a format asking for month and day keeps exactly those two segments
335
+ * rather than growing a year the consumer never requested. A `dateStyle`
336
+ * preset names no fields at all, so there is nothing to preserve and the
337
+ * default numeric format stands in for the whole thing.
338
+ */
339
+ function toNumericFormat(options) {
340
+ if (options.dateStyle !== undefined) return DEFAULT_FORMAT;
341
+ return {
342
+ ...options,
343
+ month: 'numeric'
344
+ };
345
+ }
346
+
347
+ /**
348
+ * The format the segments should actually be built from, warning when that is
349
+ * not the one asked for.
350
+ *
351
+ * Both hosts need the identical policy and differ only in what they call
352
+ * themselves, so the message is passed in rather than the rule being written
353
+ * out twice and left to drift.
354
+ */
355
+ function resolveSegmentFormat(given, warning) {
356
+ if (!given || !hasTextualMonth(given)) return given;
357
+ warn(warning.message, false, {
358
+ id: warning.id
359
+ });
360
+ return toNumericFormat(given);
361
+ }
362
+
363
+ /** Whether two composed values differ -- `null` (no date) included. */
364
+ function hasDateChanged(before, after) {
365
+ if (before === null || after === null) return before !== after;
366
+ return before.getTime() !== after.getTime();
367
+ }
368
+
369
+ /** Writes a value across the segments, leaving literals untouched. */
370
+ function fromDate(parts, date) {
371
+ return parts.map(part => {
372
+ if (!isSegment(part)) return part;
373
+ if (!date) return clearSegment(part);
374
+ return withValue(part, seedFrom(part.type, date));
375
+ });
376
+ }
377
+
378
+ export { BOUNDS, DEFAULT_FORMAT, applyDigit, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, isSegment, resolveSegmentFormat, resolveTwoDigitYear, step, toDate, toNumericFormat, withValue };
379
+ //# sourceMappingURL=segments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segments.js","sources":["../../../../src/components/forms/date-input/segments.ts"],"sourcesContent":["import { warn } from '@ember/debug';\nimport type { Part, Segment, SegmentType } from './types';\n\n/**\n * The format an editable field uses when the consumer supplies none.\n * Deliberately not `{ dateStyle: 'medium' }` -- DatePicker's button default --\n * which renders a month name and has no numeric segment to type into.\n */\nconst DEFAULT_FORMAT: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit'\n};\n\nconst BOUNDS: Record<\n SegmentType,\n { min: number; max: number; width: number; placeholder: string }\n> = {\n // Upper bound for the day is the widest any month gets; `toDate` clamps to\n // the real length of the chosen month, which is not known segment-locally.\n day: { min: 1, max: 31, width: 2, placeholder: 'dd' },\n month: { min: 1, max: 12, width: 2, placeholder: 'mm' },\n year: { min: 1, max: 9999, width: 4, placeholder: 'yyyy' }\n};\n\nfunction isSegment(part: Part): part is Segment {\n return part.kind === 'segment';\n}\n\nfunction emptySegment(type: SegmentType): Segment {\n const { min, max, width, placeholder } = BOUNDS[type];\n return {\n kind: 'segment',\n type,\n value: null,\n min,\n max,\n width,\n placeholder,\n buffer: '',\n isCommitted: false\n };\n}\n\n/**\n * Derives the segments and their separators from the locale, so `mm/dd/yyyy`,\n * `dd/mm/yyyy` and `yyyy年mm月dd日` all fall out of `Intl` rather than being\n * hardcoded.\n *\n * A format producing a textual month ('Jan') has no editable numeric\n * representation, so that part becomes a numeric month segment anyway. The\n * component warns; this function stays pure.\n */\nfunction buildParts(\n locale: string,\n formatOptions: Intl.DateTimeFormatOptions = DEFAULT_FORMAT\n): Part[] {\n const formatter = new Intl.DateTimeFormat(locale, formatOptions);\n // A reference date, only ever used to make the formatter emit its parts.\n const parts = formatter.formatToParts(new Date(2026, 0, 20));\n\n const out: Part[] = [];\n for (const part of parts) {\n if (part.type === 'year' || part.type === 'month' || part.type === 'day') {\n out.push(emptySegment(part.type));\n } else if (part.type === 'literal') {\n out.push({ kind: 'literal', text: part.value });\n }\n // Everything else -- era, weekday, relatedYear -- is dropped: day\n // granularity has no segment for it.\n }\n\n return out;\n}\n\n/**\n * A bare `yy` resolves into the hundred years running from 80 back to 19\n * forward -- so a birth date reaches the past while a card expiry reaches the\n * near future. Three or four digits are a year the user spelled out and are\n * taken literally.\n */\nfunction resolveTwoDigitYear(digits: string, now: Date = new Date()): number {\n const n = Number(digits);\n if (digits.length > 2) return n;\n\n const currentYear = now.getFullYear();\n const start = currentYear - 80;\n const century = Math.floor(start / 100) * 100;\n const candidate = century + n;\n return candidate < start ? candidate + 100 : candidate;\n}\n\n/**\n * The numeric value a buffer represents, or null when it represents none.\n *\n * A buffer is always its literal number, including a year's: `26` is the year\n * 26 here, not 2026. The two-digit window is applied once, by `commitSegment`,\n * at the moment the user is finished with the segment -- applying it per\n * keystroke would make the first digit of `2026` compose the year 2002 and\n * push a date nobody typed out to `@onChange` and the calendar.\n */\nfunction bufferValue(segment: Segment, buffer: string): number | null {\n if (buffer === '') return null;\n const n = Number(buffer);\n return n < segment.min ? null : n;\n}\n\n/**\n * Appends one typed digit.\n *\n * `isFull` is the signal to advance focus. It is true when the segment cannot\n * take another digit -- either it has reached its width, or any further digit\n * would exceed `max`. That is what makes typing `5` into a month jump straight\n * to the day, while typing `1` waits to see whether `12` is coming.\n */\nfunction applyDigit(\n segment: Segment,\n digit: string\n): { segment: Segment; isFull: boolean } {\n if (!/^\\d$/.test(digit)) return { segment, isFull: false };\n\n let buffer = segment.buffer + digit;\n let value = bufferValue(segment, buffer);\n\n // The accumulated digits no longer fit the segment, so this keystroke starts\n // a fresh entry instead of being discarded. Width is checked as well as the\n // bound because leading zeros pile up without ever exceeding it: `00` then\n // `1` in a month is the buffer `001`, which is still only January and would\n // render three characters wide in a two-character segment.\n if (\n buffer.length > segment.width ||\n (value !== null && value > segment.max)\n ) {\n buffer = digit;\n value = bufferValue(segment, buffer);\n // A single digit that still overflows cannot be entered at all.\n if (value !== null && value > segment.max)\n return { segment, isFull: false };\n }\n\n const atWidth = buffer.length >= segment.width;\n // Would any digit 0-9 appended here still fit? If not, there is nothing\n // left to wait for. `bufferValue` returning null (below `min`) behaves like\n // 0 here, same as the original non-null-assertion-based comparison did.\n const extended = bufferValue(segment, buffer + '0') ?? 0;\n const isFull = atWidth || extended > segment.max;\n\n // A segment that can take no further digit is finished, so it commits here\n // rather than waiting for focus to leave.\n const next: Segment = { ...segment, buffer, value, isCommitted: isFull };\n\n return { segment: next, isFull };\n}\n\n/**\n * Marks a segment as the user's finished answer, expanding a one- or\n * two-digit year through the sliding window on the way: typing `26` and\n * moving on means 2026, while `0026` typed in full means the year 26.\n *\n * An empty segment has nothing to commit and stays uncommitted, so leaving a\n * blank field does not invent a value for it.\n */\nfunction commitSegment(segment: Segment): Segment {\n if (segment.value === null) return segment;\n\n if (\n segment.type === 'year' &&\n segment.buffer.length > 0 &&\n segment.buffer.length <= 2\n ) {\n return withValue(segment, resolveTwoDigitYear(segment.buffer));\n }\n\n return { ...segment, isCommitted: true };\n}\n\n/**\n * A segment holding `value` as a finished answer.\n *\n * The zero-padded buffer is the paired invariant of `displaySegment`, which\n * reads the buffer back out -- so every path that sets a value goes through\n * here rather than restating the padding and risking the two drifting.\n */\nfunction withValue(segment: Segment, value: number): Segment {\n return {\n ...segment,\n value,\n buffer: String(value).padStart(segment.width, '0'),\n isCommitted: true\n };\n}\n\n/** Clears both the value and the digits behind it. */\nfunction clearSegment(segment: Segment): Segment {\n return { ...segment, value: null, buffer: '', isCommitted: false };\n}\n\n/** Drops the last digit typed, for Backspace. */\nfunction deleteDigit(segment: Segment): Segment {\n const buffer = segment.buffer.slice(0, -1);\n // Un-commits: a year being backspaced through is being typed again, and the\n // 202 it passes through must not compose a date.\n return {\n ...segment,\n buffer,\n value: bufferValue(segment, buffer),\n isCommitted: false\n };\n}\n\n/** The unit of `placeholderValue` this segment seeds from when empty. */\nfunction seedFrom(type: SegmentType, placeholderValue: Date): number {\n if (type === 'year') return placeholderValue.getFullYear();\n if (type === 'month') return placeholderValue.getMonth() + 1;\n return placeholderValue.getDate();\n}\n\n/**\n * Arrow and page keys. An empty segment does not step from zero -- it adopts\n * `placeholderValue`, so ArrowUp on a blank year offers this year rather than\n * the year 1.\n */\nfunction step(\n segment: Segment,\n delta: number,\n placeholderValue: Date\n): Segment {\n if (segment.value === null) {\n return withValue(segment, seedFrom(segment.type, placeholderValue));\n }\n\n const span = segment.max - segment.min + 1;\n const offset = segment.value - segment.min + delta;\n // Modulo twice: JavaScript's % keeps the sign of the dividend, so a\n // decrement past the floor would otherwise land on a negative value.\n const wrapped = ((offset % span) + span) % span;\n\n return withValue(segment, wrapped + segment.min);\n}\n\n/**\n * The segment's display text: the digits behind it, or its placeholder when\n * empty. A year still being typed shows exactly what has been typed --\n * `26` on the way to `2026` -- because padding it would claim digits the\n * user has not entered. Every other segment, and a committed year, is padded\n * to its full width.\n *\n * This is the single source of truth for \"what does this segment read as\n * right now\" -- both the rendered cell text and `formatForClipboard` call\n * it, so a mid-entry copy always matches what is on screen.\n */\nfunction displaySegment(segment: Segment): string {\n if (segment.value === null) return segment.placeholder;\n\n const digits = segment.buffer;\n\n return segment.type === 'year' && !segment.isCommitted\n ? digits\n : digits.padStart(segment.width, '0');\n}\n\nfunction findSegment(parts: Part[], type: SegmentType): Segment | undefined {\n return parts.find((p): p is Segment => isSegment(p) && p.type === type);\n}\n\n/** Days in a month, via the zeroth day of the next one. */\nfunction daysInMonth(year: number, month: number): number {\n return new Date(year, month, 0).getDate();\n}\n\n/** A segment holding a finished value, as opposed to one mid-entry. */\nfunction isReady(\n segment: Segment | undefined\n): segment is Segment & { value: number } {\n return segment !== undefined && segment.value !== null && segment.isCommitted;\n}\n\n/**\n * The composed value, or `null` while any segment is still empty or still\n * being typed. The day is clamped to the chosen month's real length: a 31 left\n * over from January must resolve to the 28th in February, not roll forward\n * into March the way the `Date` constructor would.\n */\nfunction toDate(parts: Part[]): Date | null {\n const year = findSegment(parts, 'year');\n const month = findSegment(parts, 'month');\n const day = findSegment(parts, 'day');\n\n // Uncommitted counts as empty: half a year is not a date.\n if (!isReady(year) || !isReady(month) || !isReady(day)) return null;\n\n const clamped = Math.min(day.value, daysInMonth(year.value, month.value));\n return new Date(year.value, month.value - 1, clamped);\n}\n\n/**\n * Carries the segments' state onto a freshly built list, matching by type.\n *\n * Used when the locale or the format changes under a field that is already\n * holding something. Going via `toDate` instead would discard a half-typed\n * entry, because a partial entry composes no date -- and losing the user's\n * digits to a locale switch is exactly the failure this component exists to\n * avoid. A segment the new format has no place for is simply dropped.\n */\nfunction carryOver(next: Part[], previous: Part[]): Part[] {\n return next.map((part) => {\n if (!isSegment(part)) return part;\n\n const was = findSegment(previous, part.type);\n if (!was || was.value === null) return part;\n\n return {\n ...part,\n value: was.value,\n buffer: was.buffer,\n isCommitted: was.isCommitted\n };\n });\n}\n\n/**\n * Whether a format would render a month no one can type into -- either a\n * textual month outright, or a `dateStyle` preset, which picks its own and\n * cannot be reasoned about field by field.\n */\nfunction hasTextualMonth(options: Intl.DateTimeFormatOptions): boolean {\n return (\n options.dateStyle !== undefined ||\n options.month === 'long' ||\n options.month === 'short' ||\n options.month === 'narrow'\n );\n}\n\n/**\n * The nearest typeable format to the one asked for.\n *\n * A textual month is swapped for a numeric one and *everything else is left\n * alone*: a format asking for month and day keeps exactly those two segments\n * rather than growing a year the consumer never requested. A `dateStyle`\n * preset names no fields at all, so there is nothing to preserve and the\n * default numeric format stands in for the whole thing.\n */\nfunction toNumericFormat(\n options: Intl.DateTimeFormatOptions\n): Intl.DateTimeFormatOptions {\n if (options.dateStyle !== undefined) return DEFAULT_FORMAT;\n return { ...options, month: 'numeric' };\n}\n\n/**\n * The format the segments should actually be built from, warning when that is\n * not the one asked for.\n *\n * Both hosts need the identical policy and differ only in what they call\n * themselves, so the message is passed in rather than the rule being written\n * out twice and left to drift.\n */\nfunction resolveSegmentFormat(\n given: Intl.DateTimeFormatOptions | undefined,\n warning: { message: string; id: string }\n): Intl.DateTimeFormatOptions | undefined {\n if (!given || !hasTextualMonth(given)) return given;\n\n warn(warning.message, false, { id: warning.id });\n\n return toNumericFormat(given);\n}\n\n/** Whether two composed values differ -- `null` (no date) included. */\nfunction hasDateChanged(before: Date | null, after: Date | null): boolean {\n if (before === null || after === null) return before !== after;\n return before.getTime() !== after.getTime();\n}\n\n/** Writes a value across the segments, leaving literals untouched. */\nfunction fromDate(parts: Part[], date: Date | null): Part[] {\n return parts.map((part) => {\n if (!isSegment(part)) return part;\n if (!date) return clearSegment(part);\n\n return withValue(part, seedFrom(part.type, date));\n });\n}\n\nexport {\n buildParts,\n isSegment,\n emptySegment,\n DEFAULT_FORMAT,\n BOUNDS,\n applyDigit,\n commitSegment,\n clearSegment,\n deleteDigit,\n step,\n toDate,\n fromDate,\n findSegment,\n resolveTwoDigitYear,\n daysInMonth,\n displaySegment,\n withValue,\n carryOver,\n hasTextualMonth,\n toNumericFormat,\n resolveSegmentFormat,\n hasDateChanged\n};\n"],"names":["DEFAULT_FORMAT","year","month","day","BOUNDS","min","max","width","placeholder","isSegment","part","kind","emptySegment","type","value","buffer","isCommitted","buildParts","locale","formatOptions","formatter","Intl","DateTimeFormat","parts","formatToParts","Date","out","push","text","resolveTwoDigitYear","digits","now","n","Number","length","currentYear","getFullYear","start","century","Math","floor","candidate","bufferValue","segment","applyDigit","digit","test","isFull","atWidth","extended","next","commitSegment","withValue","String","padStart","clearSegment","deleteDigit","slice","seedFrom","placeholderValue","getMonth","getDate","step","delta","span","offset","wrapped","displaySegment","findSegment","find","p","daysInMonth","isReady","undefined","toDate","clamped","carryOver","previous","map","was","hasTextualMonth","options","dateStyle","toNumericFormat","resolveSegmentFormat","given","warning","warn","message","id","hasDateChanged","before","after","getTime","fromDate","date"],"mappings":";;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAA0C,GAAG;AACjDC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,KAAK,EAAE,SAAS;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ources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export { BOUNDS, DEFAULT_FORMAT, applyDigit, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, isSegment, resolveSegmentFormat, resolveTwoDigitYear, step, toDate, toNumericFormat, withValue } from './date-input/segments.js';
2
+ export { formatForClipboard, parsePasted, splitRange } from './date-input/clipboard.js';
3
+ export { DateInput, DateInput as default } from './date-input/date-input.js';
4
+ //# sourceMappingURL=date-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-input.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}