frontile 0.18.0-beta.0 → 0.18.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/components/collections/simple-table/body.d.ts +4 -4
- package/declarations/components/collections/simple-table/cell.d.ts +4 -4
- package/declarations/components/collections/simple-table/column.d.ts +4 -4
- package/declarations/components/collections/simple-table/footer.d.ts +4 -4
- package/declarations/components/collections/simple-table/header.d.ts +4 -4
- package/declarations/components/collections/simple-table/index.d.ts +16 -4
- package/declarations/components/collections/simple-table/row.d.ts +4 -4
- package/declarations/components/collections/table/column-visibility.d.ts +4 -4
- package/declarations/components/collections/table/sort-button.d.ts +4 -4
- package/declarations/components/collections/table/table.d.ts +5 -4
- package/declarations/components/forms/select/trigger.d.ts +5 -3
- package/declarations/components/navigation/pagination/pagination.d.ts +3 -2
- package/declarations/test-support.d.ts +22 -0
- package/declarations/utils/selection-indicator.d.ts +4 -0
- package/dist/components/buttons/button-group.js +1 -1
- package/dist/components/buttons/button-group.js.map +1 -1
- package/dist/components/buttons/button.js +2 -2
- package/dist/components/buttons/button.js.map +1 -1
- package/dist/components/buttons/chip.js +1 -1
- package/dist/components/buttons/chip.js.map +1 -1
- package/dist/components/buttons/close-button.js +1 -1
- package/dist/components/buttons/close-button.js.map +1 -1
- package/dist/components/buttons/segmented-control/item.js +1 -1
- package/dist/components/buttons/segmented-control/item.js.map +1 -1
- package/dist/components/buttons/segmented-control/segmented-control.js +1 -1
- package/dist/components/buttons/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/buttons/toggle-button.js +1 -1
- package/dist/components/buttons/toggle-button.js.map +1 -1
- package/dist/components/collections/calendar/calendar.js +8 -4
- package/dist/components/collections/calendar/calendar.js.map +1 -1
- package/dist/components/collections/calendar/day-cell.js +1 -1
- package/dist/components/collections/calendar/day-cell.js.map +1 -1
- package/dist/components/collections/calendar/header.js +1 -1
- package/dist/components/collections/calendar/header.js.map +1 -1
- package/dist/components/collections/calendar/month-grid.js +1 -1
- package/dist/components/collections/calendar/month-grid.js.map +1 -1
- package/dist/components/collections/calendar/year-grid.js +15 -3
- package/dist/components/collections/calendar/year-grid.js.map +1 -1
- package/dist/components/collections/command/command.js +1 -1
- package/dist/components/collections/command/command.js.map +1 -1
- package/dist/components/collections/command/dialog.js +1 -1
- package/dist/components/collections/command/dialog.js.map +1 -1
- package/dist/components/collections/command/footer.js +3 -3
- package/dist/components/collections/command/footer.js.map +1 -1
- package/dist/components/collections/command/input.js +1 -1
- package/dist/components/collections/command/input.js.map +1 -1
- package/dist/components/collections/command/list.js +1 -1
- package/dist/components/collections/command/list.js.map +1 -1
- package/dist/components/collections/listbox/group.js +1 -1
- package/dist/components/collections/listbox/group.js.map +1 -1
- package/dist/components/collections/listbox/item.js +1 -1
- package/dist/components/collections/listbox/item.js.map +1 -1
- package/dist/components/collections/listbox/listbox.js +1 -1
- package/dist/components/collections/listbox/listbox.js.map +1 -1
- package/dist/components/collections/simple-table/body.js +1 -1
- package/dist/components/collections/simple-table/body.js.map +1 -1
- package/dist/components/collections/simple-table/cell.js +1 -1
- package/dist/components/collections/simple-table/cell.js.map +1 -1
- package/dist/components/collections/simple-table/column.js +1 -1
- package/dist/components/collections/simple-table/column.js.map +1 -1
- package/dist/components/collections/simple-table/footer.js +1 -1
- package/dist/components/collections/simple-table/footer.js.map +1 -1
- package/dist/components/collections/simple-table/header.js +1 -1
- package/dist/components/collections/simple-table/header.js.map +1 -1
- package/dist/components/collections/simple-table/index.js +5 -3
- package/dist/components/collections/simple-table/index.js.map +1 -1
- package/dist/components/collections/simple-table/row.js +1 -1
- package/dist/components/collections/simple-table/row.js.map +1 -1
- package/dist/components/collections/table/checkbox.js +1 -1
- package/dist/components/collections/table/checkbox.js.map +1 -1
- package/dist/components/collections/table/column-visibility.js +1 -1
- package/dist/components/collections/table/column-visibility.js.map +1 -1
- package/dist/components/collections/table/sort-button.js +1 -1
- package/dist/components/collections/table/sort-button.js.map +1 -1
- package/dist/components/collections/table/table.js +7 -3
- package/dist/components/collections/table/table.js.map +1 -1
- package/dist/components/disclosure/accordion/accordion.js +3 -2
- package/dist/components/disclosure/accordion/accordion.js.map +1 -1
- package/dist/components/disclosure/accordion/item.js +1 -1
- package/dist/components/disclosure/accordion/item.js.map +1 -1
- package/dist/components/forms/autocomplete.js +1 -1
- package/dist/components/forms/autocomplete.js.map +1 -1
- package/dist/components/forms/checkbox-group.js +1 -1
- package/dist/components/forms/checkbox-group.js.map +1 -1
- package/dist/components/forms/checkbox.js +1 -1
- package/dist/components/forms/checkbox.js.map +1 -1
- package/dist/components/forms/form-control.js +1 -1
- package/dist/components/forms/form-control.js.map +1 -1
- package/dist/components/forms/form-description.js +1 -1
- package/dist/components/forms/form-description.js.map +1 -1
- package/dist/components/forms/form-feedback.js +1 -1
- package/dist/components/forms/form-feedback.js.map +1 -1
- package/dist/components/forms/input-otp.js +1 -1
- package/dist/components/forms/input-otp.js.map +1 -1
- package/dist/components/forms/input.js +1 -1
- package/dist/components/forms/input.js.map +1 -1
- package/dist/components/forms/label.js +1 -1
- package/dist/components/forms/label.js.map +1 -1
- package/dist/components/forms/native-select.js +2 -2
- package/dist/components/forms/native-select.js.map +1 -1
- package/dist/components/forms/radio-group.js +1 -1
- package/dist/components/forms/radio-group.js.map +1 -1
- package/dist/components/forms/radio.js +1 -1
- package/dist/components/forms/radio.js.map +1 -1
- package/dist/components/forms/select/end-content.js +1 -1
- package/dist/components/forms/select/end-content.js.map +1 -1
- package/dist/components/forms/select/select.js +1 -1
- package/dist/components/forms/select/select.js.map +1 -1
- package/dist/components/forms/select/selected-items.js +1 -1
- package/dist/components/forms/select/selected-items.js.map +1 -1
- package/dist/components/forms/select/trigger.js +6 -4
- package/dist/components/forms/select/trigger.js.map +1 -1
- package/dist/components/forms/switch.js +1 -1
- package/dist/components/forms/switch.js.map +1 -1
- package/dist/components/forms/textarea.js +1 -1
- package/dist/components/forms/textarea.js.map +1 -1
- package/dist/components/navigation/external-link.js +2 -2
- package/dist/components/navigation/external-link.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.js +1 -1
- package/dist/components/navigation/pagination/pagination.js.map +1 -1
- package/dist/components/navigation/tab-nav/item.js +1 -1
- package/dist/components/navigation/tab-nav/item.js.map +1 -1
- package/dist/components/navigation/tab-nav/tab-nav.js +1 -1
- package/dist/components/navigation/tab-nav/tab-nav.js.map +1 -1
- package/dist/components/navigation/tabs/panel.js +1 -1
- package/dist/components/navigation/tabs/panel.js.map +1 -1
- package/dist/components/navigation/tabs/tab.js +1 -1
- package/dist/components/navigation/tabs/tab.js.map +1 -1
- package/dist/components/navigation/tabs/tabs.js +2 -2
- package/dist/components/navigation/tabs/tabs.js.map +1 -1
- package/dist/components/notifications/index.js +1 -1
- package/dist/components/notifications/notification-card.js +1 -1
- package/dist/components/notifications/notifications-container.js +2 -2
- package/dist/components/notifications/notifications-container.js.map +1 -1
- package/dist/components/overlays/drawer/body.js +1 -1
- package/dist/components/overlays/drawer/body.js.map +1 -1
- package/dist/components/overlays/drawer/drag-handle.js +1 -1
- package/dist/components/overlays/drawer/drag-handle.js.map +1 -1
- package/dist/components/overlays/drawer/footer.js +1 -1
- package/dist/components/overlays/drawer/footer.js.map +1 -1
- package/dist/components/overlays/drawer/header.js +4 -4
- package/dist/components/overlays/drawer/header.js.map +1 -1
- package/dist/components/overlays/drawer.js +1 -1
- package/dist/components/overlays/drawer.js.map +1 -1
- package/dist/components/overlays/modal/body.js +1 -1
- package/dist/components/overlays/modal/body.js.map +1 -1
- package/dist/components/overlays/modal/footer.js +1 -1
- package/dist/components/overlays/modal/footer.js.map +1 -1
- package/dist/components/overlays/modal/header.js +1 -1
- package/dist/components/overlays/modal/header.js.map +1 -1
- package/dist/components/overlays/modal.js +1 -1
- package/dist/components/overlays/modal.js.map +1 -1
- package/dist/components/overlays/overlay.js +1 -1
- package/dist/components/overlays/overlay.js.map +1 -1
- package/dist/components/overlays/tooltip.js +13 -1
- package/dist/components/overlays/tooltip.js.map +1 -1
- package/dist/components/status/alert.js +1 -1
- package/dist/components/status/alert.js.map +1 -1
- package/dist/components/status/progress-bar.js +1 -1
- package/dist/components/status/progress-bar.js.map +1 -1
- package/dist/components/utilities/avatar.js +1 -1
- package/dist/components/utilities/avatar.js.map +1 -1
- package/dist/components/utilities/divider.js +1 -1
- package/dist/components/utilities/divider.js.map +1 -1
- package/dist/components/utilities/kbd.js +1 -1
- package/dist/components/utilities/kbd.js.map +1 -1
- package/dist/components/utilities/skeleton.js +1 -1
- package/dist/components/utilities/skeleton.js.map +1 -1
- package/dist/components/utilities/spinner.js +1 -1
- package/dist/components/utilities/spinner.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{notification-card-D5fd-Sxa.js → notification-card-BHTra4Zh.js} +2 -2
- package/dist/{notification-card-D5fd-Sxa.js.map → notification-card-BHTra4Zh.js.map} +1 -1
- package/dist/notifications.js +1 -1
- package/dist/test-support.js +40 -2
- package/dist/test-support.js.map +1 -1
- package/dist/utils/selection-indicator.js +30 -2
- package/dist/utils/selection-indicator.js.map +1 -1
- package/package.json +3 -3
|
@@ -69,7 +69,7 @@ class CloseButton extends Component {
|
|
|
69
69
|
decorateMethodV2(this.prototype, "handleClick", [action]);
|
|
70
70
|
}
|
|
71
71
|
static {
|
|
72
|
-
setComponentTemplate(precompileTemplate("<button type=\"button\" class={{this.classes.base}} data-pressed={{if this.isPressed \"true\"}} ...attributes {{press this.handlePress onPressChange=this.handlePressChange}} {{on \"click\" this.handleClick}}>\n\n {{#if (has-block)}}\n {{yield this.classes.icon}}\n {{else}}\n <svg class={{this.classes.icon}} aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\"></path>\n </svg>\n {{/if}}\n\n <VisuallyHidden>\n {{if @title @title \"Close\"}}\n </VisuallyHidden>\n</button>", {
|
|
72
|
+
setComponentTemplate(precompileTemplate("<button type=\"button\" class={{this.classes.base}} data-pressed={{if this.isPressed \"true\"}} data-component=\"close-button\" data-part=\"base\" ...attributes {{press this.handlePress onPressChange=this.handlePressChange}} {{on \"click\" this.handleClick}}>\n\n {{#if (has-block)}}\n {{yield this.classes.icon}}\n {{else}}\n <svg class={{this.classes.icon}} data-part=\"icon\" aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\"></path>\n </svg>\n {{/if}}\n\n <VisuallyHidden>\n {{if @title @title \"Close\"}}\n </VisuallyHidden>\n</button>", {
|
|
73
73
|
strictMode: true,
|
|
74
74
|
scope: () => ({
|
|
75
75
|
press,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"close-button.js","sources":["../../../src/components/buttons/close-button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\nimport { deprecate } from '@ember/debug';\nimport { VisuallyHidden } from '../utilities/visually-hidden';\nimport { press, type PressEvent } from '../../modifiers/press';\nimport { useStyles, type CloseButtonVariants } from '@frontile/theme';\nimport type Owner from '@ember/owner';\n\ninterface CloseButtonSignature {\n Args: {\n /**\n * The title of the close button\n *\n * @defaultValue 'Close'\n */\n title?: string;\n\n /**\n * The icon size\n *\n * @defaultValue 'lg'\n */\n size?: CloseButtonVariants['size'];\n\n /**\n * @defaultValue 'transparent'\n */\n variant?: CloseButtonVariants['variant'];\n\n /**\n * The function to call when button is pressed\n */\n onPress?: (event: PressEvent) => void;\n\n /**\n * Deprecated: The function to call when button is clicked\n *\n * @deprecated Use onPress instead for better cross-platform support\n */\n onClick?: (event: Event) => void;\n\n /**\n * Additional class for close button element\n */\n class?: string;\n };\n Blocks: {\n default: [string | null];\n };\n Element: HTMLButtonElement;\n}\n\nclass CloseButton extends Component<CloseButtonSignature> {\n @tracked isPressed = false;\n\n constructor(owner: Owner, args: CloseButtonSignature['Args']) {\n super(owner, args);\n\n if (args.onClick) {\n deprecate(\n 'CloseButton: onClick is deprecated. Use onPress instead for better cross-platform support including touch, keyboard, and screen reader interactions.',\n false,\n {\n id: 'frontile.close-button.onClick',\n until: '0.18.0',\n for: 'frontile',\n since: { available: '0.17.0', enabled: '0.17.0' }\n }\n );\n }\n }\n\n get classes() {\n const { closeButton } = useStyles();\n\n let { base, icon } = closeButton({\n size: this.args.size || 'md',\n variant: this.args.variant || 'transparent'\n });\n\n return {\n base: base({ class: this.args.class }),\n icon: icon()\n };\n }\n\n handlePressChange = (isPressed: boolean): void => {\n this.isPressed = isPressed;\n };\n\n @action handlePress(event: PressEvent): void {\n if (typeof this.args.onPress === 'function') {\n this.args.onPress(event);\n }\n }\n\n @action handleClick(event: Event): void {\n if (typeof this.args.onClick === 'function') {\n this.args.onClick(event);\n }\n }\n\n <template>\n <button\n type=\"button\"\n class={{this.classes.base}}\n data-pressed={{if this.isPressed \"true\"}}\n ...attributes\n {{press this.handlePress onPressChange=this.handlePressChange}}\n {{on \"click\" this.handleClick}}\n >\n\n {{#if (has-block)}}\n {{yield this.classes.icon}}\n {{else}}\n <svg\n class={{this.classes.icon}}\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M6 18L18 6M6 6l12 12\"\n ></path>\n </svg>\n {{/if}}\n\n <VisuallyHidden>\n {{if @title @title \"Close\"}}\n </VisuallyHidden>\n </button>\n </template>\n}\n\nexport { CloseButton, type CloseButtonSignature };\nexport default CloseButton;\n"],"names":["CloseButton","Component","g","prototype","tracked","i","constructor","owner","args","onClick","deprecate","id","until","for","since","available","enabled","classes","closeButton","useStyles","base","icon","size","variant","class","handlePressChange","isPressed","handlePress","event","onPress","n","action","handleClick","setComponentTemplate","precompileTemplate","strictMode","scope","press","on","VisuallyHidden"],"mappings":";;;;;;;;;;;;AAsDA,MAAMA,oBAAoBC,SAAA,CAAU;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACjCC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;AAErBC,EAAAA,WAAAA,CAAYC,KAAY,EAAEC,IAAkC,EAAE;AAC5D,IAAA,KAAK,CAACD,KAAA,EAAOC,IAAA,CAAA;IAEb,IAAIA,IAAA,CAAKC,OAAO,EAAE;AAChBC,MAAAA,SAAA,CACE,wJACA,KAAA,EACA;AACEC,QAAAA,EAAA,EAAI,+BAAA;AACJC,QAAAA,KAAA,EAAO,QAAA;AACPC,QAAAA,GAAA,EAAK,UAAA;AACLC,QAAAA,KAAA,EAAO;AAAEC,UAAAA,SAAA,EAAW,QAAA;AAAUC,UAAAA,OAAA,EAAS;AAAS;AAClD,OAAA,CAAA;AAEJ,IAAA;AACF,EAAA;EAEA,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAa,GAAGC,SAAA,EAAA;IAExB,IAAI;MAAEC,IAAI;AAAEC,MAAAA;KAAM,GAAGH,WAAA,CAAY;AAC/BI,MAAAA,IAAA,EAAM,IAAI,CAACd,IAAI,CAACc,IAAI,IAAI,IAAA;AACxBC,MAAAA,OAAA,EAAS,IAAI,CAACf,IAAI,CAACe,OAAO,IAAI;AAChC,KAAA,CAAA;IAEA,OAAO;MACLH,IAAA,EAAMA,IAAA,CAAK;AAAEI,QAAAA,KAAA,EAAO,IAAI,CAAChB,IAAI,CAACgB;AAAM,OAAA,CAAA;MACpCH,IAAA,EAAMA,IAAA;KACR;AACF,EAAA;EAEAI,iBAAA,GAAqBC,SAAkB,IAAO;IAC5C,IAAI,CAACA,SAAS,GAAGA,SAAA;EACnB,CAAA;EAEQC,WAAAA,CAAYC,KAAiB,EAAQ;IAC3C,IAAI,OAAO,IAAI,CAACpB,IAAI,CAACqB,OAAO,KAAK,UAAA,EAAY;AAC3C,MAAA,IAAI,CAACrB,IAAI,CAACqB,OAAO,CAACD,KAAA,CAAA;AACpB,IAAA;AACF,EAAA;AAAA,EAAA;IAAAE,gBAAA,CAAA,IAAA,CAAA3B,SAAA,EAAA,aAAA,EAAA,CAJC4B,MAAA,CAAA,CAAA;AAAA;EAMOC,WAAAA,CAAYJ,KAAY,EAAQ;IACtC,IAAI,OAAO,IAAI,CAACpB,IAAI,CAACC,OAAO,KAAK,UAAA,EAAY;AAC3C,MAAA,IAAI,CAACD,IAAI,CAACC,OAAO,CAACmB,KAAA,CAAA;AACpB,IAAA;AACF,EAAA;AAAA,EAAA;IAAAE,gBAAA,CAAA,IAAA,CAAA3B,SAAA,EAAA,aAAA,EAAA,CAJC4B,MAAA,CAAA,CAAA;AAAA;AAMD,EAAA;IAAAE,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"close-button.js","sources":["../../../src/components/buttons/close-button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\nimport { deprecate } from '@ember/debug';\nimport { VisuallyHidden } from '../utilities/visually-hidden';\nimport { press, type PressEvent } from '../../modifiers/press';\nimport { useStyles, type CloseButtonVariants } from '@frontile/theme';\nimport type Owner from '@ember/owner';\n\ninterface CloseButtonSignature {\n Args: {\n /**\n * The title of the close button\n *\n * @defaultValue 'Close'\n */\n title?: string;\n\n /**\n * The icon size\n *\n * @defaultValue 'lg'\n */\n size?: CloseButtonVariants['size'];\n\n /**\n * @defaultValue 'transparent'\n */\n variant?: CloseButtonVariants['variant'];\n\n /**\n * The function to call when button is pressed\n */\n onPress?: (event: PressEvent) => void;\n\n /**\n * Deprecated: The function to call when button is clicked\n *\n * @deprecated Use onPress instead for better cross-platform support\n */\n onClick?: (event: Event) => void;\n\n /**\n * Additional class for close button element\n */\n class?: string;\n };\n Blocks: {\n default: [string | null];\n };\n Element: HTMLButtonElement;\n}\n\nclass CloseButton extends Component<CloseButtonSignature> {\n @tracked isPressed = false;\n\n constructor(owner: Owner, args: CloseButtonSignature['Args']) {\n super(owner, args);\n\n if (args.onClick) {\n deprecate(\n 'CloseButton: onClick is deprecated. Use onPress instead for better cross-platform support including touch, keyboard, and screen reader interactions.',\n false,\n {\n id: 'frontile.close-button.onClick',\n until: '0.18.0',\n for: 'frontile',\n since: { available: '0.17.0', enabled: '0.17.0' }\n }\n );\n }\n }\n\n get classes() {\n const { closeButton } = useStyles();\n\n let { base, icon } = closeButton({\n size: this.args.size || 'md',\n variant: this.args.variant || 'transparent'\n });\n\n return {\n base: base({ class: this.args.class }),\n icon: icon()\n };\n }\n\n handlePressChange = (isPressed: boolean): void => {\n this.isPressed = isPressed;\n };\n\n @action handlePress(event: PressEvent): void {\n if (typeof this.args.onPress === 'function') {\n this.args.onPress(event);\n }\n }\n\n @action handleClick(event: Event): void {\n if (typeof this.args.onClick === 'function') {\n this.args.onClick(event);\n }\n }\n\n <template>\n <button\n type=\"button\"\n class={{this.classes.base}}\n data-pressed={{if this.isPressed \"true\"}}\n data-component=\"close-button\"\n data-part=\"base\"\n ...attributes\n {{press this.handlePress onPressChange=this.handlePressChange}}\n {{on \"click\" this.handleClick}}\n >\n\n {{#if (has-block)}}\n {{yield this.classes.icon}}\n {{else}}\n <svg\n class={{this.classes.icon}}\n data-part=\"icon\"\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M6 18L18 6M6 6l12 12\"\n ></path>\n </svg>\n {{/if}}\n\n <VisuallyHidden>\n {{if @title @title \"Close\"}}\n </VisuallyHidden>\n </button>\n </template>\n}\n\nexport { CloseButton, type CloseButtonSignature };\nexport default CloseButton;\n"],"names":["CloseButton","Component","g","prototype","tracked","i","constructor","owner","args","onClick","deprecate","id","until","for","since","available","enabled","classes","closeButton","useStyles","base","icon","size","variant","class","handlePressChange","isPressed","handlePress","event","onPress","n","action","handleClick","setComponentTemplate","precompileTemplate","strictMode","scope","press","on","VisuallyHidden"],"mappings":";;;;;;;;;;;;AAsDA,MAAMA,oBAAoBC,SAAA,CAAU;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACjCC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;AAErBC,EAAAA,WAAAA,CAAYC,KAAY,EAAEC,IAAkC,EAAE;AAC5D,IAAA,KAAK,CAACD,KAAA,EAAOC,IAAA,CAAA;IAEb,IAAIA,IAAA,CAAKC,OAAO,EAAE;AAChBC,MAAAA,SAAA,CACE,wJACA,KAAA,EACA;AACEC,QAAAA,EAAA,EAAI,+BAAA;AACJC,QAAAA,KAAA,EAAO,QAAA;AACPC,QAAAA,GAAA,EAAK,UAAA;AACLC,QAAAA,KAAA,EAAO;AAAEC,UAAAA,SAAA,EAAW,QAAA;AAAUC,UAAAA,OAAA,EAAS;AAAS;AAClD,OAAA,CAAA;AAEJ,IAAA;AACF,EAAA;EAEA,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAa,GAAGC,SAAA,EAAA;IAExB,IAAI;MAAEC,IAAI;AAAEC,MAAAA;KAAM,GAAGH,WAAA,CAAY;AAC/BI,MAAAA,IAAA,EAAM,IAAI,CAACd,IAAI,CAAC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
|
41
41
|
};
|
|
42
42
|
static {
|
|
43
|
-
setComponentTemplate(precompileTemplate("{{#if @context.name}}\n {{!-- Form mode. Native radios bring their own arrow-key and focus\n behaviour for a same-named group, so RovingFocus deliberately stands\n down here rather than fighting the browser for control. --}}\n <label class=\"{{@context.itemClass}} {{@class}}\" data-selected=\"{{this.isSelected}}\" data-disabled=\"{{this.isDisabled}}\" {{@context.indicator.setupTarget this.isSelected}} ...attributes>\n <input type=\"radio\" name={{@context.name}} value={{this.stringValue}} checked={{this.isSelected}} disabled={{this.isDisabled}} class=\"sr-only\" {{this.registerValue @value}} {{on \"change\" this.handleChange}} />\n {{yield (hash isSelected=this.isSelected)}}\n </label>\n{{else}}\n <button type=\"button\" role=\"radio\" aria-checked=\"{{this.isSelected}}\" disabled={{this.isDisabled}} class=\"{{@context.itemClass}} {{@class}}\" data-selected=\"{{this.isSelected}}\" data-disabled=\"{{this.isDisabled}}\" {{this.registerValue @value}} {{@context.indicator.setupTarget this.isSelected}} {{@context.roving.setupItem}} {{press this.handleClick}} ...attributes>\n {{yield (hash isSelected=this.isSelected)}}\n </button>\n{{/if}}", {
|
|
43
|
+
setComponentTemplate(precompileTemplate("{{#if @context.name}}\n {{!-- Form mode. Native radios bring their own arrow-key and focus\n behaviour for a same-named group, so RovingFocus deliberately stands\n down here rather than fighting the browser for control. --}}\n <label data-part=\"item\" class=\"{{@context.itemClass}} {{@class}}\" data-selected=\"{{this.isSelected}}\" data-disabled=\"{{this.isDisabled}}\" {{@context.indicator.setupTarget this.isSelected}} ...attributes>\n <input type=\"radio\" name={{@context.name}} value={{this.stringValue}} checked={{this.isSelected}} disabled={{this.isDisabled}} class=\"sr-only\" {{this.registerValue @value}} {{on \"change\" this.handleChange}} />\n {{yield (hash isSelected=this.isSelected)}}\n </label>\n{{else}}\n <button type=\"button\" role=\"radio\" data-part=\"item\" aria-checked=\"{{this.isSelected}}\" disabled={{this.isDisabled}} class=\"{{@context.itemClass}} {{@class}}\" data-selected=\"{{this.isSelected}}\" data-disabled=\"{{this.isDisabled}}\" {{this.registerValue @value}} {{@context.indicator.setupTarget this.isSelected}} {{@context.roving.setupItem}} {{press this.handleClick}} ...attributes>\n {{yield (hash isSelected=this.isSelected)}}\n </button>\n{{/if}}", {
|
|
44
44
|
strictMode: true,
|
|
45
45
|
scope: () => ({
|
|
46
46
|
on,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sources":["../../../../src/components/buttons/segmented-control/item.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { press } from '../../../modifiers/press';\nimport { modifier } from 'ember-modifier';\nimport type { SegmentedControlContext } from './segmented-control';\n\ninterface SegmentedControlItemArgs<T> {\n /**\n * The value this item represents. Selecting it calls the control's\n * `@onChange` with exactly this value.\n */\n value: T;\n\n /**\n * Disables this item alone: it cannot be clicked and keyboard navigation\n * skips over it. The whole control can be disabled with the control's own\n * `@isDisabled`.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\n\n /** Class names appended to this item's theme classes. */\n class?: string;\n\n /**\n * Supplied by SegmentedControl. Not part of the public API.\n *\n * @internal\n */\n context: SegmentedControlContext<T>;\n}\n\ninterface SegmentedControlItemSignature<T> {\n Args: SegmentedControlItemArgs<T>;\n Blocks: {\n default: [{ isSelected: boolean }];\n };\n Element: HTMLButtonElement | HTMLLabelElement;\n}\n\nclass SegmentedControlItem<T> extends Component<\n SegmentedControlItemSignature<T>\n> {\n get isSelected(): boolean {\n return this.args.context.isSelected(this.args.value);\n }\n\n get isDisabled(): boolean {\n return this.args.isDisabled || this.args.context.isGroupDisabled;\n }\n\n registerValue = modifier((element: HTMLElement, [value]: [T]) => {\n this.args.context.registerValue(element, value);\n\n return (): void => {\n this.args.context.unregisterValue(element);\n };\n });\n\n handleClick = (): void => {\n if (this.isDisabled) {\n return;\n }\n this.args.context.select(this.args.value);\n };\n\n get stringValue(): string {\n return String(this.args.value);\n }\n\n handleChange = (): void => {\n if (this.isDisabled) {\n return;\n }\n this.args.context.select(this.args.value);\n\n // The browser has already moved checkedness in the DOM. Ask the control to\n // re-assert the whole group from `@value` once the consumer has had its\n // chance to respond, so a declined (or absent) `@onChange` cannot leave the\n // native state disagreeing with the rendered selection.\n this.args.context.requestFormSync();\n };\n\n <template>\n {{#if @context.name}}\n {{! Form mode. Native radios bring their own arrow-key and focus\n behaviour for a same-named group, so RovingFocus deliberately stands\n down here rather than fighting the browser for control. }}\n <label\n class=\"{{@context.itemClass}} {{@class}}\"\n data-selected=\"{{this.isSelected}}\"\n data-disabled=\"{{this.isDisabled}}\"\n {{@context.indicator.setupTarget this.isSelected}}\n ...attributes\n >\n <input\n type=\"radio\"\n name={{@context.name}}\n value={{this.stringValue}}\n checked={{this.isSelected}}\n disabled={{this.isDisabled}}\n class=\"sr-only\"\n {{this.registerValue @value}}\n {{on \"change\" this.handleChange}}\n />\n {{yield (hash isSelected=this.isSelected)}}\n </label>\n {{else}}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked=\"{{this.isSelected}}\"\n disabled={{this.isDisabled}}\n class=\"{{@context.itemClass}} {{@class}}\"\n data-selected=\"{{this.isSelected}}\"\n data-disabled=\"{{this.isDisabled}}\"\n {{this.registerValue @value}}\n {{@context.indicator.setupTarget this.isSelected}}\n {{@context.roving.setupItem}}\n {{press this.handleClick}}\n ...attributes\n >\n {{yield (hash isSelected=this.isSelected)}}\n </button>\n {{/if}}\n </template>\n}\n\nexport {\n SegmentedControlItem,\n type SegmentedControlItemSignature,\n type SegmentedControlItemArgs\n};\nexport default SegmentedControlItem;\n"],"names":["SegmentedControlItem","Component","isSelected","args","context","value","isDisabled","isGroupDisabled","registerValue","modifier","element","unregisterValue","handleClick","select","stringValue","String","handleChange","requestFormSync","setComponentTemplate","precompileTemplate","strictMode","scope","on","hash","press"],"mappings":";;;;;;;;AA0CA,MAAMA,oBAAA,SAAgCC,SAAA,CACN;EAE9B,IAAIC,UAAAA,GAAsB;AACxB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,OAAO,CAACF,UAAU,CAAC,IAAI,CAACC,IAAI,CAACE,KAAK,CAAA;AACrD,EAAA;EAEA,IAAIC,UAAAA,GAAsB;AACxB,IAAA,OAAO,IAAI,CAACH,IAAI,CAACG,UAAU,IAAI,IAAI,CAACH,IAAI,CAACC,OAAO,CAACG,eAAe;AAClE,EAAA;EAEAC,aAAA,GAAgBC,SAAS,CAACC,OAAS,EAAa,CAACL,MAAW,KAAA;IAC1D,IAAI,CAACF,IAAI,CAACC,OAAO,CAACI,aAAa,CAACE,OAAA,EAASL,KAAA,CAAA;AAEzC,IAAA,OAAO,MAAQ;MACb,IAAI,CAACF,IAAI,CAACC,OAAO,CAACO,eAAe,CAACD,OAAA,CAAA;IACpC,CAAA;AACF,EAAA,CAAA,CAAA;EAEAE,WAAA,GAAcA,MAAQ;IACpB,IAAI,IAAI,CAACN,UAAU,EAAE;AACnB,MAAA;AACF,IAAA;AACA,IAAA,IAAI,CAACH,IAAI,CAACC,OAAO,CAACS,MAAM,CAAC,IAAI,CAACV,IAAI,CAACE,KAAK,CAAA;EAC1C,CAAA;EAEA,IAAIS,WAAAA,GAAsB;AACxB,IAAA,OAAOC,MAAA,CAAO,IAAI,CAACZ,IAAI,CAACE,KAAK,CAAA;AAC/B,EAAA;EAEAW,YAAA,GAAeA,MAAQ;IACrB,IAAI,IAAI,CAACV,UAAU,EAAE;AACnB,MAAA;AACF,IAAA;AACA,IAAA,IAAI,CAACH,IAAI,CAACC,OAAO,CAACS,MAAM,CAAC,IAAI,CAACV,IAAI,CAACE,KAAK,CAAA;AAExC;AACA;AACA;AACA;AACA,IAAA,IAAI,CAACF,IAAI,CAACC,OAAO,CAACa,eAAe,EAAA;EACnC,CAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"item.js","sources":["../../../../src/components/buttons/segmented-control/item.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { press } from '../../../modifiers/press';\nimport { modifier } from 'ember-modifier';\nimport type { SegmentedControlContext } from './segmented-control';\n\ninterface SegmentedControlItemArgs<T> {\n /**\n * The value this item represents. Selecting it calls the control's\n * `@onChange` with exactly this value.\n */\n value: T;\n\n /**\n * Disables this item alone: it cannot be clicked and keyboard navigation\n * skips over it. The whole control can be disabled with the control's own\n * `@isDisabled`.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\n\n /** Class names appended to this item's theme classes. */\n class?: string;\n\n /**\n * Supplied by SegmentedControl. Not part of the public API.\n *\n * @internal\n */\n context: SegmentedControlContext<T>;\n}\n\ninterface SegmentedControlItemSignature<T> {\n Args: SegmentedControlItemArgs<T>;\n Blocks: {\n default: [{ isSelected: boolean }];\n };\n Element: HTMLButtonElement | HTMLLabelElement;\n}\n\nclass SegmentedControlItem<T> extends Component<\n SegmentedControlItemSignature<T>\n> {\n get isSelected(): boolean {\n return this.args.context.isSelected(this.args.value);\n }\n\n get isDisabled(): boolean {\n return this.args.isDisabled || this.args.context.isGroupDisabled;\n }\n\n registerValue = modifier((element: HTMLElement, [value]: [T]) => {\n this.args.context.registerValue(element, value);\n\n return (): void => {\n this.args.context.unregisterValue(element);\n };\n });\n\n handleClick = (): void => {\n if (this.isDisabled) {\n return;\n }\n this.args.context.select(this.args.value);\n };\n\n get stringValue(): string {\n return String(this.args.value);\n }\n\n handleChange = (): void => {\n if (this.isDisabled) {\n return;\n }\n this.args.context.select(this.args.value);\n\n // The browser has already moved checkedness in the DOM. Ask the control to\n // re-assert the whole group from `@value` once the consumer has had its\n // chance to respond, so a declined (or absent) `@onChange` cannot leave the\n // native state disagreeing with the rendered selection.\n this.args.context.requestFormSync();\n };\n\n <template>\n {{#if @context.name}}\n {{! Form mode. Native radios bring their own arrow-key and focus\n behaviour for a same-named group, so RovingFocus deliberately stands\n down here rather than fighting the browser for control. }}\n <label\n data-part=\"item\"\n class=\"{{@context.itemClass}} {{@class}}\"\n data-selected=\"{{this.isSelected}}\"\n data-disabled=\"{{this.isDisabled}}\"\n {{@context.indicator.setupTarget this.isSelected}}\n ...attributes\n >\n <input\n type=\"radio\"\n name={{@context.name}}\n value={{this.stringValue}}\n checked={{this.isSelected}}\n disabled={{this.isDisabled}}\n class=\"sr-only\"\n {{this.registerValue @value}}\n {{on \"change\" this.handleChange}}\n />\n {{yield (hash isSelected=this.isSelected)}}\n </label>\n {{else}}\n <button\n type=\"button\"\n role=\"radio\"\n data-part=\"item\"\n aria-checked=\"{{this.isSelected}}\"\n disabled={{this.isDisabled}}\n class=\"{{@context.itemClass}} {{@class}}\"\n data-selected=\"{{this.isSelected}}\"\n data-disabled=\"{{this.isDisabled}}\"\n {{this.registerValue @value}}\n {{@context.indicator.setupTarget this.isSelected}}\n {{@context.roving.setupItem}}\n {{press this.handleClick}}\n ...attributes\n >\n {{yield (hash isSelected=this.isSelected)}}\n </button>\n {{/if}}\n </template>\n}\n\nexport {\n SegmentedControlItem,\n type SegmentedControlItemSignature,\n type SegmentedControlItemArgs\n};\nexport default SegmentedControlItem;\n"],"names":["SegmentedControlItem","Component","isSelected","args","context","value","isDisabled","isGroupDisabled","registerValue","modifier","element","unregisterValue","handleClick","select","stringValue","String","handleChange","requestFormSync","setComponentTemplate","precompileTemplate","strictMode","scope","on","hash","press"],"mappings":";;;;;;;;AA0CA,MAAMA,oBAAA,SAAgCC,SAAA,CACN;EAE9B,IAAIC,UAAAA,GAAsB;AACxB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,OAAO,CAACF,UAAU,CAAC,IAAI,CAACC,IAAI,CAACE,KAAK,CAAA;AACrD,EAAA;EAEA,IAAIC,UAAAA,GAAsB;AACxB,IAAA,OAAO,IAAI,CAACH,IAAI,CAACG,UAAU,IAAI,IAAI,CAACH,IAAI,CAACC,OAAO,CAACG,eAAe;AAClE,EAAA;EAEAC,aAAA,GAAgBC,SAAS,CAACC,OAAS,EAAa,CAACL,MAAW,KAAA;IAC1D,IAAI,CAACF,IAAI,CAACC,OAAO,CAACI,aAAa,CAACE,OAAA,EAASL,KAAA,CAAA;AAEzC,IAAA,OAAO,MAAQ;MACb,IAAI,CAACF,IAAI,CAACC,OAAO,CAACO,eAAe,CAACD,OAAA,CAAA;IACpC,CAAA;AACF,EAAA,CAAA,CAAA;EAEAE,WAAA,GAAcA,MAAQ;IACpB,IAAI,IAAI,CAACN,UAAU,EAAE;AACnB,MAAA;AACF,IAAA;AACA,IAAA,IAAI,CAACH,IAAI,CAACC,OAAO,CAACS,MAAM,CAAC,IAAI,CAACV,IAAI,CAACE,KAAK,CAAA;EAC1C,CAAA;EAEA,IAAIS,WAAAA,GAAsB;AACxB,IAAA,OAAOC,MAAA,CAAO,IAAI,CAACZ,IAAI,CAACE,KAAK,CAAA;AAC/B,EAAA;EAEAW,YAAA,GAAeA,MAAQ;IACrB,IAAI,IAAI,CAACV,UAAU,EAAE;AACnB,MAAA;AACF,IAAA;AACA,IAAA,IAAI,CAACH,IAAI,CAACC,OAAO,CAACS,MAAM,CAAC,IAAI,CAACV,IAAI,CAACE,KAAK,CAAA;AAExC;AACA;AACA;AACA;AACA,IAAA,IAAI,CAACF,IAAI,CAACC,OAAO,CAACa,eAAe,EAAA;EACnC,CAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,+rCAAA,EA4CA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -161,7 +161,7 @@ class SegmentedControl extends Component {
|
|
|
161
161
|
decorateMethodV2(this.prototype, "context", [cached]);
|
|
162
162
|
}
|
|
163
163
|
static {
|
|
164
|
-
setComponentTemplate(precompileTemplate("<div role=\"radiogroup\" aria-orientation={{this.orientation}} aria-disabled={{if @isDisabled \"true\"}} class=\"group/segmented {{this.styles.base class=@classes.base}}\" {{this.indicator.setupContainer}} ...attributes>\n <span aria-hidden=\"true\" class={{this.styles.indicator class=@classes.indicator}}></span>\n\n {{!--\n Glint cannot compose WithBoundArgs with a generic component, so the\n curried Item does not type-check against the block signature even\n though that signature is correct. The let exists only to isolate the\n failure onto the yield, keeping the ignore below scoped to a single\n line; a nocheck directive would silence this whole template instead.\n --}}\n {{#let (component SegmentedControlItem context=this.context) as |Item|}}\n {{!-- @glint-ignore: WithBoundArgs vs. a generic component --}}\n {{yield (hash Item=Item)}}\n {{/let}}\n</div>", {
|
|
164
|
+
setComponentTemplate(precompileTemplate("<div data-component=\"segmented-control\" data-part=\"base\" role=\"radiogroup\" aria-orientation={{this.orientation}} aria-disabled={{if @isDisabled \"true\"}} class=\"group/segmented {{this.styles.base class=@classes.base}}\" {{this.indicator.setupContainer}} ...attributes>\n <span data-part=\"indicator\" aria-hidden=\"true\" class={{this.styles.indicator class=@classes.indicator}}></span>\n\n {{!--\n Glint cannot compose WithBoundArgs with a generic component, so the\n curried Item does not type-check against the block signature even\n though that signature is correct. The let exists only to isolate the\n failure onto the yield, keeping the ignore below scoped to a single\n line; a nocheck directive would silence this whole template instead.\n --}}\n {{#let (component SegmentedControlItem context=this.context) as |Item|}}\n {{!-- @glint-ignore: WithBoundArgs vs. a generic component --}}\n {{yield (hash Item=Item)}}\n {{/let}}\n</div>", {
|
|
165
165
|
strictMode: true,
|
|
166
166
|
scope: () => ({
|
|
167
167
|
SegmentedControlItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented-control.js","sources":["../../../../src/components/buttons/segmented-control/segmented-control.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached, tracked } from '@glimmer/tracking';\nimport { hash } from '@ember/helper';\nimport { registerDestructor } from '@ember/destroyable';\nimport type Owner from '@ember/owner';\nimport { useStyles, type SlotsToClasses } from '@frontile/theme';\nimport {\n selectionIndicator,\n type SelectionIndicator\n} from '../../../utils/selection-indicator';\nimport { rovingFocus, type RovingFocus } from '../../../utils/roving-focus';\nimport { deferredWork } from '../../../utils/deferred-work';\nimport SegmentedControlItem from './item';\nimport type {\n SegmentedControlSlots,\n SegmentedControlVariants\n} from '@frontile/theme';\nimport type { WithBoundArgs } from '@glint/template';\n\ninterface SegmentedControlArgs<T> {\n /**\n * The currently selected value. Compared against each item's `@value` with\n * `===`, so object values must be referentially stable.\n *\n * *Passing* this argument at all puts the component in controlled mode --\n * passing it as `undefined` included, which is how a controlled control says\n * \"nothing is selected\". The selection then only ever reflects what you\n * pass, so pair it with `@onChange` and update your own state; setting it\n * back to `undefined` clears the selection. Omit the argument entirely to\n * let the control track the selection itself, seeded by `@defaultValue`.\n */\n value?: T;\n\n /**\n * Sets the initially selected value when the control is used uncontrolled\n * (that is, when `@value` is not provided). Ignored in controlled mode.\n *\n * @defaultValue undefined\n */\n defaultValue?: T;\n\n /** Called with the newly selected value when an item is chosen. */\n onChange?: (value: T) => void;\n\n /**\n * When set, items render as `<label>` wrapping a native radio input under\n * this name, so the control submits with its form. Without it the control\n * renders buttons and reports only through `onChange`.\n */\n name?: string;\n\n /**\n * The colour intent applied to the selected item's indicator and label.\n *\n * @defaultValue 'default'\n */\n intent?: SegmentedControlVariants['intent'];\n\n /**\n * The visual style of the control's track and indicator.\n *\n * @defaultValue 'solid'\n */\n variant?: SegmentedControlVariants['variant'];\n\n /**\n * The size of the control, driving item padding and text size.\n *\n * @defaultValue 'md'\n */\n size?: SegmentedControlVariants['size'];\n\n /**\n * Lays the items out in a row or a column, and switches the arrow keys that\n * move between them to match.\n *\n * @defaultValue 'horizontal'\n */\n orientation?: SegmentedControlVariants['orientation'];\n\n /**\n * Stretches the control to its container and gives every item equal width.\n *\n * @defaultValue false\n */\n isFullWidth?: boolean;\n\n /**\n * Draws a hairline between neighbouring items, hidden around the selected\n * one so the indicator never crosses a visible line.\n *\n * @defaultValue false\n */\n hasSeparators?: boolean;\n\n /**\n * Disables every item. Individual items can be disabled with the item's own\n * `@isDisabled`.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\n\n /** Class names for each slot of the component, merged with the theme's. */\n classes?: SlotsToClasses<SegmentedControlSlots>;\n}\n\ninterface SegmentedControlContext<T> {\n indicator: SelectionIndicator;\n roving: RovingFocus;\n isSelected: (value: T) => boolean;\n select: (value: T) => void;\n registerValue: (element: HTMLElement, value: T) => void;\n unregisterValue: (element: HTMLElement) => void;\n isGroupDisabled: boolean;\n name?: string;\n itemClass: string;\n requestFormSync: () => void;\n}\n\ninterface SegmentedControlSignature<T> {\n Args: SegmentedControlArgs<T>;\n Blocks: {\n default: [\n {\n Item: WithBoundArgs<typeof SegmentedControlItem<T>, 'context'>;\n }\n ];\n };\n Element: HTMLDivElement;\n}\n\nclass SegmentedControl<T> extends Component<SegmentedControlSignature<T>> {\n indicator = selectionIndicator();\n\n // Uncontrolled mode's own selection, seeded from `@defaultValue`. Written on\n // every `select` regardless of mode -- see `select` -- so the two modes stay\n // on one code path, exactly as `Switch` does it.\n @tracked _value: T | undefined;\n\n // Values are held against their elements rather than serialised into a\n // `data-` attribute, so a non-string `@value` survives the round trip from\n // keyboard activation back to `onChange`. A `Map` rather than a `WeakMap`\n // because form mode has to walk every registered element to re-assert\n // checkedness; entries are removed by the registering modifier's teardown,\n // so nothing outlives the elements themselves.\n #values = new Map<HTMLElement, T>();\n\n #formSync = deferredWork('@frontile/buttons:segmented-control-form-sync');\n\n roving = rovingFocus(() => ({\n orientation: this.args.orientation ?? 'horizontal',\n activationMode: 'automatic' as const,\n onActivate: this.activateElement\n }));\n\n constructor(owner: Owner, args: SegmentedControlSignature<T>['Args']) {\n super(owner, args);\n this._value = this.args.defaultValue;\n // The indicator and the roving-focus manager clean themselves up through\n // their own modifiers' destructors. This frame is the component's own, so\n // it is the only thing here that needs registering.\n registerDestructor(this, () => {\n this.#formSync.cancel();\n });\n }\n\n @cached\n get styles() {\n const { segmentedControl } = useStyles();\n\n return segmentedControl({\n intent: this.args.intent,\n variant: this.args.variant,\n size: this.args.size,\n orientation: this.args.orientation,\n isFullWidth: this.args.isFullWidth,\n isDisabled: this.args.isDisabled,\n hasSeparators: this.args.hasSeparators\n });\n }\n\n get orientation(): 'horizontal' | 'vertical' {\n return this.args.orientation ?? 'horizontal';\n }\n\n /**\n * Whether `@value` was *passed* decides the mode -- not whether it holds a\n * value. `@value` is generic, so `undefined` is a legitimate selection\n * meaning \"nothing is selected\"; testing `!== undefined` (as `Switch` can,\n * because its `@isSelected` is a boolean and `undefined` there really does\n * mean \"not passed\") would run a controlled control uncontrolled until its\n * first pick, and would make clearing the selection impossible.\n *\n * Glimmer's named-args object carries a key for every argument written in\n * the invoking template, so `in` distinguishes `@value={{undefined}}` from\n * an omitted `@value` -- which `undefined` alone cannot.\n */\n get isControlled(): boolean {\n return 'value' in this.args;\n }\n\n /**\n * The selection everything else reads: the argument when controlled, the\n * internal field otherwise. `requestFormSync` re-asserts the native radios\n * from this (via `isSelected`) rather than from `@value`, so an uncontrolled\n * form-mode control does not snap the user's click back.\n */\n get selectedValue(): T | undefined {\n return this.isControlled ? this.args.value : this._value;\n }\n\n isSelected = (value: T): boolean => {\n return this.selectedValue === value;\n };\n\n select = (value: T): void => {\n if (this.args.isDisabled) {\n return;\n }\n // Written unconditionally, as in `Switch`: in controlled mode the getter\n // above ignores it, so one assignment serves both modes.\n this._value = value;\n this.args.onChange?.(value);\n };\n\n activateElement = (element: HTMLElement): void => {\n // `has`, not a `!== undefined` check on the result: `T` may itself be\n // `undefined`, so only membership distinguishes \"this element is not\n // registered\" from \"it is registered against an undefined value\".\n if (!this.#values.has(element)) {\n return;\n }\n this.select(this.#values.get(element) as T);\n };\n\n registerValue = (element: HTMLElement, value: T): void => {\n this.#values.set(element, value);\n };\n\n unregisterValue = (element: HTMLElement): void => {\n this.#values.delete(element);\n };\n\n /**\n * Form mode only. A native radio flips its own `checked` the moment it is\n * clicked and Glimmer will not undo that, so the DOM can drift from `@value`\n * when a consumer declines the change.\n *\n * It waits a frame rather than correcting synchronously: reading `@value`\n * inside the change handler would see the stale value and stomp a legitimate\n * update.\n */\n requestFormSync = (): void => {\n this.#formSync.schedule(() => {\n if (this.isDestroying || this.isDestroyed) {\n return;\n }\n\n // The whole group is walked: unchecking the clicked radio does not\n // restore its previously-checked sibling.\n for (const [element, value] of this.#values) {\n if (!(element instanceof HTMLInputElement)) {\n continue;\n }\n const shouldBeChecked = this.isSelected(value);\n if (element.checked !== shouldBeChecked) {\n element.checked = shouldBeChecked;\n }\n }\n });\n };\n\n @cached\n get context(): SegmentedControlContext<T> {\n return {\n indicator: this.indicator,\n roving: this.roving,\n isSelected: this.isSelected,\n select: this.select,\n registerValue: this.registerValue,\n unregisterValue: this.unregisterValue,\n isGroupDisabled: this.args.isDisabled ?? false,\n name: this.args.name,\n requestFormSync: this.requestFormSync,\n itemClass: this.styles.item({ class: this.args.classes?.item })\n };\n }\n\n <template>\n <div\n role=\"radiogroup\"\n aria-orientation={{this.orientation}}\n aria-disabled={{if @isDisabled \"true\"}}\n class=\"group/segmented {{this.styles.base class=@classes.base}}\"\n {{this.indicator.setupContainer}}\n ...attributes\n >\n <span\n aria-hidden=\"true\"\n class={{this.styles.indicator class=@classes.indicator}}\n ></span>\n\n {{!\n Glint cannot compose WithBoundArgs with a generic component, so the\n curried Item does not type-check against the block signature even\n though that signature is correct. The let exists only to isolate the\n failure onto the yield, keeping the ignore below scoped to a single\n line; a nocheck directive would silence this whole template instead.\n }}\n {{#let (component SegmentedControlItem context=this.context) as |Item|}}\n {{! @glint-ignore: WithBoundArgs vs. a generic component }}\n {{yield (hash Item=Item)}}\n {{/let}}\n </div>\n </template>\n}\n\nexport {\n SegmentedControl,\n type SegmentedControlSignature,\n type SegmentedControlArgs,\n type SegmentedControlContext\n};\nexport default SegmentedControl;\n"],"names":["SegmentedControl","Component","indicator","selectionIndicator","g","prototype","tracked","i","Map","deferredWork","roving","rovingFocus","orientation","args","activationMode","onActivate","activateElement","constructor","owner","_value","defaultValue","registerDestructor","cancel","styles","segmentedControl","useStyles","intent","variant","size","isFullWidth","isDisabled","hasSeparators","n","cached","isControlled","selectedValue","value","isSelected","select","onChange","element","has","get","registerValue","set","unregisterValue","delete","requestFormSync","schedule","isDestroying","isDestroyed","HTMLInputElement","shouldBeChecked","checked","context","isGroupDisabled","name","itemClass","item","class","classes","setComponentTemplate","precompileTemplate","strictMode","scope","SegmentedControlItem","hash"],"mappings":";;;;;;;;;;;;;AAoIA,MAAMA,gBAAA,SAA4BC,SAAA,CAAoC;EACpEC,SAAA,GAAYC,kBAAA,EAAA;AAEZ;AACA;AACA;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CACCC,OAAA,CAAA,CAAA;AAAA;EAAA,OAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,QAAA,CAAA,EAAA,MAAA;AAED;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,OAAO,GAAG,IAAIC,GAAA,EAAiB;AAE/B,EAAA,SAAS,GAAGC,YAAA,CAAa,+CAAA,CAAA;EAEzBC,MAAA,GAASC,WAAA,CAAY,OAAO;AAC1BC,IAAAA,WAAA,EAAa,IAAI,CAACC,IAAI,CAACD,WAAW,IAAI,YAAA;AACtCE,IAAAA,cAAA,EAAgB,WAAA;IAChBC,UAAA,EAAY,IAAI,CAACC;AACnB,GAAC,CAAA,CAAA;AAEDC,EAAAA,WAAAA,CAAYC,KAAY,EAAEL,IAA0C,EAAE;AACpE,IAAA,KAAK,CAACK,KAAA,EAAOL,IAAA,CAAA;AACb,IAAA,IAAI,CAACM,MAAM,GAAG,IAAI,CAACN,IAAI,CAACO,YAAY;AACpC;AACA;AACA;IACAC,kBAAA,CAAmB,IAAI,EAAE,MAAA;AACvB,MAAA,IAAI,CAAC,SAAS,CAACC,MAAM,EAAA;AACvB,IAAA,CAAA,CAAA;AACF,EAAA;EAEA,IACIC,MAAAA,GAAS;IACX,MAAM;AAAEC,MAAAA;KAAkB,GAAGC,SAAA,EAAA;AAE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AAM;MACnB2B,UAAA,EAAY,IAAI,CAACA,UAAU;MAC3BC,MAAA,EAAQ,IAAI,CAACA,MAAM;MACnBK,aAAA,EAAe,IAAI,CAACA,aAAa;MACjCE,eAAA,EAAiB,IAAI,CAACA,eAAe;AACrCU,MAAAA,eAAA,EAAiB,IAAI,CAAC1C,IAAI,CAACiB,UAAU,IAAI,KAAA;AACzC0B,MAAAA,IAAA,EAAM,IAAI,CAAC3C,IAAI,CAAC2C,IAAI;MACpBT,eAAA,EAAiB,IAAI,CAACA,eAAe;AACrCU,MAAAA,SAAA,EAAW,IAAI,CAAClC,MAAM,CAACmC,IAAI,CAAC;AAAEC,QAAAA,KAAA,EAAO,IAAI,CAAC9C,IAAI,CAAC+C,OAAO,EAAEF;OAAK;KAC/D;AACF,EAAA;AAAA,EAAA;IAAA1B,gBAAA,CAAA,IAAA,CAAA3B,SAAA,EAAA,SAAA,EAAA,CAdC4B,MAAA,CAAA,CAAA;AAAA;AAgBD,EAAA;IAAA4B,oBAAA,CAAAC,kBAAA,CAAA,k4BAAA,EA0BA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,oBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
1
|
+
{"version":3,"file":"segmented-control.js","sources":["../../../../src/components/buttons/segmented-control/segmented-control.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached, tracked } from '@glimmer/tracking';\nimport { hash } from '@ember/helper';\nimport { registerDestructor } from '@ember/destroyable';\nimport type Owner from '@ember/owner';\nimport { useStyles, type SlotsToClasses } from '@frontile/theme';\nimport {\n selectionIndicator,\n type SelectionIndicator\n} from '../../../utils/selection-indicator';\nimport { rovingFocus, type RovingFocus } from '../../../utils/roving-focus';\nimport { deferredWork } from '../../../utils/deferred-work';\nimport SegmentedControlItem from './item';\nimport type {\n SegmentedControlSlots,\n SegmentedControlVariants\n} from '@frontile/theme';\nimport type { WithBoundArgs } from '@glint/template';\n\ninterface SegmentedControlArgs<T> {\n /**\n * The currently selected value. Compared against each item's `@value` with\n * `===`, so object values must be referentially stable.\n *\n * *Passing* this argument at all puts the component in controlled mode --\n * passing it as `undefined` included, which is how a controlled control says\n * \"nothing is selected\". The selection then only ever reflects what you\n * pass, so pair it with `@onChange` and update your own state; setting it\n * back to `undefined` clears the selection. Omit the argument entirely to\n * let the control track the selection itself, seeded by `@defaultValue`.\n */\n value?: T;\n\n /**\n * Sets the initially selected value when the control is used uncontrolled\n * (that is, when `@value` is not provided). Ignored in controlled mode.\n *\n * @defaultValue undefined\n */\n defaultValue?: T;\n\n /** Called with the newly selected value when an item is chosen. */\n onChange?: (value: T) => void;\n\n /**\n * When set, items render as `<label>` wrapping a native radio input under\n * this name, so the control submits with its form. Without it the control\n * renders buttons and reports only through `onChange`.\n */\n name?: string;\n\n /**\n * The colour intent applied to the selected item's indicator and label.\n *\n * @defaultValue 'default'\n */\n intent?: SegmentedControlVariants['intent'];\n\n /**\n * The visual style of the control's track and indicator.\n *\n * @defaultValue 'solid'\n */\n variant?: SegmentedControlVariants['variant'];\n\n /**\n * The size of the control, driving item padding and text size.\n *\n * @defaultValue 'md'\n */\n size?: SegmentedControlVariants['size'];\n\n /**\n * Lays the items out in a row or a column, and switches the arrow keys that\n * move between them to match.\n *\n * @defaultValue 'horizontal'\n */\n orientation?: SegmentedControlVariants['orientation'];\n\n /**\n * Stretches the control to its container and gives every item equal width.\n *\n * @defaultValue false\n */\n isFullWidth?: boolean;\n\n /**\n * Draws a hairline between neighbouring items, hidden around the selected\n * one so the indicator never crosses a visible line.\n *\n * @defaultValue false\n */\n hasSeparators?: boolean;\n\n /**\n * Disables every item. Individual items can be disabled with the item's own\n * `@isDisabled`.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\n\n /** Class names for each slot of the component, merged with the theme's. */\n classes?: SlotsToClasses<SegmentedControlSlots>;\n}\n\ninterface SegmentedControlContext<T> {\n indicator: SelectionIndicator;\n roving: RovingFocus;\n isSelected: (value: T) => boolean;\n select: (value: T) => void;\n registerValue: (element: HTMLElement, value: T) => void;\n unregisterValue: (element: HTMLElement) => void;\n isGroupDisabled: boolean;\n name?: string;\n itemClass: string;\n requestFormSync: () => void;\n}\n\ninterface SegmentedControlSignature<T> {\n Args: SegmentedControlArgs<T>;\n Blocks: {\n default: [\n {\n Item: WithBoundArgs<typeof SegmentedControlItem<T>, 'context'>;\n }\n ];\n };\n Element: HTMLDivElement;\n}\n\nclass SegmentedControl<T> extends Component<SegmentedControlSignature<T>> {\n indicator = selectionIndicator();\n\n // Uncontrolled mode's own selection, seeded from `@defaultValue`. Written on\n // every `select` regardless of mode -- see `select` -- so the two modes stay\n // on one code path, exactly as `Switch` does it.\n @tracked _value: T | undefined;\n\n // Values are held against their elements rather than serialised into a\n // `data-` attribute, so a non-string `@value` survives the round trip from\n // keyboard activation back to `onChange`. A `Map` rather than a `WeakMap`\n // because form mode has to walk every registered element to re-assert\n // checkedness; entries are removed by the registering modifier's teardown,\n // so nothing outlives the elements themselves.\n #values = new Map<HTMLElement, T>();\n\n #formSync = deferredWork('@frontile/buttons:segmented-control-form-sync');\n\n roving = rovingFocus(() => ({\n orientation: this.args.orientation ?? 'horizontal',\n activationMode: 'automatic' as const,\n onActivate: this.activateElement\n }));\n\n constructor(owner: Owner, args: SegmentedControlSignature<T>['Args']) {\n super(owner, args);\n this._value = this.args.defaultValue;\n // The indicator and the roving-focus manager clean themselves up through\n // their own modifiers' destructors. This frame is the component's own, so\n // it is the only thing here that needs registering.\n registerDestructor(this, () => {\n this.#formSync.cancel();\n });\n }\n\n @cached\n get styles() {\n const { segmentedControl } = useStyles();\n\n return segmentedControl({\n intent: this.args.intent,\n variant: this.args.variant,\n size: this.args.size,\n orientation: this.args.orientation,\n isFullWidth: this.args.isFullWidth,\n isDisabled: this.args.isDisabled,\n hasSeparators: this.args.hasSeparators\n });\n }\n\n get orientation(): 'horizontal' | 'vertical' {\n return this.args.orientation ?? 'horizontal';\n }\n\n /**\n * Whether `@value` was *passed* decides the mode -- not whether it holds a\n * value. `@value` is generic, so `undefined` is a legitimate selection\n * meaning \"nothing is selected\"; testing `!== undefined` (as `Switch` can,\n * because its `@isSelected` is a boolean and `undefined` there really does\n * mean \"not passed\") would run a controlled control uncontrolled until its\n * first pick, and would make clearing the selection impossible.\n *\n * Glimmer's named-args object carries a key for every argument written in\n * the invoking template, so `in` distinguishes `@value={{undefined}}` from\n * an omitted `@value` -- which `undefined` alone cannot.\n */\n get isControlled(): boolean {\n return 'value' in this.args;\n }\n\n /**\n * The selection everything else reads: the argument when controlled, the\n * internal field otherwise. `requestFormSync` re-asserts the native radios\n * from this (via `isSelected`) rather than from `@value`, so an uncontrolled\n * form-mode control does not snap the user's click back.\n */\n get selectedValue(): T | undefined {\n return this.isControlled ? this.args.value : this._value;\n }\n\n isSelected = (value: T): boolean => {\n return this.selectedValue === value;\n };\n\n select = (value: T): void => {\n if (this.args.isDisabled) {\n return;\n }\n // Written unconditionally, as in `Switch`: in controlled mode the getter\n // above ignores it, so one assignment serves both modes.\n this._value = value;\n this.args.onChange?.(value);\n };\n\n activateElement = (element: HTMLElement): void => {\n // `has`, not a `!== undefined` check on the result: `T` may itself be\n // `undefined`, so only membership distinguishes \"this element is not\n // registered\" from \"it is registered against an undefined value\".\n if (!this.#values.has(element)) {\n return;\n }\n this.select(this.#values.get(element) as T);\n };\n\n registerValue = (element: HTMLElement, value: T): void => {\n this.#values.set(element, value);\n };\n\n unregisterValue = (element: HTMLElement): void => {\n this.#values.delete(element);\n };\n\n /**\n * Form mode only. A native radio flips its own `checked` the moment it is\n * clicked and Glimmer will not undo that, so the DOM can drift from `@value`\n * when a consumer declines the change.\n *\n * It waits a frame rather than correcting synchronously: reading `@value`\n * inside the change handler would see the stale value and stomp a legitimate\n * update.\n */\n requestFormSync = (): void => {\n this.#formSync.schedule(() => {\n if (this.isDestroying || this.isDestroyed) {\n return;\n }\n\n // The whole group is walked: unchecking the clicked radio does not\n // restore its previously-checked sibling.\n for (const [element, value] of this.#values) {\n if (!(element instanceof HTMLInputElement)) {\n continue;\n }\n const shouldBeChecked = this.isSelected(value);\n if (element.checked !== shouldBeChecked) {\n element.checked = shouldBeChecked;\n }\n }\n });\n };\n\n @cached\n get context(): SegmentedControlContext<T> {\n return {\n indicator: this.indicator,\n roving: this.roving,\n isSelected: this.isSelected,\n select: this.select,\n registerValue: this.registerValue,\n unregisterValue: this.unregisterValue,\n isGroupDisabled: this.args.isDisabled ?? false,\n name: this.args.name,\n requestFormSync: this.requestFormSync,\n itemClass: this.styles.item({ class: this.args.classes?.item })\n };\n }\n\n <template>\n <div\n data-component=\"segmented-control\"\n data-part=\"base\"\n role=\"radiogroup\"\n aria-orientation={{this.orientation}}\n aria-disabled={{if @isDisabled \"true\"}}\n class=\"group/segmented {{this.styles.base class=@classes.base}}\"\n {{this.indicator.setupContainer}}\n ...attributes\n >\n <span\n data-part=\"indicator\"\n aria-hidden=\"true\"\n class={{this.styles.indicator class=@classes.indicator}}\n ></span>\n\n {{!\n Glint cannot compose WithBoundArgs with a generic component, so the\n curried Item does not type-check against the block signature even\n though that signature is correct. The let exists only to isolate the\n failure onto the yield, keeping the ignore below scoped to a single\n line; a nocheck directive would silence this whole template instead.\n }}\n {{#let (component SegmentedControlItem context=this.context) as |Item|}}\n {{! @glint-ignore: WithBoundArgs vs. a generic component }}\n {{yield (hash Item=Item)}}\n {{/let}}\n </div>\n </template>\n}\n\nexport {\n SegmentedControl,\n type SegmentedControlSignature,\n type SegmentedControlArgs,\n type SegmentedControlContext\n};\nexport default SegmentedControl;\n"],"names":["SegmentedControl","Component","indicator","selectionIndicator","g","prototype","tracked","i","Map","deferredWork","roving","rovingFocus","orientation","args","activationMode","onActivate","activateElement","constructor","owner","_value","defaultValue","registerDestructor","cancel","styles","segmentedControl","useStyles","intent","variant","size","isFullWidth","isDisabled","hasSeparators","n","cached","isControlled","selectedValue","value","isSelected","select","onChange","element","has","get","registerValue","set","unregisterValue","delete","requestFormSync","schedule","isDestroying","isDestroyed","HTMLInputElement","shouldBeChecked","checked","context","isGroupDisabled","name","itemClass","item","class","classes","setComponentTemplate","precompileTemplate","strictMode","scope","SegmentedControlItem","hash"],"mappings":";;;;;;;;;;;;;AAoIA,MAAMA,gBAAA,SAA4BC,SAAA,CAAoC;EACpEC,SAAA,GAAYC,kBAAA,EAAA;AAEZ;AACA;AACA;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CACCC,OAAA,CAAA,CAAA;AAAA;EAAA,OAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,QAAA,CAAA,EAAA,MAAA;AAED;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,OAAO,GAAG,IAAIC,GAAA,EAAiB;AAE/B,EAAA,SAAS,GAAGC,YAAA,CAAa,+CAAA,CAAA;EAEzBC,MAAA,GAASC,WAAA,CAAY,OAAO;AAC1BC,IAAAA,WAAA,EAAa,IAAI,CAACC,IAAI,CAACD,WAAW,IAAI,YAAA;AACtCE,IAAAA,cAAA,EAAgB,WAAA;IAChBC,UAAA,EAAY,IAAI,CAACC;AACnB,GAAC,CAAA,CAAA;AAEDC,EAAAA,WAAAA,CAAYC,KAAY,EAAEL,IAA0C,EAAE;AACpE,IAAA,KAAK,CAACK,KAAA,EAAOL,IAAA,CAAA;AACb,IAAA,IAAI,CAACM,MAAM,GAAG,IAAI,CAACN,IAAI,CAACO,YAAY;AACpC;AACA;AACA;IACAC,kBAAA,CAAmB,IAAI,EAAE,MAAA;AACvB,MAAA,IAAI,CAAC,SAAS,CAACC,MAAM,EAAA;AACvB,IAAA,CAAA,CAAA;AACF,EAAA;EAEA,IACIC,MAAAA,GAAS;IACX,MAAM;AAAEC,MAAAA;KAAkB,GAAGC,SAAA,EAAA;AAE7B,IAAA,OAAOD,gBAAA,CAAiB;AACtBE,MAAAA,MAAA,EAAQ,IAAI,CAACb,IAAI,CAACa,MAAM;AAC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AAA,EAAe,IAAI,CAACA,aAAa;MACjCE,eAAA,EAAiB,IAAI,CAACA,eAAe;AACrCU,MAAAA,eAAA,EAAiB,IAAI,CAAC1C,IAAI,CAACiB,UAAU,IAAI,KAAA;AACzC0B,MAAAA,IAAA,EAAM,IAAI,CAAC3C,IAAI,CAAC2C,IAAI;MACpBT,eAAA,EAAiB,IAAI,CAACA,eAAe;AACrCU,MAAAA,SAAA,EAAW,IAAI,CAAClC,MAAM,CAACmC,IAAI,CAAC;AAAEC,QAAAA,KAAA,EAAO,IAAI,CAAC9C,IAAI,CAAC+C,OAAO,EAAEF;OAAK;KAC/D;AACF,EAAA;AAAA,EAAA;IAAA1B,gBAAA,CAAA,IAAA,CAAA3B,SAAA,EAAA,SAAA,EAAA,CAdC4B,MAAA,CAAA,CAAA;AAAA;AAgBD,EAAA;IAAA4B,oBAAA,CAAAC,kBAAA,CAAA,k9BAAA,EA6BA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,oBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -27,7 +27,7 @@ class ToggleButton extends Component {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
static {
|
|
30
|
-
setComponentTemplate(precompileTemplate("<button type=\"button\" {{press this.onChange}} class={{this.classNames}} aria-pressed=\"{{this.isSelected}}\" ...attributes>\n {{yield}}\n</button>", {
|
|
30
|
+
setComponentTemplate(precompileTemplate("<button type=\"button\" {{press this.onChange}} class={{this.classNames}} aria-pressed=\"{{this.isSelected}}\" data-component=\"toggle-button\" data-part=\"base\" ...attributes>\n {{yield}}\n</button>", {
|
|
31
31
|
strictMode: true,
|
|
32
32
|
scope: () => ({
|
|
33
33
|
press
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-button.js","sources":["../../../src/components/buttons/toggle-button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { press } from '../../modifiers/press';\nimport type { ButtonArgs } from './button';\n\ninterface ToggleButtonArgs extends Pick<\n ButtonArgs,\n 'intent' | 'size' | 'class' | 'isInGroup'\n> {\n /**\n * If the button is currently selected\n *\n * @defaultValue false\n */\n isSelected?: boolean;\n\n /**\n * Callback when the buttle is toggled\n */\n onChange?: (isSelected: boolean) => void;\n}\n\ninterface ToggleButtonSignature {\n Args: ToggleButtonArgs;\n Blocks: {\n default: [];\n };\n Element: HTMLButtonElement;\n}\n\nclass ToggleButton extends Component<ToggleButtonSignature> {\n get classNames(): string {\n const { toggleButton } = useStyles();\n\n return toggleButton({\n intent: this.args.intent || 'default',\n size: this.args.size,\n appearance: 'outlined',\n isSelected: this.isSelected,\n isInGroup: this.args.isInGroup,\n class: this.args.class\n });\n }\n\n get isSelected() {\n return !!this.args.isSelected;\n }\n\n onChange = () => {\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(!this.isSelected);\n }\n };\n\n <template>\n <button\n type=\"button\"\n {{press this.onChange}}\n class={{this.classNames}}\n aria-pressed=\"{{this.isSelected}}\"\n ...attributes\n >\n {{yield}}\n </button>\n </template>\n}\n\nexport { ToggleButton, type ToggleButtonSignature };\nexport default ToggleButton;\n"],"names":["ToggleButton","Component","classNames","toggleButton","useStyles","intent","args","size","appearance","isSelected","isInGroup","class","onChange","setComponentTemplate","precompileTemplate","strictMode","scope","press"],"mappings":";;;;;;AA8BA,MAAMA,qBAAqBC,SAAA,CAAU;EACnC,IAAIC,UAAAA,GAAqB;IACvB,MAAM;AAAEC,MAAAA;KAAc,GAAGC,SAAA,EAAA;AAEzB,IAAA,OAAOD,YAAA,CAAa;AAClBE,MAAAA,MAAA,EAAQ,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,SAAA;AAC5BE,MAAAA,IAAA,EAAM,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,UAAA,EAAY,UAAA;MACZC,UAAA,EAAY,IAAI,CAACA,UAAU;AAC3BC,MAAAA,SAAA,EAAW,IAAI,CAACJ,IAAI,CAACI,SAAS;AAC9BC,MAAAA,KAAA,EAAO,IAAI,CAACL,IAAI,CAACK;AACnB,KAAA,CAAA;AACF,EAAA;EAEA,IAAIF,UAAAA,GAAa;AACf,IAAA,OAAO,CAAC,CAAC,IAAI,CAACH,IAAI,CAACG,UAAU;AAC/B,EAAA;EAEAG,QAAA,GAAWA,MAAA;IACT,IAAI,OAAO,IAAI,CAACN,IAAI,CAACM,QAAQ,KAAK,UAAA,EAAY;MAC5C,IAAI,CAACN,IAAI,CAACM,QAAQ,CAAC,CAAC,IAAI,CAACH,UAAU,CAAA;AACrC,IAAA;EACF,CAAA;AAEA,EAAA;IAAAI,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"toggle-button.js","sources":["../../../src/components/buttons/toggle-button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { press } from '../../modifiers/press';\nimport type { ButtonArgs } from './button';\n\ninterface ToggleButtonArgs extends Pick<\n ButtonArgs,\n 'intent' | 'size' | 'class' | 'isInGroup'\n> {\n /**\n * If the button is currently selected\n *\n * @defaultValue false\n */\n isSelected?: boolean;\n\n /**\n * Callback when the buttle is toggled\n */\n onChange?: (isSelected: boolean) => void;\n}\n\ninterface ToggleButtonSignature {\n Args: ToggleButtonArgs;\n Blocks: {\n default: [];\n };\n Element: HTMLButtonElement;\n}\n\nclass ToggleButton extends Component<ToggleButtonSignature> {\n get classNames(): string {\n const { toggleButton } = useStyles();\n\n return toggleButton({\n intent: this.args.intent || 'default',\n size: this.args.size,\n appearance: 'outlined',\n isSelected: this.isSelected,\n isInGroup: this.args.isInGroup,\n class: this.args.class\n });\n }\n\n get isSelected() {\n return !!this.args.isSelected;\n }\n\n onChange = () => {\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(!this.isSelected);\n }\n };\n\n <template>\n <button\n type=\"button\"\n {{press this.onChange}}\n class={{this.classNames}}\n aria-pressed=\"{{this.isSelected}}\"\n data-component=\"toggle-button\"\n data-part=\"base\"\n ...attributes\n >\n {{yield}}\n </button>\n </template>\n}\n\nexport { ToggleButton, type ToggleButtonSignature };\nexport default ToggleButton;\n"],"names":["ToggleButton","Component","classNames","toggleButton","useStyles","intent","args","size","appearance","isSelected","isInGroup","class","onChange","setComponentTemplate","precompileTemplate","strictMode","scope","press"],"mappings":";;;;;;AA8BA,MAAMA,qBAAqBC,SAAA,CAAU;EACnC,IAAIC,UAAAA,GAAqB;IACvB,MAAM;AAAEC,MAAAA;KAAc,GAAGC,SAAA,EAAA;AAEzB,IAAA,OAAOD,YAAA,CAAa;AAClBE,MAAAA,MAAA,EAAQ,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,SAAA;AAC5BE,MAAAA,IAAA,EAAM,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,UAAA,EAAY,UAAA;MACZC,UAAA,EAAY,IAAI,CAACA,UAAU;AAC3BC,MAAAA,SAAA,EAAW,IAAI,CAACJ,IAAI,CAACI,SAAS;AAC9BC,MAAAA,KAAA,EAAO,IAAI,CAACL,IAAI,CAACK;AACnB,KAAA,CAAA;AACF,EAAA;EAEA,IAAIF,UAAAA,GAAa;AACf,IAAA,OAAO,CAAC,CAAC,IAAI,CAACH,IAAI,CAACG,UAAU;AAC/B,EAAA;EAEAG,QAAA,GAAWA,MAAA;IACT,IAAI,OAAO,IAAI,CAACN,IAAI,CAACM,QAAQ,KAAK,UAAA,EAAY;MAC5C,IAAI,CAACN,IAAI,CAACM,QAAQ,CAAC,CAAC,IAAI,CAACH,UAAU,CAAA;AACrC,IAAA;EACF,CAAA;AAEA,EAAA;IAAAI,oBAAA,CAAAC,kBAAA,CAAA,2MAAA,EAYA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -44,7 +44,7 @@ class Calendar extends Component {
|
|
|
44
44
|
this.isYearGridOpen = !this.isYearGridOpen;
|
|
45
45
|
};
|
|
46
46
|
returnFocusToYearTrigger(element) {
|
|
47
|
-
const trigger = element?.querySelector('[data-
|
|
47
|
+
const trigger = element?.querySelector('[data-part="year-trigger"]');
|
|
48
48
|
if (trigger) {
|
|
49
49
|
trigger.focus();
|
|
50
50
|
return;
|
|
@@ -451,7 +451,7 @@ class Calendar extends Component {
|
|
|
451
451
|
* hijacked by the day-grid's roving-focus handling.
|
|
452
452
|
*/
|
|
453
453
|
focusOrigin(event) {
|
|
454
|
-
const key = event.target?.closest('[data-
|
|
454
|
+
const key = event.target?.closest('[data-part="day"]')?.dataset['key'];
|
|
455
455
|
return key ? fromDayKey(key) : null;
|
|
456
456
|
}
|
|
457
457
|
handleKeydown = event => {
|
|
@@ -545,7 +545,11 @@ class Calendar extends Component {
|
|
|
545
545
|
return;
|
|
546
546
|
}
|
|
547
547
|
this.#shouldFocus = false;
|
|
548
|
-
|
|
548
|
+
// No nested component renders a `day` part, so unlike the general
|
|
549
|
+
// `closest('[data-component]') === root` guard used elsewhere, this
|
|
550
|
+
// query cannot pick up a descendant component's own day-shaped cell --
|
|
551
|
+
// there is nothing else in the tree it could collide with.
|
|
552
|
+
element.querySelector('[data-part="day"][tabindex="0"]')?.focus();
|
|
549
553
|
});
|
|
550
554
|
/** How many months to render, starting at `visibleMonth`. */
|
|
551
555
|
get visibleMonths() {
|
|
@@ -791,7 +795,7 @@ class Calendar extends Component {
|
|
|
791
795
|
};
|
|
792
796
|
};
|
|
793
797
|
static {
|
|
794
|
-
setComponentTemplate(precompileTemplate("{{!-- template-lint-disable no-invalid-interactive --}}\n{{!-- The keydown listener implements the roving-tabindex grid pattern for\n the day buttons nested inside; the root itself stays a plain,\n non-focusable container. --}}\n<div data-
|
|
798
|
+
setComponentTemplate(precompileTemplate("{{!-- template-lint-disable no-invalid-interactive --}}\n{{!-- The keydown listener implements the roving-tabindex grid pattern for\n the day buttons nested inside; the root itself stays a plain,\n non-focusable container. --}}\n<div data-component=\"calendar\" data-part=\"base\" class={{this.styles.base class=@classes.base}} {{on \"keydown\" this.handleKeydown}} {{this.applyFocus this.focusedDate this.isYearGridOpen}} {{this.rootRef.setup}} ...attributes>\n {{!-- Header, year panel and grids share one column sized to the grids,\n so a wide footer block cannot stretch the header and pull the paging\n arrows away from the days they page. --}}\n <div data-part=\"body\" class={{this.styles.body class=@classes.body}}>\n {{#if (has-block \"header\")}}\n {{yield this.headerContext to=\"header\"}}\n {{else}}\n <CalendarHeader @context={{this.headerContext}} @captionLayout={{this.captionLayout}} @months={{this.monthOptions}} @isYearGridOpen={{this.isYearGridOpen}} @onToggleYearGrid={{this.toggleYearGrid}} @classes={{this.headerClasses}} />\n {{/if}}\n\n <VisuallyHidden>\n <div data-fr-calendar-live aria-live=\"polite\">{{this.caption}}</div>\n </VisuallyHidden>\n\n {{!-- The year panel stands in for the grids rather than stacking\n above them; otherwise picking a year pushes the days off screen. --}}\n {{#if this.isYearGridOpen}}\n <YearGrid @years={{this.yearOptions}} @currentYear={{this.visibleYear}} @onSelect={{this.pickYear}} @onDismiss={{this.dismissYearGrid}} @classes={{this.yearGridClasses}} />\n {{else}}\n <div data-part=\"months-wrapper\" class={{this.styles.monthsWrapper class=@classes.monthsWrapper}}>\n {{#each this.months key=\"key\" as |monthData|}}\n <MonthGrid @month={{monthData}} @weekdays={{this.weekdays}} @caption={{this.captionFor monthData.month}} @stateFor={{this.stateFor}} @isReadOnly={{this.isReadOnly}} @labelledBy={{@labelledBy}} @onSelect={{this.selectDay}} @onHover={{this.hoverDay}} @hasDayContent={{has-block \"day\"}} @hasWeekdayContent={{has-block \"weekday\"}} @classes={{this.gridClasses}}>\n <:day as |day|>{{yield day to=\"day\"}}</:day>\n <:weekday as |wd|>{{yield wd to=\"weekday\"}}</:weekday>\n </MonthGrid>\n {{/each}}\n </div>\n {{/if}}\n </div>\n\n {{#if (has-block \"footer\")}}\n <div data-part=\"footer\" class={{this.styles.footer class=@classes.footer}}>{{yield to=\"footer\"}}</div>\n {{/if}}\n</div>", {
|
|
795
799
|
strictMode: true,
|
|
796
800
|
scope: () => ({
|
|
797
801
|
on,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sources":["../../../../src/components/collections/calendar/calendar.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked, cached } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\nimport { modifier } from 'ember-modifier';\nimport {\n addDays,\n addMonths,\n addWeeks,\n addYears,\n startOfMonth,\n endOfMonth,\n endOfWeek,\n startOfWeek,\n isSameMonth,\n isAfter,\n isBefore\n} from 'date-fns';\nimport { useStyles, type SlotsToClasses } from '@frontile/theme';\nimport { MonthGrid } from './month-grid';\nimport { CalendarHeader, type CalendarHeaderContext } from './header';\nimport { YearGrid } from './year-grid';\nimport { VisuallyHidden } from '../../utilities/visually-hidden';\nimport { ref } from '../../../utils/ref';\nimport {\n buildMonthGrid,\n formatMonthCaption,\n formatWeekdays,\n resolveWeekStart,\n fromDayKey,\n isSameDay,\n isWithinBounds,\n normalizeRange,\n rangeLimits,\n startOfDay\n} from './utils';\nimport type { CalendarSlots, CalendarVariants } from '@frontile/theme';\nimport type {\n CalendarDay,\n CalendarMode,\n CalendarMonthData,\n CalendarValue,\n DateRange,\n DayState,\n WeekDay,\n WeekdayLabel\n} from './types';\n\nexport interface CalendarArgs<M extends CalendarMode = 'single'> {\n /**\n * Whether a click selects one day or the two ends of a range.\n *\n * @defaultValue 'single'\n */\n mode?: M;\n\n /**\n * Seeds the visible month when uncontrolled -- the *first* month of the\n * window when `@visibleMonths` is greater than one.\n */\n defaultMonth?: Date;\n\n /**\n * Controlled visible month -- the *first* month of the window when\n * `@visibleMonths` is greater than one.\n *\n * *Passing* this argument at all puts the month axis in controlled mode --\n * passing it as `undefined` included. Omit it entirely to let `Calendar`\n * track the visible month itself.\n */\n month?: Date;\n\n /** Called with the month the user asked to move to. */\n onMonthChange?: (month: Date) => void;\n\n /**\n * Controlled selection. *Passing* this argument at all puts selection in\n * controlled mode -- passing it as `undefined` included.\n */\n value?: CalendarValue<M>;\n\n /** Seeds the selection when uncontrolled. */\n defaultValue?: CalendarValue<M>;\n\n /** Called with the new selection when the user picks or clears a day. */\n onChange?: (value: CalendarValue<M>) => void;\n\n /** BCP-47 tag. All human-readable text is produced by `Intl` from this. */\n locale?: string;\n\n /** Overrides the first day of week implied by `@locale`. */\n weekStartsOn?: WeekDay;\n\n /**\n * Whether days from the adjacent month fill out a grid's leading/trailing\n * weeks. @defaultValue `true` when a single month is visible, `false`\n * once `@visibleMonths` is greater than one -- otherwise a boundary date\n * would render twice, once per adjacent grid.\n */\n showOutsideDays?: boolean;\n\n /**\n * Renders six week rows in every month, so the calendar keeps the same\n * height as you page between months of different lengths.\n *\n * @defaultValue false\n */\n fixedWeeks?: boolean;\n\n /**\n * How many months to render side by side, starting from the visible\n * month. @defaultValue 1\n */\n visibleMonths?: number;\n\n /**\n * How far prev/next paging advances. `'visible'` moves by the whole\n * window (`@visibleMonths`); `'single'` always moves by one month.\n *\n * @defaultValue 'visible'\n */\n pageBehavior?: 'visible' | 'single';\n\n /**\n * The color used for the selected day and the range band.\n *\n * @defaultValue 'primary'\n */\n intent?: CalendarVariants['intent'];\n\n /**\n * The size of the calendar cells and caption text.\n *\n * @defaultValue 'md'\n */\n size?: CalendarVariants['size'];\n\n /**\n * Blocks navigation and selection entirely.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\n\n /** Earliest selectable date. Also clamps month navigation. */\n minValue?: Date;\n\n /** Latest selectable date. Also clamps month navigation. */\n maxValue?: Date;\n\n /**\n * Marks a date as present but unselectable -- a holiday, a booked night.\n * Distinct from `@minValue`/`@maxValue`, which put a date out of range\n * entirely.\n */\n isDateUnavailable?: (date: Date) => boolean;\n\n /**\n * Allows paging between months but blocks selecting a day. Unlike\n * `@isDisabled`, the days stay focusable so the calendar can still be read\n * with the keyboard.\n *\n * @defaultValue false\n */\n isReadOnly?: boolean;\n\n /**\n * Moves DOM focus into the grid on insert. This is the *only* thing that\n * may focus the calendar on mount -- rendering a calendar must never\n * otherwise steal focus.\n *\n * @defaultValue false\n */\n autofocus?: boolean;\n\n /**\n * The id of an element naming this calendar, forwarded to each month grid's\n * `aria-labelledby`. Use it when something outside the calendar already\n * names it -- a date picker's own label, say -- so the grid is announced\n * with that name instead of its month caption.\n *\n * An `aria-labelledby` passed through `...attributes` lands on the root\n * element, which has no role, so it would not reach the grid.\n */\n labelledBy?: string;\n\n /** Overrides the classes applied to individual slots. */\n classes?: SlotsToClasses<CalendarSlots>;\n\n /**\n * `'label'` renders the plain month/year caption; `'dropdown'` swaps it for\n * a native month `<select>` plus a year trigger that opens a year-grid\n * picker.\n *\n * @defaultValue 'label'\n */\n captionLayout?: 'label' | 'dropdown';\n}\n\nexport interface CalendarSignature<M extends CalendarMode = 'single'> {\n Args: CalendarArgs<M>;\n Blocks: {\n day: [DayState];\n header: [CalendarHeaderContext];\n weekday: [WeekdayLabel];\n footer: [];\n };\n Element: HTMLDivElement;\n}\n\nclass Calendar<M extends CalendarMode = 'single'> extends Component<\n CalendarSignature<M>\n> {\n get locale(): string {\n return this.args.locale ?? navigator.language;\n }\n\n get weekStartsOn(): WeekDay {\n return resolveWeekStart(this.locale, this.args.weekStartsOn);\n }\n\n /**\n * Default is `true` for a single visible month, `false` once more than\n * one month is visible -- a boundary date would otherwise render twice\n * (once as a trailing/leading outside day, once as a real day in the\n * neighbouring grid). An explicit `@showOutsideDays` always wins, in\n * either direction.\n */\n get showOutsideDays(): boolean {\n return this.args.showOutsideDays ?? this.visibleMonths === 1;\n }\n\n get captionLayout(): 'label' | 'dropdown' {\n return this.args.captionLayout ?? 'label';\n }\n\n @tracked isYearGridOpen = false;\n\n toggleYearGrid = (): void => {\n this.isYearGridOpen = !this.isYearGridOpen;\n };\n\n private returnFocusToYearTrigger(element: HTMLElement | null): void {\n const trigger = element?.querySelector<HTMLElement>(\n '[data-fr-calendar-year-trigger]'\n );\n\n if (trigger) {\n trigger.focus();\n return;\n }\n\n // A `<:header>` block replaces the default header entirely, so there is\n // no year trigger to find -- the selector above matches nothing and,\n // without this fallback, the just-removed year button leaves focus on\n // `<body>`. Fall back to the roving day cell instead, same element\n // `applyFocus` would target.\n //\n // Requesting focus rather than taking it: the year panel stands in for\n // the day grid, so at this moment there is no day cell in the DOM to\n // focus. `applyFocus` takes over once the grid is back -- it depends on\n // `isYearGridOpen`, so closing the panel is what wakes it, and the flag\n // is consumed on that same rerender rather than lingering.\n this.#shouldFocus = true;\n }\n\n dismissYearGrid = (): void => {\n this.isYearGridOpen = false;\n // Dismissing a panel that took focus must give it back, or focus falls to\n // the body and the keyboard user loses their place.\n this.returnFocusToYearTrigger(this.rootRef.current ?? null);\n };\n\n pickYear = (year: number): void => {\n this.headerContext.setYear(year);\n this.isYearGridOpen = false;\n // Same as `dismissYearGrid`: closing the grid removes the just-activated\n // year button from the DOM, so focus must be restored explicitly or it\n // falls to the body.\n this.returnFocusToYearTrigger(this.rootRef.current ?? null);\n };\n\n /**\n * The root element, for the imperative focus restores above: closing the\n * year grid unmounts the button focus was on, so the element to move focus\n * to has to be looked up rather than rendered into.\n */\n rootRef = ref<HTMLElement>();\n\n @cached\n get monthOptions(): { value: number; label: string; isDisabled: boolean }[] {\n const fmt = this.monthNameFormatter;\n const year = this.visibleMonth.getFullYear();\n\n // A month is offered only when some day in it is in range. `yearOptions`\n // already clamps this way; without the same treatment the month picker is\n // a hole in the `@minValue`/`@maxValue` clamp, since it can navigate to a\n // month the prev/next buttons refuse to reach.\n return Array.from({ length: 12 }, (_, value) => {\n const month = new Date(year, value, 1);\n\n return {\n value,\n label: fmt.format(month),\n isDisabled: !this.canShowWindow(month)\n };\n });\n }\n\n /**\n * A getter, not a bare `{{this.visibleMonth.getFullYear}}` in the\n * template -- Glimmer does not auto-invoke a plain method reference in\n * argument position, it would pass the function itself instead of a\n * number.\n */\n get visibleYear(): number {\n return this.visibleMonth.getFullYear();\n }\n\n @cached\n get yearOptions(): number[] {\n const current = this.visibleMonth.getFullYear();\n\n // The visible year is always included, even when it sits outside\n // `@minValue`/`@maxValue`. The panel marks and scrolls to the *current*\n // year on open; omitting it leaves nothing to select, so the panel would\n // open unfocused and scrolled to an arbitrary decade. `Math.min`/`max`\n // also keep the range non-empty if the bounds are inverted, which would\n // otherwise render an empty listbox.\n const first = Math.min(\n this.args.minValue?.getFullYear() ?? current - 100,\n current\n );\n const last = Math.max(\n this.args.maxValue?.getFullYear() ?? current + 10,\n current\n );\n\n return Array.from({ length: last - first + 1 }, (_, i) => first + i);\n }\n\n @cached\n get yearGridClasses() {\n const s = this.styles;\n const c = this.args.classes ?? {};\n\n return {\n yearGrid: s.yearGrid({ class: c.yearGrid }),\n yearCell: s.yearCell({ class: c.yearCell })\n };\n }\n\n /**\n * Uncontrolled mode's own state. `undefined` means \"not navigated yet\",\n * which is what lets the seed getters below resolve without a tracked\n * write during render.\n */\n @tracked private _month: Date | undefined;\n\n private get isMonthControlled(): boolean {\n return 'month' in this.args;\n }\n\n get visibleMonth(): Date {\n if (this.isMonthControlled) {\n return startOfMonth(this.args.month ?? this.seedMonth);\n }\n if (this._month) {\n return startOfMonth(this._month);\n }\n return startOfMonth(this.seedMonth);\n }\n\n /**\n * A calendar seeded with a selection should open showing that selection,\n * not today.\n */\n private get seedMonth(): Date {\n if (this.args.defaultMonth) {\n return this.args.defaultMonth;\n }\n\n const seed = this.args.defaultValue ?? this.args.value;\n\n if (seed instanceof Date) {\n return seed;\n }\n if (seed && 'start' in seed) {\n return seed.start;\n }\n return new Date();\n }\n\n goToMonth = (month: Date): void => {\n const next = startOfMonth(month);\n\n // The clamp lives here, not only in `canGoPrevious`/`canGoNext`. Those\n // disable the default buttons, but `goToMonth` is also reachable through\n // `setMonth`/`setYear` and through the `goToPrevious`/`goToNext` yielded\n // to a `<:header>` block -- a custom header that ignores `canGoPrevious`\n // would otherwise page straight past `@minValue`.\n if (!this.canShowWindow(next)) {\n return;\n }\n\n if (!this.isMonthControlled) {\n this._month = next;\n }\n this.args.onMonthChange?.(next);\n };\n\n /**\n * Uncontrolled mode's own selection. `undefined` means \"not selected yet\",\n * mirroring `_month` above so the seed getter can resolve without a\n * tracked write during render.\n */\n @tracked private _value: CalendarValue<M> | undefined;\n\n private get isValueControlled(): boolean {\n return 'value' in this.args;\n }\n\n get selection(): CalendarValue<M> | null {\n if (this.isValueControlled) {\n return (this.args.value ?? null) as CalendarValue<M>;\n }\n if (this._value !== undefined) {\n return this._value;\n }\n return (this.args.defaultValue ?? null) as CalendarValue<M>;\n }\n\n private commit(value: CalendarValue<M>): void {\n if (!this.isValueControlled) {\n this._value = value;\n }\n this.args.onChange?.(value);\n }\n\n /** The first endpoint of a range being built. `undefined` means idle. */\n @tracked private _anchor: Date | undefined;\n\n /** The day currently hovered or focused while anchored. */\n @tracked private _hovered: Date | undefined;\n\n private get isRange(): boolean {\n return this.args.mode === 'range';\n }\n\n /** How far the pending range may reach before it hits an unavailable day. */\n @cached\n private get pendingLimits(): { min: Date; max: Date } | null {\n // `null` means \"no range being built\", which is what confines these limits\n // to an anchored interaction -- idle browsing must not disable anything.\n if (!this._anchor) {\n return null;\n }\n return rangeLimits(\n this._anchor,\n this.args.isDateUnavailable,\n this.args.minValue,\n this.args.maxValue\n );\n }\n\n /** The range to paint: the pending preview if anchored, else the committed one. */\n @cached\n private get displayRange(): DateRange | null {\n if (this._anchor) {\n const to = this._hovered ?? this.focusedDate;\n // Neither `hoverDay` nor `moveFocus` consults `pendingLimits` -- only\n // `selectDay` does -- so an unclamped `to` would paint the band\n // straight through an unavailable day it cannot actually select\n // (the disabled cell would sit inside a band that promises it is\n // reachable). Clamp here, once, for both the pointer and keyboard\n // paths.\n // `_anchor` is set, so `pendingLimits` is never null here.\n const pending = this.pendingLimits;\n let clamped = startOfDay(to);\n if (pending && isBefore(clamped, pending.min)) {\n clamped = pending.min;\n }\n if (pending && isAfter(clamped, pending.max)) {\n clamped = pending.max;\n }\n return normalizeRange(this._anchor, clamped);\n }\n\n const selected = this.selection;\n // A committed selection only counts once it has a real `end` -- a\n // half-open `{ start, end: null }` (written by the anchor step below)\n // must not surface here, or it would outlive `cancelPending()` clearing\n // `_anchor`/`_hovered` and leave a stale single-day range painted after\n // Escape.\n return selected &&\n !(selected instanceof Date) &&\n (selected as DateRange).end\n ? (selected as DateRange)\n : null;\n }\n\n hoverDay = (date: Date | null): void => {\n this._hovered = date ?? undefined;\n };\n\n cancelPending = (): void => {\n // The anchor step below commits a half-open `{ start, end: null }`\n // range so a controlled consumer sees the anchor immediately. That\n // commit must be retracted here, or a half-open range stays selected\n // (and `@onChange`-reported) forever with no way to clear it: `Escape`\n // only clears `_anchor`/`_hovered`, and `isDaySelected`/`stateFor` do\n // *not* special-case a null `end` -- only `displayRange`'s idle-branch\n // fallback does, and that fallback only matters once `_anchor` is\n // already gone. Retracting to `null` is the one unambiguous rollback\n // that works the same in controlled and uncontrolled mode.\n if (this.isRange && this._anchor) {\n const selected = this.selection;\n if (\n selected &&\n !(selected instanceof Date) &&\n (selected as DateRange).end === null\n ) {\n this.commit(null as CalendarValue<M>);\n }\n }\n\n this._anchor = undefined;\n this._hovered = undefined;\n };\n\n selectDay = (date: Date): void => {\n if (this.args.isReadOnly || this.isDayDisabled(date)) {\n return;\n }\n\n const day = startOfDay(date);\n\n // An outside day belongs to a month outside the visible window; follow\n // it so the newly selected day is never left off screen.\n if (!this.isWithinWindow(day)) {\n this.goToMonth(day);\n }\n\n if (!this.isRange) {\n this.commit(day as CalendarValue<M>);\n return;\n }\n\n if (!this._anchor) {\n this._anchor = day;\n this._hovered = day;\n // Goes through the normal `commit()` path, same as the final commit\n // below -- there is no need to special-case the anchor step. A\n // half-open `{ start, end: null }` selection is filtered out of\n // `displayRange`'s idle-branch fallback above, but `isDaySelected`/\n // `stateFor` do *not* treat a null-`end` range as unselected -- they\n // paint `selected.start` regardless. That is only safe here because\n // `cancelPending()` explicitly retracts this half-open commit (see\n // its comment); if the anchor is abandoned any other way, this day\n // stays selected with no way to clear it.\n this.commit({ start: day, end: null } as CalendarValue<M>);\n return;\n }\n\n this.commit(normalizeRange(this._anchor, day) as CalendarValue<M>);\n this._anchor = undefined;\n this._hovered = undefined;\n };\n\n private isDaySelected(date: Date): boolean {\n const selected = this.selection;\n\n if (selected instanceof Date) {\n return isSameDay(selected, date);\n }\n if (selected && 'start' in selected) {\n return (\n isSameDay(selected.start, date) ||\n Boolean(selected.end && isSameDay(selected.end, date))\n );\n }\n return false;\n }\n\n isDayUnavailable = (date: Date): boolean => {\n return this.args.isDateUnavailable?.(date) ?? false;\n };\n\n isDayOutsideRange = (date: Date): boolean => {\n return !isWithinBounds(date, this.args.minValue, this.args.maxValue);\n };\n\n isDayDisabled = (date: Date): boolean => {\n if (this.args.isDisabled) {\n return true;\n }\n if (this.isDayOutsideRange(date) || this.isDayUnavailable(date)) {\n return true;\n }\n\n const pending = this.pendingLimits;\n if (pending && !isWithinBounds(date, pending.min, pending.max)) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Focus management is hand-rolled rather than delegated to the repo's\n * `rovingFocus` utility (`packages/frontile/src/utils/roving-focus.ts`),\n * and the reason is structural: arrow keys must cross month boundaries --\n * Right on Sept 30 lands on Oct 1 -- and at the moment the key fires that\n * element does not exist in the DOM yet. `rovingFocus` navigates among\n * already-rendered siblings sorted by document position and cannot move\n * focus into an element a re-render has yet to create.\n */\n @tracked private _focusedDate: Date | undefined;\n\n /**\n * Only keyboard interaction (or `@autofocus`) sets this. Mounting\n * therefore never steals focus, and we never write to the DOM during a\n * render pass -- which is what caused the synchronous-focusout flake in\n * `ListManager`. This is deliberately a plain field, not `@tracked`: it is\n * read and cleared from inside the `applyFocus` modifier, which runs\n * after render, not during it, so tracking it would only invite a\n * backtracking-write assertion for no benefit.\n */\n #shouldFocus = false;\n\n @cached\n get focusedDate(): Date {\n return this._focusedDate ?? this.defaultFocusedDate;\n }\n\n @cached\n private get defaultFocusedDate(): Date {\n const selected = this.selection;\n\n if (selected instanceof Date) {\n return selected;\n }\n if (selected && 'start' in selected) {\n return selected.start;\n }\n\n const today = startOfDay(new Date());\n return this.isWithinWindow(today) ? today : this.visibleMonth;\n }\n\n private moveFocus(date: Date): void {\n const next = startOfDay(date);\n\n if (this.isDayOutsideRange(next)) {\n return;\n }\n\n this._focusedDate = next;\n this.#shouldFocus = true;\n\n // Keyboard movement takes over the range preview from pointer hover:\n // clear any hovered day so `displayRange` falls back to `focusedDate`.\n // Without this, `_hovered` (set once at anchor time, or by a prior\n // `mouseenter`) would permanently shadow `focusedDate` and arrow-key\n // navigation would never move the preview. A later `mouseenter` still\n // hands control right back to the pointer via `hoverDay`.\n this._hovered = undefined;\n\n if (!this.isWithinWindow(next)) {\n this.goToMonth(next);\n }\n }\n\n /** Is `date` inside any of the currently visible months' window? */\n private isWithinWindow(date: Date): boolean {\n return this.months.some((m) => isSameMonth(date, m.month));\n }\n\n /**\n * The date to navigate *from*. Read off the actual DOM-focused day button\n * (via the event target) rather than trusting `this.focusedDate` alone --\n * that tracked value only advances when `moveFocus` runs, so it can lag\n * behind wherever the browser's real focus happens to be (a direct\n * `.focus()` call, or focus arriving by Tab into a cell this render\n * hasn't marked as the roving tabstop yet). The DOM is the source of\n * truth for \"where is focus right now\"; the tracked value exists only to\n * tell `applyFocus` which element to re-focus after a rerender.\n *\n * Returns `null` when the event did not originate from a day cell --\n * `handleKeydown` is bound on the calendar's root element, so it also\n * receives keydowns bubbling up from the header's nav buttons (and, later,\n * a month `<select>`). Those controls have their own keyboard behavior\n * (arrow keys operate a native `<select>`, for instance) and must not be\n * hijacked by the day-grid's roving-focus handling.\n */\n private focusOrigin(event: KeyboardEvent): Date | null {\n const key = (event.target as HTMLElement | null)?.closest<HTMLElement>(\n '[data-fr-calendar-day]'\n )?.dataset['key'];\n\n return key ? fromDayKey(key) : null;\n }\n\n handleKeydown = (event: KeyboardEvent): void => {\n if (this.args.isDisabled) {\n return;\n }\n\n // Escape must cancel a pending range regardless of where focus is --\n // the Previous/Next buttons and the month `<select>` also live under\n // this listener, and a range can be left pending while focus is on any\n // of them. This runs before the origin guard below (and still without\n // calling `preventDefault()`, same as before), so it does not disturb\n // that guard's job of leaving arrow keys on non-day controls alone.\n if (event.key === 'Escape') {\n this.cancelPending();\n return;\n }\n\n const from = this.focusOrigin(event);\n if (!from) {\n return;\n }\n let next: Date | undefined;\n\n switch (event.key) {\n case 'ArrowLeft':\n next = addDays(from, -1);\n break;\n case 'ArrowRight':\n next = addDays(from, 1);\n break;\n case 'ArrowUp':\n next = addWeeks(from, -1);\n break;\n case 'ArrowDown':\n next = addWeeks(from, 1);\n break;\n case 'Home':\n next = startOfWeek(from, { weekStartsOn: this.weekStartsOn });\n break;\n case 'End':\n next = endOfWeek(from, { weekStartsOn: this.weekStartsOn });\n break;\n case 'PageUp':\n next = event.shiftKey ? addYears(from, -1) : addMonths(from, -1);\n break;\n case 'PageDown':\n next = event.shiftKey ? addYears(from, 1) : addMonths(from, 1);\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n this.selectDay(from);\n return;\n default:\n return;\n }\n\n event.preventDefault();\n this.moveFocus(next);\n };\n\n /**\n * Applies DOM focus after a render, but only when a keypress asked for it\n * (or `@autofocus` did on insert). Never called from a getter or a\n * tracked setter -- only from this modifier, which Glimmer schedules\n * after the DOM has been updated.\n *\n * `ember-modifier`'s function-based modifiers only rerun when the\n * function actually *reads* one of its arguments during autotracking --\n * merely passing `this.focusedDate` from the template does nothing on\n * its own. The destructured `[]` here is what makes that read happen, so\n * every focus move (including one that crosses a month boundary) causes\n * this modifier to run again after the corresponding rerender.\n */\n /**\n * Set the first time `applyFocus` runs, then left `true` forever after.\n * `@autofocus`'s contract is \"focus the grid on insert\", not \"focus the\n * grid every time this modifier reruns\" -- and it reruns on every\n * `focusedDate` change, including ones the calendar causes itself (e.g.\n * paging a month away moves `defaultFocusedDate`, since it depends on\n * whether today is still in the visible window). Without this guard,\n * `@autofocus` would re-steal focus off of whatever the user just\n * interacted with (a nav button, in that example) on every such change.\n */\n #autofocusApplied = false;\n\n applyFocus = modifier(\n (element: HTMLElement, [focusedDate, isYearGridOpen]: [Date, boolean]) => {\n // Referenced only to establish the autotracking dependencies described\n // above -- the actual target element is looked up fresh below.\n // `isYearGridOpen` is one of them because the day grid is unmounted\n // while the year panel is up: focus requested during that time has to\n // wait for the grid to come back, and this is what wakes the modifier\n // when it does.\n void focusedDate;\n void isYearGridOpen;\n\n if (this.args.autofocus && !this.#autofocusApplied) {\n this.#autofocusApplied = true;\n this.#shouldFocus = true;\n }\n if (!this.#shouldFocus) {\n return;\n }\n\n this.#shouldFocus = false;\n element\n .querySelector<HTMLElement>('[data-fr-calendar-day][tabindex=\"0\"]')\n ?.focus();\n }\n );\n\n /** How many months to render, starting at `visibleMonth`. */\n get visibleMonths(): number {\n return Math.max(1, this.args.visibleMonths ?? 1);\n }\n\n /** How far prev/next paging moves the window. */\n private get pageSize(): number {\n return this.args.pageBehavior === 'single' ? 1 : this.visibleMonths;\n }\n\n goToPrevious = (): void =>\n this.goToMonth(addMonths(this.visibleMonth, -this.pageSize));\n goToNext = (): void =>\n this.goToMonth(addMonths(this.visibleMonth, this.pageSize));\n\n /**\n * Whether a window whose first month is `firstMonth` has any day inside\n * `@minValue`/`@maxValue`.\n *\n * The single source of truth for month-level bounds. Every entry point that\n * can move the window -- the prev/next buttons, `goToMonth` (and so the\n * `setMonth`/`setYear` and `<:header>` paths through it), and the month\n * picker's option list -- asks this, so an affordance can never offer a\n * month the enforcement would then refuse.\n *\n * The whole window is tested, not just its first month: with several months\n * visible a bound can fall inside a later month, which is still a legitimate\n * place to land.\n */\n private canShowWindow(firstMonth: Date): boolean {\n const first = startOfMonth(firstMonth);\n const last = endOfMonth(addMonths(first, this.visibleMonths - 1));\n\n return (\n isWithinBounds(last, this.args.minValue, undefined) &&\n isWithinBounds(first, undefined, this.args.maxValue)\n );\n }\n\n get canGoPrevious(): boolean {\n if (this.args.isDisabled) {\n return false;\n }\n return this.canShowWindow(addMonths(this.visibleMonth, -this.pageSize));\n }\n\n get canGoNext(): boolean {\n if (this.args.isDisabled) {\n return false;\n }\n return this.canShowWindow(addMonths(this.visibleMonth, this.pageSize));\n }\n\n @cached\n get headerContext(): CalendarHeaderContext {\n return {\n month: this.visibleMonth,\n title: this.caption,\n goToPrevious: this.goToPrevious,\n goToNext: this.goToNext,\n canGoPrevious: this.canGoPrevious,\n canGoNext: this.canGoNext,\n setMonth: (monthIndex: number) =>\n this.goToMonth(\n new Date(this.visibleMonth.getFullYear(), monthIndex, 1)\n ),\n setYear: (year: number) =>\n this.goToMonth(new Date(year, this.visibleMonth.getMonth(), 1)),\n isYearGridOpen: this.isYearGridOpen,\n toggleYearGrid: this.toggleYearGrid\n };\n }\n\n @cached\n get months(): CalendarMonthData[] {\n return Array.from({ length: this.visibleMonths }, (_, i) =>\n buildMonthGrid({\n month: addMonths(this.visibleMonth, i),\n weekStartsOn: this.weekStartsOn,\n fixedWeeks: this.args.fixedWeeks ?? false\n })\n );\n }\n\n captionFor = (month: Date): string => {\n return formatMonthCaption(month, this.locale);\n };\n\n @cached\n get weekdays() {\n return formatWeekdays(this.locale, this.weekStartsOn);\n }\n\n get caption(): string {\n return formatMonthCaption(this.visibleMonth, this.locale);\n }\n\n /**\n * Memoized per `@locale` rather than constructed fresh in `stateFor` --\n * `Intl.DateTimeFormat` construction is not free, and `stateFor` runs\n * once per rendered day.\n */\n /** Reused across all twelve options rather than rebuilt per render. */\n @cached\n private get monthNameFormatter(): Intl.DateTimeFormat {\n return new Intl.DateTimeFormat(this.locale, { month: 'long' });\n }\n\n @cached\n private get dayLabelFormatter(): Intl.DateTimeFormat {\n return new Intl.DateTimeFormat(this.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n });\n }\n\n /**\n * One `Date` per render rather than one per cell. `stateFor` runs for every\n * rendered day -- 35 to 42 of them, more with several months visible -- and\n * they all need the same \"today\".\n */\n @cached\n private get today(): Date {\n return startOfDay(new Date());\n }\n\n get isReadOnly(): boolean {\n return this.args.isReadOnly ?? false;\n }\n\n @cached\n get styles() {\n const { calendar } = useStyles();\n return calendar({\n intent: this.args.intent,\n size: this.args.size,\n isDisabled: this.args.isDisabled\n });\n }\n\n @cached\n get headerClasses() {\n const s = this.styles;\n const c = this.args.classes ?? {};\n\n return {\n header: s.header({ class: c.header }),\n title: s.title({ class: c.title }),\n nav: s.nav({ class: c.nav }),\n navButton: s.navButton({ class: c.navButton }),\n monthSelectWrapper: s.monthSelectWrapper({ class: c.monthSelectWrapper }),\n monthSelect: s.monthSelect({ class: c.monthSelect }),\n monthSelectValue: s.monthSelectValue({ class: c.monthSelectValue }),\n monthSelectIcon: s.monthSelectIcon({ class: c.monthSelectIcon }),\n yearTrigger: s.yearTrigger({ class: c.yearTrigger })\n };\n }\n\n @cached\n get gridClasses() {\n const s = this.styles;\n const c = this.args.classes ?? {};\n\n return {\n monthGrid: s.monthGrid({ class: c.monthGrid }),\n weekdaysRow: s.weekdaysRow({ class: c.weekdaysRow }),\n weekday: s.weekday({ class: c.weekday }),\n week: s.week({ class: c.week }),\n cell: s.cell({ class: c.cell }),\n cellBand: s.cellBand({ class: c.cellBand }),\n day: s.day({ class: c.day }),\n dayContent: s.dayContent({ class: c.dayContent }),\n indicator: s.indicator({ class: c.indicator })\n };\n }\n\n stateFor = (day: CalendarDay): DayState => {\n const range = this.displayRange;\n const inRange = Boolean(\n range?.end && isWithinBounds(day.date, range.start, range.end)\n );\n\n // With more than one month visible and an explicit\n // `@showOutsideDays={{true}}`, a boundary date renders twice: once as\n // a real day in its own month's grid, once as a leading/trailing\n // outside day in the neighbouring grid. Both copies would otherwise\n // get an identical `DayState`, producing two `tabindex=\"0\"` day\n // buttons (breaking the single-tab-stop invariant) and two\n // `aria-selected=\"true\"` gridcells for one date. Suppressing the\n // roving tabstop and selected state on the outside-month copy lets the\n // real in-month cell own both. This only matters when the outside\n // copy actually renders as a duplicate -- a single visible month never\n // reaches this branch with `isOutside` true and a matching in-month\n // cell elsewhere, since there is no neighbouring grid to duplicate\n // into.\n const isOutsideDuplicate = day.isOutside && this.visibleMonths > 1;\n\n return {\n // The one place that decides whether a cell renders a day. `DayCell`\n // cannot work this out: it sees neither `@showOutsideDays` nor how many\n // months are on screen.\n rendersDay: day.isOutside ? this.showOutsideDays : true,\n date: day.date,\n dayOfMonth: day.dayOfMonth,\n isOutside: day.isOutside,\n isToday: isSameDay(day.date, this.today),\n isSelected: isOutsideDuplicate ? false : this.isDaySelected(day.date),\n isDisabled: this.isDayDisabled(day.date),\n isUnavailable: this.isDayUnavailable(day.date),\n isRangeStart: Boolean(range && isSameDay(range.start, day.date)),\n isRangeEnd: Boolean(range?.end && isSameDay(range.end, day.date)),\n isInRange: inRange,\n isPreview: inRange && this._anchor !== undefined,\n isFocused: isOutsideDuplicate\n ? false\n : isSameDay(day.date, this.focusedDate),\n isOutsideRange: this.isDayOutsideRange(day.date),\n ariaLabel: this.dayLabelFormatter.format(day.date)\n };\n };\n\n <template>\n {{! template-lint-disable no-invalid-interactive }}\n {{! The keydown listener implements the roving-tabindex grid pattern for\n the day buttons nested inside; the root itself stays a plain,\n non-focusable container. }}\n <div\n data-fr-calendar\n class={{this.styles.base class=@classes.base}}\n {{on \"keydown\" this.handleKeydown}}\n {{this.applyFocus this.focusedDate this.isYearGridOpen}}\n {{this.rootRef.setup}}\n ...attributes\n >\n {{! Header, year panel and grids share one column sized to the grids,\n so a wide footer block cannot stretch the header and pull the paging\n arrows away from the days they page. }}\n <div class={{this.styles.body class=@classes.body}}>\n {{#if (has-block \"header\")}}\n {{yield this.headerContext to=\"header\"}}\n {{else}}\n <CalendarHeader\n @context={{this.headerContext}}\n @captionLayout={{this.captionLayout}}\n @months={{this.monthOptions}}\n @isYearGridOpen={{this.isYearGridOpen}}\n @onToggleYearGrid={{this.toggleYearGrid}}\n @classes={{this.headerClasses}}\n />\n {{/if}}\n\n <VisuallyHidden>\n <div data-fr-calendar-live aria-live=\"polite\">{{this.caption}}</div>\n </VisuallyHidden>\n\n {{! The year panel stands in for the grids rather than stacking\n above them; otherwise picking a year pushes the days off screen. }}\n {{#if this.isYearGridOpen}}\n <YearGrid\n @years={{this.yearOptions}}\n @currentYear={{this.visibleYear}}\n @onSelect={{this.pickYear}}\n @onDismiss={{this.dismissYearGrid}}\n @classes={{this.yearGridClasses}}\n />\n {{else}}\n <div class={{this.styles.monthsWrapper class=@classes.monthsWrapper}}>\n {{#each this.months key=\"key\" as |monthData|}}\n <MonthGrid\n @month={{monthData}}\n @weekdays={{this.weekdays}}\n @caption={{this.captionFor monthData.month}}\n @stateFor={{this.stateFor}}\n @isReadOnly={{this.isReadOnly}}\n @labelledBy={{@labelledBy}}\n @onSelect={{this.selectDay}}\n @onHover={{this.hoverDay}}\n @hasDayContent={{has-block \"day\"}}\n @hasWeekdayContent={{has-block \"weekday\"}}\n @classes={{this.gridClasses}}\n >\n <:day as |day|>{{yield day to=\"day\"}}</:day>\n <:weekday as |wd|>{{yield wd to=\"weekday\"}}</:weekday>\n </MonthGrid>\n {{/each}}\n </div>\n {{/if}}\n </div>\n\n {{#if (has-block \"footer\")}}\n <div\n data-fr-calendar-footer\n class={{this.styles.footer class=@classes.footer}}\n >{{yield to=\"footer\"}}</div>\n {{/if}}\n </div>\n </template>\n}\n\nexport default Calendar;\nexport { Calendar };\n"],"names":["Calendar","Component","locale","args","navigator","language","weekStartsOn","resolveWeekStart","showOutsideDays","visibleMonths","captionLayout","g","prototype","tracked","i","toggleYearGrid","isYearGridOpen","returnFocusToYearTrigger","element","trigger","querySelector","focus","dismissYearGrid","rootRef","current","pickYear","year","headerContext","setYear","ref","monthOptions","fmt","monthNameFormatter","visibleMonth","getFullYear","Array","from","length","_","value","month","Date","label","format","isDisabled","canShowWindow","n","cached","visibleYear","yearOptions","first","Math","min","minValue","last","max","maxValue","yearGridClasses","s","styles","c","classes","yearGrid","class","yearCell","isMonthControlled","startOfMonth","seedMonth","_month","defaultMonth","seed","defaultValue","start","goToMonth","next","onMonthChange","isValueControlled","selection","_value","undefined","commit","onChange","isRange","mode","pendingLimits","_anchor","rangeLimits","isDateUnavailable","displayRange","to","_hovered","focusedDate","pending","clamped","startOfDay","isBefore","isAfter","normalizeRange","selected","end","hoverDay","date","cancelPending","selectDay","isReadOnly","isDayDisabled","day","isWithinWindow","isDaySelected","isSameDay","Boolean","isDayUnavailable","isDayOutsideRange","isWithinBounds","_focusedDate","defaultFocusedDate","today","moveFocus","months","some","m","isSameMonth","focusOrigin","event","key","target","closest","dataset","fromDayKey","handleKeydown","addDays","addWeeks","startOfWeek","endOfWeek","shiftKey","addYears","addMonths","preventDefault","applyFocus","modifier","autofocus","pageSize","pageBehavior","goToPrevious","goToNext","firstMonth","endOfMonth","canGoPrevious","canGoNext","title","caption","setMonth","monthIndex","getMonth","buildMonthGrid","fixedWeeks","captionFor","formatMonthCaption","weekdays","formatWeekdays","Intl","DateTimeFormat","dayLabelFormatter","weekday","calendar","useStyles","intent","size","headerClasses","header","nav","navButton","monthSelectWrapper","monthSelect","monthSelectValue","monthSelectIcon","yearTrigger","gridClasses","monthGrid","weekdaysRow","week","cell","cellBand","dayContent","indicator","stateFor","range","inRange","isOutsideDuplicate","isOutside","rendersDay","dayOfMonth","isToday","isSelected","isUnavailable","isRangeStart","isRangeEnd","isInRange","isPreview","isFocused","isOutsideRange","ariaLabel","setComponentTemplate","precompileTemplate","strictMode","scope","on","CalendarHeader","VisuallyHidden","YearGrid","MonthGrid"],"mappings":";;;;;;;;;;;;;;;;AAiNA,MAAMA,QAAA,SAAoDC,UACtC;EAElB,IAAIC,MAAAA,GAAiB;IACnB,OAAO,IAAI,CAACC,IAAI,CAACD,MAAM,IAAIE,UAAUC,QAAQ;AAC/C,EAAA;EAEA,IAAIC,eAAwB;IAC1B,OAAOC,gBAAA,CAAiB,IAAI,CAACL,MAAM,EAAE,IAAI,CAACC,IAAI,CAACG,YAAY,CAAA;AAC7D,EAA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YtF,OAAA,CAAQ4E,OAAOvF,GAAA,IAAOU,SAAA,CAAU6E,MAAMvF,GAAG,EAAEO,IAAIL,IAAI,CAAA,CAAA;AAC/DgG,MAAAA,SAAA,EAAWV,OAAA;AACXW,MAAAA,SAAA,EAAWX,OAAA,IAAW,IAAI,CAACtG,OAAO,KAAKN,SAAA;AACvCwH,MAAAA,SAAA,EAAWX,kBAAA,GACP,QACA/E,SAAA,CAAUH,GAAA,CAAIL,IAAI,EAAE,IAAI,CAACV,WAAW,CAAA;MACxC6G,cAAA,EAAgB,IAAI,CAACxF,iBAAiB,CAACN,IAAIL,IAAI,CAAA;MAC/CoG,SAAA,EAAW,IAAI,CAACvC,iBAAiB,CAACvH,MAAM,CAAC+D,IAAIL,IAAI;KACnD;EACF,CAAA;AAEA,EAAA;IAAAqG,oBAAA,CAAAC,kBAAA,CAAA,04EAAA,EA2EA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;QAAAC,cAAA;QAAAC,cAAA;QAAAC,QAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
1
|
+
{"version":3,"file":"calendar.js","sources":["../../../../src/components/collections/calendar/calendar.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked, cached } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\nimport { modifier } from 'ember-modifier';\nimport {\n addDays,\n addMonths,\n addWeeks,\n addYears,\n startOfMonth,\n endOfMonth,\n endOfWeek,\n startOfWeek,\n isSameMonth,\n isAfter,\n isBefore\n} from 'date-fns';\nimport { useStyles, type SlotsToClasses } from '@frontile/theme';\nimport { MonthGrid } from './month-grid';\nimport { CalendarHeader, type CalendarHeaderContext } from './header';\nimport { YearGrid } from './year-grid';\nimport { VisuallyHidden } from '../../utilities/visually-hidden';\nimport { ref } from '../../../utils/ref';\nimport {\n buildMonthGrid,\n formatMonthCaption,\n formatWeekdays,\n resolveWeekStart,\n fromDayKey,\n isSameDay,\n isWithinBounds,\n normalizeRange,\n rangeLimits,\n startOfDay\n} from './utils';\nimport type { CalendarSlots, CalendarVariants } from '@frontile/theme';\nimport type {\n CalendarDay,\n CalendarMode,\n CalendarMonthData,\n CalendarValue,\n DateRange,\n DayState,\n WeekDay,\n WeekdayLabel\n} from './types';\n\nexport interface CalendarArgs<M extends CalendarMode = 'single'> {\n /**\n * Whether a click selects one day or the two ends of a range.\n *\n * @defaultValue 'single'\n */\n mode?: M;\n\n /**\n * Seeds the visible month when uncontrolled -- the *first* month of the\n * window when `@visibleMonths` is greater than one.\n */\n defaultMonth?: Date;\n\n /**\n * Controlled visible month -- the *first* month of the window when\n * `@visibleMonths` is greater than one.\n *\n * *Passing* this argument at all puts the month axis in controlled mode --\n * passing it as `undefined` included. Omit it entirely to let `Calendar`\n * track the visible month itself.\n */\n month?: Date;\n\n /** Called with the month the user asked to move to. */\n onMonthChange?: (month: Date) => void;\n\n /**\n * Controlled selection. *Passing* this argument at all puts selection in\n * controlled mode -- passing it as `undefined` included.\n */\n value?: CalendarValue<M>;\n\n /** Seeds the selection when uncontrolled. */\n defaultValue?: CalendarValue<M>;\n\n /** Called with the new selection when the user picks or clears a day. */\n onChange?: (value: CalendarValue<M>) => void;\n\n /** BCP-47 tag. All human-readable text is produced by `Intl` from this. */\n locale?: string;\n\n /** Overrides the first day of week implied by `@locale`. */\n weekStartsOn?: WeekDay;\n\n /**\n * Whether days from the adjacent month fill out a grid's leading/trailing\n * weeks. @defaultValue `true` when a single month is visible, `false`\n * once `@visibleMonths` is greater than one -- otherwise a boundary date\n * would render twice, once per adjacent grid.\n */\n showOutsideDays?: boolean;\n\n /**\n * Renders six week rows in every month, so the calendar keeps the same\n * height as you page between months of different lengths.\n *\n * @defaultValue false\n */\n fixedWeeks?: boolean;\n\n /**\n * How many months to render side by side, starting from the visible\n * month. @defaultValue 1\n */\n visibleMonths?: number;\n\n /**\n * How far prev/next paging advances. `'visible'` moves by the whole\n * window (`@visibleMonths`); `'single'` always moves by one month.\n *\n * @defaultValue 'visible'\n */\n pageBehavior?: 'visible' | 'single';\n\n /**\n * The color used for the selected day and the range band.\n *\n * @defaultValue 'primary'\n */\n intent?: CalendarVariants['intent'];\n\n /**\n * The size of the calendar cells and caption text.\n *\n * @defaultValue 'md'\n */\n size?: CalendarVariants['size'];\n\n /**\n * Blocks navigation and selection entirely.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\n\n /** Earliest selectable date. Also clamps month navigation. */\n minValue?: Date;\n\n /** Latest selectable date. Also clamps month navigation. */\n maxValue?: Date;\n\n /**\n * Marks a date as present but unselectable -- a holiday, a booked night.\n * Distinct from `@minValue`/`@maxValue`, which put a date out of range\n * entirely.\n */\n isDateUnavailable?: (date: Date) => boolean;\n\n /**\n * Allows paging between months but blocks selecting a day. Unlike\n * `@isDisabled`, the days stay focusable so the calendar can still be read\n * with the keyboard.\n *\n * @defaultValue false\n */\n isReadOnly?: boolean;\n\n /**\n * Moves DOM focus into the grid on insert. This is the *only* thing that\n * may focus the calendar on mount -- rendering a calendar must never\n * otherwise steal focus.\n *\n * @defaultValue false\n */\n autofocus?: boolean;\n\n /**\n * The id of an element naming this calendar, forwarded to each month grid's\n * `aria-labelledby`. Use it when something outside the calendar already\n * names it -- a date picker's own label, say -- so the grid is announced\n * with that name instead of its month caption.\n *\n * An `aria-labelledby` passed through `...attributes` lands on the root\n * element, which has no role, so it would not reach the grid.\n */\n labelledBy?: string;\n\n /** Overrides the classes applied to individual slots. */\n classes?: SlotsToClasses<CalendarSlots>;\n\n /**\n * `'label'` renders the plain month/year caption; `'dropdown'` swaps it for\n * a native month `<select>` plus a year trigger that opens a year-grid\n * picker.\n *\n * @defaultValue 'label'\n */\n captionLayout?: 'label' | 'dropdown';\n}\n\nexport interface CalendarSignature<M extends CalendarMode = 'single'> {\n Args: CalendarArgs<M>;\n Blocks: {\n day: [DayState];\n header: [CalendarHeaderContext];\n weekday: [WeekdayLabel];\n footer: [];\n };\n Element: HTMLDivElement;\n}\n\nclass Calendar<M extends CalendarMode = 'single'> extends Component<\n CalendarSignature<M>\n> {\n get locale(): string {\n return this.args.locale ?? navigator.language;\n }\n\n get weekStartsOn(): WeekDay {\n return resolveWeekStart(this.locale, this.args.weekStartsOn);\n }\n\n /**\n * Default is `true` for a single visible month, `false` once more than\n * one month is visible -- a boundary date would otherwise render twice\n * (once as a trailing/leading outside day, once as a real day in the\n * neighbouring grid). An explicit `@showOutsideDays` always wins, in\n * either direction.\n */\n get showOutsideDays(): boolean {\n return this.args.showOutsideDays ?? this.visibleMonths === 1;\n }\n\n get captionLayout(): 'label' | 'dropdown' {\n return this.args.captionLayout ?? 'label';\n }\n\n @tracked isYearGridOpen = false;\n\n toggleYearGrid = (): void => {\n this.isYearGridOpen = !this.isYearGridOpen;\n };\n\n private returnFocusToYearTrigger(element: HTMLElement | null): void {\n const trigger = element?.querySelector<HTMLElement>(\n '[data-part=\"year-trigger\"]'\n );\n\n if (trigger) {\n trigger.focus();\n return;\n }\n\n // A `<:header>` block replaces the default header entirely, so there is\n // no year trigger to find -- the selector above matches nothing and,\n // without this fallback, the just-removed year button leaves focus on\n // `<body>`. Fall back to the roving day cell instead, same element\n // `applyFocus` would target.\n //\n // Requesting focus rather than taking it: the year panel stands in for\n // the day grid, so at this moment there is no day cell in the DOM to\n // focus. `applyFocus` takes over once the grid is back -- it depends on\n // `isYearGridOpen`, so closing the panel is what wakes it, and the flag\n // is consumed on that same rerender rather than lingering.\n this.#shouldFocus = true;\n }\n\n dismissYearGrid = (): void => {\n this.isYearGridOpen = false;\n // Dismissing a panel that took focus must give it back, or focus falls to\n // the body and the keyboard user loses their place.\n this.returnFocusToYearTrigger(this.rootRef.current ?? null);\n };\n\n pickYear = (year: number): void => {\n this.headerContext.setYear(year);\n this.isYearGridOpen = false;\n // Same as `dismissYearGrid`: closing the grid removes the just-activated\n // year button from the DOM, so focus must be restored explicitly or it\n // falls to the body.\n this.returnFocusToYearTrigger(this.rootRef.current ?? null);\n };\n\n /**\n * The root element, for the imperative focus restores above: closing the\n * year grid unmounts the button focus was on, so the element to move focus\n * to has to be looked up rather than rendered into.\n */\n rootRef = ref<HTMLElement>();\n\n @cached\n get monthOptions(): { value: number; label: string; isDisabled: boolean }[] {\n const fmt = this.monthNameFormatter;\n const year = this.visibleMonth.getFullYear();\n\n // A month is offered only when some day in it is in range. `yearOptions`\n // already clamps this way; without the same treatment the month picker is\n // a hole in the `@minValue`/`@maxValue` clamp, since it can navigate to a\n // month the prev/next buttons refuse to reach.\n return Array.from({ length: 12 }, (_, value) => {\n const month = new Date(year, value, 1);\n\n return {\n value,\n label: fmt.format(month),\n isDisabled: !this.canShowWindow(month)\n };\n });\n }\n\n /**\n * A getter, not a bare `{{this.visibleMonth.getFullYear}}` in the\n * template -- Glimmer does not auto-invoke a plain method reference in\n * argument position, it would pass the function itself instead of a\n * number.\n */\n get visibleYear(): number {\n return this.visibleMonth.getFullYear();\n }\n\n @cached\n get yearOptions(): number[] {\n const current = this.visibleMonth.getFullYear();\n\n // The visible year is always included, even when it sits outside\n // `@minValue`/`@maxValue`. The panel marks and scrolls to the *current*\n // year on open; omitting it leaves nothing to select, so the panel would\n // open unfocused and scrolled to an arbitrary decade. `Math.min`/`max`\n // also keep the range non-empty if the bounds are inverted, which would\n // otherwise render an empty listbox.\n const first = Math.min(\n this.args.minValue?.getFullYear() ?? current - 100,\n current\n );\n const last = Math.max(\n this.args.maxValue?.getFullYear() ?? current + 10,\n current\n );\n\n return Array.from({ length: last - first + 1 }, (_, i) => first + i);\n }\n\n @cached\n get yearGridClasses() {\n const s = this.styles;\n const c = this.args.classes ?? {};\n\n return {\n yearGrid: s.yearGrid({ class: c.yearGrid }),\n yearCell: s.yearCell({ class: c.yearCell })\n };\n }\n\n /**\n * Uncontrolled mode's own state. `undefined` means \"not navigated yet\",\n * which is what lets the seed getters below resolve without a tracked\n * write during render.\n */\n @tracked private _month: Date | undefined;\n\n private get isMonthControlled(): boolean {\n return 'month' in this.args;\n }\n\n get visibleMonth(): Date {\n if (this.isMonthControlled) {\n return startOfMonth(this.args.month ?? this.seedMonth);\n }\n if (this._month) {\n return startOfMonth(this._month);\n }\n return startOfMonth(this.seedMonth);\n }\n\n /**\n * A calendar seeded with a selection should open showing that selection,\n * not today.\n */\n private get seedMonth(): Date {\n if (this.args.defaultMonth) {\n return this.args.defaultMonth;\n }\n\n const seed = this.args.defaultValue ?? this.args.value;\n\n if (seed instanceof Date) {\n return seed;\n }\n if (seed && 'start' in seed) {\n return seed.start;\n }\n return new Date();\n }\n\n goToMonth = (month: Date): void => {\n const next = startOfMonth(month);\n\n // The clamp lives here, not only in `canGoPrevious`/`canGoNext`. Those\n // disable the default buttons, but `goToMonth` is also reachable through\n // `setMonth`/`setYear` and through the `goToPrevious`/`goToNext` yielded\n // to a `<:header>` block -- a custom header that ignores `canGoPrevious`\n // would otherwise page straight past `@minValue`.\n if (!this.canShowWindow(next)) {\n return;\n }\n\n if (!this.isMonthControlled) {\n this._month = next;\n }\n this.args.onMonthChange?.(next);\n };\n\n /**\n * Uncontrolled mode's own selection. `undefined` means \"not selected yet\",\n * mirroring `_month` above so the seed getter can resolve without a\n * tracked write during render.\n */\n @tracked private _value: CalendarValue<M> | undefined;\n\n private get isValueControlled(): boolean {\n return 'value' in this.args;\n }\n\n get selection(): CalendarValue<M> | null {\n if (this.isValueControlled) {\n return (this.args.value ?? null) as CalendarValue<M>;\n }\n if (this._value !== undefined) {\n return this._value;\n }\n return (this.args.defaultValue ?? null) as CalendarValue<M>;\n }\n\n private commit(value: CalendarValue<M>): void {\n if (!this.isValueControlled) {\n this._value = value;\n }\n this.args.onChange?.(value);\n }\n\n /** The first endpoint of a range being built. `undefined` means idle. */\n @tracked private _anchor: Date | undefined;\n\n /** The day currently hovered or focused while anchored. */\n @tracked private _hovered: Date | undefined;\n\n private get isRange(): boolean {\n return this.args.mode === 'range';\n }\n\n /** How far the pending range may reach before it hits an unavailable day. */\n @cached\n private get pendingLimits(): { min: Date; max: Date } | null {\n // `null` means \"no range being built\", which is what confines these limits\n // to an anchored interaction -- idle browsing must not disable anything.\n if (!this._anchor) {\n return null;\n }\n return rangeLimits(\n this._anchor,\n this.args.isDateUnavailable,\n this.args.minValue,\n this.args.maxValue\n );\n }\n\n /** The range to paint: the pending preview if anchored, else the committed one. */\n @cached\n private get displayRange(): DateRange | null {\n if (this._anchor) {\n const to = this._hovered ?? this.focusedDate;\n // Neither `hoverDay` nor `moveFocus` consults `pendingLimits` -- only\n // `selectDay` does -- so an unclamped `to` would paint the band\n // straight through an unavailable day it cannot actually select\n // (the disabled cell would sit inside a band that promises it is\n // reachable). Clamp here, once, for both the pointer and keyboard\n // paths.\n // `_anchor` is set, so `pendingLimits` is never null here.\n const pending = this.pendingLimits;\n let clamped = startOfDay(to);\n if (pending && isBefore(clamped, pending.min)) {\n clamped = pending.min;\n }\n if (pending && isAfter(clamped, pending.max)) {\n clamped = pending.max;\n }\n return normalizeRange(this._anchor, clamped);\n }\n\n const selected = this.selection;\n // A committed selection only counts once it has a real `end` -- a\n // half-open `{ start, end: null }` (written by the anchor step below)\n // must not surface here, or it would outlive `cancelPending()` clearing\n // `_anchor`/`_hovered` and leave a stale single-day range painted after\n // Escape.\n return selected &&\n !(selected instanceof Date) &&\n (selected as DateRange).end\n ? (selected as DateRange)\n : null;\n }\n\n hoverDay = (date: Date | null): void => {\n this._hovered = date ?? undefined;\n };\n\n cancelPending = (): void => {\n // The anchor step below commits a half-open `{ start, end: null }`\n // range so a controlled consumer sees the anchor immediately. That\n // commit must be retracted here, or a half-open range stays selected\n // (and `@onChange`-reported) forever with no way to clear it: `Escape`\n // only clears `_anchor`/`_hovered`, and `isDaySelected`/`stateFor` do\n // *not* special-case a null `end` -- only `displayRange`'s idle-branch\n // fallback does, and that fallback only matters once `_anchor` is\n // already gone. Retracting to `null` is the one unambiguous rollback\n // that works the same in controlled and uncontrolled mode.\n if (this.isRange && this._anchor) {\n const selected = this.selection;\n if (\n selected &&\n !(selected instanceof Date) &&\n (selected as DateRange).end === null\n ) {\n this.commit(null as CalendarValue<M>);\n }\n }\n\n this._anchor = undefined;\n this._hovered = undefined;\n };\n\n selectDay = (date: Date): void => {\n if (this.args.isReadOnly || this.isDayDisabled(date)) {\n return;\n }\n\n const day = startOfDay(date);\n\n // An outside day belongs to a month outside the visible window; follow\n // it so the newly selected day is never left off screen.\n if (!this.isWithinWindow(day)) {\n this.goToMonth(day);\n }\n\n if (!this.isRange) {\n this.commit(day as CalendarValue<M>);\n return;\n }\n\n if (!this._anchor) {\n this._anchor = day;\n this._hovered = day;\n // Goes through the normal `commit()` path, same as the final commit\n // below -- there is no need to special-case the anchor step. A\n // half-open `{ start, end: null }` selection is filtered out of\n // `displayRange`'s idle-branch fallback above, but `isDaySelected`/\n // `stateFor` do *not* treat a null-`end` range as unselected -- they\n // paint `selected.start` regardless. That is only safe here because\n // `cancelPending()` explicitly retracts this half-open commit (see\n // its comment); if the anchor is abandoned any other way, this day\n // stays selected with no way to clear it.\n this.commit({ start: day, end: null } as CalendarValue<M>);\n return;\n }\n\n this.commit(normalizeRange(this._anchor, day) as CalendarValue<M>);\n this._anchor = undefined;\n this._hovered = undefined;\n };\n\n private isDaySelected(date: Date): boolean {\n const selected = this.selection;\n\n if (selected instanceof Date) {\n return isSameDay(selected, date);\n }\n if (selected && 'start' in selected) {\n return (\n isSameDay(selected.start, date) ||\n Boolean(selected.end && isSameDay(selected.end, date))\n );\n }\n return false;\n }\n\n isDayUnavailable = (date: Date): boolean => {\n return this.args.isDateUnavailable?.(date) ?? false;\n };\n\n isDayOutsideRange = (date: Date): boolean => {\n return !isWithinBounds(date, this.args.minValue, this.args.maxValue);\n };\n\n isDayDisabled = (date: Date): boolean => {\n if (this.args.isDisabled) {\n return true;\n }\n if (this.isDayOutsideRange(date) || this.isDayUnavailable(date)) {\n return true;\n }\n\n const pending = this.pendingLimits;\n if (pending && !isWithinBounds(date, pending.min, pending.max)) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Focus management is hand-rolled rather than delegated to the repo's\n * `rovingFocus` utility (`packages/frontile/src/utils/roving-focus.ts`),\n * and the reason is structural: arrow keys must cross month boundaries --\n * Right on Sept 30 lands on Oct 1 -- and at the moment the key fires that\n * element does not exist in the DOM yet. `rovingFocus` navigates among\n * already-rendered siblings sorted by document position and cannot move\n * focus into an element a re-render has yet to create.\n */\n @tracked private _focusedDate: Date | undefined;\n\n /**\n * Only keyboard interaction (or `@autofocus`) sets this. Mounting\n * therefore never steals focus, and we never write to the DOM during a\n * render pass -- which is what caused the synchronous-focusout flake in\n * `ListManager`. This is deliberately a plain field, not `@tracked`: it is\n * read and cleared from inside the `applyFocus` modifier, which runs\n * after render, not during it, so tracking it would only invite a\n * backtracking-write assertion for no benefit.\n */\n #shouldFocus = false;\n\n @cached\n get focusedDate(): Date {\n return this._focusedDate ?? this.defaultFocusedDate;\n }\n\n @cached\n private get defaultFocusedDate(): Date {\n const selected = this.selection;\n\n if (selected instanceof Date) {\n return selected;\n }\n if (selected && 'start' in selected) {\n return selected.start;\n }\n\n const today = startOfDay(new Date());\n return this.isWithinWindow(today) ? today : this.visibleMonth;\n }\n\n private moveFocus(date: Date): void {\n const next = startOfDay(date);\n\n if (this.isDayOutsideRange(next)) {\n return;\n }\n\n this._focusedDate = next;\n this.#shouldFocus = true;\n\n // Keyboard movement takes over the range preview from pointer hover:\n // clear any hovered day so `displayRange` falls back to `focusedDate`.\n // Without this, `_hovered` (set once at anchor time, or by a prior\n // `mouseenter`) would permanently shadow `focusedDate` and arrow-key\n // navigation would never move the preview. A later `mouseenter` still\n // hands control right back to the pointer via `hoverDay`.\n this._hovered = undefined;\n\n if (!this.isWithinWindow(next)) {\n this.goToMonth(next);\n }\n }\n\n /** Is `date` inside any of the currently visible months' window? */\n private isWithinWindow(date: Date): boolean {\n return this.months.some((m) => isSameMonth(date, m.month));\n }\n\n /**\n * The date to navigate *from*. Read off the actual DOM-focused day button\n * (via the event target) rather than trusting `this.focusedDate` alone --\n * that tracked value only advances when `moveFocus` runs, so it can lag\n * behind wherever the browser's real focus happens to be (a direct\n * `.focus()` call, or focus arriving by Tab into a cell this render\n * hasn't marked as the roving tabstop yet). The DOM is the source of\n * truth for \"where is focus right now\"; the tracked value exists only to\n * tell `applyFocus` which element to re-focus after a rerender.\n *\n * Returns `null` when the event did not originate from a day cell --\n * `handleKeydown` is bound on the calendar's root element, so it also\n * receives keydowns bubbling up from the header's nav buttons (and, later,\n * a month `<select>`). Those controls have their own keyboard behavior\n * (arrow keys operate a native `<select>`, for instance) and must not be\n * hijacked by the day-grid's roving-focus handling.\n */\n private focusOrigin(event: KeyboardEvent): Date | null {\n const key = (event.target as HTMLElement | null)?.closest<HTMLElement>(\n '[data-part=\"day\"]'\n )?.dataset['key'];\n\n return key ? fromDayKey(key) : null;\n }\n\n handleKeydown = (event: KeyboardEvent): void => {\n if (this.args.isDisabled) {\n return;\n }\n\n // Escape must cancel a pending range regardless of where focus is --\n // the Previous/Next buttons and the month `<select>` also live under\n // this listener, and a range can be left pending while focus is on any\n // of them. This runs before the origin guard below (and still without\n // calling `preventDefault()`, same as before), so it does not disturb\n // that guard's job of leaving arrow keys on non-day controls alone.\n if (event.key === 'Escape') {\n this.cancelPending();\n return;\n }\n\n const from = this.focusOrigin(event);\n if (!from) {\n return;\n }\n let next: Date | undefined;\n\n switch (event.key) {\n case 'ArrowLeft':\n next = addDays(from, -1);\n break;\n case 'ArrowRight':\n next = addDays(from, 1);\n break;\n case 'ArrowUp':\n next = addWeeks(from, -1);\n break;\n case 'ArrowDown':\n next = addWeeks(from, 1);\n break;\n case 'Home':\n next = startOfWeek(from, { weekStartsOn: this.weekStartsOn });\n break;\n case 'End':\n next = endOfWeek(from, { weekStartsOn: this.weekStartsOn });\n break;\n case 'PageUp':\n next = event.shiftKey ? addYears(from, -1) : addMonths(from, -1);\n break;\n case 'PageDown':\n next = event.shiftKey ? addYears(from, 1) : addMonths(from, 1);\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n this.selectDay(from);\n return;\n default:\n return;\n }\n\n event.preventDefault();\n this.moveFocus(next);\n };\n\n /**\n * Applies DOM focus after a render, but only when a keypress asked for it\n * (or `@autofocus` did on insert). Never called from a getter or a\n * tracked setter -- only from this modifier, which Glimmer schedules\n * after the DOM has been updated.\n *\n * `ember-modifier`'s function-based modifiers only rerun when the\n * function actually *reads* one of its arguments during autotracking --\n * merely passing `this.focusedDate` from the template does nothing on\n * its own. The destructured `[]` here is what makes that read happen, so\n * every focus move (including one that crosses a month boundary) causes\n * this modifier to run again after the corresponding rerender.\n */\n /**\n * Set the first time `applyFocus` runs, then left `true` forever after.\n * `@autofocus`'s contract is \"focus the grid on insert\", not \"focus the\n * grid every time this modifier reruns\" -- and it reruns on every\n * `focusedDate` change, including ones the calendar causes itself (e.g.\n * paging a month away moves `defaultFocusedDate`, since it depends on\n * whether today is still in the visible window). Without this guard,\n * `@autofocus` would re-steal focus off of whatever the user just\n * interacted with (a nav button, in that example) on every such change.\n */\n #autofocusApplied = false;\n\n applyFocus = modifier(\n (element: HTMLElement, [focusedDate, isYearGridOpen]: [Date, boolean]) => {\n // Referenced only to establish the autotracking dependencies described\n // above -- the actual target element is looked up fresh below.\n // `isYearGridOpen` is one of them because the day grid is unmounted\n // while the year panel is up: focus requested during that time has to\n // wait for the grid to come back, and this is what wakes the modifier\n // when it does.\n void focusedDate;\n void isYearGridOpen;\n\n if (this.args.autofocus && !this.#autofocusApplied) {\n this.#autofocusApplied = true;\n this.#shouldFocus = true;\n }\n if (!this.#shouldFocus) {\n return;\n }\n\n this.#shouldFocus = false;\n // No nested component renders a `day` part, so unlike the general\n // `closest('[data-component]') === root` guard used elsewhere, this\n // query cannot pick up a descendant component's own day-shaped cell --\n // there is nothing else in the tree it could collide with.\n element\n .querySelector<HTMLElement>('[data-part=\"day\"][tabindex=\"0\"]')\n ?.focus();\n }\n );\n\n /** How many months to render, starting at `visibleMonth`. */\n get visibleMonths(): number {\n return Math.max(1, this.args.visibleMonths ?? 1);\n }\n\n /** How far prev/next paging moves the window. */\n private get pageSize(): number {\n return this.args.pageBehavior === 'single' ? 1 : this.visibleMonths;\n }\n\n goToPrevious = (): void =>\n this.goToMonth(addMonths(this.visibleMonth, -this.pageSize));\n goToNext = (): void =>\n this.goToMonth(addMonths(this.visibleMonth, this.pageSize));\n\n /**\n * Whether a window whose first month is `firstMonth` has any day inside\n * `@minValue`/`@maxValue`.\n *\n * The single source of truth for month-level bounds. Every entry point that\n * can move the window -- the prev/next buttons, `goToMonth` (and so the\n * `setMonth`/`setYear` and `<:header>` paths through it), and the month\n * picker's option list -- asks this, so an affordance can never offer a\n * month the enforcement would then refuse.\n *\n * The whole window is tested, not just its first month: with several months\n * visible a bound can fall inside a later month, which is still a legitimate\n * place to land.\n */\n private canShowWindow(firstMonth: Date): boolean {\n const first = startOfMonth(firstMonth);\n const last = endOfMonth(addMonths(first, this.visibleMonths - 1));\n\n return (\n isWithinBounds(last, this.args.minValue, undefined) &&\n isWithinBounds(first, undefined, this.args.maxValue)\n );\n }\n\n get canGoPrevious(): boolean {\n if (this.args.isDisabled) {\n return false;\n }\n return this.canShowWindow(addMonths(this.visibleMonth, -this.pageSize));\n }\n\n get canGoNext(): boolean {\n if (this.args.isDisabled) {\n return false;\n }\n return this.canShowWindow(addMonths(this.visibleMonth, this.pageSize));\n }\n\n @cached\n get headerContext(): CalendarHeaderContext {\n return {\n month: this.visibleMonth,\n title: this.caption,\n goToPrevious: this.goToPrevious,\n goToNext: this.goToNext,\n canGoPrevious: this.canGoPrevious,\n canGoNext: this.canGoNext,\n setMonth: (monthIndex: number) =>\n this.goToMonth(\n new Date(this.visibleMonth.getFullYear(), monthIndex, 1)\n ),\n setYear: (year: number) =>\n this.goToMonth(new Date(year, this.visibleMonth.getMonth(), 1)),\n isYearGridOpen: this.isYearGridOpen,\n toggleYearGrid: this.toggleYearGrid\n };\n }\n\n @cached\n get months(): CalendarMonthData[] {\n return Array.from({ length: this.visibleMonths }, (_, i) =>\n buildMonthGrid({\n month: addMonths(this.visibleMonth, i),\n weekStartsOn: this.weekStartsOn,\n fixedWeeks: this.args.fixedWeeks ?? false\n })\n );\n }\n\n captionFor = (month: Date): string => {\n return formatMonthCaption(month, this.locale);\n };\n\n @cached\n get weekdays() {\n return formatWeekdays(this.locale, this.weekStartsOn);\n }\n\n get caption(): string {\n return formatMonthCaption(this.visibleMonth, this.locale);\n }\n\n /**\n * Memoized per `@locale` rather than constructed fresh in `stateFor` --\n * `Intl.DateTimeFormat` construction is not free, and `stateFor` runs\n * once per rendered day.\n */\n /** Reused across all twelve options rather than rebuilt per render. */\n @cached\n private get monthNameFormatter(): Intl.DateTimeFormat {\n return new Intl.DateTimeFormat(this.locale, { month: 'long' });\n }\n\n @cached\n private get dayLabelFormatter(): Intl.DateTimeFormat {\n return new Intl.DateTimeFormat(this.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n });\n }\n\n /**\n * One `Date` per render rather than one per cell. `stateFor` runs for every\n * rendered day -- 35 to 42 of them, more with several months visible -- and\n * they all need the same \"today\".\n */\n @cached\n private get today(): Date {\n return startOfDay(new Date());\n }\n\n get isReadOnly(): boolean {\n return this.args.isReadOnly ?? false;\n }\n\n @cached\n get styles() {\n const { calendar } = useStyles();\n return calendar({\n intent: this.args.intent,\n size: this.args.size,\n isDisabled: this.args.isDisabled\n });\n }\n\n @cached\n get headerClasses() {\n const s = this.styles;\n const c = this.args.classes ?? {};\n\n return {\n header: s.header({ class: c.header }),\n title: s.title({ class: c.title }),\n nav: s.nav({ class: c.nav }),\n navButton: s.navButton({ class: c.navButton }),\n monthSelectWrapper: s.monthSelectWrapper({ class: c.monthSelectWrapper }),\n monthSelect: s.monthSelect({ class: c.monthSelect }),\n monthSelectValue: s.monthSelectValue({ class: c.monthSelectValue }),\n monthSelectIcon: s.monthSelectIcon({ class: c.monthSelectIcon }),\n yearTrigger: s.yearTrigger({ class: c.yearTrigger })\n };\n }\n\n @cached\n get gridClasses() {\n const s = this.styles;\n const c = this.args.classes ?? {};\n\n return {\n monthGrid: s.monthGrid({ class: c.monthGrid }),\n weekdaysRow: s.weekdaysRow({ class: c.weekdaysRow }),\n weekday: s.weekday({ class: c.weekday }),\n week: s.week({ class: c.week }),\n cell: s.cell({ class: c.cell }),\n cellBand: s.cellBand({ class: c.cellBand }),\n day: s.day({ class: c.day }),\n dayContent: s.dayContent({ class: c.dayContent }),\n indicator: s.indicator({ class: c.indicator })\n };\n }\n\n stateFor = (day: CalendarDay): DayState => {\n const range = this.displayRange;\n const inRange = Boolean(\n range?.end && isWithinBounds(day.date, range.start, range.end)\n );\n\n // With more than one month visible and an explicit\n // `@showOutsideDays={{true}}`, a boundary date renders twice: once as\n // a real day in its own month's grid, once as a leading/trailing\n // outside day in the neighbouring grid. Both copies would otherwise\n // get an identical `DayState`, producing two `tabindex=\"0\"` day\n // buttons (breaking the single-tab-stop invariant) and two\n // `aria-selected=\"true\"` gridcells for one date. Suppressing the\n // roving tabstop and selected state on the outside-month copy lets the\n // real in-month cell own both. This only matters when the outside\n // copy actually renders as a duplicate -- a single visible month never\n // reaches this branch with `isOutside` true and a matching in-month\n // cell elsewhere, since there is no neighbouring grid to duplicate\n // into.\n const isOutsideDuplicate = day.isOutside && this.visibleMonths > 1;\n\n return {\n // The one place that decides whether a cell renders a day. `DayCell`\n // cannot work this out: it sees neither `@showOutsideDays` nor how many\n // months are on screen.\n rendersDay: day.isOutside ? this.showOutsideDays : true,\n date: day.date,\n dayOfMonth: day.dayOfMonth,\n isOutside: day.isOutside,\n isToday: isSameDay(day.date, this.today),\n isSelected: isOutsideDuplicate ? false : this.isDaySelected(day.date),\n isDisabled: this.isDayDisabled(day.date),\n isUnavailable: this.isDayUnavailable(day.date),\n isRangeStart: Boolean(range && isSameDay(range.start, day.date)),\n isRangeEnd: Boolean(range?.end && isSameDay(range.end, day.date)),\n isInRange: inRange,\n isPreview: inRange && this._anchor !== undefined,\n isFocused: isOutsideDuplicate\n ? false\n : isSameDay(day.date, this.focusedDate),\n isOutsideRange: this.isDayOutsideRange(day.date),\n ariaLabel: this.dayLabelFormatter.format(day.date)\n };\n };\n\n <template>\n {{! template-lint-disable no-invalid-interactive }}\n {{! The keydown listener implements the roving-tabindex grid pattern for\n the day buttons nested inside; the root itself stays a plain,\n non-focusable container. }}\n <div\n data-component=\"calendar\"\n data-part=\"base\"\n class={{this.styles.base class=@classes.base}}\n {{on \"keydown\" this.handleKeydown}}\n {{this.applyFocus this.focusedDate this.isYearGridOpen}}\n {{this.rootRef.setup}}\n ...attributes\n >\n {{! Header, year panel and grids share one column sized to the grids,\n so a wide footer block cannot stretch the header and pull the paging\n arrows away from the days they page. }}\n <div data-part=\"body\" class={{this.styles.body class=@classes.body}}>\n {{#if (has-block \"header\")}}\n {{yield this.headerContext to=\"header\"}}\n {{else}}\n <CalendarHeader\n @context={{this.headerContext}}\n @captionLayout={{this.captionLayout}}\n @months={{this.monthOptions}}\n @isYearGridOpen={{this.isYearGridOpen}}\n @onToggleYearGrid={{this.toggleYearGrid}}\n @classes={{this.headerClasses}}\n />\n {{/if}}\n\n <VisuallyHidden>\n <div data-fr-calendar-live aria-live=\"polite\">{{this.caption}}</div>\n </VisuallyHidden>\n\n {{! The year panel stands in for the grids rather than stacking\n above them; otherwise picking a year pushes the days off screen. }}\n {{#if this.isYearGridOpen}}\n <YearGrid\n @years={{this.yearOptions}}\n @currentYear={{this.visibleYear}}\n @onSelect={{this.pickYear}}\n @onDismiss={{this.dismissYearGrid}}\n @classes={{this.yearGridClasses}}\n />\n {{else}}\n <div\n data-part=\"months-wrapper\"\n class={{this.styles.monthsWrapper class=@classes.monthsWrapper}}\n >\n {{#each this.months key=\"key\" as |monthData|}}\n <MonthGrid\n @month={{monthData}}\n @weekdays={{this.weekdays}}\n @caption={{this.captionFor monthData.month}}\n @stateFor={{this.stateFor}}\n @isReadOnly={{this.isReadOnly}}\n @labelledBy={{@labelledBy}}\n @onSelect={{this.selectDay}}\n @onHover={{this.hoverDay}}\n @hasDayContent={{has-block \"day\"}}\n @hasWeekdayContent={{has-block \"weekday\"}}\n @classes={{this.gridClasses}}\n >\n <:day as |day|>{{yield day to=\"day\"}}</:day>\n <:weekday as |wd|>{{yield wd to=\"weekday\"}}</:weekday>\n </MonthGrid>\n {{/each}}\n </div>\n {{/if}}\n </div>\n\n {{#if (has-block \"footer\")}}\n <div\n data-part=\"footer\"\n class={{this.styles.footer class=@classes.footer}}\n >{{yield to=\"footer\"}}</div>\n {{/if}}\n </div>\n </template>\n}\n\nexport default Calendar;\nexport { Calendar };\n"],"names":["Calendar","Component","locale","args","navigator","language","weekStartsOn","resolveWeekStart","showOutsideDays","visibleMonths","captionLayout","g","prototype","tracked","i","toggleYearGrid","isYearGridOpen","returnFocusToYearTrigger","element","trigger","querySelector","focus","dismissYearGrid","rootRef","current","pickYear","year","headerContext","setYear","ref","monthOptions","fmt","monthNameFormatter","visibleMonth","getFullYear","Array","from","length","_","value","month","Date","label","format","isDisabled","canShowWindow","n","cached","visibleYear","yearOptions","first","Math","min","minValue","last","max","maxValue","yearGridClasses","s","styles","c","classes","yearGrid","class","yearCell","isMonthControlled","startOfMonth","seedMonth","_month","defaultMonth","seed","defaultValue","start","goToMonth","next","onMonthChange","isValueControlled","selection","_value","undefined","commit","onChange","isRange","mode","pendingLimits","_anchor","rangeLimits","isDateUnavailable","displayRange","to","_hovered","focusedDate","pending","clamped","startOfDay","isBefore","isAfter","normalizeRange","selected","end","hoverDay","date","cancelPending","selectDay","isReadOnly","isDayDisabled","day","isWithinWindow","isDaySelected","isSameDay","Boolean","isDayUnavailable","isDayOutsideRange","isWithinBounds","_focusedDate","defaultFocusedDate","today","moveFocus","months","some","m","isSameMonth","focusOrigin","event","key","target","closest","dataset","fromDayKey","handleKeydown","addDays","addWeeks","startOfWeek","endOfWeek","shiftKey","addYears","addMonths","preventDefault","applyFocus","modifier","autofocus","pageSize","pageBehavior","goToPrevious","goToNext","firstMonth","endOfMonth","canGoPrevious","canGoNext","title","caption","setMonth","monthIndex","getMonth","buildMonthGrid","fixedWeeks","captionFor","formatMonthCaption","weekdays","formatWeekdays","Intl","DateTimeFormat","dayLabelFormatter","weekday","calendar","useStyles","intent","size","headerClasses","header","nav","navButton","monthSelectWrapper","monthSelect","monthSelectValue","monthSelectIcon","yearTrigger","gridClasses","monthGrid","weekdaysRow","week","cell","cellBand","dayContent","indicator","stateFor","range","inRange","isOutsideDuplicate","isOutside","rendersDay","dayOfMonth","isToday","isSelected","isUnavailable","isRangeStart","isRangeEnd","isInRange","isPreview","isFocused","isOutsideRange","ariaLabel","setComponentTemplate","precompileTemplate","strictMode","scope","on","CalendarHeader","VisuallyHidden","YearGrid","MonthGrid"],"mappings":";;;;;;;;;;;;;;;;AAiNA,MAAMA,QAAA,SAAoDC,UACtC;EAElB,IAAIC,MAAAA,GAAiB;IACnB,OAAO,IAAI,CAACC,IAAI,CAACD,MAAM,IAAIE,UAAUC,QAAQ;AAC/C,EAAA;EAEA,IAAIC,eAAwB;IAC1B,OAAOC,gBAAA,CAAiB,IAAI,CAACL,MAAM,EAAE,IAAI,CAACC,IAAI,CAACG,YAAY,CAAA;AAC7D,EAAA;AAEA;;;;;;;EAOA,IAAIE,eAAAA,GAA2B;IAC7B,OAAO,IAAI,CAACL,IAAI,CAACK,eAAe,IAAI,IAAI,CAACC,aAAa,KAAK,CAAA;AAC7D,EAAA;EAEA,IAAIC,aAAAA,GAAsC;AACxC,IAAA,OAAO,IAAI,CAACP,IAAI,CAACO,aAAa,IAAI,OAAA;AACpC,EAAA;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,gBAAA,EAAA,CAECC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAyB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,eAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,gBAAA,CAAA,EAAA,MAAA;EAE1BC,cAAA,GAAiBA,MAAQ;AACvB,IAAA,IAAI,CAACC,cAAc,GAAG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