@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
|
@@ -11,6 +11,7 @@ import { styles } from './nile-popover.css';
|
|
|
11
11
|
import NileElement from '../internal/nile-element';
|
|
12
12
|
import { watch } from '../internal/watch';
|
|
13
13
|
import { PopoverPortalManager } from './portal-manager';
|
|
14
|
+
import { VisibilityManager } from '../utilities/visibility-manager.js';
|
|
14
15
|
/**
|
|
15
16
|
* Nile icon component.
|
|
16
17
|
*
|
|
@@ -35,6 +36,8 @@ let NilePopover = class NilePopover extends NileElement {
|
|
|
35
36
|
this.isShow = false;
|
|
36
37
|
this.arrowPlacement = 'anchor';
|
|
37
38
|
this.portalManager = null;
|
|
39
|
+
this.enableVisibilityEffect = false;
|
|
40
|
+
this.enableTabClose = false;
|
|
38
41
|
/**
|
|
39
42
|
* Enable this option to prevent the panel from being clipped when the component is placed inside a container with
|
|
40
43
|
* `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.
|
|
@@ -88,12 +91,40 @@ let NilePopover = class NilePopover extends NileElement {
|
|
|
88
91
|
disconnectedCallback() {
|
|
89
92
|
super.disconnectedCallback();
|
|
90
93
|
this.emit('nile-destroy');
|
|
94
|
+
this.visibilityManager?.cleanup();
|
|
91
95
|
document.removeEventListener('click', this.handleDocumentClick);
|
|
92
96
|
if (this.portalManager) {
|
|
93
97
|
this.portalManager.cleanupPortalAppend();
|
|
94
98
|
this.portalManager = null;
|
|
95
99
|
}
|
|
96
100
|
}
|
|
101
|
+
async firstUpdated(_changed) {
|
|
102
|
+
await this.updateComplete;
|
|
103
|
+
const anchorSlot = this.renderRoot.querySelector('slot[name="anchor"]');
|
|
104
|
+
const anchorEl = anchorSlot?.assignedElements({ flatten: true })[0];
|
|
105
|
+
this.visibilityManager = new VisibilityManager({
|
|
106
|
+
host: this,
|
|
107
|
+
target: anchorEl || null,
|
|
108
|
+
enableVisibilityEffect: this.enableVisibilityEffect,
|
|
109
|
+
enableTabClose: this.enableTabClose,
|
|
110
|
+
isOpen: () => this.isShow,
|
|
111
|
+
onAnchorOutOfView: () => {
|
|
112
|
+
this.isShow = false;
|
|
113
|
+
this.emit('nile-visibility-change', {
|
|
114
|
+
visible: false,
|
|
115
|
+
reason: 'anchor-out-of-view',
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
onDocumentHidden: () => {
|
|
119
|
+
this.isShow = false;
|
|
120
|
+
this.emit('nile-visibility-change', {
|
|
121
|
+
visible: false,
|
|
122
|
+
reason: 'document-hidden',
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
emit: (event, detail) => this.emit(`nile-${event}`, detail),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
97
128
|
updated(_changedProperties) {
|
|
98
129
|
if (_changedProperties.has('open')) {
|
|
99
130
|
this.isShow = this.open;
|
|
@@ -111,6 +142,7 @@ let NilePopover = class NilePopover extends NileElement {
|
|
|
111
142
|
handleShowHide() {
|
|
112
143
|
if (this.isShow) {
|
|
113
144
|
this.emit('nile-show');
|
|
145
|
+
this.visibilityManager?.setup();
|
|
114
146
|
if (this.portal && this.portalManager) {
|
|
115
147
|
this.portalManager.setupPortalAppend();
|
|
116
148
|
}
|
|
@@ -121,6 +153,7 @@ let NilePopover = class NilePopover extends NileElement {
|
|
|
121
153
|
}
|
|
122
154
|
else {
|
|
123
155
|
this.emit('nile-hide');
|
|
156
|
+
this.visibilityManager?.cleanup();
|
|
124
157
|
if (this.portal && this.portalManager) {
|
|
125
158
|
this.portalManager.cleanupPortalAppend();
|
|
126
159
|
}
|
|
@@ -203,6 +236,12 @@ __decorate([
|
|
|
203
236
|
__decorate([
|
|
204
237
|
property({ attribute: 'arrow-placement' })
|
|
205
238
|
], NilePopover.prototype, "arrowPlacement", void 0);
|
|
239
|
+
__decorate([
|
|
240
|
+
property({ type: Boolean, reflect: true })
|
|
241
|
+
], NilePopover.prototype, "enableVisibilityEffect", void 0);
|
|
242
|
+
__decorate([
|
|
243
|
+
property({ type: Boolean, reflect: true })
|
|
244
|
+
], NilePopover.prototype, "enableTabClose", void 0);
|
|
206
245
|
__decorate([
|
|
207
246
|
property({ type: Boolean })
|
|
208
247
|
], NilePopover.prototype, "hoist", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-popover.js","sourceRoot":"","sources":["../../../src/nile-popover/nile-popover.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,GAIL,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;;GAKG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAArC;;QASL;;;WAGG;QACS,cAAS,GAYJ,KA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E,OAAO,EAAE,CAAC;0CAAe;AAMd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAgB;AAEf;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAAc;AAkD1C;IADC,KAAK,CAAC,QAAQ,CAAC;iDAgBf;AA9HU,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA4MvB;;AAED,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit-element';\nimport { customElement,property, state } from 'lit/decorators.js';\nimport { styles } from './nile-popover.css';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\nimport { CSSResultGroup } from 'lit';\nimport { PopoverPortalManager } from './portal-manager';\n\n/**\n * Nile icon component.\n *\n * @tag nile-popover\n *\n */\n@customElement('nile-popover')\nexport class NilePopover extends NileElement {\n /**\n * The styles for Popover\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultGroup {\n return [styles];\n }\n\n /**\n * The preferred placement of the popover. Note that the actual placement may vary as needed to keep the tooltip\n * inside of the viewport.\n */\n @property() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** The distance in pixels from which to offset the popover away from its target. */\n @property({ type: Number }) distance = 18;\n\n @property({ type: Boolean, reflect: true }) preventOverlayClose = false;\n\n @property({ type: Boolean, attribute: 'arrow' }) arrow = true;\n\n /** Gives the title to the popover */\n @property({ type: String }) title = '';\n\n @property({type:Boolean }) open = false;\n\n @state() isShow:boolean = false;\n\n @property({ attribute: 'arrow-placement' }) arrowPlacement:\n | 'start'\n | 'end'\n | 'center'\n | 'anchor' = 'anchor';\n\n private portalManager: PopoverPortalManager | null = null;\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n /**\n * Enable portal mode to render the popover content in a portal outside the component's DOM tree.\n * This provides better positioning control and prevents clipping issues in complex layouts.\n */\n @property({ type: Boolean }) portal = false;\n\n @property({ type: Boolean }) flip = false;\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n connectedCallback() {\n super.connectedCallback();\n this.emit('nile-init');\n document.addEventListener('click', this.handleDocumentClick);\n \n requestAnimationFrame(() => {\n if (this.portal && !this.portalManager) {\n this.portalManager = new PopoverPortalManager(this);\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n document.removeEventListener('click', this.handleDocumentClick);\n \n if (this.portalManager) {\n this.portalManager.cleanupPortalAppend();\n this.portalManager = null;\n }\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('open')) {\n this.isShow = this.open;\n }\n \n if (_changedProperties.has('portal')) {\n if (this.portal && !this.portalManager) {\n this.portalManager = new PopoverPortalManager(this);\n } else if (!this.portal && this.portalManager) {\n this.portalManager.cleanupPortalAppend();\n this.portalManager = null;\n }\n }\n }\n\n @watch('isShow')\n handleShowHide() {\n if (this.isShow) {\n this.emit('nile-show');\n if (this.portal && this.portalManager) {\n this.portalManager.setupPortalAppend();\n } else if (this.portal && !this.portalManager) {\n this.portalManager = new PopoverPortalManager(this);\n this.portalManager.setupPortalAppend();\n }\n } else {\n this.emit('nile-hide');\n if (this.portal && this.portalManager) {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n public render(): TemplateResult {\n const shouldRenderContent = this.isShow && !(this.portal && this.portalManager);\n \n return html`\n <nile-popup\n active\n .arrow=\"${this.arrow && this.isShow && !this.portal}\"\n distance=\"${this.distance}\"\n placement=\"${this.placement}\"\n @click=${(e: Event) => e.stopPropagation()}\n arrowPlacement=\"${this.arrowPlacement}\"\n .flip=\"${this.flip}\"\n shift\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n >\n <slot\n slot=\"anchor\"\n name=\"anchor\"\n aria-describedby=\"tooltip\"\n @click=${this.handleClick}\n ></slot>\n ${shouldRenderContent\n ? html` <div part=\"popover\" class=\"popover__box\">\n <slot name=\"title\" class=\"popover__title\">${this.title}</slot>\n <slot part=\"base\"></slot>\n <slot name=\"action\" class=\"popover__action\"> </slot>\n </div>`\n : html``}\n </nile-popup>\n `;\n }\n\n private handleClick = () => {\n this.isShow = !this.isShow;\n const allPopovers = document.querySelectorAll('nile-popover');\n\n allPopovers.forEach(popover => {\n if (popover !== this) {\n popover.isShow = false;\n }\n });\n };\n\n private handleDocumentClick = () => {\n if (this.isShow && !this.preventOverlayClose) {\n this.isShow = false;\n }\n };\n\n public updatePortalContent(): void {\n if (this.portalManager) {\n this.portalManager.updatePortalAppendPosition();\n }\n }\n\n public forceReposition(): void {\n if (this.portalManager) {\n this.portalManager.forceReposition();\n }\n }\n\n public getCurrentPlacement(): string {\n if (this.portalManager) {\n return this.portalManager.getCurrentPlacement();\n }\n return this.placement;\n }\n\n public isPositioningOptimal(): boolean {\n if (this.portalManager) {\n return this.portalManager.isPositioningOptimal();\n }\n return true;\n }\n\n /* #endregion */\n}\n\nexport default NilePopover;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-popover': NilePopover;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nile-popover.js","sourceRoot":"","sources":["../../../src/nile-popover/nile-popover.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,GAIL,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAM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O,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wDAA6B;AAEvB;IAAhD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;0CAAc;AAGlC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAY;AAEZ;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAC,OAAO,EAAE,CAAC;yCAAc;AAE/B;IAAR,KAAK,EAAE;2CAAwB;AAEY;IAA3C,QAAQ,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;mDAInB;AAKoB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2DAAgC;AAE/B;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAwB;AAOtC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAAe;AAMd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAgB;AAEf;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAAc;AAmF1C;IADC,KAAK,CAAC,QAAQ,CAAC;iDAkBf;AAvKU,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAqPvB;;AAED,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit-element';\nimport { customElement,property, state } from 'lit/decorators.js';\nimport { styles } from './nile-popover.css';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\nimport { CSSResultGroup } from 'lit';\nimport { PopoverPortalManager } from './portal-manager';\nimport { VisibilityManager } from '../utilities/visibility-manager.js';\n\n\n/**\n * Nile icon component.\n *\n * @tag nile-popover\n *\n */\n@customElement('nile-popover')\nexport class NilePopover extends NileElement {\n /**\n * The styles for Popover\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultGroup {\n return [styles];\n }\n\n /**\n * The preferred placement of the popover. Note that the actual placement may vary as needed to keep the tooltip\n * inside of the viewport.\n */\n @property() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** The distance in pixels from which to offset the popover away from its target. */\n @property({ type: Number }) distance = 18;\n\n @property({ type: Boolean, reflect: true }) preventOverlayClose = false;\n\n @property({ type: Boolean, attribute: 'arrow' }) arrow = true;\n\n /** Gives the title to the popover */\n @property({ type: String }) title = '';\n\n @property({type:Boolean }) open = false;\n\n @state() isShow:boolean = false;\n\n @property({ attribute: 'arrow-placement' }) arrowPlacement:\n | 'start'\n | 'end'\n | 'center'\n | 'anchor' = 'anchor';\n\n private portalManager: PopoverPortalManager | null = null;\n private visibilityManager?: VisibilityManager;\n\n @property({ type: Boolean, reflect: true }) enableVisibilityEffect = false;\n\n @property({ type: Boolean, reflect: true }) enableTabClose = false;\n\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n /**\n * Enable portal mode to render the popover content in a portal outside the component's DOM tree.\n * This provides better positioning control and prevents clipping issues in complex layouts.\n */\n @property({ type: Boolean }) portal = false;\n\n @property({ type: Boolean }) flip = false;\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n connectedCallback() {\n super.connectedCallback();\n this.emit('nile-init');\n document.addEventListener('click', this.handleDocumentClick);\n \n requestAnimationFrame(() => {\n if (this.portal && !this.portalManager) {\n this.portalManager = new PopoverPortalManager(this);\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n this.visibilityManager?.cleanup();\n document.removeEventListener('click', this.handleDocumentClick);\n \n if (this.portalManager) {\n this.portalManager.cleanupPortalAppend();\n this.portalManager = null;\n }\n }\n\n protected async firstUpdated(_changed: PropertyValues) {\n await this.updateComplete;\n \n const anchorSlot = this.renderRoot.querySelector('slot[name=\"anchor\"]') as HTMLSlotElement | null;\n const anchorEl = anchorSlot?.assignedElements({ flatten: true })[0] as HTMLElement | undefined;\n \n \n this.visibilityManager = new VisibilityManager({\n host: this,\n target: anchorEl || null,\n enableVisibilityEffect: this.enableVisibilityEffect,\n enableTabClose: this.enableTabClose,\n isOpen: () => this.isShow,\n onAnchorOutOfView: () => {\n this.isShow = false;\n this.emit('nile-visibility-change', {\n visible: false,\n reason: 'anchor-out-of-view',\n });\n },\n onDocumentHidden: () => {\n this.isShow = false;\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\n \n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('open')) {\n this.isShow = this.open;\n }\n \n if (_changedProperties.has('portal')) {\n if (this.portal && !this.portalManager) {\n this.portalManager = new PopoverPortalManager(this);\n } else if (!this.portal && this.portalManager) {\n this.portalManager.cleanupPortalAppend();\n this.portalManager = null;\n }\n }\n }\n\n @watch('isShow')\n handleShowHide() {\n if (this.isShow) {\n this.emit('nile-show');\n this.visibilityManager?.setup();\n if (this.portal && this.portalManager) {\n this.portalManager.setupPortalAppend();\n } else if (this.portal && !this.portalManager) {\n this.portalManager = new PopoverPortalManager(this);\n this.portalManager.setupPortalAppend();\n }\n } else {\n this.emit('nile-hide');\n this.visibilityManager?.cleanup();\n if (this.portal && this.portalManager) {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n public render(): TemplateResult {\n const shouldRenderContent = this.isShow && !(this.portal && this.portalManager);\n \n return html`\n <nile-popup\n active\n .arrow=\"${this.arrow && this.isShow && !this.portal}\"\n distance=\"${this.distance}\"\n placement=\"${this.placement}\"\n @click=${(e: Event) => e.stopPropagation()}\n arrowPlacement=\"${this.arrowPlacement}\"\n .flip=\"${this.flip}\"\n shift\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n >\n <slot\n slot=\"anchor\"\n name=\"anchor\"\n aria-describedby=\"tooltip\"\n @click=${this.handleClick}\n ></slot>\n ${shouldRenderContent\n ? html` <div part=\"popover\" class=\"popover__box\">\n <slot name=\"title\" class=\"popover__title\">${this.title}</slot>\n <slot part=\"base\"></slot>\n <slot name=\"action\" class=\"popover__action\"> </slot>\n </div>`\n : html``}\n </nile-popup>\n `;\n }\n\n private handleClick = () => {\n this.isShow = !this.isShow;\n const allPopovers = document.querySelectorAll('nile-popover');\n\n allPopovers.forEach(popover => {\n if (popover !== this) {\n popover.isShow = false;\n }\n });\n };\n\n private handleDocumentClick = () => {\n if (this.isShow && !this.preventOverlayClose) {\n this.isShow = false;\n }\n };\n\n public updatePortalContent(): void {\n if (this.portalManager) {\n this.portalManager.updatePortalAppendPosition();\n }\n }\n\n public forceReposition(): void {\n if (this.portalManager) {\n this.portalManager.forceReposition();\n }\n }\n\n public getCurrentPlacement(): string {\n if (this.portalManager) {\n return this.portalManager.getCurrentPlacement();\n }\n return this.placement;\n }\n\n public isPositioningOptimal(): boolean {\n if (this.portalManager) {\n return this.portalManager.isPositioningOptimal();\n }\n return true;\n }\n\n /* #endregion */\n}\n\nexport default NilePopover;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-popover': NilePopover;\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2025
|
|
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
|
+
import { PortalContentHandler, PortalConfig } from '../internal/portal-manager';
|
|
8
|
+
import type { CSSResultGroup } from 'lit';
|
|
9
|
+
export declare class PopoverPortalHandler implements PortalContentHandler {
|
|
10
|
+
private component;
|
|
11
|
+
private config;
|
|
12
|
+
private clonedPopoverContent;
|
|
13
|
+
constructor(component: any, config?: PortalConfig);
|
|
14
|
+
createPortalContent(): HTMLElement;
|
|
15
|
+
private createFallbackContent;
|
|
16
|
+
updatePortalContent(portalElement: HTMLElement): void;
|
|
17
|
+
setupEventListeners(portalElement: HTMLElement): void;
|
|
18
|
+
cleanupEventListeners(portalElement: HTMLElement): void;
|
|
19
|
+
getReferenceElement(): HTMLElement;
|
|
20
|
+
getComponentStyles(): CSSResultGroup | undefined;
|
|
21
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2025
|
|
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
|
+
export class PopoverPortalHandler {
|
|
8
|
+
constructor(component, config = {}) {
|
|
9
|
+
this.component = component;
|
|
10
|
+
this.config = config;
|
|
11
|
+
this.clonedPopoverContent = null;
|
|
12
|
+
}
|
|
13
|
+
createPortalContent() {
|
|
14
|
+
// Find the popover content in the shadow DOM (now it's always rendered but hidden when portal is enabled)
|
|
15
|
+
const popoverBox = this.component.shadowRoot?.querySelector('.popover__box');
|
|
16
|
+
if (!popoverBox) {
|
|
17
|
+
// Fallback: create content directly
|
|
18
|
+
return this.createFallbackContent();
|
|
19
|
+
}
|
|
20
|
+
// Clone the popover content for portal
|
|
21
|
+
this.clonedPopoverContent = popoverBox.cloneNode(true);
|
|
22
|
+
this.clonedPopoverContent.style.display = 'block';
|
|
23
|
+
this.clonedPopoverContent.style.position = 'relative';
|
|
24
|
+
return this.clonedPopoverContent;
|
|
25
|
+
}
|
|
26
|
+
createFallbackContent() {
|
|
27
|
+
// Create the popover content directly as fallback
|
|
28
|
+
this.clonedPopoverContent = document.createElement('div');
|
|
29
|
+
this.clonedPopoverContent.className = 'popover__box';
|
|
30
|
+
this.clonedPopoverContent.setAttribute('part', 'popover');
|
|
31
|
+
this.clonedPopoverContent.style.display = 'block';
|
|
32
|
+
this.clonedPopoverContent.style.position = 'relative';
|
|
33
|
+
// Create the title element
|
|
34
|
+
const titleElement = document.createElement('div');
|
|
35
|
+
titleElement.className = 'popover__title';
|
|
36
|
+
titleElement.textContent = this.component.title;
|
|
37
|
+
// Create the base content slot
|
|
38
|
+
const baseSlot = document.createElement('div');
|
|
39
|
+
baseSlot.setAttribute('part', 'base');
|
|
40
|
+
// Create the action slot
|
|
41
|
+
const actionSlot = document.createElement('div');
|
|
42
|
+
actionSlot.className = 'popover__action';
|
|
43
|
+
// Append elements
|
|
44
|
+
this.clonedPopoverContent.appendChild(titleElement);
|
|
45
|
+
this.clonedPopoverContent.appendChild(baseSlot);
|
|
46
|
+
this.clonedPopoverContent.appendChild(actionSlot);
|
|
47
|
+
return this.clonedPopoverContent;
|
|
48
|
+
}
|
|
49
|
+
updatePortalContent(portalElement) {
|
|
50
|
+
if (!this.component.isShow) {
|
|
51
|
+
portalElement.style.display = 'none';
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
portalElement.style.display = 'block';
|
|
55
|
+
// Update the content by cloning from the shadow DOM again
|
|
56
|
+
const originalPopoverBox = this.component.shadowRoot?.querySelector('.popover__box');
|
|
57
|
+
if (originalPopoverBox) {
|
|
58
|
+
// Clone the updated content
|
|
59
|
+
const updatedContent = originalPopoverBox.cloneNode(true);
|
|
60
|
+
updatedContent.style.display = 'block';
|
|
61
|
+
updatedContent.style.position = 'relative';
|
|
62
|
+
// Replace the content
|
|
63
|
+
portalElement.innerHTML = updatedContent.innerHTML;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
setupEventListeners(portalElement) {
|
|
67
|
+
// Handle click events to prevent them from bubbling up
|
|
68
|
+
portalElement.addEventListener('click', (event) => {
|
|
69
|
+
event.stopPropagation();
|
|
70
|
+
});
|
|
71
|
+
// Handle any other popover-specific events
|
|
72
|
+
// For example, if the popover has action buttons, we might need to handle those
|
|
73
|
+
const actionSlot = portalElement.querySelector('slot[name="action"]');
|
|
74
|
+
if (actionSlot) {
|
|
75
|
+
actionSlot.addEventListener('click', (event) => {
|
|
76
|
+
event.stopPropagation();
|
|
77
|
+
// Forward the event to the original component if needed
|
|
78
|
+
this.component.dispatchEvent(new CustomEvent('nile-popover-action', {
|
|
79
|
+
detail: { originalEvent: event },
|
|
80
|
+
bubbles: true
|
|
81
|
+
}));
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
cleanupEventListeners(portalElement) {
|
|
86
|
+
// Remove all event listeners
|
|
87
|
+
const newElement = portalElement.cloneNode(true);
|
|
88
|
+
portalElement.parentNode?.replaceChild(newElement, portalElement);
|
|
89
|
+
}
|
|
90
|
+
getReferenceElement() {
|
|
91
|
+
// Get the anchor element from the slot
|
|
92
|
+
const anchorSlot = this.component.shadowRoot?.querySelector('slot[name="anchor"]');
|
|
93
|
+
if (anchorSlot) {
|
|
94
|
+
const assignedElements = anchorSlot.assignedElements();
|
|
95
|
+
if (assignedElements.length > 0) {
|
|
96
|
+
return assignedElements[0];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Fallback to the component itself
|
|
100
|
+
return this.component;
|
|
101
|
+
}
|
|
102
|
+
getComponentStyles() {
|
|
103
|
+
return this.component.constructor.styles;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=popover-portal-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover-portal-handler.js","sourceRoot":"","sources":["../../../src/nile-popover/popover-portal-handler.ts"],"names":[],"mappings":"AAAA;;;;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,OAAQ,IAAI,CAAC,SAAS,CAAC,WAAmB,CAAC,MAAM,CAAC;IACpD,CAAC;CACF","sourcesContent":["/**\n * Copyright Aquera Inc 2025\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 { PortalContentHandler, PortalConfig } from '../internal/portal-manager';\nimport type { CSSResultGroup } from 'lit';\n\nexport class PopoverPortalHandler implements PortalContentHandler {\n private clonedPopoverContent: HTMLElement | null = null;\n\n constructor(\n private component: any,\n private config: PortalConfig = {}\n ) {}\n\n createPortalContent(): HTMLElement {\n // Find the popover content in the shadow DOM (now it's always rendered but hidden when portal is enabled)\n const popoverBox = this.component.shadowRoot?.querySelector('.popover__box') as HTMLElement;\n if (!popoverBox) {\n // Fallback: create content directly\n return this.createFallbackContent();\n }\n\n // Clone the popover content for portal\n this.clonedPopoverContent = popoverBox.cloneNode(true) as HTMLElement;\n this.clonedPopoverContent.style.display = 'block';\n this.clonedPopoverContent.style.position = 'relative';\n \n return this.clonedPopoverContent;\n }\n\n private createFallbackContent(): HTMLElement {\n // Create the popover content directly as fallback\n this.clonedPopoverContent = document.createElement('div');\n this.clonedPopoverContent.className = 'popover__box';\n this.clonedPopoverContent.setAttribute('part', 'popover');\n this.clonedPopoverContent.style.display = 'block';\n this.clonedPopoverContent.style.position = 'relative';\n \n // Create the title element\n const titleElement = document.createElement('div');\n titleElement.className = 'popover__title';\n titleElement.textContent = this.component.title;\n \n // Create the base content slot\n const baseSlot = document.createElement('div');\n baseSlot.setAttribute('part', 'base');\n \n // Create the action slot\n const actionSlot = document.createElement('div');\n actionSlot.className = 'popover__action';\n \n // Append elements\n this.clonedPopoverContent.appendChild(titleElement);\n this.clonedPopoverContent.appendChild(baseSlot);\n this.clonedPopoverContent.appendChild(actionSlot);\n \n return this.clonedPopoverContent;\n }\n\n updatePortalContent(portalElement: HTMLElement): void {\n if (!this.component.isShow) {\n portalElement.style.display = 'none';\n return;\n }\n\n portalElement.style.display = 'block';\n\n // Update the content by cloning from the shadow DOM again\n const originalPopoverBox = this.component.shadowRoot?.querySelector('.popover__box') as HTMLElement;\n if (originalPopoverBox) {\n // Clone the updated content\n const updatedContent = originalPopoverBox.cloneNode(true) as HTMLElement;\n updatedContent.style.display = 'block';\n updatedContent.style.position = 'relative';\n \n // Replace the content\n portalElement.innerHTML = updatedContent.innerHTML;\n }\n }\n\n setupEventListeners(portalElement: HTMLElement): void {\n // Handle click events to prevent them from bubbling up\n portalElement.addEventListener('click', (event) => {\n event.stopPropagation();\n });\n\n // Handle any other popover-specific events\n // For example, if the popover has action buttons, we might need to handle those\n const actionSlot = portalElement.querySelector('slot[name=\"action\"]');\n if (actionSlot) {\n actionSlot.addEventListener('click', (event) => {\n event.stopPropagation();\n // Forward the event to the original component if needed\n this.component.dispatchEvent(new CustomEvent('nile-popover-action', {\n detail: { originalEvent: event },\n bubbles: true\n }));\n });\n }\n }\n\n cleanupEventListeners(portalElement: HTMLElement): void {\n // Remove all event listeners\n const newElement = portalElement.cloneNode(true) as HTMLElement;\n portalElement.parentNode?.replaceChild(newElement, portalElement);\n }\n\n getReferenceElement(): HTMLElement {\n // Get the anchor element from the slot\n const anchorSlot = this.component.shadowRoot?.querySelector('slot[name=\"anchor\"]') as HTMLSlotElement;\n if (anchorSlot) {\n const assignedElements = anchorSlot.assignedElements();\n if (assignedElements.length > 0) {\n return assignedElements[0] as HTMLElement;\n }\n }\n \n // Fallback to the component itself\n return this.component;\n }\n\n getComponentStyles(): CSSResultGroup | undefined {\n return (this.component.constructor as any).styles;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NilePortalWrapper } from './nile-portal-wrapper.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-portal-wrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export { NilePortalWrapper } from './nile-portal-wrapper.js';\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { type Placement, type Boundary } from '@floating-ui/dom';
|
|
3
|
+
export declare class NilePortalWrapper extends LitElement {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
targetElement: HTMLElement | null;
|
|
6
|
+
content: HTMLElement | null;
|
|
7
|
+
placement: Placement;
|
|
8
|
+
offset: number;
|
|
9
|
+
padding: number;
|
|
10
|
+
boundary: Boundary;
|
|
11
|
+
fallbackPlacements: Placement[];
|
|
12
|
+
strategy: 'absolute' | 'fixed';
|
|
13
|
+
className: string;
|
|
14
|
+
zIndex: number;
|
|
15
|
+
preserveStyles: boolean;
|
|
16
|
+
cloneContent: boolean;
|
|
17
|
+
private portalContainer;
|
|
18
|
+
private clonedContent;
|
|
19
|
+
private currentPlacement;
|
|
20
|
+
private currentMiddlewareData;
|
|
21
|
+
private measuredHeight;
|
|
22
|
+
private cleanupAutoUpdate;
|
|
23
|
+
private injectedStyleId;
|
|
24
|
+
private resizeObserver;
|
|
25
|
+
static styles: import("lit").CSSResult;
|
|
26
|
+
connectedCallback(): void;
|
|
27
|
+
disconnectedCallback(): void;
|
|
28
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
29
|
+
private setupPortal;
|
|
30
|
+
private createPortalContainer;
|
|
31
|
+
private createClonedContent;
|
|
32
|
+
private createPortalListbox;
|
|
33
|
+
private cloneOption;
|
|
34
|
+
private positionPortal;
|
|
35
|
+
private handleSizeMiddleware;
|
|
36
|
+
private applyPosition;
|
|
37
|
+
private fallbackPositioning;
|
|
38
|
+
private setupAutoUpdate;
|
|
39
|
+
private setupEventListeners;
|
|
40
|
+
private handleOptionClick;
|
|
41
|
+
private forwardEvent;
|
|
42
|
+
private findOriginalElement;
|
|
43
|
+
private injectStyles;
|
|
44
|
+
private extractStylesAsCSS;
|
|
45
|
+
private cleanup;
|
|
46
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
47
|
+
}
|