@nova-design-system/nova-webcomponents 3.24.0 → 3.25.0
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/dist/cjs/_commonjsHelpers-CFO10eej.js +0 -3
- package/dist/cjs/clsx-BtxeOLZW.js +0 -3
- package/dist/cjs/collapse.animation-CcG0GAWk.js +0 -3
- package/dist/cjs/constants-BugGJYqL.js +0 -3
- package/dist/cjs/dom.utils-8VY5SfMZ.js +177 -0
- package/dist/cjs/events.utils-BE6R5q9C.js +0 -3
- package/dist/cjs/fade.animation-BQSqXXOJ.js +0 -3
- package/dist/cjs/grow.animation-ynu_HmA_.js +0 -3
- package/dist/cjs/i18n.utils-ku0bScip.js +0 -3
- package/dist/cjs/index-BQjqJTJB.js +4832 -0
- package/dist/cjs/index.cjs.js +0 -1
- package/dist/cjs/index.esm-CG1TVKfu.js +0 -3
- package/dist/cjs/inputmask-DtXnpVWa.js +0 -3
- package/dist/cjs/loader.cjs.js +3 -5
- package/dist/cjs/native.cjs.js +32 -7
- package/dist/cjs/nv-accordion-item.cjs.entry.js +8 -8
- package/dist/cjs/nv-accordion.cjs.entry.js +10 -9
- package/dist/cjs/nv-alert.cjs.entry.js +6 -5
- package/dist/cjs/nv-avatar.cjs.entry.js +3 -4
- package/dist/cjs/nv-badge_2.cjs.entry.js +15 -11
- package/dist/cjs/nv-breadcrumb.cjs.entry.js +14 -12
- package/dist/cjs/nv-breadcrumbs.cjs.entry.js +4 -5
- package/dist/cjs/nv-button.cjs.entry.js +10 -7
- package/dist/cjs/nv-buttongroup.cjs.entry.js +13 -8
- package/dist/cjs/nv-calendar.cjs.entry.js +27 -11
- package/dist/cjs/nv-col.cjs.entry.js +4 -5
- package/dist/cjs/nv-datagrid.cjs.entry.js +47 -185
- package/dist/cjs/nv-datagridcolumn.cjs.entry.js +2 -3
- package/dist/cjs/nv-dialog.cjs.entry.js +19 -21
- package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +11 -30
- package/dist/cjs/nv-drawer.cjs.entry.js +19 -20
- package/dist/cjs/nv-drawerfooter_2.cjs.entry.js +11 -30
- package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +10 -9
- package/dist/cjs/nv-fielddate.cjs.entry.js +15 -14
- package/dist/cjs/nv-fielddaterange.cjs.entry.js +15 -14
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +17 -16
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +5 -9
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +12 -9
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +10 -9
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +10 -9
- package/dist/cjs/nv-fieldradio.cjs.entry.js +9 -8
- package/dist/cjs/nv-fieldselect.cjs.entry.js +20 -13
- package/dist/cjs/nv-fieldslider.cjs.entry.js +33 -16
- package/dist/cjs/nv-fieldtext.cjs.entry.js +7 -8
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +15 -10
- package/dist/cjs/nv-fieldtime.cjs.entry.js +15 -10
- package/dist/cjs/nv-icon.cjs.entry.js +4 -5
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js +13 -10
- package/dist/cjs/nv-menu.cjs.entry.js +9 -14
- package/dist/cjs/nv-menuitem.cjs.entry.js +4 -6
- package/dist/cjs/nv-notification-bullet.cjs.entry.js +3 -4
- package/dist/cjs/nv-notification.cjs.entry.js +4 -5
- package/dist/cjs/nv-notificationcontainer.cjs.entry.js +4 -5
- package/dist/cjs/nv-paginationtable.cjs.entry.js +228 -0
- package/dist/cjs/nv-popover.cjs.entry.js +105 -34
- package/dist/cjs/nv-row.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebar.cjs.entry.js +10 -7
- package/dist/cjs/nv-sidebarcontent.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebardivider.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebarfooter.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebargroup.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebarheader.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebarlogo.cjs.entry.js +4 -5
- package/dist/cjs/nv-sidebarnavitem.cjs.entry.js +9 -8
- package/dist/cjs/nv-sidebarnavsubitem.cjs.entry.js +4 -5
- package/dist/cjs/nv-split.cjs.entry.js +10 -7
- package/dist/cjs/nv-stack.cjs.entry.js +4 -5
- package/dist/cjs/nv-table.cjs.entry.js +4 -5
- package/dist/cjs/nv-tableheader.cjs.entry.js +4 -5
- package/dist/cjs/nv-toggle.cjs.entry.js +8 -7
- package/dist/cjs/nv-togglebutton.cjs.entry.js +4 -6
- package/dist/cjs/nv-togglebuttongroup.cjs.entry.js +13 -10
- package/dist/cjs/nv-tooltip.cjs.entry.js +10 -10
- package/dist/cjs/slide.animation-Cb3tpLQv.js +0 -3
- package/dist/cjs/style-value-types.es-B1vLqX9m.js +0 -3
- package/dist/cjs/timeline.animation-KteJaZPb.js +0 -3
- package/dist/cjs/uri.utils-DiMLQx64.js +0 -3
- package/dist/cjs/v4-C1vaJ4yP.js +0 -3
- package/dist/collection/animations/collapse.animation.js +0 -1
- package/dist/collection/animations/fade.animation.js +0 -1
- package/dist/collection/animations/grow.animation.js +0 -1
- package/dist/collection/animations/index.js +0 -1
- package/dist/collection/animations/slide.animation.js +0 -1
- package/dist/collection/animations/timeline.animation.js +0 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/nv-accordion/nv-accordion.docs.js +0 -1
- package/dist/collection/components/nv-accordion/nv-accordion.js +1 -4
- package/dist/collection/components/nv-accordion-item/nv-accordion-item.docs.js +0 -1
- package/dist/collection/components/nv-accordion-item/nv-accordion-item.js +2 -4
- package/dist/collection/components/nv-alert/nv-alert.docs.js +0 -1
- package/dist/collection/components/nv-alert/nv-alert.js +4 -3
- package/dist/collection/components/nv-avatar/nv-avatar.docs.js +0 -1
- package/dist/collection/components/nv-avatar/nv-avatar.js +2 -2
- package/dist/collection/components/nv-badge/nv-badge.docs.js +0 -1
- package/dist/collection/components/nv-badge/nv-badge.js +0 -1
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.docs.js +0 -1
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.js +12 -10
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.css +0 -3
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js +0 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.js +1 -2
- package/dist/collection/components/nv-button/nv-button.docs.js +0 -1
- package/dist/collection/components/nv-button/nv-button.js +7 -5
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.docs.js +0 -1
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.js +5 -4
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.utils.js +0 -1
- package/dist/collection/components/nv-buttongroup/test/nv-buttongroup.utils.test.js +0 -1
- package/dist/collection/components/nv-calendar/nv-calendar.css +110 -1
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js +0 -1
- package/dist/collection/components/nv-calendar/nv-calendar.js +9 -3
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-actions.js +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-grid.js +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-header.js +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-shortcuts.js +0 -1
- package/dist/collection/components/nv-calendar/partials/day-cell.js +0 -1
- package/dist/collection/components/nv-calendar/partials/index.js +0 -1
- package/dist/collection/components/nv-calendar/partials/week-numbers.js +0 -1
- package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-actions.logic.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-grid.logic.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-header.logic.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/day-cell.logic.test.js +0 -1
- package/dist/collection/components/nv-calendar/test/partials/week-numbers.logic.test.js +0 -1
- package/dist/collection/components/nv-col/nv-col.docs.js +0 -1
- package/dist/collection/components/nv-col/nv-col.js +1 -2
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +0 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +6 -5
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.docs.js +0 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +1 -2
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js +0 -7
- package/dist/collection/components/nv-dialog/nv-dialog.js +17 -45
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.docs.js +0 -1
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js +8 -15
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.docs.js +0 -1
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.js +1 -13
- package/dist/collection/components/nv-drawer/nv-drawer.docs.js +0 -1
- package/dist/collection/components/nv-drawer/nv-drawer.js +13 -16
- package/dist/collection/components/nv-drawerfooter/nv-drawerfooter.docs.js +0 -1
- package/dist/collection/components/nv-drawerfooter/nv-drawerfooter.js +8 -15
- package/dist/collection/components/nv-drawerheader/nv-drawerheader.docs.js +0 -1
- package/dist/collection/components/nv-drawerheader/nv-drawerheader.js +1 -13
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.docs.js +0 -1
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js +6 -6
- package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js +0 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.js +6 -9
- package/dist/collection/components/nv-fielddate/test/nv-fielddate.logic.test.js +0 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js +0 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +6 -9
- package/dist/collection/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.js +0 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +0 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +16 -13
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.docs.js +0 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +3 -7
- package/dist/collection/components/nv-fielddropdownitem/styles/nv-fielddropdownitem.css +78 -8
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.docs.js +0 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -3
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +0 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +5 -6
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js +0 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +4 -5
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js +0 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +7 -7
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.docs.js +0 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +5 -5
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js +0 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +5 -6
- package/dist/collection/components/nv-fieldselect/styles/nv-fieldselect.css +90 -7
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js +0 -1
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.js +3 -4
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js +0 -1
- package/dist/collection/components/nv-fieldslider/partials/field-input.js +0 -1
- package/dist/collection/components/nv-fieldslider/partials/range-thumb.js +0 -1
- package/dist/collection/components/nv-fieldslider/partials/single-thumb.js +0 -1
- package/dist/collection/components/nv-fieldslider/partials/tick-marks.js +0 -1
- package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js +0 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +0 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +7 -7
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js +0 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +3 -4
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js +0 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +3 -4
- package/dist/collection/components/nv-fieldtime/utils/format-utils.js +0 -1
- package/dist/collection/components/nv-icon/nv-icon.docs.js +0 -1
- package/dist/collection/components/nv-icon/nv-icon.js +7 -5
- package/dist/collection/components/nv-icon/nv-icons.js +0 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.docs.js +0 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +11 -7
- package/dist/collection/components/nv-loader/nv-loader.docs.js +0 -1
- package/dist/collection/components/nv-loader/nv-loader.js +5 -4
- package/dist/collection/components/nv-menu/nv-menu.docs.js +0 -1
- package/dist/collection/components/nv-menu/nv-menu.js +14 -12
- package/dist/collection/components/nv-menuitem/nv-menuitem.docs.js +0 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +4 -5
- package/dist/collection/components/nv-notification/nv-notification.docs.js +0 -1
- package/dist/collection/components/nv-notification/nv-notification.js +5 -4
- package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.docs.js +0 -1
- package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.js +0 -1
- package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.docs.js +0 -1
- package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.js +3 -3
- package/dist/collection/components/nv-paginationtable/nv-paginationtable.css +17 -0
- package/dist/collection/components/nv-paginationtable/nv-paginationtable.docs.js +248 -0
- package/dist/collection/components/nv-paginationtable/nv-paginationtable.js +537 -0
- package/dist/collection/components/nv-paginationtable/nv-paginationtable.utils.js +64 -0
- package/dist/collection/components/nv-paginationtable/test/nv-paginationtable.utils.test.js +361 -0
- package/dist/collection/components/nv-popover/nv-popover.docs.js +0 -1
- package/dist/collection/components/nv-popover/nv-popover.js +19 -14
- package/dist/collection/components/nv-row/nv-row.docs.js +0 -1
- package/dist/collection/components/nv-row/nv-row.js +1 -2
- package/dist/collection/components/nv-sidebar/nv-sidebar.docs.js +0 -1
- package/dist/collection/components/nv-sidebar/nv-sidebar.js +1 -2
- package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.docs.js +0 -1
- package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.js +1 -2
- package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.docs.js +0 -1
- package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.js +1 -2
- package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.docs.js +0 -1
- package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.js +1 -2
- package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.docs.js +0 -1
- package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.js +1 -2
- package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.docs.js +0 -1
- package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.js +1 -2
- package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.docs.js +0 -1
- package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.js +1 -2
- package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.docs.js +0 -1
- package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.js +6 -6
- package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.docs.js +0 -1
- package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.js +1 -2
- package/dist/collection/components/nv-split/nv-split.docs.js +0 -1
- package/dist/collection/components/nv-split/nv-split.js +1 -2
- package/dist/collection/components/nv-stack/nv-stack.docs.js +0 -1
- package/dist/collection/components/nv-stack/nv-stack.js +1 -2
- package/dist/collection/components/nv-table/nv-table.docs.js +0 -1
- package/dist/collection/components/nv-table/nv-table.js +1 -2
- package/dist/collection/components/nv-table/nv-table.utils.js +0 -1
- package/dist/collection/components/nv-table/test/nv-table.utils.test.js +0 -1
- package/dist/collection/components/nv-tableheader/nv-tableheader.docs.js +0 -1
- package/dist/collection/components/nv-tableheader/nv-tableheader.js +1 -2
- package/dist/collection/components/nv-toggle/nv-toggle.docs.js +0 -1
- package/dist/collection/components/nv-toggle/nv-toggle.js +4 -4
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.docs.js +0 -1
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.js +5 -5
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.docs.js +0 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js +5 -6
- package/dist/collection/components/nv-tooltip/nv-tooltip.docs.js +0 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +20 -13
- package/dist/collection/index.js +0 -1
- package/dist/collection/interfaces/Column.js +0 -1
- package/dist/collection/interfaces/ColumnConfig.js +0 -1
- package/dist/collection/interfaces/localization.js +0 -1
- package/dist/collection/templates/navigation.docs.js +0 -1
- package/dist/collection/utils/class.utils.js +0 -1
- package/dist/collection/utils/constants.js +0 -1
- package/dist/collection/utils/dom.utils.js +8 -1
- package/dist/collection/utils/events.utils.js +0 -1
- package/dist/collection/utils/i18n.utils.js +0 -1
- package/dist/collection/utils/input.utils.js +0 -1
- package/dist/collection/utils/search-engine/engine.js +0 -1
- package/dist/collection/utils/search-engine/guards.js +0 -1
- package/dist/collection/utils/search-engine/index.js +0 -1
- package/dist/collection/utils/search-engine/indexer.js +0 -1
- package/dist/collection/utils/search-engine/normalize.js +0 -1
- package/dist/collection/utils/search-engine/strategies/fuzzy.js +0 -1
- package/dist/collection/utils/search-engine/strategies/smart.js +0 -1
- package/dist/collection/utils/search-engine/strategies/strict.js +0 -1
- package/dist/collection/utils/search-engine/test/engine.test.js +0 -1
- package/dist/collection/utils/search-engine/test/guards.test.js +0 -1
- package/dist/collection/utils/search-engine/test/indexer.test.js +0 -1
- package/dist/collection/utils/search-engine/test/normalize.test.js +0 -1
- package/dist/collection/utils/search-engine/test/strategies.test.js +0 -1
- package/dist/collection/utils/search-engine/types.js +0 -1
- package/dist/collection/utils/search-engine/worker/index.js +0 -1
- package/dist/collection/utils/search-engine/worker/search.worker.js +0 -1
- package/dist/collection/utils/search-engine/worker/worker-client.js +0 -1
- package/dist/collection/utils/string.utils.js +0 -1
- package/dist/collection/utils/test/class.utils.test.js +0 -1
- package/dist/collection/utils/test/dom.utils.test.js +24 -2
- package/dist/collection/utils/test/i18n.utils.test.js +0 -1
- package/dist/collection/utils/test/input.utils.test.js +0 -1
- package/dist/collection/utils/test/uri.utils.test.js +0 -1
- package/dist/collection/utils/uri.utils.js +0 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -583
- package/dist/components/nv-accordion-item.js +1 -9
- package/dist/components/nv-accordion.js +1 -229
- package/dist/components/nv-alert.js +1 -211
- package/dist/components/nv-avatar.js +1 -105
- package/dist/components/nv-badge.js +1 -9
- package/dist/components/nv-breadcrumb.js +1 -80
- package/dist/components/nv-breadcrumbs.js +1 -39
- package/dist/components/nv-button.js +1 -9
- package/dist/components/nv-buttongroup.js +1 -223
- package/dist/components/nv-calendar.js +1 -9
- package/dist/components/nv-col.js +1 -58
- package/dist/components/nv-datagrid.js +1 -4580
- package/dist/components/nv-datagridcolumn.js +1 -47
- package/dist/components/nv-dialog.js +1 -362
- package/dist/components/nv-dialogfooter.js +1 -9
- package/dist/components/nv-dialogheader.js +1 -9
- package/dist/components/nv-drawer.js +1 -507
- package/dist/components/nv-drawerfooter.js +1 -9
- package/dist/components/nv-drawerheader.js +1 -9
- package/dist/components/nv-fieldcheckbox.js +1 -9
- package/dist/components/nv-fielddate.js +1 -507
- package/dist/components/nv-fielddaterange.js +1 -670
- package/dist/components/nv-fielddropdown.js +1 -768
- package/dist/components/nv-fielddropdownitem.js +1 -9
- package/dist/components/nv-fielddropdownitemcheck.js +1 -9
- package/dist/components/nv-fieldmultiselect.js +1 -1587
- package/dist/components/nv-fieldnumber.js +1 -9
- package/dist/components/nv-fieldpassword.js +1 -227
- package/dist/components/nv-fieldradio.js +1 -137
- package/dist/components/nv-fieldselect.js +1 -460
- package/dist/components/nv-fieldslider.js +1 -801
- package/dist/components/nv-fieldtext.js +1 -9
- package/dist/components/nv-fieldtextarea.js +1 -282
- package/dist/components/nv-fieldtime.js +1 -1189
- package/dist/components/nv-icon.js +1 -9
- package/dist/components/nv-iconbutton.js +1 -9
- package/dist/components/nv-loader.js +1 -9
- package/dist/components/nv-menu.js +1 -254
- package/dist/components/nv-menuitem.js +1 -9
- package/dist/components/nv-notification-bullet.js +1 -9
- package/dist/components/nv-notification.js +1 -212
- package/dist/components/nv-notificationcontainer.js +1 -61
- package/dist/components/nv-paginationtable.d.ts +11 -0
- package/dist/components/nv-paginationtable.js +1 -0
- package/dist/components/nv-popover.js +1 -9
- package/dist/components/nv-row.js +1 -40
- package/dist/components/nv-sidebar.js +1 -210
- package/dist/components/nv-sidebarcontent.js +1 -40
- package/dist/components/nv-sidebardivider.js +1 -40
- package/dist/components/nv-sidebarfooter.js +1 -40
- package/dist/components/nv-sidebargroup.js +1 -43
- package/dist/components/nv-sidebarheader.js +1 -40
- package/dist/components/nv-sidebarlogo.js +1 -54
- package/dist/components/nv-sidebarnavitem.js +1 -336
- package/dist/components/nv-sidebarnavsubitem.js +1 -55
- package/dist/components/nv-split.js +1 -370
- package/dist/components/nv-stack.js +1 -55
- package/dist/components/nv-table.js +1 -261
- package/dist/components/nv-tableheader.js +1 -114
- package/dist/components/nv-toggle.js +1 -111
- package/dist/components/nv-togglebutton.js +1 -91
- package/dist/components/nv-togglebuttongroup.js +1 -200
- package/dist/components/nv-tooltip.js +1 -9
- package/dist/components/p-9xYwU7ku.js +1 -724
- package/dist/components/p-B6GgGra-.js +1 -29
- package/dist/components/p-BJSrJH9I.js +1 -0
- package/dist/components/p-BReL3Lsa.js +1 -286
- package/dist/components/p-BdYh22OP.js +1 -57
- package/dist/components/p-Bg-b6OWh.js +1 -0
- package/dist/components/p-BkqfOhkU.js +1 -0
- package/dist/components/p-BqRuoNHJ.js +1 -0
- package/dist/components/p-C-MlXMFg.js +1 -0
- package/dist/components/p-C6LzzMQm.js +1 -0
- package/dist/components/p-CGXDiomF.js +1 -0
- package/dist/components/p-CPjfMClF.js +1 -0
- package/dist/components/p-C_a7VT_H.js +1 -0
- package/dist/components/p-Cfr9uriB.js +1 -0
- package/dist/components/p-CgHCo_Ho.js +1 -42
- package/dist/components/p-ChRIFm7p.js +1 -0
- package/dist/components/p-ChV9xqsO.js +1 -6
- package/dist/components/p-CnI0auJM.js +1 -24
- package/dist/components/p-Cq5FI49y.js +1 -0
- package/dist/components/p-CskCUxuV.js +1 -0
- package/dist/components/p-CuXVGECR.js +1 -0
- package/dist/components/p-Cw5yG8cD.js +9 -0
- package/dist/components/p-D02w_Ru6.js +1 -91
- package/dist/components/p-D1C_pu0E.js +1 -218
- package/dist/components/p-D2otK4Ce.js +1 -91
- package/dist/components/p-D3eWMME9.js +1 -534
- package/dist/components/p-D7xBylwr.js +1 -0
- package/dist/components/p-D_JRZMC-.js +1 -0
- package/dist/components/p-DkC2jlrw.js +1 -0
- package/dist/components/p-Dz1GUhVy.js +15 -1119
- package/dist/components/p-IlwlcG9l.js +1 -2485
- package/dist/components/p-Nf-dwTsx.js +1 -0
- package/dist/components/p-iXsbKJzR.js +2 -0
- package/dist/components/p-mWVXEsBF.js +1 -0
- package/dist/components/p-r3_atQ9r.js +1 -0
- package/dist/components/p-tJDdN0lo.js +1 -0
- package/dist/components/p-yHGZRC6Q.js +1 -0
- package/dist/esm/_commonjsHelpers-B85MJLTf.js +0 -3
- package/dist/esm/clsx-ChV9xqsO.js +0 -3
- package/dist/esm/collapse.animation-DZDm0vSK.js +0 -3
- package/dist/esm/constants-BReL3Lsa.js +0 -3
- package/dist/esm/dom.utils-CuXVGECR.js +173 -0
- package/dist/esm/events.utils-B6GgGra-.js +0 -3
- package/dist/esm/fade.animation-DcRL9lcm.js +0 -3
- package/dist/esm/grow.animation-D7ep_aVl.js +0 -3
- package/dist/esm/i18n.utils-IlwlcG9l.js +0 -3
- package/dist/esm/index-S-IZ4AN_.js +4796 -0
- package/dist/esm/index.esm-D3eWMME9.js +0 -3
- package/dist/esm/index.js +0 -1
- package/dist/esm/inputmask-CSo292ul.js +0 -3
- package/dist/esm/loader.js +3 -5
- package/dist/esm/native.js +32 -7
- package/dist/esm/nv-accordion-item.entry.js +8 -8
- package/dist/esm/nv-accordion.entry.js +10 -9
- package/dist/esm/nv-alert.entry.js +6 -5
- package/dist/esm/nv-avatar.entry.js +3 -4
- package/dist/esm/nv-badge_2.entry.js +15 -11
- package/dist/esm/nv-breadcrumb.entry.js +14 -12
- package/dist/esm/nv-breadcrumbs.entry.js +4 -5
- package/dist/esm/nv-button.entry.js +10 -7
- package/dist/esm/nv-buttongroup.entry.js +13 -8
- package/dist/esm/nv-calendar.entry.js +27 -11
- package/dist/esm/nv-col.entry.js +4 -5
- package/dist/esm/nv-datagrid.entry.js +42 -180
- package/dist/esm/nv-datagridcolumn.entry.js +2 -3
- package/dist/esm/nv-dialog.entry.js +19 -21
- package/dist/esm/nv-dialogfooter_2.entry.js +11 -30
- package/dist/esm/nv-drawer.entry.js +19 -20
- package/dist/esm/nv-drawerfooter_2.entry.js +11 -30
- package/dist/esm/nv-fieldcheckbox.entry.js +10 -9
- package/dist/esm/nv-fielddate.entry.js +15 -14
- package/dist/esm/nv-fielddaterange.entry.js +15 -14
- package/dist/esm/nv-fielddropdown.entry.js +17 -16
- package/dist/esm/nv-fielddropdownitem.entry.js +5 -9
- package/dist/esm/nv-fieldmultiselect.entry.js +12 -9
- package/dist/esm/nv-fieldnumber.entry.js +10 -9
- package/dist/esm/nv-fieldpassword.entry.js +10 -9
- package/dist/esm/nv-fieldradio.entry.js +9 -8
- package/dist/esm/nv-fieldselect.entry.js +20 -13
- package/dist/esm/nv-fieldslider.entry.js +33 -16
- package/dist/esm/nv-fieldtext.entry.js +7 -8
- package/dist/esm/nv-fieldtextarea.entry.js +15 -10
- package/dist/esm/nv-fieldtime.entry.js +15 -10
- package/dist/esm/nv-icon.entry.js +4 -5
- package/dist/esm/nv-iconbutton_2.entry.js +13 -10
- package/dist/esm/nv-menu.entry.js +9 -14
- package/dist/esm/nv-menuitem.entry.js +4 -6
- package/dist/esm/nv-notification-bullet.entry.js +3 -4
- package/dist/esm/nv-notification.entry.js +4 -5
- package/dist/esm/nv-notificationcontainer.entry.js +4 -5
- package/dist/esm/nv-paginationtable.entry.js +226 -0
- package/dist/esm/nv-popover.entry.js +105 -34
- package/dist/esm/nv-row.entry.js +4 -5
- package/dist/esm/nv-sidebar.entry.js +10 -7
- package/dist/esm/nv-sidebarcontent.entry.js +4 -5
- package/dist/esm/nv-sidebardivider.entry.js +4 -5
- package/dist/esm/nv-sidebarfooter.entry.js +4 -5
- package/dist/esm/nv-sidebargroup.entry.js +4 -5
- package/dist/esm/nv-sidebarheader.entry.js +4 -5
- package/dist/esm/nv-sidebarlogo.entry.js +4 -5
- package/dist/esm/nv-sidebarnavitem.entry.js +9 -8
- package/dist/esm/nv-sidebarnavsubitem.entry.js +4 -5
- package/dist/esm/nv-split.entry.js +10 -7
- package/dist/esm/nv-stack.entry.js +4 -5
- package/dist/esm/nv-table.entry.js +4 -5
- package/dist/esm/nv-tableheader.entry.js +4 -5
- package/dist/esm/nv-toggle.entry.js +8 -7
- package/dist/esm/nv-togglebutton.entry.js +4 -6
- package/dist/esm/nv-togglebuttongroup.entry.js +13 -10
- package/dist/esm/nv-tooltip.entry.js +10 -10
- package/dist/esm/slide.animation-CmH5d1of.js +0 -3
- package/dist/esm/style-value-types.es-xlgmw4x8.js +0 -3
- package/dist/esm/timeline.animation-CgHCo_Ho.js +0 -3
- package/dist/esm/uri.utils-CnI0auJM.js +0 -3
- package/dist/esm/v4-BdYh22OP.js +0 -3
- package/dist/lib/generators/angular-output.js +0 -1
- package/dist/lib/generators/docs-blazor.js +0 -1
- package/dist/lib/generators/vue-output.js +0 -1
- package/dist/lib/utils/componentBinding.js +0 -1
- package/dist/lib/utils/parseToCSharpTypes.js +0 -1
- package/dist/lib/utils/spread.js +0 -1
- package/dist/lib/utils/test/parseToCSharpTypes.test.js +0 -1
- package/dist/native/index.esm.js +1 -2
- package/dist/native/native.css +1 -1
- package/dist/native/native.esm.js +1 -2
- package/dist/native/p-00b80d2b.entry.js +1 -0
- package/dist/native/p-01d09dfa.entry.js +1 -0
- package/dist/native/p-0242699e.entry.js +1 -0
- package/dist/native/p-09b88c8d.entry.js +1 -0
- package/dist/native/p-13YSIyGW.js +1 -2
- package/dist/native/p-184b4f0d.entry.js +1 -0
- package/dist/native/p-1a1a6bbf.entry.js +1 -0
- package/dist/native/p-1b37bf6c.entry.js +1 -0
- package/dist/native/p-1bf1a213.entry.js +1 -0
- package/dist/native/p-1c86c5b8.entry.js +1 -0
- package/dist/native/p-2106dfbd.entry.js +1 -0
- package/dist/native/p-223814fe.entry.js +1 -0
- package/dist/native/p-2623b212.entry.js +1 -0
- package/dist/native/p-29f0730f.entry.js +1 -0
- package/dist/native/p-2b7e621a.entry.js +1 -0
- package/dist/native/p-32cbc18b.entry.js +1 -0
- package/dist/native/p-34cce087.entry.js +1 -0
- package/dist/native/p-38e981f2.entry.js +1 -0
- package/dist/native/p-3ac56d5f.entry.js +1 -0
- package/dist/native/p-3bd49efe.entry.js +1 -0
- package/dist/native/p-3c09e565.entry.js +1 -0
- package/dist/native/p-3e949805.entry.js +1 -0
- package/dist/native/p-4016851b.entry.js +1 -0
- package/dist/native/p-4725d9aa.entry.js +1 -0
- package/dist/native/p-4bda5842.entry.js +1 -0
- package/dist/native/p-4c29c4c7.entry.js +1 -0
- package/dist/native/p-5cbf5973.entry.js +1 -0
- package/dist/native/p-5fb6d986.entry.js +1 -0
- package/dist/native/p-6a548776.entry.js +1 -0
- package/dist/native/p-6ba310e8.entry.js +1 -0
- package/dist/native/p-6ccea920.entry.js +1 -0
- package/dist/native/p-6e9b95fa.entry.js +1 -0
- package/dist/native/p-6f368c8d.entry.js +1 -0
- package/dist/native/p-70fa3c6b.entry.js +1 -0
- package/dist/native/p-7f3c3c29.entry.js +1 -0
- package/dist/native/p-84202d8a.entry.js +1 -0
- package/dist/native/p-87f35ce1.entry.js +1 -0
- package/dist/native/p-91f71346.entry.js +1 -0
- package/dist/native/p-98de77f8.entry.js +1 -0
- package/dist/native/p-98ea927d.entry.js +1 -0
- package/dist/native/p-99051651.entry.js +1 -0
- package/dist/native/p-997a2268.entry.js +1 -0
- package/dist/native/p-B6GgGra-.js +1 -2
- package/dist/native/p-B85MJLTf.js +1 -2
- package/dist/native/p-BReL3Lsa.js +1 -2
- package/dist/native/p-BdYh22OP.js +1 -2
- package/dist/native/p-Blc6XEY7.js +1 -2
- package/dist/native/p-CgHCo_Ho.js +1 -2
- package/dist/native/p-ChV9xqsO.js +1 -2
- package/dist/native/p-CnI0auJM.js +1 -2
- package/dist/native/p-CuXVGECR.js +1 -0
- package/dist/native/p-D3eWMME9.js +1 -2
- package/dist/native/p-DmUOtOcY.js +1 -2
- package/dist/native/p-Hfc8Oh0x.js +3 -4
- package/dist/native/p-IlwlcG9l.js +1 -2
- package/dist/native/p-S-IZ4AN_.js +2 -0
- package/dist/native/p-a60660f6.entry.js +1 -0
- package/dist/native/p-a6287e55.entry.js +1 -0
- package/dist/native/p-a813f497.entry.js +1 -0
- package/dist/native/p-ad05cef2.entry.js +1 -0
- package/dist/native/p-b65f3418.entry.js +1 -0
- package/dist/native/p-bf8b0be2.entry.js +1 -0
- package/dist/native/p-ca3b996b.entry.js +1 -0
- package/dist/native/p-d9c1287c.entry.js +1 -0
- package/dist/native/p-d9cebb66.entry.js +1 -0
- package/dist/native/p-da417f83.entry.js +1 -0
- package/dist/native/p-df59dee0.entry.js +1 -0
- package/dist/native/p-e1021e2c.entry.js +1 -0
- package/dist/native/p-e371a958.entry.js +1 -0
- package/dist/native/p-e5dbacf6.entry.js +1 -0
- package/dist/native/p-ed19f3dc.entry.js +1 -0
- package/dist/native/p-f1b6d43b.entry.js +1 -0
- package/dist/native/p-ff7eae44.entry.js +1 -0
- package/dist/native/p-sqVK8yoD.js +1 -2
- package/dist/native/p-xlgmw4x8.js +2 -3
- package/dist/types/components/nv-breadcrumb/nv-breadcrumb.d.ts +4 -2
- package/dist/types/components/nv-dialog/nv-dialog.d.ts +4 -9
- package/dist/types/components/nv-dialogfooter/nv-dialogfooter.d.ts +3 -4
- package/dist/types/components/nv-dialogheader/nv-dialogheader.d.ts +0 -3
- package/dist/types/components/nv-drawer/nv-drawer.d.ts +3 -3
- package/dist/types/components/nv-drawerfooter/nv-drawerfooter.d.ts +3 -4
- package/dist/types/components/nv-drawerheader/nv-drawerheader.d.ts +0 -3
- package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +4 -0
- package/dist/types/components/nv-fielddropdownitem/nv-fielddropdownitem.d.ts +2 -3
- package/dist/types/components/nv-menu/nv-menu.d.ts +5 -1
- package/dist/types/components/nv-paginationtable/nv-paginationtable.d.ts +112 -0
- package/dist/types/components/nv-paginationtable/nv-paginationtable.docs.d.ts +4 -0
- package/dist/types/components/nv-paginationtable/nv-paginationtable.utils.d.ts +61 -0
- package/dist/types/components/nv-paginationtable/test/nv-paginationtable.utils.test.d.ts +1 -0
- package/dist/types/components/nv-popover/nv-popover.d.ts +2 -3
- package/dist/types/components/nv-tooltip/nv-tooltip.d.ts +4 -2
- package/dist/types/components.d.ts +172 -3
- package/dist/types/stencil-public-runtime.d.ts +87 -4
- package/dist/types/utils/dom.utils.d.ts +6 -0
- package/dist/types/utils/events.utils.d.ts +2 -2
- package/dist/vscode-data.json +636 -587
- package/hydrate/index.d.ts +12 -0
- package/hydrate/index.js +6969 -1224
- package/hydrate/index.mjs +6968 -1225
- package/package.json +10 -8
- package/dist/cjs/_commonjsHelpers-CFO10eej.js.map +0 -1
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -8
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
- package/dist/cjs/clsx-BtxeOLZW.js.map +0 -1
- package/dist/cjs/collapse.animation-CcG0GAWk.js.map +0 -1
- package/dist/cjs/constants-BugGJYqL.js.map +0 -1
- package/dist/cjs/events.utils-BE6R5q9C.js.map +0 -1
- package/dist/cjs/fade.animation-BQSqXXOJ.js.map +0 -1
- package/dist/cjs/grow.animation-ynu_HmA_.js.map +0 -1
- package/dist/cjs/i18n.utils-ku0bScip.js.map +0 -1
- package/dist/cjs/index-B1na8x6M.js +0 -2841
- package/dist/cjs/index-B1na8x6M.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/index.esm-CG1TVKfu.js.map +0 -1
- package/dist/cjs/inputmask-DtXnpVWa.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/native.cjs.js.map +0 -1
- package/dist/cjs/nv-accordion-item.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-accordion.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-alert.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-avatar.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-badge.nv-fielddropdownitemcheck.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-breadcrumb.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-breadcrumbs.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-button.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-buttongroup.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-calendar.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-col.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-datagrid.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-datagridcolumn.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-dialog.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-dialogfooter.nv-dialogheader.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-drawer.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-drawerfooter.nv-drawerheader.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldcheckbox.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fielddate.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fielddaterange.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fielddropdown.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fielddropdownitem.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldmultiselect.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldnumber.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldpassword.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldradio.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldselect.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldslider.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldtext.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldtextarea.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-fieldtime.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-icon.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-iconbutton.nv-loader.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-menu.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-menuitem.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-notification-bullet.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-notification.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-notificationcontainer.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-popover.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-row.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebar.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarcontent.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebardivider.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarfooter.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebargroup.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarheader.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarlogo.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarnavitem.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-sidebarnavsubitem.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-split.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-stack.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-table.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-tableheader.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-toggle.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-togglebutton.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-togglebuttongroup.entry.cjs.js.map +0 -1
- package/dist/cjs/nv-tooltip.entry.cjs.js.map +0 -1
- package/dist/cjs/slide.animation-Cb3tpLQv.js.map +0 -1
- package/dist/cjs/style-value-types.es-B1vLqX9m.js.map +0 -1
- package/dist/cjs/timeline.animation-KteJaZPb.js.map +0 -1
- package/dist/cjs/uri.utils-DiMLQx64.js.map +0 -1
- package/dist/cjs/v4-C1vaJ4yP.js.map +0 -1
- package/dist/collection/animations/collapse.animation.js.map +0 -1
- package/dist/collection/animations/fade.animation.js.map +0 -1
- package/dist/collection/animations/grow.animation.js.map +0 -1
- package/dist/collection/animations/index.js.map +0 -1
- package/dist/collection/animations/slide.animation.js.map +0 -1
- package/dist/collection/animations/timeline.animation.js.map +0 -1
- package/dist/collection/components/nv-accordion/nv-accordion.docs.js.map +0 -1
- package/dist/collection/components/nv-accordion/nv-accordion.js.map +0 -1
- package/dist/collection/components/nv-accordion-item/nv-accordion-item.docs.js.map +0 -1
- package/dist/collection/components/nv-accordion-item/nv-accordion-item.js.map +0 -1
- package/dist/collection/components/nv-alert/nv-alert.docs.js.map +0 -1
- package/dist/collection/components/nv-alert/nv-alert.js.map +0 -1
- package/dist/collection/components/nv-avatar/nv-avatar.docs.js.map +0 -1
- package/dist/collection/components/nv-avatar/nv-avatar.js.map +0 -1
- package/dist/collection/components/nv-badge/nv-badge.docs.js.map +0 -1
- package/dist/collection/components/nv-badge/nv-badge.js.map +0 -1
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.docs.js.map +0 -1
- package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.js.map +0 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js.map +0 -1
- package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.js.map +0 -1
- package/dist/collection/components/nv-button/nv-button.docs.js.map +0 -1
- package/dist/collection/components/nv-button/nv-button.js.map +0 -1
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.docs.js.map +0 -1
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.js.map +0 -1
- package/dist/collection/components/nv-buttongroup/nv-buttongroup.utils.js.map +0 -1
- package/dist/collection/components/nv-buttongroup/test/nv-buttongroup.utils.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/nv-calendar.docs.js.map +0 -1
- package/dist/collection/components/nv-calendar/nv-calendar.js.map +0 -1
- package/dist/collection/components/nv-calendar/nv-calendar.utils.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-actions.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-grid.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-header.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/calendar-shortcuts.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/day-cell.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/index.js.map +0 -1
- package/dist/collection/components/nv-calendar/partials/week-numbers.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-actions.logic.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-grid.logic.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-header.logic.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/day-cell.logic.test.js.map +0 -1
- package/dist/collection/components/nv-calendar/test/partials/week-numbers.logic.test.js.map +0 -1
- package/dist/collection/components/nv-col/nv-col.docs.js.map +0 -1
- package/dist/collection/components/nv-col/nv-col.js.map +0 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +0 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +0 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.docs.js.map +0 -1
- package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js.map +0 -1
- package/dist/collection/components/nv-dialog/nv-dialog.docs.js.map +0 -1
- package/dist/collection/components/nv-dialog/nv-dialog.js.map +0 -1
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.docs.js.map +0 -1
- package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js.map +0 -1
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.docs.js.map +0 -1
- package/dist/collection/components/nv-dialogheader/nv-dialogheader.js.map +0 -1
- package/dist/collection/components/nv-drawer/nv-drawer.docs.js.map +0 -1
- package/dist/collection/components/nv-drawer/nv-drawer.js.map +0 -1
- package/dist/collection/components/nv-drawerfooter/nv-drawerfooter.docs.js.map +0 -1
- package/dist/collection/components/nv-drawerfooter/nv-drawerfooter.js.map +0 -1
- package/dist/collection/components/nv-drawerheader/nv-drawerheader.docs.js.map +0 -1
- package/dist/collection/components/nv-drawerheader/nv-drawerheader.js.map +0 -1
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js.map +0 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js.map +0 -1
- package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +0 -1
- package/dist/collection/components/nv-fielddate/test/nv-fielddate.logic.test.js.map +0 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js.map +0 -1
- package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +0 -1
- package/dist/collection/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.js.map +0 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +0 -1
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +0 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.docs.js.map +0 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js.map +0 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.docs.js.map +0 -1
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js.map +0 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +0 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +0 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js.map +0 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js.map +0 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/partials/field-input.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/partials/range-thumb.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/partials/single-thumb.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/partials/tick-marks.js.map +0 -1
- package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js.map +0 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +0 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +0 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js.map +0 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +0 -1
- package/dist/collection/components/nv-fieldtime/utils/format-utils.js.map +0 -1
- package/dist/collection/components/nv-icon/nv-icon.docs.js.map +0 -1
- package/dist/collection/components/nv-icon/nv-icon.js.map +0 -1
- package/dist/collection/components/nv-icon/nv-icons.js.map +0 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.docs.js.map +0 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js.map +0 -1
- package/dist/collection/components/nv-loader/nv-loader.docs.js.map +0 -1
- package/dist/collection/components/nv-loader/nv-loader.js.map +0 -1
- package/dist/collection/components/nv-menu/nv-menu.docs.js.map +0 -1
- package/dist/collection/components/nv-menu/nv-menu.js.map +0 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.docs.js.map +0 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js.map +0 -1
- package/dist/collection/components/nv-notification/nv-notification.docs.js.map +0 -1
- package/dist/collection/components/nv-notification/nv-notification.js.map +0 -1
- package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.docs.js.map +0 -1
- package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.js.map +0 -1
- package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.docs.js.map +0 -1
- package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.js.map +0 -1
- package/dist/collection/components/nv-popover/nv-popover.docs.js.map +0 -1
- package/dist/collection/components/nv-popover/nv-popover.js.map +0 -1
- package/dist/collection/components/nv-row/nv-row.docs.js.map +0 -1
- package/dist/collection/components/nv-row/nv-row.js.map +0 -1
- package/dist/collection/components/nv-sidebar/nv-sidebar.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebar/nv-sidebar.js.map +0 -1
- package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.js.map +0 -1
- package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.js.map +0 -1
- package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.js.map +0 -1
- package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.js.map +0 -1
- package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.js.map +0 -1
- package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.js.map +0 -1
- package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.js.map +0 -1
- package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.docs.js.map +0 -1
- package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.js.map +0 -1
- package/dist/collection/components/nv-split/nv-split.docs.js.map +0 -1
- package/dist/collection/components/nv-split/nv-split.js.map +0 -1
- package/dist/collection/components/nv-stack/nv-stack.docs.js.map +0 -1
- package/dist/collection/components/nv-stack/nv-stack.js.map +0 -1
- package/dist/collection/components/nv-table/nv-table.docs.js.map +0 -1
- package/dist/collection/components/nv-table/nv-table.js.map +0 -1
- package/dist/collection/components/nv-table/nv-table.utils.js.map +0 -1
- package/dist/collection/components/nv-table/test/nv-table.utils.test.js.map +0 -1
- package/dist/collection/components/nv-tableheader/nv-tableheader.docs.js.map +0 -1
- package/dist/collection/components/nv-tableheader/nv-tableheader.js.map +0 -1
- package/dist/collection/components/nv-toggle/nv-toggle.docs.js.map +0 -1
- package/dist/collection/components/nv-toggle/nv-toggle.js.map +0 -1
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.docs.js.map +0 -1
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.js.map +0 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.docs.js.map +0 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js.map +0 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.docs.js.map +0 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/interfaces/Column.js.map +0 -1
- package/dist/collection/interfaces/ColumnConfig.js.map +0 -1
- package/dist/collection/interfaces/localization.js.map +0 -1
- package/dist/collection/templates/navigation.docs.js.map +0 -1
- package/dist/collection/utils/class.utils.js.map +0 -1
- package/dist/collection/utils/constants.js.map +0 -1
- package/dist/collection/utils/dom.utils.js.map +0 -1
- package/dist/collection/utils/events.utils.js.map +0 -1
- package/dist/collection/utils/i18n.utils.js.map +0 -1
- package/dist/collection/utils/input.utils.js.map +0 -1
- package/dist/collection/utils/search-engine/engine.js.map +0 -1
- package/dist/collection/utils/search-engine/guards.js.map +0 -1
- package/dist/collection/utils/search-engine/index.js.map +0 -1
- package/dist/collection/utils/search-engine/indexer.js.map +0 -1
- package/dist/collection/utils/search-engine/normalize.js.map +0 -1
- package/dist/collection/utils/search-engine/strategies/fuzzy.js.map +0 -1
- package/dist/collection/utils/search-engine/strategies/smart.js.map +0 -1
- package/dist/collection/utils/search-engine/strategies/strict.js.map +0 -1
- package/dist/collection/utils/search-engine/test/engine.test.js.map +0 -1
- package/dist/collection/utils/search-engine/test/guards.test.js.map +0 -1
- package/dist/collection/utils/search-engine/test/indexer.test.js.map +0 -1
- package/dist/collection/utils/search-engine/test/normalize.test.js.map +0 -1
- package/dist/collection/utils/search-engine/test/strategies.test.js.map +0 -1
- package/dist/collection/utils/search-engine/types.js.map +0 -1
- package/dist/collection/utils/search-engine/worker/index.js.map +0 -1
- package/dist/collection/utils/search-engine/worker/search.worker.js.map +0 -1
- package/dist/collection/utils/search-engine/worker/worker-client.js.map +0 -1
- package/dist/collection/utils/string.utils.js.map +0 -1
- package/dist/collection/utils/test/class.utils.test.js.map +0 -1
- package/dist/collection/utils/test/dom.utils.test.js.map +0 -1
- package/dist/collection/utils/test/i18n.utils.test.js.map +0 -1
- package/dist/collection/utils/test/input.utils.test.js.map +0 -1
- package/dist/collection/utils/test/uri.utils.test.js.map +0 -1
- package/dist/collection/utils/uri.utils.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/nv-accordion-item.js.map +0 -1
- package/dist/components/nv-accordion.js.map +0 -1
- package/dist/components/nv-alert.js.map +0 -1
- package/dist/components/nv-avatar.js.map +0 -1
- package/dist/components/nv-badge.js.map +0 -1
- package/dist/components/nv-breadcrumb.js.map +0 -1
- package/dist/components/nv-breadcrumbs.js.map +0 -1
- package/dist/components/nv-button.js.map +0 -1
- package/dist/components/nv-buttongroup.js.map +0 -1
- package/dist/components/nv-calendar.js.map +0 -1
- package/dist/components/nv-col.js.map +0 -1
- package/dist/components/nv-datagrid.js.map +0 -1
- package/dist/components/nv-datagridcolumn.js.map +0 -1
- package/dist/components/nv-dialog.js.map +0 -1
- package/dist/components/nv-dialogfooter.js.map +0 -1
- package/dist/components/nv-dialogheader.js.map +0 -1
- package/dist/components/nv-drawer.js.map +0 -1
- package/dist/components/nv-drawerfooter.js.map +0 -1
- package/dist/components/nv-drawerheader.js.map +0 -1
- package/dist/components/nv-fieldcheckbox.js.map +0 -1
- package/dist/components/nv-fielddate.js.map +0 -1
- package/dist/components/nv-fielddaterange.js.map +0 -1
- package/dist/components/nv-fielddropdown.js.map +0 -1
- package/dist/components/nv-fielddropdownitem.js.map +0 -1
- package/dist/components/nv-fielddropdownitemcheck.js.map +0 -1
- package/dist/components/nv-fieldmultiselect.js.map +0 -1
- package/dist/components/nv-fieldnumber.js.map +0 -1
- package/dist/components/nv-fieldpassword.js.map +0 -1
- package/dist/components/nv-fieldradio.js.map +0 -1
- package/dist/components/nv-fieldselect.js.map +0 -1
- package/dist/components/nv-fieldslider.js.map +0 -1
- package/dist/components/nv-fieldtext.js.map +0 -1
- package/dist/components/nv-fieldtextarea.js.map +0 -1
- package/dist/components/nv-fieldtime.js.map +0 -1
- package/dist/components/nv-icon.js.map +0 -1
- package/dist/components/nv-iconbutton.js.map +0 -1
- package/dist/components/nv-loader.js.map +0 -1
- package/dist/components/nv-menu.js.map +0 -1
- package/dist/components/nv-menuitem.js.map +0 -1
- package/dist/components/nv-notification-bullet.js.map +0 -1
- package/dist/components/nv-notification.js.map +0 -1
- package/dist/components/nv-notificationcontainer.js.map +0 -1
- package/dist/components/nv-popover.js.map +0 -1
- package/dist/components/nv-row.js.map +0 -1
- package/dist/components/nv-sidebar.js.map +0 -1
- package/dist/components/nv-sidebarcontent.js.map +0 -1
- package/dist/components/nv-sidebardivider.js.map +0 -1
- package/dist/components/nv-sidebarfooter.js.map +0 -1
- package/dist/components/nv-sidebargroup.js.map +0 -1
- package/dist/components/nv-sidebarheader.js.map +0 -1
- package/dist/components/nv-sidebarlogo.js.map +0 -1
- package/dist/components/nv-sidebarnavitem.js.map +0 -1
- package/dist/components/nv-sidebarnavsubitem.js.map +0 -1
- package/dist/components/nv-split.js.map +0 -1
- package/dist/components/nv-stack.js.map +0 -1
- package/dist/components/nv-table.js.map +0 -1
- package/dist/components/nv-tableheader.js.map +0 -1
- package/dist/components/nv-toggle.js.map +0 -1
- package/dist/components/nv-togglebutton.js.map +0 -1
- package/dist/components/nv-togglebuttongroup.js.map +0 -1
- package/dist/components/nv-tooltip.js.map +0 -1
- package/dist/components/p-9xYwU7ku.js.map +0 -1
- package/dist/components/p-B45HbBWe.js +0 -191
- package/dist/components/p-B45HbBWe.js.map +0 -1
- package/dist/components/p-B5jN7NKA.js +0 -59
- package/dist/components/p-B5jN7NKA.js.map +0 -1
- package/dist/components/p-B6GgGra-.js.map +0 -1
- package/dist/components/p-B7VlEQVW.js +0 -1475
- package/dist/components/p-B7VlEQVW.js.map +0 -1
- package/dist/components/p-B9i3m6rk.js +0 -1941
- package/dist/components/p-B9i3m6rk.js.map +0 -1
- package/dist/components/p-BILd3Ta-.js +0 -209
- package/dist/components/p-BILd3Ta-.js.map +0 -1
- package/dist/components/p-BISctfud.js +0 -214
- package/dist/components/p-BISctfud.js.map +0 -1
- package/dist/components/p-BReL3Lsa.js.map +0 -1
- package/dist/components/p-BVOv1zgq.js +0 -82
- package/dist/components/p-BVOv1zgq.js.map +0 -1
- package/dist/components/p-BdYh22OP.js.map +0 -1
- package/dist/components/p-Bg_l3jn1.js +0 -191
- package/dist/components/p-Bg_l3jn1.js.map +0 -1
- package/dist/components/p-C2QAWGhf.js +0 -88
- package/dist/components/p-C2QAWGhf.js.map +0 -1
- package/dist/components/p-C63Xpg9a.js +0 -2338
- package/dist/components/p-C63Xpg9a.js.map +0 -1
- package/dist/components/p-COnt5ux_.js +0 -51
- package/dist/components/p-COnt5ux_.js.map +0 -1
- package/dist/components/p-Cc7XnqPp.js +0 -260
- package/dist/components/p-Cc7XnqPp.js.map +0 -1
- package/dist/components/p-CgHCo_Ho.js.map +0 -1
- package/dist/components/p-ChV9xqsO.js.map +0 -1
- package/dist/components/p-CnI0auJM.js.map +0 -1
- package/dist/components/p-D02w_Ru6.js.map +0 -1
- package/dist/components/p-D1C_pu0E.js.map +0 -1
- package/dist/components/p-D2otK4Ce.js.map +0 -1
- package/dist/components/p-D3eWMME9.js.map +0 -1
- package/dist/components/p-D6APFL6N.js +0 -243
- package/dist/components/p-D6APFL6N.js.map +0 -1
- package/dist/components/p-DZJHk4fr.js +0 -3759
- package/dist/components/p-DZJHk4fr.js.map +0 -1
- package/dist/components/p-DiUP3TzF.js +0 -140
- package/dist/components/p-DiUP3TzF.js.map +0 -1
- package/dist/components/p-DpDooigg.js +0 -99
- package/dist/components/p-DpDooigg.js.map +0 -1
- package/dist/components/p-Dr-67WvG.js +0 -94
- package/dist/components/p-Dr-67WvG.js.map +0 -1
- package/dist/components/p-DvapDVBj.js +0 -176
- package/dist/components/p-DvapDVBj.js.map +0 -1
- package/dist/components/p-Dz1GUhVy.js.map +0 -1
- package/dist/components/p-IlwlcG9l.js.map +0 -1
- package/dist/components/p-W6vOfMC9.js +0 -63
- package/dist/components/p-W6vOfMC9.js.map +0 -1
- package/dist/components/p-nfYynlVq.js +0 -90
- package/dist/components/p-nfYynlVq.js.map +0 -1
- package/dist/components/p-tyaJ-nGV.js +0 -97
- package/dist/components/p-tyaJ-nGV.js.map +0 -1
- package/dist/components/p-u-maNLLs.js +0 -145
- package/dist/components/p-u-maNLLs.js.map +0 -1
- package/dist/esm/_commonjsHelpers-B85MJLTf.js.map +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -6
- package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
- package/dist/esm/clsx-ChV9xqsO.js.map +0 -1
- package/dist/esm/collapse.animation-DZDm0vSK.js.map +0 -1
- package/dist/esm/constants-BReL3Lsa.js.map +0 -1
- package/dist/esm/events.utils-B6GgGra-.js.map +0 -1
- package/dist/esm/fade.animation-DcRL9lcm.js.map +0 -1
- package/dist/esm/grow.animation-D7ep_aVl.js.map +0 -1
- package/dist/esm/i18n.utils-IlwlcG9l.js.map +0 -1
- package/dist/esm/index-CasQushP.js +0 -2811
- package/dist/esm/index-CasQushP.js.map +0 -1
- package/dist/esm/index.esm-D3eWMME9.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/inputmask-CSo292ul.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/native.js.map +0 -1
- package/dist/esm/nv-accordion-item.entry.js.map +0 -1
- package/dist/esm/nv-accordion.entry.js.map +0 -1
- package/dist/esm/nv-alert.entry.js.map +0 -1
- package/dist/esm/nv-avatar.entry.js.map +0 -1
- package/dist/esm/nv-badge.nv-fielddropdownitemcheck.entry.js.map +0 -1
- package/dist/esm/nv-breadcrumb.entry.js.map +0 -1
- package/dist/esm/nv-breadcrumbs.entry.js.map +0 -1
- package/dist/esm/nv-button.entry.js.map +0 -1
- package/dist/esm/nv-buttongroup.entry.js.map +0 -1
- package/dist/esm/nv-calendar.entry.js.map +0 -1
- package/dist/esm/nv-col.entry.js.map +0 -1
- package/dist/esm/nv-datagrid.entry.js.map +0 -1
- package/dist/esm/nv-datagridcolumn.entry.js.map +0 -1
- package/dist/esm/nv-dialog.entry.js.map +0 -1
- package/dist/esm/nv-dialogfooter.nv-dialogheader.entry.js.map +0 -1
- package/dist/esm/nv-drawer.entry.js.map +0 -1
- package/dist/esm/nv-drawerfooter.nv-drawerheader.entry.js.map +0 -1
- package/dist/esm/nv-fieldcheckbox.entry.js.map +0 -1
- package/dist/esm/nv-fielddate.entry.js.map +0 -1
- package/dist/esm/nv-fielddaterange.entry.js.map +0 -1
- package/dist/esm/nv-fielddropdown.entry.js.map +0 -1
- package/dist/esm/nv-fielddropdownitem.entry.js.map +0 -1
- package/dist/esm/nv-fieldmultiselect.entry.js.map +0 -1
- package/dist/esm/nv-fieldnumber.entry.js.map +0 -1
- package/dist/esm/nv-fieldpassword.entry.js.map +0 -1
- package/dist/esm/nv-fieldradio.entry.js.map +0 -1
- package/dist/esm/nv-fieldselect.entry.js.map +0 -1
- package/dist/esm/nv-fieldslider.entry.js.map +0 -1
- package/dist/esm/nv-fieldtext.entry.js.map +0 -1
- package/dist/esm/nv-fieldtextarea.entry.js.map +0 -1
- package/dist/esm/nv-fieldtime.entry.js.map +0 -1
- package/dist/esm/nv-icon.entry.js.map +0 -1
- package/dist/esm/nv-iconbutton.nv-loader.entry.js.map +0 -1
- package/dist/esm/nv-menu.entry.js.map +0 -1
- package/dist/esm/nv-menuitem.entry.js.map +0 -1
- package/dist/esm/nv-notification-bullet.entry.js.map +0 -1
- package/dist/esm/nv-notification.entry.js.map +0 -1
- package/dist/esm/nv-notificationcontainer.entry.js.map +0 -1
- package/dist/esm/nv-popover.entry.js.map +0 -1
- package/dist/esm/nv-row.entry.js.map +0 -1
- package/dist/esm/nv-sidebar.entry.js.map +0 -1
- package/dist/esm/nv-sidebarcontent.entry.js.map +0 -1
- package/dist/esm/nv-sidebardivider.entry.js.map +0 -1
- package/dist/esm/nv-sidebarfooter.entry.js.map +0 -1
- package/dist/esm/nv-sidebargroup.entry.js.map +0 -1
- package/dist/esm/nv-sidebarheader.entry.js.map +0 -1
- package/dist/esm/nv-sidebarlogo.entry.js.map +0 -1
- package/dist/esm/nv-sidebarnavitem.entry.js.map +0 -1
- package/dist/esm/nv-sidebarnavsubitem.entry.js.map +0 -1
- package/dist/esm/nv-split.entry.js.map +0 -1
- package/dist/esm/nv-stack.entry.js.map +0 -1
- package/dist/esm/nv-table.entry.js.map +0 -1
- package/dist/esm/nv-tableheader.entry.js.map +0 -1
- package/dist/esm/nv-toggle.entry.js.map +0 -1
- package/dist/esm/nv-togglebutton.entry.js.map +0 -1
- package/dist/esm/nv-togglebuttongroup.entry.js.map +0 -1
- package/dist/esm/nv-tooltip.entry.js.map +0 -1
- package/dist/esm/slide.animation-CmH5d1of.js.map +0 -1
- package/dist/esm/style-value-types.es-xlgmw4x8.js.map +0 -1
- package/dist/esm/timeline.animation-CgHCo_Ho.js.map +0 -1
- package/dist/esm/uri.utils-CnI0auJM.js.map +0 -1
- package/dist/esm/v4-BdYh22OP.js.map +0 -1
- package/dist/lib/generators/angular-output.js.map +0 -1
- package/dist/lib/generators/docs-blazor.js.map +0 -1
- package/dist/lib/generators/vue-output.js.map +0 -1
- package/dist/lib/utils/componentBinding.js.map +0 -1
- package/dist/lib/utils/parseToCSharpTypes.js.map +0 -1
- package/dist/lib/utils/spread.js.map +0 -1
- package/dist/lib/utils/test/parseToCSharpTypes.test.js.map +0 -1
- package/dist/native/index.esm.js.map +0 -1
- package/dist/native/loader.esm.js.map +0 -1
- package/dist/native/native.esm.js.map +0 -1
- package/dist/native/nv-accordion-item.entry.esm.js.map +0 -1
- package/dist/native/nv-accordion.entry.esm.js.map +0 -1
- package/dist/native/nv-alert.entry.esm.js.map +0 -1
- package/dist/native/nv-avatar.entry.esm.js.map +0 -1
- package/dist/native/nv-badge.nv-fielddropdownitemcheck.entry.esm.js.map +0 -1
- package/dist/native/nv-breadcrumb.entry.esm.js.map +0 -1
- package/dist/native/nv-breadcrumbs.entry.esm.js.map +0 -1
- package/dist/native/nv-button.entry.esm.js.map +0 -1
- package/dist/native/nv-buttongroup.entry.esm.js.map +0 -1
- package/dist/native/nv-calendar.entry.esm.js.map +0 -1
- package/dist/native/nv-col.entry.esm.js.map +0 -1
- package/dist/native/nv-datagrid.entry.esm.js.map +0 -1
- package/dist/native/nv-datagridcolumn.entry.esm.js.map +0 -1
- package/dist/native/nv-dialog.entry.esm.js.map +0 -1
- package/dist/native/nv-dialogfooter.nv-dialogheader.entry.esm.js.map +0 -1
- package/dist/native/nv-drawer.entry.esm.js.map +0 -1
- package/dist/native/nv-drawerfooter.nv-drawerheader.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldcheckbox.entry.esm.js.map +0 -1
- package/dist/native/nv-fielddate.entry.esm.js.map +0 -1
- package/dist/native/nv-fielddaterange.entry.esm.js.map +0 -1
- package/dist/native/nv-fielddropdown.entry.esm.js.map +0 -1
- package/dist/native/nv-fielddropdownitem.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldmultiselect.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldnumber.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldpassword.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldradio.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldselect.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldslider.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldtext.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldtextarea.entry.esm.js.map +0 -1
- package/dist/native/nv-fieldtime.entry.esm.js.map +0 -1
- package/dist/native/nv-icon.entry.esm.js.map +0 -1
- package/dist/native/nv-iconbutton.nv-loader.entry.esm.js.map +0 -1
- package/dist/native/nv-menu.entry.esm.js.map +0 -1
- package/dist/native/nv-menuitem.entry.esm.js.map +0 -1
- package/dist/native/nv-notification-bullet.entry.esm.js.map +0 -1
- package/dist/native/nv-notification.entry.esm.js.map +0 -1
- package/dist/native/nv-notificationcontainer.entry.esm.js.map +0 -1
- package/dist/native/nv-popover.entry.esm.js.map +0 -1
- package/dist/native/nv-row.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebar.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarcontent.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebardivider.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarfooter.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebargroup.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarheader.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarlogo.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarnavitem.entry.esm.js.map +0 -1
- package/dist/native/nv-sidebarnavsubitem.entry.esm.js.map +0 -1
- package/dist/native/nv-split.entry.esm.js.map +0 -1
- package/dist/native/nv-stack.entry.esm.js.map +0 -1
- package/dist/native/nv-table.entry.esm.js.map +0 -1
- package/dist/native/nv-tableheader.entry.esm.js.map +0 -1
- package/dist/native/nv-toggle.entry.esm.js.map +0 -1
- package/dist/native/nv-togglebutton.entry.esm.js.map +0 -1
- package/dist/native/nv-togglebuttongroup.entry.esm.js.map +0 -1
- package/dist/native/nv-tooltip.entry.esm.js.map +0 -1
- package/dist/native/p-02e6228a.entry.js +0 -2
- package/dist/native/p-02e6228a.entry.js.map +0 -1
- package/dist/native/p-04a2fe7f.entry.js +0 -2
- package/dist/native/p-04a2fe7f.entry.js.map +0 -1
- package/dist/native/p-08204da4.entry.js +0 -2
- package/dist/native/p-08204da4.entry.js.map +0 -1
- package/dist/native/p-0e07b91b.entry.js +0 -2
- package/dist/native/p-0e07b91b.entry.js.map +0 -1
- package/dist/native/p-136dfb3e.entry.js +0 -2
- package/dist/native/p-136dfb3e.entry.js.map +0 -1
- package/dist/native/p-13YSIyGW.js.map +0 -1
- package/dist/native/p-1f2dd37f.entry.js +0 -2
- package/dist/native/p-1f2dd37f.entry.js.map +0 -1
- package/dist/native/p-255a0482.entry.js +0 -2
- package/dist/native/p-255a0482.entry.js.map +0 -1
- package/dist/native/p-3305a7e6.entry.js +0 -2
- package/dist/native/p-3305a7e6.entry.js.map +0 -1
- package/dist/native/p-36b0a6f0.entry.js +0 -2
- package/dist/native/p-36b0a6f0.entry.js.map +0 -1
- package/dist/native/p-434bc910.entry.js +0 -2
- package/dist/native/p-434bc910.entry.js.map +0 -1
- package/dist/native/p-436029a5.entry.js +0 -2
- package/dist/native/p-436029a5.entry.js.map +0 -1
- package/dist/native/p-460fdf02.entry.js +0 -2
- package/dist/native/p-460fdf02.entry.js.map +0 -1
- package/dist/native/p-477e02cf.entry.js +0 -2
- package/dist/native/p-477e02cf.entry.js.map +0 -1
- package/dist/native/p-4efb582b.entry.js +0 -2
- package/dist/native/p-4efb582b.entry.js.map +0 -1
- package/dist/native/p-4f1dfa32.entry.js +0 -2
- package/dist/native/p-4f1dfa32.entry.js.map +0 -1
- package/dist/native/p-50ce41ac.entry.js +0 -2
- package/dist/native/p-50ce41ac.entry.js.map +0 -1
- package/dist/native/p-51b7de55.entry.js +0 -13
- package/dist/native/p-51b7de55.entry.js.map +0 -1
- package/dist/native/p-5dd120dc.entry.js +0 -2
- package/dist/native/p-5dd120dc.entry.js.map +0 -1
- package/dist/native/p-60bb0d48.entry.js +0 -2
- package/dist/native/p-60bb0d48.entry.js.map +0 -1
- package/dist/native/p-67181258.entry.js +0 -2
- package/dist/native/p-67181258.entry.js.map +0 -1
- package/dist/native/p-6a81884b.entry.js +0 -2
- package/dist/native/p-6a81884b.entry.js.map +0 -1
- package/dist/native/p-6aa483de.entry.js +0 -2
- package/dist/native/p-6aa483de.entry.js.map +0 -1
- package/dist/native/p-6fc79712.entry.js +0 -2
- package/dist/native/p-6fc79712.entry.js.map +0 -1
- package/dist/native/p-70e9e067.entry.js +0 -2
- package/dist/native/p-70e9e067.entry.js.map +0 -1
- package/dist/native/p-729589cb.entry.js +0 -2
- package/dist/native/p-729589cb.entry.js.map +0 -1
- package/dist/native/p-78bf7650.entry.js +0 -2
- package/dist/native/p-78bf7650.entry.js.map +0 -1
- package/dist/native/p-7e6e9ea2.entry.js +0 -2
- package/dist/native/p-7e6e9ea2.entry.js.map +0 -1
- package/dist/native/p-8f1cd9e2.entry.js +0 -2
- package/dist/native/p-8f1cd9e2.entry.js.map +0 -1
- package/dist/native/p-910cd685.entry.js +0 -2
- package/dist/native/p-910cd685.entry.js.map +0 -1
- package/dist/native/p-91eaf02e.entry.js +0 -2
- package/dist/native/p-91eaf02e.entry.js.map +0 -1
- package/dist/native/p-93b77ed4.entry.js +0 -2
- package/dist/native/p-93b77ed4.entry.js.map +0 -1
- package/dist/native/p-93e35975.entry.js +0 -2
- package/dist/native/p-93e35975.entry.js.map +0 -1
- package/dist/native/p-96c45604.entry.js +0 -2
- package/dist/native/p-96c45604.entry.js.map +0 -1
- package/dist/native/p-9b6ad782.entry.js +0 -2
- package/dist/native/p-9b6ad782.entry.js.map +0 -1
- package/dist/native/p-9f32c3ea.entry.js +0 -2
- package/dist/native/p-9f32c3ea.entry.js.map +0 -1
- package/dist/native/p-B6GgGra-.js.map +0 -1
- package/dist/native/p-B85MJLTf.js.map +0 -1
- package/dist/native/p-BReL3Lsa.js.map +0 -1
- package/dist/native/p-BdYh22OP.js.map +0 -1
- package/dist/native/p-Blc6XEY7.js.map +0 -1
- package/dist/native/p-CasQushP.js +0 -3
- package/dist/native/p-CasQushP.js.map +0 -1
- package/dist/native/p-CgHCo_Ho.js.map +0 -1
- package/dist/native/p-ChV9xqsO.js.map +0 -1
- package/dist/native/p-CnI0auJM.js.map +0 -1
- package/dist/native/p-D3eWMME9.js.map +0 -1
- package/dist/native/p-DQuL1Twl.js +0 -2
- package/dist/native/p-DQuL1Twl.js.map +0 -1
- package/dist/native/p-DmUOtOcY.js.map +0 -1
- package/dist/native/p-Hfc8Oh0x.js.map +0 -1
- package/dist/native/p-IlwlcG9l.js.map +0 -1
- package/dist/native/p-a6fea322.entry.js +0 -2
- package/dist/native/p-a6fea322.entry.js.map +0 -1
- package/dist/native/p-ae279ae9.entry.js +0 -2
- package/dist/native/p-ae279ae9.entry.js.map +0 -1
- package/dist/native/p-b7765048.entry.js +0 -2
- package/dist/native/p-b7765048.entry.js.map +0 -1
- package/dist/native/p-ba1286aa.entry.js +0 -2
- package/dist/native/p-ba1286aa.entry.js.map +0 -1
- package/dist/native/p-bb52a5a9.entry.js +0 -2
- package/dist/native/p-bb52a5a9.entry.js.map +0 -1
- package/dist/native/p-bc90247e.entry.js +0 -2
- package/dist/native/p-bc90247e.entry.js.map +0 -1
- package/dist/native/p-c2a73a5a.entry.js +0 -2
- package/dist/native/p-c2a73a5a.entry.js.map +0 -1
- package/dist/native/p-c4c11549.entry.js +0 -2
- package/dist/native/p-c4c11549.entry.js.map +0 -1
- package/dist/native/p-c5ecdc49.entry.js +0 -2
- package/dist/native/p-c5ecdc49.entry.js.map +0 -1
- package/dist/native/p-cb1b9edb.entry.js +0 -2
- package/dist/native/p-cb1b9edb.entry.js.map +0 -1
- package/dist/native/p-cdaf54b0.entry.js +0 -2
- package/dist/native/p-cdaf54b0.entry.js.map +0 -1
- package/dist/native/p-ceb8fe8a.entry.js +0 -2
- package/dist/native/p-ceb8fe8a.entry.js.map +0 -1
- package/dist/native/p-daf7541b.entry.js +0 -2
- package/dist/native/p-daf7541b.entry.js.map +0 -1
- package/dist/native/p-de4f53a5.entry.js +0 -2
- package/dist/native/p-de4f53a5.entry.js.map +0 -1
- package/dist/native/p-ded4be77.entry.js +0 -2
- package/dist/native/p-ded4be77.entry.js.map +0 -1
- package/dist/native/p-e1fc5f8c.entry.js +0 -2
- package/dist/native/p-e1fc5f8c.entry.js.map +0 -1
- package/dist/native/p-e6c69f7d.entry.js +0 -2
- package/dist/native/p-e6c69f7d.entry.js.map +0 -1
- package/dist/native/p-e83603f1.entry.js +0 -2
- package/dist/native/p-e83603f1.entry.js.map +0 -1
- package/dist/native/p-ec217581.entry.js +0 -2
- package/dist/native/p-ec217581.entry.js.map +0 -1
- package/dist/native/p-ee694832.entry.js +0 -2
- package/dist/native/p-ee694832.entry.js.map +0 -1
- package/dist/native/p-f39aef8e.entry.js +0 -2
- package/dist/native/p-f39aef8e.entry.js.map +0 -1
- package/dist/native/p-f7e0146e.entry.js +0 -2
- package/dist/native/p-f7e0146e.entry.js.map +0 -1
- package/dist/native/p-sqVK8yoD.js.map +0 -1
- package/dist/native/p-xlgmw4x8.js.map +0 -1
|
@@ -1,4580 +1 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-C63Xpg9a.js';
|
|
2
|
-
import { h as SortingPossibility } from './p-BReL3Lsa.js';
|
|
3
|
-
import { d as defineCustomElement$3 } from './p-BILd3Ta-.js';
|
|
4
|
-
import { d as defineCustomElement$2 } from './p-nfYynlVq.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* table-core
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) TanStack
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
13
|
-
*
|
|
14
|
-
* @license MIT
|
|
15
|
-
*/
|
|
16
|
-
// type Person = {
|
|
17
|
-
// firstName: string
|
|
18
|
-
// lastName: string
|
|
19
|
-
// age: number
|
|
20
|
-
// visits: number
|
|
21
|
-
// status: string
|
|
22
|
-
// progress: number
|
|
23
|
-
// createdAt: Date
|
|
24
|
-
// nested: {
|
|
25
|
-
// foo: [
|
|
26
|
-
// {
|
|
27
|
-
// bar: 'bar'
|
|
28
|
-
// }
|
|
29
|
-
// ]
|
|
30
|
-
// bar: { subBar: boolean }[]
|
|
31
|
-
// baz: {
|
|
32
|
-
// foo: 'foo'
|
|
33
|
-
// bar: {
|
|
34
|
-
// baz: 'baz'
|
|
35
|
-
// }
|
|
36
|
-
// }
|
|
37
|
-
// }
|
|
38
|
-
// }
|
|
39
|
-
|
|
40
|
-
// const test: DeepKeys<Person> = 'nested.foo.0.bar'
|
|
41
|
-
// const test2: DeepKeys<Person> = 'nested.bar'
|
|
42
|
-
|
|
43
|
-
// const helper = createColumnHelper<Person>()
|
|
44
|
-
|
|
45
|
-
// helper.accessor('nested.foo', {
|
|
46
|
-
// cell: info => info.getValue(),
|
|
47
|
-
// })
|
|
48
|
-
|
|
49
|
-
// helper.accessor('nested.foo.0.bar', {
|
|
50
|
-
// cell: info => info.getValue(),
|
|
51
|
-
// })
|
|
52
|
-
|
|
53
|
-
// helper.accessor('nested.bar', {
|
|
54
|
-
// cell: info => info.getValue(),
|
|
55
|
-
// })
|
|
56
|
-
|
|
57
|
-
function createColumnHelper() {
|
|
58
|
-
return {
|
|
59
|
-
accessor: (accessor, column) => {
|
|
60
|
-
return typeof accessor === 'function' ? {
|
|
61
|
-
...column,
|
|
62
|
-
accessorFn: accessor
|
|
63
|
-
} : {
|
|
64
|
-
...column,
|
|
65
|
-
accessorKey: accessor
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
display: column => column,
|
|
69
|
-
group: column => column
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// Is this type a tuple?
|
|
74
|
-
|
|
75
|
-
// If this type is a tuple, what indices are allowed?
|
|
76
|
-
|
|
77
|
-
///
|
|
78
|
-
|
|
79
|
-
function functionalUpdate(updater, input) {
|
|
80
|
-
return typeof updater === 'function' ? updater(input) : updater;
|
|
81
|
-
}
|
|
82
|
-
function makeStateUpdater(key, instance) {
|
|
83
|
-
return updater => {
|
|
84
|
-
instance.setState(old => {
|
|
85
|
-
return {
|
|
86
|
-
...old,
|
|
87
|
-
[key]: functionalUpdate(updater, old[key])
|
|
88
|
-
};
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
function isFunction(d) {
|
|
93
|
-
return d instanceof Function;
|
|
94
|
-
}
|
|
95
|
-
function isNumberArray(d) {
|
|
96
|
-
return Array.isArray(d) && d.every(val => typeof val === 'number');
|
|
97
|
-
}
|
|
98
|
-
function flattenBy(arr, getChildren) {
|
|
99
|
-
const flat = [];
|
|
100
|
-
const recurse = subArr => {
|
|
101
|
-
subArr.forEach(item => {
|
|
102
|
-
flat.push(item);
|
|
103
|
-
const children = getChildren(item);
|
|
104
|
-
if (children != null && children.length) {
|
|
105
|
-
recurse(children);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
recurse(arr);
|
|
110
|
-
return flat;
|
|
111
|
-
}
|
|
112
|
-
function memo(getDeps, fn, opts) {
|
|
113
|
-
let deps = [];
|
|
114
|
-
let result;
|
|
115
|
-
return depArgs => {
|
|
116
|
-
let depTime;
|
|
117
|
-
if (opts.key && opts.debug) depTime = Date.now();
|
|
118
|
-
const newDeps = getDeps(depArgs);
|
|
119
|
-
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
|
|
120
|
-
if (!depsChanged) {
|
|
121
|
-
return result;
|
|
122
|
-
}
|
|
123
|
-
deps = newDeps;
|
|
124
|
-
let resultTime;
|
|
125
|
-
if (opts.key && opts.debug) resultTime = Date.now();
|
|
126
|
-
result = fn(...newDeps);
|
|
127
|
-
opts == null || opts.onChange == null || opts.onChange(result);
|
|
128
|
-
if (opts.key && opts.debug) {
|
|
129
|
-
if (opts != null && opts.debug()) {
|
|
130
|
-
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
131
|
-
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
132
|
-
const resultFpsPercentage = resultEndTime / 16;
|
|
133
|
-
const pad = (str, num) => {
|
|
134
|
-
str = String(str);
|
|
135
|
-
while (str.length < num) {
|
|
136
|
-
str = ' ' + str;
|
|
137
|
-
}
|
|
138
|
-
return str;
|
|
139
|
-
};
|
|
140
|
-
console.info(`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, `
|
|
141
|
-
font-size: .6rem;
|
|
142
|
-
font-weight: bold;
|
|
143
|
-
color: hsl(${Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120))}deg 100% 31%);`, opts == null ? void 0 : opts.key);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return result;
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
function getMemoOptions(tableOptions, debugLevel, key, onChange) {
|
|
150
|
-
return {
|
|
151
|
-
debug: () => {
|
|
152
|
-
var _tableOptions$debugAl;
|
|
153
|
-
return (_tableOptions$debugAl = tableOptions == null ? void 0 : tableOptions.debugAll) != null ? _tableOptions$debugAl : tableOptions[debugLevel];
|
|
154
|
-
},
|
|
155
|
-
key: "production" === 'development',
|
|
156
|
-
onChange
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function createCell(table, row, column, columnId) {
|
|
161
|
-
const getRenderValue = () => {
|
|
162
|
-
var _cell$getValue;
|
|
163
|
-
return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : table.options.renderFallbackValue;
|
|
164
|
-
};
|
|
165
|
-
const cell = {
|
|
166
|
-
id: `${row.id}_${column.id}`,
|
|
167
|
-
row,
|
|
168
|
-
column,
|
|
169
|
-
getValue: () => row.getValue(columnId),
|
|
170
|
-
renderValue: getRenderValue,
|
|
171
|
-
getContext: memo(() => [table, column, row, cell], (table, column, row, cell) => ({
|
|
172
|
-
table,
|
|
173
|
-
column,
|
|
174
|
-
row,
|
|
175
|
-
cell: cell,
|
|
176
|
-
getValue: cell.getValue,
|
|
177
|
-
renderValue: cell.renderValue
|
|
178
|
-
}), getMemoOptions(table.options, 'debugCells'))
|
|
179
|
-
};
|
|
180
|
-
table._features.forEach(feature => {
|
|
181
|
-
feature.createCell == null || feature.createCell(cell, column, row, table);
|
|
182
|
-
}, {});
|
|
183
|
-
return cell;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function createColumn(table, columnDef, depth, parent) {
|
|
187
|
-
var _ref, _resolvedColumnDef$id;
|
|
188
|
-
const defaultColumn = table._getDefaultColumnDef();
|
|
189
|
-
const resolvedColumnDef = {
|
|
190
|
-
...defaultColumn,
|
|
191
|
-
...columnDef
|
|
192
|
-
};
|
|
193
|
-
const accessorKey = resolvedColumnDef.accessorKey;
|
|
194
|
-
let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? typeof String.prototype.replaceAll === 'function' ? accessorKey.replaceAll('.', '_') : accessorKey.replace(/\./g, '_') : undefined) != null ? _ref : typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined;
|
|
195
|
-
let accessorFn;
|
|
196
|
-
if (resolvedColumnDef.accessorFn) {
|
|
197
|
-
accessorFn = resolvedColumnDef.accessorFn;
|
|
198
|
-
} else if (accessorKey) {
|
|
199
|
-
// Support deep accessor keys
|
|
200
|
-
if (accessorKey.includes('.')) {
|
|
201
|
-
accessorFn = originalRow => {
|
|
202
|
-
let result = originalRow;
|
|
203
|
-
for (const key of accessorKey.split('.')) {
|
|
204
|
-
var _result;
|
|
205
|
-
result = (_result = result) == null ? void 0 : _result[key];
|
|
206
|
-
}
|
|
207
|
-
return result;
|
|
208
|
-
};
|
|
209
|
-
} else {
|
|
210
|
-
accessorFn = originalRow => originalRow[resolvedColumnDef.accessorKey];
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
if (!id) {
|
|
214
|
-
throw new Error();
|
|
215
|
-
}
|
|
216
|
-
let column = {
|
|
217
|
-
id: `${String(id)}`,
|
|
218
|
-
accessorFn,
|
|
219
|
-
parent: parent,
|
|
220
|
-
depth,
|
|
221
|
-
columnDef: resolvedColumnDef,
|
|
222
|
-
columns: [],
|
|
223
|
-
getFlatColumns: memo(() => [true], () => {
|
|
224
|
-
var _column$columns;
|
|
225
|
-
return [column, ...((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(d => d.getFlatColumns()))];
|
|
226
|
-
}, getMemoOptions(table.options, 'debugColumns')),
|
|
227
|
-
getLeafColumns: memo(() => [table._getOrderColumnsFn()], orderColumns => {
|
|
228
|
-
var _column$columns2;
|
|
229
|
-
if ((_column$columns2 = column.columns) != null && _column$columns2.length) {
|
|
230
|
-
let leafColumns = column.columns.flatMap(column => column.getLeafColumns());
|
|
231
|
-
return orderColumns(leafColumns);
|
|
232
|
-
}
|
|
233
|
-
return [column];
|
|
234
|
-
}, getMemoOptions(table.options, 'debugColumns'))
|
|
235
|
-
};
|
|
236
|
-
for (const feature of table._features) {
|
|
237
|
-
feature.createColumn == null || feature.createColumn(column, table);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// Yes, we have to convert table to unknown, because we know more than the compiler here.
|
|
241
|
-
return column;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
const debug = 'debugHeaders';
|
|
245
|
-
//
|
|
246
|
-
|
|
247
|
-
function createHeader(table, column, options) {
|
|
248
|
-
var _options$id;
|
|
249
|
-
const id = (_options$id = options.id) != null ? _options$id : column.id;
|
|
250
|
-
let header = {
|
|
251
|
-
id,
|
|
252
|
-
column,
|
|
253
|
-
index: options.index,
|
|
254
|
-
isPlaceholder: !!options.isPlaceholder,
|
|
255
|
-
placeholderId: options.placeholderId,
|
|
256
|
-
depth: options.depth,
|
|
257
|
-
subHeaders: [],
|
|
258
|
-
colSpan: 0,
|
|
259
|
-
rowSpan: 0,
|
|
260
|
-
headerGroup: null,
|
|
261
|
-
getLeafHeaders: () => {
|
|
262
|
-
const leafHeaders = [];
|
|
263
|
-
const recurseHeader = h => {
|
|
264
|
-
if (h.subHeaders && h.subHeaders.length) {
|
|
265
|
-
h.subHeaders.map(recurseHeader);
|
|
266
|
-
}
|
|
267
|
-
leafHeaders.push(h);
|
|
268
|
-
};
|
|
269
|
-
recurseHeader(header);
|
|
270
|
-
return leafHeaders;
|
|
271
|
-
},
|
|
272
|
-
getContext: () => ({
|
|
273
|
-
table,
|
|
274
|
-
header: header,
|
|
275
|
-
column
|
|
276
|
-
})
|
|
277
|
-
};
|
|
278
|
-
table._features.forEach(feature => {
|
|
279
|
-
feature.createHeader == null || feature.createHeader(header, table);
|
|
280
|
-
});
|
|
281
|
-
return header;
|
|
282
|
-
}
|
|
283
|
-
const Headers = {
|
|
284
|
-
createTable: table => {
|
|
285
|
-
// Header Groups
|
|
286
|
-
|
|
287
|
-
table.getHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
|
|
288
|
-
var _left$map$filter, _right$map$filter;
|
|
289
|
-
const leftColumns = (_left$map$filter = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
|
|
290
|
-
const rightColumns = (_right$map$filter = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
|
|
291
|
-
const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
|
|
292
|
-
const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);
|
|
293
|
-
return headerGroups;
|
|
294
|
-
}, getMemoOptions(table.options, debug));
|
|
295
|
-
table.getCenterHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
|
|
296
|
-
leafColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
|
|
297
|
-
return buildHeaderGroups(allColumns, leafColumns, table, 'center');
|
|
298
|
-
}, getMemoOptions(table.options, debug));
|
|
299
|
-
table.getLeftHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {
|
|
300
|
-
var _left$map$filter2;
|
|
301
|
-
const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
|
|
302
|
-
return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left');
|
|
303
|
-
}, getMemoOptions(table.options, debug));
|
|
304
|
-
table.getRightHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {
|
|
305
|
-
var _right$map$filter2;
|
|
306
|
-
const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
|
|
307
|
-
return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right');
|
|
308
|
-
}, getMemoOptions(table.options, debug));
|
|
309
|
-
|
|
310
|
-
// Footer Groups
|
|
311
|
-
|
|
312
|
-
table.getFooterGroups = memo(() => [table.getHeaderGroups()], headerGroups => {
|
|
313
|
-
return [...headerGroups].reverse();
|
|
314
|
-
}, getMemoOptions(table.options, debug));
|
|
315
|
-
table.getLeftFooterGroups = memo(() => [table.getLeftHeaderGroups()], headerGroups => {
|
|
316
|
-
return [...headerGroups].reverse();
|
|
317
|
-
}, getMemoOptions(table.options, debug));
|
|
318
|
-
table.getCenterFooterGroups = memo(() => [table.getCenterHeaderGroups()], headerGroups => {
|
|
319
|
-
return [...headerGroups].reverse();
|
|
320
|
-
}, getMemoOptions(table.options, debug));
|
|
321
|
-
table.getRightFooterGroups = memo(() => [table.getRightHeaderGroups()], headerGroups => {
|
|
322
|
-
return [...headerGroups].reverse();
|
|
323
|
-
}, getMemoOptions(table.options, debug));
|
|
324
|
-
|
|
325
|
-
// Flat Headers
|
|
326
|
-
|
|
327
|
-
table.getFlatHeaders = memo(() => [table.getHeaderGroups()], headerGroups => {
|
|
328
|
-
return headerGroups.map(headerGroup => {
|
|
329
|
-
return headerGroup.headers;
|
|
330
|
-
}).flat();
|
|
331
|
-
}, getMemoOptions(table.options, debug));
|
|
332
|
-
table.getLeftFlatHeaders = memo(() => [table.getLeftHeaderGroups()], left => {
|
|
333
|
-
return left.map(headerGroup => {
|
|
334
|
-
return headerGroup.headers;
|
|
335
|
-
}).flat();
|
|
336
|
-
}, getMemoOptions(table.options, debug));
|
|
337
|
-
table.getCenterFlatHeaders = memo(() => [table.getCenterHeaderGroups()], left => {
|
|
338
|
-
return left.map(headerGroup => {
|
|
339
|
-
return headerGroup.headers;
|
|
340
|
-
}).flat();
|
|
341
|
-
}, getMemoOptions(table.options, debug));
|
|
342
|
-
table.getRightFlatHeaders = memo(() => [table.getRightHeaderGroups()], left => {
|
|
343
|
-
return left.map(headerGroup => {
|
|
344
|
-
return headerGroup.headers;
|
|
345
|
-
}).flat();
|
|
346
|
-
}, getMemoOptions(table.options, debug));
|
|
347
|
-
|
|
348
|
-
// Leaf Headers
|
|
349
|
-
|
|
350
|
-
table.getCenterLeafHeaders = memo(() => [table.getCenterFlatHeaders()], flatHeaders => {
|
|
351
|
-
return flatHeaders.filter(header => {
|
|
352
|
-
var _header$subHeaders;
|
|
353
|
-
return !((_header$subHeaders = header.subHeaders) != null && _header$subHeaders.length);
|
|
354
|
-
});
|
|
355
|
-
}, getMemoOptions(table.options, debug));
|
|
356
|
-
table.getLeftLeafHeaders = memo(() => [table.getLeftFlatHeaders()], flatHeaders => {
|
|
357
|
-
return flatHeaders.filter(header => {
|
|
358
|
-
var _header$subHeaders2;
|
|
359
|
-
return !((_header$subHeaders2 = header.subHeaders) != null && _header$subHeaders2.length);
|
|
360
|
-
});
|
|
361
|
-
}, getMemoOptions(table.options, debug));
|
|
362
|
-
table.getRightLeafHeaders = memo(() => [table.getRightFlatHeaders()], flatHeaders => {
|
|
363
|
-
return flatHeaders.filter(header => {
|
|
364
|
-
var _header$subHeaders3;
|
|
365
|
-
return !((_header$subHeaders3 = header.subHeaders) != null && _header$subHeaders3.length);
|
|
366
|
-
});
|
|
367
|
-
}, getMemoOptions(table.options, debug));
|
|
368
|
-
table.getLeafHeaders = memo(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {
|
|
369
|
-
var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
|
|
370
|
-
return [...((_left$0$headers = (_left$ = left[0]) == null ? void 0 : _left$.headers) != null ? _left$0$headers : []), ...((_center$0$headers = (_center$ = center[0]) == null ? void 0 : _center$.headers) != null ? _center$0$headers : []), ...((_right$0$headers = (_right$ = right[0]) == null ? void 0 : _right$.headers) != null ? _right$0$headers : [])].map(header => {
|
|
371
|
-
return header.getLeafHeaders();
|
|
372
|
-
}).flat();
|
|
373
|
-
}, getMemoOptions(table.options, debug));
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
|
|
377
|
-
var _headerGroups$0$heade, _headerGroups$;
|
|
378
|
-
// Find the max depth of the columns:
|
|
379
|
-
// build the leaf column row
|
|
380
|
-
// build each buffer row going up
|
|
381
|
-
// placeholder for non-existent level
|
|
382
|
-
// real column for existing level
|
|
383
|
-
|
|
384
|
-
let maxDepth = 0;
|
|
385
|
-
const findMaxDepth = function (columns, depth) {
|
|
386
|
-
if (depth === void 0) {
|
|
387
|
-
depth = 1;
|
|
388
|
-
}
|
|
389
|
-
maxDepth = Math.max(maxDepth, depth);
|
|
390
|
-
columns.filter(column => column.getIsVisible()).forEach(column => {
|
|
391
|
-
var _column$columns;
|
|
392
|
-
if ((_column$columns = column.columns) != null && _column$columns.length) {
|
|
393
|
-
findMaxDepth(column.columns, depth + 1);
|
|
394
|
-
}
|
|
395
|
-
}, 0);
|
|
396
|
-
};
|
|
397
|
-
findMaxDepth(allColumns);
|
|
398
|
-
let headerGroups = [];
|
|
399
|
-
const createHeaderGroup = (headersToGroup, depth) => {
|
|
400
|
-
// The header group we are creating
|
|
401
|
-
const headerGroup = {
|
|
402
|
-
depth,
|
|
403
|
-
id: [headerFamily, `${depth}`].filter(Boolean).join('_'),
|
|
404
|
-
headers: []
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
// The parent columns we're going to scan next
|
|
408
|
-
const pendingParentHeaders = [];
|
|
409
|
-
|
|
410
|
-
// Scan each column for parents
|
|
411
|
-
headersToGroup.forEach(headerToGroup => {
|
|
412
|
-
// What is the latest (last) parent column?
|
|
413
|
-
|
|
414
|
-
const latestPendingParentHeader = [...pendingParentHeaders].reverse()[0];
|
|
415
|
-
const isLeafHeader = headerToGroup.column.depth === headerGroup.depth;
|
|
416
|
-
let column;
|
|
417
|
-
let isPlaceholder = false;
|
|
418
|
-
if (isLeafHeader && headerToGroup.column.parent) {
|
|
419
|
-
// The parent header is new
|
|
420
|
-
column = headerToGroup.column.parent;
|
|
421
|
-
} else {
|
|
422
|
-
// The parent header is repeated
|
|
423
|
-
column = headerToGroup.column;
|
|
424
|
-
isPlaceholder = true;
|
|
425
|
-
}
|
|
426
|
-
if (latestPendingParentHeader && (latestPendingParentHeader == null ? void 0 : latestPendingParentHeader.column) === column) {
|
|
427
|
-
// This column is repeated. Add it as a sub header to the next batch
|
|
428
|
-
latestPendingParentHeader.subHeaders.push(headerToGroup);
|
|
429
|
-
} else {
|
|
430
|
-
// This is a new header. Let's create it
|
|
431
|
-
const header = createHeader(table, column, {
|
|
432
|
-
id: [headerFamily, depth, column.id, headerToGroup == null ? void 0 : headerToGroup.id].filter(Boolean).join('_'),
|
|
433
|
-
isPlaceholder,
|
|
434
|
-
placeholderId: isPlaceholder ? `${pendingParentHeaders.filter(d => d.column === column).length}` : undefined,
|
|
435
|
-
depth,
|
|
436
|
-
index: pendingParentHeaders.length
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
// Add the headerToGroup as a subHeader of the new header
|
|
440
|
-
header.subHeaders.push(headerToGroup);
|
|
441
|
-
// Add the new header to the pendingParentHeaders to get grouped
|
|
442
|
-
// in the next batch
|
|
443
|
-
pendingParentHeaders.push(header);
|
|
444
|
-
}
|
|
445
|
-
headerGroup.headers.push(headerToGroup);
|
|
446
|
-
headerToGroup.headerGroup = headerGroup;
|
|
447
|
-
});
|
|
448
|
-
headerGroups.push(headerGroup);
|
|
449
|
-
if (depth > 0) {
|
|
450
|
-
createHeaderGroup(pendingParentHeaders, depth - 1);
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
const bottomHeaders = columnsToGroup.map((column, index) => createHeader(table, column, {
|
|
454
|
-
depth: maxDepth,
|
|
455
|
-
index
|
|
456
|
-
}));
|
|
457
|
-
createHeaderGroup(bottomHeaders, maxDepth - 1);
|
|
458
|
-
headerGroups.reverse();
|
|
459
|
-
|
|
460
|
-
// headerGroups = headerGroups.filter(headerGroup => {
|
|
461
|
-
// return !headerGroup.headers.every(header => header.isPlaceholder)
|
|
462
|
-
// })
|
|
463
|
-
|
|
464
|
-
const recurseHeadersForSpans = headers => {
|
|
465
|
-
const filteredHeaders = headers.filter(header => header.column.getIsVisible());
|
|
466
|
-
return filteredHeaders.map(header => {
|
|
467
|
-
let colSpan = 0;
|
|
468
|
-
let rowSpan = 0;
|
|
469
|
-
let childRowSpans = [0];
|
|
470
|
-
if (header.subHeaders && header.subHeaders.length) {
|
|
471
|
-
childRowSpans = [];
|
|
472
|
-
recurseHeadersForSpans(header.subHeaders).forEach(_ref => {
|
|
473
|
-
let {
|
|
474
|
-
colSpan: childColSpan,
|
|
475
|
-
rowSpan: childRowSpan
|
|
476
|
-
} = _ref;
|
|
477
|
-
colSpan += childColSpan;
|
|
478
|
-
childRowSpans.push(childRowSpan);
|
|
479
|
-
});
|
|
480
|
-
} else {
|
|
481
|
-
colSpan = 1;
|
|
482
|
-
}
|
|
483
|
-
const minChildRowSpan = Math.min(...childRowSpans);
|
|
484
|
-
rowSpan = rowSpan + minChildRowSpan;
|
|
485
|
-
header.colSpan = colSpan;
|
|
486
|
-
header.rowSpan = rowSpan;
|
|
487
|
-
return {
|
|
488
|
-
colSpan,
|
|
489
|
-
rowSpan
|
|
490
|
-
};
|
|
491
|
-
});
|
|
492
|
-
};
|
|
493
|
-
recurseHeadersForSpans((_headerGroups$0$heade = (_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) != null ? _headerGroups$0$heade : []);
|
|
494
|
-
return headerGroups;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
const createRow = (table, id, original, rowIndex, depth, subRows, parentId) => {
|
|
498
|
-
let row = {
|
|
499
|
-
id,
|
|
500
|
-
index: rowIndex,
|
|
501
|
-
original,
|
|
502
|
-
depth,
|
|
503
|
-
parentId,
|
|
504
|
-
_valuesCache: {},
|
|
505
|
-
_uniqueValuesCache: {},
|
|
506
|
-
getValue: columnId => {
|
|
507
|
-
if (row._valuesCache.hasOwnProperty(columnId)) {
|
|
508
|
-
return row._valuesCache[columnId];
|
|
509
|
-
}
|
|
510
|
-
const column = table.getColumn(columnId);
|
|
511
|
-
if (!(column != null && column.accessorFn)) {
|
|
512
|
-
return undefined;
|
|
513
|
-
}
|
|
514
|
-
row._valuesCache[columnId] = column.accessorFn(row.original, rowIndex);
|
|
515
|
-
return row._valuesCache[columnId];
|
|
516
|
-
},
|
|
517
|
-
getUniqueValues: columnId => {
|
|
518
|
-
if (row._uniqueValuesCache.hasOwnProperty(columnId)) {
|
|
519
|
-
return row._uniqueValuesCache[columnId];
|
|
520
|
-
}
|
|
521
|
-
const column = table.getColumn(columnId);
|
|
522
|
-
if (!(column != null && column.accessorFn)) {
|
|
523
|
-
return undefined;
|
|
524
|
-
}
|
|
525
|
-
if (!column.columnDef.getUniqueValues) {
|
|
526
|
-
row._uniqueValuesCache[columnId] = [row.getValue(columnId)];
|
|
527
|
-
return row._uniqueValuesCache[columnId];
|
|
528
|
-
}
|
|
529
|
-
row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(row.original, rowIndex);
|
|
530
|
-
return row._uniqueValuesCache[columnId];
|
|
531
|
-
},
|
|
532
|
-
renderValue: columnId => {
|
|
533
|
-
var _row$getValue;
|
|
534
|
-
return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;
|
|
535
|
-
},
|
|
536
|
-
subRows: [],
|
|
537
|
-
getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
|
|
538
|
-
getParentRow: () => row.parentId ? table.getRow(row.parentId, true) : undefined,
|
|
539
|
-
getParentRows: () => {
|
|
540
|
-
let parentRows = [];
|
|
541
|
-
let currentRow = row;
|
|
542
|
-
while (true) {
|
|
543
|
-
const parentRow = currentRow.getParentRow();
|
|
544
|
-
if (!parentRow) break;
|
|
545
|
-
parentRows.push(parentRow);
|
|
546
|
-
currentRow = parentRow;
|
|
547
|
-
}
|
|
548
|
-
return parentRows.reverse();
|
|
549
|
-
},
|
|
550
|
-
getAllCells: memo(() => [table.getAllLeafColumns()], leafColumns => {
|
|
551
|
-
return leafColumns.map(column => {
|
|
552
|
-
return createCell(table, row, column, column.id);
|
|
553
|
-
});
|
|
554
|
-
}, getMemoOptions(table.options, 'debugRows')),
|
|
555
|
-
_getAllCellsByColumnId: memo(() => [row.getAllCells()], allCells => {
|
|
556
|
-
return allCells.reduce((acc, cell) => {
|
|
557
|
-
acc[cell.column.id] = cell;
|
|
558
|
-
return acc;
|
|
559
|
-
}, {});
|
|
560
|
-
}, getMemoOptions(table.options, 'debugRows'))
|
|
561
|
-
};
|
|
562
|
-
for (let i = 0; i < table._features.length; i++) {
|
|
563
|
-
const feature = table._features[i];
|
|
564
|
-
feature == null || feature.createRow == null || feature.createRow(row, table);
|
|
565
|
-
}
|
|
566
|
-
return row;
|
|
567
|
-
};
|
|
568
|
-
|
|
569
|
-
//
|
|
570
|
-
|
|
571
|
-
const ColumnFaceting = {
|
|
572
|
-
createColumn: (column, table) => {
|
|
573
|
-
column._getFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, column.id);
|
|
574
|
-
column.getFacetedRowModel = () => {
|
|
575
|
-
if (!column._getFacetedRowModel) {
|
|
576
|
-
return table.getPreFilteredRowModel();
|
|
577
|
-
}
|
|
578
|
-
return column._getFacetedRowModel();
|
|
579
|
-
};
|
|
580
|
-
column._getFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, column.id);
|
|
581
|
-
column.getFacetedUniqueValues = () => {
|
|
582
|
-
if (!column._getFacetedUniqueValues) {
|
|
583
|
-
return new Map();
|
|
584
|
-
}
|
|
585
|
-
return column._getFacetedUniqueValues();
|
|
586
|
-
};
|
|
587
|
-
column._getFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, column.id);
|
|
588
|
-
column.getFacetedMinMaxValues = () => {
|
|
589
|
-
if (!column._getFacetedMinMaxValues) {
|
|
590
|
-
return undefined;
|
|
591
|
-
}
|
|
592
|
-
return column._getFacetedMinMaxValues();
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
const includesString = (row, columnId, filterValue) => {
|
|
598
|
-
var _filterValue$toString, _row$getValue;
|
|
599
|
-
const search = filterValue == null || (_filterValue$toString = filterValue.toString()) == null ? void 0 : _filterValue$toString.toLowerCase();
|
|
600
|
-
return Boolean((_row$getValue = row.getValue(columnId)) == null || (_row$getValue = _row$getValue.toString()) == null || (_row$getValue = _row$getValue.toLowerCase()) == null ? void 0 : _row$getValue.includes(search));
|
|
601
|
-
};
|
|
602
|
-
includesString.autoRemove = val => testFalsey(val);
|
|
603
|
-
const includesStringSensitive = (row, columnId, filterValue) => {
|
|
604
|
-
var _row$getValue2;
|
|
605
|
-
return Boolean((_row$getValue2 = row.getValue(columnId)) == null || (_row$getValue2 = _row$getValue2.toString()) == null ? void 0 : _row$getValue2.includes(filterValue));
|
|
606
|
-
};
|
|
607
|
-
includesStringSensitive.autoRemove = val => testFalsey(val);
|
|
608
|
-
const equalsString = (row, columnId, filterValue) => {
|
|
609
|
-
var _row$getValue3;
|
|
610
|
-
return ((_row$getValue3 = row.getValue(columnId)) == null || (_row$getValue3 = _row$getValue3.toString()) == null ? void 0 : _row$getValue3.toLowerCase()) === (filterValue == null ? void 0 : filterValue.toLowerCase());
|
|
611
|
-
};
|
|
612
|
-
equalsString.autoRemove = val => testFalsey(val);
|
|
613
|
-
const arrIncludes = (row, columnId, filterValue) => {
|
|
614
|
-
var _row$getValue4;
|
|
615
|
-
return (_row$getValue4 = row.getValue(columnId)) == null ? void 0 : _row$getValue4.includes(filterValue);
|
|
616
|
-
};
|
|
617
|
-
arrIncludes.autoRemove = val => testFalsey(val);
|
|
618
|
-
const arrIncludesAll = (row, columnId, filterValue) => {
|
|
619
|
-
return !filterValue.some(val => {
|
|
620
|
-
var _row$getValue5;
|
|
621
|
-
return !((_row$getValue5 = row.getValue(columnId)) != null && _row$getValue5.includes(val));
|
|
622
|
-
});
|
|
623
|
-
};
|
|
624
|
-
arrIncludesAll.autoRemove = val => testFalsey(val) || !(val != null && val.length);
|
|
625
|
-
const arrIncludesSome = (row, columnId, filterValue) => {
|
|
626
|
-
return filterValue.some(val => {
|
|
627
|
-
var _row$getValue6;
|
|
628
|
-
return (_row$getValue6 = row.getValue(columnId)) == null ? void 0 : _row$getValue6.includes(val);
|
|
629
|
-
});
|
|
630
|
-
};
|
|
631
|
-
arrIncludesSome.autoRemove = val => testFalsey(val) || !(val != null && val.length);
|
|
632
|
-
const equals = (row, columnId, filterValue) => {
|
|
633
|
-
return row.getValue(columnId) === filterValue;
|
|
634
|
-
};
|
|
635
|
-
equals.autoRemove = val => testFalsey(val);
|
|
636
|
-
const weakEquals = (row, columnId, filterValue) => {
|
|
637
|
-
return row.getValue(columnId) == filterValue;
|
|
638
|
-
};
|
|
639
|
-
weakEquals.autoRemove = val => testFalsey(val);
|
|
640
|
-
const inNumberRange = (row, columnId, filterValue) => {
|
|
641
|
-
let [min, max] = filterValue;
|
|
642
|
-
const rowValue = row.getValue(columnId);
|
|
643
|
-
return rowValue >= min && rowValue <= max;
|
|
644
|
-
};
|
|
645
|
-
inNumberRange.resolveFilterValue = val => {
|
|
646
|
-
let [unsafeMin, unsafeMax] = val;
|
|
647
|
-
let parsedMin = typeof unsafeMin !== 'number' ? parseFloat(unsafeMin) : unsafeMin;
|
|
648
|
-
let parsedMax = typeof unsafeMax !== 'number' ? parseFloat(unsafeMax) : unsafeMax;
|
|
649
|
-
let min = unsafeMin === null || Number.isNaN(parsedMin) ? -Infinity : parsedMin;
|
|
650
|
-
let max = unsafeMax === null || Number.isNaN(parsedMax) ? Infinity : parsedMax;
|
|
651
|
-
if (min > max) {
|
|
652
|
-
const temp = min;
|
|
653
|
-
min = max;
|
|
654
|
-
max = temp;
|
|
655
|
-
}
|
|
656
|
-
return [min, max];
|
|
657
|
-
};
|
|
658
|
-
inNumberRange.autoRemove = val => testFalsey(val) || testFalsey(val[0]) && testFalsey(val[1]);
|
|
659
|
-
|
|
660
|
-
// Export
|
|
661
|
-
|
|
662
|
-
const filterFns = {
|
|
663
|
-
includesString,
|
|
664
|
-
includesStringSensitive,
|
|
665
|
-
equalsString,
|
|
666
|
-
arrIncludes,
|
|
667
|
-
arrIncludesAll,
|
|
668
|
-
arrIncludesSome,
|
|
669
|
-
equals,
|
|
670
|
-
weakEquals,
|
|
671
|
-
inNumberRange
|
|
672
|
-
};
|
|
673
|
-
// Utils
|
|
674
|
-
|
|
675
|
-
function testFalsey(val) {
|
|
676
|
-
return val === undefined || val === null || val === '';
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
//
|
|
680
|
-
|
|
681
|
-
const ColumnFiltering = {
|
|
682
|
-
getDefaultColumnDef: () => {
|
|
683
|
-
return {
|
|
684
|
-
filterFn: 'auto'
|
|
685
|
-
};
|
|
686
|
-
},
|
|
687
|
-
getInitialState: state => {
|
|
688
|
-
return {
|
|
689
|
-
columnFilters: [],
|
|
690
|
-
...state
|
|
691
|
-
};
|
|
692
|
-
},
|
|
693
|
-
getDefaultOptions: table => {
|
|
694
|
-
return {
|
|
695
|
-
onColumnFiltersChange: makeStateUpdater('columnFilters', table),
|
|
696
|
-
filterFromLeafRows: false,
|
|
697
|
-
maxLeafRowFilterDepth: 100
|
|
698
|
-
};
|
|
699
|
-
},
|
|
700
|
-
createColumn: (column, table) => {
|
|
701
|
-
column.getAutoFilterFn = () => {
|
|
702
|
-
const firstRow = table.getCoreRowModel().flatRows[0];
|
|
703
|
-
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
704
|
-
if (typeof value === 'string') {
|
|
705
|
-
return filterFns.includesString;
|
|
706
|
-
}
|
|
707
|
-
if (typeof value === 'number') {
|
|
708
|
-
return filterFns.inNumberRange;
|
|
709
|
-
}
|
|
710
|
-
if (typeof value === 'boolean') {
|
|
711
|
-
return filterFns.equals;
|
|
712
|
-
}
|
|
713
|
-
if (value !== null && typeof value === 'object') {
|
|
714
|
-
return filterFns.equals;
|
|
715
|
-
}
|
|
716
|
-
if (Array.isArray(value)) {
|
|
717
|
-
return filterFns.arrIncludes;
|
|
718
|
-
}
|
|
719
|
-
return filterFns.weakEquals;
|
|
720
|
-
};
|
|
721
|
-
column.getFilterFn = () => {
|
|
722
|
-
var _table$options$filter, _table$options$filter2;
|
|
723
|
-
return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn() : // @ts-ignore
|
|
724
|
-
(_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[column.columnDef.filterFn]) != null ? _table$options$filter : filterFns[column.columnDef.filterFn];
|
|
725
|
-
};
|
|
726
|
-
column.getCanFilter = () => {
|
|
727
|
-
var _column$columnDef$ena, _table$options$enable, _table$options$enable2;
|
|
728
|
-
return ((_column$columnDef$ena = column.columnDef.enableColumnFilter) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnFilters) != null ? _table$options$enable : true) && ((_table$options$enable2 = table.options.enableFilters) != null ? _table$options$enable2 : true) && !!column.accessorFn;
|
|
729
|
-
};
|
|
730
|
-
column.getIsFiltered = () => column.getFilterIndex() > -1;
|
|
731
|
-
column.getFilterValue = () => {
|
|
732
|
-
var _table$getState$colum;
|
|
733
|
-
return (_table$getState$colum = table.getState().columnFilters) == null || (_table$getState$colum = _table$getState$colum.find(d => d.id === column.id)) == null ? void 0 : _table$getState$colum.value;
|
|
734
|
-
};
|
|
735
|
-
column.getFilterIndex = () => {
|
|
736
|
-
var _table$getState$colum2, _table$getState$colum3;
|
|
737
|
-
return (_table$getState$colum2 = (_table$getState$colum3 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum3.findIndex(d => d.id === column.id)) != null ? _table$getState$colum2 : -1;
|
|
738
|
-
};
|
|
739
|
-
column.setFilterValue = value => {
|
|
740
|
-
table.setColumnFilters(old => {
|
|
741
|
-
const filterFn = column.getFilterFn();
|
|
742
|
-
const previousFilter = old == null ? void 0 : old.find(d => d.id === column.id);
|
|
743
|
-
const newFilter = functionalUpdate(value, previousFilter ? previousFilter.value : undefined);
|
|
744
|
-
|
|
745
|
-
//
|
|
746
|
-
if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
|
|
747
|
-
var _old$filter;
|
|
748
|
-
return (_old$filter = old == null ? void 0 : old.filter(d => d.id !== column.id)) != null ? _old$filter : [];
|
|
749
|
-
}
|
|
750
|
-
const newFilterObj = {
|
|
751
|
-
id: column.id,
|
|
752
|
-
value: newFilter
|
|
753
|
-
};
|
|
754
|
-
if (previousFilter) {
|
|
755
|
-
var _old$map;
|
|
756
|
-
return (_old$map = old == null ? void 0 : old.map(d => {
|
|
757
|
-
if (d.id === column.id) {
|
|
758
|
-
return newFilterObj;
|
|
759
|
-
}
|
|
760
|
-
return d;
|
|
761
|
-
})) != null ? _old$map : [];
|
|
762
|
-
}
|
|
763
|
-
if (old != null && old.length) {
|
|
764
|
-
return [...old, newFilterObj];
|
|
765
|
-
}
|
|
766
|
-
return [newFilterObj];
|
|
767
|
-
});
|
|
768
|
-
};
|
|
769
|
-
},
|
|
770
|
-
createRow: (row, _table) => {
|
|
771
|
-
row.columnFilters = {};
|
|
772
|
-
row.columnFiltersMeta = {};
|
|
773
|
-
},
|
|
774
|
-
createTable: table => {
|
|
775
|
-
table.setColumnFilters = updater => {
|
|
776
|
-
const leafColumns = table.getAllLeafColumns();
|
|
777
|
-
const updateFn = old => {
|
|
778
|
-
var _functionalUpdate;
|
|
779
|
-
return (_functionalUpdate = functionalUpdate(updater, old)) == null ? void 0 : _functionalUpdate.filter(filter => {
|
|
780
|
-
const column = leafColumns.find(d => d.id === filter.id);
|
|
781
|
-
if (column) {
|
|
782
|
-
const filterFn = column.getFilterFn();
|
|
783
|
-
if (shouldAutoRemoveFilter(filterFn, filter.value, column)) {
|
|
784
|
-
return false;
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
return true;
|
|
788
|
-
});
|
|
789
|
-
};
|
|
790
|
-
table.options.onColumnFiltersChange == null || table.options.onColumnFiltersChange(updateFn);
|
|
791
|
-
};
|
|
792
|
-
table.resetColumnFilters = defaultState => {
|
|
793
|
-
var _table$initialState$c, _table$initialState;
|
|
794
|
-
table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);
|
|
795
|
-
};
|
|
796
|
-
table.getPreFilteredRowModel = () => table.getCoreRowModel();
|
|
797
|
-
table.getFilteredRowModel = () => {
|
|
798
|
-
if (!table._getFilteredRowModel && table.options.getFilteredRowModel) {
|
|
799
|
-
table._getFilteredRowModel = table.options.getFilteredRowModel(table);
|
|
800
|
-
}
|
|
801
|
-
if (table.options.manualFiltering || !table._getFilteredRowModel) {
|
|
802
|
-
return table.getPreFilteredRowModel();
|
|
803
|
-
}
|
|
804
|
-
return table._getFilteredRowModel();
|
|
805
|
-
};
|
|
806
|
-
}
|
|
807
|
-
};
|
|
808
|
-
function shouldAutoRemoveFilter(filterFn, value, column) {
|
|
809
|
-
return (filterFn && filterFn.autoRemove ? filterFn.autoRemove(value, column) : false) || typeof value === 'undefined' || typeof value === 'string' && !value;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
const sum = (columnId, _leafRows, childRows) => {
|
|
813
|
-
// It's faster to just add the aggregations together instead of
|
|
814
|
-
// process leaf nodes individually
|
|
815
|
-
return childRows.reduce((sum, next) => {
|
|
816
|
-
const nextValue = next.getValue(columnId);
|
|
817
|
-
return sum + (typeof nextValue === 'number' ? nextValue : 0);
|
|
818
|
-
}, 0);
|
|
819
|
-
};
|
|
820
|
-
const min = (columnId, _leafRows, childRows) => {
|
|
821
|
-
let min;
|
|
822
|
-
childRows.forEach(row => {
|
|
823
|
-
const value = row.getValue(columnId);
|
|
824
|
-
if (value != null && (min > value || min === undefined && value >= value)) {
|
|
825
|
-
min = value;
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
return min;
|
|
829
|
-
};
|
|
830
|
-
const max = (columnId, _leafRows, childRows) => {
|
|
831
|
-
let max;
|
|
832
|
-
childRows.forEach(row => {
|
|
833
|
-
const value = row.getValue(columnId);
|
|
834
|
-
if (value != null && (max < value || max === undefined && value >= value)) {
|
|
835
|
-
max = value;
|
|
836
|
-
}
|
|
837
|
-
});
|
|
838
|
-
return max;
|
|
839
|
-
};
|
|
840
|
-
const extent = (columnId, _leafRows, childRows) => {
|
|
841
|
-
let min;
|
|
842
|
-
let max;
|
|
843
|
-
childRows.forEach(row => {
|
|
844
|
-
const value = row.getValue(columnId);
|
|
845
|
-
if (value != null) {
|
|
846
|
-
if (min === undefined) {
|
|
847
|
-
if (value >= value) min = max = value;
|
|
848
|
-
} else {
|
|
849
|
-
if (min > value) min = value;
|
|
850
|
-
if (max < value) max = value;
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
return [min, max];
|
|
855
|
-
};
|
|
856
|
-
const mean = (columnId, leafRows) => {
|
|
857
|
-
let count = 0;
|
|
858
|
-
let sum = 0;
|
|
859
|
-
leafRows.forEach(row => {
|
|
860
|
-
let value = row.getValue(columnId);
|
|
861
|
-
if (value != null && (value = +value) >= value) {
|
|
862
|
-
++count, sum += value;
|
|
863
|
-
}
|
|
864
|
-
});
|
|
865
|
-
if (count) return sum / count;
|
|
866
|
-
return;
|
|
867
|
-
};
|
|
868
|
-
const median = (columnId, leafRows) => {
|
|
869
|
-
if (!leafRows.length) {
|
|
870
|
-
return;
|
|
871
|
-
}
|
|
872
|
-
const values = leafRows.map(row => row.getValue(columnId));
|
|
873
|
-
if (!isNumberArray(values)) {
|
|
874
|
-
return;
|
|
875
|
-
}
|
|
876
|
-
if (values.length === 1) {
|
|
877
|
-
return values[0];
|
|
878
|
-
}
|
|
879
|
-
const mid = Math.floor(values.length / 2);
|
|
880
|
-
const nums = values.sort((a, b) => a - b);
|
|
881
|
-
return values.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;
|
|
882
|
-
};
|
|
883
|
-
const unique = (columnId, leafRows) => {
|
|
884
|
-
return Array.from(new Set(leafRows.map(d => d.getValue(columnId))).values());
|
|
885
|
-
};
|
|
886
|
-
const uniqueCount = (columnId, leafRows) => {
|
|
887
|
-
return new Set(leafRows.map(d => d.getValue(columnId))).size;
|
|
888
|
-
};
|
|
889
|
-
const count = (_columnId, leafRows) => {
|
|
890
|
-
return leafRows.length;
|
|
891
|
-
};
|
|
892
|
-
const aggregationFns = {
|
|
893
|
-
sum,
|
|
894
|
-
min,
|
|
895
|
-
max,
|
|
896
|
-
extent,
|
|
897
|
-
mean,
|
|
898
|
-
median,
|
|
899
|
-
unique,
|
|
900
|
-
uniqueCount,
|
|
901
|
-
count
|
|
902
|
-
};
|
|
903
|
-
|
|
904
|
-
//
|
|
905
|
-
|
|
906
|
-
const ColumnGrouping = {
|
|
907
|
-
getDefaultColumnDef: () => {
|
|
908
|
-
return {
|
|
909
|
-
aggregatedCell: props => {
|
|
910
|
-
var _toString, _props$getValue;
|
|
911
|
-
return (_toString = (_props$getValue = props.getValue()) == null || _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _toString : null;
|
|
912
|
-
},
|
|
913
|
-
aggregationFn: 'auto'
|
|
914
|
-
};
|
|
915
|
-
},
|
|
916
|
-
getInitialState: state => {
|
|
917
|
-
return {
|
|
918
|
-
grouping: [],
|
|
919
|
-
...state
|
|
920
|
-
};
|
|
921
|
-
},
|
|
922
|
-
getDefaultOptions: table => {
|
|
923
|
-
return {
|
|
924
|
-
onGroupingChange: makeStateUpdater('grouping', table),
|
|
925
|
-
groupedColumnMode: 'reorder'
|
|
926
|
-
};
|
|
927
|
-
},
|
|
928
|
-
createColumn: (column, table) => {
|
|
929
|
-
column.toggleGrouping = () => {
|
|
930
|
-
table.setGrouping(old => {
|
|
931
|
-
// Find any existing grouping for this column
|
|
932
|
-
if (old != null && old.includes(column.id)) {
|
|
933
|
-
return old.filter(d => d !== column.id);
|
|
934
|
-
}
|
|
935
|
-
return [...(old != null ? old : []), column.id];
|
|
936
|
-
});
|
|
937
|
-
};
|
|
938
|
-
column.getCanGroup = () => {
|
|
939
|
-
var _column$columnDef$ena, _table$options$enable;
|
|
940
|
-
return ((_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableGrouping) != null ? _table$options$enable : true) && (!!column.accessorFn || !!column.columnDef.getGroupingValue);
|
|
941
|
-
};
|
|
942
|
-
column.getIsGrouped = () => {
|
|
943
|
-
var _table$getState$group;
|
|
944
|
-
return (_table$getState$group = table.getState().grouping) == null ? void 0 : _table$getState$group.includes(column.id);
|
|
945
|
-
};
|
|
946
|
-
column.getGroupedIndex = () => {
|
|
947
|
-
var _table$getState$group2;
|
|
948
|
-
return (_table$getState$group2 = table.getState().grouping) == null ? void 0 : _table$getState$group2.indexOf(column.id);
|
|
949
|
-
};
|
|
950
|
-
column.getToggleGroupingHandler = () => {
|
|
951
|
-
const canGroup = column.getCanGroup();
|
|
952
|
-
return () => {
|
|
953
|
-
if (!canGroup) return;
|
|
954
|
-
column.toggleGrouping();
|
|
955
|
-
};
|
|
956
|
-
};
|
|
957
|
-
column.getAutoAggregationFn = () => {
|
|
958
|
-
const firstRow = table.getCoreRowModel().flatRows[0];
|
|
959
|
-
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
960
|
-
if (typeof value === 'number') {
|
|
961
|
-
return aggregationFns.sum;
|
|
962
|
-
}
|
|
963
|
-
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
964
|
-
return aggregationFns.extent;
|
|
965
|
-
}
|
|
966
|
-
};
|
|
967
|
-
column.getAggregationFn = () => {
|
|
968
|
-
var _table$options$aggreg, _table$options$aggreg2;
|
|
969
|
-
if (!column) {
|
|
970
|
-
throw new Error();
|
|
971
|
-
}
|
|
972
|
-
return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_table$options$aggreg = (_table$options$aggreg2 = table.options.aggregationFns) == null ? void 0 : _table$options$aggreg2[column.columnDef.aggregationFn]) != null ? _table$options$aggreg : aggregationFns[column.columnDef.aggregationFn];
|
|
973
|
-
};
|
|
974
|
-
},
|
|
975
|
-
createTable: table => {
|
|
976
|
-
table.setGrouping = updater => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater);
|
|
977
|
-
table.resetGrouping = defaultState => {
|
|
978
|
-
var _table$initialState$g, _table$initialState;
|
|
979
|
-
table.setGrouping(defaultState ? [] : (_table$initialState$g = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) != null ? _table$initialState$g : []);
|
|
980
|
-
};
|
|
981
|
-
table.getPreGroupedRowModel = () => table.getFilteredRowModel();
|
|
982
|
-
table.getGroupedRowModel = () => {
|
|
983
|
-
if (!table._getGroupedRowModel && table.options.getGroupedRowModel) {
|
|
984
|
-
table._getGroupedRowModel = table.options.getGroupedRowModel(table);
|
|
985
|
-
}
|
|
986
|
-
if (table.options.manualGrouping || !table._getGroupedRowModel) {
|
|
987
|
-
return table.getPreGroupedRowModel();
|
|
988
|
-
}
|
|
989
|
-
return table._getGroupedRowModel();
|
|
990
|
-
};
|
|
991
|
-
},
|
|
992
|
-
createRow: (row, table) => {
|
|
993
|
-
row.getIsGrouped = () => !!row.groupingColumnId;
|
|
994
|
-
row.getGroupingValue = columnId => {
|
|
995
|
-
if (row._groupingValuesCache.hasOwnProperty(columnId)) {
|
|
996
|
-
return row._groupingValuesCache[columnId];
|
|
997
|
-
}
|
|
998
|
-
const column = table.getColumn(columnId);
|
|
999
|
-
if (!(column != null && column.columnDef.getGroupingValue)) {
|
|
1000
|
-
return row.getValue(columnId);
|
|
1001
|
-
}
|
|
1002
|
-
row._groupingValuesCache[columnId] = column.columnDef.getGroupingValue(row.original);
|
|
1003
|
-
return row._groupingValuesCache[columnId];
|
|
1004
|
-
};
|
|
1005
|
-
row._groupingValuesCache = {};
|
|
1006
|
-
},
|
|
1007
|
-
createCell: (cell, column, row, table) => {
|
|
1008
|
-
cell.getIsGrouped = () => column.getIsGrouped() && column.id === row.groupingColumnId;
|
|
1009
|
-
cell.getIsPlaceholder = () => !cell.getIsGrouped() && column.getIsGrouped();
|
|
1010
|
-
cell.getIsAggregated = () => {
|
|
1011
|
-
var _row$subRows;
|
|
1012
|
-
return !cell.getIsGrouped() && !cell.getIsPlaceholder() && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
|
|
1013
|
-
};
|
|
1014
|
-
}
|
|
1015
|
-
};
|
|
1016
|
-
function orderColumns(leafColumns, grouping, groupedColumnMode) {
|
|
1017
|
-
if (!(grouping != null && grouping.length) || !groupedColumnMode) {
|
|
1018
|
-
return leafColumns;
|
|
1019
|
-
}
|
|
1020
|
-
const nonGroupingColumns = leafColumns.filter(col => !grouping.includes(col.id));
|
|
1021
|
-
if (groupedColumnMode === 'remove') {
|
|
1022
|
-
return nonGroupingColumns;
|
|
1023
|
-
}
|
|
1024
|
-
const groupingColumns = grouping.map(g => leafColumns.find(col => col.id === g)).filter(Boolean);
|
|
1025
|
-
return [...groupingColumns, ...nonGroupingColumns];
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
//
|
|
1029
|
-
|
|
1030
|
-
const ColumnOrdering = {
|
|
1031
|
-
getInitialState: state => {
|
|
1032
|
-
return {
|
|
1033
|
-
columnOrder: [],
|
|
1034
|
-
...state
|
|
1035
|
-
};
|
|
1036
|
-
},
|
|
1037
|
-
getDefaultOptions: table => {
|
|
1038
|
-
return {
|
|
1039
|
-
onColumnOrderChange: makeStateUpdater('columnOrder', table)
|
|
1040
|
-
};
|
|
1041
|
-
},
|
|
1042
|
-
createColumn: (column, table) => {
|
|
1043
|
-
column.getIndex = memo(position => [_getVisibleLeafColumns(table, position)], columns => columns.findIndex(d => d.id === column.id), getMemoOptions(table.options, 'debugColumns'));
|
|
1044
|
-
column.getIsFirstColumn = position => {
|
|
1045
|
-
var _columns$;
|
|
1046
|
-
const columns = _getVisibleLeafColumns(table, position);
|
|
1047
|
-
return ((_columns$ = columns[0]) == null ? void 0 : _columns$.id) === column.id;
|
|
1048
|
-
};
|
|
1049
|
-
column.getIsLastColumn = position => {
|
|
1050
|
-
var _columns;
|
|
1051
|
-
const columns = _getVisibleLeafColumns(table, position);
|
|
1052
|
-
return ((_columns = columns[columns.length - 1]) == null ? void 0 : _columns.id) === column.id;
|
|
1053
|
-
};
|
|
1054
|
-
},
|
|
1055
|
-
createTable: table => {
|
|
1056
|
-
table.setColumnOrder = updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater);
|
|
1057
|
-
table.resetColumnOrder = defaultState => {
|
|
1058
|
-
var _table$initialState$c;
|
|
1059
|
-
table.setColumnOrder(defaultState ? [] : (_table$initialState$c = table.initialState.columnOrder) != null ? _table$initialState$c : []);
|
|
1060
|
-
};
|
|
1061
|
-
table._getOrderColumnsFn = memo(() => [table.getState().columnOrder, table.getState().grouping, table.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => columns => {
|
|
1062
|
-
// Sort grouped columns to the start of the column list
|
|
1063
|
-
// before the headers are built
|
|
1064
|
-
let orderedColumns = [];
|
|
1065
|
-
|
|
1066
|
-
// If there is no order, return the normal columns
|
|
1067
|
-
if (!(columnOrder != null && columnOrder.length)) {
|
|
1068
|
-
orderedColumns = columns;
|
|
1069
|
-
} else {
|
|
1070
|
-
const columnOrderCopy = [...columnOrder];
|
|
1071
|
-
|
|
1072
|
-
// If there is an order, make a copy of the columns
|
|
1073
|
-
const columnsCopy = [...columns];
|
|
1074
|
-
|
|
1075
|
-
// And make a new ordered array of the columns
|
|
1076
|
-
|
|
1077
|
-
// Loop over the columns and place them in order into the new array
|
|
1078
|
-
while (columnsCopy.length && columnOrderCopy.length) {
|
|
1079
|
-
const targetColumnId = columnOrderCopy.shift();
|
|
1080
|
-
const foundIndex = columnsCopy.findIndex(d => d.id === targetColumnId);
|
|
1081
|
-
if (foundIndex > -1) {
|
|
1082
|
-
orderedColumns.push(columnsCopy.splice(foundIndex, 1)[0]);
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
// If there are any columns left, add them to the end
|
|
1087
|
-
orderedColumns = [...orderedColumns, ...columnsCopy];
|
|
1088
|
-
}
|
|
1089
|
-
return orderColumns(orderedColumns, grouping, groupedColumnMode);
|
|
1090
|
-
}, getMemoOptions(table.options, 'debugTable'));
|
|
1091
|
-
}
|
|
1092
|
-
};
|
|
1093
|
-
|
|
1094
|
-
//
|
|
1095
|
-
|
|
1096
|
-
const getDefaultColumnPinningState = () => ({
|
|
1097
|
-
left: [],
|
|
1098
|
-
right: []
|
|
1099
|
-
});
|
|
1100
|
-
const ColumnPinning = {
|
|
1101
|
-
getInitialState: state => {
|
|
1102
|
-
return {
|
|
1103
|
-
columnPinning: getDefaultColumnPinningState(),
|
|
1104
|
-
...state
|
|
1105
|
-
};
|
|
1106
|
-
},
|
|
1107
|
-
getDefaultOptions: table => {
|
|
1108
|
-
return {
|
|
1109
|
-
onColumnPinningChange: makeStateUpdater('columnPinning', table)
|
|
1110
|
-
};
|
|
1111
|
-
},
|
|
1112
|
-
createColumn: (column, table) => {
|
|
1113
|
-
column.pin = position => {
|
|
1114
|
-
const columnIds = column.getLeafColumns().map(d => d.id).filter(Boolean);
|
|
1115
|
-
table.setColumnPinning(old => {
|
|
1116
|
-
var _old$left3, _old$right3;
|
|
1117
|
-
if (position === 'right') {
|
|
1118
|
-
var _old$left, _old$right;
|
|
1119
|
-
return {
|
|
1120
|
-
left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter(d => !(columnIds != null && columnIds.includes(d))),
|
|
1121
|
-
right: [...((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]
|
|
1122
|
-
};
|
|
1123
|
-
}
|
|
1124
|
-
if (position === 'left') {
|
|
1125
|
-
var _old$left2, _old$right2;
|
|
1126
|
-
return {
|
|
1127
|
-
left: [...((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
|
|
1128
|
-
right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
|
|
1129
|
-
};
|
|
1130
|
-
}
|
|
1131
|
-
return {
|
|
1132
|
-
left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter(d => !(columnIds != null && columnIds.includes(d))),
|
|
1133
|
-
right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
|
|
1134
|
-
};
|
|
1135
|
-
});
|
|
1136
|
-
};
|
|
1137
|
-
column.getCanPin = () => {
|
|
1138
|
-
const leafColumns = column.getLeafColumns();
|
|
1139
|
-
return leafColumns.some(d => {
|
|
1140
|
-
var _d$columnDef$enablePi, _ref, _table$options$enable;
|
|
1141
|
-
return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_ref = (_table$options$enable = table.options.enableColumnPinning) != null ? _table$options$enable : table.options.enablePinning) != null ? _ref : true);
|
|
1142
|
-
});
|
|
1143
|
-
};
|
|
1144
|
-
column.getIsPinned = () => {
|
|
1145
|
-
const leafColumnIds = column.getLeafColumns().map(d => d.id);
|
|
1146
|
-
const {
|
|
1147
|
-
left,
|
|
1148
|
-
right
|
|
1149
|
-
} = table.getState().columnPinning;
|
|
1150
|
-
const isLeft = leafColumnIds.some(d => left == null ? void 0 : left.includes(d));
|
|
1151
|
-
const isRight = leafColumnIds.some(d => right == null ? void 0 : right.includes(d));
|
|
1152
|
-
return isLeft ? 'left' : isRight ? 'right' : false;
|
|
1153
|
-
};
|
|
1154
|
-
column.getPinnedIndex = () => {
|
|
1155
|
-
var _table$getState$colum, _table$getState$colum2;
|
|
1156
|
-
const position = column.getIsPinned();
|
|
1157
|
-
return position ? (_table$getState$colum = (_table$getState$colum2 = table.getState().columnPinning) == null || (_table$getState$colum2 = _table$getState$colum2[position]) == null ? void 0 : _table$getState$colum2.indexOf(column.id)) != null ? _table$getState$colum : -1 : 0;
|
|
1158
|
-
};
|
|
1159
|
-
},
|
|
1160
|
-
createRow: (row, table) => {
|
|
1161
|
-
row.getCenterVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {
|
|
1162
|
-
const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
|
|
1163
|
-
return allCells.filter(d => !leftAndRight.includes(d.column.id));
|
|
1164
|
-
}, getMemoOptions(table.options, 'debugRows'));
|
|
1165
|
-
row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left], (allCells, left) => {
|
|
1166
|
-
const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
|
|
1167
|
-
...d,
|
|
1168
|
-
position: 'left'
|
|
1169
|
-
}));
|
|
1170
|
-
return cells;
|
|
1171
|
-
}, getMemoOptions(table.options, 'debugRows'));
|
|
1172
|
-
row.getRightVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
|
|
1173
|
-
const cells = (right != null ? right : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
|
|
1174
|
-
...d,
|
|
1175
|
-
position: 'right'
|
|
1176
|
-
}));
|
|
1177
|
-
return cells;
|
|
1178
|
-
}, getMemoOptions(table.options, 'debugRows'));
|
|
1179
|
-
},
|
|
1180
|
-
createTable: table => {
|
|
1181
|
-
table.setColumnPinning = updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater);
|
|
1182
|
-
table.resetColumnPinning = defaultState => {
|
|
1183
|
-
var _table$initialState$c, _table$initialState;
|
|
1184
|
-
return table.setColumnPinning(defaultState ? getDefaultColumnPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultColumnPinningState());
|
|
1185
|
-
};
|
|
1186
|
-
table.getIsSomeColumnsPinned = position => {
|
|
1187
|
-
var _pinningState$positio;
|
|
1188
|
-
const pinningState = table.getState().columnPinning;
|
|
1189
|
-
if (!position) {
|
|
1190
|
-
var _pinningState$left, _pinningState$right;
|
|
1191
|
-
return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length));
|
|
1192
|
-
}
|
|
1193
|
-
return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
|
|
1194
|
-
};
|
|
1195
|
-
table.getLeftLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
|
|
1196
|
-
return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
|
|
1197
|
-
}, getMemoOptions(table.options, 'debugColumns'));
|
|
1198
|
-
table.getRightLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
|
|
1199
|
-
return (right != null ? right : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
|
|
1200
|
-
}, getMemoOptions(table.options, 'debugColumns'));
|
|
1201
|
-
table.getCenterLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
|
|
1202
|
-
const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
|
|
1203
|
-
return allColumns.filter(d => !leftAndRight.includes(d.id));
|
|
1204
|
-
}, getMemoOptions(table.options, 'debugColumns'));
|
|
1205
|
-
}
|
|
1206
|
-
};
|
|
1207
|
-
|
|
1208
|
-
function safelyAccessDocument(_document) {
|
|
1209
|
-
return _document || (typeof document !== 'undefined' ? document : null);
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
//
|
|
1213
|
-
|
|
1214
|
-
//
|
|
1215
|
-
|
|
1216
|
-
const defaultColumnSizing = {
|
|
1217
|
-
size: 150,
|
|
1218
|
-
minSize: 20,
|
|
1219
|
-
maxSize: Number.MAX_SAFE_INTEGER
|
|
1220
|
-
};
|
|
1221
|
-
const getDefaultColumnSizingInfoState = () => ({
|
|
1222
|
-
startOffset: null,
|
|
1223
|
-
startSize: null,
|
|
1224
|
-
deltaOffset: null,
|
|
1225
|
-
deltaPercentage: null,
|
|
1226
|
-
isResizingColumn: false,
|
|
1227
|
-
columnSizingStart: []
|
|
1228
|
-
});
|
|
1229
|
-
const ColumnSizing = {
|
|
1230
|
-
getDefaultColumnDef: () => {
|
|
1231
|
-
return defaultColumnSizing;
|
|
1232
|
-
},
|
|
1233
|
-
getInitialState: state => {
|
|
1234
|
-
return {
|
|
1235
|
-
columnSizing: {},
|
|
1236
|
-
columnSizingInfo: getDefaultColumnSizingInfoState(),
|
|
1237
|
-
...state
|
|
1238
|
-
};
|
|
1239
|
-
},
|
|
1240
|
-
getDefaultOptions: table => {
|
|
1241
|
-
return {
|
|
1242
|
-
columnResizeMode: 'onEnd',
|
|
1243
|
-
columnResizeDirection: 'ltr',
|
|
1244
|
-
onColumnSizingChange: makeStateUpdater('columnSizing', table),
|
|
1245
|
-
onColumnSizingInfoChange: makeStateUpdater('columnSizingInfo', table)
|
|
1246
|
-
};
|
|
1247
|
-
},
|
|
1248
|
-
createColumn: (column, table) => {
|
|
1249
|
-
column.getSize = () => {
|
|
1250
|
-
var _column$columnDef$min, _ref, _column$columnDef$max;
|
|
1251
|
-
const columnSize = table.getState().columnSizing[column.id];
|
|
1252
|
-
return Math.min(Math.max((_column$columnDef$min = column.columnDef.minSize) != null ? _column$columnDef$min : defaultColumnSizing.minSize, (_ref = columnSize != null ? columnSize : column.columnDef.size) != null ? _ref : defaultColumnSizing.size), (_column$columnDef$max = column.columnDef.maxSize) != null ? _column$columnDef$max : defaultColumnSizing.maxSize);
|
|
1253
|
-
};
|
|
1254
|
-
column.getStart = memo(position => [position, _getVisibleLeafColumns(table, position), table.getState().columnSizing], (position, columns) => columns.slice(0, column.getIndex(position)).reduce((sum, column) => sum + column.getSize(), 0), getMemoOptions(table.options, 'debugColumns'));
|
|
1255
|
-
column.getAfter = memo(position => [position, _getVisibleLeafColumns(table, position), table.getState().columnSizing], (position, columns) => columns.slice(column.getIndex(position) + 1).reduce((sum, column) => sum + column.getSize(), 0), getMemoOptions(table.options, 'debugColumns'));
|
|
1256
|
-
column.resetSize = () => {
|
|
1257
|
-
table.setColumnSizing(_ref2 => {
|
|
1258
|
-
let {
|
|
1259
|
-
[column.id]: _,
|
|
1260
|
-
...rest
|
|
1261
|
-
} = _ref2;
|
|
1262
|
-
return rest;
|
|
1263
|
-
});
|
|
1264
|
-
};
|
|
1265
|
-
column.getCanResize = () => {
|
|
1266
|
-
var _column$columnDef$ena, _table$options$enable;
|
|
1267
|
-
return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnResizing) != null ? _table$options$enable : true);
|
|
1268
|
-
};
|
|
1269
|
-
column.getIsResizing = () => {
|
|
1270
|
-
return table.getState().columnSizingInfo.isResizingColumn === column.id;
|
|
1271
|
-
};
|
|
1272
|
-
},
|
|
1273
|
-
createHeader: (header, table) => {
|
|
1274
|
-
header.getSize = () => {
|
|
1275
|
-
let sum = 0;
|
|
1276
|
-
const recurse = header => {
|
|
1277
|
-
if (header.subHeaders.length) {
|
|
1278
|
-
header.subHeaders.forEach(recurse);
|
|
1279
|
-
} else {
|
|
1280
|
-
var _header$column$getSiz;
|
|
1281
|
-
sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;
|
|
1282
|
-
}
|
|
1283
|
-
};
|
|
1284
|
-
recurse(header);
|
|
1285
|
-
return sum;
|
|
1286
|
-
};
|
|
1287
|
-
header.getStart = () => {
|
|
1288
|
-
if (header.index > 0) {
|
|
1289
|
-
const prevSiblingHeader = header.headerGroup.headers[header.index - 1];
|
|
1290
|
-
return prevSiblingHeader.getStart() + prevSiblingHeader.getSize();
|
|
1291
|
-
}
|
|
1292
|
-
return 0;
|
|
1293
|
-
};
|
|
1294
|
-
header.getResizeHandler = _contextDocument => {
|
|
1295
|
-
const column = table.getColumn(header.column.id);
|
|
1296
|
-
const canResize = column == null ? void 0 : column.getCanResize();
|
|
1297
|
-
return e => {
|
|
1298
|
-
if (!column || !canResize) {
|
|
1299
|
-
return;
|
|
1300
|
-
}
|
|
1301
|
-
e.persist == null || e.persist();
|
|
1302
|
-
if (isTouchStartEvent(e)) {
|
|
1303
|
-
// lets not respond to multiple touches (e.g. 2 or 3 fingers)
|
|
1304
|
-
if (e.touches && e.touches.length > 1) {
|
|
1305
|
-
return;
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
const startSize = header.getSize();
|
|
1309
|
-
const columnSizingStart = header ? header.getLeafHeaders().map(d => [d.column.id, d.column.getSize()]) : [[column.id, column.getSize()]];
|
|
1310
|
-
const clientX = isTouchStartEvent(e) ? Math.round(e.touches[0].clientX) : e.clientX;
|
|
1311
|
-
const newColumnSizing = {};
|
|
1312
|
-
const updateOffset = (eventType, clientXPos) => {
|
|
1313
|
-
if (typeof clientXPos !== 'number') {
|
|
1314
|
-
return;
|
|
1315
|
-
}
|
|
1316
|
-
table.setColumnSizingInfo(old => {
|
|
1317
|
-
var _old$startOffset, _old$startSize;
|
|
1318
|
-
const deltaDirection = table.options.columnResizeDirection === 'rtl' ? -1 : 1;
|
|
1319
|
-
const deltaOffset = (clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0)) * deltaDirection;
|
|
1320
|
-
const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
|
|
1321
|
-
old.columnSizingStart.forEach(_ref3 => {
|
|
1322
|
-
let [columnId, headerSize] = _ref3;
|
|
1323
|
-
newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
|
|
1324
|
-
});
|
|
1325
|
-
return {
|
|
1326
|
-
...old,
|
|
1327
|
-
deltaOffset,
|
|
1328
|
-
deltaPercentage
|
|
1329
|
-
};
|
|
1330
|
-
});
|
|
1331
|
-
if (table.options.columnResizeMode === 'onChange' || eventType === 'end') {
|
|
1332
|
-
table.setColumnSizing(old => ({
|
|
1333
|
-
...old,
|
|
1334
|
-
...newColumnSizing
|
|
1335
|
-
}));
|
|
1336
|
-
}
|
|
1337
|
-
};
|
|
1338
|
-
const onMove = clientXPos => updateOffset('move', clientXPos);
|
|
1339
|
-
const onEnd = clientXPos => {
|
|
1340
|
-
updateOffset('end', clientXPos);
|
|
1341
|
-
table.setColumnSizingInfo(old => ({
|
|
1342
|
-
...old,
|
|
1343
|
-
isResizingColumn: false,
|
|
1344
|
-
startOffset: null,
|
|
1345
|
-
startSize: null,
|
|
1346
|
-
deltaOffset: null,
|
|
1347
|
-
deltaPercentage: null,
|
|
1348
|
-
columnSizingStart: []
|
|
1349
|
-
}));
|
|
1350
|
-
};
|
|
1351
|
-
const contextDocument = safelyAccessDocument(_contextDocument);
|
|
1352
|
-
const mouseEvents = {
|
|
1353
|
-
moveHandler: e => onMove(e.clientX),
|
|
1354
|
-
upHandler: e => {
|
|
1355
|
-
contextDocument == null || contextDocument.removeEventListener('mousemove', mouseEvents.moveHandler);
|
|
1356
|
-
contextDocument == null || contextDocument.removeEventListener('mouseup', mouseEvents.upHandler);
|
|
1357
|
-
onEnd(e.clientX);
|
|
1358
|
-
}
|
|
1359
|
-
};
|
|
1360
|
-
const touchEvents = {
|
|
1361
|
-
moveHandler: e => {
|
|
1362
|
-
if (e.cancelable) {
|
|
1363
|
-
e.preventDefault();
|
|
1364
|
-
e.stopPropagation();
|
|
1365
|
-
}
|
|
1366
|
-
onMove(e.touches[0].clientX);
|
|
1367
|
-
return false;
|
|
1368
|
-
},
|
|
1369
|
-
upHandler: e => {
|
|
1370
|
-
var _e$touches$;
|
|
1371
|
-
contextDocument == null || contextDocument.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
1372
|
-
contextDocument == null || contextDocument.removeEventListener('touchend', touchEvents.upHandler);
|
|
1373
|
-
if (e.cancelable) {
|
|
1374
|
-
e.preventDefault();
|
|
1375
|
-
e.stopPropagation();
|
|
1376
|
-
}
|
|
1377
|
-
onEnd((_e$touches$ = e.touches[0]) == null ? void 0 : _e$touches$.clientX);
|
|
1378
|
-
}
|
|
1379
|
-
};
|
|
1380
|
-
const passiveIfSupported = passiveEventSupported() ? {
|
|
1381
|
-
passive: false
|
|
1382
|
-
} : false;
|
|
1383
|
-
if (isTouchStartEvent(e)) {
|
|
1384
|
-
contextDocument == null || contextDocument.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
1385
|
-
contextDocument == null || contextDocument.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
1386
|
-
} else {
|
|
1387
|
-
contextDocument == null || contextDocument.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
1388
|
-
contextDocument == null || contextDocument.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
1389
|
-
}
|
|
1390
|
-
table.setColumnSizingInfo(old => ({
|
|
1391
|
-
...old,
|
|
1392
|
-
startOffset: clientX,
|
|
1393
|
-
startSize,
|
|
1394
|
-
deltaOffset: 0,
|
|
1395
|
-
deltaPercentage: 0,
|
|
1396
|
-
columnSizingStart,
|
|
1397
|
-
isResizingColumn: column.id
|
|
1398
|
-
}));
|
|
1399
|
-
};
|
|
1400
|
-
};
|
|
1401
|
-
},
|
|
1402
|
-
createTable: table => {
|
|
1403
|
-
table.setColumnSizing = updater => table.options.onColumnSizingChange == null ? void 0 : table.options.onColumnSizingChange(updater);
|
|
1404
|
-
table.setColumnSizingInfo = updater => table.options.onColumnSizingInfoChange == null ? void 0 : table.options.onColumnSizingInfoChange(updater);
|
|
1405
|
-
table.resetColumnSizing = defaultState => {
|
|
1406
|
-
var _table$initialState$c;
|
|
1407
|
-
table.setColumnSizing(defaultState ? {} : (_table$initialState$c = table.initialState.columnSizing) != null ? _table$initialState$c : {});
|
|
1408
|
-
};
|
|
1409
|
-
table.resetHeaderSizeInfo = defaultState => {
|
|
1410
|
-
var _table$initialState$c2;
|
|
1411
|
-
table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_table$initialState$c2 = table.initialState.columnSizingInfo) != null ? _table$initialState$c2 : getDefaultColumnSizingInfoState());
|
|
1412
|
-
};
|
|
1413
|
-
table.getTotalSize = () => {
|
|
1414
|
-
var _table$getHeaderGroup, _table$getHeaderGroup2;
|
|
1415
|
-
return (_table$getHeaderGroup = (_table$getHeaderGroup2 = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup2.headers.reduce((sum, header) => {
|
|
1416
|
-
return sum + header.getSize();
|
|
1417
|
-
}, 0)) != null ? _table$getHeaderGroup : 0;
|
|
1418
|
-
};
|
|
1419
|
-
table.getLeftTotalSize = () => {
|
|
1420
|
-
var _table$getLeftHeaderG, _table$getLeftHeaderG2;
|
|
1421
|
-
return (_table$getLeftHeaderG = (_table$getLeftHeaderG2 = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG2.headers.reduce((sum, header) => {
|
|
1422
|
-
return sum + header.getSize();
|
|
1423
|
-
}, 0)) != null ? _table$getLeftHeaderG : 0;
|
|
1424
|
-
};
|
|
1425
|
-
table.getCenterTotalSize = () => {
|
|
1426
|
-
var _table$getCenterHeade, _table$getCenterHeade2;
|
|
1427
|
-
return (_table$getCenterHeade = (_table$getCenterHeade2 = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade2.headers.reduce((sum, header) => {
|
|
1428
|
-
return sum + header.getSize();
|
|
1429
|
-
}, 0)) != null ? _table$getCenterHeade : 0;
|
|
1430
|
-
};
|
|
1431
|
-
table.getRightTotalSize = () => {
|
|
1432
|
-
var _table$getRightHeader, _table$getRightHeader2;
|
|
1433
|
-
return (_table$getRightHeader = (_table$getRightHeader2 = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader2.headers.reduce((sum, header) => {
|
|
1434
|
-
return sum + header.getSize();
|
|
1435
|
-
}, 0)) != null ? _table$getRightHeader : 0;
|
|
1436
|
-
};
|
|
1437
|
-
}
|
|
1438
|
-
};
|
|
1439
|
-
let passiveSupported = null;
|
|
1440
|
-
function passiveEventSupported() {
|
|
1441
|
-
if (typeof passiveSupported === 'boolean') return passiveSupported;
|
|
1442
|
-
let supported = false;
|
|
1443
|
-
try {
|
|
1444
|
-
const options = {
|
|
1445
|
-
get passive() {
|
|
1446
|
-
supported = true;
|
|
1447
|
-
return false;
|
|
1448
|
-
}
|
|
1449
|
-
};
|
|
1450
|
-
const noop = () => {};
|
|
1451
|
-
window.addEventListener('test', noop, options);
|
|
1452
|
-
window.removeEventListener('test', noop);
|
|
1453
|
-
} catch (err) {
|
|
1454
|
-
supported = false;
|
|
1455
|
-
}
|
|
1456
|
-
passiveSupported = supported;
|
|
1457
|
-
return passiveSupported;
|
|
1458
|
-
}
|
|
1459
|
-
function isTouchStartEvent(e) {
|
|
1460
|
-
return e.type === 'touchstart';
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
//
|
|
1464
|
-
|
|
1465
|
-
const ColumnVisibility = {
|
|
1466
|
-
getInitialState: state => {
|
|
1467
|
-
return {
|
|
1468
|
-
columnVisibility: {},
|
|
1469
|
-
...state
|
|
1470
|
-
};
|
|
1471
|
-
},
|
|
1472
|
-
getDefaultOptions: table => {
|
|
1473
|
-
return {
|
|
1474
|
-
onColumnVisibilityChange: makeStateUpdater('columnVisibility', table)
|
|
1475
|
-
};
|
|
1476
|
-
},
|
|
1477
|
-
createColumn: (column, table) => {
|
|
1478
|
-
column.toggleVisibility = value => {
|
|
1479
|
-
if (column.getCanHide()) {
|
|
1480
|
-
table.setColumnVisibility(old => ({
|
|
1481
|
-
...old,
|
|
1482
|
-
[column.id]: value != null ? value : !column.getIsVisible()
|
|
1483
|
-
}));
|
|
1484
|
-
}
|
|
1485
|
-
};
|
|
1486
|
-
column.getIsVisible = () => {
|
|
1487
|
-
var _ref, _table$getState$colum;
|
|
1488
|
-
const childColumns = column.columns;
|
|
1489
|
-
return (_ref = childColumns.length ? childColumns.some(c => c.getIsVisible()) : (_table$getState$colum = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum[column.id]) != null ? _ref : true;
|
|
1490
|
-
};
|
|
1491
|
-
column.getCanHide = () => {
|
|
1492
|
-
var _column$columnDef$ena, _table$options$enable;
|
|
1493
|
-
return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);
|
|
1494
|
-
};
|
|
1495
|
-
column.getToggleVisibilityHandler = () => {
|
|
1496
|
-
return e => {
|
|
1497
|
-
column.toggleVisibility == null || column.toggleVisibility(e.target.checked);
|
|
1498
|
-
};
|
|
1499
|
-
};
|
|
1500
|
-
},
|
|
1501
|
-
createRow: (row, table) => {
|
|
1502
|
-
row._getAllVisibleCells = memo(() => [row.getAllCells(), table.getState().columnVisibility], cells => {
|
|
1503
|
-
return cells.filter(cell => cell.column.getIsVisible());
|
|
1504
|
-
}, getMemoOptions(table.options, 'debugRows'));
|
|
1505
|
-
row.getVisibleCells = memo(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], getMemoOptions(table.options, 'debugRows'));
|
|
1506
|
-
},
|
|
1507
|
-
createTable: table => {
|
|
1508
|
-
const makeVisibleColumnsMethod = (key, getColumns) => {
|
|
1509
|
-
return memo(() => [getColumns(), getColumns().filter(d => d.getIsVisible()).map(d => d.id).join('_')], columns => {
|
|
1510
|
-
return columns.filter(d => d.getIsVisible == null ? void 0 : d.getIsVisible());
|
|
1511
|
-
}, getMemoOptions(table.options, 'debugColumns'));
|
|
1512
|
-
};
|
|
1513
|
-
table.getVisibleFlatColumns = makeVisibleColumnsMethod('getVisibleFlatColumns', () => table.getAllFlatColumns());
|
|
1514
|
-
table.getVisibleLeafColumns = makeVisibleColumnsMethod('getVisibleLeafColumns', () => table.getAllLeafColumns());
|
|
1515
|
-
table.getLeftVisibleLeafColumns = makeVisibleColumnsMethod('getLeftVisibleLeafColumns', () => table.getLeftLeafColumns());
|
|
1516
|
-
table.getRightVisibleLeafColumns = makeVisibleColumnsMethod('getRightVisibleLeafColumns', () => table.getRightLeafColumns());
|
|
1517
|
-
table.getCenterVisibleLeafColumns = makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => table.getCenterLeafColumns());
|
|
1518
|
-
table.setColumnVisibility = updater => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater);
|
|
1519
|
-
table.resetColumnVisibility = defaultState => {
|
|
1520
|
-
var _table$initialState$c;
|
|
1521
|
-
table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});
|
|
1522
|
-
};
|
|
1523
|
-
table.toggleAllColumnsVisible = value => {
|
|
1524
|
-
var _value;
|
|
1525
|
-
value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
|
|
1526
|
-
table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({
|
|
1527
|
-
...obj,
|
|
1528
|
-
[column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value
|
|
1529
|
-
}), {}));
|
|
1530
|
-
};
|
|
1531
|
-
table.getIsAllColumnsVisible = () => !table.getAllLeafColumns().some(column => !(column.getIsVisible != null && column.getIsVisible()));
|
|
1532
|
-
table.getIsSomeColumnsVisible = () => table.getAllLeafColumns().some(column => column.getIsVisible == null ? void 0 : column.getIsVisible());
|
|
1533
|
-
table.getToggleAllColumnsVisibilityHandler = () => {
|
|
1534
|
-
return e => {
|
|
1535
|
-
var _target;
|
|
1536
|
-
table.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked);
|
|
1537
|
-
};
|
|
1538
|
-
};
|
|
1539
|
-
}
|
|
1540
|
-
};
|
|
1541
|
-
function _getVisibleLeafColumns(table, position) {
|
|
1542
|
-
return !position ? table.getVisibleLeafColumns() : position === 'center' ? table.getCenterVisibleLeafColumns() : position === 'left' ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();
|
|
1543
|
-
}
|
|
1544
|
-
|
|
1545
|
-
//
|
|
1546
|
-
|
|
1547
|
-
const GlobalFaceting = {
|
|
1548
|
-
createTable: table => {
|
|
1549
|
-
table._getGlobalFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, '__global__');
|
|
1550
|
-
table.getGlobalFacetedRowModel = () => {
|
|
1551
|
-
if (table.options.manualFiltering || !table._getGlobalFacetedRowModel) {
|
|
1552
|
-
return table.getPreFilteredRowModel();
|
|
1553
|
-
}
|
|
1554
|
-
return table._getGlobalFacetedRowModel();
|
|
1555
|
-
};
|
|
1556
|
-
table._getGlobalFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, '__global__');
|
|
1557
|
-
table.getGlobalFacetedUniqueValues = () => {
|
|
1558
|
-
if (!table._getGlobalFacetedUniqueValues) {
|
|
1559
|
-
return new Map();
|
|
1560
|
-
}
|
|
1561
|
-
return table._getGlobalFacetedUniqueValues();
|
|
1562
|
-
};
|
|
1563
|
-
table._getGlobalFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, '__global__');
|
|
1564
|
-
table.getGlobalFacetedMinMaxValues = () => {
|
|
1565
|
-
if (!table._getGlobalFacetedMinMaxValues) {
|
|
1566
|
-
return;
|
|
1567
|
-
}
|
|
1568
|
-
return table._getGlobalFacetedMinMaxValues();
|
|
1569
|
-
};
|
|
1570
|
-
}
|
|
1571
|
-
};
|
|
1572
|
-
|
|
1573
|
-
//
|
|
1574
|
-
|
|
1575
|
-
const GlobalFiltering = {
|
|
1576
|
-
getInitialState: state => {
|
|
1577
|
-
return {
|
|
1578
|
-
globalFilter: undefined,
|
|
1579
|
-
...state
|
|
1580
|
-
};
|
|
1581
|
-
},
|
|
1582
|
-
getDefaultOptions: table => {
|
|
1583
|
-
return {
|
|
1584
|
-
onGlobalFilterChange: makeStateUpdater('globalFilter', table),
|
|
1585
|
-
globalFilterFn: 'auto',
|
|
1586
|
-
getColumnCanGlobalFilter: column => {
|
|
1587
|
-
var _table$getCoreRowMode;
|
|
1588
|
-
const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null || (_table$getCoreRowMode = _table$getCoreRowMode._getAllCellsByColumnId()[column.id]) == null ? void 0 : _table$getCoreRowMode.getValue();
|
|
1589
|
-
return typeof value === 'string' || typeof value === 'number';
|
|
1590
|
-
}
|
|
1591
|
-
};
|
|
1592
|
-
},
|
|
1593
|
-
createColumn: (column, table) => {
|
|
1594
|
-
column.getCanGlobalFilter = () => {
|
|
1595
|
-
var _column$columnDef$ena, _table$options$enable, _table$options$enable2, _table$options$getCol;
|
|
1596
|
-
return ((_column$columnDef$ena = column.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableGlobalFilter) != null ? _table$options$enable : true) && ((_table$options$enable2 = table.options.enableFilters) != null ? _table$options$enable2 : true) && ((_table$options$getCol = table.options.getColumnCanGlobalFilter == null ? void 0 : table.options.getColumnCanGlobalFilter(column)) != null ? _table$options$getCol : true) && !!column.accessorFn;
|
|
1597
|
-
};
|
|
1598
|
-
},
|
|
1599
|
-
createTable: table => {
|
|
1600
|
-
table.getGlobalAutoFilterFn = () => {
|
|
1601
|
-
return filterFns.includesString;
|
|
1602
|
-
};
|
|
1603
|
-
table.getGlobalFilterFn = () => {
|
|
1604
|
-
var _table$options$filter, _table$options$filter2;
|
|
1605
|
-
const {
|
|
1606
|
-
globalFilterFn: globalFilterFn
|
|
1607
|
-
} = table.options;
|
|
1608
|
-
return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn() : (_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[globalFilterFn]) != null ? _table$options$filter : filterFns[globalFilterFn];
|
|
1609
|
-
};
|
|
1610
|
-
table.setGlobalFilter = updater => {
|
|
1611
|
-
table.options.onGlobalFilterChange == null || table.options.onGlobalFilterChange(updater);
|
|
1612
|
-
};
|
|
1613
|
-
table.resetGlobalFilter = defaultState => {
|
|
1614
|
-
table.setGlobalFilter(defaultState ? undefined : table.initialState.globalFilter);
|
|
1615
|
-
};
|
|
1616
|
-
}
|
|
1617
|
-
};
|
|
1618
|
-
|
|
1619
|
-
//
|
|
1620
|
-
|
|
1621
|
-
const RowExpanding = {
|
|
1622
|
-
getInitialState: state => {
|
|
1623
|
-
return {
|
|
1624
|
-
expanded: {},
|
|
1625
|
-
...state
|
|
1626
|
-
};
|
|
1627
|
-
},
|
|
1628
|
-
getDefaultOptions: table => {
|
|
1629
|
-
return {
|
|
1630
|
-
onExpandedChange: makeStateUpdater('expanded', table),
|
|
1631
|
-
paginateExpandedRows: true
|
|
1632
|
-
};
|
|
1633
|
-
},
|
|
1634
|
-
createTable: table => {
|
|
1635
|
-
let registered = false;
|
|
1636
|
-
let queued = false;
|
|
1637
|
-
table._autoResetExpanded = () => {
|
|
1638
|
-
var _ref, _table$options$autoRe;
|
|
1639
|
-
if (!registered) {
|
|
1640
|
-
table._queue(() => {
|
|
1641
|
-
registered = true;
|
|
1642
|
-
});
|
|
1643
|
-
return;
|
|
1644
|
-
}
|
|
1645
|
-
if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetExpanded) != null ? _ref : !table.options.manualExpanding) {
|
|
1646
|
-
if (queued) return;
|
|
1647
|
-
queued = true;
|
|
1648
|
-
table._queue(() => {
|
|
1649
|
-
table.resetExpanded();
|
|
1650
|
-
queued = false;
|
|
1651
|
-
});
|
|
1652
|
-
}
|
|
1653
|
-
};
|
|
1654
|
-
table.setExpanded = updater => table.options.onExpandedChange == null ? void 0 : table.options.onExpandedChange(updater);
|
|
1655
|
-
table.toggleAllRowsExpanded = expanded => {
|
|
1656
|
-
if (expanded != null ? expanded : !table.getIsAllRowsExpanded()) {
|
|
1657
|
-
table.setExpanded(true);
|
|
1658
|
-
} else {
|
|
1659
|
-
table.setExpanded({});
|
|
1660
|
-
}
|
|
1661
|
-
};
|
|
1662
|
-
table.resetExpanded = defaultState => {
|
|
1663
|
-
var _table$initialState$e, _table$initialState;
|
|
1664
|
-
table.setExpanded(defaultState ? {} : (_table$initialState$e = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) != null ? _table$initialState$e : {});
|
|
1665
|
-
};
|
|
1666
|
-
table.getCanSomeRowsExpand = () => {
|
|
1667
|
-
return table.getPrePaginationRowModel().flatRows.some(row => row.getCanExpand());
|
|
1668
|
-
};
|
|
1669
|
-
table.getToggleAllRowsExpandedHandler = () => {
|
|
1670
|
-
return e => {
|
|
1671
|
-
e.persist == null || e.persist();
|
|
1672
|
-
table.toggleAllRowsExpanded();
|
|
1673
|
-
};
|
|
1674
|
-
};
|
|
1675
|
-
table.getIsSomeRowsExpanded = () => {
|
|
1676
|
-
const expanded = table.getState().expanded;
|
|
1677
|
-
return expanded === true || Object.values(expanded).some(Boolean);
|
|
1678
|
-
};
|
|
1679
|
-
table.getIsAllRowsExpanded = () => {
|
|
1680
|
-
const expanded = table.getState().expanded;
|
|
1681
|
-
|
|
1682
|
-
// If expanded is true, save some cycles and return true
|
|
1683
|
-
if (typeof expanded === 'boolean') {
|
|
1684
|
-
return expanded === true;
|
|
1685
|
-
}
|
|
1686
|
-
if (!Object.keys(expanded).length) {
|
|
1687
|
-
return false;
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
// If any row is not expanded, return false
|
|
1691
|
-
if (table.getRowModel().flatRows.some(row => !row.getIsExpanded())) {
|
|
1692
|
-
return false;
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
// They must all be expanded :shrug:
|
|
1696
|
-
return true;
|
|
1697
|
-
};
|
|
1698
|
-
table.getExpandedDepth = () => {
|
|
1699
|
-
let maxDepth = 0;
|
|
1700
|
-
const rowIds = table.getState().expanded === true ? Object.keys(table.getRowModel().rowsById) : Object.keys(table.getState().expanded);
|
|
1701
|
-
rowIds.forEach(id => {
|
|
1702
|
-
const splitId = id.split('.');
|
|
1703
|
-
maxDepth = Math.max(maxDepth, splitId.length);
|
|
1704
|
-
});
|
|
1705
|
-
return maxDepth;
|
|
1706
|
-
};
|
|
1707
|
-
table.getPreExpandedRowModel = () => table.getSortedRowModel();
|
|
1708
|
-
table.getExpandedRowModel = () => {
|
|
1709
|
-
if (!table._getExpandedRowModel && table.options.getExpandedRowModel) {
|
|
1710
|
-
table._getExpandedRowModel = table.options.getExpandedRowModel(table);
|
|
1711
|
-
}
|
|
1712
|
-
if (table.options.manualExpanding || !table._getExpandedRowModel) {
|
|
1713
|
-
return table.getPreExpandedRowModel();
|
|
1714
|
-
}
|
|
1715
|
-
return table._getExpandedRowModel();
|
|
1716
|
-
};
|
|
1717
|
-
},
|
|
1718
|
-
createRow: (row, table) => {
|
|
1719
|
-
row.toggleExpanded = expanded => {
|
|
1720
|
-
table.setExpanded(old => {
|
|
1721
|
-
var _expanded;
|
|
1722
|
-
const exists = old === true ? true : !!(old != null && old[row.id]);
|
|
1723
|
-
let oldExpanded = {};
|
|
1724
|
-
if (old === true) {
|
|
1725
|
-
Object.keys(table.getRowModel().rowsById).forEach(rowId => {
|
|
1726
|
-
oldExpanded[rowId] = true;
|
|
1727
|
-
});
|
|
1728
|
-
} else {
|
|
1729
|
-
oldExpanded = old;
|
|
1730
|
-
}
|
|
1731
|
-
expanded = (_expanded = expanded) != null ? _expanded : !exists;
|
|
1732
|
-
if (!exists && expanded) {
|
|
1733
|
-
return {
|
|
1734
|
-
...oldExpanded,
|
|
1735
|
-
[row.id]: true
|
|
1736
|
-
};
|
|
1737
|
-
}
|
|
1738
|
-
if (exists && !expanded) {
|
|
1739
|
-
const {
|
|
1740
|
-
[row.id]: _,
|
|
1741
|
-
...rest
|
|
1742
|
-
} = oldExpanded;
|
|
1743
|
-
return rest;
|
|
1744
|
-
}
|
|
1745
|
-
return old;
|
|
1746
|
-
});
|
|
1747
|
-
};
|
|
1748
|
-
row.getIsExpanded = () => {
|
|
1749
|
-
var _table$options$getIsR;
|
|
1750
|
-
const expanded = table.getState().expanded;
|
|
1751
|
-
return !!((_table$options$getIsR = table.options.getIsRowExpanded == null ? void 0 : table.options.getIsRowExpanded(row)) != null ? _table$options$getIsR : expanded === true || (expanded == null ? void 0 : expanded[row.id]));
|
|
1752
|
-
};
|
|
1753
|
-
row.getCanExpand = () => {
|
|
1754
|
-
var _table$options$getRow, _table$options$enable, _row$subRows;
|
|
1755
|
-
return (_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
|
|
1756
|
-
};
|
|
1757
|
-
row.getIsAllParentsExpanded = () => {
|
|
1758
|
-
let isFullyExpanded = true;
|
|
1759
|
-
let currentRow = row;
|
|
1760
|
-
while (isFullyExpanded && currentRow.parentId) {
|
|
1761
|
-
currentRow = table.getRow(currentRow.parentId, true);
|
|
1762
|
-
isFullyExpanded = currentRow.getIsExpanded();
|
|
1763
|
-
}
|
|
1764
|
-
return isFullyExpanded;
|
|
1765
|
-
};
|
|
1766
|
-
row.getToggleExpandedHandler = () => {
|
|
1767
|
-
const canExpand = row.getCanExpand();
|
|
1768
|
-
return () => {
|
|
1769
|
-
if (!canExpand) return;
|
|
1770
|
-
row.toggleExpanded();
|
|
1771
|
-
};
|
|
1772
|
-
};
|
|
1773
|
-
}
|
|
1774
|
-
};
|
|
1775
|
-
|
|
1776
|
-
//
|
|
1777
|
-
|
|
1778
|
-
const defaultPageIndex = 0;
|
|
1779
|
-
const defaultPageSize = 10;
|
|
1780
|
-
const getDefaultPaginationState = () => ({
|
|
1781
|
-
pageIndex: defaultPageIndex,
|
|
1782
|
-
pageSize: defaultPageSize
|
|
1783
|
-
});
|
|
1784
|
-
const RowPagination = {
|
|
1785
|
-
getInitialState: state => {
|
|
1786
|
-
return {
|
|
1787
|
-
...state,
|
|
1788
|
-
pagination: {
|
|
1789
|
-
...getDefaultPaginationState(),
|
|
1790
|
-
...(state == null ? void 0 : state.pagination)
|
|
1791
|
-
}
|
|
1792
|
-
};
|
|
1793
|
-
},
|
|
1794
|
-
getDefaultOptions: table => {
|
|
1795
|
-
return {
|
|
1796
|
-
onPaginationChange: makeStateUpdater('pagination', table)
|
|
1797
|
-
};
|
|
1798
|
-
},
|
|
1799
|
-
createTable: table => {
|
|
1800
|
-
let registered = false;
|
|
1801
|
-
let queued = false;
|
|
1802
|
-
table._autoResetPageIndex = () => {
|
|
1803
|
-
var _ref, _table$options$autoRe;
|
|
1804
|
-
if (!registered) {
|
|
1805
|
-
table._queue(() => {
|
|
1806
|
-
registered = true;
|
|
1807
|
-
});
|
|
1808
|
-
return;
|
|
1809
|
-
}
|
|
1810
|
-
if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref : !table.options.manualPagination) {
|
|
1811
|
-
if (queued) return;
|
|
1812
|
-
queued = true;
|
|
1813
|
-
table._queue(() => {
|
|
1814
|
-
table.resetPageIndex();
|
|
1815
|
-
queued = false;
|
|
1816
|
-
});
|
|
1817
|
-
}
|
|
1818
|
-
};
|
|
1819
|
-
table.setPagination = updater => {
|
|
1820
|
-
const safeUpdater = old => {
|
|
1821
|
-
let newState = functionalUpdate(updater, old);
|
|
1822
|
-
return newState;
|
|
1823
|
-
};
|
|
1824
|
-
return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
|
|
1825
|
-
};
|
|
1826
|
-
table.resetPagination = defaultState => {
|
|
1827
|
-
var _table$initialState$p;
|
|
1828
|
-
table.setPagination(defaultState ? getDefaultPaginationState() : (_table$initialState$p = table.initialState.pagination) != null ? _table$initialState$p : getDefaultPaginationState());
|
|
1829
|
-
};
|
|
1830
|
-
table.setPageIndex = updater => {
|
|
1831
|
-
table.setPagination(old => {
|
|
1832
|
-
let pageIndex = functionalUpdate(updater, old.pageIndex);
|
|
1833
|
-
const maxPageIndex = typeof table.options.pageCount === 'undefined' || table.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : table.options.pageCount - 1;
|
|
1834
|
-
pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex));
|
|
1835
|
-
return {
|
|
1836
|
-
...old,
|
|
1837
|
-
pageIndex
|
|
1838
|
-
};
|
|
1839
|
-
});
|
|
1840
|
-
};
|
|
1841
|
-
table.resetPageIndex = defaultState => {
|
|
1842
|
-
var _table$initialState$p2, _table$initialState;
|
|
1843
|
-
table.setPageIndex(defaultState ? defaultPageIndex : (_table$initialState$p2 = (_table$initialState = table.initialState) == null || (_table$initialState = _table$initialState.pagination) == null ? void 0 : _table$initialState.pageIndex) != null ? _table$initialState$p2 : defaultPageIndex);
|
|
1844
|
-
};
|
|
1845
|
-
table.resetPageSize = defaultState => {
|
|
1846
|
-
var _table$initialState$p3, _table$initialState2;
|
|
1847
|
-
table.setPageSize(defaultState ? defaultPageSize : (_table$initialState$p3 = (_table$initialState2 = table.initialState) == null || (_table$initialState2 = _table$initialState2.pagination) == null ? void 0 : _table$initialState2.pageSize) != null ? _table$initialState$p3 : defaultPageSize);
|
|
1848
|
-
};
|
|
1849
|
-
table.setPageSize = updater => {
|
|
1850
|
-
table.setPagination(old => {
|
|
1851
|
-
const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize));
|
|
1852
|
-
const topRowIndex = old.pageSize * old.pageIndex;
|
|
1853
|
-
const pageIndex = Math.floor(topRowIndex / pageSize);
|
|
1854
|
-
return {
|
|
1855
|
-
...old,
|
|
1856
|
-
pageIndex,
|
|
1857
|
-
pageSize
|
|
1858
|
-
};
|
|
1859
|
-
});
|
|
1860
|
-
};
|
|
1861
|
-
//deprecated
|
|
1862
|
-
table.setPageCount = updater => table.setPagination(old => {
|
|
1863
|
-
var _table$options$pageCo;
|
|
1864
|
-
let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
|
|
1865
|
-
if (typeof newPageCount === 'number') {
|
|
1866
|
-
newPageCount = Math.max(-1, newPageCount);
|
|
1867
|
-
}
|
|
1868
|
-
return {
|
|
1869
|
-
...old,
|
|
1870
|
-
pageCount: newPageCount
|
|
1871
|
-
};
|
|
1872
|
-
});
|
|
1873
|
-
table.getPageOptions = memo(() => [table.getPageCount()], pageCount => {
|
|
1874
|
-
let pageOptions = [];
|
|
1875
|
-
if (pageCount && pageCount > 0) {
|
|
1876
|
-
pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i);
|
|
1877
|
-
}
|
|
1878
|
-
return pageOptions;
|
|
1879
|
-
}, getMemoOptions(table.options, 'debugTable'));
|
|
1880
|
-
table.getCanPreviousPage = () => table.getState().pagination.pageIndex > 0;
|
|
1881
|
-
table.getCanNextPage = () => {
|
|
1882
|
-
const {
|
|
1883
|
-
pageIndex
|
|
1884
|
-
} = table.getState().pagination;
|
|
1885
|
-
const pageCount = table.getPageCount();
|
|
1886
|
-
if (pageCount === -1) {
|
|
1887
|
-
return true;
|
|
1888
|
-
}
|
|
1889
|
-
if (pageCount === 0) {
|
|
1890
|
-
return false;
|
|
1891
|
-
}
|
|
1892
|
-
return pageIndex < pageCount - 1;
|
|
1893
|
-
};
|
|
1894
|
-
table.previousPage = () => {
|
|
1895
|
-
return table.setPageIndex(old => old - 1);
|
|
1896
|
-
};
|
|
1897
|
-
table.nextPage = () => {
|
|
1898
|
-
return table.setPageIndex(old => {
|
|
1899
|
-
return old + 1;
|
|
1900
|
-
});
|
|
1901
|
-
};
|
|
1902
|
-
table.firstPage = () => {
|
|
1903
|
-
return table.setPageIndex(0);
|
|
1904
|
-
};
|
|
1905
|
-
table.lastPage = () => {
|
|
1906
|
-
return table.setPageIndex(table.getPageCount() - 1);
|
|
1907
|
-
};
|
|
1908
|
-
table.getPrePaginationRowModel = () => table.getExpandedRowModel();
|
|
1909
|
-
table.getPaginationRowModel = () => {
|
|
1910
|
-
if (!table._getPaginationRowModel && table.options.getPaginationRowModel) {
|
|
1911
|
-
table._getPaginationRowModel = table.options.getPaginationRowModel(table);
|
|
1912
|
-
}
|
|
1913
|
-
if (table.options.manualPagination || !table._getPaginationRowModel) {
|
|
1914
|
-
return table.getPrePaginationRowModel();
|
|
1915
|
-
}
|
|
1916
|
-
return table._getPaginationRowModel();
|
|
1917
|
-
};
|
|
1918
|
-
table.getPageCount = () => {
|
|
1919
|
-
var _table$options$pageCo2;
|
|
1920
|
-
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getRowCount() / table.getState().pagination.pageSize);
|
|
1921
|
-
};
|
|
1922
|
-
table.getRowCount = () => {
|
|
1923
|
-
var _table$options$rowCou;
|
|
1924
|
-
return (_table$options$rowCou = table.options.rowCount) != null ? _table$options$rowCou : table.getPrePaginationRowModel().rows.length;
|
|
1925
|
-
};
|
|
1926
|
-
}
|
|
1927
|
-
};
|
|
1928
|
-
|
|
1929
|
-
//
|
|
1930
|
-
|
|
1931
|
-
const getDefaultRowPinningState = () => ({
|
|
1932
|
-
top: [],
|
|
1933
|
-
bottom: []
|
|
1934
|
-
});
|
|
1935
|
-
const RowPinning = {
|
|
1936
|
-
getInitialState: state => {
|
|
1937
|
-
return {
|
|
1938
|
-
rowPinning: getDefaultRowPinningState(),
|
|
1939
|
-
...state
|
|
1940
|
-
};
|
|
1941
|
-
},
|
|
1942
|
-
getDefaultOptions: table => {
|
|
1943
|
-
return {
|
|
1944
|
-
onRowPinningChange: makeStateUpdater('rowPinning', table)
|
|
1945
|
-
};
|
|
1946
|
-
},
|
|
1947
|
-
createRow: (row, table) => {
|
|
1948
|
-
row.pin = (position, includeLeafRows, includeParentRows) => {
|
|
1949
|
-
const leafRowIds = includeLeafRows ? row.getLeafRows().map(_ref => {
|
|
1950
|
-
let {
|
|
1951
|
-
id
|
|
1952
|
-
} = _ref;
|
|
1953
|
-
return id;
|
|
1954
|
-
}) : [];
|
|
1955
|
-
const parentRowIds = includeParentRows ? row.getParentRows().map(_ref2 => {
|
|
1956
|
-
let {
|
|
1957
|
-
id
|
|
1958
|
-
} = _ref2;
|
|
1959
|
-
return id;
|
|
1960
|
-
}) : [];
|
|
1961
|
-
const rowIds = new Set([...parentRowIds, row.id, ...leafRowIds]);
|
|
1962
|
-
table.setRowPinning(old => {
|
|
1963
|
-
var _old$top3, _old$bottom3;
|
|
1964
|
-
if (position === 'bottom') {
|
|
1965
|
-
var _old$top, _old$bottom;
|
|
1966
|
-
return {
|
|
1967
|
-
top: ((_old$top = old == null ? void 0 : old.top) != null ? _old$top : []).filter(d => !(rowIds != null && rowIds.has(d))),
|
|
1968
|
-
bottom: [...((_old$bottom = old == null ? void 0 : old.bottom) != null ? _old$bottom : []).filter(d => !(rowIds != null && rowIds.has(d))), ...Array.from(rowIds)]
|
|
1969
|
-
};
|
|
1970
|
-
}
|
|
1971
|
-
if (position === 'top') {
|
|
1972
|
-
var _old$top2, _old$bottom2;
|
|
1973
|
-
return {
|
|
1974
|
-
top: [...((_old$top2 = old == null ? void 0 : old.top) != null ? _old$top2 : []).filter(d => !(rowIds != null && rowIds.has(d))), ...Array.from(rowIds)],
|
|
1975
|
-
bottom: ((_old$bottom2 = old == null ? void 0 : old.bottom) != null ? _old$bottom2 : []).filter(d => !(rowIds != null && rowIds.has(d)))
|
|
1976
|
-
};
|
|
1977
|
-
}
|
|
1978
|
-
return {
|
|
1979
|
-
top: ((_old$top3 = old == null ? void 0 : old.top) != null ? _old$top3 : []).filter(d => !(rowIds != null && rowIds.has(d))),
|
|
1980
|
-
bottom: ((_old$bottom3 = old == null ? void 0 : old.bottom) != null ? _old$bottom3 : []).filter(d => !(rowIds != null && rowIds.has(d)))
|
|
1981
|
-
};
|
|
1982
|
-
});
|
|
1983
|
-
};
|
|
1984
|
-
row.getCanPin = () => {
|
|
1985
|
-
var _ref3;
|
|
1986
|
-
const {
|
|
1987
|
-
enableRowPinning,
|
|
1988
|
-
enablePinning
|
|
1989
|
-
} = table.options;
|
|
1990
|
-
if (typeof enableRowPinning === 'function') {
|
|
1991
|
-
return enableRowPinning(row);
|
|
1992
|
-
}
|
|
1993
|
-
return (_ref3 = enableRowPinning != null ? enableRowPinning : enablePinning) != null ? _ref3 : true;
|
|
1994
|
-
};
|
|
1995
|
-
row.getIsPinned = () => {
|
|
1996
|
-
const rowIds = [row.id];
|
|
1997
|
-
const {
|
|
1998
|
-
top,
|
|
1999
|
-
bottom
|
|
2000
|
-
} = table.getState().rowPinning;
|
|
2001
|
-
const isTop = rowIds.some(d => top == null ? void 0 : top.includes(d));
|
|
2002
|
-
const isBottom = rowIds.some(d => bottom == null ? void 0 : bottom.includes(d));
|
|
2003
|
-
return isTop ? 'top' : isBottom ? 'bottom' : false;
|
|
2004
|
-
};
|
|
2005
|
-
row.getPinnedIndex = () => {
|
|
2006
|
-
var _ref4, _visiblePinnedRowIds$;
|
|
2007
|
-
const position = row.getIsPinned();
|
|
2008
|
-
if (!position) return -1;
|
|
2009
|
-
const visiblePinnedRowIds = (_ref4 = position === 'top' ? table.getTopRows() : table.getBottomRows()) == null ? void 0 : _ref4.map(_ref5 => {
|
|
2010
|
-
let {
|
|
2011
|
-
id
|
|
2012
|
-
} = _ref5;
|
|
2013
|
-
return id;
|
|
2014
|
-
});
|
|
2015
|
-
return (_visiblePinnedRowIds$ = visiblePinnedRowIds == null ? void 0 : visiblePinnedRowIds.indexOf(row.id)) != null ? _visiblePinnedRowIds$ : -1;
|
|
2016
|
-
};
|
|
2017
|
-
},
|
|
2018
|
-
createTable: table => {
|
|
2019
|
-
table.setRowPinning = updater => table.options.onRowPinningChange == null ? void 0 : table.options.onRowPinningChange(updater);
|
|
2020
|
-
table.resetRowPinning = defaultState => {
|
|
2021
|
-
var _table$initialState$r, _table$initialState;
|
|
2022
|
-
return table.setRowPinning(defaultState ? getDefaultRowPinningState() : (_table$initialState$r = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.rowPinning) != null ? _table$initialState$r : getDefaultRowPinningState());
|
|
2023
|
-
};
|
|
2024
|
-
table.getIsSomeRowsPinned = position => {
|
|
2025
|
-
var _pinningState$positio;
|
|
2026
|
-
const pinningState = table.getState().rowPinning;
|
|
2027
|
-
if (!position) {
|
|
2028
|
-
var _pinningState$top, _pinningState$bottom;
|
|
2029
|
-
return Boolean(((_pinningState$top = pinningState.top) == null ? void 0 : _pinningState$top.length) || ((_pinningState$bottom = pinningState.bottom) == null ? void 0 : _pinningState$bottom.length));
|
|
2030
|
-
}
|
|
2031
|
-
return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
|
|
2032
|
-
};
|
|
2033
|
-
table._getPinnedRows = (visibleRows, pinnedRowIds, position) => {
|
|
2034
|
-
var _table$options$keepPi;
|
|
2035
|
-
const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ?
|
|
2036
|
-
//get all rows that are pinned even if they would not be otherwise visible
|
|
2037
|
-
//account for expanded parent rows, but not pagination or filtering
|
|
2038
|
-
(pinnedRowIds != null ? pinnedRowIds : []).map(rowId => {
|
|
2039
|
-
const row = table.getRow(rowId, true);
|
|
2040
|
-
return row.getIsAllParentsExpanded() ? row : null;
|
|
2041
|
-
}) :
|
|
2042
|
-
//else get only visible rows that are pinned
|
|
2043
|
-
(pinnedRowIds != null ? pinnedRowIds : []).map(rowId => visibleRows.find(row => row.id === rowId));
|
|
2044
|
-
return rows.filter(Boolean).map(d => ({
|
|
2045
|
-
...d,
|
|
2046
|
-
position
|
|
2047
|
-
}));
|
|
2048
|
-
};
|
|
2049
|
-
table.getTopRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top], (allRows, topPinnedRowIds) => table._getPinnedRows(allRows, topPinnedRowIds, 'top'), getMemoOptions(table.options, 'debugRows'));
|
|
2050
|
-
table.getBottomRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.bottom], (allRows, bottomPinnedRowIds) => table._getPinnedRows(allRows, bottomPinnedRowIds, 'bottom'), getMemoOptions(table.options, 'debugRows'));
|
|
2051
|
-
table.getCenterRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top, bottom) => {
|
|
2052
|
-
const topAndBottom = new Set([...(top != null ? top : []), ...(bottom != null ? bottom : [])]);
|
|
2053
|
-
return allRows.filter(d => !topAndBottom.has(d.id));
|
|
2054
|
-
}, getMemoOptions(table.options, 'debugRows'));
|
|
2055
|
-
}
|
|
2056
|
-
};
|
|
2057
|
-
|
|
2058
|
-
//
|
|
2059
|
-
|
|
2060
|
-
const RowSelection = {
|
|
2061
|
-
getInitialState: state => {
|
|
2062
|
-
return {
|
|
2063
|
-
rowSelection: {},
|
|
2064
|
-
...state
|
|
2065
|
-
};
|
|
2066
|
-
},
|
|
2067
|
-
getDefaultOptions: table => {
|
|
2068
|
-
return {
|
|
2069
|
-
onRowSelectionChange: makeStateUpdater('rowSelection', table),
|
|
2070
|
-
enableRowSelection: true,
|
|
2071
|
-
enableMultiRowSelection: true,
|
|
2072
|
-
enableSubRowSelection: true
|
|
2073
|
-
// enableGroupingRowSelection: false,
|
|
2074
|
-
// isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
|
|
2075
|
-
// isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
|
|
2076
|
-
};
|
|
2077
|
-
},
|
|
2078
|
-
createTable: table => {
|
|
2079
|
-
table.setRowSelection = updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater);
|
|
2080
|
-
table.resetRowSelection = defaultState => {
|
|
2081
|
-
var _table$initialState$r;
|
|
2082
|
-
return table.setRowSelection(defaultState ? {} : (_table$initialState$r = table.initialState.rowSelection) != null ? _table$initialState$r : {});
|
|
2083
|
-
};
|
|
2084
|
-
table.toggleAllRowsSelected = value => {
|
|
2085
|
-
table.setRowSelection(old => {
|
|
2086
|
-
value = typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected();
|
|
2087
|
-
const rowSelection = {
|
|
2088
|
-
...old
|
|
2089
|
-
};
|
|
2090
|
-
const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows;
|
|
2091
|
-
|
|
2092
|
-
// We don't use `mutateRowIsSelected` here for performance reasons.
|
|
2093
|
-
// All of the rows are flat already, so it wouldn't be worth it
|
|
2094
|
-
if (value) {
|
|
2095
|
-
preGroupedFlatRows.forEach(row => {
|
|
2096
|
-
if (!row.getCanSelect()) {
|
|
2097
|
-
return;
|
|
2098
|
-
}
|
|
2099
|
-
rowSelection[row.id] = true;
|
|
2100
|
-
});
|
|
2101
|
-
} else {
|
|
2102
|
-
preGroupedFlatRows.forEach(row => {
|
|
2103
|
-
delete rowSelection[row.id];
|
|
2104
|
-
});
|
|
2105
|
-
}
|
|
2106
|
-
return rowSelection;
|
|
2107
|
-
});
|
|
2108
|
-
};
|
|
2109
|
-
table.toggleAllPageRowsSelected = value => table.setRowSelection(old => {
|
|
2110
|
-
const resolvedValue = typeof value !== 'undefined' ? value : !table.getIsAllPageRowsSelected();
|
|
2111
|
-
const rowSelection = {
|
|
2112
|
-
...old
|
|
2113
|
-
};
|
|
2114
|
-
table.getRowModel().rows.forEach(row => {
|
|
2115
|
-
mutateRowIsSelected(rowSelection, row.id, resolvedValue, true, table);
|
|
2116
|
-
});
|
|
2117
|
-
return rowSelection;
|
|
2118
|
-
});
|
|
2119
|
-
|
|
2120
|
-
// addRowSelectionRange: rowId => {
|
|
2121
|
-
// const {
|
|
2122
|
-
// rows,
|
|
2123
|
-
// rowsById,
|
|
2124
|
-
// options: { selectGroupingRows, selectSubRows },
|
|
2125
|
-
// } = table
|
|
2126
|
-
|
|
2127
|
-
// const findSelectedRow = (rows: Row[]) => {
|
|
2128
|
-
// let found
|
|
2129
|
-
// rows.find(d => {
|
|
2130
|
-
// if (d.getIsSelected()) {
|
|
2131
|
-
// found = d
|
|
2132
|
-
// return true
|
|
2133
|
-
// }
|
|
2134
|
-
// const subFound = findSelectedRow(d.subRows || [])
|
|
2135
|
-
// if (subFound) {
|
|
2136
|
-
// found = subFound
|
|
2137
|
-
// return true
|
|
2138
|
-
// }
|
|
2139
|
-
// return false
|
|
2140
|
-
// })
|
|
2141
|
-
// return found
|
|
2142
|
-
// }
|
|
2143
|
-
|
|
2144
|
-
// const firstRow = findSelectedRow(rows) || rows[0]
|
|
2145
|
-
// const lastRow = rowsById[rowId]
|
|
2146
|
-
|
|
2147
|
-
// let include = false
|
|
2148
|
-
// const selectedRowIds = {}
|
|
2149
|
-
|
|
2150
|
-
// const addRow = (row: Row) => {
|
|
2151
|
-
// mutateRowIsSelected(selectedRowIds, row.id, true, {
|
|
2152
|
-
// rowsById,
|
|
2153
|
-
// selectGroupingRows: selectGroupingRows!,
|
|
2154
|
-
// selectSubRows: selectSubRows!,
|
|
2155
|
-
// })
|
|
2156
|
-
// }
|
|
2157
|
-
|
|
2158
|
-
// table.rows.forEach(row => {
|
|
2159
|
-
// const isFirstRow = row.id === firstRow.id
|
|
2160
|
-
// const isLastRow = row.id === lastRow.id
|
|
2161
|
-
|
|
2162
|
-
// if (isFirstRow || isLastRow) {
|
|
2163
|
-
// if (!include) {
|
|
2164
|
-
// include = true
|
|
2165
|
-
// } else if (include) {
|
|
2166
|
-
// addRow(row)
|
|
2167
|
-
// include = false
|
|
2168
|
-
// }
|
|
2169
|
-
// }
|
|
2170
|
-
|
|
2171
|
-
// if (include) {
|
|
2172
|
-
// addRow(row)
|
|
2173
|
-
// }
|
|
2174
|
-
// })
|
|
2175
|
-
|
|
2176
|
-
// table.setRowSelection(selectedRowIds)
|
|
2177
|
-
// },
|
|
2178
|
-
table.getPreSelectedRowModel = () => table.getCoreRowModel();
|
|
2179
|
-
table.getSelectedRowModel = memo(() => [table.getState().rowSelection, table.getCoreRowModel()], (rowSelection, rowModel) => {
|
|
2180
|
-
if (!Object.keys(rowSelection).length) {
|
|
2181
|
-
return {
|
|
2182
|
-
rows: [],
|
|
2183
|
-
flatRows: [],
|
|
2184
|
-
rowsById: {}
|
|
2185
|
-
};
|
|
2186
|
-
}
|
|
2187
|
-
return selectRowsFn(table, rowModel);
|
|
2188
|
-
}, getMemoOptions(table.options, 'debugTable'));
|
|
2189
|
-
table.getFilteredSelectedRowModel = memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
|
|
2190
|
-
if (!Object.keys(rowSelection).length) {
|
|
2191
|
-
return {
|
|
2192
|
-
rows: [],
|
|
2193
|
-
flatRows: [],
|
|
2194
|
-
rowsById: {}
|
|
2195
|
-
};
|
|
2196
|
-
}
|
|
2197
|
-
return selectRowsFn(table, rowModel);
|
|
2198
|
-
}, getMemoOptions(table.options, 'debugTable'));
|
|
2199
|
-
table.getGroupedSelectedRowModel = memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
|
|
2200
|
-
if (!Object.keys(rowSelection).length) {
|
|
2201
|
-
return {
|
|
2202
|
-
rows: [],
|
|
2203
|
-
flatRows: [],
|
|
2204
|
-
rowsById: {}
|
|
2205
|
-
};
|
|
2206
|
-
}
|
|
2207
|
-
return selectRowsFn(table, rowModel);
|
|
2208
|
-
}, getMemoOptions(table.options, 'debugTable'));
|
|
2209
|
-
|
|
2210
|
-
///
|
|
2211
|
-
|
|
2212
|
-
// getGroupingRowCanSelect: rowId => {
|
|
2213
|
-
// const row = table.getRow(rowId)
|
|
2214
|
-
|
|
2215
|
-
// if (!row) {
|
|
2216
|
-
// throw new Error()
|
|
2217
|
-
// }
|
|
2218
|
-
|
|
2219
|
-
// if (typeof table.options.enableGroupingRowSelection === 'function') {
|
|
2220
|
-
// return table.options.enableGroupingRowSelection(row)
|
|
2221
|
-
// }
|
|
2222
|
-
|
|
2223
|
-
// return table.options.enableGroupingRowSelection ?? false
|
|
2224
|
-
// },
|
|
2225
|
-
|
|
2226
|
-
table.getIsAllRowsSelected = () => {
|
|
2227
|
-
const preGroupedFlatRows = table.getFilteredRowModel().flatRows;
|
|
2228
|
-
const {
|
|
2229
|
-
rowSelection
|
|
2230
|
-
} = table.getState();
|
|
2231
|
-
let isAllRowsSelected = Boolean(preGroupedFlatRows.length && Object.keys(rowSelection).length);
|
|
2232
|
-
if (isAllRowsSelected) {
|
|
2233
|
-
if (preGroupedFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {
|
|
2234
|
-
isAllRowsSelected = false;
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
return isAllRowsSelected;
|
|
2238
|
-
};
|
|
2239
|
-
table.getIsAllPageRowsSelected = () => {
|
|
2240
|
-
const paginationFlatRows = table.getPaginationRowModel().flatRows.filter(row => row.getCanSelect());
|
|
2241
|
-
const {
|
|
2242
|
-
rowSelection
|
|
2243
|
-
} = table.getState();
|
|
2244
|
-
let isAllPageRowsSelected = !!paginationFlatRows.length;
|
|
2245
|
-
if (isAllPageRowsSelected && paginationFlatRows.some(row => !rowSelection[row.id])) {
|
|
2246
|
-
isAllPageRowsSelected = false;
|
|
2247
|
-
}
|
|
2248
|
-
return isAllPageRowsSelected;
|
|
2249
|
-
};
|
|
2250
|
-
table.getIsSomeRowsSelected = () => {
|
|
2251
|
-
var _table$getState$rowSe;
|
|
2252
|
-
const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
|
|
2253
|
-
return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
|
|
2254
|
-
};
|
|
2255
|
-
table.getIsSomePageRowsSelected = () => {
|
|
2256
|
-
const paginationFlatRows = table.getPaginationRowModel().flatRows;
|
|
2257
|
-
return table.getIsAllPageRowsSelected() ? false : paginationFlatRows.filter(row => row.getCanSelect()).some(d => d.getIsSelected() || d.getIsSomeSelected());
|
|
2258
|
-
};
|
|
2259
|
-
table.getToggleAllRowsSelectedHandler = () => {
|
|
2260
|
-
return e => {
|
|
2261
|
-
table.toggleAllRowsSelected(e.target.checked);
|
|
2262
|
-
};
|
|
2263
|
-
};
|
|
2264
|
-
table.getToggleAllPageRowsSelectedHandler = () => {
|
|
2265
|
-
return e => {
|
|
2266
|
-
table.toggleAllPageRowsSelected(e.target.checked);
|
|
2267
|
-
};
|
|
2268
|
-
};
|
|
2269
|
-
},
|
|
2270
|
-
createRow: (row, table) => {
|
|
2271
|
-
row.toggleSelected = (value, opts) => {
|
|
2272
|
-
const isSelected = row.getIsSelected();
|
|
2273
|
-
table.setRowSelection(old => {
|
|
2274
|
-
var _opts$selectChildren;
|
|
2275
|
-
value = typeof value !== 'undefined' ? value : !isSelected;
|
|
2276
|
-
if (row.getCanSelect() && isSelected === value) {
|
|
2277
|
-
return old;
|
|
2278
|
-
}
|
|
2279
|
-
const selectedRowIds = {
|
|
2280
|
-
...old
|
|
2281
|
-
};
|
|
2282
|
-
mutateRowIsSelected(selectedRowIds, row.id, value, (_opts$selectChildren = opts == null ? void 0 : opts.selectChildren) != null ? _opts$selectChildren : true, table);
|
|
2283
|
-
return selectedRowIds;
|
|
2284
|
-
});
|
|
2285
|
-
};
|
|
2286
|
-
row.getIsSelected = () => {
|
|
2287
|
-
const {
|
|
2288
|
-
rowSelection
|
|
2289
|
-
} = table.getState();
|
|
2290
|
-
return isRowSelected(row, rowSelection);
|
|
2291
|
-
};
|
|
2292
|
-
row.getIsSomeSelected = () => {
|
|
2293
|
-
const {
|
|
2294
|
-
rowSelection
|
|
2295
|
-
} = table.getState();
|
|
2296
|
-
return isSubRowSelected(row, rowSelection) === 'some';
|
|
2297
|
-
};
|
|
2298
|
-
row.getIsAllSubRowsSelected = () => {
|
|
2299
|
-
const {
|
|
2300
|
-
rowSelection
|
|
2301
|
-
} = table.getState();
|
|
2302
|
-
return isSubRowSelected(row, rowSelection) === 'all';
|
|
2303
|
-
};
|
|
2304
|
-
row.getCanSelect = () => {
|
|
2305
|
-
var _table$options$enable;
|
|
2306
|
-
if (typeof table.options.enableRowSelection === 'function') {
|
|
2307
|
-
return table.options.enableRowSelection(row);
|
|
2308
|
-
}
|
|
2309
|
-
return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
|
|
2310
|
-
};
|
|
2311
|
-
row.getCanSelectSubRows = () => {
|
|
2312
|
-
var _table$options$enable2;
|
|
2313
|
-
if (typeof table.options.enableSubRowSelection === 'function') {
|
|
2314
|
-
return table.options.enableSubRowSelection(row);
|
|
2315
|
-
}
|
|
2316
|
-
return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
|
|
2317
|
-
};
|
|
2318
|
-
row.getCanMultiSelect = () => {
|
|
2319
|
-
var _table$options$enable3;
|
|
2320
|
-
if (typeof table.options.enableMultiRowSelection === 'function') {
|
|
2321
|
-
return table.options.enableMultiRowSelection(row);
|
|
2322
|
-
}
|
|
2323
|
-
return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;
|
|
2324
|
-
};
|
|
2325
|
-
row.getToggleSelectedHandler = () => {
|
|
2326
|
-
const canSelect = row.getCanSelect();
|
|
2327
|
-
return e => {
|
|
2328
|
-
var _target;
|
|
2329
|
-
if (!canSelect) return;
|
|
2330
|
-
row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked);
|
|
2331
|
-
};
|
|
2332
|
-
};
|
|
2333
|
-
}
|
|
2334
|
-
};
|
|
2335
|
-
const mutateRowIsSelected = (selectedRowIds, id, value, includeChildren, table) => {
|
|
2336
|
-
var _row$subRows;
|
|
2337
|
-
const row = table.getRow(id, true);
|
|
2338
|
-
|
|
2339
|
-
// const isGrouped = row.getIsGrouped()
|
|
2340
|
-
|
|
2341
|
-
// if ( // TODO: enforce grouping row selection rules
|
|
2342
|
-
// !isGrouped ||
|
|
2343
|
-
// (isGrouped && table.options.enableGroupingRowSelection)
|
|
2344
|
-
// ) {
|
|
2345
|
-
if (value) {
|
|
2346
|
-
if (!row.getCanMultiSelect()) {
|
|
2347
|
-
Object.keys(selectedRowIds).forEach(key => delete selectedRowIds[key]);
|
|
2348
|
-
}
|
|
2349
|
-
if (row.getCanSelect()) {
|
|
2350
|
-
selectedRowIds[id] = true;
|
|
2351
|
-
}
|
|
2352
|
-
} else {
|
|
2353
|
-
delete selectedRowIds[id];
|
|
2354
|
-
}
|
|
2355
|
-
// }
|
|
2356
|
-
|
|
2357
|
-
if (includeChildren && (_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
|
|
2358
|
-
row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, includeChildren, table));
|
|
2359
|
-
}
|
|
2360
|
-
};
|
|
2361
|
-
function selectRowsFn(table, rowModel) {
|
|
2362
|
-
const rowSelection = table.getState().rowSelection;
|
|
2363
|
-
const newSelectedFlatRows = [];
|
|
2364
|
-
const newSelectedRowsById = {};
|
|
2365
|
-
|
|
2366
|
-
// Filters top level and nested rows
|
|
2367
|
-
const recurseRows = function (rows, depth) {
|
|
2368
|
-
return rows.map(row => {
|
|
2369
|
-
var _row$subRows2;
|
|
2370
|
-
const isSelected = isRowSelected(row, rowSelection);
|
|
2371
|
-
if (isSelected) {
|
|
2372
|
-
newSelectedFlatRows.push(row);
|
|
2373
|
-
newSelectedRowsById[row.id] = row;
|
|
2374
|
-
}
|
|
2375
|
-
if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
|
|
2376
|
-
row = {
|
|
2377
|
-
...row,
|
|
2378
|
-
subRows: recurseRows(row.subRows)
|
|
2379
|
-
};
|
|
2380
|
-
}
|
|
2381
|
-
if (isSelected) {
|
|
2382
|
-
return row;
|
|
2383
|
-
}
|
|
2384
|
-
}).filter(Boolean);
|
|
2385
|
-
};
|
|
2386
|
-
return {
|
|
2387
|
-
rows: recurseRows(rowModel.rows),
|
|
2388
|
-
flatRows: newSelectedFlatRows,
|
|
2389
|
-
rowsById: newSelectedRowsById
|
|
2390
|
-
};
|
|
2391
|
-
}
|
|
2392
|
-
function isRowSelected(row, selection) {
|
|
2393
|
-
var _selection$row$id;
|
|
2394
|
-
return (_selection$row$id = selection[row.id]) != null ? _selection$row$id : false;
|
|
2395
|
-
}
|
|
2396
|
-
function isSubRowSelected(row, selection, table) {
|
|
2397
|
-
var _row$subRows3;
|
|
2398
|
-
if (!((_row$subRows3 = row.subRows) != null && _row$subRows3.length)) return false;
|
|
2399
|
-
let allChildrenSelected = true;
|
|
2400
|
-
let someSelected = false;
|
|
2401
|
-
row.subRows.forEach(subRow => {
|
|
2402
|
-
// Bail out early if we know both of these
|
|
2403
|
-
if (someSelected && !allChildrenSelected) {
|
|
2404
|
-
return;
|
|
2405
|
-
}
|
|
2406
|
-
if (subRow.getCanSelect()) {
|
|
2407
|
-
if (isRowSelected(subRow, selection)) {
|
|
2408
|
-
someSelected = true;
|
|
2409
|
-
} else {
|
|
2410
|
-
allChildrenSelected = false;
|
|
2411
|
-
}
|
|
2412
|
-
}
|
|
2413
|
-
|
|
2414
|
-
// Check row selection of nested subrows
|
|
2415
|
-
if (subRow.subRows && subRow.subRows.length) {
|
|
2416
|
-
const subRowChildrenSelected = isSubRowSelected(subRow, selection);
|
|
2417
|
-
if (subRowChildrenSelected === 'all') {
|
|
2418
|
-
someSelected = true;
|
|
2419
|
-
} else if (subRowChildrenSelected === 'some') {
|
|
2420
|
-
someSelected = true;
|
|
2421
|
-
allChildrenSelected = false;
|
|
2422
|
-
} else {
|
|
2423
|
-
allChildrenSelected = false;
|
|
2424
|
-
}
|
|
2425
|
-
}
|
|
2426
|
-
});
|
|
2427
|
-
return allChildrenSelected ? 'all' : someSelected ? 'some' : false;
|
|
2428
|
-
}
|
|
2429
|
-
|
|
2430
|
-
const reSplitAlphaNumeric = /([0-9]+)/gm;
|
|
2431
|
-
const alphanumeric = (rowA, rowB, columnId) => {
|
|
2432
|
-
return compareAlphanumeric(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
|
|
2433
|
-
};
|
|
2434
|
-
const alphanumericCaseSensitive = (rowA, rowB, columnId) => {
|
|
2435
|
-
return compareAlphanumeric(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
|
|
2436
|
-
};
|
|
2437
|
-
|
|
2438
|
-
// The text filter is more basic (less numeric support)
|
|
2439
|
-
// but is much faster
|
|
2440
|
-
const text = (rowA, rowB, columnId) => {
|
|
2441
|
-
return compareBasic(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
|
|
2442
|
-
};
|
|
2443
|
-
|
|
2444
|
-
// The text filter is more basic (less numeric support)
|
|
2445
|
-
// but is much faster
|
|
2446
|
-
const textCaseSensitive = (rowA, rowB, columnId) => {
|
|
2447
|
-
return compareBasic(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
|
|
2448
|
-
};
|
|
2449
|
-
const datetime = (rowA, rowB, columnId) => {
|
|
2450
|
-
const a = rowA.getValue(columnId);
|
|
2451
|
-
const b = rowB.getValue(columnId);
|
|
2452
|
-
|
|
2453
|
-
// Can handle nullish values
|
|
2454
|
-
// Use > and < because == (and ===) doesn't work with
|
|
2455
|
-
// Date objects (would require calling getTime()).
|
|
2456
|
-
return a > b ? 1 : a < b ? -1 : 0;
|
|
2457
|
-
};
|
|
2458
|
-
const basic = (rowA, rowB, columnId) => {
|
|
2459
|
-
return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId));
|
|
2460
|
-
};
|
|
2461
|
-
|
|
2462
|
-
// Utils
|
|
2463
|
-
|
|
2464
|
-
function compareBasic(a, b) {
|
|
2465
|
-
return a === b ? 0 : a > b ? 1 : -1;
|
|
2466
|
-
}
|
|
2467
|
-
function toString(a) {
|
|
2468
|
-
if (typeof a === 'number') {
|
|
2469
|
-
if (isNaN(a) || a === Infinity || a === -Infinity) {
|
|
2470
|
-
return '';
|
|
2471
|
-
}
|
|
2472
|
-
return String(a);
|
|
2473
|
-
}
|
|
2474
|
-
if (typeof a === 'string') {
|
|
2475
|
-
return a;
|
|
2476
|
-
}
|
|
2477
|
-
return '';
|
|
2478
|
-
}
|
|
2479
|
-
|
|
2480
|
-
// Mixed sorting is slow, but very inclusive of many edge cases.
|
|
2481
|
-
// It handles numbers, mixed alphanumeric combinations, and even
|
|
2482
|
-
// null, undefined, and Infinity
|
|
2483
|
-
function compareAlphanumeric(aStr, bStr) {
|
|
2484
|
-
// Split on number groups, but keep the delimiter
|
|
2485
|
-
// Then remove falsey split values
|
|
2486
|
-
const a = aStr.split(reSplitAlphaNumeric).filter(Boolean);
|
|
2487
|
-
const b = bStr.split(reSplitAlphaNumeric).filter(Boolean);
|
|
2488
|
-
|
|
2489
|
-
// While
|
|
2490
|
-
while (a.length && b.length) {
|
|
2491
|
-
const aa = a.shift();
|
|
2492
|
-
const bb = b.shift();
|
|
2493
|
-
const an = parseInt(aa, 10);
|
|
2494
|
-
const bn = parseInt(bb, 10);
|
|
2495
|
-
const combo = [an, bn].sort();
|
|
2496
|
-
|
|
2497
|
-
// Both are string
|
|
2498
|
-
if (isNaN(combo[0])) {
|
|
2499
|
-
if (aa > bb) {
|
|
2500
|
-
return 1;
|
|
2501
|
-
}
|
|
2502
|
-
if (bb > aa) {
|
|
2503
|
-
return -1;
|
|
2504
|
-
}
|
|
2505
|
-
continue;
|
|
2506
|
-
}
|
|
2507
|
-
|
|
2508
|
-
// One is a string, one is a number
|
|
2509
|
-
if (isNaN(combo[1])) {
|
|
2510
|
-
return isNaN(an) ? -1 : 1;
|
|
2511
|
-
}
|
|
2512
|
-
|
|
2513
|
-
// Both are numbers
|
|
2514
|
-
if (an > bn) {
|
|
2515
|
-
return 1;
|
|
2516
|
-
}
|
|
2517
|
-
if (bn > an) {
|
|
2518
|
-
return -1;
|
|
2519
|
-
}
|
|
2520
|
-
}
|
|
2521
|
-
return a.length - b.length;
|
|
2522
|
-
}
|
|
2523
|
-
|
|
2524
|
-
// Exports
|
|
2525
|
-
|
|
2526
|
-
const sortingFns = {
|
|
2527
|
-
alphanumeric,
|
|
2528
|
-
alphanumericCaseSensitive,
|
|
2529
|
-
text,
|
|
2530
|
-
textCaseSensitive,
|
|
2531
|
-
datetime,
|
|
2532
|
-
basic
|
|
2533
|
-
};
|
|
2534
|
-
|
|
2535
|
-
//
|
|
2536
|
-
|
|
2537
|
-
const RowSorting = {
|
|
2538
|
-
getInitialState: state => {
|
|
2539
|
-
return {
|
|
2540
|
-
sorting: [],
|
|
2541
|
-
...state
|
|
2542
|
-
};
|
|
2543
|
-
},
|
|
2544
|
-
getDefaultColumnDef: () => {
|
|
2545
|
-
return {
|
|
2546
|
-
sortingFn: 'auto',
|
|
2547
|
-
sortUndefined: 1
|
|
2548
|
-
};
|
|
2549
|
-
},
|
|
2550
|
-
getDefaultOptions: table => {
|
|
2551
|
-
return {
|
|
2552
|
-
onSortingChange: makeStateUpdater('sorting', table),
|
|
2553
|
-
isMultiSortEvent: e => {
|
|
2554
|
-
return e.shiftKey;
|
|
2555
|
-
}
|
|
2556
|
-
};
|
|
2557
|
-
},
|
|
2558
|
-
createColumn: (column, table) => {
|
|
2559
|
-
column.getAutoSortingFn = () => {
|
|
2560
|
-
const firstRows = table.getFilteredRowModel().flatRows.slice(10);
|
|
2561
|
-
let isString = false;
|
|
2562
|
-
for (const row of firstRows) {
|
|
2563
|
-
const value = row == null ? void 0 : row.getValue(column.id);
|
|
2564
|
-
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
2565
|
-
return sortingFns.datetime;
|
|
2566
|
-
}
|
|
2567
|
-
if (typeof value === 'string') {
|
|
2568
|
-
isString = true;
|
|
2569
|
-
if (value.split(reSplitAlphaNumeric).length > 1) {
|
|
2570
|
-
return sortingFns.alphanumeric;
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
|
-
if (isString) {
|
|
2575
|
-
return sortingFns.text;
|
|
2576
|
-
}
|
|
2577
|
-
return sortingFns.basic;
|
|
2578
|
-
};
|
|
2579
|
-
column.getAutoSortDir = () => {
|
|
2580
|
-
const firstRow = table.getFilteredRowModel().flatRows[0];
|
|
2581
|
-
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
2582
|
-
if (typeof value === 'string') {
|
|
2583
|
-
return 'asc';
|
|
2584
|
-
}
|
|
2585
|
-
return 'desc';
|
|
2586
|
-
};
|
|
2587
|
-
column.getSortingFn = () => {
|
|
2588
|
-
var _table$options$sortin, _table$options$sortin2;
|
|
2589
|
-
if (!column) {
|
|
2590
|
-
throw new Error();
|
|
2591
|
-
}
|
|
2592
|
-
return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : (_table$options$sortin = (_table$options$sortin2 = table.options.sortingFns) == null ? void 0 : _table$options$sortin2[column.columnDef.sortingFn]) != null ? _table$options$sortin : sortingFns[column.columnDef.sortingFn];
|
|
2593
|
-
};
|
|
2594
|
-
column.toggleSorting = (desc, multi) => {
|
|
2595
|
-
// if (column.columns.length) {
|
|
2596
|
-
// column.columns.forEach((c, i) => {
|
|
2597
|
-
// if (c.id) {
|
|
2598
|
-
// table.toggleColumnSorting(c.id, undefined, multi || !!i)
|
|
2599
|
-
// }
|
|
2600
|
-
// })
|
|
2601
|
-
// return
|
|
2602
|
-
// }
|
|
2603
|
-
|
|
2604
|
-
// this needs to be outside of table.setSorting to be in sync with rerender
|
|
2605
|
-
const nextSortingOrder = column.getNextSortingOrder();
|
|
2606
|
-
const hasManualValue = typeof desc !== 'undefined' && desc !== null;
|
|
2607
|
-
table.setSorting(old => {
|
|
2608
|
-
// Find any existing sorting for this column
|
|
2609
|
-
const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
|
|
2610
|
-
const existingIndex = old == null ? void 0 : old.findIndex(d => d.id === column.id);
|
|
2611
|
-
let newSorting = [];
|
|
2612
|
-
|
|
2613
|
-
// What should we do with this sort action?
|
|
2614
|
-
let sortAction;
|
|
2615
|
-
let nextDesc = hasManualValue ? desc : nextSortingOrder === 'desc';
|
|
2616
|
-
|
|
2617
|
-
// Multi-mode
|
|
2618
|
-
if (old != null && old.length && column.getCanMultiSort() && multi) {
|
|
2619
|
-
if (existingSorting) {
|
|
2620
|
-
sortAction = 'toggle';
|
|
2621
|
-
} else {
|
|
2622
|
-
sortAction = 'add';
|
|
2623
|
-
}
|
|
2624
|
-
} else {
|
|
2625
|
-
// Normal mode
|
|
2626
|
-
if (old != null && old.length && existingIndex !== old.length - 1) {
|
|
2627
|
-
sortAction = 'replace';
|
|
2628
|
-
} else if (existingSorting) {
|
|
2629
|
-
sortAction = 'toggle';
|
|
2630
|
-
} else {
|
|
2631
|
-
sortAction = 'replace';
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
|
|
2635
|
-
// Handle toggle states that will remove the sorting
|
|
2636
|
-
if (sortAction === 'toggle') {
|
|
2637
|
-
// If we are "actually" toggling (not a manual set value), should we remove the sorting?
|
|
2638
|
-
if (!hasManualValue) {
|
|
2639
|
-
// Is our intention to remove?
|
|
2640
|
-
if (!nextSortingOrder) {
|
|
2641
|
-
sortAction = 'remove';
|
|
2642
|
-
}
|
|
2643
|
-
}
|
|
2644
|
-
}
|
|
2645
|
-
if (sortAction === 'add') {
|
|
2646
|
-
var _table$options$maxMul;
|
|
2647
|
-
newSorting = [...old, {
|
|
2648
|
-
id: column.id,
|
|
2649
|
-
desc: nextDesc
|
|
2650
|
-
}];
|
|
2651
|
-
// Take latest n columns
|
|
2652
|
-
newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));
|
|
2653
|
-
} else if (sortAction === 'toggle') {
|
|
2654
|
-
// This flips (or sets) the
|
|
2655
|
-
newSorting = old.map(d => {
|
|
2656
|
-
if (d.id === column.id) {
|
|
2657
|
-
return {
|
|
2658
|
-
...d,
|
|
2659
|
-
desc: nextDesc
|
|
2660
|
-
};
|
|
2661
|
-
}
|
|
2662
|
-
return d;
|
|
2663
|
-
});
|
|
2664
|
-
} else if (sortAction === 'remove') {
|
|
2665
|
-
newSorting = old.filter(d => d.id !== column.id);
|
|
2666
|
-
} else {
|
|
2667
|
-
newSorting = [{
|
|
2668
|
-
id: column.id,
|
|
2669
|
-
desc: nextDesc
|
|
2670
|
-
}];
|
|
2671
|
-
}
|
|
2672
|
-
return newSorting;
|
|
2673
|
-
});
|
|
2674
|
-
};
|
|
2675
|
-
column.getFirstSortDir = () => {
|
|
2676
|
-
var _ref, _column$columnDef$sor;
|
|
2677
|
-
const sortDescFirst = (_ref = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref : column.getAutoSortDir() === 'desc';
|
|
2678
|
-
return sortDescFirst ? 'desc' : 'asc';
|
|
2679
|
-
};
|
|
2680
|
-
column.getNextSortingOrder = multi => {
|
|
2681
|
-
var _table$options$enable, _table$options$enable2;
|
|
2682
|
-
const firstSortDirection = column.getFirstSortDir();
|
|
2683
|
-
const isSorted = column.getIsSorted();
|
|
2684
|
-
if (!isSorted) {
|
|
2685
|
-
return firstSortDirection;
|
|
2686
|
-
}
|
|
2687
|
-
if (isSorted !== firstSortDirection && ((_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && (
|
|
2688
|
-
// If enableSortRemove, enable in general
|
|
2689
|
-
multi ? (_table$options$enable2 = table.options.enableMultiRemove) != null ? _table$options$enable2 : true : true) // If multi, don't allow if enableMultiRemove))
|
|
2690
|
-
) {
|
|
2691
|
-
return false;
|
|
2692
|
-
}
|
|
2693
|
-
return isSorted === 'desc' ? 'asc' : 'desc';
|
|
2694
|
-
};
|
|
2695
|
-
column.getCanSort = () => {
|
|
2696
|
-
var _column$columnDef$ena, _table$options$enable3;
|
|
2697
|
-
return ((_column$columnDef$ena = column.columnDef.enableSorting) != null ? _column$columnDef$ena : true) && ((_table$options$enable3 = table.options.enableSorting) != null ? _table$options$enable3 : true) && !!column.accessorFn;
|
|
2698
|
-
};
|
|
2699
|
-
column.getCanMultiSort = () => {
|
|
2700
|
-
var _ref2, _column$columnDef$ena2;
|
|
2701
|
-
return (_ref2 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref2 : !!column.accessorFn;
|
|
2702
|
-
};
|
|
2703
|
-
column.getIsSorted = () => {
|
|
2704
|
-
var _table$getState$sorti;
|
|
2705
|
-
const columnSort = (_table$getState$sorti = table.getState().sorting) == null ? void 0 : _table$getState$sorti.find(d => d.id === column.id);
|
|
2706
|
-
return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';
|
|
2707
|
-
};
|
|
2708
|
-
column.getSortIndex = () => {
|
|
2709
|
-
var _table$getState$sorti2, _table$getState$sorti3;
|
|
2710
|
-
return (_table$getState$sorti2 = (_table$getState$sorti3 = table.getState().sorting) == null ? void 0 : _table$getState$sorti3.findIndex(d => d.id === column.id)) != null ? _table$getState$sorti2 : -1;
|
|
2711
|
-
};
|
|
2712
|
-
column.clearSorting = () => {
|
|
2713
|
-
//clear sorting for just 1 column
|
|
2714
|
-
table.setSorting(old => old != null && old.length ? old.filter(d => d.id !== column.id) : []);
|
|
2715
|
-
};
|
|
2716
|
-
column.getToggleSortingHandler = () => {
|
|
2717
|
-
const canSort = column.getCanSort();
|
|
2718
|
-
return e => {
|
|
2719
|
-
if (!canSort) return;
|
|
2720
|
-
e.persist == null || e.persist();
|
|
2721
|
-
column.toggleSorting == null || column.toggleSorting(undefined, column.getCanMultiSort() ? table.options.isMultiSortEvent == null ? void 0 : table.options.isMultiSortEvent(e) : false);
|
|
2722
|
-
};
|
|
2723
|
-
};
|
|
2724
|
-
},
|
|
2725
|
-
createTable: table => {
|
|
2726
|
-
table.setSorting = updater => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater);
|
|
2727
|
-
table.resetSorting = defaultState => {
|
|
2728
|
-
var _table$initialState$s, _table$initialState;
|
|
2729
|
-
table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);
|
|
2730
|
-
};
|
|
2731
|
-
table.getPreSortedRowModel = () => table.getGroupedRowModel();
|
|
2732
|
-
table.getSortedRowModel = () => {
|
|
2733
|
-
if (!table._getSortedRowModel && table.options.getSortedRowModel) {
|
|
2734
|
-
table._getSortedRowModel = table.options.getSortedRowModel(table);
|
|
2735
|
-
}
|
|
2736
|
-
if (table.options.manualSorting || !table._getSortedRowModel) {
|
|
2737
|
-
return table.getPreSortedRowModel();
|
|
2738
|
-
}
|
|
2739
|
-
return table._getSortedRowModel();
|
|
2740
|
-
};
|
|
2741
|
-
}
|
|
2742
|
-
};
|
|
2743
|
-
|
|
2744
|
-
const builtInFeatures = [Headers, ColumnVisibility, ColumnOrdering, ColumnPinning, ColumnFaceting, ColumnFiltering, GlobalFaceting,
|
|
2745
|
-
//depends on ColumnFaceting
|
|
2746
|
-
GlobalFiltering,
|
|
2747
|
-
//depends on ColumnFiltering
|
|
2748
|
-
RowSorting, ColumnGrouping,
|
|
2749
|
-
//depends on RowSorting
|
|
2750
|
-
RowExpanding, RowPagination, RowPinning, RowSelection, ColumnSizing];
|
|
2751
|
-
|
|
2752
|
-
//
|
|
2753
|
-
|
|
2754
|
-
function createTable(options) {
|
|
2755
|
-
var _options$_features, _options$initialState;
|
|
2756
|
-
const _features = [...builtInFeatures, ...((_options$_features = options._features) != null ? _options$_features : [])];
|
|
2757
|
-
let table = {
|
|
2758
|
-
_features
|
|
2759
|
-
};
|
|
2760
|
-
const defaultOptions = table._features.reduce((obj, feature) => {
|
|
2761
|
-
return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(table));
|
|
2762
|
-
}, {});
|
|
2763
|
-
const mergeOptions = options => {
|
|
2764
|
-
if (table.options.mergeOptions) {
|
|
2765
|
-
return table.options.mergeOptions(defaultOptions, options);
|
|
2766
|
-
}
|
|
2767
|
-
return {
|
|
2768
|
-
...defaultOptions,
|
|
2769
|
-
...options
|
|
2770
|
-
};
|
|
2771
|
-
};
|
|
2772
|
-
const coreInitialState = {};
|
|
2773
|
-
let initialState = {
|
|
2774
|
-
...coreInitialState,
|
|
2775
|
-
...((_options$initialState = options.initialState) != null ? _options$initialState : {})
|
|
2776
|
-
};
|
|
2777
|
-
table._features.forEach(feature => {
|
|
2778
|
-
var _feature$getInitialSt;
|
|
2779
|
-
initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
|
|
2780
|
-
});
|
|
2781
|
-
const queued = [];
|
|
2782
|
-
let queuedTimeout = false;
|
|
2783
|
-
const coreInstance = {
|
|
2784
|
-
_features,
|
|
2785
|
-
options: {
|
|
2786
|
-
...defaultOptions,
|
|
2787
|
-
...options
|
|
2788
|
-
},
|
|
2789
|
-
initialState,
|
|
2790
|
-
_queue: cb => {
|
|
2791
|
-
queued.push(cb);
|
|
2792
|
-
if (!queuedTimeout) {
|
|
2793
|
-
queuedTimeout = true;
|
|
2794
|
-
|
|
2795
|
-
// Schedule a microtask to run the queued callbacks after
|
|
2796
|
-
// the current call stack (render, etc) has finished.
|
|
2797
|
-
Promise.resolve().then(() => {
|
|
2798
|
-
while (queued.length) {
|
|
2799
|
-
queued.shift()();
|
|
2800
|
-
}
|
|
2801
|
-
queuedTimeout = false;
|
|
2802
|
-
}).catch(error => setTimeout(() => {
|
|
2803
|
-
throw error;
|
|
2804
|
-
}));
|
|
2805
|
-
}
|
|
2806
|
-
},
|
|
2807
|
-
reset: () => {
|
|
2808
|
-
table.setState(table.initialState);
|
|
2809
|
-
},
|
|
2810
|
-
setOptions: updater => {
|
|
2811
|
-
const newOptions = functionalUpdate(updater, table.options);
|
|
2812
|
-
table.options = mergeOptions(newOptions);
|
|
2813
|
-
},
|
|
2814
|
-
getState: () => {
|
|
2815
|
-
return table.options.state;
|
|
2816
|
-
},
|
|
2817
|
-
setState: updater => {
|
|
2818
|
-
table.options.onStateChange == null || table.options.onStateChange(updater);
|
|
2819
|
-
},
|
|
2820
|
-
_getRowId: (row, index, parent) => {
|
|
2821
|
-
var _table$options$getRow;
|
|
2822
|
-
return (_table$options$getRow = table.options.getRowId == null ? void 0 : table.options.getRowId(row, index, parent)) != null ? _table$options$getRow : `${parent ? [parent.id, index].join('.') : index}`;
|
|
2823
|
-
},
|
|
2824
|
-
getCoreRowModel: () => {
|
|
2825
|
-
if (!table._getCoreRowModel) {
|
|
2826
|
-
table._getCoreRowModel = table.options.getCoreRowModel(table);
|
|
2827
|
-
}
|
|
2828
|
-
return table._getCoreRowModel();
|
|
2829
|
-
},
|
|
2830
|
-
// The final calls start at the bottom of the model,
|
|
2831
|
-
// expanded rows, which then work their way up
|
|
2832
|
-
|
|
2833
|
-
getRowModel: () => {
|
|
2834
|
-
return table.getPaginationRowModel();
|
|
2835
|
-
},
|
|
2836
|
-
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
2837
|
-
getRow: (id, searchAll) => {
|
|
2838
|
-
let row = (searchAll ? table.getPrePaginationRowModel() : table.getRowModel()).rowsById[id];
|
|
2839
|
-
if (!row) {
|
|
2840
|
-
row = table.getCoreRowModel().rowsById[id];
|
|
2841
|
-
if (!row) {
|
|
2842
|
-
throw new Error();
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
return row;
|
|
2846
|
-
},
|
|
2847
|
-
_getDefaultColumnDef: memo(() => [table.options.defaultColumn], defaultColumn => {
|
|
2848
|
-
var _defaultColumn;
|
|
2849
|
-
defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
|
|
2850
|
-
return {
|
|
2851
|
-
header: props => {
|
|
2852
|
-
const resolvedColumnDef = props.header.column.columnDef;
|
|
2853
|
-
if (resolvedColumnDef.accessorKey) {
|
|
2854
|
-
return resolvedColumnDef.accessorKey;
|
|
2855
|
-
}
|
|
2856
|
-
if (resolvedColumnDef.accessorFn) {
|
|
2857
|
-
return resolvedColumnDef.id;
|
|
2858
|
-
}
|
|
2859
|
-
return null;
|
|
2860
|
-
},
|
|
2861
|
-
// footer: props => props.header.column.id,
|
|
2862
|
-
cell: props => {
|
|
2863
|
-
var _props$renderValue$to, _props$renderValue;
|
|
2864
|
-
return (_props$renderValue$to = (_props$renderValue = props.renderValue()) == null || _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) != null ? _props$renderValue$to : null;
|
|
2865
|
-
},
|
|
2866
|
-
...table._features.reduce((obj, feature) => {
|
|
2867
|
-
return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
|
|
2868
|
-
}, {}),
|
|
2869
|
-
...defaultColumn
|
|
2870
|
-
};
|
|
2871
|
-
}, getMemoOptions(options, 'debugColumns')),
|
|
2872
|
-
_getColumnDefs: () => table.options.columns,
|
|
2873
|
-
getAllColumns: memo(() => [table._getColumnDefs()], columnDefs => {
|
|
2874
|
-
const recurseColumns = function (columnDefs, parent, depth) {
|
|
2875
|
-
if (depth === void 0) {
|
|
2876
|
-
depth = 0;
|
|
2877
|
-
}
|
|
2878
|
-
return columnDefs.map(columnDef => {
|
|
2879
|
-
const column = createColumn(table, columnDef, depth, parent);
|
|
2880
|
-
const groupingColumnDef = columnDef;
|
|
2881
|
-
column.columns = groupingColumnDef.columns ? recurseColumns(groupingColumnDef.columns, column, depth + 1) : [];
|
|
2882
|
-
return column;
|
|
2883
|
-
});
|
|
2884
|
-
};
|
|
2885
|
-
return recurseColumns(columnDefs);
|
|
2886
|
-
}, getMemoOptions(options, 'debugColumns')),
|
|
2887
|
-
getAllFlatColumns: memo(() => [table.getAllColumns()], allColumns => {
|
|
2888
|
-
return allColumns.flatMap(column => {
|
|
2889
|
-
return column.getFlatColumns();
|
|
2890
|
-
});
|
|
2891
|
-
}, getMemoOptions(options, 'debugColumns')),
|
|
2892
|
-
_getAllFlatColumnsById: memo(() => [table.getAllFlatColumns()], flatColumns => {
|
|
2893
|
-
return flatColumns.reduce((acc, column) => {
|
|
2894
|
-
acc[column.id] = column;
|
|
2895
|
-
return acc;
|
|
2896
|
-
}, {});
|
|
2897
|
-
}, getMemoOptions(options, 'debugColumns')),
|
|
2898
|
-
getAllLeafColumns: memo(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns) => {
|
|
2899
|
-
let leafColumns = allColumns.flatMap(column => column.getLeafColumns());
|
|
2900
|
-
return orderColumns(leafColumns);
|
|
2901
|
-
}, getMemoOptions(options, 'debugColumns')),
|
|
2902
|
-
getColumn: columnId => {
|
|
2903
|
-
const column = table._getAllFlatColumnsById()[columnId];
|
|
2904
|
-
return column;
|
|
2905
|
-
}
|
|
2906
|
-
};
|
|
2907
|
-
Object.assign(table, coreInstance);
|
|
2908
|
-
for (let index = 0; index < table._features.length; index++) {
|
|
2909
|
-
const feature = table._features[index];
|
|
2910
|
-
feature == null || feature.createTable == null || feature.createTable(table);
|
|
2911
|
-
}
|
|
2912
|
-
return table;
|
|
2913
|
-
}
|
|
2914
|
-
|
|
2915
|
-
function getCoreRowModel() {
|
|
2916
|
-
return table => memo(() => [table.options.data], data => {
|
|
2917
|
-
const rowModel = {
|
|
2918
|
-
rows: [],
|
|
2919
|
-
flatRows: [],
|
|
2920
|
-
rowsById: {}
|
|
2921
|
-
};
|
|
2922
|
-
const accessRows = function (originalRows, depth, parentRow) {
|
|
2923
|
-
if (depth === void 0) {
|
|
2924
|
-
depth = 0;
|
|
2925
|
-
}
|
|
2926
|
-
const rows = [];
|
|
2927
|
-
for (let i = 0; i < originalRows.length; i++) {
|
|
2928
|
-
// This could be an expensive check at scale, so we should move it somewhere else, but where?
|
|
2929
|
-
// if (!id) {
|
|
2930
|
-
// if ("production" !== 'production') {
|
|
2931
|
-
// throw new Error(`getRowId expected an ID, but got ${id}`)
|
|
2932
|
-
// }
|
|
2933
|
-
// }
|
|
2934
|
-
|
|
2935
|
-
// Make the row
|
|
2936
|
-
const row = createRow(table, table._getRowId(originalRows[i], i, parentRow), originalRows[i], i, depth, undefined, parentRow == null ? void 0 : parentRow.id);
|
|
2937
|
-
|
|
2938
|
-
// Keep track of every row in a flat array
|
|
2939
|
-
rowModel.flatRows.push(row);
|
|
2940
|
-
// Also keep track of every row by its ID
|
|
2941
|
-
rowModel.rowsById[row.id] = row;
|
|
2942
|
-
// Push table row into parent
|
|
2943
|
-
rows.push(row);
|
|
2944
|
-
|
|
2945
|
-
// Get the original subrows
|
|
2946
|
-
if (table.options.getSubRows) {
|
|
2947
|
-
var _row$originalSubRows;
|
|
2948
|
-
row.originalSubRows = table.options.getSubRows(originalRows[i], i);
|
|
2949
|
-
|
|
2950
|
-
// Then recursively access them
|
|
2951
|
-
if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) {
|
|
2952
|
-
row.subRows = accessRows(row.originalSubRows, depth + 1, row);
|
|
2953
|
-
}
|
|
2954
|
-
}
|
|
2955
|
-
}
|
|
2956
|
-
return rows;
|
|
2957
|
-
};
|
|
2958
|
-
rowModel.rows = accessRows(data);
|
|
2959
|
-
return rowModel;
|
|
2960
|
-
}, getMemoOptions(table.options, 'debugTable', 'getRowModel', () => table._autoResetPageIndex()));
|
|
2961
|
-
}
|
|
2962
|
-
function expandRows(rowModel) {
|
|
2963
|
-
const expandedRows = [];
|
|
2964
|
-
const handleRow = row => {
|
|
2965
|
-
var _row$subRows;
|
|
2966
|
-
expandedRows.push(row);
|
|
2967
|
-
if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getIsExpanded()) {
|
|
2968
|
-
row.subRows.forEach(handleRow);
|
|
2969
|
-
}
|
|
2970
|
-
};
|
|
2971
|
-
rowModel.rows.forEach(handleRow);
|
|
2972
|
-
return {
|
|
2973
|
-
rows: expandedRows,
|
|
2974
|
-
flatRows: rowModel.flatRows,
|
|
2975
|
-
rowsById: rowModel.rowsById
|
|
2976
|
-
};
|
|
2977
|
-
}
|
|
2978
|
-
|
|
2979
|
-
function filterRows(rows, filterRowImpl, table) {
|
|
2980
|
-
if (table.options.filterFromLeafRows) {
|
|
2981
|
-
return filterRowModelFromLeafs(rows, filterRowImpl, table);
|
|
2982
|
-
}
|
|
2983
|
-
return filterRowModelFromRoot(rows, filterRowImpl, table);
|
|
2984
|
-
}
|
|
2985
|
-
function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
|
|
2986
|
-
var _table$options$maxLea;
|
|
2987
|
-
const newFilteredFlatRows = [];
|
|
2988
|
-
const newFilteredRowsById = {};
|
|
2989
|
-
const maxDepth = (_table$options$maxLea = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea : 100;
|
|
2990
|
-
const recurseFilterRows = function (rowsToFilter, depth) {
|
|
2991
|
-
if (depth === void 0) {
|
|
2992
|
-
depth = 0;
|
|
2993
|
-
}
|
|
2994
|
-
const rows = [];
|
|
2995
|
-
|
|
2996
|
-
// Filter from children up first
|
|
2997
|
-
for (let i = 0; i < rowsToFilter.length; i++) {
|
|
2998
|
-
var _row$subRows;
|
|
2999
|
-
let row = rowsToFilter[i];
|
|
3000
|
-
const newRow = createRow(table, row.id, row.original, row.index, row.depth, undefined, row.parentId);
|
|
3001
|
-
newRow.columnFilters = row.columnFilters;
|
|
3002
|
-
if ((_row$subRows = row.subRows) != null && _row$subRows.length && depth < maxDepth) {
|
|
3003
|
-
newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
|
|
3004
|
-
row = newRow;
|
|
3005
|
-
if (filterRow(row) && !newRow.subRows.length) {
|
|
3006
|
-
rows.push(row);
|
|
3007
|
-
newFilteredRowsById[row.id] = row;
|
|
3008
|
-
newFilteredFlatRows.push(row);
|
|
3009
|
-
continue;
|
|
3010
|
-
}
|
|
3011
|
-
if (filterRow(row) || newRow.subRows.length) {
|
|
3012
|
-
rows.push(row);
|
|
3013
|
-
newFilteredRowsById[row.id] = row;
|
|
3014
|
-
newFilteredFlatRows.push(row);
|
|
3015
|
-
continue;
|
|
3016
|
-
}
|
|
3017
|
-
} else {
|
|
3018
|
-
row = newRow;
|
|
3019
|
-
if (filterRow(row)) {
|
|
3020
|
-
rows.push(row);
|
|
3021
|
-
newFilteredRowsById[row.id] = row;
|
|
3022
|
-
newFilteredFlatRows.push(row);
|
|
3023
|
-
}
|
|
3024
|
-
}
|
|
3025
|
-
}
|
|
3026
|
-
return rows;
|
|
3027
|
-
};
|
|
3028
|
-
return {
|
|
3029
|
-
rows: recurseFilterRows(rowsToFilter),
|
|
3030
|
-
flatRows: newFilteredFlatRows,
|
|
3031
|
-
rowsById: newFilteredRowsById
|
|
3032
|
-
};
|
|
3033
|
-
}
|
|
3034
|
-
function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
|
|
3035
|
-
var _table$options$maxLea2;
|
|
3036
|
-
const newFilteredFlatRows = [];
|
|
3037
|
-
const newFilteredRowsById = {};
|
|
3038
|
-
const maxDepth = (_table$options$maxLea2 = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea2 : 100;
|
|
3039
|
-
|
|
3040
|
-
// Filters top level and nested rows
|
|
3041
|
-
const recurseFilterRows = function (rowsToFilter, depth) {
|
|
3042
|
-
if (depth === void 0) {
|
|
3043
|
-
depth = 0;
|
|
3044
|
-
}
|
|
3045
|
-
// Filter from parents downward first
|
|
3046
|
-
|
|
3047
|
-
const rows = [];
|
|
3048
|
-
|
|
3049
|
-
// Apply the filter to any subRows
|
|
3050
|
-
for (let i = 0; i < rowsToFilter.length; i++) {
|
|
3051
|
-
let row = rowsToFilter[i];
|
|
3052
|
-
const pass = filterRow(row);
|
|
3053
|
-
if (pass) {
|
|
3054
|
-
var _row$subRows2;
|
|
3055
|
-
if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length && depth < maxDepth) {
|
|
3056
|
-
const newRow = createRow(table, row.id, row.original, row.index, row.depth, undefined, row.parentId);
|
|
3057
|
-
newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
|
|
3058
|
-
row = newRow;
|
|
3059
|
-
}
|
|
3060
|
-
rows.push(row);
|
|
3061
|
-
newFilteredFlatRows.push(row);
|
|
3062
|
-
newFilteredRowsById[row.id] = row;
|
|
3063
|
-
}
|
|
3064
|
-
}
|
|
3065
|
-
return rows;
|
|
3066
|
-
};
|
|
3067
|
-
return {
|
|
3068
|
-
rows: recurseFilterRows(rowsToFilter),
|
|
3069
|
-
flatRows: newFilteredFlatRows,
|
|
3070
|
-
rowsById: newFilteredRowsById
|
|
3071
|
-
};
|
|
3072
|
-
}
|
|
3073
|
-
|
|
3074
|
-
function getFilteredRowModel() {
|
|
3075
|
-
return table => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {
|
|
3076
|
-
if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
|
|
3077
|
-
for (let i = 0; i < rowModel.flatRows.length; i++) {
|
|
3078
|
-
rowModel.flatRows[i].columnFilters = {};
|
|
3079
|
-
rowModel.flatRows[i].columnFiltersMeta = {};
|
|
3080
|
-
}
|
|
3081
|
-
return rowModel;
|
|
3082
|
-
}
|
|
3083
|
-
const resolvedColumnFilters = [];
|
|
3084
|
-
const resolvedGlobalFilters = [];
|
|
3085
|
-
(columnFilters != null ? columnFilters : []).forEach(d => {
|
|
3086
|
-
var _filterFn$resolveFilt;
|
|
3087
|
-
const column = table.getColumn(d.id);
|
|
3088
|
-
if (!column) {
|
|
3089
|
-
return;
|
|
3090
|
-
}
|
|
3091
|
-
const filterFn = column.getFilterFn();
|
|
3092
|
-
if (!filterFn) {
|
|
3093
|
-
return;
|
|
3094
|
-
}
|
|
3095
|
-
resolvedColumnFilters.push({
|
|
3096
|
-
id: d.id,
|
|
3097
|
-
filterFn,
|
|
3098
|
-
resolvedValue: (_filterFn$resolveFilt = filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) != null ? _filterFn$resolveFilt : d.value
|
|
3099
|
-
});
|
|
3100
|
-
});
|
|
3101
|
-
const filterableIds = (columnFilters != null ? columnFilters : []).map(d => d.id);
|
|
3102
|
-
const globalFilterFn = table.getGlobalFilterFn();
|
|
3103
|
-
const globallyFilterableColumns = table.getAllLeafColumns().filter(column => column.getCanGlobalFilter());
|
|
3104
|
-
if (globalFilter && globalFilterFn && globallyFilterableColumns.length) {
|
|
3105
|
-
filterableIds.push('__global__');
|
|
3106
|
-
globallyFilterableColumns.forEach(column => {
|
|
3107
|
-
var _globalFilterFn$resol;
|
|
3108
|
-
resolvedGlobalFilters.push({
|
|
3109
|
-
id: column.id,
|
|
3110
|
-
filterFn: globalFilterFn,
|
|
3111
|
-
resolvedValue: (_globalFilterFn$resol = globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) != null ? _globalFilterFn$resol : globalFilter
|
|
3112
|
-
});
|
|
3113
|
-
});
|
|
3114
|
-
}
|
|
3115
|
-
let currentColumnFilter;
|
|
3116
|
-
let currentGlobalFilter;
|
|
3117
|
-
|
|
3118
|
-
// Flag the prefiltered row model with each filter state
|
|
3119
|
-
for (let j = 0; j < rowModel.flatRows.length; j++) {
|
|
3120
|
-
const row = rowModel.flatRows[j];
|
|
3121
|
-
row.columnFilters = {};
|
|
3122
|
-
if (resolvedColumnFilters.length) {
|
|
3123
|
-
for (let i = 0; i < resolvedColumnFilters.length; i++) {
|
|
3124
|
-
currentColumnFilter = resolvedColumnFilters[i];
|
|
3125
|
-
const id = currentColumnFilter.id;
|
|
3126
|
-
|
|
3127
|
-
// Tag the row with the column filter state
|
|
3128
|
-
row.columnFilters[id] = currentColumnFilter.filterFn(row, id, currentColumnFilter.resolvedValue, filterMeta => {
|
|
3129
|
-
row.columnFiltersMeta[id] = filterMeta;
|
|
3130
|
-
});
|
|
3131
|
-
}
|
|
3132
|
-
}
|
|
3133
|
-
if (resolvedGlobalFilters.length) {
|
|
3134
|
-
for (let i = 0; i < resolvedGlobalFilters.length; i++) {
|
|
3135
|
-
currentGlobalFilter = resolvedGlobalFilters[i];
|
|
3136
|
-
const id = currentGlobalFilter.id;
|
|
3137
|
-
// Tag the row with the first truthy global filter state
|
|
3138
|
-
if (currentGlobalFilter.filterFn(row, id, currentGlobalFilter.resolvedValue, filterMeta => {
|
|
3139
|
-
row.columnFiltersMeta[id] = filterMeta;
|
|
3140
|
-
})) {
|
|
3141
|
-
row.columnFilters.__global__ = true;
|
|
3142
|
-
break;
|
|
3143
|
-
}
|
|
3144
|
-
}
|
|
3145
|
-
if (row.columnFilters.__global__ !== true) {
|
|
3146
|
-
row.columnFilters.__global__ = false;
|
|
3147
|
-
}
|
|
3148
|
-
}
|
|
3149
|
-
}
|
|
3150
|
-
const filterRowsImpl = row => {
|
|
3151
|
-
// Horizontally filter rows through each column
|
|
3152
|
-
for (let i = 0; i < filterableIds.length; i++) {
|
|
3153
|
-
if (row.columnFilters[filterableIds[i]] === false) {
|
|
3154
|
-
return false;
|
|
3155
|
-
}
|
|
3156
|
-
}
|
|
3157
|
-
return true;
|
|
3158
|
-
};
|
|
3159
|
-
|
|
3160
|
-
// Filter final rows using all of the active filters
|
|
3161
|
-
return filterRows(rowModel.rows, filterRowsImpl, table);
|
|
3162
|
-
}, getMemoOptions(table.options, 'debugTable', 'getFilteredRowModel', () => table._autoResetPageIndex()));
|
|
3163
|
-
}
|
|
3164
|
-
|
|
3165
|
-
function getPaginationRowModel(opts) {
|
|
3166
|
-
return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel(), table.options.paginateExpandedRows ? undefined : table.getState().expanded], (pagination, rowModel) => {
|
|
3167
|
-
if (!rowModel.rows.length) {
|
|
3168
|
-
return rowModel;
|
|
3169
|
-
}
|
|
3170
|
-
const {
|
|
3171
|
-
pageSize,
|
|
3172
|
-
pageIndex
|
|
3173
|
-
} = pagination;
|
|
3174
|
-
let {
|
|
3175
|
-
rows,
|
|
3176
|
-
flatRows,
|
|
3177
|
-
rowsById
|
|
3178
|
-
} = rowModel;
|
|
3179
|
-
const pageStart = pageSize * pageIndex;
|
|
3180
|
-
const pageEnd = pageStart + pageSize;
|
|
3181
|
-
rows = rows.slice(pageStart, pageEnd);
|
|
3182
|
-
let paginatedRowModel;
|
|
3183
|
-
if (!table.options.paginateExpandedRows) {
|
|
3184
|
-
paginatedRowModel = expandRows({
|
|
3185
|
-
rows,
|
|
3186
|
-
flatRows,
|
|
3187
|
-
rowsById
|
|
3188
|
-
});
|
|
3189
|
-
} else {
|
|
3190
|
-
paginatedRowModel = {
|
|
3191
|
-
rows,
|
|
3192
|
-
flatRows,
|
|
3193
|
-
rowsById
|
|
3194
|
-
};
|
|
3195
|
-
}
|
|
3196
|
-
paginatedRowModel.flatRows = [];
|
|
3197
|
-
const handleRow = row => {
|
|
3198
|
-
paginatedRowModel.flatRows.push(row);
|
|
3199
|
-
if (row.subRows.length) {
|
|
3200
|
-
row.subRows.forEach(handleRow);
|
|
3201
|
-
}
|
|
3202
|
-
};
|
|
3203
|
-
paginatedRowModel.rows.forEach(handleRow);
|
|
3204
|
-
return paginatedRowModel;
|
|
3205
|
-
}, getMemoOptions(table.options, 'debugTable'));
|
|
3206
|
-
}
|
|
3207
|
-
|
|
3208
|
-
function getSortedRowModel() {
|
|
3209
|
-
return table => memo(() => [table.getState().sorting, table.getPreSortedRowModel()], (sorting, rowModel) => {
|
|
3210
|
-
if (!rowModel.rows.length || !(sorting != null && sorting.length)) {
|
|
3211
|
-
return rowModel;
|
|
3212
|
-
}
|
|
3213
|
-
const sortingState = table.getState().sorting;
|
|
3214
|
-
const sortedFlatRows = [];
|
|
3215
|
-
|
|
3216
|
-
// Filter out sortings that correspond to non existing columns
|
|
3217
|
-
const availableSorting = sortingState.filter(sort => {
|
|
3218
|
-
var _table$getColumn;
|
|
3219
|
-
return (_table$getColumn = table.getColumn(sort.id)) == null ? void 0 : _table$getColumn.getCanSort();
|
|
3220
|
-
});
|
|
3221
|
-
const columnInfoById = {};
|
|
3222
|
-
availableSorting.forEach(sortEntry => {
|
|
3223
|
-
const column = table.getColumn(sortEntry.id);
|
|
3224
|
-
if (!column) return;
|
|
3225
|
-
columnInfoById[sortEntry.id] = {
|
|
3226
|
-
sortUndefined: column.columnDef.sortUndefined,
|
|
3227
|
-
invertSorting: column.columnDef.invertSorting,
|
|
3228
|
-
sortingFn: column.getSortingFn()
|
|
3229
|
-
};
|
|
3230
|
-
});
|
|
3231
|
-
const sortData = rows => {
|
|
3232
|
-
// This will also perform a stable sorting using the row index
|
|
3233
|
-
// if needed.
|
|
3234
|
-
const sortedData = rows.map(row => ({
|
|
3235
|
-
...row
|
|
3236
|
-
}));
|
|
3237
|
-
sortedData.sort((rowA, rowB) => {
|
|
3238
|
-
for (let i = 0; i < availableSorting.length; i += 1) {
|
|
3239
|
-
var _sortEntry$desc;
|
|
3240
|
-
const sortEntry = availableSorting[i];
|
|
3241
|
-
const columnInfo = columnInfoById[sortEntry.id];
|
|
3242
|
-
const sortUndefined = columnInfo.sortUndefined;
|
|
3243
|
-
const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
|
|
3244
|
-
let sortInt = 0;
|
|
3245
|
-
|
|
3246
|
-
// All sorting ints should always return in ascending order
|
|
3247
|
-
if (sortUndefined) {
|
|
3248
|
-
const aValue = rowA.getValue(sortEntry.id);
|
|
3249
|
-
const bValue = rowB.getValue(sortEntry.id);
|
|
3250
|
-
const aUndefined = aValue === undefined;
|
|
3251
|
-
const bUndefined = bValue === undefined;
|
|
3252
|
-
if (aUndefined || bUndefined) {
|
|
3253
|
-
if (sortUndefined === 'first') return aUndefined ? -1 : 1;
|
|
3254
|
-
if (sortUndefined === 'last') return aUndefined ? 1 : -1;
|
|
3255
|
-
sortInt = aUndefined && bUndefined ? 0 : aUndefined ? sortUndefined : -sortUndefined;
|
|
3256
|
-
}
|
|
3257
|
-
}
|
|
3258
|
-
if (sortInt === 0) {
|
|
3259
|
-
sortInt = columnInfo.sortingFn(rowA, rowB, sortEntry.id);
|
|
3260
|
-
}
|
|
3261
|
-
|
|
3262
|
-
// If sorting is non-zero, take care of desc and inversion
|
|
3263
|
-
if (sortInt !== 0) {
|
|
3264
|
-
if (isDesc) {
|
|
3265
|
-
sortInt *= -1;
|
|
3266
|
-
}
|
|
3267
|
-
if (columnInfo.invertSorting) {
|
|
3268
|
-
sortInt *= -1;
|
|
3269
|
-
}
|
|
3270
|
-
return sortInt;
|
|
3271
|
-
}
|
|
3272
|
-
}
|
|
3273
|
-
return rowA.index - rowB.index;
|
|
3274
|
-
});
|
|
3275
|
-
|
|
3276
|
-
// If there are sub-rows, sort them
|
|
3277
|
-
sortedData.forEach(row => {
|
|
3278
|
-
var _row$subRows;
|
|
3279
|
-
sortedFlatRows.push(row);
|
|
3280
|
-
if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
|
|
3281
|
-
row.subRows = sortData(row.subRows);
|
|
3282
|
-
}
|
|
3283
|
-
});
|
|
3284
|
-
return sortedData;
|
|
3285
|
-
};
|
|
3286
|
-
return {
|
|
3287
|
-
rows: sortData(rowModel.rows),
|
|
3288
|
-
flatRows: sortedFlatRows,
|
|
3289
|
-
rowsById: rowModel.rowsById
|
|
3290
|
-
};
|
|
3291
|
-
}, getMemoOptions(table.options, 'debugTable', 'getSortedRowModel', () => table._autoResetPageIndex()));
|
|
3292
|
-
}
|
|
3293
|
-
|
|
3294
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3295
|
-
/**
|
|
3296
|
-
* All properties that should be excluded from the deep copy of an HTML element.
|
|
3297
|
-
*/
|
|
3298
|
-
const excludedProps = new Set([
|
|
3299
|
-
// Text and content-related properties
|
|
3300
|
-
'textContent',
|
|
3301
|
-
'innerText',
|
|
3302
|
-
'outerText',
|
|
3303
|
-
'innerHTML',
|
|
3304
|
-
'outerHTML',
|
|
3305
|
-
'text',
|
|
3306
|
-
// Form element properties
|
|
3307
|
-
'value',
|
|
3308
|
-
'defaultValue',
|
|
3309
|
-
'checked',
|
|
3310
|
-
'defaultChecked',
|
|
3311
|
-
'selectionStart',
|
|
3312
|
-
'selectionEnd',
|
|
3313
|
-
'selectionDirection',
|
|
3314
|
-
'form',
|
|
3315
|
-
'willValidate',
|
|
3316
|
-
'validity',
|
|
3317
|
-
'validationMessage',
|
|
3318
|
-
'labels',
|
|
3319
|
-
'list',
|
|
3320
|
-
'maxLength',
|
|
3321
|
-
'minLength',
|
|
3322
|
-
'valueAsDate',
|
|
3323
|
-
'valueAsNumber',
|
|
3324
|
-
// Editability and namespaces
|
|
3325
|
-
'contentEditable',
|
|
3326
|
-
'isContentEditable',
|
|
3327
|
-
'namespaceURI',
|
|
3328
|
-
// Child-related properties (handled recursively)
|
|
3329
|
-
'attributes',
|
|
3330
|
-
'children',
|
|
3331
|
-
'childNodes',
|
|
3332
|
-
'firstChild',
|
|
3333
|
-
'lastChild',
|
|
3334
|
-
// Blazor-related properties
|
|
3335
|
-
'origin',
|
|
3336
|
-
'dataset',
|
|
3337
|
-
'attributeStyleMap',
|
|
3338
|
-
'prefix',
|
|
3339
|
-
'localName',
|
|
3340
|
-
'tagName',
|
|
3341
|
-
'shadowRoot',
|
|
3342
|
-
'assignedSlot',
|
|
3343
|
-
'scrollWidth',
|
|
3344
|
-
'scrollHeight',
|
|
3345
|
-
'clientTop',
|
|
3346
|
-
'clientLeft',
|
|
3347
|
-
'clientWidth',
|
|
3348
|
-
'clientHeight',
|
|
3349
|
-
'firstElementChild',
|
|
3350
|
-
'lastElementChild',
|
|
3351
|
-
'childElementCount',
|
|
3352
|
-
'previousElementSibling',
|
|
3353
|
-
'nextElementSibling',
|
|
3354
|
-
'currentCSSZoom',
|
|
3355
|
-
'nodeType',
|
|
3356
|
-
'nodeName',
|
|
3357
|
-
'baseURI',
|
|
3358
|
-
'isConnected',
|
|
3359
|
-
'ownerDocument',
|
|
3360
|
-
'parentNode',
|
|
3361
|
-
'parentElement',
|
|
3362
|
-
'previousSibling',
|
|
3363
|
-
'nextSibling',
|
|
3364
|
-
'ELEMENT_NODE',
|
|
3365
|
-
'ATTRIBUTE_NODE',
|
|
3366
|
-
'TEXT_NODE',
|
|
3367
|
-
'CDATA_SECTION_NODE',
|
|
3368
|
-
'ENTITY_REFERENCE_NODE',
|
|
3369
|
-
'ENTITY_NODE',
|
|
3370
|
-
'PROCESSING_INSTRUCTION_NODE',
|
|
3371
|
-
'COMMENT_NODE',
|
|
3372
|
-
'DOCUMENT_NODE',
|
|
3373
|
-
'DOCUMENT_TYPE_NODE',
|
|
3374
|
-
'DOCUMENT_FRAGMENT_NODE',
|
|
3375
|
-
'NOTATION_NODE',
|
|
3376
|
-
'DOCUMENT_POSITION_DISCONNECTED',
|
|
3377
|
-
'DOCUMENT_POSITION_PRECEDING',
|
|
3378
|
-
'DOCUMENT_POSITION_FOLLOWING',
|
|
3379
|
-
'DOCUMENT_POSITION_CONTAINS',
|
|
3380
|
-
'DOCUMENT_POSITION_CONTAINED_BY',
|
|
3381
|
-
'DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC',
|
|
3382
|
-
]);
|
|
3383
|
-
/**
|
|
3384
|
-
* Deep copy an HTML element with all its attributes, properties, and child nodes.
|
|
3385
|
-
* This method is useful for creating a clone of an element that can be safely modified without affecting the original.
|
|
3386
|
-
* @param {HTMLElement} element - The HTML element to copy.
|
|
3387
|
-
* @returns {HTMLElement} - A deep copy of the HTML element.
|
|
3388
|
-
* @example const copy = deepCopyElement(document.getElementById('myElement'));
|
|
3389
|
-
*/
|
|
3390
|
-
function deepCopyElement(element) {
|
|
3391
|
-
const copy = document.createElement(element.tagName);
|
|
3392
|
-
// ✅ Copy attributes
|
|
3393
|
-
Array.from(element.attributes).forEach(attr => {
|
|
3394
|
-
copy.setAttribute(attr.name, attr.value);
|
|
3395
|
-
});
|
|
3396
|
-
// ✅ Dynamically extract relevant properties
|
|
3397
|
-
const properties = new Set();
|
|
3398
|
-
// Collect only own enumerable properties
|
|
3399
|
-
Object.keys(element).forEach(key => properties.add(key));
|
|
3400
|
-
// Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
|
|
3401
|
-
let proto = Object.getPrototypeOf(element);
|
|
3402
|
-
while (proto && proto !== HTMLElement.prototype) {
|
|
3403
|
-
Object.keys(proto).forEach(key => properties.add(key));
|
|
3404
|
-
proto = Object.getPrototypeOf(proto);
|
|
3405
|
-
}
|
|
3406
|
-
// ✅ Filter and copy only non-function properties (methods are excluded) and non-event listeners
|
|
3407
|
-
properties.forEach(prop => {
|
|
3408
|
-
if (typeof element[prop] !== 'function' && // Ignore methods
|
|
3409
|
-
!prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
|
|
3410
|
-
!excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
|
|
3411
|
-
) {
|
|
3412
|
-
try {
|
|
3413
|
-
copy[prop] = element[prop];
|
|
3414
|
-
}
|
|
3415
|
-
catch (error) {
|
|
3416
|
-
console.warn(`Could not copy property ${prop}:`, error.message);
|
|
3417
|
-
}
|
|
3418
|
-
}
|
|
3419
|
-
});
|
|
3420
|
-
// ✅ Copy dataset separately
|
|
3421
|
-
Object.assign(copy.dataset, element.dataset);
|
|
3422
|
-
// ✅ Handle form elements specifically
|
|
3423
|
-
if (element instanceof HTMLInputElement) {
|
|
3424
|
-
copy.value = element.value;
|
|
3425
|
-
copy.checked = element.checked;
|
|
3426
|
-
copy.defaultValue = element.defaultValue;
|
|
3427
|
-
copy.defaultChecked = element.defaultChecked;
|
|
3428
|
-
copy.selectionStart = element.selectionStart;
|
|
3429
|
-
copy.selectionEnd = element.selectionEnd;
|
|
3430
|
-
copy.selectionDirection = element.selectionDirection;
|
|
3431
|
-
}
|
|
3432
|
-
else if (element instanceof HTMLTextAreaElement) {
|
|
3433
|
-
copy.value = element.value;
|
|
3434
|
-
copy.defaultValue = element.defaultValue;
|
|
3435
|
-
copy.selectionStart = element.selectionStart;
|
|
3436
|
-
copy.selectionEnd = element.selectionEnd;
|
|
3437
|
-
copy.selectionDirection =
|
|
3438
|
-
element.selectionDirection;
|
|
3439
|
-
}
|
|
3440
|
-
else if (element instanceof HTMLSelectElement) {
|
|
3441
|
-
copy.value = element.value;
|
|
3442
|
-
copy.selectedIndex = element.selectedIndex;
|
|
3443
|
-
}
|
|
3444
|
-
// ✅ Recursively copy child nodes (prevent duplicates)
|
|
3445
|
-
element.childNodes.forEach(child => {
|
|
3446
|
-
let childCopy;
|
|
3447
|
-
if (child.nodeType === Node.ELEMENT_NODE) {
|
|
3448
|
-
childCopy = deepCopyElement(child);
|
|
3449
|
-
}
|
|
3450
|
-
else {
|
|
3451
|
-
childCopy = child.cloneNode(true);
|
|
3452
|
-
}
|
|
3453
|
-
copy.appendChild(childCopy);
|
|
3454
|
-
});
|
|
3455
|
-
return copy;
|
|
3456
|
-
}
|
|
3457
|
-
|
|
3458
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3459
|
-
/**
|
|
3460
|
-
* Debounce function to prevent multiple calls in a short
|
|
3461
|
-
* period of time (e.g., input events).
|
|
3462
|
-
* @param {T} func - Function to be debounced
|
|
3463
|
-
* @param {number} wait - Time in milliseconds
|
|
3464
|
-
* @returns {(...args: Parameters<T>) => void} - Debounced function
|
|
3465
|
-
*/
|
|
3466
|
-
function debounce(func, wait) {
|
|
3467
|
-
let timeout;
|
|
3468
|
-
return function executedFunction(...args) {
|
|
3469
|
-
const later = () => {
|
|
3470
|
-
clearTimeout(timeout);
|
|
3471
|
-
func(...args);
|
|
3472
|
-
};
|
|
3473
|
-
clearTimeout(timeout);
|
|
3474
|
-
timeout = setTimeout(later, wait);
|
|
3475
|
-
};
|
|
3476
|
-
}
|
|
3477
|
-
|
|
3478
|
-
const nvDatagridCss = "nv-datagrid{--nv-datagrid-border-default:var(\n --components-form-field-border-default\n );--nv-datagrid-border-hover:var(--components-form-field-border-hover);--nv-datagrid-border-focus:var(--components-form-field-border-default);--nv-datagrid-background-default:var(\n --components-form-field-background-default\n );--nv-datagrid-background-checked:var(\n --components-form-field-background-checked\n );--nv-datagrid-background-disabled:var(\n --components-form-field-background-disabled\n );--nv-datagrid-color-checked:var(\n --components-form-shape-foreground-default\n );--nv-datagrid-color-disabled:var(\n --components-form-shape-foreground-disabled\n );--nv-datagrid-outline-color:var(--color-focus-brand);display:block}nv-datagrid .hidden{display:none}nv-datagrid table{border-collapse:collapse;border-color:inherit;text-indent:0;width:100%}nv-datagrid th{text-align:left;border-bottom:1px solid var(--components-datagrid-header-border);min-height:var(--spacing-12);padding:var(--datagrid-cell-header-padding-y) var(--datagrid-cell-header-padding-x);font-size:var(--font-size-md);font-weight:var(--font-weight-high-emphasis);color:var(--components-datagrid-header-text)}nv-datagrid td{border-bottom:1px solid var(--components-datagrid-body-border);min-height:var(--spacing-12);max-height:var(--spacing-14);padding:var(--datagrid-cell-body-padding-y) var(--datagrid-cell-body-padding-x);font-size:var(--font-size-md);font-weight:var(--font-weight-low-emphasis);color:var(--components-datagrid-body-text);white-space:nowrap;text-overflow:ellipsis}nv-datagrid tbody>tr:hover{background:var(--color-interaction-container-neutral-background-hover)}nv-datagrid .cursor-pointer{cursor:pointer}nv-datagrid .select-none{-webkit-user-select:none;user-select:none}nv-datagrid .search-container{display:flex}nv-datagrid .checkbox-container{position:relative;color:var(--nv-datagrid-color-checked)}nv-datagrid .checkbox-container input[type=checkbox][readonly]{opacity:0.5}nv-datagrid .checkbox-container:has(input[type=checkbox]:disabled:not([readonly])){color:var(--nv-datagrid-color-disabled)}nv-datagrid .checkbox-container input[type=checkbox]{appearance:none;position:relative;display:flex;width:var(--form-checkbox-size);height:var(--form-checkbox-size);flex-direction:column;align-items:flex-start;border-radius:var(--form-checkbox-radius);border-width:var(--form-checkbox-border-width);border-style:solid;border-color:var(--nv-datagrid-border-default);background:var(--nv-datagrid-background-default)}nv-datagrid .checkbox-container input[type=checkbox]:hover{border-color:var(--nv-datagrid-border-hover)}nv-datagrid .checkbox-container input[type=checkbox]:focus{border-color:var(--nv-datagrid-border-focus)}nv-datagrid .checkbox-container input[type=checkbox]:focus,nv-datagrid .checkbox-container input[type=checkbox]:focus-within{outline:none}nv-datagrid .checkbox-container input[type=checkbox]:focus-visible,nv-datagrid .checkbox-container input[type=checkbox]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--nv-datagrid-outline-color);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-datagrid .checkbox-container input[type=checkbox]:checked,nv-datagrid .checkbox-container input[type=checkbox]:indeterminate{background:var(--nv-datagrid-background-checked);border-color:var(--nv-datagrid-background-checked)}nv-datagrid .checkbox-container input[type=checkbox]:disabled:not([readonly]){background:var(--nv-datagrid-background-disabled);border-color:var(--nv-datagrid-border-default)}nv-datagrid .checkbox-container input[type=checkbox][readonly]{opacity:0.5}nv-datagrid .checkbox-container .icon{pointer-events:none;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}nv-datagrid .checkbox-container .icon svg{width:var(--form-checkbox-icon-size);height:var(--form-checkbox-icon-size);fill:none;stroke:currentcolor;stroke-width:var(--form-checkbox-icon-stroke);flex-shrink:0}";
|
|
3479
|
-
|
|
3480
|
-
const NvDatagrid$1 = /*@__PURE__*/ proxyCustomElement(class NvDatagrid extends H {
|
|
3481
|
-
constructor(registerHost) {
|
|
3482
|
-
super();
|
|
3483
|
-
if (registerHost !== false) {
|
|
3484
|
-
this.__registerHost();
|
|
3485
|
-
}
|
|
3486
|
-
this.action = createEvent(this, "action", 3);
|
|
3487
|
-
this.selectedRows = createEvent(this, "selectedRows", 3);
|
|
3488
|
-
this.stateChanged = createEvent(this, "stateChanged", 3);
|
|
3489
|
-
this.templateCache = new Map();
|
|
3490
|
-
this.headerTemplateCache = new Map();
|
|
3491
|
-
this.minPageIndex = 1;
|
|
3492
|
-
/****************************************************************************/
|
|
3493
|
-
//#region STATES
|
|
3494
|
-
this.table = null;
|
|
3495
|
-
this.parsedColumns = []; // Parsed array
|
|
3496
|
-
this.parsedData = []; // Parsed array
|
|
3497
|
-
this.globalFilterSearchTerm = '';
|
|
3498
|
-
this.columnData = [];
|
|
3499
|
-
this.paginationState = null;
|
|
3500
|
-
this.sortingState = [];
|
|
3501
|
-
this.rowSelectionState = {};
|
|
3502
|
-
//#endregion STATES
|
|
3503
|
-
/****************************************************************************/
|
|
3504
|
-
//#region PROPERTIES
|
|
3505
|
-
/**
|
|
3506
|
-
* The data to display in the data grid.
|
|
3507
|
-
* @example [{ "name": "Alice", "age": 25 }, { "name": "Bob", "age": 30 }]
|
|
3508
|
-
* @default []
|
|
3509
|
-
*/
|
|
3510
|
-
this.data = [];
|
|
3511
|
-
/**
|
|
3512
|
-
* The columns to display in the data grid.
|
|
3513
|
-
* @example
|
|
3514
|
-
* [
|
|
3515
|
-
* {"header":"Name","accessor":"name"},
|
|
3516
|
-
* {"header":"Age","accessor":"age"},
|
|
3517
|
-
* {"header":"Email","accessor":"email"}
|
|
3518
|
-
* ]
|
|
3519
|
-
* @default []
|
|
3520
|
-
*/
|
|
3521
|
-
this.columns = [];
|
|
3522
|
-
/**
|
|
3523
|
-
* Fallback value to be displayed when data is not available
|
|
3524
|
-
* @default 'N/A'
|
|
3525
|
-
*/
|
|
3526
|
-
this.fallbackValue = 'N/A';
|
|
3527
|
-
/**
|
|
3528
|
-
* The message to display when there is no data available.
|
|
3529
|
-
* @default 'No data available'
|
|
3530
|
-
*/
|
|
3531
|
-
this.noDataMessage = 'No data available';
|
|
3532
|
-
/**
|
|
3533
|
-
* The message to display when there are no columns or data available.
|
|
3534
|
-
* @default 'No data or columns available to display.'
|
|
3535
|
-
*/
|
|
3536
|
-
this.noColumnsNoDataMessage = 'No data or columns available to display.';
|
|
3537
|
-
/**
|
|
3538
|
-
* Whether to automatically generate columns if none are provided.
|
|
3539
|
-
* If columns are explicitly set, this property is ignored.
|
|
3540
|
-
* @default false
|
|
3541
|
-
*/
|
|
3542
|
-
this.autoGenerateColumns = false;
|
|
3543
|
-
/**
|
|
3544
|
-
* Whether to enable global filtering for the data grid.
|
|
3545
|
-
* This allows users to search across all columns for a specific value.
|
|
3546
|
-
* The search is case-insensitive and supports partial matches.
|
|
3547
|
-
* It use string.includes() to match the search term.
|
|
3548
|
-
* @default false
|
|
3549
|
-
*/
|
|
3550
|
-
this.enableGlobalFilter = false;
|
|
3551
|
-
/**
|
|
3552
|
-
* Position the global filter input field
|
|
3553
|
-
*/
|
|
3554
|
-
this.globalFilterPosition = 'end';
|
|
3555
|
-
/**
|
|
3556
|
-
* Whether to enable pagination for the data grid.
|
|
3557
|
-
* @default false
|
|
3558
|
-
*/
|
|
3559
|
-
this.enablePagination = false;
|
|
3560
|
-
/**
|
|
3561
|
-
* The number of rows to display per page.
|
|
3562
|
-
* If the number is not present in the property pageSizes it takes the first of the list.
|
|
3563
|
-
* @default 10
|
|
3564
|
-
*/
|
|
3565
|
-
this.pageSize = 10;
|
|
3566
|
-
/**
|
|
3567
|
-
* The array of page sizes to display in the pagination dropdown.
|
|
3568
|
-
* @default [10, 20, 30, 40, 50]
|
|
3569
|
-
*/
|
|
3570
|
-
this.pageSizes = [10, 20, 30, 40, 50];
|
|
3571
|
-
/**
|
|
3572
|
-
* Whether to enable sorting for the data grid.
|
|
3573
|
-
* @default false
|
|
3574
|
-
*/
|
|
3575
|
-
this.enableSorting = false;
|
|
3576
|
-
/**
|
|
3577
|
-
* Whether to enable row selection for the data grid.
|
|
3578
|
-
*/
|
|
3579
|
-
this.enableRowSelection = false;
|
|
3580
|
-
/**
|
|
3581
|
-
* The overall state
|
|
3582
|
-
*/
|
|
3583
|
-
this.state = null;
|
|
3584
|
-
this.debouncedFilter = debounce((value) => {
|
|
3585
|
-
this.table?.setGlobalFilter(value);
|
|
3586
|
-
}, 300);
|
|
3587
|
-
/**
|
|
3588
|
-
* Handles global filtering on input event for the search input.
|
|
3589
|
-
* It debounces the input to prevent excessive filtering.
|
|
3590
|
-
* @param {Event} event - The input event.
|
|
3591
|
-
* @returns {void} - Nothing.
|
|
3592
|
-
*/
|
|
3593
|
-
this.handleGlobalFilteringOnInput = (event) => {
|
|
3594
|
-
const target = event.target;
|
|
3595
|
-
if (target instanceof HTMLInputElement) {
|
|
3596
|
-
const value = target.value;
|
|
3597
|
-
// Update the globalFilter state
|
|
3598
|
-
this.debouncedFilter(value);
|
|
3599
|
-
}
|
|
3600
|
-
};
|
|
3601
|
-
this.flexRender = (comp, props) => {
|
|
3602
|
-
if (typeof comp === 'function') {
|
|
3603
|
-
return comp(props);
|
|
3604
|
-
}
|
|
3605
|
-
return comp;
|
|
3606
|
-
};
|
|
3607
|
-
this.handlePageIndexChange = (event) => {
|
|
3608
|
-
const target = event.target;
|
|
3609
|
-
const page = target.value ? Number(target.value) - 1 : 0;
|
|
3610
|
-
// Simply use `setPageIndex` to update the page index directly
|
|
3611
|
-
this.paginationState = { ...this.paginationState, pageIndex: page }; // This triggers the paginationState watcher
|
|
3612
|
-
};
|
|
3613
|
-
this.handlePageSizeChange = (event) => {
|
|
3614
|
-
const target = event.target;
|
|
3615
|
-
let effectivePageSize = Number(target.value);
|
|
3616
|
-
if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
|
|
3617
|
-
effectivePageSize = this.pageSizes[0];
|
|
3618
|
-
}
|
|
3619
|
-
// Simply use `setPageSize` to update the page size directly
|
|
3620
|
-
this.paginationState = {
|
|
3621
|
-
...this.paginationState,
|
|
3622
|
-
pageSize: effectivePageSize,
|
|
3623
|
-
}; // This triggers the paginationState watcher
|
|
3624
|
-
};
|
|
3625
|
-
this.handleSortingClick = (event, header) => {
|
|
3626
|
-
if (!header.column.getCanSort()) {
|
|
3627
|
-
return;
|
|
3628
|
-
}
|
|
3629
|
-
header.column.getToggleSortingHandler()?.(event);
|
|
3630
|
-
};
|
|
3631
|
-
this.getSortTitle = (header) => {
|
|
3632
|
-
if (!header.column.getCanSort())
|
|
3633
|
-
return;
|
|
3634
|
-
const nextOrder = header.column.getNextSortingOrder();
|
|
3635
|
-
switch (nextOrder) {
|
|
3636
|
-
case SortingPossibility.Asc:
|
|
3637
|
-
return 'Sort ascending';
|
|
3638
|
-
case SortingPossibility.Desc:
|
|
3639
|
-
return 'Sort descending';
|
|
3640
|
-
default:
|
|
3641
|
-
return 'Clear sort';
|
|
3642
|
-
}
|
|
3643
|
-
};
|
|
3644
|
-
}
|
|
3645
|
-
//#endregion PROPERTIES
|
|
3646
|
-
/****************************************************************************/
|
|
3647
|
-
//#region METHODS
|
|
3648
|
-
/**
|
|
3649
|
-
* Caches templates for cells and headers upfront to improve performance.
|
|
3650
|
-
*/
|
|
3651
|
-
cacheTemplates() {
|
|
3652
|
-
const columns = Array.from(this.el.querySelectorAll('nv-datagridcolumn'));
|
|
3653
|
-
this.columnData = [];
|
|
3654
|
-
columns.forEach((col) => {
|
|
3655
|
-
const key = col.accessor;
|
|
3656
|
-
const cellSlot = col.querySelector('[slot="cell"]');
|
|
3657
|
-
if (cellSlot) {
|
|
3658
|
-
const element = deepCopyElement(cellSlot);
|
|
3659
|
-
this.templateCache.set(key, element);
|
|
3660
|
-
}
|
|
3661
|
-
const headerSlot = col.querySelector('[slot="header"]');
|
|
3662
|
-
if (headerSlot) {
|
|
3663
|
-
const element = deepCopyElement(headerSlot);
|
|
3664
|
-
this.headerTemplateCache.set(key, element);
|
|
3665
|
-
}
|
|
3666
|
-
else {
|
|
3667
|
-
const header = col.header;
|
|
3668
|
-
if (header) {
|
|
3669
|
-
const headerDiv = document.createElement('div');
|
|
3670
|
-
headerDiv.textContent = header;
|
|
3671
|
-
this.headerTemplateCache.set(key, headerDiv);
|
|
3672
|
-
}
|
|
3673
|
-
}
|
|
3674
|
-
const colData = {
|
|
3675
|
-
header: col.header,
|
|
3676
|
-
accessor: col.accessor,
|
|
3677
|
-
repeatTemplate: col.hasAttribute('repeat-template'),
|
|
3678
|
-
group: col.group,
|
|
3679
|
-
};
|
|
3680
|
-
this.columnData.push(colData);
|
|
3681
|
-
});
|
|
3682
|
-
console.info('cacheTemplates this.columnData:', this.columnData);
|
|
3683
|
-
}
|
|
3684
|
-
parseDataAndColumns() {
|
|
3685
|
-
if (this.data && this.data.length > 0) {
|
|
3686
|
-
this.parseDataArray(this.data, this.parsedData);
|
|
3687
|
-
}
|
|
3688
|
-
if (this.columns && this.columns.length > 0) {
|
|
3689
|
-
this.parseColumnsArray(this.columns, this.parsedColumns);
|
|
3690
|
-
}
|
|
3691
|
-
else if (this.headerTemplateCache.size > 0) {
|
|
3692
|
-
const headerKeys = Array.from(this.headerTemplateCache.keys());
|
|
3693
|
-
const arrayColumnsConfig = headerKeys.map(key => ({
|
|
3694
|
-
...{}, // Ensure no prototype inheritance
|
|
3695
|
-
accessor: key,
|
|
3696
|
-
header: key ? key.charAt(0).toUpperCase() + key.slice(1) : '',
|
|
3697
|
-
group: this.columnData.find(x => x.accessor === key)?.group ?? 'ungrouped',
|
|
3698
|
-
}));
|
|
3699
|
-
this.parseColumnsArray(arrayColumnsConfig, this.parsedColumns);
|
|
3700
|
-
}
|
|
3701
|
-
else if (this.parsedData.length > 0) {
|
|
3702
|
-
const firstRow = this.parsedData[0];
|
|
3703
|
-
const arrayColumnsConfig = Object.keys(firstRow).map(key => ({
|
|
3704
|
-
accessor: key,
|
|
3705
|
-
header: key.charAt(0).toUpperCase() + key.slice(1),
|
|
3706
|
-
group: this.columnData.find(x => x.accessor === key)?.group ?? 'ungrouped',
|
|
3707
|
-
}));
|
|
3708
|
-
if (this.autoGenerateColumns) {
|
|
3709
|
-
this.parseColumnsArray(arrayColumnsConfig, this.parsedColumns);
|
|
3710
|
-
}
|
|
3711
|
-
}
|
|
3712
|
-
}
|
|
3713
|
-
deepEqual(a, b) {
|
|
3714
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
3715
|
-
}
|
|
3716
|
-
/**
|
|
3717
|
-
* Parses the data array and sets the state accordingly
|
|
3718
|
-
* @param {any[]} newValue - The new value of the data array.
|
|
3719
|
-
* @param {any[]} oldValue - The old value of the data array.
|
|
3720
|
-
*/
|
|
3721
|
-
parseDataArray(newValue, oldValue) {
|
|
3722
|
-
// Ensure both are arrays for proper comparison
|
|
3723
|
-
const safeNewValue = Array.isArray(newValue) ? newValue : [];
|
|
3724
|
-
const safeOldValue = Array.isArray(oldValue) ? oldValue : [];
|
|
3725
|
-
if (this.deepEqual(safeNewValue, safeOldValue)) {
|
|
3726
|
-
return; // Deep comparison
|
|
3727
|
-
}
|
|
3728
|
-
this.parsedData = Array.isArray(newValue) ? newValue : [];
|
|
3729
|
-
}
|
|
3730
|
-
/**
|
|
3731
|
-
* Parses the columns array and sets the state accordingly
|
|
3732
|
-
* @param {Column[]} newValue - The new value of the columns array.
|
|
3733
|
-
* @param {Column[]} oldValue - The old value of the columns array.
|
|
3734
|
-
*/
|
|
3735
|
-
parseColumnsArray(newValue, oldValue) {
|
|
3736
|
-
// Ensure both are arrays for proper comparison
|
|
3737
|
-
const safeNewValue = Array.isArray(newValue) ? newValue : [];
|
|
3738
|
-
const safeOldValue = Array.isArray(oldValue) ? oldValue : [];
|
|
3739
|
-
// Use a proper deep comparison function (e.g., Lodash's isEqual)
|
|
3740
|
-
if (this.deepEqual(safeNewValue, safeOldValue)) {
|
|
3741
|
-
return;
|
|
3742
|
-
}
|
|
3743
|
-
// Assign only after confirming changes
|
|
3744
|
-
this.parsedColumns = safeNewValue;
|
|
3745
|
-
}
|
|
3746
|
-
initializeTable() {
|
|
3747
|
-
// Clear the previous table instance (if any)
|
|
3748
|
-
this.table = null;
|
|
3749
|
-
console.info('initializeTable this.columnData:', this.columnData);
|
|
3750
|
-
// Set default options for the table
|
|
3751
|
-
const tableOptions = {
|
|
3752
|
-
columns: [],
|
|
3753
|
-
data: [],
|
|
3754
|
-
getCoreRowModel: getCoreRowModel(),
|
|
3755
|
-
debugAll: true,
|
|
3756
|
-
onStateChange: state => console.log('Table state changed:', state), // eslint-disable-line nova/no-console
|
|
3757
|
-
renderFallbackValue: 'No rows to display',
|
|
3758
|
-
state: {
|
|
3759
|
-
sorting: [], // Default: no active sorting
|
|
3760
|
-
columnVisibility: {}, // Default: all columns visible
|
|
3761
|
-
columnFilters: [], // Default: no column filters
|
|
3762
|
-
columnPinning: {}, // Default: no column pinning
|
|
3763
|
-
columnSizing: {}, // Default: no column sizing
|
|
3764
|
-
columnOrder: [], // Default: as defined in the `columns`
|
|
3765
|
-
pagination: null, // Default: no pagination
|
|
3766
|
-
grouping: [], // Default: no active grouping
|
|
3767
|
-
expanded: {}, // Default: no expanded rows
|
|
3768
|
-
rowPinning: {}, // Default: no row pinning
|
|
3769
|
-
rowSelection: {}, // Default: no row selection
|
|
3770
|
-
globalFilter: null, // Default: no global filter
|
|
3771
|
-
columnSizingInfo: {
|
|
3772
|
-
columnSizingStart: null,
|
|
3773
|
-
deltaOffset: null,
|
|
3774
|
-
deltaPercentage: null,
|
|
3775
|
-
isResizingColumn: false,
|
|
3776
|
-
startOffset: null,
|
|
3777
|
-
startSize: null,
|
|
3778
|
-
}, // Default: no column sizing info
|
|
3779
|
-
},
|
|
3780
|
-
};
|
|
3781
|
-
if (this.parsedColumns.length > 0) {
|
|
3782
|
-
// Validate and generate column definitions
|
|
3783
|
-
const validColumns = this.parsedColumns.filter(column => column?.accessor);
|
|
3784
|
-
// Update tableOptions based on parsed data and columns
|
|
3785
|
-
const hasColumns = validColumns && Array.isArray(validColumns) && validColumns.length > 0;
|
|
3786
|
-
const hasData = this.parsedData &&
|
|
3787
|
-
Array.isArray(this.parsedData) &&
|
|
3788
|
-
this.parsedData.length > 0;
|
|
3789
|
-
if (!hasColumns && !hasData) ;
|
|
3790
|
-
else if (hasColumns && !hasData) {
|
|
3791
|
-
// Has columns but no data
|
|
3792
|
-
tableOptions.columns = this.generateColumns(validColumns, tableOptions);
|
|
3793
|
-
}
|
|
3794
|
-
else {
|
|
3795
|
-
// Both columns and data are available
|
|
3796
|
-
tableOptions.data = this.getTableData();
|
|
3797
|
-
tableOptions.columns = this.generateColumns(validColumns, tableOptions);
|
|
3798
|
-
}
|
|
3799
|
-
}
|
|
3800
|
-
else {
|
|
3801
|
-
// No parsed columns and data is available
|
|
3802
|
-
const hasData = this.parsedData &&
|
|
3803
|
-
Array.isArray(this.parsedData) &&
|
|
3804
|
-
this.parsedData.length > 0;
|
|
3805
|
-
if (hasData) {
|
|
3806
|
-
// No parsed columns and data is available
|
|
3807
|
-
const firstRow = this.parsedData[0];
|
|
3808
|
-
const arrayColumnsConfig = Object.keys(firstRow).map(key => ({
|
|
3809
|
-
accessor: key,
|
|
3810
|
-
header: key.charAt(0).toUpperCase() + key.slice(1),
|
|
3811
|
-
group: this.columnData.find(x => x.accessor === key)?.group ?? 'ungrouped',
|
|
3812
|
-
}));
|
|
3813
|
-
if (this.autoGenerateColumns) {
|
|
3814
|
-
this.parseColumnsArray(arrayColumnsConfig, this.parsedColumns);
|
|
3815
|
-
}
|
|
3816
|
-
tableOptions.data = this.getTableData();
|
|
3817
|
-
tableOptions.columns = this.generateColumns(arrayColumnsConfig, tableOptions);
|
|
3818
|
-
}
|
|
3819
|
-
}
|
|
3820
|
-
if (this.enableGlobalFilter) {
|
|
3821
|
-
tableOptions.getFilteredRowModel = getFilteredRowModel();
|
|
3822
|
-
const globalFilter = this.globalFilterSearchTerm;
|
|
3823
|
-
// Set the initial global filter value
|
|
3824
|
-
tableOptions.state.globalFilter = globalFilter;
|
|
3825
|
-
// Define the callback for global filter changes
|
|
3826
|
-
tableOptions.onGlobalFilterChange = updater => {
|
|
3827
|
-
const newFilter = typeof updater === 'function'
|
|
3828
|
-
? updater(this.globalFilterSearchTerm)
|
|
3829
|
-
: updater;
|
|
3830
|
-
this.globalFilterSearchTerm = newFilter; // Will automatically trigger the searchTerm watcher and update the table
|
|
3831
|
-
};
|
|
3832
|
-
tableOptions.globalFilterFn = this.globalFilterFn;
|
|
3833
|
-
}
|
|
3834
|
-
if (this.enablePagination) {
|
|
3835
|
-
tableOptions.getPaginationRowModel = getPaginationRowModel();
|
|
3836
|
-
const pageIndex = this.paginationState?.pageIndex ?? 0;
|
|
3837
|
-
let effectivePageSize = this.paginationState?.pageSize ?? 10;
|
|
3838
|
-
if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
|
|
3839
|
-
effectivePageSize = this.pageSizes[0];
|
|
3840
|
-
}
|
|
3841
|
-
const pagination = {
|
|
3842
|
-
pageIndex: pageIndex,
|
|
3843
|
-
pageSize: effectivePageSize,
|
|
3844
|
-
};
|
|
3845
|
-
// Set the initial pagination value with safeguards
|
|
3846
|
-
tableOptions.state.pagination = pagination;
|
|
3847
|
-
tableOptions.onPaginationChange = updater => {
|
|
3848
|
-
const newPagination = typeof updater === 'function'
|
|
3849
|
-
? updater(this.paginationState)
|
|
3850
|
-
: updater;
|
|
3851
|
-
this.paginationState = newPagination;
|
|
3852
|
-
};
|
|
3853
|
-
}
|
|
3854
|
-
if (this.enableSorting) {
|
|
3855
|
-
tableOptions.getSortedRowModel = getSortedRowModel();
|
|
3856
|
-
tableOptions.enableSorting = this.enableSorting;
|
|
3857
|
-
tableOptions.state.sorting = this.sortingState;
|
|
3858
|
-
tableOptions.onSortingChange = updater => {
|
|
3859
|
-
const newSorting = typeof updater === 'function' ? updater(this.sortingState) : updater;
|
|
3860
|
-
this.sortingState = newSorting; // Will automatically trigger the searchTerm watcher and update the table
|
|
3861
|
-
};
|
|
3862
|
-
}
|
|
3863
|
-
if (this.enableRowSelection) {
|
|
3864
|
-
tableOptions.state.rowSelection = this.rowSelectionState;
|
|
3865
|
-
tableOptions.onRowSelectionChange = updater => {
|
|
3866
|
-
const newRowSelectionState = typeof updater === 'function'
|
|
3867
|
-
? updater(this.rowSelectionState)
|
|
3868
|
-
: updater;
|
|
3869
|
-
this.rowSelectionState = newRowSelectionState;
|
|
3870
|
-
// Emit the original rows instead of IDs
|
|
3871
|
-
const selectedRows = Object.keys(newRowSelectionState)
|
|
3872
|
-
.filter(rowId => newRowSelectionState[rowId])
|
|
3873
|
-
.map(rowId => {
|
|
3874
|
-
// Assuming rowId corresponds to the index in parsedData
|
|
3875
|
-
const index = parseInt(rowId, 10); // Convert rowId to an integer index
|
|
3876
|
-
return this.parsedData[index]; // Get the original row data
|
|
3877
|
-
});
|
|
3878
|
-
this.selectedRows.emit(selectedRows); // Emit the original rows
|
|
3879
|
-
};
|
|
3880
|
-
}
|
|
3881
|
-
// Initialize the table
|
|
3882
|
-
this.table = createTable(tableOptions);
|
|
3883
|
-
}
|
|
3884
|
-
/**
|
|
3885
|
-
* Global filter function for the table.
|
|
3886
|
-
* This function checks if the specified filter value is present in any of the row's original values,
|
|
3887
|
-
* including nested objects and arrays. It is used to filter the rows based on the global filter value,
|
|
3888
|
-
* allowing for case-insensitive matching.
|
|
3889
|
-
*
|
|
3890
|
-
* @param {Row<any>} row - The row object containing the data to be filtered.
|
|
3891
|
-
* @param {string} _columnId - The ID of the column being filtered (not used in this function).
|
|
3892
|
-
* @param {string} filterValue - The value to filter the rows by. This value is checked against the row's data.
|
|
3893
|
-
* @returns {boolean} - Returns true if the row should be included in the filtered results, false otherwise.
|
|
3894
|
-
* If the filter value is empty, all rows are included.
|
|
3895
|
-
*/
|
|
3896
|
-
globalFilterFn(row, _columnId, filterValue) {
|
|
3897
|
-
const safeFilterValue = String(filterValue).toLowerCase().trim();
|
|
3898
|
-
// If no filter value, return true for all rows
|
|
3899
|
-
if (!safeFilterValue)
|
|
3900
|
-
return true;
|
|
3901
|
-
// More robust filtering across all columns
|
|
3902
|
-
const checkValue = (value) => {
|
|
3903
|
-
if (typeof value === 'object' && value !== null) {
|
|
3904
|
-
// If it's an array, check each item
|
|
3905
|
-
if (Array.isArray(value)) {
|
|
3906
|
-
return value.some(item => checkValue(item));
|
|
3907
|
-
}
|
|
3908
|
-
// If it's an object, check each property
|
|
3909
|
-
return Object.values(value).some(val => checkValue(val));
|
|
3910
|
-
}
|
|
3911
|
-
return String(value).toLowerCase().includes(safeFilterValue);
|
|
3912
|
-
};
|
|
3913
|
-
return checkValue(row.original);
|
|
3914
|
-
}
|
|
3915
|
-
createIconSpan(checked, indeterminate) {
|
|
3916
|
-
const span = document.createElement('span');
|
|
3917
|
-
span.className = 'icon';
|
|
3918
|
-
if (checked && !indeterminate) {
|
|
3919
|
-
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
3920
|
-
svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
|
|
3921
|
-
svg.setAttribute('width', '14');
|
|
3922
|
-
svg.setAttribute('height', '14');
|
|
3923
|
-
svg.setAttribute('viewBox', '0 0 14 14');
|
|
3924
|
-
svg.setAttribute('fill', 'none');
|
|
3925
|
-
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
3926
|
-
path.setAttribute('d', 'M11.6667 3.5L5.25004 9.91667L2.33337 7');
|
|
3927
|
-
path.setAttribute('stroke-linecap', 'round');
|
|
3928
|
-
path.setAttribute('stroke-linejoin', 'round');
|
|
3929
|
-
svg.appendChild(path);
|
|
3930
|
-
span.appendChild(svg);
|
|
3931
|
-
}
|
|
3932
|
-
if (indeterminate) {
|
|
3933
|
-
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
3934
|
-
svg.classList.add('indeterminate-svg');
|
|
3935
|
-
svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
|
|
3936
|
-
svg.setAttribute('viewBox', '0 0 14 14');
|
|
3937
|
-
svg.setAttribute('fill', 'none');
|
|
3938
|
-
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
3939
|
-
path.setAttribute('d', 'M2.9165 7H11.0832');
|
|
3940
|
-
path.setAttribute('stroke-linecap', 'round');
|
|
3941
|
-
path.setAttribute('stroke-linejoin', 'round');
|
|
3942
|
-
svg.appendChild(path);
|
|
3943
|
-
span.appendChild(svg);
|
|
3944
|
-
}
|
|
3945
|
-
return span;
|
|
3946
|
-
}
|
|
3947
|
-
createIndeterminateCheckbox(options = {}) {
|
|
3948
|
-
const { indeterminate, checked = false, disabled = false, className = '', onChange, } = options;
|
|
3949
|
-
const input = document.createElement('input');
|
|
3950
|
-
input.type = 'checkbox';
|
|
3951
|
-
input.checked = checked;
|
|
3952
|
-
input.disabled = disabled;
|
|
3953
|
-
input.className = `${className} cursor-pointer`.trim();
|
|
3954
|
-
if (typeof indeterminate === 'boolean') {
|
|
3955
|
-
input.indeterminate = !checked && indeterminate;
|
|
3956
|
-
}
|
|
3957
|
-
if (onChange) {
|
|
3958
|
-
input.addEventListener('change', onChange);
|
|
3959
|
-
}
|
|
3960
|
-
const iconSpan = this.createIconSpan(checked, indeterminate);
|
|
3961
|
-
const container = document.createElement('div');
|
|
3962
|
-
container.className = 'checkbox-container';
|
|
3963
|
-
container.appendChild(input);
|
|
3964
|
-
container.appendChild(iconSpan);
|
|
3965
|
-
return container;
|
|
3966
|
-
}
|
|
3967
|
-
// Helper function to generate column definitions
|
|
3968
|
-
generateColumns(validColumns, tableOptions) {
|
|
3969
|
-
console.info('generateColumns this.columnData:', this.columnData);
|
|
3970
|
-
console.info('generateColumns validColumns:', validColumns);
|
|
3971
|
-
let processedColumns = validColumns || [];
|
|
3972
|
-
const columnHelper = createColumnHelper();
|
|
3973
|
-
// If no columns provided or autoGenerateColumns is true, generate them from data
|
|
3974
|
-
if ((!validColumns && tableOptions.data && tableOptions.data.length > 0) ||
|
|
3975
|
-
(validColumns.length <= 0 &&
|
|
3976
|
-
tableOptions.data &&
|
|
3977
|
-
tableOptions.data.length > 0)) {
|
|
3978
|
-
const sampleRow = tableOptions.data[0];
|
|
3979
|
-
processedColumns = Object.keys(sampleRow).map(key => ({
|
|
3980
|
-
header: key.charAt(0).toUpperCase() + key.slice(1),
|
|
3981
|
-
accessor: key,
|
|
3982
|
-
group: this.columnData.find(x => x.accessor === key)?.group ?? 'ungrouped',
|
|
3983
|
-
headerSlot: null,
|
|
3984
|
-
cellSlot: null,
|
|
3985
|
-
}));
|
|
3986
|
-
}
|
|
3987
|
-
// Group columns by their group property
|
|
3988
|
-
const groupedColumns = processedColumns.reduce((acc, column) => {
|
|
3989
|
-
let group = column.group || 'ungrouped';
|
|
3990
|
-
if (group == 'ungrouped') {
|
|
3991
|
-
group = group + processedColumns.findIndex(x => x == column);
|
|
3992
|
-
}
|
|
3993
|
-
if (!acc[group]) {
|
|
3994
|
-
acc[group] = [];
|
|
3995
|
-
}
|
|
3996
|
-
acc[group].push(column);
|
|
3997
|
-
return acc;
|
|
3998
|
-
}, {});
|
|
3999
|
-
// Transform each column into a ColumnDef
|
|
4000
|
-
const createColumnDef = (column) => {
|
|
4001
|
-
return columnHelper.accessor(column.accessor, {
|
|
4002
|
-
header: this.renderTemplate(this.headerTemplateCache.get(column.accessor), column.header ?? column.accessor, null) ??
|
|
4003
|
-
column.header ??
|
|
4004
|
-
column.accessor,
|
|
4005
|
-
cell: (info) => {
|
|
4006
|
-
const value = info.getValue();
|
|
4007
|
-
const row = info.row;
|
|
4008
|
-
return this.columnData.find(x => x.accessor === column.accessor)
|
|
4009
|
-
?.repeatTemplate && Array.isArray(value)
|
|
4010
|
-
? value.map((item) => this.renderTemplate(this.templateCache.get(column.accessor), item, row) ??
|
|
4011
|
-
item ??
|
|
4012
|
-
value ??
|
|
4013
|
-
this.fallbackValue)
|
|
4014
|
-
: this.renderTemplate(this.templateCache.get(column.accessor), value, row) ??
|
|
4015
|
-
value ??
|
|
4016
|
-
this.fallbackValue;
|
|
4017
|
-
},
|
|
4018
|
-
sortUndefined: 'last',
|
|
4019
|
-
sortDescFirst: false,
|
|
4020
|
-
enableSorting: this.enableSorting, // Explicitly set enableSorting based on the sorting prop
|
|
4021
|
-
enableGlobalFilter: this.enableGlobalFilter, // Explicity set enableGlobalFilter based on the globalFiltering prop
|
|
4022
|
-
});
|
|
4023
|
-
};
|
|
4024
|
-
// Create the final column structure
|
|
4025
|
-
let generatedColumns = Object.entries(groupedColumns)
|
|
4026
|
-
.map(([groupName, groupColumns]) => {
|
|
4027
|
-
if (groupName.includes('ungrouped')) {
|
|
4028
|
-
return groupColumns.map(createColumnDef);
|
|
4029
|
-
}
|
|
4030
|
-
return {
|
|
4031
|
-
id: groupName,
|
|
4032
|
-
header: groupName,
|
|
4033
|
-
columns: groupColumns.map(createColumnDef),
|
|
4034
|
-
enableSorting: this.enableSorting, // Also apply to column groups
|
|
4035
|
-
enableGlobalFilter: this.enableGlobalFilter, // Also apply to column groups
|
|
4036
|
-
};
|
|
4037
|
-
})
|
|
4038
|
-
.flat();
|
|
4039
|
-
if (this.enableRowSelection) {
|
|
4040
|
-
const rowSelection = columnHelper.accessor('select', {
|
|
4041
|
-
header: ({ table }) => {
|
|
4042
|
-
return (h("div", { class: "flex px-1", ref: el => {
|
|
4043
|
-
const checkbox = this.createIndeterminateCheckbox({
|
|
4044
|
-
checked: table?.getIsAllRowsSelected(),
|
|
4045
|
-
indeterminate: table?.getIsSomeRowsSelected(),
|
|
4046
|
-
onChange: table?.getToggleAllRowsSelectedHandler(),
|
|
4047
|
-
});
|
|
4048
|
-
if (el) {
|
|
4049
|
-
el.innerHTML = ''; // Remove existing content
|
|
4050
|
-
el.appendChild(checkbox); // Append new checkbox
|
|
4051
|
-
}
|
|
4052
|
-
} }));
|
|
4053
|
-
},
|
|
4054
|
-
cell: ({ row }) => {
|
|
4055
|
-
return (h("div", { class: "flex px-1", ref: el => {
|
|
4056
|
-
const checkbox = this.createIndeterminateCheckbox({
|
|
4057
|
-
checked: row?.getIsSelected(),
|
|
4058
|
-
disabled: !row?.getCanSelect(),
|
|
4059
|
-
indeterminate: row?.getIsSomeSelected(),
|
|
4060
|
-
onChange: row?.getToggleSelectedHandler(),
|
|
4061
|
-
});
|
|
4062
|
-
if (el) {
|
|
4063
|
-
el.innerHTML = ''; // Remove existing content
|
|
4064
|
-
el.appendChild(checkbox); // Append new checkbox
|
|
4065
|
-
}
|
|
4066
|
-
} }));
|
|
4067
|
-
},
|
|
4068
|
-
enableGlobalFilter: false,
|
|
4069
|
-
enableSorting: false,
|
|
4070
|
-
});
|
|
4071
|
-
generatedColumns = [rowSelection, ...generatedColumns];
|
|
4072
|
-
}
|
|
4073
|
-
return generatedColumns;
|
|
4074
|
-
}
|
|
4075
|
-
getTableData() {
|
|
4076
|
-
if (this.parsedData &&
|
|
4077
|
-
Array.isArray(this.parsedData) &&
|
|
4078
|
-
this.parsedData.length > 0) {
|
|
4079
|
-
return [...this.parsedData];
|
|
4080
|
-
}
|
|
4081
|
-
else {
|
|
4082
|
-
return [];
|
|
4083
|
-
}
|
|
4084
|
-
}
|
|
4085
|
-
renderTemplate(template, cellValue, row) {
|
|
4086
|
-
if (!template) {
|
|
4087
|
-
return null;
|
|
4088
|
-
}
|
|
4089
|
-
// Handle <template> elements correctly
|
|
4090
|
-
const templateContent = template instanceof HTMLTemplateElement ? template.content : template;
|
|
4091
|
-
const element = deepCopyElement(templateContent);
|
|
4092
|
-
// Replace placeholders in text content, attributes, and properties
|
|
4093
|
-
element.querySelectorAll('*').forEach(el => {
|
|
4094
|
-
// Replace placeholders in text content
|
|
4095
|
-
this.replacePlaceholdersTextContent(el, cellValue, row);
|
|
4096
|
-
// Replace placeholders in attributes
|
|
4097
|
-
this.replacePlaceholdersAttributes(el, cellValue, row);
|
|
4098
|
-
// Replace placeholders in properties
|
|
4099
|
-
this.replacePlaceholdersProperties(el, cellValue, row);
|
|
4100
|
-
});
|
|
4101
|
-
// Handle `data-bind-event`
|
|
4102
|
-
element.querySelectorAll('[data-bind-event]').forEach(el => {
|
|
4103
|
-
const bindEvent = el.getAttribute('data-bind-event') || '';
|
|
4104
|
-
const splitted = bindEvent.split(':');
|
|
4105
|
-
if (!bindEvent.includes(':') || splitted.length < 2) {
|
|
4106
|
-
console.warn('Invalid data-bind-event format:', bindEvent);
|
|
4107
|
-
return;
|
|
4108
|
-
}
|
|
4109
|
-
const eventType = splitted[0];
|
|
4110
|
-
const keyAction = splitted[1];
|
|
4111
|
-
const details = splitted.length > 2 ? splitted[2] : null;
|
|
4112
|
-
el.addEventListener(eventType, () => {
|
|
4113
|
-
const keys = details?.split(',') ?? [];
|
|
4114
|
-
// Convert keys into a single object instead of an array of objects
|
|
4115
|
-
const keyValue = keys.reduce((acc, key) => {
|
|
4116
|
-
if (row?.original) {
|
|
4117
|
-
if (key in row.original) {
|
|
4118
|
-
acc[key] = row.original?.[key];
|
|
4119
|
-
}
|
|
4120
|
-
}
|
|
4121
|
-
return acc;
|
|
4122
|
-
}, {});
|
|
4123
|
-
const action = { keyAction, details: keyValue };
|
|
4124
|
-
this.action.emit(action);
|
|
4125
|
-
});
|
|
4126
|
-
});
|
|
4127
|
-
// Ensure Web Components are properly connected
|
|
4128
|
-
setTimeout(() => {
|
|
4129
|
-
element.querySelectorAll('*').forEach(child => {
|
|
4130
|
-
if (typeof child.connectedCallback === 'function') {
|
|
4131
|
-
child.connectedCallback();
|
|
4132
|
-
}
|
|
4133
|
-
});
|
|
4134
|
-
}, 0);
|
|
4135
|
-
return (h("div", { ref: el => {
|
|
4136
|
-
if (el) {
|
|
4137
|
-
el.innerHTML = ''; // Remove existing content
|
|
4138
|
-
el.appendChild(element); // Append new element
|
|
4139
|
-
}
|
|
4140
|
-
} }));
|
|
4141
|
-
}
|
|
4142
|
-
replaceKeyWithValue(key, cellValue) {
|
|
4143
|
-
// Handle undefined or null values by returning the fallback
|
|
4144
|
-
if (cellValue === undefined || cellValue === null) {
|
|
4145
|
-
return this.fallbackValue;
|
|
4146
|
-
}
|
|
4147
|
-
// If cellValue is an object, attempt to retrieve the value
|
|
4148
|
-
if (typeof cellValue === 'object') {
|
|
4149
|
-
// Handle nested key paths (e.g., "user.name")
|
|
4150
|
-
if (key.includes('.')) {
|
|
4151
|
-
const resolvedValue = key.split('.').reduce((acc, keyPart) => {
|
|
4152
|
-
if (acc && acc[keyPart] !== undefined) {
|
|
4153
|
-
return acc[keyPart];
|
|
4154
|
-
}
|
|
4155
|
-
else {
|
|
4156
|
-
return undefined;
|
|
4157
|
-
}
|
|
4158
|
-
}, cellValue);
|
|
4159
|
-
if (resolvedValue !== undefined) {
|
|
4160
|
-
return String(resolvedValue);
|
|
4161
|
-
}
|
|
4162
|
-
else {
|
|
4163
|
-
const firstLevelKey = key.split('.')[0];
|
|
4164
|
-
const rest = key.substring(firstLevelKey.length + 1);
|
|
4165
|
-
const response = this.replaceKeyWithValue(rest, cellValue);
|
|
4166
|
-
if (response !== this.fallbackValue) {
|
|
4167
|
-
return response;
|
|
4168
|
-
}
|
|
4169
|
-
}
|
|
4170
|
-
}
|
|
4171
|
-
// Handle single-level key lookup
|
|
4172
|
-
if (key in cellValue) {
|
|
4173
|
-
return String(cellValue[key]);
|
|
4174
|
-
}
|
|
4175
|
-
else if (Array.isArray(cellValue)) {
|
|
4176
|
-
// Handle array of objects
|
|
4177
|
-
const response = cellValue.map((item) => {
|
|
4178
|
-
if (typeof item !== 'object') {
|
|
4179
|
-
return item.toString();
|
|
4180
|
-
}
|
|
4181
|
-
else if (key in item) {
|
|
4182
|
-
return item[key];
|
|
4183
|
-
}
|
|
4184
|
-
else {
|
|
4185
|
-
return item.toString();
|
|
4186
|
-
}
|
|
4187
|
-
});
|
|
4188
|
-
return response.join(', ');
|
|
4189
|
-
}
|
|
4190
|
-
return this.fallbackValue;
|
|
4191
|
-
}
|
|
4192
|
-
// If cellValue is a primitive (string, number, boolean, etc.), return it as a string
|
|
4193
|
-
return cellValue?.toString() ?? this.fallbackValue;
|
|
4194
|
-
}
|
|
4195
|
-
replacePlaceholdersTextContent(element, cellValue, row) {
|
|
4196
|
-
if (!cellValue) {
|
|
4197
|
-
// ✅ Replace placeholders in text content with the row original value
|
|
4198
|
-
// but first get the original value
|
|
4199
|
-
const originalValue = row.original;
|
|
4200
|
-
element.childNodes.forEach(node => {
|
|
4201
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
4202
|
-
node.textContent = node.textContent.replace(/__([\w.]+)__/g, (_, key) => {
|
|
4203
|
-
if (key in originalValue) {
|
|
4204
|
-
return this.replaceKeyWithValue(key, originalValue[key]);
|
|
4205
|
-
}
|
|
4206
|
-
else {
|
|
4207
|
-
console.warn(`Key ${key} not found in originalValue`);
|
|
4208
|
-
return '';
|
|
4209
|
-
}
|
|
4210
|
-
});
|
|
4211
|
-
}
|
|
4212
|
-
});
|
|
4213
|
-
}
|
|
4214
|
-
else {
|
|
4215
|
-
// ✅ Replace placeholders in text content
|
|
4216
|
-
element.childNodes.forEach(node => {
|
|
4217
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
4218
|
-
node.textContent = node.textContent.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue));
|
|
4219
|
-
}
|
|
4220
|
-
});
|
|
4221
|
-
}
|
|
4222
|
-
}
|
|
4223
|
-
replacePlaceholdersAttributes(element, cellValue, row) {
|
|
4224
|
-
if (!cellValue) {
|
|
4225
|
-
// ✅ Replace placeholders in attributes with the row original value
|
|
4226
|
-
// but first get the original value
|
|
4227
|
-
const originalValue = row.original;
|
|
4228
|
-
Array.from(element.attributes).forEach(attr => {
|
|
4229
|
-
if (attr.value.includes('__')) {
|
|
4230
|
-
attr.value = attr.value.replace(/__([\w.]+)__/g, (_, key) => {
|
|
4231
|
-
if (key in originalValue) {
|
|
4232
|
-
return this.replaceKeyWithValue(key, originalValue[key]);
|
|
4233
|
-
}
|
|
4234
|
-
else {
|
|
4235
|
-
console.warn(`Key ${key} not found in originalValue`);
|
|
4236
|
-
return '';
|
|
4237
|
-
}
|
|
4238
|
-
});
|
|
4239
|
-
}
|
|
4240
|
-
});
|
|
4241
|
-
}
|
|
4242
|
-
else {
|
|
4243
|
-
// ✅ Replace placeholders in attributes
|
|
4244
|
-
Array.from(element.attributes).forEach(attr => {
|
|
4245
|
-
if (attr.value.includes('__')) {
|
|
4246
|
-
attr.value = attr.value.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue));
|
|
4247
|
-
}
|
|
4248
|
-
});
|
|
4249
|
-
}
|
|
4250
|
-
}
|
|
4251
|
-
replacePlaceholdersProperties(element, cellValue, row) {
|
|
4252
|
-
if (!cellValue) {
|
|
4253
|
-
// ✅ Replace placeholders in properties with the row original value
|
|
4254
|
-
// but first get the original value
|
|
4255
|
-
const originalValue = row.original;
|
|
4256
|
-
// ✅ Dynamically extract relevant properties
|
|
4257
|
-
const properties = new Set();
|
|
4258
|
-
// Collect only own enumerable properties
|
|
4259
|
-
Object.keys(originalValue).forEach(key => properties.add(key));
|
|
4260
|
-
// Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
|
|
4261
|
-
let proto = Object.getPrototypeOf(originalValue);
|
|
4262
|
-
while (proto && proto !== H.prototype) {
|
|
4263
|
-
Object.keys(proto).forEach(key => properties.add(key));
|
|
4264
|
-
proto = Object.getPrototypeOf(proto);
|
|
4265
|
-
}
|
|
4266
|
-
// ✅ Filter and copy only non-function properties and exclude irrelevant ones
|
|
4267
|
-
properties.forEach(prop => {
|
|
4268
|
-
if (typeof element[prop] !== 'function' && // Ignore methods
|
|
4269
|
-
!prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
|
|
4270
|
-
!excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
|
|
4271
|
-
) {
|
|
4272
|
-
const propValue = element[prop];
|
|
4273
|
-
if (typeof propValue === 'string' && propValue.includes('__')) {
|
|
4274
|
-
element[prop] = propValue.replace(/__([\w.]+)__/g, (_, key) => {
|
|
4275
|
-
if (key in originalValue) {
|
|
4276
|
-
return this.replaceKeyWithValue(key, originalValue[key]);
|
|
4277
|
-
}
|
|
4278
|
-
else {
|
|
4279
|
-
console.warn(`Key ${key} not found in originalValue`);
|
|
4280
|
-
return '';
|
|
4281
|
-
}
|
|
4282
|
-
});
|
|
4283
|
-
}
|
|
4284
|
-
}
|
|
4285
|
-
});
|
|
4286
|
-
}
|
|
4287
|
-
else {
|
|
4288
|
-
// ✅ Dynamically extract relevant properties
|
|
4289
|
-
const properties = new Set();
|
|
4290
|
-
// Collect only own enumerable properties
|
|
4291
|
-
Object.keys(element).forEach(key => properties.add(key));
|
|
4292
|
-
// Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
|
|
4293
|
-
let proto = Object.getPrototypeOf(element);
|
|
4294
|
-
while (proto && proto !== H.prototype) {
|
|
4295
|
-
Object.keys(proto).forEach(key => properties.add(key));
|
|
4296
|
-
proto = Object.getPrototypeOf(proto);
|
|
4297
|
-
}
|
|
4298
|
-
// ✅ Filter and copy only non-function properties and exclude irrelevant ones
|
|
4299
|
-
properties.forEach(prop => {
|
|
4300
|
-
if (typeof element[prop] !== 'function' && // Ignore methods
|
|
4301
|
-
!prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
|
|
4302
|
-
!excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
|
|
4303
|
-
) {
|
|
4304
|
-
try {
|
|
4305
|
-
const propValue = element[prop];
|
|
4306
|
-
// ✅ Replace placeholders only if the value is a string
|
|
4307
|
-
if (typeof propValue === 'string' && propValue.includes('__')) {
|
|
4308
|
-
element[prop] = propValue.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue)); // ✅ TypeScript safe
|
|
4309
|
-
}
|
|
4310
|
-
}
|
|
4311
|
-
catch (error) {
|
|
4312
|
-
console.warn(`Could not assign property ${prop}:`, error.message);
|
|
4313
|
-
}
|
|
4314
|
-
}
|
|
4315
|
-
});
|
|
4316
|
-
}
|
|
4317
|
-
}
|
|
4318
|
-
getArrowSorting(header) {
|
|
4319
|
-
if (!header.column.getCanSort())
|
|
4320
|
-
return null;
|
|
4321
|
-
const sortState = header.column.getIsSorted();
|
|
4322
|
-
if (sortState === SortingPossibility.Asc) {
|
|
4323
|
-
return (h("div", { class: "inline-flex align-middle" }, h("nv-icon", { name: "arrow-up" })));
|
|
4324
|
-
}
|
|
4325
|
-
if (sortState === SortingPossibility.Desc) {
|
|
4326
|
-
return (h("div", { class: "inline-flex align-middle" }, h("nv-icon", { name: "arrow-down" })));
|
|
4327
|
-
}
|
|
4328
|
-
return null;
|
|
4329
|
-
}
|
|
4330
|
-
getHeaderCell(header) {
|
|
4331
|
-
const isSortable = header.column.getCanSort();
|
|
4332
|
-
const sortTitle = this.getSortTitle(header);
|
|
4333
|
-
const content = header.isPlaceholder
|
|
4334
|
-
? null
|
|
4335
|
-
: header.column.columnDef.header
|
|
4336
|
-
? this.flexRender(header.column.columnDef.header, header.getContext())
|
|
4337
|
-
: null; // Ensure content is not null
|
|
4338
|
-
const sortIcon = this.getArrowSorting(header);
|
|
4339
|
-
const handleClick = this.createSortingClickHandler(header);
|
|
4340
|
-
if (this.enableRowSelection) {
|
|
4341
|
-
return (h("th", { key: header.id, colSpan: header.colSpan }, content, " "));
|
|
4342
|
-
}
|
|
4343
|
-
const returnHtml = (h("th", { key: header.id, colSpan: header.colSpan }, h("button", { type: "button", class: isSortable
|
|
4344
|
-
? 'w-full text-left cursor-pointer select-none bg-transparent border-none p-0 m-0 focus:outline-none'
|
|
4345
|
-
: 'w-full text-left bg-transparent border-none p-0 m-0 cursor-default', onClick: handleClick, title: sortTitle }, h("span", { class: "inline-flex items-center gap-1" }, content, sortIcon))));
|
|
4346
|
-
return returnHtml;
|
|
4347
|
-
}
|
|
4348
|
-
// 👇 Helper method to avoid arrow function in JSX
|
|
4349
|
-
createSortingClickHandler(header) {
|
|
4350
|
-
return (e) => {
|
|
4351
|
-
this.handleSortingClick(e, header);
|
|
4352
|
-
};
|
|
4353
|
-
}
|
|
4354
|
-
getPagination() {
|
|
4355
|
-
return (this.enablePagination && (h("div", { class: "flex items-center gap-2" }, h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.firstPage }, "<<"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.previousPage }, "<"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.nextPage }, ">"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.lastPage }, ">>"), h("span", { class: "flex items-center gap-1" }, h("div", null, "Page"), h("strong", null, this.table.getState().pagination.pageIndex + 1, " of", ' ', this.table.getPageCount().toLocaleString())), h("span", { class: "flex items-center gap-1" }, "| Go to page:", ' ', h("input", { type: "number", min: this.minPageIndex, max: this.table.getPageCount(), value: this.table.getState().pagination.pageIndex + 1, class: "border p-1 rounded w-16", "aria-label": "Go to page", onInput: this.handlePageIndexChange })), this.pageSizes?.length > 0 && (h("select", { "aria-label": "Rows per page", onChange: this.handlePageSizeChange }, this.pageSizes.map(pageSize => (h("option", { value: String(pageSize), selected: this.table.getState().pagination.pageSize === pageSize }, "Show ", pageSize))))))));
|
|
4356
|
-
}
|
|
4357
|
-
//#endregion METHODS
|
|
4358
|
-
/****************************************************************************/
|
|
4359
|
-
//#region WATCHERS
|
|
4360
|
-
parseColumns(newValue, oldValue = []) {
|
|
4361
|
-
this.parseColumnsArray(newValue, oldValue);
|
|
4362
|
-
}
|
|
4363
|
-
parseData(newValue, oldValue = []) {
|
|
4364
|
-
this.parseDataArray(newValue, oldValue);
|
|
4365
|
-
}
|
|
4366
|
-
handleParsedChange() {
|
|
4367
|
-
this.initializeTable();
|
|
4368
|
-
}
|
|
4369
|
-
handleGlobalFilterSearchTerm(newValue) {
|
|
4370
|
-
if (!this.table) {
|
|
4371
|
-
console.warn('Table is not initialized yet.');
|
|
4372
|
-
return;
|
|
4373
|
-
}
|
|
4374
|
-
// Not working
|
|
4375
|
-
/*// Set the global filter for the table
|
|
4376
|
-
this.table.setGlobalFilter(newValue);*/
|
|
4377
|
-
// Manually update the globalFilter state
|
|
4378
|
-
this.table.options.state.globalFilter = newValue;
|
|
4379
|
-
}
|
|
4380
|
-
handlePaginationState(newValue, oldValue) {
|
|
4381
|
-
if (!this.table) {
|
|
4382
|
-
console.warn('Table is not initialized yet.');
|
|
4383
|
-
return;
|
|
4384
|
-
}
|
|
4385
|
-
// Only update if there is a meaningful change
|
|
4386
|
-
if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
|
|
4387
|
-
// Not working
|
|
4388
|
-
/*// Set the pagination for the table
|
|
4389
|
-
this.table.setPagination(newValue);*/
|
|
4390
|
-
// Manually update the pagination state
|
|
4391
|
-
this.table.options.state.pagination = newValue;
|
|
4392
|
-
}
|
|
4393
|
-
}
|
|
4394
|
-
handleSortingState(newValue) {
|
|
4395
|
-
if (!this.table) {
|
|
4396
|
-
console.warn('Table is not initialized yet.');
|
|
4397
|
-
return;
|
|
4398
|
-
}
|
|
4399
|
-
// Not working
|
|
4400
|
-
/*// Set the sorting for the table
|
|
4401
|
-
this.table.setSorting(newValue);*/
|
|
4402
|
-
// Manually update the sorting state
|
|
4403
|
-
this.table.options.state.sorting = newValue;
|
|
4404
|
-
}
|
|
4405
|
-
handlePageSize(newValue) {
|
|
4406
|
-
let effectivePageSize = newValue;
|
|
4407
|
-
if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
|
|
4408
|
-
effectivePageSize = this.pageSizes[0];
|
|
4409
|
-
}
|
|
4410
|
-
// Simply use `setPageSize` to update the page size directly
|
|
4411
|
-
this.paginationState = {
|
|
4412
|
-
...this.paginationState,
|
|
4413
|
-
pageSize: effectivePageSize,
|
|
4414
|
-
}; // This triggers the paginationState watcher
|
|
4415
|
-
}
|
|
4416
|
-
handleRowSelectionState(newValue, oldValue) {
|
|
4417
|
-
if (!this.table) {
|
|
4418
|
-
console.warn('Table is not initialized yet.');
|
|
4419
|
-
return;
|
|
4420
|
-
}
|
|
4421
|
-
// Only update if there is a meaningful change
|
|
4422
|
-
if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
|
|
4423
|
-
// Not working
|
|
4424
|
-
/*// Set the rowSelection for the table
|
|
4425
|
-
this.table.setRowSelection(newValue);*/
|
|
4426
|
-
// Manually update the row selection state
|
|
4427
|
-
this.table.options.state.rowSelection = newValue;
|
|
4428
|
-
}
|
|
4429
|
-
}
|
|
4430
|
-
handleStateChange(newValue) {
|
|
4431
|
-
if (newValue) {
|
|
4432
|
-
// Only update internal state if values are different to avoid loops
|
|
4433
|
-
if (this.globalFilterSearchTerm !== newValue.globalFilterSearchTerm) {
|
|
4434
|
-
this.globalFilterSearchTerm = newValue.globalFilterSearchTerm;
|
|
4435
|
-
}
|
|
4436
|
-
if (JSON.stringify(this.paginationState) !==
|
|
4437
|
-
JSON.stringify(newValue.paginationState)) {
|
|
4438
|
-
this.paginationState = newValue.paginationState;
|
|
4439
|
-
}
|
|
4440
|
-
if (JSON.stringify(this.sortingState) !==
|
|
4441
|
-
JSON.stringify(newValue.sortingState)) {
|
|
4442
|
-
this.sortingState = newValue.sortingState;
|
|
4443
|
-
}
|
|
4444
|
-
}
|
|
4445
|
-
}
|
|
4446
|
-
// Add watchers for internal state to emit changes
|
|
4447
|
-
handleInternalStateChange() {
|
|
4448
|
-
// Only emit if the state has actually changed
|
|
4449
|
-
const newState = {
|
|
4450
|
-
globalFilterSearchTerm: this.globalFilterSearchTerm,
|
|
4451
|
-
paginationState: this.paginationState,
|
|
4452
|
-
sortingState: this.sortingState,
|
|
4453
|
-
};
|
|
4454
|
-
// Emit the new state and let the parent component update the prop
|
|
4455
|
-
this.stateChanged.emit(newState);
|
|
4456
|
-
}
|
|
4457
|
-
//#endregion WATCHERS
|
|
4458
|
-
/****************************************************************************/
|
|
4459
|
-
//#region LIFECYCLE
|
|
4460
|
-
componentWillLoad() {
|
|
4461
|
-
this.cacheTemplates();
|
|
4462
|
-
this.parseDataAndColumns();
|
|
4463
|
-
this.initializeTable();
|
|
4464
|
-
if (this.enablePagination) {
|
|
4465
|
-
// Ensure a valid page size
|
|
4466
|
-
let effectivePageSize = this.pageSize > 0 ? this.pageSize : 10;
|
|
4467
|
-
if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
|
|
4468
|
-
effectivePageSize = this.pageSizes[0];
|
|
4469
|
-
}
|
|
4470
|
-
this.paginationState = {
|
|
4471
|
-
pageIndex: Math.max(0, this.minPageIndex - 1),
|
|
4472
|
-
pageSize: effectivePageSize,
|
|
4473
|
-
};
|
|
4474
|
-
}
|
|
4475
|
-
}
|
|
4476
|
-
//#endregion EVENTS
|
|
4477
|
-
/****************************************************************************/
|
|
4478
|
-
//#region RENDER
|
|
4479
|
-
render() {
|
|
4480
|
-
const headerGroups = !this.table || this.table === undefined || this.parsedColumns.length === 0
|
|
4481
|
-
? []
|
|
4482
|
-
: this.table?.getHeaderGroups();
|
|
4483
|
-
const rows = !this.table || this.table === undefined || this.parsedData.length === 0
|
|
4484
|
-
? []
|
|
4485
|
-
: this.table?.getRowModel()?.rows;
|
|
4486
|
-
return (h(Host, { key: 'd1ca320f75940993840349a4f33afb0a8dc10788' }, h("div", { key: 'd07f038bfa0d4c0092f0ad9e6f13c95a47331f75', class: "hidden" }, h("slot", { key: 'be8e292240da78d055cce83fb5700111d371d0db' })), h("slot", { key: 'af921e34986bf67afa14190e2d01e866af7ab7ae', name: "before" }), this.enableGlobalFilter && this.table && (h("div", { key: 'f3ffe4bdfee63e86ad470923e4faf62be821b5fa', class: `search-container justify-${this.globalFilterPosition}` }, h("nv-fieldtext", { key: 'a5ab10f4e088b106368bd5d98d99e3cef2b59955', value: this.globalFilterSearchTerm, onInput: this.handleGlobalFilteringOnInput, placeholder: "Search all columns..." }))), this.parsedColumns.length === 0 && this.parsedData.length === 0 ? (h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (h("div", null, h("table", null, this.parsedColumns.length > 0 && headerGroups.length > 0 && (h("thead", null, this.parsedColumns.length > 0 && headerGroups
|
|
4487
|
-
? headerGroups?.map(headerGroup => (h("tr", { key: headerGroup.id }, headerGroup.headers.map(header => {
|
|
4488
|
-
return this.getHeaderCell(header);
|
|
4489
|
-
}))))
|
|
4490
|
-
: null)), h("tbody", null, !rows || rows.length === 0 || this.parsedData.length === 0 ? (h("tr", null, h("td", { colSpan: this.parsedColumns.length || 12, class: "no-data" }, this.noDataMessage))) : (rows.map(row => {
|
|
4491
|
-
const rowId = row.id;
|
|
4492
|
-
const visibleCells = row?.getVisibleCells();
|
|
4493
|
-
return (h("tr", { key: rowId }, visibleCells.map(cell => {
|
|
4494
|
-
return (h("td", { key: cell.id, "data-row-id": rowId }, this.flexRender(cell.column.columnDef.cell, cell.getContext())));
|
|
4495
|
-
})));
|
|
4496
|
-
}))), this.table && this.enableRowSelection ? (h("tfoot", null, h("tr", null, h("td", { colSpan: 20 }, this.enableRowSelection && this.table ? (h("div", null, this.rowSelectionState &&
|
|
4497
|
-
Object.keys(this.rowSelectionState).length > 0 ? (h("span", null, Object.keys(this.rowSelectionState).length, " of", ' ', this.table.getPreFilteredRowModel()?.rows
|
|
4498
|
-
?.length || 0, ' ', "Total Rows Selected")) : (h("span", null, "No rows selected")))) : null)))) : null), this.getPagination())), h("slot", { key: '8941adaa686dec6b3f09e0434bdf9df3d273e930', name: "after" })));
|
|
4499
|
-
}
|
|
4500
|
-
get el() { return this; }
|
|
4501
|
-
static get watchers() { return {
|
|
4502
|
-
"columns": ["parseColumns"],
|
|
4503
|
-
"data": ["parseData"],
|
|
4504
|
-
"parsedColumns": ["handleParsedChange"],
|
|
4505
|
-
"parsedData": ["handleParsedChange"],
|
|
4506
|
-
"globalFilterSearchTerm": ["handleGlobalFilterSearchTerm", "handleInternalStateChange"],
|
|
4507
|
-
"paginationState": ["handlePaginationState", "handleInternalStateChange"],
|
|
4508
|
-
"sortingState": ["handleSortingState", "handleInternalStateChange"],
|
|
4509
|
-
"pageSize": ["handlePageSize"],
|
|
4510
|
-
"rowSelectionState": ["handleRowSelectionState"],
|
|
4511
|
-
"state": ["handleStateChange"]
|
|
4512
|
-
}; }
|
|
4513
|
-
static get style() { return nvDatagridCss; }
|
|
4514
|
-
}, [260, "nv-datagrid", {
|
|
4515
|
-
"data": [16],
|
|
4516
|
-
"columns": [16],
|
|
4517
|
-
"fallbackValue": [513, "fallback-value"],
|
|
4518
|
-
"noDataMessage": [513, "no-data-message"],
|
|
4519
|
-
"noColumnsNoDataMessage": [513, "no-columns-no-data-message"],
|
|
4520
|
-
"autoGenerateColumns": [516, "auto-generate-columns"],
|
|
4521
|
-
"enableGlobalFilter": [516, "enable-global-filter"],
|
|
4522
|
-
"globalFilterPosition": [513, "global-filter-position"],
|
|
4523
|
-
"enablePagination": [516, "enable-pagination"],
|
|
4524
|
-
"pageSize": [514, "page-size"],
|
|
4525
|
-
"pageSizes": [16],
|
|
4526
|
-
"enableSorting": [516, "enable-sorting"],
|
|
4527
|
-
"enableRowSelection": [516, "enable-row-selection"],
|
|
4528
|
-
"state": [16],
|
|
4529
|
-
"table": [32],
|
|
4530
|
-
"parsedColumns": [32],
|
|
4531
|
-
"parsedData": [32],
|
|
4532
|
-
"globalFilterSearchTerm": [32],
|
|
4533
|
-
"columnData": [32],
|
|
4534
|
-
"paginationState": [32],
|
|
4535
|
-
"sortingState": [32],
|
|
4536
|
-
"rowSelectionState": [32]
|
|
4537
|
-
}, undefined, {
|
|
4538
|
-
"columns": ["parseColumns"],
|
|
4539
|
-
"data": ["parseData"],
|
|
4540
|
-
"parsedColumns": ["handleParsedChange"],
|
|
4541
|
-
"parsedData": ["handleParsedChange"],
|
|
4542
|
-
"globalFilterSearchTerm": ["handleGlobalFilterSearchTerm", "handleInternalStateChange"],
|
|
4543
|
-
"paginationState": ["handlePaginationState", "handleInternalStateChange"],
|
|
4544
|
-
"sortingState": ["handleSortingState", "handleInternalStateChange"],
|
|
4545
|
-
"pageSize": ["handlePageSize"],
|
|
4546
|
-
"rowSelectionState": ["handleRowSelectionState"],
|
|
4547
|
-
"state": ["handleStateChange"]
|
|
4548
|
-
}]);
|
|
4549
|
-
function defineCustomElement$1() {
|
|
4550
|
-
if (typeof customElements === "undefined") {
|
|
4551
|
-
return;
|
|
4552
|
-
}
|
|
4553
|
-
const components = ["nv-datagrid", "nv-fieldtext", "nv-icon"];
|
|
4554
|
-
components.forEach(tagName => { switch (tagName) {
|
|
4555
|
-
case "nv-datagrid":
|
|
4556
|
-
if (!customElements.get(tagName)) {
|
|
4557
|
-
customElements.define(tagName, NvDatagrid$1);
|
|
4558
|
-
}
|
|
4559
|
-
break;
|
|
4560
|
-
case "nv-fieldtext":
|
|
4561
|
-
if (!customElements.get(tagName)) {
|
|
4562
|
-
defineCustomElement$3();
|
|
4563
|
-
}
|
|
4564
|
-
break;
|
|
4565
|
-
case "nv-icon":
|
|
4566
|
-
if (!customElements.get(tagName)) {
|
|
4567
|
-
defineCustomElement$2();
|
|
4568
|
-
}
|
|
4569
|
-
break;
|
|
4570
|
-
} });
|
|
4571
|
-
}
|
|
4572
|
-
defineCustomElement$1();
|
|
4573
|
-
|
|
4574
|
-
const NvDatagrid = NvDatagrid$1;
|
|
4575
|
-
const defineCustomElement = defineCustomElement$1;
|
|
4576
|
-
|
|
4577
|
-
export { NvDatagrid, defineCustomElement };
|
|
4578
|
-
//# sourceMappingURL=nv-datagrid.js.map
|
|
4579
|
-
|
|
4580
|
-
//# sourceMappingURL=nv-datagrid.js.map
|
|
1
|
+
import{t as e,p as t,H as n,c as l,h as o,d as r}from"./p-iXsbKJzR.js";import{d as i,e as a}from"./p-CuXVGECR.js";import{h as u}from"./p-BReL3Lsa.js";import{d as s}from"./p-C-MlXMFg.js";import{d as c}from"./p-Bg-b6OWh.js";function d(e,t){return"function"==typeof e?e(t):e}function h(e,t){return n=>{t.setState((t=>({...t,[e]:d(n,t[e])})))}}function g(e){return e instanceof Function}function v(e,t,n){let l,o=[];return r=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(r);if(a.length===o.length&&!a.some(((e,t)=>o[t]!==e)))return l;let u;if(o=a,n.key&&n.debug&&(u=Date.now()),l=t(...a),null==n||null==n.onChange||n.onChange(l),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-i))/100,t=Math.round(100*(Date.now()-u))/100,l=t/16,o=(e,t)=>{for(e+="";e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*l,120))}deg 100% 31%);`,null==n?void 0:n.key)}return l}}function f(e,t,n,l){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:l}}const b="debugHeaders";function p(e,t,n){var l;let o={id:null!=(l=n.id)?l:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(o,e)})),o}const m={createTable:e=>{e.getHeaderGroups=v((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,l,o)=>{var r,i;const a=null!=(r=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?r:[],u=null!=(i=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[];return w(t,[...a,...n.filter((e=>!(null!=l&&l.includes(e.id)||null!=o&&o.includes(e.id)))),...u],e)}),f(e.options,b)),e.getCenterHeaderGroups=v((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,l,o)=>w(t,n=n.filter((e=>!(null!=l&&l.includes(e.id)||null!=o&&o.includes(e.id)))),e,"center")),f(e.options,b)),e.getLeftHeaderGroups=v((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,l)=>{var o;return w(t,null!=(o=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"left")}),f(e.options,b)),e.getRightHeaderGroups=v((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,l)=>{var o;return w(t,null!=(o=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"right")}),f(e.options,b)),e.getFooterGroups=v((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),f(e.options,b)),e.getLeftFooterGroups=v((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),f(e.options,b)),e.getCenterFooterGroups=v((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),f(e.options,b)),e.getRightFooterGroups=v((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),f(e.options,b)),e.getFlatHeaders=v((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),f(e.options,b)),e.getLeftFlatHeaders=v((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),f(e.options,b)),e.getCenterFlatHeaders=v((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),f(e.options,b)),e.getRightFlatHeaders=v((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),f(e.options,b)),e.getCenterLeafHeaders=v((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),f(e.options,b)),e.getLeftLeafHeaders=v((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),f(e.options,b)),e.getRightLeafHeaders=v((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),f(e.options,b)),e.getLeafHeaders=v((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var l,o,r,i,a,u;return[...null!=(l=null==(o=e[0])?void 0:o.headers)?l:[],...null!=(r=null==(i=t[0])?void 0:i.headers)?r:[],...null!=(a=null==(u=n[0])?void 0:u.headers)?a:[]].map((e=>e.getLeafHeaders())).flat()}),f(e.options,b))}};function w(e,t,n,l){var o,r;let i=0;const a=function(e,t){void 0===t&&(t=1),i=Math.max(i,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&a(e.columns,t+1)}),0)};a(e);let u=[];const s=(e,t)=>{const o={depth:t,id:[l,""+t].filter(Boolean).join("_"),headers:[]},r=[];e.forEach((e=>{const i=[...r].reverse()[0];let a,u=!1;if(e.column.depth===o.depth&&e.column.parent?a=e.column.parent:(a=e.column,u=!0),i&&(null==i?void 0:i.column)===a)i.subHeaders.push(e);else{const o=p(n,a,{id:[l,t,a.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?""+r.filter((e=>e.column===a)).length:void 0,depth:t,index:r.length});o.subHeaders.push(e),r.push(o)}o.headers.push(e),e.headerGroup=o})),u.push(o),t>0&&s(r,t-1)},c=t.map(((e,t)=>p(n,e,{depth:i,index:t})));s(c,i-1),u.reverse();const d=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,l=[0];return e.subHeaders&&e.subHeaders.length?(l=[],d(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:o}=e;t+=n,l.push(o)}))):t=1,n+=Math.min(...l),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return d(null!=(o=null==(r=u[0])?void 0:r.headers)?o:[]),u}const S=(e,t,n,l,o,r,i)=>{let a={id:t,index:l,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(a._valuesCache.hasOwnProperty(t))return a._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(a._valuesCache[t]=n.accessorFn(a.original,l),a._valuesCache[t]):void 0},getUniqueValues:t=>{if(a._uniqueValuesCache.hasOwnProperty(t))return a._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(a._uniqueValuesCache[t]=n.columnDef.getUniqueValues(a.original,l),a._uniqueValuesCache[t]):(a._uniqueValuesCache[t]=[a.getValue(t)],a._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=a.getValue(t))?n:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>function(e){const t=[],n=e=>{e.forEach((e=>{t.push(e);const l=(e=>e.subRows)(e);null!=l&&l.length&&n(l)}))};return n(e),t}(a.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let e=[],t=a;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:v((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>function(e,t,n,l){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(l),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:v((()=>[e,n,t,o]),((e,t,n,l)=>({table:e,column:t,row:n,cell:l,getValue:l.getValue,renderValue:l.renderValue})),f(e.options,"debugCells"))};return e._features.forEach((l=>{null==l.createCell||l.createCell(o,n,t,e)}),{}),o}(e,a,t,t.id)))),f(e.options,"debugRows")),_getAllCellsByColumnId:v((()=>[a.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),f(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(a,e)}return a},y={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},C=(e,t,n)=>{var l,o;const r=null==n||null==(l=""+n)?void 0:l.toLowerCase();return!!(null==(o=e.getValue(t))||null==(o=""+o)||null==(o=o.toLowerCase())?void 0:o.includes(r))};C.autoRemove=e=>j(e);const x=(e,t,n)=>{var l;return!!(null==(l=e.getValue(t))||null==(l=""+l)?void 0:l.includes(n))};x.autoRemove=e=>j(e);const k=(e,t,n)=>{var l;return(null==(l=e.getValue(t))||null==(l=""+l)?void 0:l.toLowerCase())===(null==n?void 0:n.toLowerCase())};k.autoRemove=e=>j(e);const O=(e,t,n)=>{var l;return null==(l=e.getValue(t))?void 0:l.includes(n)};O.autoRemove=e=>j(e);const R=(e,t,n)=>!n.some((n=>{var l;return!(null!=(l=e.getValue(t))&&l.includes(n))}));R.autoRemove=e=>j(e)||!(null!=e&&e.length);const z=(e,t,n)=>n.some((n=>{var l;return null==(l=e.getValue(t))?void 0:l.includes(n)}));z.autoRemove=e=>j(e)||!(null!=e&&e.length);const _=(e,t,n)=>e.getValue(t)===n;_.autoRemove=e=>j(e);const I=(e,t,n)=>e.getValue(t)==n;I.autoRemove=e=>j(e);const T=(e,t,n)=>{let[l,o]=n;const r=e.getValue(t);return r>=l&&r<=o};T.resolveFilterValue=e=>{let[t,n]=e,l="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,r=null===t||Number.isNaN(l)?-1/0:l,i=null===n||Number.isNaN(o)?1/0:o;if(r>i){const e=r;r=i,i=e}return[r,i]},T.autoRemove=e=>j(e)||j(e[0])&&j(e[1]);const D={includesString:C,includesStringSensitive:x,equalsString:k,arrIncludes:O,arrIncludesAll:R,arrIncludesSome:z,equals:_,weakEquals:I,inNumberRange:T};function j(e){return null==e||""===e}function F(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const P={sum:(e,t,n)=>n.reduce(((t,n)=>{const l=n.getValue(e);return t+("number"==typeof l?l:0)}),0),min:(e,t,n)=>{let l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(l>n||void 0===l&&n>=n)&&(l=n)})),l},max:(e,t,n)=>{let l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(l<n||void 0===l&&n>=n)&&(l=n)})),l},extent:(e,t,n)=>{let l,o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===l?n>=n&&(l=o=n):(l>n&&(l=n),o<n&&(o=n)))})),[l,o]},mean:(e,t)=>{let n=0,l=0;if(t.forEach((t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,l+=o)})),n)return l/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(!function(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))}(n))return;if(1===n.length)return n[0];const l=Math.floor(n.length/2),o=n.sort(((e,t)=>e-t));return n.length%2!=0?o[l]:(o[l-1]+o[l])/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},M={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},A={getDefaultColumnDef:()=>M,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:h("columnSizing",e),onColumnSizingInfoChange:h("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,l,o;const r=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:M.minSize,null!=(l=null!=r?r:e.columnDef.size)?l:M.size),null!=(o=e.columnDef.maxSize)?o:M.maxSize)},e.getStart=v((e=>[e,V(t,e),t.getState().columnSizing]),((t,n)=>n.slice(0,e.getIndex(t)).reduce(((e,t)=>e+t.getSize()),0)),f(t.options,"debugColumns")),e.getAfter=v((e=>[e,V(t,e),t.getState().columnSizing]),((t,n)=>n.slice(e.getIndex(t)+1).reduce(((e,t)=>e+t.getSize()),0)),f(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...l}=t;return l}))},e.getCanResize=()=>{var n,l;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(l=t.options.enableColumnResizing)||l)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var l;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(l=e.column.getSize())?l:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const l=t.getColumn(e.column.id),o=null==l?void 0:l.getCanResize();return r=>{if(!l||!o)return;if(null==r.persist||r.persist(),N(r)&&r.touches&&r.touches.length>1)return;const i=e.getSize(),a=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[l.id,l.getSize()]],u=N(r)?Math.round(r.touches[0].clientX):r.clientX,s={},c=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var l,o;const r=(n-(null!=(l=null==e?void 0:e.startOffset)?l:0))*("rtl"===t.options.columnResizeDirection?-1:1),i=Math.max(r/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;s[t]=Math.round(100*Math.max(n+n*i,0))/100})),{...e,deltaOffset:r,deltaPercentage:i}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...s}))))},d=e=>c("move",e),h=e=>{c("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},g=function(e){return e||("undefined"!=typeof document?document:null)}(n),v={moveHandler:e=>d(e.clientX),upHandler:e=>{null==g||g.removeEventListener("mousemove",v.moveHandler),null==g||g.removeEventListener("mouseup",v.upHandler),h(e.clientX)}},f={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{var t;null==g||g.removeEventListener("touchmove",f.moveHandler),null==g||g.removeEventListener("touchend",f.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(null==(t=e.touches[0])?void 0:t.clientX)}},b=!!function(){if("boolean"==typeof B)return B;let e=!1;try{const t=()=>{};window.addEventListener("test",t,{get passive(){return e=!0,!1}}),window.removeEventListener("test",t)}catch(t){e=!1}return B=e,B}()&&{passive:!1};N(r)?(null==g||g.addEventListener("touchmove",f.moveHandler,b),null==g||g.addEventListener("touchend",f.upHandler,b)):(null==g||g.addEventListener("mousemove",v.moveHandler,b),null==g||g.addEventListener("mouseup",v.upHandler,b)),t.setColumnSizingInfo((e=>({...e,startOffset:u,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:l.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let B=null;function N(e){return"touchstart"===e.type}function V(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const E={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:h("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const l={...n};return e.getPreGroupedRowModel().flatRows.forEach(t?e=>{e.getCanSelect()&&(l[e.id]=!0)}:e=>{delete l[e.id]}),l}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const l=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach((t=>{G(o,t.id,l,!0,e)})),o})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=v((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?H(e,n):{rows:[],flatRows:[],rowsById:{}}),f(e.options,"debugTable")),e.getFilteredSelectedRowModel=v((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?H(e,n):{rows:[],flatRows:[],rowsById:{}}),f(e.options,"debugTable")),e.getGroupedSelectedRowModel=v((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?H(e,n):{rows:[],flatRows:[],rowsById:{}}),f(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let l=!(!t.length||!Object.keys(n).length);return l&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(l=!1),l},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let l=!!t.length;return l&&t.some((e=>!n[e.id]))&&(l=!1),l},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,l)=>{const o=e.getIsSelected();t.setRowSelection((r=>{var i;if(n=void 0!==n?n:!o,e.getCanSelect()&&o===n)return r;const a={...r};return G(a,e.id,n,null==(i=null==l?void 0:l.selectChildren)||i,t),a}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return L(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===J(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===J(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var l;t&&e.toggleSelected(null==(l=n.target)?void 0:l.checked)}}}},G=(e,t,n,l,o)=>{var r;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),i.getCanSelect()&&(e[t]=!0)):delete e[t],l&&null!=(r=i.subRows)&&r.length&&i.getCanSelectSubRows()&&i.subRows.forEach((t=>G(e,t.id,n,l,o)))};function H(e,t){const n=e.getState().rowSelection,l=[],o={},r=function(e){return e.map((e=>{var t;const i=L(e,n);if(i&&(l.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:r(e.subRows)}),i)return e})).filter(Boolean)};return{rows:r(t.rows),flatRows:l,rowsById:o}}function L(e,t){var n;return null!=(n=t[e.id])&&n}function J(e,t){var n;if(null==(n=e.subRows)||!n.length)return!1;let l=!0,o=!1;return e.subRows.forEach((e=>{if((!o||l)&&(e.getCanSelect()&&(L(e,t)?o=!0:l=!1),e.subRows&&e.subRows.length)){const n=J(e,t);"all"===n?o=!0:"some"===n?(o=!0,l=!1):l=!1}})),l?"all":!!o&&"some"}const q=/([0-9]+)/gm;function $(e,t){return e===t?0:e>t?1:-1}function K(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":e+"":"string"==typeof e?e:""}function U(e,t){const n=e.split(q).filter(Boolean),l=t.split(q).filter(Boolean);for(;n.length&&l.length;){const e=n.shift(),t=l.shift(),o=parseInt(e,10),r=parseInt(t,10),i=[o,r].sort();if(isNaN(i[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(i[1]))return isNaN(o)?-1:1;if(o>r)return 1;if(r>o)return-1}}return n.length-l.length}const W={alphanumeric:(e,t,n)=>U(K(e.getValue(n)).toLowerCase(),K(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>U(K(e.getValue(n)),K(t.getValue(n))),text:(e,t,n)=>$(K(e.getValue(n)).toLowerCase(),K(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>$(K(e.getValue(n)),K(t.getValue(n))),datetime:(e,t,n)=>{const l=e.getValue(n),o=t.getValue(n);return l>o?1:l<o?-1:0},basic:(e,t,n)=>$(e.getValue(n),t.getValue(n))},X=[m,{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:h("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()})))},e.getIsVisible=()=>{var n,l;const o=e.columns;return null==(n=o.length?o.some((e=>e.getIsVisible())):null==(l=t.getState().columnVisibility)?void 0:l[e.id])||n},e.getCanHide=()=>{var n,l;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(l=t.options.enableHiding)||l)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=v((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),f(t.options,"debugRows")),e.getVisibleCells=v((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),f(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>v((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),f(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t(0,(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t(0,(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t(0,(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t(0,(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},{getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:h("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=v((e=>[V(t,e)]),(t=>t.findIndex((t=>t.id===e.id))),f(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var l;return(null==(l=V(t,n)[0])?void 0:l.id)===e.id},e.getIsLastColumn=n=>{var l;const o=V(t,n);return(null==(l=o[o.length-1])?void 0:l.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=v((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>l=>{let o=[];if(null!=e&&e.length){const t=[...e],n=[...l];for(;n.length&&t.length;){const e=t.shift(),l=n.findIndex((t=>t.id===e));l>-1&&o.push(n.splice(l,1)[0])}o=[...o,...n]}else o=l;return function(e,t,n){if(null==t||!t.length||!n)return e;const l=e.filter((e=>!t.includes(e.id)));return"remove"===n?l:[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...l]}(o,t,n)}),f(e.options,"debugTable"))}},{getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:h("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const l=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,o,r,i,a,u;return"right"===n?{left:(null!=(r=null==e?void 0:e.left)?r:[]).filter((e=>!(null!=l&&l.includes(e)))),right:[...(null!=(i=null==e?void 0:e.right)?i:[]).filter((e=>!(null!=l&&l.includes(e)))),...l]}:"left"===n?{left:[...(null!=(a=null==e?void 0:e.left)?a:[]).filter((e=>!(null!=l&&l.includes(e)))),...l],right:(null!=(u=null==e?void 0:e.right)?u:[]).filter((e=>!(null!=l&&l.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=l&&l.includes(e)))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter((e=>!(null!=l&&l.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,l,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(l=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||l)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:l,right:o}=t.getState().columnPinning,r=n.some((e=>null==l?void 0:l.includes(e))),i=n.some((e=>null==o?void 0:o.includes(e)));return r?"left":!!i&&"right"},e.getPinnedIndex=()=>{var n,l;const o=e.getIsPinned();return o?null!=(n=null==(l=t.getState().columnPinning)||null==(l=l[o])?void 0:l.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=v((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const l=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!l.includes(e.column.id)))}),f(t.options,"debugRows")),e.getLeftVisibleCells=v((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),f(t.options,"debugRows")),e.getRightVisibleCells=v((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),f(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,l;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(l=e.initialState)?void 0:l.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const l=e.getState().columnPinning;var o,r;return t?!!(null==(n=l[t])?void 0:n.length):!(!(null==(o=l.left)?void 0:o.length)&&!(null==(r=l.right)?void 0:r.length))},e.getLeftLeafColumns=v((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),f(e.options,"debugColumns")),e.getRightLeafColumns=v((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),f(e.options,"debugColumns")),e.getCenterLeafColumns=v((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const l=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!l.includes(e.id)))}),f(e.options,"debugColumns"))}},y,{getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:h("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],l=null==n?void 0:n.getValue(e.id);return"string"==typeof l?D.includesString:"number"==typeof l?D.inNumberRange:"boolean"==typeof l||null!==l&&"object"==typeof l?D.equals:Array.isArray(l)?D.arrIncludes:D.weakEquals},e.getFilterFn=()=>{var n,l;return g(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(l=t.options.filterFns)?void 0:l[e.columnDef.filterFn])?n:D[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,l,o;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(l=t.options.enableColumnFilters)||l)&&(null==(o=t.options.enableFilters)||o)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find((t=>t.id===e.id)))?void 0:n.value},e.getFilterIndex=()=>{var n,l;return null!=(n=null==(l=t.getState().columnFilters)?void 0:l.findIndex((t=>t.id===e.id)))?n:-1},e.setFilterValue=n=>{t.setColumnFilters((t=>{const l=e.getFilterFn(),o=null==t?void 0:t.find((t=>t.id===e.id)),r=d(n,o?o.value:void 0);var i;if(F(l,r,e))return null!=(i=null==t?void 0:t.filter((t=>t.id!==e.id)))?i:[];const a={id:e.id,value:r};var u;return o?null!=(u=null==t?void 0:t.map((t=>t.id===e.id?a:t)))?u:[]:null!=t&&t.length?[...t,a]:[a]}))}},createRow:e=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var l;return null==(l=d(t,e))?void 0:l.filter((e=>{const t=n.find((t=>t.id===e.id));return!t||!F(t.getFilterFn(),e.value,t)}))}))},e.resetColumnFilters=t=>{var n,l;e.setColumnFilters(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}},{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:h("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const l=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof l||"number"==typeof l}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,l,o,r;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(l=t.options.enableGlobalFilter)||l)&&(null==(o=t.options.enableFilters)||o)&&(null==(r=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||r)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>D.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:l}=e.options;return g(l)?l:"auto"===l?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[l])?t:D[l]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:h("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let l=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return W.datetime;if("string"==typeof n&&(l=!0,n.split(q).length>1))return W.alphanumeric}return l?W.text:W.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,l;if(!e)throw Error();return g(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(l=t.options.sortingFns)?void 0:l[e.columnDef.sortingFn])?n:W[e.columnDef.sortingFn]},e.toggleSorting=(n,l)=>{const o=e.getNextSortingOrder(),r=null!=n;t.setSorting((i=>{const a=null==i?void 0:i.find((t=>t.id===e.id)),u=null==i?void 0:i.findIndex((t=>t.id===e.id));let s,c=[],d=r?n:"desc"===o;var h;return s=null!=i&&i.length&&e.getCanMultiSort()&&l?a?"toggle":"add":null!=i&&i.length&&u!==i.length-1?"replace":a?"toggle":"replace","toggle"===s&&(r||o||(s="remove")),"add"===s?(c=[...i,{id:e.id,desc:d}],c.splice(0,c.length-(null!=(h=t.options.maxMultiSortColCount)?h:Number.MAX_SAFE_INTEGER))):c="toggle"===s?i.map((t=>t.id===e.id?{...t,desc:d}:t)):"remove"===s?i.filter((t=>t.id!==e.id)):[{id:e.id,desc:d}],c}))},e.getFirstSortDir=()=>{var n,l;return(null!=(n=null!=(l=e.columnDef.sortDescFirst)?l:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var l,o;const r=e.getFirstSortDir(),i=e.getIsSorted();return i?!!(i===r||null!=(l=t.options.enableSortingRemoval)&&!l||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===i?"asc":"desc"):r},e.getCanSort=()=>{var n,l;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(l=t.options.enableSorting)||l)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,l;return null!=(n=null!=(l=e.columnDef.enableMultiSort)?l:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const l=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!l&&(l.desc?"desc":"asc")},e.getSortIndex=()=>{var n,l;return null!=(n=null==(l=t.getState().sorting)?void 0:l.findIndex((t=>t.id===e.id)))?n:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return l=>{n&&(null==l.persist||l.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(l))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,l;e.setSorting(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},{getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:""+n)?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:h("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var n,l;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(l=t.options.enableGrouping)||l)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],l=null==n?void 0:n.getValue(e.id);return"number"==typeof l?P.sum:"[object Date]"===Object.prototype.toString.call(l)?P.extent:void 0},e.getAggregationFn=()=>{var n,l;if(!e)throw Error();return g(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(l=t.options.aggregationFns)?void 0:l[e.columnDef.aggregationFn])?n:P[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,l;e.setGrouping(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const l=t.getColumn(n);return null!=l&&l.columnDef.getGroupingValue?(e._groupingValuesCache[n]=l.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}},{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:h("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var l,o;if(t){if(null!=(l=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?l:!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,l;e.setExpanded(t?{}:null!=(n=null==(l=e.initialState)?void 0:l.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded((l=>{var o;const r=!0===l||!(null==l||!l[e.id]);let i={};if(!0===l?Object.keys(t.getRowModel().rowsById).forEach((e=>{i[e]=!0})):i=l,n=null!=(o=n)?o:!r,!r&&n)return{...i,[e.id]:!0};if(r&&!n){const{[e.id]:t,...n}=i;return n}return l}))},e.getIsExpanded=()=>{var n;const l=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===l||(null==l?void 0:l[e.id]))},e.getCanExpand=()=>{var n,l,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(l=t.options.enableExpanding)||l)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,l=e;for(;n&&l.parentId;)l=t.getRow(l.parentId,!0),n=l.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:h("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var l,o;if(t){if(null!=(l=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?l:!e.options.manualPagination){if(n)return;n=!0,e._queue((()=>{e.resetPageIndex(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>d(t,e))),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination((n=>{let l=d(t,n.pageIndex);return l=Math.max(0,Math.min(l,void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1)),{...n,pageIndex:l}}))},e.resetPageIndex=t=>{var n,l;e.setPageIndex(t?0:null!=(n=null==(l=e.initialState)||null==(l=l.pagination)?void 0:l.pageIndex)?n:0)},e.resetPageSize=t=>{var n,l;e.setPageSize(t?10:null!=(n=null==(l=e.initialState)||null==(l=l.pagination)?void 0:l.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination((e=>{const n=Math.max(1,d(t,e.pageSize)),l=Math.floor(e.pageSize*e.pageIndex/n);return{...e,pageIndex:l,pageSize:n}}))},e.setPageCount=t=>e.setPagination((n=>{var l;let o=d(t,null!=(l=e.options.pageCount)?l:-1);return"number"==typeof o&&(o=Math.max(-1,o)),{...n,pageCount:o}})),e.getPageOptions=v((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map(((e,t)=>t))),t}),f(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:h("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,l,o)=>{const r=l?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],i=o?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],a=new Set([...i,e.id,...r]);t.setRowPinning((e=>{var t,l,o,r,i,u;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter((e=>!(null!=a&&a.has(e)))),bottom:[...(null!=(r=null==e?void 0:e.bottom)?r:[]).filter((e=>!(null!=a&&a.has(e)))),...Array.from(a)]}:"top"===n?{top:[...(null!=(i=null==e?void 0:e.top)?i:[]).filter((e=>!(null!=a&&a.has(e)))),...Array.from(a)],bottom:(null!=(u=null==e?void 0:e.bottom)?u:[]).filter((e=>!(null!=a&&a.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=a&&a.has(e)))),bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter((e=>!(null!=a&&a.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:l,enablePinning:o}=t.options;return"function"==typeof l?l(e):null==(n=null!=l?l:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:l,bottom:o}=t.getState().rowPinning,r=n.some((e=>null==l?void 0:l.includes(e))),i=n.some((e=>null==o?void 0:o.includes(e)));return r?"top":!!i&&"bottom"},e.getPinnedIndex=()=>{var n,l;const o=e.getIsPinned();if(!o)return-1;const r=null==(n="top"===o?t.getTopRows():t.getBottomRows())?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(l=null==r?void 0:r.indexOf(e.id))?l:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,l;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(l=e.initialState)?void 0:l.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const l=e.getState().rowPinning;var o,r;return t?!!(null==(n=l[t])?void 0:n.length):!(!(null==(o=l.top)?void 0:o.length)&&!(null==(r=l.bottom)?void 0:r.length))},e._getPinnedRows=(t,n,l)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=n?n:[]).map((t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null})):(null!=n?n:[]).map((e=>t.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:l})))},e.getTopRows=v((()=>[e.getRowModel().rows,e.getState().rowPinning.top]),((t,n)=>e._getPinnedRows(t,n,"top")),f(e.options,"debugRows")),e.getBottomRows=v((()=>[e.getRowModel().rows,e.getState().rowPinning.bottom]),((t,n)=>e._getPinnedRows(t,n,"bottom")),f(e.options,"debugRows")),e.getCenterRows=v((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const l=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!l.has(e.id)))}),f(e.options,"debugRows"))}},E,A];const Q=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.action=l(this,"action",3),this.selectedRows=l(this,"selectedRows",3),this.stateChanged=l(this,"stateChanged",3),this.templateCache=new Map,this.headerTemplateCache=new Map,this.minPageIndex=1,this.table=null,this.parsedColumns=[],this.parsedData=[],this.globalFilterSearchTerm="",this.columnData=[],this.paginationState=null,this.sortingState=[],this.rowSelectionState={},this.data=[],this.columns=[],this.fallbackValue="N/A",this.noDataMessage="No data available",this.noColumnsNoDataMessage="No data or columns available to display.",this.autoGenerateColumns=!1,this.enableGlobalFilter=!1,this.globalFilterPosition="end",this.enablePagination=!1,this.pageSize=10,this.pageSizes=[10,20,30,40,50],this.enableSorting=!1,this.enableRowSelection=!1,this.state=null,this.debouncedFilter=function(e){let t;return function(...n){clearTimeout(t),t=setTimeout((()=>{clearTimeout(t),e(...n)}),300)}}((e=>{this.table?.setGlobalFilter(e)})),this.handleGlobalFilteringOnInput=e=>{const t=e.target;t instanceof HTMLInputElement&&this.debouncedFilter(t.value)},this.flexRender=(e,t)=>"function"==typeof e?e(t):e,this.handlePageIndexChange=e=>{const t=e.target;this.paginationState={...this.paginationState,pageIndex:t.value?Number(t.value)-1:0}},this.handlePageSizeChange=e=>{let t=Number(e.target.value);!this.pageSizes.includes(t)&&this.pageSizes&&(t=this.pageSizes[0]),this.paginationState={...this.paginationState,pageSize:t}},this.handleSortingClick=(e,t)=>{t.column.getCanSort()&&t.column.getToggleSortingHandler()?.(e)},this.getSortTitle=e=>{if(e.column.getCanSort())switch(e.column.getNextSortingOrder()){case u.Asc:return"Sort ascending";case u.Desc:return"Sort descending";default:return"Clear sort"}}}cacheTemplates(){const e=Array.from(this.el.querySelectorAll("nv-datagridcolumn"));this.columnData=[],e.forEach((e=>{const t=e.accessor,n=e.querySelector('[slot="cell"]');if(n){const e=i(n);this.templateCache.set(t,e)}const l=e.querySelector('[slot="header"]');if(l){const e=i(l);this.headerTemplateCache.set(t,e)}else{const n=e.header;if(n){const e=document.createElement("div");e.textContent=n,this.headerTemplateCache.set(t,e)}}const o={header:e.header,accessor:e.accessor,repeatTemplate:e.hasAttribute("repeat-template"),group:e.group};this.columnData.push(o)})),console.info("cacheTemplates this.columnData:",this.columnData)}parseDataAndColumns(){if(this.data&&this.data.length>0&&this.parseDataArray(this.data,this.parsedData),this.columns&&this.columns.length>0)this.parseColumnsArray(this.columns,this.parsedColumns);else if(this.headerTemplateCache.size>0){const e=Array.from(this.headerTemplateCache.keys()).map((e=>({accessor:e,header:e?e.charAt(0).toUpperCase()+e.slice(1):"",group:this.columnData.find((t=>t.accessor===e))?.group??"ungrouped"})));this.parseColumnsArray(e,this.parsedColumns)}else if(this.parsedData.length>0){const e=Object.keys(this.parsedData[0]).map((e=>({accessor:e,header:e.charAt(0).toUpperCase()+e.slice(1),group:this.columnData.find((t=>t.accessor===e))?.group??"ungrouped"})));this.autoGenerateColumns&&this.parseColumnsArray(e,this.parsedColumns)}}deepEqual(e,t){return JSON.stringify(e)===JSON.stringify(t)}parseDataArray(e,t){this.deepEqual(Array.isArray(e)?e:[],Array.isArray(t)?t:[])||(this.parsedData=Array.isArray(e)?e:[])}parseColumnsArray(e,t){const n=Array.isArray(e)?e:[];this.deepEqual(n,Array.isArray(t)?t:[])||(this.parsedColumns=n)}initializeTable(){this.table=null,console.info("initializeTable this.columnData:",this.columnData);const e={columns:[],data:[],getCoreRowModel:e=>v((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},l=function(t,o,r){void 0===o&&(o=0);const i=[];for(let u=0;u<t.length;u++){const s=S(e,e._getRowId(t[u],u,r),t[u],u,o,0,null==r?void 0:r.id);var a;n.flatRows.push(s),n.rowsById[s.id]=s,i.push(s),e.options.getSubRows&&(s.originalSubRows=e.options.getSubRows(t[u],u),null!=(a=s.originalSubRows)&&a.length&&(s.subRows=l(s.originalSubRows,o+1,s)))}return i};return n.rows=l(t),n}),f(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),debugAll:!0,onStateChange:e=>console.log("Table state changed:",e),renderFallbackValue:"No rows to display",state:{sorting:[],columnVisibility:{},columnFilters:[],columnPinning:{},columnSizing:{},columnOrder:[],pagination:null,grouping:[],expanded:{},rowPinning:{},rowSelection:{},globalFilter:null,columnSizingInfo:{columnSizingStart:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,startOffset:null,startSize:null}}};if(this.parsedColumns.length>0){const t=this.parsedColumns.filter((e=>e?.accessor)),n=t&&Array.isArray(t)&&t.length>0,l=this.parsedData&&Array.isArray(this.parsedData)&&this.parsedData.length>0;(n||l)&&(n&&!l||(e.data=this.getTableData()),e.columns=this.generateColumns(t,e))}else if(this.parsedData&&Array.isArray(this.parsedData)&&this.parsedData.length>0){const t=Object.keys(this.parsedData[0]).map((e=>({accessor:e,header:e.charAt(0).toUpperCase()+e.slice(1),group:this.columnData.find((t=>t.accessor===e))?.group??"ungrouped"})));this.autoGenerateColumns&&this.parseColumnsArray(t,this.parsedColumns),e.data=this.getTableData(),e.columns=this.generateColumns(t,e)}if(this.enableGlobalFilter&&(e.getFilteredRowModel=e=>v((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,l)=>{if(!t.rows.length||(null==n||!n.length)&&!l){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],r=[];(null!=n?n:[]).forEach((t=>{var n;const l=e.getColumn(t.id);if(!l)return;const r=l.getFilterFn();r&&o.push({id:t.id,filterFn:r,resolvedValue:null!=(n=null==r.resolveFilterValue?void 0:r.resolveFilterValue(t.value))?n:t.value})}));const i=(null!=n?n:[]).map((e=>e.id)),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let s,c;l&&a&&u.length&&(i.push("__global__"),u.forEach((e=>{var t;r.push({id:e.id,filterFn:a,resolvedValue:null!=(t=null==a.resolveFilterValue?void 0:a.resolveFilterValue(l))?t:l})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){s=o[e];const t=s.id;n.columnFilters[t]=s.filterFn(n,t,s.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(r.length){for(let e=0;e<r.length;e++){c=r[e];const t=c.id;if(c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return function(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var l;const o=[],r={},i=null!=(l=n.options.maxLeafRowFilterDepth)?l:100,a=function(e,l){void 0===l&&(l=0);const u=[];for(let c=0;c<e.length;c++){var s;let d=e[c];const h=S(n,d.id,d.original,d.index,d.depth,0,d.parentId);if(h.columnFilters=d.columnFilters,null!=(s=d.subRows)&&s.length&&l<i){if(h.subRows=a(d.subRows,l+1),d=h,t(d)&&!h.subRows.length){u.push(d),r[d.id]=d,o.push(d);continue}if(t(d)||h.subRows.length){u.push(d),r[d.id]=d,o.push(d);continue}}else d=h,t(d)&&(u.push(d),r[d.id]=d,o.push(d))}return u};return{rows:a(e),flatRows:o,rowsById:r}}(e,t,n):function(e,t,n){var l;const o=[],r={},i=null!=(l=n.options.maxLeafRowFilterDepth)?l:100,a=function(e,l){void 0===l&&(l=0);const u=[];for(let c=0;c<e.length;c++){let d=e[c];if(t(d)){var s;if(null!=(s=d.subRows)&&s.length&&l<i){const e=S(n,d.id,d.original,d.index,d.depth,0,d.parentId);e.subRows=a(d.subRows,l+1),d=e}u.push(d),o.push(d),r[d.id]=d}}return u};return{rows:a(e),flatRows:o,rowsById:r}}(e,t,n)}(t.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),f(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),e.state.globalFilter=this.globalFilterSearchTerm,e.onGlobalFilterChange=e=>{const t="function"==typeof e?e(this.globalFilterSearchTerm):e;this.globalFilterSearchTerm=t},e.globalFilterFn=this.globalFilterFn),this.enablePagination){e.getPaginationRowModel=e=>v((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:l,pageIndex:o}=t;let{rows:r,flatRows:i,rowsById:a}=n;const u=l*o;let s;r=r.slice(u,u+l),s=e.options.paginateExpandedRows?{rows:r,flatRows:i,rowsById:a}:function(e){const t=[],n=e=>{var l;t.push(e),null!=(l=e.subRows)&&l.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}({rows:r,flatRows:i,rowsById:a}),s.flatRows=[];const c=e=>{s.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return s.rows.forEach(c),s}),f(e.options,"debugTable"));const t=this.paginationState?.pageIndex??0;let n=this.paginationState?.pageSize??10;!this.pageSizes.includes(n)&&this.pageSizes&&(n=this.pageSizes[0]),e.state.pagination={pageIndex:t,pageSize:n},e.onPaginationChange=e=>{const t="function"==typeof e?e(this.paginationState):e;this.paginationState=t}}this.enableSorting&&(e.getSortedRowModel=e=>v((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const l=e.getState().sorting,o=[],r=l.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),i={};r.forEach((t=>{const n=e.getColumn(t.id);n&&(i[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const a=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let l=0;l<r.length;l+=1){var n;const o=r[l],a=i[o.id],u=a.sortUndefined,s=null!=(n=null==o?void 0:o.desc)&&n;let c=0;if(u){const n=void 0===e.getValue(o.id),l=void 0===t.getValue(o.id);if(n||l){if("first"===u)return n?-1:1;if("last"===u)return n?1:-1;c=n&&l?0:n?u:-u}}if(0===c&&(c=a.sortingFn(e,t,o.id)),0!==c)return s&&(c*=-1),a.invertSorting&&(c*=-1),c}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=a(e.subRows))})),t};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}}),f(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),e.enableSorting=this.enableSorting,e.state.sorting=this.sortingState,e.onSortingChange=e=>{const t="function"==typeof e?e(this.sortingState):e;this.sortingState=t}),this.enableRowSelection&&(e.state.rowSelection=this.rowSelectionState,e.onRowSelectionChange=e=>{const t="function"==typeof e?e(this.rowSelectionState):e;this.rowSelectionState=t;const n=Object.keys(t).filter((e=>t[e])).map((e=>this.parsedData[parseInt(e,10)]));this.selectedRows.emit(n)}),this.table=function(e){var t,n;const l=[...X,...null!=(t=e._features)?t:[]];let o={_features:l};const r=o._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(o))),{});let i={...null!=(n=e.initialState)?n:{}};o._features.forEach((e=>{var t;i=null!=(t=null==e.getInitialState?void 0:e.getInitialState(i))?t:i}));const a=[];let u=!1;const s={_features:l,options:{...r,...e},initialState:i,_queue:e=>{a.push(e),u||(u=!0,Promise.resolve().then((()=>{for(;a.length;)a.shift()();u=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{o.setState(o.initialState)},setOptions:e=>{const t=d(e,o.options);o.options=(e=>o.options.mergeOptions?o.options.mergeOptions(r,e):{...r,...e})(t)},getState:()=>o.options.state,setState:e=>{null==o.options.onStateChange||o.options.onStateChange(e)},_getRowId:(e,t,n)=>{var l;return null!=(l=null==o.options.getRowId?void 0:o.options.getRowId(e,t,n))?l:""+(n?[n.id,t].join("."):t)},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?o.getPrePaginationRowModel():o.getRowModel()).rowsById[e];if(!n&&(n=o.getCoreRowModel().rowsById[e],!n))throw Error();return n},_getDefaultColumnDef:v((()=>[o.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:""+n)?t:null},...o._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),f(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:v((()=>[o._getColumnDefs()]),(e=>{const t=function(e,n,l){return void 0===l&&(l=0),e.map((e=>{const r=function(e,t,n,l){var o,r;const i={...e._getDefaultColumnDef(),...t},a=i.accessorKey;let u,s=null!=(o=null!=(r=i.id)?r:a?"function"==typeof String.prototype.replaceAll?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)?o:"string"==typeof i.header?i.header:void 0;if(i.accessorFn?u=i.accessorFn:a&&(u=a.includes(".")?e=>{let t=e;for(const e of a.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[i.accessorKey]),!s)throw Error();let c={id:s+"",accessorFn:u,parent:l,depth:n,columnDef:i,columns:[],getFlatColumns:v((()=>[!0]),(()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),f(e.options,"debugColumns")),getLeafColumns:v((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=c.columns)&&t.length){let t=c.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[c]}),f(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(c,e);return c}(o,e,l,n);return r.columns=e.columns?t(e.columns,r,l+1):[],r}))};return t(e)}),f(e,"debugColumns")),getAllFlatColumns:v((()=>[o.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),f(e,"debugColumns")),_getAllFlatColumnsById:v((()=>[o.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),f(e,"debugColumns")),getAllLeafColumns:v((()=>[o.getAllColumns(),o._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),f(e,"debugColumns")),getColumn:e=>o._getAllFlatColumnsById()[e]};Object.assign(o,s);for(let e=0;e<o._features.length;e++){const t=o._features[e];null==t||null==t.createTable||t.createTable(o)}return o}(e)}globalFilterFn(e,t,n){const l=(n+"").toLowerCase().trim();if(!l)return!0;const o=e=>"object"==typeof e&&null!==e?Array.isArray(e)?e.some((e=>o(e))):Object.values(e).some((e=>o(e))):(e+"").toLowerCase().includes(l);return o(e.original)}createIconSpan(e,t){const n=document.createElement("span");if(n.className="icon",e&&!t){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("width","14"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 14 14"),e.setAttribute("fill","none");const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d","M11.6667 3.5L5.25004 9.91667L2.33337 7"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),e.appendChild(t),n.appendChild(e)}if(t){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.classList.add("indeterminate-svg"),e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("viewBox","0 0 14 14"),e.setAttribute("fill","none");const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d","M2.9165 7H11.0832"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),e.appendChild(t),n.appendChild(e)}return n}createIndeterminateCheckbox(e={}){const{indeterminate:t,checked:n=!1,disabled:l=!1,className:o="",onChange:r}=e,i=document.createElement("input");i.type="checkbox",i.checked=n,i.disabled=l,i.className=(o+" cursor-pointer").trim(),"boolean"==typeof t&&(i.indeterminate=!n&&t),r&&i.addEventListener("change",r);const a=this.createIconSpan(n,t),u=document.createElement("div");return u.className="checkbox-container",u.appendChild(i),u.appendChild(a),u}generateColumns(e,t){console.info("generateColumns this.columnData:",this.columnData),console.info("generateColumns validColumns:",e);let n=e||[];const l=(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e};(!e&&t.data&&t.data.length>0||e.length<=0&&t.data&&t.data.length>0)&&(n=Object.keys(t.data[0]).map((e=>({header:e.charAt(0).toUpperCase()+e.slice(1),accessor:e,group:this.columnData.find((t=>t.accessor===e))?.group??"ungrouped",headerSlot:null,cellSlot:null}))));const r=n.reduce(((e,t)=>{let l=t.group||"ungrouped";return"ungrouped"==l&&(l+=n.findIndex((e=>e==t))),e[l]||(e[l]=[]),e[l].push(t),e}),{}),i=e=>l(e.accessor,{header:this.renderTemplate(this.headerTemplateCache.get(e.accessor),e.header??e.accessor,null)??e.header??e.accessor,cell:t=>{const n=t.getValue(),l=t.row;return this.columnData.find((t=>t.accessor===e.accessor))?.repeatTemplate&&Array.isArray(n)?n.map((t=>this.renderTemplate(this.templateCache.get(e.accessor),t,l)??t??n??this.fallbackValue)):this.renderTemplate(this.templateCache.get(e.accessor),n,l)??n??this.fallbackValue},sortUndefined:"last",sortDescFirst:!1,enableSorting:this.enableSorting,enableGlobalFilter:this.enableGlobalFilter});let a=Object.entries(r).map((([e,t])=>e.includes("ungrouped")?t.map(i):{id:e,header:e,columns:t.map(i),enableSorting:this.enableSorting,enableGlobalFilter:this.enableGlobalFilter})).flat();return this.enableRowSelection&&(a=[l("select",{header:({table:e})=>o("div",{class:"flex px-1",ref:t=>{const n=this.createIndeterminateCheckbox({checked:e?.getIsAllRowsSelected(),indeterminate:e?.getIsSomeRowsSelected(),onChange:e?.getToggleAllRowsSelectedHandler()});t&&(t.innerHTML="",t.appendChild(n))}}),cell:({row:e})=>o("div",{class:"flex px-1",ref:t=>{const n=this.createIndeterminateCheckbox({checked:e?.getIsSelected(),disabled:!e?.getCanSelect(),indeterminate:e?.getIsSomeSelected(),onChange:e?.getToggleSelectedHandler()});t&&(t.innerHTML="",t.appendChild(n))}}),enableGlobalFilter:!1,enableSorting:!1}),...a]),a}getTableData(){return this.parsedData&&Array.isArray(this.parsedData)&&this.parsedData.length>0?[...this.parsedData]:[]}renderTemplate(e,t,n){if(!e)return null;const l=e instanceof HTMLTemplateElement?e.content:e,r=i(l);return r.querySelectorAll("*").forEach((e=>{this.replacePlaceholdersTextContent(e,t,n),this.replacePlaceholdersAttributes(e,t,n),this.replacePlaceholdersProperties(e,t,n)})),r.querySelectorAll("[data-bind-event]").forEach((e=>{const t=e.getAttribute("data-bind-event")||"",l=t.split(":");if(!t.includes(":")||l.length<2)return void console.warn("Invalid data-bind-event format:",t);const o=l[1],r=l.length>2?l[2]:null;e.addEventListener(l[0],(()=>{const e=(r?.split(",")??[]).reduce(((e,t)=>(n?.original&&t in n.original&&(e[t]=n.original?.[t]),e)),{});this.action.emit({keyAction:o,details:e})}))})),setTimeout((()=>{r.querySelectorAll("*").forEach((e=>{"function"==typeof e.connectedCallback&&e.connectedCallback()}))}),0),o("div",{ref:e=>{e&&(e.innerHTML="",e.appendChild(r))}})}replaceKeyWithValue(e,t){if(null==t)return this.fallbackValue;if("object"==typeof t){if(e.includes(".")){const n=e.split(".").reduce(((e,t)=>e&&void 0!==e[t]?e[t]:void 0),t);if(void 0!==n)return n+"";{const n=e.split(".")[0],l=e.substring(n.length+1),o=this.replaceKeyWithValue(l,t);if(o!==this.fallbackValue)return o}}return e in t?t[e]+"":Array.isArray(t)?t.map((t=>"object"!=typeof t?""+t:e in t?t[e]:""+t)).join(", "):this.fallbackValue}return t?.toString()??this.fallbackValue}replacePlaceholdersTextContent(e,t,n){if(t)e.childNodes.forEach((e=>{e.nodeType===Node.TEXT_NODE&&(e.textContent=e.textContent.replace(/__([\w.]+)__/g,((e,n)=>this.replaceKeyWithValue(n,t))))}));else{const t=n.original;e.childNodes.forEach((e=>{e.nodeType===Node.TEXT_NODE&&(e.textContent=e.textContent.replace(/__([\w.]+)__/g,((e,n)=>n in t?this.replaceKeyWithValue(n,t[n]):(console.warn(`Key ${n} not found in originalValue`),""))))}))}}replacePlaceholdersAttributes(e,t,n){if(t)Array.from(e.attributes).forEach((e=>{e.value.includes("__")&&(e.value=e.value.replace(/__([\w.]+)__/g,((e,n)=>this.replaceKeyWithValue(n,t))))}));else{const t=n.original;Array.from(e.attributes).forEach((e=>{e.value.includes("__")&&(e.value=e.value.replace(/__([\w.]+)__/g,((e,n)=>n in t?this.replaceKeyWithValue(n,t[n]):(console.warn(`Key ${n} not found in originalValue`),""))))}))}}replacePlaceholdersProperties(e,t,l){if(t){const l=new Set;Object.keys(e).forEach((e=>l.add(e)));let o=Object.getPrototypeOf(e);for(;o&&o!==n.prototype;)Object.keys(o).forEach((e=>l.add(e))),o=Object.getPrototypeOf(o);l.forEach((n=>{if("function"!=typeof e[n]&&!n.startsWith("on")&&!a.has(n))try{const l=e[n];"string"==typeof l&&l.includes("__")&&(e[n]=l.replace(/__([\w.]+)__/g,((e,n)=>this.replaceKeyWithValue(n,t))))}catch(e){console.warn(`Could not assign property ${n}:`,e.message)}}))}else{const t=l.original,o=new Set;Object.keys(t).forEach((e=>o.add(e)));let r=Object.getPrototypeOf(t);for(;r&&r!==n.prototype;)Object.keys(r).forEach((e=>o.add(e))),r=Object.getPrototypeOf(r);o.forEach((n=>{if("function"!=typeof e[n]&&!n.startsWith("on")&&!a.has(n)){const l=e[n];"string"==typeof l&&l.includes("__")&&(e[n]=l.replace(/__([\w.]+)__/g,((e,n)=>n in t?this.replaceKeyWithValue(n,t[n]):(console.warn(`Key ${n} not found in originalValue`),""))))}}))}}getArrowSorting(e){if(!e.column.getCanSort())return null;const t=e.column.getIsSorted();return t===u.Asc?o("div",{class:"inline-flex align-middle"},o("nv-icon",{name:"arrow-up"})):t===u.Desc?o("div",{class:"inline-flex align-middle"},o("nv-icon",{name:"arrow-down"})):null}getHeaderCell(e){const t=e.column.getCanSort(),n=this.getSortTitle(e),l=e.isPlaceholder?null:e.column.columnDef.header?this.flexRender(e.column.columnDef.header,e.getContext()):null,r=this.getArrowSorting(e),i=this.createSortingClickHandler(e);return this.enableRowSelection?o("th",{key:e.id,colSpan:e.colSpan},l," "):o("th",{key:e.id,colSpan:e.colSpan},o("button",{type:"button",class:t?"w-full text-left cursor-pointer select-none bg-transparent border-none p-0 m-0 focus:outline-none":"w-full text-left bg-transparent border-none p-0 m-0 cursor-default",onClick:i,title:n},o("span",{class:"inline-flex items-center gap-1"},l,r)))}createSortingClickHandler(e){return t=>{this.handleSortingClick(t,e)}}getPagination(){return this.enablePagination&&o("div",{class:"flex items-center gap-2"},o("button",{class:"border rounded p-1",disabled:!this.table.getCanPreviousPage(),onClick:this.table.firstPage},"<<"),o("button",{class:"border rounded p-1",disabled:!this.table.getCanPreviousPage(),onClick:this.table.previousPage},"<"),o("button",{class:"border rounded p-1",disabled:!this.table.getCanNextPage(),onClick:this.table.nextPage},">"),o("button",{class:"border rounded p-1",disabled:!this.table.getCanNextPage(),onClick:this.table.lastPage},">>"),o("span",{class:"flex items-center gap-1"},o("div",null,"Page"),o("strong",null,this.table.getState().pagination.pageIndex+1," of"," ",this.table.getPageCount().toLocaleString())),o("span",{class:"flex items-center gap-1"},"| Go to page:"," ",o("input",{type:"number",min:this.minPageIndex,max:this.table.getPageCount(),value:this.table.getState().pagination.pageIndex+1,class:"border p-1 rounded w-16","aria-label":"Go to page",onInput:this.handlePageIndexChange})),this.pageSizes?.length>0&&o("select",{"aria-label":"Rows per page",onChange:this.handlePageSizeChange},this.pageSizes.map((e=>o("option",{value:e+"",selected:this.table.getState().pagination.pageSize===e},"Show ",e)))))}parseColumns(e,t=[]){this.parseColumnsArray(e,t)}parseData(e,t=[]){this.parseDataArray(e,t)}handleParsedChange(){this.initializeTable()}handleGlobalFilterSearchTerm(e){this.table?this.table.options.state.globalFilter=e:console.warn("Table is not initialized yet.")}handlePaginationState(e,t){this.table?JSON.stringify(e)!==JSON.stringify(t)&&(this.table.options.state.pagination=e):console.warn("Table is not initialized yet.")}handleSortingState(e){this.table?this.table.options.state.sorting=e:console.warn("Table is not initialized yet.")}handlePageSize(e){let t=e;!this.pageSizes.includes(t)&&this.pageSizes&&(t=this.pageSizes[0]),this.paginationState={...this.paginationState,pageSize:t}}handleRowSelectionState(e,t){this.table?JSON.stringify(e)!==JSON.stringify(t)&&(this.table.options.state.rowSelection=e):console.warn("Table is not initialized yet.")}handleStateChange(e){e&&(this.globalFilterSearchTerm!==e.globalFilterSearchTerm&&(this.globalFilterSearchTerm=e.globalFilterSearchTerm),JSON.stringify(this.paginationState)!==JSON.stringify(e.paginationState)&&(this.paginationState=e.paginationState),JSON.stringify(this.sortingState)!==JSON.stringify(e.sortingState)&&(this.sortingState=e.sortingState))}handleInternalStateChange(){this.stateChanged.emit({globalFilterSearchTerm:this.globalFilterSearchTerm,paginationState:this.paginationState,sortingState:this.sortingState})}componentWillLoad(){if(this.cacheTemplates(),this.parseDataAndColumns(),this.initializeTable(),this.enablePagination){let e=this.pageSize>0?this.pageSize:10;!this.pageSizes.includes(e)&&this.pageSizes&&(e=this.pageSizes[0]),this.paginationState={pageIndex:Math.max(0,this.minPageIndex-1),pageSize:e}}}render(){const e=this.table&&void 0!==this.table&&0!==this.parsedColumns.length?this.table?.getHeaderGroups():[],t=this.table&&void 0!==this.table&&0!==this.parsedData.length?this.table?.getRowModel()?.rows:[];return o(r,{key:"08593ceb15e31184e76c7ab641f5e2db635527e2"},o("div",{key:"092f351ba6b5683b798651e5fb4eb1a40015684e",class:"hidden"},o("slot",{key:"c24d531e1e48dfc7db7bae7d6453994f70487f7b"})),o("slot",{key:"e0d2aa2dd23eac36c5b735ea7640937cce649987",name:"before"}),this.enableGlobalFilter&&this.table&&o("div",{key:"beb373f14fad14c50b2c92b6c5542dec797750b3",class:"search-container justify-"+this.globalFilterPosition},o("nv-fieldtext",{key:"943dc6d3b0663e15846682ede0f9ea5cb3f1c56e",value:this.globalFilterSearchTerm,onInput:this.handleGlobalFilteringOnInput,placeholder:"Search all columns..."})),0===this.parsedColumns.length&&0===this.parsedData.length?o("div",{class:"no-data"},this.noColumnsNoDataMessage):o("div",null,o("table",null,this.parsedColumns.length>0&&e.length>0&&o("thead",null,this.parsedColumns.length>0&&e?e?.map((e=>o("tr",{key:e.id},e.headers.map((e=>this.getHeaderCell(e)))))):null),o("tbody",null,t&&0!==t.length&&0!==this.parsedData.length?t.map((e=>{const t=e.id,n=e?.getVisibleCells();return o("tr",{key:t},n.map((e=>o("td",{key:e.id,"data-row-id":t},this.flexRender(e.column.columnDef.cell,e.getContext())))))})):o("tr",null,o("td",{colSpan:this.parsedColumns.length||12,class:"no-data"},this.noDataMessage))),this.table&&this.enableRowSelection?o("tfoot",null,o("tr",null,o("td",{colSpan:20},this.enableRowSelection&&this.table?o("div",null,this.rowSelectionState&&Object.keys(this.rowSelectionState).length>0?o("span",null,Object.keys(this.rowSelectionState).length," of"," ",this.table.getPreFilteredRowModel()?.rows?.length||0," ","Total Rows Selected"):o("span",null,"No rows selected")):null))):null),this.getPagination()),o("slot",{key:"9d016c03102ff36aeaf8ff5364086902b129f2ce",name:"after"}))}get el(){return this}static get watchers(){return{columns:[{parseColumns:0}],data:[{parseData:0}],parsedColumns:[{handleParsedChange:0}],parsedData:[{handleParsedChange:0}],globalFilterSearchTerm:[{handleGlobalFilterSearchTerm:0},{handleInternalStateChange:0}],paginationState:[{handlePaginationState:0},{handleInternalStateChange:0}],sortingState:[{handleSortingState:0},{handleInternalStateChange:0}],pageSize:[{handlePageSize:0}],rowSelectionState:[{handleRowSelectionState:0}],state:[{handleStateChange:0}]}}static get style(){return"nv-datagrid{--nv-datagrid-border-default:var( --components-form-field-border-default );--nv-datagrid-border-hover:var(--components-form-field-border-hover);--nv-datagrid-border-focus:var(--components-form-field-border-default);--nv-datagrid-background-default:var( --components-form-field-background-default );--nv-datagrid-background-checked:var( --components-form-field-background-checked );--nv-datagrid-background-disabled:var( --components-form-field-background-disabled );--nv-datagrid-color-checked:var( --components-form-shape-foreground-default );--nv-datagrid-color-disabled:var( --components-form-shape-foreground-disabled );--nv-datagrid-outline-color:var(--color-focus-brand);display:block}nv-datagrid .hidden{display:none}nv-datagrid table{border-collapse:collapse;border-color:inherit;text-indent:0;width:100%}nv-datagrid th{text-align:left;border-bottom:1px solid var(--components-datagrid-header-border);min-height:var(--spacing-12);padding:var(--datagrid-cell-header-padding-y) var(--datagrid-cell-header-padding-x);font-size:var(--font-size-md);font-weight:var(--font-weight-high-emphasis);color:var(--components-datagrid-header-text)}nv-datagrid td{border-bottom:1px solid var(--components-datagrid-body-border);min-height:var(--spacing-12);max-height:var(--spacing-14);padding:var(--datagrid-cell-body-padding-y) var(--datagrid-cell-body-padding-x);font-size:var(--font-size-md);font-weight:var(--font-weight-low-emphasis);color:var(--components-datagrid-body-text);white-space:nowrap;text-overflow:ellipsis}nv-datagrid tbody>tr:hover{background:var(--color-interaction-container-neutral-background-hover)}nv-datagrid .cursor-pointer{cursor:pointer}nv-datagrid .select-none{-webkit-user-select:none;user-select:none}nv-datagrid .search-container{display:flex}nv-datagrid .checkbox-container{position:relative;color:var(--nv-datagrid-color-checked)}nv-datagrid .checkbox-container input[type=checkbox][readonly]{opacity:0.5}nv-datagrid .checkbox-container:has(input[type=checkbox]:disabled:not([readonly])){color:var(--nv-datagrid-color-disabled)}nv-datagrid .checkbox-container input[type=checkbox]{appearance:none;position:relative;display:flex;width:var(--form-checkbox-size);height:var(--form-checkbox-size);flex-direction:column;align-items:flex-start;border-radius:var(--form-checkbox-radius);border-width:var(--form-checkbox-border-width);border-style:solid;border-color:var(--nv-datagrid-border-default);background:var(--nv-datagrid-background-default)}nv-datagrid .checkbox-container input[type=checkbox]:hover{border-color:var(--nv-datagrid-border-hover)}nv-datagrid .checkbox-container input[type=checkbox]:focus{border-color:var(--nv-datagrid-border-focus)}nv-datagrid .checkbox-container input[type=checkbox]:focus,nv-datagrid .checkbox-container input[type=checkbox]:focus-within{outline:none}nv-datagrid .checkbox-container input[type=checkbox]:focus-visible,nv-datagrid .checkbox-container input[type=checkbox]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--nv-datagrid-outline-color);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-datagrid .checkbox-container input[type=checkbox]:checked,nv-datagrid .checkbox-container input[type=checkbox]:indeterminate{background:var(--nv-datagrid-background-checked);border-color:var(--nv-datagrid-background-checked)}nv-datagrid .checkbox-container input[type=checkbox]:disabled:not([readonly]){background:var(--nv-datagrid-background-disabled);border-color:var(--nv-datagrid-border-default)}nv-datagrid .checkbox-container input[type=checkbox][readonly]{opacity:0.5}nv-datagrid .checkbox-container .icon{pointer-events:none;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}nv-datagrid .checkbox-container .icon svg{width:var(--form-checkbox-icon-size);height:var(--form-checkbox-icon-size);fill:none;stroke:currentcolor;stroke-width:var(--form-checkbox-icon-stroke);flex-shrink:0}"}},[260,"nv-datagrid",{data:[16],columns:[16],fallbackValue:[513,"fallback-value"],noDataMessage:[513,"no-data-message"],noColumnsNoDataMessage:[513,"no-columns-no-data-message"],autoGenerateColumns:[516,"auto-generate-columns"],enableGlobalFilter:[516,"enable-global-filter"],globalFilterPosition:[513,"global-filter-position"],enablePagination:[516,"enable-pagination"],pageSize:[514,"page-size"],pageSizes:[16],enableSorting:[516,"enable-sorting"],enableRowSelection:[516,"enable-row-selection"],state:[16],table:[32],parsedColumns:[32],parsedData:[32],globalFilterSearchTerm:[32],columnData:[32],paginationState:[32],sortingState:[32],rowSelectionState:[32]},void 0,{columns:[{parseColumns:0}],data:[{parseData:0}],parsedColumns:[{handleParsedChange:0}],parsedData:[{handleParsedChange:0}],globalFilterSearchTerm:[{handleGlobalFilterSearchTerm:0},{handleInternalStateChange:0}],paginationState:[{handlePaginationState:0},{handleInternalStateChange:0}],sortingState:[{handleSortingState:0},{handleInternalStateChange:0}],pageSize:[{handlePageSize:0}],rowSelectionState:[{handleRowSelectionState:0}],state:[{handleStateChange:0}]}]);function Y(){"undefined"!=typeof customElements&&["nv-datagrid","nv-fieldtext","nv-icon"].forEach((t=>{switch(t){case"nv-datagrid":customElements.get(e(t))||customElements.define(e(t),Q);break;case"nv-fieldtext":customElements.get(e(t))||s();break;case"nv-icon":customElements.get(e(t))||c()}}))}Y();const Z=Q,ee=Y;export{Z as NvDatagrid,ee as defineCustomElement}
|