@aquera/nile-elements 1.3.0 → 1.3.1-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/demo/index.html +14 -14
- package/dist/{fixture-1c49c014.cjs.js → fixture-54600b35.cjs.js} +2 -2
- package/dist/{fixture-1c49c014.cjs.js.map → fixture-54600b35.cjs.js.map} +1 -1
- package/dist/fixture-5b79f853.cjs.js +395 -0
- package/dist/fixture-5b79f853.cjs.js.map +1 -0
- package/dist/fixture-73855806.cjs.js +395 -0
- package/dist/fixture-73855806.cjs.js.map +1 -0
- package/dist/fixture-90b199c4.esm.js +569 -0
- package/dist/{fixture-985bba12.esm.js → fixture-9871e8a9.esm.js} +1 -1
- package/dist/fixture-c1d78368.cjs.js +395 -0
- package/dist/fixture-c1d78368.cjs.js.map +1 -0
- package/dist/fixture-cf7bfcf5.esm.js +569 -0
- package/dist/fixture-dbd66009.cjs.js +395 -0
- package/dist/fixture-dbd66009.cjs.js.map +1 -0
- package/dist/index.js +6 -2
- 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.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +4 -0
- 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-code-editor/backup_nile-code-editor copy.cjs.js +2 -0
- package/dist/nile-code-editor/backup_nile-code-editor copy.cjs.js.map +1 -0
- package/dist/nile-code-editor/backup_nile-code-editor copy.esm.js +1 -0
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
- package/dist/nile-dropdown/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-grid/nile-grid.types.cjs.js +2 -0
- package/dist/nile-grid/nile-grid.types.cjs.js.map +1 -0
- package/dist/nile-grid/nile-grid.types.esm.js +1 -0
- package/dist/nile-grid-body/index.cjs.js +2 -0
- package/dist/nile-grid-body/index.cjs.js.map +1 -0
- package/dist/nile-grid-body/index.esm.js +1 -0
- package/dist/nile-grid-body/nile-grid-body.cjs.js +2 -0
- package/dist/nile-grid-body/nile-grid-body.cjs.js.map +1 -0
- package/dist/nile-grid-body/nile-grid-body.css.cjs.js +2 -0
- package/dist/nile-grid-body/nile-grid-body.css.cjs.js.map +1 -0
- package/dist/nile-grid-body/nile-grid-body.css.esm.js +10 -0
- package/dist/nile-grid-body/nile-grid-body.esm.js +5 -0
- package/dist/nile-grid-cell-item/index.cjs.js +2 -0
- package/dist/nile-grid-cell-item/index.cjs.js.map +1 -0
- package/dist/nile-grid-cell-item/index.esm.js +1 -0
- package/dist/nile-grid-cell-item/nile-grid-cell-item.cjs.js +2 -0
- package/dist/nile-grid-cell-item/nile-grid-cell-item.cjs.js.map +1 -0
- package/dist/nile-grid-cell-item/nile-grid-cell-item.css.cjs.js +2 -0
- package/dist/nile-grid-cell-item/nile-grid-cell-item.css.cjs.js.map +1 -0
- package/dist/nile-grid-cell-item/nile-grid-cell-item.css.esm.js +35 -0
- package/dist/nile-grid-cell-item/nile-grid-cell-item.esm.js +12 -0
- package/dist/nile-grid-cell-item/nile-grid-cell-item.utils.cjs.js +2 -0
- package/dist/nile-grid-cell-item/nile-grid-cell-item.utils.cjs.js.map +1 -0
- package/dist/nile-grid-cell-item/nile-grid-cell-item.utils.esm.js +1 -0
- package/dist/nile-grid-head/index.cjs.js +2 -0
- package/dist/nile-grid-head/index.cjs.js.map +1 -0
- package/dist/nile-grid-head/index.esm.js +1 -0
- package/dist/nile-grid-head/nile-grid-head.cjs.js +2 -0
- package/dist/nile-grid-head/nile-grid-head.cjs.js.map +1 -0
- package/dist/nile-grid-head/nile-grid-head.css.cjs.js +2 -0
- package/dist/nile-grid-head/nile-grid-head.css.cjs.js.map +1 -0
- package/dist/nile-grid-head/nile-grid-head.css.esm.js +7 -0
- package/dist/nile-grid-head/nile-grid-head.esm.js +5 -0
- package/dist/nile-grid-head-item/index.cjs.js +2 -0
- package/dist/nile-grid-head-item/index.cjs.js.map +1 -0
- package/dist/nile-grid-head-item/index.esm.js +1 -0
- package/dist/nile-grid-head-item/nile-grid-head-item.cjs.js +2 -0
- package/dist/nile-grid-head-item/nile-grid-head-item.cjs.js.map +1 -0
- package/dist/nile-grid-head-item/nile-grid-head-item.css.cjs.js +2 -0
- package/dist/nile-grid-head-item/nile-grid-head-item.css.cjs.js.map +1 -0
- package/dist/nile-grid-head-item/nile-grid-head-item.css.esm.js +34 -0
- package/dist/nile-grid-head-item/nile-grid-head-item.esm.js +12 -0
- package/dist/nile-grid-head-item/nile-grid-head-item.utils.cjs.js +2 -0
- package/dist/nile-grid-head-item/nile-grid-head-item.utils.cjs.js.map +1 -0
- package/dist/nile-grid-head-item/nile-grid-head-item.utils.esm.js +1 -0
- package/dist/nile-grid-row/index.cjs.js +2 -0
- package/dist/nile-grid-row/index.cjs.js.map +1 -0
- package/dist/nile-grid-row/index.esm.js +1 -0
- package/dist/nile-grid-row/nile-grid-row.cjs.js +2 -0
- package/dist/nile-grid-row/nile-grid-row.cjs.js.map +1 -0
- package/dist/nile-grid-row/nile-grid-row.css.cjs.js +2 -0
- package/dist/nile-grid-row/nile-grid-row.css.cjs.js.map +1 -0
- package/dist/nile-grid-row/nile-grid-row.css.esm.js +15 -0
- package/dist/nile-grid-row/nile-grid-row.esm.js +7 -0
- 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-input/nile-input.test.cjs.js +1 -1
- package/dist/nile-input/nile-input.test.esm.js +1 -1
- package/dist/nile-link/nile-link.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-rich-text-editor/utils.cjs.js +2 -0
- package/dist/nile-rich-text-editor/utils.cjs.js.map +1 -0
- package/dist/nile-rich-text-editor/utils.esm.js +1 -0
- 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-sidebar/index.cjs.js +2 -0
- package/dist/nile-sidebar/index.cjs.js.map +1 -0
- package/dist/nile-sidebar/index.esm.js +75 -0
- package/dist/nile-sidebar-menu/index.cjs.js +2 -0
- package/dist/nile-sidebar-menu/index.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu/index.esm.js +1 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js +2 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js +2 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.css.esm.js +38 -0
- package/dist/nile-sidebar-menu/nile-sidebar-menu.esm.js +10 -0
- package/dist/nile-sidebar-menu-items/index.cjs.js +2 -0
- package/dist/nile-sidebar-menu-items/index.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu-items/index.esm.js +1 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js +2 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js +2 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js.map +1 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.esm.js +36 -0
- package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.esm.js +15 -0
- package/dist/nile-sidebar-wrapper/index.cjs.js +2 -0
- package/dist/nile-sidebar-wrapper/index.cjs.js.map +1 -0
- package/dist/nile-sidebar-wrapper/index.esm.js +1 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js +2 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js.map +1 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js +2 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js.map +1 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.esm.js +105 -0
- package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.esm.js +16 -0
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
- package/dist/nile-virtual-select/group-manager.cjs.js +2 -0
- package/dist/nile-virtual-select/group-manager.cjs.js.map +1 -0
- package/dist/nile-virtual-select/group-manager.esm.js +1 -0
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +1 -1
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js +2 -0
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js.map +1 -0
- package/dist/nile-virtual-select/temp_nile-virtual-select copy.esm.js +231 -0
- package/dist/scopedElementsWrapper-1bff26ef.cjs.js +2 -0
- package/dist/scopedElementsWrapper-1bff26ef.cjs.js.map +1 -0
- package/dist/scopedElementsWrapper-4c29be11.esm.js +7 -0
- package/dist/scopedElementsWrapper-a112fc73.cjs.js +6 -0
- package/dist/scopedElementsWrapper-a112fc73.cjs.js.map +1 -0
- package/dist/scopedElementsWrapper-c815042c.cjs.js +2 -0
- package/dist/scopedElementsWrapper-c815042c.cjs.js.map +1 -0
- package/dist/src/internal/portal-manager.d.ts +53 -0
- package/dist/src/internal/portal-manager.js +196 -0
- package/dist/src/internal/portal-manager.js.map +1 -0
- package/dist/src/internal/portal.d.ts +60 -0
- package/dist/src/internal/portal.js +199 -0
- package/dist/src/internal/portal.js.map +1 -0
- package/dist/src/internal/resizable-helper.d.ts +59 -0
- package/dist/src/internal/resizable-helper.js +115 -0
- package/dist/src/internal/resizable-helper.js.map +1 -0
- package/dist/src/internal/resizable-styles.d.ts +16 -0
- package/dist/src/internal/resizable-styles.js +144 -0
- package/dist/src/internal/resizable-styles.js.map +1 -0
- package/dist/src/internal/virtualizer-error-handler.d.ts +30 -0
- package/dist/src/internal/virtualizer-error-handler.js +82 -0
- package/dist/src/internal/virtualizer-error-handler.js.map +1 -0
- package/dist/src/lib/index.d.ts +7 -0
- package/dist/src/lib/index.js +8 -0
- package/dist/src/lib/index.js.map +1 -0
- package/dist/src/lib/virtualize.d.ts +32 -0
- package/dist/src/lib/virtualize.js +105 -0
- package/dist/src/lib/virtualize.js.map +1 -0
- package/dist/src/lib/virtualize.test.d.ts +7 -0
- package/dist/src/lib/virtualize.test.js +57 -0
- package/dist/src/lib/virtualize.test.js.map +1 -0
- package/dist/src/nile-badge/__snapshots__/nile-badge.test.snap.js +17 -0
- package/dist/src/nile-calendar/__snapshots__/nile-calendar.test.snap.js +310 -0
- package/dist/src/nile-calendar/nile-calendar.css.js +4 -0
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-card/__snapshots__/nile-card.test.snap.js +34 -0
- package/dist/src/nile-checkbox/__snapshots__/nile-checkbox.test.snap.js +31 -0
- package/dist/src/nile-code-editor/Old_theme copy.d.ts +191 -0
- package/dist/src/nile-code-editor/Old_theme copy.js +193 -0
- package/dist/src/nile-code-editor/Old_theme copy.js.map +1 -0
- package/dist/src/nile-code-editor/backup_nile-code-editor copy.d.ts +0 -0
- package/dist/src/nile-code-editor/backup_nile-code-editor copy.js +675 -0
- package/dist/src/nile-code-editor/backup_nile-code-editor copy.js.map +1 -0
- package/dist/src/nile-code-editor/theme copy.d.ts +191 -0
- package/dist/src/nile-code-editor/theme copy.js +193 -0
- package/dist/src/nile-code-editor/theme copy.js.map +1 -0
- package/dist/src/nile-dropdown/portal-manager.js +2 -0
- package/dist/src/nile-dropdown/portal-manager.js.map +1 -1
- package/dist/src/nile-dropdown/portal-utils.d.ts +1 -0
- package/dist/src/nile-dropdown/portal-utils.js +24 -0
- package/dist/src/nile-dropdown/portal-utils.js.map +1 -1
- package/dist/src/nile-floating-panel/anchor-manager.d.ts +26 -0
- package/dist/src/nile-floating-panel/anchor-manager.js +49 -0
- package/dist/src/nile-floating-panel/anchor-manager.js.map +1 -0
- package/dist/src/nile-floating-panel/content-manager.d.ts +23 -0
- package/dist/src/nile-floating-panel/content-manager.js +67 -0
- package/dist/src/nile-floating-panel/content-manager.js.map +1 -0
- package/dist/src/nile-floating-panel/event-manager.d.ts +38 -0
- package/dist/src/nile-floating-panel/event-manager.js +81 -0
- package/dist/src/nile-floating-panel/event-manager.js.map +1 -0
- package/dist/src/nile-floating-panel/index.d.ts +1 -0
- package/dist/src/nile-floating-panel/index.js +2 -0
- package/dist/src/nile-floating-panel/index.js.map +1 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.css.d.ts +17 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.css.js +51 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.css.js.map +1 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.d.ts +67 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.js +203 -0
- package/dist/src/nile-floating-panel/nile-floating-panel.js.map +1 -0
- package/dist/src/nile-floating-panel/position-manager.d.ts +47 -0
- package/dist/src/nile-floating-panel/position-manager.js +94 -0
- package/dist/src/nile-floating-panel/position-manager.js.map +1 -0
- package/dist/src/nile-floating-panel/style-manager.d.ts +31 -0
- package/dist/src/nile-floating-panel/style-manager.js +74 -0
- package/dist/src/nile-floating-panel/style-manager.js.map +1 -0
- package/dist/src/nile-floating-panel/types.d.ts +29 -0
- package/dist/src/nile-floating-panel/types.js +8 -0
- package/dist/src/nile-floating-panel/types.js.map +1 -0
- package/dist/src/nile-grid/data-processor.d.ts +37 -0
- package/dist/src/nile-grid/data-processor.js +122 -0
- package/dist/src/nile-grid/data-processor.js.map +1 -0
- package/dist/src/nile-grid/event-handlers.d.ts +35 -0
- package/dist/src/nile-grid/event-handlers.js +158 -0
- package/dist/src/nile-grid/event-handlers.js.map +1 -0
- package/dist/src/nile-grid/nile-grid.types.d.ts +3 -0
- package/dist/src/nile-grid/nile-grid.types.js +2 -0
- package/dist/src/nile-grid/nile-grid.types.js.map +1 -0
- package/dist/src/nile-grid/renderer.d.ts +8 -0
- package/dist/src/nile-grid/renderer.js +78 -0
- package/dist/src/nile-grid/renderer.js.map +1 -0
- package/dist/src/nile-grid/resize-handler.d.ts +4 -0
- package/dist/src/nile-grid/resize-handler.js +36 -0
- package/dist/src/nile-grid/resize-handler.js.map +1 -0
- package/dist/src/nile-grid/types.d.ts +32 -0
- package/dist/src/nile-grid/types.js +2 -0
- package/dist/src/nile-grid/types.js.map +1 -0
- package/dist/src/nile-grid/utils.d.ts +4 -0
- package/dist/src/nile-grid/utils.js +32 -0
- package/dist/src/nile-grid/utils.js.map +1 -0
- package/dist/src/nile-grid-body/index.d.ts +1 -0
- package/dist/src/nile-grid-body/index.js +2 -0
- package/dist/src/nile-grid-body/index.js.map +1 -0
- package/dist/src/nile-grid-body/nile-grid-body.css.d.ts +12 -0
- package/dist/src/nile-grid-body/nile-grid-body.css.js +22 -0
- package/dist/src/nile-grid-body/nile-grid-body.css.js.map +1 -0
- package/dist/src/nile-grid-body/nile-grid-body.d.ts +29 -0
- package/dist/src/nile-grid-body/nile-grid-body.js +43 -0
- package/dist/src/nile-grid-body/nile-grid-body.js.map +1 -0
- package/dist/src/nile-grid-cell-item/index.d.ts +1 -0
- package/dist/src/nile-grid-cell-item/index.js +2 -0
- package/dist/src/nile-grid-cell-item/index.js.map +1 -0
- package/dist/src/nile-grid-cell-item/nile-grid-cell-item.css.d.ts +12 -0
- package/dist/src/nile-grid-cell-item/nile-grid-cell-item.css.js +47 -0
- package/dist/src/nile-grid-cell-item/nile-grid-cell-item.css.js.map +1 -0
- package/dist/src/nile-grid-cell-item/nile-grid-cell-item.d.ts +36 -0
- package/dist/src/nile-grid-cell-item/nile-grid-cell-item.js +93 -0
- package/dist/src/nile-grid-cell-item/nile-grid-cell-item.js.map +1 -0
- package/dist/src/nile-grid-cell-item/nile-grid-cell-item.utils.d.ts +10 -0
- package/dist/src/nile-grid-cell-item/nile-grid-cell-item.utils.js +34 -0
- package/dist/src/nile-grid-cell-item/nile-grid-cell-item.utils.js.map +1 -0
- package/dist/src/nile-grid-head/index.d.ts +1 -0
- package/dist/src/nile-grid-head/index.js +2 -0
- package/dist/src/nile-grid-head/index.js.map +1 -0
- package/dist/src/nile-grid-head/nile-grid-head.css.d.ts +12 -0
- package/dist/src/nile-grid-head/nile-grid-head.css.js +19 -0
- package/dist/src/nile-grid-head/nile-grid-head.css.js.map +1 -0
- package/dist/src/nile-grid-head/nile-grid-head.d.ts +28 -0
- package/dist/src/nile-grid-head/nile-grid-head.js +41 -0
- package/dist/src/nile-grid-head/nile-grid-head.js.map +1 -0
- package/dist/src/nile-grid-head-item/index.d.ts +1 -0
- package/dist/src/nile-grid-head-item/index.js +2 -0
- package/dist/src/nile-grid-head-item/index.js.map +1 -0
- package/dist/src/nile-grid-head-item/nile-grid-head-item.css.d.ts +12 -0
- package/dist/src/nile-grid-head-item/nile-grid-head-item.css.js +46 -0
- package/dist/src/nile-grid-head-item/nile-grid-head-item.css.js.map +1 -0
- package/dist/src/nile-grid-head-item/nile-grid-head-item.d.ts +37 -0
- package/dist/src/nile-grid-head-item/nile-grid-head-item.js +100 -0
- package/dist/src/nile-grid-head-item/nile-grid-head-item.js.map +1 -0
- package/dist/src/nile-grid-head-item/nile-grid-head-item.utils.d.ts +10 -0
- package/dist/src/nile-grid-head-item/nile-grid-head-item.utils.js +34 -0
- package/dist/src/nile-grid-head-item/nile-grid-head-item.utils.js.map +1 -0
- package/dist/src/nile-grid-row/index.d.ts +1 -0
- package/dist/src/nile-grid-row/index.js +2 -0
- package/dist/src/nile-grid-row/index.js.map +1 -0
- package/dist/src/nile-grid-row/nile-grid-row.css.d.ts +12 -0
- package/dist/src/nile-grid-row/nile-grid-row.css.js +27 -0
- package/dist/src/nile-grid-row/nile-grid-row.css.js.map +1 -0
- package/dist/src/nile-grid-row/nile-grid-row.d.ts +29 -0
- package/dist/src/nile-grid-row/nile-grid-row.js +45 -0
- package/dist/src/nile-grid-row/nile-grid-row.js.map +1 -0
- package/dist/src/nile-hero/__snapshots__/nile-hero.test.snap.js +47 -0
- package/dist/src/nile-icon/__snapshots__/nile-icon.test.snap.js +16 -0
- package/dist/src/nile-input/__snapshots__/nile-input.test.snap.js +75 -0
- package/dist/src/nile-menu/portal-manager.d.ts +39 -0
- package/dist/src/nile-menu/portal-manager.js +340 -0
- package/dist/src/nile-menu/portal-manager.js.map +1 -0
- package/dist/src/nile-menu/portal-utils.d.ts +21 -0
- package/dist/src/nile-menu/portal-utils.js +128 -0
- package/dist/src/nile-menu/portal-utils.js.map +1 -0
- package/dist/src/nile-popover/__snapshots__/nile-popover.test.snap.js +22 -0
- package/dist/src/nile-popover/popover-portal-handler.d.ts +21 -0
- package/dist/src/nile-popover/popover-portal-handler.js +106 -0
- package/dist/src/nile-popover/popover-portal-handler.js.map +1 -0
- package/dist/src/nile-portal-wrapper/index.d.ts +1 -0
- package/dist/src/nile-portal-wrapper/index.js +2 -0
- package/dist/src/nile-portal-wrapper/index.js.map +1 -0
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.d.ts +47 -0
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js +451 -0
- package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js.map +1 -0
- package/dist/src/nile-rich-text-editor/utils.d.ts +13 -0
- package/dist/src/nile-rich-text-editor/utils.js +538 -0
- package/dist/src/nile-rich-text-editor/utils.js.map +1 -0
- package/dist/src/nile-select/body-append-manager.d.ts +90 -0
- package/dist/src/nile-select/body-append-manager.js +298 -0
- package/dist/src/nile-select/body-append-manager.js.map +1 -0
- package/dist/src/nile-sidebar/index.d.ts +28 -0
- package/dist/src/nile-sidebar/index.js +116 -0
- package/dist/src/nile-sidebar/index.js.map +1 -0
- package/dist/src/nile-sidebar-menu/index.d.ts +1 -0
- package/dist/src/nile-sidebar-menu/index.js +2 -0
- package/dist/src/nile-sidebar-menu/index.js.map +1 -0
- package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.d.ts +12 -0
- package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.js +47 -0
- package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.js.map +1 -0
- package/dist/src/nile-sidebar-menu/nile-sidebar-menu.d.ts +37 -0
- package/dist/src/nile-sidebar-menu/nile-sidebar-menu.js +84 -0
- package/dist/src/nile-sidebar-menu/nile-sidebar-menu.js.map +1 -0
- package/dist/src/nile-sidebar-menu-items/index.d.ts +1 -0
- package/dist/src/nile-sidebar-menu-items/index.js +2 -0
- package/dist/src/nile-sidebar-menu-items/index.js.map +1 -0
- package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.d.ts +12 -0
- package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.js +45 -0
- package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.js.map +1 -0
- package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.d.ts +35 -0
- package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.js +78 -0
- package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.js.map +1 -0
- package/dist/src/nile-sidebar-wrapper/index.d.ts +1 -0
- package/dist/src/nile-sidebar-wrapper/index.js +2 -0
- package/dist/src/nile-sidebar-wrapper/index.js.map +1 -0
- package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.d.ts +12 -0
- package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.js +114 -0
- package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.js.map +1 -0
- package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.d.ts +35 -0
- package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.js +89 -0
- package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.js.map +1 -0
- package/dist/src/nile-table-body/virtual-scroll-helper.d.ts +9 -0
- package/dist/src/nile-table-body/virtual-scroll-helper.js +24 -0
- package/dist/src/nile-table-body/virtual-scroll-helper.js.map +1 -0
- package/dist/src/nile-virtual-select/body-append-helper.d.ts +16 -0
- package/dist/src/nile-virtual-select/body-append-helper.js +95 -0
- package/dist/src/nile-virtual-select/body-append-helper.js.map +1 -0
- package/dist/src/nile-virtual-select/group-manager.d.ts +32 -0
- package/dist/src/nile-virtual-select/group-manager.js +134 -0
- package/dist/src/nile-virtual-select/group-manager.js.map +1 -0
- package/dist/src/nile-virtual-select/portal-utils.d.ts +65 -0
- package/dist/src/nile-virtual-select/portal-utils.js +376 -0
- package/dist/src/nile-virtual-select/portal-utils.js.map +1 -0
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.d.ts +273 -0
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js +1305 -0
- package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js.map +1 -0
- package/dist/src/nile-virtual-select/virtualizer-error-handler.d.ts +21 -0
- package/dist/src/nile-virtual-select/virtualizer-error-handler.js +56 -0
- package/dist/src/nile-virtual-select/virtualizer-error-handler.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/index.d.ts +1 -0
- package/dist/src/nile-virtual-select-disabled/index.js +2 -0
- package/dist/src/nile-virtual-select-disabled/index.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.d.ts +12 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js +538 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.d.ts +299 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js +1441 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.d.ts +7 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js +631 -0
- package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/portal-manager.d.ts +45 -0
- package/dist/src/nile-virtual-select-disabled/portal-manager.js +333 -0
- package/dist/src/nile-virtual-select-disabled/portal-manager.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/renderer.d.ts +16 -0
- package/dist/src/nile-virtual-select-disabled/renderer.js +79 -0
- package/dist/src/nile-virtual-select-disabled/renderer.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/search-manager.d.ts +12 -0
- package/dist/src/nile-virtual-select-disabled/search-manager.js +40 -0
- package/dist/src/nile-virtual-select-disabled/search-manager.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/selection-manager.d.ts +12 -0
- package/dist/src/nile-virtual-select-disabled/selection-manager.js +64 -0
- package/dist/src/nile-virtual-select-disabled/selection-manager.js.map +1 -0
- package/dist/src/nile-virtual-select-disabled/types.d.ts +50 -0
- package/dist/src/nile-virtual-select-disabled/types.js +8 -0
- package/dist/src/nile-virtual-select-disabled/types.js.map +1 -0
- package/dist/src/nile-virtual-table-body/index.d.ts +2 -0
- package/dist/src/nile-virtual-table-body/index.js +3 -0
- package/dist/src/nile-virtual-table-body/index.js.map +1 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.d.ts +1 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js +44 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js.map +1 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.d.ts +50 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js +135 -0
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js.map +1 -0
- package/dist/src/nile-virtual-table-body/renderer.d.ts +16 -0
- package/dist/src/nile-virtual-table-body/renderer.js +49 -0
- package/dist/src/nile-virtual-table-body/renderer.js.map +1 -0
- package/dist/src/utilities/stepper-utils.d.ts +71 -0
- package/dist/src/utilities/stepper-utils.js +108 -0
- package/dist/src/utilities/stepper-utils.js.map +1 -0
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/nile-calendar/nile-calendar.css.ts +4 -0
- package/src/nile-dropdown/portal-manager.ts +2 -0
- package/src/nile-dropdown/portal-utils.ts +26 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Floating Panel CSS
|
|
9
|
+
*/
|
|
10
|
+
export declare const styles: import("lit").CSSResult;
|
|
11
|
+
/**
|
|
12
|
+
* Panel container styles - applied to the dynamically appended element
|
|
13
|
+
* These styles are injected into the document head
|
|
14
|
+
*/
|
|
15
|
+
export declare const panelContainerStyles: import("lit").CSSResult;
|
|
16
|
+
declare const _default: import("lit").CSSResult[];
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
/**
|
|
9
|
+
* Floating Panel CSS
|
|
10
|
+
*/
|
|
11
|
+
export const styles = css `
|
|
12
|
+
:host {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
|
|
15
|
+
-moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));
|
|
16
|
+
text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));
|
|
17
|
+
display: inline-block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([hidden]) {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
slot {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
/**
|
|
29
|
+
* Panel container styles - applied to the dynamically appended element
|
|
30
|
+
* These styles are injected into the document head
|
|
31
|
+
*/
|
|
32
|
+
export const panelContainerStyles = css `
|
|
33
|
+
.nile-floating-panel__container {
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
z-index: var(--nile-floating-panel-z-index, 9999);
|
|
36
|
+
pointer-events: auto;
|
|
37
|
+
background-color: var(--nile-floating-panel-background, var(--nile-colors-white-base, var(--ng-colors-bg-primary)));
|
|
38
|
+
border: solid 1px var(--nile-floating-panel-border-color, var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt)));
|
|
39
|
+
border-radius: var(--nile-floating-panel-border-radius, var(--nile-radius-sm, var(--ng-radius-md)));
|
|
40
|
+
box-shadow: var(--nile-floating-panel-box-shadow, var(--nile-box-shadow-2, var(--ng-shadow-lg)));
|
|
41
|
+
padding: var(--nile-floating-panel-padding, var(--nile-spacing-xl, var(--ng-spacing-xl)));
|
|
42
|
+
min-width: var(--nile-floating-panel-min-width, 200px);
|
|
43
|
+
max-width: var(--nile-floating-panel-max-width, 400px);
|
|
44
|
+
color: var(--nile-floating-panel-color, var(--nile-colors-dark-900, var(--ng-colors-text-primary-900)));
|
|
45
|
+
font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
46
|
+
font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));
|
|
47
|
+
line-height: var(--nile-line-height-xsmall, var(--ng-line-height-text-sm));
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
export default [styles];
|
|
51
|
+
//# sourceMappingURL=nile-floating-panel.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nile-floating-panel.css.js","sourceRoot":"","sources":["../../../src/nile-floating-panel/nile-floating-panel.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;CAgBxB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiBtC,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * Floating Panel CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n display: inline-block;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n slot {\n display: none;\n }\n`;\n\n/**\n * Panel container styles - applied to the dynamically appended element\n * These styles are injected into the document head\n */\nexport const panelContainerStyles = css`\n .nile-floating-panel__container {\n box-sizing: border-box;\n z-index: var(--nile-floating-panel-z-index, 9999);\n pointer-events: auto;\n background-color: var(--nile-floating-panel-background, var(--nile-colors-white-base, var(--ng-colors-bg-primary)));\n border: solid 1px var(--nile-floating-panel-border-color, var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt)));\n border-radius: var(--nile-floating-panel-border-radius, var(--nile-radius-sm, var(--ng-radius-md)));\n box-shadow: var(--nile-floating-panel-box-shadow, var(--nile-box-shadow-2, var(--ng-shadow-lg)));\n padding: var(--nile-floating-panel-padding, var(--nile-spacing-xl, var(--ng-spacing-xl)));\n min-width: var(--nile-floating-panel-min-width, 200px);\n max-width: var(--nile-floating-panel-max-width, 400px);\n color: var(--nile-floating-panel-color, var(--nile-colors-dark-900, var(--ng-colors-text-primary-900)));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));\n line-height: var(--nile-line-height-xsmall, var(--ng-line-height-text-sm));\n }\n`;\n\nexport default [styles];\n\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { CSSResultArray, TemplateResult } from 'lit';
|
|
8
|
+
import NileElement from '../internal/nile-element';
|
|
9
|
+
import type { FloatingPanelPosition, FloatingPanelAnchor } from './types';
|
|
10
|
+
/**
|
|
11
|
+
* Nile floating panel component.
|
|
12
|
+
*
|
|
13
|
+
* @tag nile-floating-panel
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export declare class NileFloatingPanel extends NileElement {
|
|
17
|
+
/**
|
|
18
|
+
* The styles for nile-floating-panel
|
|
19
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
|
20
|
+
*/
|
|
21
|
+
static get styles(): CSSResultArray;
|
|
22
|
+
/**
|
|
23
|
+
* The anchor element where the panel will be appended. Can be an HTMLElement reference
|
|
24
|
+
* or a string selector. Defaults to document.body.
|
|
25
|
+
*/
|
|
26
|
+
anchor: FloatingPanelAnchor;
|
|
27
|
+
/**
|
|
28
|
+
* The position of the panel relative to the component itself.
|
|
29
|
+
* Options: 'top', 'bottom', 'left', 'right'
|
|
30
|
+
*/
|
|
31
|
+
position: FloatingPanelPosition;
|
|
32
|
+
/**
|
|
33
|
+
* Controls the visibility of the panel. When true, the panel is appended to the anchor
|
|
34
|
+
* and positioned relative to the component itself.
|
|
35
|
+
*/
|
|
36
|
+
open: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Optional content provided via data attribute. Used when no slot content is provided.
|
|
39
|
+
*/
|
|
40
|
+
dataContent: string;
|
|
41
|
+
/**
|
|
42
|
+
* Controls whether the panel closes when clicking outside of it.
|
|
43
|
+
* When true (default), clicking outside the panel will close it.
|
|
44
|
+
*/
|
|
45
|
+
closeOnOutsideClick: boolean;
|
|
46
|
+
private panelContainer;
|
|
47
|
+
private positionManager;
|
|
48
|
+
private styleManager;
|
|
49
|
+
private eventManager;
|
|
50
|
+
connectedCallback(): void;
|
|
51
|
+
disconnectedCallback(): void;
|
|
52
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
53
|
+
private setupPanel;
|
|
54
|
+
private setupEventHandlers;
|
|
55
|
+
private setupPositionManager;
|
|
56
|
+
private updatePanelContent;
|
|
57
|
+
private reposition;
|
|
58
|
+
private cleanupPanel;
|
|
59
|
+
render(): TemplateResult;
|
|
60
|
+
private handleSlotChange;
|
|
61
|
+
}
|
|
62
|
+
export default NileFloatingPanel;
|
|
63
|
+
declare global {
|
|
64
|
+
interface HTMLElementTagNameMap {
|
|
65
|
+
'nile-floating-panel': NileFloatingPanel;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
var NileFloatingPanel_1;
|
|
8
|
+
import { __decorate } from "tslib";
|
|
9
|
+
import { html, } from 'lit';
|
|
10
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
11
|
+
import { styles } from './nile-floating-panel.css';
|
|
12
|
+
import NileElement from '../internal/nile-element';
|
|
13
|
+
import { PositionManager } from './position-manager';
|
|
14
|
+
import { StyleManager } from './style-manager';
|
|
15
|
+
import { ContentManager } from './content-manager';
|
|
16
|
+
import { AnchorManager } from './anchor-manager';
|
|
17
|
+
import { EventManager } from './event-manager';
|
|
18
|
+
/**
|
|
19
|
+
* Nile floating panel component.
|
|
20
|
+
*
|
|
21
|
+
* @tag nile-floating-panel
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
let NileFloatingPanel = NileFloatingPanel_1 = class NileFloatingPanel extends NileElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
/**
|
|
28
|
+
* The anchor element where the panel will be appended. Can be an HTMLElement reference
|
|
29
|
+
* or a string selector. Defaults to document.body.
|
|
30
|
+
*/
|
|
31
|
+
this.anchor = null;
|
|
32
|
+
/**
|
|
33
|
+
* The position of the panel relative to the component itself.
|
|
34
|
+
* Options: 'top', 'bottom', 'left', 'right'
|
|
35
|
+
*/
|
|
36
|
+
this.position = 'bottom';
|
|
37
|
+
/**
|
|
38
|
+
* Controls the visibility of the panel. When true, the panel is appended to the anchor
|
|
39
|
+
* and positioned relative to the component itself.
|
|
40
|
+
*/
|
|
41
|
+
this.open = false;
|
|
42
|
+
/**
|
|
43
|
+
* Optional content provided via data attribute. Used when no slot content is provided.
|
|
44
|
+
*/
|
|
45
|
+
this.dataContent = '';
|
|
46
|
+
/**
|
|
47
|
+
* Controls whether the panel closes when clicking outside of it.
|
|
48
|
+
* When true (default), clicking outside the panel will close it.
|
|
49
|
+
*/
|
|
50
|
+
this.closeOnOutsideClick = true;
|
|
51
|
+
this.panelContainer = null;
|
|
52
|
+
this.positionManager = null;
|
|
53
|
+
this.styleManager = new StyleManager();
|
|
54
|
+
this.eventManager = new EventManager(this);
|
|
55
|
+
this.handleSlotChange = () => {
|
|
56
|
+
// Update panel content when slot content changes
|
|
57
|
+
if (this.open && this.panelContainer) {
|
|
58
|
+
this.updatePanelContent();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
/* #endregion */
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The styles for nile-floating-panel
|
|
65
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
|
66
|
+
*/
|
|
67
|
+
static get styles() {
|
|
68
|
+
return [styles];
|
|
69
|
+
}
|
|
70
|
+
/* #endregion */
|
|
71
|
+
/* #region Methods */
|
|
72
|
+
connectedCallback() {
|
|
73
|
+
super.connectedCallback();
|
|
74
|
+
}
|
|
75
|
+
disconnectedCallback() {
|
|
76
|
+
super.disconnectedCallback();
|
|
77
|
+
this.cleanupPanel();
|
|
78
|
+
}
|
|
79
|
+
updated(changedProperties) {
|
|
80
|
+
super.updated(changedProperties);
|
|
81
|
+
if (changedProperties.has('open')) {
|
|
82
|
+
if (this.open) {
|
|
83
|
+
this.setupPanel();
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.cleanupPanel();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (changedProperties.has('closeOnOutsideClick') && this.open && this.panelContainer) {
|
|
90
|
+
this.eventManager.updateOutsideClickHandler(this.panelContainer, this.closeOnOutsideClick, this.open);
|
|
91
|
+
}
|
|
92
|
+
if (changedProperties.has('anchor') && this.open) {
|
|
93
|
+
this.cleanupPanel();
|
|
94
|
+
this.setupPanel();
|
|
95
|
+
}
|
|
96
|
+
if (changedProperties.has('position') && this.open && this.positionManager) {
|
|
97
|
+
this.positionManager.updatePosition(this.position);
|
|
98
|
+
}
|
|
99
|
+
if ((changedProperties.has('dataContent') || changedProperties.has('open')) && this.open && this.panelContainer) {
|
|
100
|
+
this.updatePanelContent();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
setupPanel() {
|
|
104
|
+
if (this.panelContainer) {
|
|
105
|
+
return; // Already set up
|
|
106
|
+
}
|
|
107
|
+
// Inject styles if not already injected
|
|
108
|
+
const componentStyles = this.constructor.styles;
|
|
109
|
+
if (componentStyles) {
|
|
110
|
+
this.styleManager.injectStyles(componentStyles);
|
|
111
|
+
}
|
|
112
|
+
// Create panel container
|
|
113
|
+
this.panelContainer = document.createElement('div');
|
|
114
|
+
this.panelContainer.setAttribute('part', 'panel');
|
|
115
|
+
this.panelContainer.className = 'nile-floating-panel__container';
|
|
116
|
+
// Update content
|
|
117
|
+
this.updatePanelContent();
|
|
118
|
+
// Append to anchor
|
|
119
|
+
const anchorElement = AnchorManager.resolveAnchor(this.anchor);
|
|
120
|
+
AnchorManager.appendToAnchor(anchorElement, this.panelContainer);
|
|
121
|
+
// Wait for next frame to ensure DOM is ready
|
|
122
|
+
requestAnimationFrame(() => {
|
|
123
|
+
this.setupPositionManager();
|
|
124
|
+
this.setupEventHandlers();
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
setupEventHandlers() {
|
|
128
|
+
if (!this.panelContainer) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
// Setup outside click handler
|
|
132
|
+
this.eventManager.setupOutsideClickHandler(this.panelContainer, this.closeOnOutsideClick, this.open, () => {
|
|
133
|
+
this.open = false;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
setupPositionManager() {
|
|
137
|
+
if (!this.panelContainer) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
// Create position manager
|
|
141
|
+
this.positionManager = new PositionManager(this, this.panelContainer, this.position);
|
|
142
|
+
// Initial positioning
|
|
143
|
+
this.positionManager.reposition();
|
|
144
|
+
// Setup auto-update
|
|
145
|
+
this.positionManager.setupAutoUpdate();
|
|
146
|
+
}
|
|
147
|
+
updatePanelContent() {
|
|
148
|
+
if (!this.panelContainer) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const slot = this.shadowRoot?.querySelector('slot') || null;
|
|
152
|
+
ContentManager.updatePanelContent(this.panelContainer, slot, this.dataContent);
|
|
153
|
+
}
|
|
154
|
+
reposition() {
|
|
155
|
+
if (this.positionManager) {
|
|
156
|
+
this.positionManager.reposition();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
cleanupPanel() {
|
|
160
|
+
// Cleanup event handlers
|
|
161
|
+
this.eventManager.destroy();
|
|
162
|
+
// Cleanup position manager
|
|
163
|
+
if (this.positionManager) {
|
|
164
|
+
this.positionManager.destroy();
|
|
165
|
+
this.positionManager = null;
|
|
166
|
+
}
|
|
167
|
+
// Remove panel from anchor
|
|
168
|
+
if (this.panelContainer) {
|
|
169
|
+
AnchorManager.removeFromAnchor(this.panelContainer);
|
|
170
|
+
}
|
|
171
|
+
this.panelContainer = null;
|
|
172
|
+
// Clean up styles (optional - styles are shared across instances)
|
|
173
|
+
this.styleManager.cleanupStyles();
|
|
174
|
+
}
|
|
175
|
+
render() {
|
|
176
|
+
// Component itself doesn't render visible content
|
|
177
|
+
// The panel is created and appended to anchor when open
|
|
178
|
+
return html `
|
|
179
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
__decorate([
|
|
184
|
+
property()
|
|
185
|
+
], NileFloatingPanel.prototype, "anchor", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
property()
|
|
188
|
+
], NileFloatingPanel.prototype, "position", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
property({ type: Boolean, reflect: true })
|
|
191
|
+
], NileFloatingPanel.prototype, "open", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
property({ attribute: 'data-content', type: String })
|
|
194
|
+
], NileFloatingPanel.prototype, "dataContent", void 0);
|
|
195
|
+
__decorate([
|
|
196
|
+
property({ type: Boolean, reflect: true, attribute: 'close-on-outside-click' })
|
|
197
|
+
], NileFloatingPanel.prototype, "closeOnOutsideClick", void 0);
|
|
198
|
+
NileFloatingPanel = NileFloatingPanel_1 = __decorate([
|
|
199
|
+
customElement('nile-floating-panel')
|
|
200
|
+
], NileFloatingPanel);
|
|
201
|
+
export { NileFloatingPanel };
|
|
202
|
+
export default NileFloatingPanel;
|
|
203
|
+
//# sourceMappingURL=nile-floating-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nile-floating-panel.js","sourceRoot":"","sources":["../../../src/nile-floating-panel/nile-floating-panel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;AAEH,OAAO,EAEL,IAAI,GAIL,MAAM,KAAK,CAAC;AACb,OA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a,EAAE,CAAC;IACpC,CAAC;IAEM,MAAM;QACX,kDAAkD;QAClD,wDAAwD;QACxD,OAAO,IAAI,CAAA;0BACW,IAAI,CAAC,gBAAgB;KAC1C,CAAC;IACJ,CAAC;CAUF,CAAA;AAtMa;IAAX,QAAQ,EAAE;iDAAoC;AAMnC;IAAX,QAAQ,EAAE;mDAA4C;AAMX;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAc;AAKF;IAAtD,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAkB;AAOxE;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC;8DACrD;AArChB,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAmN7B;;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-floating-panel.css';\nimport NileElement from '../internal/nile-element';\nimport { PositionManager } from './position-manager';\nimport { StyleManager } from './style-manager';\nimport { ContentManager } from './content-manager';\nimport { AnchorManager } from './anchor-manager';\nimport { EventManager } from './event-manager';\nimport type { FloatingPanelPosition, FloatingPanelAnchor } from './types';\n\n/**\n * Nile floating panel component.\n *\n * @tag nile-floating-panel\n *\n */\n@customElement('nile-floating-panel')\nexport class NileFloatingPanel extends NileElement {\n /**\n * The styles for nile-floating-panel\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /**\n * The anchor element where the panel will be appended. Can be an HTMLElement reference\n * or a string selector. Defaults to document.body.\n */\n @property() anchor: FloatingPanelAnchor = null;\n\n /**\n * The position of the panel relative to the component itself.\n * Options: 'top', 'bottom', 'left', 'right'\n */\n @property() position: FloatingPanelPosition = 'bottom';\n\n /**\n * Controls the visibility of the panel. When true, the panel is appended to the anchor\n * and positioned relative to the component itself.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * Optional content provided via data attribute. Used when no slot content is provided.\n */\n @property({ attribute: 'data-content', type: String }) dataContent = '';\n\n /**\n * Controls whether the panel closes when clicking outside of it.\n * When true (default), clicking outside the panel will close it.\n */\n @property({ type: Boolean, reflect: true, attribute: 'close-on-outside-click' }) \n closeOnOutsideClick = true;\n\n private panelContainer: HTMLElement | null = null;\n private positionManager: PositionManager | null = null;\n private styleManager: StyleManager = new StyleManager();\n private eventManager: EventManager = new EventManager(this);\n\n /* #endregion */\n\n /* #region Methods */\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanupPanel();\n }\n\n updated(changedProperties: Map<string, unknown>) {\n super.updated(changedProperties);\n\n if (changedProperties.has('open')) {\n if (this.open) {\n this.setupPanel();\n } else {\n this.cleanupPanel();\n }\n }\n\n if (changedProperties.has('closeOnOutsideClick') && this.open && this.panelContainer) {\n this.eventManager.updateOutsideClickHandler(\n this.panelContainer,\n this.closeOnOutsideClick,\n this.open\n );\n }\n\n if (changedProperties.has('anchor') && this.open) {\n this.cleanupPanel();\n this.setupPanel();\n }\n\n if (changedProperties.has('position') && this.open && this.positionManager) {\n this.positionManager.updatePosition(this.position);\n }\n\n if ((changedProperties.has('dataContent') || changedProperties.has('open')) && this.open && this.panelContainer) {\n this.updatePanelContent();\n }\n }\n\n private setupPanel() {\n if (this.panelContainer) {\n return; // Already set up\n }\n\n // Inject styles if not already injected\n const componentStyles = (this.constructor as typeof NileFloatingPanel).styles;\n if (componentStyles) {\n this.styleManager.injectStyles(componentStyles);\n }\n\n // Create panel container\n this.panelContainer = document.createElement('div');\n this.panelContainer.setAttribute('part', 'panel');\n this.panelContainer.className = 'nile-floating-panel__container';\n\n // Update content\n this.updatePanelContent();\n\n // Append to anchor\n const anchorElement = AnchorManager.resolveAnchor(this.anchor);\n AnchorManager.appendToAnchor(anchorElement, this.panelContainer);\n\n // Wait for next frame to ensure DOM is ready\n requestAnimationFrame(() => {\n this.setupPositionManager();\n this.setupEventHandlers();\n });\n }\n\n private setupEventHandlers() {\n if (!this.panelContainer) {\n return;\n }\n\n // Setup outside click handler\n this.eventManager.setupOutsideClickHandler(\n this.panelContainer,\n this.closeOnOutsideClick,\n this.open,\n () => {\n this.open = false;\n }\n );\n }\n\n private setupPositionManager() {\n if (!this.panelContainer) {\n return;\n }\n\n // Create position manager\n this.positionManager = new PositionManager(\n this,\n this.panelContainer,\n this.position\n );\n\n // Initial positioning\n this.positionManager.reposition();\n\n // Setup auto-update\n this.positionManager.setupAutoUpdate();\n }\n\n private updatePanelContent() {\n if (!this.panelContainer) {\n return;\n }\n\n const slot = this.shadowRoot?.querySelector('slot') || null;\n ContentManager.updatePanelContent(\n this.panelContainer,\n slot,\n this.dataContent\n );\n }\n\n private reposition() {\n if (this.positionManager) {\n this.positionManager.reposition();\n }\n }\n\n private cleanupPanel() {\n // Cleanup event handlers\n this.eventManager.destroy();\n\n // Cleanup position manager\n if (this.positionManager) {\n this.positionManager.destroy();\n this.positionManager = null;\n }\n\n // Remove panel from anchor\n if (this.panelContainer) {\n AnchorManager.removeFromAnchor(this.panelContainer);\n }\n\n this.panelContainer = null;\n\n // Clean up styles (optional - styles are shared across instances)\n this.styleManager.cleanupStyles();\n }\n\n public render(): TemplateResult {\n // Component itself doesn't render visible content\n // The panel is created and appended to anchor when open\n return html`\n <slot @slotchange=${this.handleSlotChange}></slot>\n `;\n }\n\n private handleSlotChange = () => {\n // Update panel content when slot content changes\n if (this.open && this.panelContainer) {\n this.updatePanelContent();\n }\n };\n\n /* #endregion */\n}\n\nexport default NileFloatingPanel;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-floating-panel': NileFloatingPanel;\n }\n}\n\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { FloatingPanelPosition } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Manages positioning of the floating panel using floating-ui
|
|
10
|
+
*/
|
|
11
|
+
export declare class PositionManager {
|
|
12
|
+
private cleanup;
|
|
13
|
+
private referenceElement;
|
|
14
|
+
private floatingElement;
|
|
15
|
+
private position;
|
|
16
|
+
private offsetValue;
|
|
17
|
+
private shiftPadding;
|
|
18
|
+
constructor(referenceElement: HTMLElement, floatingElement: HTMLElement, position: FloatingPanelPosition, offsetValue?: number, shiftPadding?: number);
|
|
19
|
+
/**
|
|
20
|
+
* Sets up automatic position updates
|
|
21
|
+
*/
|
|
22
|
+
setupAutoUpdate(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Cleans up automatic position updates
|
|
25
|
+
*/
|
|
26
|
+
cleanupAutoUpdate(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Repositions the floating element relative to the reference element
|
|
29
|
+
*/
|
|
30
|
+
reposition(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Updates the position configuration
|
|
33
|
+
*/
|
|
34
|
+
updatePosition(position: FloatingPanelPosition): void;
|
|
35
|
+
/**
|
|
36
|
+
* Updates the offset value
|
|
37
|
+
*/
|
|
38
|
+
updateOffset(offset: number): void;
|
|
39
|
+
/**
|
|
40
|
+
* Updates the shift padding
|
|
41
|
+
*/
|
|
42
|
+
updateShiftPadding(padding: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* Cleans up all resources
|
|
45
|
+
*/
|
|
46
|
+
destroy(): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { autoUpdate, computePosition, offset, shift } from '@floating-ui/dom';
|
|
8
|
+
/**
|
|
9
|
+
* Manages positioning of the floating panel using floating-ui
|
|
10
|
+
*/
|
|
11
|
+
export class PositionManager {
|
|
12
|
+
constructor(referenceElement, floatingElement, position, offsetValue = 8, shiftPadding = 8) {
|
|
13
|
+
this.cleanup = null;
|
|
14
|
+
this.referenceElement = referenceElement;
|
|
15
|
+
this.floatingElement = floatingElement;
|
|
16
|
+
this.position = position;
|
|
17
|
+
this.offsetValue = offsetValue;
|
|
18
|
+
this.shiftPadding = shiftPadding;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Sets up automatic position updates
|
|
22
|
+
*/
|
|
23
|
+
setupAutoUpdate() {
|
|
24
|
+
this.cleanupAutoUpdate();
|
|
25
|
+
this.cleanup = autoUpdate(this.referenceElement, this.floatingElement, () => {
|
|
26
|
+
this.reposition();
|
|
27
|
+
}, {
|
|
28
|
+
ancestorScroll: true,
|
|
29
|
+
ancestorResize: true,
|
|
30
|
+
elementResize: true,
|
|
31
|
+
layoutShift: true,
|
|
32
|
+
animationFrame: false,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Cleans up automatic position updates
|
|
37
|
+
*/
|
|
38
|
+
cleanupAutoUpdate() {
|
|
39
|
+
if (this.cleanup) {
|
|
40
|
+
this.cleanup();
|
|
41
|
+
this.cleanup = null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Repositions the floating element relative to the reference element
|
|
46
|
+
*/
|
|
47
|
+
reposition() {
|
|
48
|
+
const placement = this.position;
|
|
49
|
+
computePosition(this.referenceElement, this.floatingElement, {
|
|
50
|
+
placement,
|
|
51
|
+
strategy: 'fixed',
|
|
52
|
+
middleware: [
|
|
53
|
+
offset(this.offsetValue),
|
|
54
|
+
shift({
|
|
55
|
+
padding: this.shiftPadding,
|
|
56
|
+
}),
|
|
57
|
+
],
|
|
58
|
+
}).then(({ x, y }) => {
|
|
59
|
+
Object.assign(this.floatingElement.style, {
|
|
60
|
+
left: `${x}px`,
|
|
61
|
+
top: `${y}px`,
|
|
62
|
+
position: 'fixed',
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Updates the position configuration
|
|
68
|
+
*/
|
|
69
|
+
updatePosition(position) {
|
|
70
|
+
this.position = position;
|
|
71
|
+
this.reposition();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Updates the offset value
|
|
75
|
+
*/
|
|
76
|
+
updateOffset(offset) {
|
|
77
|
+
this.offsetValue = offset;
|
|
78
|
+
this.reposition();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Updates the shift padding
|
|
82
|
+
*/
|
|
83
|
+
updateShiftPadding(padding) {
|
|
84
|
+
this.shiftPadding = padding;
|
|
85
|
+
this.reposition();
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Cleans up all resources
|
|
89
|
+
*/
|
|
90
|
+
destroy() {
|
|
91
|
+
this.cleanupAutoUpdate();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=position-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position-manager.js","sourceRoot":"","sources":["../../../src/nile-floating-panel/position-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAI9E;;GAEG;AACH,MAAM,OAAO,eAAe;IAQ1B,YACE,gBAA6B,EA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AC,EAAE,EAAE,EAAE;YACnB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;gBACxC,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,GAAG,EAAE,GAAG,CAAC,IAAI;gBACb,QAAQ,EAAE,OAAO;aAClB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,QAA+B;QAC5C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,MAAc;QACzB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,kBAAkB,CAAC,OAAe;QAChC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;CACF","sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { autoUpdate, computePosition, offset, shift } from '@floating-ui/dom';\nimport type { Placement } from '@floating-ui/dom';\nimport type { FloatingPanelPosition } from './types';\n\n/**\n * Manages positioning of the floating panel using floating-ui\n */\nexport class PositionManager {\n private cleanup: (() => void) | null = null;\n private referenceElement: HTMLElement;\n private floatingElement: HTMLElement;\n private position: FloatingPanelPosition;\n private offsetValue: number;\n private shiftPadding: number;\n\n constructor(\n referenceElement: HTMLElement,\n floatingElement: HTMLElement,\n position: FloatingPanelPosition,\n offsetValue: number = 8,\n shiftPadding: number = 8\n ) {\n this.referenceElement = referenceElement;\n this.floatingElement = floatingElement;\n this.position = position;\n this.offsetValue = offsetValue;\n this.shiftPadding = shiftPadding;\n }\n\n /**\n * Sets up automatic position updates\n */\n setupAutoUpdate(): void {\n this.cleanupAutoUpdate();\n\n this.cleanup = autoUpdate(\n this.referenceElement,\n this.floatingElement,\n () => {\n this.reposition();\n },\n {\n ancestorScroll: true,\n ancestorResize: true,\n elementResize: true,\n layoutShift: true,\n animationFrame: false,\n }\n );\n }\n\n /**\n * Cleans up automatic position updates\n */\n cleanupAutoUpdate(): void {\n if (this.cleanup) {\n this.cleanup();\n this.cleanup = null;\n }\n }\n\n /**\n * Repositions the floating element relative to the reference element\n */\n reposition(): void {\n const placement: Placement = this.position;\n\n computePosition(this.referenceElement, this.floatingElement, {\n placement,\n strategy: 'fixed',\n middleware: [\n offset(this.offsetValue),\n shift({\n padding: this.shiftPadding,\n }),\n ],\n }).then(({ x, y }) => {\n Object.assign(this.floatingElement.style, {\n left: `${x}px`,\n top: `${y}px`,\n position: 'fixed',\n });\n });\n }\n\n /**\n * Updates the position configuration\n */\n updatePosition(position: FloatingPanelPosition): void {\n this.position = position;\n this.reposition();\n }\n\n /**\n * Updates the offset value\n */\n updateOffset(offset: number): void {\n this.offsetValue = offset;\n this.reposition();\n }\n\n /**\n * Updates the shift padding\n */\n updateShiftPadding(padding: number): void {\n this.shiftPadding = padding;\n this.reposition();\n }\n\n /**\n * Cleans up all resources\n */\n destroy(): void {\n this.cleanupAutoUpdate();\n }\n}\n\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { CSSResultArray } from 'lit';
|
|
8
|
+
/**
|
|
9
|
+
* Manages style injection for the floating panel
|
|
10
|
+
*/
|
|
11
|
+
export declare class StyleManager {
|
|
12
|
+
private injectedStyleId;
|
|
13
|
+
private static injectedStyleIds;
|
|
14
|
+
/**
|
|
15
|
+
* Injects styles into the document head
|
|
16
|
+
*/
|
|
17
|
+
injectStyles(componentStyles: CSSResultArray): void;
|
|
18
|
+
/**
|
|
19
|
+
* Extracts CSS text from CSSResultArray
|
|
20
|
+
*/
|
|
21
|
+
private extractCSSFromStyles;
|
|
22
|
+
/**
|
|
23
|
+
* Cleans up injected styles (only if this is the last instance)
|
|
24
|
+
* Note: In production, you might want a shared style manager
|
|
25
|
+
*/
|
|
26
|
+
cleanupStyles(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the injected style ID
|
|
29
|
+
*/
|
|
30
|
+
getInjectedStyleId(): string | null;
|
|
31
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { panelContainerStyles } from './nile-floating-panel.css';
|
|
8
|
+
/**
|
|
9
|
+
* Manages style injection for the floating panel
|
|
10
|
+
*/
|
|
11
|
+
export class StyleManager {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.injectedStyleId = null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Injects styles into the document head
|
|
17
|
+
*/
|
|
18
|
+
injectStyles(componentStyles) {
|
|
19
|
+
// Check if styles are already injected globally
|
|
20
|
+
const globalStyleId = 'nile-floating-panel-styles-global';
|
|
21
|
+
if (StyleManager.injectedStyleIds.has(globalStyleId)) {
|
|
22
|
+
return; // Styles already injected by another instance
|
|
23
|
+
}
|
|
24
|
+
if (this.injectedStyleId && document.getElementById(this.injectedStyleId)) {
|
|
25
|
+
return; // Styles already injected for this instance
|
|
26
|
+
}
|
|
27
|
+
this.injectedStyleId = globalStyleId;
|
|
28
|
+
StyleManager.injectedStyleIds.add(globalStyleId);
|
|
29
|
+
const cssText = this.extractCSSFromStyles(componentStyles);
|
|
30
|
+
const styleElement = document.createElement('style');
|
|
31
|
+
styleElement.id = globalStyleId;
|
|
32
|
+
styleElement.textContent = cssText;
|
|
33
|
+
document.head.appendChild(styleElement);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Extracts CSS text from CSSResultArray
|
|
37
|
+
*/
|
|
38
|
+
extractCSSFromStyles(styles) {
|
|
39
|
+
// Extract panel container styles for injection
|
|
40
|
+
const containerStyles = panelContainerStyles.cssText || '';
|
|
41
|
+
// Also extract component styles if needed
|
|
42
|
+
const componentStyles = styles
|
|
43
|
+
.map(style => {
|
|
44
|
+
if (typeof style === 'string') {
|
|
45
|
+
return style;
|
|
46
|
+
}
|
|
47
|
+
// For CSSResult, get the cssText
|
|
48
|
+
if (style && 'cssText' in style) {
|
|
49
|
+
return style.cssText;
|
|
50
|
+
}
|
|
51
|
+
return '';
|
|
52
|
+
})
|
|
53
|
+
.join('\n');
|
|
54
|
+
// Return both, prioritizing container styles
|
|
55
|
+
return containerStyles + '\n' + componentStyles;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Cleans up injected styles (only if this is the last instance)
|
|
59
|
+
* Note: In production, you might want a shared style manager
|
|
60
|
+
*/
|
|
61
|
+
cleanupStyles() {
|
|
62
|
+
// For now, we leave styles injected to avoid flicker
|
|
63
|
+
// In a production app, you might want to use a shared style manager
|
|
64
|
+
// that tracks instance count and removes styles when count reaches 0
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Gets the injected style ID
|
|
68
|
+
*/
|
|
69
|
+
getInjectedStyleId() {
|
|
70
|
+
return this.injectedStyleId;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
StyleManager.injectedStyleIds = new Set();
|
|
74
|
+
//# sourceMappingURL=style-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-manager.js","sourceRoot":"","sources":["../../../src/nile-floating-panel/style-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OA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gBAChC,OAAQ,KAAa,CAAC,OAAO,CAAC;YAChC,CAAC;YACD,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,6CAA6C;QAC7C,OAAO,eAAe,GAAG,IAAI,GAAG,eAAe,CAAC;IAClD,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,qDAAqD;QACrD,oEAAoE;QACpE,qEAAqE;IACvE,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;;AAnEc,6BAAgB,GAAgB,IAAI,GAAG,EAAE,AAAzB,CAA0B","sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { CSSResultArray } from 'lit';\nimport { panelContainerStyles } from './nile-floating-panel.css';\n\n/**\n * Manages style injection for the floating panel\n */\nexport class StyleManager {\n private injectedStyleId: string | null = null;\n private static injectedStyleIds: Set<string> = new Set();\n\n /**\n * Injects styles into the document head\n */\n injectStyles(componentStyles: CSSResultArray): void {\n // Check if styles are already injected globally\n const globalStyleId = 'nile-floating-panel-styles-global';\n if (StyleManager.injectedStyleIds.has(globalStyleId)) {\n return; // Styles already injected by another instance\n }\n\n if (this.injectedStyleId && document.getElementById(this.injectedStyleId)) {\n return; // Styles already injected for this instance\n }\n\n this.injectedStyleId = globalStyleId;\n StyleManager.injectedStyleIds.add(globalStyleId);\n\n const cssText = this.extractCSSFromStyles(componentStyles);\n\n const styleElement = document.createElement('style');\n styleElement.id = globalStyleId;\n styleElement.textContent = cssText;\n document.head.appendChild(styleElement);\n }\n\n /**\n * Extracts CSS text from CSSResultArray\n */\n private extractCSSFromStyles(styles: CSSResultArray): string {\n // Extract panel container styles for injection\n const containerStyles = panelContainerStyles.cssText || '';\n\n // Also extract component styles if needed\n const componentStyles = styles\n .map(style => {\n if (typeof style === 'string') {\n return style;\n }\n // For CSSResult, get the cssText\n if (style && 'cssText' in style) {\n return (style as any).cssText;\n }\n return '';\n })\n .join('\\n');\n\n // Return both, prioritizing container styles\n return containerStyles + '\\n' + componentStyles;\n }\n\n /**\n * Cleans up injected styles (only if this is the last instance)\n * Note: In production, you might want a shared style manager\n */\n cleanupStyles(): void {\n // For now, we leave styles injected to avoid flicker\n // In a production app, you might want to use a shared style manager\n // that tracks instance count and removes styles when count reaches 0\n }\n\n /**\n * Gets the injected style ID\n */\n getInjectedStyleId(): string | null {\n return this.injectedStyleId;\n }\n}\n\n"]}
|