@zeedhi/vuetify 3.0.6 → 3.0.7
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/components/index.js +275 -0
- package/dist/components/tek-grid/TekGrid.js +287 -0
- package/dist/components/tek-grid/column-filter/TekGridColumnFilter.js +201 -0
- package/dist/components/tek-grid/column-header/TekGridHeaderRow.js +134 -0
- package/dist/components/tek-grid/columns-button/TekGridColumnsButton.js +79 -0
- package/dist/components/tek-grid/columns-button/TekGridColumnsOptionsController.js +416 -0
- package/dist/components/tek-grid/columns-button/TekGridColumnsOptionsModal.js +501 -0
- package/dist/components/tek-grid/filter-button/TekGridFilterButton.js +36 -0
- package/dist/components/tek-grid/indentation/TekGridIndentation.js +20 -0
- package/dist/components/tek-grid/layout-options/TekGridLayoutOptions.js +101 -0
- package/dist/components/tek-grid/row/TekGridFooterRow.js +57 -0
- package/dist/components/tek-grid/row/TekGridGroupRow.js +58 -0
- package/dist/components/tooltip-overflow/ZdTooltipOverflow.js +56 -0
- package/dist/components/zd-activator-wrapper/ZdActivatorWrapper.js +33 -0
- package/dist/components/zd-alert/ZdAlert.js +112 -0
- package/dist/components/zd-badge/ZdBadge.js +28 -0
- package/dist/components/zd-breadcrumbs/ZdBreadcrumbs.js +55 -0
- package/dist/components/zd-button/ZdButton.js +230 -0
- package/dist/components/zd-button-group/ZdButtonGroup.js +110 -0
- package/dist/components/zd-card/ZdCard.js +132 -0
- package/dist/components/zd-carousel/ZdCarousel.js +242 -0
- package/dist/components/zd-checkbox/ZdCheckbox.js +35 -0
- package/dist/components/zd-checkbox-multiple/ZdCheckboxMultiple.js +62 -0
- package/dist/components/zd-chip/ZdChip.js +94 -0
- package/dist/components/zd-code-viewer/ZdCodeViewer.js +55 -0
- package/dist/components/zd-code-viewer/prism.js +14 -0
- package/dist/components/zd-col/ZdCol.js +45 -0
- package/dist/components/zd-collapse-card/ZdCollapseCard.js +85 -0
- package/dist/components/zd-component/ZdComponent.js +259 -0
- package/dist/components/zd-component/ZdComponentRender.js +14 -0
- package/dist/components/zd-container/ZdContainer.js +42 -0
- package/dist/components/zd-currency/ZdCurrency.js +24 -0
- package/dist/components/zd-date-input/ZdDateInput.js +247 -0
- package/dist/components/zd-date-range/ZdDateRange.js +251 -0
- package/dist/components/zd-dialog/ZdDialog.js +34 -0
- package/dist/components/zd-divider/ZdDivider.js +28 -0
- package/dist/components/zd-dropdown/ZdDropdown.js +93 -0
- package/dist/components/zd-footer/ZdFooter.js +77 -0
- package/dist/components/zd-form/ZdForm.js +85 -0
- package/dist/components/zd-frame/ZdFrame.js +76 -0
- package/dist/components/zd-frame-page/ZdFramePage.js +21 -0
- package/dist/components/zd-grid/ZdGrid.js +284 -0
- package/dist/components/zd-grid/cell/ZdGridAction.js +12 -0
- package/dist/components/zd-grid/cell/ZdGridCell.js +59 -0
- package/dist/components/zd-grid/cell/ZdGridCellContent.js +59 -0
- package/dist/components/zd-grid/cell/ZdGridCheckbox.js +38 -0
- package/dist/components/zd-grid/column-header/ZdGridColumnHeader.js +70 -0
- package/dist/components/zd-grid/column-header/ZdGridHeaderIcon.js +31 -0
- package/dist/components/zd-grid/column-header/ZdGridHeaderRow.js +102 -0
- package/dist/components/zd-grid/column-header/ZdGridSort.js +32 -0
- package/dist/components/zd-grid/composables/grid-instance.js +12 -0
- package/dist/components/zd-grid/footer/ZdGridFooter.js +16 -0
- package/dist/components/zd-grid/helper/ZdGridHelper.js +12 -0
- package/dist/components/zd-grid/row/TableRow.js +25 -0
- package/dist/components/zd-grid/row/ZdGridRow.js +70 -0
- package/dist/components/zd-grid/toolbar/ZdGridToolbar.js +15 -0
- package/dist/components/zd-grid-editable/ZdGridEditable.js +174 -0
- package/dist/components/zd-grid-editable/cell/ZdGridEditableCell.js +135 -0
- package/dist/components/zd-grid-editable/row/ZdGridEditableRow.js +99 -0
- package/dist/components/zd-header/ZdHeader.js +111 -0
- package/dist/components/zd-icon/ZdIcon.js +63 -0
- package/dist/components/zd-image/ZdImage.js +48 -0
- package/dist/components/zd-increment/ZdIncrement.js +38 -0
- package/dist/components/zd-input/ZdInput.js +164 -0
- package/dist/components/zd-iterable/ZdIterable.js +38 -0
- package/dist/components/zd-iterable/ZdIterableNoData.js +20 -0
- package/dist/components/zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton.js +50 -0
- package/dist/components/zd-iterable/zd-iterable-page-info/ZdIterablePageInfo.js +21 -0
- package/dist/components/zd-iterable/zd-iterable-page-size/ZdIterablePageSize.js +55 -0
- package/dist/components/zd-iterable/zd-iterable-pagination/ZdIterablePagination.js +36 -0
- package/dist/components/zd-iterable/zd-search/ZdSearch.js +42 -0
- package/dist/components/zd-iterable-component-render/ZdIterableComponentRender.js +108 -0
- package/dist/components/zd-layout/ZdLayout.js +41 -0
- package/dist/components/zd-list/ZdList.js +84 -0
- package/dist/components/zd-list/ZdListGroup.js +38 -0
- package/dist/components/zd-list/ZdListItem.js +66 -0
- package/dist/components/zd-loading/ZdLoading.js +61 -0
- package/dist/components/zd-login/ZdLogin.js +68 -0
- package/dist/components/zd-login/ZdLoginButton.js +28 -0
- package/dist/components/zd-main/ZdMain.js +33 -0
- package/dist/components/zd-master-detail/ZdMasterDetail.js +48 -0
- package/dist/components/zd-menu/ZdMenu.js +302 -0
- package/dist/components/zd-menu/ZdMenuButton.js +42 -0
- package/dist/components/zd-menu/ZdMenuGroup.js +66 -0
- package/dist/components/zd-menu/ZdMenuLink.js +63 -0
- package/dist/components/zd-menu/ZdMenuSeparator.js +26 -0
- package/dist/components/zd-modal/ZdModal.js +123 -0
- package/dist/components/zd-modal/ZdModalCloseButton.js +36 -0
- package/dist/components/zd-month/ZdMonth.js +31 -0
- package/dist/components/zd-number-input/ZdNumberInput.js +84 -0
- package/dist/components/zd-password/ZdPassword.js +23 -0
- package/dist/components/zd-progress/ZdProgress.js +52 -0
- package/dist/components/zd-radio/ZdRadio.js +56 -0
- package/dist/components/zd-row/ZdRow.js +43 -0
- package/dist/components/zd-select/ZdSelect.js +191 -0
- package/dist/components/zd-select-multiple/ZdSelectMultiple.js +326 -0
- package/dist/components/zd-svg-map/ZdSvgMap.js +211 -0
- package/dist/components/zd-switch/ZdSwitch.js +39 -0
- package/dist/components/zd-table/ZdTable.js +42 -0
- package/dist/components/zd-tabs/ZdTab.js +92 -0
- package/dist/components/zd-tabs/ZdTabItem.js +17 -0
- package/dist/components/zd-tabs/ZdTabs.js +84 -0
- package/dist/components/zd-tag/ZdTag.js +34 -0
- package/dist/components/zd-text/ZdText.js +35 -0
- package/dist/components/zd-text-input/ZdTextInput.js +174 -0
- package/dist/components/zd-textarea/ZdTextarea.js +76 -0
- package/dist/components/zd-time/ZdTime.js +159 -0
- package/dist/components/zd-toggleable/ZdToggleable.js +13 -0
- package/dist/components/zd-tooltip/ZdTooltip.js +92 -0
- package/dist/components/zd-tree/ZdTree.js +315 -0
- package/dist/components/zd-tree/ZdTreeAfterTitle.js +17 -0
- package/dist/components/zd-tree/ZdTreeCheckbox.js +97 -0
- package/dist/components/zd-tree-grid/ZdTreeGrid.js +101 -0
- package/dist/components/zd-tree-grid/cell/ZdTreeGridCell.js +81 -0
- package/dist/components/zd-tree-grid/row/ZdTreeGridRow.js +85 -0
- package/dist/composables/cellSelection.js +37 -0
- package/dist/composables/columnDrag.js +82 -0
- package/dist/composables/columnResize.js +115 -0
- package/dist/composables/density.js +13 -0
- package/dist/composables/doubleClick.js +32 -0
- package/dist/composables/fixedColumns.js +106 -0
- package/dist/composables/gridColorVars.js +30 -0
- package/dist/composables/gridColumns.js +87 -0
- package/dist/composables/gridSelection.js +91 -0
- package/dist/composables/gridSorting.js +19 -0
- package/dist/composables/hasSlot.js +25 -0
- package/dist/composables/index.js +16 -0
- package/dist/composables/maska.js +36 -0
- package/dist/composables/tableNavigation.js +126 -0
- package/dist/composables/useIsMobile.js +8 -0
- package/dist/composables/useTableLayout.js +212 -0
- package/dist/composables/virtualScroll.js +92 -0
- package/dist/composables/watchUrl.js +14 -0
- package/dist/errors/index.js +3 -0
- package/dist/errors/not-provided.js +11 -0
- package/dist/errors/row-not-found.js +9 -0
- package/dist/errors/zeedhi-error.js +8 -0
- package/dist/index.js +49 -0
- package/dist/propsMixins/heightProps.js +17 -0
- package/dist/propsMixins/index.js +3 -0
- package/dist/propsMixins/interfaces.js +1 -0
- package/dist/propsMixins/widthProps.js +13 -0
- package/dist/utils/buildProps.js +3 -0
- package/dist/utils/fillHeight.js +18 -0
- package/dist/utils/icons/icons.js +28 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/isArrayOperation.js +4 -0
- package/dist/utils/logger/logger.js +7 -0
- package/dist/utils/mergeDictionaries.js +22 -0
- package/dist/utils/plugins/formatSizePlugin.js +6 -0
- package/dist/utils/plugins/getIconPlugin.js +11 -0
- package/dist/utils/plugins/index.js +4 -0
- package/dist/utils/plugins/styleObjectPlugin.js +13 -0
- package/dist/zd-vuetify.css +22578 -22810
- package/dist/zd-vuetify.js +9696 -13977
- package/package.json +8 -6
- package/src/components/index.ts +0 -27
- package/src/components/zd-date-input/ZdDateInput.ts +11 -9
- package/src/components/zd-date-input/ZdDateInput.vue +42 -46
- package/src/components/zd-date-range/ZdDateRange.ts +24 -23
- package/src/components/zd-date-range/ZdDateRange.vue +42 -54
- package/src/components/zd-month/ZdMonth.ts +0 -17
- package/src/components/zd-month/ZdMonth.vue +0 -1
- package/src/components/zd-text-input/ZdTextInput.ts +4 -0
- package/src/components/zd-text-input/ZdTextInput.vue +1 -0
- package/src/components/zd-time/ZdTime.ts +11 -50
- package/src/components/zd-time/ZdTime.vue +41 -29
- package/src/composables/index.ts +1 -1
- package/src/composables/useIsMobile.ts +9 -0
- package/src/errors/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/utils/index.ts +0 -1
- package/types/components/index.d.ts +80 -88
- package/types/components/tek-grid/TekGrid.d.ts +7258 -7258
- package/types/components/tek-grid/column-filter/TekGridColumnFilter.d.ts +129 -129
- package/types/components/tek-grid/column-header/TekGridHeaderRow.d.ts +225 -225
- package/types/components/tek-grid/columns-button/TekGridColumnsButton.d.ts +2432 -2432
- package/types/components/tek-grid/columns-button/TekGridColumnsOptionsController.d.ts +65 -65
- package/types/components/tek-grid/columns-button/TekGridColumnsOptionsModal.d.ts +9 -9
- package/types/components/tek-grid/filter-button/TekGridFilterButton.d.ts +2920 -2920
- package/types/components/tek-grid/indentation/TekGridIndentation.d.ts +32 -32
- package/types/components/tek-grid/layout-options/TekGridLayoutOptions.d.ts +1892 -1892
- package/types/components/tek-grid/row/TekGridFooterRow.d.ts +90 -90
- package/types/components/tek-grid/row/TekGridGroupRow.d.ts +87 -87
- package/types/components/tooltip-overflow/ZdTooltipOverflow.d.ts +50 -50
- package/types/components/zd-activator-wrapper/ZdActivatorWrapper.d.ts +25 -25
- package/types/components/zd-alert/ZdAlert.d.ts +884 -884
- package/types/components/zd-badge/ZdBadge.d.ts +624 -624
- package/types/components/zd-breadcrumbs/ZdBreadcrumbs.d.ts +697 -697
- package/types/components/zd-button/ZdButton.d.ts +1158 -1158
- package/types/components/zd-button-group/ZdButtonGroup.d.ts +785 -785
- package/types/components/zd-card/ZdCard.d.ts +1028 -1028
- package/types/components/zd-carousel/ZdCarousel.d.ts +2007 -2007
- package/types/components/zd-checkbox/ZdCheckbox.d.ts +655 -642
- package/types/components/zd-checkbox-multiple/ZdCheckboxMultiple.d.ts +2040 -2010
- package/types/components/zd-chip/ZdChip.d.ts +1256 -1256
- package/types/components/zd-code-viewer/ZdCodeViewer.d.ts +791 -791
- package/types/components/zd-code-viewer/prism.d.ts +14 -14
- package/types/components/zd-col/ZdCol.d.ts +741 -741
- package/types/components/zd-collapse-card/ZdCollapseCard.d.ts +1583 -1583
- package/types/components/zd-component/ZdComponent.d.ts +104 -104
- package/types/components/zd-component/ZdComponentRender.d.ts +80 -80
- package/types/components/zd-container/ZdContainer.d.ts +722 -722
- package/types/components/zd-currency/ZdCurrency.d.ts +2068 -2024
- package/types/components/zd-date-input/ZdDateInput.d.ts +986 -960
- package/types/components/zd-date-range/ZdDateRange.d.ts +2305 -0
- package/types/components/zd-dialog/ZdDialog.d.ts +262 -262
- package/types/components/zd-divider/ZdDivider.d.ts +623 -623
- package/types/components/zd-dropdown/ZdDropdown.d.ts +836 -836
- package/types/components/zd-footer/ZdFooter.d.ts +1262 -1262
- package/types/components/zd-form/ZdForm.d.ts +118 -118
- package/types/components/zd-frame/ZdFrame.d.ts +138 -138
- package/types/components/zd-frame-page/ZdFramePage.d.ts +805 -805
- package/types/components/zd-grid/ZdGrid.d.ts +7304 -7304
- package/types/components/zd-grid/cell/ZdGridAction.d.ts +14 -14
- package/types/components/zd-grid/cell/ZdGridCell.d.ts +68 -68
- package/types/components/zd-grid/cell/ZdGridCellContent.d.ts +58 -58
- package/types/components/zd-grid/cell/ZdGridCheckbox.d.ts +53 -53
- package/types/components/zd-grid/column-header/ZdGridColumnHeader.d.ts +112 -112
- package/types/components/zd-grid/column-header/ZdGridHeaderIcon.d.ts +46 -46
- package/types/components/zd-grid/column-header/ZdGridHeaderRow.d.ts +165 -165
- package/types/components/zd-grid/column-header/ZdGridSort.d.ts +47 -47
- package/types/components/zd-grid/composables/grid-instance.d.ts +2085 -2085
- package/types/components/zd-grid/footer/ZdGridFooter.d.ts +2087 -2087
- package/types/components/zd-grid/helper/ZdGridHelper.d.ts +16 -16
- package/types/components/zd-grid/row/TableRow.d.ts +34 -34
- package/types/components/zd-grid/row/ZdGridRow.d.ts +105 -105
- package/types/components/zd-grid/toolbar/ZdGridToolbar.d.ts +2086 -2086
- package/types/components/zd-grid-editable/ZdGridEditable.d.ts +8663 -8663
- package/types/components/zd-grid-editable/cell/ZdGridEditableCell.d.ts +637 -637
- package/types/components/zd-grid-editable/row/ZdGridEditableRow.d.ts +126 -126
- package/types/components/zd-header/ZdHeader.d.ts +1320 -1320
- package/types/components/zd-icon/ZdIcon.d.ts +383 -383
- package/types/components/zd-image/ZdImage.d.ts +753 -753
- package/types/components/zd-increment/ZdIncrement.d.ts +2113 -2069
- package/types/components/zd-input/ZdInput.d.ts +204 -200
- package/types/components/zd-iterable/ZdIterable.d.ts +130 -130
- package/types/components/zd-iterable/ZdIterableNoData.d.ts +2089 -2089
- package/types/components/zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton.d.ts +1645 -1645
- package/types/components/zd-iterable/zd-iterable-page-info/ZdIterablePageInfo.d.ts +1081 -1081
- package/types/components/zd-iterable/zd-iterable-page-size/ZdIterablePageSize.d.ts +2807 -2763
- package/types/components/zd-iterable/zd-iterable-pagination/ZdIterablePagination.d.ts +1653 -1627
- package/types/components/zd-iterable/zd-search/ZdSearch.d.ts +792 -766
- package/types/components/zd-iterable-component-render/ZdIterableComponentRender.d.ts +2484 -2484
- package/types/components/zd-layout/ZdLayout.d.ts +647 -647
- package/types/components/zd-list/ZdList.d.ts +1140 -1140
- package/types/components/zd-list/ZdListGroup.d.ts +1332 -1332
- package/types/components/zd-list/ZdListItem.d.ts +848 -848
- package/types/components/zd-loading/ZdLoading.d.ts +350 -350
- package/types/components/zd-login/ZdLogin.d.ts +1072 -1072
- package/types/components/zd-login/ZdLoginButton.d.ts +1913 -1910
- package/types/components/zd-main/ZdMain.d.ts +619 -619
- package/types/components/zd-master-detail/ZdMasterDetail.d.ts +684 -684
- package/types/components/zd-menu/ZdMenu.d.ts +4484 -4484
- package/types/components/zd-menu/ZdMenuButton.d.ts +1142 -1142
- package/types/components/zd-menu/ZdMenuGroup.d.ts +6286 -6286
- package/types/components/zd-menu/ZdMenuLink.d.ts +10437 -10437
- package/types/components/zd-menu/ZdMenuSeparator.d.ts +600 -600
- package/types/components/zd-modal/ZdModal.d.ts +10 -10
- package/types/components/zd-modal/ZdModalCloseButton.d.ts +1137 -1137
- package/types/components/zd-month/ZdMonth.d.ts +2260 -2217
- package/types/components/zd-number-input/ZdNumberInput.d.ts +2065 -2021
- package/types/components/zd-password/ZdPassword.d.ts +2058 -2014
- package/types/components/zd-progress/ZdProgress.d.ts +859 -859
- package/types/components/zd-radio/ZdRadio.d.ts +695 -682
- package/types/components/zd-row/ZdRow.d.ts +734 -734
- package/types/components/zd-select/ZdSelect.d.ts +321 -313
- package/types/components/zd-select-multiple/ZdSelectMultiple.d.ts +341 -333
- package/types/components/zd-svg-map/ZdSvgMap.d.ts +414 -414
- package/types/components/zd-switch/ZdSwitch.d.ts +1948 -1918
- package/types/components/zd-table/ZdTable.d.ts +1092 -1092
- package/types/components/zd-tabs/ZdTab.d.ts +674 -674
- package/types/components/zd-tabs/ZdTabItem.d.ts +268 -268
- package/types/components/zd-tabs/ZdTabs.d.ts +929 -929
- package/types/components/zd-tag/ZdTag.d.ts +613 -613
- package/types/components/zd-text/ZdText.d.ts +670 -670
- package/types/components/zd-text-input/ZdTextInput.d.ts +772 -746
- package/types/components/zd-textarea/ZdTextarea.d.ts +903 -877
- package/types/components/zd-time/ZdTime.d.ts +2271 -2224
- package/types/components/zd-toggleable/ZdToggleable.d.ts +203 -199
- package/types/components/zd-tooltip/ZdTooltip.d.ts +781 -781
- package/types/components/zd-tree/ZdTree.d.ts +1879 -1878
- package/types/components/zd-tree/ZdTreeAfterTitle.d.ts +28 -26
- package/types/components/zd-tree/ZdTreeCheckbox.d.ts +74 -74
- package/types/components/zd-tree-grid/ZdTreeGrid.d.ts +4178 -4178
- package/types/components/zd-tree-grid/cell/ZdTreeGridCell.d.ts +92 -92
- package/types/components/zd-tree-grid/row/ZdTreeGridRow.d.ts +124 -124
- package/types/composables/cellSelection.d.ts +281 -281
- package/types/composables/columnDrag.d.ts +9 -9
- package/types/composables/columnResize.d.ts +18 -18
- package/types/composables/density.d.ts +12 -12
- package/types/composables/doubleClick.d.ts +6 -6
- package/types/composables/fixedColumns.d.ts +14 -14
- package/types/composables/gridColorVars.d.ts +13 -13
- package/types/composables/gridColumns.d.ts +285 -285
- package/types/composables/gridSelection.d.ts +15 -15
- package/types/composables/gridSorting.d.ts +17 -17
- package/types/composables/hasSlot.d.ts +8 -8
- package/types/composables/index.d.ts +16 -16
- package/types/composables/maska.d.ts +16 -16
- package/types/composables/tableNavigation.d.ts +11 -11
- package/types/composables/useIsMobile.d.ts +3 -0
- package/types/composables/useTableLayout.d.ts +25 -25
- package/types/composables/virtualScroll.d.ts +26 -26
- package/types/composables/watchUrl.d.ts +8 -8
- package/types/errors/index.d.ts +3 -2
- package/types/errors/not-provided.d.ts +7 -7
- package/types/errors/row-not-found.d.ts +7 -7
- package/types/errors/zeedhi-error.d.ts +6 -6
- package/types/index.d.ts +22 -21
- package/types/propsMixins/heightProps.d.ts +17 -17
- package/types/propsMixins/index.d.ts +5 -5
- package/types/propsMixins/interfaces.d.ts +2 -2
- package/types/propsMixins/widthProps.d.ts +13 -13
- package/types/utils/buildProps.d.ts +2 -2
- package/types/utils/fillHeight.d.ts +1 -1
- package/types/utils/icons/icons.d.ts +5 -5
- package/types/utils/index.d.ts +6 -7
- package/types/utils/isArrayOperation.d.ts +2 -2
- package/types/utils/logger/logger.d.ts +3 -3
- package/types/utils/mergeDictionaries.d.ts +3 -3
- package/types/utils/plugins/formatSizePlugin.d.ts +1 -1
- package/types/utils/plugins/getIconPlugin.d.ts +1 -1
- package/types/utils/plugins/index.d.ts +4 -4
- package/types/utils/plugins/styleObjectPlugin.d.ts +1 -1
- package/.package.json +0 -52
- package/rollup.config.prod.js +0 -26
- package/rollup.scss.config.js +0 -13
- package/src/components/tek-grid/TekGrid.ts +0 -320
- package/src/components/tek-grid/TekGrid.vue +0 -235
- package/src/components/tek-grid/column-filter/TekGridColumnFilter.ts +0 -243
- package/src/components/tek-grid/column-filter/TekGridColumnFilter.vue +0 -93
- package/src/components/tek-grid/column-header/TekGridHeaderRow.ts +0 -147
- package/src/components/tek-grid/column-header/TekGridHeaderRow.vue +0 -78
- package/src/components/tek-grid/columns-button/TekGridColumnsButton.ts +0 -97
- package/src/components/tek-grid/columns-button/TekGridColumnsButton.vue +0 -273
- package/src/components/tek-grid/columns-button/TekGridColumnsOptionsController.ts +0 -469
- package/src/components/tek-grid/columns-button/TekGridColumnsOptionsModal.ts +0 -512
- package/src/components/tek-grid/filter-button/TekGridFilterButton.ts +0 -46
- package/src/components/tek-grid/filter-button/TekGridFilterButton.vue +0 -28
- package/src/components/tek-grid/indentation/TekGridIndentation.ts +0 -21
- package/src/components/tek-grid/indentation/TekGridIndentation.vue +0 -33
- package/src/components/tek-grid/layout-options/TekGridLayoutOptions.ts +0 -117
- package/src/components/tek-grid/layout-options/TekGridLayoutOptions.vue +0 -172
- package/src/components/tek-grid/row/TekGridFooterRow.ts +0 -62
- package/src/components/tek-grid/row/TekGridFooterRow.vue +0 -64
- package/src/components/tek-grid/row/TekGridGroupRow.ts +0 -65
- package/src/components/tek-grid/row/TekGridGroupRow.vue +0 -65
- package/src/composables/useTableLayout.ts +0 -293
- package/src/utils/isArrayOperation.ts +0 -5
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { defineComponent } from 'vue';
|
|
2
|
+
export default defineComponent({
|
|
3
|
+
props: {
|
|
4
|
+
isSelected: {
|
|
5
|
+
type: Boolean,
|
|
6
|
+
required: true,
|
|
7
|
+
},
|
|
8
|
+
isCurrentRow: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
selectable: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
selectionDisabled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
cellSelection: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
isCurrent: {
|
|
25
|
+
type: Function,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
columns: {
|
|
29
|
+
type: Array,
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
row: {
|
|
33
|
+
type: Object,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
fixedLeft: {
|
|
37
|
+
type: Object,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
fixedRight: {
|
|
41
|
+
type: Object,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
indeterminate: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
hasChildOnDemand: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
emits: ['click', 'checkboxClick', 'focusin', 'cellFocus', 'cellClick', 'expandIconClick'],
|
|
53
|
+
setup(props, { emit }) {
|
|
54
|
+
const click = (event) => {
|
|
55
|
+
emit('click', event);
|
|
56
|
+
};
|
|
57
|
+
const checkboxClick = (event) => {
|
|
58
|
+
emit('checkboxClick', event);
|
|
59
|
+
};
|
|
60
|
+
const focusin = (event, column) => {
|
|
61
|
+
emit('focusin', { event, row: props.row, column });
|
|
62
|
+
};
|
|
63
|
+
const cellFocus = (event, column) => {
|
|
64
|
+
emit('cellFocus', { event, row: props.row, column });
|
|
65
|
+
};
|
|
66
|
+
const cellClick = (event, column) => {
|
|
67
|
+
emit('cellClick', { event, row: props.row, column });
|
|
68
|
+
};
|
|
69
|
+
const expandIconClick = (event) => {
|
|
70
|
+
emit('expandIconClick', event);
|
|
71
|
+
};
|
|
72
|
+
const isFirstCell = (index) => {
|
|
73
|
+
return index === 0 || (index === 1 && props.selectable);
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
click,
|
|
77
|
+
focusin,
|
|
78
|
+
checkboxClick,
|
|
79
|
+
cellFocus,
|
|
80
|
+
cellClick,
|
|
81
|
+
expandIconClick,
|
|
82
|
+
isFirstCell,
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for components that can have their cells selected
|
|
4
|
+
*/
|
|
5
|
+
export function useCellSelection({ instance, }) {
|
|
6
|
+
const currentCell = ref(null);
|
|
7
|
+
const isCurrent = ({ row, column }) => {
|
|
8
|
+
const rowCheck = currentCell.value?.key === instance.getRowKey(row);
|
|
9
|
+
if (!column)
|
|
10
|
+
return rowCheck;
|
|
11
|
+
return rowCheck && currentCell.value?.column === column.name;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* When cell is focused, should set currentCell
|
|
15
|
+
* allows focusing cells that have no column (the checkbox cell)
|
|
16
|
+
*/
|
|
17
|
+
const cellFocusIn = ({ row, column }) => {
|
|
18
|
+
if (!instance.cellSelection)
|
|
19
|
+
return;
|
|
20
|
+
const key = instance.getRowKey(row);
|
|
21
|
+
if (!column) {
|
|
22
|
+
currentCell.value = { key };
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const columnName = column.name;
|
|
26
|
+
currentCell.value = { key, column: columnName };
|
|
27
|
+
};
|
|
28
|
+
const isCurrentRow = (row) => {
|
|
29
|
+
const { uniqueKey } = instance.datasource;
|
|
30
|
+
return !instance.cellSelection && row[uniqueKey] && row[uniqueKey] === instance.datasource.currentRow[uniqueKey];
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
isCurrent,
|
|
34
|
+
cellFocusIn,
|
|
35
|
+
isCurrentRow,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import Sortable from 'sortablejs';
|
|
2
|
+
import { onMounted, watch } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* Composable for components that can have their columns dragged
|
|
5
|
+
*/
|
|
6
|
+
export function useColumnDrag({ instance, rootEl, }) {
|
|
7
|
+
onMounted(() => {
|
|
8
|
+
if (instance.dragColumns) {
|
|
9
|
+
initDragColumns();
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
watch(() => instance.dragColumns, (value) => {
|
|
13
|
+
if (value) {
|
|
14
|
+
initDragColumns();
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
destroyDragColumns();
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const checkMove = (event) => {
|
|
21
|
+
return event.related.classList.contains('sort-handle');
|
|
22
|
+
};
|
|
23
|
+
const initDragColumns = () => {
|
|
24
|
+
const tr = rootEl.value?.querySelector('thead tr');
|
|
25
|
+
if (tr) {
|
|
26
|
+
Sortable.create(tr, {
|
|
27
|
+
onEnd: sortColumns,
|
|
28
|
+
onMove: checkMove,
|
|
29
|
+
handle: '.sort-handle',
|
|
30
|
+
scroll: false,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const destroyDragColumns = () => {
|
|
35
|
+
const tr = rootEl.value?.querySelector('thead tr');
|
|
36
|
+
if (tr) {
|
|
37
|
+
Sortable.create(tr, {
|
|
38
|
+
onEnd: sortColumns,
|
|
39
|
+
onMove: checkMove,
|
|
40
|
+
handle: '.sort-handle',
|
|
41
|
+
scroll: false,
|
|
42
|
+
}).destroy();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const sortColumns = (event) => {
|
|
46
|
+
const { originalEvent } = event;
|
|
47
|
+
let touch = originalEvent;
|
|
48
|
+
if (originalEvent.changedTouches?.length) {
|
|
49
|
+
[touch] = originalEvent.changedTouches;
|
|
50
|
+
}
|
|
51
|
+
const target = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
52
|
+
if (!rootEl.value?.contains(target)) {
|
|
53
|
+
hideColumn(event);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const columnsTmp = getColumnsDOMOrder().filter((a) => a.isVisible);
|
|
57
|
+
let { oldIndex = 0, newIndex = 0 } = event;
|
|
58
|
+
if (instance.selectable) {
|
|
59
|
+
oldIndex -= 1;
|
|
60
|
+
newIndex -= 1;
|
|
61
|
+
if (newIndex < 0) {
|
|
62
|
+
newIndex = 0;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
columnsTmp.splice(newIndex, 0, columnsTmp.splice(oldIndex, 1)[0]);
|
|
66
|
+
instance.columns = columnsTmp.concat(instance.columns.filter((a) => !a.isVisible));
|
|
67
|
+
instance.changeLayout(event, rootEl);
|
|
68
|
+
};
|
|
69
|
+
const hideColumn = (event) => {
|
|
70
|
+
const columnIndex = Number(event.item.getAttribute('index'));
|
|
71
|
+
const column = getColumnsDOMOrder()[columnIndex];
|
|
72
|
+
column.isVisible = false;
|
|
73
|
+
instance.changeLayout(event, rootEl);
|
|
74
|
+
};
|
|
75
|
+
const orderHeaders = (headers) => {
|
|
76
|
+
return headers.filter((item) => item.isVisible);
|
|
77
|
+
};
|
|
78
|
+
const getColumnsDOMOrder = () => {
|
|
79
|
+
return orderHeaders(instance.columns);
|
|
80
|
+
};
|
|
81
|
+
return {};
|
|
82
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for components that can have their columns resized
|
|
4
|
+
*/
|
|
5
|
+
export function useColumnResize({ instance, rootEl, onResizeCallback, }) {
|
|
6
|
+
let resizeX = 0;
|
|
7
|
+
let resizeWidth = 0;
|
|
8
|
+
let resizeTableWidth = 0;
|
|
9
|
+
let resizeColumn;
|
|
10
|
+
let resizeTableElement;
|
|
11
|
+
const getTotalWidth = (element) => {
|
|
12
|
+
const clientWidth = element.clientWidth; // Content + padding
|
|
13
|
+
const computedStyle = window.getComputedStyle(element);
|
|
14
|
+
const marginLeft = parseFloat(computedStyle.marginLeft);
|
|
15
|
+
const marginRight = parseFloat(computedStyle.marginRight);
|
|
16
|
+
const totalWidth = clientWidth + marginLeft + marginRight;
|
|
17
|
+
return totalWidth;
|
|
18
|
+
};
|
|
19
|
+
const parseWidth = (width) => {
|
|
20
|
+
if (width && width.indexOf('%') !== -1 && rootEl.value) {
|
|
21
|
+
const percent = Number(width?.replace('%', '')) / 100;
|
|
22
|
+
const tableWidth = rootEl.value.clientWidth;
|
|
23
|
+
const pxWidth = Number(tableWidth) * percent;
|
|
24
|
+
return pxWidth;
|
|
25
|
+
}
|
|
26
|
+
return Number(width?.replace('px', ''));
|
|
27
|
+
};
|
|
28
|
+
const resizeMouseMoveHandler = (event) => {
|
|
29
|
+
if (!resizeTableElement)
|
|
30
|
+
return;
|
|
31
|
+
// Determine how far the mouse has been moved
|
|
32
|
+
const dx = event.clientX - resizeX;
|
|
33
|
+
const headerEl = resizeColumnElement.parentElement;
|
|
34
|
+
if (!headerEl || !resizeColumn)
|
|
35
|
+
return;
|
|
36
|
+
const newWidth = resizeWidth + dx;
|
|
37
|
+
const { min, max } = getMinMaxColumnWidth(headerEl, resizeColumn);
|
|
38
|
+
const width = Math.max(min, Math.min(newWidth, max));
|
|
39
|
+
if (resizeColumn) {
|
|
40
|
+
// Update the width of column
|
|
41
|
+
resizeColumn.width = `${width}px`;
|
|
42
|
+
}
|
|
43
|
+
if (newWidth >= max) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (newWidth >= min) {
|
|
47
|
+
// Update the width of the table
|
|
48
|
+
resizeTableElement.style.width = `${resizeTableWidth + dx}px`;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
resizeTableElement.style.width = `${resizeTableWidth - resizeWidth + min}px`;
|
|
52
|
+
}
|
|
53
|
+
nextTick(onResizeCallback);
|
|
54
|
+
};
|
|
55
|
+
const resizeMouseUpHandler = (event) => {
|
|
56
|
+
instance.changeLayout(event, rootEl.value);
|
|
57
|
+
document.removeEventListener('mousemove', resizeMouseMoveHandler);
|
|
58
|
+
document.removeEventListener('mouseup', resizeMouseUpHandler);
|
|
59
|
+
};
|
|
60
|
+
let resizeColumnElement;
|
|
61
|
+
const resizeMouseDownHandler = (column, { event, el }) => {
|
|
62
|
+
resizeX = event.clientX;
|
|
63
|
+
resizeColumn = column;
|
|
64
|
+
const resizeEl = el;
|
|
65
|
+
if (resizeEl) {
|
|
66
|
+
resizeColumnElement = resizeEl;
|
|
67
|
+
let styles = window.getComputedStyle(resizeColumnElement);
|
|
68
|
+
resizeWidth = parseInt(styles.width, 10);
|
|
69
|
+
resizeWidth -= parseInt(styles.paddingLeft, 10) + parseInt(styles.paddingRight, 10);
|
|
70
|
+
resizeTableElement = rootEl.value?.getElementsByTagName('table')[0];
|
|
71
|
+
if (!resizeTableElement)
|
|
72
|
+
return;
|
|
73
|
+
styles = window.getComputedStyle(resizeTableElement);
|
|
74
|
+
resizeTableWidth = parseInt(styles.width, 10);
|
|
75
|
+
// Attach listeners for document's events
|
|
76
|
+
document.addEventListener('mousemove', resizeMouseMoveHandler);
|
|
77
|
+
document.addEventListener('mouseup', resizeMouseUpHandler);
|
|
78
|
+
}
|
|
79
|
+
event.stopImmediatePropagation();
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
};
|
|
82
|
+
const resizeClickHandler = ({ event }) => {
|
|
83
|
+
event.stopImmediatePropagation();
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
};
|
|
86
|
+
const getMinMaxColumnWidth = (columnElement, column) => {
|
|
87
|
+
const headerIcons = Array.from(columnElement.querySelectorAll('.zd-grid__header-icon'));
|
|
88
|
+
const iconsWidth = headerIcons.reduce((result, item) => {
|
|
89
|
+
return result + getTotalWidth(item);
|
|
90
|
+
}, 0);
|
|
91
|
+
// minimum width occupied by the 'name' span inside header
|
|
92
|
+
const minNameWidth = 23;
|
|
93
|
+
const min = Math.max(iconsWidth + minNameWidth, parseWidth(column?.minWidth) || 0);
|
|
94
|
+
const max = parseWidth(column?.maxWidth) || Infinity;
|
|
95
|
+
return { min, max };
|
|
96
|
+
};
|
|
97
|
+
const calcWidth = (column) => {
|
|
98
|
+
const width = column.width || column.maxWidth || column.minWidth;
|
|
99
|
+
if (width?.length === 0 || width === undefined) {
|
|
100
|
+
return '';
|
|
101
|
+
}
|
|
102
|
+
const name = column.name;
|
|
103
|
+
const columnElement = rootEl.value?.querySelector(`th[column-name="${name}"]`);
|
|
104
|
+
if (!columnElement)
|
|
105
|
+
return;
|
|
106
|
+
const { min, max } = getMinMaxColumnWidth(columnElement, column);
|
|
107
|
+
const pxWidth = parseWidth(width);
|
|
108
|
+
return `${Math.max(min, Math.min(Math.trunc(pxWidth), max || Infinity))}px`;
|
|
109
|
+
};
|
|
110
|
+
return {
|
|
111
|
+
resizeMouseDownHandler,
|
|
112
|
+
resizeClickHandler,
|
|
113
|
+
calcWidth,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for components that have dense prop
|
|
4
|
+
* Converts the instance.dense prop into the values accepted by vuetify
|
|
5
|
+
*/
|
|
6
|
+
export function useDensity({ instance, }) {
|
|
7
|
+
const density = computed(() => {
|
|
8
|
+
return instance.dense ? 'compact' : 'default';
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
density,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable to check if a double click has occurred
|
|
4
|
+
*/
|
|
5
|
+
export function useDoubleClick() {
|
|
6
|
+
const clicks = ref(0);
|
|
7
|
+
const lastCellClicked = ref(null);
|
|
8
|
+
const timer = ref(0);
|
|
9
|
+
const doubleClick = (clickFn, dblclickFn, event, delay = 300) => {
|
|
10
|
+
if (lastCellClicked && lastCellClicked.value !== event.currentTarget) {
|
|
11
|
+
clicks.value = 0;
|
|
12
|
+
}
|
|
13
|
+
clicks.value += 1;
|
|
14
|
+
lastCellClicked.value = event.currentTarget;
|
|
15
|
+
if (clicks.value === 1) {
|
|
16
|
+
timer.value = window.setTimeout(() => {
|
|
17
|
+
// single click
|
|
18
|
+
clickFn();
|
|
19
|
+
clicks.value = 0;
|
|
20
|
+
}, delay);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
// double click
|
|
24
|
+
window.clearTimeout(timer.value);
|
|
25
|
+
dblclickFn();
|
|
26
|
+
clicks.value = 0;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
doubleClick,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { onMounted, onUnmounted, reactive } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for components that can have their columns fixed
|
|
4
|
+
*/
|
|
5
|
+
export function useFixedColumns({ instance, rootEl, }) {
|
|
6
|
+
let tableHeader;
|
|
7
|
+
let tableBody;
|
|
8
|
+
/**
|
|
9
|
+
* Left distance for each column
|
|
10
|
+
*/
|
|
11
|
+
const fixedLeft = reactive({});
|
|
12
|
+
/**
|
|
13
|
+
* Right distance for each column
|
|
14
|
+
*/
|
|
15
|
+
const fixedRight = reactive({});
|
|
16
|
+
const updateFixedColumns = () => {
|
|
17
|
+
if (instance.columns.filter((column) => column.fixed || column.actionFixed).length === 0)
|
|
18
|
+
return;
|
|
19
|
+
if (!tableHeader) {
|
|
20
|
+
tableHeader = rootEl.value?.querySelector('table thead tr');
|
|
21
|
+
tableBody = rootEl.value?.querySelector('table tbody');
|
|
22
|
+
if (!tableHeader || !tableBody)
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const headerColumns = Array.from(tableHeader.querySelectorAll('th'));
|
|
26
|
+
let left = instance.selectable ? 44 : 0;
|
|
27
|
+
headerColumns.forEach((column) => {
|
|
28
|
+
const name = column.getAttribute('column-name');
|
|
29
|
+
if (name && column.classList.contains('zd-grid__header--fixed')) {
|
|
30
|
+
column.style.left = `${left}px`;
|
|
31
|
+
fixedLeft[name] = column.style.left;
|
|
32
|
+
// left += column.clientWidth;
|
|
33
|
+
left += parseFloat(getComputedStyle(column).width);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
let right = 0;
|
|
37
|
+
headerColumns.reverse().forEach((column) => {
|
|
38
|
+
const name = column.getAttribute('column-name');
|
|
39
|
+
const columnsWithClassFixed = column.classList.contains('zd-grid__action-header--fixed');
|
|
40
|
+
if (name && columnsWithClassFixed) {
|
|
41
|
+
column.style.right = `${right}px`;
|
|
42
|
+
fixedRight[name] = column.style.right;
|
|
43
|
+
const minActionWidth = column.clientWidth <= 16 ? 40 : column.clientWidth;
|
|
44
|
+
right += minActionWidth;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
let observer;
|
|
49
|
+
let resizeObserver;
|
|
50
|
+
const registerResizeObserver = () => {
|
|
51
|
+
// disconnects current observer
|
|
52
|
+
observer.disconnect();
|
|
53
|
+
const table = rootEl.value?.querySelector('table');
|
|
54
|
+
if (!table)
|
|
55
|
+
return;
|
|
56
|
+
const targetRow = table.querySelector('tr');
|
|
57
|
+
if (!targetRow)
|
|
58
|
+
return;
|
|
59
|
+
resizeObserver = new ResizeObserver(() => {
|
|
60
|
+
updateFixedColumns();
|
|
61
|
+
});
|
|
62
|
+
// observe the resize of each of the table columns
|
|
63
|
+
for (const child of targetRow.children) {
|
|
64
|
+
resizeObserver.observe(child);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Register a mutation observer for the table TR
|
|
69
|
+
* this observer should call updateFixedColumns whenever the
|
|
70
|
+
* number of columns inside the table changes \
|
|
71
|
+
* This also takes into account columns that gets hidden via isVisible
|
|
72
|
+
*/
|
|
73
|
+
const registerTrObserver = () => {
|
|
74
|
+
const table = rootEl.value?.querySelector('table');
|
|
75
|
+
if (!table)
|
|
76
|
+
return;
|
|
77
|
+
const targetRow = table.querySelector('tr');
|
|
78
|
+
if (!targetRow)
|
|
79
|
+
return;
|
|
80
|
+
observer = new MutationObserver((mutations) => {
|
|
81
|
+
mutations.forEach((mutation) => {
|
|
82
|
+
if (mutation.type === 'childList' && mutation.target instanceof Element && mutation.target.tagName === 'TR') {
|
|
83
|
+
updateFixedColumns();
|
|
84
|
+
registerResizeObserver();
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
observer.observe(targetRow, {
|
|
89
|
+
childList: true, // Listen for additions/removals of children
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
onMounted(() => {
|
|
93
|
+
updateFixedColumns();
|
|
94
|
+
registerTrObserver();
|
|
95
|
+
registerResizeObserver();
|
|
96
|
+
});
|
|
97
|
+
onUnmounted(() => {
|
|
98
|
+
observer.disconnect();
|
|
99
|
+
resizeObserver.disconnect();
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
updateFixedColumns,
|
|
103
|
+
fixedLeft,
|
|
104
|
+
fixedRight,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import { useTheme } from 'vuetify';
|
|
3
|
+
/**
|
|
4
|
+
* Composable for components that use grid color vars
|
|
5
|
+
*/
|
|
6
|
+
export function useGridColorVars({ instance, }) {
|
|
7
|
+
const getBackgroundColor = () => {
|
|
8
|
+
if (instance.backgroundColor && instance.backgroundColor !== 'transparent') {
|
|
9
|
+
return instance.backgroundColor;
|
|
10
|
+
}
|
|
11
|
+
return '';
|
|
12
|
+
};
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const getThemeBackground = (background) => {
|
|
15
|
+
if (background && background !== 'transparent')
|
|
16
|
+
return background;
|
|
17
|
+
return theme.current.value.colors.surface;
|
|
18
|
+
};
|
|
19
|
+
const cssColorVars = computed(() => {
|
|
20
|
+
const bgColor = getBackgroundColor();
|
|
21
|
+
const themeBackground = getThemeBackground(bgColor);
|
|
22
|
+
return {
|
|
23
|
+
'--theme-background-color': themeBackground,
|
|
24
|
+
'--background-color': bgColor,
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
cssColorVars,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for components that can have their columns fixed
|
|
4
|
+
*/
|
|
5
|
+
export function useGridColumns({ instance, rootEl, visibilityCondition = (column) => column.isVisible, }) {
|
|
6
|
+
const headers = computed(() => {
|
|
7
|
+
return instance.columns.map((column) => {
|
|
8
|
+
const alignMap = {
|
|
9
|
+
left: 'start',
|
|
10
|
+
center: 'center',
|
|
11
|
+
right: 'end',
|
|
12
|
+
};
|
|
13
|
+
const align = alignMap[column.align];
|
|
14
|
+
return {
|
|
15
|
+
align,
|
|
16
|
+
key: column.name,
|
|
17
|
+
title: column.label,
|
|
18
|
+
type: column.type,
|
|
19
|
+
overflow: column.overflow,
|
|
20
|
+
helperText: column.helperText,
|
|
21
|
+
width: column.width,
|
|
22
|
+
sortable: column.sortable,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
const setViewGetWidth = () => {
|
|
27
|
+
instance.columns.forEach((column) => {
|
|
28
|
+
column.setViewGetWidth(() => {
|
|
29
|
+
const index = instance.columns.filter((col) => col.isVisible).findIndex((col) => col.name === column.name);
|
|
30
|
+
const el = rootEl.value;
|
|
31
|
+
const colEl = el.querySelector(`
|
|
32
|
+
.zd-grid-table-header .zd-table-cell[index='${index}']
|
|
33
|
+
`);
|
|
34
|
+
return colEl?.clientWidth || 0;
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
setViewGetWidth();
|
|
39
|
+
/**
|
|
40
|
+
* Sorts instance columns and filters out invisible columns
|
|
41
|
+
* - fixed columns should come first
|
|
42
|
+
* - actionFixed columns should come last
|
|
43
|
+
* - maintain original order for other columns
|
|
44
|
+
*/
|
|
45
|
+
const visibleColumns = computed(() => {
|
|
46
|
+
// Create a map to store original indices for stability
|
|
47
|
+
const indexMap = new Map();
|
|
48
|
+
instance.columns.forEach((item, index) => {
|
|
49
|
+
indexMap.set(item, index);
|
|
50
|
+
});
|
|
51
|
+
// Create a copy of the array to avoid mutating the original
|
|
52
|
+
const sortedArray = [...instance.columns].filter((column) => visibilityCondition(column));
|
|
53
|
+
sortedArray.sort((a, b) => {
|
|
54
|
+
// Both are fixed - maintain original order
|
|
55
|
+
if (a.fixed && b.fixed) {
|
|
56
|
+
return indexMap.get(a) - indexMap.get(b);
|
|
57
|
+
}
|
|
58
|
+
// Only a is fixed - a comes first
|
|
59
|
+
if (a.fixed) {
|
|
60
|
+
return -1;
|
|
61
|
+
}
|
|
62
|
+
// Only b is fixed - b comes first
|
|
63
|
+
if (b.fixed) {
|
|
64
|
+
return 1;
|
|
65
|
+
}
|
|
66
|
+
// Both are actionFixed - maintain original order
|
|
67
|
+
if (a.actionFixed && b.actionFixed) {
|
|
68
|
+
return indexMap.get(a) - indexMap.get(b);
|
|
69
|
+
}
|
|
70
|
+
// Only a is actionFixed - a comes last
|
|
71
|
+
if (a.actionFixed) {
|
|
72
|
+
return 1;
|
|
73
|
+
}
|
|
74
|
+
// Only b is actionFixed - b comes last
|
|
75
|
+
if (b.actionFixed) {
|
|
76
|
+
return -1;
|
|
77
|
+
}
|
|
78
|
+
// Neither fixed nor actionFixed - maintain original order
|
|
79
|
+
return indexMap.get(a) - indexMap.get(b);
|
|
80
|
+
});
|
|
81
|
+
return sortedArray;
|
|
82
|
+
});
|
|
83
|
+
return {
|
|
84
|
+
headers,
|
|
85
|
+
visibleColumns,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { computed, nextTick } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for grid components that have selection
|
|
4
|
+
*/
|
|
5
|
+
export function useGridSelection({ instance, rootEl, }) {
|
|
6
|
+
const getKeysFrom = (data) => {
|
|
7
|
+
const { uniqueKey } = instance.datasource;
|
|
8
|
+
return data.map((toggledRow) => toggledRow[uniqueKey]);
|
|
9
|
+
};
|
|
10
|
+
const selectedRows = computed({
|
|
11
|
+
get: () => {
|
|
12
|
+
if (!instance.selectAllPages)
|
|
13
|
+
return instance.selectedRows;
|
|
14
|
+
if (instance.selectionState.allSelected) {
|
|
15
|
+
const toggledKeys = getKeysFrom(instance.selectionState.except);
|
|
16
|
+
const data = instance.getData().filter((row) => {
|
|
17
|
+
const rowKey = instance.getRowKey(row);
|
|
18
|
+
return !instance.callDisableSelection(row) && !toggledKeys.includes(rowKey);
|
|
19
|
+
});
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
return instance.selectionState.except;
|
|
23
|
+
},
|
|
24
|
+
set: (rows) => {
|
|
25
|
+
if (instance.selectAllPages)
|
|
26
|
+
return;
|
|
27
|
+
instance.selectedRows = sortSelectionArray(rows);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const sortSelectionArray = (arr) => {
|
|
31
|
+
return arr.sort((a, b) => {
|
|
32
|
+
const aKey = instance.getRowKey(a);
|
|
33
|
+
const bKey = instance.getRowKey(b);
|
|
34
|
+
if (aKey < bKey) {
|
|
35
|
+
return -1;
|
|
36
|
+
}
|
|
37
|
+
if (aKey > bKey) {
|
|
38
|
+
return 1;
|
|
39
|
+
}
|
|
40
|
+
// a must be equal to b
|
|
41
|
+
return 0;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const allselectedState = computed(() => {
|
|
45
|
+
if (instance.selectAllPages) {
|
|
46
|
+
if (instance.selectionState.except.length > 0)
|
|
47
|
+
return 2;
|
|
48
|
+
if (!instance.selectionState.allSelected)
|
|
49
|
+
return 0;
|
|
50
|
+
return 1;
|
|
51
|
+
}
|
|
52
|
+
const selectedKeys = getKeysFrom(instance.selectedRows);
|
|
53
|
+
const { uniqueKey } = instance.datasource;
|
|
54
|
+
const data = instance.getData();
|
|
55
|
+
let disabledCount = 0;
|
|
56
|
+
let pageSelectionCount = 0;
|
|
57
|
+
data.forEach((row) => {
|
|
58
|
+
if (instance.callDisableSelection(row)) {
|
|
59
|
+
disabledCount += 1;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (selectedKeys.includes(row[uniqueKey])) {
|
|
63
|
+
pageSelectionCount += 1;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
if (pageSelectionCount === 0)
|
|
67
|
+
return 0;
|
|
68
|
+
if (pageSelectionCount < data.length - disabledCount)
|
|
69
|
+
return 2;
|
|
70
|
+
return 1;
|
|
71
|
+
});
|
|
72
|
+
const selectAllClick = (event) => {
|
|
73
|
+
nextTick(() => {
|
|
74
|
+
const isSelected = allselectedState.value !== 1;
|
|
75
|
+
instance.selectAll(isSelected);
|
|
76
|
+
instance.selectAllClick(isSelected, event, rootEl.value);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const selectRowClick = (row, isSelected, event) => {
|
|
80
|
+
nextTick(() => {
|
|
81
|
+
instance.selectRow(row, isSelected);
|
|
82
|
+
instance.selectClick(row, isSelected, event, rootEl.value);
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
return {
|
|
86
|
+
selectedRows,
|
|
87
|
+
allselectedState,
|
|
88
|
+
selectAllClick,
|
|
89
|
+
selectRowClick,
|
|
90
|
+
};
|
|
91
|
+
}
|