frontile 0.18.5 → 0.18.6

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 (46) hide show
  1. package/declarations/-private/reveal-within.d.ts +19 -0
  2. package/declarations/-private/reveal-within.d.ts.map +1 -0
  3. package/declarations/components/collections/calendar/year-grid.d.ts.map +1 -1
  4. package/declarations/components/forms/date-input/segment-group.d.ts +2 -1
  5. package/declarations/components/forms/date-input/segment-group.d.ts.map +1 -1
  6. package/declarations/components/forms/date-input/segments.d.ts +3 -1
  7. package/declarations/components/forms/date-input/segments.d.ts.map +1 -1
  8. package/declarations/components/forms/date-picker/date-picker.d.ts +119 -1
  9. package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -1
  10. package/declarations/components/forms/date-picker/time-columns.d.ts +87 -0
  11. package/declarations/components/forms/date-picker/time-columns.d.ts.map +1 -0
  12. package/declarations/components/forms/date-picker/types.d.ts +28 -0
  13. package/declarations/components/forms/date-picker/types.d.ts.map +1 -1
  14. package/declarations/components/forms/select/native-mirror.d.ts +3 -2
  15. package/declarations/components/forms/select/native-mirror.d.ts.map +1 -1
  16. package/declarations/components/forms/select/select.d.ts +14 -2
  17. package/declarations/components/forms/select/select.d.ts.map +1 -1
  18. package/declarations/components/forms/select/types.d.ts +3 -2
  19. package/declarations/components/forms/select/types.d.ts.map +1 -1
  20. package/declarations/components/overlays/overlay.d.ts +17 -2
  21. package/declarations/components/overlays/overlay.d.ts.map +1 -1
  22. package/declarations/test-support.d.ts.map +1 -1
  23. package/dist/components/collections/calendar/year-grid.js +1 -30
  24. package/dist/components/collections/calendar/year-grid.js.map +1 -1
  25. package/dist/components/forms/date-input/segment-group.js +1 -1
  26. package/dist/components/forms/date-input/segment-group.js.map +1 -1
  27. package/dist/components/forms/date-input/segments.js +1 -1
  28. package/dist/components/forms/date-input/segments.js.map +1 -1
  29. package/dist/components/forms/date-input.js +1 -1
  30. package/dist/components/forms/date-picker/date-picker.js +57 -6
  31. package/dist/components/forms/date-picker/date-picker.js.map +1 -1
  32. package/dist/components/forms/date-picker/time-columns.js +238 -0
  33. package/dist/components/forms/date-picker/time-columns.js.map +1 -0
  34. package/dist/components/forms/index.js +1 -1
  35. package/dist/components/forms/select/native-mirror.js.map +1 -1
  36. package/dist/components/forms/select/select.js +22 -4
  37. package/dist/components/forms/select/select.js.map +1 -1
  38. package/dist/components/overlays/overlay.js +55 -7
  39. package/dist/components/overlays/overlay.js.map +1 -1
  40. package/dist/forms.js +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/reveal-within-BcqpOmSI.js +33 -0
  43. package/dist/reveal-within-BcqpOmSI.js.map +1 -0
  44. package/dist/test-support.js +3 -1
  45. package/dist/test-support.js.map +1 -1
  46. package/package.json +3 -3
