@zeedhi/vuetify 3.0.6 → 3.0.8
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/.package.json +11 -9
- 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 +22062 -22295
- 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/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,19 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for components that use grid color vars
|
|
4
|
+
*/
|
|
5
|
+
export function useGridSorting({ instance, }) {
|
|
6
|
+
const updateSortBy = (sortBy) => {
|
|
7
|
+
instance.changeOrder(sortBy);
|
|
8
|
+
};
|
|
9
|
+
const sortBy = computed(() => {
|
|
10
|
+
return instance.datasource.order.map((orderString) => {
|
|
11
|
+
const [key, order] = orderString.split('.');
|
|
12
|
+
return { key, order };
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
updateSortBy,
|
|
17
|
+
sortBy,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useSlots } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for components that need to check if a slot is defined
|
|
4
|
+
*/
|
|
5
|
+
export function useHasSlot() {
|
|
6
|
+
const slots = useSlots();
|
|
7
|
+
const result = {};
|
|
8
|
+
const checkHasContent = (vnode) => {
|
|
9
|
+
// Ignore fragment nodes (Symbol(v-fgt))
|
|
10
|
+
if (vnode.type === Symbol.for('v-fgt')) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
// Check for non-empty text content or elements
|
|
14
|
+
return vnode.type || (typeof vnode.children === 'string' && vnode.children.trim() !== '');
|
|
15
|
+
};
|
|
16
|
+
for (const slotName in slots) {
|
|
17
|
+
const slot = slots[slotName];
|
|
18
|
+
const hasContent = slot?.().some((vnode) => checkHasContent(vnode));
|
|
19
|
+
result[slotName] = {
|
|
20
|
+
slot,
|
|
21
|
+
hasContent: !!hasContent,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './cellSelection';
|
|
2
|
+
export * from './columnDrag';
|
|
3
|
+
export * from './columnResize';
|
|
4
|
+
export * from './density';
|
|
5
|
+
export * from './doubleClick';
|
|
6
|
+
export * from './fixedColumns';
|
|
7
|
+
export * from './gridColorVars';
|
|
8
|
+
export * from './gridColumns';
|
|
9
|
+
export * from './gridSelection';
|
|
10
|
+
export * from './gridSorting';
|
|
11
|
+
export * from './hasSlot';
|
|
12
|
+
export * from './maska';
|
|
13
|
+
export * from './tableNavigation';
|
|
14
|
+
export * from './virtualScroll';
|
|
15
|
+
export * from './watchUrl';
|
|
16
|
+
export * from './useIsMobile';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Mask } from '@zeedhi/core';
|
|
2
|
+
import { reactive, ref } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* Composable for text inputs that need basic Mask formatting
|
|
5
|
+
* @returns options to be passed to a v-maska directive
|
|
6
|
+
*/
|
|
7
|
+
export function useMaska(instance, options) {
|
|
8
|
+
const currentMask = ref('');
|
|
9
|
+
/**
|
|
10
|
+
* Get the current mask. If using dynamic mask, this will call the mask as a function
|
|
11
|
+
*/
|
|
12
|
+
const getCurrentMask = (value) => {
|
|
13
|
+
const mask = instance.getMask();
|
|
14
|
+
if (typeof mask === 'function') {
|
|
15
|
+
const parsedValue = Mask.getValueWithoutMask(value);
|
|
16
|
+
return mask(parsedValue);
|
|
17
|
+
}
|
|
18
|
+
return mask;
|
|
19
|
+
};
|
|
20
|
+
const getMaskOptions = () => {
|
|
21
|
+
if (options.disable)
|
|
22
|
+
return {};
|
|
23
|
+
return {
|
|
24
|
+
mask: () => {
|
|
25
|
+
return currentMask.value || undefined;
|
|
26
|
+
},
|
|
27
|
+
preProcess: (value) => {
|
|
28
|
+
currentMask.value = getCurrentMask(value);
|
|
29
|
+
return value;
|
|
30
|
+
},
|
|
31
|
+
eager: false,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const maskOptions = reactive(getMaskOptions());
|
|
35
|
+
return { maskOptions };
|
|
36
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composable for components that can use table navigation
|
|
3
|
+
*/
|
|
4
|
+
export function useTableNavigation({ instance, rootEl, }) {
|
|
5
|
+
const navigate = (direction, event) => {
|
|
6
|
+
if (direction === 'up' || direction === 'down') {
|
|
7
|
+
navigateVertical(direction);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (direction === 'right') {
|
|
11
|
+
navigateRight(event);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
navigateLeft(event);
|
|
15
|
+
};
|
|
16
|
+
instance.setViewNavigate(navigate);
|
|
17
|
+
const navigateRight = (event) => {
|
|
18
|
+
event?.preventDefault();
|
|
19
|
+
const tdNode = getTdNode(document.activeElement);
|
|
20
|
+
if (!tdNode)
|
|
21
|
+
return;
|
|
22
|
+
let { nextElementSibling } = tdNode;
|
|
23
|
+
if (!nextElementSibling) {
|
|
24
|
+
const trNode = tdNode.parentElement;
|
|
25
|
+
if (!trNode)
|
|
26
|
+
return;
|
|
27
|
+
let nextTr;
|
|
28
|
+
do {
|
|
29
|
+
nextTr = trNode.nextElementSibling;
|
|
30
|
+
if (!nextTr)
|
|
31
|
+
return;
|
|
32
|
+
} while (!isElementVisible(nextTr));
|
|
33
|
+
[nextElementSibling] = nextTr.children;
|
|
34
|
+
}
|
|
35
|
+
focusElement(nextElementSibling);
|
|
36
|
+
};
|
|
37
|
+
const navigateLeft = (event) => {
|
|
38
|
+
event?.preventDefault();
|
|
39
|
+
const tdNode = getTdNode(document.activeElement);
|
|
40
|
+
if (!tdNode)
|
|
41
|
+
return;
|
|
42
|
+
let { previousElementSibling } = tdNode;
|
|
43
|
+
if (!previousElementSibling) {
|
|
44
|
+
const trNode = tdNode.parentElement;
|
|
45
|
+
if (!trNode)
|
|
46
|
+
return;
|
|
47
|
+
let previousTr;
|
|
48
|
+
do {
|
|
49
|
+
previousTr = trNode.previousElementSibling;
|
|
50
|
+
if (!previousTr)
|
|
51
|
+
return;
|
|
52
|
+
} while (!isElementVisible(previousTr));
|
|
53
|
+
previousElementSibling = previousTr.children[previousTr.children.length - 1];
|
|
54
|
+
}
|
|
55
|
+
focusElement(previousElementSibling);
|
|
56
|
+
};
|
|
57
|
+
const isElementVisible = (element) => {
|
|
58
|
+
const style = window.getComputedStyle(element);
|
|
59
|
+
const isVisible = style.display !== 'none';
|
|
60
|
+
return isVisible;
|
|
61
|
+
};
|
|
62
|
+
// selector for input-type elements that are not disabled, or elements with tabindex
|
|
63
|
+
const focusableSelector = 'button:not([disabled]), a:not([disabled]), input:not([disabled]), select:not([disabled])' +
|
|
64
|
+
', textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
65
|
+
/**
|
|
66
|
+
* Focus an element or its first focusable children
|
|
67
|
+
* @param element element to be focused
|
|
68
|
+
*/
|
|
69
|
+
const focusElement = (element) => {
|
|
70
|
+
if (!element)
|
|
71
|
+
return;
|
|
72
|
+
const focusableChild = element.querySelector(focusableSelector);
|
|
73
|
+
const nextFocusableElement = focusableChild && isElementVisible(focusableChild) ? focusableChild : element;
|
|
74
|
+
nextFocusableElement.focus({ preventScroll: true });
|
|
75
|
+
if (nextFocusableElement instanceof HTMLInputElement)
|
|
76
|
+
nextFocusableElement.select();
|
|
77
|
+
};
|
|
78
|
+
const getTdNode = (element) => {
|
|
79
|
+
if (!element)
|
|
80
|
+
return null;
|
|
81
|
+
if (element.nodeName === 'TD')
|
|
82
|
+
return element;
|
|
83
|
+
return getTdNode(element.parentElement);
|
|
84
|
+
};
|
|
85
|
+
const getArrayFromElementTag = (tagName, node) => {
|
|
86
|
+
if (node)
|
|
87
|
+
return Array.from(node.getElementsByTagName(tagName));
|
|
88
|
+
return [];
|
|
89
|
+
};
|
|
90
|
+
const getArrayFromTdElement = (node) => {
|
|
91
|
+
return getArrayFromElementTag('TD', node);
|
|
92
|
+
};
|
|
93
|
+
const getArrayFromTrElement = (node) => {
|
|
94
|
+
return getArrayFromElementTag('TR', node).filter(isElementVisible);
|
|
95
|
+
};
|
|
96
|
+
const findNextTd = (direction, trIndex, tdIndex, trCollection) => {
|
|
97
|
+
const up = direction === 'up';
|
|
98
|
+
if ((up && trIndex <= 0) || (!up && trIndex >= trCollection.length - 1)) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
const nextTr = trCollection[up ? trIndex - 1 : trIndex + 1];
|
|
102
|
+
const index = Math.min(tdIndex, nextTr.childElementCount - 1);
|
|
103
|
+
const nextTd = getArrayFromTdElement(nextTr)[index];
|
|
104
|
+
return nextTd;
|
|
105
|
+
};
|
|
106
|
+
const navigateVertical = (direction) => {
|
|
107
|
+
const hasActive = rootEl.value?.querySelector('tbody')?.contains(document.activeElement);
|
|
108
|
+
// if not cellSelection and activeElement is not inside tbody, should navigate from datasource
|
|
109
|
+
if (!hasActive) {
|
|
110
|
+
instance.navigateDatasource(direction);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const tdNode = getTdNode(document.activeElement);
|
|
114
|
+
const trNode = tdNode?.parentElement;
|
|
115
|
+
if (!tdNode || !trNode)
|
|
116
|
+
return;
|
|
117
|
+
const tdIndex = getArrayFromTdElement(trNode).indexOf(tdNode);
|
|
118
|
+
const trCollection = getArrayFromTrElement(trNode.parentElement);
|
|
119
|
+
const trIndex = trCollection.indexOf(trNode);
|
|
120
|
+
const nextElement = findNextTd(direction, trIndex, tdIndex, trCollection);
|
|
121
|
+
if (!nextElement)
|
|
122
|
+
return;
|
|
123
|
+
focusElement(nextElement);
|
|
124
|
+
};
|
|
125
|
+
return { navigate };
|
|
126
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { TekFilterHelper, TekGridColumn, TekRestDatasource, } from '@zeedhi/common';
|
|
2
|
+
import { Utils } from '@zeedhi/core';
|
|
3
|
+
import cloneDeep from 'lodash.clonedeep';
|
|
4
|
+
import { NotProvidedError } from '../errors/not-provided';
|
|
5
|
+
import { computed, inject, nextTick, provide } from 'vue';
|
|
6
|
+
export function useTableLayout() {
|
|
7
|
+
const applyLayout = inject('applyLayout');
|
|
8
|
+
const getColumnElements = inject('getColumnElements');
|
|
9
|
+
const getTableWidth = inject('getTableWidth');
|
|
10
|
+
if (!applyLayout) {
|
|
11
|
+
throw new NotProvidedError('applyLayout');
|
|
12
|
+
}
|
|
13
|
+
if (!getColumnElements) {
|
|
14
|
+
throw new NotProvidedError('getColumnElements');
|
|
15
|
+
}
|
|
16
|
+
if (!getTableWidth) {
|
|
17
|
+
throw new NotProvidedError('getTableWidth');
|
|
18
|
+
}
|
|
19
|
+
return { applyLayout, getColumnElements, getTableWidth };
|
|
20
|
+
}
|
|
21
|
+
export function provideTableLayout({ instance, rootEl, }) {
|
|
22
|
+
const tableElement = rootEl.value?.querySelector('table');
|
|
23
|
+
const columnDictionary = computed(() => getColumnDictionary(instance.columns));
|
|
24
|
+
const datasourceDynamicFilter = () => {
|
|
25
|
+
const datasource = instance.datasource;
|
|
26
|
+
if (datasource instanceof TekRestDatasource)
|
|
27
|
+
return datasource.dynamicFilter;
|
|
28
|
+
return {};
|
|
29
|
+
};
|
|
30
|
+
const getColumnDictionary = (columns) => {
|
|
31
|
+
const columnDictionary = {};
|
|
32
|
+
columns.forEach((column) => {
|
|
33
|
+
columnDictionary[column.name] = column;
|
|
34
|
+
});
|
|
35
|
+
return columnDictionary;
|
|
36
|
+
};
|
|
37
|
+
const addMissingColumns = (layout) => {
|
|
38
|
+
const layoutColumnNames = layout.columns?.map((column) => column.name) || [];
|
|
39
|
+
const columnNames = Object.keys(columnDictionary.value);
|
|
40
|
+
columnNames.forEach((columnName) => {
|
|
41
|
+
if (!layoutColumnNames.includes(columnName)) {
|
|
42
|
+
layout.columns?.push(columnDictionary.value[columnName]);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const setHelperValue = (column, value) => {
|
|
47
|
+
if (column instanceof TekGridColumn) {
|
|
48
|
+
if (!Array.isArray(column.filterProps) && typeof value === 'string') {
|
|
49
|
+
column.filterProps.helperValue = value;
|
|
50
|
+
}
|
|
51
|
+
else if (Array.isArray(column.filterProps) && Array.isArray(value)) {
|
|
52
|
+
column.filterProps.forEach((prop, index) => {
|
|
53
|
+
prop.value = value[index];
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const getHelperValues = (dynamicFilter, columns) => {
|
|
59
|
+
const filter = cloneDeep(dynamicFilter);
|
|
60
|
+
Object.keys(filter).forEach((columnName) => {
|
|
61
|
+
const filterOptions = filter[columnName];
|
|
62
|
+
const column = columns[columns.findIndex((col) => col.name === columnName)];
|
|
63
|
+
const { filterHelperValue } = column;
|
|
64
|
+
filterOptions.forEach((item) => {
|
|
65
|
+
if (['IN', 'NOT_IN', 'BETWEEN'].includes(item.operation) && !Array.isArray(item.value)) {
|
|
66
|
+
item.value = item.value.split(';');
|
|
67
|
+
}
|
|
68
|
+
let helperValue = '';
|
|
69
|
+
if (!Array.isArray(filterHelperValue)) {
|
|
70
|
+
helperValue = filterHelperValue;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
Object.keys(filterHelperValue).forEach((key) => {
|
|
74
|
+
const value = filterHelperValue[key] || '';
|
|
75
|
+
if (`${item.relation || 'AND'}-${item.operation || 'CONTAINS'}` === key) {
|
|
76
|
+
helperValue = value;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (helperValue) {
|
|
81
|
+
const columnObj = instance.getColumn(column.name);
|
|
82
|
+
item.value = TekFilterHelper.getValue(helperValue, columnObj);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
return filter;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Applies the default grid layout
|
|
90
|
+
* @returns a boolean to indicate whether the group parameters changed
|
|
91
|
+
*/
|
|
92
|
+
const applyDefaultLayout = (defaultLayout) => {
|
|
93
|
+
let groupParamsChanged = false;
|
|
94
|
+
instance.datasource.order = [...defaultLayout.originalDatasourceOrder];
|
|
95
|
+
instance.datasource.filter = { ...defaultLayout.originalDatasourceFilter };
|
|
96
|
+
if (instance.datasource instanceof TekRestDatasource) {
|
|
97
|
+
instance.datasource.dynamicFilter = getHelperValues(defaultLayout.originalDatasourceDynamicFilter, defaultLayout.originalColumnProps);
|
|
98
|
+
}
|
|
99
|
+
instance.columns = defaultLayout.originalColumnProps.map((defaultColumn) => {
|
|
100
|
+
const col = columnDictionary.value[defaultColumn.name];
|
|
101
|
+
groupParamsChanged =
|
|
102
|
+
groupParamsChanged ||
|
|
103
|
+
col.grouped !== defaultColumn.grouped ||
|
|
104
|
+
col.groupOpened !== defaultColumn.groupOpened ||
|
|
105
|
+
col.aggregation !== defaultColumn.aggregation;
|
|
106
|
+
col.isVisible = defaultColumn.isVisible ?? col.isVisible;
|
|
107
|
+
col.label = defaultColumn.label ?? col.label;
|
|
108
|
+
col.align = defaultColumn.align ?? col.align;
|
|
109
|
+
col.fixed = defaultColumn.fixed ?? col.fixed;
|
|
110
|
+
col.grouped = defaultColumn.grouped ?? col.grouped;
|
|
111
|
+
col.groupOpened = defaultColumn.groupOpened ?? col.groupOpened;
|
|
112
|
+
col.aggregation = defaultColumn.aggregation ?? col.aggregation;
|
|
113
|
+
col.minWidth = defaultColumn.minWidth ?? col.minWidth;
|
|
114
|
+
col.maxWidth = defaultColumn.maxWidth ?? col.maxWidth;
|
|
115
|
+
col.width = defaultColumn.width ?? col.width;
|
|
116
|
+
setHelperValue(col, defaultColumn.filterHelperValue || '');
|
|
117
|
+
return col;
|
|
118
|
+
});
|
|
119
|
+
if (tableElement) {
|
|
120
|
+
tableElement.style.width = '100%';
|
|
121
|
+
const columnElements = Array.from(tableElement.querySelectorAll('tr th:not(.selectable)'));
|
|
122
|
+
columnElements.forEach((item) => {
|
|
123
|
+
item.style.width = 'unset';
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return groupParamsChanged;
|
|
127
|
+
};
|
|
128
|
+
const applyNewLayout = (layout, changeLayoutCallback) => {
|
|
129
|
+
const gridColumnNames = Object.keys(columnDictionary.value);
|
|
130
|
+
let layoutChanged = false;
|
|
131
|
+
// removes columns that are in the layout but not in grid
|
|
132
|
+
layout.columns = layout.columns?.filter((column) => {
|
|
133
|
+
const isInGrid = gridColumnNames.includes(column.name);
|
|
134
|
+
if (!isInGrid)
|
|
135
|
+
layoutChanged = true;
|
|
136
|
+
return isInGrid;
|
|
137
|
+
});
|
|
138
|
+
if (layoutChanged) {
|
|
139
|
+
changeLayoutCallback(layout);
|
|
140
|
+
}
|
|
141
|
+
if (tableElement)
|
|
142
|
+
tableElement.style.width = layout.gridWidth || 'auto';
|
|
143
|
+
instance.datasource.order = layout.order !== undefined ? layout.order : instance.datasource.order;
|
|
144
|
+
instance.datasource.filter = layout.filter !== undefined ? layout.filter : instance.datasource.filter;
|
|
145
|
+
if (instance.datasource instanceof TekRestDatasource && layout.dynamicFilter !== undefined) {
|
|
146
|
+
instance.datasource.dynamicFilter = getHelperValues(layout.dynamicFilter, layout.columns || instance.columns);
|
|
147
|
+
}
|
|
148
|
+
if (layout.columns) {
|
|
149
|
+
instance.columns = layout.columns.map((column) => {
|
|
150
|
+
const col = columnDictionary.value[column.name];
|
|
151
|
+
col.label = column.label !== undefined ? column.label : col.label;
|
|
152
|
+
col.align = column.align !== undefined ? column.align : col.align;
|
|
153
|
+
col.isVisible = column.isVisible !== undefined ? column.isVisible : col.isVisible;
|
|
154
|
+
col.fixed = !!column.fixed;
|
|
155
|
+
col.grouped = !!column.grouped;
|
|
156
|
+
col.groupOpened = !!column.groupOpened;
|
|
157
|
+
col.aggregation = column.aggregation;
|
|
158
|
+
col.minWidth = column.minWidth || '';
|
|
159
|
+
col.maxWidth = column.maxWidth || '';
|
|
160
|
+
col.width = column.width;
|
|
161
|
+
setHelperValue(col, column.filterHelperValue || '');
|
|
162
|
+
return col;
|
|
163
|
+
});
|
|
164
|
+
// wait to change column orders
|
|
165
|
+
nextTick(() => {
|
|
166
|
+
gridColumnNames.forEach((_key, index) => {
|
|
167
|
+
const columnElement = tableElement?.querySelector(`tr th:not(.selectable)[index="${index}"]`);
|
|
168
|
+
if (columnElement) {
|
|
169
|
+
columnElement.style.width = layout.columns[index].width || 'unset';
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const applyLayout = ({ layout, defaultLayout, changeLayoutCallback, }) => {
|
|
176
|
+
const oldOrder = instance.datasource.order;
|
|
177
|
+
const oldFilter = instance.datasource.filter;
|
|
178
|
+
const oldDynamicFilter = datasourceDynamicFilter();
|
|
179
|
+
let groupParamsChanged = false;
|
|
180
|
+
if (layout) {
|
|
181
|
+
addMissingColumns(layout);
|
|
182
|
+
applyNewLayout(layout, changeLayoutCallback);
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
groupParamsChanged = applyDefaultLayout(defaultLayout);
|
|
186
|
+
}
|
|
187
|
+
if ((!Utils.isEqual(instance.datasource.order, oldOrder) ||
|
|
188
|
+
!Utils.isEqual(instance.datasource.filter, oldFilter) ||
|
|
189
|
+
!Utils.isEqual(datasourceDynamicFilter(), oldDynamicFilter)) &&
|
|
190
|
+
!groupParamsChanged) {
|
|
191
|
+
// Se os parametros de agrupamento tiverem sido alterados um get é feito automaticamente
|
|
192
|
+
instance.loadAfterTasks();
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
const getColumnElements = () => {
|
|
196
|
+
const elementDict = {};
|
|
197
|
+
const columnElements = tableElement?.querySelectorAll('tr th:not(.selectable)[index]') || [];
|
|
198
|
+
columnElements.forEach((el) => {
|
|
199
|
+
const index = el.getAttribute('index');
|
|
200
|
+
if (index === null)
|
|
201
|
+
return;
|
|
202
|
+
elementDict[index] = el;
|
|
203
|
+
});
|
|
204
|
+
return elementDict;
|
|
205
|
+
};
|
|
206
|
+
const getTableWidth = () => {
|
|
207
|
+
return tableElement ? window.getComputedStyle(tableElement).width : 'auto';
|
|
208
|
+
};
|
|
209
|
+
provide('applyLayout', applyLayout);
|
|
210
|
+
provide('getColumnElements', getColumnElements);
|
|
211
|
+
provide('getTableWidth', getTableWidth);
|
|
212
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { reactive, ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for components that use grid color vars
|
|
4
|
+
*/
|
|
5
|
+
export function useVirtualScroll({ instance, rootEl, renderedData, }) {
|
|
6
|
+
const scrollData = reactive({
|
|
7
|
+
start: 0,
|
|
8
|
+
startHeight: 0,
|
|
9
|
+
perPage: 0,
|
|
10
|
+
endHeight: 0,
|
|
11
|
+
rowHeight: 0,
|
|
12
|
+
initialized: false,
|
|
13
|
+
});
|
|
14
|
+
const lastStart = ref(0);
|
|
15
|
+
const onScroll = (event) => {
|
|
16
|
+
const { scrollTop } = event.target;
|
|
17
|
+
const rows = Math.floor(scrollTop / scrollData.rowHeight);
|
|
18
|
+
const start = rows + scrollData.perPage > renderedData.value.length
|
|
19
|
+
? Math.max(0, renderedData.value.length - scrollData.perPage)
|
|
20
|
+
: rows;
|
|
21
|
+
if (lastStart.value !== start) {
|
|
22
|
+
lastStart.value = start;
|
|
23
|
+
scrollData.start = start;
|
|
24
|
+
updateScrollData(renderedData.value);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const updateScrollData = (data) => {
|
|
28
|
+
const { start, rowHeight, perPage } = scrollData;
|
|
29
|
+
const cache = instance.virtualScrollCache;
|
|
30
|
+
scrollData.startHeight = Math.max(start - cache, 0) * rowHeight;
|
|
31
|
+
scrollData.endHeight = Math.max(data.length - start - perPage - cache, 0) * rowHeight;
|
|
32
|
+
};
|
|
33
|
+
const updateScrollPerPage = () => {
|
|
34
|
+
const tableWrapperHeight = scrollData.tableWrapper.clientHeight;
|
|
35
|
+
const tableHeader = rootEl.value?.querySelector('thead');
|
|
36
|
+
const tableHeaderHeight = tableHeader.clientHeight;
|
|
37
|
+
scrollData.perPage = Math.ceil((tableWrapperHeight - tableHeaderHeight) / scrollData.rowHeight);
|
|
38
|
+
updateScrollData(renderedData.value);
|
|
39
|
+
};
|
|
40
|
+
const initializeScrollData = (el) => {
|
|
41
|
+
const tbodyEl = el.querySelector('tbody');
|
|
42
|
+
const tableWrapperEl = el.querySelector('.v-table__wrapper');
|
|
43
|
+
if (!tbodyEl || !tableWrapperEl) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
scrollData.tbody = tbodyEl;
|
|
47
|
+
const tr = document.createElement('tr');
|
|
48
|
+
scrollData.tbody.append(tr);
|
|
49
|
+
const td = document.createElement('td');
|
|
50
|
+
td.className = 'zd-grid__cell';
|
|
51
|
+
tr.append(td);
|
|
52
|
+
scrollData.rowHeight = td.clientHeight;
|
|
53
|
+
tr.remove();
|
|
54
|
+
scrollData.tableWrapper = tableWrapperEl;
|
|
55
|
+
scrollData.tableWrapper.addEventListener('scroll', onScroll);
|
|
56
|
+
const observer = new ResizeObserver(updateScrollPerPage);
|
|
57
|
+
observer.observe(tableWrapperEl);
|
|
58
|
+
scrollData.start = 0;
|
|
59
|
+
scrollData.initialized = true;
|
|
60
|
+
};
|
|
61
|
+
const calcScrollData = () => {
|
|
62
|
+
if (!instance.virtualScroll || scrollData.initialized || !rootEl.value)
|
|
63
|
+
return;
|
|
64
|
+
if (!scrollData.tbody) {
|
|
65
|
+
initializeScrollData(rootEl.value);
|
|
66
|
+
}
|
|
67
|
+
updateScrollPerPage();
|
|
68
|
+
};
|
|
69
|
+
const addTopPadding = () => {
|
|
70
|
+
return instance.virtualScroll && scrollData.start > instance.virtualScrollCache;
|
|
71
|
+
};
|
|
72
|
+
const addBottomPadding = () => {
|
|
73
|
+
return (instance.virtualScroll &&
|
|
74
|
+
scrollData.start + scrollData.perPage + instance.virtualScrollCache < renderedData.value.length);
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Checks if a row should be rendered based on it's index
|
|
78
|
+
*/
|
|
79
|
+
const shouldRender = (index) => {
|
|
80
|
+
// checks if index position is inside the cached range
|
|
81
|
+
const isAfterTopCache = index >= scrollData.start - instance.virtualScrollCache;
|
|
82
|
+
const isBeforeBottomCache = index <= scrollData.start + scrollData.perPage + instance.virtualScrollCache;
|
|
83
|
+
return !instance.virtualScroll || (isAfterTopCache && isBeforeBottomCache);
|
|
84
|
+
};
|
|
85
|
+
return {
|
|
86
|
+
calcScrollData,
|
|
87
|
+
scrollData,
|
|
88
|
+
addTopPadding,
|
|
89
|
+
addBottomPadding,
|
|
90
|
+
shouldRender,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { watch } from 'vue';
|
|
2
|
+
import { useRoute } from 'vue-router';
|
|
3
|
+
/**
|
|
4
|
+
* Composable for components that can use datasource watchUrl feature
|
|
5
|
+
*/
|
|
6
|
+
export function useWatchUrl(instance) {
|
|
7
|
+
const route = useRoute();
|
|
8
|
+
watch(() => route.fullPath, () => {
|
|
9
|
+
if (instance.datasource.urlHasChanged()) {
|
|
10
|
+
instance.datasource.get();
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ZeedhiError } from './zeedhi-error';
|
|
2
|
+
/**
|
|
3
|
+
* RowNotFound error
|
|
4
|
+
*/
|
|
5
|
+
export class NotProvidedError extends ZeedhiError {
|
|
6
|
+
constructor(provides) {
|
|
7
|
+
const text = Array.isArray(provides) ? provides.join(', ') : provides;
|
|
8
|
+
super(`component requires ${text} to be provided`);
|
|
9
|
+
this.name = 'NotProvidedError';
|
|
10
|
+
}
|
|
11
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { initTheme } from '@zeedhi/common';
|
|
2
|
+
import { ViewService } from '@zeedhi/core';
|
|
3
|
+
import { nextTick } from 'vue';
|
|
4
|
+
import { PrismEditor } from 'vue-prism-editor';
|
|
5
|
+
// Vuetify
|
|
6
|
+
import { createVuetify } from 'vuetify';
|
|
7
|
+
import * as components from 'vuetify/components';
|
|
8
|
+
import * as directives from 'vuetify/directives';
|
|
9
|
+
import * as labs from 'vuetify/labs/components';
|
|
10
|
+
import 'vuetify/styles';
|
|
11
|
+
import { SlVueTreeNext } from 'sl-vue-tree-next';
|
|
12
|
+
import { RegisterComponents } from './components';
|
|
13
|
+
import './styles/index.scss';
|
|
14
|
+
import { formatSizePlugin, getIconPlugin, styleObjectPlugin } from './utils/plugins';
|
|
15
|
+
const ZeedhiVuetify = {
|
|
16
|
+
install(app, { theme, icons, display } = {}) {
|
|
17
|
+
const vuetify = createVuetify({
|
|
18
|
+
components: {
|
|
19
|
+
...components,
|
|
20
|
+
...labs,
|
|
21
|
+
},
|
|
22
|
+
directives,
|
|
23
|
+
theme: initTheme(theme),
|
|
24
|
+
icons,
|
|
25
|
+
display,
|
|
26
|
+
});
|
|
27
|
+
app.use(vuetify);
|
|
28
|
+
ViewService.setViewNextTick(nextTick);
|
|
29
|
+
// Prism Code Editor
|
|
30
|
+
app.component('PrismEditor', PrismEditor);
|
|
31
|
+
// Tree component
|
|
32
|
+
app.component('SlVueTree', SlVueTreeNext);
|
|
33
|
+
RegisterComponents(app);
|
|
34
|
+
// getIcon
|
|
35
|
+
// eslint-disable-next-line no-param-reassign
|
|
36
|
+
app.config.globalProperties.$getIcon = getIconPlugin;
|
|
37
|
+
// formatSize
|
|
38
|
+
// eslint-disable-next-line no-param-reassign
|
|
39
|
+
app.config.globalProperties.$formatSize = formatSizePlugin;
|
|
40
|
+
// styleObject
|
|
41
|
+
// eslint-disable-next-line no-param-reassign
|
|
42
|
+
app.config.globalProperties.$styleObject = styleObjectPlugin;
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export * from './errors';
|
|
46
|
+
export * from './utils';
|
|
47
|
+
export * from './components';
|
|
48
|
+
export * from './composables';
|
|
49
|
+
export default ZeedhiVuetify;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const HeightProps = {
|
|
2
|
+
fillHeight: {
|
|
3
|
+
type: [Boolean, String],
|
|
4
|
+
default: false,
|
|
5
|
+
},
|
|
6
|
+
height: {
|
|
7
|
+
type: [Number, String],
|
|
8
|
+
},
|
|
9
|
+
minHeight: {
|
|
10
|
+
type: [Number, String],
|
|
11
|
+
default: 'auto',
|
|
12
|
+
},
|
|
13
|
+
maxHeight: {
|
|
14
|
+
type: [Number, String],
|
|
15
|
+
default: 'none',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|