@aquera/nile-elements 0.0.110 → 0.0.111
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/README.md +5 -0
- package/dist/{angular-ts-7f0ea228.cjs.js → angular-ts-f3444056.cjs.js} +2 -2
- package/dist/{angular-ts-7f0ea228.cjs.js.map → angular-ts-f3444056.cjs.js.map} +1 -1
- package/dist/{github-dark-default-2257ba5e.cjs.js → github-dark-default-450c7c01.cjs.js} +2 -2
- package/dist/{github-dark-default-2257ba5e.cjs.js.map → github-dark-default-450c7c01.cjs.js.map} +1 -1
- package/dist/{github-dark-default-5814263b.esm.js → github-dark-default-c8549d91.esm.js} +1 -1
- package/dist/{github-dark-dimmed-b7e46b3b.esm.js → github-dark-dimmed-2d99017f.esm.js} +1 -1
- package/dist/{github-dark-dimmed-5703df55.cjs.js → github-dark-dimmed-ef1406bd.cjs.js} +2 -2
- package/dist/{github-dark-dimmed-5703df55.cjs.js.map → github-dark-dimmed-ef1406bd.cjs.js.map} +1 -1
- package/dist/{github-dark-high-contrast-af204903.cjs.js → github-dark-high-contrast-60f6edfa.cjs.js} +2 -2
- package/dist/{github-dark-high-contrast-af204903.cjs.js.map → github-dark-high-contrast-60f6edfa.cjs.js.map} +1 -1
- package/dist/{github-dark-high-contrast-917c210a.esm.js → github-dark-high-contrast-eb093cb4.esm.js} +1 -1
- package/dist/{github-light-default-a8b27e0c.esm.js → github-light-default-97194ef6.esm.js} +1 -1
- package/dist/{github-light-default-f34de887.cjs.js → github-light-default-cf60a983.cjs.js} +2 -2
- package/dist/{github-light-default-f34de887.cjs.js.map → github-light-default-cf60a983.cjs.js.map} +1 -1
- package/dist/{github-light-high-contrast-17c40b3b.esm.js → github-light-high-contrast-0ddc875a.esm.js} +1 -1
- package/dist/{github-light-high-contrast-ef2e56e6.cjs.js → github-light-high-contrast-ab424680.cjs.js} +2 -2
- package/dist/{github-light-high-contrast-ef2e56e6.cjs.js.map → github-light-high-contrast-ab424680.cjs.js.map} +1 -1
- package/dist/hy-431f15f8.cjs.js +2 -0
- package/dist/hy-431f15f8.cjs.js.map +1 -0
- package/dist/hy-5e43d6c1.esm.js +1 -0
- package/dist/{mermaid-7f9972ac.cjs.js → mermaid-76489bb0.cjs.js} +2 -2
- package/dist/{mermaid-7f9972ac.cjs.js.map → mermaid-76489bb0.cjs.js.map} +1 -1
- package/dist/{mermaid-94e78bd4.esm.js → mermaid-ca28664b.esm.js} +1 -1
- package/dist/mipsasm-535432b4.cjs.js +2 -0
- package/dist/mipsasm-535432b4.cjs.js.map +1 -0
- package/dist/mipsasm-57581c0d.esm.js +1 -0
- package/dist/nile-accordion/nile-accordion.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordion.cjs.js.map +1 -1
- package/dist/nile-accordion/nile-accordion.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
- package/dist/nile-avatar/nile-avatar.cjs.js +1 -1
- package/dist/nile-avatar/nile-avatar.cjs.js.map +1 -1
- package/dist/nile-avatar/nile-avatar.esm.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
- package/dist/nile-badge/nile-badge.esm.js +1 -1
- package/dist/nile-breadcrumb/nile-breadcrumb.cjs.js +1 -1
- package/dist/nile-breadcrumb/nile-breadcrumb.cjs.js.map +1 -1
- package/dist/nile-breadcrumb/nile-breadcrumb.esm.js +1 -1
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js +1 -1
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js.map +1 -1
- package/dist/nile-breadcrumb-item/nile-breadcrumb-item.esm.js +2 -2
- package/dist/nile-button/nile-button.cjs.js +1 -1
- package/dist/nile-button/nile-button.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.esm.js +1 -1
- package/dist/nile-button-toggle/nile-button-toggle.cjs.js +1 -1
- package/dist/nile-button-toggle/nile-button-toggle.cjs.js.map +1 -1
- package/dist/nile-button-toggle/nile-button-toggle.esm.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js.map +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.esm.js +1 -1
- package/dist/nile-card/nile-card.cjs.js +1 -1
- package/dist/nile-card/nile-card.cjs.js.map +1 -1
- package/dist/nile-card/nile-card.esm.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.esm.js +3 -3
- package/dist/nile-chip/nile-chip.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
- package/dist/nile-content-editor/nile-content-editor.cjs.js +1 -1
- package/dist/nile-content-editor/nile-content-editor.cjs.js.map +1 -1
- package/dist/nile-content-editor/nile-content-editor.esm.js +5 -5
- package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
- package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
- package/dist/nile-date-picker/nile-date-picker.esm.js +3 -5
- package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
- package/dist/nile-dialog/nile-dialog.esm.js +8 -6
- package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.esm.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.cjs.js.map +1 -1
- package/dist/nile-empty-state/nile-empty-state.esm.js +1 -1
- package/dist/nile-highlighter/nile-highlighter.cjs.js +1 -1
- package/dist/nile-highlighter/nile-highlighter.cjs.js.map +1 -1
- package/dist/nile-highlighter/nile-highlighter.esm.js +2 -2
- package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
- package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.esm.js +1 -1
- package/dist/nile-link/index.cjs.js +1 -1
- package/dist/nile-link/index.esm.js +1 -1
- package/dist/nile-link/nile-link.cjs.js +1 -1
- package/dist/nile-link/nile-link.cjs.js.map +1 -1
- package/dist/nile-link/nile-link.esm.js +4 -4
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.cjs.js.map +1 -1
- package/dist/nile-link/nile-link.test.esm.js +1 -1
- package/dist/nile-list/nile-list.cjs.js +1 -1
- package/dist/nile-list/nile-list.cjs.js.map +1 -1
- package/dist/nile-list/nile-list.esm.js +1 -1
- package/dist/nile-list-item/nile-list-item.cjs.js +1 -1
- package/dist/nile-list-item/nile-list-item.cjs.js.map +1 -1
- package/dist/nile-list-item/nile-list-item.esm.js +1 -1
- package/dist/nile-menu/nile-menu.cjs.js +1 -1
- package/dist/nile-menu/nile-menu.cjs.js.map +1 -1
- package/dist/nile-menu/nile-menu.esm.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
- package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.esm.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.esm.js +2 -2
- package/dist/nile-popup/nile-popup.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.cjs.js.map +1 -1
- package/dist/nile-popup/nile-popup.esm.js +1 -1
- package/dist/nile-radio/nile-radio.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.cjs.js.map +1 -1
- package/dist/nile-radio/nile-radio.esm.js +4 -4
- package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
- package/dist/nile-radio-group/nile-radio-group.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js.map +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.esm.js +1 -1
- package/dist/nile-split-panel/nile-split-panel.cjs.js +1 -1
- package/dist/nile-split-panel/nile-split-panel.cjs.js.map +1 -1
- package/dist/nile-split-panel/nile-split-panel.esm.js +1 -1
- package/dist/nile-stepper/nile-stepper.cjs.js +1 -1
- package/dist/nile-stepper/nile-stepper.cjs.js.map +1 -1
- package/dist/nile-stepper/nile-stepper.esm.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
- package/dist/nile-tab/nile-tab.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
- package/dist/nile-tab-group/nile-tab-group.esm.js +2 -2
- package/dist/nile-table-body/nile-table-body.cjs.js +1 -1
- package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
- package/dist/nile-table-body/nile-table-body.esm.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.cjs.js +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.cjs.js.map +1 -1
- package/dist/nile-table-header-item/nile-table-header-item.esm.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.esm.js +1 -1
- package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
- package/dist/nile-textarea/nile-textarea.esm.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
- package/dist/nile-toast/nile-toast.esm.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.esm.js +1 -1
- package/dist/nile-tree/nile-tree.cjs.js +1 -1
- package/dist/nile-tree/nile-tree.cjs.js.map +1 -1
- package/dist/nile-tree/nile-tree.esm.js +1 -1
- package/dist/nile-tree-item/nile-tree-item.cjs.js +1 -1
- package/dist/nile-tree-item/nile-tree-item.cjs.js.map +1 -1
- package/dist/nile-tree-item/nile-tree-item.esm.js +1 -1
- package/dist/sass-16055185.esm.js +1 -0
- package/dist/sass-4bfa8a08.cjs.js +2 -0
- package/dist/sass-4bfa8a08.cjs.js.map +1 -0
- package/dist/{sparql-f0d04e05.cjs.js → sparql-ebe1ddf3.cjs.js} +2 -2
- package/dist/{sparql-f0d04e05.cjs.js.map → sparql-ebe1ddf3.cjs.js.map} +1 -1
- package/dist/src/nile-accordion/nile-accordion.d.ts +1 -0
- package/dist/src/nile-accordion/nile-accordion.js +1 -0
- package/dist/src/nile-accordion/nile-accordion.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +1 -0
- package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -0
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-avatar/nile-avatar.d.ts +1 -0
- package/dist/src/nile-avatar/nile-avatar.js +1 -0
- package/dist/src/nile-avatar/nile-avatar.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.d.ts +1 -0
- package/dist/src/nile-badge/nile-badge.js +1 -0
- package/dist/src/nile-badge/nile-badge.js.map +1 -1
- package/dist/src/nile-breadcrumb/nile-breadcrumb.d.ts +1 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.js +5 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.js.map +1 -1
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.d.ts +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js.map +1 -1
- package/dist/src/nile-button/nile-button.d.ts +1 -0
- package/dist/src/nile-button/nile-button.js +1 -0
- package/dist/src/nile-button/nile-button.js.map +1 -1
- package/dist/src/nile-button-toggle/nile-button-toggle.d.ts +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.js +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.js.map +1 -1
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.d.ts +1 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js +1 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
- package/dist/src/nile-calendar/nile-calendar.js +1 -0
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-card/nile-card.d.ts +1 -0
- package/dist/src/nile-card/nile-card.js +1 -0
- package/dist/src/nile-card/nile-card.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.d.ts +1 -0
- package/dist/src/nile-checkbox/nile-checkbox.js +3 -7
- package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.d.ts +1 -0
- package/dist/src/nile-chip/nile-chip.js +1 -0
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.d.ts +1 -0
- package/dist/src/nile-code-editor/nile-code-editor.js +1 -0
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-content-editor/nile-content-editor.d.ts +1 -0
- package/dist/src/nile-content-editor/nile-content-editor.js +1 -0
- package/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
- package/dist/src/nile-date-picker/nile-date-picker.d.ts +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.js +2 -4
- package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
- package/dist/src/nile-dialog/nile-dialog.d.ts +1 -0
- package/dist/src/nile-dialog/nile-dialog.js +10 -7
- package/dist/src/nile-dialog/nile-dialog.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.d.ts +1 -0
- package/dist/src/nile-drawer/nile-drawer.js +1 -0
- package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
- package/dist/src/nile-empty-state/nile-empty-state.d.ts +1 -0
- package/dist/src/nile-empty-state/nile-empty-state.js +1 -0
- package/dist/src/nile-empty-state/nile-empty-state.js.map +1 -1
- package/dist/src/nile-icon-button/nile-icon-button.d.ts +1 -0
- package/dist/src/nile-icon-button/nile-icon-button.js +1 -0
- package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
- package/dist/src/nile-input/nile-input.d.ts +1 -0
- package/dist/src/nile-input/nile-input.js +1 -0
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-link/nile-link.d.ts +1 -0
- package/dist/src/nile-link/nile-link.js +2 -2
- package/dist/src/nile-link/nile-link.js.map +1 -1
- package/dist/src/nile-list/nile-list.d.ts +1 -0
- package/dist/src/nile-list/nile-list.js +5 -0
- package/dist/src/nile-list/nile-list.js.map +1 -1
- package/dist/src/nile-list-item/nile-list-item.d.ts +1 -0
- package/dist/src/nile-list-item/nile-list-item.js +1 -0
- package/dist/src/nile-list-item/nile-list-item.js.map +1 -1
- package/dist/src/nile-menu/nile-menu.d.ts +1 -0
- package/dist/src/nile-menu/nile-menu.js +1 -0
- package/dist/src/nile-menu/nile-menu.js.map +1 -1
- package/dist/src/nile-menu-item/nile-menu-item.d.ts +2 -0
- package/dist/src/nile-menu-item/nile-menu-item.js +3 -5
- package/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
- package/dist/src/nile-option/nile-option.d.ts +2 -0
- package/dist/src/nile-option/nile-option.js +3 -5
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-popover/nile-popover.d.ts +1 -0
- package/dist/src/nile-popover/nile-popover.js +3 -2
- package/dist/src/nile-popover/nile-popover.js.map +1 -1
- package/dist/src/nile-popup/nile-popup.d.ts +2 -0
- package/dist/src/nile-popup/nile-popup.js +2 -0
- package/dist/src/nile-popup/nile-popup.js.map +1 -1
- package/dist/src/nile-radio/nile-radio.js +2 -8
- package/dist/src/nile-radio/nile-radio.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.d.ts +1 -0
- package/dist/src/nile-radio-group/nile-radio-group.js +1 -0
- package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +1 -0
- package/dist/src/nile-select/nile-select.js +1 -0
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-slide-toggle/nile-slide-toggle.d.ts +1 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.js +2 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
- package/dist/src/nile-split-panel/nile-split-panel.d.ts +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.js +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.js.map +1 -1
- package/dist/src/nile-stepper/nile-stepper.d.ts +1 -0
- package/dist/src/nile-stepper/nile-stepper.js +1 -0
- package/dist/src/nile-stepper/nile-stepper.js.map +1 -1
- package/dist/src/nile-tab/nile-tab.d.ts +1 -0
- package/dist/src/nile-tab/nile-tab.js +3 -2
- package/dist/src/nile-tab/nile-tab.js.map +1 -1
- package/dist/src/nile-tab-group/nile-tab-group.d.ts +1 -0
- package/dist/src/nile-tab-group/nile-tab-group.js +3 -2
- package/dist/src/nile-tab-group/nile-tab-group.js.map +1 -1
- package/dist/src/nile-table-body/nile-table-body.d.ts +1 -0
- package/dist/src/nile-table-body/nile-table-body.js +1 -0
- package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
- package/dist/src/nile-table-header-item/nile-table-header-item.d.ts +1 -0
- package/dist/src/nile-table-header-item/nile-table-header-item.js +1 -0
- package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
- package/dist/src/nile-tag/nile-tag.d.ts +1 -0
- package/dist/src/nile-tag/nile-tag.js +1 -0
- package/dist/src/nile-tag/nile-tag.js.map +1 -1
- package/dist/src/nile-textarea/nile-textarea.d.ts +1 -0
- package/dist/src/nile-textarea/nile-textarea.js +1 -0
- package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
- package/dist/src/nile-toast/nile-toast.d.ts +1 -0
- package/dist/src/nile-toast/nile-toast.js +1 -0
- package/dist/src/nile-toast/nile-toast.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.d.ts +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.js +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
- package/dist/src/nile-tree/nile-tree.d.ts +1 -0
- package/dist/src/nile-tree/nile-tree.js +1 -0
- package/dist/src/nile-tree/nile-tree.js.map +1 -1
- package/dist/src/nile-tree-item/nile-tree-item.d.ts +1 -0
- package/dist/src/nile-tree-item/nile-tree-item.js +1 -0
- package/dist/src/nile-tree-item/nile-tree-item.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{twig-4e6df20b.cjs.js → twig-2431875e.cjs.js} +2 -2
- package/dist/{twig-4e6df20b.cjs.js.map → twig-2431875e.cjs.js.map} +1 -1
- package/dist/{vue-html-4845664e.cjs.js → vue-html-36dd3960.cjs.js} +2 -2
- package/dist/{vue-html-4845664e.cjs.js.map → vue-html-36dd3960.cjs.js.map} +1 -1
- package/package.json +1 -1
- package/src/nile-accordion/nile-accordion.ts +1 -0
- package/src/nile-auto-complete/nile-auto-complete.ts +3 -1
- package/src/nile-avatar/nile-avatar.ts +2 -0
- package/src/nile-badge/nile-badge.ts +2 -0
- package/src/nile-breadcrumb/nile-breadcrumb.ts +2 -0
- package/src/nile-breadcrumb-item/nile-breadcrumb-item.ts +2 -0
- package/src/nile-button/nile-button.ts +2 -0
- package/src/nile-button-toggle/nile-button-toggle.ts +2 -0
- package/src/nile-button-toggle-group/nile-button-toggle-group.ts +2 -0
- package/src/nile-calendar/nile-calendar.ts +2 -0
- package/src/nile-card/nile-card.ts +2 -0
- package/src/nile-checkbox/nile-checkbox.ts +4 -9
- package/src/nile-chip/nile-chip.ts +2 -0
- package/src/nile-code-editor/nile-code-editor.ts +2 -0
- package/src/nile-content-editor/nile-content-editor.ts +2 -0
- package/src/nile-date-picker/nile-date-picker.ts +3 -4
- package/src/nile-dialog/nile-dialog.ts +12 -8
- package/src/nile-drawer/nile-drawer.ts +2 -0
- package/src/nile-empty-state/nile-empty-state.ts +2 -0
- package/src/nile-icon-button/nile-icon-button.ts +2 -0
- package/src/nile-input/nile-input.ts +2 -0
- package/src/nile-link/nile-link.ts +3 -1
- package/src/nile-list/nile-list.ts +2 -0
- package/src/nile-list-item/nile-list-item.ts +2 -0
- package/src/nile-menu/nile-menu.ts +3 -0
- package/src/nile-menu-item/nile-menu-item.ts +4 -5
- package/src/nile-option/nile-option.ts +4 -5
- package/src/nile-popover/nile-popover.ts +4 -2
- package/src/nile-popup/nile-popup.ts +3 -0
- package/src/nile-radio/nile-radio.ts +2 -12
- package/src/nile-radio-group/nile-radio-group.ts +2 -0
- package/src/nile-select/nile-select.ts +2 -0
- package/src/nile-slide-toggle/nile-slide-toggle.ts +3 -0
- package/src/nile-split-panel/nile-split-panel.ts +2 -0
- package/src/nile-stepper/nile-stepper.ts +2 -0
- package/src/nile-tab/nile-tab.ts +4 -2
- package/src/nile-tab-group/nile-tab-group.ts +4 -2
- package/src/nile-table-body/nile-table-body.ts +2 -0
- package/src/nile-table-header-item/nile-table-header-item.ts +2 -0
- package/src/nile-tag/nile-tag.ts +2 -0
- package/src/nile-textarea/nile-textarea.ts +2 -0
- package/src/nile-toast/nile-toast.ts +2 -0
- package/src/nile-tooltip/nile-tooltip.ts +2 -0
- package/src/nile-tree/nile-tree.ts +2 -0
- package/src/nile-tree-item/nile-tree-item.ts +2 -0
- package/dist/hy-70a23b1a.cjs.js +0 -2
- package/dist/hy-70a23b1a.cjs.js.map +0 -1
- package/dist/hy-c5d98bdd.esm.js +0 -1
- package/dist/sass-07548677.esm.js +0 -1
- package/dist/sass-836693eb.cjs.js +0 -2
- package/dist/sass-836693eb.cjs.js.map +0 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-1a9fb5f1.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-link.cjs.js","tslib","../index-c7ad3b47.cjs.js","lit/decorators.js","./nile-link.css.cjs.js","../slot.cjs.js","lit/directives/if-defined.js","lit/directives/class-map.js","../internal/nile-element.cjs.js","../property-217fe924.cjs.js"],function(_export,_context){"use strict";var i,t,n,e,l,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}return{setters:[function(_fixture004CjsJs){i=_fixture004CjsJs.f;t=_fixture004CjsJs.a;n=_fixture004CjsJs.o;e=_fixture004CjsJs.b;},function(_litStaticHtmlJs){l=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileLinkCjsJs){},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileLinkCssCjsJs){},function(_slotCjsJs){},function(_litDirectivesIfDefinedJs){},function(_litDirectivesClassMapJs){},function(_internalNileElementCjsJs){},function(_property002CjsJs){}],execute:function execute(){describe("NileLink",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var n;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return i(l(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-link></nile-link>"]))));case 2:n=_context2.sent;t(n.shadowRoot).to.exist,t(n.shadowRoot.querySelector(".link")).to.exist;case 4:case"end":return _context2.stop();}},_callee);}))),it("should handle the disabled attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var n,e;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return i(l(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-link disabled></nile-link>"]))));case 2:n=_context3.sent;e=n.shadowRoot.querySelector(".link");t(n.disabled).to.be["true"],t(e.getAttribute("aria-disabled")).to.equal("true"),t(e.getAttribute("tabindex")).to.equal("-1");case 5:case"end":return _context3.stop();}},_callee2);}))),it("should emit custom events on focus and blur",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var e,s,a;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return i(l(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-link></nile-link>"]))));case 2:e=_context4.sent;setTimeout(function(){return e.shadowRoot.querySelector(".link").focus();});_context4.next=6;return n(e,"nile-focus");case 6:s=_context4.sent;t(s).to.exist,setTimeout(function(){return e.shadowRoot.querySelector(".link").blur();});_context4.next=10;return n(e,"nile-blur");case 10:a=_context4.sent;t(a).to.exist;case 12:case"end":return _context4.stop();}},_callee3);}))),it("should prevent click events when disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var n,s;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return i(l(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-link disabled></nile-link>"]))));case 2:n=_context5.sent;s=!1;n.addEventListener("click",function(){s=!0;});n.shadowRoot.querySelector(".link").click();_context5.next=8;return e(100);case 8:t(s).to.be["false"];case 9:case"end":return _context5.stop();}},_callee4);}))),it("should handle button property correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var n;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return i(l(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-link button></nile-link>"]))));case 2:n=_context6.sent.shadowRoot.querySelector(".link");t(n.classList.contains("link__button")).to.be["true"];case 4:case"end":return _context6.stop();}},_callee5);}))),it("should have all slots rendered successfully",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var n,e,s,a;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return i(l(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-link><span slot=\"prefix\">Prefix</span><span>Label</span><span slot=\"suffix\">Suffix</span></nile-link>"]))));case 2:n=_context7.sent;e=n.shadowRoot.querySelector('slot[name="prefix"]');s=n.shadowRoot.querySelector("slot:not([name])");a=n.shadowRoot.querySelector('slot[name="suffix"]');t(e.assignedNodes().length).to.equal(1),t(s.assignedNodes().length).to.equal(1),t(a.assignedNodes().length).to.equal(1);case 7:case"end":return _context7.stop();}},_callee6);}))),it("should emit nile-init and nile-destroy events on connected and disconnected",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var i,n,e;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:i=document.createElement("nile-link");i.addEventListener("nile-init",function(i){return n=i;});i.addEventListener("nile-init",function(i){return e=i;});document.body.appendChild(i);_context8.next=6;return i.updateComplete;case 6:t(n).to.exist;document.body.removeChild(i);_context8.next=10;return i.updateComplete;case 10:t(e).to.exist;case 11:case"end":return _context8.stop();}},_callee7);}))),it("should reflect properties correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var n;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return i(l(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-link></nile-link>"]))));case 2:n=_context9.sent;n.disabled=!0;_context9.next=6;return n.updateComplete;case 6:t(n.hasAttribute("disabled")).to.be["true"];n.disabled=!1;_context9.next=10;return n.updateComplete;case 10:t(n.hasAttribute("disabled")).to.be["false"];case 11:case"end":return _context9.stop();}},_callee8);})));});}};});
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-1a9fb5f1.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-link.cjs.js","tslib","../index-c7ad3b47.cjs.js","lit/decorators.js","./nile-link.css.cjs.js","../slot.cjs.js","lit/directives/class-map.js","../internal/nile-element.cjs.js","../property-217fe924.cjs.js"],function(_export,_context){"use strict";var i,t,n,e,l,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}return{setters:[function(_fixture004CjsJs){i=_fixture004CjsJs.f;t=_fixture004CjsJs.a;n=_fixture004CjsJs.o;e=_fixture004CjsJs.b;},function(_litStaticHtmlJs){l=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileLinkCjsJs){},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileLinkCssCjsJs){},function(_slotCjsJs){},function(_litDirectivesClassMapJs){},function(_internalNileElementCjsJs){},function(_property002CjsJs){}],execute:function execute(){describe("NileLink",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var n;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return i(l(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-link></nile-link>"]))));case 2:n=_context2.sent;t(n.shadowRoot).to.exist,t(n.shadowRoot.querySelector(".link")).to.exist;case 4:case"end":return _context2.stop();}},_callee);}))),it("should handle the disabled attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var n,e;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return i(l(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-link disabled></nile-link>"]))));case 2:n=_context3.sent;e=n.shadowRoot.querySelector(".link");t(n.disabled).to.be["true"],t(e.getAttribute("aria-disabled")).to.equal("true"),t(e.getAttribute("tabindex")).to.equal("-1");case 5:case"end":return _context3.stop();}},_callee2);}))),it("should emit custom events on focus and blur",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var e,s,a;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return i(l(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-link></nile-link>"]))));case 2:e=_context4.sent;setTimeout(function(){return e.shadowRoot.querySelector(".link").focus();});_context4.next=6;return n(e,"nile-focus");case 6:s=_context4.sent;t(s).to.exist,setTimeout(function(){return e.shadowRoot.querySelector(".link").blur();});_context4.next=10;return n(e,"nile-blur");case 10:a=_context4.sent;t(a).to.exist;case 12:case"end":return _context4.stop();}},_callee3);}))),it("should prevent click events when disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var n,s;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return i(l(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-link disabled></nile-link>"]))));case 2:n=_context5.sent;s=!1;n.addEventListener("click",function(){s=!0;});n.shadowRoot.querySelector(".link").click();_context5.next=8;return e(100);case 8:t(s).to.be["false"];case 9:case"end":return _context5.stop();}},_callee4);}))),it("should handle button property correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var n;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return i(l(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-link button></nile-link>"]))));case 2:n=_context6.sent.shadowRoot.querySelector(".link");t(n.classList.contains("link__button")).to.be["true"];case 4:case"end":return _context6.stop();}},_callee5);}))),it("should have all slots rendered successfully",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var n,e,s,a;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return i(l(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-link><span slot=\"prefix\">Prefix</span><span>Label</span><span slot=\"suffix\">Suffix</span></nile-link>"]))));case 2:n=_context7.sent;e=n.shadowRoot.querySelector('slot[name="prefix"]');s=n.shadowRoot.querySelector("slot:not([name])");a=n.shadowRoot.querySelector('slot[name="suffix"]');t(e.assignedNodes().length).to.equal(1),t(s.assignedNodes().length).to.equal(1),t(a.assignedNodes().length).to.equal(1);case 7:case"end":return _context7.stop();}},_callee6);}))),it("should emit nile-init and nile-destroy events on connected and disconnected",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var i,n,e;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:i=document.createElement("nile-link");i.addEventListener("nile-init",function(i){return n=i;});i.addEventListener("nile-init",function(i){return e=i;});document.body.appendChild(i);_context8.next=6;return i.updateComplete;case 6:t(n).to.exist;document.body.removeChild(i);_context8.next=10;return i.updateComplete;case 10:t(e).to.exist;case 11:case"end":return _context8.stop();}},_callee7);}))),it("should reflect properties correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var n;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return i(l(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-link></nile-link>"]))));case 2:n=_context9.sent;n.disabled=!0;_context9.next=6;return n.updateComplete;case 6:t(n.hasAttribute("disabled")).to.be["true"];n.disabled=!1;_context9.next=10;return n.updateComplete;case 10:t(n.hasAttribute("disabled")).to.be["false"];case 11:case"end":return _context9.stop();}},_callee8);})));});}};});
|
2
2
|
//# sourceMappingURL=nile-link.test.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-link.test.cjs.js","sources":["../../../src/nile-link/nile-link.test.ts"],"sourcesContent":["import { fixture, expect, oneEvent, aTimeout } from '@open-wc/testing';\nimport { html } from 'lit/static-html.js';\nimport './nile-link';\nimport { NileLink } from './nile-link';\ndescribe('NileLink', () => {\n it('should render correctly', async () => {\n const el: NileLink = await fixture(html`<nile-link></nile-link>`);\n expect(el.shadowRoot).to.exist;\n expect(el.shadowRoot!.querySelector('.link')).to.exist;\n });\n\n it('should handle the disabled attribute', async () => {\n const el: NileLink = await fixture(html`<nile-link disabled></nile-link>`);\n const link = el.shadowRoot!.querySelector('.link')!;\n expect(el.disabled).to.be.true;\n expect(link.getAttribute('aria-disabled')).to.equal('true');\n expect(link.getAttribute('tabindex')).to.equal('-1');\n });\n\n it('should emit custom events on focus and blur', async () => {\n const el: NileLink = await fixture(html`<nile-link></nile-link>`);\n setTimeout(() => el.shadowRoot!.querySelector<HTMLElement>('.link')!.focus());\n const focusEvent = await oneEvent(el, 'nile-focus');\n expect(focusEvent).to.exist;\n\n setTimeout(() => el.shadowRoot!.querySelector<HTMLElement>('.link')!.blur());\n const blurEvent = await oneEvent(el, 'nile-blur');\n expect(blurEvent).to.exist;\n });\n\n it('should prevent click events when disabled', async () => {\n const el: NileLink = await fixture(html`<nile-link disabled></nile-link>`);\n let clicked = false;\n el.addEventListener('click', () => {\n clicked = true;\n });\n\n el.shadowRoot!.querySelector<HTMLElement>('.link')!.click();\n await aTimeout(100);\n expect(clicked).to.be.false;\n });\n\n it('should handle button property correctly', async () => {\n const el: NileLink = await fixture(html`<nile-link button></nile-link>`);\n const link = el.shadowRoot!.querySelector('.link')!;\n expect(link.classList.contains('link__button')).to.be.true;\n });\n\n it('should have all slots rendered successfully', async () => {\n const el: NileLink = await fixture(html`<nile-link><span slot=\"prefix\">Prefix</span><span>Label</span><span slot=\"suffix\">Suffix</span></nile-link>`);\n const prefixSlot = el.shadowRoot!.querySelector<HTMLSlotElement>('slot[name=\"prefix\"]')!;\n const labelSlot = el.shadowRoot!.querySelector<HTMLSlotElement>('slot:not([name])')!;\n const suffixSlot = el.shadowRoot!.querySelector<HTMLSlotElement>('slot[name=\"suffix\"]')!;\n expect(prefixSlot.assignedNodes().length).to.equal(1);\n expect(labelSlot.assignedNodes().length).to.equal(1);\n expect(suffixSlot.assignedNodes().length).to.equal(1);\n });\n\n\n it('should emit nile-init and nile-destroy events on connected and disconnected', async () => {\n const el: NileLink = document.createElement('nile-link');\n let initEvent:any, destroyEvent:any;\n el.addEventListener('nile-init',(e)=>initEvent=e)\n el.addEventListener('nile-init',(e)=>destroyEvent=e)\n document.body.appendChild(el);\n await el.updateComplete\n expect(initEvent).to.exist;\n document.body.removeChild(el);\n await el.updateComplete\n expect(destroyEvent).to.exist;\n });\n\n it('should reflect properties correctly', async () => {\n const el: NileLink = await fixture(html`<nile-link></nile-link>`);\n el.disabled = true;\n await el.updateComplete;\n expect(el.hasAttribute('disabled')).to.be.true;\n \n el.disabled = false;\n await el.updateComplete;\n expect(el.hasAttribute('disabled')).to.be.false;\n });\n})"],"names":["describe","it","_asyncToGenerator","_regeneratorRuntime","mark","async","fixture","html","_templateObject","_taggedTemplateLiteral","el","expect","shadowRoot","to","exist","querySelector","_context2","stop","_callee","_templateObject2","link","disabled","be","true","getAttribute","equal","_context3","_callee2","_templateObject3","setTimeout","focus","_context4","next","oneEvent","focusEvent","blur","blurEvent","_callee3","_templateObject4","clicked","addEventListener","click","aTimeout","false","_context5","_callee4","_templateObject5","classList","contains","_context6","_callee5","_templateObject6","prefixSlot","labelSlot","suffixSlot","assignedNodes","length","_context7","_callee6","document","createElement","e","initEvent","destroyEvent","body","appendChild","update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CAAAA,IAAAA,SAAAA,SAAAA,CAAAA,IAAAA,SACXC,CAAAA,CAAAA,CAAQC,CAAI,CAAA+D,gBAAA,GAAAA,gBAAA,CAAA7D,sBAAA,+BAAA,CAAA,QAAjCC,CAAqBJ,CAAAA,SAAAA,CAAAA,IAAAA,CAC3BI,CAAGW,CAAAA,QAAAA,CAAAA,CAAW,CACRX,CAAAA,SAAAA,CAAAA,IAAAA,SAAAA,CAAAA,CAAAA,CAAGwD,sBACTvD,CAAOD,CAAAA,CAAAA,CAAG6D,YAAa,CAAA,UAAA,CAAA,CAAA,CAAa1D,EAAGS,CAAAA,EAAAA,QAEvCZ,CAAAA,CAAAA,CAAGW,UAAW,CACRX,CAAAA,SAAAA,CAAAA,IAAAA,UAAAA,CAAAA,CAAAA,CAAGwD,cACTvD,SAAAA,CAAAA,CAAOD,EAAG6D,YAAa,CAAA,UAAA,CAAA,CAAA,CAAa1D,EAAGS,CAAAA,EAAAA,SAAQ,0BAAAkD,SAAA,CAAAvD,IAAA,MAAAwD,QAAA,GACjD,EAAA,CAAA,EAAA,CAAA,CAAA"}
|
1
|
+
{"version":3,"file":"nile-link.test.cjs.js","sources":["../../../src/nile-link/nile-link.test.ts"],"sourcesContent":["import { fixture, expect, oneEvent, aTimeout } from '@open-wc/testing';\nimport { html } from 'lit/static-html.js';\nimport './nile-link';\nimport { NileLink } from './nile-link';\ndescribe('NileLink', () => {\n it('should render correctly', async () => {\n const el: NileLink = await fixture(html`<nile-link></nile-link>`);\n expect(el.shadowRoot).to.exist;\n expect(el.shadowRoot!.querySelector('.link')).to.exist;\n });\n\n it('should handle the disabled attribute', async () => {\n const el: NileLink = await fixture(html`<nile-link disabled></nile-link>`);\n const link = el.shadowRoot!.querySelector('.link')!;\n expect(el.disabled).to.be.true;\n expect(link.getAttribute('aria-disabled')).to.equal('true');\n expect(link.getAttribute('tabindex')).to.equal('-1');\n });\n\n it('should emit custom events on focus and blur', async () => {\n const el: NileLink = await fixture(html`<nile-link></nile-link>`);\n setTimeout(() => el.shadowRoot!.querySelector<HTMLElement>('.link')!.focus());\n const focusEvent = await oneEvent(el, 'nile-focus');\n expect(focusEvent).to.exist;\n\n setTimeout(() => el.shadowRoot!.querySelector<HTMLElement>('.link')!.blur());\n const blurEvent = await oneEvent(el, 'nile-blur');\n expect(blurEvent).to.exist;\n });\n\n it('should prevent click events when disabled', async () => {\n const el: NileLink = await fixture(html`<nile-link disabled></nile-link>`);\n let clicked = false;\n el.addEventListener('click', () => {\n clicked = true;\n });\n\n el.shadowRoot!.querySelector<HTMLElement>('.link')!.click();\n await aTimeout(100);\n expect(clicked).to.be.false;\n });\n\n it('should handle button property correctly', async () => {\n const el: NileLink = await fixture(html`<nile-link button></nile-link>`);\n const link = el.shadowRoot!.querySelector('.link')!;\n expect(link.classList.contains('link__button')).to.be.true;\n });\n\n it('should have all slots rendered successfully', async () => {\n const el: NileLink = await fixture(html`<nile-link><span slot=\"prefix\">Prefix</span><span>Label</span><span slot=\"suffix\">Suffix</span></nile-link>`);\n const prefixSlot = el.shadowRoot!.querySelector<HTMLSlotElement>('slot[name=\"prefix\"]')!;\n const labelSlot = el.shadowRoot!.querySelector<HTMLSlotElement>('slot:not([name])')!;\n const suffixSlot = el.shadowRoot!.querySelector<HTMLSlotElement>('slot[name=\"suffix\"]')!;\n expect(prefixSlot.assignedNodes().length).to.equal(1);\n expect(labelSlot.assignedNodes().length).to.equal(1);\n expect(suffixSlot.assignedNodes().length).to.equal(1);\n });\n\n\n it('should emit nile-init and nile-destroy events on connected and disconnected', async () => {\n const el: NileLink = document.createElement('nile-link');\n let initEvent:any, destroyEvent:any;\n el.addEventListener('nile-init',(e)=>initEvent=e)\n el.addEventListener('nile-init',(e)=>destroyEvent=e)\n document.body.appendChild(el);\n await el.updateComplete\n expect(initEvent).to.exist;\n document.body.removeChild(el);\n await el.updateComplete\n expect(destroyEvent).to.exist;\n });\n\n it('should reflect properties correctly', async () => {\n const el: NileLink = await fixture(html`<nile-link></nile-link>`);\n el.disabled = true;\n await el.updateComplete;\n expect(el.hasAttribute('disabled')).to.be.true;\n \n el.disabled = false;\n await el.updateComplete;\n expect(el.hasAttribute('disabled')).to.be.false;\n });\n})"],"names":["describe","it","async","fixture","html","_templateObject","_taggedTemplateLiteral","expect","el","shadowRoot","to","exist","querySelector","_context2","stop","_callee","_asyncToGenerator","_regeneratorRuntime","mark","_templateObject2","link","disabled","be","getAttribute","equal","_context3","_callee2","_templateObject3","setTimeout","focus","_context4","next","oneEvent","focusEvent","blur","blurEvent","_callee3","_templateObject4","clicked","addEventListener","click","aTimeout","_context5","_callee4","_templateObject5","classList","contains","_context6","_callee5","_templateObject6","prefixSlot","labelSlot","suffixSlot","assignedNodes","length","_context7","_callee6","document","createElement","e","initEvent","destroyEvent","body","appendChild","updateComplete","removeChild","_context8","_callee7","_templateObject7","hasAttribute","_context9","_callee8"],"mappings":"grTAIAA,QAAAA,CAAS,UAAY,CAAA,UAAA,CACjBC,GAAG,yBAA2BC,cAAAA,iBAAAA,cAAAA,mBAAAA,GAAAA,IAAAA,CAAAA,SAAAA,QAAAA,MAAAA,CAAAA,QAAAA,mBAAAA,GAAAA,IAAAA,UAAAA,SAAAA,SAAAA,iBAAAA,SAAAA,CAAAA,IAAAA,CAAAA,SAAAA,CAAAA,IAAAA,SAAAA,SAAAA,CAAAA,IAAAA,SACCC,CAAAA,CAAQC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,+BACvCC,CAAAA,QADMC,CAAAA,CAAAA,SAAAA,CAAAA,IAAAA,CACND,CAAAA,CAAOC,EAAGC,UAAYC,CAAAA,CAAAA,EAAAA,CAAGC,KACzBJ,CAAAA,CAAAA,CAAOC,CAAGC,CAAAA,UAAAA,CAAYG,aAAc,CAAA,OAAA,CAAA,CAAA,CAAUF,GAAGC,KAAK,yBAAAE,SAAA,CAAAC,IAAA,MAAAC,OAAA,GAAA,EAAA,CAAA,CAG1Dd,EAAG,CAAA,sCAAA,cAAAe,iBAAA,c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AAAyD,QAAA,GACjD,EAAA,CAAA,EAAA,CAAA,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
import{f as i,a as t,o as e,b as n}from"../fixture-81e5a936.esm.js";import{html as l}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-link.esm.js";import"tslib";import"../index-0a3007c5.esm.js";import"lit/decorators.js";import"./nile-link.css.esm.js";import"../slot.esm.js";import"lit/directives/
|
1
|
+
import{f as i,a as t,o as e,b as n}from"../fixture-81e5a936.esm.js";import{html as l}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-link.esm.js";import"tslib";import"../index-0a3007c5.esm.js";import"lit/decorators.js";import"./nile-link.css.esm.js";import"../slot.esm.js";import"lit/directives/class-map.js";import"../internal/nile-element.esm.js";import"../property-09139d3c.esm.js";describe("NileLink",(()=>{it("should render correctly",(async()=>{const e=await i(l`<nile-link></nile-link>`);t(e.shadowRoot).to.exist,t(e.shadowRoot.querySelector(".link")).to.exist})),it("should handle the disabled attribute",(async()=>{const e=await i(l`<nile-link disabled></nile-link>`),n=e.shadowRoot.querySelector(".link");t(e.disabled).to.be.true,t(n.getAttribute("aria-disabled")).to.equal("true"),t(n.getAttribute("tabindex")).to.equal("-1")})),it("should emit custom events on focus and blur",(async()=>{const n=await i(l`<nile-link></nile-link>`);setTimeout((()=>n.shadowRoot.querySelector(".link").focus()));const s=await e(n,"nile-focus");t(s).to.exist,setTimeout((()=>n.shadowRoot.querySelector(".link").blur()));const a=await e(n,"nile-blur");t(a).to.exist})),it("should prevent click events when disabled",(async()=>{const e=await i(l`<nile-link disabled></nile-link>`);let s=!1;e.addEventListener("click",(()=>{s=!0})),e.shadowRoot.querySelector(".link").click(),await n(100),t(s).to.be.false})),it("should handle button property correctly",(async()=>{const e=(await i(l`<nile-link button></nile-link>`)).shadowRoot.querySelector(".link");t(e.classList.contains("link__button")).to.be.true})),it("should have all slots rendered successfully",(async()=>{const e=await i(l`<nile-link><span slot="prefix">Prefix</span><span>Label</span><span slot="suffix">Suffix</span></nile-link>`),n=e.shadowRoot.querySelector('slot[name="prefix"]'),s=e.shadowRoot.querySelector("slot:not([name])"),a=e.shadowRoot.querySelector('slot[name="suffix"]');t(n.assignedNodes().length).to.equal(1),t(s.assignedNodes().length).to.equal(1),t(a.assignedNodes().length).to.equal(1)})),it("should emit nile-init and nile-destroy events on connected and disconnected",(async()=>{const i=document.createElement("nile-link");let e,n;i.addEventListener("nile-init",(i=>e=i)),i.addEventListener("nile-init",(i=>n=i)),document.body.appendChild(i),await i.updateComplete,t(e).to.exist,document.body.removeChild(i),await i.updateComplete,t(n).to.exist})),it("should reflect properties correctly",(async()=>{const e=await i(l`<nile-link></nile-link>`);e.disabled=!0,await e.updateComplete,t(e.hasAttribute("disabled")).to.be.true,e.disabled=!1,await e.updateComplete,t(e.hasAttribute("disabled")).to.be.false}))}));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","../index-c7ad3b47.cjs.js","lit/decorators.js","./nile-list.css.cjs.js","../internal/nile-element.cjs.js","lit"],function(_export,_context){"use strict";var t,s,i,e,l,_templateObject,r;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){s=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.customElement;},function(_nileListCssCjsJs){e=_nileListCssCjsJs.s;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_lit){}],execute:function execute(){_export("N",r=/*#__PURE__*/function(_l){function r(){_classCallCheck(this,r);
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","../index-c7ad3b47.cjs.js","lit/decorators.js","./nile-list.css.cjs.js","../internal/nile-element.cjs.js","lit"],function(_export,_context){"use strict";var t,s,i,e,l,_templateObject,r;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){s=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.customElement;},function(_nileListCssCjsJs){e=_nileListCssCjsJs.s;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_lit){}],execute:function execute(){_export("N",r=/*#__PURE__*/function(_l){function r(){var _this;_classCallCheck(this,r);_this=_callSuper(this,r,arguments),_this.BUBBLES=!1;return _this;}_inherits(r,_l);return _createClass(r,[{key:"handleListItemClick",value:function handleListItemClick(t){var s=t.target.innerText;this.emit("nile-list-click",{value:s});}},{key:"render",value:function render(){return s(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <slot @nile-list-item-click=\"","\"> </slot>\n "])),this.handleListItemClick);}}],[{key:"styles",get:function get(){return[e];}}]);}(l));_export("N",r=t([i("nile-list")],r));}};});
|
2
2
|
//# sourceMappingURL=nile-list.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-list.cjs.js","sources":["../../../src/nile-list/nile-list.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-list.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n * Nile list component.\n *\n * @tag nile-list\n *\n */\n@customElement('nile-list')\nexport class NileList extends NileElement {\n /**\n * The styles for nile-list\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n handleListItemClick(e: any) {\n const listTextValue = e.target.innerText;\n this.emit('nile-list-click', { value: listTextValue });\n }\n\n public render(): TemplateResult {\n return html`\n <slot @nile-list-item-click=\"${this.handleListItemClick}\"> </slot>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileList;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-list': NileList;\n }\n}\n"],"names":["NileList","_l","r","
|
1
|
+
{"version":3,"file":"nile-list.cjs.js","sources":["../../../src/nile-list/nile-list.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-list.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n * Nile list component.\n *\n * @tag nile-list\n *\n */\n@customElement('nile-list')\nexport class NileList extends NileElement {\n /**\n * The styles for nile-list\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n protected override BUBBLES: boolean=false;\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n handleListItemClick(e: any) {\n const listTextValue = e.target.innerText;\n this.emit('nile-list-click', { value: listTextValue });\n }\n\n public render(): TemplateResult {\n return html`\n <slot @nile-list-item-click=\"${this.handleListItemClick}\"> </slot>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileList;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-list': NileList;\n }\n}\n"],"names":["NileList","_l","r","constructor","this","BUBBLES","_this","_inherits","_createClass","key","value","handleListItemClick","e","listTextValue","target","innerText","emit","render","html","_templateObject","_taggedTemplateLiteral","get","styles","NileElement","__decorate","customElement"],"mappings":"wmHAyBaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCAScC,EAAAA,KAAAA,CAAOC,OAAU,CAAA,CAAA,CAuBrC,QAAAC,KAAA,EA3BQC,SAAA,CAAAL,CAAA,CAAAD,EAAA,SAAAO,YAAA,CAAAN,CAAA,GAAAO,GAAA,uBAAAC,KAAA,CAeP,SAAAC,oBAAoBC,CAClB,CAAA,CAAA,GAAMC,CAAAA,EAAgBD,CAAEE,CAAAA,MAAAA,CAAOC,UAC/BX,IAAKY,CAAAA,IAAAA,CAAK,kBAAmB,CAAEN,KAAAA,CAAOG,GACvC,EAEM,GAAAJ,GAAA,UAAAC,KAAA,UAAAO,OAAA,CACL,CAAA,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,kEACsBhB,IAAKO,CAAAA,mBAAAA,EAEvC,CAAA,KAAAF,GAAA,UAAAY,GAAA,CAxBM,SAAAA,IAAA,EACL,MAAO,CAACC,EACT,EAaD,MApB4BC,IAAjBvB,OAAAA,KAAAA,CAAQwB,CAAAA,CAAAA,CAAA,CADpBC,CAAAA,CAAc,cACFzB"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{x as s}from"../index-0a3007c5.esm.js";import{customElement as e}from"lit/decorators.js";import{s as i}from"./nile-list.css.esm.js";import{N as l}from"../internal/nile-element.esm.js";import"lit";let r=class extends l{static get styles(){return[i]}handleListItemClick(t){const s=t.target.innerText;this.emit("nile-list-click",{value:s})}render(){return s`
|
1
|
+
import{__decorate as t}from"tslib";import{x as s}from"../index-0a3007c5.esm.js";import{customElement as e}from"lit/decorators.js";import{s as i}from"./nile-list.css.esm.js";import{N as l}from"../internal/nile-element.esm.js";import"lit";let r=class extends l{constructor(){super(...arguments),this.BUBBLES=!1}static get styles(){return[i]}handleListItemClick(t){const s=t.target.innerText;this.emit("nile-list-click",{value:s})}render(){return s`
|
2
2
|
<slot @nile-list-item-click="${this.handleListItemClick}"> </slot>
|
3
3
|
`}};r=t([e("nile-list")],r);export{r as N};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","../index-c7ad3b47.cjs.js","lit/decorators.js","./nile-list-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js","../property-217fe924.cjs.js","lit"],function(_export,_context){"use strict";var i,t,s,e,n,r,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,o;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){i=_tslib.__decorate;},function(_index001CjsJs){t=_index001CjsJs.x;},function(_litDecoratorsJs){s=_litDecoratorsJs.customElement;},function(_nileListItemCssCjsJs){e=_nileListItemCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_internalSlotCjsJs){r=_internalSlotCjsJs.H;},function(_property002CjsJs){a=_property002CjsJs.n;},function(_lit){}],execute:function execute(){_export("N",o=/*#__PURE__*/function(_n){function o(){var _this;_classCallCheck(this,o);_this=_callSuper(this,o,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"preffix","heading","subheading"),_this.iconName="",_this.iconSize=14,_this.heading="",_this.subHeading="";return _this;}_inherits(o,_n);return _createClass(o,[{key:"handleClick",value:function handleClick(i){this.emit("nile-list-item-click",{heading:this.heading,subheading:this.subHeading});}},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n ","\n\n <div class=\"content__wrapper\" part=\"content__wrapper\">\n ","\n ","\n </div>\n\n <slot @click=\"","\" class=\"list__item\" part=\"base\"> </slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"list-item__suffix\">\n </slot>\n "])),this.iconName||this.hasSlotController.test("preffix")?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <slot name=\"preffix\" part=\"preffix\" class=\"preffix__icon\">\n <nile-icon\n name=\"","\"\n size=\"","\"\n ></nile-icon>\n </slot>"])),this.iconName,this.iconSize):"",this.heading||this.hasSlotController.test("heading")?t(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" <slot class=\"heading\" part=\"heading\" name=\"heading\"\n >","</slot\n >"])),this.heading):"",this.subHeading||this.hasSlotController.test("subheading")?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral([" <slot class=\"subheading\" part=\"subheading\" name=\"subheading\"\n >","</slot\n >"])),this.subHeading):"\n ",this.handleClick);}}],[{key:"styles",get:function get(){return[e];}}]);}(n));i([a({type:String,attribute:"icon-name"})],o.prototype,"iconName",void 0),i([a({type:Number,attribute:"icon-size"})],o.prototype,"iconSize",void 0),i([a({type:String,attribute:"heading"})],o.prototype,"heading",void 0),i([a({type:String,attribute:"sub-heading"})],o.prototype,"subHeading",void 0),_export("N",o=i([s("nile-list-item")],o));}};});
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","../index-c7ad3b47.cjs.js","lit/decorators.js","./nile-list-item.css.cjs.js","../internal/nile-element.cjs.js","../internal/slot.cjs.js","../property-217fe924.cjs.js","lit"],function(_export,_context){"use strict";var i,t,s,e,n,r,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,o;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){i=_tslib.__decorate;},function(_index001CjsJs){t=_index001CjsJs.x;},function(_litDecoratorsJs){s=_litDecoratorsJs.customElement;},function(_nileListItemCssCjsJs){e=_nileListItemCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_internalSlotCjsJs){r=_internalSlotCjsJs.H;},function(_property002CjsJs){a=_property002CjsJs.n;},function(_lit){}],execute:function execute(){_export("N",o=/*#__PURE__*/function(_n){function o(){var _this;_classCallCheck(this,o);_this=_callSuper(this,o,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"preffix","heading","subheading"),_this.BUBBLES=!1,_this.iconName="",_this.iconSize=14,_this.heading="",_this.subHeading="";return _this;}_inherits(o,_n);return _createClass(o,[{key:"handleClick",value:function handleClick(i){this.emit("nile-list-item-click",{heading:this.heading,subheading:this.subHeading});}},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n ","\n\n <div class=\"content__wrapper\" part=\"content__wrapper\">\n ","\n ","\n </div>\n\n <slot @click=\"","\" class=\"list__item\" part=\"base\"> </slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"list-item__suffix\">\n </slot>\n "])),this.iconName||this.hasSlotController.test("preffix")?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <slot name=\"preffix\" part=\"preffix\" class=\"preffix__icon\">\n <nile-icon\n name=\"","\"\n size=\"","\"\n ></nile-icon>\n </slot>"])),this.iconName,this.iconSize):"",this.heading||this.hasSlotController.test("heading")?t(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" <slot class=\"heading\" part=\"heading\" name=\"heading\"\n >","</slot\n >"])),this.heading):"",this.subHeading||this.hasSlotController.test("subheading")?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral([" <slot class=\"subheading\" part=\"subheading\" name=\"subheading\"\n >","</slot\n >"])),this.subHeading):"\n ",this.handleClick);}}],[{key:"styles",get:function get(){return[e];}}]);}(n));i([a({type:String,attribute:"icon-name"})],o.prototype,"iconName",void 0),i([a({type:Number,attribute:"icon-size"})],o.prototype,"iconSize",void 0),i([a({type:String,attribute:"heading"})],o.prototype,"heading",void 0),i([a({type:String,attribute:"sub-heading"})],o.prototype,"subHeading",void 0),_export("N",o=i([s("nile-list-item")],o));}};});
|
2
2
|
//# sourceMappingURL=nile-list-item.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-list-item.cjs.js","sources":["../../../src/nile-list-item/nile-list-item.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-list-item.css';\nimport NileElement from '../internal/nile-element';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * Nile list-item component.\n *\n * @tag nile-list-item\n *\n */\n@customElement('nile-list-item')\nexport class NileListItem extends NileElement {\n /**\n * The styles for nile-list-item\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'preffix',\n 'heading',\n 'subheading'\n );\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n @property({ type: String, attribute: 'icon-name' }) iconName = '';\n @property({ type: Number, attribute: 'icon-size' }) iconSize = 14;\n\n @property({ type: String, attribute: 'heading' }) heading = '';\n @property({ type: String, attribute: 'sub-heading' }) subHeading = '';\n \n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n handleClick(e: any) {\n this.emit('nile-list-item-click', {\n heading: this.heading,\n subheading: this.subHeading,\n });\n }\n\n public render(): TemplateResult {\n return html`\n ${this.iconName || this.hasSlotController.test('preffix')\n ? html` <slot name=\"preffix\" part=\"preffix\" class=\"preffix__icon\">\n <nile-icon\n name=\"${this.iconName}\"\n size=\"${this.iconSize}\"\n ></nile-icon>\n </slot>`\n : ``}\n\n <div class=\"content__wrapper\" part=\"content__wrapper\">\n ${this.heading || this.hasSlotController.test('heading')\n ? html` <slot class=\"heading\" part=\"heading\" name=\"heading\"\n >${this.heading}</slot\n >`\n : ``}\n ${this.subHeading || this.hasSlotController.test('subheading')\n ? html` <slot class=\"subheading\" part=\"subheading\" name=\"subheading\"\n >${this.subHeading}</slot\n >`\n : `\n `}\n </div>\n\n <slot @click=\"${this.handleClick}\" class=\"list__item\" part=\"base\"> </slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"list-item__suffix\">\n </slot>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileListItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-list-item': NileListItem;\n }\n}\n"],"names":["NileListItem","
|
1
|
+
{"version":3,"file":"nile-list-item.cjs.js","sources":["../../../src/nile-list-item/nile-list-item.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-list-item.css';\nimport NileElement from '../internal/nile-element';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * Nile list-item component.\n *\n * @tag nile-list-item\n *\n */\n@customElement('nile-list-item')\nexport class NileListItem extends NileElement {\n /**\n * The styles for nile-list-item\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'preffix',\n 'heading',\n 'subheading'\n );\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n protected override BUBBLES: boolean=false;\n @property({ type: String, attribute: 'icon-name' }) iconName = '';\n @property({ type: Number, attribute: 'icon-size' }) iconSize = 14;\n\n @property({ type: String, attribute: 'heading' }) heading = '';\n @property({ type: String, attribute: 'sub-heading' }) subHeading = '';\n \n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n handleClick(e: any) {\n this.emit('nile-list-item-click', {\n heading: this.heading,\n subheading: this.subHeading,\n });\n }\n\n public render(): TemplateResult {\n return html`\n ${this.iconName || this.hasSlotController.test('preffix')\n ? html` <slot name=\"preffix\" part=\"preffix\" class=\"preffix__icon\">\n <nile-icon\n name=\"${this.iconName}\"\n size=\"${this.iconSize}\"\n ></nile-icon>\n </slot>`\n : ``}\n\n <div class=\"content__wrapper\" part=\"content__wrapper\">\n ${this.heading || this.hasSlotController.test('heading')\n ? html` <slot class=\"heading\" part=\"heading\" name=\"heading\"\n >${this.heading}</slot\n >`\n : ``}\n ${this.subHeading || this.hasSlotController.test('subheading')\n ? html` <slot class=\"subheading\" part=\"subheading\" name=\"subheading\"\n >${this.subHeading}</slot\n >`\n : `\n `}\n </div>\n\n <slot @click=\"${this.handleClick}\" class=\"list__item\" part=\"base\"> </slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"list-item__suffix\">\n </slot>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileListItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-list-item': NileListItem;\n }\n}\n"],"names":["NileListItem","o","constructor","this","hasSlotController","HasSlotController","BUBBLES","iconName","iconSize","heading","subHeading","_this","_inherits","_n","_createClass","key","value","handleClick","e","emit","subheading","render","html","_templateObject","_taggedTemplateLiteral","test","_templateObject2","_templateObject3","_templateObject4","__decorate","get","styles","NileElement","property","type","String","attribute","prototype","Number","customElement"],"mappings":"80HA0BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAMYC,KAAAA,CAAAC,iBAAoB,CAAA,GAAIC,CAAAA,CACvCF,CAAAA,sBAAAA,CAAAA,KAAAA,EACA,SACA,CAAA,SAAA,CACA,YAOiBA,CAAAA,CAAAA,KAAAA,CAAOG,SAAU,CACgBH,CAAAA,KAAAA,CAAQI,QAAG,CAAA,EAAA,CACXJ,KAAAA,CAAQK,QAAAA,CAAG,EAEbL,CAAAA,KAAAA,CAAOM,QAAG,EACNN,CAAAA,KAAAA,CAAUO,UAAG,CAAA,EAiDpE,QAAAC,KAAA,EA1DQC,SAAA,CAAAX,CAAA,CAAAY,EAAA,SAAAC,YAAA,CAAAb,CAAA,GAAAc,GAAA,eAAAC,KAAA,CAmBP,SAAAC,YAAYC,CACVf,CAAAA,CAAAA,IAAAA,CAAKgB,IA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pC,CAAAqC,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAEhBR,CAAA,CAAA,CAAjDI,EAAS,CAAEC,IAAAA,CAAMC,MAAQC,CAAAA,SAAAA,CAAW,SAA0BpC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqC,UAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CACTR,CAAA,CAAA,CAArDI,CAAS,CAAA,CAAEC,KAAMC,MAAQC,CAAAA,SAAAA,CAAW,aAAiCpC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqC,SAAA,CAAA,YAAA,CAAA,IAAA,EAtB3DrC,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAY6B,CAAA,CAAA,CADxBU,CAAc,CAAA,gBAAA,CAAA,CAAA,CACFvC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{__decorate as i}from"tslib";import{x as t}from"../index-0a3007c5.esm.js";import{customElement as s}from"lit/decorators.js";import{s as e}from"./nile-list-item.css.esm.js";import{N as n}from"../internal/nile-element.esm.js";import{H as r}from"../internal/slot.esm.js";import{n as a}from"../property-09139d3c.esm.js";import"lit";let o=class extends n{constructor(){super(...arguments),this.hasSlotController=new r(this,"preffix","heading","subheading"),this.iconName="",this.iconSize=14,this.heading="",this.subHeading=""}static get styles(){return[e]}handleClick(i){this.emit("nile-list-item-click",{heading:this.heading,subheading:this.subHeading})}render(){return t`
|
1
|
+
import{__decorate as i}from"tslib";import{x as t}from"../index-0a3007c5.esm.js";import{customElement as s}from"lit/decorators.js";import{s as e}from"./nile-list-item.css.esm.js";import{N as n}from"../internal/nile-element.esm.js";import{H as r}from"../internal/slot.esm.js";import{n as a}from"../property-09139d3c.esm.js";import"lit";let o=class extends n{constructor(){super(...arguments),this.hasSlotController=new r(this,"preffix","heading","subheading"),this.BUBBLES=!1,this.iconName="",this.iconSize=14,this.heading="",this.subHeading=""}static get styles(){return[e]}handleClick(i){this.emit("nile-list-item-click",{heading:this.heading,subheading:this.subHeading})}render(){return t`
|
2
2
|
${this.iconName||this.hasSlotController.test("preffix")?t` <slot name="preffix" part="preffix" class="preffix__icon">
|
3
3
|
<nile-icon
|
4
4
|
name="${this.iconName}"
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../internal/nile-element.cjs.js","./nile-menu.css.cjs.js","../internal/slot.cjs.js","../index-c7ad3b47.cjs.js"],function(_export,_context){"use strict";var e,t,s,i,n,o,r,l,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,h;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.state;i=_litDecoratorsJs.property;n=_litDecoratorsJs.query;o=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_nileMenuCssCjsJs){l=_nileMenuCssCjsJs.s;},function(_internalSlotCjsJs){a=_internalSlotCjsJs.H;},function(_index001CjsJs){}],execute:function execute(){_export("N",h=/*#__PURE__*/function(_r){function h(){var _this;_classCallCheck(this,h);_this=_callSuper(this,h,arguments),_this.searchValue="",_this.searchWidth=0,_this.searchEnabled=!1,_this.customSearch=!1,_this.showNoResults=!1,_this.noResultsMessage="No results found",_this.hasSlotController=new a(_assertThisInitialized(_this),"menu__footer","menu__header");return _this;}_inherits(h,_r);return _createClass(h,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(h.prototype),"connectedCallback",this).call(this),this.setAttribute("role","menu");}},{key:"handleClick",value:function handleClick(e){var t=e.target.closest("nile-menu-item");(t===null||t===void 0?void 0:t.hasSubMenu)||t&&!t.disabled&&("checkbox"===t.type&&(t.checked=!t.checked),this.emit("nile-select",{value:t.value}));}},{key:"handleKeyDown",value:function handleKeyDown(e){if("Enter"===e.key){var _t=this.getCurrentItem();e.preventDefault(),_t===null||_t===void 0?void 0:_t.click();}if(" "===e.key&&e.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(e.key)){var _t2=this.getAllItems(),_s=this.getCurrentItem();var _i=_s?_t2.indexOf(_s):0;_t2.length>0&&(e.preventDefault(),"ArrowDown"===e.key?_i++:"ArrowUp"===e.key?_i--:"Home"===e.key?_i=0:"End"===e.key&&(_i=_t2.length-1),_i<0&&(_i=_t2.length-1),_i>_t2.length-1&&(_i=0),this.setCurrentItem(_t2[_i]),_t2[_i].focus());}}},{key:"handleMouseDown",value:function handleMouseDown(e){var t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t);}},{key:"handleSlotChange",value:function handleSlotChange(){var e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0]);}},{key:"isMenuItem",value:function isMenuItem(e){var _e$getAttribute;return"nile-menu-item"===e.tagName.toLowerCase()||["menuitem","menuitemcheckbox","menuitemradio"].includes((_e$getAttribute=e.getAttribute("role"))!==null&&_e$getAttribute!==void 0?_e$getAttribute:"");}},{key:"getAllItems",value:function getAllItems(){var _this2=this;return _toConsumableArray(this.defaultSlot.assignedElements({flatten:!0})).filter(function(e){return!!_this2.isMenuItem(e);});}},{key:"getCurrentItem",value:function getCurrentItem(){return this.getAllItems().find(function(e){return"0"===e.getAttribute("tabindex");});}},{key:"setCurrentItem",value:function setCurrentItem(e){this.getAllItems().forEach(function(t){t.setAttribute("tabindex",t===e?"0":"-1");});}},{key:"handleSearchChange",value:function handleSearchChange(e){var _this3=this;var t=this.getAllItems(),s=e.target.value;if(this.customSearch)return void this.emit("nile-search-value",{value:s});var i=0;t.map(function(t){_this3.searchWidth=Math.max(_this3.searchWidth,t.offsetWidth),t.innerText.toLowerCase().includes(e.target.value.toLowerCase())?(t.style.display="block",i++):t.style.display="none";}),this.showNoResults=0===i;}},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n ","\n <div part=\"menu__items-wrapper\" class=\"menu__items-wrapper\">\n ","\n\n <slot\n name=\"menu__header\"\n part=\"menu__header\"\n @click=","\n ></slot>\n <slot\n class=\"menu__item-wrapper\"\n @slotchange=","\n @click=","\n @keydown=","\n @mousedown=","\n ></slot>\n ","\n </div>\n "])),this.searchEnabled?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<div class=\"search__wrapper\" part=\"search__wrapper\">\n <nile-input\n size=\"medium\"\n .value=","\n placeholder=\"Search...\"\n @nile-input=","\n part=\"menu__input\"\n clearable\n >\n <nile-icon name=\"search\" slot=\"suffix\"> </nile-icon>\n </nile-input>\n </div>"])),this.searchValue,this.handleSearchChange):t(_templateObject3||(_templateObject3=_taggedTemplateLiteral([""]))),this.showNoResults?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral([" <nile-menu-item>","</nile-menu-item> "])),this.noResultsMessage):"",function(e){e.stopPropagation();},this.handleSlotChange,this.handleClick,this.handleKeyDown,this.handleMouseDown,this.hasSlotController.test("menu__footer")?t(_templateObject5||(_templateObject5=_taggedTemplateLiteral([" <slot\n part=\"menu__footer\"\n name=\"menu__footer\"\n class=\"menu__footer\"\n ></slot>"]))):null);}}]);}(r));h.styles=l,e([s()],h.prototype,"searchValue",void 0),e([s()],h.prototype,"searchWidth",void 0),e([i({type:Boolean,reflect:!0})],h.prototype,"searchEnabled",void 0),e([i({type:Boolean,reflect:!0})],h.prototype,"customSearch",void 0),e([i({type:Boolean})],h.prototype,"showNoResults",void 0),e([i({type:String})],h.prototype,"noResultsMessage",void 0),e([n("slot:not([name])")],h.prototype,"defaultSlot",void 0),_export("N",h=e([o("nile-menu")],h));}};});
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../internal/nile-element.cjs.js","./nile-menu.css.cjs.js","../internal/slot.cjs.js","../index-c7ad3b47.cjs.js"],function(_export,_context){"use strict";var e,t,s,i,n,o,r,l,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,h;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.state;i=_litDecoratorsJs.property;n=_litDecoratorsJs.query;o=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_nileMenuCssCjsJs){l=_nileMenuCssCjsJs.s;},function(_internalSlotCjsJs){a=_internalSlotCjsJs.H;},function(_index001CjsJs){}],execute:function execute(){_export("N",h=/*#__PURE__*/function(_r){function h(){var _this;_classCallCheck(this,h);_this=_callSuper(this,h,arguments),_this.BUBBLES=!1,_this.searchValue="",_this.searchWidth=0,_this.searchEnabled=!1,_this.customSearch=!1,_this.showNoResults=!1,_this.noResultsMessage="No results found",_this.hasSlotController=new a(_assertThisInitialized(_this),"menu__footer","menu__header");return _this;}_inherits(h,_r);return _createClass(h,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(h.prototype),"connectedCallback",this).call(this),this.setAttribute("role","menu");}},{key:"handleClick",value:function handleClick(e){var t=e.target.closest("nile-menu-item");(t===null||t===void 0?void 0:t.hasSubMenu)||t&&!t.disabled&&("checkbox"===t.type&&(t.checked=!t.checked),this.emit("nile-select",{value:t.value}));}},{key:"handleKeyDown",value:function handleKeyDown(e){if("Enter"===e.key){var _t=this.getCurrentItem();e.preventDefault(),_t===null||_t===void 0?void 0:_t.click();}if(" "===e.key&&e.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(e.key)){var _t2=this.getAllItems(),_s=this.getCurrentItem();var _i=_s?_t2.indexOf(_s):0;_t2.length>0&&(e.preventDefault(),"ArrowDown"===e.key?_i++:"ArrowUp"===e.key?_i--:"Home"===e.key?_i=0:"End"===e.key&&(_i=_t2.length-1),_i<0&&(_i=_t2.length-1),_i>_t2.length-1&&(_i=0),this.setCurrentItem(_t2[_i]),_t2[_i].focus());}}},{key:"handleMouseDown",value:function handleMouseDown(e){var t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t);}},{key:"handleSlotChange",value:function handleSlotChange(){var e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0]);}},{key:"isMenuItem",value:function isMenuItem(e){var _e$getAttribute;return"nile-menu-item"===e.tagName.toLowerCase()||["menuitem","menuitemcheckbox","menuitemradio"].includes((_e$getAttribute=e.getAttribute("role"))!==null&&_e$getAttribute!==void 0?_e$getAttribute:"");}},{key:"getAllItems",value:function getAllItems(){var _this2=this;return _toConsumableArray(this.defaultSlot.assignedElements({flatten:!0})).filter(function(e){return!!_this2.isMenuItem(e);});}},{key:"getCurrentItem",value:function getCurrentItem(){return this.getAllItems().find(function(e){return"0"===e.getAttribute("tabindex");});}},{key:"setCurrentItem",value:function setCurrentItem(e){this.getAllItems().forEach(function(t){t.setAttribute("tabindex",t===e?"0":"-1");});}},{key:"handleSearchChange",value:function handleSearchChange(e){var _this3=this;var t=this.getAllItems(),s=e.target.value;if(this.customSearch)return void this.emit("nile-search-value",{value:s});var i=0;t.map(function(t){_this3.searchWidth=Math.max(_this3.searchWidth,t.offsetWidth),t.innerText.toLowerCase().includes(e.target.value.toLowerCase())?(t.style.display="block",i++):t.style.display="none";}),this.showNoResults=0===i;}},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n ","\n <div part=\"menu__items-wrapper\" class=\"menu__items-wrapper\">\n ","\n\n <slot\n name=\"menu__header\"\n part=\"menu__header\"\n @click=","\n ></slot>\n <slot\n class=\"menu__item-wrapper\"\n @slotchange=","\n @click=","\n @keydown=","\n @mousedown=","\n ></slot>\n ","\n </div>\n "])),this.searchEnabled?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<div class=\"search__wrapper\" part=\"search__wrapper\">\n <nile-input\n size=\"medium\"\n .value=","\n placeholder=\"Search...\"\n @nile-input=","\n part=\"menu__input\"\n clearable\n >\n <nile-icon name=\"search\" slot=\"suffix\"> </nile-icon>\n </nile-input>\n </div>"])),this.searchValue,this.handleSearchChange):t(_templateObject3||(_templateObject3=_taggedTemplateLiteral([""]))),this.showNoResults?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral([" <nile-menu-item>","</nile-menu-item> "])),this.noResultsMessage):"",function(e){e.stopPropagation();},this.handleSlotChange,this.handleClick,this.handleKeyDown,this.handleMouseDown,this.hasSlotController.test("menu__footer")?t(_templateObject5||(_templateObject5=_taggedTemplateLiteral([" <slot\n part=\"menu__footer\"\n name=\"menu__footer\"\n class=\"menu__footer\"\n ></slot>"]))):null);}}]);}(r));h.styles=l,e([s()],h.prototype,"searchValue",void 0),e([s()],h.prototype,"searchWidth",void 0),e([i({type:Boolean,reflect:!0})],h.prototype,"searchEnabled",void 0),e([i({type:Boolean,reflect:!0})],h.prototype,"customSearch",void 0),e([i({type:Boolean})],h.prototype,"showNoResults",void 0),e([i({type:String})],h.prototype,"noResultsMessage",void 0),e([n("slot:not([name])")],h.prototype,"defaultSlot",void 0),_export("N",h=e([o("nile-menu")],h));}};});
|
2
2
|
//# sourceMappingURL=nile-menu.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-menu.cjs.js","sources":["../../../src/nile-menu/nile-menu.ts"],"sourcesContent":["import { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\nimport type NileMenuItem from '../nile-menu-item/nile-menu-item';\nimport { styles } from './nile-menu.css';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * An nile-menu element.\n * @summary Menus provide a list of options for the user to choose from.\n *\n * @slot - The menu's content, including menu items, menu labels, and dividers.\n *\n * @event nile-select - Emitted when a menu item is selected.\n * @fires count-changed - Indicates when the count changes\n * @slot - This element has a slot\n * @csspart button - The button\n */\n\n@customElement('nile-menu')\nexport class NileMenu extends NileElement {\n static styles: CSSResultGroup = styles;\n @state() searchValue: string = '';\n @state() searchWidth: number = 0;\n\n @property({ type: Boolean, reflect: true }) searchEnabled = false;\n @property({ type: Boolean, reflect: true }) customSearch = false;\n\n @property({ type: Boolean }) showNoResults: boolean = false;\n\n @property({ type: String }) noResultsMessage: string = 'No results found';\n\n @query('slot:not([name])') defaultSlot!: HTMLSlotElement;\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'menu__footer',\n 'menu__header'\n );\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'menu');\n }\n\n private handleClick(event: MouseEvent) {\n const target = event.target as HTMLElement;\n const item = target.closest('nile-menu-item');\n\n if (item?.hasSubMenu) {\n return;\n }\n\n // if (!item || item.disabled || item.inert) {\n if (!item || item.disabled) {\n return;\n }\n\n if (item.type === 'checkbox') {\n item.checked = !item.checked;\n }\n\n this.emit('nile-select', { value: item.value });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n // Make a selection when pressing enter\n if (event.key === 'Enter') {\n const item = this.getCurrentItem();\n event.preventDefault();\n\n // Simulate a click to support @click handlers on menu items that also work with the keyboard\n item?.click();\n }\n\n // Prevent scrolling when space is pressed\n if (event.key === ' ') {\n event.preventDefault();\n }\n\n // Move the selection when pressing down or up\n if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {\n const items = this.getAllItems();\n const activeItem = this.getCurrentItem();\n let index = activeItem ? items.indexOf(activeItem) : 0;\n\n if (items.length > 0) {\n event.preventDefault();\n\n if (event.key === 'ArrowDown') {\n index++;\n } else if (event.key === 'ArrowUp') {\n index--;\n } else if (event.key === 'Home') {\n index = 0;\n } else if (event.key === 'End') {\n index = items.length - 1;\n }\n\n if (index < 0) {\n index = items.length - 1;\n }\n if (index > items.length - 1) {\n index = 0;\n }\n\n this.setCurrentItem(items[index]);\n items[index].focus();\n }\n }\n }\n\n private handleMouseDown(event: MouseEvent) {\n const target = event.target as HTMLElement;\n\n if (this.isMenuItem(target)) {\n this.setCurrentItem(target as NileMenuItem);\n }\n }\n\n private handleSlotChange() {\n const items = this.getAllItems();\n\n // Reset the roving tab index when the slotted items change\n if (items.length > 0) {\n this.setCurrentItem(items[0]);\n }\n }\n\n private isMenuItem(item: HTMLElement) {\n return (\n item.tagName.toLowerCase() === 'nile-menu-item' ||\n ['menuitem', 'menuitemcheckbox', 'menuitemradio'].includes(\n item.getAttribute('role') ?? ''\n )\n );\n }\n\n /** @internal Gets all slotted menu items, ignoring dividers, headers, and other elements. */\n getAllItems() {\n return [...this.defaultSlot.assignedElements({ flatten: true })].filter(\n (el: HTMLElement) => {\n if (!this.isMenuItem(el)) {\n // if (el.inert || !this.isMenuItem(el)) {\n return false;\n }\n return true;\n }\n ) as NileMenuItem[];\n }\n\n /**\n * @internal Gets the current menu item, which is the menu item that has `tabindex=\"0\"` within the roving tab index.\n * The menu item may or may not have focus, but for keyboard interaction purposes it's considered the \"active\" item.\n */\n getCurrentItem() {\n return this.getAllItems().find(i => i.getAttribute('tabindex') === '0');\n }\n\n /**\n * @internal Sets the current menu item to the specified element. This sets `tabindex=\"0\"` on the target element and\n * `tabindex=\"-1\"` to all other items. This method must be called prior to setting focus on a menu item.\n */\n setCurrentItem(item: NileMenuItem) {\n const items = this.getAllItems();\n\n // Update tab indexes\n items.forEach(i => {\n i.setAttribute('tabindex', i === item ? '0' : '-1');\n });\n }\n\n private handleSearchChange(e: any) {\n let items = this.getAllItems();\n let searchValue = e.target.value;\n if (this.customSearch) {\n this.emit('nile-search-value', { value: searchValue });\n return;\n }\n\n let counter = 0;\n items.map(curr_item => {\n this.searchWidth = Math.max(this.searchWidth, curr_item.offsetWidth);\n if (\n curr_item.innerText.toLowerCase().includes(e.target.value.toLowerCase())\n ) {\n curr_item.style.display = 'block';\n counter++;\n } else {\n curr_item.style.display = 'none';\n }\n });\n this.showNoResults = counter === 0;\n }\n\n render() {\n return html`\n ${this.searchEnabled\n ? html`<div class=\"search__wrapper\" part=\"search__wrapper\">\n <nile-input\n size=\"medium\"\n .value=${this.searchValue}\n placeholder=\"Search...\"\n @nile-input=${this.handleSearchChange}\n part=\"menu__input\"\n clearable\n >\n <nile-icon name=\"search\" slot=\"suffix\"> </nile-icon>\n </nile-input>\n </div>`\n : html``}\n <div part=\"menu__items-wrapper\" class=\"menu__items-wrapper\">\n ${this.showNoResults\n ? html` <nile-menu-item>${this.noResultsMessage}</nile-menu-item> `\n : ''}\n\n <slot\n name=\"menu__header\"\n part=\"menu__header\"\n @click=${(e: Event) => {\n e.stopPropagation();\n }}\n ></slot>\n <slot\n class=\"menu__item-wrapper\"\n @slotchange=${this.handleSlotChange}\n @click=${this.handleClick}\n @keydown=${this.handleKeyDown}\n @mousedown=${this.handleMouseDown}\n ></slot>\n ${this.hasSlotController.test('menu__footer')\n ? html` <slot\n part=\"menu__footer\"\n name=\"menu__footer\"\n class=\"menu__footer\"\n ></slot>`\n : null}\n </div>\n `;\n }\n}\nexport default NileMenu;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-menu': NileMenu;\n }\n}\n"],"names":["NileMenu","_r","h","this","searchValue","searchWidth","searchEnabled","customSearch","showNoResults","noResultsMessage","hasSlotController","HasSlotController","_this","_inherits","_createClass","key","value","connectedCallback","super","setAttribute","handleClick","event","item","target","closest","hasSubMenu","disabled","type","checked","emit","handleKeyDown","getCurrentItem","preventDefault","click","includes","items","getAllItems","activeItem","index","indexOf","length","setCurrentItem","focus","handleMouseDown","isMenuItem","handleSlotChange","_e$getAttribute","tagName","toLowerCase","getAttribute","_toConsumableArray","defaultSlot","assignedElements","flatten","filter","el","find","i","forEach","handleSearchChange","e","counter","map","curr_item","Math","max","offsetWidth","innerText","style","display","render","html","_templateObject","_taggedTemplateLiteral","_templateObject2","_templateObject3","_templateObject4","stopPropagation","test","_templateObject5","NileElement","styles","__decorate","state","prototype","property","Boolean","reflect","String","query","customElement"],"mappings":"66KAuBaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,uEAE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CAAA,CAA3BG,EAAS,CAAE1D,IAAAA,CAAM6D,MAAwDxF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAoF,UAAA,kBAAA,CAAA,IAAA,EAAA,CAAA,CAE/CF,CAAA,CAAA,CAA1BO,EAAM,kBAAkDzF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAoF,SAAA,CAAA,aAAA,CAAA,IAAA,gBAZ9CpF,CAAQkF,CAAAA,CAAAA,CAAA,CADpBQ,CAAAA,CAAc,cACF1F"}
|
1
|
+
{"version":3,"file":"nile-menu.cjs.js","sources":["../../../src/nile-menu/nile-menu.ts"],"sourcesContent":["import { LitElement, html, css } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\nimport type NileMenuItem from '../nile-menu-item/nile-menu-item';\nimport { styles } from './nile-menu.css';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * An nile-menu element.\n * @summary Menus provide a list of options for the user to choose from.\n *\n * @slot - The menu's content, including menu items, menu labels, and dividers.\n *\n * @event nile-select - Emitted when a menu item is selected.\n * @fires count-changed - Indicates when the count changes\n * @slot - This element has a slot\n * @csspart button - The button\n */\n\n@customElement('nile-menu')\nexport class NileMenu extends NileElement {\n static styles: CSSResultGroup = styles;\n\n protected override BUBBLES: boolean=false;\n \n @state() searchValue: string = '';\n @state() searchWidth: number = 0;\n\n @property({ type: Boolean, reflect: true }) searchEnabled = false;\n @property({ type: Boolean, reflect: true }) customSearch = false;\n\n @property({ type: Boolean }) showNoResults: boolean = false;\n\n @property({ type: String }) noResultsMessage: string = 'No results found';\n\n @query('slot:not([name])') defaultSlot!: HTMLSlotElement;\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'menu__footer',\n 'menu__header'\n );\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'menu');\n }\n\n private handleClick(event: MouseEvent) {\n const target = event.target as HTMLElement;\n const item = target.closest('nile-menu-item');\n\n if (item?.hasSubMenu) {\n return;\n }\n\n // if (!item || item.disabled || item.inert) {\n if (!item || item.disabled) {\n return;\n }\n\n if (item.type === 'checkbox') {\n item.checked = !item.checked;\n }\n\n this.emit('nile-select', { value: item.value });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n // Make a selection when pressing enter\n if (event.key === 'Enter') {\n const item = this.getCurrentItem();\n event.preventDefault();\n\n // Simulate a click to support @click handlers on menu items that also work with the keyboard\n item?.click();\n }\n\n // Prevent scrolling when space is pressed\n if (event.key === ' ') {\n event.preventDefault();\n }\n\n // Move the selection when pressing down or up\n if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {\n const items = this.getAllItems();\n const activeItem = this.getCurrentItem();\n let index = activeItem ? items.indexOf(activeItem) : 0;\n\n if (items.length > 0) {\n event.preventDefault();\n\n if (event.key === 'ArrowDown') {\n index++;\n } else if (event.key === 'ArrowUp') {\n index--;\n } else if (event.key === 'Home') {\n index = 0;\n } else if (event.key === 'End') {\n index = items.length - 1;\n }\n\n if (index < 0) {\n index = items.length - 1;\n }\n if (index > items.length - 1) {\n index = 0;\n }\n\n this.setCurrentItem(items[index]);\n items[index].focus();\n }\n }\n }\n\n private handleMouseDown(event: MouseEvent) {\n const target = event.target as HTMLElement;\n\n if (this.isMenuItem(target)) {\n this.setCurrentItem(target as NileMenuItem);\n }\n }\n\n private handleSlotChange() {\n const items = this.getAllItems();\n\n // Reset the roving tab index when the slotted items change\n if (items.length > 0) {\n this.setCurrentItem(items[0]);\n }\n }\n\n private isMenuItem(item: HTMLElement) {\n return (\n item.tagName.toLowerCase() === 'nile-menu-item' ||\n ['menuitem', 'menuitemcheckbox', 'menuitemradio'].includes(\n item.getAttribute('role') ?? ''\n )\n );\n }\n\n /** @internal Gets all slotted menu items, ignoring dividers, headers, and other elements. */\n getAllItems() {\n return [...this.defaultSlot.assignedElements({ flatten: true })].filter(\n (el: HTMLElement) => {\n if (!this.isMenuItem(el)) {\n // if (el.inert || !this.isMenuItem(el)) {\n return false;\n }\n return true;\n }\n ) as NileMenuItem[];\n }\n\n /**\n * @internal Gets the current menu item, which is the menu item that has `tabindex=\"0\"` within the roving tab index.\n * The menu item may or may not have focus, but for keyboard interaction purposes it's considered the \"active\" item.\n */\n getCurrentItem() {\n return this.getAllItems().find(i => i.getAttribute('tabindex') === '0');\n }\n\n /**\n * @internal Sets the current menu item to the specified element. This sets `tabindex=\"0\"` on the target element and\n * `tabindex=\"-1\"` to all other items. This method must be called prior to setting focus on a menu item.\n */\n setCurrentItem(item: NileMenuItem) {\n const items = this.getAllItems();\n\n // Update tab indexes\n items.forEach(i => {\n i.setAttribute('tabindex', i === item ? '0' : '-1');\n });\n }\n\n private handleSearchChange(e: any) {\n let items = this.getAllItems();\n let searchValue = e.target.value;\n if (this.customSearch) {\n this.emit('nile-search-value', { value: searchValue });\n return;\n }\n\n let counter = 0;\n items.map(curr_item => {\n this.searchWidth = Math.max(this.searchWidth, curr_item.offsetWidth);\n if (\n curr_item.innerText.toLowerCase().includes(e.target.value.toLowerCase())\n ) {\n curr_item.style.display = 'block';\n counter++;\n } else {\n curr_item.style.display = 'none';\n }\n });\n this.showNoResults = counter === 0;\n }\n\n render() {\n return html`\n ${this.searchEnabled\n ? html`<div class=\"search__wrapper\" part=\"search__wrapper\">\n <nile-input\n size=\"medium\"\n .value=${this.searchValue}\n placeholder=\"Search...\"\n @nile-input=${this.handleSearchChange}\n part=\"menu__input\"\n clearable\n >\n <nile-icon name=\"search\" slot=\"suffix\"> </nile-icon>\n </nile-input>\n </div>`\n : html``}\n <div part=\"menu__items-wrapper\" class=\"menu__items-wrapper\">\n ${this.showNoResults\n ? html` <nile-menu-item>${this.noResultsMessage}</nile-menu-item> `\n : ''}\n\n <slot\n name=\"menu__header\"\n part=\"menu__header\"\n @click=${(e: Event) => {\n e.stopPropagation();\n }}\n ></slot>\n <slot\n class=\"menu__item-wrapper\"\n @slotchange=${this.handleSlotChange}\n @click=${this.handleClick}\n @keydown=${this.handleKeyDown}\n @mousedown=${this.handleMouseDown}\n ></slot>\n ${this.hasSlotController.test('menu__footer')\n ? html` <slot\n part=\"menu__footer\"\n name=\"menu__footer\"\n class=\"menu__footer\"\n ></slot>`\n : null}\n </div>\n `;\n }\n}\nexport default NileMenu;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-menu': NileMenu;\n }\n}\n"],"names":["NileMenu","h","constructor","this","BUBBLES","searchValue","searchWidth","searchEnabled","customSearch","showNoResults","noResultsMessage","hasSlotController","HasSlotController","_this","_inherits","_r","_createClass","key","value","connectedCallback","super","setAttribute","handleClick","event","item","target","closest","hasSubMenu","disabled","type","checked","emit","handleKeyDown","getCurrentItem","preventDefault","click","includes","items","getAllItems","activeItem","index","indexOf","length","setCurrentItem","focus","handleMouseDown","isMenuItem","handleSlotChange","tagName","toLowerCase","getAttribute","_e$getAttribute","_this2","_toConsumableArray","defaultSlot","assignedElements","flatten","filter","el","find","i","forEach","handleSearchChange","e","_this3","counter","map","curr_item","Math","max","offsetWidth","innerText","style","display","render","html","_templateObject","_taggedTemplateLiteral","_templateObject2","_templateObject3","_templateObject4","stopPropagation","test","_templateObject5","NileElement","styles","__decorate","state","prototype","property","Boolean","reflect","String","query","customElement"],"mappings":"66KAuBaA,4BAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCAGcC,EAAAA,KAAAA,CAAOC,OAAU,CAAA,CAAA,CAAA,CAE3BD,KAAAA,CAAWE,WAAW,CAAA,EAAA,CACtBF,KAAAA,CAAWG,WAAAA,CAAW,EAEaH,KAAAA,CAAaI,aAAAA,CAAAA,CAAG,EAChBJ,KAAAA,CAAYK,YAAAA,CAAAA,CAAG,EAE9BL,KAAAA,CAAaM,aAAAA,CAAAA,CAAY,CAE1BN,CAAAA,KAAAA,CAAgBO,iBAAW,kBAItCP,CAAAA,KAAAA,CAAiBQ,i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A,CAAAwF,SAAA,CAAA,aAAA,CAAA,IAAA,gBAf9CxF,CAAQsF,CAAAA,CAAAA,CAAA,CADpBQ,CAAAA,CAAc,cACF9F"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{__decorate as e}from"tslib";import{html as t}from"lit";import{state as s,property as i,query as n,customElement as o}from"lit/decorators.js";import{N as r}from"../internal/nile-element.esm.js";import{s as l}from"./nile-menu.css.esm.js";import{H as a}from"../internal/slot.esm.js";import"../index-0a3007c5.esm.js";let h=class extends r{constructor(){super(...arguments),this.searchValue="",this.searchWidth=0,this.searchEnabled=!1,this.customSearch=!1,this.showNoResults=!1,this.noResultsMessage="No results found",this.hasSlotController=new a(this,"menu__footer","menu__header")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}handleClick(e){const t=e.target.closest("nile-menu-item");t?.hasSubMenu||t&&!t.disabled&&("checkbox"===t.type&&(t.checked=!t.checked),this.emit("nile-select",{value:t.value}))}handleKeyDown(e){if("Enter"===e.key){const t=this.getCurrentItem();e.preventDefault(),t?.click()}if(" "===e.key&&e.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(e.key)){const t=this.getAllItems(),s=this.getCurrentItem();let i=s?t.indexOf(s):0;t.length>0&&(e.preventDefault(),"ArrowDown"===e.key?i++:"ArrowUp"===e.key?i--:"Home"===e.key?i=0:"End"===e.key&&(i=t.length-1),i<0&&(i=t.length-1),i>t.length-1&&(i=0),this.setCurrentItem(t[i]),t[i].focus())}}handleMouseDown(e){const t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t)}handleSlotChange(){const e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0])}isMenuItem(e){return"nile-menu-item"===e.tagName.toLowerCase()||["menuitem","menuitemcheckbox","menuitemradio"].includes(e.getAttribute("role")??"")}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:!0})].filter((e=>!!this.isMenuItem(e)))}getCurrentItem(){return this.getAllItems().find((e=>"0"===e.getAttribute("tabindex")))}setCurrentItem(e){this.getAllItems().forEach((t=>{t.setAttribute("tabindex",t===e?"0":"-1")}))}handleSearchChange(e){let t=this.getAllItems(),s=e.target.value;if(this.customSearch)return void this.emit("nile-search-value",{value:s});let i=0;t.map((t=>{this.searchWidth=Math.max(this.searchWidth,t.offsetWidth),t.innerText.toLowerCase().includes(e.target.value.toLowerCase())?(t.style.display="block",i++):t.style.display="none"})),this.showNoResults=0===i}render(){return t`
|
1
|
+
import{__decorate as e}from"tslib";import{html as t}from"lit";import{state as s,property as i,query as n,customElement as o}from"lit/decorators.js";import{N as r}from"../internal/nile-element.esm.js";import{s as l}from"./nile-menu.css.esm.js";import{H as a}from"../internal/slot.esm.js";import"../index-0a3007c5.esm.js";let h=class extends r{constructor(){super(...arguments),this.BUBBLES=!1,this.searchValue="",this.searchWidth=0,this.searchEnabled=!1,this.customSearch=!1,this.showNoResults=!1,this.noResultsMessage="No results found",this.hasSlotController=new a(this,"menu__footer","menu__header")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}handleClick(e){const t=e.target.closest("nile-menu-item");t?.hasSubMenu||t&&!t.disabled&&("checkbox"===t.type&&(t.checked=!t.checked),this.emit("nile-select",{value:t.value}))}handleKeyDown(e){if("Enter"===e.key){const t=this.getCurrentItem();e.preventDefault(),t?.click()}if(" "===e.key&&e.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(e.key)){const t=this.getAllItems(),s=this.getCurrentItem();let i=s?t.indexOf(s):0;t.length>0&&(e.preventDefault(),"ArrowDown"===e.key?i++:"ArrowUp"===e.key?i--:"Home"===e.key?i=0:"End"===e.key&&(i=t.length-1),i<0&&(i=t.length-1),i>t.length-1&&(i=0),this.setCurrentItem(t[i]),t[i].focus())}}handleMouseDown(e){const t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t)}handleSlotChange(){const e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0])}isMenuItem(e){return"nile-menu-item"===e.tagName.toLowerCase()||["menuitem","menuitemcheckbox","menuitemradio"].includes(e.getAttribute("role")??"")}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:!0})].filter((e=>!!this.isMenuItem(e)))}getCurrentItem(){return this.getAllItems().find((e=>"0"===e.getAttribute("tabindex")))}setCurrentItem(e){this.getAllItems().forEach((t=>{t.setAttribute("tabindex",t===e?"0":"-1")}))}handleSearchChange(e){let t=this.getAllItems(),s=e.target.value;if(this.customSearch)return void this.emit("nile-search-value",{value:s});let i=0;t.map((t=>{this.searchWidth=Math.max(this.searchWidth,t.offsetWidth),t.innerText.toLowerCase().includes(e.target.value.toLowerCase())?(t.style.display="block",i++):t.style.display="none"})),this.showNoResults=0===i}render(){return t`
|
2
2
|
${this.searchEnabled?t`<div class="search__wrapper" part="search__wrapper">
|
3
3
|
<nile-input
|
4
4
|
size="medium"
|