@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
package/dist/index.js
CHANGED
|
@@ -5680,7 +5680,7 @@ class QM{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
|
|
|
5680
5680
|
max-width: var(--auto-size-available-width) !important;
|
|
5681
5681
|
max-height: var(--auto-size-available-height) !important;
|
|
5682
5682
|
}
|
|
5683
|
-
`;let Mn=class{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}},nn=class{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const M=document.createElement("div");return M.className="dropdown__panel",M.setAttribute("part","panel"),M.setAttribute("aria-hidden","false"),M.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);this.processInlineEventHandlers(t),M.appendChild(t)})),M}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let M=i?.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}M.forEach((t=>{const i=t.cloneNode(!0);this.processInlineEventHandlers(i),e.appendChild(i)}))}static processInlineEventHandlers(e){["onclick","onchange","oninput","onsubmit","onfocus","onblur","onkeydown","onkeyup"].forEach((t=>{const i=t.replace("on",""),M=e.getAttribute(t);M&&(e.removeAttribute(t),e.addEventListener(i,(t=>{new Function("event",M).call(e,t)}))),e.querySelectorAll(`[${t}]`).forEach((e=>{const M=e.getAttribute(t);M&&(e.removeAttribute(t),e.addEventListener(i,(t=>{new Function("event",M).call(e,t)})))}))}))}},on=class{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}};class rn{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}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 e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=Mn.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[Bi(this.component.distance||0)];return this.component.sync&&t.push(Fi({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(Gi({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:M}){const n=Mn.calculateOptimalHeight(M.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${M.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${M.reference.height}px`),i.floating.style.maxHeight=`${n}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${n}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return Wi}applyFloatingUIPosition(e,t,i,M,n,o){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=n,this.currentMiddlewareData=o,Mn.applyCollisionData(e,o,n);const s=n.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,M=t-e.bottom,n=e.top,o=i-e.right,r=e.left;let s,a,l,N=e.left;const g=this.component.placement||"bottom-start";g.startsWith("bottom")?(l=Math.max(M-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):g.startsWith("top")?(l=Math.max(n-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):g.startsWith("right")?(l=Math.max(Math.min(o,M,n)-20,100),s=e.top,N=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,M,n)-20,100),s=e.top,N=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${N}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}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=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,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 e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=Ri(e,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 e=Mn.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=Mn.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}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 nn.createPortalPanel(this.component)}setupPortalEventListeners(){on.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.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 e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(nn.updatePortalPanel(this.clonedPanel,this.component),this.setupPortalEventListeners(),this.forceReposition())}}let sn=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.noOpenOnClick=!1,this.skidding=0,this.hoist=!1,this.portal=!1,this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.portalManager=null}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new rn(this))}))}async firstUpdated(e){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0),await this.updateComplete;const t=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new tM({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===e.key){if(this.open&&"nile-menu-item"===document.activeElement?.tagName.toLowerCase())return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),M=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.noOpenOnClick||(this.open?this.hide():(this.show(),this.focusOnTrigger()))}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new rn(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.visibilityManager?.setup(),this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new rn(this),this.portalManager.setupPortalAppend()),await jt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await jt(this),!this.portal){const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return R`
|
|
5683
|
+
`;let Mn=class{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}},nn=class{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const M=document.createElement("div");return M.className="dropdown__panel",M.setAttribute("part","panel"),M.setAttribute("aria-hidden","false"),M.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);M.appendChild(t)})),M}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let M=i?.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}M.forEach((t=>{const i=t.cloneNode(!0);e.appendChild(i)}))}},on=class{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}};class rn{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}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 e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=Mn.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[Bi(this.component.distance||0)];return this.component.sync&&t.push(Fi({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(Gi({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:M}){const n=Mn.calculateOptimalHeight(M.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${M.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${M.reference.height}px`),i.floating.style.maxHeight=`${n}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${n}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return Wi}applyFloatingUIPosition(e,t,i,M,n,o){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=n,this.currentMiddlewareData=o,Mn.applyCollisionData(e,o,n);const s=n.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,M=t-e.bottom,n=e.top,o=i-e.right,r=e.left;let s,a,l,N=e.left;const g=this.component.placement||"bottom-start";g.startsWith("bottom")?(l=Math.max(M-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):g.startsWith("top")?(l=Math.max(n-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):g.startsWith("right")?(l=Math.max(Math.min(o,M,n)-20,100),s=e.top,N=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,M,n)-20,100),s=e.top,N=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${N}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}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=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,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 e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=Ri(e,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 e=Mn.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=Mn.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}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 nn.createPortalPanel(this.component)}setupPortalEventListeners(){on.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.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 e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(nn.updatePortalPanel(this.clonedPanel,this.component),this.forceReposition())}}let sn=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.noOpenOnClick=!1,this.skidding=0,this.hoist=!1,this.portal=!1,this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.portalManager=null}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new rn(this))}))}async firstUpdated(e){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0),await this.updateComplete;const t=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new tM({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===e.key){if(this.open&&"nile-menu-item"===document.activeElement?.tagName.toLowerCase())return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),M=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.noOpenOnClick||(this.open?this.hide():(this.show(),this.focusOnTrigger()))}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new rn(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.visibilityManager?.setup(),this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new rn(this),this.portalManager.setupPortalAppend()),await jt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await jt(this),!this.portal){const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return R`
|
|
5684
5684
|
<nile-popup
|
|
5685
5685
|
part="base"
|
|
5686
5686
|
id="dropdown"
|
|
@@ -14701,7 +14701,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
14701
14701
|
|
|
14702
14702
|
|
|
14703
14703
|
|
|
14704
|
-
`,bS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"};let fS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),xS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(CS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=bS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?ES(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){ES(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=OS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&SS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;pS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":xS(this.editorEl,"strong");break;case"italic":xS(this.editorEl,"em");break;case"underline":xS(this.editorEl,"u");break;case"left":pS(this.editorEl,"left");break;case"center":pS(this.editorEl,"center");break;case"right":pS(this.editorEl,"right");break;case"justify":pS(this.editorEl,"justify");break;case"ul":kS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":kS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=OS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=LS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=LS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],fS.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],fS.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],fS.prototype,"singleLineEditor",void 0),e([ce({type:String})],fS.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],fS.prototype,"mentions",void 0),e([De()],fS.prototype,"content",void 0),fS=e([Ne("nile-rich-text-editor")],fS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.3.1-beta-1"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const vS=r`
|
|
14704
|
+
`,bS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"};let fS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),xS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(CS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=bS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?ES(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){ES(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=OS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&SS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;pS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":xS(this.editorEl,"strong");break;case"italic":xS(this.editorEl,"em");break;case"underline":xS(this.editorEl,"u");break;case"left":pS(this.editorEl,"left");break;case"center":pS(this.editorEl,"center");break;case"right":pS(this.editorEl,"right");break;case"justify":pS(this.editorEl,"justify");break;case"ul":kS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":kS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=OS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=LS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=LS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],fS.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],fS.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],fS.prototype,"singleLineEditor",void 0),e([ce({type:String})],fS.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],fS.prototype,"mentions",void 0),e([De()],fS.prototype,"content",void 0),fS=e([Ne("nile-rich-text-editor")],fS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.3.1-beta-1.1"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const vS=r`
|
|
14705
14705
|
:host {
|
|
14706
14706
|
--sidebar-width: 240px;
|
|
14707
14707
|
--sidebar-collapsed-width: 70px;
|
|
@@ -14710,7 +14710,8 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
14710
14710
|
display: flex;
|
|
14711
14711
|
flex-direction: column;
|
|
14712
14712
|
background-color: var(--nile-colors-neutral-100);
|
|
14713
|
-
|
|
14713
|
+
height: 100%;
|
|
14714
|
+
overflow: hidden;
|
|
14714
14715
|
transition: width 0.25s ease, transform 0.25s ease;
|
|
14715
14716
|
z-index: 1000;
|
|
14716
14717
|
}
|
|
@@ -14736,15 +14737,6 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
14736
14737
|
transform: translateX(calc(var(--sidebar-width) - var(--sidebar-collapsed-width)));
|
|
14737
14738
|
}
|
|
14738
14739
|
|
|
14739
|
-
|
|
14740
|
-
|
|
14741
|
-
::slotted(*) {
|
|
14742
|
-
display: block;
|
|
14743
|
-
min-width: 0;
|
|
14744
|
-
/* padding: var(--nile-spacing-xl) */
|
|
14745
|
-
}
|
|
14746
|
-
|
|
14747
|
-
|
|
14748
14740
|
:host {
|
|
14749
14741
|
scrollbar-width: thin;
|
|
14750
14742
|
scrollbar-color: #64748b transparent;
|
|
@@ -14760,35 +14752,44 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
14760
14752
|
background-color: #64748b;
|
|
14761
14753
|
border-radius: 10px;
|
|
14762
14754
|
}
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
|
|
14755
|
+
|
|
14756
|
+
|
|
14757
|
+
.scroll-container {
|
|
14758
|
+
flex: 1;
|
|
14759
|
+
overflow-y: auto;
|
|
14760
|
+
overflow-x: hidden;
|
|
14761
|
+
display: flex;
|
|
14762
|
+
flex-direction: column;
|
|
14767
14763
|
}
|
|
14768
14764
|
|
|
14769
|
-
|
|
14770
|
-
|
|
14771
|
-
|
|
14765
|
+
|
|
14766
|
+
::slotted(nile-side-bar-header) {
|
|
14767
|
+
flex-shrink: 0;
|
|
14772
14768
|
}
|
|
14769
|
+
|
|
14773
14770
|
::slotted(nile-side-bar-footer) {
|
|
14774
|
-
|
|
14775
|
-
|
|
14776
|
-
|
|
14777
|
-
:
|
|
14778
|
-
justify-content: center;
|
|
14779
|
-
padding: 0;
|
|
14771
|
+
flex-shrink: 0;
|
|
14772
|
+
position: sticky;
|
|
14773
|
+
bottom: 0;
|
|
14774
|
+
margin-top: auto;
|
|
14780
14775
|
}
|
|
14781
14776
|
|
|
14782
|
-
|
|
14783
|
-
|
|
14784
|
-
|
|
14785
|
-
}
|
|
14777
|
+
|
|
14778
|
+
|
|
14779
|
+
|
|
14786
14780
|
|
|
14787
14781
|
|
|
14788
14782
|
|
|
14789
14783
|
|
|
14790
14784
|
|
|
14791
|
-
|
|
14785
|
+
|
|
14786
|
+
`;let US=class extends Re{constructor(){super(...arguments),this.position="left",this.collapsed=!1,this.fullHeight=!1,this.width=null,this.collapsedWidth=null}static get styles(){return[vS]}updated(e){super.updated(e),e.has("collapsed")&&this.querySelectorAll("nile-side-bar-footer-item, nile-side-bar-group-item, nile-side-bar-group").forEach((e=>e.toggleAttribute("collapsed",this.collapsed))),e.has("width")&&null!==this.width&&this.style.setProperty("--sidebar-width",`${this.width}px`),e.has("collapsedWidth")&&null!==this.collapsedWidth&&this.style.setProperty("--sidebar-collapsed-width",`${this.collapsedWidth}px`)}render(){return R`
|
|
14787
|
+
<slot name="header"></slot>
|
|
14788
|
+
<div class="scroll-container">
|
|
14789
|
+
<slot></slot>
|
|
14790
|
+
</div>
|
|
14791
|
+
<slot name="footer"></slot>
|
|
14792
|
+
`}};e([ce({type:String,reflect:!0,attribute:!0})],US.prototype,"position",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],US.prototype,"collapsed",void 0),e([ce({type:Boolean,reflect:!0,attribute:!0})],US.prototype,"fullHeight",void 0),e([ce({type:Number,attribute:!0})],US.prototype,"width",void 0),e([ce({type:Number,attribute:!0})],US.prototype,"collapsedWidth",void 0),US=e([Ne("nile-side-bar")],US);const YS=r`
|
|
14792
14793
|
:host {
|
|
14793
14794
|
display: flex;
|
|
14794
14795
|
align-items: center;
|
|
@@ -14882,8 +14883,8 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
14882
14883
|
display: flex;
|
|
14883
14884
|
align-items: center;
|
|
14884
14885
|
justify-content: center;
|
|
14885
|
-
width:
|
|
14886
|
-
height:
|
|
14886
|
+
width: 38px;
|
|
14887
|
+
height: 38px;
|
|
14887
14888
|
border: none;
|
|
14888
14889
|
background: transparent;
|
|
14889
14890
|
color: inherit;
|
|
@@ -14892,9 +14893,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
14892
14893
|
transition: background-color 0.2s ease;
|
|
14893
14894
|
}
|
|
14894
14895
|
|
|
14895
|
-
|
|
14896
|
-
background-color: rgba(255, 255, 255, 0.1);
|
|
14897
|
-
}
|
|
14896
|
+
|
|
14898
14897
|
|
|
14899
14898
|
nile-tooltip::part(body) {
|
|
14900
14899
|
width: max-content;
|
|
@@ -14905,26 +14904,25 @@ nile-tooltip::part(body) {
|
|
|
14905
14904
|
|
|
14906
14905
|
|
|
14907
14906
|
|
|
14908
|
-
`;let RS=class extends Re{constructor(){super(...arguments),this.collapsed=!1}static get styles(){return[PS]}connectedCallback(){super.connectedCallback();const e=this.closest("nile-side-bar");e&&(this.collapsed=e.hasAttribute("collapsed"))}toggleSidebar(){const e=this.closest("nile-side-bar");if(!e)return;e.hasAttribute("collapsed")?(e.removeAttribute("collapsed"),this.collapsed=!1):(e.setAttribute("collapsed",""),this.collapsed=!0)}render(){return R`
|
|
14907
|
+
`;let RS=class extends Re{constructor(){super(...arguments),this.collapsed=!1,this.expandTooltipText="Expand Sidebar",this.collapseTooltipText="Collapse Sidebar"}static get styles(){return[PS]}connectedCallback(){super.connectedCallback();const e=this.closest("nile-side-bar");e&&(this.collapsed=e.hasAttribute("collapsed"))}toggleSidebar(){const e=this.closest("nile-side-bar");if(!e)return;e.hasAttribute("collapsed")?(e.removeAttribute("collapsed"),this.collapsed=!1):(e.setAttribute("collapsed",""),this.collapsed=!0)}render(){return R`
|
|
14909
14908
|
<button class="expand-btn" @click=${this.toggleSidebar}>
|
|
14910
14909
|
${this.collapsed?R`
|
|
14911
|
-
<nile-tooltip placement="right" hoist content
|
|
14910
|
+
<nile-lite-tooltip placement="right" hoist content=${this.expandTooltipText}>
|
|
14912
14911
|
<span part="icon"><nile-icon name="moveright"></nile-icon></span>
|
|
14913
|
-
</nile-tooltip>
|
|
14912
|
+
</nile-lite-tooltip>
|
|
14914
14913
|
`:R`
|
|
14915
|
-
<nile-tooltip placement="right" hoist content
|
|
14914
|
+
<nile-lite-tooltip placement="right" hoist content=${this.collapseTooltipText}>
|
|
14916
14915
|
<span part="icon"><nile-icon name="moveleft"></nile-icon></span>
|
|
14917
|
-
</nile-tooltip>
|
|
14916
|
+
</nile-lite-tooltip>
|
|
14918
14917
|
`}
|
|
14919
14918
|
</button>
|
|
14920
|
-
`}};e([ce({type:Boolean,reflect:!0})],RS.prototype,"collapsed",void 0),RS=e([Ne("nile-side-bar-expand")],RS);const BS=r`
|
|
14919
|
+
`}};e([ce({type:Boolean,reflect:!0})],RS.prototype,"collapsed",void 0),e([ce({type:String,reflect:!0,attribute:!0})],RS.prototype,"expandTooltipText",void 0),e([ce({type:String,reflect:!0,attribute:!0})],RS.prototype,"collapseTooltipText",void 0),RS=e([Ne("nile-side-bar-expand")],RS);const BS=r`
|
|
14921
14920
|
:host {
|
|
14922
14921
|
display: flex;
|
|
14923
14922
|
flex-direction: column;
|
|
14924
14923
|
padding-bottom: var(--nile-spacing-xs);
|
|
14925
|
-
padding-left: var(--nile-spacing-
|
|
14926
|
-
padding-right: var(--nile-spacing-
|
|
14927
|
-
gap: var(--nile-spacing-lg);
|
|
14924
|
+
padding-left: var(--nile-spacing-xl);
|
|
14925
|
+
padding-right: var(--nile-spacing-xl);
|
|
14928
14926
|
}
|
|
14929
14927
|
|
|
14930
14928
|
|
|
@@ -14944,10 +14942,8 @@ nile-tooltip::part(body) {
|
|
|
14944
14942
|
display: block;
|
|
14945
14943
|
height: 1px;
|
|
14946
14944
|
background: var(--nile-colors-neutral-400);
|
|
14947
|
-
margin-top: var(--nile-spacing-xs);
|
|
14948
14945
|
margin-left: var(--nile-spacing-md);
|
|
14949
14946
|
margin-right: var(--nile-spacing-md);
|
|
14950
|
-
|
|
14951
14947
|
}
|
|
14952
14948
|
|
|
14953
14949
|
.side-bar-group {
|
|
@@ -14977,60 +14973,62 @@ justify-content: center;
|
|
|
14977
14973
|
<slot></slot>
|
|
14978
14974
|
</section>
|
|
14979
14975
|
`}};e([ce({type:String})],GS.prototype,"label",void 0),e([ce({type:Boolean,reflect:!0})],GS.prototype,"footer",void 0),e([ce({type:Boolean,reflect:!0})],GS.prototype,"divider",void 0),GS=e([Ne("nile-side-bar-group")],GS);const _S=r`
|
|
14980
|
-
|
|
14981
|
-
|
|
14982
|
-
}
|
|
14983
|
-
|
|
14984
|
-
.group-item {
|
|
14985
|
-
display: flex;
|
|
14986
|
-
flex-direction: column;
|
|
14987
|
-
}
|
|
14988
|
-
|
|
14989
|
-
.item-link {
|
|
14990
|
-
display: flex;
|
|
14991
|
-
align-items: center;
|
|
14992
|
-
padding-top: var(--nile-spacing-lg);
|
|
14993
|
-
padding-bottom: var(--nile-spacing-lg);
|
|
14994
|
-
padding-left: var(--nile-spacing-md);
|
|
14995
|
-
padding-right: var(--nile-spacing-md);
|
|
14996
|
-
cursor: pointer;
|
|
14997
|
-
color: var(--nile-colors-dark-900);
|
|
14998
|
-
text-decoration: none;
|
|
14999
|
-
font-size: var(--nile-type-scale-3);
|
|
15000
|
-
line-height: 1.4;
|
|
15001
|
-
}
|
|
14976
|
+
:host {
|
|
14977
|
+
display: block;
|
|
14978
|
+
}
|
|
15002
14979
|
|
|
15003
|
-
.item
|
|
15004
|
-
|
|
15005
|
-
|
|
15006
|
-
|
|
14980
|
+
.group-item {
|
|
14981
|
+
display: flex;
|
|
14982
|
+
flex-direction: column;
|
|
14983
|
+
height: 38px;
|
|
14984
|
+
width: 208px;
|
|
14985
|
+
overflow: hidden;
|
|
14986
|
+
}
|
|
15007
14987
|
|
|
14988
|
+
.item-link {
|
|
14989
|
+
display: flex;
|
|
14990
|
+
align-items: center;
|
|
14991
|
+
justify-content: flex-start;
|
|
14992
|
+
height: 100%;
|
|
14993
|
+
width: 100%;
|
|
14994
|
+
padding: var(--nile-spacing-lg) var(--nile-spacing-md);
|
|
14995
|
+
cursor: pointer;
|
|
14996
|
+
color: var(--nile-colors-dark-900);
|
|
14997
|
+
text-decoration: none;
|
|
14998
|
+
font-size: var(--nile-type-scale-3);
|
|
14999
|
+
line-height: 1.4;
|
|
15000
|
+
box-sizing: border-box;
|
|
15001
|
+
}
|
|
15008
15002
|
|
|
15003
|
+
.item-link:hover {
|
|
15004
|
+
background: var(--nile-colors-neutral-400);
|
|
15005
|
+
border-radius: var(--nile-radius-sm);
|
|
15006
|
+
}
|
|
15009
15007
|
|
|
15010
|
-
::slotted(nile-side-bar-group-item-icon) {
|
|
15011
|
-
|
|
15012
|
-
}
|
|
15008
|
+
::slotted(nile-side-bar-group-item-icon) {
|
|
15009
|
+
flex-shrink: 0;
|
|
15010
|
+
}
|
|
15013
15011
|
|
|
15014
|
-
::slotted(nile-side-bar-group-item-text) {
|
|
15015
|
-
|
|
15016
|
-
}
|
|
15017
|
-
:host([active]) [part="link"] {
|
|
15018
|
-
background: var(--nile-colors-primary-100);
|
|
15019
|
-
border-radius: var(--nile-radius-sm);
|
|
15020
|
-
font-weight: var(--nile-font-weight-semibold);
|
|
15021
|
-
}
|
|
15012
|
+
::slotted(nile-side-bar-group-item-text) {
|
|
15013
|
+
flex-grow: 1;
|
|
15014
|
+
}
|
|
15022
15015
|
|
|
15023
|
-
:host([
|
|
15024
|
-
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
opacity: 0.5;
|
|
15029
|
-
pointer-events: none;
|
|
15030
|
-
cursor: not-allowed;
|
|
15031
|
-
}
|
|
15016
|
+
:host([active]) [part="link"] {
|
|
15017
|
+
background: var(--nile-colors-primary-100);
|
|
15018
|
+
border-radius: var(--nile-radius-sm);
|
|
15019
|
+
font-weight: var(--nile-font-weight-semibold);
|
|
15020
|
+
}
|
|
15032
15021
|
|
|
15022
|
+
:host([collapsed]) .group-item {
|
|
15023
|
+
height: 38px;
|
|
15024
|
+
width: 38px;
|
|
15025
|
+
}
|
|
15033
15026
|
|
|
15027
|
+
:host([disabled]) .item-link {
|
|
15028
|
+
opacity: 0.5;
|
|
15029
|
+
pointer-events: none;
|
|
15030
|
+
cursor: not-allowed;
|
|
15031
|
+
}
|
|
15034
15032
|
`;let FS=class extends Re{constructor(){super(...arguments),this.href=null,this.active=!1,this.type="default",this.expanded=!1,this.disabled=!1}static get styles(){return[_S]}toggleExpand(){"dropdown"!==this.type&&"popover"!==this.type||this.disabled||(this.expanded=!this.expanded)}connectedCallback(){super.connectedCallback(),this.href&&window.location.pathname===this.href&&(this.active=!0)}handleSelect(e){if(this.disabled)return e.preventDefault(),void e.stopImmediatePropagation();this.href||e.preventDefault();const t=this.closest("nile-side-bar");t&&t.querySelectorAll("nile-side-bar-group-item[active]").forEach((e=>{e!==this&&(e.active=!1,e.expanded=!1)})),this.active=!0,"dropdown"!==this.type&&"popover"!==this.type||this.disabled||(this.expanded=!0),this.dispatchEvent(new CustomEvent("nile-click",{bubbles:!0,composed:!0,detail:{href:this.href,text:this.textContent?.trim()||"",type:this.type}}))}render(){const e="dropdown"===this.type||"popover"===this.type;return R`
|
|
15035
15033
|
<div
|
|
15036
15034
|
part="base"
|
|
@@ -15139,13 +15137,15 @@ width: 38px;
|
|
|
15139
15137
|
`;let XS=class extends Re{static get styles(){return[$S]}connectedCallback(){super.connectedCallback(),this.hasAttribute("slot")||this.setAttribute("slot","text")}render(){return R` <slot></slot> `}};XS=e([Ne("nile-side-bar-group-item-text")],XS);const qS=r`
|
|
15140
15138
|
:host {
|
|
15141
15139
|
display: block;
|
|
15142
|
-
position: sticky;
|
|
15143
15140
|
bottom: var(--nile-spacing-md);
|
|
15144
15141
|
padding-bottom: var(--nile-spacing-xl);
|
|
15145
15142
|
padding-left: var(--nile-spacing-xl);
|
|
15146
15143
|
padding-right: var(--nile-spacing-xl);
|
|
15144
|
+
padding-top: var(--nile-spacing-xs);
|
|
15147
15145
|
gap: var(--nile-spacing-md);
|
|
15148
15146
|
z-index: 10;
|
|
15147
|
+
bottom: 0;
|
|
15148
|
+
position: sticky;
|
|
15149
15149
|
background: var(--nile-colors-neutral-100);
|
|
15150
15150
|
}
|
|
15151
15151
|
|
|
@@ -15187,8 +15187,11 @@ width: 38px;
|
|
|
15187
15187
|
display: flex;
|
|
15188
15188
|
align-items: center;
|
|
15189
15189
|
justify-content: flex-start;
|
|
15190
|
-
padding:
|
|
15191
|
-
|
|
15190
|
+
padding-top: var(--nile-spacing-md);
|
|
15191
|
+
padding-bottom: var(--nile-spacing-md);
|
|
15192
|
+
padding-left: var(--nile-spacing-lg);
|
|
15193
|
+
padding-right: var(--nile-spacing-lg);
|
|
15194
|
+
font-size: var(--nile-type-scale-3);
|
|
15192
15195
|
color: var(--nile-side-bar-footer-color, #374151);
|
|
15193
15196
|
cursor: pointer;
|
|
15194
15197
|
border-radius: var(--nile-side-bar-footer-radius, 0.375rem);
|
|
@@ -15230,8 +15233,13 @@ width: 38px;
|
|
|
15230
15233
|
|
|
15231
15234
|
:host([type='support']) .footer-item {
|
|
15232
15235
|
background: var(--nile-colors-neutral-400);
|
|
15233
|
-
|
|
15236
|
+
height: 38px;
|
|
15234
15237
|
}
|
|
15238
|
+
:host([type='support'][active]) .footer-item {
|
|
15239
|
+
background: var(--nile-colors-neutral-500);
|
|
15240
|
+
}
|
|
15241
|
+
|
|
15242
|
+
|
|
15235
15243
|
|
|
15236
15244
|
:host([collapsed][type='avatar']) .footer-item {
|
|
15237
15245
|
padding: 3px;
|
|
@@ -15248,8 +15256,12 @@ width: 38px;
|
|
|
15248
15256
|
width: 38px;
|
|
15249
15257
|
}
|
|
15250
15258
|
|
|
15251
|
-
|
|
15252
|
-
|
|
15259
|
+
|
|
15260
|
+
|
|
15261
|
+
|
|
15262
|
+
|
|
15263
|
+
`;let tm=class extends Re{constructor(){super(...arguments),this.type=null}static get styles(){return[em]}handleClick(){this.dispatchEvent(new CustomEvent("nile-click",{detail:{type:this.type},bubbles:!0,composed:!0}))}render(){return R`
|
|
15264
|
+
<div part="base" class="footer-item" @click=${this.handleClick}>
|
|
15253
15265
|
<slot name="icon" part="icon"></slot>
|
|
15254
15266
|
<slot name="text" part="text"></slot>
|
|
15255
15267
|
<slot name="action" part="action"></slot>
|
|
@@ -15719,8 +15731,8 @@ width: 38px;
|
|
|
15719
15731
|
flex-direction: column;
|
|
15720
15732
|
gap: var(--nile-spacing-xs);
|
|
15721
15733
|
padding-right: var(--nile-spacing-xl);
|
|
15722
|
-
padding-top: var(--nile-spacing-
|
|
15723
|
-
padding-bottom: var(--nile-spacing-
|
|
15734
|
+
padding-top: var(--nile-spacing-3xl);
|
|
15735
|
+
padding-bottom: var(--nile-spacing-3xl);
|
|
15724
15736
|
}
|
|
15725
15737
|
|
|
15726
15738
|
nile-side-bar-action-menu {
|
|
@@ -15741,6 +15753,13 @@ width: 38px;
|
|
|
15741
15753
|
margin-left: 0;
|
|
15742
15754
|
margin-right: 0;
|
|
15743
15755
|
border-radius: 0;
|
|
15756
|
+
color: black;
|
|
15757
|
+
}
|
|
15758
|
+
|
|
15759
|
+
|
|
15760
|
+
nile-side-bar-action-menu-item[active]::part(base):hover {
|
|
15761
|
+
background: var(--nile-colors-primary-100);
|
|
15762
|
+
color: black;
|
|
15744
15763
|
}
|
|
15745
15764
|
|
|
15746
15765
|
nile-side-bar-action-menu-item::part(label) {
|
|
@@ -15749,6 +15768,7 @@ width: 38px;
|
|
|
15749
15768
|
white-space: nowrap;
|
|
15750
15769
|
overflow: hidden;
|
|
15751
15770
|
text-overflow: ellipsis;
|
|
15771
|
+
|
|
15752
15772
|
}
|
|
15753
15773
|
|
|
15754
15774
|
/* Transition for sidebar button when it is closed and opened */
|
|
@@ -15766,7 +15786,7 @@ width: 38px;
|
|
|
15766
15786
|
pointer-events: auto;
|
|
15767
15787
|
transition-delay: 0ms;
|
|
15768
15788
|
}
|
|
15769
|
-
`;let cm=class extends Re{constructor(){super(...arguments),this.collapsed=!1,this.fixed=!1,this.showTooltip=!1,this.activeIndex=-1,this.handleItemSelect=e=>{const t=e.detail.item,i=this.sidebarItems.indexOf(t);this.sidebarItems.forEach(((e,t)=>e.active=t===i)),this.activeIndex=i,this.dispatchEvent(new CustomEvent("nile-change",{detail:{selectedItem:t,index:i},bubbles:!0,composed:!0})),this.requestUpdate()}}static get styles(){return[um]}get sidebarItems(){if(!this.defaultSlot)return[];return this.defaultSlot.assignedElements({flatten:!0}).flatMap((e=>"nile-inline-sidebar-item"===e.tagName.toLowerCase()?[e]:Array.from(e.querySelectorAll("nile-inline-sidebar-item"))))}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-click",this.handleItemSelect),this.mutationObserver=new MutationObserver((()=>this.syncActiveFromItems()))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeEventListener("nile-click",this.handleItemSelect)}firstUpdated(){this.observeSidebarItems(),this.syncActiveFromItems(),this.fixed&&(this.collapsed=!1)}observeSidebarItems(){this.sidebarItems?.length&&this.mutationObserver&&this.sidebarItems.forEach((e=>this.mutationObserver.observe(e,{attributes:!0,attributeFilter:["active"]})))}syncActiveFromItems(){if(!this.sidebarItems?.length)return;const e=this.sidebarItems.findIndex((e=>e.hasAttribute("active")));-1!==e&&e!==this.activeIndex&&(this.activeIndex=e,this.requestUpdate())}toggleCollapse(){this.fixed||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}handleMenuItemClick(e){const t=this.sidebarItems[e];if(!t||t.hasAttribute("disabled"))return;this.sidebarItems.forEach(((t,i)=>t.active=i===e)),this.activeIndex=e;const i=t.textContent?.trim()||"",M=t.href;this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:t,href:M,text:i},bubbles:!0,composed:!0})),M&&(window.location.href=M),this.requestUpdate()}get menuItemsTemplate(){return this.sidebarItems?.length?this.sidebarItems.map(((e,t)=>{const i=R`
|
|
15789
|
+
`;let cm=class extends Re{constructor(){super(...arguments),this.collapsed=!1,this.fixed=!1,this.showTooltip=!1,this.activeIndex=-1,this.handleItemSelect=e=>{const t=e.detail.item,i=this.sidebarItems.indexOf(t);this.sidebarItems.forEach(((e,t)=>e.active=t===i)),this.activeIndex=i,this.dispatchEvent(new CustomEvent("nile-change",{detail:{selectedItem:t,index:i},bubbles:!0,composed:!0})),this.requestUpdate()}}static get styles(){return[um]}get sidebarItems(){if(!this.defaultSlot)return[];return this.defaultSlot.assignedElements({flatten:!0}).flatMap((e=>"nile-inline-sidebar-item"===e.tagName.toLowerCase()?[e]:Array.from(e.querySelectorAll("nile-inline-sidebar-item"))))}connectedCallback(){super.connectedCallback(),this.addEventListener("nile-click",this.handleItemSelect),this.mutationObserver=new MutationObserver((()=>this.syncActiveFromItems()))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.removeEventListener("nile-click",this.handleItemSelect)}firstUpdated(){this.observeSidebarItems(),this.syncActiveFromItems(),this.fixed&&(this.collapsed=!1)}observeSidebarItems(){this.sidebarItems?.length&&this.mutationObserver&&this.sidebarItems.forEach((e=>this.mutationObserver.observe(e,{attributes:!0,attributeFilter:["active"]})))}syncActiveFromItems(){if(!this.sidebarItems?.length)return;const e=this.sidebarItems.findIndex((e=>e.hasAttribute("active")));-1!==e&&e!==this.activeIndex&&(this.activeIndex=e,this.requestUpdate())}toggleCollapse(){this.fixed||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("nile-toggle",{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}handleMenuItemClick(e){const t=this.sidebarItems[e];if(!t||t.hasAttribute("disabled"))return;this.sidebarItems.forEach(((t,i)=>t.active=i===e)),this.activeIndex=e;const i=t.textContent?.trim()||"",M=t.href;this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:t,href:M,text:i},bubbles:!0,composed:!0})),M&&(window.location.href=M),this.requestUpdate()}get menuItemsTemplate(){return this.sidebarItems?.length?this.sidebarItems.map(((e,t)=>{const i=e.tooltip,M=e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight,n=R`
|
|
15770
15790
|
<nile-side-bar-action-menu-item
|
|
15771
15791
|
?disabled=${e.hasAttribute("disabled")}
|
|
15772
15792
|
?active=${this.activeIndex===t}
|
|
@@ -15774,11 +15794,15 @@ width: 38px;
|
|
|
15774
15794
|
>
|
|
15775
15795
|
${e.textContent}
|
|
15776
15796
|
</nile-side-bar-action-menu-item>
|
|
15777
|
-
`;return
|
|
15778
|
-
<nile-tooltip
|
|
15779
|
-
|
|
15780
|
-
|
|
15781
|
-
|
|
15797
|
+
`;return i||M?R`
|
|
15798
|
+
<nile-inline-tooltip
|
|
15799
|
+
content=${e.textContent?.trim()||""}
|
|
15800
|
+
hoist
|
|
15801
|
+
placement="right"
|
|
15802
|
+
>
|
|
15803
|
+
${n}
|
|
15804
|
+
</nile-inline-tooltip>
|
|
15805
|
+
`:n})):null}render(){return R`
|
|
15782
15806
|
<div class="sidebar" part="base">
|
|
15783
15807
|
<div class="sidebar-header" part="header">
|
|
15784
15808
|
${this.fixed?null:this.collapsed?R`
|
|
@@ -15849,6 +15873,10 @@ width: 38px;
|
|
|
15849
15873
|
font-weight: 500;
|
|
15850
15874
|
}
|
|
15851
15875
|
|
|
15876
|
+
:host([active]) .item:hover {
|
|
15877
|
+
background: var(--nile-colors-primary-100);
|
|
15878
|
+
}
|
|
15879
|
+
|
|
15852
15880
|
|
|
15853
15881
|
:host([disabled]) {
|
|
15854
15882
|
color: var(--nile-colors-neutral-500);
|
|
@@ -15874,11 +15902,13 @@ a {
|
|
|
15874
15902
|
text-decoration: none;
|
|
15875
15903
|
}
|
|
15876
15904
|
|
|
15877
|
-
|
|
15905
|
+
|
|
15906
|
+
|
|
15907
|
+
`;let jm=class extends Re{constructor(){super(...arguments),this.active=!1,this.disabled=!1,this.tooltip=!1}static get styles(){return[Dm]}handleClick(e){if(this.disabled)return e.preventDefault(),void e.stopPropagation();const t=this.closest("nile-inline-sidebar");if(t){t.querySelectorAll("nile-inline-sidebar-item").forEach((e=>e.active=e===this))}const i=this.textContent?.trim()||"";this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:this,href:this.href,text:i},bubbles:!0,composed:!0})),this.href&&(window.location.href=this.href)}render(){return R`
|
|
15878
15908
|
<div class="item" @click=${this.handleClick} role="button" tabindex="0">
|
|
15879
15909
|
${this.href?R`<a href=${this.href} @click=${e=>e.preventDefault()}><slot></slot></a>`:R`<slot></slot>`}
|
|
15880
15910
|
</div>
|
|
15881
|
-
`}};e([ce({type:Boolean,reflect:!0})],jm.prototype,"active",void 0),e([ce({type:Boolean,reflect:!0})],jm.prototype,"disabled",void 0),e([ce({type:String})],jm.prototype,"href",void 0),jm=e([Ne("nile-inline-sidebar-item")],jm);const Im=r`
|
|
15911
|
+
`}};e([ce({type:Boolean,reflect:!0})],jm.prototype,"active",void 0),e([ce({type:Boolean,reflect:!0})],jm.prototype,"disabled",void 0),e([ce({type:String})],jm.prototype,"href",void 0),e([ce({type:Boolean,reflect:!0})],jm.prototype,"tooltip",void 0),jm=e([Ne("nile-inline-sidebar-item")],jm);const Im=r`
|
|
15882
15912
|
:host { }
|
|
15883
15913
|
|
|
15884
15914
|
.tippy-box[data-animation=fade][data-state=hidden] { opacity: 0; }
|