@@ -316,8 +316,9 @@ type SelectArgs<T> = (ExplicitSingleSelectArgs<T> | DefaultSingleSelectArgs<T> |
316
316
  *
317
317
  * Requires `@isFilterable`: without a filter, the options past the limit
318
318
  * could not be reached at all. Options passed in block form are not
319
- * counted or limited. The hidden native `<select>` always holds every
320
- * option, so the form value is never affected.
319
+ * counted or limited. The hidden native `<select>` that carries the form
320
+ * value holds the same number of options, from the unfiltered list, plus
321
+ * every selected one, so the form value is never affected.
321
322
  *
322
323
  * @defaultValue undefined (every option is rendered)
323
324
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,wBAAw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;IACH,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACpC,IAAI,EAAE,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,eAAe,EACrB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;GAIG;AACH,UAAU,YAAY;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,UAAU,oBAAoB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K,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,eAAe,EACrB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { type FocusTrapModifierSignature } from 'ember-focus-trap';
3
- import { createFocusTrap } from 'focus-trap';
3
+ import { createFocusTrap, type FocusTrap } from 'focus-trap';
4
4
  import { type BackdropSignature } from './backdrop';
5
5
  import { type PortalSignature } from './portal';
6
6
  import type Owner from '@ember/owner';
@@ -149,6 +149,7 @@ declare class Overlay extends Component<OverlaySignature> {
149
149
  focusedElement: Element | null | undefined;
150
150
  mouseDownContentElement: EventTarget | null;
151
151
  didLockBodyScroll: boolean;
152
+ nestedPortalObserver: MutationObserver | undefined;
152
153
  cancelPaintWait: (() => void) | undefined;
153
154
  constructor(owner: Owner, args: Args);
154
155
  willDestroy(): void;
@@ -188,7 +189,21 @@ declare class Overlay extends Component<OverlaySignature> {
188
189
  * say so by passing those two as `false`.
189
190
  */
190
191
  get focusTrapOptions(): FocusTrapOptions;
191
- get createFocusTrap(): typeof createFocusTrap | undefined;
192
+ /**
193
+ * The trap covers the content and the portals nested in this overlay's
194
+ * portal, the same ones `handleOutsideClick` doesn't count as outside.
195
+ *
196
+ * With the content alone as its container, the trap took a press in a
197
+ * nested portal for an outside click and deactivated: from then on Tab
198
+ * walked out of the Drawer. A touch on a Select's list also sent the focus
199
+ * back to where it was when the trap activated, out of the Select's
200
+ * filter. As containers, nested overlays are also part of the Tab cycle,
201
+ * after the content.
202
+ *
203
+ * Nested overlays open and close while this one stays open, so a
204
+ * MutationObserver on the portal keeps the containers current.
205
+ */
206
+ createFocusTrap: (...[element, options]: Parameters<typeof createFocusTrap>) => FocusTrap;
192
207
  get classes(): string;
193
208
  get customContentModifier(): ModifierLike<{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AK,EAAE,IAAI,GAAG,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,IAAI,GAAG,MAAM,EACpB,GAAG,EAAE,IAAI,GAAG,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -2,40 +2,11 @@ import Component from '@glimmer/component';
2
2
  import { on } from '@ember/modifier';
3
3
  import { fn } from '@ember/helper';
4
4
  import { modifier } from 'ember-modifier';
5
+ import { r as revealWithin } from '../../../reveal-within-BcqpOmSI.js';
5
6
  import { precompileTemplate } from '@ember/template-compilation';
6
7
  import { setComponentTemplate } from '@ember/component';
7
8
 
8
9
  /** The grid is three columns wide, so vertical movement is by three. */const COLUMNS = 3;
9
- /**
10
- * Scroll `target` into view inside `panel` and nowhere else.
11
- *
12
- * `scrollIntoView` and a plain `focus()` both scroll *every* scrollable
13
- * ancestor up to the document, so either one makes the host page jump when the
14
- * panel opens or when arrow keys walk past its edge. Adjusting `scrollTop`
15
- * directly keeps the movement inside the panel.
16
- *
17
- * The measurements come from `offsetTop`, not `getBoundingClientRect()`:
18
- * client rects are in transformed pixels, so under any ancestor `scale()` they
19
- * would not agree with `scrollTop`. This relies on the panel being the
20
- * `offsetParent` -- the `yearGrid` slot is positioned for exactly that reason.
21
- *
22
- * `center` places the target mid-panel, for the opening jump to a year that is
23
- * usually a long way down the list; otherwise the target is brought just far
24
- * enough into view, which is what stepping key by key wants.
25
- */
26
- function revealWithin(panel, target, center) {
27
- const top = target.offsetTop;
28
- const bottom = top + target.offsetHeight;
29
- if (center) {
30
- panel.scrollTop = top - (panel.clientHeight - target.offsetHeight) / 2;
31
- return;
32
- }
33
- if (top < panel.scrollTop) {
34
- panel.scrollTop = top;
35
- } else if (bottom > panel.scrollTop + panel.clientHeight) {
36
- panel.scrollTop = bottom - panel.clientHeight;
37
- }
38
- }
39
10
  class YearGrid extends Component {
40
11
  #element;
41
12
  isCurrent = year => year === this.args.currentYear;
@@ -1 +1 @@
1
- {"version":3,"file":"year-grid.js","sources":["../../../../src/components/collections/calendar/year-grid.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { on } from '@ember/modifier';\nimport { fn } from '@ember/helper';\nimport { modifier } from 'ember-modifier';\n\nexport interface YearGridSignature {\n Args: {\n years: number[];\n currentYear: number;\n onSelect: (year: number) => void;\n onDismiss: () => void;\n /** The grid's accessible name. */\n label: string;\n classes: { yearGrid: string; yearCell: string };\n };\n Element: HTMLDivElement;\n}\n\n/** The grid is three columns wide, so vertical movement is by three. */\nconst COLUMNS = 3;\n\n/**\n * Scroll `target` into view inside `panel` and nowhere else.\n *\n * `scrollIntoView` and a plain `focus()` both scroll *every* scrollable\n * ancestor up to the document, so either one makes the host page jump when the\n * panel opens or when arrow keys walk past its edge. Adjusting `scrollTop`\n * directly keeps the movement inside the panel.\n *\n * The measurements come from `offsetTop`, not `getBoundingClientRect()`:\n * client rects are in transformed pixels, so under any ancestor `scale()` they\n * would not agree with `scrollTop`. This relies on the panel being the\n * `offsetParent` -- the `yearGrid` slot is positioned for exactly that reason.\n *\n * `center` places the target mid-panel, for the opening jump to a year that is\n * usually a long way down the list; otherwise the target is brought just far\n * enough into view, which is what stepping key by key wants.\n */\nfunction revealWithin(\n panel: HTMLElement,\n target: HTMLElement,\n center: boolean\n): void {\n const top = target.offsetTop;\n const bottom = top + target.offsetHeight;\n\n if (center) {\n panel.scrollTop = top - (panel.clientHeight - target.offsetHeight) / 2;\n return;\n }\n\n if (top < panel.scrollTop) {\n panel.scrollTop = top;\n } else if (bottom > panel.scrollTop + panel.clientHeight) {\n panel.scrollTop = bottom - panel.clientHeight;\n }\n}\n\nexport default class YearGrid extends Component<YearGridSignature> {\n #element: HTMLElement | undefined;\n\n isCurrent = (year: number): boolean => year === this.args.currentYear;\n\n /**\n * A year grid is opened by a deliberate action, so unlike the day grid it\n * *should* take focus -- otherwise a keyboard user opens a panel they cannot\n * reach.\n */\n setup = modifier((element: HTMLElement) => {\n this.#element = element;\n\n // `element` here is the year-grid panel's own container, which carries\n // no `data-component` of its own -- only the enclosing Calendar's root\n // does. So the \"same component\" boundary is that ancestor, not\n // `element` itself; resolve it once and filter against it, rather than\n // comparing against `element` (which would never match and would leave\n // `selected` unfindable for every real render).\n const root = element.closest('[data-component]') ?? element;\n const selected = [\n ...element.querySelectorAll<HTMLElement>(\n '[data-part=\"year-cell\"][data-selected=\"true\"]'\n )\n ].find((el) => el.closest('[data-component]') === root);\n\n // The list spans a century, so the selected year is usually far down a\n // scrolling panel. Bring it into view before focusing, or the panel opens\n // showing whichever decade happens to be at the top.\n if (selected) {\n revealWithin(element, selected, true);\n selected.focus({ preventScroll: true });\n }\n });\n\n /**\n * The panel is a single tab stop: only the year focus currently rests on is\n * tabbable, and arrow keys move both focus and that tabbability together.\n * Without this, tabbing through the calendar walks all hundred-odd years.\n *\n * Written imperatively from the keydown handler rather than derived from\n * tracked state, so focus and `tabindex` change in the same turn and neither\n * waits on a render.\n */\n #setActive(buttons: HTMLElement[], next: HTMLElement): void {\n for (const button of buttons) {\n button.tabIndex = -1;\n }\n next.tabIndex = 0;\n next.focus({ preventScroll: true });\n\n if (this.#element) {\n revealWithin(this.#element, next, false);\n }\n }\n\n handleKeydown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.args.onDismiss();\n return;\n }\n\n const step =\n event.key === 'ArrowRight'\n ? 1\n : event.key === 'ArrowLeft'\n ? -1\n : event.key === 'ArrowDown'\n ? COLUMNS\n : event.key === 'ArrowUp'\n ? -COLUMNS\n : 0;\n\n if (step === 0) {\n return;\n }\n\n event.preventDefault();\n\n // Same reasoning as `setup` above: `this.#element` is the year-grid\n // panel's own container, not the node carrying `data-component`, so the\n // \"same component\" boundary is resolved via `closest` rather than\n // compared directly against `this.#element`.\n const root = this.#element?.closest('[data-component]') ?? this.#element;\n const buttons = root\n ? [\n ...root.querySelectorAll<HTMLElement>('[data-part=\"year-cell\"]')\n ].filter((el) => el.closest('[data-component]') === root)\n : [];\n const index = buttons.indexOf(document.activeElement as HTMLElement);\n\n // `indexOf` returns -1 when focus is not on a year button. Stepping from\n // -1 would land on `buttons[0]` or `buttons[2]` rather than doing nothing,\n // so bail before the arithmetic.\n if (index < 0) {\n return;\n }\n\n const next = buttons[index + step];\n\n if (next) {\n this.#setActive(buttons, next);\n }\n };\n\n <template>\n {{! template-lint-disable no-invalid-interactive }}\n {{! The keydown listener implements the year grid's own roving keyboard\n behavior (arrow keys, Enter, Escape); the container itself stays a\n plain, non-focusable listbox role. }}\n <div\n role=\"listbox\"\n aria-label={{@label}}\n data-part=\"year-grid\"\n class={{@classes.yearGrid}}\n {{this.setup}}\n {{on \"keydown\" this.handleKeydown}}\n ...attributes\n >\n {{#each @years key=\"@identity\" as |year|}}\n <button\n type=\"button\"\n role=\"option\"\n data-part=\"year-cell\"\n data-year={{year}}\n data-selected={{if (this.isCurrent year) \"true\" \"false\"}}\n aria-selected={{if (this.isCurrent year) \"true\" \"false\"}}\n tabindex={{if (this.isCurrent year) \"0\" \"-1\"}}\n class={{@classes.yearCell}}\n {{on \"click\" (fn @onSelect year)}}\n >{{year}}</button>\n {{/each}}\n </div>\n </template>\n}\n\nexport { YearGrid };\n"],"names":["COLUMNS","revealWithin","panel","target","center","top","offsetTop","bottom","offsetHeight","scrollTop","clientHeight","YearGrid","Component","isCurrent","year","args","currentYear","setup","modifier","element","root","closest","selected","querySelectorAll","find","el","focus","preventScroll","#setActive","buttons","next","button","tabIndex","handleKeydown","event","key","preventDefault","onDismiss","step","filter","index","indexOf","document","activeElement","setComponentTemplate","precompileTemplate","strictMode","scope","on","fn"],"mappings":";;;;;;;AAkBA,wEACA,MAAMA,OAAA,GAAU,CAAA;AAEhB;;;;;;;;;;;;;;;;;AAiBA,SAASC,YAAAA,CACPC,KAAkB,EAClBC,MAAmB,EACnBC,MAAe,EACV;AACL,EAAA,MAAMC,GAAA,GAAMF,OAAOG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AA,CAAA,KAAwBD,IAAA,CAAA,GACpD,EAAE;IACN,MAAMoB,QAAQX,OAAA,CAAQY,OAAO,CAACC,QAAA,CAASC,aAAiB,CAAA;AAExD;AACA;AACA;IACA,IAAIH,QAAQ,CAAA,EAAG;AACb,MAAA;AACF,IAAA;AAEA,IAAA,MAAMV,IAAA,GAAOD,OAAO,CAACW,KAAA,GAAQF,IAAA,CAAK;AAElC,IAAA,IAAIR,IAAA,EAAM;AACR,MAAA,IAAI,CAAC,UAAU,CAACD,OAAA,EAASC,IAAA,CAAA;AAC3B,IAAA;EACF,CAAA;AAEA,EAAA;IAAAc,oBAAA,CAAAC,kBAAA,CAAA,+zBAAA,EA4BA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"year-grid.js","sources":["../../../../src/components/collections/calendar/year-grid.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { on } from '@ember/modifier';\nimport { fn } from '@ember/helper';\nimport { modifier } from 'ember-modifier';\nimport { revealWithin } from '../../../-private/reveal-within';\n\nexport interface YearGridSignature {\n Args: {\n years: number[];\n currentYear: number;\n onSelect: (year: number) => void;\n onDismiss: () => void;\n /** The grid's accessible name. */\n label: string;\n classes: { yearGrid: string; yearCell: string };\n };\n Element: HTMLDivElement;\n}\n\n/** The grid is three columns wide, so vertical movement is by three. */\nconst COLUMNS = 3;\n\nexport default class YearGrid extends Component<YearGridSignature> {\n #element: HTMLElement | undefined;\n\n isCurrent = (year: number): boolean => year === this.args.currentYear;\n\n /**\n * A year grid is opened by a deliberate action, so unlike the day grid it\n * *should* take focus -- otherwise a keyboard user opens a panel they cannot\n * reach.\n */\n setup = modifier((element: HTMLElement) => {\n this.#element = element;\n\n // `element` here is the year-grid panel's own container, which carries\n // no `data-component` of its own -- only the enclosing Calendar's root\n // does. So the \"same component\" boundary is that ancestor, not\n // `element` itself; resolve it once and filter against it, rather than\n // comparing against `element` (which would never match and would leave\n // `selected` unfindable for every real render).\n const root = element.closest('[data-component]') ?? element;\n const selected = [\n ...element.querySelectorAll<HTMLElement>(\n '[data-part=\"year-cell\"][data-selected=\"true\"]'\n )\n ].find((el) => el.closest('[data-component]') === root);\n\n // The list spans a century, so the selected year is usually far down a\n // scrolling panel. Bring it into view before focusing, or the panel opens\n // showing whichever decade happens to be at the top.\n if (selected) {\n revealWithin(element, selected, true);\n selected.focus({ preventScroll: true });\n }\n });\n\n /**\n * The panel is a single tab stop: only the year focus currently rests on is\n * tabbable, and arrow keys move both focus and that tabbability together.\n * Without this, tabbing through the calendar walks all hundred-odd years.\n *\n * Written imperatively from the keydown handler rather than derived from\n * tracked state, so focus and `tabindex` change in the same turn and neither\n * waits on a render.\n */\n #setActive(buttons: HTMLElement[], next: HTMLElement): void {\n for (const button of buttons) {\n button.tabIndex = -1;\n }\n next.tabIndex = 0;\n next.focus({ preventScroll: true });\n\n if (this.#element) {\n revealWithin(this.#element, next, false);\n }\n }\n\n handleKeydown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.args.onDismiss();\n return;\n }\n\n const step =\n event.key === 'ArrowRight'\n ? 1\n : event.key === 'ArrowLeft'\n ? -1\n : event.key === 'ArrowDown'\n ? COLUMNS\n : event.key === 'ArrowUp'\n ? -COLUMNS\n : 0;\n\n if (step === 0) {\n return;\n }\n\n event.preventDefault();\n\n // Same reasoning as `setup` above: `this.#element` is the year-grid\n // panel's own container, not the node carrying `data-component`, so the\n // \"same component\" boundary is resolved via `closest` rather than\n // compared directly against `this.#element`.\n const root = this.#element?.closest('[data-component]') ?? this.#element;\n const buttons = root\n ? [\n ...root.querySelectorAll<HTMLElement>('[data-part=\"year-cell\"]')\n ].filter((el) => el.closest('[data-component]') === root)\n : [];\n const index = buttons.indexOf(document.activeElement as HTMLElement);\n\n // `indexOf` returns -1 when focus is not on a year button. Stepping from\n // -1 would land on `buttons[0]` or `buttons[2]` rather than doing nothing,\n // so bail before the arithmetic.\n if (index < 0) {\n return;\n }\n\n const next = buttons[index + step];\n\n if (next) {\n this.#setActive(buttons, next);\n }\n };\n\n <template>\n {{! template-lint-disable no-invalid-interactive }}\n {{! The keydown listener implements the year grid's own roving keyboard\n behavior (arrow keys, Enter, Escape); the container itself stays a\n plain, non-focusable listbox role. }}\n <div\n role=\"listbox\"\n aria-label={{@label}}\n data-part=\"year-grid\"\n class={{@classes.yearGrid}}\n {{this.setup}}\n {{on \"keydown\" this.handleKeydown}}\n ...attributes\n >\n {{#each @years key=\"@identity\" as |year|}}\n <button\n type=\"button\"\n role=\"option\"\n data-part=\"year-cell\"\n data-year={{year}}\n data-selected={{if (this.isCurrent year) \"true\" \"false\"}}\n aria-selected={{if (this.isCurrent year) \"true\" \"false\"}}\n tabindex={{if (this.isCurrent year) \"0\" \"-1\"}}\n class={{@classes.yearCell}}\n {{on \"click\" (fn @onSelect year)}}\n >{{year}}</button>\n {{/each}}\n </div>\n </template>\n}\n\nexport { YearGrid };\n"],"names":["COLUMNS","YearGrid","Component","isCurrent","year","args","currentYear","setup","modifier","element","root","closest","selected","querySelectorAll","find","el","revealWithin","focus","preventScroll","#setActive","buttons","next","button","tabIndex","handleKeydown","event","key","preventDefault","onDismiss","step","filter","index","indexOf","document","activeElement","setComponentTemplate","precompileTemplate","strictMode","scope","on","fn"],"mappings":";;;;;;;;AAmBA,wEACA,MAAMA,OAAA,GAAU,CAAA;AAED,MAAMC,iBAAiBC,SAAA,CAAU;AAC9C,EAAA,QAAQ;EAERC,SAAA,GAAaC,IAAY,IAAcA,IAAA,KAAS,IAAI,CAACC,IAAI,CAACC,WAAW;AAErE;;;;;AAKAC,EAAAA,KAAA,GAAQC,QAAA,CAAUC,OAAS,IAAA;AACzB,IAAA,IAAI,CAAC,QAAQ,GAAGA,OAAA;AAEhB;AACA;AACA;AACA;AACA;AACA;IACA,MAAMC,IAAA,GA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GAAG,KAAK,SAAA,GACZ,CAAC1B,OAAA,GACD,CAAA;IAEZ,IAAI6B,SAAS,CAAA,EAAG;AACd,MAAA;AACF,IAAA;IAEAJ,KAAA,CAAME,cAAc,EAAA;AAEpB;AACA;AACA;AACA;AACA,IAAA,MAAMjB,IAAA,GAAO,IAAI,CAAC,QAAQ,EAAEC,OAAA,CAAQ,kBAAA,CAAA,IAAuB,IAAI,CAAC,QAAQ;AACxE,IAAA,MAAMS,UAAUV,IAAA,GACZ,IACKA,IAAA,CAAKG,gBAAgB,CAAc,yBAAA,CAAA,CACvC,CAACiB,MAAM,CAAEf,EAAA,IAAOA,GAAGJ,OAAO,CAAC,kBAAA,CAAA,KAAwBD,IAAA,CAAA,GACpD,EAAE;IACN,MAAMqB,QAAQX,OAAA,CAAQY,OAAO,CAACC,QAAA,CAASC,aAAiB,CAAA;AAExD;AACA;AACA;IACA,IAAIH,QAAQ,CAAA,EAAG;AACb,MAAA;AACF,IAAA;AAEA,IAAA,MAAMV,IAAA,GAAOD,OAAO,CAACW,KAAA,GAAQF,IAAA,CAAK;AAElC,IAAA,IAAIR,IAAA,EAAM;AACR,MAAA,IAAI,CAAC,UAAU,CAACD,OAAA,EAASC,IAAA,CAAA;AAC3B,IAAA;EACF,CAAA;AAEA,EAAA;IAAAc,oBAAA,CAAAC,kBAAA,CAAA,+zBAAA,EA4BA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -288,5 +288,5 @@ class SegmentGroup extends Component {
288
288
  }
289
289
  }
290
290
 
291
- export { SegmentGroup, SegmentGroup as default };
291
+ export { DEFAULT_LABELS as DEFAULT_SEGMENT_LABELS, SegmentGroup, SegmentGroup as default };
292
292
  //# sourceMappingURL=segment-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment-group.js","sources":["../../../../src/components/forms/date-input/segment-group.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached } from '@glimmer/tracking';\nimport { fn } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport {\n isSegment,\n applyDigit,\n applyLetter,\n commitSegment,\n step,\n clearSegment,\n deleteDigit,\n displaySegment\n} from './segments';\nimport { parsePasted, formatForClipboard, splitRange } from './clipboard';\nimport type {\n Part,\n Segment,\n SegmentType,\n SegmentGroupClasses,\n SegmentGroupUserClasses\n} from './types';\n\ninterface SegmentGroupSignature {\n Args: {\n parts: Part[];\n /** Hands the whole list back; the group holds no state of its own. */\n onPartsChange: (parts: Part[]) => void;\n /**\n * Offered text that reads as two dates rather than one. Only `DatePicker`\n * in `@mode=\"range\"` supplies it, and only to its *start* group: pasting\n * a range into the end of a field and having it rewrite the start would\n * be surprising. Without it, such text is simply declined.\n */\n onRangePaste?: (start: Part[], end: Part[]) => void;\n locale: string;\n placeholderValue: Date;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n /** Rendered as the group's own id, so a `<label for>` can target it. */\n id?: string;\n /**\n * The field's name. A `role=\"group\"` is not a labelable element, so a\n * sibling `<label for>` does not name it on its own -- this does.\n */\n label?: string;\n labelledBy?: string;\n describedBy?: string;\n segmentLabels?: Partial<Record<SegmentType, string>>;\n /**\n * Only the three slots this group renders, so that `DateInput`'s\n * `dateInput` recipe and `DatePicker`'s `datePicker` recipe both satisfy\n * it. See {@link SegmentGroupClasses}.\n */\n classes: SegmentGroupClasses;\n userClasses?: SegmentGroupUserClasses;\n };\n Element: HTMLDivElement;\n}\n\nconst DEFAULT_LABELS: Record<SegmentType, string> = {\n year: 'year',\n month: 'month',\n day: 'day',\n hour: 'hour',\n minute: 'minute',\n dayPeriod: 'AM/PM'\n};\n\n/** How much PageUp/PageDown moves, per segment. */\nconst PAGE_STEP: Record<SegmentType, number> = {\n day: 7,\n month: 3,\n year: 10,\n hour: 2,\n minute: 15,\n dayPeriod: 1\n};\n\n/**\n * Everything one rendered part needs, resolved to primitives.\n *\n * The template cannot narrow the `Part` union -- `eq` is unavailable and Glint\n * does not carry a type predicate through `{{#if}}` -- so the narrowing happens\n * here, in TypeScript, and the template only ever reads optional primitives.\n * That keeps `part.type` off a `LiteralPart` without a cast anywhere.\n */\ninterface Cell {\n index: number;\n isSegment: boolean;\n /** The segment's display text, or the literal's text. */\n text: string;\n type?: SegmentType;\n isEmpty: boolean;\n label?: string;\n /** `text` for AM/PM, typed by letter; `numeric` for everything else. */\n inputMode: 'numeric' | 'text';\n valueNow?: number;\n valueMin?: number;\n valueMax?: number;\n valueText?: string;\n}\n\n/**\n * One row of date segments. Private: `DateInput` and `DatePicker` both render\n * it, and neither wants the other's `FormControl` wrapper.\n */\nclass SegmentGroup extends Component<SegmentGroupSignature> {\n get isEditable(): boolean {\n return !this.args.isDisabled && !this.args.isReadOnly;\n }\n\n labelFor = (type: SegmentType): string =>\n this.args.segmentLabels?.[type] ?? DEFAULT_LABELS[type];\n\n /**\n * Built once per locale rather than inside {@link valueTextFor}: `cells`\n * recomputes on every keystroke, and an `Intl` constructor is expensive\n * enough that building one per keypress is the costliest thing this\n * component would otherwise do.\n */\n @cached\n get monthNames(): Intl.DateTimeFormat {\n return new Intl.DateTimeFormat(this.args.locale, { month: 'long' });\n }\n\n /**\n * What a screen reader reads instead of the raw number. A month is read by\n * name -- \"January\", not \"1\" -- which is the whole point of `aria-valuetext`.\n */\n valueTextFor = (segment: Segment): string | undefined => {\n if (segment.value === null) return undefined;\n if (segment.labels) return segment.labels[segment.value];\n if (segment.type !== 'month') return String(segment.value);\n\n // Any year and day will do; only the month is read back out.\n return this.monthNames.format(new Date(2026, segment.value - 1, 1));\n };\n\n @cached\n get cells(): Cell[] {\n return this.args.parts.map((part, index) => {\n if (!isSegment(part)) {\n return {\n index,\n isSegment: false,\n isEmpty: false,\n text: part.text,\n inputMode: 'numeric'\n };\n }\n\n return {\n index,\n isSegment: true,\n text: displaySegment(part),\n type: part.type,\n isEmpty: part.value === null,\n label: this.labelFor(part.type),\n inputMode: part.labels ? 'text' : 'numeric',\n // `undefined` rather than `null`: an empty segment has no current\n // value, and `aria-valuenow=\"null\"` would be a value of sorts.\n valueNow: part.value ?? undefined,\n valueMin: part.min,\n valueMax: part.max,\n valueText: this.valueTextFor(part)\n };\n });\n }\n\n /** The segment elements, in document order -- the focus order too. */\n private segmentElements(from: HTMLElement): HTMLElement[] {\n const group = from.closest('[data-part=\"group\"]');\n return group\n ? Array.from(group.querySelectorAll<HTMLElement>('[data-part=\"segment\"]'))\n : [];\n }\n\n /**\n * Left and right are *visual* directions, so in an RTL locale they run\n * against document order: pressing the left arrow in `yyyy/mm/dd` laid out\n * right-to-left should move to the segment drawn to the left, which is the\n * later one in the DOM.\n */\n private focusSibling(from: HTMLElement, delta: number): void {\n const all = this.segmentElements(from);\n const step = this.isRtl(from) ? -delta : delta;\n const next = all[all.indexOf(from) + step];\n next?.focus();\n }\n\n private isRtl(from: HTMLElement): boolean {\n const group = from.closest<HTMLElement>('[data-part=\"group\"]') ?? from;\n return getComputedStyle(group).direction === 'rtl';\n }\n\n private focusEdge(from: HTMLElement, edge: 'first' | 'last'): void {\n const all = this.segmentElements(from);\n (edge === 'first' ? all[0] : all[all.length - 1])?.focus();\n }\n\n /** Replaces one segment by index and reports the new list. */\n private replace(index: number, segment: Segment): void {\n const next = this.args.parts.map((part, i) =>\n i === index ? segment : part\n );\n this.args.onPartsChange(next);\n }\n\n handleKeyDown = (index: number, event: KeyboardEvent): void => {\n const part = this.args.parts[index];\n if (!part || !isSegment(part)) return;\n\n const element = event.target as HTMLElement;\n const { key } = event;\n\n // Navigation works even when the field is read-only; editing does not.\n if (key === 'ArrowRight') {\n event.preventDefault();\n this.focusSibling(element, 1);\n return;\n }\n if (key === 'ArrowLeft') {\n event.preventDefault();\n this.focusSibling(element, -1);\n return;\n }\n if (key === 'Home') {\n event.preventDefault();\n this.focusEdge(element, 'first');\n return;\n }\n if (key === 'End') {\n event.preventDefault();\n this.focusEdge(element, 'last');\n return;\n }\n\n if (!this.isEditable) return;\n\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n event.preventDefault();\n const delta = key === 'ArrowUp' ? 1 : -1;\n this.replace(index, step(part, delta, this.args.placeholderValue));\n return;\n }\n\n if (key === 'PageUp' || key === 'PageDown') {\n event.preventDefault();\n const magnitude = PAGE_STEP[part.type];\n const delta = key === 'PageUp' ? magnitude : -magnitude;\n this.replace(index, step(part, delta, this.args.placeholderValue));\n return;\n }\n\n if (key === 'Backspace') {\n event.preventDefault();\n this.replace(index, deleteDigit(part));\n return;\n }\n\n if (key === 'Delete') {\n event.preventDefault();\n this.replace(index, clearSegment(part));\n return;\n }\n\n if (/^\\d$/.test(key)) {\n event.preventDefault();\n // AM/PM has no digits to take.\n if (part.labels) return;\n const { segment, isFull } = applyDigit(part, key);\n this.replace(index, segment);\n // Advancing before the DOM has caught up is safe: the segment elements\n // are keyed by index and are updated, never re-created.\n if (isFull) this.focusSibling(element, 1);\n return;\n }\n\n if (part.labels && key.length === 1 && !event.metaKey && !event.ctrlKey) {\n event.preventDefault();\n const { segment, isFull } = applyLetter(part, key);\n if (segment !== part) this.replace(index, segment);\n if (isFull) this.focusSibling(element, 1);\n return;\n }\n\n // Everything else -- letters, symbols -- would otherwise be inserted into\n // the contenteditable span as literal text.\n if (key.length === 1 && !event.metaKey && !event.ctrlKey) {\n event.preventDefault();\n }\n };\n\n /**\n * Leaving a segment finishes it: the digits in it stop being something the\n * user is still typing and become their answer, which is what turns a typed\n * `26` into 2026. Tab, arrow-key navigation and a click elsewhere all arrive\n * here, because moving focus is the one thing they have in common.\n */\n handleFocusOut = (index: number): void => {\n if (!this.isEditable) return;\n\n const part = this.args.parts[index];\n if (!part || !isSegment(part) || part.isCommitted) return;\n\n const committed = commitSegment(part);\n // An empty segment commits to itself; reporting it would be churn.\n if (committed !== part) this.replace(index, committed);\n };\n\n /**\n * `contenteditable`'s hazard: anything not handled above arrives here and\n * would be written into the span's DOM, desynchronising the display from the\n * model. Every input type is refused; the model is the only writer.\n */\n handleBeforeInput = (event: Event): void => {\n event.preventDefault();\n };\n\n /**\n * Always `preventDefault`: the browser would otherwise write the pasted text\n * into the contenteditable span, and the model would no longer describe what\n * is on screen. Unparseable text is dropped silently -- a date field that\n * guessed would be worse than one that declined.\n */\n handlePaste = (event: ClipboardEvent): void => {\n event.preventDefault();\n if (!this.isEditable) return;\n\n const text = event.clipboardData?.getData('text/plain') ?? '';\n const parsed = parsePasted(text, this.args.parts);\n if (parsed) {\n this.args.onPartsChange(parsed);\n return;\n }\n\n this.tryRangePaste(text);\n };\n\n /**\n * A second reading of text a single date could not be made of.\n *\n * Both halves are parsed against *this* group's parts, which is sound\n * because the two groups of a range are built from the same locale and\n * format and so have identical shape, and because a half only counts when\n * it parses in full -- nothing of this group's own state survives into the\n * list handed to the other one.\n */\n private tryRangePaste(text: string): void {\n const onRangePaste = this.args.onRangePaste;\n if (!onRangePaste) return;\n\n const halves = splitRange(text);\n if (!halves) return;\n\n const start = parsePasted(halves[0], this.args.parts);\n const end = parsePasted(halves[1], this.args.parts);\n if (start && end) onRangePaste(start, end);\n }\n\n handleCopy = (event: ClipboardEvent): void => {\n event.preventDefault();\n event.clipboardData?.setData(\n 'text/plain',\n formatForClipboard(this.args.parts)\n );\n };\n\n handleCut = (event: ClipboardEvent): void => {\n this.handleCopy(event);\n if (!this.isEditable) return;\n\n this.args.onPartsChange(\n this.args.parts.map((p) => (isSegment(p) ? clearSegment(p) : p))\n );\n };\n\n <template>\n <div\n role=\"group\"\n data-part=\"group\"\n id={{@id}}\n aria-label={{@label}}\n aria-labelledby={{@labelledBy}}\n aria-describedby={{@describedBy}}\n aria-disabled={{if @isDisabled \"true\"}}\n {{! `role=\"group\"` supports neither aria-readonly nor aria-invalid --\n neither is global in ARIA 1.2, and ember-template-lint's\n no-unsupported-role-attributes is right to reject them here (its\n autofixer deletes them silently, which is how they went missing\n once already). Both live on the spinbuttons below instead, where\n the role does support them and where assistive technology actually\n lands. These data attributes carry the same state for styling and\n for tests. }}\n data-readonly={{if @isReadOnly \"true\" \"false\"}}\n data-invalid={{if @isInvalid \"true\" \"false\"}}\n class={{@classes.group class=@userClasses.group}}\n {{on \"paste\" this.handlePaste}}\n {{on \"copy\" this.handleCopy}}\n {{on \"cut\" this.handleCut}}\n ...attributes\n >\n {{#each this.cells key=\"index\" as |cell|}}\n {{#if cell.isSegment}}\n <span\n role=\"spinbutton\"\n tabindex={{unless @isDisabled \"0\"}}\n contenteditable={{if this.isEditable \"true\" \"false\"}}\n inputmode={{cell.inputMode}}\n spellcheck=\"false\"\n autocorrect=\"off\"\n data-part=\"segment\"\n data-type={{cell.type}}\n data-placeholder={{if cell.isEmpty \"true\" \"false\"}}\n data-disabled={{if @isDisabled \"true\" \"false\"}}\n aria-readonly={{if @isReadOnly \"true\"}}\n aria-invalid={{if @isInvalid \"true\"}}\n aria-label={{cell.label}}\n aria-valuenow={{cell.valueNow}}\n aria-valuemin={{cell.valueMin}}\n aria-valuemax={{cell.valueMax}}\n aria-valuetext={{cell.valueText}}\n class={{@classes.segment class=@userClasses.segment}}\n {{on \"keydown\" (fn this.handleKeyDown cell.index)}}\n {{on \"focusout\" (fn this.handleFocusOut cell.index)}}\n {{on \"beforeinput\" this.handleBeforeInput}}\n >{{cell.text}}</span>\n {{else}}\n <span\n data-part=\"literal\"\n aria-hidden=\"true\"\n class={{@classes.literal class=@userClasses.literal}}\n >{{cell.text}}</span>\n {{/if}}\n {{/each}}\n </div>\n </template>\n}\n\nexport { SegmentGroup, type SegmentGroupSignature };\nexport default SegmentGroup;\n"],"names":["DEFAULT_LABELS","year","month","day","hour","minute","dayPeriod","PAGE_STEP","SegmentGroup","Component","isEditable","args","isDisabled","isReadOnly","labelFor","type","segmentLabels","monthNames","Intl","DateTimeFormat","locale","n","prototype","cached","valueTextFor","segment","value","undefined","labels","String","format","Date","cells","parts","map","part","index","isSegment","isEmpty","text","inputMode","displaySegment","label","valueNow","valueMin","min","valueMax","max","valueText","segmentElements","from","group","closest","Array","querySelectorAll","focusSibling","delta","all","step","isRtl","next","indexOf","focus","getComputedStyle","direction","focusEdge","edge","length","replace","i","onPartsChange","handleKeyDown","event","element","target","key","preventDefault","placeholderValue","magnitude","deleteDigit","clearSegment","test","isFull","applyDigit","metaKey","ctrlKey","applyLetter","handleFocusOut","isCommitted","committed","commitSegment","handleBeforeInput","handlePaste","clipboardData","getData","parsed","parsePasted","tryRangePaste","onRangePaste","halves","splitRange","start","end","handleCopy","setData","formatForClipboard","handleCut","p","setComponentTemplate","precompileTemplate","strictMode","scope","on","fn"],"mappings":";;;;;;;;;;AA6DA,MAAMA,cAA0C,GAAI;AAClDC,EAAAA,IAAA,EAAM,MAAA;AACNC,EAAAA,KAAA,EAAO,OAAA;AACPC,EAAAA,GAAA,EAAK,KAAA;AACLC,EAAAA,IAAA,EAAM,MAAA;AACNC,EAAAA,MAAA,EAAQ,QAAA;AACRC,EAAAA,SAAA,EAAW;AACb,CAAA;AAEA;AACA,MAAMC,SAAqC,GAAI;AAC7CJ,EAAAA,GAAA,EAAK,CAAA;AACLD,EAAAA,KAAA,EAAO,CAAA;AACPD,EAAAA,IAAA,EAAM,EAAA;AACNG,EAAAA,IAAA,EAAM,CAAA;AACNC,EAAAA,MAAA,EAAQ,EAAA;AACRC,EAAAA,SAAA,EAAW;AACb,CAAA;AAEA;;;;;;;;;AAwBA;;;;AAIA,MAAME,qBAAqBC,SAAA,CAAU;EACnC,IAAIC,UAAAA,GAAsB;AACxB,IAAA,OAAO,CAAC,IAAI,CAACC,IAAI,CAACC,UAAU,IAAI,CAAC,IAAI,CAACD,IAAI,CAACE,UAAU;AACvD,EAAA;AAEAC,EAAAA,QAAA,GAAYC,IAAM,IAChB,IAAI,CAACJ,IAAI,CAACK,aAAa,GAAGD,IAAA,CAAK,IAAIf,cAAc,CAACe,KAAK;AAEzD;;;;;AAKC;EACD,IACIE,UAAAA,GAAkC;IACpC,OAAO,IAAIC,KAAKC,cAAc,CAAC,IA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AAA,MAAME,KAAA,GAAQL,WAAA,CAAYG,MAAM,CAAC,CAAA,CAAE,EAAE,IAAI,CAACxF,IAAI,CAACsB,KAAK,CAAA;AACpD,IAAA,MAAMqE,GAAA,GAAMN,WAAA,CAAYG,MAAM,CAAC,CAAA,CAAE,EAAE,IAAI,CAACxF,IAAI,CAACsB,KAAK,CAAA;IAClD,IAAIoE,KAAA,IAASC,GAAA,EAAKJ,YAAA,CAAaG,KAAA,EAAOC,GAAA,CAAA;AACxC,EAAA;EAEAC,UAAA,GAAc/B,KAAO,IAAqB;IACxCA,KAAA,CAAMI,cAAc,EAAA;AACpBJ,IAAAA,KAAA,CAAMqB,aAAa,EAAEW,OAAA,CACnB,YAAA,EACAC,mBAAmB,IAAI,CAAC9F,IAAI,CAACsB,KAAK,CAAA,CAAA;EAEtC,CAAA;EAEAyE,SAAA,GAAalC,KAAO,IAAqB;AACvC,IAAA,IAAI,CAAC+B,UAAU,CAAC/B,KAAA,CAAA;AAChB,IAAA,IAAI,CAAC,IAAI,CAAC9D,UAAU,EAAE;IAEtB,IAAI,CAACC,IAAI,CAAC2D,aAAa,CACrB,IAAI,CAAC3D,IAAI,CAACsB,KAAK,CAACC,GAAG,CAAEyE,CAAA,IAAOtE,UAAUsE,CAAA,CAAA,GAAK3B,YAAA,CAAa2B,KAAKA,CAAC,CAAA,CAAA;EAElE,CAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,6/DAAA,EA2DA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
1
+ {"version":3,"file":"segment-group.js","sources":["../../../../src/components/forms/date-input/segment-group.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached } from '@glimmer/tracking';\nimport { fn } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport {\n isSegment,\n applyDigit,\n applyLetter,\n commitSegment,\n step,\n clearSegment,\n deleteDigit,\n displaySegment\n} from './segments';\nimport { parsePasted, formatForClipboard, splitRange } from './clipboard';\nimport type {\n Part,\n Segment,\n SegmentType,\n SegmentGroupClasses,\n SegmentGroupUserClasses\n} from './types';\n\ninterface SegmentGroupSignature {\n Args: {\n parts: Part[];\n /** Hands the whole list back; the group holds no state of its own. */\n onPartsChange: (parts: Part[]) => void;\n /**\n * Offered text that reads as two dates rather than one. Only `DatePicker`\n * in `@mode=\"range\"` supplies it, and only to its *start* group: pasting\n * a range into the end of a field and having it rewrite the start would\n * be surprising. Without it, such text is simply declined.\n */\n onRangePaste?: (start: Part[], end: Part[]) => void;\n locale: string;\n placeholderValue: Date;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n /** Rendered as the group's own id, so a `<label for>` can target it. */\n id?: string;\n /**\n * The field's name. A `role=\"group\"` is not a labelable element, so a\n * sibling `<label for>` does not name it on its own -- this does.\n */\n label?: string;\n labelledBy?: string;\n describedBy?: string;\n segmentLabels?: Partial<Record<SegmentType, string>>;\n /**\n * Only the three slots this group renders, so that `DateInput`'s\n * `dateInput` recipe and `DatePicker`'s `datePicker` recipe both satisfy\n * it. See {@link SegmentGroupClasses}.\n */\n classes: SegmentGroupClasses;\n userClasses?: SegmentGroupUserClasses;\n };\n Element: HTMLDivElement;\n}\n\nconst DEFAULT_LABELS: Record<SegmentType, string> = {\n year: 'year',\n month: 'month',\n day: 'day',\n hour: 'hour',\n minute: 'minute',\n dayPeriod: 'AM/PM'\n};\n\n/** How much PageUp/PageDown moves, per segment. */\nconst PAGE_STEP: Record<SegmentType, number> = {\n day: 7,\n month: 3,\n year: 10,\n hour: 2,\n minute: 15,\n dayPeriod: 1\n};\n\n/**\n * Everything one rendered part needs, resolved to primitives.\n *\n * The template cannot narrow the `Part` union -- `eq` is unavailable and Glint\n * does not carry a type predicate through `{{#if}}` -- so the narrowing happens\n * here, in TypeScript, and the template only ever reads optional primitives.\n * That keeps `part.type` off a `LiteralPart` without a cast anywhere.\n */\ninterface Cell {\n index: number;\n isSegment: boolean;\n /** The segment's display text, or the literal's text. */\n text: string;\n type?: SegmentType;\n isEmpty: boolean;\n label?: string;\n /** `text` for AM/PM, typed by letter; `numeric` for everything else. */\n inputMode: 'numeric' | 'text';\n valueNow?: number;\n valueMin?: number;\n valueMax?: number;\n valueText?: string;\n}\n\n/**\n * One row of date segments. Private: `DateInput` and `DatePicker` both render\n * it, and neither wants the other's `FormControl` wrapper.\n */\nclass SegmentGroup extends Component<SegmentGroupSignature> {\n get isEditable(): boolean {\n return !this.args.isDisabled && !this.args.isReadOnly;\n }\n\n labelFor = (type: SegmentType): string =>\n this.args.segmentLabels?.[type] ?? DEFAULT_LABELS[type];\n\n /**\n * Built once per locale rather than inside {@link valueTextFor}: `cells`\n * recomputes on every keystroke, and an `Intl` constructor is expensive\n * enough that building one per keypress is the costliest thing this\n * component would otherwise do.\n */\n @cached\n get monthNames(): Intl.DateTimeFormat {\n return new Intl.DateTimeFormat(this.args.locale, { month: 'long' });\n }\n\n /**\n * What a screen reader reads instead of the raw number. A month is read by\n * name -- \"January\", not \"1\" -- which is the whole point of `aria-valuetext`.\n */\n valueTextFor = (segment: Segment): string | undefined => {\n if (segment.value === null) return undefined;\n if (segment.labels) return segment.labels[segment.value];\n if (segment.type !== 'month') return String(segment.value);\n\n // Any year and day will do; only the month is read back out.\n return this.monthNames.format(new Date(2026, segment.value - 1, 1));\n };\n\n @cached\n get cells(): Cell[] {\n return this.args.parts.map((part, index) => {\n if (!isSegment(part)) {\n return {\n index,\n isSegment: false,\n isEmpty: false,\n text: part.text,\n inputMode: 'numeric'\n };\n }\n\n return {\n index,\n isSegment: true,\n text: displaySegment(part),\n type: part.type,\n isEmpty: part.value === null,\n label: this.labelFor(part.type),\n inputMode: part.labels ? 'text' : 'numeric',\n // `undefined` rather than `null`: an empty segment has no current\n // value, and `aria-valuenow=\"null\"` would be a value of sorts.\n valueNow: part.value ?? undefined,\n valueMin: part.min,\n valueMax: part.max,\n valueText: this.valueTextFor(part)\n };\n });\n }\n\n /** The segment elements, in document order -- the focus order too. */\n private segmentElements(from: HTMLElement): HTMLElement[] {\n const group = from.closest('[data-part=\"group\"]');\n return group\n ? Array.from(group.querySelectorAll<HTMLElement>('[data-part=\"segment\"]'))\n : [];\n }\n\n /**\n * Left and right are *visual* directions, so in an RTL locale they run\n * against document order: pressing the left arrow in `yyyy/mm/dd` laid out\n * right-to-left should move to the segment drawn to the left, which is the\n * later one in the DOM.\n */\n private focusSibling(from: HTMLElement, delta: number): void {\n const all = this.segmentElements(from);\n const step = this.isRtl(from) ? -delta : delta;\n const next = all[all.indexOf(from) + step];\n next?.focus();\n }\n\n private isRtl(from: HTMLElement): boolean {\n const group = from.closest<HTMLElement>('[data-part=\"group\"]') ?? from;\n return getComputedStyle(group).direction === 'rtl';\n }\n\n private focusEdge(from: HTMLElement, edge: 'first' | 'last'): void {\n const all = this.segmentElements(from);\n (edge === 'first' ? all[0] : all[all.length - 1])?.focus();\n }\n\n /** Replaces one segment by index and reports the new list. */\n private replace(index: number, segment: Segment): void {\n const next = this.args.parts.map((part, i) =>\n i === index ? segment : part\n );\n this.args.onPartsChange(next);\n }\n\n handleKeyDown = (index: number, event: KeyboardEvent): void => {\n const part = this.args.parts[index];\n if (!part || !isSegment(part)) return;\n\n const element = event.target as HTMLElement;\n const { key } = event;\n\n // Navigation works even when the field is read-only; editing does not.\n if (key === 'ArrowRight') {\n event.preventDefault();\n this.focusSibling(element, 1);\n return;\n }\n if (key === 'ArrowLeft') {\n event.preventDefault();\n this.focusSibling(element, -1);\n return;\n }\n if (key === 'Home') {\n event.preventDefault();\n this.focusEdge(element, 'first');\n return;\n }\n if (key === 'End') {\n event.preventDefault();\n this.focusEdge(element, 'last');\n return;\n }\n\n if (!this.isEditable) return;\n\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n event.preventDefault();\n const delta = key === 'ArrowUp' ? 1 : -1;\n this.replace(index, step(part, delta, this.args.placeholderValue));\n return;\n }\n\n if (key === 'PageUp' || key === 'PageDown') {\n event.preventDefault();\n const magnitude = PAGE_STEP[part.type];\n const delta = key === 'PageUp' ? magnitude : -magnitude;\n this.replace(index, step(part, delta, this.args.placeholderValue));\n return;\n }\n\n if (key === 'Backspace') {\n event.preventDefault();\n this.replace(index, deleteDigit(part));\n return;\n }\n\n if (key === 'Delete') {\n event.preventDefault();\n this.replace(index, clearSegment(part));\n return;\n }\n\n if (/^\\d$/.test(key)) {\n event.preventDefault();\n // AM/PM has no digits to take.\n if (part.labels) return;\n const { segment, isFull } = applyDigit(part, key);\n this.replace(index, segment);\n // Advancing before the DOM has caught up is safe: the segment elements\n // are keyed by index and are updated, never re-created.\n if (isFull) this.focusSibling(element, 1);\n return;\n }\n\n if (part.labels && key.length === 1 && !event.metaKey && !event.ctrlKey) {\n event.preventDefault();\n const { segment, isFull } = applyLetter(part, key);\n if (segment !== part) this.replace(index, segment);\n if (isFull) this.focusSibling(element, 1);\n return;\n }\n\n // Everything else -- letters, symbols -- would otherwise be inserted into\n // the contenteditable span as literal text.\n if (key.length === 1 && !event.metaKey && !event.ctrlKey) {\n event.preventDefault();\n }\n };\n\n /**\n * Leaving a segment finishes it: the digits in it stop being something the\n * user is still typing and become their answer, which is what turns a typed\n * `26` into 2026. Tab, arrow-key navigation and a click elsewhere all arrive\n * here, because moving focus is the one thing they have in common.\n */\n handleFocusOut = (index: number): void => {\n if (!this.isEditable) return;\n\n const part = this.args.parts[index];\n if (!part || !isSegment(part) || part.isCommitted) return;\n\n const committed = commitSegment(part);\n // An empty segment commits to itself; reporting it would be churn.\n if (committed !== part) this.replace(index, committed);\n };\n\n /**\n * `contenteditable`'s hazard: anything not handled above arrives here and\n * would be written into the span's DOM, desynchronising the display from the\n * model. Every input type is refused; the model is the only writer.\n */\n handleBeforeInput = (event: Event): void => {\n event.preventDefault();\n };\n\n /**\n * Always `preventDefault`: the browser would otherwise write the pasted text\n * into the contenteditable span, and the model would no longer describe what\n * is on screen. Unparseable text is dropped silently -- a date field that\n * guessed would be worse than one that declined.\n */\n handlePaste = (event: ClipboardEvent): void => {\n event.preventDefault();\n if (!this.isEditable) return;\n\n const text = event.clipboardData?.getData('text/plain') ?? '';\n const parsed = parsePasted(text, this.args.parts);\n if (parsed) {\n this.args.onPartsChange(parsed);\n return;\n }\n\n this.tryRangePaste(text);\n };\n\n /**\n * A second reading of text a single date could not be made of.\n *\n * Both halves are parsed against *this* group's parts, which is sound\n * because the two groups of a range are built from the same locale and\n * format and so have identical shape, and because a half only counts when\n * it parses in full -- nothing of this group's own state survives into the\n * list handed to the other one.\n */\n private tryRangePaste(text: string): void {\n const onRangePaste = this.args.onRangePaste;\n if (!onRangePaste) return;\n\n const halves = splitRange(text);\n if (!halves) return;\n\n const start = parsePasted(halves[0], this.args.parts);\n const end = parsePasted(halves[1], this.args.parts);\n if (start && end) onRangePaste(start, end);\n }\n\n handleCopy = (event: ClipboardEvent): void => {\n event.preventDefault();\n event.clipboardData?.setData(\n 'text/plain',\n formatForClipboard(this.args.parts)\n );\n };\n\n handleCut = (event: ClipboardEvent): void => {\n this.handleCopy(event);\n if (!this.isEditable) return;\n\n this.args.onPartsChange(\n this.args.parts.map((p) => (isSegment(p) ? clearSegment(p) : p))\n );\n };\n\n <template>\n <div\n role=\"group\"\n data-part=\"group\"\n id={{@id}}\n aria-label={{@label}}\n aria-labelledby={{@labelledBy}}\n aria-describedby={{@describedBy}}\n aria-disabled={{if @isDisabled \"true\"}}\n {{! `role=\"group\"` supports neither aria-readonly nor aria-invalid --\n neither is global in ARIA 1.2, and ember-template-lint's\n no-unsupported-role-attributes is right to reject them here (its\n autofixer deletes them silently, which is how they went missing\n once already). Both live on the spinbuttons below instead, where\n the role does support them and where assistive technology actually\n lands. These data attributes carry the same state for styling and\n for tests. }}\n data-readonly={{if @isReadOnly \"true\" \"false\"}}\n data-invalid={{if @isInvalid \"true\" \"false\"}}\n class={{@classes.group class=@userClasses.group}}\n {{on \"paste\" this.handlePaste}}\n {{on \"copy\" this.handleCopy}}\n {{on \"cut\" this.handleCut}}\n ...attributes\n >\n {{#each this.cells key=\"index\" as |cell|}}\n {{#if cell.isSegment}}\n <span\n role=\"spinbutton\"\n tabindex={{unless @isDisabled \"0\"}}\n contenteditable={{if this.isEditable \"true\" \"false\"}}\n inputmode={{cell.inputMode}}\n spellcheck=\"false\"\n autocorrect=\"off\"\n data-part=\"segment\"\n data-type={{cell.type}}\n data-placeholder={{if cell.isEmpty \"true\" \"false\"}}\n data-disabled={{if @isDisabled \"true\" \"false\"}}\n aria-readonly={{if @isReadOnly \"true\"}}\n aria-invalid={{if @isInvalid \"true\"}}\n aria-label={{cell.label}}\n aria-valuenow={{cell.valueNow}}\n aria-valuemin={{cell.valueMin}}\n aria-valuemax={{cell.valueMax}}\n aria-valuetext={{cell.valueText}}\n class={{@classes.segment class=@userClasses.segment}}\n {{on \"keydown\" (fn this.handleKeyDown cell.index)}}\n {{on \"focusout\" (fn this.handleFocusOut cell.index)}}\n {{on \"beforeinput\" this.handleBeforeInput}}\n >{{cell.text}}</span>\n {{else}}\n <span\n data-part=\"literal\"\n aria-hidden=\"true\"\n class={{@classes.literal class=@userClasses.literal}}\n >{{cell.text}}</span>\n {{/if}}\n {{/each}}\n </div>\n </template>\n}\n\nexport {\n SegmentGroup,\n DEFAULT_LABELS as DEFAULT_SEGMENT_LABELS,\n type SegmentGroupSignature\n};\nexport default SegmentGroup;\n"],"names":["DEFAULT_LABELS","year","month","day","hour","minute","dayPeriod","PAGE_STEP","SegmentGroup","Component","isEditable","args","isDisabled","isReadOnly","labelFor","type","segmentLabels","monthNames","Intl","DateTimeFormat","locale","n","prototype","cached","valueTextFor","segment","value","undefined","labels","String","format","Date","cells","parts","map","part","index","isSegment","isEmpty","text","inputMode","displaySegment","label","valueNow","valueMin","min","valueMax","max","valueText","segmentElements","from","group","closest","Array","querySelectorAll","focusSibling","delta","all","step","isRtl","next","indexOf","focus","getComputedStyle","direction","focusEdge","edge","length","replace","i","onPartsChange","handleKeyDown","event","element","target","key","preventDefault","placeholderValue","magnitude","deleteDigit","clearSegment","test","isFull","applyDigit","metaKey","ctrlKey","applyLetter","handleFocusOut","isCommitted","committed","commitSegment","handleBeforeInput","handlePaste","clipboardData","getData","parsed","parsePasted","tryRangePaste","onRangePaste","halves","splitRange","start","end","handleCopy","setData","formatForClipboard","handleCut","p","setComponentTemplate","precompileTemplate","strictMode","scope","on","fn"],"mappings":";;;;;;;;;;AA6DA,MAAMA,cAA0C,GAAI;AAClDC,EAAAA,IAAA,EAAM,MAAA;AACNC,EAAAA,KAAA,EAAO,OAAA;AACPC,EAAAA,GAAA,EAAK,KAAA;AACLC,EAAAA,IAAA,EAAM,MAAA;AACNC,EAAAA,MAAA,EAAQ,QAAA;AACRC,EAAAA,SAAA,EAAW;AACb;AAEA;AACA,MAAMC,SAAqC,GAAI;AAC7CJ,EAAAA,GAAA,EAAK,CAAA;AACLD,EAAAA,KAAA,EAAO,CAAA;AACPD,EAAAA,IAAA,EAAM,EAAA;AACNG,EAAAA,IAAA,EAAM,CAAA;AACNC,EAAAA,MAAA,EAAQ,EAAA;AACRC,EAAAA,SAAA,EAAW;AACb,CAAA;AAEA;;;;;;;;;AAwBA;;;;AAIA,MAAME,qBAAqBC,SAAA,CAAU;EACnC,IAAIC,UAAAA,GAAsB;AACxB,IAAA,OAAO,CAAC,IAAI,CAACC,IAAI,CAACC,UAAU,IAAI,CAAC,IAAI,CAACD,IAAI,CAACE,UAAU;AACvD,EAAA;AAEAC,EAAAA,QAAA,GAAYC,IAAM,IAChB,IAAI,CAACJ,IAAI,CAACK,aAAa,GAAGD,IAAA,CAAK,IAAIf,cAAc,CAACe,KAAK;AAEzD;;;;;AAKC;EACD,IACIE,UAAAA,GAAkC;IACpC,OAAO,IAAIC,KAAKC,cAAc,CAAC,IAAI,CAACR,IAAI,CAACS,MAAM,EAAE;AAAElB,MAAAA,KAAA,EAAO;AAAO,KAAA,CAAA;AACnE,EAAA;AAEA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AAK,CAAA;AACpD,IAAA,MAAMqE,GAAA,GAAMN,WAAA,CAAYG,MAAM,CAAC,CAAA,CAAE,EAAE,IAAI,CAACxF,IAAI,CAACsB,KAAK,CAAA;IAClD,IAAIoE,KAAA,IAASC,GAAA,EAAKJ,YAAA,CAAaG,KAAA,EAAOC,GAAA,CAAA;AACxC,EAAA;EAEAC,UAAA,GAAc/B,KAAO,IAAqB;IACxCA,KAAA,CAAMI,cAAc,EAAA;AACpBJ,IAAAA,KAAA,CAAMqB,aAAa,EAAEW,OAAA,CACnB,YAAA,EACAC,mBAAmB,IAAI,CAAC9F,IAAI,CAACsB,KAAK,CAAA,CAAA;EAEtC,CAAA;EAEAyE,SAAA,GAAalC,KAAO,IAAqB;AACvC,IAAA,IAAI,CAAC+B,UAAU,CAAC/B,KAAA,CAAA;AAChB,IAAA,IAAI,CAAC,IAAI,CAAC9D,UAAU,EAAE;IAEtB,IAAI,CAACC,IAAI,CAAC2D,aAAa,CACrB,IAAI,CAAC3D,IAAI,CAACsB,KAAK,CAACC,GAAG,CAAEyE,CAAA,IAAOtE,UAAUsE,CAAA,CAAA,GAAK3B,YAAA,CAAa2B,KAAKA,CAAC,CAAA,CAAA;EAElE,CAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,6/DAAA,EA2DA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -558,5 +558,5 @@ function fromDate(parts, date) {
558
558
  });
559
559
  }
560
560
 
561
- export { BOUNDS, DEFAULT_FORMAT, applyDigit, applyLetter, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, hourOfDay, hourOnCycle, isSegment, resolveSegmentFormat, resolveTwoDigitYear, step, timeOf, toDate, toNumericFormat, withTime, withValue };
561
+ export { BOUNDS, DEFAULT_FORMAT, applyDigit, applyLetter, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, hourOfDay, hourOnCycle, isSegment, resolveSegmentFormat, resolveTwoDigitYear, seedFrom, step, timeOf, toDate, toNumericFormat, withTime, withValue };
562
562
  //# sourceMappingURL=segments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segments.js","sources":["../../../../src/components/forms/date-input/segments.ts"],"sourcesContent":["import { warn } from '@ember/debug';\nimport type {\n HourCycle,\n Part,\n Segment,\n SegmentType,\n TimeOptions\n} 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 // A 24-hour clock's bounds; `hourBounds` gives the other cycles'.\n hour: { min: 0, max: 23, width: 2, placeholder: 'hh' },\n minute: { min: 0, max: 59, width: 2, placeholder: 'mm' },\n // AM is 0 and PM is 1. Its placeholder is the locale's AM, set by\n // `buildParts`, which is the only place the locale is known.\n dayPeriod: { min: 0, max: 1, width: 2, placeholder: 'AM' }\n};\n\nconst HOUR_BOUNDS: Record<HourCycle, { min: number; max: number }> = {\n h11: { min: 0, max: 11 },\n h12: { min: 1, max: 12 },\n h23: { min: 0, max: 23 },\n h24: { min: 1, max: 24 }\n};\n\n/** Whether a cycle counts the hours twice a day, and so needs AM/PM. */\nfunction isTwelveHour(cycle: HourCycle): boolean {\n return cycle === 'h11' || cycle === 'h12';\n}\n\nfunction isSegment(part: Part): part is Segment {\n return part.kind === 'segment';\n}\n\nfunction emptySegment(\n type: SegmentType,\n overrides: Partial<Segment> = {}\n): 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 ...overrides\n };\n}\n\n/**\n * The format the segments are built from: the date format, plus the time\n * fields a granularity asks for. Seconds are out of scope.\n */\nfunction withTime(\n format: Intl.DateTimeFormatOptions,\n { granularity = 'day', hourCycle }: TimeOptions\n): Intl.DateTimeFormatOptions {\n if (granularity === 'day') return format;\n\n return {\n ...format,\n hour: '2-digit',\n ...(granularity === 'minute' ? { minute: '2-digit' } : {}),\n ...(hourCycle ? { hourCycle: hourCycle === 12 ? 'h12' : 'h23' } : {})\n };\n}\n\n/** The locale's names for AM and PM, in that order. */\nfunction dayPeriodLabels(locale: string): string[] {\n const formatter = new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hourCycle: 'h12'\n });\n return [1, 13].map(\n (hour) =>\n formatter\n .formatToParts(new Date(2026, 0, 20, hour))\n .find((p) => p.type === 'dayPeriod')?.value ?? (hour < 12 ? 'AM' : 'PM')\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 time: TimeOptions = {}\n): Part[] {\n const formatter = new Intl.DateTimeFormat(\n locale,\n withTime(formatOptions, time)\n );\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 // `Intl` settles the cycle -- the locale's, or the one asked for -- and the\n // hour's bounds, and whether there is an AM/PM at all, follow from it.\n const hourCycle = formatter.resolvedOptions().hourCycle ?? 'h23';\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 === 'hour') {\n out.push(emptySegment('hour', { ...HOUR_BOUNDS[hourCycle], hourCycle }));\n } else if (part.type === 'minute') {\n out.push(emptySegment('minute'));\n } else if (part.type === 'dayPeriod') {\n const labels = dayPeriodLabels(locale);\n out.push(emptySegment('dayPeriod', { labels, placeholder: labels[0] }));\n } else if (part.type === 'literal') {\n out.push({ kind: 'literal', text: part.value });\n }\n // Everything else -- era, weekday, relatedYear -- is dropped: there is no\n // segment for it.\n }\n\n return withoutDateTimeComma(out);\n}\n\nconst DATE_TYPES: SegmentType[] = ['year', 'month', 'day'];\n\n/**\n * `Intl` joins the date and the time with a comma in many locales\n * (`01/20/2026, 09:05 PM`), which reads like a sentence rather than a field.\n * The separator between the last date segment and the first time one keeps\n * whatever else the locale put there, minus the comma.\n */\nfunction withoutDateTimeComma(parts: Part[]): Part[] {\n return parts.map((part, i) => {\n if (part.kind !== 'literal') return part;\n const before = parts[i - 1];\n const after = parts[i + 1];\n const joinsDateAndTime =\n before?.kind === 'segment' &&\n DATE_TYPES.includes(before.type) &&\n after?.kind === 'segment' &&\n !DATE_TYPES.includes(after.type);\n if (!joinsDateAndTime) return part;\n const text = part.text.replace(/[,،,]/g, '').replace(/\\s+/g, ' ');\n return { kind: 'literal', text: text.trim() === '' ? ' ' : text };\n });\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 // A textual segment (AM/PM) is typed by letter; see `applyLetter`.\n if (!/^\\d$/.test(digit) || segment.labels) {\n return { segment, isFull: false };\n }\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/**\n * Types into a textual segment: a letter picks the first label starting with\n * it, so `a` and `p` set AM and PM in English. A letter that starts no label\n * is ignored, and the segment is finished either way it is set.\n */\nfunction applyLetter(\n segment: Segment,\n key: string\n): { segment: Segment; isFull: boolean } {\n const letter = key.toLocaleLowerCase();\n const index = (segment.labels ?? []).findIndex((label) =>\n label.toLocaleLowerCase().startsWith(letter)\n );\n if (index === -1) return { segment, isFull: false };\n\n return { segment: withValue(segment, index), isFull: true };\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/** A 0-23 hour as the given cycle counts it. */\nfunction hourOnCycle(hours: number, cycle: HourCycle): number {\n if (cycle === 'h11') return hours % 12;\n if (cycle === 'h12') return hours % 12 || 12;\n if (cycle === 'h24') return hours || 24;\n return hours;\n}\n\n/** The 0-23 hour an hour segment and an AM/PM (0 or 1) stand for. */\nfunction hourOfDay(hour: number, cycle: HourCycle, dayPeriod: number): number {\n if (isTwelveHour(cycle)) return (hour % 12) + (dayPeriod === 1 ? 12 : 0);\n return hour % 24;\n}\n\n/** The unit of `date` this segment holds: what it seeds from, or is set to. */\nfunction seedFrom(segment: Segment, date: Date): number {\n switch (segment.type) {\n case 'year':\n return date.getFullYear();\n case 'month':\n return date.getMonth() + 1;\n case 'day':\n return date.getDate();\n case 'hour':\n return hourOnCycle(date.getHours(), segment.hourCycle ?? 'h23');\n case 'minute':\n return date.getMinutes();\n case 'dayPeriod':\n return date.getHours() < 12 ? 0 : 1;\n }\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, 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 if (segment.labels) return segment.labels[segment.value] ?? '';\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 time the time segments hold, as a 0-23 hour and a minute; midnight when\n * there are none, and `null` while any of them is empty or still being typed.\n */\nfunction timeOf(parts: Part[]): { hours: number; minutes: number } | null {\n const hour = findSegment(parts, 'hour');\n if (!hour) return { hours: 0, minutes: 0 };\n\n const minute = findSegment(parts, 'minute');\n const dayPeriod = findSegment(parts, 'dayPeriod');\n if (!isReady(hour)) return null;\n if (minute && !isReady(minute)) return null;\n if (dayPeriod && !isReady(dayPeriod)) return null;\n\n return {\n hours: hourOfDay(\n hour.value,\n hour.hourCycle ?? 'h23',\n dayPeriod?.value ?? 0\n ),\n minutes: minute?.value ?? 0\n };\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 time = timeOf(parts);\n if (!time) return null;\n\n const clamped = Math.min(day.value, daysInMonth(year.value, month.value));\n return new Date(\n year.value,\n month.value - 1,\n clamped,\n time.hours,\n time.minutes\n );\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, date));\n });\n}\n\nexport {\n buildParts,\n withTime,\n applyLetter,\n timeOf,\n hourOnCycle,\n hourOfDay,\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","hour","minute","dayPeriod","HOUR_BOUNDS","h11","h12","h23","h24","isTwelveHour","cycle","isSegment","part","kind","emptySegment","type","overrides","value","buffer","isCommitted","withTime","format","granularity","hourCycle","dayPeriodLabels","locale","formatter","Intl","DateTimeFormat","map","formatToParts","Date","find","p","buildParts","formatOptions","time","parts","resolvedOptions","out","push","labels","text","withoutDateTimeComma","DATE_TYPES","i","before","after","joinsDateAndTime","includes","replace","trim","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","applyLetter","key","letter","toLocaleLowerCase","index","findIndex","label","startsWith","clearSegment","deleteDigit","slice","hourOnCycle","hours","hourOfDay","seedFrom","date","getMonth","getDate","getHours","getMinutes","step","delta","placeholderValue","span","offset","wrapped","displaySegment","findSegment","daysInMonth","isReady","undefined","timeOf","minutes","toDate","clamped","carryOver","previous","was","hasTextualMonth","options","dateStyle","toNumericFormat","resolveSegmentFormat","given","warning","warn","message","id","hasDateChanged","getTime","fromDate"],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAA0C,GAAG;AACjDC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,KAAK,EAAE,SAAS;AAChBC,EAAAA,GAAG,EAAE;AAC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AC/D,IAAI,EAAEgF,QAAQ,CAAChF,IAAI,EAAEiF,IAAI,CAAC,CAAC;AAC9C,EAAA,CAAC,CAAC;AACJ;;"}
1
+ {"version":3,"file":"segments.js","sources":["../../../../src/components/forms/date-input/segments.ts"],"sourcesContent":["import { warn } from '@ember/debug';\nimport type {\n HourCycle,\n Part,\n Segment,\n SegmentType,\n TimeOptions\n} 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 // A 24-hour clock's bounds; `hourBounds` gives the other cycles'.\n hour: { min: 0, max: 23, width: 2, placeholder: 'hh' },\n minute: { min: 0, max: 59, width: 2, placeholder: 'mm' },\n // AM is 0 and PM is 1. Its placeholder is the locale's AM, set by\n // `buildParts`, which is the only place the locale is known.\n dayPeriod: { min: 0, max: 1, width: 2, placeholder: 'AM' }\n};\n\nconst HOUR_BOUNDS: Record<HourCycle, { min: number; max: number }> = {\n h11: { min: 0, max: 11 },\n h12: { min: 1, max: 12 },\n h23: { min: 0, max: 23 },\n h24: { min: 1, max: 24 }\n};\n\n/** Whether a cycle counts the hours twice a day, and so needs AM/PM. */\nfunction isTwelveHour(cycle: HourCycle): boolean {\n return cycle === 'h11' || cycle === 'h12';\n}\n\nfunction isSegment(part: Part): part is Segment {\n return part.kind === 'segment';\n}\n\nfunction emptySegment(\n type: SegmentType,\n overrides: Partial<Segment> = {}\n): 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 ...overrides\n };\n}\n\n/**\n * The format the segments are built from: the date format, plus the time\n * fields a granularity asks for. Seconds are out of scope.\n */\nfunction withTime(\n format: Intl.DateTimeFormatOptions,\n { granularity = 'day', hourCycle }: TimeOptions\n): Intl.DateTimeFormatOptions {\n if (granularity === 'day') return format;\n\n return {\n ...format,\n hour: '2-digit',\n ...(granularity === 'minute' ? { minute: '2-digit' } : {}),\n ...(hourCycle ? { hourCycle: hourCycle === 12 ? 'h12' : 'h23' } : {})\n };\n}\n\n/** The locale's names for AM and PM, in that order. */\nfunction dayPeriodLabels(locale: string): string[] {\n const formatter = new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hourCycle: 'h12'\n });\n return [1, 13].map(\n (hour) =>\n formatter\n .formatToParts(new Date(2026, 0, 20, hour))\n .find((p) => p.type === 'dayPeriod')?.value ?? (hour < 12 ? 'AM' : 'PM')\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 time: TimeOptions = {}\n): Part[] {\n const formatter = new Intl.DateTimeFormat(\n locale,\n withTime(formatOptions, time)\n );\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 // `Intl` settles the cycle -- the locale's, or the one asked for -- and the\n // hour's bounds, and whether there is an AM/PM at all, follow from it.\n const hourCycle = formatter.resolvedOptions().hourCycle ?? 'h23';\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 === 'hour') {\n out.push(emptySegment('hour', { ...HOUR_BOUNDS[hourCycle], hourCycle }));\n } else if (part.type === 'minute') {\n out.push(emptySegment('minute'));\n } else if (part.type === 'dayPeriod') {\n const labels = dayPeriodLabels(locale);\n out.push(emptySegment('dayPeriod', { labels, placeholder: labels[0] }));\n } else if (part.type === 'literal') {\n out.push({ kind: 'literal', text: part.value });\n }\n // Everything else -- era, weekday, relatedYear -- is dropped: there is no\n // segment for it.\n }\n\n return withoutDateTimeComma(out);\n}\n\nconst DATE_TYPES: SegmentType[] = ['year', 'month', 'day'];\n\n/**\n * `Intl` joins the date and the time with a comma in many locales\n * (`01/20/2026, 09:05 PM`), which reads like a sentence rather than a field.\n * The separator between the last date segment and the first time one keeps\n * whatever else the locale put there, minus the comma.\n */\nfunction withoutDateTimeComma(parts: Part[]): Part[] {\n return parts.map((part, i) => {\n if (part.kind !== 'literal') return part;\n const before = parts[i - 1];\n const after = parts[i + 1];\n const joinsDateAndTime =\n before?.kind === 'segment' &&\n DATE_TYPES.includes(before.type) &&\n after?.kind === 'segment' &&\n !DATE_TYPES.includes(after.type);\n if (!joinsDateAndTime) return part;\n const text = part.text.replace(/[,،,]/g, '').replace(/\\s+/g, ' ');\n return { kind: 'literal', text: text.trim() === '' ? ' ' : text };\n });\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 // A textual segment (AM/PM) is typed by letter; see `applyLetter`.\n if (!/^\\d$/.test(digit) || segment.labels) {\n return { segment, isFull: false };\n }\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/**\n * Types into a textual segment: a letter picks the first label starting with\n * it, so `a` and `p` set AM and PM in English. A letter that starts no label\n * is ignored, and the segment is finished either way it is set.\n */\nfunction applyLetter(\n segment: Segment,\n key: string\n): { segment: Segment; isFull: boolean } {\n const letter = key.toLocaleLowerCase();\n const index = (segment.labels ?? []).findIndex((label) =>\n label.toLocaleLowerCase().startsWith(letter)\n );\n if (index === -1) return { segment, isFull: false };\n\n return { segment: withValue(segment, index), isFull: true };\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/** A 0-23 hour as the given cycle counts it. */\nfunction hourOnCycle(hours: number, cycle: HourCycle): number {\n if (cycle === 'h11') return hours % 12;\n if (cycle === 'h12') return hours % 12 || 12;\n if (cycle === 'h24') return hours || 24;\n return hours;\n}\n\n/** The 0-23 hour an hour segment and an AM/PM (0 or 1) stand for. */\nfunction hourOfDay(hour: number, cycle: HourCycle, dayPeriod: number): number {\n if (isTwelveHour(cycle)) return (hour % 12) + (dayPeriod === 1 ? 12 : 0);\n return hour % 24;\n}\n\n/** The unit of `date` this segment holds: what it seeds from, or is set to. */\nfunction seedFrom(segment: Segment, date: Date): number {\n switch (segment.type) {\n case 'year':\n return date.getFullYear();\n case 'month':\n return date.getMonth() + 1;\n case 'day':\n return date.getDate();\n case 'hour':\n return hourOnCycle(date.getHours(), segment.hourCycle ?? 'h23');\n case 'minute':\n return date.getMinutes();\n case 'dayPeriod':\n return date.getHours() < 12 ? 0 : 1;\n }\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, 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 if (segment.labels) return segment.labels[segment.value] ?? '';\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 time the time segments hold, as a 0-23 hour and a minute; midnight when\n * there are none, and `null` while any of them is empty or still being typed.\n */\nfunction timeOf(parts: Part[]): { hours: number; minutes: number } | null {\n const hour = findSegment(parts, 'hour');\n if (!hour) return { hours: 0, minutes: 0 };\n\n const minute = findSegment(parts, 'minute');\n const dayPeriod = findSegment(parts, 'dayPeriod');\n if (!isReady(hour)) return null;\n if (minute && !isReady(minute)) return null;\n if (dayPeriod && !isReady(dayPeriod)) return null;\n\n return {\n hours: hourOfDay(\n hour.value,\n hour.hourCycle ?? 'h23',\n dayPeriod?.value ?? 0\n ),\n minutes: minute?.value ?? 0\n };\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 time = timeOf(parts);\n if (!time) return null;\n\n const clamped = Math.min(day.value, daysInMonth(year.value, month.value));\n return new Date(\n year.value,\n month.value - 1,\n clamped,\n time.hours,\n time.minutes\n );\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, date));\n });\n}\n\nexport {\n buildParts,\n withTime,\n applyLetter,\n timeOf,\n hourOnCycle,\n hourOfDay,\n seedFrom,\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","hour","minute","dayPeriod","HOUR_BOUNDS","h11","h12","h23","h24","isTwelveHour","cycle","isSegment","part","kind","emptySegment","type","overrides","value","buffer","isCommitted","withTime","format","granularity","hourCycle","dayPeriodLabels","locale","formatter","Intl","DateTimeFormat","map","formatToParts","Date","find","p","buildParts","formatOptions","time","parts","resolvedOptions","out","push","labels","text","withoutDateTimeComma","DATE_TYPES","i","before","after","joinsDateAndTime","includes","replace","trim","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","applyLetter","key","letter","toLocaleLowerCase","index","findIndex","label","startsWith","clearSegment","deleteDigit","slice","hourOnCycle","hours","hourOfDay","seedFrom","date","getMonth","getDate","getHours","getMinutes","step","delta","placeholderValue","span","offset","wrapped","displaySegment","findSegment","daysInMonth","isReady","undefined","timeOf","minutes","toDate","clamped","carryOver","previous","was","hasTextualMonth","options","dateStyle","toNumericFormat","resolveSegmentFormat","given","warning","warn","message","id","hasDateChanged","getTime","fromDate"],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAA0C,GAAG;AACjDC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,KAAK,EAAE,SAAS;AAChBC,EAAAA,GAAG,EAAE;AACP;AAEA,MAAMC,MAGL,GAAG;AACF;AACA;AACAD,EAAAA,GAAG,EAAE;AAAEE,IAAAA,GAAG,EAAE,CAAC;AAAEC,IAAAA,GAAG,EAAE,EAAE;AAAEC,IAAAA,KAAK,EAAE,CAAC;AAAE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ter, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, hourOfDay, hourOnCycle, isSegment, resolveSegmentFormat, resolveTwoDigitYear, step, timeOf, toDate, toNumericFormat, withTime, withValue } from './date-input/segments.js';
1
+ export { BOUNDS, DEFAULT_FORMAT, applyDigit, applyLetter, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, hourOfDay, hourOnCycle, isSegment, resolveSegmentFormat, resolveTwoDigitYear, seedFrom, step, timeOf, toDate, toNumericFormat, withTime, withValue } from './date-input/segments.js';
2
2
  export { formatForClipboard, parsePasted, splitRange } from './date-input/clipboard.js';
3
3
  export { DateInput, DateInput as default } from './date-input/date-input.js';
4
4
  //# sourceMappingURL=date-input.js.map