@aquera/nile-elements 1.3.1-beta-1.0 → 1.3.1-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/demo/index.css +1 -4
- package/demo/index.html +15 -38
- package/demo/nxtgen.css +6 -0
- package/demo/variables.css +6 -2
- package/dist/{fixture-d1470b58.cjs.js → fixture-54600b35.cjs.js} +2 -2
- package/dist/{fixture-d1470b58.cjs.js.map → fixture-54600b35.cjs.js.map} +1 -1
- package/dist/{fixture-1c49c014.cjs.js → fixture-5b79f853.cjs.js} +2 -2
- package/dist/{fixture-dff65c89.cjs.js.map → fixture-5b79f853.cjs.js.map} +1 -1
- package/dist/{fixture-dff65c89.cjs.js → fixture-73855806.cjs.js} +2 -2
- package/dist/{fixture-1c49c014.cjs.js.map → fixture-73855806.cjs.js.map} +1 -1
- package/dist/fixture-90b199c4.esm.js +569 -0
- package/dist/{fixture-985bba12.esm.js → fixture-9871e8a9.esm.js} +1 -1
- package/dist/fixture-c1d78368.cjs.js +395 -0
- package/dist/fixture-c1d78368.cjs.js.map +1 -0
- package/dist/fixture-cf7bfcf5.esm.js +569 -0
- package/dist/fixture-dbd66009.cjs.js +395 -0
- package/dist/fixture-dbd66009.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +981 -628
- 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/index.cjs.js +1 -1
- package/dist/nile-calendar/index.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +387 -110
- package/dist/nile-calendar/nile-calendar.enum.cjs.js +2 -0
- package/dist/nile-calendar/nile-calendar.enum.cjs.js.map +1 -0
- package/dist/nile-calendar/nile-calendar.enum.esm.js +1 -0
- package/dist/nile-calendar/nile-calendar.esm.js +216 -108
- 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-code-editor/backup_nile-code-editor copy.cjs.js +2 -0
- package/dist/nile-code-editor/backup_nile-code-editor copy.cjs.js.map +1 -0
- package/dist/nile-code-editor/backup_nile-code-editor copy.esm.js +1 -0
- 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-dropdown/portal-manager.cjs.js +1 -1
- package/dist/nile-dropdown/portal-manager.cjs.js.map +1 -1
- package/dist/nile-dropdown/portal-manager.esm.js +1 -1
- package/dist/nile-dropdown/portal-utils.cjs.js +1 -1
- package/dist/nile-dropdown/portal-utils.cjs.js.map +1 -1
- package/dist/nile-dropdown/portal-utils.esm.js +1 -1
- 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-utils.cjs.js +2 -0
- package/dist/nile-inline-edit/nile-inline-edit-utils.cjs.js.map +1 -0
- package/dist/nile-inline-edit/nile-inline-edit-utils.esm.js +1 -0
- 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-inline-sidebar/nile-inline-sidebar.cjs.js +1 -1
- package/dist/nile-inline-sidebar/nile-inline-sidebar.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar/nile-inline-sidebar.css.cjs.js +1 -1
- package/dist/nile-inline-sidebar/nile-inline-sidebar.css.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar/nile-inline-sidebar.css.esm.js +2 -10
- package/dist/nile-inline-sidebar/nile-inline-sidebar.esm.js +6 -10
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.css.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.css.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.css.esm.js +2 -8
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.esm.js +2 -2
- 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-link/nile-link.css.cjs.js +1 -1
- package/dist/nile-link/nile-link.css.cjs.js.map +1 -1
- package/dist/nile-link/nile-link.css.esm.js +3 -3
- 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-select/virtual-scroll-helper.cjs.js +1 -1
- package/dist/nile-select/virtual-scroll-helper.cjs.js.map +1 -1
- package/dist/nile-select/virtual-scroll-helper.esm.js +0 -2
- package/dist/nile-side-bar/nile-side-bar.cjs.js +1 -1
- package/dist/nile-side-bar/nile-side-bar.cjs.js.map +1 -1
- package/dist/nile-side-bar/nile-side-bar.css.cjs.js +1 -1
- package/dist/nile-side-bar/nile-side-bar.css.cjs.js.map +1 -1
- package/dist/nile-side-bar/nile-side-bar.css.esm.js +29 -24
- package/dist/nile-side-bar/nile-side-bar.esm.js +1 -7
- package/dist/nile-side-bar-expand/nile-side-bar-expand.cjs.js +1 -1
- package/dist/nile-side-bar-expand/nile-side-bar-expand.cjs.js.map +1 -1
- package/dist/nile-side-bar-expand/nile-side-bar-expand.css.cjs.js +1 -1
- package/dist/nile-side-bar-expand/nile-side-bar-expand.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-expand/nile-side-bar-expand.css.esm.js +5 -3
- package/dist/nile-side-bar-expand/nile-side-bar-expand.esm.js +8 -8
- package/dist/nile-side-bar-footer/nile-side-bar-footer.css.cjs.js +1 -1
- package/dist/nile-side-bar-footer/nile-side-bar-footer.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer/nile-side-bar-footer.css.esm.js +3 -5
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.cjs.js +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.cjs.js +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.esm.js +5 -17
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.esm.js +3 -3
- package/dist/nile-side-bar-group/nile-side-bar-group.css.cjs.js +1 -1
- package/dist/nile-side-bar-group/nile-side-bar-group.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-group/nile-side-bar-group.css.esm.js +7 -4
- package/dist/nile-side-bar-group-item/nile-side-bar-group-item.css.cjs.js +1 -1
- package/dist/nile-side-bar-group-item/nile-side-bar-group-item.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-group-item/nile-side-bar-group-item.css.esm.js +56 -58
- package/dist/nile-sidebar/index.cjs.js +2 -0
- package/dist/nile-sidebar/index.cjs.js.map +1 -0
- package/dist/nile-sidebar/index.esm.js +75 -0
- package/dist/nile-sidebar-menu/index.cjs.js +2 -0
- package/dist/nile-sidebar-menu/index.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu/index.esm.js +1 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js +2 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js +2 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.esm.js +38 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.esm.js +10 -0
- package/dist/nile-sidebar-menu-items/index.cjs.js +2 -0
- package/dist/nile-sidebar-menu-items/index.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu-items/index.esm.js +1 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js +2 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js +2 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.esm.js +36 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.esm.js +15 -0
- package/dist/nile-sidebar-wrapper/index.cjs.js +2 -0
- package/dist/nile-sidebar-wrapper/index.cjs.js.map +1 -0
- package/dist/nile-sidebar-wrapper/index.esm.js +1 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js +2 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js.map +1 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js +2 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js.map +1 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.esm.js +105 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.esm.js +16 -0
- 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/group-manager.cjs.js +2 -0
- package/dist/nile-virtual-select/group-manager.cjs.js.map +1 -0
- package/dist/nile-virtual-select/group-manager.esm.js +1 -0
- 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/nile-virtual-select/temp_nile-virtual-select copy.cjs.js +2 -0
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js.map +1 -0
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.esm.js +231 -0
- package/dist/scopedElementsWrapper-4c29be11.esm.js +7 -0
- package/dist/scopedElementsWrapper-a112fc73.cjs.js +6 -0
- package/dist/scopedElementsWrapper-a112fc73.cjs.js.map +1 -0
- package/dist/src/internal/portal-manager.d.ts +53 -0
- package/dist/src/internal/portal-manager.js +196 -0
- package/dist/src/internal/portal-manager.js.map +1 -0
- package/dist/src/internal/portal.d.ts +60 -0
- package/dist/src/internal/portal.js +199 -0
- package/dist/src/internal/portal.js.map +1 -0
- package/dist/src/internal/resizable-helper.d.ts +59 -0
- package/dist/src/internal/resizable-helper.js +115 -0
- package/dist/src/internal/resizable-helper.js.map +1 -0
- package/dist/src/internal/resizable-styles.d.ts +16 -0
- package/dist/src/internal/resizable-styles.js +144 -0
- package/dist/src/internal/resizable-styles.js.map +1 -0
- package/dist/src/internal/virtualizer-error-handler.d.ts +30 -0
- package/dist/src/internal/virtualizer-error-handler.js +82 -0
- package/dist/src/internal/virtualizer-error-handler.js.map +1 -0
- package/dist/src/lib/index.d.ts +7 -0
- package/dist/src/lib/index.js +8 -0
- package/dist/src/lib/index.js.map +1 -0
- package/dist/src/lib/virtualize.d.ts +32 -0
- package/dist/src/lib/virtualize.js +105 -0
- package/dist/src/lib/virtualize.js.map +1 -0
- package/dist/src/lib/virtualize.test.d.ts +7 -0
- package/dist/src/lib/virtualize.test.js +57 -0
- package/dist/src/lib/virtualize.test.js.map +1 -0
- package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +4 -0
- package/dist/src/nile-auto-complete/nile-auto-complete.js +39 -0
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-badge/__snapshots__/nile-badge.test.snap.js +17 -0
- package/dist/src/nile-calendar/__snapshots__/nile-calendar.test.snap.js +310 -0
- package/dist/src/nile-calendar/nile-calendar.css.js +385 -108
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.d.ts +17 -1
- package/dist/src/nile-calendar/nile-calendar.js +345 -108
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-card/__snapshots__/nile-card.test.snap.js +34 -0
- package/dist/src/nile-checkbox/__snapshots__/nile-checkbox.test.snap.js +31 -0
- package/dist/src/nile-chip/nile-chip.d.ts +4 -0
- package/dist/src/nile-chip/nile-chip.js +46 -0
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-code-editor/Old_theme copy.d.ts +191 -0
- package/dist/src/nile-code-editor/Old_theme copy.js +193 -0
- package/dist/src/nile-code-editor/Old_theme copy.js.map +1 -0
- 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 +675 -0
- package/dist/src/nile-code-editor/backup_nile-code-editor copy.js.map +1 -0
- package/dist/src/nile-code-editor/theme copy.d.ts +191 -0
- package/dist/src/nile-code-editor/theme copy.js +193 -0
- package/dist/src/nile-code-editor/theme copy.js.map +1 -0
- package/dist/src/nile-dropdown/nile-dropdown.d.ts +4 -1
- package/dist/src/nile-dropdown/nile-dropdown.js +37 -1
- package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
- package/dist/src/nile-dropdown/portal-manager.js +2 -0
- package/dist/src/nile-dropdown/portal-manager.js.map +1 -1
- package/dist/src/nile-dropdown/portal-utils.d.ts +1 -0
- package/dist/src/nile-dropdown/portal-utils.js +24 -0
- package/dist/src/nile-dropdown/portal-utils.js.map +1 -1
- package/dist/src/nile-floating-panel/anchor-manager.d.ts +26 -0
- package/dist/src/nile-floating-panel/anchor-manager.js +49 -0
- package/dist/src/nile-floating-panel/anchor-manager.js.map +1 -0
- package/dist/src/nile-floating-panel/content-manager.d.ts +23 -0
- package/dist/src/nile-floating-panel/content-manager.js +67 -0
- package/dist/src/nile-floating-panel/content-manager.js.map +1 -0
- package/dist/src/nile-floating-panel/event-manager.d.ts +38 -0
- package/dist/src/nile-floating-panel/event-manager.js +81 -0
- package/dist/src/nile-floating-panel/event-manager.js.map +1 -0
- package/dist/src/nile-floating-panel/index.d.ts +1 -0
- package/dist/src/nile-floating-panel/index.js +2 -0
- package/dist/src/nile-floating-panel/index.js.map +1 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.css.d.ts +17 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.css.js +51 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.css.js.map +1 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.d.ts +67 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.js +203 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.js.map +1 -0
- package/dist/src/nile-floating-panel/position-manager.d.ts +47 -0
- package/dist/src/nile-floating-panel/position-manager.js +94 -0
- package/dist/src/nile-floating-panel/position-manager.js.map +1 -0
- package/dist/src/nile-floating-panel/style-manager.d.ts +31 -0
- package/dist/src/nile-floating-panel/style-manager.js +74 -0
- package/dist/src/nile-floating-panel/style-manager.js.map +1 -0
- package/dist/src/nile-floating-panel/types.d.ts +29 -0
- package/dist/src/nile-floating-panel/types.js +8 -0
- package/dist/src/nile-floating-panel/types.js.map +1 -0
- package/dist/src/nile-grid/data-processor.d.ts +37 -0
- package/dist/src/nile-grid/data-processor.js +122 -0
- package/dist/src/nile-grid/data-processor.js.map +1 -0
- package/dist/src/nile-grid/event-handlers.d.ts +35 -0
- package/dist/src/nile-grid/event-handlers.js +158 -0
- package/dist/src/nile-grid/event-handlers.js.map +1 -0
- package/dist/src/nile-grid/renderer.d.ts +8 -0
- package/dist/src/nile-grid/renderer.js +78 -0
- package/dist/src/nile-grid/renderer.js.map +1 -0
- package/dist/src/nile-grid/resize-handler.d.ts +4 -0
- package/dist/src/nile-grid/resize-handler.js +36 -0
- package/dist/src/nile-grid/resize-handler.js.map +1 -0
- package/dist/src/nile-grid/types.d.ts +32 -0
- package/dist/src/nile-grid/types.js +2 -0
- package/dist/src/nile-grid/types.js.map +1 -0
- package/dist/src/nile-grid/utils.d.ts +4 -0
- package/dist/src/nile-grid/utils.js +32 -0
- package/dist/src/nile-grid/utils.js.map +1 -0
- package/dist/src/nile-hero/__snapshots__/nile-hero.test.snap.js +47 -0
- package/dist/src/nile-icon/__snapshots__/nile-icon.test.snap.js +16 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.d.ts +10 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.js +52 -1
- package/dist/src/nile-inline-edit/nile-inline-edit.js.map +1 -1
- package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js +2 -10
- package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js.map +1 -1
- package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js +3 -11
- package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js.map +1 -1
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.css.js +0 -6
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.css.js.map +1 -1
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.d.ts +0 -1
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js +0 -4
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js.map +1 -1
- package/dist/src/nile-input/__snapshots__/nile-input.test.snap.js +75 -0
- package/dist/src/nile-link/nile-link.css.js +3 -3
- package/dist/src/nile-link/nile-link.css.js.map +1 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.d.ts +5 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js +43 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js.map +1 -1
- package/dist/src/nile-menu/portal-manager.d.ts +39 -0
- package/dist/src/nile-menu/portal-manager.js +340 -0
- package/dist/src/nile-menu/portal-manager.js.map +1 -0
- package/dist/src/nile-menu/portal-utils.d.ts +21 -0
- package/dist/src/nile-menu/portal-utils.js +128 -0
- package/dist/src/nile-menu/portal-utils.js.map +1 -0
- package/dist/src/nile-popover/__snapshots__/nile-popover.test.snap.js +22 -0
- package/dist/src/nile-popover/nile-popover.d.ts +4 -0
- package/dist/src/nile-popover/nile-popover.js +39 -0
- package/dist/src/nile-popover/nile-popover.js.map +1 -1
- package/dist/src/nile-popover/popover-portal-handler.d.ts +21 -0
- package/dist/src/nile-popover/popover-portal-handler.js +106 -0
- package/dist/src/nile-popover/popover-portal-handler.js.map +1 -0
- package/dist/src/nile-portal-wrapper/index.d.ts +1 -0
- package/dist/src/nile-portal-wrapper/index.js +2 -0
- package/dist/src/nile-portal-wrapper/index.js.map +1 -0
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.d.ts +47 -0
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js +451 -0
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js.map +1 -0
- package/dist/src/nile-select/body-append-manager.d.ts +90 -0
- package/dist/src/nile-select/body-append-manager.js +298 -0
- package/dist/src/nile-select/body-append-manager.js.map +1 -0
- 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-select/virtual-scroll-helper.js +0 -2
- package/dist/src/nile-select/virtual-scroll-helper.js.map +1 -1
- package/dist/src/nile-side-bar/nile-side-bar.css.js +27 -22
- package/dist/src/nile-side-bar/nile-side-bar.css.js.map +1 -1
- package/dist/src/nile-side-bar/nile-side-bar.js +1 -7
- package/dist/src/nile-side-bar/nile-side-bar.js.map +1 -1
- package/dist/src/nile-side-bar-expand/nile-side-bar-expand.css.js +5 -3
- package/dist/src/nile-side-bar-expand/nile-side-bar-expand.css.js.map +1 -1
- package/dist/src/nile-side-bar-expand/nile-side-bar-expand.d.ts +0 -2
- package/dist/src/nile-side-bar-expand/nile-side-bar-expand.js +4 -12
- package/dist/src/nile-side-bar-expand/nile-side-bar-expand.js.map +1 -1
- package/dist/src/nile-side-bar-footer/nile-side-bar-footer.css.js +1 -3
- package/dist/src/nile-side-bar-footer/nile-side-bar-footer.css.js.map +1 -1
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.js +3 -15
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.js.map +1 -1
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.d.ts +0 -1
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.js +1 -8
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.js.map +1 -1
- package/dist/src/nile-side-bar-group/nile-side-bar-group.css.js +5 -2
- package/dist/src/nile-side-bar-group/nile-side-bar-group.css.js.map +1 -1
- package/dist/src/nile-side-bar-group-item/nile-side-bar-group-item.css.js +46 -48
- package/dist/src/nile-side-bar-group-item/nile-side-bar-group-item.css.js.map +1 -1
- package/dist/src/nile-table-body/virtual-scroll-helper.d.ts +9 -0
- package/dist/src/nile-table-body/virtual-scroll-helper.js +24 -0
- package/dist/src/nile-table-body/virtual-scroll-helper.js.map +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.d.ts +3 -0
- package/dist/src/nile-tooltip/nile-tooltip.js +36 -0
- package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
- package/dist/src/nile-virtual-select/body-append-helper.d.ts +16 -0
- package/dist/src/nile-virtual-select/body-append-helper.js +95 -0
- package/dist/src/nile-virtual-select/body-append-helper.js.map +1 -0
- package/dist/src/nile-virtual-select/group-manager.d.ts +32 -0
- package/dist/src/nile-virtual-select/group-manager.js +134 -0
- package/dist/src/nile-virtual-select/group-manager.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +2 -5
- package/dist/src/nile-virtual-select/nile-virtual-select.js +28 -66
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -1
- package/dist/src/nile-virtual-select/portal-utils.d.ts +65 -0
- package/dist/src/nile-virtual-select/portal-utils.js +376 -0
- package/dist/src/nile-virtual-select/portal-utils.js.map +1 -0
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.d.ts +273 -0
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js +1305 -0
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js.map +1 -0
- package/dist/src/nile-virtual-select/virtualizer-error-handler.d.ts +21 -0
- package/dist/src/nile-virtual-select/virtualizer-error-handler.js +56 -0
- package/dist/src/nile-virtual-select/virtualizer-error-handler.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/index.d.ts +1 -0
- package/dist/src/nile-virtual-select-disabled/index.js +2 -0
- package/dist/src/nile-virtual-select-disabled/index.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.d.ts +12 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js +538 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.d.ts +299 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js +1441 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.d.ts +7 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js +631 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/portal-manager.d.ts +45 -0
- package/dist/src/nile-virtual-select-disabled/portal-manager.js +333 -0
- package/dist/src/nile-virtual-select-disabled/portal-manager.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/renderer.d.ts +16 -0
- package/dist/src/nile-virtual-select-disabled/renderer.js +79 -0
- package/dist/src/nile-virtual-select-disabled/renderer.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/search-manager.d.ts +12 -0
- package/dist/src/nile-virtual-select-disabled/search-manager.js +40 -0
- package/dist/src/nile-virtual-select-disabled/search-manager.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/selection-manager.d.ts +12 -0
- package/dist/src/nile-virtual-select-disabled/selection-manager.js +64 -0
- package/dist/src/nile-virtual-select-disabled/selection-manager.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/types.d.ts +50 -0
- package/dist/src/nile-virtual-select-disabled/types.js +8 -0
- package/dist/src/nile-virtual-select-disabled/types.js.map +1 -0
- package/dist/src/nile-virtual-table-body/index.d.ts +2 -0
- package/dist/src/nile-virtual-table-body/index.js +3 -0
- package/dist/src/nile-virtual-table-body/index.js.map +1 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.d.ts +1 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js +44 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js.map +1 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.d.ts +50 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js +135 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js.map +1 -0
- package/dist/src/nile-virtual-table-body/renderer.d.ts +16 -0
- package/dist/src/nile-virtual-table-body/renderer.js +49 -0
- package/dist/src/nile-virtual-table-body/renderer.js.map +1 -0
- package/dist/src/utilities/stepper-utils.d.ts +71 -0
- package/dist/src/utilities/stepper-utils.js +108 -0
- package/dist/src/utilities/stepper-utils.js.map +1 -0
- package/dist/src/version.js +2 -2
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/nile-auto-complete/nile-auto-complete.ts +41 -0
- package/src/nile-calendar/nile-calendar.css.ts +385 -108
- package/src/nile-calendar/nile-calendar.enum.ts +5 -0
- package/src/nile-calendar/nile-calendar.ts +374 -119
- package/src/nile-chip/nile-chip.ts +48 -0
- package/src/nile-dropdown/nile-dropdown.ts +39 -1
- package/src/nile-dropdown/portal-manager.ts +2 -0
- package/src/nile-dropdown/portal-utils.ts +26 -0
- package/src/nile-inline-edit/nile-inline-edit-utils.ts +94 -0
- package/src/nile-inline-edit/nile-inline-edit.ts +59 -1
- package/src/nile-inline-sidebar/nile-inline-sidebar.css.ts +2 -10
- package/src/nile-inline-sidebar/nile-inline-sidebar.ts +5 -17
- package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.css.ts +0 -6
- package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.ts +0 -1
- package/src/nile-link/nile-link.css.ts +3 -3
- package/src/nile-lite-tooltip/nile-lite-tooltip.ts +47 -1
- package/src/nile-popover/nile-popover.ts +43 -0
- package/src/nile-select/nile-select.ts +31 -87
- package/src/nile-select/virtual-scroll-helper.ts +0 -2
- package/src/nile-side-bar/nile-side-bar.css.ts +27 -22
- package/src/nile-side-bar/nile-side-bar.ts +1 -8
- package/src/nile-side-bar-expand/nile-side-bar-expand.css.ts +5 -3
- package/src/nile-side-bar-expand/nile-side-bar-expand.ts +4 -6
- package/src/nile-side-bar-footer/nile-side-bar-footer.css.ts +1 -3
- package/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.ts +3 -15
- package/src/nile-side-bar-footer-item/nile-side-bar-footer-item.ts +1 -9
- package/src/nile-side-bar-group/nile-side-bar-group.css.ts +5 -2
- package/src/nile-side-bar-group-item/nile-side-bar-group-item.css.ts +47 -49
- package/src/nile-tooltip/nile-tooltip.ts +37 -0
- package/src/nile-virtual-select/nile-virtual-select.ts +31 -87
- package/src/utilities/visibility-manager.ts +104 -0
- package/vscode-html-custom-data.json +124 -50
- package/dist/assets/nile-elements-4b5c262d.css +0 -1
- package/dist/nile-light-tooltip/index.esm.js +0 -1
- package/dist/nile-light-tooltip/nile-light-tooltip.css.esm.js +0 -6
- package/dist/nile-light-tooltip/nile-light-tooltip.esm.js +0 -1
- package/dist/src/nile-light-tooltip/index.d.ts +0 -1
- package/dist/src/nile-light-tooltip/index.js +0 -2
- package/dist/src/nile-light-tooltip/index.js.map +0 -1
- package/dist/src/nile-light-tooltip/nile-light-tooltip.css.d.ts +0 -12
- package/dist/src/nile-light-tooltip/nile-light-tooltip.css.js +0 -18
- package/dist/src/nile-light-tooltip/nile-light-tooltip.css.js.map +0 -1
- package/dist/src/nile-light-tooltip/nile-light-tooltip.d.ts +0 -40
- package/dist/src/nile-light-tooltip/nile-light-tooltip.js +0 -101
- package/dist/src/nile-light-tooltip/nile-light-tooltip.js.map +0 -1
- package/dist/src/nile-menu/virtual-menu-search-manager.d.ts +0 -11
- package/dist/src/nile-menu/virtual-menu-search-manager.js +0 -43
- package/dist/src/nile-menu/virtual-menu-search-manager.js.map +0 -1
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Manager class for handling bodyAppend functionality in nile-select
|
|
9
|
+
* This class manages moving select options to document.body to avoid CSS clipping issues
|
|
10
|
+
*/
|
|
11
|
+
export class BodyAppendManager {
|
|
12
|
+
constructor(selectElement) {
|
|
13
|
+
this.originalOptions = [];
|
|
14
|
+
this.selectElement = selectElement;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sets the popup and listbox references
|
|
18
|
+
*/
|
|
19
|
+
setReferences(popup, listbox) {
|
|
20
|
+
this.popup = popup;
|
|
21
|
+
this.listbox = listbox;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Handles the bodyAppend change
|
|
25
|
+
*/
|
|
26
|
+
handleBodyAppendChange(bodyAppend) {
|
|
27
|
+
if (bodyAppend) {
|
|
28
|
+
// Initialize body container when bodyAppend becomes true
|
|
29
|
+
this.createBodyContainer();
|
|
30
|
+
// Move options to body immediately
|
|
31
|
+
this.moveOptionsToBody();
|
|
32
|
+
// If no options were found, retry after a short delay
|
|
33
|
+
if (this.getAllOptions().length === 0) {
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
this.moveOptionsToBody();
|
|
36
|
+
}, 100);
|
|
37
|
+
}
|
|
38
|
+
// Listen for popup reposition events
|
|
39
|
+
this.boundHandlePopupReposition = this.handlePopupReposition.bind(this);
|
|
40
|
+
this.popup?.addEventListener('reposition', this.boundHandlePopupReposition);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// Restore options from body when bodyAppend becomes false
|
|
44
|
+
this.restoreOptionsFromBody();
|
|
45
|
+
// Clean up body container when bodyAppend becomes false
|
|
46
|
+
this.cleanupBodyContainer();
|
|
47
|
+
// Remove popup reposition listener
|
|
48
|
+
if (this.boundHandlePopupReposition) {
|
|
49
|
+
this.popup?.removeEventListener('reposition', this.boundHandlePopupReposition);
|
|
50
|
+
this.boundHandlePopupReposition = undefined;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Handles popup reposition events to update body container position
|
|
56
|
+
*/
|
|
57
|
+
handlePopupReposition() {
|
|
58
|
+
if (this.bodyContainer && this.selectElement.open) {
|
|
59
|
+
this.updateBodyContainerVisibility(true);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Extracts styles as CSS string from various style formats
|
|
64
|
+
*/
|
|
65
|
+
extractStylesAsCSS(styles) {
|
|
66
|
+
if (typeof styles === 'string') {
|
|
67
|
+
return styles;
|
|
68
|
+
}
|
|
69
|
+
if (Array.isArray(styles)) {
|
|
70
|
+
return styles.map(style => this.extractStylesAsCSS(style)).join('\n');
|
|
71
|
+
}
|
|
72
|
+
if (styles && typeof styles === 'object' && styles.cssText) {
|
|
73
|
+
return styles.cssText;
|
|
74
|
+
}
|
|
75
|
+
return '';
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Injects component styles into document head
|
|
79
|
+
*/
|
|
80
|
+
injectStylesToDocument() {
|
|
81
|
+
if (!this.bodyContainer)
|
|
82
|
+
return;
|
|
83
|
+
// Create a unique identifier for this component instance
|
|
84
|
+
this.injectedStyleId = `nile-select-body-append-styles-${Math.random().toString(36).substring(2, 11)}`;
|
|
85
|
+
// Check if styles are already injected
|
|
86
|
+
if (document.getElementById(this.injectedStyleId))
|
|
87
|
+
return;
|
|
88
|
+
// Get the component's styles
|
|
89
|
+
const componentStyles = this.selectElement.constructor.styles;
|
|
90
|
+
if (!componentStyles)
|
|
91
|
+
return;
|
|
92
|
+
// Create a style element
|
|
93
|
+
const styleElement = document.createElement('style');
|
|
94
|
+
styleElement.id = this.injectedStyleId;
|
|
95
|
+
styleElement.textContent = this.extractStylesAsCSS(componentStyles);
|
|
96
|
+
// Inject into document head
|
|
97
|
+
document.head.appendChild(styleElement);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Adopts component styles to the body container (similar to portal-manager pattern)
|
|
101
|
+
*/
|
|
102
|
+
adoptStylesToBodyContainer(listboxContainer) {
|
|
103
|
+
if (!this.bodyContainer)
|
|
104
|
+
return;
|
|
105
|
+
// Inject styles to document head first
|
|
106
|
+
this.injectStylesToDocument();
|
|
107
|
+
// Apply basic styling to match the original listbox
|
|
108
|
+
if (this.listbox) {
|
|
109
|
+
const computedStyle = window.getComputedStyle(this.listbox);
|
|
110
|
+
listboxContainer.style.backgroundColor = computedStyle.backgroundColor;
|
|
111
|
+
listboxContainer.style.border = computedStyle.border;
|
|
112
|
+
listboxContainer.style.borderRadius = computedStyle.borderRadius;
|
|
113
|
+
listboxContainer.style.boxShadow = computedStyle.boxShadow;
|
|
114
|
+
listboxContainer.style.maxHeight = computedStyle.maxHeight;
|
|
115
|
+
listboxContainer.style.overflow = computedStyle.overflow;
|
|
116
|
+
listboxContainer.style.padding = computedStyle.padding;
|
|
117
|
+
listboxContainer.style.margin = computedStyle.margin;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Creates a body container for options when bodyAppend is true
|
|
122
|
+
*/
|
|
123
|
+
createBodyContainer() {
|
|
124
|
+
if (this.bodyContainer) {
|
|
125
|
+
return this.bodyContainer;
|
|
126
|
+
}
|
|
127
|
+
this.bodyContainer = document.createElement('div');
|
|
128
|
+
this.bodyContainer.style.position = 'fixed';
|
|
129
|
+
this.bodyContainer.style.zIndex = '9999';
|
|
130
|
+
this.bodyContainer.style.pointerEvents = 'none';
|
|
131
|
+
this.bodyContainer.style.visibility = 'hidden';
|
|
132
|
+
this.bodyContainer.style.overflow = 'hidden';
|
|
133
|
+
// Create the listbox container inside the body container
|
|
134
|
+
const listboxContainer = document.createElement('div');
|
|
135
|
+
listboxContainer.id = 'listbox';
|
|
136
|
+
listboxContainer.setAttribute('role', 'listbox');
|
|
137
|
+
listboxContainer.className = 'select__listbox';
|
|
138
|
+
listboxContainer.setAttribute('aria-expanded', 'false');
|
|
139
|
+
listboxContainer.setAttribute('aria-multiselectable', 'false');
|
|
140
|
+
listboxContainer.setAttribute('aria-labelledby', 'label');
|
|
141
|
+
listboxContainer.setAttribute('tabindex', '-1');
|
|
142
|
+
// Adopt styles to the listbox container (similar to portal-manager pattern)
|
|
143
|
+
this.adoptStylesToBodyContainer(listboxContainer);
|
|
144
|
+
// Append the listbox container to the body container
|
|
145
|
+
this.bodyContainer.appendChild(listboxContainer);
|
|
146
|
+
// Inject component styles to document head
|
|
147
|
+
this.injectStylesToDocument();
|
|
148
|
+
document.body.appendChild(this.bodyContainer);
|
|
149
|
+
return this.bodyContainer;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Cleans up the body container
|
|
153
|
+
*/
|
|
154
|
+
cleanupBodyContainer() {
|
|
155
|
+
if (this.bodyContainer && this.bodyContainer.parentNode) {
|
|
156
|
+
this.bodyContainer.parentNode.removeChild(this.bodyContainer);
|
|
157
|
+
this.bodyContainer = undefined;
|
|
158
|
+
}
|
|
159
|
+
// Clean up injected styles
|
|
160
|
+
if (this.injectedStyleId) {
|
|
161
|
+
const styleElement = document.getElementById(this.injectedStyleId);
|
|
162
|
+
if (styleElement) {
|
|
163
|
+
styleElement.remove();
|
|
164
|
+
}
|
|
165
|
+
this.injectedStyleId = undefined;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Moves options to body container when bodyAppend is true
|
|
170
|
+
*/
|
|
171
|
+
moveOptionsToBody() {
|
|
172
|
+
const container = this.createBodyContainer();
|
|
173
|
+
const listboxContainer = container.querySelector('#listbox');
|
|
174
|
+
const allOptions = this.getAllOptions();
|
|
175
|
+
// Only proceed if we have options to move and listbox container exists
|
|
176
|
+
if (allOptions.length === 0 || !listboxContainer) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
// Store original options for restoration
|
|
180
|
+
this.originalOptions = [...allOptions];
|
|
181
|
+
// Move options to listbox container inside body container
|
|
182
|
+
allOptions.forEach(option => {
|
|
183
|
+
if (option.parentNode) {
|
|
184
|
+
option.parentNode.removeChild(option);
|
|
185
|
+
}
|
|
186
|
+
listboxContainer.appendChild(option);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Restores options to their original position
|
|
191
|
+
*/
|
|
192
|
+
restoreOptionsFromBody() {
|
|
193
|
+
if (!this.bodyContainer) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const allOptions = this.getAllOptions();
|
|
197
|
+
// Move options back to their original position
|
|
198
|
+
allOptions.forEach(option => {
|
|
199
|
+
if (option.parentNode) {
|
|
200
|
+
option.parentNode.removeChild(option);
|
|
201
|
+
}
|
|
202
|
+
// Insert back into the slot
|
|
203
|
+
this.selectElement.appendChild(option);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Updates body container visibility and positioning
|
|
208
|
+
*/
|
|
209
|
+
updateBodyContainerVisibility(visible) {
|
|
210
|
+
if (!this.bodyContainer) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if (visible) {
|
|
214
|
+
this.bodyContainer.style.visibility = 'visible';
|
|
215
|
+
this.bodyContainer.style.pointerEvents = 'auto';
|
|
216
|
+
// Position the container relative to the popup
|
|
217
|
+
if (this.popup && this.popup.popup) {
|
|
218
|
+
const popupRect = this.popup.popup.getBoundingClientRect();
|
|
219
|
+
this.bodyContainer.style.left = `${popupRect.left}px`;
|
|
220
|
+
this.bodyContainer.style.top = `${popupRect.top}px`;
|
|
221
|
+
this.bodyContainer.style.width = `${popupRect.width}px`;
|
|
222
|
+
this.bodyContainer.style.height = `${popupRect.height}px`;
|
|
223
|
+
// Update styles to match the popup
|
|
224
|
+
const computedStyle = window.getComputedStyle(this.popup.popup);
|
|
225
|
+
this.bodyContainer.style.backgroundColor = computedStyle.backgroundColor;
|
|
226
|
+
this.bodyContainer.style.border = computedStyle.border;
|
|
227
|
+
this.bodyContainer.style.borderRadius = computedStyle.borderRadius;
|
|
228
|
+
this.bodyContainer.style.boxShadow = computedStyle.boxShadow;
|
|
229
|
+
this.bodyContainer.style.maxHeight = computedStyle.maxHeight;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
this.bodyContainer.style.visibility = 'hidden';
|
|
234
|
+
this.bodyContainer.style.pointerEvents = 'none';
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Gets all options from both original location and body container
|
|
239
|
+
*/
|
|
240
|
+
getAllOptions() {
|
|
241
|
+
let options;
|
|
242
|
+
// Always get options from the original location first
|
|
243
|
+
options = [...this.selectElement.querySelectorAll('nile-option')];
|
|
244
|
+
// If no options found in original location and bodyAppend is true, check listbox container
|
|
245
|
+
if (options.length === 0 && this.bodyContainer) {
|
|
246
|
+
const listboxContainer = this.bodyContainer.querySelector('#listbox');
|
|
247
|
+
if (listboxContainer) {
|
|
248
|
+
options = [...listboxContainer.querySelectorAll('nile-option')];
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return options;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Updates body container visibility when select opens/closes
|
|
255
|
+
*/
|
|
256
|
+
updateVisibility(visible) {
|
|
257
|
+
this.updateBodyContainerVisibility(visible);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Checks if bodyAppend is active (has body container)
|
|
261
|
+
*/
|
|
262
|
+
isActive() {
|
|
263
|
+
return !!this.bodyContainer;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Gets the body container element
|
|
267
|
+
*/
|
|
268
|
+
getBodyContainer() {
|
|
269
|
+
return this.bodyContainer;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Gets the listbox container element inside the body container
|
|
273
|
+
*/
|
|
274
|
+
getListboxContainer() {
|
|
275
|
+
return this.bodyContainer?.querySelector('#listbox');
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Cleans up all resources
|
|
279
|
+
*/
|
|
280
|
+
destroy() {
|
|
281
|
+
// Clean up body container if it exists
|
|
282
|
+
this.cleanupBodyContainer();
|
|
283
|
+
// Clean up event listeners
|
|
284
|
+
if (this.boundHandlePopupReposition) {
|
|
285
|
+
this.popup?.removeEventListener('reposition', this.boundHandlePopupReposition);
|
|
286
|
+
this.boundHandlePopupReposition = undefined;
|
|
287
|
+
}
|
|
288
|
+
// Clean up injected styles
|
|
289
|
+
if (this.injectedStyleId) {
|
|
290
|
+
const styleElement = document.getElementById(this.injectedStyleId);
|
|
291
|
+
if (styleElement) {
|
|
292
|
+
styleElement.remove();
|
|
293
|
+
}
|
|
294
|
+
this.injectedStyleId = undefined;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=body-append-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body-append-manager.js","sourceRoot":"","sources":["../../../src/nile-select/body-append-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAS5B,YAAY,aAAyB;QAP7B,oBAAe,GAAiB,EAAE,CAAC;QAQzC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,KAAgB,EAAE,OAAwB;QACtD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,UAAmB;QACxC,IAAI,UAAU,EAAE,CAAC;YACf,yDAAyD;YACzD,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC3B,mCAAmC;YACnC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACzB,sDAAsD;YACtD,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtC,UAAU,CAAC,GAAG,EAAE;oBACd,IAAI,CAAC,iBAAiB,EAAE,CAAC;gBAC3B,CAAC,EAAE,GAAG,CAAC,CAAC;YACV,CAAC;YACD,qCAAqC;YACrC,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxE,IAAI,CAAC,KAAK,EAAE,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC;QAC9E,CAAC;aAAM,CAAC;YACN,0DAA0D;YAC1D,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC9B,wDAAwD;YACxD,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC5B,mCAAmC;YACnC,IAAI,IAAI,CAAC,0BAA0B,EAAE,CAAC;gBACpC,IAA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AAC,CAAC;YAC9E,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,OAAgB;QAC/B,IAAI,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,OAAO,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,UAAU,CAA4B,CAAC;IAClF,CAAC;IAED;;OAEG;IACH,OAAO;QACL,uCAAuC;QACvC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,2BAA2B;QAC3B,IAAI,IAAI,CAAC,0BAA0B,EAAE,CAAC;YACpC,IAAI,CAAC,KAAK,EAAE,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC;YAC/E,IAAI,CAAC,0BAA0B,GAAG,SAAS,CAAC;QAC9C,CAAC;QACD,2BAA2B;QAC3B,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,MAAM,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACnE,IAAI,YAAY,EAAE,CAAC;gBACjB,YAAY,CAAC,MAAM,EAAE,CAAC;YACxB,CAAC;YACD,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACnC,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type NileOption from '../nile-option/nile-option';\nimport type NilePopup from '../nile-popup/nile-popup';\nimport type NileSelect from './nile-select';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * Manager class for handling bodyAppend functionality in nile-select\n * This class manages moving select options to document.body to avoid CSS clipping issues\n */\nexport class BodyAppendManager {\n private bodyContainer?: HTMLElement;\n private originalOptions: NileOption[] = [];\n private boundHandlePopupReposition?: () => void;\n private selectElement: NileSelect;\n private popup?: NilePopup;\n private listbox?: HTMLSlotElement;\n private injectedStyleId?: string;\n\n constructor(selectElement: NileSelect) {\n this.selectElement = selectElement;\n }\n\n /**\n * Sets the popup and listbox references\n */\n setReferences(popup: NilePopup, listbox: HTMLSlotElement): void {\n this.popup = popup;\n this.listbox = listbox;\n }\n\n /**\n * Handles the bodyAppend change\n */\n handleBodyAppendChange(bodyAppend: boolean): void {\n if (bodyAppend) {\n // Initialize body container when bodyAppend becomes true\n this.createBodyContainer();\n // Move options to body immediately\n this.moveOptionsToBody();\n // If no options were found, retry after a short delay\n if (this.getAllOptions().length === 0) {\n setTimeout(() => {\n this.moveOptionsToBody();\n }, 100);\n }\n // Listen for popup reposition events\n this.boundHandlePopupReposition = this.handlePopupReposition.bind(this);\n this.popup?.addEventListener('reposition', this.boundHandlePopupReposition);\n } else {\n // Restore options from body when bodyAppend becomes false\n this.restoreOptionsFromBody();\n // Clean up body container when bodyAppend becomes false\n this.cleanupBodyContainer();\n // Remove popup reposition listener\n if (this.boundHandlePopupReposition) {\n this.popup?.removeEventListener('reposition', this.boundHandlePopupReposition);\n this.boundHandlePopupReposition = undefined;\n }\n }\n }\n\n /**\n * Handles popup reposition events to update body container position\n */\n private handlePopupReposition(): void {\n if (this.bodyContainer && this.selectElement.open) {\n this.updateBodyContainerVisibility(true);\n }\n }\n\n /**\n * Extracts styles as CSS string from various style formats\n */\n private extractStylesAsCSS(styles: any): string {\n if (typeof styles === 'string') {\n return styles;\n }\n \n if (Array.isArray(styles)) {\n return styles.map(style => this.extractStylesAsCSS(style)).join('\\n');\n }\n \n if (styles && typeof styles === 'object' && styles.cssText) {\n return styles.cssText;\n }\n \n return '';\n }\n\n /**\n * Injects component styles into document head\n */\n private injectStylesToDocument(): void {\n if (!this.bodyContainer) return;\n\n // Create a unique identifier for this component instance\n this.injectedStyleId = `nile-select-body-append-styles-${Math.random().toString(36).substring(2, 11)}`;\n \n // Check if styles are already injected\n if (document.getElementById(this.injectedStyleId)) return;\n\n // Get the component's styles\n const componentStyles = (this.selectElement.constructor as any).styles;\n if (!componentStyles) return;\n\n // Create a style element\n const styleElement = document.createElement('style');\n styleElement.id = this.injectedStyleId;\n styleElement.textContent = this.extractStylesAsCSS(componentStyles);\n \n // Inject into document head\n document.head.appendChild(styleElement);\n }\n\n /**\n * Adopts component styles to the body container (similar to portal-manager pattern)\n */\n private adoptStylesToBodyContainer(listboxContainer: HTMLElement): void {\n if (!this.bodyContainer) return;\n \n // Inject styles to document head first\n this.injectStylesToDocument();\n \n // Apply basic styling to match the original listbox\n if (this.listbox) {\n const computedStyle = window.getComputedStyle(this.listbox);\n listboxContainer.style.backgroundColor = computedStyle.backgroundColor;\n listboxContainer.style.border = computedStyle.border;\n listboxContainer.style.borderRadius = computedStyle.borderRadius;\n listboxContainer.style.boxShadow = computedStyle.boxShadow;\n listboxContainer.style.maxHeight = computedStyle.maxHeight;\n listboxContainer.style.overflow = computedStyle.overflow;\n listboxContainer.style.padding = computedStyle.padding;\n listboxContainer.style.margin = computedStyle.margin;\n }\n }\n\n /**\n * Creates a body container for options when bodyAppend is true\n */\n private createBodyContainer(): HTMLElement {\n if (this.bodyContainer) {\n return this.bodyContainer;\n }\n\n this.bodyContainer = document.createElement('div');\n this.bodyContainer.style.position = 'fixed';\n this.bodyContainer.style.zIndex = '9999';\n this.bodyContainer.style.pointerEvents = 'none';\n this.bodyContainer.style.visibility = 'hidden';\n this.bodyContainer.style.overflow = 'hidden';\n \n // Create the listbox container inside the body container\n const listboxContainer = document.createElement('div');\n listboxContainer.id = 'listbox';\n listboxContainer.setAttribute('role', 'listbox');\n listboxContainer.className = 'select__listbox';\n listboxContainer.setAttribute('aria-expanded', 'false');\n listboxContainer.setAttribute('aria-multiselectable', 'false');\n listboxContainer.setAttribute('aria-labelledby', 'label');\n listboxContainer.setAttribute('tabindex', '-1');\n \n // Adopt styles to the listbox container (similar to portal-manager pattern)\n this.adoptStylesToBodyContainer(listboxContainer);\n \n // Append the listbox container to the body container\n this.bodyContainer.appendChild(listboxContainer);\n \n // Inject component styles to document head\n this.injectStylesToDocument();\n \n document.body.appendChild(this.bodyContainer);\n \n return this.bodyContainer;\n }\n\n /**\n * Cleans up the body container\n */\n private cleanupBodyContainer(): void {\n if (this.bodyContainer && this.bodyContainer.parentNode) {\n this.bodyContainer.parentNode.removeChild(this.bodyContainer);\n this.bodyContainer = undefined;\n }\n \n // Clean up injected styles\n if (this.injectedStyleId) {\n const styleElement = document.getElementById(this.injectedStyleId);\n if (styleElement) {\n styleElement.remove();\n }\n this.injectedStyleId = undefined;\n }\n }\n\n /**\n * Moves options to body container when bodyAppend is true\n */\n private moveOptionsToBody(): void {\n const container = this.createBodyContainer();\n const listboxContainer = container.querySelector('#listbox') as HTMLElement;\n const allOptions = this.getAllOptions();\n \n // Only proceed if we have options to move and listbox container exists\n if (allOptions.length === 0 || !listboxContainer) {\n return;\n }\n \n // Store original options for restoration\n this.originalOptions = [...allOptions];\n \n // Move options to listbox container inside body container\n allOptions.forEach(option => {\n if (option.parentNode) {\n option.parentNode.removeChild(option);\n }\n listboxContainer.appendChild(option);\n });\n }\n\n /**\n * Restores options to their original position\n */\n private restoreOptionsFromBody(): void {\n if (!this.bodyContainer) {\n return;\n }\n\n const allOptions = this.getAllOptions();\n \n // Move options back to their original position\n allOptions.forEach(option => {\n if (option.parentNode) {\n option.parentNode.removeChild(option);\n }\n // Insert back into the slot\n this.selectElement.appendChild(option);\n });\n }\n\n /**\n * Updates body container visibility and positioning\n */\n private updateBodyContainerVisibility(visible: boolean): void {\n if (!this.bodyContainer) {\n return;\n }\n\n if (visible) {\n this.bodyContainer.style.visibility = 'visible';\n this.bodyContainer.style.pointerEvents = 'auto';\n \n // Position the container relative to the popup\n if (this.popup && this.popup.popup) {\n const popupRect = this.popup.popup.getBoundingClientRect();\n this.bodyContainer.style.left = `${popupRect.left}px`;\n this.bodyContainer.style.top = `${popupRect.top}px`;\n this.bodyContainer.style.width = `${popupRect.width}px`;\n this.bodyContainer.style.height = `${popupRect.height}px`;\n \n // Update styles to match the popup\n const computedStyle = window.getComputedStyle(this.popup.popup);\n this.bodyContainer.style.backgroundColor = computedStyle.backgroundColor;\n this.bodyContainer.style.border = computedStyle.border;\n this.bodyContainer.style.borderRadius = computedStyle.borderRadius;\n this.bodyContainer.style.boxShadow = computedStyle.boxShadow;\n this.bodyContainer.style.maxHeight = computedStyle.maxHeight;\n }\n } else {\n this.bodyContainer.style.visibility = 'hidden';\n this.bodyContainer.style.pointerEvents = 'none';\n }\n }\n\n /**\n * Gets all options from both original location and body container\n */\n private getAllOptions(): NileOption[] {\n let options: NileOption[];\n \n // Always get options from the original location first\n options = [...this.selectElement.querySelectorAll<NileOption>('nile-option')];\n \n // If no options found in original location and bodyAppend is true, check listbox container\n if (options.length === 0 && this.bodyContainer) {\n const listboxContainer = this.bodyContainer.querySelector('#listbox');\n if (listboxContainer) {\n options = [...listboxContainer.querySelectorAll<NileOption>('nile-option')];\n }\n }\n\n return options;\n }\n\n /**\n * Updates body container visibility when select opens/closes\n */\n updateVisibility(visible: boolean): void {\n this.updateBodyContainerVisibility(visible);\n }\n\n /**\n * Checks if bodyAppend is active (has body container)\n */\n isActive(): boolean {\n return !!this.bodyContainer;\n }\n\n /**\n * Gets the body container element\n */\n getBodyContainer(): HTMLElement | undefined {\n return this.bodyContainer;\n }\n\n /**\n * Gets the listbox container element inside the body container\n */\n getListboxContainer(): HTMLElement | undefined {\n return this.bodyContainer?.querySelector('#listbox') as HTMLElement | undefined;\n }\n\n /**\n * Cleans up all resources\n */\n destroy(): void {\n // Clean up body container if it exists\n this.cleanupBodyContainer();\n // Clean up event listeners\n if (this.boundHandlePopupReposition) {\n this.popup?.removeEventListener('reposition', this.boundHandlePopupReposition);\n this.boundHandlePopupReposition = undefined;\n }\n // Clean up injected styles\n if (this.injectedStyleId) {\n const styleElement = document.getElementById(this.injectedStyleId);\n if (styleElement) {\n styleElement.remove();\n }\n this.injectedStyleId = undefined;\n }\n }\n}\n"]}
|
|
@@ -81,6 +81,7 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
|
81
81
|
private scrolling;
|
|
82
82
|
private options;
|
|
83
83
|
private resizeController?;
|
|
84
|
+
private visibilityManager?;
|
|
84
85
|
popup: NilePopup;
|
|
85
86
|
combobox: HTMLSlotElement;
|
|
86
87
|
displayInput: HTMLInputElement;
|
|
@@ -199,11 +200,6 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
|
199
200
|
private handleFocus;
|
|
200
201
|
private handleBlur;
|
|
201
202
|
private handleDocumentFocusIn;
|
|
202
|
-
private anchorVisibilityObservers;
|
|
203
|
-
private getScrollableAncestors;
|
|
204
|
-
private handleDocumentVisibilityChange;
|
|
205
|
-
private setupAnchorVisibilityObserver;
|
|
206
|
-
private cleanupAnchorVisibilityObserver;
|
|
207
203
|
/**
|
|
208
204
|
* Handles the click event on the footer.
|
|
209
205
|
* @param event - The click event.
|
|
@@ -28,6 +28,7 @@ import '../nile-virtual-select/nile-virtual-select';
|
|
|
28
28
|
import { VirtualScrollHelper } from './virtual-scroll-helper';
|
|
29
29
|
import { ResizeController } from '@lit-labs/observers/resize-controller.js';
|
|
30
30
|
import { PortalManager } from './portal-manager';
|
|
31
|
+
import { VisibilityManager } from '../utilities/visibility-manager';
|
|
31
32
|
/**
|
|
32
33
|
* Nile icon component.
|
|
33
34
|
*
|
|
@@ -193,19 +194,6 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
193
194
|
this.autoFocusSearch = false;
|
|
194
195
|
/** loading indicator for virtual select */
|
|
195
196
|
this.loading = false;
|
|
196
|
-
this.anchorVisibilityObservers = [];
|
|
197
|
-
this.handleDocumentVisibilityChange = () => {
|
|
198
|
-
if (!this.enableTabClose)
|
|
199
|
-
return;
|
|
200
|
-
if (document.visibilityState === 'hidden' && this.open) {
|
|
201
|
-
this.hide();
|
|
202
|
-
this.emit('nile-visibility-change', {
|
|
203
|
-
visible: false,
|
|
204
|
-
reason: 'document-hidden',
|
|
205
|
-
name: this.name,
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
197
|
this.handleWindowResize = () => {
|
|
210
198
|
this.portalManager.updatePortalAppendPosition();
|
|
211
199
|
};
|
|
@@ -237,6 +225,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
237
225
|
clearTimeout(this.scrollTimeout);
|
|
238
226
|
this.scrollTimeout = undefined;
|
|
239
227
|
}
|
|
228
|
+
this.visibilityManager?.cleanup();
|
|
240
229
|
// Clean up body append elements
|
|
241
230
|
this.portalManager.cleanupPortalAppend();
|
|
242
231
|
this.emit('nile-destroy');
|
|
@@ -272,6 +261,30 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
272
261
|
if (_changedProperties.has('multiple')) {
|
|
273
262
|
this.setCheckBoxInOption(this.multiple);
|
|
274
263
|
}
|
|
264
|
+
this.visibilityManager = new VisibilityManager({
|
|
265
|
+
host: this,
|
|
266
|
+
target: this.combobox,
|
|
267
|
+
enableVisibilityEffect: this.enableVisibilityEffect,
|
|
268
|
+
enableTabClose: this.enableTabClose,
|
|
269
|
+
isOpen: () => this.open,
|
|
270
|
+
onAnchorOutOfView: () => {
|
|
271
|
+
this.hide();
|
|
272
|
+
this.emit('nile-visibility-change', {
|
|
273
|
+
visible: false,
|
|
274
|
+
reason: 'anchor-out-of-view',
|
|
275
|
+
name: this.name,
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
onDocumentHidden: () => {
|
|
279
|
+
this.hide();
|
|
280
|
+
this.emit('nile-visibility-change', {
|
|
281
|
+
visible: false,
|
|
282
|
+
reason: 'document-hidden',
|
|
283
|
+
name: this.name,
|
|
284
|
+
});
|
|
285
|
+
},
|
|
286
|
+
emit: (event, detail) => this.emit(`nile-${event}`, detail),
|
|
287
|
+
});
|
|
275
288
|
}
|
|
276
289
|
setCheckBoxInOption(checked) {
|
|
277
290
|
if (!this.options.length) {
|
|
@@ -317,57 +330,6 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
317
330
|
this.hide();
|
|
318
331
|
}
|
|
319
332
|
}
|
|
320
|
-
getScrollableAncestors(element) {
|
|
321
|
-
const scrollables = [];
|
|
322
|
-
let parent = element.parentElement;
|
|
323
|
-
while (parent) {
|
|
324
|
-
const style = getComputedStyle(parent);
|
|
325
|
-
const canScroll = /(auto|scroll)/.test(style.overflow + style.overflowY + style.overflowX);
|
|
326
|
-
if (canScroll) {
|
|
327
|
-
scrollables.push(parent);
|
|
328
|
-
}
|
|
329
|
-
parent = parent.parentElement;
|
|
330
|
-
}
|
|
331
|
-
return scrollables;
|
|
332
|
-
}
|
|
333
|
-
setupAnchorVisibilityObserver() {
|
|
334
|
-
if (!this.enableVisibilityEffect)
|
|
335
|
-
return;
|
|
336
|
-
this.cleanupAnchorVisibilityObserver();
|
|
337
|
-
const combobox = this.combobox;
|
|
338
|
-
if (!combobox)
|
|
339
|
-
return;
|
|
340
|
-
const scrollContainers = [...this.getScrollableAncestors(this), null];
|
|
341
|
-
scrollContainers.forEach((rootContainer) => {
|
|
342
|
-
const observer = new IntersectionObserver((entries) => {
|
|
343
|
-
for (const entry of entries) {
|
|
344
|
-
if (!entry.isIntersecting && this.open) {
|
|
345
|
-
this.hide();
|
|
346
|
-
this.emit('nile-visibility-change', {
|
|
347
|
-
visible: false,
|
|
348
|
-
reason: 'anchor-out-of-view',
|
|
349
|
-
name: this.name,
|
|
350
|
-
root: rootContainer,
|
|
351
|
-
});
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}, {
|
|
356
|
-
root: rootContainer,
|
|
357
|
-
threshold: 0.1,
|
|
358
|
-
});
|
|
359
|
-
observer.observe(combobox);
|
|
360
|
-
this.anchorVisibilityObservers.push(observer);
|
|
361
|
-
});
|
|
362
|
-
if (this.enableTabClose) {
|
|
363
|
-
document.addEventListener('visibilitychange', this.handleDocumentVisibilityChange);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
cleanupAnchorVisibilityObserver() {
|
|
367
|
-
this.anchorVisibilityObservers.forEach((o) => o.disconnect());
|
|
368
|
-
this.anchorVisibilityObservers = [];
|
|
369
|
-
document.removeEventListener('visibilitychange', this.handleDocumentVisibilityChange);
|
|
370
|
-
}
|
|
371
333
|
/**
|
|
372
334
|
* Handles the click event on the footer.
|
|
373
335
|
* @param event - The click event.
|
|
@@ -899,6 +861,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
899
861
|
});
|
|
900
862
|
}
|
|
901
863
|
this.addOpenListeners();
|
|
864
|
+
this.visibilityManager?.setup();
|
|
902
865
|
this.showNoResults = !this.getAllOptions()?.length;
|
|
903
866
|
await stopAnimations(this);
|
|
904
867
|
this.listbox.hidden = false;
|
|
@@ -907,9 +870,6 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
907
870
|
requestAnimationFrame(() => {
|
|
908
871
|
this.setCurrentOption(this.currentOption);
|
|
909
872
|
});
|
|
910
|
-
if (this.enableVisibilityEffect) {
|
|
911
|
-
this.setupAnchorVisibilityObserver();
|
|
912
|
-
}
|
|
913
873
|
const { keyframes, options } = getAnimation(this, 'select.show', {
|
|
914
874
|
dir: 'ltr',
|
|
915
875
|
});
|
|
@@ -933,6 +893,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
933
893
|
this.emit('nile-hide', { value: this.value, name: this.name });
|
|
934
894
|
this.showSelected = false;
|
|
935
895
|
this.removeOpenListeners();
|
|
896
|
+
this.visibilityManager?.cleanup();
|
|
936
897
|
await stopAnimations(this);
|
|
937
898
|
const { keyframes, options } = getAnimation(this, 'select.hide', {
|
|
938
899
|
dir: 'ltr',
|