frontile 0.18.0-alpha.11 → 0.18.0-alpha.13
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/buttons/button.d.ts +1 -1
- package/declarations/components/buttons/chip.d.ts +1 -1
- package/declarations/components/collections/listbox/item.d.ts +1 -1
- package/declarations/components/collections/listbox/listbox.d.ts +1 -1
- package/declarations/components/forms/switch.d.ts +16 -16
- package/declarations/components/overlays/overlay.d.ts +4 -2
- package/declarations/components/status/progress-bar.d.ts +1 -1
- package/declarations/utils/listManager.d.ts +14 -3
- 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 +3 -3
- 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 +3 -3
- package/dist/components/buttons/close-button.js.map +1 -1
- package/dist/components/buttons/toggle-button.js +2 -2
- package/dist/components/buttons/toggle-button.js.map +1 -1
- package/dist/components/collections/dropdown.js +3 -3
- package/dist/components/collections/dropdown.js.map +1 -1
- package/dist/components/collections/listbox/item.js +3 -3
- 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 +1 -1
- 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/cell-default.js +1 -1
- package/dist/components/collections/table/cell-default.js.map +1 -1
- package/dist/components/collections/table/cell-for.js +1 -1
- package/dist/components/collections/table/cell-for.js.map +1 -1
- package/dist/components/collections/table/checkbox.js +2 -2
- package/dist/components/collections/table/checkbox.js.map +1 -1
- package/dist/components/collections/table/column-visibility.js +2 -2
- package/dist/components/collections/table/column-visibility.js.map +1 -1
- package/dist/components/collections/table/icons.js +3 -3
- package/dist/components/collections/table/icons.js.map +1 -1
- package/dist/components/collections/table/sort-button.js +2 -2
- package/dist/components/collections/table/sort-button.js.map +1 -1
- package/dist/components/collections/table/table.js +2 -2
- package/dist/components/collections/table/table.js.map +1 -1
- package/dist/components/collections/table/utils.js.map +1 -1
- package/dist/components/forms/autocomplete.js +2 -2
- 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 +2 -2
- package/dist/components/forms/checkbox.js.map +1 -1
- package/dist/components/forms/field.js +2 -2
- package/dist/components/forms/field.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/form.js +2 -2
- package/dist/components/forms/form.js.map +1 -1
- package/dist/components/forms/icons.js +2 -2
- package/dist/components/forms/icons.js.map +1 -1
- package/dist/components/forms/input.js +2 -2
- 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 +3 -3
- 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 +2 -2
- package/dist/components/forms/radio.js.map +1 -1
- package/dist/components/forms/select.js +2 -2
- package/dist/components/forms/select.js.map +1 -1
- package/dist/components/forms/switch.js +2 -2
- package/dist/components/forms/switch.js.map +1 -1
- package/dist/components/forms/textarea.js +2 -2
- package/dist/components/forms/textarea.js.map +1 -1
- package/dist/components/notifications/index.js +1 -1
- package/dist/components/notifications/notification-card.js +2 -3
- package/dist/components/notifications/notification-card.js.map +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/backdrop.js +1 -1
- package/dist/components/overlays/backdrop.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/footer.js +1 -1
- package/dist/components/overlays/drawer/footer.js.map +1 -1
- package/dist/components/overlays/drawer/header.js +1 -1
- 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/index.js +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 +3 -4
- package/dist/components/overlays/overlay.js.map +1 -1
- package/dist/components/overlays/popover.js +3 -3
- package/dist/components/overlays/popover.js.map +1 -1
- package/dist/components/overlays/portal-target.js +1 -1
- package/dist/components/overlays/portal-target.js.map +1 -1
- package/dist/components/overlays/portal.js +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/collapsible.js +1 -1
- package/dist/components/utilities/collapsible.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/index.js +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/components/utilities/visually-hidden.js +1 -1
- package/dist/components/utilities/visually-hidden.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/{manager-C1Vyhk-A.js → manager-x3PBWzjm.js} +2 -2
- package/dist/{manager-C1Vyhk-A.js.map → manager-x3PBWzjm.js.map} +1 -1
- package/dist/notifications.js +1 -1
- package/dist/overlays.js +1 -1
- package/dist/{portal-BTKv9EEY.js → portal-D2m_lkn7.js} +3 -3
- package/dist/{portal-BTKv9EEY.js.map → portal-D2m_lkn7.js.map} +1 -1
- package/dist/{runtime-BPCpkOf1-B5Lbloj7.js → runtime--fcdnjmJ-BOdRhmsS.js} +2 -2
- package/dist/runtime--fcdnjmJ-BOdRhmsS.js.map +1 -0
- package/dist/services/notifications.js +1 -1
- package/dist/test-support.js +9 -31
- package/dist/test-support.js.map +1 -1
- package/dist/utilities.js +1 -1
- package/dist/utils/listManager.js +98 -18
- package/dist/utils/listManager.js.map +1 -1
- package/dist/utils/ref.js +1 -1
- package/dist/utils/ref.js.map +1 -1
- package/dist/utils/toggle.js +1 -1
- package/dist/utils/toggle.js.map +1 -1
- package/package.json +21 -21
- package/dist/runtime-BPCpkOf1-B5Lbloj7.js.map +0 -1
|
@@ -92,7 +92,7 @@ class Listbox extends Component {
|
|
|
92
92
|
return 'listbox';
|
|
93
93
|
}
|
|
94
94
|
static {
|
|
95
|
-
setComponentTemplate(precompileTemplate("
|
|
95
|
+
setComponentTemplate(precompileTemplate("<ul tabindex=\"0\" role={{this.role}} {{this.listManager.setup selectedKeys=@selectedKeys disabledKeys=@disabledKeys selectionMode=@selectionMode allowEmpty=@allowEmpty autoActivateMode=(if (isUndefined @autoActivateMode) \"first\" @autoActivateMode)}} {{on \"keypress\" this.onKeyPress}} {{on \"keydown\" this.onKeyDown}} {{this.setupEvents elementToAddKeyboardEvents=@elementToAddKeyboardEvents}} data-test-id=\"listbox\" data-component=\"listbox\" class={{this.classNames}} ...attributes>\n {{#each @items as |item|}}\n {{#let (keyAndLabelForItem item) as |keyLabel|}}\n {{#if (has-block \"item\")}}\n {{yield (hash item=item key=keyLabel.key label=keyLabel.label Item=(component ListboxItem manager=this.listManager appearance=@appearance intent=@intent type=this.role key=keyLabel.key)) to=\"item\"}}\n {{else}}\n <ListboxItem @manager={{this.listManager}} @key={{keyLabel.key}} @appearance={{@appearance}} @intent={{@intent}} @type={{this.role}}>\n {{keyLabel.label}}\n </ListboxItem>\n {{/if}}\n {{/let}}\n {{/each}}\n\n {{yield (hash Item=(component ListboxItem manager=this.listManager appearance=@appearance intent=@intent type=this.role))}}\n</ul>", {
|
|
96
96
|
strictMode: true,
|
|
97
97
|
scope: () => ({
|
|
98
98
|
isUndefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox.js","sources":["../../../../src/components/collections/listbox/listbox.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\nimport {\n ListManager,\n keyAndLabelForItem,\n type SelectionMode,\n type ListItem\n} from '../../../utils/listManager';\nimport { ListboxItem, type ListboxItemSignature } from './item';\nimport { modifier } from 'ember-modifier';\nimport type { WithBoundArgs } from '@glint/template';\n\ntype ItemCompBounded = WithBoundArgs<typeof ListboxItem, 'manager'>;\n\ninterface ListboxSignature<T> {\n Args: {\n /**\n * @default 'listbox'\n */\n type?: 'menu' | 'listbox';\n selectionMode?: SelectionMode;\n selectedKeys?: string[];\n disabledKeys?: string[];\n allowEmpty?: boolean;\n items?: T[];\n class?: string;\n isKeyboardEventsEnabled?: boolean;\n\n /** The element to add keyboard events to.\n *\n * This does not respect the option `iskeyboardEventsEnabled`.\n * @defaultValue null\n */\n elementToAddKeyboardEvents?: HTMLElement;\n\n /**\n * @edefaultValue 'frist'\n */\n autoActivateMode?: 'none' | 'first' | 'selected';\n\n onAction?: (key: string) => void;\n onSelectionChange?: (key: string[]) => void;\n onActiveItemChange?: (key?: string, item?: ListItem) => void;\n\n /**\n * The appearance of each item\n *\n * @defaultValue 'default'\n */\n appearance?: 'default' | 'outlined' | 'faded';\n\n /**\n * The intent of each item\n */\n intent?:\n | 'default'\n | 'primary'\n | 'accent'\n | 'success'\n | 'warning'\n | 'danger';\n };\n Element: HTMLUListElement;\n Blocks: {\n item: [{ item: T; key: string; label: string; Item: ItemCompBounded }];\n default: [{ Item: ItemCompBounded }];\n };\n}\n\nconst isInputElement = (\n target: EventTarget | null\n): target is HTMLInputElement => {\n return target instanceof HTMLInputElement;\n};\n\nconst isUndefined = (a: unknown) => typeof a === 'undefined';\n\nclass Listbox<T = unknown> extends Component<ListboxSignature<T>> {\n listManager = new ListManager({\n selectionMode: this.args.selectionMode,\n selectedKeys: this.args.selectedKeys,\n disabledKeys: this.args.disabledKeys,\n allowEmpty: this.args.allowEmpty,\n onSelectionChange: this.args.onSelectionChange,\n onAction: this.args.onAction,\n onActiveItemChange: this.args.onActiveItemChange,\n autoActivateMode: isUndefined(this.args.autoActivateMode)\n ? 'first'\n : this.args.autoActivateMode\n });\n\n handleKeyPress = (event: KeyboardEvent) => {\n if (isInputElement(event.target)) {\n if (event.key === 'Enter') {\n this.listManager.selectActiveItem();\n return;\n }\n } else {\n if (\n ['Enter', ' ', 'Space'].includes(event.key) &&\n this.listManager.searchKeys == ''\n ) {\n this.listManager.selectActiveItem();\n event.preventDefault();\n event.stopPropagation();\n return;\n } else if (event.key.length === 1) {\n this.listManager.search(event.key);\n return;\n }\n }\n };\n\n handleKeyDown = (event: KeyboardEvent) => {\n if (\n ['ArrowUp', 'ArrowDown', 'PageUp', 'PageDown', 'Home', 'End'].includes(\n event.key\n )\n ) {\n event.preventDefault();\n\n if (event.key === 'ArrowDown') {\n this.listManager.setNextOptionActive();\n } else if (event.key === 'ArrowUp') {\n this.listManager.setPreviousOptionActive();\n } else if (event.key === 'Home' || event.key === 'PageUp') {\n this.listManager.setFirstOptionActive();\n } else if (event.key === 'End' || event.key === 'PageDown') {\n this.listManager.setLastOptionActive();\n }\n }\n };\n\n onKeyPress = (event: KeyboardEvent) => {\n if (this.args.isKeyboardEventsEnabled) {\n this.handleKeyPress(event);\n }\n };\n\n onKeyDown = (event: KeyboardEvent) => {\n if (this.args.isKeyboardEventsEnabled) {\n this.handleKeyDown(event);\n }\n };\n\n setupEvents = modifier(\n (\n _el: HTMLElement,\n _: unknown[],\n args: { elementToAddKeyboardEvents?: HTMLElement }\n ) => {\n if (args.elementToAddKeyboardEvents) {\n args.elementToAddKeyboardEvents.addEventListener(\n 'keydown',\n this.handleKeyDown\n );\n args.elementToAddKeyboardEvents.addEventListener(\n 'keypress',\n this.handleKeyPress\n );\n }\n\n return () => {\n if (args.elementToAddKeyboardEvents) {\n args.elementToAddKeyboardEvents.removeEventListener(\n 'keydown',\n this.handleKeyDown\n );\n args.elementToAddKeyboardEvents.removeEventListener(\n 'keypress',\n this.handleKeyPress\n );\n }\n };\n }\n );\n\n get classNames() {\n const { listbox } = useStyles();\n return listbox({ class: this.args.class });\n }\n\n get role() {\n if (this.args.type === 'menu') {\n return this.args.type;\n }\n return 'listbox';\n }\n\n <template>\n <ul\n tabindex=\"0\"\n role={{this.role}}\n {{this.listManager.setup\n selectedKeys=@selectedKeys\n disabledKeys=@disabledKeys\n selectionMode=@selectionMode\n allowEmpty=@allowEmpty\n autoActivateMode=(if\n (isUndefined @autoActivateMode) \"first\" @autoActivateMode\n )\n }}\n {{on \"keypress\" this.onKeyPress}}\n {{on \"keydown\" this.onKeyDown}}\n {{this.setupEvents\n elementToAddKeyboardEvents=@elementToAddKeyboardEvents\n }}\n data-test-id=\"listbox\"\n data-component=\"listbox\"\n class={{this.classNames}}\n ...attributes\n >\n {{#each @items as |item|}}\n {{#let (keyAndLabelForItem item) as |keyLabel|}}\n {{#if (has-block \"item\")}}\n {{yield\n (hash\n item=item\n key=keyLabel.key\n label=keyLabel.label\n Item=(component\n ListboxItem\n manager=this.listManager\n appearance=@appearance\n intent=@intent\n type=this.role\n key=keyLabel.key\n )\n )\n to=\"item\"\n }}\n {{else}}\n <ListboxItem\n @manager={{this.listManager}}\n @key={{keyLabel.key}}\n @appearance={{@appearance}}\n @intent={{@intent}}\n @type={{this.role}}\n >\n {{keyLabel.label}}\n </ListboxItem>\n {{/if}}\n {{/let}}\n {{/each}}\n\n {{yield\n (hash\n Item=(component\n ListboxItem\n manager=this.listManager\n appearance=@appearance\n intent=@intent\n type=this.role\n )\n )\n }}\n </ul>\n </template>\n}\n\nexport {\n Listbox,\n ListboxItem,\n type ListboxSignature,\n type ListboxItemSignature,\n type ListItem\n};\nexport default Listbox;\n"],"names":["isInputElement","target","HTMLInputElement","isUndefined","a","Listbox","Component","listManager","ListManager","selectionMode","args","selectedKeys","disabledKeys","allowEmpty","onSelectionChange","onAction","onActiveItemChange","autoActivateMode","handleKeyPress","event","key","selectActiveItem","includes","searchKeys","preventDefault","stopPropagation","length","search","handleKeyDown","setNextOptionActive","setPreviousOptionActive","setFirstOptionActive","setLastOptionActive","onKeyPress","isKeyboardEventsEnabled","onKeyDown","setupEvents","modifier","_el","_","elementToAddKeyboardEvents","addEventListener","removeEventListener","classNames","listbox","useStyles","class","role","type","setComponentTemplate","precompileTemplate","strictMode","scope","on","keyAndLabelForItem","hash","ListboxItem"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"listbox.js","sources":["../../../../src/components/collections/listbox/listbox.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\nimport {\n ListManager,\n keyAndLabelForItem,\n type SelectionMode,\n type ListItem\n} from '../../../utils/listManager';\nimport { ListboxItem, type ListboxItemSignature } from './item';\nimport { modifier } from 'ember-modifier';\nimport type { WithBoundArgs } from '@glint/template';\n\ntype ItemCompBounded = WithBoundArgs<typeof ListboxItem, 'manager'>;\n\ninterface ListboxSignature<T> {\n Args: {\n /**\n * @default 'listbox'\n */\n type?: 'menu' | 'listbox';\n selectionMode?: SelectionMode;\n selectedKeys?: string[];\n disabledKeys?: string[];\n allowEmpty?: boolean;\n items?: T[];\n class?: string;\n isKeyboardEventsEnabled?: boolean;\n\n /** The element to add keyboard events to.\n *\n * This does not respect the option `iskeyboardEventsEnabled`.\n * @defaultValue null\n */\n elementToAddKeyboardEvents?: HTMLElement;\n\n /**\n * @edefaultValue 'frist'\n */\n autoActivateMode?: 'none' | 'first' | 'selected';\n\n onAction?: (key: string) => void;\n onSelectionChange?: (key: string[]) => void;\n onActiveItemChange?: (key?: string, item?: ListItem) => void;\n\n /**\n * The appearance of each item\n *\n * @defaultValue 'default'\n */\n appearance?: 'default' | 'outlined' | 'faded';\n\n /**\n * The intent of each item\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n };\n Element: HTMLUListElement;\n Blocks: {\n item: [{ item: T; key: string; label: string; Item: ItemCompBounded }];\n default: [{ Item: ItemCompBounded }];\n };\n}\n\nconst isInputElement = (\n target: EventTarget | null\n): target is HTMLInputElement => {\n return target instanceof HTMLInputElement;\n};\n\nconst isUndefined = (a: unknown) => typeof a === 'undefined';\n\nclass Listbox<T = unknown> extends Component<ListboxSignature<T>> {\n listManager = new ListManager({\n selectionMode: this.args.selectionMode,\n selectedKeys: this.args.selectedKeys,\n disabledKeys: this.args.disabledKeys,\n allowEmpty: this.args.allowEmpty,\n onSelectionChange: this.args.onSelectionChange,\n onAction: this.args.onAction,\n onActiveItemChange: this.args.onActiveItemChange,\n autoActivateMode: isUndefined(this.args.autoActivateMode)\n ? 'first'\n : this.args.autoActivateMode\n });\n\n handleKeyPress = (event: KeyboardEvent) => {\n if (isInputElement(event.target)) {\n if (event.key === 'Enter') {\n this.listManager.selectActiveItem();\n return;\n }\n } else {\n if (\n ['Enter', ' ', 'Space'].includes(event.key) &&\n this.listManager.searchKeys == ''\n ) {\n this.listManager.selectActiveItem();\n event.preventDefault();\n event.stopPropagation();\n return;\n } else if (event.key.length === 1) {\n this.listManager.search(event.key);\n return;\n }\n }\n };\n\n handleKeyDown = (event: KeyboardEvent) => {\n if (\n ['ArrowUp', 'ArrowDown', 'PageUp', 'PageDown', 'Home', 'End'].includes(\n event.key\n )\n ) {\n event.preventDefault();\n\n if (event.key === 'ArrowDown') {\n this.listManager.setNextOptionActive();\n } else if (event.key === 'ArrowUp') {\n this.listManager.setPreviousOptionActive();\n } else if (event.key === 'Home' || event.key === 'PageUp') {\n this.listManager.setFirstOptionActive();\n } else if (event.key === 'End' || event.key === 'PageDown') {\n this.listManager.setLastOptionActive();\n }\n }\n };\n\n onKeyPress = (event: KeyboardEvent) => {\n if (this.args.isKeyboardEventsEnabled) {\n this.handleKeyPress(event);\n }\n };\n\n onKeyDown = (event: KeyboardEvent) => {\n if (this.args.isKeyboardEventsEnabled) {\n this.handleKeyDown(event);\n }\n };\n\n setupEvents = modifier(\n (\n _el: HTMLElement,\n _: unknown[],\n args: { elementToAddKeyboardEvents?: HTMLElement }\n ) => {\n if (args.elementToAddKeyboardEvents) {\n args.elementToAddKeyboardEvents.addEventListener(\n 'keydown',\n this.handleKeyDown\n );\n args.elementToAddKeyboardEvents.addEventListener(\n 'keypress',\n this.handleKeyPress\n );\n }\n\n return () => {\n if (args.elementToAddKeyboardEvents) {\n args.elementToAddKeyboardEvents.removeEventListener(\n 'keydown',\n this.handleKeyDown\n );\n args.elementToAddKeyboardEvents.removeEventListener(\n 'keypress',\n this.handleKeyPress\n );\n }\n };\n }\n );\n\n get classNames() {\n const { listbox } = useStyles();\n return listbox({ class: this.args.class });\n }\n\n get role() {\n if (this.args.type === 'menu') {\n return this.args.type;\n }\n return 'listbox';\n }\n\n <template>\n <ul\n tabindex=\"0\"\n role={{this.role}}\n {{this.listManager.setup\n selectedKeys=@selectedKeys\n disabledKeys=@disabledKeys\n selectionMode=@selectionMode\n allowEmpty=@allowEmpty\n autoActivateMode=(if\n (isUndefined @autoActivateMode) \"first\" @autoActivateMode\n )\n }}\n {{on \"keypress\" this.onKeyPress}}\n {{on \"keydown\" this.onKeyDown}}\n {{this.setupEvents\n elementToAddKeyboardEvents=@elementToAddKeyboardEvents\n }}\n data-test-id=\"listbox\"\n data-component=\"listbox\"\n class={{this.classNames}}\n ...attributes\n >\n {{#each @items as |item|}}\n {{#let (keyAndLabelForItem item) as |keyLabel|}}\n {{#if (has-block \"item\")}}\n {{yield\n (hash\n item=item\n key=keyLabel.key\n label=keyLabel.label\n Item=(component\n ListboxItem\n manager=this.listManager\n appearance=@appearance\n intent=@intent\n type=this.role\n key=keyLabel.key\n )\n )\n to=\"item\"\n }}\n {{else}}\n <ListboxItem\n @manager={{this.listManager}}\n @key={{keyLabel.key}}\n @appearance={{@appearance}}\n @intent={{@intent}}\n @type={{this.role}}\n >\n {{keyLabel.label}}\n </ListboxItem>\n {{/if}}\n {{/let}}\n {{/each}}\n\n {{yield\n (hash\n Item=(component\n ListboxItem\n manager=this.listManager\n appearance=@appearance\n intent=@intent\n type=this.role\n )\n )\n }}\n </ul>\n </template>\n}\n\nexport {\n Listbox,\n ListboxItem,\n type ListboxSignature,\n type ListboxItemSignature,\n type ListItem\n};\nexport default Listbox;\n"],"names":["isInputElement","target","HTMLInputElement","isUndefined","a","Listbox","Component","listManager","ListManager","selectionMode","args","selectedKeys","disabledKeys","allowEmpty","onSelectionChange","onAction","onActiveItemChange","autoActivateMode","handleKeyPress","event","key","selectActiveItem","includes","searchKeys","preventDefault","stopPropagation","length","search","handleKeyDown","setNextOptionActive","setPreviousOptionActive","setFirstOptionActive","setLastOptionActive","onKeyPress","isKeyboardEventsEnabled","onKeyDown","setupEvents","modifier","_el","_","elementToAddKeyboardEvents","addEventListener","removeEventListener","classNames","listbox","useStyles","class","role","type","setComponentTemplate","precompileTemplate","strictMode","scope","on","keyAndLabelForItem","hash","ListboxItem"],"mappings":"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"}
|
|
@@ -17,7 +17,7 @@ class SimpleTableBody extends Component {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
static {
|
|
20
|
-
setComponentTemplate(precompileTemplate("
|
|
20
|
+
setComponentTemplate(precompileTemplate("<tbody class={{this.classNames}} data-test-id=\"table-body\" data-component=\"table-body\" ...attributes>\n {{yield (hash Row=(component SimpleTableRow styleFns=this.styles classes=@classes) Cell=(component SimpleTableCell styleFns=this.styles classes=@classes))}}\n</tbody>", {
|
|
21
21
|
strictMode: true,
|
|
22
22
|
scope: () => ({
|
|
23
23
|
hash,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sources":["../../../../src/components/collections/simple-table/body.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableRow } from './row';\nimport { SimpleTableCell } from './cell';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\nimport type { WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableBodySignature {\n Args: {\n /** Additional CSS class to apply to the body section */\n class?: string;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableSectionElement;\n Blocks: {\n default: [\n {\n Row: WithBoundArgs<typeof SimpleTableRow, 'styleFns' | 'classes'>;\n Cell: WithBoundArgs<typeof SimpleTableCell, 'styleFns' | 'classes'>;\n }\n ];\n };\n}\n\nclass SimpleTableBody extends Component<SimpleTableBodySignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const mergedClass = twMerge(this.args.class, this.args.classes?.tbody);\n return this.styles.tbody({ class: mergedClass });\n }\n\n <template>\n <tbody\n class={{this.classNames}}\n data-test-id=\"table-body\"\n data-component=\"table-body\"\n ...attributes\n >\n {{yield\n (hash\n Row=(component SimpleTableRow styleFns=this.styles classes=@classes)\n Cell=(component SimpleTableCell styleFns=this.styles classes=@classes)\n )\n }}\n </tbody>\n </template>\n}\n\nexport { SimpleTableBody, type SimpleTableBodySignature };\nexport default SimpleTableBody;\n"],"names":["SimpleTableBody","Component","styles","args","styleFns","useStyles","table","classNames","mergedClass","twMerge","class","classes","tbody","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableRow","SimpleTableCell"],"mappings":";;;;;;;;AAkCA,MAAMA,wBAAwBC,SAAA,CAAU;EACtC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,WAAA,GAAcC,OAAA,CAAQ,IAAI,CAACN,IAAI,CAACO,KAAK,EAAE,IAAI,CAACP,IAAI,CAACQ,OAAO,EAAEC,KAAA,CAAA;AAChE,IAAA,OAAO,IAAI,CAACV,MAAM,CAACU,KAAK,CAAC;AAAEF,MAAAA,KAAA,EAAOF;AAAY,KAAA,CAAA;AAChD,EAAA;AAEA,EAAA;IAAAK,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"body.js","sources":["../../../../src/components/collections/simple-table/body.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableRow } from './row';\nimport { SimpleTableCell } from './cell';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\nimport type { WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableBodySignature {\n Args: {\n /** Additional CSS class to apply to the body section */\n class?: string;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableSectionElement;\n Blocks: {\n default: [\n {\n Row: WithBoundArgs<typeof SimpleTableRow, 'styleFns' | 'classes'>;\n Cell: WithBoundArgs<typeof SimpleTableCell, 'styleFns' | 'classes'>;\n }\n ];\n };\n}\n\nclass SimpleTableBody extends Component<SimpleTableBodySignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const mergedClass = twMerge(this.args.class, this.args.classes?.tbody);\n return this.styles.tbody({ class: mergedClass });\n }\n\n <template>\n <tbody\n class={{this.classNames}}\n data-test-id=\"table-body\"\n data-component=\"table-body\"\n ...attributes\n >\n {{yield\n (hash\n Row=(component SimpleTableRow styleFns=this.styles classes=@classes)\n Cell=(component SimpleTableCell styleFns=this.styles classes=@classes)\n )\n }}\n </tbody>\n </template>\n}\n\nexport { SimpleTableBody, type SimpleTableBodySignature };\nexport default SimpleTableBody;\n"],"names":["SimpleTableBody","Component","styles","args","styleFns","useStyles","table","classNames","mergedClass","twMerge","class","classes","tbody","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableRow","SimpleTableCell"],"mappings":";;;;;;;;AAkCA,MAAMA,wBAAwBC,SAAA,CAAU;EACtC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,WAAA,GAAcC,OAAA,CAAQ,IAAI,CAACN,IAAI,CAACO,KAAK,EAAE,IAAI,CAACP,IAAI,CAACQ,OAAO,EAAEC,KAAA,CAAA;AAChE,IAAA,OAAO,IAAI,CAACV,MAAM,CAACU,KAAK,CAAC;AAAEF,MAAAA,KAAA,EAAOF;AAAY,KAAA,CAAA;AAChD,EAAA;AAEA,EAAA;IAAAK,oBAAA,CAAAC,kBAAA,CAAA,qRAAA,EAcA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;QAAAC,cAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -17,7 +17,7 @@ class SimpleTableCell extends Component {
|
|
|
17
17
|
return this.styles.td(options);
|
|
18
18
|
}
|
|
19
19
|
static {
|
|
20
|
-
setComponentTemplate(precompileTemplate("
|
|
20
|
+
setComponentTemplate(precompileTemplate("<td class={{this.classNames}} data-test-id=\"table-cell\" data-component=\"table-cell\" ...attributes>\n {{yield}}\n</td>", {
|
|
21
21
|
strictMode: true
|
|
22
22
|
}), this);
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.js","sources":["../../../../src/components/collections/simple-table/cell.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\n\ninterface SimpleTableCellSignature {\n Args: {\n /** Additional CSS class to apply to the cell */\n class?: string;\n /** Whether this cell should be sticky during horizontal scrolling */\n isSticky?: boolean;\n /** Position where the sticky cell should stick. @default 'left' */\n stickyPosition?: 'left' | 'right';\n /** Whether this cell is part of a sticky row (used for intersection styling) */\n isInStickyRow?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableCellElement;\n Blocks: {\n default: [];\n };\n}\n\nclass SimpleTableCell extends Component<SimpleTableCellSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky\n ? (this.args.stickyPosition as 'left' | 'right') || 'left'\n : undefined,\n isInStickyRow: this.args.isInStickyRow || false,\n class: twMerge(this.args.class || '', this.args.classes?.td || '')\n };\n\n return this.styles.td(options);\n }\n\n <template>\n <td\n class={{this.classNames}}\n data-test-id=\"table-cell\"\n data-component=\"table-cell\"\n ...attributes\n >\n {{yield}}\n </td>\n </template>\n}\n\nexport { SimpleTableCell, type SimpleTableCellSignature };\nexport default SimpleTableCell;\n"],"names":["SimpleTableCell","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","isInStickyRow","class","twMerge","classes","td","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AA+BA,MAAMA,wBAAwBC,SAAA,CAAU;EACtC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;AAChCC,MAAAA,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAC7B,IAAI,CAACN,IAAI,CAACO,cAAc,IAAyB,MAAA,GAClDC,SAAA;AACJC,MAAAA,aAAA,EAAe,IAAI,CAACT,IAAI,CAACS,aAAa,IAAI,KAAA;AAC1CC,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,CAACX,IAAI,CAACU,KAAK,IAAI,EAAA,EAAI,IAAI,CAACV,IAAI,CAACY,OAAO,EAAEC,EAAA,IAAM,EAAA;KACjE;AAEA,IAAA,OAAO,IAAI,CAACd,MAAM,CAACc,EAAE,CAACR,OAAA,CAAA;AACxB,EAAA;AAEA,EAAA;IAAAS,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"cell.js","sources":["../../../../src/components/collections/simple-table/cell.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\n\ninterface SimpleTableCellSignature {\n Args: {\n /** Additional CSS class to apply to the cell */\n class?: string;\n /** Whether this cell should be sticky during horizontal scrolling */\n isSticky?: boolean;\n /** Position where the sticky cell should stick. @default 'left' */\n stickyPosition?: 'left' | 'right';\n /** Whether this cell is part of a sticky row (used for intersection styling) */\n isInStickyRow?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableCellElement;\n Blocks: {\n default: [];\n };\n}\n\nclass SimpleTableCell extends Component<SimpleTableCellSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky\n ? (this.args.stickyPosition as 'left' | 'right') || 'left'\n : undefined,\n isInStickyRow: this.args.isInStickyRow || false,\n class: twMerge(this.args.class || '', this.args.classes?.td || '')\n };\n\n return this.styles.td(options);\n }\n\n <template>\n <td\n class={{this.classNames}}\n data-test-id=\"table-cell\"\n data-component=\"table-cell\"\n ...attributes\n >\n {{yield}}\n </td>\n </template>\n}\n\nexport { SimpleTableCell, type SimpleTableCellSignature };\nexport default SimpleTableCell;\n"],"names":["SimpleTableCell","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","isInStickyRow","class","twMerge","classes","td","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AA+BA,MAAMA,wBAAwBC,SAAA,CAAU;EACtC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;AAChCC,MAAAA,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAC7B,IAAI,CAACN,IAAI,CAACO,cAAc,IAAyB,MAAA,GAClDC,SAAA;AACJC,MAAAA,aAAA,EAAe,IAAI,CAACT,IAAI,CAACS,aAAa,IAAI,KAAA;AAC1CC,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,CAACX,IAAI,CAACU,KAAK,IAAI,EAAA,EAAI,IAAI,CAACV,IAAI,CAACY,OAAO,EAAEC,EAAA,IAAM,EAAA;KACjE;AAEA,IAAA,OAAO,IAAI,CAACd,MAAM,CAACc,EAAE,CAACR,OAAA,CAAA;AACxB,EAAA;AAEA,EAAA;IAAAS,oBAAA,CAAAC,kBAAA,CAAA,4HAAA,EASA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -16,7 +16,7 @@ class SimpleTableColumn extends Component {
|
|
|
16
16
|
return this.styles.th(options);
|
|
17
17
|
}
|
|
18
18
|
static {
|
|
19
|
-
setComponentTemplate(precompileTemplate("
|
|
19
|
+
setComponentTemplate(precompileTemplate("<th class={{this.classNames}} data-test-id=\"table-column\" data-component=\"table-column\" ...attributes>\n {{yield}}\n</th>", {
|
|
20
20
|
strictMode: true
|
|
21
21
|
}), this);
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column.js","sources":["../../../../src/components/collections/simple-table/column.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\ninterface SimpleTableColumnSignature {\n Args: {\n /** Additional CSS class to apply to the header cell */\n class?: string;\n /** Whether this column should be sticky during horizontal scrolling */\n isSticky?: boolean;\n /** Position where the sticky column should stick. @default 'left' */\n stickyPosition?: 'left' | 'right';\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n };\n Element: HTMLTableCellElement;\n Blocks: {\n default: [];\n };\n}\n\nclass SimpleTableColumn extends Component<SimpleTableColumnSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky\n ? (this.args.stickyPosition as 'left' | 'right') || 'left'\n : undefined,\n class: this.args.class\n };\n\n return this.styles.th(options);\n }\n\n <template>\n <th\n class={{this.classNames}}\n data-test-id=\"table-column\"\n data-component=\"table-column\"\n ...attributes\n >\n {{yield}}\n </th>\n </template>\n}\n\nexport { SimpleTableColumn, type SimpleTableColumnSignature };\nexport default SimpleTableColumn;\n"],"names":["SimpleTableColumn","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","class","th","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAuBA,MAAMA,0BAA0BC,SAAA,CAAU;EACxC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;AAChCC,MAAAA,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAC7B,IAAI,CAACN,IAAI,CAACO,cAAc,IAAyB,MAAA,GAClDC,SAAA;AACJC,MAAAA,KAAA,EAAO,IAAI,CAACT,IAAI,CAACS;KACnB;AAEA,IAAA,OAAO,IAAI,CAACV,MAAM,CAACW,EAAE,CAACL,OAAA,CAAA;AACxB,EAAA;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"column.js","sources":["../../../../src/components/collections/simple-table/column.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\ninterface SimpleTableColumnSignature {\n Args: {\n /** Additional CSS class to apply to the header cell */\n class?: string;\n /** Whether this column should be sticky during horizontal scrolling */\n isSticky?: boolean;\n /** Position where the sticky column should stick. @default 'left' */\n stickyPosition?: 'left' | 'right';\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n };\n Element: HTMLTableCellElement;\n Blocks: {\n default: [];\n };\n}\n\nclass SimpleTableColumn extends Component<SimpleTableColumnSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky\n ? (this.args.stickyPosition as 'left' | 'right') || 'left'\n : undefined,\n class: this.args.class\n };\n\n return this.styles.th(options);\n }\n\n <template>\n <th\n class={{this.classNames}}\n data-test-id=\"table-column\"\n data-component=\"table-column\"\n ...attributes\n >\n {{yield}}\n </th>\n </template>\n}\n\nexport { SimpleTableColumn, type SimpleTableColumnSignature };\nexport default SimpleTableColumn;\n"],"names":["SimpleTableColumn","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","class","th","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAuBA,MAAMA,0BAA0BC,SAAA,CAAU;EACxC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;AAChCC,MAAAA,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAC7B,IAAI,CAACN,IAAI,CAACO,cAAc,IAAyB,MAAA,GAClDC,SAAA;AACJC,MAAAA,KAAA,EAAO,IAAI,CAACT,IAAI,CAACS;KACnB;AAEA,IAAA,OAAO,IAAI,CAACV,MAAM,CAACW,EAAE,CAACL,OAAA,CAAA;AACxB,EAAA;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAAA,gIAAA,EASA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -30,7 +30,7 @@ class SimpleTableFooter extends Component {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
static {
|
|
33
|
-
setComponentTemplate(precompileTemplate("
|
|
33
|
+
setComponentTemplate(precompileTemplate("<tfoot class={{this.classNames}} data-test-id=\"table-footer\" data-component=\"table-footer\" ...attributes>\n <tr class={{this.separatorClassNames}} />\n <tr class={{this.rowClassNames}}>\n {{yield (hash Column=SimpleTableColumn)}}\n </tr>\n</tfoot>", {
|
|
34
34
|
strictMode: true,
|
|
35
35
|
scope: () => ({
|
|
36
36
|
hash,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.js","sources":["../../../../src/components/collections/simple-table/footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableColumn } from './column';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\n\ninterface SimpleTableFooterSignature {\n Args: {\n /** Additional CSS class to apply to the footer element */\n class?: string;\n /** Whether this footer should be sticky during vertical scrolling */\n isSticky?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableSectionElement;\n Blocks: {\n default: [\n {\n Column: typeof SimpleTableColumn;\n }\n ];\n };\n}\n\nclass SimpleTableFooter extends Component<SimpleTableFooterSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky ? ('bottom' as const) : undefined,\n class: twMerge(this.args.class, this.args.classes?.tfoot)\n };\n\n return this.styles.tfoot(options);\n }\n\n get rowClassNames() {\n const options = {\n class: twMerge('', this.args.classes?.tr || ''),\n isSticky: false\n };\n return this.styles.tr(options);\n }\n\n get separatorClassNames() {\n return this.styles.separator({\n class: this.args.classes?.separator\n });\n }\n\n <template>\n <tfoot\n class={{this.classNames}}\n data-test-id=\"table-footer\"\n data-component=\"table-footer\"\n ...attributes\n >\n <tr class={{this.separatorClassNames}} />\n <tr class={{this.rowClassNames}}>\n {{yield (hash Column=SimpleTableColumn)}}\n </tr>\n </tfoot>\n </template>\n}\n\nexport { SimpleTableFooter, type SimpleTableFooterSignature };\nexport default SimpleTableFooter;\n"],"names":["SimpleTableFooter","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","class","twMerge","classes","tfoot","rowClassNames","tr","separatorClassNames","separator","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableColumn"],"mappings":";;;;;;;AAiCA,MAAMA,0BAA0BC,SAAA,CAAU;EACxC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;MAChCC,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAAI,WAAqBE,SAAA;AAC3DC,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,CAACV,IAAI,CAACS,KAAK,EAAE,IAAI,CAACT,IAAI,CAACW,OAAO,EAAEC,KAAA;KACrD;AAEA,IAAA,OAAO,IAAI,CAACb,MAAM,CAACa,KAAK,CAACP,OAAA,CAAA;AAC3B,EAAA;EAEA,IAAIQ,aAAAA,GAAgB;AAClB,IAAA,MAAMR,OAAA,GAAU;AACdI,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,IAAI,CAACV,IAAI,CAACW,OAAO,EAAEG,EAAA,IAAM,EAAA,CAAA;AAC5CR,MAAAA,QAAA,EAAU;KACZ;AACA,IAAA,OAAO,IAAI,CAACP,MAAM,CAACe,EAAE,CAACT,OAAA,CAAA;AACxB,EAAA;EAEA,IAAIU,mBAAAA,GAAsB;AACxB,IAAA,OAAO,IAAI,CAAChB,MAAM,CAACiB,SAAS,CAAC;AAC3BP,MAAAA,KAAA,EAAO,IAAI,CAACT,IAAI,CAACW,OAAO,EAAEK;AAC5B,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"footer.js","sources":["../../../../src/components/collections/simple-table/footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableColumn } from './column';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\n\ninterface SimpleTableFooterSignature {\n Args: {\n /** Additional CSS class to apply to the footer element */\n class?: string;\n /** Whether this footer should be sticky during vertical scrolling */\n isSticky?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableSectionElement;\n Blocks: {\n default: [\n {\n Column: typeof SimpleTableColumn;\n }\n ];\n };\n}\n\nclass SimpleTableFooter extends Component<SimpleTableFooterSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky ? ('bottom' as const) : undefined,\n class: twMerge(this.args.class, this.args.classes?.tfoot)\n };\n\n return this.styles.tfoot(options);\n }\n\n get rowClassNames() {\n const options = {\n class: twMerge('', this.args.classes?.tr || ''),\n isSticky: false\n };\n return this.styles.tr(options);\n }\n\n get separatorClassNames() {\n return this.styles.separator({\n class: this.args.classes?.separator\n });\n }\n\n <template>\n <tfoot\n class={{this.classNames}}\n data-test-id=\"table-footer\"\n data-component=\"table-footer\"\n ...attributes\n >\n <tr class={{this.separatorClassNames}} />\n <tr class={{this.rowClassNames}}>\n {{yield (hash Column=SimpleTableColumn)}}\n </tr>\n </tfoot>\n </template>\n}\n\nexport { SimpleTableFooter, type SimpleTableFooterSignature };\nexport default SimpleTableFooter;\n"],"names":["SimpleTableFooter","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","class","twMerge","classes","tfoot","rowClassNames","tr","separatorClassNames","separator","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableColumn"],"mappings":";;;;;;;AAiCA,MAAMA,0BAA0BC,SAAA,CAAU;EACxC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;MAChCC,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAAI,WAAqBE,SAAA;AAC3DC,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,CAACV,IAAI,CAACS,KAAK,EAAE,IAAI,CAACT,IAAI,CAACW,OAAO,EAAEC,KAAA;KACrD;AAEA,IAAA,OAAO,IAAI,CAACb,MAAM,CAACa,KAAK,CAACP,OAAA,CAAA;AAC3B,EAAA;EAEA,IAAIQ,aAAAA,GAAgB;AAClB,IAAA,MAAMR,OAAA,GAAU;AACdI,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,IAAI,CAACV,IAAI,CAACW,OAAO,EAAEG,EAAA,IAAM,EAAA,CAAA;AAC5CR,MAAAA,QAAA,EAAU;KACZ;AACA,IAAA,OAAO,IAAI,CAACP,MAAM,CAACe,EAAE,CAACT,OAAA,CAAA;AACxB,EAAA;EAEA,IAAIU,mBAAAA,GAAsB;AACxB,IAAA,OAAO,IAAI,CAAChB,MAAM,CAACiB,SAAS,CAAC;AAC3BP,MAAAA,KAAA,EAAO,IAAI,CAACT,IAAI,CAACW,OAAO,EAAEK;AAC5B,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,mQAAA,EAYA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -30,7 +30,7 @@ class SimpleTableHeader extends Component {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
static {
|
|
33
|
-
setComponentTemplate(precompileTemplate("
|
|
33
|
+
setComponentTemplate(precompileTemplate("<thead class={{this.classNames}} data-test-id=\"table-header\" data-component=\"table-header\" ...attributes>\n <tr class={{this.rowClassNames}}>\n {{yield (hash Column=SimpleTableColumn)}}\n </tr>\n <tr class={{this.separatorClassNames}} />\n</thead>", {
|
|
34
34
|
strictMode: true,
|
|
35
35
|
scope: () => ({
|
|
36
36
|
hash,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","sources":["../../../../src/components/collections/simple-table/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableColumn } from './column';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\n\ninterface SimpleTableHeaderSignature {\n Args: {\n /** Additional CSS class to apply to the header section */\n class?: string;\n /** Whether the header should be sticky during vertical scrolling */\n isSticky?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableSectionElement;\n Blocks: {\n default: [\n {\n Column: typeof SimpleTableColumn;\n }\n ];\n };\n}\n\nclass SimpleTableHeader extends Component<SimpleTableHeaderSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky ? ('top' as const) : undefined,\n class: twMerge(this.args.class, this.args.classes?.thead)\n };\n\n return this.styles.thead(options);\n }\n\n get rowClassNames() {\n const options = {\n class: twMerge('', this.args.classes?.tr || ''),\n isSticky: false\n };\n return this.styles.tr(options);\n }\n\n get separatorClassNames() {\n return this.styles.separator({\n class: this.args.classes?.separator\n });\n }\n\n <template>\n <thead\n class={{this.classNames}}\n data-test-id=\"table-header\"\n data-component=\"table-header\"\n ...attributes\n >\n <tr class={{this.rowClassNames}}>\n {{yield (hash Column=SimpleTableColumn)}}\n </tr>\n <tr class={{this.separatorClassNames}} />\n </thead>\n </template>\n}\n\nexport { SimpleTableHeader, type SimpleTableHeaderSignature };\nexport default SimpleTableHeader;\n"],"names":["SimpleTableHeader","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","class","twMerge","classes","thead","rowClassNames","tr","separatorClassNames","separator","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableColumn"],"mappings":";;;;;;;AAiCA,MAAMA,0BAA0BC,SAAA,CAAU;EACxC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;MAChCC,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAAI,QAAkBE,SAAA;AACxDC,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,CAACV,IAAI,CAACS,KAAK,EAAE,IAAI,CAACT,IAAI,CAACW,OAAO,EAAEC,KAAA;KACrD;AAEA,IAAA,OAAO,IAAI,CAACb,MAAM,CAACa,KAAK,CAACP,OAAA,CAAA;AAC3B,EAAA;EAEA,IAAIQ,aAAAA,GAAgB;AAClB,IAAA,MAAMR,OAAA,GAAU;AACdI,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,IAAI,CAACV,IAAI,CAACW,OAAO,EAAEG,EAAA,IAAM,EAAA,CAAA;AAC5CR,MAAAA,QAAA,EAAU;KACZ;AACA,IAAA,OAAO,IAAI,CAACP,MAAM,CAACe,EAAE,CAACT,OAAA,CAAA;AACxB,EAAA;EAEA,IAAIU,mBAAAA,GAAsB;AACxB,IAAA,OAAO,IAAI,CAAChB,MAAM,CAACiB,SAAS,CAAC;AAC3BP,MAAAA,KAAA,EAAO,IAAI,CAACT,IAAI,CAACW,OAAO,EAAEK;AAC5B,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../../src/components/collections/simple-table/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableColumn } from './column';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\n\ninterface SimpleTableHeaderSignature {\n Args: {\n /** Additional CSS class to apply to the header section */\n class?: string;\n /** Whether the header should be sticky during vertical scrolling */\n isSticky?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableSectionElement;\n Blocks: {\n default: [\n {\n Column: typeof SimpleTableColumn;\n }\n ];\n };\n}\n\nclass SimpleTableHeader extends Component<SimpleTableHeaderSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky ? ('top' as const) : undefined,\n class: twMerge(this.args.class, this.args.classes?.thead)\n };\n\n return this.styles.thead(options);\n }\n\n get rowClassNames() {\n const options = {\n class: twMerge('', this.args.classes?.tr || ''),\n isSticky: false\n };\n return this.styles.tr(options);\n }\n\n get separatorClassNames() {\n return this.styles.separator({\n class: this.args.classes?.separator\n });\n }\n\n <template>\n <thead\n class={{this.classNames}}\n data-test-id=\"table-header\"\n data-component=\"table-header\"\n ...attributes\n >\n <tr class={{this.rowClassNames}}>\n {{yield (hash Column=SimpleTableColumn)}}\n </tr>\n <tr class={{this.separatorClassNames}} />\n </thead>\n </template>\n}\n\nexport { SimpleTableHeader, type SimpleTableHeaderSignature };\nexport default SimpleTableHeader;\n"],"names":["SimpleTableHeader","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","class","twMerge","classes","thead","rowClassNames","tr","separatorClassNames","separator","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableColumn"],"mappings":";;;;;;;AAiCA,MAAMA,0BAA0BC,SAAA,CAAU;EACxC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;MAChCC,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAAI,QAAkBE,SAAA;AACxDC,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,CAACV,IAAI,CAACS,KAAK,EAAE,IAAI,CAACT,IAAI,CAACW,OAAO,EAAEC,KAAA;KACrD;AAEA,IAAA,OAAO,IAAI,CAACb,MAAM,CAACa,KAAK,CAACP,OAAA,CAAA;AAC3B,EAAA;EAEA,IAAIQ,aAAAA,GAAgB;AAClB,IAAA,MAAMR,OAAA,GAAU;AACdI,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,IAAI,CAACV,IAAI,CAACW,OAAO,EAAEG,EAAA,IAAM,EAAA,CAAA;AAC5CR,MAAAA,QAAA,EAAU;KACZ;AACA,IAAA,OAAO,IAAI,CAACP,MAAM,CAACe,EAAE,CAACT,OAAA,CAAA;AACxB,EAAA;EAEA,IAAIU,mBAAAA,GAAsB;AACxB,IAAA,OAAO,IAAI,CAAChB,MAAM,CAACiB,SAAS,CAAC;AAC3BP,MAAAA,KAAA,EAAO,IAAI,CAACT,IAAI,CAACW,OAAO,EAAEK;AAC5B,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,mQAAA,EAYA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -41,7 +41,7 @@ class SimpleTable extends Component {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
static {
|
|
44
|
-
setComponentTemplate(precompileTemplate("
|
|
44
|
+
setComponentTemplate(precompileTemplate("{{#if this.hasWrapper}}\n <div class={{this.wrapperClassNames}} data-component=\"table-wrapper\">\n <table class={{this.tableClassNames}} data-test-id=\"table\" data-component=\"table\" data-loading={{if this.args.isLoading \"true\" \"false\"}} ...attributes>\n {{yield (hash Header=(component SimpleTableHeader styleFns=this.styles classes=this.args.classes) Body=(component SimpleTableBody styleFns=this.styles classes=this.args.classes) Footer=(component SimpleTableFooter styleFns=this.styles classes=this.args.classes) Column=(component SimpleTableColumn styleFns=this.styles) Row=(component SimpleTableRow styleFns=this.styles classes=this.args.classes) Cell=(component SimpleTableCell styleFns=this.styles classes=this.args.classes))}}\n </table>\n </div>\n{{else}}\n <table class={{this.tableClassNames}} data-test-id=\"table\" data-component=\"table\" data-loading={{if this.args.isLoading \"true\" \"false\"}} ...attributes>\n {{yield (hash Header=(component SimpleTableHeader styleFns=this.styles classes=this.args.classes) Body=(component SimpleTableBody styleFns=this.styles classes=this.args.classes) Footer=(component SimpleTableFooter styleFns=this.styles classes=this.args.classes) Column=(component SimpleTableColumn styleFns=this.styles) Row=(component SimpleTableRow styleFns=this.styles classes=this.args.classes) Cell=(component SimpleTableCell styleFns=this.styles classes=this.args.classes))}}\n </table>\n{{/if}}", {
|
|
45
45
|
strictMode: true,
|
|
46
46
|
scope: () => ({
|
|
47
47
|
hash,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/collections/simple-table/index.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport { SimpleTableHeader, type SimpleTableHeaderSignature } from './header';\nimport { SimpleTableBody, type SimpleTableBodySignature } from './body';\nimport { SimpleTableFooter, type SimpleTableFooterSignature } from './footer';\nimport { SimpleTableColumn, type SimpleTableColumnSignature } from './column';\nimport { SimpleTableRow, type SimpleTableRowSignature } from './row';\nimport { SimpleTableCell, type SimpleTableCellSignature } from './cell';\n\nimport type { TableVariants, TableSlots, SlotsToClasses } from '../table/types';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableSignature {\n Args: {\n /** Custom CSS classes for different table elements (wrapper, table, th, td, etc.) */\n classes?: SlotsToClasses<TableSlots>;\n /** Size variant for table cells and headers. @defaultValue 'md' */\n size?: TableVariants['size'];\n /** Table layout algorithm - 'auto' sizes columns by content, 'fixed' uses first row for sizing. @defaultValue 'auto' */\n layout?: TableVariants['layout'];\n /** Enable striped rows (alternating background colors) */\n isStriped?: TableVariants['striped'];\n /** Enable scrolling for the table container */\n isScrollable?: boolean;\n /** Whether to render the wrapper div. @defaultValue true */\n hasWrapper?: boolean;\n /** Enable loading state styling and behavior */\n isLoading?: boolean;\n /** Color variant for loading animation. @defaultValue 'default' */\n loadingColor?: TableVariants['loadingColor'];\n /** Color variant for selection highlight. @defaultValue 'primary' */\n selectionColor?: TableVariants['selectionColor'];\n /** Whether a custom loading block is provided (disables CSS loading indicator) */\n hasCustomLoading?: boolean;\n };\n Element: HTMLTableElement;\n Blocks: {\n default: [\n {\n Header: WithBoundArgs<\n ComponentLike<SimpleTableHeaderSignature>,\n 'styleFns' | 'classes'\n >;\n Body: WithBoundArgs<\n ComponentLike<SimpleTableBodySignature>,\n 'styleFns' | 'classes'\n >;\n Footer: WithBoundArgs<\n ComponentLike<SimpleTableFooterSignature>,\n 'styleFns' | 'classes'\n >;\n Column: WithBoundArgs<\n ComponentLike<SimpleTableColumnSignature>,\n 'styleFns'\n >;\n Row: WithBoundArgs<\n ComponentLike<SimpleTableRowSignature>,\n 'styleFns' | 'classes'\n >;\n Cell: WithBoundArgs<\n ComponentLike<SimpleTableCellSignature>,\n 'styleFns' | 'classes'\n >;\n }\n ];\n };\n}\n\nclass SimpleTable extends Component<SimpleTableSignature> {\n get hasWrapper() {\n return this.args.hasWrapper ?? true;\n }\n\n get styles() {\n const { table } = useStyles();\n return table({\n size: this.args.size,\n layout: this.args.layout,\n striped: this.args.isStriped,\n isScrollable: this.args.isScrollable || false,\n hasStickyHeader: false, // Will be determined by header component\n isLoading: this.args.hasCustomLoading\n ? false\n : this.args.isLoading || false,\n loadingColor: this.args.loadingColor,\n selectionColor: this.args.selectionColor,\n class: this.args.classes?.base\n });\n }\n\n get wrapperClassNames() {\n return this.styles.wrapper({\n class: this.args.classes?.wrapper\n });\n }\n\n get tableClassNames() {\n return this.styles.table({ class: this.args.classes?.table });\n }\n\n <template>\n {{#if this.hasWrapper}}\n <div class={{this.wrapperClassNames}} data-component=\"table-wrapper\">\n <table\n class={{this.tableClassNames}}\n data-test-id=\"table\"\n data-component=\"table\"\n data-loading={{if this.args.isLoading \"true\" \"false\"}}\n ...attributes\n >\n {{yield\n (hash\n Header=(component\n SimpleTableHeader styleFns=this.styles classes=this.args.classes\n )\n Body=(component\n SimpleTableBody styleFns=this.styles classes=this.args.classes\n )\n Footer=(component\n SimpleTableFooter styleFns=this.styles classes=this.args.classes\n )\n Column=(component SimpleTableColumn styleFns=this.styles)\n Row=(component\n SimpleTableRow styleFns=this.styles classes=this.args.classes\n )\n Cell=(component\n SimpleTableCell styleFns=this.styles classes=this.args.classes\n )\n )\n }}\n </table>\n </div>\n {{else}}\n <table\n class={{this.tableClassNames}}\n data-test-id=\"table\"\n data-component=\"table\"\n data-loading={{if this.args.isLoading \"true\" \"false\"}}\n ...attributes\n >\n {{yield\n (hash\n Header=(component\n SimpleTableHeader styleFns=this.styles classes=this.args.classes\n )\n Body=(component\n SimpleTableBody styleFns=this.styles classes=this.args.classes\n )\n Footer=(component\n SimpleTableFooter styleFns=this.styles classes=this.args.classes\n )\n Column=(component SimpleTableColumn styleFns=this.styles)\n Row=(component\n SimpleTableRow styleFns=this.styles classes=this.args.classes\n )\n Cell=(component\n SimpleTableCell styleFns=this.styles classes=this.args.classes\n )\n )\n }}\n </table>\n {{/if}}\n </template>\n}\n\nexport { SimpleTable, type SimpleTableSignature };\nexport default SimpleTable;\n"],"names":["SimpleTable","Component","hasWrapper","args","styles","table","useStyles","size","layout","striped","isStriped","isScrollable","hasStickyHeader","isLoading","hasCustomLoading","loadingColor","selectionColor","class","classes","base","wrapperClassNames","wrapper","tableClassNames","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableHeader","SimpleTableBody","SimpleTableFooter","SimpleTableColumn","SimpleTableRow","SimpleTableCell"],"mappings":";;;;;;;;;;;;AAqEA,MAAMA,oBAAoBC,SAAA,CAAU;EAClC,IAAIC,UAAAA,GAAa;AACf,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,UAAU,IAAI,IAAA;AACjC,EAAA;EAEA,IAAIE,MAAAA,GAAS;IACX,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;AAClB,IAAA,OAAOD,KAAA,CAAM;AACXE,MAAAA,IAAA,EAAM,IAAI,CAACJ,IAAI,CAACI,IAAI;AACpBC,MAAAA,MAAA,EAAQ,IAAI,CAACL,IAAI,CAACK,MAAM;AACxBC,MAAAA,OAAA,EAAS,IAAI,CAACN,IAAI,CAACO,SAAS;AAC5BC,MAAAA,YAAA,EAAc,IAAI,CAACR,IAAI,CAACQ,YAAY,IAAI,KAAA;AACxCC,MAAAA,eAAA,EAAiB,KAAA;AACjBC,MAAAA,SAAA,EAAW,IAAI,CAACV,IAAI,CAACW,gBAAgB,GACjC,KAAA,GACA,IAAI,CAACX,IAAI,CAACU,SAAS,IAAI,KAAA;AAC3BE,MAAAA,YAAA,EAAc,IAAI,CAACZ,IAAI,CAACY,YAAY;AACpCC,MAAAA,cAAA,EAAgB,IAAI,CAACb,IAAI,CAACa,cAAc;AACxCC,MAAAA,KAAA,EAAO,IAAI,CAACd,IAAI,CAACe,OAAO,EAAEC;AAC5B,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,iBAAAA,GAAoB;AACtB,IAAA,OAAO,IAAI,CAAChB,MAAM,CAACiB,OAAO,CAAC;AACzBJ,MAAAA,KAAA,EAAO,IAAI,CAACd,IAAI,CAACe,OAAO,EAAEG;AAC5B,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,eAAAA,GAAkB;AACpB,IAAA,OAAO,IAAI,CAAClB,MAAM,CAACC,KAAK,CAAC;AAAEY,MAAAA,KAAA,EAAO,IAAI,CAACd,IAAI,CAACe,OAAO,EAAEb;AAAM,KAAA,CAAA;AAC7D,EAAA;AAEA,EAAA;IAAAkB,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/collections/simple-table/index.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport { SimpleTableHeader, type SimpleTableHeaderSignature } from './header';\nimport { SimpleTableBody, type SimpleTableBodySignature } from './body';\nimport { SimpleTableFooter, type SimpleTableFooterSignature } from './footer';\nimport { SimpleTableColumn, type SimpleTableColumnSignature } from './column';\nimport { SimpleTableRow, type SimpleTableRowSignature } from './row';\nimport { SimpleTableCell, type SimpleTableCellSignature } from './cell';\n\nimport type { TableVariants, TableSlots, SlotsToClasses } from '../table/types';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableSignature {\n Args: {\n /** Custom CSS classes for different table elements (wrapper, table, th, td, etc.) */\n classes?: SlotsToClasses<TableSlots>;\n /** Size variant for table cells and headers. @defaultValue 'md' */\n size?: TableVariants['size'];\n /** Table layout algorithm - 'auto' sizes columns by content, 'fixed' uses first row for sizing. @defaultValue 'auto' */\n layout?: TableVariants['layout'];\n /** Enable striped rows (alternating background colors) */\n isStriped?: TableVariants['striped'];\n /** Enable scrolling for the table container */\n isScrollable?: boolean;\n /** Whether to render the wrapper div. @defaultValue true */\n hasWrapper?: boolean;\n /** Enable loading state styling and behavior */\n isLoading?: boolean;\n /** Color variant for loading animation. @defaultValue 'default' */\n loadingColor?: TableVariants['loadingColor'];\n /** Color variant for selection highlight. @defaultValue 'primary' */\n selectionColor?: TableVariants['selectionColor'];\n /** Whether a custom loading block is provided (disables CSS loading indicator) */\n hasCustomLoading?: boolean;\n };\n Element: HTMLTableElement;\n Blocks: {\n default: [\n {\n Header: WithBoundArgs<\n ComponentLike<SimpleTableHeaderSignature>,\n 'styleFns' | 'classes'\n >;\n Body: WithBoundArgs<\n ComponentLike<SimpleTableBodySignature>,\n 'styleFns' | 'classes'\n >;\n Footer: WithBoundArgs<\n ComponentLike<SimpleTableFooterSignature>,\n 'styleFns' | 'classes'\n >;\n Column: WithBoundArgs<\n ComponentLike<SimpleTableColumnSignature>,\n 'styleFns'\n >;\n Row: WithBoundArgs<\n ComponentLike<SimpleTableRowSignature>,\n 'styleFns' | 'classes'\n >;\n Cell: WithBoundArgs<\n ComponentLike<SimpleTableCellSignature>,\n 'styleFns' | 'classes'\n >;\n }\n ];\n };\n}\n\nclass SimpleTable extends Component<SimpleTableSignature> {\n get hasWrapper() {\n return this.args.hasWrapper ?? true;\n }\n\n get styles() {\n const { table } = useStyles();\n return table({\n size: this.args.size,\n layout: this.args.layout,\n striped: this.args.isStriped,\n isScrollable: this.args.isScrollable || false,\n hasStickyHeader: false, // Will be determined by header component\n isLoading: this.args.hasCustomLoading\n ? false\n : this.args.isLoading || false,\n loadingColor: this.args.loadingColor,\n selectionColor: this.args.selectionColor,\n class: this.args.classes?.base\n });\n }\n\n get wrapperClassNames() {\n return this.styles.wrapper({\n class: this.args.classes?.wrapper\n });\n }\n\n get tableClassNames() {\n return this.styles.table({ class: this.args.classes?.table });\n }\n\n <template>\n {{#if this.hasWrapper}}\n <div class={{this.wrapperClassNames}} data-component=\"table-wrapper\">\n <table\n class={{this.tableClassNames}}\n data-test-id=\"table\"\n data-component=\"table\"\n data-loading={{if this.args.isLoading \"true\" \"false\"}}\n ...attributes\n >\n {{yield\n (hash\n Header=(component\n SimpleTableHeader styleFns=this.styles classes=this.args.classes\n )\n Body=(component\n SimpleTableBody styleFns=this.styles classes=this.args.classes\n )\n Footer=(component\n SimpleTableFooter styleFns=this.styles classes=this.args.classes\n )\n Column=(component SimpleTableColumn styleFns=this.styles)\n Row=(component\n SimpleTableRow styleFns=this.styles classes=this.args.classes\n )\n Cell=(component\n SimpleTableCell styleFns=this.styles classes=this.args.classes\n )\n )\n }}\n </table>\n </div>\n {{else}}\n <table\n class={{this.tableClassNames}}\n data-test-id=\"table\"\n data-component=\"table\"\n data-loading={{if this.args.isLoading \"true\" \"false\"}}\n ...attributes\n >\n {{yield\n (hash\n Header=(component\n SimpleTableHeader styleFns=this.styles classes=this.args.classes\n )\n Body=(component\n SimpleTableBody styleFns=this.styles classes=this.args.classes\n )\n Footer=(component\n SimpleTableFooter styleFns=this.styles classes=this.args.classes\n )\n Column=(component SimpleTableColumn styleFns=this.styles)\n Row=(component\n SimpleTableRow styleFns=this.styles classes=this.args.classes\n )\n Cell=(component\n SimpleTableCell styleFns=this.styles classes=this.args.classes\n )\n )\n }}\n </table>\n {{/if}}\n </template>\n}\n\nexport { SimpleTable, type SimpleTableSignature };\nexport default SimpleTable;\n"],"names":["SimpleTable","Component","hasWrapper","args","styles","table","useStyles","size","layout","striped","isStriped","isScrollable","hasStickyHeader","isLoading","hasCustomLoading","loadingColor","selectionColor","class","classes","base","wrapperClassNames","wrapper","tableClassNames","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableHeader","SimpleTableBody","SimpleTableFooter","SimpleTableColumn","SimpleTableRow","SimpleTableCell"],"mappings":";;;;;;;;;;;;AAqEA,MAAMA,oBAAoBC,SAAA,CAAU;EAClC,IAAIC,UAAAA,GAAa;AACf,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,UAAU,IAAI,IAAA;AACjC,EAAA;EAEA,IAAIE,MAAAA,GAAS;IACX,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;AAClB,IAAA,OAAOD,KAAA,CAAM;AACXE,MAAAA,IAAA,EAAM,IAAI,CAACJ,IAAI,CAACI,IAAI;AACpBC,MAAAA,MAAA,EAAQ,IAAI,CAACL,IAAI,CAACK,MAAM;AACxBC,MAAAA,OAAA,EAAS,IAAI,CAACN,IAAI,CAACO,SAAS;AAC5BC,MAAAA,YAAA,EAAc,IAAI,CAACR,IAAI,CAACQ,YAAY,IAAI,KAAA;AACxCC,MAAAA,eAAA,EAAiB,KAAA;AACjBC,MAAAA,SAAA,EAAW,IAAI,CAACV,IAAI,CAACW,gBAAgB,GACjC,KAAA,GACA,IAAI,CAACX,IAAI,CAACU,SAAS,IAAI,KAAA;AAC3BE,MAAAA,YAAA,EAAc,IAAI,CAACZ,IAAI,CAACY,YAAY;AACpCC,MAAAA,cAAA,EAAgB,IAAI,CAACb,IAAI,CAACa,cAAc;AACxCC,MAAAA,KAAA,EAAO,IAAI,CAACd,IAAI,CAACe,OAAO,EAAEC;AAC5B,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,iBAAAA,GAAoB;AACtB,IAAA,OAAO,IAAI,CAAChB,MAAM,CAACiB,OAAO,CAAC;AACzBJ,MAAAA,KAAA,EAAO,IAAI,CAACd,IAAI,CAACe,OAAO,EAAEG;AAC5B,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,eAAAA,GAAkB;AACpB,IAAA,OAAO,IAAI,CAAClB,MAAM,CAACC,KAAK,CAAC;AAAEY,MAAAA,KAAA,EAAO,IAAI,CAACd,IAAI,CAACe,OAAO,EAAEb;AAAM,KAAA,CAAA;AAC7D,EAAA;AAEA,EAAA;IAAAkB,oBAAA,CAAAC,kBAAA,CAAA,i7CAAA,EA8DA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;QAAAC,iBAAA;QAAAC,eAAA;QAAAC,iBAAA;QAAAC,iBAAA;QAAAC,cAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -19,7 +19,7 @@ class SimpleTableRow extends Component {
|
|
|
19
19
|
return this.styles.tr(options);
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
|
-
setComponentTemplate(precompileTemplate("
|
|
22
|
+
setComponentTemplate(precompileTemplate("<tr class={{this.classNames}} data-test-id=\"table-row\" data-component=\"table-row\" ...attributes>\n {{yield (hash Cell=(component SimpleTableCell styleFns=this.styles classes=@classes))}}\n</tr>", {
|
|
23
23
|
strictMode: true,
|
|
24
24
|
scope: () => ({
|
|
25
25
|
hash,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row.js","sources":["../../../../src/components/collections/simple-table/row.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableCell } from './cell';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\nimport type { WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableRowSignature {\n Args: {\n /** Additional CSS class to apply to the row */\n class?: string;\n /** Whether this row should be sticky during vertical scrolling */\n isSticky?: boolean;\n /** Whether the table has a sticky header (affects positioning of sticky rows) */\n hasStickyHeader?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableRowElement;\n Blocks: {\n default: [\n {\n Cell: WithBoundArgs<typeof SimpleTableCell, 'styleFns' | 'classes'>;\n }\n ];\n };\n}\n\nclass SimpleTableRow extends Component<SimpleTableRowSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky ? ('top' as const) : undefined,\n hasStickyHeader: this.args.hasStickyHeader || false,\n class: twMerge(this.args.class || '', this.args.classes?.tr || '')\n };\n\n return this.styles.tr(options);\n }\n\n <template>\n <tr\n class={{this.classNames}}\n data-test-id=\"table-row\"\n data-component=\"table-row\"\n ...attributes\n >\n {{yield\n (hash\n Cell=(component SimpleTableCell styleFns=this.styles classes=@classes)\n )\n }}\n </tr>\n </template>\n}\n\nexport { SimpleTableRow, type SimpleTableRowSignature };\nexport default SimpleTableRow;\n"],"names":["SimpleTableRow","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","hasStickyHeader","class","twMerge","classes","tr","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableCell"],"mappings":";;;;;;;AAoCA,MAAMA,uBAAuBC,SAAA,CAAU;EACrC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;MAChCC,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAAI,QAAkBE,SAAA;AACxDC,MAAAA,eAAA,EAAiB,IAAI,CAACT,IAAI,CAACS,eAAe,IAAI,KAAA;AAC9CC,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,CAACX,IAAI,CAACU,KAAK,IAAI,EAAA,EAAI,IAAI,CAACV,IAAI,CAACY,OAAO,EAAEC,EAAA,IAAM,EAAA;KACjE;AAEA,IAAA,OAAO,IAAI,CAACd,MAAM,CAACc,EAAE,CAACR,OAAA,CAAA;AACxB,EAAA;AAEA,EAAA;IAAAS,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"row.js","sources":["../../../../src/components/collections/simple-table/row.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles, twMerge } from '@frontile/theme';\nimport { SimpleTableCell } from './cell';\nimport type { SlotsToClasses, TableSlots } from '../table/types';\nimport type { WithBoundArgs } from '@glint/template';\n\ninterface SimpleTableRowSignature {\n Args: {\n /** Additional CSS class to apply to the row */\n class?: string;\n /** Whether this row should be sticky during vertical scrolling */\n isSticky?: boolean;\n /** Whether the table has a sticky header (affects positioning of sticky rows) */\n hasStickyHeader?: boolean;\n /**\n * @internal Style functions object from SimpleTable component\n * @ignore\n */\n styleFns?: ReturnType<ReturnType<typeof useStyles>['table']>;\n /**\n * @internal Classes object from SimpleTable component\n * @ignore\n */\n classes?: SlotsToClasses<TableSlots>;\n };\n Element: HTMLTableRowElement;\n Blocks: {\n default: [\n {\n Cell: WithBoundArgs<typeof SimpleTableCell, 'styleFns' | 'classes'>;\n }\n ];\n };\n}\n\nclass SimpleTableRow extends Component<SimpleTableRowSignature> {\n get styles() {\n return this.args.styleFns || useStyles().table();\n }\n\n get classNames() {\n const options = {\n isSticky: this.args.isSticky || false,\n stickyPosition: this.args.isSticky ? ('top' as const) : undefined,\n hasStickyHeader: this.args.hasStickyHeader || false,\n class: twMerge(this.args.class || '', this.args.classes?.tr || '')\n };\n\n return this.styles.tr(options);\n }\n\n <template>\n <tr\n class={{this.classNames}}\n data-test-id=\"table-row\"\n data-component=\"table-row\"\n ...attributes\n >\n {{yield\n (hash\n Cell=(component SimpleTableCell styleFns=this.styles classes=@classes)\n )\n }}\n </tr>\n </template>\n}\n\nexport { SimpleTableRow, type SimpleTableRowSignature };\nexport default SimpleTableRow;\n"],"names":["SimpleTableRow","Component","styles","args","styleFns","useStyles","table","classNames","options","isSticky","stickyPosition","undefined","hasStickyHeader","class","twMerge","classes","tr","setComponentTemplate","precompileTemplate","strictMode","scope","hash","SimpleTableCell"],"mappings":";;;;;;;AAoCA,MAAMA,uBAAuBC,SAAA,CAAU;EACrC,IAAIC,MAAAA,GAAS;AACX,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAIC,YAAYC,KAAK,EAAA;AAChD,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,MAAMC,OAAA,GAAU;AACdC,MAAAA,QAAA,EAAU,IAAI,CAACN,IAAI,CAACM,QAAQ,IAAI,KAAA;MAChCC,cAAA,EAAgB,IAAI,CAACP,IAAI,CAACM,QAAQ,GAAI,QAAkBE,SAAA;AACxDC,MAAAA,eAAA,EAAiB,IAAI,CAACT,IAAI,CAACS,eAAe,IAAI,KAAA;AAC9CC,MAAAA,KAAA,EAAOC,OAAA,CAAQ,IAAI,CAACX,IAAI,CAACU,KAAK,IAAI,EAAA,EAAI,IAAI,CAACV,IAAI,CAACY,OAAO,EAAEC,EAAA,IAAM,EAAA;KACjE;AAEA,IAAA,OAAO,IAAI,CAACd,MAAM,CAACc,EAAE,CAACR,OAAA,CAAA;AACxB,EAAA;AAEA,EAAA;IAAAS,oBAAA,CAAAC,kBAAA,CAAA,wMAAA,EAaA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -29,7 +29,7 @@ class CellDefaultComponent extends Component {
|
|
|
29
29
|
return !this.args.registry.isKeyClaimed(currentKey);
|
|
30
30
|
}
|
|
31
31
|
static {
|
|
32
|
-
setComponentTemplate(precompileTemplate("
|
|
32
|
+
setComponentTemplate(precompileTemplate("{{#if this.shouldRender}}\n {{yield}}\n{{/if}}", {
|
|
33
33
|
strictMode: true
|
|
34
34
|
}), this);
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-default.js","sources":["../../../../src/components/collections/table/cell-default.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport type { CellRenderingContext } from './cell-rendering-context';\nimport type { Column, Row } from './types';\n\ninterface CellDefaultSignature<T> {\n Args: {\n /**\n * The Column object for the current cell\n */\n column: Column<T>;\n\n /**\n * Registry to check for claimed keys\n */\n registry: CellRenderingContext;\n\n /**\n * Optional array of keys to exclude from default rendering\n * (alternative to using the registry system)\n */\n except?: string[];\n };\n\n Blocks: {\n default: [];\n };\n}\n\n/**\n * Default/fallback rendering component for table cells. Only renders its content\n * when no CellForComponent has claimed the current column key.\n *\n * Usage:\n * ```hbs\n * <c.Default>\n * Default: {{c.value}}\n * </c.Default>\n *\n * <!-- Or with explicit exclusions -->\n * <c.Default @except={{array \"status\" \"actions\"}}>\n * {{c.value}}\n * </c.Default>\n * ```\n */\nexport default class CellDefaultComponent<T> extends Component<\n CellDefaultSignature<T>\n> {\n get shouldRender(): boolean {\n const currentKey = this.args.column.key;\n\n // Check explicit exclusions first\n if (this.args.except?.includes(currentKey)) {\n return false;\n }\n\n // Check if any CellForComponent has claimed this key\n return !this.args.registry.isKeyClaimed(currentKey);\n }\n\n <template>\n {{#if this.shouldRender}}\n {{yield}}\n {{/if}}\n </template>\n}\n"],"names":["CellDefaultComponent","Component","shouldRender","currentKey","args","column","key","except","includes","registry","isKeyClaimed","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;AA4BA;;;;;;;;;;;;;;;AAeC;AACc,MAAMA,oBAAA,SAAgCC,UAC9B;EAErB,IAAIC,YAAAA,GAAwB;IAC1B,MAAMC,aAAa,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,GAAG;AAEvC;IACA,IAAI,IAAI,CAACF,IAAI,CAACG,MAAM,EAAEC,SAASL,UAAA,CAAA,EAAa;AAC1C,MAAA,OAAO,KAAA;AACT,IAAA;AAEA;IACA,OAAO,CAAC,IAAI,CAACC,IAAI,CAACK,QAAQ,CAACC,YAAY,CAACP,UAAA,CAAA;AAC1C,EAAA;AAEA,EAAA;IAAAQ,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"cell-default.js","sources":["../../../../src/components/collections/table/cell-default.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport type { CellRenderingContext } from './cell-rendering-context';\nimport type { Column, Row } from './types';\n\ninterface CellDefaultSignature<T> {\n Args: {\n /**\n * The Column object for the current cell\n */\n column: Column<T>;\n\n /**\n * Registry to check for claimed keys\n */\n registry: CellRenderingContext;\n\n /**\n * Optional array of keys to exclude from default rendering\n * (alternative to using the registry system)\n */\n except?: string[];\n };\n\n Blocks: {\n default: [];\n };\n}\n\n/**\n * Default/fallback rendering component for table cells. Only renders its content\n * when no CellForComponent has claimed the current column key.\n *\n * Usage:\n * ```hbs\n * <c.Default>\n * Default: {{c.value}}\n * </c.Default>\n *\n * <!-- Or with explicit exclusions -->\n * <c.Default @except={{array \"status\" \"actions\"}}>\n * {{c.value}}\n * </c.Default>\n * ```\n */\nexport default class CellDefaultComponent<T> extends Component<\n CellDefaultSignature<T>\n> {\n get shouldRender(): boolean {\n const currentKey = this.args.column.key;\n\n // Check explicit exclusions first\n if (this.args.except?.includes(currentKey)) {\n return false;\n }\n\n // Check if any CellForComponent has claimed this key\n return !this.args.registry.isKeyClaimed(currentKey);\n }\n\n <template>\n {{#if this.shouldRender}}\n {{yield}}\n {{/if}}\n </template>\n}\n"],"names":["CellDefaultComponent","Component","shouldRender","currentKey","args","column","key","except","includes","registry","isKeyClaimed","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;AA4BA;;;;;;;;;;;;;;;AAeC;AACc,MAAMA,oBAAA,SAAgCC,UAC9B;EAErB,IAAIC,YAAAA,GAAwB;IAC1B,MAAMC,aAAa,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,GAAG;AAEvC;IACA,IAAI,IAAI,CAACF,IAAI,CAACG,MAAM,EAAEC,SAASL,UAAA,CAAA,EAAa;AAC1C,MAAA,OAAO,KAAA;AACT,IAAA;AAEA;IACA,OAAO,CAAC,IAAI,CAACC,IAAI,CAACK,QAAQ,CAACC,YAAY,CAACP,UAAA,CAAA;AAC1C,EAAA;AAEA,EAAA;IAAAQ,oBAAA,CAAAC,kBAAA,CAAA,iDAAA,EAIA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -24,7 +24,7 @@ class CellForComponent extends Component {
|
|
|
24
24
|
return matches;
|
|
25
25
|
}
|
|
26
26
|
static {
|
|
27
|
-
setComponentTemplate(precompileTemplate("
|
|
27
|
+
setComponentTemplate(precompileTemplate("{{#if this.shouldRender}}\n {{yield}}\n{{/if}}", {
|
|
28
28
|
strictMode: true
|
|
29
29
|
}), this);
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-for.js","sources":["../../../../src/components/collections/table/cell-for.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport type { CellRenderingContext } from './cell-rendering-context';\nimport type { Column, Row, ColumnConfig, ColumnKeys } from './types';\n\ninterface CellForSignature<\n T,\n TColumns extends ColumnConfig<T>[] = ColumnConfig<T>[]\n> {\n Args: {\n /**\n * The column key to match against the current column.\n * When used with defineColumns(), this is type-checked against available column keys.\n */\n key: ColumnKeys<TColumns>;\n\n /**\n * The column object for the current cell\n */\n column: Column<T>;\n\n /**\n * Registry to track claimed keys\n */\n registry: CellRenderingContext;\n };\n\n Blocks: {\n default: [];\n };\n}\n\n/**\n * Conditional rendering component for table cells. Only renders its content\n * when the current column key matches the specified @key argument.\n *\n * Usage:\n * ```hbs\n * <c.For @key=\"status\">\n * <StatusBadge @status={{c.value}} />\n * </c.For>\n * ```\n */\nexport default class CellForComponent<\n T,\n TColumns extends ColumnConfig<T>[] = ColumnConfig<T>[]\n> extends Component<CellForSignature<T, TColumns>> {\n get shouldRender(): boolean {\n const matches = this.args.column.key === this.args.key;\n\n // If this component matches the current column, claim the key\n // so that CellDefaultComponent knows not to render\n if (matches) {\n this.args.registry.claimKey(this.args.key);\n }\n\n return matches;\n }\n\n <template>\n {{#if this.shouldRender}}\n {{yield}}\n {{/if}}\n </template>\n}\n"],"names":["CellForComponent","Component","shouldRender","matches","args","column","key","registry","claimKey","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;AA+BA;;;;;;;;;;;AAWe,MAAMA,gBAAA,SAGXC,SAAA,CAA8B;EACtC,IAAIC,YAAAA,GAAwB;AAC1B,IAAA,MAAMC,OAAA,GAAU,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,GAAG,KAAK,IAAI,CAACF,IAAI,CAACE,GAAG;AAEtD;AACA;AACA,IAAA,IAAIH,OAAA,EAAS;AACX,MAAA,IAAI,CAACC,IAAI,CAACG,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACJ,IAAI,CAACE,GAAG,CAAA;AAC3C,IAAA;AAEA,IAAA,OAAOH,OAAA;AACT,EAAA;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"cell-for.js","sources":["../../../../src/components/collections/table/cell-for.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport type { CellRenderingContext } from './cell-rendering-context';\nimport type { Column, Row, ColumnConfig, ColumnKeys } from './types';\n\ninterface CellForSignature<\n T,\n TColumns extends ColumnConfig<T>[] = ColumnConfig<T>[]\n> {\n Args: {\n /**\n * The column key to match against the current column.\n * When used with defineColumns(), this is type-checked against available column keys.\n */\n key: ColumnKeys<TColumns>;\n\n /**\n * The column object for the current cell\n */\n column: Column<T>;\n\n /**\n * Registry to track claimed keys\n */\n registry: CellRenderingContext;\n };\n\n Blocks: {\n default: [];\n };\n}\n\n/**\n * Conditional rendering component for table cells. Only renders its content\n * when the current column key matches the specified @key argument.\n *\n * Usage:\n * ```hbs\n * <c.For @key=\"status\">\n * <StatusBadge @status={{c.value}} />\n * </c.For>\n * ```\n */\nexport default class CellForComponent<\n T,\n TColumns extends ColumnConfig<T>[] = ColumnConfig<T>[]\n> extends Component<CellForSignature<T, TColumns>> {\n get shouldRender(): boolean {\n const matches = this.args.column.key === this.args.key;\n\n // If this component matches the current column, claim the key\n // so that CellDefaultComponent knows not to render\n if (matches) {\n this.args.registry.claimKey(this.args.key);\n }\n\n return matches;\n }\n\n <template>\n {{#if this.shouldRender}}\n {{yield}}\n {{/if}}\n </template>\n}\n"],"names":["CellForComponent","Component","shouldRender","matches","args","column","key","registry","claimKey","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;AA+BA;;;;;;;;;;;AAWe,MAAMA,gBAAA,SAGXC,SAAA,CAA8B;EACtC,IAAIC,YAAAA,GAAwB;AAC1B,IAAA,MAAMC,OAAA,GAAU,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,GAAG,KAAK,IAAI,CAACF,IAAI,CAACE,GAAG;AAEtD;AACA;AACA,IAAA,IAAIH,OAAA,EAAS;AACX,MAAA,IAAI,CAACC,IAAI,CAACG,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACJ,IAAI,CAACE,GAAG,CAAA;AAC3C,IAAA;AAEA,IAAA,OAAOH,OAAA;AACT,EAAA;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAAA,iDAAA,EAIA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -5,7 +5,7 @@ import { modifier } from 'ember-modifier';
|
|
|
5
5
|
import { useStyles } from '@frontile/theme';
|
|
6
6
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
7
|
import { setComponentTemplate } from '@ember/component';
|
|
8
|
-
import { a as decorateMethodV2 } from '../../../runtime-
|
|
8
|
+
import { a as decorateMethodV2 } from '../../../runtime--fcdnjmJ-BOdRhmsS.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal checkbox component for table selection.
|
|
@@ -40,7 +40,7 @@ class Checkbox extends Component {
|
|
|
40
40
|
element.indeterminate = !!indeterminate;
|
|
41
41
|
});
|
|
42
42
|
static {
|
|
43
|
-
setComponentTemplate(precompileTemplate("
|
|
43
|
+
setComponentTemplate(precompileTemplate("<input {{on \"change\" this.handleChange}} {{this.setIndeterminate @indeterminate}} type=\"checkbox\" checked={{this.isChecked}} disabled={{@disabled}} class={{this.classes.input class=@classes.input}} aria-label={{@ariaLabel}} aria-labelledby={{@ariaLabelledby}} aria-checked={{if @indeterminate \"mixed\" (if this.isChecked \"true\" \"false\")}} ...attributes />", {
|
|
44
44
|
strictMode: true,
|
|
45
45
|
scope: () => ({
|
|
46
46
|
on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../../../../src/components/collections/table/checkbox.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { modifier } from 'ember-modifier';\nimport {\n useStyles,\n type CheckboxVariants,\n type CheckboxSlots,\n type SlotsToClasses\n} from '@frontile/theme';\n\ninterface CheckboxSignature {\n Args: {\n checked?: boolean;\n indeterminate?: boolean;\n disabled?: boolean;\n onChange?: (checked: boolean, event: Event) => void;\n size?: CheckboxVariants['size'];\n classes?: SlotsToClasses<CheckboxSlots>;\n ariaLabel?: string;\n ariaLabelledby?: string;\n };\n Element: HTMLInputElement;\n}\n\n/**\n * Internal checkbox component for table selection.\n * Simplified version without FormControl wrapper.\n */\nclass Checkbox extends Component<CheckboxSignature> {\n get isChecked(): boolean {\n return !!this.args.checked;\n }\n\n @action handleChange(event: Event): void {\n if (this.args.disabled) {\n return;\n }\n\n const target = event.target as HTMLInputElement;\n const value = target.checked;\n\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value, event);\n }\n }\n\n get classes() {\n const { checkbox } = useStyles();\n return checkbox({\n size: this.args.size\n });\n }\n\n setIndeterminate = modifier(\n (element: HTMLInputElement, [indeterminate]: [boolean | undefined]) => {\n element.indeterminate = !!indeterminate;\n }\n );\n\n <template>\n <input\n {{on \"change\" this.handleChange}}\n {{this.setIndeterminate @indeterminate}}\n type=\"checkbox\"\n checked={{this.isChecked}}\n disabled={{@disabled}}\n class={{this.classes.input class=@classes.input}}\n aria-label={{@ariaLabel}}\n aria-labelledby={{@ariaLabelledby}}\n aria-checked={{if\n @indeterminate\n \"mixed\"\n (if this.isChecked \"true\" \"false\")\n }}\n ...attributes\n />\n </template>\n}\n\nexport { Checkbox, type CheckboxSignature };\nexport default Checkbox;\n"],"names":["Checkbox","Component","isChecked","args","checked","handleChange","event","disabled","target","value","onChange","n","prototype","action","classes","checkbox","useStyles","size","setIndeterminate","modifier","element","indeterminate","setComponentTemplate","precompileTemplate","strictMode","scope","on"],"mappings":";;;;;;;;;AAyBA;;;;AAIA,MAAMA,iBAAiBC,SAAA,CAAU;EAC/B,IAAIC,SAAAA,GAAqB;AACvB,IAAA,OAAO,CAAC,CAAC,IAAI,CAACC,IAAI,CAACC,OAAO;AAC5B,EAAA;EAEQC,YAAAA,CAAaC,KAAY,EAAQ;AACvC,IAAA,IAAI,IAAI,CAACH,IAAI,CAACI,QAAQ,EAAE;AACtB,MAAA;AACF,IAAA;AAEA,IAAA,MAAMC,MAAA,GAASF,KAAA,CAAME,MAAU;AAC/B,IAAA,MAAMC,KAAA,GAAQD,OAAOJ,OAAO;IAE5B,IAAI,OAAO,IAAI,CAACD,IAAI,CAACO,QAAQ,KAAK,UAAA,EAAY;MAC5C,IAAI,CAACP,IAAI,CAACO,QAAQ,CAACD,KAAA,EAAOH,KAAA,CAAA;AAC5B,IAAA;AACF,EAAA;AAAA,EAAA;IAAAK,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,cAAA,EAAA,CAXCC,MAAA,CAAA,CAAA;AAAA;EAaD,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAU,GAAGC,SAAA,EAAA;AACrB,IAAA,OAAOD,QAAA,CAAS;AACdE,MAAAA,IAAA,EAAM,IAAI,CAACd,IAAI,CAACc;AAClB,KAAA,CAAA;AACF,EAAA;EAEAC,gBAAA,GAAmBC,QAAA,CACjB,CAACC,OAAS,EAAkB,CAACC,aAAA,CAAqC,KAAA;AAChED,IAAAA,OAAA,CAAQC,aAAa,GAAG,CAAC,CAACA,aAAA;AAC5B,EAAA,CAAA,CAAA;AAGF,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../../src/components/collections/table/checkbox.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { modifier } from 'ember-modifier';\nimport {\n useStyles,\n type CheckboxVariants,\n type CheckboxSlots,\n type SlotsToClasses\n} from '@frontile/theme';\n\ninterface CheckboxSignature {\n Args: {\n checked?: boolean;\n indeterminate?: boolean;\n disabled?: boolean;\n onChange?: (checked: boolean, event: Event) => void;\n size?: CheckboxVariants['size'];\n classes?: SlotsToClasses<CheckboxSlots>;\n ariaLabel?: string;\n ariaLabelledby?: string;\n };\n Element: HTMLInputElement;\n}\n\n/**\n * Internal checkbox component for table selection.\n * Simplified version without FormControl wrapper.\n */\nclass Checkbox extends Component<CheckboxSignature> {\n get isChecked(): boolean {\n return !!this.args.checked;\n }\n\n @action handleChange(event: Event): void {\n if (this.args.disabled) {\n return;\n }\n\n const target = event.target as HTMLInputElement;\n const value = target.checked;\n\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value, event);\n }\n }\n\n get classes() {\n const { checkbox } = useStyles();\n return checkbox({\n size: this.args.size\n });\n }\n\n setIndeterminate = modifier(\n (element: HTMLInputElement, [indeterminate]: [boolean | undefined]) => {\n element.indeterminate = !!indeterminate;\n }\n );\n\n <template>\n <input\n {{on \"change\" this.handleChange}}\n {{this.setIndeterminate @indeterminate}}\n type=\"checkbox\"\n checked={{this.isChecked}}\n disabled={{@disabled}}\n class={{this.classes.input class=@classes.input}}\n aria-label={{@ariaLabel}}\n aria-labelledby={{@ariaLabelledby}}\n aria-checked={{if\n @indeterminate\n \"mixed\"\n (if this.isChecked \"true\" \"false\")\n }}\n ...attributes\n />\n </template>\n}\n\nexport { Checkbox, type CheckboxSignature };\nexport default Checkbox;\n"],"names":["Checkbox","Component","isChecked","args","checked","handleChange","event","disabled","target","value","onChange","n","prototype","action","classes","checkbox","useStyles","size","setIndeterminate","modifier","element","indeterminate","setComponentTemplate","precompileTemplate","strictMode","scope","on"],"mappings":";;;;;;;;;AAyBA;;;;AAIA,MAAMA,iBAAiBC,SAAA,CAAU;EAC/B,IAAIC,SAAAA,GAAqB;AACvB,IAAA,OAAO,CAAC,CAAC,IAAI,CAACC,IAAI,CAACC,OAAO;AAC5B,EAAA;EAEQC,YAAAA,CAAaC,KAAY,EAAQ;AACvC,IAAA,IAAI,IAAI,CAACH,IAAI,CAACI,QAAQ,EAAE;AACtB,MAAA;AACF,IAAA;AAEA,IAAA,MAAMC,MAAA,GAASF,KAAA,CAAME,MAAU;AAC/B,IAAA,MAAMC,KAAA,GAAQD,OAAOJ,OAAO;IAE5B,IAAI,OAAO,IAAI,CAACD,IAAI,CAACO,QAAQ,KAAK,UAAA,EAAY;MAC5C,IAAI,CAACP,IAAI,CAACO,QAAQ,CAACD,KAAA,EAAOH,KAAA,CAAA;AAC5B,IAAA;AACF,EAAA;AAAA,EAAA;IAAAK,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,cAAA,EAAA,CAXCC,MAAA,CAAA,CAAA;AAAA;EAaD,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAU,GAAGC,SAAA,EAAA;AACrB,IAAA,OAAOD,QAAA,CAAS;AACdE,MAAAA,IAAA,EAAM,IAAI,CAACd,IAAI,CAACc;AAClB,KAAA,CAAA;AACF,EAAA;EAEAC,gBAAA,GAAmBC,QAAA,CACjB,CAACC,OAAS,EAAkB,CAACC,aAAA,CAAqC,KAAA;AAChED,IAAAA,OAAA,CAAQC,aAAa,GAAG,CAAC,CAACA,aAAA;AAC5B,EAAA,CAAA,CAAA;AAGF,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,8WAAA,EAiBA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -6,7 +6,7 @@ import { isVisible, show, hide } from '@universal-ember/table/plugins/column-vis
|
|
|
6
6
|
import { ColumnVisibilityIcon } from './icons.js';
|
|
7
7
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
8
8
|
import { setComponentTemplate } from '@ember/component';
|
|
9
|
-
import { a as decorateMethodV2 } from '../../../runtime-
|
|
9
|
+
import { a as decorateMethodV2 } from '../../../runtime--fcdnjmJ-BOdRhmsS.js';
|
|
10
10
|
|
|
11
11
|
class ColumnVisibility extends Component {
|
|
12
12
|
get styles() {
|
|
@@ -44,7 +44,7 @@ class ColumnVisibility extends Component {
|
|
|
44
44
|
decorateMethodV2(this.prototype, "handleSelectionChange", [action]);
|
|
45
45
|
}
|
|
46
46
|
static {
|
|
47
|
-
setComponentTemplate(precompileTemplate("
|
|
47
|
+
setComponentTemplate(precompileTemplate("<Dropdown @closeOnItemSelect={{false}} ...attributes>\n <:default as |d|>\n <d.Trigger @intent=\"default\" @size={{this.size}} @class={{(this.styles.columnVisibilityButton)}}>\n\n {{#if (has-block \"icon\")}}\n {{yield to=\"icon\"}}\n {{else}}\n <ColumnVisibilityIcon class={{(this.styles.columnVisibilityIcon)}} />\n {{/if}}\n {{yield}}\n </d.Trigger>\n\n <d.Menu @selectionMode=\"multiple\" @selectedKeys={{this.selectedKeys}} @onSelectionChange={{this.handleSelectionChange}} as |Item|>\n {{#each @tableInstance.columns as |column|}}\n <Item @key={{column.key}}>\n {{column.name}}\n </Item>\n {{/each}}\n </d.Menu>\n </:default>\n</Dropdown>", {
|
|
48
48
|
strictMode: true,
|
|
49
49
|
scope: () => ({
|
|
50
50
|
Dropdown,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-visibility.js","sources":["../../../../src/components/collections/table/column-visibility.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { useStyles } from '@frontile/theme';\nimport { Dropdown } from '../dropdown';\nimport {\n hide,\n show,\n isVisible\n} from '@universal-ember/table/plugins/column-visibility';\nimport { ColumnVisibilityIcon } from './icons';\nimport type { Table, Column } from './types';\n\ninterface ColumnVisibilitySignature<T> {\n Args: {\n /** Universal-ember table instance */\n tableInstance?: Table<T>;\n /** Size of the column visibility button. @defaultValue 'xs' */\n size?: 'xs' | 'sm' | 'lg' | 'xl';\n };\n Element: HTMLUListElement;\n Blocks: {\n default: [];\n icon: [];\n };\n}\n\nexport default class ColumnVisibility<T> extends Component<\n ColumnVisibilitySignature<T>\n> {\n get styles() {\n const { table } = useStyles();\n return table();\n }\n\n get size() {\n return this.args.size ?? 'xs';\n }\n\n get columns() {\n return this.args.tableInstance?.columns.values() || [];\n }\n\n get selectedKeys() {\n return this.columns\n .filter((column: Column<T>) => isVisible(column))\n .map((column: Column<T>) => column.key);\n }\n\n get allColumnKeys() {\n return this.columns.map((column: Column<T>) => column.key);\n }\n\n @action\n handleSelectionChange(selectedKeys: string[]) {\n this.columns.forEach((column: Column<T>) => {\n if (selectedKeys.includes(column.key)) {\n if (!isVisible(column)) {\n show(column);\n }\n } else {\n if (isVisible(column)) {\n hide(column);\n }\n }\n });\n }\n\n <template>\n <Dropdown @closeOnItemSelect={{false}} ...attributes>\n <:default as |d|>\n <d.Trigger\n @intent=\"default\"\n @size={{this.size}}\n @class={{(this.styles.columnVisibilityButton)}}\n >\n\n {{#if (has-block \"icon\")}}\n {{yield to=\"icon\"}}\n {{else}}\n <ColumnVisibilityIcon\n class={{(this.styles.columnVisibilityIcon)}}\n />\n {{/if}}\n {{yield}}\n </d.Trigger>\n\n <d.Menu\n @selectionMode=\"multiple\"\n @selectedKeys={{this.selectedKeys}}\n @onSelectionChange={{this.handleSelectionChange}}\n as |Item|\n >\n {{#each @tableInstance.columns as |column|}}\n <Item @key={{column.key}}>\n {{column.name}}\n </Item>\n {{/each}}\n </d.Menu>\n </:default>\n </Dropdown>\n </template>\n}\n"],"names":["ColumnVisibility","Component","styles","table","useStyles","size","args","columns","tableInstance","values","selectedKeys","filter","column","isVisible","map","key","allColumnKeys","handleSelectionChange","forEach","includes","show","hide","n","prototype","action","setComponentTemplate","precompileTemplate","strictMode","scope","Dropdown","ColumnVisibilityIcon"],"mappings":";;;;;;;;;;AA0Be,MAAMA,gBAAA,SAA4BC,SAAA,CACrB;EAE1B,IAAIC,MAAAA,GAAS;IACX,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;IAClB,OAAOD,KAAA,EAAA;AACT,EAAA;EAEA,IAAIE,IAAAA,GAAO;AACT,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,IAAI,IAAI,IAAA;AAC3B,EAAA;EAEA,IAAIE,OAAAA,GAAU;AACZ,IAAA,OAAO,IAAI,CAACD,IAAI,CAACE,aAAa,EAAED,OAAA,CAAQE,YAAY,EAAE;AACxD,EAAA;EAEA,IAAIC,YAAAA,GAAe;IACjB,OAAO,IAAI,CAACH,OAAO,CAChBI,MAAM,CAAEC,UAAsBC,SAAA,CAAUD,MAAA,CAAA,CAAA,CACxCE,GAAG,CAAEF,MAAe,IAAOA,OAAOG,GAAG,CAAA;AAC1C,EAAA;EAEA,IAAIC,aAAAA,GAAgB;IAClB,OAAO,IAAI,CAACT,OAAO,CAACO,GAAG,CAAEF,MAAe,IAAOA,MAAA,CAAOG,GAAG,CAAA;AAC3D,EAAA;EAGAE,qBAAAA,CAAsBP,YAAsB,EAAE;AAC5C,IAAA,IAAI,CAACH,OAAO,CAACW,OAAO,CAAEN,MAAe,IAAA;MACnC,IAAIF,YAAA,CAAaS,QAAQ,CAACP,MAAA,CAAOG,GAAG,CAAA,EAAG;AACrC,QAAA,IAAI,CAACF,UAAUD,MAAA,CAAA,EAAS;UACtBQ,IAAA,CAAKR,MAAA,CAAA;AACP,QAAA;AACF,MAAA,CAAA,MAAO;AACL,QAAA,IAAIC,UAAUD,MAAA,CAAA,EAAS;UACrBS,IAAA,CAAKT,MAAA,CAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA,CAAA,CAAA;AACF,EAAA;AAAA,EAAA;IAAAU,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,uBAAA,EAAA,CAbCC,MAAA,CAAA,CAAA;AAAA;AAeD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"column-visibility.js","sources":["../../../../src/components/collections/table/column-visibility.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { useStyles } from '@frontile/theme';\nimport { Dropdown } from '../dropdown';\nimport {\n hide,\n show,\n isVisible\n} from '@universal-ember/table/plugins/column-visibility';\nimport { ColumnVisibilityIcon } from './icons';\nimport type { Table, Column } from './types';\n\ninterface ColumnVisibilitySignature<T> {\n Args: {\n /** Universal-ember table instance */\n tableInstance?: Table<T>;\n /** Size of the column visibility button. @defaultValue 'xs' */\n size?: 'xs' | 'sm' | 'lg' | 'xl';\n };\n Element: HTMLUListElement;\n Blocks: {\n default: [];\n icon: [];\n };\n}\n\nexport default class ColumnVisibility<T> extends Component<\n ColumnVisibilitySignature<T>\n> {\n get styles() {\n const { table } = useStyles();\n return table();\n }\n\n get size() {\n return this.args.size ?? 'xs';\n }\n\n get columns() {\n return this.args.tableInstance?.columns.values() || [];\n }\n\n get selectedKeys() {\n return this.columns\n .filter((column: Column<T>) => isVisible(column))\n .map((column: Column<T>) => column.key);\n }\n\n get allColumnKeys() {\n return this.columns.map((column: Column<T>) => column.key);\n }\n\n @action\n handleSelectionChange(selectedKeys: string[]) {\n this.columns.forEach((column: Column<T>) => {\n if (selectedKeys.includes(column.key)) {\n if (!isVisible(column)) {\n show(column);\n }\n } else {\n if (isVisible(column)) {\n hide(column);\n }\n }\n });\n }\n\n <template>\n <Dropdown @closeOnItemSelect={{false}} ...attributes>\n <:default as |d|>\n <d.Trigger\n @intent=\"default\"\n @size={{this.size}}\n @class={{(this.styles.columnVisibilityButton)}}\n >\n\n {{#if (has-block \"icon\")}}\n {{yield to=\"icon\"}}\n {{else}}\n <ColumnVisibilityIcon\n class={{(this.styles.columnVisibilityIcon)}}\n />\n {{/if}}\n {{yield}}\n </d.Trigger>\n\n <d.Menu\n @selectionMode=\"multiple\"\n @selectedKeys={{this.selectedKeys}}\n @onSelectionChange={{this.handleSelectionChange}}\n as |Item|\n >\n {{#each @tableInstance.columns as |column|}}\n <Item @key={{column.key}}>\n {{column.name}}\n </Item>\n {{/each}}\n </d.Menu>\n </:default>\n </Dropdown>\n </template>\n}\n"],"names":["ColumnVisibility","Component","styles","table","useStyles","size","args","columns","tableInstance","values","selectedKeys","filter","column","isVisible","map","key","allColumnKeys","handleSelectionChange","forEach","includes","show","hide","n","prototype","action","setComponentTemplate","precompileTemplate","strictMode","scope","Dropdown","ColumnVisibilityIcon"],"mappings":";;;;;;;;;;AA0Be,MAAMA,gBAAA,SAA4BC,SAAA,CACrB;EAE1B,IAAIC,MAAAA,GAAS;IACX,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;IAClB,OAAOD,KAAA,EAAA;AACT,EAAA;EAEA,IAAIE,IAAAA,GAAO;AACT,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,IAAI,IAAI,IAAA;AAC3B,EAAA;EAEA,IAAIE,OAAAA,GAAU;AACZ,IAAA,OAAO,IAAI,CAACD,IAAI,CAACE,aAAa,EAAED,OAAA,CAAQE,YAAY,EAAE;AACxD,EAAA;EAEA,IAAIC,YAAAA,GAAe;IACjB,OAAO,IAAI,CAACH,OAAO,CAChBI,MAAM,CAAEC,UAAsBC,SAAA,CAAUD,MAAA,CAAA,CAAA,CACxCE,GAAG,CAAEF,MAAe,IAAOA,OAAOG,GAAG,CAAA;AAC1C,EAAA;EAEA,IAAIC,aAAAA,GAAgB;IAClB,OAAO,IAAI,CAACT,OAAO,CAACO,GAAG,CAAEF,MAAe,IAAOA,MAAA,CAAOG,GAAG,CAAA;AAC3D,EAAA;EAGAE,qBAAAA,CAAsBP,YAAsB,EAAE;AAC5C,IAAA,IAAI,CAACH,OAAO,CAACW,OAAO,CAAEN,MAAe,IAAA;MACnC,IAAIF,YAAA,CAAaS,QAAQ,CAACP,MAAA,CAAOG,GAAG,CAAA,EAAG;AACrC,QAAA,IAAI,CAACF,UAAUD,MAAA,CAAA,EAAS;UACtBQ,IAAA,CAAKR,MAAA,CAAA;AACP,QAAA;AACF,MAAA,CAAA,MAAO;AACL,QAAA,IAAIC,UAAUD,MAAA,CAAA,EAAS;UACrBS,IAAA,CAAKT,MAAA,CAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA,CAAA,CAAA;AACF,EAAA;AAAA,EAAA;IAAAU,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,uBAAA,EAAA,CAbCC,MAAA,CAAA,CAAA;AAAA;AAeD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,utBAAA,EAiCA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,QAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -5,13 +5,13 @@ import templateOnly from '@ember/component/template-only';
|
|
|
5
5
|
/**
|
|
6
6
|
* Icon components used in the table component
|
|
7
7
|
*/
|
|
8
|
-
const ChevronUpIcon = setComponentTemplate(precompileTemplate("
|
|
8
|
+
const ChevronUpIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m4.5 15.75 7.5-7.5 7.5 7.5\" />\n</svg>", {
|
|
9
9
|
strictMode: true
|
|
10
10
|
}), templateOnly());
|
|
11
|
-
const ChevronDownIcon = setComponentTemplate(precompileTemplate("
|
|
11
|
+
const ChevronDownIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m19.5 8.25-7.5 7.5-7.5-7.5\" />\n</svg>", {
|
|
12
12
|
strictMode: true
|
|
13
13
|
}), templateOnly());
|
|
14
|
-
const ColumnVisibilityIcon = setComponentTemplate(precompileTemplate("
|
|
14
|
+
const ColumnVisibilityIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\" />\n</svg>", {
|
|
15
15
|
strictMode: true
|
|
16
16
|
}), templateOnly());
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sources":["../../../../src/components/collections/table/icons.gts"],"sourcesContent":["/**\n * Icon components used in the table component\n */\nimport type { TOC } from '@ember/component/template-only';\n\ninterface IconSignature {\n Element: SVGElement;\n}\n\nexport const ChevronUpIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDownIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ColumnVisibilityIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\"\n />\n </svg>\n</template>;\n"],"names":["ChevronUpIcon","setComponentTemplate","precompileTemplate","strictMode","templateOnly","ChevronDownIcon","ColumnVisibilityIcon"],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"icons.js","sources":["../../../../src/components/collections/table/icons.gts"],"sourcesContent":["/**\n * Icon components used in the table component\n */\nimport type { TOC } from '@ember/component/template-only';\n\ninterface IconSignature {\n Element: SVGElement;\n}\n\nexport const ChevronUpIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDownIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ColumnVisibilityIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\"\n />\n </svg>\n</template>;\n"],"names":["ChevronUpIcon","setComponentTemplate","precompileTemplate","strictMode","templateOnly","ChevronDownIcon","ColumnVisibilityIcon"],"mappings":";;;;AAAA;;;MASaA,aAAmB,GAAAC,oBAAA,CAAiBC,kBAAA,CAAA,mPAAA,EAejD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGC,eAAqB,GAAAJ,oBAAA,CAAiBC,kBAAA,CAAA,mPAAA,EAenD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGE,oBAA0B,GAAAL,oBAAA,CAAiBC,kBAAA,CAAA,gYAAA,EAexD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { useStyles } from '@frontile/theme';
|
|
3
|
-
import
|
|
3
|
+
import press from '../../../modifiers/press.js';
|
|
4
4
|
import { ChevronDownIcon, ChevronUpIcon } from './icons.js';
|
|
5
5
|
import { SortDirection } from '@universal-ember/table/plugins/data-sorting';
|
|
6
6
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
@@ -17,7 +17,7 @@ class SortButton extends Component {
|
|
|
17
17
|
return this.args.sortDirection === SortDirection.Ascending;
|
|
18
18
|
}
|
|
19
19
|
static {
|
|
20
|
-
setComponentTemplate(precompileTemplate("
|
|
20
|
+
setComponentTemplate(precompileTemplate("<button type=\"button\" class=\"{{(this.styles.sortButton)}}\" data-sort-direction={{@sortDirection}} data-sorted=\"{{@isSorted}}\" {{press @onSort}} ...attributes>\n <span>\n {{@column.name}}\n </span>\n {{#if this.showUpIcon}}\n <ChevronUpIcon class={{(this.styles.sortIcon)}} data-sorted=\"{{@isSorted}}\" aria-hidden=\"true\" />\n {{else}}\n <ChevronDownIcon class={{(this.styles.sortIcon)}} data-sorted=\"{{@isSorted}}\" aria-hidden=\"true\" />\n {{/if}}\n</button>", {
|
|
21
21
|
strictMode: true,
|
|
22
22
|
scope: () => ({
|
|
23
23
|
press,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort-button.js","sources":["../../../../src/components/collections/table/sort-button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { press } from '../../../modifiers/press';\nimport { ChevronUpIcon, ChevronDownIcon } from './icons';\nimport { SortDirection } from './types';\nimport type { Column } from './types';\n\ninterface SortButtonSignature<T> {\n Args: {\n /** The column to render the sort button for */\n column: Column<T>;\n /** Current sort direction for this column */\n sortDirection: SortDirection;\n /** Whether this column is currently sorted */\n isSorted: boolean;\n /** Click handler for sorting */\n onSort: () => void;\n };\n Element: HTMLButtonElement;\n}\n\nexport default class SortButton<T> extends Component<SortButtonSignature<T>> {\n get styles() {\n const { table } = useStyles();\n return table();\n }\n\n get showUpIcon() {\n return this.args.sortDirection === SortDirection.Ascending;\n }\n\n <template>\n <button\n type=\"button\"\n class=\"{{(this.styles.sortButton)}}\"\n data-sort-direction={{@sortDirection}}\n data-sorted=\"{{@isSorted}}\"\n {{press @onSort}}\n ...attributes\n >\n <span>\n {{@column.name}}\n </span>\n {{#if this.showUpIcon}}\n <ChevronUpIcon\n class={{(this.styles.sortIcon)}}\n data-sorted=\"{{@isSorted}}\"\n aria-hidden=\"true\"\n />\n {{else}}\n <ChevronDownIcon\n class={{(this.styles.sortIcon)}}\n data-sorted=\"{{@isSorted}}\"\n aria-hidden=\"true\"\n />\n {{/if}}\n </button>\n </template>\n}\n"],"names":["SortButton","Component","styles","table","useStyles","showUpIcon","args","sortDirection","SortDirection","Ascending","setComponentTemplate","precompileTemplate","strictMode","scope","press","ChevronUpIcon","ChevronDownIcon"],"mappings":";;;;;;;;AAqBe,MAAMA,UAAA,SAAsBC,SAAA,CAA8B;EACvE,IAAIC,MAAAA,GAAS;IACX,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;IAClB,OAAOD,KAAA,EAAA;AACT,EAAA;EAEA,IAAIE,UAAAA,GAAa;IACf,OAAO,IAAI,CAACC,IAAI,CAACC,aAAa,KAAKC,cAAcC,SAAS;AAC5D,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"sort-button.js","sources":["../../../../src/components/collections/table/sort-button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { press } from '../../../modifiers/press';\nimport { ChevronUpIcon, ChevronDownIcon } from './icons';\nimport { SortDirection } from './types';\nimport type { Column } from './types';\n\ninterface SortButtonSignature<T> {\n Args: {\n /** The column to render the sort button for */\n column: Column<T>;\n /** Current sort direction for this column */\n sortDirection: SortDirection;\n /** Whether this column is currently sorted */\n isSorted: boolean;\n /** Click handler for sorting */\n onSort: () => void;\n };\n Element: HTMLButtonElement;\n}\n\nexport default class SortButton<T> extends Component<SortButtonSignature<T>> {\n get styles() {\n const { table } = useStyles();\n return table();\n }\n\n get showUpIcon() {\n return this.args.sortDirection === SortDirection.Ascending;\n }\n\n <template>\n <button\n type=\"button\"\n class=\"{{(this.styles.sortButton)}}\"\n data-sort-direction={{@sortDirection}}\n data-sorted=\"{{@isSorted}}\"\n {{press @onSort}}\n ...attributes\n >\n <span>\n {{@column.name}}\n </span>\n {{#if this.showUpIcon}}\n <ChevronUpIcon\n class={{(this.styles.sortIcon)}}\n data-sorted=\"{{@isSorted}}\"\n aria-hidden=\"true\"\n />\n {{else}}\n <ChevronDownIcon\n class={{(this.styles.sortIcon)}}\n data-sorted=\"{{@isSorted}}\"\n aria-hidden=\"true\"\n />\n {{/if}}\n </button>\n </template>\n}\n"],"names":["SortButton","Component","styles","table","useStyles","showUpIcon","args","sortDirection","SortDirection","Ascending","setComponentTemplate","precompileTemplate","strictMode","scope","press","ChevronUpIcon","ChevronDownIcon"],"mappings":";;;;;;;;AAqBe,MAAMA,UAAA,SAAsBC,SAAA,CAA8B;EACvE,IAAIC,MAAAA,GAAS;IACX,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;IAClB,OAAOD,KAAA,EAAA;AACT,EAAA;EAEA,IAAIE,UAAAA,GAAa;IACf,OAAO,IAAI,CAACC,IAAI,CAACC,aAAa,KAAKC,cAAcC,SAAS;AAC5D,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,seAAA,EA0BA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,KAAA;QAAAC,aAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|