igniteui-webcomponents 4.6.0 → 4.7.0
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/CHANGELOG.md +16 -0
- package/animations/player.js.map +1 -1
- package/components/accordion/accordion.js.map +1 -1
- package/components/avatar/avatar.d.ts +4 -3
- package/components/avatar/avatar.js +20 -24
- package/components/avatar/avatar.js.map +1 -1
- package/components/avatar/themes/themes.js +8 -9
- package/components/avatar/themes/themes.js.map +1 -1
- package/components/badge/badge.d.ts +4 -1
- package/components/badge/badge.js +15 -5
- package/components/badge/badge.js.map +1 -1
- package/components/badge/themes/themes.js +8 -9
- package/components/badge/themes/themes.js.map +1 -1
- package/components/button/button-base.d.ts +5 -6
- package/components/button/button-base.js +13 -26
- package/components/button/button-base.js.map +1 -1
- package/components/button/button.d.ts +2 -8
- package/components/button/button.js +6 -14
- package/components/button/button.js.map +1 -1
- package/components/button/icon-button.d.ts +1 -1
- package/components/button/icon-button.js +2 -1
- package/components/button/icon-button.js.map +1 -1
- package/components/button/themes/button/themes.js +8 -9
- package/components/button/themes/button/themes.js.map +1 -1
- package/components/button/themes/icon-button/themes.js +8 -9
- package/components/button/themes/icon-button/themes.js.map +1 -1
- package/components/button-group/button-group.d.ts +1 -1
- package/components/button-group/button-group.js +2 -1
- package/components/button-group/button-group.js.map +1 -1
- package/components/button-group/themes/button.js +6 -13
- package/components/button-group/themes/button.js.map +1 -1
- package/components/button-group/themes/group.js +8 -9
- package/components/button-group/themes/group.js.map +1 -1
- package/components/button-group/toggle-button.d.ts +2 -2
- package/components/button-group/toggle-button.js +7 -13
- package/components/button-group/toggle-button.js.map +1 -1
- package/components/calendar/calendar.d.ts +1 -1
- package/components/calendar/calendar.js +2 -1
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/common/calendar-base.js.map +1 -1
- package/components/calendar/common/calendar.model.js.map +1 -1
- package/components/calendar/common/utils.js.map +1 -1
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/months-view/months-view.js.map +1 -1
- package/components/calendar/themes/calendar.js +8 -9
- package/components/calendar/themes/calendar.js.map +1 -1
- package/components/calendar/years-view/years-view.js.map +1 -1
- package/components/card/card.content.d.ts +1 -1
- package/components/card/card.content.js +2 -1
- package/components/card/card.content.js.map +1 -1
- package/components/card/card.d.ts +1 -1
- package/components/card/card.header.d.ts +1 -1
- package/components/card/card.header.js +2 -1
- package/components/card/card.header.js.map +1 -1
- package/components/card/card.js +2 -1
- package/components/card/card.js.map +1 -1
- package/components/card/themes/container.js +8 -9
- package/components/card/themes/container.js.map +1 -1
- package/components/card/themes/content.js +8 -9
- package/components/card/themes/content.js.map +1 -1
- package/components/card/themes/header.js +8 -9
- package/components/card/themes/header.js.map +1 -1
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/chip/chip.d.ts +1 -1
- package/components/chip/chip.js +2 -1
- package/components/chip/chip.js.map +1 -1
- package/components/chip/themes/themes.js +8 -9
- package/components/chip/themes/themes.js.map +1 -1
- package/components/combo/combo-item.d.ts +2 -0
- package/components/combo/combo-item.js +10 -11
- package/components/combo/combo-item.js.map +1 -1
- package/components/combo/combo-list.d.ts +0 -1
- package/components/combo/combo-list.js +0 -6
- package/components/combo/combo-list.js.map +1 -1
- package/components/combo/combo.d.ts +4 -5
- package/components/combo/combo.js +51 -39
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/navigation.js.map +1 -1
- package/components/combo/controllers/selection.js.map +1 -1
- package/components/combo/operations/group.d.ts +2 -2
- package/components/combo/operations/group.js +13 -26
- package/components/combo/operations/group.js.map +1 -1
- package/components/combo/themes/dark/combo.bootstrap.css.js +1 -1
- package/components/combo/themes/dark/combo.bootstrap.css.js.map +1 -1
- package/components/combo/themes/dark/combo.fluent.css.js +1 -1
- package/components/combo/themes/dark/combo.fluent.css.js.map +1 -1
- package/components/combo/themes/light/combo.bootstrap.css.js +1 -1
- package/components/combo/themes/light/combo.bootstrap.css.js.map +1 -1
- package/components/combo/themes/light/combo.fluent.css.js +1 -1
- package/components/combo/themes/light/combo.fluent.css.js.map +1 -1
- package/components/common/controllers/key-bindings.js.map +1 -1
- package/components/common/controllers/root-click.d.ts +1 -1
- package/components/common/controllers/root-click.js.map +1 -1
- package/components/common/controllers/root-scroll.js.map +1 -1
- package/components/common/decorators/watch.js.map +1 -1
- package/components/common/definitions/defineComponents.js.map +1 -1
- package/components/common/definitions/register.js.map +1 -1
- package/components/common/mixins/alert.js.map +1 -1
- package/components/common/mixins/combo-box.js.map +1 -1
- package/components/common/mixins/form-associated.js.map +1 -1
- package/components/common/util.js.map +1 -1
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/date-util.js.map +1 -1
- package/components/dialog/dialog.js +2 -1
- package/components/dialog/dialog.js.map +1 -1
- package/components/dialog/themes/themes.js +8 -9
- package/components/dialog/themes/themes.js.map +1 -1
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/dropdown/themes/dark/dropdown.bootstrap.css.js +1 -1
- package/components/dropdown/themes/dark/dropdown.bootstrap.css.js.map +1 -1
- package/components/dropdown/themes/dark/dropdown.fluent.css.js +1 -1
- package/components/dropdown/themes/dark/dropdown.fluent.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown.bootstrap.css.js +1 -1
- package/components/dropdown/themes/light/dropdown.bootstrap.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown.fluent.css.js +1 -1
- package/components/dropdown/themes/light/dropdown.fluent.css.js.map +1 -1
- package/components/dropdown/themes/shared/item/dropdown-item.fluent.css.js +1 -1
- package/components/dropdown/themes/shared/item/dropdown-item.fluent.css.js.map +1 -1
- package/components/expansion-panel/expansion-panel.d.ts +1 -1
- package/components/expansion-panel/expansion-panel.js +2 -1
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/expansion-panel/themes/themes.js +8 -9
- package/components/expansion-panel/themes/themes.js.map +1 -1
- package/components/form/form.js.map +1 -1
- package/components/icon/icon.d.ts +2 -2
- package/components/icon/icon.js +6 -7
- package/components/icon/icon.js.map +1 -1
- package/components/icon/icon.registry.js.map +1 -1
- package/components/icon/themes/themes.js +8 -9
- package/components/icon/themes/themes.js.map +1 -1
- package/components/input/input-base.js +0 -4
- package/components/input/input-base.js.map +1 -1
- package/components/list/list-header.d.ts +1 -1
- package/components/list/list-header.js +2 -1
- package/components/list/list-header.js.map +1 -1
- package/components/list/list-item.d.ts +1 -1
- package/components/list/list-item.js +2 -1
- package/components/list/list-item.js.map +1 -1
- package/components/list/themes/header.js +8 -9
- package/components/list/themes/header.js.map +1 -1
- package/components/list/themes/item.js +8 -9
- package/components/list/themes/item.js.map +1 -1
- package/components/mask-input/mask-input-base.js.map +1 -1
- package/components/mask-input/mask-input.js.map +1 -1
- package/components/mask-input/mask-parser.js.map +1 -1
- package/components/nav-drawer/nav-drawer-header-item.d.ts +1 -1
- package/components/nav-drawer/nav-drawer-header-item.js +2 -1
- package/components/nav-drawer/nav-drawer-header-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer-item.d.ts +1 -1
- package/components/nav-drawer/nav-drawer-item.js +2 -1
- package/components/nav-drawer/nav-drawer-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer.d.ts +1 -1
- package/components/nav-drawer/nav-drawer.js +2 -1
- package/components/nav-drawer/nav-drawer.js.map +1 -1
- package/components/nav-drawer/themes/container.base.css.js +1 -1
- package/components/nav-drawer/themes/container.base.css.js.map +1 -1
- package/components/nav-drawer/themes/container.js +8 -9
- package/components/nav-drawer/themes/container.js.map +1 -1
- package/components/nav-drawer/themes/header-item.js +2 -21
- package/components/nav-drawer/themes/header-item.js.map +1 -1
- package/components/nav-drawer/themes/item.js +4 -17
- package/components/nav-drawer/themes/item.js.map +1 -1
- package/components/navbar/navbar.d.ts +1 -1
- package/components/navbar/navbar.js +2 -1
- package/components/navbar/navbar.js.map +1 -1
- package/components/navbar/themes/themes.js +8 -9
- package/components/navbar/themes/themes.js.map +1 -1
- package/components/popover/popover.js.map +1 -1
- package/components/progress/base.js.map +1 -1
- package/components/progress/circular-progress.d.ts +1 -1
- package/components/progress/circular-progress.js +2 -1
- package/components/progress/circular-progress.js.map +1 -1
- package/components/progress/linear-progress.d.ts +1 -1
- package/components/progress/linear-progress.js +2 -1
- package/components/progress/linear-progress.js.map +1 -1
- package/components/progress/themes/circular/themes.js +8 -9
- package/components/progress/themes/circular/themes.js.map +1 -1
- package/components/progress/themes/linear/themes.js +8 -9
- package/components/progress/themes/linear/themes.js.map +1 -1
- package/components/radio/radio.js.map +1 -1
- package/components/radio/utils.js.map +1 -1
- package/components/rating/rating.d.ts +5 -0
- package/components/rating/rating.js +13 -2
- package/components/rating/rating.js.map +1 -1
- package/components/rating/themes/themes.js +8 -9
- package/components/rating/themes/themes.js.map +1 -1
- package/components/select/select-group.js.map +1 -1
- package/components/select/select-item.js.map +1 -1
- package/components/select/select.js.map +1 -1
- package/components/select/themes/dark/select.bootstrap.css.js +1 -1
- package/components/select/themes/dark/select.bootstrap.css.js.map +1 -1
- package/components/select/themes/dark/select.fluent.css.js +1 -1
- package/components/select/themes/dark/select.fluent.css.js.map +1 -1
- package/components/select/themes/light/select.bootstrap.css.js +1 -1
- package/components/select/themes/light/select.bootstrap.css.js.map +1 -1
- package/components/select/themes/light/select.fluent.css.js +1 -1
- package/components/select/themes/light/select.fluent.css.js.map +1 -1
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.js.map +1 -1
- package/components/slider/slider.js.map +1 -1
- package/components/snackbar/snackbar.d.ts +1 -1
- package/components/snackbar/snackbar.js +2 -1
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/snackbar/themes/themes.js +8 -9
- package/components/snackbar/themes/themes.js.map +1 -1
- package/components/stepper/step.d.ts +1 -1
- package/components/stepper/step.js +2 -1
- package/components/stepper/step.js.map +1 -1
- package/components/stepper/stepper.js.map +1 -1
- package/components/stepper/themes/step/themes.js +8 -9
- package/components/stepper/themes/step/themes.js.map +1 -1
- package/components/tabs/tab.d.ts +1 -1
- package/components/tabs/tab.js +2 -1
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.d.ts +1 -1
- package/components/tabs/tabs.js +2 -1
- package/components/tabs/tabs.js.map +1 -1
- package/components/tabs/themes/tab-themes.js +4 -17
- package/components/tabs/themes/tab-themes.js.map +1 -1
- package/components/tabs/themes/tabs-themes.js +8 -9
- package/components/tabs/themes/tabs-themes.js.map +1 -1
- package/components/textarea/textarea.js.map +1 -1
- package/components/toast/themes/themes.js +8 -9
- package/components/toast/themes/themes.js.map +1 -1
- package/components/toast/toast.js +2 -1
- package/components/toast/toast.js.map +1 -1
- package/components/tree/tree-item.d.ts +1 -1
- package/components/tree/tree-item.js +20 -4
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.d.ts +5 -0
- package/components/tree/tree.js +4 -0
- package/components/tree/tree.js.map +1 -1
- package/components/tree/tree.navigation.js.map +1 -1
- package/components/tree/tree.selection.js.map +1 -1
- package/custom-elements.json +190 -378
- package/package.json +1 -1
- package/theming/config.js.map +1 -1
- package/theming/theming-controller.js.map +1 -1
- package/theming/utils.js.map +1 -1
- package/components/toggle/toggle.controller.d.ts +0 -52
- package/components/toggle/toggle.controller.js +0 -92
- package/components/toggle/toggle.controller.js.map +0 -1
- package/components/toggle/toggle.directive.d.ts +0 -20
- package/components/toggle/toggle.directive.js +0 -94
- package/components/toggle/toggle.directive.js.map +0 -1
- package/components/toggle/types.d.ts +0 -51
- package/components/toggle/types.js +0 -2
- package/components/toggle/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,yBAAyB,MAAM,qBAAqB,CAAC;AAC5D,OAAO,0BAA0B,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ADT,KAAK,EAAE;yDACyC;AAczC;IADP,KAAK,EAAE;qDACsB;AAGpB;IADT,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC;qDACC;AAO7B;IADN,QAAQ,EAAE;uDACqC;AAOzC;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;8DACc;AAOpD;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;4DACoB;AAQxD;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDACR;AAOb;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDACP;AAOb;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;uDAC5B;AAyBf;IADT,KAAK,CAAC,gBAAgB,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;iEAGvD;AAIS;IAFT,KAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAC7C,KAAK,CAAC,wBAAwB,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;2DAW/D;AAiKM;IADN,cAAc,EAAE;sDAUhB;AAQM;IADN,cAAc,EAAE;kDAKhB;AA5TkB,oBAAoB;IAJxC,MAAM,CAAC,GAAG,CAAC;IACX,4BAA4B,CAC3B,sGAAsG,CACvG;GACoB,oBAAoB,CAoWxC;eApWoB,oBAAoB","sourcesContent":["import { html } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\n\nimport IgcDropdownGroupComponent from './dropdown-group.js';\nimport IgcDropdownHeaderComponent from './dropdown-header.js';\nimport IgcDropdownItemComponent from './dropdown-item.js';\nimport { all } from './themes/container.js';\nimport { styles } from './themes/dropdown.base.css.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport {\n KeyBindingObserverCleanup,\n addKeybindings,\n arrowDown,\n arrowLeft,\n arrowRight,\n arrowUp,\n endKey,\n enterKey,\n escapeKey,\n homeKey,\n tabKey,\n} from '../common/controllers/key-bindings.js';\nimport { addRootClickHandler } from '../common/controllers/root-click.js';\nimport { addRootScrollHandler } from '../common/controllers/root-scroll.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport {\n IgcBaseComboBoxLikeComponent,\n getActiveItems,\n getItems,\n getNextActiveItem,\n getPreviousActiveItem,\n setInitialSelectionState,\n} from '../common/mixins/combo-box.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { SizableMixin } from '../common/mixins/sizable.js';\nimport { getElementByIdFromRoot } from '../common/util.js';\nimport IgcPopoverComponent, { type IgcPlacement } from '../popover/popover.js';\n\nexport interface IgcDropdownEventMap {\n igcOpening: CustomEvent<void>;\n igcOpened: CustomEvent<void>;\n igcClosing: CustomEvent<void>;\n igcClosed: CustomEvent<void>;\n igcChange: CustomEvent<IgcDropdownItemComponent>;\n}\n\n/**\n * Represents a DropDown component.\n *\n * @element igc-dropdown\n *\n * @fires igcChange - Emitted when the selected item changes.\n * @fires igcOpening - Emitted just before the dropdown is open.\n * @fires igcOpened - Emitted after the dropdown is open.\n * @fires igcClosing - Emitter just before the dropdown is closed.\n * @fires igcClosed - Emitted after closing the dropdown.\n *\n * @slot target - Renders the dropdown's target element.\n * @slot - Renders the dropdown list items.\n *\n * @csspart base - The dropdown list wrapper.\n * @csspart list - The dropdown list.\n */\n@themes(all)\n@blazorAdditionalDependencies(\n 'IgcDropdownItemComponent, IgcDropdownHeaderComponent, IgcDropdownGroupComponent, IgcPopoverComponent'\n)\nexport default class IgcDropdownComponent extends SizableMixin(\n EventEmitterMixin<\n IgcDropdownEventMap,\n Constructor<IgcBaseComboBoxLikeComponent>\n >(IgcBaseComboBoxLikeComponent)\n) {\n public static readonly tagName = 'igc-dropdown';\n public static styles = styles;\n\n public static register() {\n registerComponent(\n this,\n IgcDropdownGroupComponent,\n IgcDropdownHeaderComponent,\n IgcDropdownItemComponent,\n IgcPopoverComponent\n );\n }\n\n private _keyBindings: ReturnType<typeof addKeybindings>;\n\n private _rootScrollController = addRootScrollHandler(this, {\n hideCallback: () => this._hide(true),\n });\n\n private _rootClickController = addRootClickHandler(this, {\n hideCallback: () => this._hide(true),\n });\n\n @state()\n protected _selectedItem: IgcDropdownItemComponent | null = null;\n\n @state()\n protected _activeItem!: IgcDropdownItemComponent;\n\n private get _activeItems() {\n return Array.from(\n getActiveItems<IgcDropdownItemComponent>(\n this,\n IgcDropdownItemComponent.tagName\n )\n );\n }\n\n private _targetListeners!: KeyBindingObserverCleanup;\n\n @state()\n private _target?: HTMLElement;\n\n @query('slot[name=\"target\"]', true)\n protected trigger!: HTMLSlotElement;\n\n /** The preferred placement of the component around the target element.\n * @type {'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end'}\n * @attr\n */\n @property()\n public placement: IgcPlacement = 'bottom-start';\n\n /**\n * Sets the component's positioning strategy.\n * @attr position-strategy\n */\n @property({ attribute: 'position-strategy' })\n public positionStrategy: 'absolute' | 'fixed' = 'absolute';\n\n /**\n * Determines the behavior of the component during scrolling of the parent container.\n * @attr scroll-strategy\n */\n @property({ attribute: 'scroll-strategy' })\n public scrollStrategy: 'scroll' | 'block' | 'close' = 'scroll';\n\n /**\n * Whether the component should be flipped to the opposite side of the target once it's about to overflow the visible area.\n * When true, once enough space is detected on its preferred side, it will flip back.\n * @attr\n */\n @property({ type: Boolean })\n public flip = false;\n\n /**\n * The distance from the target element.\n * @attr\n */\n @property({ type: Number })\n public distance = 0;\n\n /**\n * Whether the dropdown's width should be the same as the target's one.\n * @attr same-width\n */\n @property({ type: Boolean, attribute: 'same-width' })\n public sameWidth = false;\n\n /** Returns the items of the dropdown. */\n public get items() {\n return Array.from(\n getItems<IgcDropdownItemComponent>(this, IgcDropdownItemComponent.tagName)\n );\n }\n\n /** Returns the group items of the dropdown. */\n public get groups() {\n return Array.from(\n getItems<IgcDropdownGroupComponent>(\n this,\n IgcDropdownGroupComponent.tagName\n )\n );\n }\n\n /** Returns the selected item from the dropdown or null. */\n public get selectedItem() {\n return this._selectedItem;\n }\n\n @watch('scrollStrategy', { waitUntilFirstUpdate: true })\n protected scrollStrategyChanged() {\n this._rootScrollController.update({ resetListeners: true });\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n @watch('keepOpenOnOutsideClick', { waitUntilFirstUpdate: true })\n protected openStateChange() {\n this._updateAnchorAccessibility(this._target);\n this._rootClickController.update();\n this._rootScrollController.update();\n\n if (!this.open) {\n this._target = undefined;\n this._targetListeners?.unsubscribe();\n this._rootClickController.update({ target: undefined });\n }\n }\n\n constructor() {\n super();\n\n this._keyBindings = addKeybindings(this, {\n skip: () => !this.open,\n bindingDefaults: { preventDefault: true, triggers: ['keydownRepeat'] },\n })\n .set(tabKey, this.onTabKey, {\n preventDefault: false,\n })\n .set(escapeKey, this.onEscapeKey)\n .set(arrowUp, this.onArrowUp)\n .set(arrowLeft, this.onArrowUp)\n .set(arrowDown, this.onArrowDown)\n .set(arrowRight, this.onArrowDown)\n .set(enterKey, this.onEnterKey)\n .set(homeKey, this.onHomeKey)\n .set(endKey, this.onEndKey);\n }\n\n protected override async firstUpdated() {\n await this.updateComplete;\n const selected = setInitialSelectionState(this.items);\n if (selected) {\n this._selectItem(selected, false);\n }\n }\n\n public override disconnectedCallback() {\n this._targetListeners?.unsubscribe();\n super.disconnectedCallback();\n }\n\n private handleListBoxClick(event: MouseEvent) {\n const item = event.target as IgcDropdownItemComponent;\n if (this._activeItems.includes(item)) {\n this._selectItem(item);\n }\n }\n\n private handleChange(item: IgcDropdownItemComponent) {\n this.emitEvent('igcChange', { detail: item });\n }\n\n private handleSlotChange() {\n this._updateAnchorAccessibility();\n }\n\n private onArrowUp() {\n this._navigateToActiveItem(\n getPreviousActiveItem(this.items, this._activeItem)\n );\n }\n\n private onArrowDown() {\n this._navigateToActiveItem(getNextActiveItem(this.items, this._activeItem));\n }\n\n protected onHomeKey() {\n this._navigateToActiveItem(this._activeItems.at(0));\n }\n\n protected onEndKey() {\n this._navigateToActiveItem(this._activeItems.at(-1));\n }\n\n protected onTabKey() {\n if (this._activeItem) {\n this._selectItem(this._activeItem);\n }\n if (this.open) {\n this._hide(true);\n }\n }\n\n protected onEscapeKey() {\n this._hide(true);\n }\n\n protected onEnterKey() {\n this._selectItem(this._activeItem);\n }\n\n private activateItem(item: IgcDropdownItemComponent) {\n if (this._activeItem) {\n this._activeItem.active = false;\n }\n\n this._activeItem = item;\n this._activeItem.active = true;\n }\n\n private _navigateToActiveItem(item?: IgcDropdownItemComponent) {\n if (item) {\n this.activateItem(item);\n item.scrollIntoView({ behavior: 'auto', block: 'nearest' });\n }\n }\n\n private _selectItem(item: IgcDropdownItemComponent, emit = true) {\n if (this._selectedItem) {\n this._selectedItem.selected = false;\n }\n\n this.activateItem(item);\n this._selectedItem = item;\n this._selectedItem.selected = true;\n\n if (emit) this.handleChange(this._selectedItem);\n if (emit && !this.keepOpenOnSelect) this._hide(true);\n\n return this._selectedItem;\n }\n\n private _updateAnchorAccessibility(anchor?: HTMLElement | null) {\n const target =\n anchor ?? this.trigger.assignedElements({ flatten: true }).at(0);\n\n // Find tabbable elements ?\n if (target) {\n target.setAttribute('aria-haspopup', 'true');\n target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n }\n\n private getItem(value: string) {\n return this.items.find((item) => item.value === value);\n }\n\n private _setTarget(anchor: HTMLElement | string) {\n const target =\n typeof anchor === 'string'\n ? (getElementByIdFromRoot(this, anchor) as HTMLElement)\n : anchor;\n\n this._target = target;\n this._targetListeners = this._keyBindings.observeElement(target);\n this._rootClickController.update({ target });\n }\n\n /** Shows the component. */\n public override show(target?: HTMLElement | string) {\n if (target) {\n this._setTarget(target);\n }\n super.show();\n }\n\n /** Toggles the open state of the component. */\n public override toggle(target?: HTMLElement | string) {\n this.open ? this.hide() : this.show(target);\n }\n\n /** Navigates to the item with the specified value. If it exists, returns the found item, otherwise - null. */\n public navigateTo(value: string): IgcDropdownItemComponent | null;\n /** Navigates to the item at the specified index. If it exists, returns the found item, otherwise - null. */\n public navigateTo(index: number): IgcDropdownItemComponent | null;\n /** Navigates to the specified item. If it exists, returns the found item, otherwise - null. */\n @blazorSuppress()\n public navigateTo(value: string | number): IgcDropdownItemComponent | null {\n const item =\n typeof value === 'string' ? this.getItem(value) : this.items[value];\n\n if (item) {\n this._navigateToActiveItem(item);\n }\n\n return item ?? null;\n }\n\n /** Selects the item with the specified value. If it exists, returns the found item, otherwise - null. */\n public select(value: string): IgcDropdownItemComponent | null;\n /** Selects the item at the specified index. If it exists, returns the found item, otherwise - null. */\n public select(index: number): IgcDropdownItemComponent | null;\n /** Selects the specified item. If it exists, returns the found item, otherwise - null. */\n @blazorSuppress()\n public select(value: string | number): IgcDropdownItemComponent | null {\n const item =\n typeof value === 'string' ? this.getItem(value) : this.items[value];\n return item ? this._selectItem(item, false) : null;\n }\n\n /** Clears the current selection of the dropdown. */\n public clearSelection() {\n if (this._selectedItem) {\n this._selectedItem.selected = false;\n }\n this._selectedItem = null;\n }\n\n protected override render() {\n return html`<igc-popover\n ?open=${this.open}\n ?flip=${this.flip}\n ?same-width=${this.sameWidth}\n .anchor=${this._target}\n .strategy=${this.positionStrategy}\n .offset=${this.distance}\n .placement=${this.placement}\n shift\n >\n <slot\n id=\"dropdown-target\"\n name=\"target\"\n slot=\"anchor\"\n @click=${this.handleAnchorClick}\n @slotchange=${this.handleSlotChange}\n ></slot>\n <div part=\"base\" @click=${this.handleListBoxClick} .inert=${!this.open}>\n <div\n id=\"dropdown-list\"\n role=\"listbox\"\n part=\"list\"\n aria-labelledby=\"dropdown-target\"\n >\n <slot></slot>\n </div>\n </div>\n </igc-popover>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-dropdown': IgcDropdownComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,yBAAyB,MAAM,qBAAqB,CAAC;AAC5D,OAAO,0BAA0B,MAAM,sBAAsB,CAAC;AAC9D,OAAO,wBAAwB,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAEL,cAAc,EACd,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,MAAM,GACP,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,QAAQ,EACR,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE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B,EAAE,IAAI,EAAE,CAAC;2DAW/D;AAiKM;IADN,cAAc,EAAE;sDAUhB;AAQM;IADN,cAAc,EAAE;kDAKhB;AA5TkB,oBAAoB;IAJxC,MAAM,CAAC,GAAG,CAAC;IACX,4BAA4B,CAC3B,sGAAsG,CACvG;GACoB,oBAAoB,CAoWxC;eApWoB,oBAAoB","sourcesContent":["import { html } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\n\nimport IgcDropdownGroupComponent from './dropdown-group.js';\nimport IgcDropdownHeaderComponent from './dropdown-header.js';\nimport IgcDropdownItemComponent from './dropdown-item.js';\nimport { all } from './themes/container.js';\nimport { styles } from './themes/dropdown.base.css.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport {\n KeyBindingObserverCleanup,\n addKeybindings,\n arrowDown,\n arrowLeft,\n arrowRight,\n arrowUp,\n endKey,\n enterKey,\n escapeKey,\n homeKey,\n tabKey,\n} from '../common/controllers/key-bindings.js';\nimport { addRootClickHandler } from '../common/controllers/root-click.js';\nimport { addRootScrollHandler } from '../common/controllers/root-scroll.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport {\n IgcBaseComboBoxLikeComponent,\n getActiveItems,\n getItems,\n getNextActiveItem,\n getPreviousActiveItem,\n setInitialSelectionState,\n} from '../common/mixins/combo-box.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { SizableMixin } from '../common/mixins/sizable.js';\nimport { getElementByIdFromRoot } from '../common/util.js';\nimport IgcPopoverComponent, { type IgcPlacement } from '../popover/popover.js';\n\nexport interface IgcDropdownEventMap {\n igcOpening: CustomEvent<void>;\n igcOpened: CustomEvent<void>;\n igcClosing: CustomEvent<void>;\n igcClosed: CustomEvent<void>;\n igcChange: CustomEvent<IgcDropdownItemComponent>;\n}\n\n/**\n * Represents a DropDown component.\n *\n * @element igc-dropdown\n *\n * @fires igcChange - Emitted when the selected item changes.\n * @fires igcOpening - Emitted just before the dropdown is open.\n * @fires igcOpened - Emitted after the dropdown is open.\n * @fires igcClosing - Emitter just before the dropdown is closed.\n * @fires igcClosed - Emitted after closing the dropdown.\n *\n * @slot target - Renders the dropdown's target element.\n * @slot - Renders the dropdown list items.\n *\n * @csspart base - The dropdown list wrapper.\n * @csspart list - The dropdown list.\n */\n@themes(all)\n@blazorAdditionalDependencies(\n 'IgcDropdownItemComponent, IgcDropdownHeaderComponent, IgcDropdownGroupComponent, IgcPopoverComponent'\n)\nexport default class IgcDropdownComponent extends SizableMixin(\n EventEmitterMixin<\n IgcDropdownEventMap,\n Constructor<IgcBaseComboBoxLikeComponent>\n >(IgcBaseComboBoxLikeComponent)\n) {\n public static readonly tagName = 'igc-dropdown';\n public static styles = styles;\n\n public static register() {\n registerComponent(\n this,\n IgcDropdownGroupComponent,\n IgcDropdownHeaderComponent,\n IgcDropdownItemComponent,\n IgcPopoverComponent\n );\n }\n\n private _keyBindings: ReturnType<typeof addKeybindings>;\n\n private _rootScrollController = addRootScrollHandler(this, {\n hideCallback: () => this._hide(true),\n });\n\n private _rootClickController = addRootClickHandler(this, {\n hideCallback: () => this._hide(true),\n });\n\n @state()\n protected _selectedItem: IgcDropdownItemComponent | null = null;\n\n @state()\n protected _activeItem!: IgcDropdownItemComponent;\n\n private get _activeItems() {\n return Array.from(\n getActiveItems<IgcDropdownItemComponent>(\n this,\n IgcDropdownItemComponent.tagName\n )\n );\n }\n\n private _targetListeners!: KeyBindingObserverCleanup;\n\n @state()\n private _target?: HTMLElement;\n\n @query('slot[name=\"target\"]', true)\n protected trigger!: HTMLSlotElement;\n\n /** The preferred placement of the component around the target element.\n * @type {'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end'}\n * @attr\n */\n @property()\n public placement: IgcPlacement = 'bottom-start';\n\n /**\n * Sets the component's positioning strategy.\n * @attr position-strategy\n */\n @property({ attribute: 'position-strategy' })\n public positionStrategy: 'absolute' | 'fixed' = 'absolute';\n\n /**\n * Determines the behavior of the component during scrolling of the parent container.\n * @attr scroll-strategy\n */\n @property({ attribute: 'scroll-strategy' })\n public scrollStrategy: 'scroll' | 'block' | 'close' = 'scroll';\n\n /**\n * Whether the component should be flipped to the opposite side of the target once it's about to overflow the visible area.\n * When true, once enough space is detected on its preferred side, it will flip back.\n * @attr\n */\n @property({ type: Boolean })\n public flip = false;\n\n /**\n * The distance from the target element.\n * @attr\n */\n @property({ type: Number })\n public distance = 0;\n\n /**\n * Whether the dropdown's width should be the same as the target's one.\n * @attr same-width\n */\n @property({ type: Boolean, attribute: 'same-width' })\n public sameWidth = false;\n\n /** Returns the items of the dropdown. */\n public get items() {\n return Array.from(\n getItems<IgcDropdownItemComponent>(this, IgcDropdownItemComponent.tagName)\n );\n }\n\n /** Returns the group items of the dropdown. */\n public get groups() {\n return Array.from(\n getItems<IgcDropdownGroupComponent>(\n this,\n IgcDropdownGroupComponent.tagName\n )\n );\n }\n\n /** Returns the selected item from the dropdown or null. */\n public get selectedItem() {\n return this._selectedItem;\n }\n\n @watch('scrollStrategy', { waitUntilFirstUpdate: true })\n protected scrollStrategyChanged() {\n this._rootScrollController.update({ resetListeners: true });\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n @watch('keepOpenOnOutsideClick', { waitUntilFirstUpdate: true })\n protected openStateChange() {\n this._updateAnchorAccessibility(this._target);\n this._rootClickController.update();\n this._rootScrollController.update();\n\n if (!this.open) {\n this._target = undefined;\n this._targetListeners?.unsubscribe();\n this._rootClickController.update({ target: undefined });\n }\n }\n\n constructor() {\n super();\n\n this._keyBindings = addKeybindings(this, {\n skip: () => !this.open,\n bindingDefaults: { preventDefault: true, triggers: ['keydownRepeat'] },\n })\n .set(tabKey, this.onTabKey, {\n preventDefault: false,\n })\n .set(escapeKey, this.onEscapeKey)\n .set(arrowUp, this.onArrowUp)\n .set(arrowLeft, this.onArrowUp)\n .set(arrowDown, this.onArrowDown)\n .set(arrowRight, this.onArrowDown)\n .set(enterKey, this.onEnterKey)\n .set(homeKey, this.onHomeKey)\n .set(endKey, this.onEndKey);\n }\n\n protected override async firstUpdated() {\n await this.updateComplete;\n const selected = setInitialSelectionState(this.items);\n if (selected) {\n this._selectItem(selected, false);\n }\n }\n\n public override disconnectedCallback() {\n this._targetListeners?.unsubscribe();\n super.disconnectedCallback();\n }\n\n private handleListBoxClick(event: MouseEvent) {\n const item = event.target as IgcDropdownItemComponent;\n if (this._activeItems.includes(item)) {\n this._selectItem(item);\n }\n }\n\n private handleChange(item: IgcDropdownItemComponent) {\n this.emitEvent('igcChange', { detail: item });\n }\n\n private handleSlotChange() {\n this._updateAnchorAccessibility();\n }\n\n private onArrowUp() {\n this._navigateToActiveItem(\n getPreviousActiveItem(this.items, this._activeItem)\n );\n }\n\n private onArrowDown() {\n this._navigateToActiveItem(getNextActiveItem(this.items, this._activeItem));\n }\n\n protected onHomeKey() {\n this._navigateToActiveItem(this._activeItems.at(0));\n }\n\n protected onEndKey() {\n this._navigateToActiveItem(this._activeItems.at(-1));\n }\n\n protected onTabKey() {\n if (this._activeItem) {\n this._selectItem(this._activeItem);\n }\n if (this.open) {\n this._hide(true);\n }\n }\n\n protected onEscapeKey() {\n this._hide(true);\n }\n\n protected onEnterKey() {\n this._selectItem(this._activeItem);\n }\n\n private activateItem(item: IgcDropdownItemComponent) {\n if (this._activeItem) {\n this._activeItem.active = false;\n }\n\n this._activeItem = item;\n this._activeItem.active = true;\n }\n\n private _navigateToActiveItem(item?: IgcDropdownItemComponent) {\n if (item) {\n this.activateItem(item);\n item.scrollIntoView({ behavior: 'auto', block: 'nearest' });\n }\n }\n\n private _selectItem(item: IgcDropdownItemComponent, emit = true) {\n if (this._selectedItem) {\n this._selectedItem.selected = false;\n }\n\n this.activateItem(item);\n this._selectedItem = item;\n this._selectedItem.selected = true;\n\n if (emit) this.handleChange(this._selectedItem);\n if (emit && !this.keepOpenOnSelect) this._hide(true);\n\n return this._selectedItem;\n }\n\n private _updateAnchorAccessibility(anchor?: HTMLElement | null) {\n const target =\n anchor ?? this.trigger.assignedElements({ flatten: true }).at(0);\n\n // Find tabbable elements ?\n if (target) {\n target.setAttribute('aria-haspopup', 'true');\n target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n }\n\n private getItem(value: string) {\n return this.items.find((item) => item.value === value);\n }\n\n private _setTarget(anchor: HTMLElement | string) {\n const target =\n typeof anchor === 'string'\n ? (getElementByIdFromRoot(this, anchor) as HTMLElement)\n : anchor;\n\n this._target = target;\n this._targetListeners = this._keyBindings.observeElement(target);\n this._rootClickController.update({ target });\n }\n\n /** Shows the component. */\n public override show(target?: HTMLElement | string) {\n if (target) {\n this._setTarget(target);\n }\n super.show();\n }\n\n /** Toggles the open state of the component. */\n public override toggle(target?: HTMLElement | string) {\n this.open ? this.hide() : this.show(target);\n }\n\n /** Navigates to the item with the specified value. If it exists, returns the found item, otherwise - null. */\n public navigateTo(value: string): IgcDropdownItemComponent | null;\n /** Navigates to the item at the specified index. If it exists, returns the found item, otherwise - null. */\n public navigateTo(index: number): IgcDropdownItemComponent | null;\n /** Navigates to the specified item. If it exists, returns the found item, otherwise - null. */\n @blazorSuppress()\n public navigateTo(value: string | number): IgcDropdownItemComponent | null {\n const item =\n typeof value === 'string' ? this.getItem(value) : this.items[value];\n\n if (item) {\n this._navigateToActiveItem(item);\n }\n\n return item ?? null;\n }\n\n /** Selects the item with the specified value. If it exists, returns the found item, otherwise - null. */\n public select(value: string): IgcDropdownItemComponent | null;\n /** Selects the item at the specified index. If it exists, returns the found item, otherwise - null. */\n public select(index: number): IgcDropdownItemComponent | null;\n /** Selects the specified item. If it exists, returns the found item, otherwise - null. */\n @blazorSuppress()\n public select(value: string | number): IgcDropdownItemComponent | null {\n const item =\n typeof value === 'string' ? this.getItem(value) : this.items[value];\n return item ? this._selectItem(item, false) : null;\n }\n\n /** Clears the current selection of the dropdown. */\n public clearSelection() {\n if (this._selectedItem) {\n this._selectedItem.selected = false;\n }\n this._selectedItem = null;\n }\n\n protected override render() {\n return html`<igc-popover\n ?open=${this.open}\n ?flip=${this.flip}\n ?same-width=${this.sameWidth}\n .anchor=${this._target}\n .strategy=${this.positionStrategy}\n .offset=${this.distance}\n .placement=${this.placement}\n shift\n >\n <slot\n id=\"dropdown-target\"\n name=\"target\"\n slot=\"anchor\"\n @click=${this.handleAnchorClick}\n @slotchange=${this.handleSlotChange}\n ></slot>\n <div part=\"base\" @click=${this.handleListBoxClick} .inert=${!this.open}>\n <div\n id=\"dropdown-list\"\n role=\"listbox\"\n part=\"list\"\n aria-labelledby=\"dropdown-target\"\n >\n <slot></slot>\n </div>\n </div>\n </igc-popover>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-dropdown': IgcDropdownComponent;\n }\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-0));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-gray-700), var(--ig-gray-a)));--item-text-color: var(--ig-dropdown-item-text-color, var(--ig-surface-500-contrast));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, var(--ig-surface-500-contrast));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-
|
|
2
|
+
export const styles = css `:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-0));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-gray-700), var(--ig-gray-a)));--item-text-color: var(--ig-dropdown-item-text-color, var(--ig-surface-500-contrast));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, var(--ig-surface-500-contrast));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--focused-item-background: var(--ig-dropdown-focused-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--focused-item-text-color: var(--ig-dropdown-focused-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--selected-item-background: var(--ig-dropdown-selected-item-background, hsla(var(--ig-primary-500), var(--ig-primary-a)));--selected-item-text-color: var(--ig-dropdown-selected-item-text-color, var(--ig-primary-600-contrast));--selected-hover-item-background: var(--ig-dropdown-selected-hover-item-background, hsla(var(--ig-primary-600), var(--ig-primary-a)));--selected-hover-item-text-color: var(--ig-dropdown-selected-hover-item-text-color, var(--ig-primary-600-contrast));--selected-focus-item-background: var(--ig-dropdown-selected-focus-item-background, hsla(var(--ig-primary-600), var(--ig-primary-a)));--selected-focus-item-text-color: var(--ig-dropdown-selected-focus-item-text-color, var(--ig-primary-600-contrast));--disabled-item-background: var(--ig-dropdown-disabled-item-background, hsla(var(--ig-gray-50), 0));--disabled-item-text-color: var(--ig-dropdown-disabled-item-text-color, hsla(var(--ig-gray-200), var(--ig-gray-a)));--border-color: var(--ig-dropdown-border-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));--border-width: var(--ig-dropdown-border-width, 1px);--border-radius: var(--ig-dropdown-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.2) * 1.25rem), 1.25rem));--item-border-radius: var(--ig-dropdown-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.25rem), 1.25rem));--size: var(--ig-dropdown-size, max(var(--is-large, 1) * max(2.5rem, -1 * 2.5rem), var(--is-medium, 1) * max(2rem, -1 * 2rem), var(--is-small, 1) * max(1.75rem, -1 * 1.75rem)));--default-size: var(--ig-dropdown-default-size, 2)}`;
|
|
3
3
|
//# sourceMappingURL=dropdown.bootstrap.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/dropdown/themes/dark/dropdown.bootstrap.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"dropdown.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/dropdown/themes/dark/dropdown.bootstrap.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,0zEAA0zE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-0));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-gray-700), var(--ig-gray-a)));--item-text-color: var(--ig-dropdown-item-text-color, var(--ig-surface-500-contrast));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, var(--ig-surface-500-contrast));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--focused-item-background: var(--ig-dropdown-focused-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--focused-item-text-color: var(--ig-dropdown-focused-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--selected-item-background: var(--ig-dropdown-selected-item-background, hsla(var(--ig-primary-500), var(--ig-primary-a)));--selected-item-text-color: var(--ig-dropdown-selected-item-text-color, var(--ig-primary-600-contrast));--selected-hover-item-background: var(--ig-dropdown-selected-hover-item-background, hsla(var(--ig-primary-600), var(--ig-primary-a)));--selected-hover-item-text-color: var(--ig-dropdown-selected-hover-item-text-color, var(--ig-primary-600-contrast));--selected-focus-item-background: var(--ig-dropdown-selected-focus-item-background, hsla(var(--ig-primary-600), var(--ig-primary-a)));--selected-focus-item-text-color: var(--ig-dropdown-selected-focus-item-text-color, var(--ig-primary-600-contrast));--disabled-item-background: var(--ig-dropdown-disabled-item-background, hsla(var(--ig-gray-50), 0));--disabled-item-text-color: var(--ig-dropdown-disabled-item-text-color, hsla(var(--ig-gray-200), var(--ig-gray-a)));--border-color: var(--ig-dropdown-border-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));--border-width: var(--ig-dropdown-border-width, 1px);--border-radius: var(--ig-dropdown-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.2) * 1.25rem), 1.25rem));--item-border-radius: var(--ig-dropdown-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.25rem), 1.25rem));--size: var(--ig-dropdown-size, max(var(--is-large, 1) * max(2.5rem, -1 * 2.5rem), var(--is-medium, 1) * max(2rem, -1 * 2rem), var(--is-small, 1) * max(1.75rem, -1 * 1.75rem)));--default-size: var(--ig-dropdown-default-size, 2)}`;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-4));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--item-text-color: var(--ig-dropdown-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-100),
|
|
2
|
+
export const styles = css `:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-4));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--item-text-color: var(--ig-dropdown-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-100), var(--ig-gray-a)));--focused-item-background: var(--ig-dropdown-focused-item-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));--focused-item-text-color: var(--ig-dropdown-focused-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--selected-item-background: var(--ig-dropdown-selected-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-item-text-color: var(--ig-dropdown-selected-item-text-color, var(--ig-surface-500-contrast));--selected-hover-item-background: var(--ig-dropdown-selected-hover-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-hover-item-text-color: var(--ig-dropdown-selected-hover-item-text-color, var(--ig-surface-500-contrast));--selected-focus-item-background: var(--ig-dropdown-selected-focus-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-focus-item-text-color: var(--ig-dropdown-selected-focus-item-text-color, var(--ig-surface-500-contrast));--disabled-item-background: var(--ig-dropdown-disabled-item-background, hsla(var(--ig-gray-50), 0));--disabled-item-text-color: var(--ig-dropdown-disabled-item-text-color, hsla(var(--ig-gray-200), var(--ig-gray-a)));--border-color: var(--ig-dropdown-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--border-width: var(--ig-dropdown-border-width, 0);--border-radius: var(--ig-dropdown-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.1) * 1.25rem), 1.25rem));--item-border-radius: var(--ig-dropdown-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.25rem), 1.25rem));--size: var(--ig-dropdown-size, max(var(--is-large, 1) * max(2.5rem, -1 * 2.5rem), var(--is-medium, 1) * max(2rem, -1 * 2rem), var(--is-small, 1) * max(1.75rem, -1 * 1.75rem)));--default-size: var(--ig-dropdown-default-size, 2)}`;
|
|
3
3
|
//# sourceMappingURL=dropdown.fluent.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/dropdown/themes/dark/dropdown.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"dropdown.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/dropdown/themes/dark/dropdown.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,80EAA80E,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-4));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--item-text-color: var(--ig-dropdown-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-100), var(--ig-gray-a)));--focused-item-background: var(--ig-dropdown-focused-item-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));--focused-item-text-color: var(--ig-dropdown-focused-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--selected-item-background: var(--ig-dropdown-selected-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-item-text-color: var(--ig-dropdown-selected-item-text-color, var(--ig-surface-500-contrast));--selected-hover-item-background: var(--ig-dropdown-selected-hover-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-hover-item-text-color: var(--ig-dropdown-selected-hover-item-text-color, var(--ig-surface-500-contrast));--selected-focus-item-background: var(--ig-dropdown-selected-focus-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-focus-item-text-color: var(--ig-dropdown-selected-focus-item-text-color, var(--ig-surface-500-contrast));--disabled-item-background: var(--ig-dropdown-disabled-item-background, hsla(var(--ig-gray-50), 0));--disabled-item-text-color: var(--ig-dropdown-disabled-item-text-color, hsla(var(--ig-gray-200), var(--ig-gray-a)));--border-color: var(--ig-dropdown-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--border-width: var(--ig-dropdown-border-width, 0);--border-radius: var(--ig-dropdown-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.1) * 1.25rem), 1.25rem));--item-border-radius: var(--ig-dropdown-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.25rem), 1.25rem));--size: var(--ig-dropdown-size, max(var(--is-large, 1) * max(2.5rem, -1 * 2.5rem), var(--is-medium, 1) * max(2rem, -1 * 2rem), var(--is-small, 1) * max(1.75rem, -1 * 1.75rem)));--default-size: var(--ig-dropdown-default-size, 2)}`;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-0));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-gray-700), var(--ig-gray-a)));--item-text-color: var(--ig-dropdown-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-
|
|
2
|
+
export const styles = css `:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-0));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-gray-700), var(--ig-gray-a)));--item-text-color: var(--ig-dropdown-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--focused-item-background: var(--ig-dropdown-focused-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--focused-item-text-color: var(--ig-dropdown-focused-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--selected-item-background: var(--ig-dropdown-selected-item-background, hsla(var(--ig-primary-500), var(--ig-primary-a)));--selected-item-text-color: var(--ig-dropdown-selected-item-text-color, var(--ig-primary-600-contrast));--selected-hover-item-background: var(--ig-dropdown-selected-hover-item-background, hsla(var(--ig-primary-600), var(--ig-primary-a)));--selected-hover-item-text-color: var(--ig-dropdown-selected-hover-item-text-color, var(--ig-primary-600-contrast));--selected-focus-item-background: var(--ig-dropdown-selected-focus-item-background, hsla(var(--ig-primary-600), var(--ig-primary-a)));--selected-focus-item-text-color: var(--ig-dropdown-selected-focus-item-text-color, var(--ig-primary-600-contrast));--disabled-item-background: var(--ig-dropdown-disabled-item-background, hsla(var(--ig-gray-50), 0));--disabled-item-text-color: var(--ig-dropdown-disabled-item-text-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--border-color: var(--ig-dropdown-border-color, hsla(var(--ig-gray-300), var(--ig-gray-a)));--border-width: var(--ig-dropdown-border-width, 1px);--border-radius: var(--ig-dropdown-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.2) * 1.25rem), 1.25rem));--item-border-radius: var(--ig-dropdown-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.25rem), 1.25rem));--size: var(--ig-dropdown-size, max(var(--is-large, 1) * max(2.5rem, -1 * 2.5rem), var(--is-medium, 1) * max(2rem, -1 * 2rem), var(--is-small, 1) * max(1.75rem, -1 * 1.75rem)));--default-size: var(--ig-dropdown-default-size, 2)}`;
|
|
3
3
|
//# sourceMappingURL=dropdown.bootstrap.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/dropdown/themes/light/dropdown.bootstrap.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"dropdown.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/dropdown/themes/light/dropdown.bootstrap.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,k1EAAk1E,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-0));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-gray-700), var(--ig-gray-a)));--item-text-color: var(--ig-dropdown-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--focused-item-background: var(--ig-dropdown-focused-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--focused-item-text-color: var(--ig-dropdown-focused-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--selected-item-background: var(--ig-dropdown-selected-item-background, hsla(var(--ig-primary-500), var(--ig-primary-a)));--selected-item-text-color: var(--ig-dropdown-selected-item-text-color, var(--ig-primary-600-contrast));--selected-hover-item-background: var(--ig-dropdown-selected-hover-item-background, hsla(var(--ig-primary-600), var(--ig-primary-a)));--selected-hover-item-text-color: var(--ig-dropdown-selected-hover-item-text-color, var(--ig-primary-600-contrast));--selected-focus-item-background: var(--ig-dropdown-selected-focus-item-background, hsla(var(--ig-primary-600), var(--ig-primary-a)));--selected-focus-item-text-color: var(--ig-dropdown-selected-focus-item-text-color, var(--ig-primary-600-contrast));--disabled-item-background: var(--ig-dropdown-disabled-item-background, hsla(var(--ig-gray-50), 0));--disabled-item-text-color: var(--ig-dropdown-disabled-item-text-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--border-color: var(--ig-dropdown-border-color, hsla(var(--ig-gray-300), var(--ig-gray-a)));--border-width: var(--ig-dropdown-border-width, 1px);--border-radius: var(--ig-dropdown-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.2) * 1.25rem), 1.25rem));--item-border-radius: var(--ig-dropdown-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.25rem), 1.25rem));--size: var(--ig-dropdown-size, max(var(--is-large, 1) * max(2.5rem, -1 * 2.5rem), var(--is-medium, 1) * max(2rem, -1 * 2rem), var(--is-small, 1) * max(1.75rem, -1 * 1.75rem)));--default-size: var(--ig-dropdown-default-size, 2)}`;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-4));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--item-text-color: var(--ig-dropdown-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-100),
|
|
2
|
+
export const styles = css `:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-4));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--item-text-color: var(--ig-dropdown-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-100), var(--ig-gray-a)));--focused-item-background: var(--ig-dropdown-focused-item-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));--focused-item-text-color: var(--ig-dropdown-focused-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--selected-item-background: var(--ig-dropdown-selected-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-item-text-color: var(--ig-dropdown-selected-item-text-color, var(--ig-gray-200-contrast));--selected-hover-item-background: var(--ig-dropdown-selected-hover-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-hover-item-text-color: var(--ig-dropdown-selected-hover-item-text-color, var(--ig-gray-200-contrast));--selected-focus-item-background: var(--ig-dropdown-selected-focus-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-focus-item-text-color: var(--ig-dropdown-selected-focus-item-text-color, var(--ig-gray-200-contrast));--disabled-item-background: var(--ig-dropdown-disabled-item-background, hsla(var(--ig-gray-50), 0));--disabled-item-text-color: var(--ig-dropdown-disabled-item-text-color, hsla(var(--ig-gray-500), var(--ig-gray-a)));--border-color: var(--ig-dropdown-border-color, hsla(var(--ig-gray-700), var(--ig-gray-a)));--border-width: var(--ig-dropdown-border-width, 0);--border-radius: var(--ig-dropdown-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.1) * 1.25rem), 1.25rem));--item-border-radius: var(--ig-dropdown-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.25rem), 1.25rem));--size: var(--ig-dropdown-size, max(var(--is-large, 1) * max(2.5rem, -1 * 2.5rem), var(--is-medium, 1) * max(2rem, -1 * 2rem), var(--is-small, 1) * max(1.75rem, -1 * 1.75rem)));--default-size: var(--ig-dropdown-default-size, 2)}`;
|
|
3
3
|
//# sourceMappingURL=dropdown.fluent.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/dropdown/themes/light/dropdown.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"dropdown.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/dropdown/themes/light/dropdown.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,q0EAAq0E,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--elevation: var(--ig-dropdown-elevation, var(--ig-elevation-4));--background-color: var(--ig-dropdown-background-color, hsla(var(--ig-surface-500), var(--ig-surface-a)));--header-text-color: var(--ig-dropdown-header-text-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--item-text-color: var(--ig-dropdown-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-text-color: var(--ig-dropdown-hover-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--hover-item-background: var(--ig-dropdown-hover-item-background, hsla(var(--ig-gray-100), var(--ig-gray-a)));--focused-item-background: var(--ig-dropdown-focused-item-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));--focused-item-text-color: var(--ig-dropdown-focused-item-text-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));--selected-item-background: var(--ig-dropdown-selected-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-item-text-color: var(--ig-dropdown-selected-item-text-color, var(--ig-gray-200-contrast));--selected-hover-item-background: var(--ig-dropdown-selected-hover-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-hover-item-text-color: var(--ig-dropdown-selected-hover-item-text-color, var(--ig-gray-200-contrast));--selected-focus-item-background: var(--ig-dropdown-selected-focus-item-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--selected-focus-item-text-color: var(--ig-dropdown-selected-focus-item-text-color, var(--ig-gray-200-contrast));--disabled-item-background: var(--ig-dropdown-disabled-item-background, hsla(var(--ig-gray-50), 0));--disabled-item-text-color: var(--ig-dropdown-disabled-item-text-color, hsla(var(--ig-gray-500), var(--ig-gray-a)));--border-color: var(--ig-dropdown-border-color, hsla(var(--ig-gray-700), var(--ig-gray-a)));--border-width: var(--ig-dropdown-border-width, 0);--border-radius: var(--ig-dropdown-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.1) * 1.25rem), 1.25rem));--item-border-radius: var(--ig-dropdown-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.25rem), 1.25rem));--size: var(--ig-dropdown-size, max(var(--is-large, 1) * max(2.5rem, -1 * 2.5rem), var(--is-medium, 1) * max(2rem, -1 * 2rem), var(--is-small, 1) * max(1.75rem, -1 * 1.75rem)));--default-size: var(--ig-dropdown-default-size, 2)}`;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{border-radius:var(--item-border-radius);color:var(--item-text-color);padding:max(var(--is-large, 1)*max(0.5rem, -1 * 0.5rem)*var(--ig-spacing-large, var(--ig-spacing, --ig-spacing)),var(--is-medium, 1)*max(0.25rem, -1 * 0.25rem)*var(--ig-spacing-medium, var(--ig-spacing, --ig-spacing)),var(--is-small, 1)*max(0.125rem, -1 * 0.125rem)*var(--ig-spacing-small, var(--ig-spacing, --ig-spacing)))}:host([active]),:host(:hover){background:var(--hover-item-background);color:var(--hover-item-text-color)}:host([active]){background:var(--focused-item-background);color:var(--focused-item-text-color)}:host([selected]){background:var(--selected-item-background);color:var(--selected-item-text-color)}:host([selected]:hover),:host([selected][active]){background:var(--selected-hover-item-background);color:var(--selected-hover-item-text-color)}:host([disabled]){background:var(--disabled-item-background);color:var(--disabled-item-text-color)}`;
|
|
2
|
+
export const styles = css `:host{border-radius:var(--item-border-radius);color:var(--item-text-color);padding:max(var(--is-large, 1)*max(0.5rem, -1 * 0.5rem)*var(--ig-spacing-large, var(--ig-spacing, --ig-spacing)),var(--is-medium, 1)*max(0.25rem, -1 * 0.25rem)*var(--ig-spacing-medium, var(--ig-spacing, --ig-spacing)),var(--is-small, 1)*max(0.125rem, -1 * 0.125rem)*var(--ig-spacing-small, var(--ig-spacing, --ig-spacing)))}:host([active]),:host(:hover),:host([active]:hover){background:var(--hover-item-background);color:var(--hover-item-text-color)}:host([active]){background:var(--focused-item-background);color:var(--focused-item-text-color);outline:.0625rem solid var(--border-color);outline-offset:-0.0625rem}:host([selected]){background:var(--selected-item-background);color:var(--selected-item-text-color)}:host([selected]:hover),:host([selected][active]){background:var(--selected-hover-item-background);color:var(--selected-hover-item-text-color)}:host([disabled]){background:var(--disabled-item-background);color:var(--disabled-item-text-color)}`;
|
|
3
3
|
//# sourceMappingURL=dropdown-item.fluent.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-item.fluent.css.js","sourceRoot":"","sources":["../../../../../../src/components/dropdown/themes/shared/item/dropdown-item.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"dropdown-item.fluent.css.js","sourceRoot":"","sources":["../../../../../../src/components/dropdown/themes/shared/item/dropdown-item.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,ygCAAygC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{border-radius:var(--item-border-radius);color:var(--item-text-color);padding:max(var(--is-large, 1)*max(0.5rem, -1 * 0.5rem)*var(--ig-spacing-large, var(--ig-spacing, --ig-spacing)),var(--is-medium, 1)*max(0.25rem, -1 * 0.25rem)*var(--ig-spacing-medium, var(--ig-spacing, --ig-spacing)),var(--is-small, 1)*max(0.125rem, -1 * 0.125rem)*var(--ig-spacing-small, var(--ig-spacing, --ig-spacing)))}:host([active]),:host(:hover),:host([active]:hover){background:var(--hover-item-background);color:var(--hover-item-text-color)}:host([active]){background:var(--focused-item-background);color:var(--focused-item-text-color);outline:.0625rem solid var(--border-color);outline-offset:-0.0625rem}:host([selected]){background:var(--selected-item-background);color:var(--selected-item-text-color)}:host([selected]:hover),:host([selected][active]){background:var(--selected-hover-item-background);color:var(--selected-hover-item-text-color)}:host([disabled]){background:var(--disabled-item-background);color:var(--disabled-item-text-color)}`;\n"]}
|
|
@@ -33,7 +33,7 @@ declare const IgcExpansionPanelComponent_base: import("../common/mixins/construc
|
|
|
33
33
|
*/
|
|
34
34
|
export default class IgcExpansionPanelComponent extends IgcExpansionPanelComponent_base {
|
|
35
35
|
static readonly tagName = "igc-expansion-panel";
|
|
36
|
-
static styles: import("lit").CSSResult;
|
|
36
|
+
static styles: import("lit").CSSResult[];
|
|
37
37
|
static register(): void;
|
|
38
38
|
private static readonly increment;
|
|
39
39
|
private animationPlayer;
|
|
@@ -9,6 +9,7 @@ import { LitElement, html } from 'lit';
|
|
|
9
9
|
import { property, query, queryAssignedElements } from 'lit/decorators.js';
|
|
10
10
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
11
11
|
import { styles } from './themes/expansion-panel.base.css.js';
|
|
12
|
+
import { styles as shared } from './themes/shared/expansion-panel.common.css.js';
|
|
12
13
|
import { all } from './themes/themes.js';
|
|
13
14
|
import { AnimationPlayer } from '../../animations/player.js';
|
|
14
15
|
import { growVerIn, growVerOut } from '../../animations/presets/grow/index.js';
|
|
@@ -164,7 +165,7 @@ let IgcExpansionPanelComponent = IgcExpansionPanelComponent_1 = class IgcExpansi
|
|
|
164
165
|
}
|
|
165
166
|
};
|
|
166
167
|
IgcExpansionPanelComponent.tagName = 'igc-expansion-panel';
|
|
167
|
-
IgcExpansionPanelComponent.styles = styles;
|
|
168
|
+
IgcExpansionPanelComponent.styles = [styles, shared];
|
|
168
169
|
IgcExpansionPanelComponent.increment = createCounter();
|
|
169
170
|
__decorate([
|
|
170
171
|
queryAssignedElements({ slot: 'indicator-expanded' })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expansion-panel.js","sourceRoot":"","sources":["../../../src/components/expansion-panel/expansion-panel.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAO,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,MAAM,EACN,SAAS,EACT,OAAO,GACR,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAA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AI,CAAC,CAAC,CAAC,GAAG;iBAC5B,IAAI,CAAC,aAAa;;UAEzB,IAAI,CAAC,iBAAiB,EAAE;;;;;;KAM7B,CAAC;IACJ,CAAC;IAEO,eAAe;QACrB,OAAO,IAAI,CAAA;;;;cAID,IAAI,CAAC,OAAQ;2BACA,IAAI,CAAC,OAAQ;iBACvB,CAAC,IAAI,CAAC,IAAI;sBACL,CAAC,IAAI,CAAC,IAAI;;;;KAI3B,CAAC;IACJ,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,GAAG,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;IACjE,CAAC;;AAjNsB,kCAAO,GAAG,qBAAqB,AAAxB,CAAyB;AACzC,iCAAM,GAAG,MAAM,AAAT,CAAU;AAMN,oCAAS,GAAG,aAAa,EAAE,AAAlB,CAAmB;AAI5C;IADP,qBAAqB,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;8EACH;AAO5C;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wDACvB;AAOb;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4DACnB;AAOjB;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;qEACA;AAGnD;IADT,KAAK,CAAC,mBAAmB,EAAE,IAAI,CAAC;gEACI;AAvClB,0BAA0B;IAD9C,MAAM,CAAC,GAAG,CAAC;GACS,0BAA0B,CAsN9C;eAtNoB,0BAA0B","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { Ref, createRef, ref } from 'lit/directives/ref.js';\n\nimport { styles } from './themes/expansion-panel.base.css.js';\nimport { all } from './themes/themes.js';\nimport { AnimationPlayer } from '../../animations/player.js';\nimport { growVerIn, growVerOut } from '../../animations/presets/grow/index.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport {\n addKeybindings,\n altKey,\n arrowDown,\n arrowUp,\n} from '../common/controllers/key-bindings.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { createCounter } from '../common/util.js';\nimport IgcIconComponent from '../icon/icon.js';\n\nexport interface IgcExpansionPanelComponentEventMap {\n igcOpening: CustomEvent<IgcExpansionPanelComponent>;\n igcOpened: CustomEvent<IgcExpansionPanelComponent>;\n igcClosing: CustomEvent<IgcExpansionPanelComponent>;\n igcClosed: CustomEvent<IgcExpansionPanelComponent>;\n}\n\n/**\n * The Expansion Panel Component provides a way to display information in a toggleable way -\n * compact summary view containing title and description and expanded detail view containing\n * additional content to the summary header.\n *\n * @element igc-expansion-panel\n *\n * @slot - renders the default content of the panel\n * @slot title - renders the title of the panel's header\n * @slot subtitle - renders the subtitle of the panel's header\n * @slot indicator - renders the expand/collapsed indicator\n * @slot indicator-expanded - renders the expanded state of the indicator\n *\n * @fires igcOpening - Emitted before opening the expansion panel.\n * @fires igcOpened - Emitted after the expansion panel is opened.\n * @fires igcClosing - Emitted before closing the expansion panel.\n * @fires igcClosed - Emitted after the expansion panel is closed.\n *\n * @csspart header - The container of the expansion indicator, title and subtitle.\n * @csspart title - The title container.\n * @csspart subtitle - The subtitle container.\n * @csspart indicator - The indicator container.\n * @csspart content - The expansion panel's content wrapper.\n */\n\n@themes(all)\nexport default class IgcExpansionPanelComponent extends EventEmitterMixin<\n IgcExpansionPanelComponentEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-expansion-panel';\n public static styles = styles;\n\n public static register() {\n registerComponent(this, IgcIconComponent);\n }\n\n private static readonly increment = createCounter();\n private animationPlayer!: AnimationPlayer;\n\n @queryAssignedElements({ slot: 'indicator-expanded' })\n private _indicatorExpandedElements!: HTMLElement[];\n\n /**\n * Indicates whether the contents of the control should be visible.\n * @attr\n */\n @property({ reflect: true, type: Boolean })\n public open = false;\n\n /**\n * Get/Set whether the expansion panel is disabled. Disabled panels are ignored for user interactions.\n * @attr\n */\n @property({ reflect: true, type: Boolean })\n public disabled = false;\n\n /**\n * The indicator position of the expansion panel.\n * @attr indicator-position\n */\n @property({ reflect: true, attribute: 'indicator-position' })\n public indicatorPosition: 'start' | 'end' | 'none' = 'start';\n\n @query('[part~=\"content\"]', true)\n protected panelContent!: HTMLElement;\n\n private panelId!: string;\n\n private headerRef: Ref<HTMLDivElement> = createRef();\n\n constructor() {\n super();\n\n addKeybindings(this, {\n ref: this.headerRef,\n bindingDefaults: { preventDefault: true },\n })\n .setActivateHandler(this.toggleWithEvent)\n .set([altKey, arrowDown], this.openWithEvent)\n .set([altKey, arrowUp], this.closeWithEvent);\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n this.panelId =\n this.getAttribute('id') ||\n `igc-expansion-panel-${IgcExpansionPanelComponent.increment()}`;\n }\n\n protected override firstUpdated() {\n this.animationPlayer = new AnimationPlayer(this.panelContent);\n }\n\n private handleClicked() {\n this.headerRef.value!.focus();\n this.toggleWithEvent();\n }\n\n private toggleWithEvent() {\n if (this.disabled) return;\n this.open ? this.closeWithEvent() : this.openWithEvent();\n }\n\n private async toggleAnimation(dir: 'open' | 'close') {\n const animation = dir === 'open' ? growVerIn : growVerOut;\n\n const [_, event] = await Promise.all([\n this.animationPlayer.stopAll(),\n this.animationPlayer.play(animation()),\n ]);\n\n return event.type === 'finish';\n }\n\n private async openWithEvent() {\n if (\n this.open ||\n !this.emitEvent('igcOpening', { cancelable: true, detail: this })\n ) {\n return;\n }\n\n this.open = true;\n\n if (await this.toggleAnimation('open')) {\n this.emitEvent('igcOpened', { detail: this });\n }\n }\n\n private async closeWithEvent() {\n if (\n !this.open ||\n !this.emitEvent('igcClosing', { cancelable: true, detail: this })\n ) {\n return;\n }\n\n this.open = false;\n\n if (await this.toggleAnimation('close')) {\n this.emitEvent('igcClosed', { detail: this });\n }\n }\n\n /** Toggles panel open state. */\n public toggle(): void {\n this.open ? this.hide() : this.show();\n }\n\n /** Hides the panel content. */\n public hide(): void {\n if (this.open) {\n this.toggleAnimation('close');\n }\n\n this.open = false;\n }\n\n /** Shows the panel content. */\n public show(): void {\n if (!this.open) {\n this.toggleAnimation('open');\n }\n\n this.open = true;\n }\n\n private handleSlotChange() {\n this.requestUpdate();\n }\n\n private indicatorTemplate() {\n const indicatorHidden =\n this.open && this._indicatorExpandedElements.length > 0;\n const indicatorExpandedHidden =\n this._indicatorExpandedElements.length < 1 || !this.open;\n\n return html`\n <div part=\"indicator\" aria-hidden=\"true\">\n <slot\n name=\"indicator\"\n ?hidden=${indicatorHidden}\n @slotchange=${this.handleSlotChange}\n >\n <igc-icon\n name=${this.open ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}\n collection=\"internal\"\n >\n </igc-icon>\n </slot>\n <slot\n name=\"indicator-expanded\"\n ?hidden=${indicatorExpandedHidden}\n @slotchange=${this.handleSlotChange}\n ></slot>\n </div>\n `;\n }\n\n private headerTemplate() {\n return html`\n <div\n ${ref(this.headerRef)}\n part=\"header\"\n id=\"${this.panelId!}-header\"\n role=\"button\"\n aria-expanded=\"${this.open}\"\n aria-disabled=\"${this.disabled}\"\n aria-controls=\"${this.panelId!}-content\"\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.handleClicked}\n >\n ${this.indicatorTemplate()}\n <div>\n <slot name=\"title\" part=\"title\"></slot>\n <slot name=\"subtitle\" part=\"subtitle\"></slot>\n </div>\n </div>\n `;\n }\n\n private contentTemplate() {\n return html`\n <div\n part=\"content\"\n role=\"region\"\n id=\"${this.panelId!}-content\"\n aria-labelledby=\"${this.panelId!}-header\"\n .inert=${!this.open}\n aria-hidden=${!this.open}\n >\n <slot></slot>\n </div>\n `;\n }\n\n protected override render() {\n return html`${this.headerTemplate()}${this.contentTemplate()}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-expansion-panel': IgcExpansionPanelComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"expansion-panel.js","sourceRoot":"","sources":["../../../src/components/expansion-panel/expansion-panel.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAO,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,MAAM,EACN,SAAS,EACT,OAAO,GACR,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAmChC,IAAM,0BAA0B,kCAAhC,MAAM,0BAA2B,SAAQ,iBAAiB,CAGvE,UAAU,CAAC;IAIJ,MAAM,CAAC,QAAQ;QACpB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAoCD;QACE,KAAK,EAAE,CAAC;QAxBH,SAAI,GAAG,KAAK,CAAC;QAOb,aAAQ,GAAG,K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CAAC,IAAI;sBACL,CAAC,IAAI,CAAC,IAAI;;;;KAI3B,CAAC;IACJ,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,GAAG,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;IACjE,CAAC;;AAjNsB,kCAAO,GAAG,qBAAqB,AAAxB,CAAyB;AACzC,iCAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,AAAnB,CAAoB;AAMhB,oCAAS,GAAG,aAAa,EAAE,AAAlB,CAAmB;AAI5C;IADP,qBAAqB,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;8EACH;AAO5C;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wDACvB;AAOb;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4DACnB;AAOjB;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;qEACA;AAGnD;IADT,KAAK,CAAC,mBAAmB,EAAE,IAAI,CAAC;gEACI;AAvClB,0BAA0B;IAD9C,MAAM,CAAC,GAAG,CAAC;GACS,0BAA0B,CAsN9C;eAtNoB,0BAA0B","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { Ref, createRef, ref } from 'lit/directives/ref.js';\n\nimport { styles } from './themes/expansion-panel.base.css.js';\nimport { styles as shared } from './themes/shared/expansion-panel.common.css.js';\nimport { all } from './themes/themes.js';\nimport { AnimationPlayer } from '../../animations/player.js';\nimport { growVerIn, growVerOut } from '../../animations/presets/grow/index.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport {\n addKeybindings,\n altKey,\n arrowDown,\n arrowUp,\n} from '../common/controllers/key-bindings.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { createCounter } from '../common/util.js';\nimport IgcIconComponent from '../icon/icon.js';\n\nexport interface IgcExpansionPanelComponentEventMap {\n igcOpening: CustomEvent<IgcExpansionPanelComponent>;\n igcOpened: CustomEvent<IgcExpansionPanelComponent>;\n igcClosing: CustomEvent<IgcExpansionPanelComponent>;\n igcClosed: CustomEvent<IgcExpansionPanelComponent>;\n}\n\n/**\n * The Expansion Panel Component provides a way to display information in a toggleable way -\n * compact summary view containing title and description and expanded detail view containing\n * additional content to the summary header.\n *\n * @element igc-expansion-panel\n *\n * @slot - renders the default content of the panel\n * @slot title - renders the title of the panel's header\n * @slot subtitle - renders the subtitle of the panel's header\n * @slot indicator - renders the expand/collapsed indicator\n * @slot indicator-expanded - renders the expanded state of the indicator\n *\n * @fires igcOpening - Emitted before opening the expansion panel.\n * @fires igcOpened - Emitted after the expansion panel is opened.\n * @fires igcClosing - Emitted before closing the expansion panel.\n * @fires igcClosed - Emitted after the expansion panel is closed.\n *\n * @csspart header - The container of the expansion indicator, title and subtitle.\n * @csspart title - The title container.\n * @csspart subtitle - The subtitle container.\n * @csspart indicator - The indicator container.\n * @csspart content - The expansion panel's content wrapper.\n */\n\n@themes(all)\nexport default class IgcExpansionPanelComponent extends EventEmitterMixin<\n IgcExpansionPanelComponentEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-expansion-panel';\n public static styles = [styles, shared];\n\n public static register() {\n registerComponent(this, IgcIconComponent);\n }\n\n private static readonly increment = createCounter();\n private animationPlayer!: AnimationPlayer;\n\n @queryAssignedElements({ slot: 'indicator-expanded' })\n private _indicatorExpandedElements!: HTMLElement[];\n\n /**\n * Indicates whether the contents of the control should be visible.\n * @attr\n */\n @property({ reflect: true, type: Boolean })\n public open = false;\n\n /**\n * Get/Set whether the expansion panel is disabled. Disabled panels are ignored for user interactions.\n * @attr\n */\n @property({ reflect: true, type: Boolean })\n public disabled = false;\n\n /**\n * The indicator position of the expansion panel.\n * @attr indicator-position\n */\n @property({ reflect: true, attribute: 'indicator-position' })\n public indicatorPosition: 'start' | 'end' | 'none' = 'start';\n\n @query('[part~=\"content\"]', true)\n protected panelContent!: HTMLElement;\n\n private panelId!: string;\n\n private headerRef: Ref<HTMLDivElement> = createRef();\n\n constructor() {\n super();\n\n addKeybindings(this, {\n ref: this.headerRef,\n bindingDefaults: { preventDefault: true },\n })\n .setActivateHandler(this.toggleWithEvent)\n .set([altKey, arrowDown], this.openWithEvent)\n .set([altKey, arrowUp], this.closeWithEvent);\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n this.panelId =\n this.getAttribute('id') ||\n `igc-expansion-panel-${IgcExpansionPanelComponent.increment()}`;\n }\n\n protected override firstUpdated() {\n this.animationPlayer = new AnimationPlayer(this.panelContent);\n }\n\n private handleClicked() {\n this.headerRef.value!.focus();\n this.toggleWithEvent();\n }\n\n private toggleWithEvent() {\n if (this.disabled) return;\n this.open ? this.closeWithEvent() : this.openWithEvent();\n }\n\n private async toggleAnimation(dir: 'open' | 'close') {\n const animation = dir === 'open' ? growVerIn : growVerOut;\n\n const [_, event] = await Promise.all([\n this.animationPlayer.stopAll(),\n this.animationPlayer.play(animation()),\n ]);\n\n return event.type === 'finish';\n }\n\n private async openWithEvent() {\n if (\n this.open ||\n !this.emitEvent('igcOpening', { cancelable: true, detail: this })\n ) {\n return;\n }\n\n this.open = true;\n\n if (await this.toggleAnimation('open')) {\n this.emitEvent('igcOpened', { detail: this });\n }\n }\n\n private async closeWithEvent() {\n if (\n !this.open ||\n !this.emitEvent('igcClosing', { cancelable: true, detail: this })\n ) {\n return;\n }\n\n this.open = false;\n\n if (await this.toggleAnimation('close')) {\n this.emitEvent('igcClosed', { detail: this });\n }\n }\n\n /** Toggles panel open state. */\n public toggle(): void {\n this.open ? this.hide() : this.show();\n }\n\n /** Hides the panel content. */\n public hide(): void {\n if (this.open) {\n this.toggleAnimation('close');\n }\n\n this.open = false;\n }\n\n /** Shows the panel content. */\n public show(): void {\n if (!this.open) {\n this.toggleAnimation('open');\n }\n\n this.open = true;\n }\n\n private handleSlotChange() {\n this.requestUpdate();\n }\n\n private indicatorTemplate() {\n const indicatorHidden =\n this.open && this._indicatorExpandedElements.length > 0;\n const indicatorExpandedHidden =\n this._indicatorExpandedElements.length < 1 || !this.open;\n\n return html`\n <div part=\"indicator\" aria-hidden=\"true\">\n <slot\n name=\"indicator\"\n ?hidden=${indicatorHidden}\n @slotchange=${this.handleSlotChange}\n >\n <igc-icon\n name=${this.open ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}\n collection=\"internal\"\n >\n </igc-icon>\n </slot>\n <slot\n name=\"indicator-expanded\"\n ?hidden=${indicatorExpandedHidden}\n @slotchange=${this.handleSlotChange}\n ></slot>\n </div>\n `;\n }\n\n private headerTemplate() {\n return html`\n <div\n ${ref(this.headerRef)}\n part=\"header\"\n id=\"${this.panelId!}-header\"\n role=\"button\"\n aria-expanded=\"${this.open}\"\n aria-disabled=\"${this.disabled}\"\n aria-controls=\"${this.panelId!}-content\"\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.handleClicked}\n >\n ${this.indicatorTemplate()}\n <div>\n <slot name=\"title\" part=\"title\"></slot>\n <slot name=\"subtitle\" part=\"subtitle\"></slot>\n </div>\n </div>\n `;\n }\n\n private contentTemplate() {\n return html`\n <div\n part=\"content\"\n role=\"region\"\n id=\"${this.panelId!}-content\"\n aria-labelledby=\"${this.panelId!}-header\"\n .inert=${!this.open}\n aria-hidden=${!this.open}\n >\n <slot></slot>\n </div>\n `;\n }\n\n protected override render() {\n return html`${this.headerTemplate()}${this.contentTemplate()}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-expansion-panel': IgcExpansionPanelComponent;\n }\n}\n"]}
|
|
@@ -8,35 +8,34 @@ import { styles as fluentLight } from './light/expansion-panel.fluent.css.js';
|
|
|
8
8
|
import { styles as indigoLight } from './light/expansion-panel.indigo.css.js';
|
|
9
9
|
import { styles as materialLight } from './light/expansion-panel.material.css.js';
|
|
10
10
|
import { styles as bootstrap } from './shared/expansion-panel.bootstrap.css.js';
|
|
11
|
-
import { styles as shared } from './shared/expansion-panel.common.css.js';
|
|
12
11
|
import { styles as fluent } from './shared/expansion-panel.fluent.css.js';
|
|
13
12
|
import { styles as indigo } from './shared/expansion-panel.indigo.css.js';
|
|
14
13
|
const light = {
|
|
15
14
|
bootstrap: css `
|
|
16
|
-
${
|
|
15
|
+
${bootstrap} ${bootstrapLight}
|
|
17
16
|
`,
|
|
18
17
|
material: css `
|
|
19
|
-
${
|
|
18
|
+
${materialLight}
|
|
20
19
|
`,
|
|
21
20
|
fluent: css `
|
|
22
|
-
${
|
|
21
|
+
${fluent} ${fluentLight}
|
|
23
22
|
`,
|
|
24
23
|
indigo: css `
|
|
25
|
-
${
|
|
24
|
+
${indigo} ${indigoLight}
|
|
26
25
|
`,
|
|
27
26
|
};
|
|
28
27
|
const dark = {
|
|
29
28
|
bootstrap: css `
|
|
30
|
-
${
|
|
29
|
+
${bootstrap} ${bootstrapDark}
|
|
31
30
|
`,
|
|
32
31
|
material: css `
|
|
33
|
-
${
|
|
32
|
+
${materialDark}
|
|
34
33
|
`,
|
|
35
34
|
fluent: css `
|
|
36
|
-
${
|
|
35
|
+
${fluent} ${fluentDark}
|
|
37
36
|
`,
|
|
38
37
|
indigo: css `
|
|
39
|
-
${
|
|
38
|
+
${indigo} ${indigoDark}
|
|
40
39
|
`,
|
|
41
40
|
};
|
|
42
41
|
export const all = { light, dark };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../../src/components/expansion-panel/themes/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1B,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,MAAM,IAAI,UAA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CAAyC,CAAC;AAElF,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,wCAAwC,CAAC;AAG1E,MAAM,KAAK,GAAG;IACZ,SAAS,EAAE,GAAG,CAAA;MACV,SAAS,IAAI,cAAc;GAC9B;IACD,QAAQ,EAAE,GAAG,CAAA;MACT,aAAa;GAChB;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,WAAW;GACxB;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,WAAW;GACxB;CACF,CAAC;AAEF,MAAM,IAAI,GAAG;IACX,SAAS,EAAE,GAAG,CAAA;MACV,SAAS,IAAI,aAAa;GAC7B;IACD,QAAQ,EAAE,GAAG,CAAA;MACT,YAAY;GACf;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,UAAU;GACvB;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,UAAU;GACvB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAW,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\n// Dark Overrides\nimport { styles as bootstrapDark } from './dark/expansion-panel.bootstrap.css.js';\nimport { styles as fluentDark } from './dark/expansion-panel.fluent.css.js';\nimport { styles as indigoDark } from './dark/expansion-panel.indigo.css.js';\nimport { styles as materialDark } from './dark/expansion-panel.material.css.js';\n// Light Overrides\nimport { styles as bootstrapLight } from './light/expansion-panel.bootstrap.css.js';\nimport { styles as fluentLight } from './light/expansion-panel.fluent.css.js';\nimport { styles as indigoLight } from './light/expansion-panel.indigo.css.js';\nimport { styles as materialLight } from './light/expansion-panel.material.css.js';\n// Shared Styles\nimport { styles as bootstrap } from './shared/expansion-panel.bootstrap.css.js';\nimport { styles as fluent } from './shared/expansion-panel.fluent.css.js';\nimport { styles as indigo } from './shared/expansion-panel.indigo.css.js';\nimport { Themes } from '../../../theming/types.js';\n\nconst light = {\n bootstrap: css`\n ${bootstrap} ${bootstrapLight}\n `,\n material: css`\n ${materialLight}\n `,\n fluent: css`\n ${fluent} ${fluentLight}\n `,\n indigo: css`\n ${indigo} ${indigoLight}\n `,\n};\n\nconst dark = {\n bootstrap: css`\n ${bootstrap} ${bootstrapDark}\n `,\n material: css`\n ${materialDark}\n `,\n fluent: css`\n ${fluent} ${fluentDark}\n `,\n indigo: css`\n ${indigo} ${indigoDark}\n `,\n};\n\nexport const all: Themes = { light, dark };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/components/form/form.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAqBtE,MAAqB,gBAAiB,SAAQ,iBAAiB,CAG7D,UAAU,CAAC;IASJ,MAAM,CAAC,QAAQ;QACpB,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IA6BD;QACE,KAAK,EAAE,CAAC;QA5BF,yBAAoB,GAAG;YAC7B,OAAO;YACP,OAAO;YACP,WAAW;YACX,YAAY;YACZ,cAAc;SACf,CAAC;QACM,uBAAkB,GAAG;YAC3B,OAAO;YACP,WAAW;YACX,gBAAgB;YAChB,UAAU;YACV,YAAY;YACZ,YAAY;YACZ,WAAW;YACX,qBAAqB;SACtB,CAAC;QAC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EAAE,KAAK,KAAK,CACrC,CAAC;IACJ,CAAC;IAEO,WAAW,CAAC,KAAiB;QACnC,MAAM,aAAa,GAAQ,KAAK,CAAC,MAAqB,CAAC;QACvD,IACE,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YACtE,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,QAAQ,EAC9C;YACA,IAAI,CAAC,MAAM,EAAE,CAAC;SACf;aAAM,IAAI,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE;YACxD,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AAtKsB,wBAAO,GAAG,UAAU,AAAb,CAAc;AAE9B,uBAAM,GAAG,GAAG,CAAA;;;;GAIzB,AAJmB,CAIlB;eAViB,gBAAgB;AAyCgB;IAAlD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAA2B;AAU/D;IADN,aAAa,CAAC,eAAe,CAAC;8CAS9B;AAIM;IADN,aAAa,CAAC,cAAc,CAAC;6CA6B7B;AAsBM;IADN,cAAc,EAAE;mDA8BhB","sourcesContent":["import { LitElement, css, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { alternateName } from '../common/decorators/alternateName.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\n\nexport interface IgcFormEventMap {\n igcSubmit: CustomEvent<FormData>;\n igcReset: CustomEvent;\n}\n\n/**\n * The form is a component used to collect user input from\n * interactive controls.\n *\n * @element igc-form\n *\n * @slot - Default slot for the form.\n *\n * @fires igcSubmit - Emitted when the form is submitted.\n * @fires igcReset - Emitted when the form is reset.\n *\n * @deprecated - since version 4.4.0\n * Use the native `<form>` element instead.\n */\nexport default class IgcFormComponent extends EventEmitterMixin<\n IgcFormEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-form';\n\n public static styles = css`\n :host {\n display: block;\n }\n `;\n\n public static register() {\n registerComponent(this);\n }\n\n private _controlsWithChecked = [\n 'input',\n 'radio',\n 'igc-radio',\n 'igc-switch',\n 'igc-checkbox',\n ];\n private _controlsWithValue = [\n 'input',\n 'igc-input',\n 'igc-mask-input',\n 'textarea',\n 'igc-rating',\n 'igc-select',\n 'igc-combo',\n 'igc-date-time-input',\n ];\n private _controlsThatSubmit = [\n 'input',\n 'button',\n 'igc-button',\n 'igc-icon-button',\n ];\n\n /** Specifies if form data validation should be skipped on submit. */\n @property({ type: Boolean, reflect: true }) public novalidate = false;\n\n constructor() {\n super();\n\n this.addEventListener('click', this.handleClick);\n }\n\n /** Submits the form. */\n @alternateName('performSubmit')\n public submit(): boolean {\n const formData = this.getFormData();\n if (!this.novalidate && !this.reportValidity()) {\n return false;\n }\n\n this.emitEvent('igcSubmit', { detail: formData });\n return true;\n }\n\n /** Resets the form. */\n @alternateName('performReset')\n public reset() {\n const formElements = this.getFormElements();\n formElements.forEach((element) => {\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'select') {\n for (let i = 0; i < element.options.length; i++) {\n const option = element.options[i];\n option.selected = option.defaultSelected;\n }\n } else if (\n (tagName === 'input' &&\n (element.type === 'checkbox' || element.type == 'radio')) ||\n (tagName !== 'input' && this._controlsWithChecked.includes(tagName))\n ) {\n element.checked = element.hasAttribute('checked');\n } else if (\n tagName === 'igc-input' ||\n tagName === 'igc-rating' ||\n tagName === 'igc-mask-input' ||\n tagName === 'igc-date-time-input'\n ) {\n element.value = element.getAttribute('value');\n } else if (this._controlsWithValue.includes(tagName)) {\n element.value = element.defaultValue;\n }\n });\n\n this.emitEvent('igcReset');\n }\n\n private getFormElements(): any[] {\n const slot = this.shadowRoot?.querySelector('slot');\n const assignedElements = slot?.assignedElements({ flatten: true });\n const formElements: any[] = [];\n assignedElements?.forEach((element: any) => {\n if (!element.disabled) {\n formElements.push(element);\n }\n const children = Array.from(element.getElementsByTagName('*')).filter(\n (element: any) => !element.disabled\n );\n formElements.push(...children);\n });\n\n return formElements;\n }\n\n //suppressing in blazor for now due to an issue, bringing it back later\n /** Retrieves the data from the form in the format of a FormData object. */\n @blazorSuppress()\n public getFormData() {\n const formData = new FormData();\n\n const formElements = this.getFormElements();\n formElements.forEach((element) => {\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'select') {\n for (let i = 0; i < element.options.length; i++) {\n const option = element.options[i];\n if (option.selected) {\n formData.append(element.name, option.value);\n }\n }\n } else if (\n this._controlsWithChecked.includes(tagName) &&\n element.checked\n ) {\n formData.append(element.name, element.value || 'on');\n } else if (\n this._controlsWithValue.includes(tagName) &&\n element.type !== 'checkbox' &&\n element.type !== 'radio' &&\n element.type !== 'submit'\n ) {\n formData.append(element.name, element.value);\n }\n });\n\n return formData;\n }\n\n /** Checks for validity of the form. */\n public reportValidity(): boolean {\n const formElements = this.getFormElements();\n return !formElements.some(\n (element) =>\n typeof element.reportValidity === 'function' &&\n element.reportValidity() === false\n );\n }\n\n private handleClick(event: MouseEvent) {\n const targetElement: any = event.target as HTMLElement;\n if (\n this._controlsThatSubmit.includes(targetElement.tagName.toLowerCase()) &&\n targetElement.type?.toLowerCase() === 'submit'\n ) {\n this.submit();\n } else if (targetElement.type?.toLowerCase() === 'reset') {\n this.reset();\n }\n\n return true;\n }\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-form': IgcFormComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/components/form/form.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAA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,KAAK,EAAE,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AAtKsB,wBAAO,GAAG,UAAU,AAAb,CAAc;AAE9B,uBAAM,GAAG,GAAG,CAAA;;;;GAIzB,AAJmB,CAIlB;eAViB,gBAAgB;AAyCgB;IAAlD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAA2B;AAU/D;IADN,aAAa,CAAC,eAAe,CAAC;8CAS9B;AAIM;IADN,aAAa,CAAC,cAAc,CAAC;6CA6B7B;AAsBM;IADN,cAAc,EAAE;mDA8BhB","sourcesContent":["import { LitElement, css, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { alternateName } from '../common/decorators/alternateName.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\n\nexport interface IgcFormEventMap {\n igcSubmit: CustomEvent<FormData>;\n igcReset: CustomEvent;\n}\n\n/**\n * The form is a component used to collect user input from\n * interactive controls.\n *\n * @element igc-form\n *\n * @slot - Default slot for the form.\n *\n * @fires igcSubmit - Emitted when the form is submitted.\n * @fires igcReset - Emitted when the form is reset.\n *\n * @deprecated - since version 4.4.0\n * Use the native `<form>` element instead.\n */\nexport default class IgcFormComponent extends EventEmitterMixin<\n IgcFormEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-form';\n\n public static styles = css`\n :host {\n display: block;\n }\n `;\n\n public static register() {\n registerComponent(this);\n }\n\n private _controlsWithChecked = [\n 'input',\n 'radio',\n 'igc-radio',\n 'igc-switch',\n 'igc-checkbox',\n ];\n private _controlsWithValue = [\n 'input',\n 'igc-input',\n 'igc-mask-input',\n 'textarea',\n 'igc-rating',\n 'igc-select',\n 'igc-combo',\n 'igc-date-time-input',\n ];\n private _controlsThatSubmit = [\n 'input',\n 'button',\n 'igc-button',\n 'igc-icon-button',\n ];\n\n /** Specifies if form data validation should be skipped on submit. */\n @property({ type: Boolean, reflect: true }) public novalidate = false;\n\n constructor() {\n super();\n\n this.addEventListener('click', this.handleClick);\n }\n\n /** Submits the form. */\n @alternateName('performSubmit')\n public submit(): boolean {\n const formData = this.getFormData();\n if (!this.novalidate && !this.reportValidity()) {\n return false;\n }\n\n this.emitEvent('igcSubmit', { detail: formData });\n return true;\n }\n\n /** Resets the form. */\n @alternateName('performReset')\n public reset() {\n const formElements = this.getFormElements();\n formElements.forEach((element) => {\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'select') {\n for (let i = 0; i < element.options.length; i++) {\n const option = element.options[i];\n option.selected = option.defaultSelected;\n }\n } else if (\n (tagName === 'input' &&\n (element.type === 'checkbox' || element.type == 'radio')) ||\n (tagName !== 'input' && this._controlsWithChecked.includes(tagName))\n ) {\n element.checked = element.hasAttribute('checked');\n } else if (\n tagName === 'igc-input' ||\n tagName === 'igc-rating' ||\n tagName === 'igc-mask-input' ||\n tagName === 'igc-date-time-input'\n ) {\n element.value = element.getAttribute('value');\n } else if (this._controlsWithValue.includes(tagName)) {\n element.value = element.defaultValue;\n }\n });\n\n this.emitEvent('igcReset');\n }\n\n private getFormElements(): any[] {\n const slot = this.shadowRoot?.querySelector('slot');\n const assignedElements = slot?.assignedElements({ flatten: true });\n const formElements: any[] = [];\n assignedElements?.forEach((element: any) => {\n if (!element.disabled) {\n formElements.push(element);\n }\n const children = Array.from(element.getElementsByTagName('*')).filter(\n (element: any) => !element.disabled\n );\n formElements.push(...children);\n });\n\n return formElements;\n }\n\n //suppressing in blazor for now due to an issue, bringing it back later\n /** Retrieves the data from the form in the format of a FormData object. */\n @blazorSuppress()\n public getFormData() {\n const formData = new FormData();\n\n const formElements = this.getFormElements();\n formElements.forEach((element) => {\n const tagName = element.tagName.toLowerCase();\n if (tagName === 'select') {\n for (let i = 0; i < element.options.length; i++) {\n const option = element.options[i];\n if (option.selected) {\n formData.append(element.name, option.value);\n }\n }\n } else if (\n this._controlsWithChecked.includes(tagName) &&\n element.checked\n ) {\n formData.append(element.name, element.value || 'on');\n } else if (\n this._controlsWithValue.includes(tagName) &&\n element.type !== 'checkbox' &&\n element.type !== 'radio' &&\n element.type !== 'submit'\n ) {\n formData.append(element.name, element.value);\n }\n });\n\n return formData;\n }\n\n /** Checks for validity of the form. */\n public reportValidity(): boolean {\n const formElements = this.getFormElements();\n return !formElements.some(\n (element) =>\n typeof element.reportValidity === 'function' &&\n element.reportValidity() === false\n );\n }\n\n private handleClick(event: MouseEvent) {\n const targetElement: any = event.target as HTMLElement;\n if (\n this._controlsThatSubmit.includes(targetElement.tagName.toLowerCase()) &&\n targetElement.type?.toLowerCase() === 'submit'\n ) {\n this.submit();\n } else if (targetElement.type?.toLowerCase() === 'reset') {\n this.reset();\n }\n\n return true;\n }\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-form': IgcFormComponent;\n }\n}\n"]}
|
|
@@ -9,9 +9,9 @@ declare const IgcIconComponent_base: import("../common/mixins/constructor.js").C
|
|
|
9
9
|
*/
|
|
10
10
|
export default class IgcIconComponent extends IgcIconComponent_base {
|
|
11
11
|
static readonly tagName = "igc-icon";
|
|
12
|
-
static styles: import("lit").CSSResult;
|
|
12
|
+
static styles: import("lit").CSSResult[];
|
|
13
13
|
static register(): void;
|
|
14
|
-
private
|
|
14
|
+
private __internals;
|
|
15
15
|
private svg;
|
|
16
16
|
/**
|
|
17
17
|
* The name of the icon glyph to draw.
|
package/components/icon/icon.js
CHANGED
|
@@ -9,9 +9,9 @@ import { property, state } from 'lit/decorators.js';
|
|
|
9
9
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
10
10
|
import { getIconRegistry, registerIconFromText as registerIconFromText_impl, registerIcon as registerIcon_impl, } from './icon.registry.js';
|
|
11
11
|
import { styles } from './themes/icon.base.css.js';
|
|
12
|
+
import { styles as shared } from './themes/shared/icon.common.css.js';
|
|
12
13
|
import { all } from './themes/themes.js';
|
|
13
14
|
import { themes } from '../../theming/theming-decorator.js';
|
|
14
|
-
import { alternateName } from '../common/decorators/alternateName.js';
|
|
15
15
|
import { blazorInclude } from '../common/decorators/blazorInclude.js';
|
|
16
16
|
import { watch } from '../common/decorators/watch.js';
|
|
17
17
|
import { registerComponent } from '../common/definitions/register.js';
|
|
@@ -31,9 +31,9 @@ let IgcIconComponent = class IgcIconComponent extends SizableMixin(LitElement) {
|
|
|
31
31
|
this.getIcon();
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
this.
|
|
34
|
+
this.__internals = this.attachInternals();
|
|
35
|
+
this.__internals.role = 'img';
|
|
35
36
|
this.size = 'medium';
|
|
36
|
-
this._internals.role = 'img';
|
|
37
37
|
}
|
|
38
38
|
connectedCallback() {
|
|
39
39
|
super.connectedCallback();
|
|
@@ -51,7 +51,7 @@ let IgcIconComponent = class IgcIconComponent extends SizableMixin(LitElement) {
|
|
|
51
51
|
getIcon() {
|
|
52
52
|
const { svg, title } = getIconRegistry().get(this.name, this.collection) ?? {};
|
|
53
53
|
this.svg = svg ?? '';
|
|
54
|
-
this.
|
|
54
|
+
this.__internals.ariaLabel = title ?? null;
|
|
55
55
|
}
|
|
56
56
|
render() {
|
|
57
57
|
return html `${unsafeSVG(this.svg)}`;
|
|
@@ -64,13 +64,12 @@ let IgcIconComponent = class IgcIconComponent extends SizableMixin(LitElement) {
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
IgcIconComponent.tagName = 'igc-icon';
|
|
67
|
-
IgcIconComponent.styles = styles;
|
|
67
|
+
IgcIconComponent.styles = [styles, shared];
|
|
68
68
|
__decorate([
|
|
69
69
|
state()
|
|
70
70
|
], IgcIconComponent.prototype, "svg", void 0);
|
|
71
71
|
__decorate([
|
|
72
|
-
property()
|
|
73
|
-
alternateName('iconName')
|
|
72
|
+
property()
|
|
74
73
|
], IgcIconComponent.prototype, "name", void 0);
|
|
75
74
|
__decorate([
|
|
76
75
|
property()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EACL,eAAe,EACf,oBAAoB,IAAI,yBAAyB,EACjD,YAAY,IAAI,iBAAiB,GAClC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EACL,eAAe,EACf,oBAAoB,IAAI,yBAAyB,EACjD,YAAY,IAAI,iBAAiB,GAClC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,M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state } from 'lit/decorators.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\n\nimport {\n getIconRegistry,\n registerIconFromText as registerIconFromText_impl,\n registerIcon as registerIcon_impl,\n} from './icon.registry.js';\nimport { styles } from './themes/icon.base.css.js';\nimport { styles as shared } from './themes/shared/icon.common.css.js';\nimport { all } from './themes/themes.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { blazorInclude } from '../common/decorators/blazorInclude.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { SizableMixin } from '../common/mixins/sizable.js';\n\n/**\n * The icon component allows visualizing collections of pre-registered SVG icons.\n *\n * @element igc-icon\n *\n *\n */\n@themes(all)\nexport default class IgcIconComponent extends SizableMixin(LitElement) {\n public static readonly tagName = 'igc-icon';\n public static override styles = [styles, shared];\n\n public static register() {\n registerComponent(this);\n }\n\n private __internals: ElementInternals;\n\n @state()\n private svg = '';\n\n /* alternateName: iconName */\n /**\n * The name of the icon glyph to draw.\n * @attr\n */\n @property()\n public name = '';\n\n /**\n * The name of the registered collection for look up of icons.\n * Defaults to `default`.\n * @attr\n */\n @property()\n public collection = 'default';\n\n /**\n * Whether to flip the icon. Useful for RTL layouts.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public mirrored = false;\n\n constructor() {\n super();\n this.__internals = this.attachInternals();\n this.__internals.role = 'img';\n this.size = 'medium';\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n getIconRegistry().subscribe(this.iconLoaded);\n }\n\n public override disconnectedCallback() {\n getIconRegistry().unsubscribe(this.iconLoaded);\n super.disconnectedCallback();\n }\n\n @watch('name')\n @watch('collection')\n protected iconChanged(prev: string, curr: string) {\n if (prev !== curr) {\n this.getIcon();\n }\n }\n\n private iconLoaded = (name: string, collection: string) => {\n if (this.name === name && this.collection === collection) {\n this.getIcon();\n }\n };\n\n private getIcon() {\n const { svg, title } =\n getIconRegistry().get(this.name, this.collection) ?? {};\n\n this.svg = svg ?? '';\n this.__internals.ariaLabel = title ?? null;\n }\n\n protected override render() {\n return html`${unsafeSVG(this.svg)}`;\n }\n\n /* c8 ignore next 8 */\n @blazorInclude()\n protected async registerIcon(\n name: string,\n url: string,\n collection = 'default'\n ) {\n await registerIcon_impl(name, url, collection);\n }\n\n /* c8 ignore next 8 */\n @blazorInclude()\n protected registerIconFromText(\n name: string,\n iconText: string,\n collection = 'default'\n ) {\n registerIconFromText_impl(name, iconText, collection);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-icon': IgcIconComponent;\n }\n}\n"]}
|