@aquera/nile-elements 1.3.1-beta-1 → 1.3.1-beta-1.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/demo/index.css +3 -0
- package/demo/index.html +126 -17
- package/demo/variables.css +0 -1
- package/dist/assets/nile-elements-4b5c262d.css +1 -0
- package/dist/{fixture-54600b35.cjs.js → fixture-1c49c014.cjs.js} +2 -2
- package/dist/{fixture-73855806.cjs.js.map → fixture-1c49c014.cjs.js.map} +1 -1
- package/dist/{fixture-9871e8a9.esm.js → fixture-985bba12.esm.js} +1 -1
- package/dist/{fixture-73855806.cjs.js → fixture-d1470b58.cjs.js} +2 -2
- package/dist/{fixture-54600b35.cjs.js.map → fixture-d1470b58.cjs.js.map} +1 -1
- package/dist/{fixture-5b79f853.cjs.js → fixture-dff65c89.cjs.js} +2 -2
- package/dist/{fixture-c1d78368.cjs.js.map → fixture-dff65c89.cjs.js.map} +1 -1
- package/dist/index.js +138 -108
- 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/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
- package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.test.esm.js +1 -1
- package/dist/nile-button/nile-button.test.cjs.js +1 -1
- package/dist/nile-button/nile-button.test.esm.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.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/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
- 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-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 +10 -2
- package/dist/nile-inline-sidebar/nile-inline-sidebar.esm.js +10 -6
- 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 +8 -2
- 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-light-tooltip/index.esm.js +1 -0
- package/dist/nile-light-tooltip/nile-light-tooltip.css.esm.js +6 -0
- package/dist/nile-light-tooltip/nile-light-tooltip.esm.js +1 -0
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.esm.js +1 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.test.esm.js +1 -1
- package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.test.esm.js +1 -1
- 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/nile-select.test.cjs.js +1 -1
- package/dist/nile-select/nile-select.test.esm.js +1 -1
- 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 +24 -29
- package/dist/nile-side-bar/nile-side-bar.esm.js +7 -1
- 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 +3 -5
- 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 +5 -3
- 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 +17 -5
- 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 +4 -7
- 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 +58 -56
- 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-virtual-select/nile-virtual-select.test.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +1 -1
- package/dist/src/nile-dropdown/portal-manager.js +0 -2
- package/dist/src/nile-dropdown/portal-manager.js.map +1 -1
- package/dist/src/nile-dropdown/portal-utils.d.ts +0 -1
- package/dist/src/nile-dropdown/portal-utils.js +0 -24
- package/dist/src/nile-dropdown/portal-utils.js.map +1 -1
- package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js +10 -2
- package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js.map +1 -1
- package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js +10 -3
- 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 +6 -0
- 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 +1 -0
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js +4 -0
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js.map +1 -1
- package/dist/src/nile-light-tooltip/index.d.ts +1 -0
- package/dist/src/nile-light-tooltip/index.js +2 -0
- package/dist/src/nile-light-tooltip/index.js.map +1 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.css.d.ts +12 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.css.js +18 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.css.js.map +1 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.d.ts +40 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.js +101 -0
- package/dist/src/nile-light-tooltip/nile-light-tooltip.js.map +1 -0
- package/dist/src/nile-menu/virtual-menu-search-manager.d.ts +11 -0
- package/dist/src/nile-menu/virtual-menu-search-manager.js +43 -0
- package/dist/src/nile-menu/virtual-menu-search-manager.js.map +1 -0
- package/dist/src/nile-side-bar/nile-side-bar.css.js +22 -27
- package/dist/src/nile-side-bar/nile-side-bar.css.js.map +1 -1
- package/dist/src/nile-side-bar/nile-side-bar.js +7 -1
- 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 +3 -5
- 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 +2 -0
- package/dist/src/nile-side-bar-expand/nile-side-bar-expand.js +12 -4
- 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 +3 -1
- 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 +15 -3
- 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 +1 -0
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.js +8 -1
- 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 +2 -5
- 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 +48 -46
- package/dist/src/nile-side-bar-group-item/nile-side-bar-group-item.css.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/nile-dropdown/portal-manager.ts +0 -2
- package/src/nile-dropdown/portal-utils.ts +0 -26
- package/src/nile-inline-sidebar/nile-inline-sidebar.css.ts +10 -2
- package/src/nile-inline-sidebar/nile-inline-sidebar.ts +16 -5
- package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.css.ts +6 -0
- package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.ts +1 -0
- package/src/nile-side-bar/nile-side-bar.css.ts +22 -27
- package/src/nile-side-bar/nile-side-bar.ts +8 -1
- package/src/nile-side-bar-expand/nile-side-bar-expand.css.ts +3 -5
- package/src/nile-side-bar-expand/nile-side-bar-expand.ts +6 -4
- package/src/nile-side-bar-footer/nile-side-bar-footer.css.ts +3 -1
- package/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.ts +15 -3
- package/src/nile-side-bar-footer-item/nile-side-bar-footer-item.ts +9 -1
- package/src/nile-side-bar-group/nile-side-bar-group.css.ts +2 -5
- package/src/nile-side-bar-group-item/nile-side-bar-group-item.css.ts +49 -47
- package/vscode-html-custom-data.json +20 -3
- package/dist/fixture-5b79f853.cjs.js.map +0 -1
- package/dist/fixture-90b199c4.esm.js +0 -569
- package/dist/fixture-c1d78368.cjs.js +0 -395
- package/dist/fixture-cf7bfcf5.esm.js +0 -569
- package/dist/fixture-dbd66009.cjs.js +0 -395
- package/dist/fixture-dbd66009.cjs.js.map +0 -1
- package/dist/nile-code-editor/backup_nile-code-editor copy.cjs.js +0 -2
- package/dist/nile-code-editor/backup_nile-code-editor copy.cjs.js.map +0 -1
- package/dist/nile-code-editor/backup_nile-code-editor copy.esm.js +0 -1
- package/dist/nile-sidebar/index.cjs.js +0 -2
- package/dist/nile-sidebar/index.cjs.js.map +0 -1
- package/dist/nile-sidebar/index.esm.js +0 -75
- package/dist/nile-sidebar-menu/index.cjs.js +0 -2
- package/dist/nile-sidebar-menu/index.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu/index.esm.js +0 -1
- package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js +0 -2
- package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js +0 -2
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.esm.js +0 -38
- package/dist/nile-sidebar-menu/nile-sidebar-menu.esm.js +0 -10
- package/dist/nile-sidebar-menu-items/index.cjs.js +0 -2
- package/dist/nile-sidebar-menu-items/index.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu-items/index.esm.js +0 -1
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js +0 -2
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js +0 -2
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js.map +0 -1
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.esm.js +0 -36
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.esm.js +0 -15
- package/dist/nile-sidebar-wrapper/index.cjs.js +0 -2
- package/dist/nile-sidebar-wrapper/index.cjs.js.map +0 -1
- package/dist/nile-sidebar-wrapper/index.esm.js +0 -1
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js +0 -2
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js.map +0 -1
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js +0 -2
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js.map +0 -1
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.esm.js +0 -105
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.esm.js +0 -16
- package/dist/nile-virtual-select/group-manager.cjs.js +0 -2
- package/dist/nile-virtual-select/group-manager.cjs.js.map +0 -1
- package/dist/nile-virtual-select/group-manager.esm.js +0 -1
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js +0 -2
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js.map +0 -1
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.esm.js +0 -231
- package/dist/scopedElementsWrapper-4c29be11.esm.js +0 -7
- package/dist/scopedElementsWrapper-a112fc73.cjs.js +0 -6
- package/dist/scopedElementsWrapper-a112fc73.cjs.js.map +0 -1
- package/dist/src/internal/portal-manager.d.ts +0 -53
- package/dist/src/internal/portal-manager.js +0 -196
- package/dist/src/internal/portal-manager.js.map +0 -1
- package/dist/src/internal/portal.d.ts +0 -60
- package/dist/src/internal/portal.js +0 -199
- package/dist/src/internal/portal.js.map +0 -1
- package/dist/src/internal/resizable-helper.d.ts +0 -59
- package/dist/src/internal/resizable-helper.js +0 -115
- package/dist/src/internal/resizable-helper.js.map +0 -1
- package/dist/src/internal/resizable-styles.d.ts +0 -16
- package/dist/src/internal/resizable-styles.js +0 -144
- package/dist/src/internal/resizable-styles.js.map +0 -1
- package/dist/src/internal/virtualizer-error-handler.d.ts +0 -30
- package/dist/src/internal/virtualizer-error-handler.js +0 -82
- package/dist/src/internal/virtualizer-error-handler.js.map +0 -1
- package/dist/src/lib/index.d.ts +0 -7
- package/dist/src/lib/index.js +0 -8
- package/dist/src/lib/index.js.map +0 -1
- package/dist/src/lib/virtualize.d.ts +0 -32
- package/dist/src/lib/virtualize.js +0 -105
- package/dist/src/lib/virtualize.js.map +0 -1
- package/dist/src/lib/virtualize.test.d.ts +0 -7
- package/dist/src/lib/virtualize.test.js +0 -57
- package/dist/src/lib/virtualize.test.js.map +0 -1
- package/dist/src/nile-badge/__snapshots__/nile-badge.test.snap.js +0 -17
- package/dist/src/nile-calendar/__snapshots__/nile-calendar.test.snap.js +0 -310
- package/dist/src/nile-card/__snapshots__/nile-card.test.snap.js +0 -34
- package/dist/src/nile-checkbox/__snapshots__/nile-checkbox.test.snap.js +0 -31
- package/dist/src/nile-code-editor/Old_theme copy.d.ts +0 -191
- package/dist/src/nile-code-editor/Old_theme copy.js +0 -193
- package/dist/src/nile-code-editor/Old_theme copy.js.map +0 -1
- package/dist/src/nile-code-editor/backup_nile-code-editor copy.d.ts +0 -0
- package/dist/src/nile-code-editor/backup_nile-code-editor copy.js +0 -675
- package/dist/src/nile-code-editor/backup_nile-code-editor copy.js.map +0 -1
- package/dist/src/nile-code-editor/theme copy.d.ts +0 -191
- package/dist/src/nile-code-editor/theme copy.js +0 -193
- package/dist/src/nile-code-editor/theme copy.js.map +0 -1
- package/dist/src/nile-floating-panel/anchor-manager.d.ts +0 -26
- package/dist/src/nile-floating-panel/anchor-manager.js +0 -49
- package/dist/src/nile-floating-panel/anchor-manager.js.map +0 -1
- package/dist/src/nile-floating-panel/content-manager.d.ts +0 -23
- package/dist/src/nile-floating-panel/content-manager.js +0 -67
- package/dist/src/nile-floating-panel/content-manager.js.map +0 -1
- package/dist/src/nile-floating-panel/event-manager.d.ts +0 -38
- package/dist/src/nile-floating-panel/event-manager.js +0 -81
- package/dist/src/nile-floating-panel/event-manager.js.map +0 -1
- package/dist/src/nile-floating-panel/index.d.ts +0 -1
- package/dist/src/nile-floating-panel/index.js +0 -2
- package/dist/src/nile-floating-panel/index.js.map +0 -1
- package/dist/src/nile-floating-panel/nile-floating-panel.css.d.ts +0 -17
- package/dist/src/nile-floating-panel/nile-floating-panel.css.js +0 -51
- package/dist/src/nile-floating-panel/nile-floating-panel.css.js.map +0 -1
- package/dist/src/nile-floating-panel/nile-floating-panel.d.ts +0 -67
- package/dist/src/nile-floating-panel/nile-floating-panel.js +0 -203
- package/dist/src/nile-floating-panel/nile-floating-panel.js.map +0 -1
- package/dist/src/nile-floating-panel/position-manager.d.ts +0 -47
- package/dist/src/nile-floating-panel/position-manager.js +0 -94
- package/dist/src/nile-floating-panel/position-manager.js.map +0 -1
- package/dist/src/nile-floating-panel/style-manager.d.ts +0 -31
- package/dist/src/nile-floating-panel/style-manager.js +0 -74
- package/dist/src/nile-floating-panel/style-manager.js.map +0 -1
- package/dist/src/nile-floating-panel/types.d.ts +0 -29
- package/dist/src/nile-floating-panel/types.js +0 -8
- package/dist/src/nile-floating-panel/types.js.map +0 -1
- package/dist/src/nile-grid/data-processor.d.ts +0 -37
- package/dist/src/nile-grid/data-processor.js +0 -122
- package/dist/src/nile-grid/data-processor.js.map +0 -1
- package/dist/src/nile-grid/event-handlers.d.ts +0 -35
- package/dist/src/nile-grid/event-handlers.js +0 -158
- package/dist/src/nile-grid/event-handlers.js.map +0 -1
- package/dist/src/nile-grid/renderer.d.ts +0 -8
- package/dist/src/nile-grid/renderer.js +0 -78
- package/dist/src/nile-grid/renderer.js.map +0 -1
- package/dist/src/nile-grid/resize-handler.d.ts +0 -4
- package/dist/src/nile-grid/resize-handler.js +0 -36
- package/dist/src/nile-grid/resize-handler.js.map +0 -1
- package/dist/src/nile-grid/types.d.ts +0 -32
- package/dist/src/nile-grid/types.js +0 -2
- package/dist/src/nile-grid/types.js.map +0 -1
- package/dist/src/nile-grid/utils.d.ts +0 -4
- package/dist/src/nile-grid/utils.js +0 -32
- package/dist/src/nile-grid/utils.js.map +0 -1
- package/dist/src/nile-hero/__snapshots__/nile-hero.test.snap.js +0 -47
- package/dist/src/nile-icon/__snapshots__/nile-icon.test.snap.js +0 -16
- package/dist/src/nile-input/__snapshots__/nile-input.test.snap.js +0 -75
- package/dist/src/nile-menu/portal-manager.d.ts +0 -39
- package/dist/src/nile-menu/portal-manager.js +0 -340
- package/dist/src/nile-menu/portal-manager.js.map +0 -1
- package/dist/src/nile-menu/portal-utils.d.ts +0 -21
- package/dist/src/nile-menu/portal-utils.js +0 -128
- package/dist/src/nile-menu/portal-utils.js.map +0 -1
- package/dist/src/nile-popover/__snapshots__/nile-popover.test.snap.js +0 -22
- package/dist/src/nile-popover/popover-portal-handler.d.ts +0 -21
- package/dist/src/nile-popover/popover-portal-handler.js +0 -106
- package/dist/src/nile-popover/popover-portal-handler.js.map +0 -1
- package/dist/src/nile-portal-wrapper/index.d.ts +0 -1
- package/dist/src/nile-portal-wrapper/index.js +0 -2
- package/dist/src/nile-portal-wrapper/index.js.map +0 -1
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.d.ts +0 -47
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js +0 -451
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js.map +0 -1
- package/dist/src/nile-select/body-append-manager.d.ts +0 -90
- package/dist/src/nile-select/body-append-manager.js +0 -298
- package/dist/src/nile-select/body-append-manager.js.map +0 -1
- package/dist/src/nile-table-body/virtual-scroll-helper.d.ts +0 -9
- package/dist/src/nile-table-body/virtual-scroll-helper.js +0 -24
- package/dist/src/nile-table-body/virtual-scroll-helper.js.map +0 -1
- package/dist/src/nile-virtual-select/body-append-helper.d.ts +0 -16
- package/dist/src/nile-virtual-select/body-append-helper.js +0 -95
- package/dist/src/nile-virtual-select/body-append-helper.js.map +0 -1
- package/dist/src/nile-virtual-select/group-manager.d.ts +0 -32
- package/dist/src/nile-virtual-select/group-manager.js +0 -134
- package/dist/src/nile-virtual-select/group-manager.js.map +0 -1
- package/dist/src/nile-virtual-select/portal-utils.d.ts +0 -65
- package/dist/src/nile-virtual-select/portal-utils.js +0 -376
- package/dist/src/nile-virtual-select/portal-utils.js.map +0 -1
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.d.ts +0 -273
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js +0 -1305
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js.map +0 -1
- package/dist/src/nile-virtual-select/virtualizer-error-handler.d.ts +0 -21
- package/dist/src/nile-virtual-select/virtualizer-error-handler.js +0 -56
- package/dist/src/nile-virtual-select/virtualizer-error-handler.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/index.d.ts +0 -1
- package/dist/src/nile-virtual-select-disabled/index.js +0 -2
- package/dist/src/nile-virtual-select-disabled/index.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.d.ts +0 -12
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js +0 -538
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.d.ts +0 -299
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js +0 -1441
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.d.ts +0 -7
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js +0 -631
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/portal-manager.d.ts +0 -45
- package/dist/src/nile-virtual-select-disabled/portal-manager.js +0 -333
- package/dist/src/nile-virtual-select-disabled/portal-manager.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/renderer.d.ts +0 -16
- package/dist/src/nile-virtual-select-disabled/renderer.js +0 -79
- package/dist/src/nile-virtual-select-disabled/renderer.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/search-manager.d.ts +0 -12
- package/dist/src/nile-virtual-select-disabled/search-manager.js +0 -40
- package/dist/src/nile-virtual-select-disabled/search-manager.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/selection-manager.d.ts +0 -12
- package/dist/src/nile-virtual-select-disabled/selection-manager.js +0 -64
- package/dist/src/nile-virtual-select-disabled/selection-manager.js.map +0 -1
- package/dist/src/nile-virtual-select-disabled/types.d.ts +0 -50
- package/dist/src/nile-virtual-select-disabled/types.js +0 -8
- package/dist/src/nile-virtual-select-disabled/types.js.map +0 -1
- package/dist/src/nile-virtual-table-body/index.d.ts +0 -2
- package/dist/src/nile-virtual-table-body/index.js +0 -3
- package/dist/src/nile-virtual-table-body/index.js.map +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.d.ts +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js +0 -44
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js.map +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.d.ts +0 -50
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js +0 -135
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js.map +0 -1
- package/dist/src/nile-virtual-table-body/renderer.d.ts +0 -16
- package/dist/src/nile-virtual-table-body/renderer.js +0 -49
- package/dist/src/nile-virtual-table-body/renderer.js.map +0 -1
- package/dist/src/utilities/stepper-utils.d.ts +0 -71
- package/dist/src/utilities/stepper-utils.js +0 -108
- package/dist/src/utilities/stepper-utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal-manager.cjs.js","sources":["../../../src/nile-dropdown/portal-manager.ts"],"sourcesContent":["import { \n autoUpdate, \n computePosition, \n flip, \n offset, \n shift, \n size,\n platform,\n type Placement,\n type MiddlewareData,\n type ComputePositionConfig\n} from '@floating-ui/dom';\nimport { PortalUtils, PortalContentUtils, PortalEventUtils } from './portal-utils';\n\nexport class DropdownPortalManager {\n private portalContainer: HTMLElement | null = null;\n private measuredPanelHeight: number | null = null;\n private component: any;\n private clonedPanel: HTMLElement | null = null;\n private cleanupAutoUpdate: (() => void) | null = null;\n private currentPlacement: Placement = 'bottom-start';\n private currentMiddlewareData: MiddlewareData | null = null;\n private boundHandleWindowResize: (() => void) | null = null;\n\n constructor(component: any) {\n this.component = component;\n }\n\n private createPortalAppendContainer(): HTMLElement {\n const container = document.createElement('div');\n container.style.position = 'absolute';\n container.style.zIndex = '9999';\n container.style.pointerEvents = 'none';\n container.style.width = 'auto';\n container.style.maxWidth = 'none';\n container.style.minWidth = 'auto';\n container.className = 'nile-dropdown-portal-append';\n return container;\n }\n\n positionPortalAppend(): void {\n if (!this.portalContainer || !this.component.open) return;\n\n this.measurePanelHeight();\n this.computeFloatingUIPosition();\n }\n\n private measurePanelHeight(): void {\n if (this.measuredPanelHeight || !this.portalContainer) return;\n\n this.portalContainer.style.position = 'absolute';\n this.portalContainer.style.visibility = 'hidden';\n this.portalContainer.style.top = '0px';\n this.portalContainer.style.left = '0px';\n \n this.portalContainer.offsetHeight;\n \n this.measuredPanelHeight = this.portalContainer.offsetHeight;\n \n this.portalContainer.style.visibility = '';\n }\n\n private async computeFloatingUIPosition(): Promise<void> {\n if (!this.portalContainer) return;\n\n const referenceElement = this.component.shadowRoot?.querySelector('[slot=\"anchor\"]')?.assignedElements({ flatten: true })[0] as HTMLElement || \n this.component.querySelector('[slot=\"trigger\"]')?.assignedElements({ flatten: true })[0] as HTMLElement ||\n this.component;\n const floatingElement = this.portalContainer;\n\n try {\n const { x, y, placement, middlewareData } = await this.calculateFloatingUIPosition(\n referenceElement,\n floatingElement\n );\n\n this.applyFloatingUIPosition(floatingElement, referenceElement, x, y, placement, middlewareData);\n\n } catch (error) {\n console.warn('Floating UI positioning failed, falling back to simple positioning:', error);\n this.fallbackPositioning();\n }\n }\n\n private async calculateFloatingUIPosition(\n referenceElement: HTMLElement,\n floatingElement: HTMLElement\n ): Promise<{ x: number; y: number; placement: Placement; middlewareData: MiddlewareData }> {\n const boundary = PortalUtils.findBoundaryElements(referenceElement);\n const initialPlacement = this.getInitialPlacement();\n const middleware = this.createFloatingUIMiddleware(boundary);\n\n return await computePosition(referenceElement, floatingElement, {\n placement: initialPlacement,\n strategy: 'fixed',\n middleware,\n platform: this.createCustomPlatform()\n });\n }\n\n private getInitialPlacement(): Placement {\n return this.component.placement || 'bottom-start';\n }\n\n private createFloatingUIMiddleware(boundary: Element[] | undefined): ComputePositionConfig['middleware'] {\n const middleware: ComputePositionConfig['middleware'] = [\n offset(this.component.distance || 0),\n ];\n\n // Add size middleware if sync is specified\n if (this.component.sync) {\n middleware.push(\n size({\n apply: this.handleSizeMiddleware.bind(this),\n padding: 10,\n boundary: boundary\n })\n );\n }\n\n // Add flip middleware\n middleware.push(\n flip({\n fallbackPlacements: this.getFallbackPlacements(),\n fallbackStrategy: 'bestFit',\n padding: 10,\n boundary: boundary\n })\n );\n\n // Add shift middleware\n middleware.push(\n shift({\n padding: 10,\n crossAxis: true,\n boundary: boundary\n })\n );\n\n return middleware;\n }\n\n private handleSizeMiddleware({ availableWidth, availableHeight, elements, rects }: {\n availableWidth: number;\n availableHeight: number;\n elements: { floating: HTMLElement };\n rects: { reference: { x: number; y: number; width: number; height: number } };\n }): void {\n const maxHeight = PortalUtils.calculateOptimalHeight(\n rects.reference,\n window.innerHeight,\n this.currentPlacement\n );\n\n if (this.component.sync === 'width' || this.component.sync === 'both') {\n elements.floating.style.width = `${rects.reference.width}px`;\n }\n if (this.component.sync === 'height' || this.component.sync === 'both') {\n elements.floating.style.height = `${rects.reference.height}px`;\n }\n\n elements.floating.style.maxHeight = `${maxHeight}px`;\n elements.floating.style.setProperty('--auto-size-available-width', `${availableWidth}px`);\n elements.floating.style.setProperty('--auto-size-available-height', `${maxHeight}px`);\n }\n\n private getFallbackPlacements(): Placement[] {\n const basePlacement = this.component.placement || 'bottom-start';\n const placements: Placement[] = [];\n \n if (basePlacement.startsWith('top')) {\n placements.push('bottom-start', 'bottom', 'bottom-end', 'top', 'top-end', 'right-start', 'left-start');\n } else if (basePlacement.startsWith('bottom')) {\n placements.push('top-start', 'top', 'top-end', 'bottom', 'bottom-end', 'right-start', 'left-start');\n } else if (basePlacement.startsWith('left')) {\n placements.push('right-start', 'right', 'right-end', 'left', 'left-end', 'top-start', 'bottom-start');\n } else if (basePlacement.startsWith('right')) {\n placements.push('left-start', 'left', 'left-end', 'right', 'right-end', 'top-start', 'bottom-start');\n }\n \n return placements;\n }\n\n private createCustomPlatform() {\n return platform;\n }\n\n private applyFloatingUIPosition(\n floatingElement: HTMLElement,\n referenceElement: HTMLElement,\n x: number,\n y: number,\n placement: Placement,\n middlewareData: MiddlewareData\n ): void {\n const referenceRect = referenceElement.getBoundingClientRect();\n \n Object.assign(floatingElement.style, {\n left: `${x}px`,\n top: `${y}px`,\n position: 'fixed',\n pointerEvents: 'auto',\n width: 'auto',\n minWidth: 'auto'\n });\n\n // Apply sync width if needed\n if (this.component.sync === 'width' || this.component.sync === 'both') {\n floatingElement.style.width = `${referenceRect.width}px`;\n }\n\n this.currentPlacement = placement;\n this.currentMiddlewareData = middlewareData;\n \n PortalUtils.applyCollisionData(floatingElement, middlewareData, placement);\n \n const placementClass = placement.split('-')[0];\n floatingElement.className = `nile-dropdown-portal-append dropdown--open dropdown__panel--${placementClass}`;\n }\n\n private fallbackPositioning(): void {\n if (!this.portalContainer) return;\n\n const referenceElement = this.component.shadowRoot?.querySelector('[slot=\"anchor\"]')?.assignedElements({ flatten: true })[0] as HTMLElement || \n this.component.querySelector('[slot=\"trigger\"]')?.assignedElements({ flatten: true })[0] as HTMLElement ||\n this.component;\n const rect = referenceElement.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n \n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n const spaceRight = viewportWidth - rect.right;\n const spaceLeft = rect.left;\n \n let topPosition: number;\n let leftPosition: number = rect.left;\n let placementClass: string;\n let maxHeight: number;\n \n const placement = this.component.placement || 'bottom-start';\n \n if (placement.startsWith('bottom')) {\n maxHeight = Math.max(spaceBelow - 20, 100);\n topPosition = rect.bottom + (this.component.distance || 0);\n placementClass = 'bottom';\n } else if (placement.startsWith('top')) {\n maxHeight = Math.max(spaceAbove - 20, 100);\n topPosition = Math.max(rect.top - maxHeight - (this.component.distance || 0), 10);\n placementClass = 'top';\n } else if (placement.startsWith('right')) {\n maxHeight = Math.max(Math.min(spaceRight, spaceBelow, spaceAbove) - 20, 100);\n topPosition = rect.top;\n leftPosition = rect.right + (this.component.distance || 0);\n placementClass = 'right';\n } else {\n maxHeight = Math.max(Math.min(spaceLeft, spaceBelow, spaceAbove) - 20, 100);\n topPosition = rect.top;\n leftPosition = Math.max(rect.left - 200 - (this.component.distance || 0), 10);\n placementClass = 'left';\n }\n\n this.portalContainer.style.left = `${leftPosition}px`;\n this.portalContainer.style.top = `${topPosition}px`;\n this.portalContainer.style.maxHeight = `${maxHeight}px`;\n this.portalContainer.style.pointerEvents = 'auto';\n this.portalContainer.style.width = 'auto';\n this.portalContainer.style.minWidth = 'auto';\n \n if (this.component.sync === 'width' || this.component.sync === 'both') {\n this.portalContainer.style.width = `${rect.width}px`;\n }\n \n this.portalContainer.className = `nile-dropdown-portal-append dropdown__panel--${placementClass}`;\n \n this.calculateAndSetAutoSizeProperties(rect, topPosition, placementClass);\n }\n\n private calculateAndSetAutoSizeProperties(rect: DOMRect, topPosition: number, placementClass: string): void {\n if (!this.portalContainer) return;\n\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n \n let availableHeight: number;\n let availableWidth: number = viewportWidth - rect.left - 10;\n \n if (placementClass === 'top') {\n availableHeight = rect.top - 10;\n } else if (placementClass === 'bottom') {\n availableHeight = viewportHeight - rect.bottom - 10;\n } else if (placementClass === 'left') {\n availableHeight = Math.min(viewportHeight - rect.top, rect.bottom);\n availableWidth = rect.left - 10;\n } else {\n availableHeight = Math.min(viewportHeight - rect.top, rect.bottom);\n availableWidth = viewportWidth - rect.right - 10;\n }\n \n this.portalContainer.style.setProperty('--auto-size-available-height', `${Math.max(availableHeight, 100)}px`);\n this.portalContainer.style.setProperty('--auto-size-available-width', `${Math.max(availableWidth, 200)}px`);\n }\n\n updatePortalAppendPosition(): void {\n if (this.component.portal && this.portalContainer) {\n this.positionPortalAppend();\n }\n }\n\n handleWindowResize(): void {\n if (this.component.portal && this.portalContainer) {\n this.positionPortalAppend();\n }\n }\n\n private setupAutoUpdatePositioning(): void {\n if (!this.portalContainer || !this.component) return;\n\n this.cleanupAutoUpdatePositioning();\n\n const referenceElement = this.component.shadowRoot?.querySelector('[slot=\"anchor\"]')?.assignedElements({ flatten: true })[0] as HTMLElement || \n this.component.querySelector('[slot=\"trigger\"]')?.assignedElements({ flatten: true })[0] as HTMLElement ||\n this.component;\n\n this.cleanupAutoUpdate = autoUpdate(\n referenceElement,\n this.portalContainer,\n () => {\n this.computeFloatingUIPosition();\n },\n {\n ancestorScroll: true,\n ancestorResize: true,\n elementResize: true,\n layoutShift: true,\n animationFrame: true\n }\n );\n }\n\n private cleanupAutoUpdatePositioning(): void {\n if (this.cleanupAutoUpdate) {\n this.cleanupAutoUpdate();\n this.cleanupAutoUpdate = null;\n }\n }\n\n private injectStylesToDocument(): void {\n if (!this.portalContainer) return;\n\n const styleId = PortalUtils.generateStyleId();\n \n if (document.getElementById(styleId)) return;\n\n const componentStyles = (this.component.constructor as any).styles;\n if (!componentStyles) return;\n\n const styleElement = document.createElement('style');\n styleElement.id = styleId;\n styleElement.textContent = PortalUtils.extractStylesAsCSS(componentStyles);\n \n document.head.appendChild(styleElement);\n \n (this.portalContainer as any).__injectedStyleId = styleId;\n }\n\n private adoptStylesToPortalAppend(): void {\n if (!this.portalContainer) return;\n this.injectStylesToDocument();\n }\n\n setupPortalAppend(): void {\n if (!this.component.portal) return;\n\n this.component.updateComplete.then(() => {\n setTimeout(() => {\n if (this.component.open) {\n this.clonedPanel = this.createPortalPanel();\n \n this.portalContainer = this.createPortalAppendContainer();\n this.portalContainer.appendChild(this.clonedPanel);\n document.body.appendChild(this.portalContainer);\n \n this.adoptStylesToPortalAppend();\n \n this.clonedPanel.style.display = '';\n this.positionPortalAppend();\n \n this.setupPortalEventListeners();\n \n this.setupAutoUpdatePositioning();\n \n this.boundHandleWindowResize = this.handleWindowResize.bind(this);\n window.addEventListener('resize', this.boundHandleWindowResize);\n }\n }, 10);\n });\n }\n\n private createPortalPanel(): HTMLElement {\n return PortalContentUtils.createPortalPanel(this.component);\n }\n\n private setupPortalEventListeners(): void {\n PortalEventUtils.setupPortalEventListeners(this.clonedPanel!, this.component);\n }\n\n cleanupPortalAppend(): void {\n this.cleanupAutoUpdatePositioning();\n \n if (this.portalContainer && this.portalContainer.parentNode) {\n const injectedStyleId = (this.portalContainer as any).__injectedStyleId;\n if (injectedStyleId) {\n const styleElement = document.getElementById(injectedStyleId);\n if (styleElement) {\n styleElement.remove();\n }\n }\n \n this.portalContainer.parentNode.removeChild(this.portalContainer);\n }\n \n if (this.boundHandleWindowResize) {\n window.removeEventListener('resize', this.boundHandleWindowResize);\n this.boundHandleWindowResize = null;\n }\n \n this.portalContainer = null;\n this.clonedPanel = null;\n this.measuredPanelHeight = null;\n this.currentPlacement = 'bottom-start';\n this.currentMiddlewareData = null;\n }\n\n get portalContainerElement(): HTMLElement | null {\n return this.portalContainer;\n }\n\n resetMeasuredHeight(): void {\n this.measuredPanelHeight = null;\n }\n\n forceReposition(): void {\n if (this.portalContainer) {\n this.computeFloatingUIPosition();\n }\n }\n\n getCurrentPlacement(): Placement {\n return this.currentPlacement;\n }\n\n getCurrentMiddlewareData(): MiddlewareData | null {\n return this.currentMiddlewareData;\n }\n\n isUsingFloatingUI(): boolean {\n return this.cleanupAutoUpdate !== null;\n }\n\n isPositioningOptimal(): boolean {\n if (!this.portalContainer || !this.currentMiddlewareData) return true;\n\n const referenceElement = this.component.shadowRoot?.querySelector('[slot=\"anchor\"]')?.assignedElements({ flatten: true })[0] as HTMLElement || \n this.component.querySelector('[slot=\"trigger\"]')?.assignedElements({ flatten: true })[0] as HTMLElement ||\n this.component;\n const rect = referenceElement.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n \n const isAbove = this.currentPlacement.startsWith('top');\n const isBelow = this.currentPlacement.startsWith('bottom');\n \n if (isAbove && spaceBelow > spaceAbove) return false;\n if (isBelow && spaceAbove > spaceBelow) return false;\n \n return true;\n }\n\n updatePortalPanel(): void {\n if (this.portalContainer && this.clonedPanel) {\n PortalContentUtils.updatePortalPanel(this.clonedPanel, this.component);\n // Re-setup event listeners after updating the panel content\n this.setupPortalEventListeners();\n this.forceReposition();\n }\n }\n}\n\n"],"names":["DropdownPortalManager","p","component","this","portalContainer","measuredPanelHeight","clonedPanel","cleanupAutoUpdate","currentPlacement","currentMiddlewareData","boundHandleWindowResize","_createClass","key","value","createPortalAppendContainer","container","document","createElement","style","position","zIndex","pointerEvents","width","maxWidth","minWidth","className","positionPortalAppend","open","measurePanelHeight","computeFloatingUIPosition","visibility","top","left","offsetHeight","_computeFloatingUIPosition","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this$component$shado","_this$component$query","t","i","_yield$this$calculate","_s","_o","_e","_h","wrap","_callee$","_context2","prev","next","referenceElement","shadowRoot","querySelector","assignedElements","flatten","floatingElement","calculateFloatingUIPosition","x","y","placement","middlewareData","applyFloatingUIPosition","t0","console","warn","error","fallbackPositioning","stop","_callee2","o","e","h","_callee2$","_context3","boundary","PortalUtils","findBoundaryElements","initialPlacement","getInitialPlacement","middleware","createFloatingUIMiddleware","computePosition","strategy","platform","createCustomPlatform","abrupt","sent","offset","distance","sync","push","size","apply","handleSizeMiddleware","bind","padding","flip","fallbackPlacements","getFallbackPlacements","fallbackStrategy","shift","crossAxis","availableWidth","availableHeight","elements","rects","_ref","maxHeight","calculateOptimalHeight","reference","window","innerHeight","floating","height","concat","setProperty","basePlacement","placements","startsWith","referenceRect","getBoundingClientRect","Object","assign","applyCollisionData","placementClass","split","rect","_this$component$shado2","_this$component$query2","viewportHeight","viewportWidth","innerWidth","spaceBelow","bottom","spaceAbove","spaceRight","right","spaceLeft","topPosition","leftPosition","Math","max","min","calculateAndSetAutoSizeProperties","updatePortalAppendPosition","portal","handleWindowResize","setupAutoUpdatePositioning","cleanupAutoUpdatePositioning","_this$component$shado3","_this$component$query3","autoUpdate","ancestorScroll","ancestorResize","elementResize","layoutShift","animationFrame","injectStylesToDocument","styleId","generateStyleId","getElementById","componentStyles","constructor","styles","styleElement","id","textContent","extractStylesAsCSS","head","appendChild","__injectedStyleId","adoptStylesToPortalAppend","setupPortalAppend","updateComplete","then","setTimeout","createPortalPanel","body","display","setupPortalEventListeners","addEventListener","PortalContentUtils","PortalEventUtils","cleanupPortalAppend","parentNode","injectedStyleId","remove","removeChild","removeEventListener","get","resetMeasuredHeight","forceReposition","getCurrentPlacement","getCurrentMiddlewareData","isUsingFloatingUI","isPositioningOptimal","_this$component$shado4","_this$component$query4","isAbove","isBelow","updatePortalPanel"],"mappings":"wlTAcaA,CAAAA,yBAUX,SAAAC,EAAYC,CAAAA,CAAAA,CAAAA,eAAAA,MAAAA,CAAAA,EATJC,IAAeC,CAAAA,eAAAA,CAAuB,IACtCD,CAAAA,IAAAA,CAAmBE,mBAAkB,CAAA,IAAA,CAErCF,KAAWG,WAAuB,CAAA,IAAA,CAClCH,IAAiBI,CAAAA,iBAAAA,CAAwB,IACzCJ,CAAAA,IAAAA,CAAgBK,gBAAc,CAAA,cAAA,CAC9BL,KAAqBM,qBAA0B,CAAA,IAAA,CAC/CN,IAAuBO,CAAAA,uBAAAA,CAAwB,IAGrDP,CAAAA,IAAAA,CAAKD,SAAYA,CAAAA,CAClB,EAEO,OAAAS,YAAA,CAAAV,CAAA,GAAAW,GAAA,+BAAAC,KAAA,UAAAC,2BAAAA,CAAAA,CAAAA,CACN,GAAMC,CAAAA,CAAAA,CAAYC,QAASC,CAAAA,aAAAA,CAAc,KAQzC,CAAA,CAAA,MAPAF,CAAAA,EAAUG,KAAMC,CAAAA,QAAAA,CAAW,UAC3BJ,CAAAA,CAAAA,CAAUG,KAAME,CAAAA,MAAAA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,EAAAA,EACxBiE,GAAWjE,CAAaF,CAAAA,CAAAA,CAG7B,EAED,GAAA3H,GAAA,qBAAAC,KAAA,UAAA8L,iBAAAA,CAAAA,CACMxM,CAAAA,IAAAA,CAAKC,eAAmBD,EAAAA,IAAAA,CAAKG,cAC/BkL,CAAmBmB,CAAAA,iBAAAA,CAAkBxM,IAAKG,CAAAA,WAAAA,CAAaH,KAAKD,SAE5DC,CAAAA,CAAAA,IAAAA,CAAKmL,yBACLnL,CAAAA,CAAAA,CAAAA,IAAAA,CAAK+L,kBAER"}
|
|
1
|
+
{"version":3,"file":"portal-manager.cjs.js","sources":["../../../src/nile-dropdown/portal-manager.ts"],"sourcesContent":["import { \n autoUpdate, \n computePosition, \n flip, \n offset, \n shift, \n size,\n platform,\n type Placement,\n type MiddlewareData,\n type ComputePositionConfig\n} from '@floating-ui/dom';\nimport { PortalUtils, PortalContentUtils, PortalEventUtils } from './portal-utils';\n\nexport class DropdownPortalManager {\n private portalContainer: HTMLElement | null = null;\n private measuredPanelHeight: number | null = null;\n private component: any;\n private clonedPanel: HTMLElement | null = null;\n private cleanupAutoUpdate: (() => void) | null = null;\n private currentPlacement: Placement = 'bottom-start';\n private currentMiddlewareData: MiddlewareData | null = null;\n private boundHandleWindowResize: (() => void) | null = null;\n\n constructor(component: any) {\n this.component = component;\n }\n\n private createPortalAppendContainer(): HTMLElement {\n const container = document.createElement('div');\n container.style.position = 'absolute';\n container.style.zIndex = '9999';\n container.style.pointerEvents = 'none';\n container.style.width = 'auto';\n container.style.maxWidth = 'none';\n container.style.minWidth = 'auto';\n container.className = 'nile-dropdown-portal-append';\n return container;\n }\n\n positionPortalAppend(): void {\n if (!this.portalContainer || !this.component.open) return;\n\n this.measurePanelHeight();\n this.computeFloatingUIPosition();\n }\n\n private measurePanelHeight(): void {\n if (this.measuredPanelHeight || !this.portalContainer) return;\n\n this.portalContainer.style.position = 'absolute';\n this.portalContainer.style.visibility = 'hidden';\n this.portalContainer.style.top = '0px';\n this.portalContainer.style.left = '0px';\n \n this.portalContainer.offsetHeight;\n \n this.measuredPanelHeight = this.portalContainer.offsetHeight;\n \n this.portalContainer.style.visibility = '';\n }\n\n private async computeFloatingUIPosition(): Promise<void> {\n if (!this.portalContainer) return;\n\n const referenceElement = this.component.shadowRoot?.querySelector('[slot=\"anchor\"]')?.assignedElements({ flatten: true })[0] as HTMLElement || \n this.component.querySelector('[slot=\"trigger\"]')?.assignedElements({ flatten: true })[0] as HTMLElement ||\n this.component;\n const floatingElement = this.portalContainer;\n\n try {\n const { x, y, placement, middlewareData } = await this.calculateFloatingUIPosition(\n referenceElement,\n floatingElement\n );\n\n this.applyFloatingUIPosition(floatingElement, referenceElement, x, y, placement, middlewareData);\n\n } catch (error) {\n console.warn('Floating UI positioning failed, falling back to simple positioning:', error);\n this.fallbackPositioning();\n }\n }\n\n private async calculateFloatingUIPosition(\n referenceElement: HTMLElement,\n floatingElement: HTMLElement\n ): Promise<{ x: number; y: number; placement: Placement; middlewareData: MiddlewareData }> {\n const boundary = PortalUtils.findBoundaryElements(referenceElement);\n const initialPlacement = this.getInitialPlacement();\n const middleware = this.createFloatingUIMiddleware(boundary);\n\n return await computePosition(referenceElement, floatingElement, {\n placement: initialPlacement,\n strategy: 'fixed',\n middleware,\n platform: this.createCustomPlatform()\n });\n }\n\n private getInitialPlacement(): Placement {\n return this.component.placement || 'bottom-start';\n }\n\n private createFloatingUIMiddleware(boundary: Element[] | undefined): ComputePositionConfig['middleware'] {\n const middleware: ComputePositionConfig['middleware'] = [\n offset(this.component.distance || 0),\n ];\n\n // Add size middleware if sync is specified\n if (this.component.sync) {\n middleware.push(\n size({\n apply: this.handleSizeMiddleware.bind(this),\n padding: 10,\n boundary: boundary\n })\n );\n }\n\n // Add flip middleware\n middleware.push(\n flip({\n fallbackPlacements: this.getFallbackPlacements(),\n fallbackStrategy: 'bestFit',\n padding: 10,\n boundary: boundary\n })\n );\n\n // Add shift middleware\n middleware.push(\n shift({\n padding: 10,\n crossAxis: true,\n boundary: boundary\n })\n );\n\n return middleware;\n }\n\n private handleSizeMiddleware({ availableWidth, availableHeight, elements, rects }: {\n availableWidth: number;\n availableHeight: number;\n elements: { floating: HTMLElement };\n rects: { reference: { x: number; y: number; width: number; height: number } };\n }): void {\n const maxHeight = PortalUtils.calculateOptimalHeight(\n rects.reference,\n window.innerHeight,\n this.currentPlacement\n );\n\n if (this.component.sync === 'width' || this.component.sync === 'both') {\n elements.floating.style.width = `${rects.reference.width}px`;\n }\n if (this.component.sync === 'height' || this.component.sync === 'both') {\n elements.floating.style.height = `${rects.reference.height}px`;\n }\n\n elements.floating.style.maxHeight = `${maxHeight}px`;\n elements.floating.style.setProperty('--auto-size-available-width', `${availableWidth}px`);\n elements.floating.style.setProperty('--auto-size-available-height', `${maxHeight}px`);\n }\n\n private getFallbackPlacements(): Placement[] {\n const basePlacement = this.component.placement || 'bottom-start';\n const placements: Placement[] = [];\n \n if (basePlacement.startsWith('top')) {\n placements.push('bottom-start', 'bottom', 'bottom-end', 'top', 'top-end', 'right-start', 'left-start');\n } else if (basePlacement.startsWith('bottom')) {\n placements.push('top-start', 'top', 'top-end', 'bottom', 'bottom-end', 'right-start', 'left-start');\n } else if (basePlacement.startsWith('left')) {\n placements.push('right-start', 'right', 'right-end', 'left', 'left-end', 'top-start', 'bottom-start');\n } else if (basePlacement.startsWith('right')) {\n placements.push('left-start', 'left', 'left-end', 'right', 'right-end', 'top-start', 'bottom-start');\n }\n \n return placements;\n }\n\n private createCustomPlatform() {\n return platform;\n }\n\n private applyFloatingUIPosition(\n floatingElement: HTMLElement,\n referenceElement: HTMLElement,\n x: number,\n y: number,\n placement: Placement,\n middlewareData: MiddlewareData\n ): void {\n const referenceRect = referenceElement.getBoundingClientRect();\n \n Object.assign(floatingElement.style, {\n left: `${x}px`,\n top: `${y}px`,\n position: 'fixed',\n pointerEvents: 'auto',\n width: 'auto',\n minWidth: 'auto'\n });\n\n // Apply sync width if needed\n if (this.component.sync === 'width' || this.component.sync === 'both') {\n floatingElement.style.width = `${referenceRect.width}px`;\n }\n\n this.currentPlacement = placement;\n this.currentMiddlewareData = middlewareData;\n \n PortalUtils.applyCollisionData(floatingElement, middlewareData, placement);\n \n const placementClass = placement.split('-')[0];\n floatingElement.className = `nile-dropdown-portal-append dropdown--open dropdown__panel--${placementClass}`;\n }\n\n private fallbackPositioning(): void {\n if (!this.portalContainer) return;\n\n const referenceElement = this.component.shadowRoot?.querySelector('[slot=\"anchor\"]')?.assignedElements({ flatten: true })[0] as HTMLElement || \n this.component.querySelector('[slot=\"trigger\"]')?.assignedElements({ flatten: true })[0] as HTMLElement ||\n this.component;\n const rect = referenceElement.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n \n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n const spaceRight = viewportWidth - rect.right;\n const spaceLeft = rect.left;\n \n let topPosition: number;\n let leftPosition: number = rect.left;\n let placementClass: string;\n let maxHeight: number;\n \n const placement = this.component.placement || 'bottom-start';\n \n if (placement.startsWith('bottom')) {\n maxHeight = Math.max(spaceBelow - 20, 100);\n topPosition = rect.bottom + (this.component.distance || 0);\n placementClass = 'bottom';\n } else if (placement.startsWith('top')) {\n maxHeight = Math.max(spaceAbove - 20, 100);\n topPosition = Math.max(rect.top - maxHeight - (this.component.distance || 0), 10);\n placementClass = 'top';\n } else if (placement.startsWith('right')) {\n maxHeight = Math.max(Math.min(spaceRight, spaceBelow, spaceAbove) - 20, 100);\n topPosition = rect.top;\n leftPosition = rect.right + (this.component.distance || 0);\n placementClass = 'right';\n } else {\n maxHeight = Math.max(Math.min(spaceLeft, spaceBelow, spaceAbove) - 20, 100);\n topPosition = rect.top;\n leftPosition = Math.max(rect.left - 200 - (this.component.distance || 0), 10);\n placementClass = 'left';\n }\n\n this.portalContainer.style.left = `${leftPosition}px`;\n this.portalContainer.style.top = `${topPosition}px`;\n this.portalContainer.style.maxHeight = `${maxHeight}px`;\n this.portalContainer.style.pointerEvents = 'auto';\n this.portalContainer.style.width = 'auto';\n this.portalContainer.style.minWidth = 'auto';\n \n if (this.component.sync === 'width' || this.component.sync === 'both') {\n this.portalContainer.style.width = `${rect.width}px`;\n }\n \n this.portalContainer.className = `nile-dropdown-portal-append dropdown__panel--${placementClass}`;\n \n this.calculateAndSetAutoSizeProperties(rect, topPosition, placementClass);\n }\n\n private calculateAndSetAutoSizeProperties(rect: DOMRect, topPosition: number, placementClass: string): void {\n if (!this.portalContainer) return;\n\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n \n let availableHeight: number;\n let availableWidth: number = viewportWidth - rect.left - 10;\n \n if (placementClass === 'top') {\n availableHeight = rect.top - 10;\n } else if (placementClass === 'bottom') {\n availableHeight = viewportHeight - rect.bottom - 10;\n } else if (placementClass === 'left') {\n availableHeight = Math.min(viewportHeight - rect.top, rect.bottom);\n availableWidth = rect.left - 10;\n } else {\n availableHeight = Math.min(viewportHeight - rect.top, rect.bottom);\n availableWidth = viewportWidth - rect.right - 10;\n }\n \n this.portalContainer.style.setProperty('--auto-size-available-height', `${Math.max(availableHeight, 100)}px`);\n this.portalContainer.style.setProperty('--auto-size-available-width', `${Math.max(availableWidth, 200)}px`);\n }\n\n updatePortalAppendPosition(): void {\n if (this.component.portal && this.portalContainer) {\n this.positionPortalAppend();\n }\n }\n\n handleWindowResize(): void {\n if (this.component.portal && this.portalContainer) {\n this.positionPortalAppend();\n }\n }\n\n private setupAutoUpdatePositioning(): void {\n if (!this.portalContainer || !this.component) return;\n\n this.cleanupAutoUpdatePositioning();\n\n const referenceElement = this.component.shadowRoot?.querySelector('[slot=\"anchor\"]')?.assignedElements({ flatten: true })[0] as HTMLElement || \n this.component.querySelector('[slot=\"trigger\"]')?.assignedElements({ flatten: true })[0] as HTMLElement ||\n this.component;\n\n this.cleanupAutoUpdate = autoUpdate(\n referenceElement,\n this.portalContainer,\n () => {\n this.computeFloatingUIPosition();\n },\n {\n ancestorScroll: true,\n ancestorResize: true,\n elementResize: true,\n layoutShift: true,\n animationFrame: true\n }\n );\n }\n\n private cleanupAutoUpdatePositioning(): void {\n if (this.cleanupAutoUpdate) {\n this.cleanupAutoUpdate();\n this.cleanupAutoUpdate = null;\n }\n }\n\n private injectStylesToDocument(): void {\n if (!this.portalContainer) return;\n\n const styleId = PortalUtils.generateStyleId();\n \n if (document.getElementById(styleId)) return;\n\n const componentStyles = (this.component.constructor as any).styles;\n if (!componentStyles) return;\n\n const styleElement = document.createElement('style');\n styleElement.id = styleId;\n styleElement.textContent = PortalUtils.extractStylesAsCSS(componentStyles);\n \n document.head.appendChild(styleElement);\n \n (this.portalContainer as any).__injectedStyleId = styleId;\n }\n\n private adoptStylesToPortalAppend(): void {\n if (!this.portalContainer) return;\n this.injectStylesToDocument();\n }\n\n setupPortalAppend(): void {\n if (!this.component.portal) return;\n\n this.component.updateComplete.then(() => {\n setTimeout(() => {\n if (this.component.open) {\n this.clonedPanel = this.createPortalPanel();\n \n this.portalContainer = this.createPortalAppendContainer();\n this.portalContainer.appendChild(this.clonedPanel);\n document.body.appendChild(this.portalContainer);\n \n this.adoptStylesToPortalAppend();\n \n this.clonedPanel.style.display = '';\n this.positionPortalAppend();\n \n this.setupPortalEventListeners();\n \n this.setupAutoUpdatePositioning();\n \n this.boundHandleWindowResize = this.handleWindowResize.bind(this);\n window.addEventListener('resize', this.boundHandleWindowResize);\n }\n }, 10);\n });\n }\n\n private createPortalPanel(): HTMLElement {\n return PortalContentUtils.createPortalPanel(this.component);\n }\n\n private setupPortalEventListeners(): void {\n PortalEventUtils.setupPortalEventListeners(this.clonedPanel!, this.component);\n }\n\n cleanupPortalAppend(): void {\n this.cleanupAutoUpdatePositioning();\n \n if (this.portalContainer && this.portalContainer.parentNode) {\n const injectedStyleId = (this.portalContainer as any).__injectedStyleId;\n if (injectedStyleId) {\n const styleElement = document.getElementById(injectedStyleId);\n if (styleElement) {\n styleElement.remove();\n }\n }\n \n this.portalContainer.parentNode.removeChild(this.portalContainer);\n }\n \n if (this.boundHandleWindowResize) {\n window.removeEventListener('resize', this.boundHandleWindowResize);\n this.boundHandleWindowResize = null;\n }\n \n this.portalContainer = null;\n this.clonedPanel = null;\n this.measuredPanelHeight = null;\n this.currentPlacement = 'bottom-start';\n this.currentMiddlewareData = null;\n }\n\n get portalContainerElement(): HTMLElement | null {\n return this.portalContainer;\n }\n\n resetMeasuredHeight(): void {\n this.measuredPanelHeight = null;\n }\n\n forceReposition(): void {\n if (this.portalContainer) {\n this.computeFloatingUIPosition();\n }\n }\n\n getCurrentPlacement(): Placement {\n return this.currentPlacement;\n }\n\n getCurrentMiddlewareData(): MiddlewareData | null {\n return this.currentMiddlewareData;\n }\n\n isUsingFloatingUI(): boolean {\n return this.cleanupAutoUpdate !== null;\n }\n\n isPositioningOptimal(): boolean {\n if (!this.portalContainer || !this.currentMiddlewareData) return true;\n\n const referenceElement = this.component.shadowRoot?.querySelector('[slot=\"anchor\"]')?.assignedElements({ flatten: true })[0] as HTMLElement || \n this.component.querySelector('[slot=\"trigger\"]')?.assignedElements({ flatten: true })[0] as HTMLElement ||\n this.component;\n const rect = referenceElement.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n \n const isAbove = this.currentPlacement.startsWith('top');\n const isBelow = this.currentPlacement.startsWith('bottom');\n \n if (isAbove && spaceBelow > spaceAbove) return false;\n if (isBelow && spaceAbove > spaceBelow) return false;\n \n return true;\n }\n\n updatePortalPanel(): void {\n if (this.portalContainer && this.clonedPanel) {\n PortalContentUtils.updatePortalPanel(this.clonedPanel, this.component);\n this.forceReposition();\n }\n }\n}\n\n"],"names":["DropdownPortalManager","p","component","this","portalContainer","measuredPanelHeight","clonedPanel","cleanupAutoUpdate","currentPlacement","currentMiddlewareData","boundHandleWindowResize","_createClass","key","value","createPortalAppendContainer","container","document","createElement","style","position","zIndex","pointerEvents","width","maxWidth","minWidth","className","positionPortalAppend","open","measurePanelHeight","computeFloatingUIPosition","visibility","top","left","offsetHeight","_computeFloatingUIPosition","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this$component$shado","_this$component$query","t","i","_yield$this$calculate","_s","_o","_e","_h","wrap","_callee$","_context2","prev","next","referenceElement","shadowRoot","querySelector","assignedElements","flatten","floatingElement","calculateFloatingUIPosition","x","y","placement","middlewareData","applyFloatingUIPosition","t0","console","warn","error","fallbackPositioning","stop","_callee2","o","e","h","_callee2$","_context3","boundary","PortalUtils","findBoundaryElements","initialPlacement","getInitialPlacement","middleware","createFloatingUIMiddleware","computePosition","strategy","platform","createCustomPlatform","abrupt","sent","offset","distance","sync","push","size","apply","handleSizeMiddleware","bind","padding","flip","fallbackPlacements","getFallbackPlacements","fallbackStrategy","shift","crossAxis","availableWidth","availableHeight","elements","rects","_ref","maxHeight","calculateOptimalHeight","reference","window","innerHeight","floating","height","concat","setProperty","basePlacement","placements","startsWith","referenceRect","getBoundingClientRect","Object","assign","applyCollisionData","placementClass","split","_this$component$shado2","_this$component$query2","rect","viewportHeight","viewportWidth","innerWidth","spaceBelow","bottom","spaceAbove","spaceRight","right","spaceLeft","topPosition","leftPosition","Math","max","min","calculateAndSetAutoSizeProperties","updatePortalAppendPosition","portal","handleWindowResize","setupAutoUpdatePositioning","cleanupAutoUpdatePositioning","_this$component$query3","autoUpdate","ancestorScroll","ancestorResize","elementResize","layoutShift","animationFrame","injectStylesToDocument","styleId","generateStyleId","getElementById","componentStyles","constructor","styles","styleElement","id","textContent","extractStylesAsCSS","head","appendChild","__injectedStyleId","adoptStylesToPortalAppend","setupPortalAppend","updateComplete","then","setTimeout","createPortalPanel","body","display","setupPortalEventListeners","addEventListener","PortalContentUtils","PortalEventUtils","cleanupPortalAppend","parentNode","injectedStyleId","remove","removeChild","removeEventListener","get","portalContainerElement","resetMeasuredHeight","forceReposition","getCurrentPlacement","getCurrentMiddlewareData","isUsingFloatingUI","isPositioningOptimal","_this$component$shado4","_this$component$query4","isAbove","isBelow","updatePortalPanel"],"mappings":"w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AA,iBAAA,CAAA,UAAAgJ,sBAAA,iBAAzCpM,sBAAAA,CAA6DqD,iBAAiB,CAAEC,OAAAA,CAAAA,CAAS,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA+I,sBAAA,CACnGrM,IAAKD,CAAAA,SAAAA,CAAUqD,aAAc,CAAA,kBAAA,CAAA,UAAAiJ,sBAAA,iBAA7BrM,sBAAAA,CAAkDqD,iBAAiB,CAAEC,OAAAA,CAAAA,CAAS,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,GACtFtD,KAAKD,SACEyH,EAAAA,qBAAAA,CAAAA,CAAAA,CAExBY,CADiBtB,CAAAA,MAAAA,CAAOC,YACMiB,CAAKK,CAAAA,MAAAA,CACnCC,CAAaN,CAAAA,CAAAA,CAAKpG,GAElB0K,CAAAA,CAAAA,CAAUtM,IAAKK,CAAAA,gBAAAA,CAAiBiH,WAAW,KAC3CiF,CAAAA,CAAAA,CAAAA,CAAUvM,IAAKK,CAAAA,gBAAAA,CAAiBiH,UAAW,CAAA,QAAA,CAAA,CAEjD,MAAIgF,EAAAA,CAAAA,EAAWlE,EAAaE,CACxBiE,CAAAA,EAAAA,EAAAA,CAAAA,EAAWjE,CAAaF,CAAAA,CAAAA,CAG7B,EAED,GAAA3H,GAAA,qBAAAC,KAAA,UAAA8L,iBAAAA,CAAAA,CACMxM,CAAAA,IAAAA,CAAKC,iBAAmBD,IAAKG,CAAAA,WAAAA,GAC/BiL,CAAmBoB,CAAAA,iBAAAA,CAAkBxM,KAAKG,WAAaH,CAAAA,IAAAA,CAAKD,SAC5DC,CAAAA,CAAAA,IAAAA,CAAK+L,kBAER"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,o as i,s,f as o,a as e,p as h,b as a}from"../floating-ui.dom-cc9126da.esm.js";import{P as n,a as l,b as r}from"./portal-utils.esm.js";class p{constructor(t){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=t}createPortalAppendContainer(){const t=document.createElement("div");return t.style.position="absolute",t.style.zIndex="9999",t.style.pointerEvents="none",t.style.width="auto",t.style.maxWidth="none",t.style.minWidth="auto",t.className="nile-dropdown-portal-append",t}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const t=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,i=this.portalContainer;try{const{x:s,y:o,placement:e,middlewareData:h}=await this.calculateFloatingUIPosition(t,i);this.applyFloatingUIPosition(i,t,s,o,e,h)}catch(t){console.warn("Floating UI positioning failed, falling back to simple positioning:",t),this.fallbackPositioning()}}async calculateFloatingUIPosition(i,s){const o=n.findBoundaryElements(i),e=this.getInitialPlacement(),h=this.createFloatingUIMiddleware(o);return await t(i,s,{placement:e,strategy:"fixed",middleware:h,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(t){const h=[i(this.component.distance||0)];return this.component.sync&&h.push(s({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:t})),h.push(o({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:t})),h.push(e({padding:10,crossAxis:!0,boundary:t})),h}handleSizeMiddleware({availableWidth:t,availableHeight:i,elements:s,rects:o}){const e=n.calculateOptimalHeight(o.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(s.floating.style.width=`${o.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(s.floating.style.height=`${o.reference.height}px`),s.floating.style.maxHeight=`${e}px`,s.floating.style.setProperty("--auto-size-available-width",`${t}px`),s.floating.style.setProperty("--auto-size-available-height",`${e}px`)}getFallbackPlacements(){const t=this.component.placement||"bottom-start",i=[];return t.startsWith("top")?i.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):t.startsWith("bottom")?i.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):t.startsWith("left")?i.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):t.startsWith("right")&&i.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),i}createCustomPlatform(){return h}applyFloatingUIPosition(t,i,s,o,e,h){const a=i.getBoundingClientRect();Object.assign(t.style,{left:`${s}px`,top:`${o}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(t.style.width=`${a.width}px`),this.currentPlacement=e,this.currentMiddlewareData=h,n.applyCollisionData(t,h,e);const l=e.split("-")[0];t.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${l}`}fallbackPositioning(){if(!this.portalContainer)return;const t=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),i=window.innerHeight,s=window.innerWidth,o=i-t.bottom,e=t.top,h=s-t.right,a=t.left;let n,l,r,p=t.left;const d=this.component.placement||"bottom-start";d.startsWith("bottom")?(r=Math.max(o-20,100),n=t.bottom+(this.component.distance||0),l="bottom"):d.startsWith("top")?(r=Math.max(e-20,100),n=Math.max(t.top-r-(this.component.distance||0),10),l="top"):d.startsWith("right")?(r=Math.max(Math.min(h,o,e)-20,100),n=t.top,p=t.right+(this.component.distance||0),l="right"):(r=Math.max(Math.min(a,o,e)-20,100),n=t.top,p=Math.max(t.left-200-(this.component.distance||0),10),l="left"),this.portalContainer.style.left=`${p}px`,this.portalContainer.style.top=`${n}px`,this.portalContainer.style.maxHeight=`${r}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${t.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${l}`,this.calculateAndSetAutoSizeProperties(t,n,l)}calculateAndSetAutoSizeProperties(t,i,s){if(!this.portalContainer)return;const o=window.innerHeight,e=window.innerWidth;let h,a=e-t.left-10;"top"===s?h=t.top-10:"bottom"===s?h=o-t.bottom-10:"left"===s?(h=Math.min(o-t.top,t.bottom),a=t.left-10):(h=Math.min(o-t.top,t.bottom),a=e-t.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(h,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(a,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const t=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=a(t,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const t=n.generateStyleId();if(document.getElementById(t))return;const i=this.component.constructor.styles;if(!i)return;const s=document.createElement("style");s.id=t,s.textContent=n.extractStylesAsCSS(i),document.head.appendChild(s),this.portalContainer.t=t}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return l.createPortalPanel(this.component)}setupPortalEventListeners(){r.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const t=this.portalContainer.t;if(t){const i=document.getElementById(t);i&&i.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const t=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),i=window.innerHeight-t.bottom,s=t.top,o=this.currentPlacement.startsWith("top"),e=this.currentPlacement.startsWith("bottom");return!(o&&i>s)&&!(e&&s>i)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(l.updatePortalPanel(this.clonedPanel,this.component),this.
|
|
1
|
+
import{c as t,o as i,s,f as o,a as e,p as h,b as a}from"../floating-ui.dom-cc9126da.esm.js";import{P as n,a as l,b as r}from"./portal-utils.esm.js";class p{constructor(t){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=t}createPortalAppendContainer(){const t=document.createElement("div");return t.style.position="absolute",t.style.zIndex="9999",t.style.pointerEvents="none",t.style.width="auto",t.style.maxWidth="none",t.style.minWidth="auto",t.className="nile-dropdown-portal-append",t}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const t=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,i=this.portalContainer;try{const{x:s,y:o,placement:e,middlewareData:h}=await this.calculateFloatingUIPosition(t,i);this.applyFloatingUIPosition(i,t,s,o,e,h)}catch(t){console.warn("Floating UI positioning failed, falling back to simple positioning:",t),this.fallbackPositioning()}}async calculateFloatingUIPosition(i,s){const o=n.findBoundaryElements(i),e=this.getInitialPlacement(),h=this.createFloatingUIMiddleware(o);return await t(i,s,{placement:e,strategy:"fixed",middleware:h,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(t){const h=[i(this.component.distance||0)];return this.component.sync&&h.push(s({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:t})),h.push(o({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:t})),h.push(e({padding:10,crossAxis:!0,boundary:t})),h}handleSizeMiddleware({availableWidth:t,availableHeight:i,elements:s,rects:o}){const e=n.calculateOptimalHeight(o.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(s.floating.style.width=`${o.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(s.floating.style.height=`${o.reference.height}px`),s.floating.style.maxHeight=`${e}px`,s.floating.style.setProperty("--auto-size-available-width",`${t}px`),s.floating.style.setProperty("--auto-size-available-height",`${e}px`)}getFallbackPlacements(){const t=this.component.placement||"bottom-start",i=[];return t.startsWith("top")?i.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):t.startsWith("bottom")?i.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):t.startsWith("left")?i.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):t.startsWith("right")&&i.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),i}createCustomPlatform(){return h}applyFloatingUIPosition(t,i,s,o,e,h){const a=i.getBoundingClientRect();Object.assign(t.style,{left:`${s}px`,top:`${o}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(t.style.width=`${a.width}px`),this.currentPlacement=e,this.currentMiddlewareData=h,n.applyCollisionData(t,h,e);const l=e.split("-")[0];t.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${l}`}fallbackPositioning(){if(!this.portalContainer)return;const t=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),i=window.innerHeight,s=window.innerWidth,o=i-t.bottom,e=t.top,h=s-t.right,a=t.left;let n,l,r,p=t.left;const d=this.component.placement||"bottom-start";d.startsWith("bottom")?(r=Math.max(o-20,100),n=t.bottom+(this.component.distance||0),l="bottom"):d.startsWith("top")?(r=Math.max(e-20,100),n=Math.max(t.top-r-(this.component.distance||0),10),l="top"):d.startsWith("right")?(r=Math.max(Math.min(h,o,e)-20,100),n=t.top,p=t.right+(this.component.distance||0),l="right"):(r=Math.max(Math.min(a,o,e)-20,100),n=t.top,p=Math.max(t.left-200-(this.component.distance||0),10),l="left"),this.portalContainer.style.left=`${p}px`,this.portalContainer.style.top=`${n}px`,this.portalContainer.style.maxHeight=`${r}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${t.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${l}`,this.calculateAndSetAutoSizeProperties(t,n,l)}calculateAndSetAutoSizeProperties(t,i,s){if(!this.portalContainer)return;const o=window.innerHeight,e=window.innerWidth;let h,a=e-t.left-10;"top"===s?h=t.top-10:"bottom"===s?h=o-t.bottom-10:"left"===s?(h=Math.min(o-t.top,t.bottom),a=t.left-10):(h=Math.min(o-t.top,t.bottom),a=e-t.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(h,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(a,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const t=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=a(t,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const t=n.generateStyleId();if(document.getElementById(t))return;const i=this.component.constructor.styles;if(!i)return;const s=document.createElement("style");s.id=t,s.textContent=n.extractStylesAsCSS(i),document.head.appendChild(s),this.portalContainer.t=t}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return l.createPortalPanel(this.component)}setupPortalEventListeners(){r.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const t=this.portalContainer.t;if(t){const i=document.getElementById(t);i&&i.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const t=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),i=window.innerHeight-t.bottom,s=t.top,o=this.currentPlacement.startsWith("top"),e=this.currentPlacement.startsWith("bottom");return!(o&&i>s)&&!(e&&s>i)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(l.updatePortalPanel(this.clonedPanel,this.component),this.forceReposition())}}export{p as D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register([],function(_export,_context){"use strict";var t,e,a;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[],execute:function execute(){_export("P",t=/*#__PURE__*/function(){function t(){_classCallCheck(this,t);}return _createClass(t,null,[{key:"calculateAvailableSpace",value:function calculateAvailableSpace(_t){var e=_t.getBoundingClientRect(),a=window.innerHeight,o=window.innerWidth,
|
|
1
|
+
System.register([],function(_export,_context){"use strict";var t,e,a;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[],execute:function execute(){_export("P",t=/*#__PURE__*/function(){function t(){_classCallCheck(this,t);}return _createClass(t,null,[{key:"calculateAvailableSpace",value:function calculateAvailableSpace(_t){var e=_t.getBoundingClientRect(),a=window.innerHeight,o=window.innerWidth,s=a-e.bottom,i=e.top,n=o-e.right;return{spaceAbove:i,spaceBelow:s,spaceLeft:e.left,spaceRight:n,viewportHeight:a,viewportWidth:o};}},{key:"getOptimalPlacement",value:function getOptimalPlacement(_t2){var _this$calculateAvaila=this.calculateAvailableSpace(_t2),e=_this$calculateAvaila.spaceAbove,a=_this$calculateAvaila.spaceBelow,o=_this$calculateAvaila.spaceLeft,s=_this$calculateAvaila.spaceRight;return a>=200&&a>=e?"bottom":e>=200&&e>a?"top":s>=200&&s>=o?"right":o>=200?"left":"bottom";}},{key:"findBoundaryElements",value:function findBoundaryElements(_t3){var e=[];var a=_t3.parentElement;for(;a&&a!==document.body;){var _t4=window.getComputedStyle(a),o=_t4.overflow,s=_t4.overflowY,i=_t4.overflowX;"auto"!==o&&"scroll"!==o&&"auto"!==s&&"scroll"!==s&&"auto"!==i&&"scroll"!==i||e.push(a),(a.hasAttribute("data-floating-boundary")||a.classList.contains("floating-boundary")||a.classList.contains("scroll-container"))&&e.push(a),a=a.parentElement;}return e.length>0?e:void 0;}},{key:"calculateOptimalHeight",value:function calculateOptimalHeight(_t5,e,a){var o=e-(_t5.y+_t5.height),s=_t5.y;return a.startsWith("top")?Math.max(s-20,100):a.startsWith("bottom")?Math.max(o-20,100):(a.startsWith("left")||a.startsWith("right"),Math.max(Math.min(s,o)-20,100));}},{key:"extractStylesAsCSS",value:function extractStylesAsCSS(_t6){var _this=this;return"string"==typeof _t6?_t6:Array.isArray(_t6)?_t6.map(function(_t7){return _this.extractStylesAsCSS(_t7);}).join("\n"):_t6&&"object"==_typeof(_t6)&&_t6.cssText?_t6.cssText:"";}},{key:"generateStyleId",value:function generateStyleId(){return"nile-dropdown-styles-".concat(Math.random().toString(36).substring(2,11));}},{key:"isPositioningOptimal",value:function isPositioningOptimal(_t8,e){var _this$calculateAvaila2=this.calculateAvailableSpace(e),a=_this$calculateAvaila2.spaceAbove,o=_this$calculateAvaila2.spaceBelow,s=_this$calculateAvaila2.spaceLeft,i=_this$calculateAvaila2.spaceRight,n=_t8.startsWith("top"),l=_t8.startsWith("bottom"),r=_t8.startsWith("left"),c=_t8.startsWith("right");return!(n&&o>a)&&!(l&&a>o)&&!(r&&i>s)&&!(c&&s>i);}},{key:"applyCollisionData",value:function applyCollisionData(_t9,e,a){if(e.flip){var o=e.flip.overflows;if(_t9.setAttribute("data-placement",a),o&&o.length>0){var _e=o.map(function(_t10){return _t10.placement;}).join(",");_t9.setAttribute("data-overflow",_e);}else _t9.removeAttribute("data-overflow");}if(e.shift){var _e$shift=e.shift,_a=_e$shift.x,_o=_e$shift.y;void 0===_a||void 0===_o||0===_a&&0===_o?_t9.removeAttribute("data-shift"):_t9.setAttribute("data-shift","".concat(_a,",").concat(_o));}if(e.size){var _e$size=e.size,_a2=_e$size.availableWidth,_o2=_e$size.availableHeight;void 0!==_a2&&_t9.setAttribute("data-available-width",_a2.toString()),void 0!==_o2&&_t9.setAttribute("data-available-height",_o2.toString());}}}]);}());_export("a",e=/*#__PURE__*/function(){function e(){_classCallCheck(this,e);}return _createClass(e,null,[{key:"createPortalPanel",value:function createPortalPanel(t){var _t$shadowRoot;var _e2=(_t$shadowRoot=t.shadowRoot)===null||_t$shadowRoot===void 0?void 0:_t$shadowRoot.querySelector(".dropdown__panel");if(!_e2){var _e3=t.querySelector("[slot]");if(!_e3||"trigger"===_e3.getAttribute("slot"))return document.createElement("div");}var a=(_e2===null||_e2===void 0?void 0:_e2.assignedElements({flatten:!0}))||[];if(0===a.length){a=Array.from(t.children).filter(function(t){var _e4=t.getAttribute("slot");return!_e4||"trigger"!==_e4;});}var o=document.createElement("div");return o.className="dropdown__panel",o.setAttribute("part","panel"),o.setAttribute("aria-hidden","false"),o.setAttribute("aria-labelledby","dropdown"),a.forEach(function(t){var _e5=t.cloneNode(!0);o.appendChild(_e5);}),o;}},{key:"updatePortalPanel",value:function updatePortalPanel(t,_e6){var _e6$shadowRoot;if(!t)return;t.innerHTML="";var a=(_e6$shadowRoot=_e6.shadowRoot)===null||_e6$shadowRoot===void 0?void 0:_e6$shadowRoot.querySelector(".dropdown__panel");var o=(a===null||a===void 0?void 0:a.assignedElements({flatten:!0}))||[];if(0===o.length){o=Array.from(_e6.children).filter(function(t){var _e7=t.getAttribute("slot");return!_e7||"trigger"!==_e7;});}o.forEach(function(_e8){var a=_e8.cloneNode(!0);t.appendChild(a);});}}]);}());_export("b",a=/*#__PURE__*/function(){function a(){_classCallCheck(this,a);}return _createClass(a,null,[{key:"setupPortalEventListeners",value:function setupPortalEventListeners(t,e){t&&(this.setupMenuSelectListeners(t,e),this.setupKeyDownListeners(t,e));}},{key:"setupMenuSelectListeners",value:function setupMenuSelectListeners(t,e){t&&t.addEventListener("nile-select",function(t){var _a3=t;e.handlePanelSelect&&e.handlePanelSelect(_a3);});}},{key:"setupKeyDownListeners",value:function setupKeyDownListeners(t,e){t&&t.addEventListener("keydown",function(t){e.handleKeyDown&&e.handleKeyDown(t);});}}]);}());}};});
|
|
2
2
|
//# sourceMappingURL=portal-utils.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal-utils.cjs.js","sources":["../../../src/nile-dropdown/portal-utils.ts"],"sourcesContent":["import { \n type Placement,\n type MiddlewareData\n} from '@floating-ui/dom';\n\nexport class PortalUtils {\n static calculateAvailableSpace(referenceElement: HTMLElement): {\n spaceAbove: number;\n spaceBelow: number;\n spaceLeft: number;\n spaceRight: number;\n viewportHeight: number;\n viewportWidth: number;\n } {\n const rect = referenceElement.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n const spaceRight = viewportWidth - rect.right;\n const spaceLeft = rect.left;\n \n return { spaceAbove, spaceBelow, spaceLeft, spaceRight, viewportHeight, viewportWidth };\n }\n\n static getOptimalPlacement(referenceElement: HTMLElement): Placement {\n const { spaceAbove, spaceBelow, spaceLeft, spaceRight } = this.calculateAvailableSpace(referenceElement);\n \n if (spaceBelow >= 200 && spaceBelow >= spaceAbove) {\n return 'bottom';\n } else if (spaceAbove >= 200 && spaceAbove > spaceBelow) {\n return 'top';\n }\n \n if (spaceRight >= 200 && spaceRight >= spaceLeft) {\n return 'right';\n } else if (spaceLeft >= 200) {\n return 'left';\n }\n \n return 'bottom';\n }\n\n static findBoundaryElements(component: HTMLElement): Element[] | undefined {\n const boundaryElements: Element[] = [];\n \n let currentElement = component.parentElement;\n \n while (currentElement && currentElement !== document.body) {\n const computedStyle = window.getComputedStyle(currentElement);\n const overflow = computedStyle.overflow;\n const overflowY = computedStyle.overflowY;\n const overflowX = computedStyle.overflowX;\n \n if (overflow === 'auto' || overflow === 'scroll' || \n overflowY === 'auto' || overflowY === 'scroll' ||\n overflowX === 'auto' || overflowX === 'scroll') {\n boundaryElements.push(currentElement);\n }\n \n if (currentElement.hasAttribute('data-floating-boundary') ||\n currentElement.classList.contains('floating-boundary') ||\n currentElement.classList.contains('scroll-container')) {\n boundaryElements.push(currentElement);\n }\n \n currentElement = currentElement.parentElement;\n }\n \n return boundaryElements.length > 0 ? boundaryElements : undefined;\n }\n\n static calculateOptimalHeight(\n referenceRect: { x: number; y: number; width: number; height: number },\n viewportHeight: number,\n placement: Placement\n ): number {\n const spaceBelow = viewportHeight - (referenceRect.y + referenceRect.height);\n const spaceAbove = referenceRect.y;\n \n if (placement.startsWith('top')) {\n return Math.max(spaceAbove - 20, 100);\n } else if (placement.startsWith('bottom')) {\n return Math.max(spaceBelow - 20, 100);\n } else if (placement.startsWith('left') || placement.startsWith('right')) {\n return Math.max(Math.min(spaceAbove, spaceBelow) - 20, 100);\n }\n \n return Math.max(Math.min(spaceAbove, spaceBelow) - 20, 100);\n }\n\n static 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 static generateStyleId(): string {\n return `nile-dropdown-styles-${Math.random().toString(36).substring(2, 11)}`;\n }\n\n static isPositioningOptimal(\n placement: Placement,\n referenceElement: HTMLElement\n ): boolean {\n const { spaceAbove, spaceBelow, spaceLeft, spaceRight } = this.calculateAvailableSpace(referenceElement);\n \n const isAbove = placement.startsWith('top');\n const isBelow = placement.startsWith('bottom');\n const isLeft = placement.startsWith('left');\n const isRight = placement.startsWith('right');\n \n if (isAbove && spaceBelow > spaceAbove) return false;\n if (isBelow && spaceAbove > spaceBelow) return false;\n if (isLeft && spaceRight > spaceLeft) return false;\n if (isRight && spaceLeft > spaceRight) return false;\n \n return true;\n }\n\n static applyCollisionData(\n element: HTMLElement,\n middlewareData: MiddlewareData,\n placement: Placement\n ): void {\n if (middlewareData.flip) {\n const { overflows } = middlewareData.flip;\n \n element.setAttribute('data-placement', placement);\n \n if (overflows && overflows.length > 0) {\n const overflowPlacements = overflows.map(overflow => overflow.placement).join(',');\n element.setAttribute('data-overflow', overflowPlacements);\n } else {\n element.removeAttribute('data-overflow');\n }\n }\n\n if (middlewareData.shift) {\n const { x, y } = middlewareData.shift;\n \n if (x !== undefined && y !== undefined && (x !== 0 || y !== 0)) {\n element.setAttribute('data-shift', `${x},${y}`);\n } else {\n element.removeAttribute('data-shift');\n }\n }\n\n if (middlewareData.size) {\n const { availableWidth, availableHeight } = middlewareData.size;\n \n if (availableWidth !== undefined) {\n element.setAttribute('data-available-width', availableWidth.toString());\n }\n if (availableHeight !== undefined) {\n element.setAttribute('data-available-height', availableHeight.toString());\n }\n }\n }\n}\n\nexport class PortalContentUtils {\n static createPortalPanel(component: any): HTMLElement {\n // Find the panel slot content (typically a nile-menu)\n const panelSlot = component.shadowRoot?.querySelector('.dropdown__panel') as HTMLSlotElement;\n if (!panelSlot) {\n // Fallback: try to find in light DOM\n const slot = component.querySelector('[slot]');\n if (!slot || slot.getAttribute('slot') === 'trigger') {\n return document.createElement('div');\n }\n }\n\n // Get assigned elements from the slot\n let assignedElements: Element[] = panelSlot?.assignedElements({ flatten: true }) as Element[] || [];\n \n // If no assigned elements, try direct children that aren't in trigger slot\n if (assignedElements.length === 0) {\n const children = Array.from(component.children) as Element[];\n assignedElements = children.filter(child => {\n const slot = child.getAttribute('slot');\n return !slot || slot !== 'trigger';\n });\n }\n\n // Create a container for the cloned panel\n const panelContainer = document.createElement('div');\n panelContainer.className = 'dropdown__panel';\n panelContainer.setAttribute('part', 'panel');\n panelContainer.setAttribute('aria-hidden', 'false');\n panelContainer.setAttribute('aria-labelledby', 'dropdown');\n\n // Clone all assigned elements\n assignedElements.forEach((element: Element) => {\n const clonedElement = element.cloneNode(true) as HTMLElement;\n this.processInlineEventHandlers(clonedElement);\n panelContainer.appendChild(clonedElement);\n });\n\n return panelContainer;\n }\n\n static updatePortalPanel(clonedPanel: HTMLElement, component: any): void {\n if (!clonedPanel) return;\n\n // Clear existing content\n clonedPanel.innerHTML = '';\n\n // Re-clone the panel content\n const panelSlot = component.shadowRoot?.querySelector('.dropdown__panel') as HTMLSlotElement;\n let assignedElements: Element[] = panelSlot?.assignedElements({ flatten: true }) as Element[] || [];\n \n if (assignedElements.length === 0) {\n const children = Array.from(component.children) as Element[];\n assignedElements = children.filter(child => {\n const slot = child.getAttribute('slot');\n return !slot || slot !== 'trigger';\n });\n }\n\n assignedElements.forEach((element: Element) => {\n const clonedElement = element.cloneNode(true) as HTMLElement;\n this.processInlineEventHandlers(clonedElement);\n clonedPanel.appendChild(clonedElement);\n });\n }\n\n static processInlineEventHandlers(element: HTMLElement): void {\n const eventHandlerAttrs = ['onclick', 'onchange', 'oninput', 'onsubmit', 'onfocus', 'onblur', 'onkeydown', 'onkeyup'];\n \n eventHandlerAttrs.forEach(attr => {\n const eventType = attr.replace('on', '');\n const handler = element.getAttribute(attr);\n if (handler) {\n element.removeAttribute(attr);\n element.addEventListener(eventType, (event: Event) => {\n new Function('event', handler).call(element, event);\n });\n }\n element.querySelectorAll(`[${attr}]`).forEach(child => {\n const childHandler = child.getAttribute(attr);\n if (childHandler) {\n child.removeAttribute(attr);\n child.addEventListener(eventType, (event: Event) => {\n new Function('event', childHandler).call(child, event);\n });\n }\n });\n });\n }\n}\n\nexport class PortalEventUtils {\n static setupPortalEventListeners(clonedPanel: HTMLElement, component: any): void {\n if (!clonedPanel) return;\n\n this.setupMenuSelectListeners(clonedPanel, component);\n this.setupKeyDownListeners(clonedPanel, component);\n }\n\n static setupMenuSelectListeners(clonedPanel: HTMLElement, component: any): void {\n if (!clonedPanel) return;\n\n // Listen for nile-select events from menu items\n clonedPanel.addEventListener('nile-select', (event: Event) => {\n const customEvent = event as CustomEvent;\n // Forward the event to the original component\n if (component.handlePanelSelect) {\n component.handlePanelSelect(customEvent);\n }\n });\n }\n\n static setupKeyDownListeners(clonedPanel: HTMLElement, component: any): void {\n if (!clonedPanel) return;\n\n // Listen for keydown events (like Escape)\n clonedPanel.addEventListener('keydown', (event: KeyboardEvent) => {\n if (component.handleKeyDown) {\n component.handleKeyDown(event);\n }\n });\n }\n}\n\n"],"names":["PortalUtils","calculateAvailableSpace","referenceElement","rect","getBoundingClientRect","viewportHeight","window","innerHeight","viewportWidth","innerWidth","spaceBelow","bottom","spaceAbove","top","spaceRight","right","spaceLeft","left","o","key","value","getOptimalPlacement","_this$calculateAvaila","this","findBoundaryElements","component","boundaryElements","currentElement","parentElement","document","body","computedStyle","getComputedStyle","overflow","overflowY","overflowX","push","hasAttribute","classList","contains","length","undefined","calculateOptimalHeight","referenceRect","placement","y","height","startsWith","Math","max","min","extractStylesAsCSS","styles","_this","Array","isArray","map","style","join","_typeof","cssText","generateStyleId","concat","random","toString","substring","isPositioningOptimal","_this$calculateAvaila2","isAbove","isBelow","isLeft","isRight","applyCollisionData","element","middlewareData","flip","overflows","setAttribute","overflowPlacements","removeAttribute","shift","_e$shift","x","size","_e$size","availableWidth","availableHeight","PortalContentUtils","createPortalPanel","panelSlot","shadowRoot","querySelector","slot","getAttribute","createElement","assignedElements","flatten","from","children","filter","child","panelContainer","className","forEach","clonedElement","cloneNode","processInlineEventHandlers","appendChild","updatePortalPanel","clonedPanel","innerHTML","attr","eventType","replace","handler","addEventListener","event","Function","call","querySelectorAll","childHandler","PortalEventUtils","a","_classCallCheck","_createClass","setupPortalEventListeners","setupMenuSelectListeners","setupKeyDownListeners","customEvent","handlePanelSelect","handleKeyDown"],"mappings":"itCAKaA,iIACX,QAAOC,CAAAA,uBAAAA,CAAwBC,EAQ7B,CAAA,CAAA,GAAMC,CAAAA,EAAOD,EAAiBE,CAAAA,qBAAAA,CAAAA,CAAAA,CACxBC,CAAiBC,CAAAA,MAAAA,CAAOC,YACxBC,CAAgBF,CAAAA,MAAAA,CAAOG,UACvBC,CAAAA,CAAAA,CAAaL,EAAiBF,CAAKQ,CAAAA,MAAAA,CACnCC,CAAaT,CAAAA,CAAAA,CAAKU,IAClBC,CAAaN,CAAAA,CAAAA,CAAgBL,CAAKY,CAAAA,KAAAA,CAGxC,MAAO,CAA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,GAAA,6BAAAC,KAAA,CAAA,QAAA,CAAAyG,yBAAOA,CAA0BhB,CAA0BpF,CAAAA,CAAAA,CAAAA,CACpDoF,IAELtF,IAAKuG,CAAAA,wBAAAA,CAAyBjB,EAAapF,CAC3CF,CAAAA,CAAAA,IAAAA,CAAKwG,qBAAsBlB,CAAAA,CAAAA,CAAapF,GACzC,EAED,GAAAN,GAAA,4BAAAC,KAAA,SAAA,CAAA0G,wBAAOA,CAAyBjB,CAAAA,CAA0BpF,GACnDoF,CAGLA,EAAAA,CAAAA,CAAYM,gBAAiB,CAAA,aAAA,CAAgBC,SAAAA,GAC3C,GAAMY,CAAAA,GAAAA,CAAcZ,EAEhB3F,CAAUwG,CAAAA,iBAAAA,EACZxG,EAAUwG,iBAAkBD,CAAAA,GAAAA,CAC7B,EAEJ,CAAA,EAED,GAAA7G,GAAA,yBAAAC,KAAA,+BAAO2G,CAAsBlB,CAAAA,CAA0BpF,CAChDoF,CAAAA,CAAAA,CAAAA,EAGLA,EAAYM,gBAAiB,CAAA,SAAA,CAAYC,SAAAA,CACnC3F,CAAAA,CAAAA,CAAAA,CAAUyG,eACZzG,CAAUyG,CAAAA,aAAAA,CAAcd,EACzB,EAEJ,CAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"portal-utils.cjs.js","sources":["../../../src/nile-dropdown/portal-utils.ts"],"sourcesContent":["import { \n type Placement,\n type MiddlewareData\n} from '@floating-ui/dom';\n\nexport class PortalUtils {\n static calculateAvailableSpace(referenceElement: HTMLElement): {\n spaceAbove: number;\n spaceBelow: number;\n spaceLeft: number;\n spaceRight: number;\n viewportHeight: number;\n viewportWidth: number;\n } {\n const rect = referenceElement.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n const spaceRight = viewportWidth - rect.right;\n const spaceLeft = rect.left;\n \n return { spaceAbove, spaceBelow, spaceLeft, spaceRight, viewportHeight, viewportWidth };\n }\n\n static getOptimalPlacement(referenceElement: HTMLElement): Placement {\n const { spaceAbove, spaceBelow, spaceLeft, spaceRight } = this.calculateAvailableSpace(referenceElement);\n \n if (spaceBelow >= 200 && spaceBelow >= spaceAbove) {\n return 'bottom';\n } else if (spaceAbove >= 200 && spaceAbove > spaceBelow) {\n return 'top';\n }\n \n if (spaceRight >= 200 && spaceRight >= spaceLeft) {\n return 'right';\n } else if (spaceLeft >= 200) {\n return 'left';\n }\n \n return 'bottom';\n }\n\n static findBoundaryElements(component: HTMLElement): Element[] | undefined {\n const boundaryElements: Element[] = [];\n \n let currentElement = component.parentElement;\n \n while (currentElement && currentElement !== document.body) {\n const computedStyle = window.getComputedStyle(currentElement);\n const overflow = computedStyle.overflow;\n const overflowY = computedStyle.overflowY;\n const overflowX = computedStyle.overflowX;\n \n if (overflow === 'auto' || overflow === 'scroll' || \n overflowY === 'auto' || overflowY === 'scroll' ||\n overflowX === 'auto' || overflowX === 'scroll') {\n boundaryElements.push(currentElement);\n }\n \n if (currentElement.hasAttribute('data-floating-boundary') ||\n currentElement.classList.contains('floating-boundary') ||\n currentElement.classList.contains('scroll-container')) {\n boundaryElements.push(currentElement);\n }\n \n currentElement = currentElement.parentElement;\n }\n \n return boundaryElements.length > 0 ? boundaryElements : undefined;\n }\n\n static calculateOptimalHeight(\n referenceRect: { x: number; y: number; width: number; height: number },\n viewportHeight: number,\n placement: Placement\n ): number {\n const spaceBelow = viewportHeight - (referenceRect.y + referenceRect.height);\n const spaceAbove = referenceRect.y;\n \n if (placement.startsWith('top')) {\n return Math.max(spaceAbove - 20, 100);\n } else if (placement.startsWith('bottom')) {\n return Math.max(spaceBelow - 20, 100);\n } else if (placement.startsWith('left') || placement.startsWith('right')) {\n return Math.max(Math.min(spaceAbove, spaceBelow) - 20, 100);\n }\n \n return Math.max(Math.min(spaceAbove, spaceBelow) - 20, 100);\n }\n\n static 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 static generateStyleId(): string {\n return `nile-dropdown-styles-${Math.random().toString(36).substring(2, 11)}`;\n }\n\n static isPositioningOptimal(\n placement: Placement,\n referenceElement: HTMLElement\n ): boolean {\n const { spaceAbove, spaceBelow, spaceLeft, spaceRight } = this.calculateAvailableSpace(referenceElement);\n \n const isAbove = placement.startsWith('top');\n const isBelow = placement.startsWith('bottom');\n const isLeft = placement.startsWith('left');\n const isRight = placement.startsWith('right');\n \n if (isAbove && spaceBelow > spaceAbove) return false;\n if (isBelow && spaceAbove > spaceBelow) return false;\n if (isLeft && spaceRight > spaceLeft) return false;\n if (isRight && spaceLeft > spaceRight) return false;\n \n return true;\n }\n\n static applyCollisionData(\n element: HTMLElement,\n middlewareData: MiddlewareData,\n placement: Placement\n ): void {\n if (middlewareData.flip) {\n const { overflows } = middlewareData.flip;\n \n element.setAttribute('data-placement', placement);\n \n if (overflows && overflows.length > 0) {\n const overflowPlacements = overflows.map(overflow => overflow.placement).join(',');\n element.setAttribute('data-overflow', overflowPlacements);\n } else {\n element.removeAttribute('data-overflow');\n }\n }\n\n if (middlewareData.shift) {\n const { x, y } = middlewareData.shift;\n \n if (x !== undefined && y !== undefined && (x !== 0 || y !== 0)) {\n element.setAttribute('data-shift', `${x},${y}`);\n } else {\n element.removeAttribute('data-shift');\n }\n }\n\n if (middlewareData.size) {\n const { availableWidth, availableHeight } = middlewareData.size;\n \n if (availableWidth !== undefined) {\n element.setAttribute('data-available-width', availableWidth.toString());\n }\n if (availableHeight !== undefined) {\n element.setAttribute('data-available-height', availableHeight.toString());\n }\n }\n }\n}\n\nexport class PortalContentUtils {\n static createPortalPanel(component: any): HTMLElement {\n // Find the panel slot content (typically a nile-menu)\n const panelSlot = component.shadowRoot?.querySelector('.dropdown__panel') as HTMLSlotElement;\n if (!panelSlot) {\n // Fallback: try to find in light DOM\n const slot = component.querySelector('[slot]');\n if (!slot || slot.getAttribute('slot') === 'trigger') {\n return document.createElement('div');\n }\n }\n\n // Get assigned elements from the slot\n let assignedElements: Element[] = panelSlot?.assignedElements({ flatten: true }) as Element[] || [];\n \n // If no assigned elements, try direct children that aren't in trigger slot\n if (assignedElements.length === 0) {\n const children = Array.from(component.children) as Element[];\n assignedElements = children.filter(child => {\n const slot = child.getAttribute('slot');\n return !slot || slot !== 'trigger';\n });\n }\n\n // Create a container for the cloned panel\n const panelContainer = document.createElement('div');\n panelContainer.className = 'dropdown__panel';\n panelContainer.setAttribute('part', 'panel');\n panelContainer.setAttribute('aria-hidden', 'false');\n panelContainer.setAttribute('aria-labelledby', 'dropdown');\n\n // Clone all assigned elements\n assignedElements.forEach((element: Element) => {\n const clonedElement = element.cloneNode(true) as HTMLElement;\n panelContainer.appendChild(clonedElement);\n });\n\n return panelContainer;\n }\n\n static updatePortalPanel(clonedPanel: HTMLElement, component: any): void {\n if (!clonedPanel) return;\n\n // Clear existing content\n clonedPanel.innerHTML = '';\n\n // Re-clone the panel content\n const panelSlot = component.shadowRoot?.querySelector('.dropdown__panel') as HTMLSlotElement;\n let assignedElements: Element[] = panelSlot?.assignedElements({ flatten: true }) as Element[] || [];\n \n if (assignedElements.length === 0) {\n const children = Array.from(component.children) as Element[];\n assignedElements = children.filter(child => {\n const slot = child.getAttribute('slot');\n return !slot || slot !== 'trigger';\n });\n }\n\n assignedElements.forEach((element: Element) => {\n const clonedElement = element.cloneNode(true) as HTMLElement;\n clonedPanel.appendChild(clonedElement);\n });\n }\n}\n\nexport class PortalEventUtils {\n static setupPortalEventListeners(clonedPanel: HTMLElement, component: any): void {\n if (!clonedPanel) return;\n\n this.setupMenuSelectListeners(clonedPanel, component);\n this.setupKeyDownListeners(clonedPanel, component);\n }\n\n static setupMenuSelectListeners(clonedPanel: HTMLElement, component: any): void {\n if (!clonedPanel) return;\n\n // Listen for nile-select events from menu items\n clonedPanel.addEventListener('nile-select', (event: Event) => {\n const customEvent = event as CustomEvent;\n // Forward the event to the original component\n if (component.handlePanelSelect) {\n component.handlePanelSelect(customEvent);\n }\n });\n }\n\n static setupKeyDownListeners(clonedPanel: HTMLElement, component: any): void {\n if (!clonedPanel) return;\n\n // Listen for keydown events (like Escape)\n clonedPanel.addEventListener('keydown', (event: KeyboardEvent) => {\n if (component.handleKeyDown) {\n component.handleKeyDown(event);\n }\n });\n }\n}\n\n"],"names":["PortalUtils","t","_classCallCheck","_createClass","key","value","calculateAvailableSpace","referenceElement","rect","getBoundingClientRect","viewportHeight","window","innerHeight","viewportWidth","innerWidth","spaceBelow","bottom","spaceAbove","top","spaceRight","right","spaceLeft","left","o","getOptimalPlacement","_this$calculateAvaila","this","findBoundaryElements","component","boundaryElements","currentElement","parentElement","document","body","computedStyle","getComputedStyle","overflow","overflowY","overflowX","push","hasAttribute","classList","contains","length","undefined","calculateOptimalHeight","referenceRect","placement","y","height","startsWith","Math","max","min","extractStylesAsCSS","styles","_this","Array","isArray","map","style","join","_typeof","cssText","generateStyleId","concat","random","toString","substring","isPositioningOptimal","_this$calculateAvaila2","isAbove","isBelow","isLeft","isRight","applyCollisionData","element","middlewareData","flip","overflows","setAttribute","overflowPlacements","removeAttribute","shift","_e$shift","x","size","_e$size","availableWidth","availableHeight","_export","PortalContentUtils","createPortalPanel","_t$shadowRoot","panelSlot","shadowRoot","querySelector","slot","getAttribute","createElement","assignedElements","flatten","from","children","filter","child","panelContainer","className","forEach","clonedElement","cloneNode","appendChild","updatePortalPanel","clonedPanel","innerHTML","PortalEventUtils","a","setupPortalEventListeners","setupMenuSelectListeners","setupKeyDownListeners","addEventListener","event","customEvent","handlePanelSelect","handleKeyDown"],"mappings":"itCAKaA,CACX,kCAAAC,EAAA,EAAAC,eAAA,MAAAD,CAAA,UAAAE,YAAA,CAAAF,CAAA,QAAAG,GAAA,2BAAAC,KAAA,CAAA,QAAA,CAAAC,uBAAOA,CAAwBC,EAAAA,CAAAA,CAQ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AA,SAAA,CAAAiH,wBAAOA,CAAyBL,CAAAA,CAA0BrF,CACnDqF,CAAAA,CAAAA,CAAAA,EAGLA,CAAYO,CAAAA,gBAAAA,CAAiB,cAAgBC,SAAAA,CAC3C,CAAA,CAAA,GAAMC,CAAAA,GAAcD,CAAAA,CAAAA,CAEhB7F,CAAU+F,CAAAA,iBAAAA,EACZ/F,CAAU+F,CAAAA,iBAAAA,CAAkBD,IAC7B,EAEJ,CAAA,EAED,GAAAtH,GAAA,yBAAAC,KAAA,SAAOkH,CAAAA,qBAAAA,CAAsBN,CAA0BrF,CAAAA,CAAAA,CAAAA,CAChDqF,CAGLA,EAAAA,CAAAA,CAAYO,iBAAiB,SAAYC,CAAAA,SAAAA,CAAAA,CAAAA,CACnC7F,CAAUgG,CAAAA,aAAAA,EACZhG,EAAUgG,aAAcH,CAAAA,CAAAA,CACzB,EAEJ,CAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class t{static calculateAvailableSpace(t){const e=t.getBoundingClientRect(),a=window.innerHeight,o=window.innerWidth,
|
|
1
|
+
class t{static calculateAvailableSpace(t){const e=t.getBoundingClientRect(),a=window.innerHeight,o=window.innerWidth,s=a-e.bottom,i=e.top,n=o-e.right;return{spaceAbove:i,spaceBelow:s,spaceLeft:e.left,spaceRight:n,viewportHeight:a,viewportWidth:o}}static getOptimalPlacement(t){const{spaceAbove:e,spaceBelow:a,spaceLeft:o,spaceRight:s}=this.calculateAvailableSpace(t);return a>=200&&a>=e?"bottom":e>=200&&e>a?"top":s>=200&&s>=o?"right":o>=200?"left":"bottom"}static findBoundaryElements(t){const e=[];let a=t.parentElement;for(;a&&a!==document.body;){const t=window.getComputedStyle(a),o=t.overflow,s=t.overflowY,i=t.overflowX;"auto"!==o&&"scroll"!==o&&"auto"!==s&&"scroll"!==s&&"auto"!==i&&"scroll"!==i||e.push(a),(a.hasAttribute("data-floating-boundary")||a.classList.contains("floating-boundary")||a.classList.contains("scroll-container"))&&e.push(a),a=a.parentElement}return e.length>0?e:void 0}static calculateOptimalHeight(t,e,a){const o=e-(t.y+t.height),s=t.y;return a.startsWith("top")?Math.max(s-20,100):a.startsWith("bottom")?Math.max(o-20,100):(a.startsWith("left")||a.startsWith("right"),Math.max(Math.min(s,o)-20,100))}static extractStylesAsCSS(t){return"string"==typeof t?t:Array.isArray(t)?t.map((t=>this.extractStylesAsCSS(t))).join("\n"):t&&"object"==typeof t&&t.cssText?t.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(t,e){const{spaceAbove:a,spaceBelow:o,spaceLeft:s,spaceRight:i}=this.calculateAvailableSpace(e),n=t.startsWith("top"),l=t.startsWith("bottom"),r=t.startsWith("left"),c=t.startsWith("right");return!(n&&o>a)&&(!(l&&a>o)&&(!(r&&i>s)&&!(c&&s>i)))}static applyCollisionData(t,e,a){if(e.flip){const{overflows:o}=e.flip;if(t.setAttribute("data-placement",a),o&&o.length>0){const e=o.map((t=>t.placement)).join(",");t.setAttribute("data-overflow",e)}else t.removeAttribute("data-overflow")}if(e.shift){const{x:a,y:o}=e.shift;void 0===a||void 0===o||0===a&&0===o?t.removeAttribute("data-shift"):t.setAttribute("data-shift",`${a},${o}`)}if(e.size){const{availableWidth:a,availableHeight:o}=e.size;void 0!==a&&t.setAttribute("data-available-width",a.toString()),void 0!==o&&t.setAttribute("data-available-height",o.toString())}}}class e{static createPortalPanel(t){const e=t.shadowRoot?.querySelector(".dropdown__panel");if(!e){const e=t.querySelector("[slot]");if(!e||"trigger"===e.getAttribute("slot"))return document.createElement("div")}let a=e?.assignedElements({flatten:!0})||[];if(0===a.length){a=Array.from(t.children).filter((t=>{const e=t.getAttribute("slot");return!e||"trigger"!==e}))}const o=document.createElement("div");return o.className="dropdown__panel",o.setAttribute("part","panel"),o.setAttribute("aria-hidden","false"),o.setAttribute("aria-labelledby","dropdown"),a.forEach((t=>{const e=t.cloneNode(!0);o.appendChild(e)})),o}static updatePortalPanel(t,e){if(!t)return;t.innerHTML="";const a=e.shadowRoot?.querySelector(".dropdown__panel");let o=a?.assignedElements({flatten:!0})||[];if(0===o.length){o=Array.from(e.children).filter((t=>{const e=t.getAttribute("slot");return!e||"trigger"!==e}))}o.forEach((e=>{const a=e.cloneNode(!0);t.appendChild(a)}))}}class a{static setupPortalEventListeners(t,e){t&&(this.setupMenuSelectListeners(t,e),this.setupKeyDownListeners(t,e))}static setupMenuSelectListeners(t,e){t&&t.addEventListener("nile-select",(t=>{const a=t;e.handlePanelSelect&&e.handlePanelSelect(a)}))}static setupKeyDownListeners(t,e){t&&t.addEventListener("keydown",(t=>{e.handleKeyDown&&e.handleKeyDown(t)}))}}export{t as P,e as a,a as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-54600b35.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-empty-state.cjs.js","tslib","lit/decorators.js","lit/directives/class-map.js","./nile-empty-state.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/if-defined.js"],function(_export,_context){"use strict";var t,e,s,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){t=_fixture005CjsJs.f;e=_fixture005CjsJs.a;},function(_litStaticHtmlJs){s=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileEmptyStateCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_litDirectivesClassMapJs){},function(_nileEmptyStateCssCjsJs){},function(_internalNileElementCjsJs){},function(_litDirectivesIfDefinedJs){}],execute:function execute(){describe("NileEmptyState",function(){it("renders correctly with default properties",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return t(s(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-empty-state></nile-empty-state>"]))));case 2:i=_context2.sent;e(i.size).to.equal("md"),e(i.variant).to.equal("tonal"),e(i.icon).to.equal("error"),e(i.grayscale).to.be["false"],e(i.text).to.equal("Empty State"),e(i.subText).to.equal("No Data");case 4:case"end":return _context2.stop();}},_callee);}))),it("should reflect properties to attributes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i,a;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:i="action";_context3.next=3;return t(s(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-empty-state size=\"sm\" variant=\"flat\" icon="," grayscale text=\"Test state text\" sub-text=\"Test sub text\"></nile-empty-state>\n "])),i));case 3:a=_context3.sent;e(a.getAttribute("size")).to.equal("sm"),e(a.getAttribute("variant")).to.equal("flat"),e(a.getAttribute("icon")).to.equal(i),e(a.hasAttribute("grayscale")).to.be["true"],e(a.getAttribute("text")).to.equal("Test state text"),e(a.getAttribute("sub-text")).to.equal("Test sub text");case 5:case"end":return _context3.stop();}},_callee2);}))),it("should render different sizes correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var i,_i2,_i,a,_i3;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:i=["sm","md","lg"];_i2=0,_i=i;case 2:if(!(_i2<_i.length)){_context4.next=11;break;}a=_i[_i2];_context4.next=6;return t(s(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-empty-state size=\"","\"></nile-empty-state>"])),a));case 6:_i3=_context4.sent.shadowRoot.querySelector(".empty-state");e(_i3.classList.contains("empty-state--".concat(a))).to.be["true"];case 8:_i2++;_context4.next=2;break;case 11:case"end":return _context4.stop();}},_callee3);}))),it("should render different variants correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var i,_i5,_i4,a,_i6;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:i=["flat","content","tonal"];_i5=0,_i4=i;case 2:if(!(_i5<_i4.length)){_context5.next=11;break;}a=_i4[_i5];_context5.next=6;return t(s(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-empty-state variant=\"","\"></nile-empty-state>"])),a));case 6:_i6=_context5.sent.shadowRoot.querySelector(".empty-state__body--".concat(a));e(_i6).to.exist;case 8:_i5++;_context5.next=2;break;case 11:case"end":return _context5.stop();}},_callee4);}))),it("should render text properties correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var i,a,o,n,r;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:i="Custom Text";a="Custom SubText";_context6.next=4;return t(s(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-empty-state text="," sub-text=","></nile-empty-state>\n "])),i,a));case 4:o=_context6.sent;n=o.shadowRoot.querySelector(".empty-state__text");r=o.shadowRoot.querySelector(".empty-state__subtext");e(n.textContent).to.equal(i),e(r.textContent).to.equal(a);case 8:case"end":return _context6.stop();}},_callee5);}))),it("should render slot content",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var i;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return t(s(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-empty-state>\n <div class=\"slot-content\">Slot Content</div>\n </nile-empty-state>\n "]))));case 2:i=_context7.sent.querySelector(".slot-content");e(i).to.exist,e(i.textContent).to.equal("Slot Content");case 4:case"end":return _context7.stop();}},_callee6);})));});}};});
|
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-1c49c014.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-empty-state.cjs.js","tslib","lit/decorators.js","lit/directives/class-map.js","./nile-empty-state.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/if-defined.js"],function(_export,_context){"use strict";var t,e,s,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){t=_fixture005CjsJs.f;e=_fixture005CjsJs.a;},function(_litStaticHtmlJs){s=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileEmptyStateCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_litDirectivesClassMapJs){},function(_nileEmptyStateCssCjsJs){},function(_internalNileElementCjsJs){},function(_litDirectivesIfDefinedJs){}],execute:function execute(){describe("NileEmptyState",function(){it("renders correctly with default properties",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return t(s(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-empty-state></nile-empty-state>"]))));case 2:i=_context2.sent;e(i.size).to.equal("md"),e(i.variant).to.equal("tonal"),e(i.icon).to.equal("error"),e(i.grayscale).to.be["false"],e(i.text).to.equal("Empty State"),e(i.subText).to.equal("No Data");case 4:case"end":return _context2.stop();}},_callee);}))),it("should reflect properties to attributes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i,a;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:i="action";_context3.next=3;return t(s(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-empty-state size=\"sm\" variant=\"flat\" icon="," grayscale text=\"Test state text\" sub-text=\"Test sub text\"></nile-empty-state>\n "])),i));case 3:a=_context3.sent;e(a.getAttribute("size")).to.equal("sm"),e(a.getAttribute("variant")).to.equal("flat"),e(a.getAttribute("icon")).to.equal(i),e(a.hasAttribute("grayscale")).to.be["true"],e(a.getAttribute("text")).to.equal("Test state text"),e(a.getAttribute("sub-text")).to.equal("Test sub text");case 5:case"end":return _context3.stop();}},_callee2);}))),it("should render different sizes correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var i,_i2,_i,a,_i3;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:i=["sm","md","lg"];_i2=0,_i=i;case 2:if(!(_i2<_i.length)){_context4.next=11;break;}a=_i[_i2];_context4.next=6;return t(s(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-empty-state size=\"","\"></nile-empty-state>"])),a));case 6:_i3=_context4.sent.shadowRoot.querySelector(".empty-state");e(_i3.classList.contains("empty-state--".concat(a))).to.be["true"];case 8:_i2++;_context4.next=2;break;case 11:case"end":return _context4.stop();}},_callee3);}))),it("should render different variants correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var i,_i5,_i4,a,_i6;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:i=["flat","content","tonal"];_i5=0,_i4=i;case 2:if(!(_i5<_i4.length)){_context5.next=11;break;}a=_i4[_i5];_context5.next=6;return t(s(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-empty-state variant=\"","\"></nile-empty-state>"])),a));case 6:_i6=_context5.sent.shadowRoot.querySelector(".empty-state__body--".concat(a));e(_i6).to.exist;case 8:_i5++;_context5.next=2;break;case 11:case"end":return _context5.stop();}},_callee4);}))),it("should render text properties correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var i,a,o,n,r;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:i="Custom Text";a="Custom SubText";_context6.next=4;return t(s(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-empty-state text="," sub-text=","></nile-empty-state>\n "])),i,a));case 4:o=_context6.sent;n=o.shadowRoot.querySelector(".empty-state__text");r=o.shadowRoot.querySelector(".empty-state__subtext");e(n.textContent).to.equal(i),e(r.textContent).to.equal(a);case 8:case"end":return _context6.stop();}},_callee5);}))),it("should render slot content",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var i;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return t(s(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-empty-state>\n <div class=\"slot-content\">Slot Content</div>\n </nile-empty-state>\n "]))));case 2:i=_context7.sent.querySelector(".slot-content");e(i).to.exist,e(i.textContent).to.equal("Slot Content");case 4:case"end":return _context7.stop();}},_callee6);})));});}};});
|
|
2
2
|
//# sourceMappingURL=nile-empty-state.test.cjs.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as t,a as e}from"../fixture-
|
|
1
|
+
import{f as t,a as e}from"../fixture-985bba12.esm.js";import{html as s}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-empty-state.esm.js";import"tslib";import"lit/decorators.js";import"lit/directives/class-map.js";import"./nile-empty-state.css.esm.js";import"../internal/nile-element.esm.js";import"lit/directives/if-defined.js";describe("NileEmptyState",(()=>{it("renders correctly with default properties",(async()=>{const i=await t(s`<nile-empty-state></nile-empty-state>`);e(i.size).to.equal("md"),e(i.variant).to.equal("tonal"),e(i.icon).to.equal("error"),e(i.grayscale).to.be.false,e(i.text).to.equal("Empty State"),e(i.subText).to.equal("No Data")})),it("should reflect properties to attributes",(async()=>{const i="action",a=await t(s`
|
|
2
2
|
<nile-empty-state size="sm" variant="flat" icon=${i} grayscale text="Test state text" sub-text="Test sub text"></nile-empty-state>
|
|
3
3
|
`);e(a.getAttribute("size")).to.equal("sm"),e(a.getAttribute("variant")).to.equal("flat"),e(a.getAttribute("icon")).to.equal(i),e(a.hasAttribute("grayscale")).to.be.true,e(a.getAttribute("text")).to.equal("Test state text"),e(a.getAttribute("sub-text")).to.equal("Test sub text")})),it("should render different sizes correctly",(async()=>{const i=["sm","md","lg"];for(const a of i){const i=(await t(s`<nile-empty-state size="${a}"></nile-empty-state>`)).shadowRoot.querySelector(".empty-state");e(i.classList.contains(`empty-state--${a}`)).to.be.true}})),it("should render different variants correctly",(async()=>{const i=["flat","content","tonal"];for(const a of i){const i=(await t(s`<nile-empty-state variant="${a}"></nile-empty-state>`)).shadowRoot.querySelector(`.empty-state__body--${a}`);e(i).to.exist}})),it("should render text properties correctly",(async()=>{const i="Custom Text",a="Custom SubText",o=await t(s`
|
|
4
4
|
<nile-empty-state text=${i} sub-text=${a}></nile-empty-state>
|