@aquera/nile-elements 1.3.0-beta-1.1 → 1.3.0-beta-1.2
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 +1 -0
- package/demo/index.html +269 -34
- package/dist/assets/nile-elements-4b5c262d.css +1 -0
- package/dist/{fixture-54600b35.cjs.js → fixture-1c49c014.cjs.js} +2 -2
- package/dist/{fixture-73855806.cjs.js.map → fixture-1c49c014.cjs.js.map} +1 -1
- package/dist/{fixture-9871e8a9.esm.js → fixture-985bba12.esm.js} +1 -1
- package/dist/{fixture-73855806.cjs.js → fixture-d1470b58.cjs.js} +2 -2
- package/dist/{fixture-54600b35.cjs.js.map → fixture-d1470b58.cjs.js.map} +1 -1
- package/dist/{fixture-5b79f853.cjs.js → fixture-dff65c89.cjs.js} +2 -2
- package/dist/{fixture-c1d78368.cjs.js.map → fixture-dff65c89.cjs.js.map} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +280 -280
- package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
- package/dist/nile-auto-complete/index.cjs.js +1 -1
- package/dist/nile-auto-complete/index.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 +2 -2
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
- package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.test.esm.js +1 -1
- package/dist/nile-button/nile-button.test.cjs.js +1 -1
- package/dist/nile-button/nile-button.test.esm.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
- package/dist/nile-card/nile-card.test.cjs.js +1 -1
- package/dist/nile-card/nile-card.test.esm.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
- package/dist/nile-chip/index.cjs.js +1 -1
- package/dist/nile-chip/index.esm.js +1 -1
- 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 +2 -2
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
- package/dist/nile-dropdown/index.cjs.js +1 -1
- package/dist/nile-dropdown/index.esm.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.cjs.js.map +1 -1
- package/dist/nile-dropdown/nile-dropdown.esm.js +2 -2
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js.map +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +6 -6
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.test.esm.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.test.esm.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.test.esm.js +1 -1
- package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
- package/dist/nile-icon/nile-icon.test.esm.js +1 -1
- package/dist/nile-inline-edit/index.cjs.js +1 -1
- package/dist/nile-inline-edit/index.esm.js +1 -1
- package/dist/nile-inline-edit/nile-inline-edit.cjs.js +1 -1
- package/dist/nile-inline-edit/nile-inline-edit.cjs.js.map +1 -1
- package/dist/nile-inline-edit/nile-inline-edit.esm.js +4 -4
- package/dist/nile-input/nile-input.test.cjs.js +1 -1
- package/dist/nile-input/nile-input.test.esm.js +1 -1
- package/dist/nile-light-tooltip/index.esm.js +1 -0
- package/dist/nile-light-tooltip/nile-light-tooltip.css.esm.js +6 -0
- package/dist/nile-light-tooltip/nile-light-tooltip.esm.js +1 -0
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.esm.js +1 -1
- package/dist/nile-lite-tooltip/index.cjs.js +1 -1
- package/dist/nile-lite-tooltip/index.esm.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js.map +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.esm.js +1 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.test.esm.js +1 -1
- package/dist/nile-popover/index.cjs.js +1 -1
- package/dist/nile-popover/index.esm.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +3 -3
- package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.esm.js +4 -4
- package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.test.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.test.esm.js +4 -4
- package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.test.esm.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.test.esm.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.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 +2 -2
- package/dist/nile-select/nile-select.test.cjs.js +1 -1
- package/dist/nile-select/nile-select.test.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.test.esm.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
- package/dist/nile-tooltip/index.cjs.js +1 -1
- package/dist/nile-tooltip/index.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 +2 -2
- package/dist/nile-virtual-select/index.cjs.js +1 -1
- package/dist/nile-virtual-select/index.esm.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +2 -2
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +13 -13
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +4 -0
- package/dist/src/nile-auto-complete/nile-auto-complete.js +41 -0
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.d.ts +4 -0
- package/dist/src/nile-chip/nile-chip.js +47 -0
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-dropdown/nile-dropdown.d.ts +4 -1
- package/dist/src/nile-dropdown/nile-dropdown.js +38 -1
- package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
- package/dist/src/nile-inline-edit/nile-inline-edit.d.ts +0 -8
- package/dist/src/nile-inline-edit/nile-inline-edit.js +1 -47
- package/dist/src/nile-inline-edit/nile-inline-edit.js.map +1 -1
- package/dist/src/nile-light-tooltip/index.d.ts +1 -0
- package/dist/src/nile-light-tooltip/index.js +2 -0
- package/dist/src/nile-light-tooltip/index.js.map +1 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.css.d.ts +12 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.css.js +18 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.css.js.map +1 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.d.ts +40 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.js +101 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.js.map +1 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.d.ts +5 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js +44 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js.map +1 -1
- package/dist/src/nile-menu/virtual-menu-search-manager.d.ts +11 -0
- package/dist/src/nile-menu/virtual-menu-search-manager.js +43 -0
- package/dist/src/nile-menu/virtual-menu-search-manager.js.map +1 -0
- package/dist/src/nile-popover/nile-popover.d.ts +4 -0
- package/dist/src/nile-popover/nile-popover.js +40 -0
- package/dist/src/nile-popover/nile-popover.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +1 -5
- package/dist/src/nile-select/nile-select.js +28 -67
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.d.ts +3 -0
- package/dist/src/nile-tooltip/nile-tooltip.js +38 -0
- package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +2 -5
- package/dist/src/nile-virtual-select/nile-virtual-select.js +29 -66
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -1
- package/dist/src/utilities/visibility-manager.d.ts +20 -0
- package/dist/src/utilities/visibility-manager.js +64 -0
- package/dist/src/utilities/visibility-manager.js.map +1 -0
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utilities/visibility-manager.cjs.js +2 -0
- package/dist/utilities/visibility-manager.cjs.js.map +1 -0
- package/dist/utilities/visibility-manager.esm.js +1 -0
- package/package.json +2 -2
- package/src/nile-auto-complete/nile-auto-complete.ts +44 -0
- package/src/nile-chip/nile-chip.ts +53 -0
- package/src/nile-dropdown/nile-dropdown.ts +40 -1
- package/src/nile-inline-edit/nile-inline-edit.ts +1 -59
- package/src/nile-lite-tooltip/nile-lite-tooltip.ts +52 -1
- package/src/nile-popover/nile-popover.ts +44 -0
- package/src/nile-select/nile-select.ts +31 -87
- package/src/nile-tooltip/nile-tooltip.ts +39 -0
- package/src/nile-virtual-select/nile-virtual-select.ts +32 -87
- package/src/utilities/visibility-manager.ts +104 -0
- package/vscode-html-custom-data.json +69 -13
- package/dist/fixture-5b79f853.cjs.js.map +0 -1
- package/dist/fixture-90b199c4.esm.js +0 -569
- package/dist/fixture-c1d78368.cjs.js +0 -395
- package/dist/fixture-cf7bfcf5.esm.js +0 -569
- package/dist/fixture-dbd66009.cjs.js +0 -395
- package/dist/fixture-dbd66009.cjs.js.map +0 -1
- package/dist/nile-code-editor/backup_nile-code-editor copy.cjs.js +0 -2
- package/dist/nile-code-editor/backup_nile-code-editor copy.cjs.js.map +0 -1
- package/dist/nile-code-editor/backup_nile-code-editor copy.esm.js +0 -1
- package/dist/nile-inline-edit/nile-inline-edit-utils.cjs.js +0 -2
- package/dist/nile-inline-edit/nile-inline-edit-utils.cjs.js.map +0 -1
- package/dist/nile-inline-edit/nile-inline-edit-utils.esm.js +0 -1
- package/dist/nile-sidebar/index.cjs.js +0 -2
- package/dist/nile-sidebar/index.cjs.js.map +0 -1
- package/dist/nile-sidebar/index.esm.js +0 -75
- package/dist/nile-sidebar-menu/index.cjs.js +0 -2
- package/dist/nile-sidebar-menu/index.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu/index.esm.js +0 -1
- package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js +0 -2
- package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js +0 -2
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.esm.js +0 -38
- package/dist/nile-sidebar-menu/nile-sidebar-menu.esm.js +0 -10
- package/dist/nile-sidebar-menu-items/index.cjs.js +0 -2
- package/dist/nile-sidebar-menu-items/index.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu-items/index.esm.js +0 -1
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js +0 -2
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js +0 -2
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.esm.js +0 -36
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.esm.js +0 -15
- package/dist/nile-sidebar-wrapper/index.cjs.js +0 -2
- package/dist/nile-sidebar-wrapper/index.cjs.js.map +0 -1
- package/dist/nile-sidebar-wrapper/index.esm.js +0 -1
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js +0 -2
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js.map +0 -1
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js +0 -2
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js.map +0 -1
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.esm.js +0 -105
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.esm.js +0 -16
- package/dist/nile-virtual-select/group-manager.cjs.js +0 -2
- package/dist/nile-virtual-select/group-manager.cjs.js.map +0 -1
- package/dist/nile-virtual-select/group-manager.esm.js +0 -1
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js +0 -2
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js.map +0 -1
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.esm.js +0 -231
- package/dist/scopedElementsWrapper-4c29be11.esm.js +0 -7
- package/dist/scopedElementsWrapper-a112fc73.cjs.js +0 -6
- package/dist/scopedElementsWrapper-a112fc73.cjs.js.map +0 -1
- package/dist/src/internal/portal-manager.d.ts +0 -53
- package/dist/src/internal/portal-manager.js +0 -196
- package/dist/src/internal/portal-manager.js.map +0 -1
- package/dist/src/internal/portal.d.ts +0 -60
- package/dist/src/internal/portal.js +0 -199
- package/dist/src/internal/portal.js.map +0 -1
- package/dist/src/internal/resizable-helper.d.ts +0 -59
- package/dist/src/internal/resizable-helper.js +0 -115
- package/dist/src/internal/resizable-helper.js.map +0 -1
- package/dist/src/internal/resizable-styles.d.ts +0 -16
- package/dist/src/internal/resizable-styles.js +0 -144
- package/dist/src/internal/resizable-styles.js.map +0 -1
- package/dist/src/internal/virtualizer-error-handler.d.ts +0 -30
- package/dist/src/internal/virtualizer-error-handler.js +0 -82
- package/dist/src/internal/virtualizer-error-handler.js.map +0 -1
- package/dist/src/lib/index.d.ts +0 -7
- package/dist/src/lib/index.js +0 -8
- package/dist/src/lib/index.js.map +0 -1
- package/dist/src/lib/virtualize.d.ts +0 -32
- package/dist/src/lib/virtualize.js +0 -105
- package/dist/src/lib/virtualize.js.map +0 -1
- package/dist/src/lib/virtualize.test.d.ts +0 -7
- package/dist/src/lib/virtualize.test.js +0 -57
- package/dist/src/lib/virtualize.test.js.map +0 -1
- package/dist/src/nile-badge/__snapshots__/nile-badge.test.snap.js +0 -17
- package/dist/src/nile-calendar/__snapshots__/nile-calendar.test.snap.js +0 -310
- package/dist/src/nile-card/__snapshots__/nile-card.test.snap.js +0 -34
- package/dist/src/nile-checkbox/__snapshots__/nile-checkbox.test.snap.js +0 -31
- package/dist/src/nile-code-editor/Old_theme copy.d.ts +0 -191
- package/dist/src/nile-code-editor/Old_theme copy.js +0 -193
- package/dist/src/nile-code-editor/Old_theme copy.js.map +0 -1
- package/dist/src/nile-code-editor/backup_nile-code-editor copy.d.ts +0 -0
- package/dist/src/nile-code-editor/backup_nile-code-editor copy.js +0 -675
- package/dist/src/nile-code-editor/backup_nile-code-editor copy.js.map +0 -1
- package/dist/src/nile-code-editor/theme copy.d.ts +0 -191
- package/dist/src/nile-code-editor/theme copy.js +0 -193
- package/dist/src/nile-code-editor/theme copy.js.map +0 -1
- package/dist/src/nile-grid/data-processor.d.ts +0 -37
- package/dist/src/nile-grid/data-processor.js +0 -122
- package/dist/src/nile-grid/data-processor.js.map +0 -1
- package/dist/src/nile-grid/event-handlers.d.ts +0 -35
- package/dist/src/nile-grid/event-handlers.js +0 -158
- package/dist/src/nile-grid/event-handlers.js.map +0 -1
- package/dist/src/nile-grid/renderer.d.ts +0 -8
- package/dist/src/nile-grid/renderer.js +0 -78
- package/dist/src/nile-grid/renderer.js.map +0 -1
- package/dist/src/nile-grid/resize-handler.d.ts +0 -4
- package/dist/src/nile-grid/resize-handler.js +0 -36
- package/dist/src/nile-grid/resize-handler.js.map +0 -1
- package/dist/src/nile-grid/types.d.ts +0 -32
- package/dist/src/nile-grid/types.js +0 -2
- package/dist/src/nile-grid/types.js.map +0 -1
- package/dist/src/nile-grid/utils.d.ts +0 -4
- package/dist/src/nile-grid/utils.js +0 -32
- package/dist/src/nile-grid/utils.js.map +0 -1
- package/dist/src/nile-hero/__snapshots__/nile-hero.test.snap.js +0 -47
- package/dist/src/nile-icon/__snapshots__/nile-icon.test.snap.js +0 -16
- package/dist/src/nile-inline-edit/nile-inline-edit-utils.d.ts +0 -20
- package/dist/src/nile-inline-edit/nile-inline-edit-utils.js +0 -70
- package/dist/src/nile-inline-edit/nile-inline-edit-utils.js.map +0 -1
- package/dist/src/nile-input/__snapshots__/nile-input.test.snap.js +0 -75
- package/dist/src/nile-menu/portal-manager.d.ts +0 -39
- package/dist/src/nile-menu/portal-manager.js +0 -340
- package/dist/src/nile-menu/portal-manager.js.map +0 -1
- package/dist/src/nile-menu/portal-utils.d.ts +0 -21
- package/dist/src/nile-menu/portal-utils.js +0 -128
- package/dist/src/nile-menu/portal-utils.js.map +0 -1
- package/dist/src/nile-popover/__snapshots__/nile-popover.test.snap.js +0 -22
- package/dist/src/nile-popover/popover-portal-handler.d.ts +0 -21
- package/dist/src/nile-popover/popover-portal-handler.js +0 -106
- package/dist/src/nile-popover/popover-portal-handler.js.map +0 -1
- package/dist/src/nile-portal-wrapper/index.d.ts +0 -1
- package/dist/src/nile-portal-wrapper/index.js +0 -2
- package/dist/src/nile-portal-wrapper/index.js.map +0 -1
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.d.ts +0 -47
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js +0 -451
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js.map +0 -1
- package/dist/src/nile-select/body-append-manager.d.ts +0 -90
- package/dist/src/nile-select/body-append-manager.js +0 -298
- package/dist/src/nile-select/body-append-manager.js.map +0 -1
- package/dist/src/nile-table-body/virtual-scroll-helper.d.ts +0 -9
- package/dist/src/nile-table-body/virtual-scroll-helper.js +0 -24
- package/dist/src/nile-table-body/virtual-scroll-helper.js.map +0 -1
- package/dist/src/nile-virtual-select/body-append-helper.d.ts +0 -16
- package/dist/src/nile-virtual-select/body-append-helper.js +0 -95
- package/dist/src/nile-virtual-select/body-append-helper.js.map +0 -1
- package/dist/src/nile-virtual-select/group-manager.d.ts +0 -32
- package/dist/src/nile-virtual-select/group-manager.js +0 -134
- package/dist/src/nile-virtual-select/group-manager.js.map +0 -1
- package/dist/src/nile-virtual-select/portal-utils.d.ts +0 -65
- package/dist/src/nile-virtual-select/portal-utils.js +0 -376
- package/dist/src/nile-virtual-select/portal-utils.js.map +0 -1
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.d.ts +0 -273
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js +0 -1305
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js.map +0 -1
- package/dist/src/nile-virtual-select/virtualizer-error-handler.d.ts +0 -21
- package/dist/src/nile-virtual-select/virtualizer-error-handler.js +0 -56
- package/dist/src/nile-virtual-select/virtualizer-error-handler.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/index.d.ts +0 -1
- package/dist/src/nile-virtual-select-disabled/index.js +0 -2
- package/dist/src/nile-virtual-select-disabled/index.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.d.ts +0 -12
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js +0 -538
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.d.ts +0 -299
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js +0 -1441
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.d.ts +0 -7
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js +0 -631
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/portal-manager.d.ts +0 -45
- package/dist/src/nile-virtual-select-disabled/portal-manager.js +0 -333
- package/dist/src/nile-virtual-select-disabled/portal-manager.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/renderer.d.ts +0 -16
- package/dist/src/nile-virtual-select-disabled/renderer.js +0 -79
- package/dist/src/nile-virtual-select-disabled/renderer.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/search-manager.d.ts +0 -12
- package/dist/src/nile-virtual-select-disabled/search-manager.js +0 -40
- package/dist/src/nile-virtual-select-disabled/search-manager.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/selection-manager.d.ts +0 -12
- package/dist/src/nile-virtual-select-disabled/selection-manager.js +0 -64
- package/dist/src/nile-virtual-select-disabled/selection-manager.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/types.d.ts +0 -50
- package/dist/src/nile-virtual-select-disabled/types.js +0 -8
- package/dist/src/nile-virtual-select-disabled/types.js.map +0 -1
- package/dist/src/nile-virtual-table-body/index.d.ts +0 -2
- package/dist/src/nile-virtual-table-body/index.js +0 -3
- package/dist/src/nile-virtual-table-body/index.js.map +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.d.ts +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js +0 -44
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js.map +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.d.ts +0 -50
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js +0 -135
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js.map +0 -1
- package/dist/src/nile-virtual-table-body/renderer.d.ts +0 -16
- package/dist/src/nile-virtual-table-body/renderer.js +0 -49
- package/dist/src/nile-virtual-table-body/renderer.js.map +0 -1
- package/dist/src/utilities/stepper-utils.d.ts +0 -71
- package/dist/src/utilities/stepper-utils.js +0 -108
- package/dist/src/utilities/stepper-utils.js.map +0 -1
- package/src/nile-inline-edit/nile-inline-edit-utils.ts +0 -94
|
@@ -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-54600b35.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-accordion.cjs.js","../sinon-esm-97570c13.cjs.js","tslib","./nile-accordion.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js"],function(_export,_context){"use strict";var a,e,i,n,o,r,t,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12;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(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){a=_fixture005CjsJs.f;e=_fixture005CjsJs.a;i=_fixture005CjsJs.e;n=_fixture005CjsJs.o;},function(_litStaticHtmlJs){o=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileAccordionCjsJs){r=_nileAccordionCjsJs.N;},function(_sinonEsm006CjsJs){t=_sinonEsm006CjsJs.s;},function(_tslib){},function(_nileAccordionCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalAnimateCjsJs){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){}],execute:function execute(){describe("NileAccordion",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return a(o(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context2.sent;e(i).to.be.instanceOf(r),e(i.shadowRoot).not.to.be["null"],e(i.summary).to.equal("Test Summary");case 4:case"end":return _context2.stop();}},_callee);}))),it("should initialize closed by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _i$shadowRoot;var i,n;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return a(o(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context3.sent;e(i.open).to.be["false"];n=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.querySelector(".accordian__body");e(n===null||n===void 0?void 0:n.hidden).to.be["true"];case 6:case"end":return _context3.stop();}},_callee2);}))),it("should open when clicked",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _n$shadowRoot,_n$shadowRoot2;var n,r,t;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return a(o(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context4.sent;r=(_n$shadowRoot=n.shadowRoot)===null||_n$shadowRoot===void 0?void 0:_n$shadowRoot.querySelector(".accordian__header");r.click();_context4.next=7;return i(n);case 7:e(n.open).to.be["true"];t=(_n$shadowRoot2=n.shadowRoot)===null||_n$shadowRoot2===void 0?void 0:_n$shadowRoot2.querySelector(".accordian__body");e(t===null||t===void 0?void 0:t.hidden).to.be["false"];case 10:case"end":return _context4.stop();}},_callee3);}))),it('should emit "nile-show" and "nile-after-show" when opened',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _i$shadowRoot2;var i,r,c;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return a(o(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context5.sent;r=t.spy(i,"emit");c=(_i$shadowRoot2=i.shadowRoot)===null||_i$shadowRoot2===void 0?void 0:_i$shadowRoot2.querySelector(".accordian__header");setTimeout(function(){return c.click();});_context5.next=8;return n(i,"nile-after-show");case 8:e(r.calledWith("nile-show")).to.be["true"];e(r.calledWith("nile-after-show")).to.be["true"];case 10:case"end":return _context5.stop();}},_callee4);}))),it('should emit "nile-hide" and "nile-after-hide" when closed',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _i$shadowRoot3;var i,r,c;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return a(o(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" open></nile-accordion>"]))));case 2:i=_context6.sent;r=t.spy(i,"emit");c=(_i$shadowRoot3=i.shadowRoot)===null||_i$shadowRoot3===void 0?void 0:_i$shadowRoot3.querySelector(".accordian__header");setTimeout(function(){return c.click();});_context6.next=8;return n(i,"nile-after-hide");case 8:e(r.calledWith("nile-hide")).to.be["true"];e(r.calledWith("nile-after-hide")).to.be["true"];case 10:case"end":return _context6.stop();}},_callee5);}))),it('should be disabled when the "disabled" property is set',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _n$shadowRoot3;var n,r;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return a(o(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" disabled></nile-accordion>"]))));case 2:n=_context7.sent;r=(_n$shadowRoot3=n.shadowRoot)===null||_n$shadowRoot3===void 0?void 0:_n$shadowRoot3.querySelector(".accordian__header");r.click();_context7.next=7;return i(n);case 7:e(n.open).to.be["false"];case 8:case"end":return _context7.stop();}},_callee6);}))),it("should handle keyboard interaction (Enter and Space)",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _n$shadowRoot4;var n,r,t,c;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return a(o(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context8.sent;r=(_n$shadowRoot4=n.shadowRoot)===null||_n$shadowRoot4===void 0?void 0:_n$shadowRoot4.querySelector(".accordian__header");t=new KeyboardEvent("keydown",{key:"Enter"});r.dispatchEvent(t);_context8.next=8;return i(n);case 8:e(n.open).to.be["true"];c=new KeyboardEvent("keydown",{key:" "});r.dispatchEvent(c);_context8.next=13;return i(n);case 13:e(n.open).to.be["false"];case 14:case"end":return _context8.stop();}},_callee7);}))),it("should handle ArrowUp/ArrowLeft to close and ArrowDown/ArrowRight to open",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _n$shadowRoot5;var n,r,t,c;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return a(o(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context9.sent;r=(_n$shadowRoot5=n.shadowRoot)===null||_n$shadowRoot5===void 0?void 0:_n$shadowRoot5.querySelector(".accordian__header");t=new KeyboardEvent("keydown",{key:"ArrowDown"});r.dispatchEvent(t);_context9.next=8;return i(n);case 8:e(n.open).to.be["true"];c=new KeyboardEvent("keydown",{key:"ArrowUp"});r.dispatchEvent(c);_context9.next=13;return i(n);case 13:e(n.open).to.be["false"];case 14:case"end":return _context9.stop();}},_callee8);}))),it('should apply the "variant" class based on the variant property',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var _i$shadowRoot4;var i,n;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return a(o(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" variant=\"dark\"></nile-accordion>"]))));case 2:i=_context10.sent;n=(_i$shadowRoot4=i.shadowRoot)===null||_i$shadowRoot4===void 0?void 0:_i$shadowRoot4.querySelector(".accordian__header");e(n).to.have["class"]("accordian__header--dark");case 5:case"end":return _context10.stop();}},_callee9);}))),it("should apply the correct size class based on the size property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var _i$shadowRoot5;var i,n;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return a(o(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" size=\"lg\"></nile-accordion>"]))));case 2:i=_context11.sent;n=(_i$shadowRoot5=i.shadowRoot)===null||_i$shadowRoot5===void 0?void 0:_i$shadowRoot5.querySelector(".accordian");e(n).to.have["class"]("accordian--lg");case 5:case"end":return _context11.stop();}},_callee10);}))),it("should apply the correct expand icon placement class based on the expandIconPlacement property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(){var _i$shadowRoot6;var i,n;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_context12.next=2;return a(o(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" expandIconPlacement=\"left\"></nile-accordion>"]))));case 2:i=_context12.sent;n=(_i$shadowRoot6=i.shadowRoot)===null||_i$shadowRoot6===void 0?void 0:_i$shadowRoot6.querySelector(".accordian__header");e(n).to.have["class"]("accordian__header--arrow-left");case 5:case"end":return _context12.stop();}},_callee11);}))),it("should animate when opening and closing",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(){var _n$shadowRoot6;var n,r,c;return _regeneratorRuntime().wrap(function _callee12$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:_context13.next=2;return a(o(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context13.sent;r=t.spy(n,"handleOpenChange");c=(_n$shadowRoot6=n.shadowRoot)===null||_n$shadowRoot6===void 0?void 0:_n$shadowRoot6.querySelector(".accordian__header");c.click();_context13.next=8;return i(n);case 8:e(r.called).to.be["true"];c.click();_context13.next=12;return i(n);case 12:e(r.calledTwice).to.be["true"];case 13:case"end":return _context13.stop();}},_callee12);})));});}};});
|
|
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-1c49c014.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-accordion.cjs.js","../sinon-esm-97570c13.cjs.js","tslib","./nile-accordion.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js"],function(_export,_context){"use strict";var a,e,i,n,o,r,t,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12;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(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){a=_fixture005CjsJs.f;e=_fixture005CjsJs.a;i=_fixture005CjsJs.e;n=_fixture005CjsJs.o;},function(_litStaticHtmlJs){o=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileAccordionCjsJs){r=_nileAccordionCjsJs.N;},function(_sinonEsm006CjsJs){t=_sinonEsm006CjsJs.s;},function(_tslib){},function(_nileAccordionCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalAnimateCjsJs){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){}],execute:function execute(){describe("NileAccordion",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return a(o(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context2.sent;e(i).to.be.instanceOf(r),e(i.shadowRoot).not.to.be["null"],e(i.summary).to.equal("Test Summary");case 4:case"end":return _context2.stop();}},_callee);}))),it("should initialize closed by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _i$shadowRoot;var i,n;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return a(o(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context3.sent;e(i.open).to.be["false"];n=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.querySelector(".accordian__body");e(n===null||n===void 0?void 0:n.hidden).to.be["true"];case 6:case"end":return _context3.stop();}},_callee2);}))),it("should open when clicked",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _n$shadowRoot,_n$shadowRoot2;var n,r,t;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return a(o(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context4.sent;r=(_n$shadowRoot=n.shadowRoot)===null||_n$shadowRoot===void 0?void 0:_n$shadowRoot.querySelector(".accordian__header");r.click();_context4.next=7;return i(n);case 7:e(n.open).to.be["true"];t=(_n$shadowRoot2=n.shadowRoot)===null||_n$shadowRoot2===void 0?void 0:_n$shadowRoot2.querySelector(".accordian__body");e(t===null||t===void 0?void 0:t.hidden).to.be["false"];case 10:case"end":return _context4.stop();}},_callee3);}))),it('should emit "nile-show" and "nile-after-show" when opened',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _i$shadowRoot2;var i,r,c;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return a(o(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context5.sent;r=t.spy(i,"emit");c=(_i$shadowRoot2=i.shadowRoot)===null||_i$shadowRoot2===void 0?void 0:_i$shadowRoot2.querySelector(".accordian__header");setTimeout(function(){return c.click();});_context5.next=8;return n(i,"nile-after-show");case 8:e(r.calledWith("nile-show")).to.be["true"];e(r.calledWith("nile-after-show")).to.be["true"];case 10:case"end":return _context5.stop();}},_callee4);}))),it('should emit "nile-hide" and "nile-after-hide" when closed',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _i$shadowRoot3;var i,r,c;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return a(o(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" open></nile-accordion>"]))));case 2:i=_context6.sent;r=t.spy(i,"emit");c=(_i$shadowRoot3=i.shadowRoot)===null||_i$shadowRoot3===void 0?void 0:_i$shadowRoot3.querySelector(".accordian__header");setTimeout(function(){return c.click();});_context6.next=8;return n(i,"nile-after-hide");case 8:e(r.calledWith("nile-hide")).to.be["true"];e(r.calledWith("nile-after-hide")).to.be["true"];case 10:case"end":return _context6.stop();}},_callee5);}))),it('should be disabled when the "disabled" property is set',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _n$shadowRoot3;var n,r;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return a(o(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" disabled></nile-accordion>"]))));case 2:n=_context7.sent;r=(_n$shadowRoot3=n.shadowRoot)===null||_n$shadowRoot3===void 0?void 0:_n$shadowRoot3.querySelector(".accordian__header");r.click();_context7.next=7;return i(n);case 7:e(n.open).to.be["false"];case 8:case"end":return _context7.stop();}},_callee6);}))),it("should handle keyboard interaction (Enter and Space)",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _n$shadowRoot4;var n,r,t,c;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return a(o(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context8.sent;r=(_n$shadowRoot4=n.shadowRoot)===null||_n$shadowRoot4===void 0?void 0:_n$shadowRoot4.querySelector(".accordian__header");t=new KeyboardEvent("keydown",{key:"Enter"});r.dispatchEvent(t);_context8.next=8;return i(n);case 8:e(n.open).to.be["true"];c=new KeyboardEvent("keydown",{key:" "});r.dispatchEvent(c);_context8.next=13;return i(n);case 13:e(n.open).to.be["false"];case 14:case"end":return _context8.stop();}},_callee7);}))),it("should handle ArrowUp/ArrowLeft to close and ArrowDown/ArrowRight to open",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _n$shadowRoot5;var n,r,t,c;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return a(o(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context9.sent;r=(_n$shadowRoot5=n.shadowRoot)===null||_n$shadowRoot5===void 0?void 0:_n$shadowRoot5.querySelector(".accordian__header");t=new KeyboardEvent("keydown",{key:"ArrowDown"});r.dispatchEvent(t);_context9.next=8;return i(n);case 8:e(n.open).to.be["true"];c=new KeyboardEvent("keydown",{key:"ArrowUp"});r.dispatchEvent(c);_context9.next=13;return i(n);case 13:e(n.open).to.be["false"];case 14:case"end":return _context9.stop();}},_callee8);}))),it('should apply the "variant" class based on the variant property',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var _i$shadowRoot4;var i,n;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return a(o(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" variant=\"dark\"></nile-accordion>"]))));case 2:i=_context10.sent;n=(_i$shadowRoot4=i.shadowRoot)===null||_i$shadowRoot4===void 0?void 0:_i$shadowRoot4.querySelector(".accordian__header");e(n).to.have["class"]("accordian__header--dark");case 5:case"end":return _context10.stop();}},_callee9);}))),it("should apply the correct size class based on the size property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var _i$shadowRoot5;var i,n;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return a(o(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" size=\"lg\"></nile-accordion>"]))));case 2:i=_context11.sent;n=(_i$shadowRoot5=i.shadowRoot)===null||_i$shadowRoot5===void 0?void 0:_i$shadowRoot5.querySelector(".accordian");e(n).to.have["class"]("accordian--lg");case 5:case"end":return _context11.stop();}},_callee10);}))),it("should apply the correct expand icon placement class based on the expandIconPlacement property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(){var _i$shadowRoot6;var i,n;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_context12.next=2;return a(o(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" expandIconPlacement=\"left\"></nile-accordion>"]))));case 2:i=_context12.sent;n=(_i$shadowRoot6=i.shadowRoot)===null||_i$shadowRoot6===void 0?void 0:_i$shadowRoot6.querySelector(".accordian__header");e(n).to.have["class"]("accordian__header--arrow-left");case 5:case"end":return _context12.stop();}},_callee11);}))),it("should animate when opening and closing",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(){var _n$shadowRoot6;var n,r,c;return _regeneratorRuntime().wrap(function _callee12$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:_context13.next=2;return a(o(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context13.sent;r=t.spy(n,"handleOpenChange");c=(_n$shadowRoot6=n.shadowRoot)===null||_n$shadowRoot6===void 0?void 0:_n$shadowRoot6.querySelector(".accordian__header");c.click();_context13.next=8;return i(n);case 8:e(r.called).to.be["true"];c.click();_context13.next=12;return i(n);case 12:e(r.calledTwice).to.be["true"];case 13:case"end":return _context13.stop();}},_callee12);})));});}};});
|
|
2
2
|
//# sourceMappingURL=nile-accordian.test.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as a,a as e,e as i,o as n}from"../fixture-
|
|
1
|
+
import{f as a,a as e,e as i,o as n}from"../fixture-985bba12.esm.js";import{html as o}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import{N as r}from"./nile-accordion.esm.js";import{s as t}from"../sinon-esm-68c8e378.esm.js";import"tslib";import"./nile-accordion.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/animate.esm.js";import"lit/directives/class-map.js";import"lit/decorators.js";import"../utilities/animation-registry.esm.js";import"../internal/event.esm.js";import"../internal/watch.esm.js";describe("NileAccordion",(()=>{it("should render correctly",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`);e(i).to.be.instanceOf(r),e(i.shadowRoot).not.to.be.null,e(i.summary).to.equal("Test Summary")})),it("should initialize closed by default",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`);e(i.open).to.be.false;const n=i.shadowRoot?.querySelector(".accordian__body");e(n?.hidden).to.be.true})),it("should open when clicked",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header");r.click(),await i(n),e(n.open).to.be.true;const t=n.shadowRoot?.querySelector(".accordian__body");e(t?.hidden).to.be.false})),it('should emit "nile-show" and "nile-after-show" when opened',(async()=>{const i=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=t.spy(i,"emit"),c=i.shadowRoot?.querySelector(".accordian__header");setTimeout((()=>c.click())),await n(i,"nile-after-show"),e(r.calledWith("nile-show")).to.be.true,e(r.calledWith("nile-after-show")).to.be.true})),it('should emit "nile-hide" and "nile-after-hide" when closed',(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" open></nile-accordion>`),r=t.spy(i,"emit"),c=i.shadowRoot?.querySelector(".accordian__header");setTimeout((()=>c.click())),await n(i,"nile-after-hide"),e(r.calledWith("nile-hide")).to.be.true,e(r.calledWith("nile-after-hide")).to.be.true})),it('should be disabled when the "disabled" property is set',(async()=>{const n=await a(o`<nile-accordion summary="Test Summary" disabled></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header");r.click(),await i(n),e(n.open).to.be.false})),it("should handle keyboard interaction (Enter and Space)",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header"),t=new KeyboardEvent("keydown",{key:"Enter"});r.dispatchEvent(t),await i(n),e(n.open).to.be.true;const c=new KeyboardEvent("keydown",{key:" "});r.dispatchEvent(c),await i(n),e(n.open).to.be.false})),it("should handle ArrowUp/ArrowLeft to close and ArrowDown/ArrowRight to open",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header"),t=new KeyboardEvent("keydown",{key:"ArrowDown"});r.dispatchEvent(t),await i(n),e(n.open).to.be.true;const c=new KeyboardEvent("keydown",{key:"ArrowUp"});r.dispatchEvent(c),await i(n),e(n.open).to.be.false})),it('should apply the "variant" class based on the variant property',(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" variant="dark"></nile-accordion>`),n=i.shadowRoot?.querySelector(".accordian__header");e(n).to.have.class("accordian__header--dark")})),it("should apply the correct size class based on the size property",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" size="lg"></nile-accordion>`),n=i.shadowRoot?.querySelector(".accordian");e(n).to.have.class("accordian--lg")})),it("should apply the correct expand icon placement class based on the expandIconPlacement property",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" expandIconPlacement="left"></nile-accordion>`),n=i.shadowRoot?.querySelector(".accordian__header");e(n).to.have.class("accordian__header--arrow-left")})),it("should animate when opening and closing",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=t.spy(n,"handleOpenChange"),c=n.shadowRoot?.querySelector(".accordian__header");c.click(),await i(n),e(r.called).to.be.true,c.click(),await i(n),e(r.calledTwice).to.be.true}))}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./nile-auto-complete.cjs.js","tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","../lit-html-9b3af046.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js","lit/directives/unsafe-html.js"],function(_export,_context){"use strict";return{setters:[function(_nileAutoCompleteCjsJs){_export("NileAutoComplete",_nileAutoCompleteCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalWatchCjsJs){},function(_portalManagerCjsJs){},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litHtml003CjsJs){},function(_virtualize002CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){},function(_litDirectivesUnsafeHtmlJs){}],execute:function execute(){}};});
|
|
1
|
+
System.register(["./nile-auto-complete.cjs.js","tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","../lit-html-9b3af046.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js","lit/directives/unsafe-html.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileAutoCompleteCjsJs){_export("NileAutoComplete",_nileAutoCompleteCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalWatchCjsJs){},function(_portalManagerCjsJs){},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litHtml003CjsJs){},function(_virtualize002CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){},function(_litDirectivesUnsafeHtmlJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{N as NileAutoComplete}from"./nile-auto-complete.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-auto-complete.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/watch.esm.js";import"./portal-manager.esm.js";import"../floating-ui.dom-cc9126da.esm.js";import"./portal-utils.esm.js";import"../lit-html-39a6718c.esm.js";import"../virtualize-a4a40d96.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";import"lit/directives/unsafe-html.js";
|
|
1
|
+
export{N as NileAutoComplete}from"./nile-auto-complete.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-auto-complete.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/watch.esm.js";import"./portal-manager.esm.js";import"../floating-ui.dom-cc9126da.esm.js";import"./portal-utils.esm.js";import"../lit-html-39a6718c.esm.js";import"../virtualize-a4a40d96.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";import"lit/directives/unsafe-html.js";import"../utilities/visibility-manager.esm.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directives/unsafe-html.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","../lit-html-9b3af046.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,i,e,s,n,o,h,l,r,a,p,d,u,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,c;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);}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}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(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;e=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;n=_litDecoratorsJs.property;o=_litDecoratorsJs.state;h=_litDecoratorsJs.customElement;},function(_nileAutoCompleteCssCjsJs){l=_nileAutoCompleteCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_portalManagerCjsJs){p=_portalManagerCjsJs.A;},function(_virtualize002CjsJs){d=_virtualize002CjsJs.v;},function(_litDirectivesUnsafeHtmlJs){u=_litDirectivesUnsafeHtmlJs.unsafeHTML;},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litHtml003CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_r){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.disabled=!1,_this.isDropdownOpen=!1,_this.portal=!1,_this.portalManager=new p(_assertThisInitialized(_this)),_this.enableVirtualScroll=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.noOutline=!1,_this.noPadding=!1,_this.loading=!1,_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;},_this.allMenuItems=[],_this.menuItems=[],_this.handleWindowResize=function(){_this.portalManager.updatePortalAppendPosition();},_this.handleWindowScroll=function(){_this.portalManager.updatePortalAppendPosition();};return _this;}_inherits(c,_r);return _createClass(c,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(c,"connectedCallback",this,3)([]),this.renderItemFunction=function(t){return t;},this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(c,"disconnectedCallback",this,3)([]),this.removeOpenListeners(),this.portalManager.cleanupPortalAppend();}},{key:"updated",value:function updated(t){_superPropGet(c,"updated",this,3)([t]),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth(),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.handleDropdownOpenChange()),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("portal")&&this.handlePortalChange();}},{key:"handlePortalChange",value:function handlePortalChange(){this.isDropdownOpen&&(this.portal?this.portalManager.setupPortalAppend():this.portalManager.cleanupPortalAppend());}},{key:"handleDropdownOpenChange",value:function handleDropdownOpenChange(){this.isDropdownOpen?(this.addOpenListeners(),this.portal&&this.portalManager.setupPortalAppend()):(this.removeOpenListeners(),this.portal&&this.portalManager.cleanupPortalAppend());}},{key:"addOpenListeners",value:function addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.portal&&(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("scroll",this.handleWindowScroll,!0));}},{key:"removeOpenListeners",value:function removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("scroll",this.handleWindowScroll,!0);}},{key:"handleDocumentFocusIn",value:function handleDocumentFocusIn(t){var _this$dropdownElement;if(!this.isDropdownOpen)return;var i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide());}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(t){var _this$dropdownElement2;if(!this.isDropdownOpen)return;var i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,(_this$dropdownElement2=this.dropdownElement)===null||_this$dropdownElement2===void 0?void 0:_this$dropdownElement2.hide());}},{key:"render",value:function render(){var t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n ?no-outline=","\n ?no-padding=","\n .disabled=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n exportparts=\"input, base\"\n >\n ","\n </nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.noOutline,this.noPadding,this.disabled,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.loading?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>"]))):e,this.menuItems.length>0&&!this.loading?t:e);}},{key:"getVirtualizedContent",value:function getVirtualizedContent(){var _this2=this;return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu class=\"virtualized__menu\" @nile-select="," id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\" style=",">\n ","\n </nile-menu>\n "])),this.handleSelect,this.portal?"display: none;":"",d({items:this.menuItems,renderItem:function renderItem(t){return _this2.getItemRenderFunction(t);},scroller:!0}));}},{key:"getContent",value:function getContent(){var _this3=this;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-menu id=\"content-menu\" @nile-select="," exportparts=\"menu__items-wrapper:options__wrapper\" style=",">\n ","\n </nile-menu>"])),this.handleSelect,this.portal?"display: none;":"",this.menuItems.map(function(t){return _this3.getItemRenderFunction(t);}));}},{key:"getItemRenderFunction",value:function getItemRenderFunction(t){var _this4=this;var e=this.renderItemFunction(t);if(!(!!t.tooltip&&(!t.tooltip["for"]||"menu"===t.tooltip["for"])))return i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-menu-item value=",">","</nile-menu-item>\n "])),e,u(e));var s=null;var n=t.tooltip.content;return n instanceof Promise?(s="Loading...",n.then(function(i){t.tooltip.content=i,_this4.requestUpdate();})):s=n,i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-menu-item value=",">\n <nile-lite-tooltip allowHTML .content=",">\n <span class=\"menu-item-text\">","</span>\n </nile-lite-tooltip>\n </nile-menu-item>\n "])),e,s,u(e));}},{key:"handleSelect",value:function handleSelect(t){var _this$dropdownElement3;this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement3=this.dropdownElement)===null||_this$dropdownElement3===void 0?void 0:_this$dropdownElement3.hide();}},{key:"setVirtualMenuWidth",value:function setVirtualMenuWidth(){var _this5=this;var t=this.menuItems.reduce(function(t,i){var e=_this5.renderItemFunction(i).length;return t>e?t:e;},0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px");}},{key:"handleSearch",value:function handleSearch(t){var _this$dropdownElement4;this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&((_this$dropdownElement4=this.dropdownElement)!==null&&_this$dropdownElement4!==void 0&&_this$dropdownElement4.show(),this.portal&&this.portalManager.updatePortalOptions());}},{key:"handleFocus",value:function handleFocus(){var _this$inputElement,_this6=this;this.openOnFocus&&(this.portal&&(_this$inputElement=this.inputElement)!==null&&_this$inputElement!==void 0&&_this$inputElement.focus(),setTimeout(function(){var _this6$dropdownElemen;_this6.isDropdownOpen=!0,(_this6$dropdownElemen=_this6.dropdownElement)===null||_this6$dropdownElemen===void 0?void 0:_this6$dropdownElemen.show();},300));}},{key:"handleClick",value:function handleClick(){var _this$dropdownElement5;this.isDropdownOpen=!0,(_this$dropdownElement5=this.dropdownElement)===null||_this$dropdownElement5===void 0?void 0:_this$dropdownElement5.show();}},{key:"applyFilter",value:function applyFilter(t,i){var _this7=this;if("object"!=_typeof(t))return[];var e=[];return t.forEach(function(t){return i(t,_this7.value)&&e.push(t);}),e;}}]);}(r));c.styles=l,t([s("nile-dropdown")],c.prototype,"dropdownElement",void 0),t([s("nile-input")],c.prototype,"inputElement",void 0),t([n({type:Boolean})],c.prototype,"disabled",void 0),t([n({type:Boolean})],c.prototype,"isDropdownOpen",void 0),t([n({type:Boolean,reflect:!0})],c.prototype,"portal",void 0),t([n({type:Boolean})],c.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],c.prototype,"openOnFocus",void 0),t([n({type:String})],c.prototype,"value",void 0),t([n({type:String})],c.prototype,"placeholder",void 0),t([n({type:Boolean})],c.prototype,"noBorder",void 0),t([n({type:Boolean})],c.prototype,"noOutline",void 0),t([n({type:Boolean})],c.prototype,"noPadding",void 0),t([n({type:Boolean})],c.prototype,"loading",void 0),t([n({attribute:!1})],c.prototype,"filterFunction",void 0),t([n({attribute:!1})],c.prototype,"renderItemFunction",void 0),t([n({type:Array})],c.prototype,"allMenuItems",void 0),t([o()],c.prototype,"menuItems",void 0),t([a("portal",{waitUntilFirstUpdate:!0})],c.prototype,"handlePortalChange",null),_export("N",c=t([h("nile-auto-complete")],c));}};});
|
|
1
|
+
System.register(["tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directives/unsafe-html.js","../utilities/visibility-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","../lit-html-9b3af046.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,i,e,s,n,o,h,l,r,a,p,d,u,c,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,m;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);}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}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 asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}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(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;e=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;n=_litDecoratorsJs.property;o=_litDecoratorsJs.state;h=_litDecoratorsJs.customElement;},function(_nileAutoCompleteCssCjsJs){l=_nileAutoCompleteCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_portalManagerCjsJs){p=_portalManagerCjsJs.A;},function(_virtualize002CjsJs){d=_virtualize002CjsJs.v;},function(_litDirectivesUnsafeHtmlJs){u=_litDirectivesUnsafeHtmlJs.unsafeHTML;},function(_utilitiesVisibilityManagerCjsJs){c=_utilitiesVisibilityManagerCjsJs.V;},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litHtml003CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){_export("N",m=/*#__PURE__*/function(_r){function m(){var _this;_classCallCheck(this,m);_this=_callSuper(this,m,arguments),_this.disabled=!1,_this.isDropdownOpen=!1,_this.portal=!1,_this.portalManager=new p(_assertThisInitialized(_this)),_this.enableVirtualScroll=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.noOutline=!1,_this.noPadding=!1,_this.loading=!1,_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;},_this.allMenuItems=[],_this.enableVisibilityEffect=!1,_this.enableTabClose=!1,_this.menuItems=[],_this.handleWindowResize=function(){_this.portalManager.updatePortalAppendPosition();},_this.handleWindowScroll=function(){_this.portalManager.updatePortalAppendPosition();};return _this;}_inherits(m,_r);return _createClass(m,[{key:"firstUpdated",value:function(){var _firstUpdated=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var _superPropGet2,_this$inputElement,_this2=this;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:(_superPropGet2=_superPropGet(m,"firstUpdated",this,3))!==null&&_superPropGet2!==void 0&&_superPropGet2([t]);_context2.next=3;return this.updateComplete;case 3:console.log("AutoComplete target:",(_this$inputElement=this.inputElement)===null||_this$inputElement===void 0?void 0:_this$inputElement.input);this.visibilityManager=new c({host:this,target:this.inputElement.input,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:function isOpen(){return _this2.isDropdownOpen;},onAnchorOutOfView:function onAnchorOutOfView(){var _this2$dropdownElemen;_this2.isDropdownOpen=!1,(_this2$dropdownElemen=_this2.dropdownElement)!==null&&_this2$dropdownElemen!==void 0&&_this2$dropdownElemen.hide(),_this2.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"});},onDocumentHidden:function onDocumentHidden(){var _this2$dropdownElemen2;_this2.isDropdownOpen=!1,(_this2$dropdownElemen2=_this2.dropdownElement)!==null&&_this2$dropdownElemen2!==void 0&&_this2$dropdownElemen2.hide(),_this2.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"});},emit:function emit(t,i){return _this2.emit("nile-".concat(t),i);}});case 5:case"end":return _context2.stop();}},_callee,this);}));function firstUpdated(_x){return _firstUpdated.apply(this,arguments);}return firstUpdated;}()},{key:"connectedCallback",value:function connectedCallback(){_superPropGet(m,"connectedCallback",this,3)([]),this.renderItemFunction=function(t){return t;},this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this);}},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$visibilityManag;_superPropGet(m,"disconnectedCallback",this,3)([]),this.removeOpenListeners(),(_this$visibilityManag=this.visibilityManager)!==null&&_this$visibilityManag!==void 0&&_this$visibilityManag.cleanup(),this.portalManager.cleanupPortalAppend();}},{key:"updated",value:function updated(t){_superPropGet(m,"updated",this,3)([t]),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth(),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.handleDropdownOpenChange()),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("portal")&&this.handlePortalChange();}},{key:"handlePortalChange",value:function handlePortalChange(){this.isDropdownOpen&&(this.portal?this.portalManager.setupPortalAppend():this.portalManager.cleanupPortalAppend());}},{key:"handleDropdownOpenChange",value:function handleDropdownOpenChange(){var _this$visibilityManag2,_this$visibilityManag3;this.isDropdownOpen?(this.addOpenListeners(),(_this$visibilityManag2=this.visibilityManager)!==null&&_this$visibilityManag2!==void 0&&_this$visibilityManag2.setup(),this.portal&&this.portalManager.setupPortalAppend()):(this.removeOpenListeners(),(_this$visibilityManag3=this.visibilityManager)!==null&&_this$visibilityManag3!==void 0&&_this$visibilityManag3.cleanup(),this.portal&&this.portalManager.cleanupPortalAppend());}},{key:"addOpenListeners",value:function addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.portal&&(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("scroll",this.handleWindowScroll,!0));}},{key:"removeOpenListeners",value:function removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("scroll",this.handleWindowScroll,!0);}},{key:"handleDocumentFocusIn",value:function handleDocumentFocusIn(t){var _this$dropdownElement;if(!this.isDropdownOpen)return;var i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide());}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(t){var _this$dropdownElement2;if(!this.isDropdownOpen)return;var i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,(_this$dropdownElement2=this.dropdownElement)===null||_this$dropdownElement2===void 0?void 0:_this$dropdownElement2.hide());}},{key:"render",value:function render(){var t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n ?no-outline=","\n ?no-padding=","\n .disabled=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n exportparts=\"input, base\"\n >\n ","\n </nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.noOutline,this.noPadding,this.disabled,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.loading?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>"]))):e,this.menuItems.length>0&&!this.loading?t:e);}},{key:"getVirtualizedContent",value:function getVirtualizedContent(){var _this3=this;return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu class=\"virtualized__menu\" @nile-select="," id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\" style=",">\n ","\n </nile-menu>\n "])),this.handleSelect,this.portal?"display: none;":"",d({items:this.menuItems,renderItem:function renderItem(t){return _this3.getItemRenderFunction(t);},scroller:!0}));}},{key:"getContent",value:function getContent(){var _this4=this;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-menu id=\"content-menu\" @nile-select="," exportparts=\"menu__items-wrapper:options__wrapper\" style=",">\n ","\n </nile-menu>"])),this.handleSelect,this.portal?"display: none;":"",this.menuItems.map(function(t){return _this4.getItemRenderFunction(t);}));}},{key:"getItemRenderFunction",value:function getItemRenderFunction(t){var _this5=this;var e=this.renderItemFunction(t);if(!(!!t.tooltip&&(!t.tooltip["for"]||"menu"===t.tooltip["for"])))return i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-menu-item value=",">","</nile-menu-item>\n "])),e,u(e));var s=null;var n=t.tooltip.content;return n instanceof Promise?(s="Loading...",n.then(function(i){t.tooltip.content=i,_this5.requestUpdate();})):s=n,i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-menu-item value=",">\n <nile-lite-tooltip allowHTML .content=",">\n <span class=\"menu-item-text\">","</span>\n </nile-lite-tooltip>\n </nile-menu-item>\n "])),e,s,u(e));}},{key:"handleSelect",value:function handleSelect(t){var _this$dropdownElement3;this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement3=this.dropdownElement)===null||_this$dropdownElement3===void 0?void 0:_this$dropdownElement3.hide();}},{key:"setVirtualMenuWidth",value:function setVirtualMenuWidth(){var _this6=this;var t=this.menuItems.reduce(function(t,i){var e=_this6.renderItemFunction(i).length;return t>e?t:e;},0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px");}},{key:"handleSearch",value:function handleSearch(t){var _this$dropdownElement4;this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&((_this$dropdownElement4=this.dropdownElement)!==null&&_this$dropdownElement4!==void 0&&_this$dropdownElement4.show(),this.portal&&this.portalManager.updatePortalOptions());}},{key:"handleFocus",value:function handleFocus(){var _this$inputElement2,_this7=this;this.openOnFocus&&(this.portal&&(_this$inputElement2=this.inputElement)!==null&&_this$inputElement2!==void 0&&_this$inputElement2.focus(),setTimeout(function(){var _this7$dropdownElemen;_this7.isDropdownOpen=!0,(_this7$dropdownElemen=_this7.dropdownElement)===null||_this7$dropdownElemen===void 0?void 0:_this7$dropdownElemen.show();},300));}},{key:"handleClick",value:function handleClick(){var _this$dropdownElement5;this.isDropdownOpen=!0,(_this$dropdownElement5=this.dropdownElement)===null||_this$dropdownElement5===void 0?void 0:_this$dropdownElement5.show();}},{key:"applyFilter",value:function applyFilter(t,i){var _this8=this;if("object"!=_typeof(t))return[];var e=[];return t.forEach(function(t){return i(t,_this8.value)&&e.push(t);}),e;}}]);}(r));m.styles=l,t([s("nile-dropdown")],m.prototype,"dropdownElement",void 0),t([s("nile-input")],m.prototype,"inputElement",void 0),t([n({type:Boolean})],m.prototype,"disabled",void 0),t([n({type:Boolean})],m.prototype,"isDropdownOpen",void 0),t([n({type:Boolean,reflect:!0})],m.prototype,"portal",void 0),t([n({type:Boolean})],m.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],m.prototype,"openOnFocus",void 0),t([n({type:String})],m.prototype,"value",void 0),t([n({type:String})],m.prototype,"placeholder",void 0),t([n({type:Boolean})],m.prototype,"noBorder",void 0),t([n({type:Boolean})],m.prototype,"noOutline",void 0),t([n({type:Boolean})],m.prototype,"noPadding",void 0),t([n({type:Boolean})],m.prototype,"loading",void 0),t([n({attribute:!1})],m.prototype,"filterFunction",void 0),t([n({attribute:!1})],m.prototype,"renderItemFunction",void 0),t([n({type:Array})],m.prototype,"allMenuItems",void 0),t([n({type:Boolean,reflect:!0})],m.prototype,"enableVisibilityEffect",void 0),t([n({type:Boolean,reflect:!0})],m.prototype,"enableTabClose",void 0),t([o()],m.prototype,"menuItems",void 0),t([a("portal",{waitUntilFirstUpdate:!0})],m.prototype,"handlePortalChange",null),_export("N",m=t([h("nile-auto-complete")],m));}};});
|
|
2
2
|
//# sourceMappingURL=nile-auto-complete.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-auto-complete.cjs.js","sources":["../../../src/nile-auto-complete/nile-auto-complete.ts"],"sourcesContent":["import {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-auto-complete.css';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport { NileDropdown } from '../nile-dropdown';\nimport { watch } from '../internal/watch';\nimport { AutoCompletePortalManager } from './portal-manager';\nimport { NileInput } from '../nile-input';\n\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\n// Define the custom element 'nile-auto-complete'\n@customElement('nile-auto-complete')\nexport class NileAutoComplete extends NileElement {\n\n static styles: CSSResultGroup = styles;\n\n @query('nile-dropdown') dropdownElement: NileDropdown;\n\n @query('nile-input') inputElement: NileInput;\n\n // Define component properties\n\n @property({ type: Boolean }) disabled: boolean = false;\n\n @property({ type: Boolean }) isDropdownOpen: boolean = false;\n\n /** \n * When true, the dropdown menu will be appended to the document body instead of the parent container.\n * This is useful when the parent has overflow: hidden, clip-path, or transform applied.\n */\n @property({ type: Boolean, reflect: true }) portal = false;\n\n private readonly portalManager = new AutoCompletePortalManager(this);\n\n @property({ type: Boolean }) enableVirtualScroll: boolean = false;\n\n @property({ type: Boolean }) openOnFocus: boolean = false;\n\n @property({ type: String }) value: string = '';\n\n @property({ type: String }) placeholder: string = 'Type here ..';\n\n @property({ type: Boolean }) noBorder: boolean = false;\n \n @property({ type: Boolean }) noOutline: boolean = false;\n\n @property({ type: Boolean }) noPadding: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean=(item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n @property({ type: Array }) allMenuItems: any = [];\n\n @state() menuItems: any = [];\n\n connectedCallback() {\n super.connectedCallback();\n this.renderItemFunction=(item:any)=>item;\n this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);\n this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);\n this.handleWindowResize = this.handleWindowResize.bind(this);\n this.handleWindowScroll = this.handleWindowScroll.bind(this);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.portalManager.cleanupPortalAppend();\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('allMenuItems')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.setVirtualMenuWidth();\n if (this.portal && this.isDropdownOpen) {\n this.portalManager.updatePortalOptions();\n }\n }\n if (changedProperties.has('isDropdownOpen')) {\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.handleDropdownOpenChange();\n }\n if (changedProperties.has('value')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n if (this.portal && this.isDropdownOpen) {\n this.portalManager.updatePortalOptions();\n }\n }\n if (changedProperties.has('portal')) {\n this.handlePortalChange();\n }\n }\n\n @watch('portal', { waitUntilFirstUpdate: true })\n handlePortalChange(): void {\n if (this.isDropdownOpen) {\n if (this.portal) {\n this.portalManager.setupPortalAppend();\n } else {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n private handleDropdownOpenChange(): void {\n if (this.isDropdownOpen) {\n this.addOpenListeners();\n if (this.portal) {\n this.portalManager.setupPortalAppend();\n }\n } else {\n this.removeOpenListeners();\n if (this.portal) {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n private addOpenListeners(): void {\n document.addEventListener('focusin', this.handleDocumentFocusIn);\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n \n if (this.portal) {\n window.addEventListener('resize', this.handleWindowResize);\n window.addEventListener('scroll', this.handleWindowScroll, true);\n }\n }\n\n private removeOpenListeners(): void {\n document.removeEventListener('focusin', this.handleDocumentFocusIn);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n window.removeEventListener('resize', this.handleWindowResize);\n window.removeEventListener('scroll', this.handleWindowScroll, true);\n }\n\n private handleDocumentFocusIn(event: FocusEvent) {\n if (!this.isDropdownOpen) return;\n const path = event.composedPath();\n const hitSelf = path.includes(this);\n const hitDropdown = this.dropdownElement && path.includes(this.dropdownElement);\n const hitPortalAppend = this.portal && this.portalManager.portalContainerElement && path.includes(this.portalManager.portalContainerElement);\n\n if (!hitSelf && !hitDropdown && !hitPortalAppend) {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n }\n\n private handleDocumentMouseDown(event: MouseEvent) {\n if (!this.isDropdownOpen) return;\n \n const path = event.composedPath();\n const hitSelf = path.includes(this);\n const hitDropdown = this.dropdownElement && path.includes(this.dropdownElement);\n const hitPortalAppend = this.portal && this.portalManager.portalContainerElement && path.includes(this.portalManager.portalContainerElement);\n \n if (!hitSelf && !hitDropdown && !hitPortalAppend) {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n }\n\n private handleWindowResize = (): void => {\n this.portalManager.updatePortalAppendPosition();\n };\n\n private handleWindowScroll = (): void => {\n this.portalManager.updatePortalAppendPosition();\n };\n\n public render(): TemplateResult {\n const content=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();\n return html`\n <nile-dropdown class=\"nile-dropdown--input\" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=${this.noBorder}\n ?no-outline=${this.noOutline}\n ?no-padding=${this.noPadding}\n .disabled=${this.disabled}\n .value=${this.value}\n @nile-input=${this.handleSearch}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n slot=\"trigger\"\n placeholder=${this.placeholder}\n exportparts=\"input, base\"\n >\n ${this.loading?html`<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>`:nothing}\n </nile-input>\n ${this.menuItems.length > 0 && !this.loading\n ? content\n : nothing}\n </nile-dropdown>\n `;\n } \n \n getVirtualizedContent():TemplateResult{\n return html`\n <nile-menu class=\"virtualized__menu\" @nile-select=${this.handleSelect} id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\" style=${this.portal ? 'display: none;' : ''}>\n ${virtualize({\n items: this.menuItems,\n renderItem: (item:any):TemplateResult=>this.getItemRenderFunction(item),\n\t\t\t\t\tscroller:true\n })}\n </nile-menu>\n `\n }\n\n getContent():TemplateResult{\n return html`\n <nile-menu id=\"content-menu\" @nile-select=${this.handleSelect} exportparts=\"menu__items-wrapper:options__wrapper\" style=${this.portal ? 'display: none;' : ''}>\n ${this.menuItems.map((item: any) => this.getItemRenderFunction(item))}\n </nile-menu>`\n }\n\n getItemRenderFunction(item: any): TemplateResult {\n const value = this.renderItemFunction(item);\n const hasTooltip = !!item.tooltip;\n const shouldShowTooltip =\n hasTooltip && (!item.tooltip.for || item.tooltip.for === 'menu');\n \n if (!shouldShowTooltip) {\n return html`\n <nile-menu-item value=${value}>${unsafeHTML(value)}</nile-menu-item>\n `;\n }\n \n let tooltipContent: string | null = null;\n \n const content = item.tooltip.content;\n if (content instanceof Promise) {\n tooltipContent = 'Loading...'; \n content.then((resolved: string) => {\n item.tooltip.content = resolved;\n this.requestUpdate(); \n });\n } else {\n tooltipContent = content;\n }\n \n return html`\n <nile-menu-item value=${value}>\n <nile-lite-tooltip allowHTML .content=${tooltipContent}>\n <span class=\"menu-item-text\">${unsafeHTML(value)}</span>\n </nile-lite-tooltip>\n </nile-menu-item>\n `;\n }\n\n handleSelect(event: CustomEvent) {\n this.value = event.detail.value;\n this.emit('nile-complete', { value: event.detail.value });\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n\n private setVirtualMenuWidth() {\n const maxLengthOption = this.menuItems\n .reduce((acc: number, curr: any) => {\n const currLength = this.renderItemFunction(curr).length\n return acc > currLength ? acc : currLength\n }, 0)\n const defaultWith = 110;\n const pixelMultiplier = 9.5;\n const menuWidth = maxLengthOption * pixelMultiplier < defaultWith ? defaultWith : maxLengthOption * pixelMultiplier;\n this.style.setProperty(\"--virtual-scroll-container-width\", menuWidth + \"px\");\n }\n\n private handleSearch(event: CustomEvent) {\n this.value = event.detail.value.toLowerCase();\n\n // Filter menu items based on the search value\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n\n this.isDropdownOpen = this.menuItems.length > 0;\n if (this.isDropdownOpen) {\n this.dropdownElement?.show();\n if (this.portal) {\n this.portalManager.updatePortalOptions();\n }\n }\n }\n\n public handleFocus() {\n if (!this.openOnFocus) {\n return;\n }\n\n if(this.portal) {\n this.inputElement?.focus();\n }\n\n // Delay opening the dropdown to allow focus to take effect\n setTimeout(() => {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }, 300);\n }\n\n private handleClick() {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }\n\n applyFilter<T>(list: T[], filterFn: (item: T,searchValue?:string) => boolean): T[] {\n if(typeof(list)!=='object') return []\n const res:T[]=[]\n list.forEach( el=> filterFn(el,this.value) && res.push(el) )\n return res\n }\n\n}\n\nexport default NileAutoComplete;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-auto-complete': NileAutoComplete;\n }\n}\n"],"names":["NileAutoComplete","c","this","disabled","isDropdownOpen","portal","portalManager","AutoCompletePortalManager","enableVirtualScroll","openOnFocus","value","placeholder","noBorder","noOutline","noPadding","loading","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","allMenuItems","menuItems","handleWindowResize","updatePortalAppendPosition","handleWindowScroll","_this","_inherits","_r","_createClass","key","connectedCallback","super","handleDocumentFocusIn","bind","handleDocumentMouseDown","disconnectedCallback","removeOpenListeners","cleanupPortalAppend","updated","changedProperties","has","applyFilter","setVirtualMenuWidth","updatePortalOptions","handleDropdownOpenChange","handlePortalChange","setupPortalAppend","addOpenListeners","document","addEventListener","window","removeEventListener","event","path","composedPath","hitSelf","hitDropdown","dropdownElement","hitPortalAppend","portalContainerElement","_this$dropdownElement","hide","_this$dropdownElement2","render","content","getVirtualizedContent","getContent","html","_templateObject","_taggedTemplateLiteral","handleSearch","handleFocus","handleClick","_templateObject2","nothing","length","_this2","_templateObject3","handleSelect","virtualize","items","renderItem","getItemRenderFunction","scroller","_this3","_templateObject4","map","tooltip","for","_templateObject5","unsafeHTML","tooltipContent","Promise","then","resolved","requestUpdate","_templateObject6","detail","emit","maxLengthOption","reduce","acc","curr","currLength","menuWidth","style","setProperty","show","inputElement","focus","setTimeout","_this6$dropdownElemen","list","filterFn","_typeof","t","res","forEach","el","push","NileElement","styles","__decorate","query","prototype","property","type","Boolean","reflect","String","attribute","Array","state","watch","waitUntilFirstUpdate","customElement"],"mappings":"2gJAqBaA,4BAAN,SAAAC,EAAA,uEAUwBC,KAAAA,CAAQC,QAAAA,CAAAA,CAAY,EAEpBD,KAAAA,CAAcE,cAAAA,CAAAA,CAAY,EAMXF,KAAAA,CAAMG,MAAAA,CAAAA,CAAG,CAEpCH,CAAAA,KAAAA,CAAAI,aAAgB,CAAA,GAAIC,CAAAA,+BAERL,CAAAA,CAAAA,KAAAA,CAAmBM,qBAAY,CAE/BN,CAAAA,KAAAA,CAAWO,aAAY,CAExBP,CAAAA,KAAAA,CAAKQ,MAAW,EAEhBR,CAAAA,KAAAA,CAAWS,YAAW,cAErBT,CAAAA,KAAAA,CAAQU,UAAY,CAEpBV,CAAAA,KAAAA,CAASW,WAAY,CAErBX,CAAAA,KAAAA,CAASY,SAAY,CAAA,CAAA,CAAA,CAErBZ,KAAAA,CAAOa,OAAAA,CAAAA,CAAY,EAElBb,KAAAA,CAAcc,cAAAA,CAA8C,SAACC,CAAYC,CAAAA,CAAAA,QAAuBD,CAAAA,EAAKE,WAAcC,CAAAA,CAAAA,CAAAA,QAAAA,CAASF,EAAcC,WAE1IjB,CAAAA,CAAAA,CAAAA,GAAAA,KAAAA,CAAAmB,mBAA0CJ,SAAAA,CAAWA,QAAAA,CAAAA,CAAAA,GAExDf,KAAAA,CAAYoB,YAAQ,CAAA,E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A,CAAgB4H,EAAA,CAD5Ba,CAAAA,CAAc,uBACFzI"}
|
|
1
|
+
{"version":3,"file":"nile-auto-complete.cjs.js","sources":["../../../src/nile-auto-complete/nile-auto-complete.ts"],"sourcesContent":["import {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-auto-complete.css';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport { NileDropdown } from '../nile-dropdown';\nimport { watch } from '../internal/watch';\nimport { AutoCompletePortalManager } from './portal-manager';\nimport { NileInput } from '../nile-input';\n\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { VisibilityManager } from '../utilities/visibility-manager.js';\n\n\n// Define the custom element 'nile-auto-complete'\n@customElement('nile-auto-complete')\nexport class NileAutoComplete extends NileElement {\n\n static styles: CSSResultGroup = styles;\n private visibilityManager?: VisibilityManager;\n\n\n @query('nile-dropdown') dropdownElement: NileDropdown;\n\n @query('nile-input') inputElement: NileInput;\n\n // Define component properties\n\n @property({ type: Boolean }) disabled: boolean = false;\n\n @property({ type: Boolean }) isDropdownOpen: boolean = false;\n\n /** \n * When true, the dropdown menu will be appended to the document body instead of the parent container.\n * This is useful when the parent has overflow: hidden, clip-path, or transform applied.\n */\n @property({ type: Boolean, reflect: true }) portal = false;\n\n private readonly portalManager = new AutoCompletePortalManager(this);\n\n @property({ type: Boolean }) enableVirtualScroll: boolean = false;\n\n @property({ type: Boolean }) openOnFocus: boolean = false;\n\n @property({ type: String }) value: string = '';\n\n @property({ type: String }) placeholder: string = 'Type here ..';\n\n @property({ type: Boolean }) noBorder: boolean = false;\n \n @property({ type: Boolean }) noOutline: boolean = false;\n\n @property({ type: Boolean }) noPadding: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean=(item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n @property({ type: Array }) allMenuItems: any = [];\n\n @property({ type: Boolean, reflect: true }) enableVisibilityEffect = false;\n\n @property({ type: Boolean, reflect: true }) enableTabClose = false;\n\n\n @state() menuItems: any = [];\n\n\n protected async firstUpdated(_changed: PropertyValues) {\n \n super.firstUpdated?.(_changed);\n await this.updateComplete;\n console.log('AutoComplete target:', this.inputElement?.input);\n\n this.visibilityManager = new VisibilityManager({\n host: this,\n target: this.inputElement.input, // element to observe\n enableVisibilityEffect: this.enableVisibilityEffect,\nenableTabClose: this.enableTabClose,\n isOpen: () => this.isDropdownOpen,\n onAnchorOutOfView: () => {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n this.emit('nile-visibility-change', {\n visible: false,\n reason: 'anchor-out-of-view',\n });\n },\n onDocumentHidden: () => {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n this.emit('nile-visibility-change', {\n visible: false,\n reason: 'document-hidden',\n });\n },\n emit: (event, detail) => this.emit(`nile-${event}`, detail),\n });\n }\n connectedCallback() {\n super.connectedCallback();\n this.renderItemFunction=(item:any)=>item;\n this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);\n this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);\n this.handleWindowResize = this.handleWindowResize.bind(this);\n this.handleWindowScroll = this.handleWindowScroll.bind(this);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.visibilityManager?.cleanup();\n this.portalManager.cleanupPortalAppend();\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('allMenuItems')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.setVirtualMenuWidth();\n if (this.portal && this.isDropdownOpen) {\n this.portalManager.updatePortalOptions();\n }\n }\n if (changedProperties.has('isDropdownOpen')) {\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.handleDropdownOpenChange();\n }\n if (changedProperties.has('value')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n if (this.portal && this.isDropdownOpen) {\n this.portalManager.updatePortalOptions();\n }\n }\n if (changedProperties.has('portal')) {\n this.handlePortalChange();\n }\n }\n\n @watch('portal', { waitUntilFirstUpdate: true })\n handlePortalChange(): void {\n if (this.isDropdownOpen) {\n if (this.portal) {\n this.portalManager.setupPortalAppend();\n } else {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n private handleDropdownOpenChange(): void {\n if (this.isDropdownOpen) {\n this.addOpenListeners();\n this.visibilityManager?.setup();\n if (this.portal) {\n this.portalManager.setupPortalAppend();\n }\n } else {\n this.removeOpenListeners();\n this.visibilityManager?.cleanup();\n if (this.portal) {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n private addOpenListeners(): void {\n document.addEventListener('focusin', this.handleDocumentFocusIn);\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n \n if (this.portal) {\n window.addEventListener('resize', this.handleWindowResize);\n window.addEventListener('scroll', this.handleWindowScroll, true);\n }\n }\n\n private removeOpenListeners(): void {\n document.removeEventListener('focusin', this.handleDocumentFocusIn);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n window.removeEventListener('resize', this.handleWindowResize);\n window.removeEventListener('scroll', this.handleWindowScroll, true);\n }\n\n private handleDocumentFocusIn(event: FocusEvent) {\n if (!this.isDropdownOpen) return;\n const path = event.composedPath();\n const hitSelf = path.includes(this);\n const hitDropdown = this.dropdownElement && path.includes(this.dropdownElement);\n const hitPortalAppend = this.portal && this.portalManager.portalContainerElement && path.includes(this.portalManager.portalContainerElement);\n\n if (!hitSelf && !hitDropdown && !hitPortalAppend) {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n }\n\n private handleDocumentMouseDown(event: MouseEvent) {\n if (!this.isDropdownOpen) return;\n \n const path = event.composedPath();\n const hitSelf = path.includes(this);\n const hitDropdown = this.dropdownElement && path.includes(this.dropdownElement);\n const hitPortalAppend = this.portal && this.portalManager.portalContainerElement && path.includes(this.portalManager.portalContainerElement);\n \n if (!hitSelf && !hitDropdown && !hitPortalAppend) {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n }\n\n private handleWindowResize = (): void => {\n this.portalManager.updatePortalAppendPosition();\n };\n\n private handleWindowScroll = (): void => {\n this.portalManager.updatePortalAppendPosition();\n };\n\n public render(): TemplateResult {\n const content=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();\n return html`\n <nile-dropdown class=\"nile-dropdown--input\" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=${this.noBorder}\n ?no-outline=${this.noOutline}\n ?no-padding=${this.noPadding}\n .disabled=${this.disabled}\n .value=${this.value}\n @nile-input=${this.handleSearch}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n slot=\"trigger\"\n placeholder=${this.placeholder}\n exportparts=\"input, base\"\n >\n ${this.loading?html`<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>`:nothing}\n </nile-input>\n ${this.menuItems.length > 0 && !this.loading\n ? content\n : nothing}\n </nile-dropdown>\n `;\n } \n \n getVirtualizedContent():TemplateResult{\n return html`\n <nile-menu class=\"virtualized__menu\" @nile-select=${this.handleSelect} id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\" style=${this.portal ? 'display: none;' : ''}>\n ${virtualize({\n items: this.menuItems,\n renderItem: (item:any):TemplateResult=>this.getItemRenderFunction(item),\n\t\t\t\t\tscroller:true\n })}\n </nile-menu>\n `\n }\n\n getContent():TemplateResult{\n return html`\n <nile-menu id=\"content-menu\" @nile-select=${this.handleSelect} exportparts=\"menu__items-wrapper:options__wrapper\" style=${this.portal ? 'display: none;' : ''}>\n ${this.menuItems.map((item: any) => this.getItemRenderFunction(item))}\n </nile-menu>`\n }\n\n getItemRenderFunction(item: any): TemplateResult {\n const value = this.renderItemFunction(item);\n const hasTooltip = !!item.tooltip;\n const shouldShowTooltip =\n hasTooltip && (!item.tooltip.for || item.tooltip.for === 'menu');\n \n if (!shouldShowTooltip) {\n return html`\n <nile-menu-item value=${value}>${unsafeHTML(value)}</nile-menu-item>\n `;\n }\n \n let tooltipContent: string | null = null;\n \n const content = item.tooltip.content;\n if (content instanceof Promise) {\n tooltipContent = 'Loading...'; \n content.then((resolved: string) => {\n item.tooltip.content = resolved;\n this.requestUpdate(); \n });\n } else {\n tooltipContent = content;\n }\n \n return html`\n <nile-menu-item value=${value}>\n <nile-lite-tooltip allowHTML .content=${tooltipContent}>\n <span class=\"menu-item-text\">${unsafeHTML(value)}</span>\n </nile-lite-tooltip>\n </nile-menu-item>\n `;\n }\n\n handleSelect(event: CustomEvent) {\n this.value = event.detail.value;\n this.emit('nile-complete', { value: event.detail.value });\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n\n private setVirtualMenuWidth() {\n const maxLengthOption = this.menuItems\n .reduce((acc: number, curr: any) => {\n const currLength = this.renderItemFunction(curr).length\n return acc > currLength ? acc : currLength\n }, 0)\n const defaultWith = 110;\n const pixelMultiplier = 9.5;\n const menuWidth = maxLengthOption * pixelMultiplier < defaultWith ? defaultWith : maxLengthOption * pixelMultiplier;\n this.style.setProperty(\"--virtual-scroll-container-width\", menuWidth + \"px\");\n }\n\n private handleSearch(event: CustomEvent) {\n this.value = event.detail.value.toLowerCase();\n\n // Filter menu items based on the search value\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n\n this.isDropdownOpen = this.menuItems.length > 0;\n if (this.isDropdownOpen) {\n this.dropdownElement?.show();\n if (this.portal) {\n this.portalManager.updatePortalOptions();\n }\n }\n }\n\n public handleFocus() {\n if (!this.openOnFocus) {\n return;\n }\n\n if(this.portal) {\n this.inputElement?.focus();\n }\n\n // Delay opening the dropdown to allow focus to take effect\n setTimeout(() => {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }, 300);\n }\n\n private handleClick() {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }\n\n applyFilter<T>(list: T[], filterFn: (item: T,searchValue?:string) => boolean): T[] {\n if(typeof(list)!=='object') return []\n const res:T[]=[]\n list.forEach( el=> filterFn(el,this.value) && res.push(el) )\n return res\n }\n\n}\n\nexport default NileAutoComplete;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-auto-complete': NileAutoComplete;\n }\n}\n"],"names":["NileAutoComplete","m","constructor","this","disabled","isDropdownOpen","portal","portalManager","AutoCompletePortalManager","enableVirtualScroll","openOnFocus","value","placeholder","noBorder","noOutline","noPadding","loading","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","allMenuItems","enableVisibilityEffect","enableTabClose","menuItems","handleWindowResize","updatePortalAppendPosition","handleWindowScroll","_this","_inherits","_r","_createClass","key","_firstUpdated","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_changed","updateComplete","console","log","inputElement","input","visibilityManager","VisibilityManager","host","target","isOpen","onAnchorOutOfView","_this2$dropdownElemen","dropdownElement","hide","emit","visible","reason","onDocumentHidden","_this2$dropdownElemen2","event","detail","_context2","stop","firstUpdated","connectedCallback","super","handleDocumentFocusIn","bind","handleDocumentMouseDown","disconnectedCallback","removeOpenListeners","cleanup","cleanupPortalAppend","updated","changedProperties","has","applyFilter","setVirtualMenuWidth","updatePortalOptions","handleDropdownOpenChange","handlePortalChange","setupPortalAppend","addOpenListeners","setup","document","addEventListener","window","removeEventListener","_this$dropdownElement","path","composedPath","hitSelf","hitDropdown","hitPortalAppend","portalContainerElement","render","content","getVirtualizedContent","getContent","html","_templateObject","_taggedTemplateLiteral","handleSearch","handleFocus","handleClick","_templateObject2","nothing","length","_this3","_templateObject3","handleSelect","virtualize","items","renderItem","getItemRenderFunction","scroller","_this4","_templateObject4","map","tooltip","for","_templateObject5","unsafeHTML","tooltipContent","Promise","then","resolved","requestUpdate","_templateObject6","maxLengthOption","reduce","acc","curr","currLength","menuWidth","style","setProperty","show","focus","setTimeout","list","filterFn","_typeof","t","res","forEach","el","push","NileElement","styles","__decorate","query","prototype","property","type","Boolean","reflect","String","attribute","Array","state","watch","waitUntilFirstUpdate","customElement"],"mappings":"ooZAuBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAYwBC,KAAAA,CAAQC,QAAAA,CAAAA,CAAY,CAEpBD,CAAAA,KAAAA,CAAcE,cAAY,CAAA,CAAA,CAAA,CAMXF,KAAAA,CAAMG,MAAAA,CAAAA,CAAG,CAEpCH,CAAAA,KAAAA,CAAAI,aAAgB,CAAA,GAAIC,CAAAA,CAA0BL,CAAAA,sBAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAElCA,KAAAA,CAAmBM,mBAAAA,CAAAA,CAAY,CAE/BN,CAAAA,KAAAA,CAAWO,WAAY,CAAA,CAAA,CAAA,CAExBP,KAAAA,CAAKQ,KAAAA,CAAW,GAEhBR,KAAAA,CAAWS,WAAAA,CAAW,cAErBT,CAAAA,KAAAA,CAAQU,QAAY,CAAA,CAAA,CAAA,CAEpBV,KAAAA,CAASW,SAAAA,CAAAA,CAAY,CAErBX,CAAAA,KAAAA,CAASY,SAAY,CAAA,CAAA,CAAA,CAErBZ,KAAAA,CAAOa,OAAAA,CAAAA,CAAY,CAElBb,CAAAA,KAAAA,CAAcc,cAA8C,CAAA,SAACC,CAAYC,CAAAA,CAAAA,QAAuBD,CAAAA,CAAKE,CAAAA,WAAAA,CAAAA,CAAAA,CAAcC,QAASF,CAAAA,CAAAA,CAAcC,WAE1IjB,CAAAA,CAAAA,CAAAA,GAAAA,KAAAA,CAAAmB,kBAA0CJ,CAAA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JF,CAAAA,CAAAA,CAAAA,CAAA,CAA7BG,CAAAA,CAAS,CAAEK,SAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkE/J,EAAAyJ,SAAA,CAAA,oBAAA,CAAA,IAAA,IAE7DF,CAAA,CAAA,CAA1BG,EAAS,CAAEC,IAAAA,CAAMK,SAAgChK,CAAAyJ,CAAAA,SAAAA,CAAA,mBAAA,EAENF,CAAAA,CAAAA,CAAAA,CAAA,CAA3CG,CAAS,CAAA,CAAEC,IAAMC,CAAAA,OAAAA,CAASC,SAAS,CAAuC7J,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyJ,UAAA,wBAAA,CAAA,IAAA,EAAA,CAAA,CAE/BF,EAAA,CAA3CG,CAAAA,CAAS,CAAEC,IAAAA,CAAMC,QAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+B7J,EAAAyJ,SAAA,CAAA,gBAAA,CAAA,IAAA,IAG1DF,CAAA,CAAA,CAARU,CAA4BjK,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyJ,UAAA,WAAA,CAAA,IAAA,EAAA,CAAA,CA2E7BF,EAAA,CADCW,CAAAA,CAAM,SAAU,CAAEC,oBAAAA,CAAAA,CAAsB,KASxCnK,CAAAyJ,CAAAA,SAAAA,CAAA,qBAAA,IAtIUzJ,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAgBuJ,EAAA,CAD5Ba,CAAAA,CAAc,uBACFpK"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t}from"tslib";import{html as i,nothing as e}from"lit";import{query as s,property as n,state as o,customElement as h}from"lit/decorators.js";import{s as l}from"./nile-auto-complete.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{w as a}from"../internal/watch.esm.js";import{A as p}from"./portal-manager.esm.js";import{v as d}from"../virtualize-a4a40d96.esm.js";import{unsafeHTML as m}from"lit/directives/unsafe-html.js";import"../floating-ui.dom-cc9126da.esm.js";import"./portal-utils.esm.js";import"../lit-html-39a6718c.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";let
|
|
1
|
+
import{__decorate as t}from"tslib";import{html as i,nothing as e}from"lit";import{query as s,property as n,state as o,customElement as h}from"lit/decorators.js";import{s as l}from"./nile-auto-complete.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{w as a}from"../internal/watch.esm.js";import{A as p}from"./portal-manager.esm.js";import{v as d}from"../virtualize-a4a40d96.esm.js";import{unsafeHTML as m}from"lit/directives/unsafe-html.js";import{V as u}from"../utilities/visibility-manager.esm.js";import"../floating-ui.dom-cc9126da.esm.js";import"./portal-utils.esm.js";import"../lit-html-39a6718c.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";let c=class extends r{constructor(){super(...arguments),this.disabled=!1,this.isDropdownOpen=!1,this.portal=!1,this.portalManager=new p(this),this.enableVirtualScroll=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.noOutline=!1,this.noPadding=!1,this.loading=!1,this.filterFunction=(t,i)=>t.toLowerCase().includes(i.toLowerCase()),this.renderItemFunction=t=>t,this.allMenuItems=[],this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.menuItems=[],this.handleWindowResize=()=>{this.portalManager.updatePortalAppendPosition()},this.handleWindowScroll=()=>{this.portalManager.updatePortalAppendPosition()}}async firstUpdated(t){super.firstUpdated?.(t),await this.updateComplete,console.log("AutoComplete target:",this.inputElement?.input),this.visibilityManager=new u({host:this,target:this.inputElement.input,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.isDropdownOpen,onAnchorOutOfView:()=>{this.isDropdownOpen=!1,this.dropdownElement?.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.isDropdownOpen=!1,this.dropdownElement?.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(t,i)=>this.emit(`nile-${t}`,i)})}connectedCallback(){super.connectedCallback(),this.renderItemFunction=t=>t,this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.portalManager.cleanupPortalAppend()}updated(t){super.updated(t),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth(),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.handleDropdownOpenChange()),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("portal")&&this.handlePortalChange()}handlePortalChange(){this.isDropdownOpen&&(this.portal?this.portalManager.setupPortalAppend():this.portalManager.cleanupPortalAppend())}handleDropdownOpenChange(){this.isDropdownOpen?(this.addOpenListeners(),this.visibilityManager?.setup(),this.portal&&this.portalManager.setupPortalAppend()):(this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.portal&&this.portalManager.cleanupPortalAppend())}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.portal&&(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("scroll",this.handleWindowScroll,!0))}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("scroll",this.handleWindowScroll,!0)}handleDocumentFocusIn(t){if(!this.isDropdownOpen)return;const i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,this.dropdownElement?.hide())}handleDocumentMouseDown(t){if(!this.isDropdownOpen)return;const i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,this.dropdownElement?.hide())}render(){const t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i`
|
|
2
2
|
<nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts="input, base">
|
|
3
3
|
<nile-input class="nile-auto-complete--input"
|
|
4
4
|
?no-border=${this.noBorder}
|
|
@@ -32,4 +32,4 @@ import{__decorate as t}from"tslib";import{html as i,nothing as e}from"lit";impor
|
|
|
32
32
|
<span class="menu-item-text">${m(e)}</span>
|
|
33
33
|
</nile-lite-tooltip>
|
|
34
34
|
</nile-menu-item>
|
|
35
|
-
`}handleSelect(t){this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}setVirtualMenuWidth(){const t=this.menuItems.reduce(((t,i)=>{const e=this.renderItemFunction(i).length;return t>e?t:e}),0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px")}handleSearch(t){this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&(this.dropdownElement?.show(),this.portal&&this.portalManager.updatePortalOptions())}handleFocus(){this.openOnFocus&&(this.portal&&this.inputElement?.focus(),setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300))}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}applyFilter(t,i){if("object"!=typeof t)return[];const e=[];return t.forEach((t=>i(t,this.value)&&e.push(t))),e}};
|
|
35
|
+
`}handleSelect(t){this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}setVirtualMenuWidth(){const t=this.menuItems.reduce(((t,i)=>{const e=this.renderItemFunction(i).length;return t>e?t:e}),0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px")}handleSearch(t){this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&(this.dropdownElement?.show(),this.portal&&this.portalManager.updatePortalOptions())}handleFocus(){this.openOnFocus&&(this.portal&&this.inputElement?.focus(),setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300))}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}applyFilter(t,i){if("object"!=typeof t)return[];const e=[];return t.forEach((t=>i(t,this.value)&&e.push(t))),e}};c.styles=l,t([s("nile-dropdown")],c.prototype,"dropdownElement",void 0),t([s("nile-input")],c.prototype,"inputElement",void 0),t([n({type:Boolean})],c.prototype,"disabled",void 0),t([n({type:Boolean})],c.prototype,"isDropdownOpen",void 0),t([n({type:Boolean,reflect:!0})],c.prototype,"portal",void 0),t([n({type:Boolean})],c.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],c.prototype,"openOnFocus",void 0),t([n({type:String})],c.prototype,"value",void 0),t([n({type:String})],c.prototype,"placeholder",void 0),t([n({type:Boolean})],c.prototype,"noBorder",void 0),t([n({type:Boolean})],c.prototype,"noOutline",void 0),t([n({type:Boolean})],c.prototype,"noPadding",void 0),t([n({type:Boolean})],c.prototype,"loading",void 0),t([n({attribute:!1})],c.prototype,"filterFunction",void 0),t([n({attribute:!1})],c.prototype,"renderItemFunction",void 0),t([n({type:Array})],c.prototype,"allMenuItems",void 0),t([n({type:Boolean,reflect:!0})],c.prototype,"enableVisibilityEffect",void 0),t([n({type:Boolean,reflect:!0})],c.prototype,"enableTabClose",void 0),t([o()],c.prototype,"menuItems",void 0),t([a("portal",{waitUntilFirstUpdate:!0})],c.prototype,"handlePortalChange",null),c=t([h("nile-auto-complete")],c);export{c 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(["../fixture-54600b35.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-auto-complete.cjs.js","tslib","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","../lit-html-9b3af046.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,e,i,o,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(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){t=_fixture005CjsJs.f;e=_fixture005CjsJs.a;i=_fixture005CjsJs.e;},function(_litStaticHtmlJs){o=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileAutoCompleteCjsJs){l=_nileAutoCompleteCjsJs.N;},function(_tslib){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalWatchCjsJs){},function(_portalManagerCjsJs){},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litHtml003CjsJs){},function(_virtualize002CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){describe("NileAutoComplete",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return t(o(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context2.sent;e(i).to.be.instanceOf(l),e(i.shadowRoot).not.to.be["null"];case 4:case"end":return _context2.stop();}},_callee);}))),it("should have an empty value and dropdown closed by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return t(o(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context3.sent;e(i.value).to.equal(""),e(i.isDropdownOpen).to.be["false"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should close the dropdown if no items match the search",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _l$shadowRoot;var l,a;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return t(o(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context4.sent;a=(_l$shadowRoot=l.shadowRoot)===null||_l$shadowRoot===void 0?void 0:_l$shadowRoot.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"Orange"}}));_context4.next=7;return i(l);case 7:e(l.menuItems).to.deep.equal([]);e(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context4.stop();}},_callee3);}))),it("should apply the placeholder text to the input",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _i$shadowRoot;var i,l;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return t(o(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-auto-complete placeholder=\"Search items...\"></nile-auto-complete>\n "]))));case 2:i=_context5.sent;l=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.querySelector("nile-input");e(l===null||l===void 0?void 0:l.getAttribute("placeholder")).to.equal("Search items...");case 5:case"end":return _context5.stop();}},_callee4);}))),it("should toggle border visibility based on the noBorder property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _l$shadowRoot2;var l,a;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return t(o(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-auto-complete noBorder></nile-auto-complete>\n "]))));case 2:l=_context6.sent;a=(_l$shadowRoot2=l.shadowRoot)===null||_l$shadowRoot2===void 0?void 0:_l$shadowRoot2.querySelector("nile-input");e(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["true"];l.noBorder=!1;_context6.next=8;return i(l);case 8:e(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["false"];case 9:case"end":return _context6.stop();}},_callee5);}))),it("should handle an empty list of menu items",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _l$shadowRoot3;var l,a;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return t(o(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-auto-complete .allMenuItems=","></nile-auto-complete>"])),[]));case 2:l=_context7.sent;a=(_l$shadowRoot3=l.shadowRoot)===null||_l$shadowRoot3===void 0?void 0:_l$shadowRoot3.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"test"}}));_context7.next=7;return i(l);case 7:e(l.menuItems.length).to.equal(0);e(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context7.stop();}},_callee6);}))),it("should hide the dropdown when no results are found",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _l$shadowRoot4;var l,a;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return t(o(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context8.sent;a=(_l$shadowRoot4=l.shadowRoot)===null||_l$shadowRoot4===void 0?void 0:_l$shadowRoot4.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"NonMatchingValue"}}));_context8.next=7;return i(l);case 7:e(l.isDropdownOpen).to.be["false"];e(l.menuItems.length).to.equal(0);case 9:case"end":return _context8.stop();}},_callee7);})));});}};});
|
|
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-1c49c014.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-auto-complete.cjs.js","tslib","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","../lit-html-9b3af046.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";var t,e,i,o,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(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){t=_fixture005CjsJs.f;e=_fixture005CjsJs.a;i=_fixture005CjsJs.e;},function(_litStaticHtmlJs){o=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileAutoCompleteCjsJs){l=_nileAutoCompleteCjsJs.N;},function(_tslib){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalWatchCjsJs){},function(_portalManagerCjsJs){},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litHtml003CjsJs){},function(_virtualize002CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){describe("NileAutoComplete",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return t(o(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context2.sent;e(i).to.be.instanceOf(l),e(i.shadowRoot).not.to.be["null"];case 4:case"end":return _context2.stop();}},_callee);}))),it("should have an empty value and dropdown closed by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return t(o(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context3.sent;e(i.value).to.equal(""),e(i.isDropdownOpen).to.be["false"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should close the dropdown if no items match the search",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _l$shadowRoot;var l,a;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return t(o(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context4.sent;a=(_l$shadowRoot=l.shadowRoot)===null||_l$shadowRoot===void 0?void 0:_l$shadowRoot.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"Orange"}}));_context4.next=7;return i(l);case 7:e(l.menuItems).to.deep.equal([]);e(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context4.stop();}},_callee3);}))),it("should apply the placeholder text to the input",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _i$shadowRoot;var i,l;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return t(o(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-auto-complete placeholder=\"Search items...\"></nile-auto-complete>\n "]))));case 2:i=_context5.sent;l=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.querySelector("nile-input");e(l===null||l===void 0?void 0:l.getAttribute("placeholder")).to.equal("Search items...");case 5:case"end":return _context5.stop();}},_callee4);}))),it("should toggle border visibility based on the noBorder property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _l$shadowRoot2;var l,a;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return t(o(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-auto-complete noBorder></nile-auto-complete>\n "]))));case 2:l=_context6.sent;a=(_l$shadowRoot2=l.shadowRoot)===null||_l$shadowRoot2===void 0?void 0:_l$shadowRoot2.querySelector("nile-input");e(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["true"];l.noBorder=!1;_context6.next=8;return i(l);case 8:e(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["false"];case 9:case"end":return _context6.stop();}},_callee5);}))),it("should handle an empty list of menu items",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _l$shadowRoot3;var l,a;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return t(o(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-auto-complete .allMenuItems=","></nile-auto-complete>"])),[]));case 2:l=_context7.sent;a=(_l$shadowRoot3=l.shadowRoot)===null||_l$shadowRoot3===void 0?void 0:_l$shadowRoot3.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"test"}}));_context7.next=7;return i(l);case 7:e(l.menuItems.length).to.equal(0);e(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context7.stop();}},_callee6);}))),it("should hide the dropdown when no results are found",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _l$shadowRoot4;var l,a;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return t(o(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context8.sent;a=(_l$shadowRoot4=l.shadowRoot)===null||_l$shadowRoot4===void 0?void 0:_l$shadowRoot4.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"NonMatchingValue"}}));_context8.next=7;return i(l);case 7:e(l.isDropdownOpen).to.be["false"];e(l.menuItems.length).to.equal(0);case 9:case"end":return _context8.stop();}},_callee7);})));});}};});
|
|
2
2
|
//# sourceMappingURL=nile-auto-complete.test.cjs.js.map
|