@aquera/nile-elements 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +253 -197
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.esm.js +2 -2
- package/dist/nile-file-preview/nile-file-preview.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.esm.js +55 -25
- package/dist/nile-file-preview/utils/index.cjs.js +1 -1
- package/dist/nile-file-preview/utils/index.esm.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js.map +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.esm.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.esm.js +15 -5
- package/dist/nile-file-upload/nile-file-upload.esm.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.template.esm.js +36 -32
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js.map +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.esm.js +1 -1
- package/dist/nile-file-upload/types/index.cjs.js +1 -1
- package/dist/nile-file-upload/types/index.esm.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.esm.js +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js +4 -2
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
- package/dist/nile-grid/index.cjs.js +1 -1
- package/dist/nile-grid/index.esm.js +1 -1
- package/dist/nile-grid/nile-grid-cell-item/nile-grid-cell-item.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-cell-item/nile-grid-cell-item.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-cell-item/nile-grid-cell-item.css.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-cell-item/nile-grid-cell-item.css.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-cell-item/nile-grid-cell-item.css.esm.js +2 -0
- package/dist/nile-grid/nile-grid-cell-item/nile-grid-cell-item.esm.js +1 -1
- package/dist/nile-grid/nile-grid-cell-item/nile-grid-cell-item.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-cell-item/nile-grid-cell-item.utils.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-cell-item/nile-grid-cell-item.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid-head/nile-grid-head.css.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head/nile-grid-head.css.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head/nile-grid-head.css.esm.js +8 -2
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.css.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.css.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.css.esm.js +2 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.esm.js +3 -3
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.css.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.css.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.css.esm.js +1 -0
- package/dist/nile-grid/nile-grid.esm.js +5 -3
- package/dist/nile-grid/nile-grid.layout.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.layout.esm.js +1 -1
- package/dist/nile-grid/nile-grid.resize.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.resize.esm.js +1 -1
- package/dist/nile-grid/nile-grid.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.utils.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid.width.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.width.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.width.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.esm.js +1 -1
- package/dist/nile-popover/index.cjs.js +1 -1
- package/dist/nile-popover/index.esm.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +4 -4
- package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.esm.js +11 -6
- package/dist/src/nile-accordion/nile-accordian.test.js +101 -99
- package/dist/src/nile-accordion/nile-accordian.test.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.test.js +104 -112
- package/dist/src/nile-auto-complete/nile-auto-complete.test.js.map +1 -1
- package/dist/src/nile-avatar/nile-avatar.test.d.ts +0 -1
- package/dist/src/nile-avatar/nile-avatar.test.js +103 -87
- package/dist/src/nile-avatar/nile-avatar.test.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.test.js +554 -35
- package/dist/src/nile-badge/nile-badge.test.js.map +1 -1
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.d.ts +2 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js +106 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js.map +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.d.ts +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js +108 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js.map +1 -0
- package/dist/src/nile-button/nile-button.test.js +499 -39
- package/dist/src/nile-button/nile-button.test.js.map +1 -1
- package/dist/src/nile-button-filter/nile-button-filter.test.d.ts +1 -0
- package/dist/src/nile-button-filter/nile-button-filter.test.js +108 -0
- package/dist/src/nile-button-filter/nile-button-filter.test.js.map +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.d.ts +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.js +108 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.js.map +1 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.d.ts +1 -1
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js +105 -104
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.test.d.ts +0 -6
- package/dist/src/nile-calendar/nile-calendar.test.js +103 -318
- package/dist/src/nile-calendar/nile-calendar.test.js.map +1 -1
- package/dist/src/nile-card/nile-card.test.js +102 -66
- package/dist/src/nile-card/nile-card.test.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.test.js +547 -108
- package/dist/src/nile-checkbox/nile-checkbox.test.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.test.d.ts +0 -2
- package/dist/src/nile-chip/nile-chip.test.js +101 -102
- package/dist/src/nile-chip/nile-chip.test.js.map +1 -1
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.d.ts +1 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js +108 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js.map +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.d.ts +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.js +108 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.js.map +1 -0
- package/dist/src/nile-dialog/nile-dialog.test.d.ts +0 -1
- package/dist/src/nile-dialog/nile-dialog.test.js +104 -126
- package/dist/src/nile-dialog/nile-dialog.test.js.map +1 -1
- package/dist/src/nile-divider/nile-divider.test.d.ts +1 -0
- package/dist/src/nile-divider/nile-divider.test.js +560 -0
- package/dist/src/nile-divider/nile-divider.test.js.map +1 -0
- package/dist/src/nile-drawer/nile-drawer.test.js +106 -86
- package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -1
- package/dist/src/nile-dropdown/nile-dropdown.test.js +104 -148
- package/dist/src/nile-dropdown/nile-dropdown.test.js.map +1 -1
- package/dist/src/nile-empty-state/nile-empty-state.test.js +107 -59
- package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.test.js +105 -55
- package/dist/src/nile-error-message/nile-error-message.test.js.map +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.test.d.ts +1 -0
- package/dist/src/nile-error-notification/nile-error-notification.test.js +108 -0
- package/dist/src/nile-error-notification/nile-error-notification.test.js.map +1 -0
- package/dist/src/nile-file-preview/nile-file-preview.css.js +2 -2
- package/dist/src/nile-file-preview/nile-file-preview.css.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.d.ts +1 -4
- package/dist/src/nile-file-preview/nile-file-preview.js +21 -47
- package/dist/src/nile-file-preview/nile-file-preview.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.template.d.ts +6 -6
- package/dist/src/nile-file-preview/nile-file-preview.template.js +53 -23
- package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.test.d.ts +0 -6
- package/dist/src/nile-file-preview/nile-file-preview.test.js +106 -28
- package/dist/src/nile-file-preview/nile-file-preview.test.js.map +1 -1
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.d.ts +3 -2
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js +32 -7
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.css.js +15 -5
- package/dist/src/nile-file-upload/nile-file-upload.css.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.d.ts +4 -1
- package/dist/src/nile-file-upload/nile-file-upload.js +13 -1
- package/dist/src/nile-file-upload/nile-file-upload.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.template.js +19 -15
- package/dist/src/nile-file-upload/nile-file-upload.template.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.test.d.ts +0 -6
- package/dist/src/nile-file-upload/nile-file-upload.test.js +106 -28
- package/dist/src/nile-file-upload/nile-file-upload.test.js.map +1 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.d.ts +17 -3
- package/dist/src/nile-file-upload/types/file-upload.enums.js +17 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.js.map +1 -1
- package/dist/src/nile-file-upload/utils/drag-drop.util.d.ts +2 -0
- package/dist/src/nile-file-upload/utils/drag-drop.util.js +14 -8
- package/dist/src/nile-file-upload/utils/drag-drop.util.js.map +1 -1
- package/dist/src/nile-file-upload/utils/file-validation.util.js +89 -10
- package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js +102 -77
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -1
- package/dist/src/nile-form-error-message/nile-form-error-message.test.d.ts +1 -0
- package/dist/src/nile-form-error-message/nile-form-error-message.test.js +108 -0
- package/dist/src/nile-form-error-message/nile-form-error-message.test.js.map +1 -0
- package/dist/src/nile-form-group/nile-form-group.test.js +104 -51
- package/dist/src/nile-form-group/nile-form-group.test.js.map +1 -1
- package/dist/src/nile-form-help-text/nile-form-help-text.test.js +104 -84
- package/dist/src/nile-form-help-text/nile-form-help-text.test.js.map +1 -1
- package/dist/src/nile-format-date/nile-format-date.test.d.ts +1 -0
- package/dist/src/nile-format-date/nile-format-date.test.js +108 -0
- package/dist/src/nile-format-date/nile-format-date.test.js.map +1 -0
- package/dist/src/nile-grid/nile-grid-cell-item/nile-grid-cell-item.css.js +2 -0
- package/dist/src/nile-grid/nile-grid-cell-item/nile-grid-cell-item.css.js.map +1 -1
- package/dist/src/nile-grid/nile-grid-cell-item/nile-grid-cell-item.js +1 -1
- package/dist/src/nile-grid/nile-grid-cell-item/nile-grid-cell-item.js.map +1 -1
- package/dist/src/nile-grid/nile-grid-cell-item/nile-grid-cell-item.utils.d.ts +1 -1
- package/dist/src/nile-grid/nile-grid-cell-item/nile-grid-cell-item.utils.js +2 -2
- package/dist/src/nile-grid/nile-grid-cell-item/nile-grid-cell-item.utils.js.map +1 -1
- package/dist/src/nile-grid/nile-grid-head/nile-grid-head.css.js +6 -0
- package/dist/src/nile-grid/nile-grid-head/nile-grid-head.css.js.map +1 -1
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.css.js +2 -1
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.css.js.map +1 -1
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js +6 -5
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js.map +1 -1
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.d.ts +15 -1
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js +26 -2
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.css.js +1 -0
- package/dist/src/nile-grid/nile-grid.css.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.d.ts +31 -3
- package/dist/src/nile-grid/nile-grid.js +107 -30
- package/dist/src/nile-grid/nile-grid.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.layout.d.ts +2 -9
- package/dist/src/nile-grid/nile-grid.layout.js +120 -106
- package/dist/src/nile-grid/nile-grid.layout.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.resize.d.ts +1 -0
- package/dist/src/nile-grid/nile-grid.resize.js +7 -3
- package/dist/src/nile-grid/nile-grid.resize.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.utils.d.ts +7 -0
- package/dist/src/nile-grid/nile-grid.utils.js +37 -2
- package/dist/src/nile-grid/nile-grid.utils.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.width.d.ts +2 -1
- package/dist/src/nile-grid/nile-grid.width.js +38 -8
- package/dist/src/nile-grid/nile-grid.width.js.map +1 -1
- package/dist/src/nile-grid/types/nile-grid.types.d.ts +5 -0
- package/dist/src/nile-grid/types/nile-grid.types.js.map +1 -1
- package/dist/src/nile-heading/nile-heading.test.d.ts +1 -0
- package/dist/src/nile-heading/nile-heading.test.js +108 -0
- package/dist/src/nile-heading/nile-heading.test.js.map +1 -0
- package/dist/src/nile-hero/nile-hero.test.js +101 -38
- package/dist/src/nile-hero/nile-hero.test.js.map +1 -1
- package/dist/src/nile-icon/nile-icon.test.js +103 -40
- package/dist/src/nile-icon/nile-icon.test.js.map +1 -1
- package/dist/src/nile-icon-button/nile-icon-button.test.d.ts +1 -0
- package/dist/src/nile-icon-button/nile-icon-button.test.js +568 -0
- package/dist/src/nile-icon-button/nile-icon-button.test.js.map +1 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.d.ts +1 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.js +108 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.js.map +1 -0
- package/dist/src/nile-input/nile-input.js +1 -1
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-input/nile-input.test.js +109 -139
- package/dist/src/nile-input/nile-input.test.js.map +1 -1
- package/dist/src/nile-link/nile-link.test.js +103 -67
- package/dist/src/nile-link/nile-link.test.js.map +1 -1
- package/dist/src/nile-list/nile-list.test.d.ts +1 -0
- package/dist/src/nile-list/nile-list.test.js +108 -0
- package/dist/src/nile-list/nile-list.test.js.map +1 -0
- package/dist/src/nile-list-item/nile-list-item.test.d.ts +1 -0
- package/dist/src/nile-list-item/nile-list-item.test.js +108 -0
- package/dist/src/nile-list-item/nile-list-item.test.js.map +1 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.d.ts +2 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js +109 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js.map +1 -0
- package/dist/src/nile-loader/nile-loader.test.js +107 -40
- package/dist/src/nile-loader/nile-loader.test.js.map +1 -1
- package/dist/src/nile-menu/nile-menu.test.d.ts +1 -0
- package/dist/src/nile-menu/nile-menu.test.js +113 -0
- package/dist/src/nile-menu/nile-menu.test.js.map +1 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.d.ts +1 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.js +113 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.js.map +1 -0
- package/dist/src/nile-option/nile-option.test.d.ts +1 -0
- package/dist/src/nile-option/nile-option.test.js +108 -0
- package/dist/src/nile-option/nile-option.test.js.map +1 -0
- package/dist/src/nile-option-group/nile-option-group.test.d.ts +1 -0
- package/dist/src/nile-option-group/nile-option-group.test.js +108 -0
- package/dist/src/nile-option-group/nile-option-group.test.js.map +1 -0
- package/dist/src/nile-page-header/nile-page-header.test.d.ts +1 -0
- package/dist/src/nile-page-header/nile-page-header.test.js +108 -0
- package/dist/src/nile-page-header/nile-page-header.test.js.map +1 -0
- package/dist/src/nile-pagination/nile-pagination.test.d.ts +1 -0
- package/dist/src/nile-pagination/nile-pagination.test.js +108 -0
- package/dist/src/nile-pagination/nile-pagination.test.js.map +1 -0
- package/dist/src/nile-popover/nile-popover.test.js +103 -68
- package/dist/src/nile-popover/nile-popover.test.js.map +1 -1
- package/dist/src/nile-popup/nile-popup.test.js +104 -65
- package/dist/src/nile-popup/nile-popup.test.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js +104 -44
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js.map +1 -1
- package/dist/src/nile-radio/nile-radio.test.js +103 -66
- package/dist/src/nile-radio/nile-radio.test.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.test.d.ts +0 -1
- package/dist/src/nile-radio-group/nile-radio-group.test.js +105 -171
- package/dist/src/nile-radio-group/nile-radio-group.test.js.map +1 -1
- package/dist/src/nile-section-message/nile-section-message.test.d.ts +1 -0
- package/dist/src/nile-section-message/nile-section-message.test.js +108 -0
- package/dist/src/nile-section-message/nile-section-message.test.js.map +1 -0
- package/dist/src/nile-select/nile-select.test.d.ts +0 -5
- package/dist/src/nile-select/nile-select.test.js +105 -244
- package/dist/src/nile-select/nile-select.test.js.map +1 -1
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.d.ts +1 -0
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js +108 -0
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js.map +1 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js +104 -50
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js.map +1 -1
- package/dist/src/nile-slider/nile-slider.test.d.ts +1 -0
- package/dist/src/nile-slider/nile-slider.test.js +108 -0
- package/dist/src/nile-slider/nile-slider.test.js.map +1 -0
- package/dist/src/nile-spinner/nile-spinner.test.d.ts +1 -0
- package/dist/src/nile-spinner/nile-spinner.test.js +569 -0
- package/dist/src/nile-spinner/nile-spinner.test.js.map +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.d.ts +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.js +108 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.js.map +1 -0
- package/dist/src/nile-stepper/nile-stepper.test.d.ts +2 -0
- package/dist/src/nile-stepper/nile-stepper.test.js +109 -0
- package/dist/src/nile-stepper/nile-stepper.test.js.map +1 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.d.ts +1 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.js +108 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.js.map +1 -0
- package/dist/src/nile-tab/nile-tab.test.d.ts +1 -0
- package/dist/src/nile-tab/nile-tab.test.js +108 -0
- package/dist/src/nile-tab/nile-tab.test.js.map +1 -0
- package/dist/src/nile-tab-group/nile-tab-group.test.js +105 -172
- package/dist/src/nile-tab-group/nile-tab-group.test.js.map +1 -1
- package/dist/src/nile-tab-panel/nile-tab-panel.test.d.ts +1 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.test.js +108 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.test.js.map +1 -0
- package/dist/src/nile-tag/nile-tag.test.d.ts +1 -0
- package/dist/src/nile-tag/nile-tag.test.js +574 -0
- package/dist/src/nile-tag/nile-tag.test.js.map +1 -0
- package/dist/src/nile-textarea/nile-textarea.test.d.ts +1 -1
- package/dist/src/nile-textarea/nile-textarea.test.js +105 -84
- package/dist/src/nile-textarea/nile-textarea.test.js.map +1 -1
- package/dist/src/nile-title/nile-title.test.d.ts +1 -0
- package/dist/src/nile-title/nile-title.test.js +108 -0
- package/dist/src/nile-title/nile-title.test.js.map +1 -0
- package/dist/src/nile-toast/nile-toast.test.d.ts +1 -0
- package/dist/src/nile-toast/nile-toast.test.js +526 -0
- package/dist/src/nile-toast/nile-toast.test.js.map +1 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.d.ts +1 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.js +108 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.js.map +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.d.ts +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.js +546 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +1 -7
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +105 -628
- package/dist/src/nile-virtual-select/nile-virtual-select.test.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 +1 -1
- package/rollup.config.js +7 -1
- package/src/nile-accordion/nile-accordian.test.ts +102 -116
- package/src/nile-auto-complete/nile-auto-complete.css.ts +1 -1
- package/src/nile-auto-complete/nile-auto-complete.test.ts +102 -145
- package/src/nile-auto-complete/nile-auto-complete.ts +1 -1
- package/src/nile-avatar/nile-avatar.test.ts +102 -112
- package/src/nile-badge/nile-badge.test.ts +642 -30
- package/src/nile-breadcrumb/nile-breadcrumb.test.ts +107 -0
- package/src/nile-breadcrumb-item/nile-breadcrumb-item.test.ts +106 -0
- package/src/nile-button/nile-button.test.ts +593 -61
- package/src/nile-button-filter/nile-button-filter.test.ts +106 -0
- package/src/nile-button-toggle/nile-button-toggle.test.ts +106 -0
- package/src/nile-button-toggle-group/nile-button-toggle-group.test.ts +104 -126
- package/src/nile-calendar/nile-calendar.test.ts +102 -406
- package/src/nile-card/nile-card.test.ts +103 -71
- package/src/nile-checkbox/nile-checkbox.test.ts +614 -108
- package/src/nile-chip/nile-chip.test.ts +102 -136
- package/src/nile-circular-progressbar/nile-circular-progressbar.test.ts +106 -0
- package/src/nile-date-picker/nile-date-picker.test.ts +106 -0
- package/src/nile-dialog/nile-dialog.test.ts +102 -164
- package/src/nile-divider/nile-divider.test.ts +659 -0
- package/src/nile-drawer/nile-drawer.test.ts +105 -105
- package/src/nile-dropdown/nile-dropdown.test.ts +102 -190
- package/src/nile-empty-state/nile-empty-state.test.ts +104 -67
- package/src/nile-error-message/nile-error-message.test.ts +104 -67
- package/src/nile-error-notification/nile-error-notification.test.ts +106 -0
- package/src/nile-file-preview/nile-file-preview.css.ts +2 -2
- package/src/nile-file-preview/nile-file-preview.template.ts +59 -23
- package/src/nile-file-preview/nile-file-preview.test.ts +105 -37
- package/src/nile-file-preview/nile-file-preview.ts +23 -56
- package/src/nile-file-preview/utils/nile-file-preview.util.ts +37 -8
- package/src/nile-file-upload/nile-file-upload.css.ts +15 -5
- package/src/nile-file-upload/nile-file-upload.template.ts +22 -18
- package/src/nile-file-upload/nile-file-upload.test.ts +105 -37
- package/src/nile-file-upload/nile-file-upload.ts +11 -3
- package/src/nile-file-upload/types/file-upload.enums.ts +20 -4
- package/src/nile-file-upload/utils/drag-drop.util.ts +20 -11
- package/src/nile-file-upload/utils/file-validation.util.ts +104 -22
- package/src/nile-filter-chip/nile-filter-chip.test.ts +103 -89
- package/src/nile-form-error-message/nile-form-error-message.test.ts +106 -0
- package/src/nile-form-group/nile-form-group.test.ts +103 -60
- package/src/nile-form-help-text/nile-form-help-text.test.ts +102 -106
- package/src/nile-format-date/nile-format-date.test.ts +106 -0
- package/src/nile-grid/nile-grid-cell-item/nile-grid-cell-item.css.ts +2 -0
- package/src/nile-grid/nile-grid-cell-item/nile-grid-cell-item.ts +1 -1
- package/src/nile-grid/nile-grid-cell-item/nile-grid-cell-item.utils.ts +2 -1
- package/src/nile-grid/nile-grid-head/nile-grid-head.css.ts +6 -0
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.css.ts +2 -1
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.ts +7 -5
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.ts +30 -1
- package/src/nile-grid/nile-grid.css.ts +1 -0
- package/src/nile-grid/nile-grid.layout.ts +122 -133
- package/src/nile-grid/nile-grid.resize.ts +15 -9
- package/src/nile-grid/nile-grid.ts +102 -28
- package/src/nile-grid/nile-grid.utils.ts +45 -3
- package/src/nile-grid/nile-grid.width.ts +45 -14
- package/src/nile-grid/types/nile-grid.types.ts +7 -1
- package/src/nile-heading/nile-heading.test.ts +106 -0
- package/src/nile-hero/nile-hero.test.ts +103 -42
- package/src/nile-icon/nile-icon.test.ts +103 -50
- package/src/nile-icon-button/nile-icon-button.test.ts +667 -0
- package/src/nile-inline-edit/nile-inline-edit.test.ts +106 -0
- package/src/nile-input/nile-input.test.ts +105 -164
- package/src/nile-input/nile-input.ts +1 -1
- package/src/nile-link/nile-link.test.ts +104 -81
- package/src/nile-list/nile-list.test.ts +106 -0
- package/src/nile-list-item/nile-list-item.test.ts +106 -0
- package/src/nile-lite-tooltip/nile-lite-tooltip.test.ts +107 -0
- package/src/nile-loader/nile-loader.test.ts +103 -48
- package/src/nile-menu/nile-menu.test.ts +106 -0
- package/src/nile-menu-item/nile-menu-item.test.ts +106 -0
- package/src/nile-option/nile-option.test.ts +106 -0
- package/src/nile-option-group/nile-option-group.test.ts +106 -0
- package/src/nile-page-header/nile-page-header.test.ts +106 -0
- package/src/nile-pagination/nile-pagination.test.ts +106 -0
- package/src/nile-popover/nile-popover.test.ts +103 -83
- package/src/nile-popup/nile-popup.test.ts +102 -82
- package/src/nile-progress-bar/nile-progress-bar.test.ts +103 -52
- package/src/nile-radio/nile-radio.test.ts +103 -78
- package/src/nile-radio-group/nile-radio-group.test.ts +104 -213
- package/src/nile-section-message/nile-section-message.test.ts +106 -0
- package/src/nile-select/nile-select.test.ts +105 -308
- package/src/nile-skeleton-loader/nile-skeleton-loader.test.ts +106 -0
- package/src/nile-slide-toggle/nile-slide-toggle.test.ts +103 -58
- package/src/nile-slider/nile-slider.test.ts +106 -0
- package/src/nile-spinner/nile-spinner.test.ts +668 -0
- package/src/nile-split-panel/nile-split-panel.test.ts +106 -0
- package/src/nile-stepper/nile-stepper.test.ts +107 -0
- package/src/nile-stepper-item/nile-stepper-item.test.ts +106 -0
- package/src/nile-tab/nile-tab.test.ts +106 -0
- package/src/nile-tab-group/nile-tab-group.test.ts +104 -211
- package/src/nile-tab-panel/nile-tab-panel.test.ts +106 -0
- package/src/nile-tag/nile-tag.test.ts +675 -0
- package/src/nile-textarea/nile-textarea.test.ts +104 -100
- package/src/nile-title/nile-title.test.ts +106 -0
- package/src/nile-toast/nile-toast.test.ts +625 -0
- package/src/nile-toolbar/nile-toolbar.test.ts +106 -0
- package/src/nile-tooltip/nile-tooltip.test.ts +645 -0
- package/src/nile-virtual-select/nile-virtual-select.test.ts +104 -772
- package/vscode-html-custom-data.json +10 -5
- package/web-test-runner.config.mjs +4 -2
- package/dist/axe.min-2720cd56.esm.js +0 -1
- package/dist/axe.min-69d47269.cjs.js +0 -2
- package/dist/axe.min-69d47269.cjs.js.map +0 -1
- package/dist/css-tag-bb10c0fa.cjs.js +0 -6
- package/dist/css-tag-bb10c0fa.cjs.js.map +0 -1
- package/dist/css-tag-dc564feb.esm.js +0 -6
- package/dist/fixture-958445f8.cjs.js +0 -395
- package/dist/fixture-958445f8.cjs.js.map +0 -1
- package/dist/fixture-985bba12.esm.js +0 -569
- package/dist/nile-accordion/nile-accordian.test.cjs.js +0 -2
- package/dist/nile-accordion/nile-accordian.test.cjs.js.map +0 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +0 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +0 -2
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +0 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +0 -9
- package/dist/nile-avatar/nile-avatar.test.cjs.js +0 -2
- package/dist/nile-avatar/nile-avatar.test.cjs.js.map +0 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +0 -11
- package/dist/nile-badge/nile-badge.test.cjs.js +0 -2
- package/dist/nile-badge/nile-badge.test.cjs.js.map +0 -1
- package/dist/nile-badge/nile-badge.test.esm.js +0 -1
- package/dist/nile-button/nile-button.test.cjs.js +0 -2
- package/dist/nile-button/nile-button.test.cjs.js.map +0 -1
- package/dist/nile-button/nile-button.test.esm.js +0 -4
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +0 -2
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js.map +0 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +0 -49
- package/dist/nile-calendar/nile-calendar.test.cjs.js +0 -2
- package/dist/nile-calendar/nile-calendar.test.cjs.js.map +0 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +0 -11
- package/dist/nile-card/nile-card.test.cjs.js +0 -2
- package/dist/nile-card/nile-card.test.cjs.js.map +0 -1
- package/dist/nile-card/nile-card.test.esm.js +0 -51
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +0 -2
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js.map +0 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +0 -17
- package/dist/nile-chip/nile-chip.test.cjs.js +0 -2
- package/dist/nile-chip/nile-chip.test.cjs.js.map +0 -1
- package/dist/nile-chip/nile-chip.test.esm.js +0 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +0 -2
- package/dist/nile-dialog/nile-dialog.test.cjs.js.map +0 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +0 -7
- package/dist/nile-drawer/nile-drawer.test.cjs.js +0 -2
- package/dist/nile-drawer/nile-drawer.test.cjs.js.map +0 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +0 -17
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +0 -2
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js.map +0 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +0 -28
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +0 -2
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js.map +0 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +0 -9
- package/dist/nile-error-message/nile-error-message.test.cjs.js +0 -2
- package/dist/nile-error-message/nile-error-message.test.cjs.js.map +0 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +0 -1
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js +0 -2
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js.map +0 -1
- package/dist/nile-file-preview/nile-file-preview.test.esm.js +0 -1
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js +0 -2
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js.map +0 -1
- package/dist/nile-file-upload/nile-file-upload.test.esm.js +0 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +0 -2
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +0 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +0 -20
- package/dist/nile-form-group/nile-form-group.test.cjs.js +0 -2
- package/dist/nile-form-group/nile-form-group.test.cjs.js.map +0 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +0 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +0 -2
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js.map +0 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +0 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +0 -2
- package/dist/nile-hero/nile-hero.test.cjs.js.map +0 -1
- package/dist/nile-hero/nile-hero.test.esm.js +0 -14
- package/dist/nile-icon/nile-icon.test.cjs.js +0 -2
- package/dist/nile-icon/nile-icon.test.cjs.js.map +0 -1
- package/dist/nile-icon/nile-icon.test.esm.js +0 -1
- package/dist/nile-input/nile-input.test.cjs.js +0 -2
- package/dist/nile-input/nile-input.test.cjs.js.map +0 -1
- package/dist/nile-input/nile-input.test.esm.js +0 -17
- package/dist/nile-link/nile-link.test.cjs.js +0 -2
- package/dist/nile-link/nile-link.test.cjs.js.map +0 -1
- package/dist/nile-link/nile-link.test.esm.js +0 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +0 -2
- package/dist/nile-loader/nile-loader.test.cjs.js.map +0 -1
- package/dist/nile-loader/nile-loader.test.esm.js +0 -1
- package/dist/nile-popover/nile-popover.test.cjs.js +0 -2
- package/dist/nile-popover/nile-popover.test.cjs.js.map +0 -1
- package/dist/nile-popover/nile-popover.test.esm.js +0 -21
- package/dist/nile-popup/nile-popup.test.cjs.js +0 -2
- package/dist/nile-popup/nile-popup.test.cjs.js.map +0 -1
- package/dist/nile-popup/nile-popup.test.esm.js +0 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +0 -2
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js.map +0 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +0 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +0 -2
- package/dist/nile-radio/nile-radio.test.cjs.js.map +0 -1
- package/dist/nile-radio/nile-radio.test.esm.js +0 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +0 -2
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js.map +0 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +0 -57
- package/dist/nile-select/nile-select.test.cjs.js +0 -2
- package/dist/nile-select/nile-select.test.cjs.js.map +0 -1
- package/dist/nile-select/nile-select.test.esm.js +0 -55
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +0 -2
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js.map +0 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +0 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +0 -2
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js.map +0 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +0 -65
- package/dist/nile-textarea/nile-textarea.test.cjs.js +0 -2
- package/dist/nile-textarea/nile-textarea.test.cjs.js.map +0 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +0 -2
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +0 -93
- package/dist/scopedElementsWrapper-31107e48.esm.js +0 -1
- package/dist/scopedElementsWrapper-9b188ea6.cjs.js +0 -2
- package/dist/scopedElementsWrapper-9b188ea6.cjs.js.map +0 -1
- package/dist/sinon-esm-68c8e378.esm.js +0 -1
- package/dist/sinon-esm-97570c13.cjs.js +0 -2
- package/dist/sinon-esm-97570c13.cjs.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-grid-head-item.js","sourceRoot":"","sources":["../../../../src/nile-grid/nile-grid-head-item/nile-grid-head-item.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAkD,MAAM,KAAK,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,
|
|
1
|
+
{"version":3,"file":"nile-grid-head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AE,IAAI,EAAE,CAAC;mDAAmB;AACnB;IAA3D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;+CAA6B;AAC5B;IAA3D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gDAA8B;AAC5B;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;mDAA4B;AAd7E,gBAAgB;IAD5B,aAAa,CAAC,qBAAqB,CAAC;GACxB,gBAAgB,CA+D5B;;AAED,eAAe,gBAAgB,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 { html, CSSResultArray, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-grid-head-item.css';\nimport NileElement from '../../internal/nile-element';\nimport {\n initHeadResize,\n headResizeMove,\n headResizeDone,\n addListeners,\n removeListeners,\n} from './nile-grid-head-item.utils';\nimport { NileGrid } from '../nile-grid';\n\n/**\n * Nile grid-head-item component.\n *\n * @tag nile-grid-head-item\n *\n */\n@customElement('nile-grid-head-item')\nexport class NileGridHeadItem extends NileElement {\n /**\n * The styles for nile-grid-head-item\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 @property({ type: Number, reflect: true, attribute: true }) colspan = 1;\n @property({ type: Number, reflect: true, attribute: true }) rowspan = 1;\n @property({ type: Boolean, reflect: true, attribute: true }) resizable = false;\n @property({ type: String, reflect: true, attribute: true }) width: string | null = null;\n @property({ type: String, reflect: true, attribute: true }) sticky: string | null = null;\n @property({ type: Boolean, reflect: true, attribute: true }) lockWidth: boolean = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role','row');\n }\n\n private onHandlePointerDown = (ev: PointerEvent) => {\n const el = this as HTMLElement;\n const nileGrid = this.closest('nile-grid') as NileGrid;\n const downXRef = { value: 0 };\n const startWRef = { value: 0 };\n\n const result = initHeadResize(el, ev, downXRef, startWRef);\n if (!result) return;\n\n const { target, col } = result;\n const move = (e: PointerEvent) => headResizeMove(el, col, startWRef.value, downXRef.value, e, nileGrid);\n const done = (e: PointerEvent) => {\n headResizeDone(el, col, e, target, move);\n removeListeners(target, move, done);\n }\n addListeners(target, move, done);\n };\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeAttribute('role');\n }\n\n public render(): TemplateResult {\n return html`\n <div part=\"grid-head-item-base\" class=\"head-item-base\">\n <slot></slot>\n ${this.resizable\n ? html`\n <div\n aria-hidden=\"false\"\n class=\"resize-handle\"\n part=\"resize-handle\"\n @pointerdown=${this.onHandlePointerDown}\n ></div>\n `\n : null}\n </div>\n `;\n }\n\n /* #endregion */\n}\n\nexport default NileGridHeadItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-grid-head-item': NileGridHeadItem;\n }\n}\n"]}
|
|
@@ -31,4 +31,18 @@ export declare function headResizeMove(el: HTMLElement, col: number, startW: num
|
|
|
31
31
|
* @param move Pointer move handler
|
|
32
32
|
* @returns void
|
|
33
33
|
*/
|
|
34
|
-
export declare function headResizeDone(el: HTMLElement, ev: PointerEvent, target: HTMLElement, move: (e: PointerEvent) => void): void;
|
|
34
|
+
export declare function headResizeDone(el: HTMLElement, col: number, ev: PointerEvent, target: HTMLElement, move: (e: PointerEvent) => void): void;
|
|
35
|
+
/** addListeners
|
|
36
|
+
* @param target Target element
|
|
37
|
+
* @param move Pointer move handler
|
|
38
|
+
* @param done Pointer up handler
|
|
39
|
+
* @returns void
|
|
40
|
+
*/
|
|
41
|
+
export declare function addListeners(target: HTMLElement, move: (e: PointerEvent) => void, done: (e: PointerEvent) => void): void;
|
|
42
|
+
/** removeListeners
|
|
43
|
+
* @param target Target element
|
|
44
|
+
* @param move Pointer move handler
|
|
45
|
+
* @param done Pointer up handler
|
|
46
|
+
* @returns void
|
|
47
|
+
*/
|
|
48
|
+
export declare function removeListeners(target: HTMLElement, move: (e: PointerEvent) => void, done: (e: PointerEvent) => void): void;
|
|
@@ -49,9 +49,33 @@ export function headResizeMove(el, col, startW, downX, e, nileGrid) {
|
|
|
49
49
|
* @param move Pointer move handler
|
|
50
50
|
* @returns void
|
|
51
51
|
*/
|
|
52
|
-
export function headResizeDone(el, ev, target, move) {
|
|
52
|
+
export function headResizeDone(el, col, ev, target, move) {
|
|
53
53
|
target.releasePointerCapture(ev.pointerId);
|
|
54
54
|
target.removeEventListener('pointermove', move);
|
|
55
|
-
el.dispatchEvent(new CustomEvent('nile-resize-end', { bubbles: true, composed: true }));
|
|
55
|
+
el.dispatchEvent(new CustomEvent('nile-resize-end', { bubbles: true, composed: true, detail: { col: col } }));
|
|
56
|
+
}
|
|
57
|
+
/** addListeners
|
|
58
|
+
* @param target Target element
|
|
59
|
+
* @param move Pointer move handler
|
|
60
|
+
* @param done Pointer up handler
|
|
61
|
+
* @returns void
|
|
62
|
+
*/
|
|
63
|
+
export function addListeners(target, move, done) {
|
|
64
|
+
target.addEventListener('pointermove', move);
|
|
65
|
+
target.addEventListener('pointerup', done);
|
|
66
|
+
target.addEventListener('pointercancel', done);
|
|
67
|
+
window.addEventListener('pointerup', done, { once: true });
|
|
68
|
+
}
|
|
69
|
+
/** removeListeners
|
|
70
|
+
* @param target Target element
|
|
71
|
+
* @param move Pointer move handler
|
|
72
|
+
* @param done Pointer up handler
|
|
73
|
+
* @returns void
|
|
74
|
+
*/
|
|
75
|
+
export function removeListeners(target, move, done) {
|
|
76
|
+
target.removeEventListener('pointermove', move);
|
|
77
|
+
target.removeEventListener('pointerup', done);
|
|
78
|
+
target.removeEventListener('pointercancel', done);
|
|
79
|
+
window.removeEventListener('pointerup', done);
|
|
56
80
|
}
|
|
57
81
|
//# sourceMappingURL=nile-grid-head-item.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-grid-head-item.utils.js","sourceRoot":"","sources":["../../../../src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,EAAe,EACf,EAAgB,EAChB,QAA2B,EAC3B,SAA4B;IAE5B,EAAE,CAAC,cAAc,EAAE,CAAC;IACpB,EAAE,CAAC,eAAe,EAAE,CAAC;IAErB,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAE/C,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC;IAC5B,SAAS,CAAC,KAAK,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;IAEnD,MAAM,MAAM,GAAG,EAAE,CAAC,aAA4B,CAAC;IAC/C,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAEvC,EAAE,CAAC,aAAa,CACd,IAAI,WAAW,CAAC,oBAAoB,EAAE;QACpC,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE;QACzC,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;KACf,CAAC,CACH,CAAC;IAEF,EAAE,CAAC,aAAa,CACd,IAAI,WAAW,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CACxE,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AACzB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,EAAe,EACf,GAAW,EACX,MAAc,EACd,KAAa,EACb,CAAe,EACf,QAAkB;IAElB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5F,EAAE,CAAC,aAAa,CACd,IAAI,WAAW,CAAC,oBAAoB,EAAE;QACpC,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;QACxB,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;KACf,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,EAAe,EACf,EAAgB,EAChB,MAAmB,EACnB,IAA+B;IAE/B,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAC3C,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAEhD,EAAE,CAAC,aAAa,CACd,IAAI,WAAW,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"nile-grid-head-item.utils.js","sourceRoot":"","sources":["../../../../src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,EAAe,EACf,EAAgB,EAChB,QAA2B,EAC3B,SAA4B;IAE5B,EAAE,CAAC,cAAc,EAAE,CAAC;IACpB,EAAE,CAAC,eAAe,EAAE,CAAC;IAEr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;IAC9C,MAAM,CAAC,mBAAmB,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IAElD,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import { NileGrid } from \"../nile-grid\";\n\n/** initHeadResize\n * @param el Target element\n * @param ev Pointer event\n * @param downXRef Reference to store downX value\n * @param startWRef Reference to store startW value\n * @returns Object containing target element and column index\n */\nexport function initHeadResize(\n el: HTMLElement,\n ev: PointerEvent,\n downXRef: { value: number },\n startWRef: { value: number }\n) {\n ev.preventDefault();\n ev.stopPropagation();\n\n const cStart = Number(el.dataset.cStart);\n if (!cStart) return null;\n\n const span = Number(el.getAttribute('colspan')) || 1;\n const col = Math.max(0, cStart + span - 1 - 1);\n\n downXRef.value = ev.clientX;\n startWRef.value = el.getBoundingClientRect().width;\n\n const target = ev.currentTarget as HTMLElement;\n target.setPointerCapture(ev.pointerId);\n\n el.dispatchEvent(\n new CustomEvent('nile-column-resize', {\n detail: { col, widthPx: startWRef.value },\n bubbles: true,\n composed: true,\n })\n );\n\n el.dispatchEvent(\n new CustomEvent('nile-resize-start', { bubbles: true, composed: true })\n );\n\n return { target, col };\n}\n\n/** headResizeMove\n * @param el Target element\n * @param col Column index\n * @param startW Starting width\n * @param downX Down X coordinate\n * @param e Pointer event\n * @param nileGrid NileGrid instance\n * @returns void\n */\nexport function headResizeMove(\n el: HTMLElement,\n col: number,\n startW: number,\n downX: number,\n e: PointerEvent,\n nileGrid: NileGrid\n) {\n const widthPx = Math.max(nileGrid.minColumnWidth, Math.round(startW + (e.clientX - downX)));\n el.dispatchEvent(\n new CustomEvent('nile-column-resize', {\n detail: { col, widthPx },\n bubbles: true,\n composed: true,\n })\n );\n}\n\n/** headResizeDone\n * @param el Target element\n * @param ev Pointer event\n * @param target Target element\n * @param move Pointer move handler\n * @returns void\n */\nexport function headResizeDone(\n el: HTMLElement,\n col: number,\n ev: PointerEvent,\n target: HTMLElement,\n move: (e: PointerEvent) => void\n) {\n target.releasePointerCapture(ev.pointerId);\n target.removeEventListener('pointermove', move);\n\n el.dispatchEvent(\n new CustomEvent('nile-resize-end', { bubbles: true, composed: true, detail: { col: col } })\n );\n}\n\n/** addListeners\n * @param target Target element\n * @param move Pointer move handler\n * @param done Pointer up handler\n * @returns void\n */\nexport function addListeners(target: HTMLElement, move: (e: PointerEvent) => void, done: (e: PointerEvent) => void) {\n target.addEventListener('pointermove', move);\n target.addEventListener('pointerup', done);\n target.addEventListener('pointercancel', done);\n\n window.addEventListener('pointerup', done, { once: true });\n}\n\n/** removeListeners\n * @param target Target element\n * @param move Pointer move handler\n * @param done Pointer up handler\n * @returns void\n */\nexport function removeListeners(target: HTMLElement, move: (e: PointerEvent) => void, done: (e: PointerEvent) => void) {\n target.removeEventListener('pointermove', move);\n target.removeEventListener('pointerup', done);\n target.removeEventListener('pointercancel', done);\n\n window.removeEventListener('pointerup', done);\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-grid.css.js","sourceRoot":"","sources":["../../../src/nile-grid/nile-grid.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"nile-grid.css.js","sourceRoot":"","sources":["../../../src/nile-grid/nile-grid.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCxB,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\nexport const styles = css`\n :host {\n --min-width: 180px;\n display: grid;\n grid-template-rows: auto;\n overflow: auto;\n inline-size: 100%;\n position: relative;\n box-sizing: border-box;\n border: 1px solid var(--nile-colors-neutral-400, , var(--ng-colors-border-secondary));\n border-radius: var(--nile-radius-md, var(--ng-radius-xl));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n max-height: 100%;\n width: 100%;\n min-width: var(--min-width);\n box-shadow: var(--nile-box-shadow-3, var(--ng-shadow-xs));\n overscroll-behavior: none;\n }\n\n ::slotted(nile-grid-head),\n ::slotted(nile-grid-body) {\n inline-size: 100%;\n }\n\n .nile-resize-start,\n .nile-resize-end {\n position: absolute;\n z-index: 4;\n background-color: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n width: 2px;\n height: 100%;\n top: 0;\n display: none;\n bottom: 0;\n }\n`;\n\nexport default [styles];\n"]}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { CSSResultArray, TemplateResult } from 'lit';
|
|
8
8
|
import NileElement from '../internal/nile-element';
|
|
9
|
+
import { PrefixColumn } from './types/nile-grid.types';
|
|
9
10
|
/**
|
|
10
11
|
* Nile grid component.
|
|
11
12
|
*
|
|
@@ -18,8 +19,6 @@ export declare class NileGrid extends NileElement {
|
|
|
18
19
|
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
|
19
20
|
*/
|
|
20
21
|
static get styles(): CSSResultArray;
|
|
21
|
-
/** To set the grid template columns in rebuildTemplate method */
|
|
22
|
-
colTemplate: string;
|
|
23
22
|
/** To store the column widths in the beginning and after resizing */
|
|
24
23
|
columnWidths: number[];
|
|
25
24
|
/** To get the slot element */
|
|
@@ -28,8 +27,12 @@ export declare class NileGrid extends NileElement {
|
|
|
28
27
|
resizeStart: HTMLElement;
|
|
29
28
|
/** To get the last resize line to show the resize handle */
|
|
30
29
|
resizeEnd: HTMLElement;
|
|
30
|
+
/** To get the last resize line to show the resize handle */
|
|
31
|
+
shadowLeft: HTMLElement;
|
|
32
|
+
/** To get the last resize line to show the resize handle */
|
|
33
|
+
shadowRight: HTMLElement;
|
|
31
34
|
/** To enable horizontal scrolling when user is resizing */
|
|
32
|
-
|
|
35
|
+
enableScroll: boolean;
|
|
33
36
|
/** To enable hoverable rows */
|
|
34
37
|
hoverable: boolean;
|
|
35
38
|
/** To store the mutation observer */
|
|
@@ -52,6 +55,31 @@ export declare class NileGrid extends NileElement {
|
|
|
52
55
|
widthsInitialized: boolean;
|
|
53
56
|
/** To check if the widths are initialized */
|
|
54
57
|
lockedWidthColumns: boolean[];
|
|
58
|
+
/** prefix columns width */
|
|
59
|
+
prefixSumColumnsWidth: PrefixColumn[];
|
|
60
|
+
/** prefix columns width */
|
|
61
|
+
stickyColumns: number[];
|
|
62
|
+
/** body rows */
|
|
63
|
+
bodyRows: HTMLElement[];
|
|
64
|
+
/** head rows */
|
|
65
|
+
headRows: HTMLElement[];
|
|
66
|
+
needsStructureLayout: boolean;
|
|
67
|
+
needsWidthLayout: boolean;
|
|
68
|
+
needsSpanLayout: boolean;
|
|
69
|
+
colCount: number;
|
|
70
|
+
shadowLeftVisibleSticky?: boolean;
|
|
71
|
+
shadowRightVisibleSticky?: boolean;
|
|
72
|
+
stickyLeftHeadEls: HTMLElement[];
|
|
73
|
+
stickyRightHeadEls: HTMLElement[];
|
|
74
|
+
stickyLeftBodyEls: HTMLElement[];
|
|
75
|
+
stickyRightBodyEls: HTMLElement[];
|
|
76
|
+
private resizeTimer;
|
|
77
|
+
/** To throttle sticky shadow updates */
|
|
78
|
+
private shadowRaf;
|
|
79
|
+
resizeBaseColumnWidths: number[];
|
|
80
|
+
constructor();
|
|
81
|
+
connectedCallback(): void;
|
|
82
|
+
private syncStickyShadowsRaf;
|
|
55
83
|
private scheduleLayout;
|
|
56
84
|
private ensureWidths;
|
|
57
85
|
private onResize;
|
|
@@ -9,9 +9,9 @@ import { html } from 'lit';
|
|
|
9
9
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
10
10
|
import { styles } from './nile-grid.css';
|
|
11
11
|
import NileElement from '../internal/nile-element';
|
|
12
|
-
import {
|
|
13
|
-
import { listenToEventListeners, removeEventListeners, getHead, getBody } from './nile-grid.utils';
|
|
14
|
-
import { computeNewWidth, resizeWithScroll,
|
|
12
|
+
import { syncStickyShadows, layout } from './nile-grid.layout';
|
|
13
|
+
import { listenToEventListeners, removeEventListeners, getHead, getBody, copyArrayValuesInPlace } from './nile-grid.utils';
|
|
14
|
+
import { computeNewWidth, resizeWithScroll, resizeNoScroll, updateResizeGuides } from './nile-grid.resize';
|
|
15
15
|
/**
|
|
16
16
|
* Nile grid component.
|
|
17
17
|
*
|
|
@@ -19,14 +19,19 @@ import { computeNewWidth, resizeWithScroll, applyAfterResize, resizeNoScroll } f
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
let NileGrid = class NileGrid extends NileElement {
|
|
22
|
+
/**
|
|
23
|
+
* The styles for nile-grid
|
|
24
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
|
25
|
+
*/
|
|
26
|
+
static get styles() {
|
|
27
|
+
return [styles];
|
|
28
|
+
}
|
|
22
29
|
constructor() {
|
|
23
|
-
super(
|
|
24
|
-
/** To set the grid template columns in rebuildTemplate method */
|
|
25
|
-
this.colTemplate = '';
|
|
30
|
+
super();
|
|
26
31
|
/** To store the column widths in the beginning and after resizing */
|
|
27
32
|
this.columnWidths = [];
|
|
28
33
|
/** To enable horizontal scrolling when user is resizing */
|
|
29
|
-
this.
|
|
34
|
+
this.enableScroll = false;
|
|
30
35
|
/** To enable hoverable rows */
|
|
31
36
|
this.hoverable = false;
|
|
32
37
|
/** To store the request animation frame */
|
|
@@ -44,6 +49,34 @@ let NileGrid = class NileGrid extends NileElement {
|
|
|
44
49
|
this.widthsInitialized = false;
|
|
45
50
|
/** To check if the widths are initialized */
|
|
46
51
|
this.lockedWidthColumns = [];
|
|
52
|
+
/** prefix columns width */
|
|
53
|
+
this.prefixSumColumnsWidth = [];
|
|
54
|
+
/** prefix columns width */
|
|
55
|
+
this.stickyColumns = [];
|
|
56
|
+
/** body rows */
|
|
57
|
+
this.bodyRows = [];
|
|
58
|
+
/** head rows */
|
|
59
|
+
this.headRows = [];
|
|
60
|
+
this.needsStructureLayout = false;
|
|
61
|
+
this.needsWidthLayout = false;
|
|
62
|
+
this.needsSpanLayout = false;
|
|
63
|
+
this.colCount = 0;
|
|
64
|
+
this.stickyLeftHeadEls = [];
|
|
65
|
+
this.stickyRightHeadEls = [];
|
|
66
|
+
this.stickyLeftBodyEls = [];
|
|
67
|
+
this.stickyRightBodyEls = [];
|
|
68
|
+
this.resizeTimer = 0;
|
|
69
|
+
/** To throttle sticky shadow updates */
|
|
70
|
+
this.shadowRaf = 0;
|
|
71
|
+
this.resizeBaseColumnWidths = [];
|
|
72
|
+
this.syncStickyShadowsRaf = () => {
|
|
73
|
+
if (this.shadowRaf)
|
|
74
|
+
return;
|
|
75
|
+
this.shadowRaf = requestAnimationFrame(() => {
|
|
76
|
+
this.shadowRaf = 0;
|
|
77
|
+
syncStickyShadows(this);
|
|
78
|
+
});
|
|
79
|
+
};
|
|
47
80
|
this.onResize = (e) => {
|
|
48
81
|
e.stopPropagation();
|
|
49
82
|
this.emit('nile-resize', {
|
|
@@ -51,6 +84,9 @@ let NileGrid = class NileGrid extends NileElement {
|
|
|
51
84
|
columnWidth: e.detail.widthPx,
|
|
52
85
|
});
|
|
53
86
|
const { col, widthPx } = e.detail;
|
|
87
|
+
if (!this.resizeBaseColumnWidths)
|
|
88
|
+
return;
|
|
89
|
+
copyArrayValuesInPlace(this.columnWidths, this.resizeBaseColumnWidths);
|
|
54
90
|
const { prevW, newW, delta0 } = computeNewWidth({
|
|
55
91
|
target: e.target,
|
|
56
92
|
col,
|
|
@@ -59,81 +95,95 @@ let NileGrid = class NileGrid extends NileElement {
|
|
|
59
95
|
columnWidths: this.columnWidths,
|
|
60
96
|
});
|
|
61
97
|
if (delta0 === 0) {
|
|
62
|
-
|
|
98
|
+
updateResizeGuides(this, col);
|
|
63
99
|
return;
|
|
64
100
|
}
|
|
65
|
-
if (!this.
|
|
101
|
+
if (!this.enableScroll) {
|
|
66
102
|
resizeNoScroll({ grid: this, col, prevW, newW, floor: this.minColumnWidth });
|
|
67
103
|
}
|
|
68
104
|
else {
|
|
69
105
|
resizeWithScroll({ grid: this, col, newW });
|
|
70
106
|
}
|
|
71
|
-
|
|
107
|
+
updateResizeGuides(this, col);
|
|
72
108
|
};
|
|
73
|
-
/* #endregion */
|
|
74
109
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
*/
|
|
79
|
-
static get styles() {
|
|
80
|
-
return [styles];
|
|
110
|
+
connectedCallback() {
|
|
111
|
+
super.connectedCallback();
|
|
112
|
+
this.emit('nile-init');
|
|
81
113
|
}
|
|
82
114
|
scheduleLayout() {
|
|
83
115
|
if (this.raf)
|
|
84
116
|
cancelAnimationFrame(this.raf);
|
|
85
117
|
this.raf = requestAnimationFrame(() => {
|
|
86
118
|
this.raf = 0;
|
|
87
|
-
layout(this, this.slotEl, this.ensureWidths.bind(this),
|
|
119
|
+
layout(this, this.slotEl, this.ensureWidths.bind(this), this.stickyLeftIndexes, this.stickyRightIndexes);
|
|
88
120
|
syncStickyShadows(this);
|
|
89
121
|
});
|
|
90
122
|
}
|
|
91
123
|
ensureWidths(colCount) {
|
|
92
124
|
if (this.columnWidths.length !== colCount) {
|
|
93
|
-
this.columnWidths = Array(colCount).fill(
|
|
125
|
+
this.columnWidths = Array(colCount).fill(0);
|
|
94
126
|
this.lockedWidthColumns = Array(colCount).fill(false);
|
|
95
127
|
}
|
|
96
128
|
}
|
|
97
129
|
firstUpdated() {
|
|
98
130
|
this.setAttribute('role', 'table');
|
|
99
131
|
listenToEventListeners(this, this.onResize, this.slotEl, this._attachObserverAndLayout.bind(this));
|
|
100
|
-
this.addEventListener('scroll',
|
|
132
|
+
this.addEventListener('scroll', this.syncStickyShadowsRaf);
|
|
101
133
|
this.resizeObserverStickyShadows = new ResizeObserver(() => syncStickyShadows(this));
|
|
102
134
|
this.resizeObserverStickyShadows.observe(this);
|
|
103
|
-
|
|
135
|
+
this.syncStickyShadowsRaf();
|
|
104
136
|
}
|
|
105
137
|
_attachObserverAndLayout() {
|
|
106
138
|
this.mo?.disconnect();
|
|
107
139
|
this.mo = new MutationObserver(() => {
|
|
140
|
+
this.needsStructureLayout = true;
|
|
141
|
+
this.needsWidthLayout = true;
|
|
142
|
+
this.needsSpanLayout = true;
|
|
108
143
|
this.scheduleLayout();
|
|
109
144
|
});
|
|
110
145
|
this.resizeObserver?.disconnect();
|
|
111
146
|
this.resizeObserver = new ResizeObserver(() => {
|
|
112
|
-
|
|
147
|
+
if (this.resizeTimer)
|
|
148
|
+
clearTimeout(this.resizeTimer);
|
|
149
|
+
this.resizeTimer = setTimeout(() => {
|
|
150
|
+
this.resizeTimer = 0;
|
|
151
|
+
this.needsWidthLayout = true;
|
|
152
|
+
this.scheduleLayout();
|
|
153
|
+
}, 16);
|
|
113
154
|
});
|
|
114
155
|
const head = getHead(this.slotEl);
|
|
115
156
|
const body = getBody(this.slotEl);
|
|
116
157
|
if (!head && !body)
|
|
117
158
|
return;
|
|
118
|
-
const target =
|
|
159
|
+
const target = head ?? this;
|
|
119
160
|
this.mo.observe(target, {
|
|
120
|
-
subtree: true,
|
|
121
161
|
childList: true,
|
|
162
|
+
subtree: true,
|
|
122
163
|
attributes: true,
|
|
123
|
-
attributeFilter: ['colspan', 'rowspan']
|
|
164
|
+
attributeFilter: ['colspan', 'rowspan', 'width', 'lockwidth', 'sticky']
|
|
124
165
|
});
|
|
125
166
|
this.resizeObserver?.observe(this);
|
|
167
|
+
if (!this.colCount || !this.columnWidths?.length) {
|
|
168
|
+
this.needsStructureLayout = true;
|
|
169
|
+
this.needsSpanLayout = true;
|
|
170
|
+
this.needsWidthLayout = true;
|
|
171
|
+
this.scheduleLayout();
|
|
172
|
+
}
|
|
126
173
|
}
|
|
127
174
|
render() {
|
|
128
175
|
return html `
|
|
129
176
|
<div part="grid-base" class="nile-grid-base">
|
|
130
|
-
<
|
|
177
|
+
<div part="grid-slot-wrapper">
|
|
178
|
+
<slot part="grid-slot"></slot>
|
|
179
|
+
</div>
|
|
131
180
|
<div part="resize-start" class="nile-resize-start"></div>
|
|
132
181
|
<div part="resize-end" class="nile-resize-end"></div>
|
|
133
182
|
</div>
|
|
134
183
|
`;
|
|
135
184
|
}
|
|
136
185
|
disconnectedCallback() {
|
|
186
|
+
this.emit('nile-destroy');
|
|
137
187
|
super.disconnectedCallback?.();
|
|
138
188
|
this.mo?.disconnect();
|
|
139
189
|
this.resizeObserver?.disconnect();
|
|
@@ -143,9 +193,6 @@ let NileGrid = class NileGrid extends NileElement {
|
|
|
143
193
|
removeEventListeners(this, this.onResize, this.slotEl, this._attachObserverAndLayout.bind(this));
|
|
144
194
|
}
|
|
145
195
|
};
|
|
146
|
-
__decorate([
|
|
147
|
-
state()
|
|
148
|
-
], NileGrid.prototype, "colTemplate", void 0);
|
|
149
196
|
__decorate([
|
|
150
197
|
state()
|
|
151
198
|
], NileGrid.prototype, "columnWidths", void 0);
|
|
@@ -158,9 +205,15 @@ __decorate([
|
|
|
158
205
|
__decorate([
|
|
159
206
|
query('.nile-resize-end')
|
|
160
207
|
], NileGrid.prototype, "resizeEnd", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
query('.shadow-left')
|
|
210
|
+
], NileGrid.prototype, "shadowLeft", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
query('.shadow-right')
|
|
213
|
+
], NileGrid.prototype, "shadowRight", void 0);
|
|
161
214
|
__decorate([
|
|
162
215
|
property({ type: Boolean, attribute: true, reflect: true })
|
|
163
|
-
], NileGrid.prototype, "
|
|
216
|
+
], NileGrid.prototype, "enableScroll", void 0);
|
|
164
217
|
__decorate([
|
|
165
218
|
property({ type: Boolean, attribute: true, reflect: true })
|
|
166
219
|
], NileGrid.prototype, "hoverable", void 0);
|
|
@@ -185,6 +238,30 @@ __decorate([
|
|
|
185
238
|
__decorate([
|
|
186
239
|
state()
|
|
187
240
|
], NileGrid.prototype, "lockedWidthColumns", void 0);
|
|
241
|
+
__decorate([
|
|
242
|
+
state()
|
|
243
|
+
], NileGrid.prototype, "prefixSumColumnsWidth", void 0);
|
|
244
|
+
__decorate([
|
|
245
|
+
state()
|
|
246
|
+
], NileGrid.prototype, "stickyColumns", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
state()
|
|
249
|
+
], NileGrid.prototype, "bodyRows", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
state()
|
|
252
|
+
], NileGrid.prototype, "headRows", void 0);
|
|
253
|
+
__decorate([
|
|
254
|
+
state()
|
|
255
|
+
], NileGrid.prototype, "needsStructureLayout", void 0);
|
|
256
|
+
__decorate([
|
|
257
|
+
state()
|
|
258
|
+
], NileGrid.prototype, "needsWidthLayout", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
state()
|
|
261
|
+
], NileGrid.prototype, "needsSpanLayout", void 0);
|
|
262
|
+
__decorate([
|
|
263
|
+
state()
|
|
264
|
+
], NileGrid.prototype, "colCount", void 0);
|
|
188
265
|
NileGrid = __decorate([
|
|
189
266
|
customElement('nile-grid')
|
|
190
267
|
], NileGrid);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-grid.js","sourceRoot":"","sources":["../../../src/nile-grid/nile-grid.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,o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C,oBAAoB,CAAC;6CAA0B;AAG3B;IAA1B,KAAK,CAAC,kBAAkB,CAAC;2CAAwB;AAGW;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAAqC;AAGpC;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAA4B;AAc5B;IAA3D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gDAAqB;AAGhE;IAAf,KAAK,EAAE;mDAAyC;AAGjC;IAAf,KAAK,EAAE;oDAA0C;AAGlC;IAAf,KAAK,EAAE;4CAAyC;AAEjC;IAAf,KAAK,EAAE;4CAAyC;AAGjC;IAAf,KAAK,EAAE;mDAAkC;AAG1B;IAAf,KAAK,EAAE;oDAA2C;AA3DxC,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA0LpB;;AAED,eAAe,QAAQ,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 { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-grid.css';\nimport NileElement from '../internal/nile-element';\nimport { rebuildTemplate, syncStickyShadows, layout } from './nile-grid.layout';\nimport { listenToEventListeners, removeEventListeners, getHead, getBody } from './nile-grid.utils';\nimport { computeNewWidth, resizeWithScroll, applyAfterResize, resizeNoScroll } from './nile-grid.resize';\n\n/**\n * Nile grid component.\n *\n * @tag nile-grid\n *\n */\n@customElement('nile-grid')\nexport class NileGrid extends NileElement {\n /**\n * The styles for nile-grid\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 /** To set the grid template columns in rebuildTemplate method */\n @state() public colTemplate = '';\n\n /** To store the column widths in the beginning and after resizing */\n @state() public columnWidths: number[] = [];\n\n /** To get the slot element */\n @query('slot') public slotEl!: HTMLSlotElement;\n\n /** To get the first resize line to show the resize handle */\n @query('.nile-resize-start') resizeStart: HTMLElement;\n\n /** To get the last resize line to show the resize handle */\n @query('.nile-resize-end') resizeEnd: HTMLElement;\n\n /** To enable horizontal scrolling when user is resizing */\n @property({ type: Boolean, attribute: true, reflect: true }) enableResizeScroll: boolean = false;\n\n /** To enable hoverable rows */\n @property({ type: Boolean, attribute: true, reflect: true }) hoverable: boolean = false;\n\n /** To store the mutation observer */\n private mo?: MutationObserver;\n\n /** To store the resize observer */\n private resizeObserver?: ResizeObserver;\n\n private resizeObserverStickyShadows?: ResizeObserver;\n\n /** To store the request animation frame */\n private raf = 0;\n\n /** Minimum column width */\n @property({ type: Number, reflect: true, attribute: true }) minColumnWidth = 40;\n\n /** To store the sticky index's */\n @state() public stickyLeftIndexes: number[] = [];\n\n /** To store the sticky index's */\n @state() public stickyRightIndexes: number[] = [];\n\n /** To calculate the rowspan height */\n @state() public cellHeight: number | null = null;\n\n @state() public headHeight: number | null = null;\n\n /** To check if the widths are initialized */\n @state() public widthsInitialized = false;\n\n /** To check if the widths are initialized */\n @state() public lockedWidthColumns: boolean[] = [];\n\n private scheduleLayout() {\n if (this.raf) cancelAnimationFrame(this.raf);\n this.raf = requestAnimationFrame(() => {\n this.raf = 0;\n layout(\n this,\n this.slotEl,\n this.ensureWidths.bind(this),\n rebuildTemplate,\n this.stickyLeftIndexes,\n this.stickyRightIndexes\n );\n syncStickyShadows(this);\n });\n }\n\n private ensureWidths(colCount: number) {\n if (this.columnWidths.length !== colCount) {\n this.columnWidths = Array(colCount).fill('');\n this.lockedWidthColumns = Array(colCount).fill(false);\n }\n }\n\n private onResize = (e: Event) => {\n e.stopPropagation();\n this.emit('nile-resize', {\n columnNumber: (e as CustomEvent).detail.col,\n columnWidth: (e as CustomEvent).detail.widthPx,\n });\n const { col, widthPx } = (e as CustomEvent).detail as {\n col: number;\n widthPx: number;\n };\n const { prevW, newW, delta0 } = computeNewWidth({\n target: e.target as HTMLElement,\n col,\n widthPx,\n floor: this.minColumnWidth,\n columnWidths: this.columnWidths,\n });\n\n if (delta0 === 0) {\n applyAfterResize(this, col);\n return;\n }\n\n if (!this.enableResizeScroll) {\n resizeNoScroll({ grid: this, col, prevW, newW, floor: this.minColumnWidth });\n } else {\n resizeWithScroll({ grid: this, col, newW });\n }\n applyAfterResize(this, col);\n };\n\n protected firstUpdated() {\n this.setAttribute('role', 'table');\n listenToEventListeners(\n this,\n this.onResize,\n this.slotEl,\n this._attachObserverAndLayout.bind(this)\n );\n this.addEventListener('scroll', () => syncStickyShadows(this));\n this.resizeObserverStickyShadows = new ResizeObserver(() => syncStickyShadows(this));\n this.resizeObserverStickyShadows.observe(this);\n syncStickyShadows(this);\n }\n\n private _attachObserverAndLayout() {\n this.mo?.disconnect();\n this.mo = new MutationObserver(() => {\n this.scheduleLayout();\n });\n this.resizeObserver?.disconnect();\n this.resizeObserver = new ResizeObserver(() => {\n layout(\n this,\n this.slotEl,\n this.ensureWidths.bind(this),\n rebuildTemplate,\n this.stickyLeftIndexes,\n this.stickyRightIndexes\n );\n });\n\n const head = getHead(this.slotEl);\n const body = getBody(this.slotEl);\n if (!head && !body) return;\n\n const target = body ?? this;\n this.mo.observe(target, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: ['colspan', 'rowspan'],\n });\n this.resizeObserver?.observe(this);\n }\n\n public render(): TemplateResult {\n return html`\n <div part=\"grid-base\" class=\"nile-grid-base\">\n <slot part=\"grid-slot\"></slot>\n <div part=\"resize-start\" class=\"nile-resize-start\"></div>\n <div part=\"resize-end\" class=\"nile-resize-end\"></div>\n </div>\n `;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback?.();\n this.mo?.disconnect();\n this.resizeObserver?.disconnect();\n this.resizeObserverStickyShadows?.disconnect();\n\n if (this.raf) cancelAnimationFrame(this.raf);\n removeEventListeners(\n this,\n this.onResize,\n this.slotEl,\n this._attachObserverAndLayout.bind(this)\n );\n }\n\n /* #endregion */\n}\n\nexport default NileGrid;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-grid': NileGrid;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nile-grid.js","sourceRoot":"","sources":["../../../src/nile-grid/nile-grid.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3H,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG3G;;;;;GAKG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,WAAW;IACvC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAgGD;QACE,KAAK,EAAE,CAAC;QA/FV,qEAAqE;QACrD,iBAAY,GAAa,EAAE,CAAC;QAiB5C,2DAA2D;QACE,iBAAY,GAAY,KAAK,CAAC;QAE3F,+BAA+B;QAC8B,cAAS,GAAY,KAAK,CAAC;QAUxF,2CAA2C;QACnC,QAAG,GAAG,CAAC,CAAC;QAEhB,2BAA2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AI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAA+B;AAG9B;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAA4B;AAc5B;IAA3D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gDAAqB;AAGhE;IAAf,KAAK,EAAE;mDAAyC;AAGjC;IAAf,KAAK,EAAE;oDAA0C;AAGlC;IAAf,KAAK,EAAE;4CAAyC;AAEjC;IAAf,KAAK,EAAE;4CAAyC;AAGjC;IAAf,KAAK,EAAE;mDAAkC;AAG1B;IAAf,KAAK,EAAE;oDAA2C;AAGnC;IAAf,KAAK,EAAE;uDAAmD;AAG3C;IAAf,KAAK,EAAE;+CAAqC;AAG7B;IAAf,KAAK,EAAE;0CAAqC;AAG7B;IAAf,KAAK,EAAE;0CAAqC;AAE7B;IAAf,KAAK,EAAE;sDAAqC;AAE7B;IAAf,KAAK,EAAE;kDAAiC;AAEzB;IAAf,KAAK,EAAE;iDAAgC;AAExB;IAAf,KAAK,EAAE;0CAAqB;AAlFlB,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAmQpB;;AAED,eAAe,QAAQ,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 { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-grid.css';\nimport NileElement from '../internal/nile-element';\nimport { syncStickyShadows, layout } from './nile-grid.layout';\nimport { listenToEventListeners, removeEventListeners, getHead, getBody, copyArrayValuesInPlace } from './nile-grid.utils';\nimport { computeNewWidth, resizeWithScroll, resizeNoScroll, updateResizeGuides } from './nile-grid.resize';\nimport { PrefixColumn } from './types/nile-grid.types';\n\n/**\n * Nile grid component.\n *\n * @tag nile-grid\n *\n */\n@customElement('nile-grid')\nexport class NileGrid extends NileElement {\n /**\n * The styles for nile-grid\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 /** To store the column widths in the beginning and after resizing */\n @state() public columnWidths: number[] = [];\n\n /** To get the slot element */\n @query('slot') public slotEl!: HTMLSlotElement;\n\n /** To get the first resize line to show the resize handle */\n @query('.nile-resize-start') resizeStart: HTMLElement;\n\n /** To get the last resize line to show the resize handle */\n @query('.nile-resize-end') resizeEnd: HTMLElement;\n\n /** To get the last resize line to show the resize handle */\n @query('.shadow-left') shadowLeft: HTMLElement;\n\n /** To get the last resize line to show the resize handle */\n @query('.shadow-right') shadowRight: HTMLElement;\n\n /** To enable horizontal scrolling when user is resizing */\n @property({ type: Boolean, attribute: true, reflect: true }) enableScroll: boolean = false;\n\n /** To enable hoverable rows */\n @property({ type: Boolean, attribute: true, reflect: true }) hoverable: boolean = false;\n\n /** To store the mutation observer */\n private mo?: MutationObserver;\n\n /** To store the resize observer */\n private resizeObserver?: ResizeObserver;\n\n private resizeObserverStickyShadows?: ResizeObserver;\n\n /** To store the request animation frame */\n private raf = 0;\n\n /** Minimum column width */\n @property({ type: Number, reflect: true, attribute: true }) minColumnWidth = 40;\n\n /** To store the sticky index's */\n @state() public stickyLeftIndexes: number[] = [];\n\n /** To store the sticky index's */\n @state() public stickyRightIndexes: number[] = [];\n\n /** To calculate the rowspan height */\n @state() public cellHeight: number | null = null;\n\n @state() public headHeight: number | null = null;\n\n /** To check if the widths are initialized */\n @state() public widthsInitialized = false;\n\n /** To check if the widths are initialized */\n @state() public lockedWidthColumns: boolean[] = [];\n\n /** prefix columns width */\n @state() public prefixSumColumnsWidth: PrefixColumn[] = [];\n\n /** prefix columns width */\n @state() public stickyColumns: number[] = [];\n\n /** body rows */\n @state() public bodyRows: HTMLElement[] = [];\n\n /** head rows */\n @state() public headRows: HTMLElement[] = [];\n\n @state() public needsStructureLayout = false;\n\n @state() public needsWidthLayout = false;\n\n @state() public needsSpanLayout = false;\n\n @state() public colCount = 0;\n \n public shadowLeftVisibleSticky?: boolean;\n\n public shadowRightVisibleSticky?: boolean;\n\n public stickyLeftHeadEls: HTMLElement[] = [];\n\n public stickyRightHeadEls: HTMLElement[] = [];\n\n public stickyLeftBodyEls: HTMLElement[] = [];\n\n public stickyRightBodyEls: HTMLElement[] = [];\n\n private resizeTimer: any = 0;\n\n /** To throttle sticky shadow updates */\n private shadowRaf = 0;\n\n public resizeBaseColumnWidths: number[] = [];\n\n constructor() {\n super();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.emit('nile-init');\n }\n\n private syncStickyShadowsRaf = () => {\n if (this.shadowRaf) return;\n this.shadowRaf = requestAnimationFrame(() => {\n this.shadowRaf = 0;\n syncStickyShadows(this);\n });\n };\n\n\n private scheduleLayout() {\n if (this.raf) cancelAnimationFrame(this.raf);\n this.raf = requestAnimationFrame(() => {\n this.raf = 0;\n layout(\n this,\n this.slotEl,\n this.ensureWidths.bind(this),\n this.stickyLeftIndexes,\n this.stickyRightIndexes\n );\n syncStickyShadows(this);\n });\n }\n\n private ensureWidths(colCount: number) {\n if (this.columnWidths.length !== colCount) {\n this.columnWidths = Array(colCount).fill(0);\n this.lockedWidthColumns = Array(colCount).fill(false); \n }\n }\n\n private onResize = (e: Event) => {\n e.stopPropagation();\n this.emit('nile-resize', {\n columnNumber: (e as CustomEvent).detail.col,\n columnWidth: (e as CustomEvent).detail.widthPx,\n });\n const { col, widthPx } = (e as CustomEvent).detail as {\n col: number;\n widthPx: number;\n };\n if (!this.resizeBaseColumnWidths) return;\n \n copyArrayValuesInPlace(this.columnWidths, this.resizeBaseColumnWidths);\n const { prevW, newW, delta0 } = computeNewWidth({\n target: e.target as HTMLElement,\n col,\n widthPx,\n floor: this.minColumnWidth,\n columnWidths: this.columnWidths,\n });\n\n if (delta0 === 0) {\n updateResizeGuides(this, col);\n return;\n }\n\n if (!this.enableScroll) {\n resizeNoScroll({ grid: this, col, prevW, newW, floor: this.minColumnWidth });\n } else {\n resizeWithScroll({ grid: this, col, newW });\n }\n updateResizeGuides(this, col);\n };\n\n protected firstUpdated() {\n this.setAttribute('role', 'table');\n listenToEventListeners(\n this,\n this.onResize,\n this.slotEl,\n this._attachObserverAndLayout.bind(this)\n );\n this.addEventListener('scroll', this.syncStickyShadowsRaf);\n this.resizeObserverStickyShadows = new ResizeObserver(() => syncStickyShadows(this));\n this.resizeObserverStickyShadows.observe(this);\n this.syncStickyShadowsRaf();\n }\n\n private _attachObserverAndLayout() {\n this.mo?.disconnect();\n this.mo = new MutationObserver(() => {\n this.needsStructureLayout = true;\n this.needsWidthLayout = true;\n this.needsSpanLayout = true;\n this.scheduleLayout();\n });\n this.resizeObserver?.disconnect();\n this.resizeObserver = new ResizeObserver(() => {\n if (this.resizeTimer) clearTimeout(this.resizeTimer);\n this.resizeTimer = setTimeout(() => {\n this.resizeTimer = 0;\n this.needsWidthLayout = true;\n this.scheduleLayout();\n }, 16);\n });\n\n const head = getHead(this.slotEl);\n const body = getBody(this.slotEl);\n \n if (!head && !body) return;\n const target = head ?? this;\n this.mo.observe(target, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['colspan', 'rowspan', 'width', 'lockwidth', 'sticky']\n });\n this.resizeObserver?.observe(this);\n\n if (!this.colCount || !this.columnWidths?.length) {\n this.needsStructureLayout = true;\n this.needsSpanLayout = true;\n this.needsWidthLayout = true;\n this.scheduleLayout();\n }\n }\n\n public render(): TemplateResult {\n return html`\n <div part=\"grid-base\" class=\"nile-grid-base\">\n <div part=\"grid-slot-wrapper\">\n <slot part=\"grid-slot\"></slot>\n </div>\n <div part=\"resize-start\" class=\"nile-resize-start\"></div>\n <div part=\"resize-end\" class=\"nile-resize-end\"></div>\n </div>\n `;\n }\n\n disconnectedCallback(): void {\n this.emit('nile-destroy');\n super.disconnectedCallback?.();\n this.mo?.disconnect();\n this.resizeObserver?.disconnect();\n this.resizeObserverStickyShadows?.disconnect();\n\n if (this.raf) cancelAnimationFrame(this.raf);\n removeEventListeners(\n this,\n this.onResize,\n this.slotEl,\n this._attachObserverAndLayout.bind(this)\n );\n }\n\n /* #endregion */\n}\n\nexport default NileGrid;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-grid': NileGrid;\n }\n}\n"]}
|
|
@@ -3,26 +3,19 @@ import { NileGrid } from './nile-grid';
|
|
|
3
3
|
* @param nileGrid Parent NileGrid instance
|
|
4
4
|
* @param slotEl <slot> element hosting head/body
|
|
5
5
|
* @param ensureWidths Function to ensure columnWidths length matches colCount
|
|
6
|
-
* @param rebuildTemplate Function(colCount, widths) -> grid-template string
|
|
7
6
|
* @param stickyLeftIndexes Mutable list of left-sticky column indexes
|
|
8
7
|
* @param stickyRightIndexes Mutable list of right-sticky column indexes
|
|
9
8
|
* @returns void
|
|
10
9
|
*/
|
|
11
|
-
export declare const layout: (nileGrid: NileGrid, slotEl: any, ensureWidths: any,
|
|
10
|
+
export declare const layout: (nileGrid: NileGrid, slotEl: any, ensureWidths: any, stickyLeftIndexes: number[], stickyRightIndexes: number[]) => void;
|
|
11
|
+
export declare function cacheStickyEls(nileGrid: NileGrid): void;
|
|
12
12
|
/**
|
|
13
13
|
* @param nileGrid Grid instance to sync shadows for
|
|
14
14
|
*/
|
|
15
15
|
export declare function syncStickyShadows(nileGrid: NileGrid): void;
|
|
16
|
-
/** rebuildTemplate
|
|
17
|
-
* @param colCount Number of columns
|
|
18
|
-
* @param columnWidths Array of explicit column widths (px)
|
|
19
|
-
* @returns CSS grid-template-columns string
|
|
20
|
-
*/
|
|
21
|
-
export declare const rebuildTemplate: (colCount: number, columnWidths: number[]) => string;
|
|
22
16
|
/**
|
|
23
17
|
* @param nileGrid Grid container element
|
|
24
18
|
* @param colCount Total number of columns
|
|
25
19
|
* @param columnWidths Column width array
|
|
26
|
-
* @param headElement Header element for template update
|
|
27
20
|
*/
|
|
28
21
|
export declare function applyColumnsTemplate(nileGrid: NileGrid, columnWidths: number[]): void;
|