@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,92 @@
|
|
|
1
|
+
import { Tooltip } from '@zeedhi/common';
|
|
2
|
+
import { computed, defineComponent, mergeProps } from 'vue';
|
|
3
|
+
import { buildProps } from '../../utils';
|
|
4
|
+
import ZdActivatorWrapper from '../zd-activator-wrapper/ZdActivatorWrapper.vue';
|
|
5
|
+
import { useCreateInstance } from '../zd-component/ZdComponent';
|
|
6
|
+
import { ZdComponentRenderProps } from '../zd-component/ZdComponentRender';
|
|
7
|
+
export const ZdTooltipProps = buildProps({
|
|
8
|
+
...ZdComponentRenderProps,
|
|
9
|
+
bottom: {
|
|
10
|
+
type: [Boolean, String],
|
|
11
|
+
default: false,
|
|
12
|
+
},
|
|
13
|
+
color: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: '',
|
|
16
|
+
},
|
|
17
|
+
disabled: {
|
|
18
|
+
type: [Boolean, String],
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
label: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '',
|
|
24
|
+
},
|
|
25
|
+
left: {
|
|
26
|
+
type: [Boolean, String],
|
|
27
|
+
default: false,
|
|
28
|
+
},
|
|
29
|
+
maxWidth: {
|
|
30
|
+
type: [Number, String],
|
|
31
|
+
default: undefined,
|
|
32
|
+
},
|
|
33
|
+
minWidth: {
|
|
34
|
+
type: [Number, String],
|
|
35
|
+
default: undefined,
|
|
36
|
+
},
|
|
37
|
+
nudge: {
|
|
38
|
+
type: [Number, String],
|
|
39
|
+
default: 10,
|
|
40
|
+
},
|
|
41
|
+
openOnClick: {
|
|
42
|
+
type: [Boolean, String],
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
openOnFocus: {
|
|
46
|
+
type: [Boolean, String],
|
|
47
|
+
default: true,
|
|
48
|
+
},
|
|
49
|
+
openOnHover: {
|
|
50
|
+
type: [Boolean, String],
|
|
51
|
+
default: true,
|
|
52
|
+
},
|
|
53
|
+
right: {
|
|
54
|
+
type: [Boolean, String],
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
top: {
|
|
58
|
+
type: [Boolean, String],
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
// Zeedhi 3.0
|
|
62
|
+
});
|
|
63
|
+
const tooltipComponent = defineComponent({
|
|
64
|
+
props: ZdTooltipProps,
|
|
65
|
+
inheritAttrs: false,
|
|
66
|
+
components: {
|
|
67
|
+
ZdActivatorWrapper,
|
|
68
|
+
},
|
|
69
|
+
setup(props, ctx) {
|
|
70
|
+
const { instance, root } = useCreateInstance(props, ctx, Tooltip);
|
|
71
|
+
const getLocation = () => {
|
|
72
|
+
if (instance.right)
|
|
73
|
+
return 'right';
|
|
74
|
+
if (instance.left)
|
|
75
|
+
return 'left';
|
|
76
|
+
if (instance.top)
|
|
77
|
+
return 'top';
|
|
78
|
+
if (instance.bottom)
|
|
79
|
+
return 'bottom';
|
|
80
|
+
};
|
|
81
|
+
const location = computed(() => {
|
|
82
|
+
return getLocation();
|
|
83
|
+
});
|
|
84
|
+
return {
|
|
85
|
+
instance,
|
|
86
|
+
root,
|
|
87
|
+
location,
|
|
88
|
+
mergeProps,
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
export default tooltipComponent;
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { Tree, } from '@zeedhi/common';
|
|
2
|
+
import { computed, defineComponent, getCurrentInstance, nextTick, onMounted, ref, watch } from 'vue';
|
|
3
|
+
import { useTheme } from 'vuetify';
|
|
4
|
+
import { buildProps } from '../../utils/buildProps';
|
|
5
|
+
import { setFillHeight } from '../../utils/fillHeight';
|
|
6
|
+
import { useCreateInstance } from '../zd-component/ZdComponent';
|
|
7
|
+
import { ZdComponentRenderProps } from '../zd-component/ZdComponentRender';
|
|
8
|
+
import ZdTreeAfterTitle from './ZdTreeAfterTitle.vue';
|
|
9
|
+
import ZdTreeCheckbox from './ZdTreeCheckbox.vue';
|
|
10
|
+
export const ZdTreeProps = buildProps({
|
|
11
|
+
...ZdComponentRenderProps,
|
|
12
|
+
nodes: {
|
|
13
|
+
type: [Array, String],
|
|
14
|
+
default: () => [],
|
|
15
|
+
},
|
|
16
|
+
itemIconName: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: '',
|
|
19
|
+
},
|
|
20
|
+
groupIconName: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: '',
|
|
23
|
+
},
|
|
24
|
+
openedIconName: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: '',
|
|
27
|
+
},
|
|
28
|
+
closedIconName: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: '',
|
|
31
|
+
},
|
|
32
|
+
allowMultiSelect: {
|
|
33
|
+
type: [String, Boolean],
|
|
34
|
+
default: true,
|
|
35
|
+
},
|
|
36
|
+
allowDragDrop: {
|
|
37
|
+
type: [String, Boolean],
|
|
38
|
+
default: true,
|
|
39
|
+
},
|
|
40
|
+
afterTitleSlot: {
|
|
41
|
+
type: [String, Object],
|
|
42
|
+
default: () => [],
|
|
43
|
+
},
|
|
44
|
+
toolbarSlot: {
|
|
45
|
+
type: Array,
|
|
46
|
+
default: () => [],
|
|
47
|
+
},
|
|
48
|
+
titleSlot: {
|
|
49
|
+
type: Array,
|
|
50
|
+
default: () => [],
|
|
51
|
+
},
|
|
52
|
+
datasource: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: () => ({}),
|
|
55
|
+
},
|
|
56
|
+
parentField: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: '',
|
|
59
|
+
},
|
|
60
|
+
titleField: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '',
|
|
63
|
+
},
|
|
64
|
+
dataField: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: '',
|
|
67
|
+
},
|
|
68
|
+
checkedField: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: 'checked',
|
|
71
|
+
},
|
|
72
|
+
checkbox: {
|
|
73
|
+
type: [Boolean, String],
|
|
74
|
+
default: false,
|
|
75
|
+
},
|
|
76
|
+
openLevelOnLoad: {
|
|
77
|
+
type: [String, Number, Boolean],
|
|
78
|
+
default: false,
|
|
79
|
+
},
|
|
80
|
+
disableCheckbox: {
|
|
81
|
+
type: [String, Function],
|
|
82
|
+
default: undefined,
|
|
83
|
+
},
|
|
84
|
+
height: {
|
|
85
|
+
type: [Number, String],
|
|
86
|
+
default: 'auto',
|
|
87
|
+
},
|
|
88
|
+
minHeight: {
|
|
89
|
+
type: [Number, String],
|
|
90
|
+
default: 'auto',
|
|
91
|
+
},
|
|
92
|
+
maxHeight: {
|
|
93
|
+
type: [Number, String],
|
|
94
|
+
default: 'none',
|
|
95
|
+
},
|
|
96
|
+
width: {
|
|
97
|
+
type: [Number, String],
|
|
98
|
+
default: '100%',
|
|
99
|
+
},
|
|
100
|
+
minWidth: {
|
|
101
|
+
type: [Number, String],
|
|
102
|
+
default: 'auto',
|
|
103
|
+
},
|
|
104
|
+
maxWidth: {
|
|
105
|
+
type: [Number, String],
|
|
106
|
+
default: 'none',
|
|
107
|
+
},
|
|
108
|
+
fillHeight: {
|
|
109
|
+
type: [Boolean, String],
|
|
110
|
+
default: false,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
export default defineComponent({
|
|
114
|
+
name: 'ZdTree',
|
|
115
|
+
components: { ZdTreeCheckbox, ZdTreeAfterTitle },
|
|
116
|
+
props: ZdTreeProps,
|
|
117
|
+
setup(props, ctx) {
|
|
118
|
+
const treeRef = ref();
|
|
119
|
+
const { instance, root } = useCreateInstance(props, ctx, Tree);
|
|
120
|
+
const selectedNodesTitle = ref('');
|
|
121
|
+
const beforeNodeState = ref({});
|
|
122
|
+
const proxy = getCurrentInstance()?.proxy;
|
|
123
|
+
const theme = useTheme();
|
|
124
|
+
function ThemeColor(color = '') {
|
|
125
|
+
if (!color)
|
|
126
|
+
return '';
|
|
127
|
+
if (color[0] === '#')
|
|
128
|
+
return color;
|
|
129
|
+
const parts = color.split(' ');
|
|
130
|
+
let themeColors;
|
|
131
|
+
let idx;
|
|
132
|
+
idx = parts.indexOf('light');
|
|
133
|
+
if (idx !== -1) {
|
|
134
|
+
themeColors = theme.themes.value.light.colors;
|
|
135
|
+
parts.splice(idx, 1);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
idx = parts.indexOf('dark');
|
|
139
|
+
if (idx !== -1) {
|
|
140
|
+
themeColors = theme.themes.value.dark.colors;
|
|
141
|
+
parts.splice(idx, 1);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
themeColors = theme.current.value.colors;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return themeColors[parts[0]] || parts[0];
|
|
148
|
+
}
|
|
149
|
+
const cssColorVars = computed(() => ({
|
|
150
|
+
'--current-row-color': `${ThemeColor('primary')}40`,
|
|
151
|
+
'--current-row-hover-color': `${ThemeColor('primary')}30`,
|
|
152
|
+
}));
|
|
153
|
+
const nodeChange = () => {
|
|
154
|
+
treeRef.value?.traverse((node) => {
|
|
155
|
+
instance.reapplyConditions(node);
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
const refsMap = ref({});
|
|
159
|
+
function getAfterTitleEls(rootEl) {
|
|
160
|
+
return Array.from(rootEl.querySelectorAll('.zd-tree-after-title'));
|
|
161
|
+
}
|
|
162
|
+
function getMaxOffset(els) {
|
|
163
|
+
const siblings = els.map((el) => el.previousElementSibling instanceof HTMLElement ? el.previousElementSibling : null);
|
|
164
|
+
return siblings.reduce((result, el) => {
|
|
165
|
+
if (!el)
|
|
166
|
+
return result;
|
|
167
|
+
const style = getComputedStyle(el);
|
|
168
|
+
const offset = el.offsetLeft + el.offsetWidth + parseFloat(style.marginLeft || '0') + parseFloat(style.marginRight || '0');
|
|
169
|
+
return offset > result ? offset : result;
|
|
170
|
+
}, 0);
|
|
171
|
+
}
|
|
172
|
+
function setAfterTitleMargin(rootEl) {
|
|
173
|
+
if (!rootEl)
|
|
174
|
+
return;
|
|
175
|
+
const els = getAfterTitleEls(rootEl);
|
|
176
|
+
const maxOffset = getMaxOffset(els);
|
|
177
|
+
els.forEach((el) => {
|
|
178
|
+
el.style.left = `${maxOffset}px`;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function addObserver(node) {
|
|
182
|
+
if (!node.pathStr)
|
|
183
|
+
return;
|
|
184
|
+
const ref = refsMap.value[node.pathStr];
|
|
185
|
+
const el = ref;
|
|
186
|
+
const observer = new ResizeObserver(() => {
|
|
187
|
+
const root = treeRef.value?.$el || treeRef.value;
|
|
188
|
+
if (root)
|
|
189
|
+
setAfterTitleMargin(root);
|
|
190
|
+
});
|
|
191
|
+
if (el.parentElement) {
|
|
192
|
+
observer.observe(el.parentElement);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
onMounted(() => {
|
|
196
|
+
instance.setTree(treeRef.value);
|
|
197
|
+
nodeChange();
|
|
198
|
+
const rootEl = (treeRef.value?.$el || treeRef.value);
|
|
199
|
+
if (!rootEl)
|
|
200
|
+
return;
|
|
201
|
+
const observeAfterTitleSlots = () => {
|
|
202
|
+
const afterTitleEls = rootEl.querySelectorAll('.zd-tree-after-title');
|
|
203
|
+
afterTitleEls.forEach((el) => {
|
|
204
|
+
if (!el.parentElement)
|
|
205
|
+
return;
|
|
206
|
+
if (!el._hasObserver) {
|
|
207
|
+
const resizeObserver = new ResizeObserver(() => setAfterTitleMargin(rootEl));
|
|
208
|
+
resizeObserver.observe(el.parentElement);
|
|
209
|
+
el._hasObserver = true;
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
setAfterTitleMargin(rootEl);
|
|
214
|
+
observeAfterTitleSlots();
|
|
215
|
+
if (instance.fillHeight)
|
|
216
|
+
setFillHeight(rootEl);
|
|
217
|
+
const mutationObserver = new MutationObserver(() => {
|
|
218
|
+
setAfterTitleMargin(rootEl);
|
|
219
|
+
observeAfterTitleSlots();
|
|
220
|
+
});
|
|
221
|
+
mutationObserver.observe(rootEl, { childList: true, subtree: true });
|
|
222
|
+
});
|
|
223
|
+
watch(() => instance.nodes, () => {
|
|
224
|
+
nextTick(() => {
|
|
225
|
+
const rootEl = (treeRef.value?.$el || treeRef.value);
|
|
226
|
+
if (!rootEl)
|
|
227
|
+
return;
|
|
228
|
+
setAfterTitleMargin(rootEl);
|
|
229
|
+
// registra ResizeObserver nos novos afterTitleSlots
|
|
230
|
+
const afterTitleEls = rootEl.querySelectorAll('.zd-tree-after-title');
|
|
231
|
+
afterTitleEls.forEach((el) => {
|
|
232
|
+
if (!el.parentElement)
|
|
233
|
+
return;
|
|
234
|
+
const observer = new ResizeObserver(() => setAfterTitleMargin(rootEl));
|
|
235
|
+
observer.observe(el.parentElement);
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
}, { deep: true });
|
|
239
|
+
watch(() => instance.datasource?.data?.length, () => {
|
|
240
|
+
instance.createNodesFromDatasource();
|
|
241
|
+
});
|
|
242
|
+
const onNodeDrop = (nodes, position, event) => {
|
|
243
|
+
instance.nodeDrop(nodes, position, event, proxy?.$el);
|
|
244
|
+
nextTick(() => nodeChange());
|
|
245
|
+
};
|
|
246
|
+
const onNodeSelect = (nodes, event) => {
|
|
247
|
+
const prevCount = Object.keys(beforeNodeState.value).length;
|
|
248
|
+
beforeNodeState.value = {};
|
|
249
|
+
if (prevCount <= nodes.length || event.ctrlKey || event.metaKey) {
|
|
250
|
+
nodes.forEach((node) => {
|
|
251
|
+
beforeNodeState.value[JSON.stringify(node.path)] = node.isSelected;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
instance.nodeSelect(nodes, event, proxy?.$el);
|
|
255
|
+
selectedNodesTitle.value = nodes.map((n) => n.title).join(', ');
|
|
256
|
+
nextTick(() => nodeChange());
|
|
257
|
+
};
|
|
258
|
+
const onNodeClick = (node, event) => {
|
|
259
|
+
if (beforeNodeState.value[JSON.stringify(node.path)] &&
|
|
260
|
+
(Object.keys(beforeNodeState.value).length === 1 || event.ctrlKey || event.metaKey)) {
|
|
261
|
+
treeRef.value?.updateNode(node.path, { isSelected: false });
|
|
262
|
+
}
|
|
263
|
+
instance.nodeClick(node, event, proxy?.$el);
|
|
264
|
+
};
|
|
265
|
+
const onNodeDblClick = (node, event) => {
|
|
266
|
+
instance.nodeDblClick(node, event, proxy?.$el);
|
|
267
|
+
};
|
|
268
|
+
const instanceNode = (node) => (node?.path ? instance.getNode(node.path) : undefined);
|
|
269
|
+
const nodeCheck = (node, event) => {
|
|
270
|
+
instance.nodeCheck(node, event, proxy?.$el);
|
|
271
|
+
};
|
|
272
|
+
const toggleNode = (node) => {
|
|
273
|
+
if (treeRef.value && typeof treeRef.value.toggleNode === 'function') {
|
|
274
|
+
treeRef.value.toggleNode(node);
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
node.isExpanded = !node.isExpanded;
|
|
278
|
+
}
|
|
279
|
+
updateAfterTitlePositions();
|
|
280
|
+
};
|
|
281
|
+
function updateAfterTitlePositions() {
|
|
282
|
+
nextTick(() => {
|
|
283
|
+
const rootEl = (treeRef.value?.$el || treeRef.value);
|
|
284
|
+
if (!rootEl)
|
|
285
|
+
return;
|
|
286
|
+
setAfterTitleMargin(rootEl);
|
|
287
|
+
const afterTitleEls = rootEl.querySelectorAll('.zd-tree-after-title');
|
|
288
|
+
afterTitleEls.forEach((el) => {
|
|
289
|
+
if (!el.parentElement)
|
|
290
|
+
return;
|
|
291
|
+
if (!el._hasObserver) {
|
|
292
|
+
const observer = new ResizeObserver(() => setAfterTitleMargin(rootEl));
|
|
293
|
+
observer.observe(el.parentElement);
|
|
294
|
+
el._hasObserver = true;
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
root,
|
|
301
|
+
treeRef,
|
|
302
|
+
instance,
|
|
303
|
+
selectedNodesTitle,
|
|
304
|
+
cssColorVars,
|
|
305
|
+
onNodeDrop,
|
|
306
|
+
onNodeSelect,
|
|
307
|
+
onNodeClick,
|
|
308
|
+
onNodeDblClick,
|
|
309
|
+
instanceNode,
|
|
310
|
+
nodeCheck,
|
|
311
|
+
toggleNode,
|
|
312
|
+
addObserver,
|
|
313
|
+
};
|
|
314
|
+
},
|
|
315
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent } from 'vue';
|
|
2
|
+
import { buildProps } from '../../utils/buildProps';
|
|
3
|
+
export const ZdTreeAfterTitleProps = buildProps({
|
|
4
|
+
afterTitleSlot: {
|
|
5
|
+
type: Object,
|
|
6
|
+
},
|
|
7
|
+
node: {
|
|
8
|
+
type: Object,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const treeAfterTitleComponent = defineComponent({
|
|
12
|
+
props: ZdTreeAfterTitleProps,
|
|
13
|
+
setup() {
|
|
14
|
+
return {};
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export default treeAfterTitleComponent;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { computed, defineComponent, nextTick, ref, watch } from 'vue';
|
|
2
|
+
import { buildProps } from '../../utils/buildProps';
|
|
3
|
+
export const ZdTreeCheckboxProps = buildProps({
|
|
4
|
+
node: {
|
|
5
|
+
type: Object,
|
|
6
|
+
default: null,
|
|
7
|
+
},
|
|
8
|
+
checkedField: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: 'checked',
|
|
11
|
+
},
|
|
12
|
+
disabled: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export default defineComponent({
|
|
18
|
+
props: ZdTreeCheckboxProps,
|
|
19
|
+
setup(props, { emit }) {
|
|
20
|
+
const localNode = ref(props.node);
|
|
21
|
+
const checkedField = ref(props.checkedField);
|
|
22
|
+
let isUpdatingFromChildren = false;
|
|
23
|
+
const childrenCheck = computed(() => {
|
|
24
|
+
if (isUpdatingFromChildren)
|
|
25
|
+
return localNode.value?.data?.[checkedField.value] || false;
|
|
26
|
+
return localNode.value?.children?.every((child) => child.data?.[checkedField.value]) || false;
|
|
27
|
+
});
|
|
28
|
+
watch(childrenCheck, (newVal, oldVal) => {
|
|
29
|
+
if (isUpdatingFromChildren || newVal === oldVal)
|
|
30
|
+
return;
|
|
31
|
+
if (localNode.value?.data && localNode.value.data[checkedField.value] !== newVal) {
|
|
32
|
+
isUpdatingFromChildren = true;
|
|
33
|
+
localNode.value.data[checkedField.value] = newVal;
|
|
34
|
+
nextTick(() => {
|
|
35
|
+
isUpdatingFromChildren = false;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const isIndeterminate = computed(() => {
|
|
40
|
+
const total = localNode.value?.children?.length || 0;
|
|
41
|
+
const checked = localNode.value?.children?.filter((child) => child.data?.[checkedField.value]).length || 0;
|
|
42
|
+
return checked > 0 && checked < total;
|
|
43
|
+
});
|
|
44
|
+
const checkboxValue = computed({
|
|
45
|
+
get: () => localNode.value?.data?.[checkedField.value] || false,
|
|
46
|
+
set: (value) => {
|
|
47
|
+
if (localNode.value?.data) {
|
|
48
|
+
isUpdatingFromChildren = true;
|
|
49
|
+
localNode.value.data[checkedField.value] = value;
|
|
50
|
+
// Propaga para os filhos
|
|
51
|
+
if (localNode.value.children?.length) {
|
|
52
|
+
toggleChildren(localNode.value.children, value);
|
|
53
|
+
}
|
|
54
|
+
nextTick(() => {
|
|
55
|
+
isUpdatingFromChildren = false;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
function toggleChildren(nodes, value) {
|
|
61
|
+
nodes.forEach((node) => {
|
|
62
|
+
if (node.data) {
|
|
63
|
+
// Crie um novo objeto para data, evitando mutação direta
|
|
64
|
+
node.data = { ...node.data, [checkedField.value]: value };
|
|
65
|
+
}
|
|
66
|
+
if (node.children?.length)
|
|
67
|
+
toggleChildren(node.children, value);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function checkboxToggle() {
|
|
71
|
+
const currentValue = localNode.value?.data?.[checkedField.value] || false;
|
|
72
|
+
const newValue = !currentValue;
|
|
73
|
+
// Atualiza o nó atual
|
|
74
|
+
if (localNode.value?.data) {
|
|
75
|
+
localNode.value.data[checkedField.value] = newValue;
|
|
76
|
+
}
|
|
77
|
+
// Propaga para os filhos
|
|
78
|
+
if (localNode.value?.children?.length) {
|
|
79
|
+
toggleChildren(localNode.value.children, newValue);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function click(event) {
|
|
83
|
+
if (props.disabled)
|
|
84
|
+
return;
|
|
85
|
+
checkboxToggle();
|
|
86
|
+
emit('click', event);
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
localNode,
|
|
90
|
+
checkedField,
|
|
91
|
+
childrenCheck,
|
|
92
|
+
isIndeterminate,
|
|
93
|
+
checkboxValue,
|
|
94
|
+
click,
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { TreeGrid } from '@zeedhi/common';
|
|
2
|
+
import { computed, defineComponent } from 'vue';
|
|
3
|
+
import { buildProps } from '../../utils';
|
|
4
|
+
import { useCreateInstance } from '../zd-component/ZdComponent';
|
|
5
|
+
import { ZdGridProps, useGridInstance } from '../zd-grid/ZdGrid';
|
|
6
|
+
export const ZdTreeGridProps = buildProps({
|
|
7
|
+
...ZdGridProps,
|
|
8
|
+
parentField: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: '',
|
|
11
|
+
},
|
|
12
|
+
openLevelOnLoad: {
|
|
13
|
+
type: [String, Number, Boolean],
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
16
|
+
fetchOnDemand: {
|
|
17
|
+
type: [String, Boolean],
|
|
18
|
+
default: true,
|
|
19
|
+
},
|
|
20
|
+
flat: {
|
|
21
|
+
type: [String, Boolean],
|
|
22
|
+
default: false,
|
|
23
|
+
},
|
|
24
|
+
detach: {
|
|
25
|
+
type: [String, Boolean],
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
fieldHasChild: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: '',
|
|
31
|
+
},
|
|
32
|
+
footerSlot: {
|
|
33
|
+
type: Array,
|
|
34
|
+
default: () => [],
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
const treeGridComponent = defineComponent({
|
|
38
|
+
props: ZdTreeGridProps,
|
|
39
|
+
inheritAttrs: false,
|
|
40
|
+
setup(props, ctx) {
|
|
41
|
+
const { instance, root } = useCreateInstance(props, ctx, TreeGrid);
|
|
42
|
+
const gridScope = useGridInstance({ instance, root });
|
|
43
|
+
const cellClick = ({ row, column, event }) => {
|
|
44
|
+
instance.cellClick(row, column, event, gridScope.rootEl.value);
|
|
45
|
+
};
|
|
46
|
+
const rowClick = (row, event) => {
|
|
47
|
+
instance.rowClick(row, event, gridScope.rootEl.value);
|
|
48
|
+
};
|
|
49
|
+
const computedData = computed(() => {
|
|
50
|
+
return instance.treeDataStructure.searchHasNoData
|
|
51
|
+
? []
|
|
52
|
+
: instance.treeDataStructure.treeData || instance.getData();
|
|
53
|
+
});
|
|
54
|
+
const isOpened = (row) => {
|
|
55
|
+
return instance.treeDataStructure.isOpened(row);
|
|
56
|
+
};
|
|
57
|
+
const getKeysFrom = (data) => {
|
|
58
|
+
const { uniqueKey } = instance.datasource;
|
|
59
|
+
return data.map((toggledRow) => toggledRow[uniqueKey]);
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Checks whether this row's selection state is indeterminate
|
|
63
|
+
* @param row
|
|
64
|
+
* @returns `true` if it is indeterminate
|
|
65
|
+
*/
|
|
66
|
+
const isIndeterminate = (row) => {
|
|
67
|
+
const { uniqueKey } = instance.datasource;
|
|
68
|
+
const arrSelection = instance.selectAllPages ? instance.selectionState.except : instance.selectedRows;
|
|
69
|
+
const selectedKeys = getKeysFrom(arrSelection);
|
|
70
|
+
const childSelectionCount = row.tree__children?.reduce((result, child) => {
|
|
71
|
+
const isSelected = instance.callDisableSelection(child) || selectedKeys.includes(child[uniqueKey]);
|
|
72
|
+
return isSelected ? result + 1 : result;
|
|
73
|
+
}, 0);
|
|
74
|
+
return childSelectionCount > 0 && childSelectionCount < row.tree__children.length;
|
|
75
|
+
};
|
|
76
|
+
const hasChildOnDemand = (row) => {
|
|
77
|
+
return instance.treeDataStructure.hasChildOnDemand(row);
|
|
78
|
+
};
|
|
79
|
+
const toggleExpand = (row, rowIndex, event) => {
|
|
80
|
+
event?.stopPropagation();
|
|
81
|
+
return instance.toggleExpand(row, rowIndex);
|
|
82
|
+
};
|
|
83
|
+
const isSelected = (item) => {
|
|
84
|
+
return !!gridScope.selectedRows.value.find((row) => row[instance.datasource.uniqueKey] === item.value[instance.datasource.uniqueKey]);
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
...gridScope,
|
|
88
|
+
cellClick,
|
|
89
|
+
rowClick,
|
|
90
|
+
instance,
|
|
91
|
+
root,
|
|
92
|
+
computedData,
|
|
93
|
+
isOpened,
|
|
94
|
+
isIndeterminate,
|
|
95
|
+
hasChildOnDemand,
|
|
96
|
+
toggleExpand,
|
|
97
|
+
isSelected,
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
export default treeGridComponent;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { computed, defineComponent, inject } from 'vue';
|
|
2
|
+
export default defineComponent({
|
|
3
|
+
props: {
|
|
4
|
+
row: {
|
|
5
|
+
type: Object,
|
|
6
|
+
required: true,
|
|
7
|
+
},
|
|
8
|
+
column: {
|
|
9
|
+
type: Object,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
cssClass: {
|
|
13
|
+
type: Array,
|
|
14
|
+
default: () => [],
|
|
15
|
+
},
|
|
16
|
+
cssStyle: {
|
|
17
|
+
type: Array,
|
|
18
|
+
default: () => [],
|
|
19
|
+
},
|
|
20
|
+
cellSelection: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
isCurrent: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
},
|
|
27
|
+
hasChildOnDemand: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
},
|
|
30
|
+
showExpandIcon: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
},
|
|
33
|
+
isFirstCell: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
emits: ['focusin', 'click', 'expandIconClick'],
|
|
38
|
+
setup(props, { emit }) {
|
|
39
|
+
const tabindex = computed(() => (props.cellSelection ? 0 : ''));
|
|
40
|
+
const getActions = inject('getActions');
|
|
41
|
+
const gridInstance = inject('gridInstance');
|
|
42
|
+
if (!getActions || !gridInstance) {
|
|
43
|
+
throw new Error('gridInstance');
|
|
44
|
+
}
|
|
45
|
+
const conditionalProps = computed(() => {
|
|
46
|
+
const { row, column } = props;
|
|
47
|
+
return gridInstance.getConditionalProps({ row, column });
|
|
48
|
+
});
|
|
49
|
+
const click = (event) => {
|
|
50
|
+
emit('click', event);
|
|
51
|
+
};
|
|
52
|
+
const focusin = (event) => {
|
|
53
|
+
emit('focusin', event);
|
|
54
|
+
};
|
|
55
|
+
const getMergedConditionals = (propName) => {
|
|
56
|
+
return conditionalProps.value[propName] || props.column[propName];
|
|
57
|
+
};
|
|
58
|
+
const expandIconClick = (event) => {
|
|
59
|
+
emit('expandIconClick', event);
|
|
60
|
+
};
|
|
61
|
+
const highlightSearchResult = (text) => {
|
|
62
|
+
if (typeof text !== 'string')
|
|
63
|
+
return text;
|
|
64
|
+
if (gridInstance.datasource.search) {
|
|
65
|
+
const reg = new RegExp(gridInstance.datasource.search, 'gi');
|
|
66
|
+
return text.replace(reg, (value) => `<span class="search-result">${value}</span>`);
|
|
67
|
+
}
|
|
68
|
+
return text;
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
tabindex,
|
|
72
|
+
click,
|
|
73
|
+
focusin,
|
|
74
|
+
conditionalProps,
|
|
75
|
+
getActions,
|
|
76
|
+
getMergedConditionals,
|
|
77
|
+
expandIconClick,
|
|
78
|
+
highlightSearchResult,
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
});
|