@zeedhi/vuetify 1.112.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/zd-vuetify.css +1 -0
- package/dist/zd-vuetify.js +24569 -0
- package/package.json +29 -35
- package/rollup.config.prod.js +26 -0
- package/rollup.scss.config.js +9 -9
- package/src/components/index.ts +305 -0
- package/src/components/tek-grid/TekGrid.ts +320 -0
- package/src/components/tek-grid/TekGrid.vue +235 -0
- package/src/components/tek-grid/column-filter/TekGridColumnFilter.ts +243 -0
- package/src/components/tek-grid/column-filter/TekGridColumnFilter.vue +93 -0
- package/src/components/tek-grid/column-header/TekGridHeaderRow.ts +147 -0
- package/src/components/tek-grid/column-header/TekGridHeaderRow.vue +78 -0
- package/src/components/tek-grid/columns-button/TekGridColumnsButton.ts +97 -0
- package/src/components/tek-grid/columns-button/TekGridColumnsButton.vue +273 -0
- package/src/components/tek-grid/columns-button/TekGridColumnsOptionsController.ts +469 -0
- package/src/components/tek-grid/columns-button/TekGridColumnsOptionsModal.ts +512 -0
- package/src/components/tek-grid/filter-button/TekGridFilterButton.ts +46 -0
- package/src/components/tek-grid/filter-button/TekGridFilterButton.vue +28 -0
- package/src/components/tek-grid/indentation/TekGridIndentation.ts +21 -0
- package/src/components/tek-grid/indentation/TekGridIndentation.vue +33 -0
- package/src/components/tek-grid/layout-options/TekGridLayoutOptions.ts +117 -0
- package/src/components/tek-grid/layout-options/TekGridLayoutOptions.vue +172 -0
- package/src/components/tek-grid/row/TekGridFooterRow.ts +62 -0
- package/src/components/tek-grid/row/TekGridFooterRow.vue +64 -0
- package/src/components/tek-grid/row/TekGridGroupRow.ts +65 -0
- package/src/components/tek-grid/row/TekGridGroupRow.vue +65 -0
- package/src/components/tooltip-overflow/ZdTooltipOverflow.ts +63 -0
- package/src/components/tooltip-overflow/ZdTooltipOverflow.vue +63 -0
- package/src/components/zd-activator-wrapper/ZdActivatorWrapper.ts +37 -0
- package/src/components/zd-activator-wrapper/ZdActivatorWrapper.vue +16 -0
- package/src/components/zd-alert/ZdAlert.ts +132 -0
- package/src/components/zd-alert/ZdAlert.vue +84 -0
- package/src/components/zd-badge/ZdBadge.ts +32 -0
- package/src/components/zd-badge/ZdBadge.vue +73 -0
- package/src/components/zd-breadcrumbs/ZdBreadcrumbs.ts +61 -0
- package/src/components/zd-breadcrumbs/ZdBreadcrumbs.vue +53 -0
- package/src/components/zd-button/ZdButton.ts +249 -0
- package/src/components/zd-button/ZdButton.vue +135 -0
- package/src/components/zd-button-group/ZdButtonGroup.ts +113 -0
- package/src/components/zd-button-group/ZdButtonGroup.vue +66 -0
- package/src/components/zd-card/ZdCard.ts +139 -0
- package/src/components/zd-card/ZdCard.vue +113 -0
- package/src/components/zd-carousel/ZdCarousel.ts +268 -0
- package/src/components/zd-carousel/ZdCarousel.vue +243 -0
- package/src/components/zd-checkbox/ZdCheckbox.ts +47 -0
- package/src/components/zd-checkbox/ZdCheckbox.vue +50 -0
- package/src/components/zd-checkbox-multiple/ZdCheckboxMultiple.ts +69 -0
- package/src/components/zd-checkbox-multiple/ZdCheckboxMultiple.vue +146 -0
- package/src/components/zd-chip/ZdChip.ts +96 -0
- package/src/components/zd-chip/ZdChip.vue +131 -0
- package/src/components/zd-code-viewer/ZdCodeViewer.ts +65 -0
- package/src/components/zd-code-viewer/ZdCodeViewer.vue +187 -0
- package/src/components/zd-code-viewer/prism.ts +15 -0
- package/src/components/zd-col/ZdCol.ts +50 -0
- package/src/components/zd-col/ZdCol.vue +26 -0
- package/src/components/zd-collapse-card/ZdCollapseCard.ts +97 -0
- package/src/components/zd-collapse-card/ZdCollapseCard.vue +147 -0
- package/src/components/zd-component/ZdComponent.ts +324 -0
- package/src/components/zd-component/ZdComponentRender.ts +16 -0
- package/src/components/zd-container/ZdContainer.ts +47 -0
- package/src/components/zd-container/ZdContainer.vue +41 -0
- package/src/components/zd-currency/ZdCurrency.ts +28 -0
- package/src/components/zd-currency/ZdCurrency.vue +9 -0
- package/src/components/zd-date-input/ZdDateInput.ts +265 -0
- package/src/components/zd-date-input/ZdDateInput.vue +156 -0
- package/src/components/zd-dialog/ZdDialog.ts +39 -0
- package/src/components/zd-dialog/ZdDialog.vue +80 -0
- package/src/components/zd-divider/ZdDivider.ts +32 -0
- package/src/components/zd-divider/ZdDivider.vue +14 -0
- package/src/components/zd-dropdown/ZdDropdown.ts +98 -0
- package/src/components/zd-dropdown/ZdDropdown.vue +97 -0
- package/src/components/zd-footer/ZdFooter.ts +82 -0
- package/src/components/zd-footer/ZdFooter.vue +122 -0
- package/src/components/zd-form/ZdForm.ts +97 -0
- package/src/components/zd-form/ZdForm.vue +71 -0
- package/src/components/zd-frame/ZdFrame.ts +80 -0
- package/src/components/zd-frame/ZdFrame.vue +44 -0
- package/src/components/zd-frame-page/ZdFramePage.ts +25 -0
- package/src/components/zd-frame-page/ZdFramePage.vue +18 -0
- package/src/components/zd-grid/ZdGrid.ts +341 -0
- package/src/components/zd-grid/ZdGrid.vue +350 -0
- package/src/components/zd-grid/cell/ZdGridAction.ts +14 -0
- package/src/components/zd-grid/cell/ZdGridAction.vue +22 -0
- package/src/components/zd-grid/cell/ZdGridCell.ts +69 -0
- package/src/components/zd-grid/cell/ZdGridCell.vue +40 -0
- package/src/components/zd-grid/cell/ZdGridCellContent.ts +72 -0
- package/src/components/zd-grid/cell/ZdGridCellContent.vue +31 -0
- package/src/components/zd-grid/cell/ZdGridCheckbox.ts +41 -0
- package/src/components/zd-grid/cell/ZdGridCheckbox.vue +30 -0
- package/src/components/zd-grid/column-header/ZdGridColumnHeader.ts +78 -0
- package/src/components/zd-grid/column-header/ZdGridColumnHeader.vue +82 -0
- package/src/components/zd-grid/column-header/ZdGridHeaderIcon.ts +34 -0
- package/src/components/zd-grid/column-header/ZdGridHeaderIcon.vue +33 -0
- package/src/components/zd-grid/column-header/ZdGridHeaderRow.ts +114 -0
- package/src/components/zd-grid/column-header/ZdGridHeaderRow.vue +83 -0
- package/src/components/zd-grid/column-header/ZdGridSort.ts +34 -0
- package/src/components/zd-grid/column-header/ZdGridSort.vue +34 -0
- package/src/components/zd-grid/composables/grid-instance.ts +17 -0
- package/src/components/zd-grid/footer/ZdGridFooter.ts +19 -0
- package/src/components/zd-grid/footer/ZdGridFooter.vue +29 -0
- package/src/components/zd-grid/helper/ZdGridHelper.ts +14 -0
- package/src/components/zd-grid/helper/ZdGridHelper.vue +17 -0
- package/src/components/zd-grid/row/TableRow.ts +27 -0
- package/src/components/zd-grid/row/TableRow.vue +20 -0
- package/src/components/zd-grid/row/ZdGridRow.ts +78 -0
- package/src/components/zd-grid/row/ZdGridRow.vue +47 -0
- package/src/components/zd-grid/toolbar/ZdGridToolbar.ts +19 -0
- package/src/components/zd-grid/toolbar/ZdGridToolbar.vue +36 -0
- package/src/components/zd-grid-editable/ZdGridEditable.ts +235 -0
- package/src/components/zd-grid-editable/ZdGridEditable.vue +160 -0
- package/src/components/zd-grid-editable/cell/ZdGridEditableCell.ts +165 -0
- package/src/components/zd-grid-editable/cell/ZdGridEditableCell.vue +152 -0
- package/src/components/zd-grid-editable/row/ZdGridEditableRow.ts +114 -0
- package/src/components/zd-grid-editable/row/ZdGridEditableRow.vue +42 -0
- package/src/components/zd-header/ZdHeader.ts +119 -0
- package/src/components/zd-header/ZdHeader.vue +144 -0
- package/src/components/zd-icon/ZdIcon.ts +67 -0
- package/src/components/zd-icon/ZdIcon.vue +32 -0
- package/src/components/zd-image/ZdImage.ts +53 -0
- package/src/components/zd-image/ZdImage.vue +80 -0
- package/src/components/zd-increment/ZdIncrement.ts +42 -0
- package/src/components/zd-increment/ZdIncrement.vue +23 -0
- package/src/components/zd-input/ZdInput.ts +189 -0
- package/src/components/zd-iterable/ZdIterable.ts +40 -0
- package/src/components/zd-iterable/ZdIterableNoData.ts +23 -0
- package/src/components/zd-iterable/ZdIterableNoData.vue +53 -0
- package/src/components/zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton.ts +56 -0
- package/src/components/zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton.vue +50 -0
- package/src/components/zd-iterable/zd-iterable-page-info/ZdIterablePageInfo.ts +24 -0
- package/src/components/zd-iterable/zd-iterable-page-info/ZdIterablePageInfo.vue +21 -0
- package/src/components/zd-iterable/zd-iterable-page-size/ZdIterablePageSize.ts +60 -0
- package/src/components/zd-iterable/zd-iterable-page-size/ZdIterablePageSize.vue +17 -0
- package/src/components/zd-iterable/zd-iterable-pagination/ZdIterablePagination.ts +39 -0
- package/src/components/zd-iterable/zd-iterable-pagination/ZdIterablePagination.vue +42 -0
- package/src/components/zd-iterable/zd-search/ZdSearch.ts +46 -0
- package/src/components/zd-iterable/zd-search/ZdSearch.vue +18 -0
- package/src/components/zd-iterable-component-render/ZdIterableComponentRender.ts +115 -0
- package/src/components/zd-iterable-component-render/ZdIterableComponentRender.vue +152 -0
- package/src/components/zd-layout/ZdLayout.ts +46 -0
- package/src/components/zd-layout/ZdLayout.vue +22 -0
- package/src/components/zd-list/ZdList.scss +41 -0
- package/src/components/zd-list/ZdList.ts +89 -0
- package/src/components/zd-list/ZdList.vue +41 -0
- package/src/components/zd-list/ZdListGroup.ts +43 -0
- package/src/components/zd-list/ZdListGroup.vue +88 -0
- package/src/components/zd-list/ZdListItem.ts +71 -0
- package/src/components/zd-list/ZdListItem.vue +55 -0
- package/src/components/zd-loading/ZdLoading.ts +68 -0
- package/src/components/zd-loading/ZdLoading.vue +66 -0
- package/src/components/zd-login/ZdLogin.ts +73 -0
- package/src/components/zd-login/ZdLogin.vue +303 -0
- package/src/components/zd-login/ZdLoginButton.ts +32 -0
- package/src/components/zd-login/ZdLoginButton.vue +10 -0
- package/src/components/zd-main/ZdMain.ts +38 -0
- package/src/components/zd-main/ZdMain.vue +18 -0
- package/src/components/zd-master-detail/ZdMasterDetail.ts +53 -0
- package/src/components/zd-master-detail/ZdMasterDetail.vue +31 -0
- package/src/components/zd-menu/ZdMenu.ts +337 -0
- package/src/components/zd-menu/ZdMenu.vue +160 -0
- package/src/components/zd-menu/ZdMenuButton.ts +47 -0
- package/src/components/zd-menu/ZdMenuButton.vue +11 -0
- package/src/components/zd-menu/ZdMenuGroup.ts +73 -0
- package/src/components/zd-menu/ZdMenuGroup.vue +92 -0
- package/src/components/zd-menu/ZdMenuLink.ts +69 -0
- package/src/components/zd-menu/ZdMenuLink.vue +31 -0
- package/src/components/zd-menu/ZdMenuSeparator.ts +31 -0
- package/src/components/zd-menu/ZdMenuSeparator.vue +17 -0
- package/src/components/zd-modal/ZdModal.ts +146 -0
- package/src/components/zd-modal/ZdModal.vue +144 -0
- package/src/components/zd-modal/ZdModalCloseButton.ts +40 -0
- package/src/components/zd-modal/ZdModalCloseButton.vue +12 -0
- package/src/components/zd-month/ZdMonth.ts +55 -0
- package/src/components/zd-month/ZdMonth.vue +11 -0
- package/src/components/zd-number-input/ZdNumberInput.ts +96 -0
- package/src/components/zd-number-input/ZdNumberInput.vue +17 -0
- package/src/components/zd-password/ZdPassword.ts +27 -0
- package/src/components/zd-password/ZdPassword.vue +9 -0
- package/src/components/zd-progress/ZdProgress.ts +56 -0
- package/src/components/zd-progress/ZdProgress.vue +31 -0
- package/src/components/zd-radio/ZdRadio.ts +71 -0
- package/src/components/zd-radio/ZdRadio.vue +57 -0
- package/src/components/zd-row/ZdRow.ts +48 -0
- package/src/components/zd-row/ZdRow.vue +39 -0
- package/src/components/zd-select/ZdSelect.ts +222 -0
- package/src/components/zd-select/ZdSelect.vue +214 -0
- package/src/components/zd-select-multiple/ZdSelectMultiple.ts +389 -0
- package/src/components/zd-select-multiple/ZdSelectMultiple.vue +300 -0
- package/src/components/zd-svg-map/ZdSvgMap.ts +233 -0
- package/src/components/zd-svg-map/ZdSvgMap.vue +88 -0
- package/src/components/zd-switch/ZdSwitch.ts +45 -0
- package/src/components/zd-switch/ZdSwitch.vue +65 -0
- package/src/components/zd-table/ZdTable.ts +47 -0
- package/src/components/zd-table/ZdTable.vue +84 -0
- package/src/components/zd-tabs/ZdTab.ts +100 -0
- package/src/components/zd-tabs/ZdTab.vue +51 -0
- package/src/components/zd-tabs/ZdTabItem.ts +20 -0
- package/src/components/zd-tabs/ZdTabItem.vue +40 -0
- package/src/components/zd-tabs/ZdTabs.ts +92 -0
- package/src/components/zd-tabs/ZdTabs.vue +124 -0
- package/src/components/zd-tag/ZdTag.ts +39 -0
- package/src/components/zd-tag/ZdTag.vue +27 -0
- package/src/components/zd-text/ZdText.ts +40 -0
- package/src/components/zd-text/ZdText.vue +44 -0
- package/src/components/zd-text-input/ZdTextInput.ts +208 -0
- package/src/components/zd-text-input/ZdTextInput.vue +347 -0
- package/src/components/zd-textarea/ZdTextarea.ts +82 -0
- package/src/components/zd-textarea/ZdTextarea.vue +204 -0
- package/src/components/zd-time/ZdTime.ts +209 -0
- package/src/components/zd-time/ZdTime.vue +65 -0
- package/src/components/zd-toggleable/ZdToggleable.ts +16 -0
- package/src/components/zd-tooltip/ZdTooltip.ts +97 -0
- package/src/components/zd-tooltip/ZdTooltip.vue +34 -0
- package/src/components/zd-tree/ZdTree.ts +264 -0
- package/src/components/zd-tree/ZdTree.vue +335 -0
- package/src/components/zd-tree/ZdTreeAfterTitle.ts +21 -0
- package/src/components/zd-tree/ZdTreeAfterTitle.vue +25 -0
- package/src/components/zd-tree/ZdTreeCheckbox.ts +110 -0
- package/src/components/zd-tree/ZdTreeCheckbox.vue +43 -0
- package/src/components/zd-tree-grid/ZdTreeGrid.ts +127 -0
- package/src/components/zd-tree-grid/ZdTreeGrid.vue +199 -0
- package/src/components/zd-tree-grid/cell/ZdTreeGridCell.ts +93 -0
- package/src/components/zd-tree-grid/cell/ZdTreeGridCell.vue +133 -0
- package/src/components/zd-tree-grid/row/ZdTreeGridRow.ts +95 -0
- package/src/components/zd-tree-grid/row/ZdTreeGridRow.vue +48 -0
- package/src/composables/cellSelection.ts +49 -0
- package/src/composables/columnDrag.ts +105 -0
- package/src/composables/columnResize.ts +159 -0
- package/src/composables/density.ts +19 -0
- package/src/composables/doubleClick.ts +39 -0
- package/src/composables/fixedColumns.ts +131 -0
- package/src/composables/gridColorVars.ts +41 -0
- package/src/composables/gridColumns.ts +112 -0
- package/src/composables/gridSelection.ts +113 -0
- package/src/composables/gridSorting.ts +27 -0
- package/src/composables/hasSlot.ts +32 -0
- package/src/composables/index.ts +16 -0
- package/src/composables/maska.ts +47 -0
- package/src/composables/tableNavigation.ts +163 -0
- package/src/composables/useTableLayout.ts +293 -0
- package/src/composables/virtualScroll.ts +140 -0
- package/src/composables/watchUrl.ts +21 -0
- package/src/errors/index.ts +2 -0
- package/src/errors/not-provided.ts +12 -0
- package/src/errors/row-not-found.ts +10 -0
- package/src/errors/zeedhi-error.ts +8 -0
- package/src/index.ts +67 -0
- package/src/propsMixins/heightProps.ts +17 -0
- package/src/propsMixins/index.ts +6 -0
- package/src/propsMixins/interfaces.ts +3 -0
- package/src/propsMixins/widthProps.ts +13 -0
- package/src/shims-vue.d.ts +6 -0
- package/src/styles/_zd-input.scss +206 -0
- package/src/styles/index.scss +37 -0
- package/src/styles/moon-design-system.css +31 -0
- package/src/utils/buildProps.ts +5 -0
- package/src/utils/fillHeight.ts +17 -0
- package/src/utils/icons/icons.ts +36 -0
- package/src/utils/index.ts +7 -0
- package/src/utils/isArrayOperation.ts +5 -0
- package/src/utils/logger/logger.ts +7 -0
- package/src/utils/mergeDictionaries.ts +27 -0
- package/src/utils/plugins/formatSizePlugin.ts +6 -0
- package/src/utils/plugins/getIconPlugin.ts +12 -0
- package/src/utils/plugins/index.ts +5 -0
- package/src/utils/plugins/plugins.d.ts +12 -0
- package/src/utils/plugins/styleObjectPlugin.ts +13 -0
- package/types/components/index.d.ts +87 -2
- package/types/components/tek-grid/TekGrid.d.ts +7258 -0
- package/types/components/tek-grid/TekGrid.ts.d.ts +7258 -0
- package/types/components/tek-grid/column-filter/TekGridColumnFilter.d.ts +129 -0
- package/types/components/tek-grid/column-filter/TekGridColumnFilter.ts.d.ts +129 -0
- package/types/components/tek-grid/column-header/TekGridHeaderRow.d.ts +225 -0
- package/types/components/tek-grid/column-header/TekGridHeaderRow.ts.d.ts +225 -0
- package/types/components/tek-grid/columns-button/TekGridColumnsButton.d.ts +2432 -0
- package/types/components/tek-grid/columns-button/TekGridColumnsButton.ts.d.ts +2432 -0
- package/types/components/tek-grid/columns-button/TekGridColumnsOptionsController.d.ts +65 -0
- package/types/components/tek-grid/columns-button/TekGridColumnsOptionsModal.d.ts +9 -0
- package/types/components/tek-grid/filter-button/TekGridFilterButton.d.ts +2920 -0
- package/types/components/tek-grid/filter-button/TekGridFilterButton.ts.d.ts +2920 -0
- package/types/components/tek-grid/indentation/TekGridIndentation.d.ts +32 -0
- package/types/components/tek-grid/indentation/TekGridIndentation.ts.d.ts +32 -0
- package/types/components/tek-grid/layout-options/TekGridLayoutOptions.d.ts +1892 -0
- package/types/components/tek-grid/layout-options/TekGridLayoutOptions.ts.d.ts +1892 -0
- package/types/components/tek-grid/row/TekGridFooterRow.d.ts +90 -0
- package/types/components/tek-grid/row/TekGridFooterRow.ts.d.ts +90 -0
- package/types/components/tek-grid/row/TekGridGroupRow.d.ts +87 -0
- package/types/components/tek-grid/row/TekGridGroupRow.ts.d.ts +87 -0
- package/types/components/tooltip-overflow/ZdTooltipOverflow.d.ts +50 -0
- package/types/components/tooltip-overflow/ZdTooltipOverflow.ts.d.ts +50 -0
- package/types/components/zd-activator-wrapper/ZdActivatorWrapper.d.ts +25 -0
- package/types/components/zd-activator-wrapper/ZdActivatorWrapper.ts.d.ts +25 -0
- package/types/components/zd-alert/ZdAlert.d.ts +882 -12
- package/types/components/zd-alert/ZdAlert.ts.d.ts +884 -0
- package/types/components/zd-badge/ZdBadge.d.ts +624 -11
- package/types/components/zd-badge/ZdBadge.ts.d.ts +624 -0
- package/types/components/zd-breadcrumbs/ZdBreadcrumbs.d.ts +692 -10
- package/types/components/zd-breadcrumbs/ZdBreadcrumbs.ts.d.ts +697 -0
- package/types/components/zd-button/ZdButton.d.ts +1151 -27
- package/types/components/zd-button/ZdButton.ts.d.ts +1158 -0
- package/types/components/zd-button-group/ZdButtonGroup.d.ts +782 -23
- package/types/components/zd-button-group/ZdButtonGroup.ts.d.ts +785 -0
- package/types/components/zd-card/ZdCard.d.ts +1024 -28
- package/types/components/zd-card/ZdCard.ts.d.ts +1028 -0
- package/types/components/zd-carousel/ZdCarousel.d.ts +2007 -70
- package/types/components/zd-carousel/ZdCarousel.ts.d.ts +2007 -0
- package/types/components/zd-checkbox/ZdCheckbox.d.ts +641 -9
- package/types/components/zd-checkbox/ZdCheckbox.ts.d.ts +642 -0
- package/types/components/zd-checkbox-multiple/ZdCheckboxMultiple.d.ts +2006 -14
- package/types/components/zd-checkbox-multiple/ZdCheckboxMultiple.ts.d.ts +2010 -0
- package/types/components/zd-chip/ZdChip.d.ts +1254 -21
- package/types/components/zd-chip/ZdChip.ts.d.ts +1256 -0
- package/types/components/zd-code-viewer/ZdCodeViewer.d.ts +791 -0
- package/types/components/zd-code-viewer/ZdCodeViewer.ts.d.ts +791 -0
- package/types/components/{zd-code-editor → zd-code-viewer}/prism.d.ts +7 -7
- package/types/components/zd-col/ZdCol.d.ts +740 -19
- package/types/components/zd-col/ZdCol.ts.d.ts +741 -0
- package/types/components/zd-collapse-card/ZdCollapseCard.d.ts +1580 -40
- package/types/components/zd-collapse-card/ZdCollapseCard.ts.d.ts +1583 -0
- package/types/components/zd-component/ZdComponent.d.ts +104 -43
- package/types/components/zd-component/ZdComponentRender.d.ts +80 -11
- package/types/components/zd-container/ZdContainer.d.ts +722 -19
- package/types/components/zd-container/ZdContainer.ts.d.ts +722 -0
- package/types/components/zd-currency/ZdCurrency.d.ts +2024 -10
- package/types/components/zd-currency/ZdCurrency.ts.d.ts +2024 -0
- package/types/components/zd-date-input/ZdDateInput.d.ts +960 -0
- package/types/components/zd-date-input/ZdDateInput.ts.d.ts +960 -0
- package/types/components/zd-dialog/ZdDialog.d.ts +251 -4
- package/types/components/zd-dialog/ZdDialog.ts.d.ts +262 -0
- package/types/components/zd-divider/ZdDivider.d.ts +623 -11
- package/types/components/zd-divider/ZdDivider.ts.d.ts +623 -0
- package/types/components/zd-dropdown/ZdDropdown.d.ts +835 -31
- package/types/components/zd-dropdown/ZdDropdown.ts.d.ts +836 -0
- package/types/components/zd-footer/ZdFooter.d.ts +1258 -29
- package/types/components/zd-footer/ZdFooter.ts.d.ts +1262 -0
- package/types/components/zd-form/ZdForm.d.ts +118 -24
- package/types/components/zd-form/ZdForm.ts.d.ts +118 -0
- package/types/components/zd-frame/ZdFrame.d.ts +138 -26
- package/types/components/zd-frame/ZdFrame.ts.d.ts +138 -0
- package/types/components/zd-frame-page/ZdFramePage.d.ts +804 -9
- package/types/components/zd-frame-page/ZdFramePage.ts.d.ts +805 -0
- package/types/components/zd-grid/ZdGrid.d.ts +7299 -120
- package/types/components/zd-grid/ZdGrid.ts.d.ts +7304 -0
- package/types/components/zd-grid/cell/ZdGridAction.d.ts +14 -0
- package/types/components/zd-grid/cell/ZdGridAction.ts.d.ts +14 -0
- package/types/components/zd-grid/cell/ZdGridCell.d.ts +68 -0
- package/types/components/zd-grid/cell/ZdGridCell.ts.d.ts +68 -0
- package/types/components/zd-grid/cell/ZdGridCellContent.d.ts +58 -0
- package/types/components/zd-grid/cell/ZdGridCellContent.ts.d.ts +58 -0
- package/types/components/zd-grid/cell/ZdGridCheckbox.d.ts +53 -0
- package/types/components/zd-grid/cell/ZdGridCheckbox.ts.d.ts +53 -0
- package/types/components/zd-grid/column-header/ZdGridColumnHeader.d.ts +112 -0
- package/types/components/zd-grid/column-header/ZdGridColumnHeader.ts.d.ts +112 -0
- package/types/components/zd-grid/column-header/ZdGridHeaderIcon.d.ts +46 -0
- package/types/components/zd-grid/column-header/ZdGridHeaderIcon.ts.d.ts +46 -0
- package/types/components/zd-grid/column-header/ZdGridHeaderRow.d.ts +165 -0
- package/types/components/zd-grid/column-header/ZdGridHeaderRow.ts.d.ts +165 -0
- package/types/components/zd-grid/column-header/ZdGridSort.d.ts +47 -0
- package/types/components/zd-grid/column-header/ZdGridSort.ts.d.ts +47 -0
- package/types/components/zd-grid/composables/grid-instance.d.ts +2085 -0
- package/types/components/zd-grid/footer/ZdGridFooter.d.ts +2087 -0
- package/types/components/zd-grid/footer/ZdGridFooter.ts.d.ts +2087 -0
- package/types/components/zd-grid/helper/ZdGridHelper.d.ts +16 -0
- package/types/components/zd-grid/helper/ZdGridHelper.ts.d.ts +16 -0
- package/types/components/zd-grid/row/TableRow.d.ts +34 -0
- package/types/components/zd-grid/row/TableRow.ts.d.ts +34 -0
- package/types/components/zd-grid/row/ZdGridRow.d.ts +105 -0
- package/types/components/zd-grid/row/ZdGridRow.ts.d.ts +105 -0
- package/types/components/zd-grid/toolbar/ZdGridToolbar.d.ts +2086 -0
- package/types/components/zd-grid/toolbar/ZdGridToolbar.ts.d.ts +2086 -0
- package/types/components/zd-grid-editable/ZdGridEditable.d.ts +8663 -0
- package/types/components/zd-grid-editable/ZdGridEditable.ts.d.ts +8663 -0
- package/types/components/zd-grid-editable/cell/ZdGridEditableCell.d.ts +637 -0
- package/types/components/zd-grid-editable/cell/ZdGridEditableCell.ts.d.ts +637 -0
- package/types/components/zd-grid-editable/row/ZdGridEditableRow.d.ts +126 -0
- package/types/components/zd-grid-editable/row/ZdGridEditableRow.ts.d.ts +126 -0
- package/types/components/zd-header/ZdHeader.d.ts +1316 -32
- package/types/components/zd-header/ZdHeader.ts.d.ts +1320 -0
- package/types/components/zd-icon/ZdIcon.d.ts +379 -15
- package/types/components/zd-icon/ZdIcon.ts.d.ts +383 -0
- package/types/components/zd-image/ZdImage.d.ts +748 -18
- package/types/components/zd-image/ZdImage.ts.d.ts +753 -0
- package/types/components/zd-increment/ZdIncrement.d.ts +2069 -12
- package/types/components/zd-increment/ZdIncrement.ts.d.ts +2069 -0
- package/types/components/zd-input/ZdInput.d.ts +200 -44
- package/types/components/zd-iterable/ZdIterable.d.ts +130 -43
- package/types/components/zd-iterable/ZdIterableNoData.d.ts +2089 -0
- package/types/components/zd-iterable/ZdIterableNoData.ts.d.ts +2089 -0
- package/types/components/zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton.d.ts +1641 -20
- package/types/components/zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton.ts.d.ts +1645 -0
- package/types/components/zd-iterable/zd-iterable-page-info/ZdIterablePageInfo.d.ts +1081 -9
- package/types/components/zd-iterable/zd-iterable-page-info/ZdIterablePageInfo.ts.d.ts +1081 -0
- package/types/components/zd-iterable/zd-iterable-page-size/ZdIterablePageSize.d.ts +2762 -19
- package/types/components/zd-iterable/zd-iterable-page-size/ZdIterablePageSize.ts.d.ts +2763 -0
- package/types/components/zd-iterable/zd-iterable-pagination/ZdIterablePagination.d.ts +1625 -33
- package/types/components/zd-iterable/zd-iterable-pagination/ZdIterablePagination.ts.d.ts +1627 -0
- package/types/components/zd-iterable/zd-search/ZdSearch.d.ts +763 -19
- package/types/components/zd-iterable/zd-search/ZdSearch.ts.d.ts +766 -0
- package/types/components/zd-iterable-component-render/ZdIterableComponentRender.d.ts +2480 -21
- package/types/components/zd-iterable-component-render/ZdIterableComponentRender.ts.d.ts +2484 -0
- package/types/components/zd-layout/ZdLayout.d.ts +647 -0
- package/types/components/zd-layout/ZdLayout.ts.d.ts +647 -0
- package/types/components/zd-list/ZdList.d.ts +1140 -27
- package/types/components/zd-list/ZdList.ts.d.ts +1140 -0
- package/types/components/zd-list/ZdListGroup.d.ts +1332 -12
- package/types/components/zd-list/ZdListGroup.ts.d.ts +1332 -0
- package/types/components/zd-list/ZdListItem.d.ts +848 -19
- package/types/components/zd-list/ZdListItem.ts.d.ts +848 -0
- package/types/components/zd-loading/ZdLoading.d.ts +350 -19
- package/types/components/zd-loading/ZdLoading.ts.d.ts +350 -0
- package/types/components/zd-login/ZdLogin.d.ts +1063 -32
- package/types/components/zd-login/ZdLogin.ts.d.ts +1072 -0
- package/types/components/zd-login/ZdLoginButton.d.ts +1908 -9
- package/types/components/zd-login/ZdLoginButton.ts.d.ts +1910 -0
- package/types/components/zd-main/ZdMain.d.ts +619 -0
- package/types/components/zd-main/ZdMain.ts.d.ts +619 -0
- package/types/components/zd-master-detail/ZdMasterDetail.d.ts +683 -16
- package/types/components/zd-master-detail/ZdMasterDetail.ts.d.ts +684 -0
- package/types/components/zd-menu/ZdMenu.d.ts +4480 -40
- package/types/components/zd-menu/ZdMenu.ts.d.ts +4484 -0
- package/types/components/zd-menu/ZdMenuButton.d.ts +1141 -12
- package/types/components/zd-menu/ZdMenuButton.ts.d.ts +1142 -0
- package/types/components/zd-menu/ZdMenuGroup.d.ts +6280 -13
- package/types/components/zd-menu/ZdMenuGroup.ts.d.ts +6286 -0
- package/types/components/zd-menu/ZdMenuLink.d.ts +10433 -14
- package/types/components/zd-menu/ZdMenuLink.ts.d.ts +10437 -0
- package/types/components/zd-menu/ZdMenuSeparator.d.ts +600 -9
- package/types/components/zd-menu/ZdMenuSeparator.ts.d.ts +600 -0
- package/types/components/zd-modal/ZdModal.d.ts +8 -34
- package/types/components/zd-modal/ZdModal.ts.d.ts +10 -0
- package/types/components/zd-modal/ZdModalCloseButton.d.ts +1136 -12
- package/types/components/zd-modal/ZdModalCloseButton.ts.d.ts +1137 -0
- package/types/components/zd-month/ZdMonth.d.ts +2217 -12
- package/types/components/zd-month/ZdMonth.ts.d.ts +2217 -0
- package/types/components/zd-number-input/ZdNumberInput.d.ts +2021 -0
- package/types/components/zd-number-input/ZdNumberInput.ts.d.ts +2021 -0
- package/types/components/zd-password/ZdPassword.d.ts +2011 -6
- package/types/components/zd-password/ZdPassword.ts.d.ts +2014 -0
- package/types/components/zd-progress/ZdProgress.d.ts +856 -13
- package/types/components/zd-progress/ZdProgress.ts.d.ts +859 -0
- package/types/components/zd-radio/ZdRadio.d.ts +677 -10
- package/types/components/zd-radio/ZdRadio.ts.d.ts +682 -0
- package/types/components/zd-row/ZdRow.d.ts +734 -18
- package/types/components/zd-row/ZdRow.ts.d.ts +734 -0
- package/types/components/zd-select/ZdSelect.d.ts +313 -88
- package/types/components/zd-select/ZdSelect.ts.d.ts +313 -0
- package/types/components/zd-select-multiple/ZdSelectMultiple.d.ts +330 -64
- package/types/components/zd-select-multiple/ZdSelectMultiple.ts.d.ts +333 -0
- package/types/components/zd-svg-map/ZdSvgMap.d.ts +410 -57
- package/types/components/zd-svg-map/ZdSvgMap.ts.d.ts +414 -0
- package/types/components/zd-switch/ZdSwitch.d.ts +1915 -8
- package/types/components/zd-switch/ZdSwitch.ts.d.ts +1918 -0
- package/types/components/zd-table/ZdTable.d.ts +1092 -17
- package/types/components/zd-table/ZdTable.ts.d.ts +1092 -0
- package/types/components/zd-tabs/ZdTab.d.ts +671 -9
- package/types/components/zd-tabs/ZdTab.ts.d.ts +674 -0
- package/types/components/zd-tabs/ZdTabItem.d.ts +268 -8
- package/types/components/zd-tabs/ZdTabItem.ts.d.ts +268 -0
- package/types/components/zd-tabs/ZdTabs.d.ts +926 -17
- package/types/components/zd-tabs/ZdTabs.ts.d.ts +929 -0
- package/types/components/zd-tag/ZdTag.d.ts +613 -11
- package/types/components/zd-tag/ZdTag.ts.d.ts +613 -0
- package/types/components/zd-text/ZdText.d.ts +668 -17
- package/types/components/zd-text/ZdText.ts.d.ts +670 -0
- package/types/components/zd-text-input/ZdTextInput.d.ts +739 -41
- package/types/components/zd-text-input/ZdTextInput.ts.d.ts +746 -0
- package/types/components/zd-textarea/ZdTextarea.d.ts +875 -22
- package/types/components/zd-textarea/ZdTextarea.ts.d.ts +877 -0
- package/types/components/zd-time/ZdTime.d.ts +2221 -36
- package/types/components/zd-time/ZdTime.ts.d.ts +2224 -0
- package/types/components/zd-toggleable/ZdToggleable.d.ts +199 -11
- package/types/components/zd-tooltip/ZdTooltip.d.ts +779 -21
- package/types/components/zd-tooltip/ZdTooltip.ts.d.ts +781 -0
- package/types/components/zd-tree/ZdTree.d.ts +1863 -40
- package/types/components/zd-tree/ZdTree.ts.d.ts +1878 -0
- package/types/components/zd-tree/ZdTreeAfterTitle.d.ts +26 -11
- package/types/components/zd-tree/ZdTreeAfterTitle.ts.d.ts +26 -0
- package/types/components/zd-tree/ZdTreeCheckbox.d.ts +72 -15
- package/types/components/zd-tree/ZdTreeCheckbox.ts.d.ts +74 -0
- package/types/components/zd-tree-grid/ZdTreeGrid.d.ts +4172 -26
- package/types/components/zd-tree-grid/ZdTreeGrid.ts.d.ts +4178 -0
- package/types/components/zd-tree-grid/cell/ZdTreeGridCell.d.ts +92 -0
- package/types/components/zd-tree-grid/cell/ZdTreeGridCell.ts.d.ts +92 -0
- package/types/components/zd-tree-grid/row/ZdTreeGridRow.d.ts +124 -0
- package/types/components/zd-tree-grid/row/ZdTreeGridRow.ts.d.ts +124 -0
- package/types/composables/cellSelection.d.ts +281 -0
- package/types/composables/columnDrag.d.ts +9 -0
- package/types/composables/columnResize.d.ts +18 -0
- package/types/composables/density.d.ts +12 -0
- package/types/composables/doubleClick.d.ts +6 -0
- package/types/composables/fixedColumns.d.ts +14 -0
- package/types/composables/gridColorVars.d.ts +13 -0
- package/types/composables/gridColumns.d.ts +285 -0
- package/types/composables/gridSelection.d.ts +15 -0
- package/types/composables/gridSorting.d.ts +17 -0
- package/types/composables/hasSlot.d.ts +8 -0
- package/types/composables/index.d.ts +16 -0
- package/types/composables/maska.d.ts +16 -0
- package/types/composables/tableNavigation.d.ts +11 -0
- package/types/composables/useTableLayout.d.ts +25 -0
- package/types/composables/virtualScroll.d.ts +26 -0
- package/types/composables/watchUrl.d.ts +8 -0
- package/types/errors/index.d.ts +2 -0
- package/types/errors/not-provided.d.ts +7 -0
- package/types/errors/row-not-found.d.ts +7 -0
- package/types/errors/zeedhi-error.d.ts +6 -0
- package/types/index.d.ts +19 -16
- package/types/propsMixins/heightProps.d.ts +17 -0
- package/types/propsMixins/index.d.ts +5 -0
- package/types/propsMixins/interfaces.d.ts +2 -0
- package/types/propsMixins/widthProps.d.ts +13 -0
- package/types/utils/buildProps.d.ts +2 -0
- package/types/utils/index.d.ts +7 -0
- package/types/utils/isArrayOperation.d.ts +2 -0
- package/types/utils/logger/logger.d.ts +3 -0
- package/types/utils/mergeDictionaries.d.ts +3 -0
- package/types/utils/plugins/formatSizePlugin.d.ts +1 -2
- package/types/utils/plugins/getIconPlugin.d.ts +1 -2
- package/types/utils/plugins/index.d.ts +2 -8
- package/types/utils/plugins/styleObjectPlugin.d.ts +1 -2
- package/vitest.config.ts +14 -0
- package/dist/zd-style.css +0 -147
- package/dist/zd-vuetify.esm.js +0 -64841
- package/dist/zd-vuetify.umd.js +0 -64951
- package/types/components/public.d.ts +0 -99
- package/types/components/zd-apex-chart/ZdApexChart.d.ts +0 -32
- package/types/components/zd-code-editor/ZdCodeEditor.d.ts +0 -23
- package/types/components/zd-dashboard/ZdDashboard.d.ts +0 -41
- package/types/components/zd-date/ZdDate.d.ts +0 -48
- package/types/components/zd-date/ZdDateRange.d.ts +0 -44
- package/types/components/zd-file-input/ZdFileInput.d.ts +0 -38
- package/types/components/zd-grid/ZdGridEditable.d.ts +0 -28
- package/types/components/zd-grid/subcomponents/ZdGridFooter.d.ts +0 -6
- package/types/components/zd-grid/subcomponents/ZdGridTop.d.ts +0 -6
- package/types/components/zd-grid/subcomponents/cell/ZdGridAction.d.ts +0 -15
- package/types/components/zd-grid/subcomponents/cell/ZdGridCell.d.ts +0 -24
- package/types/components/zd-grid/subcomponents/cell/ZdGridCellContent.d.ts +0 -28
- package/types/components/zd-grid/subcomponents/cell/ZdGridCellEdit.d.ts +0 -15
- package/types/components/zd-grid/subcomponents/cell/ZdGridCheckbox.d.ts +0 -15
- package/types/components/zd-grid/subcomponents/cell/ZdGridEditableCell.d.ts +0 -49
- package/types/components/zd-grid/subcomponents/cell/ZdGridEditableCellContent.d.ts +0 -52
- package/types/components/zd-grid/subcomponents/cell/ZdGridRow.d.ts +0 -12
- package/types/components/zd-grid/subcomponents/column-header/ZdGridColumnHeader.d.ts +0 -19
- package/types/components/zd-grid/subcomponents/column-header/ZdGridSortIcon.d.ts +0 -8
- package/types/components/zd-grid/subcomponents/helper/ZdGridHelper.d.ts +0 -4
- package/types/components/zd-iterable/ZdIterablePageComponent.d.ts +0 -10
- package/types/components/zd-iterable/zd-iterable-no-data/ZdIterableNoData.d.ts +0 -8
- package/types/components/zd-list/ZdListItemContent.d.ts +0 -8
- package/types/components/zd-number/ZdNumber.d.ts +0 -20
- package/types/components/zd-range-slider/ZdRangeSlider.d.ts +0 -39
- package/types/components/zd-select-tree/ZdSelectTree.d.ts +0 -48
- package/types/components/zd-select-tree-multiple/ZdSelectTreeMultiple.d.ts +0 -39
- package/types/components/zd-selectable-list/ZdSelectableList.d.ts +0 -23
- package/types/components/zd-speed-dial/ZdSpeedDial.d.ts +0 -18
- package/types/components/zd-steppers/ZdSteppers.d.ts +0 -16
- package/types/components/zd-tree-grid/ZdTreeGridEditable.d.ts +0 -21
- package/types/components/zd-tree-grid/cell/ZdTreeGridCellActionContent.d.ts +0 -13
- package/types/components/zd-tree-grid/cell/ZdTreeGridCellContent.d.ts +0 -13
- package/types/mixins/editable-mixin/EditableMixin.d.ts +0 -77
- package/types/mixins/index.d.ts +0 -4
- package/types/mixins/navigable-table-mixin/NavigableTableMixin.d.ts +0 -26
- package/types/mixins/themeable/Themeable.d.ts +0 -16
- package/types/utils/colors.d.ts +0 -2
- package/types/utils/decorators.d.ts +0 -3
- package/types/utils/get-activator.d.ts +0 -11
- package/types/utils/plugins/doubleClickPlugin.d.ts +0 -10
- package/types/utils/plugins/isDarkPlugin.d.ts +0 -3
- package/types/utils/plugins/isLightPlugin.d.ts +0 -3
- package/types/utils/plugins/isMobilePlugin.d.ts +0 -2
- package/types/utils/plugins/onVisiblePlugin.d.ts +0 -5
- package/types/utils/plugins/solidColorPlugin.d.ts +0 -2
- package/types/v-components/index.d.ts +0 -3
- package/types/v-components/v-menu/ZdVMenu.d.ts +0 -8
- package/types/v-components/v-tooltip/ZdVTooltip.d.ts +0 -8
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { ITreeNodeModel } from '@zeedhi/common';
|
|
2
|
+
import type { IDictionary } from '@zeedhi/core';
|
|
3
|
+
import { computed, defineComponent, nextTick, ref, watch } from 'vue';
|
|
4
|
+
import type { PropType } from 'vue';
|
|
5
|
+
import { buildProps } from '../../utils/buildProps';
|
|
6
|
+
|
|
7
|
+
export const ZdTreeCheckboxProps = buildProps({
|
|
8
|
+
node: {
|
|
9
|
+
type: Object as PropType<ITreeNodeModel<IDictionary>>,
|
|
10
|
+
default: null,
|
|
11
|
+
},
|
|
12
|
+
checkedField: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'checked',
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
props: ZdTreeCheckboxProps,
|
|
24
|
+
setup(props, { emit }) {
|
|
25
|
+
const localNode = ref(props.node);
|
|
26
|
+
const checkedField = ref(props.checkedField);
|
|
27
|
+
|
|
28
|
+
let isUpdatingFromChildren = false;
|
|
29
|
+
|
|
30
|
+
const childrenCheck = computed(() => {
|
|
31
|
+
if (isUpdatingFromChildren) return localNode.value?.data?.[checkedField.value] || false;
|
|
32
|
+
return localNode.value?.children?.every((child) => child.data?.[checkedField.value]) || false;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
watch(childrenCheck, (newVal, oldVal) => {
|
|
36
|
+
if (isUpdatingFromChildren || newVal === oldVal) return;
|
|
37
|
+
|
|
38
|
+
if (localNode.value?.data && localNode.value.data[checkedField.value] !== newVal) {
|
|
39
|
+
isUpdatingFromChildren = true;
|
|
40
|
+
localNode.value.data[checkedField.value] = newVal;
|
|
41
|
+
nextTick(() => {
|
|
42
|
+
isUpdatingFromChildren = false;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const isIndeterminate = computed(() => {
|
|
48
|
+
const total = localNode.value?.children?.length || 0;
|
|
49
|
+
const checked = localNode.value?.children?.filter((child) => child.data?.[checkedField.value]).length || 0;
|
|
50
|
+
return checked > 0 && checked < total;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const checkboxValue = computed({
|
|
54
|
+
get: () => localNode.value?.data?.[checkedField.value] || false,
|
|
55
|
+
set: (value: boolean) => {
|
|
56
|
+
if (localNode.value?.data) {
|
|
57
|
+
isUpdatingFromChildren = true;
|
|
58
|
+
localNode.value.data[checkedField.value] = value;
|
|
59
|
+
// Propaga para os filhos
|
|
60
|
+
if (localNode.value.children?.length) {
|
|
61
|
+
toggleChildren(localNode.value.children, value);
|
|
62
|
+
}
|
|
63
|
+
nextTick(() => {
|
|
64
|
+
isUpdatingFromChildren = false;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
function toggleChildren(nodes: ITreeNodeModel<IDictionary>[], value: boolean) {
|
|
71
|
+
nodes.forEach((node) => {
|
|
72
|
+
if (node.data) {
|
|
73
|
+
// Crie um novo objeto para data, evitando mutação direta
|
|
74
|
+
node.data = { ...node.data, [checkedField.value]: value };
|
|
75
|
+
}
|
|
76
|
+
if (node.children?.length) toggleChildren(node.children, value);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function checkboxToggle() {
|
|
81
|
+
const currentValue = localNode.value?.data?.[checkedField.value] || false;
|
|
82
|
+
const newValue = !currentValue;
|
|
83
|
+
|
|
84
|
+
// Atualiza o nó atual
|
|
85
|
+
if (localNode.value?.data) {
|
|
86
|
+
localNode.value.data[checkedField.value] = newValue;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Propaga para os filhos
|
|
90
|
+
if (localNode.value?.children?.length) {
|
|
91
|
+
toggleChildren(localNode.value.children, newValue);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function click(event: Event) {
|
|
96
|
+
if (props.disabled) return;
|
|
97
|
+
checkboxToggle();
|
|
98
|
+
emit('click', event);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
localNode,
|
|
103
|
+
checkedField,
|
|
104
|
+
childrenCheck,
|
|
105
|
+
isIndeterminate,
|
|
106
|
+
checkboxValue,
|
|
107
|
+
click,
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-checkbox
|
|
3
|
+
class="zd-tree-checkbox"
|
|
4
|
+
hide-details
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:ripple="false"
|
|
7
|
+
:model-value="(node.data ?? {})[checkedField]"
|
|
8
|
+
:on-icon="$getIcon('checkboxOn')"
|
|
9
|
+
:off-icon="$getIcon('checkboxOff')"
|
|
10
|
+
:indeterminate-icon="$getIcon('checkboxIndeterminate')"
|
|
11
|
+
:indeterminate="isIndeterminate"
|
|
12
|
+
@click="disabled || click($event)"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script lang="ts" src="./ZdTreeCheckbox.ts" />
|
|
17
|
+
|
|
18
|
+
<style lang="scss" >
|
|
19
|
+
@import 'sl-vue-tree-next/sl-vue-tree-next-minimal.css';
|
|
20
|
+
|
|
21
|
+
.zd-tree-checkbox {
|
|
22
|
+
display: flex !important;
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.zd-tree-checkbox .v-input--selection-controls__ripple {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.zd-tree-checkbox .v-label {
|
|
31
|
+
display: none !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
.zd-tree-checkbox .mdi-checkbox-marked {
|
|
36
|
+
color: rgba(0, 0, 0, .54) !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.zd-tree-checkbox .mdi-star {
|
|
40
|
+
color: rgba(0, 0, 0, .54) !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Column, GridColumn, IComponent, IComponentRender, TreeGrid } from '@zeedhi/common';
|
|
2
|
+
import { IDictionary } from '@zeedhi/core';
|
|
3
|
+
import { ComponentPublicInstance, PropType, UnwrapRef, computed, defineComponent } from 'vue';
|
|
4
|
+
import { buildProps } from '../../utils';
|
|
5
|
+
import { useCreateInstance } from '../zd-component/ZdComponent';
|
|
6
|
+
import { ZdGridProps, useGridInstance } from '../zd-grid/ZdGrid';
|
|
7
|
+
|
|
8
|
+
export type CalcWidth = (column: UnwrapRef<Column>) => string | undefined;
|
|
9
|
+
export type GetActions = ({ row, column }: { row: IDictionary; column: GridColumn }) => IComponent[];
|
|
10
|
+
export type GetConditionalProps = ({ row, column }: { row: IDictionary; column: Column }) => Partial<IComponentRender>;
|
|
11
|
+
|
|
12
|
+
export const ZdTreeGridProps = buildProps({
|
|
13
|
+
...ZdGridProps,
|
|
14
|
+
parentField: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '',
|
|
17
|
+
},
|
|
18
|
+
openLevelOnLoad: {
|
|
19
|
+
type: [String, Number, Boolean] as PropType<string | number | boolean>,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
fetchOnDemand: {
|
|
23
|
+
type: [String, Boolean] as PropType<string | boolean>,
|
|
24
|
+
default: true,
|
|
25
|
+
},
|
|
26
|
+
flat: {
|
|
27
|
+
type: [String, Boolean] as PropType<string | boolean>,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
detach: {
|
|
31
|
+
type: [String, Boolean] as PropType<boolean>,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
fieldHasChild: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: '',
|
|
37
|
+
},
|
|
38
|
+
footerSlot: {
|
|
39
|
+
type: Array,
|
|
40
|
+
default: () => [],
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const treeGridComponent = defineComponent({
|
|
45
|
+
props: ZdTreeGridProps,
|
|
46
|
+
inheritAttrs: false,
|
|
47
|
+
setup(props, ctx) {
|
|
48
|
+
const { instance, root } = useCreateInstance<TreeGrid, ComponentPublicInstance>(props, ctx, TreeGrid);
|
|
49
|
+
|
|
50
|
+
const gridScope = useGridInstance({ instance, root });
|
|
51
|
+
|
|
52
|
+
const cellClick = ({ row, column, event }: { row: IDictionary<any>; column: GridColumn; event: Event }) => {
|
|
53
|
+
instance.cellClick(row, column, event, gridScope.rootEl.value);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const rowClick = (row: IDictionary<any>, event: Event) => {
|
|
57
|
+
instance.rowClick(row, event, gridScope.rootEl.value);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const computedData = computed(() => {
|
|
61
|
+
return instance.treeDataStructure.searchHasNoData
|
|
62
|
+
? []
|
|
63
|
+
: instance.treeDataStructure.treeData || instance.getData();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const isOpened = (row: IDictionary) => {
|
|
67
|
+
return instance.treeDataStructure.isOpened(row);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const getKeysFrom = (data: IDictionary[]) => {
|
|
71
|
+
const { uniqueKey } = instance.datasource;
|
|
72
|
+
return data.map((toggledRow) => toggledRow[uniqueKey]);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Checks whether this row's selection state is indeterminate
|
|
77
|
+
* @param row
|
|
78
|
+
* @returns `true` if it is indeterminate
|
|
79
|
+
*/
|
|
80
|
+
const isIndeterminate = (row: IDictionary<any>) => {
|
|
81
|
+
const { uniqueKey } = instance.datasource;
|
|
82
|
+
|
|
83
|
+
const arrSelection = instance.selectAllPages ? instance.selectionState.except : instance.selectedRows;
|
|
84
|
+
|
|
85
|
+
const selectedKeys = getKeysFrom(arrSelection);
|
|
86
|
+
|
|
87
|
+
const childSelectionCount = (row.tree__children as any[])?.reduce((result, child) => {
|
|
88
|
+
const isSelected = instance.callDisableSelection(child) || selectedKeys.includes(child[uniqueKey]);
|
|
89
|
+
|
|
90
|
+
return isSelected ? result + 1 : result;
|
|
91
|
+
}, 0);
|
|
92
|
+
|
|
93
|
+
return childSelectionCount > 0 && childSelectionCount < row.tree__children.length;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const hasChildOnDemand = (row: IDictionary) => {
|
|
97
|
+
return instance.treeDataStructure.hasChildOnDemand(row);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const toggleExpand = (row: IDictionary, rowIndex: number, event?: PointerEvent) => {
|
|
101
|
+
event?.stopPropagation();
|
|
102
|
+
return instance.toggleExpand(row, rowIndex);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const isSelected = (item: IDictionary) => {
|
|
106
|
+
return !!gridScope.selectedRows.value.find(
|
|
107
|
+
(row) => row[instance.datasource.uniqueKey] === item.value[instance.datasource.uniqueKey],
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return {
|
|
112
|
+
...gridScope,
|
|
113
|
+
cellClick,
|
|
114
|
+
rowClick,
|
|
115
|
+
instance,
|
|
116
|
+
root,
|
|
117
|
+
computedData,
|
|
118
|
+
isOpened,
|
|
119
|
+
isIndeterminate,
|
|
120
|
+
hasChildOnDemand,
|
|
121
|
+
toggleExpand,
|
|
122
|
+
isSelected,
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export default treeGridComponent;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-data-table
|
|
3
|
+
v-show="instance.isVisible"
|
|
4
|
+
ref="root"
|
|
5
|
+
:id="instance.name"
|
|
6
|
+
v-model="selectedRows"
|
|
7
|
+
:class="[
|
|
8
|
+
'zd-grid',
|
|
9
|
+
instance.cssClass,
|
|
10
|
+
{
|
|
11
|
+
'zd-grid--loading': instance.datasource.loading,
|
|
12
|
+
},
|
|
13
|
+
]"
|
|
14
|
+
:style="[
|
|
15
|
+
cssColorVars,
|
|
16
|
+
{
|
|
17
|
+
height: $formatSize(instance.height),
|
|
18
|
+
width: $formatSize(instance.width),
|
|
19
|
+
maxHeight: $formatSize(instance.maxHeight),
|
|
20
|
+
minHeight: $formatSize(instance.minHeight),
|
|
21
|
+
maxWidth: $formatSize(instance.maxWidth),
|
|
22
|
+
minWidth: $formatSize(instance.minWidth),
|
|
23
|
+
},
|
|
24
|
+
$styleObject(instance.cssStyle),
|
|
25
|
+
]"
|
|
26
|
+
:theme="instance.theme"
|
|
27
|
+
sort-asc-icon="$collapse"
|
|
28
|
+
sort-desc-icon="$expand"
|
|
29
|
+
fixed-header
|
|
30
|
+
multi-sort
|
|
31
|
+
hide-default-footer
|
|
32
|
+
:name="instance.name"
|
|
33
|
+
:headers="headers"
|
|
34
|
+
:items="computedData"
|
|
35
|
+
:search="instance.datasource.search"
|
|
36
|
+
:density="instance.dense ? 'compact' : 'default'"
|
|
37
|
+
:loading="instance.datasource.loading"
|
|
38
|
+
:item-value="instance.datasource.uniqueKey"
|
|
39
|
+
:items-per-page="-1"
|
|
40
|
+
no-filter
|
|
41
|
+
:sort-by="sortBy"
|
|
42
|
+
disable-sort
|
|
43
|
+
return-object
|
|
44
|
+
tabindex="0"
|
|
45
|
+
@update:current-items="changeData()"
|
|
46
|
+
@update:sort-by="updateSortBy($event)"
|
|
47
|
+
>
|
|
48
|
+
<template v-slot:top>
|
|
49
|
+
<zd-grid-toolbar v-if="!hasToolbarSlot"></zd-grid-toolbar>
|
|
50
|
+
<slot name="toolbarSlot"></slot>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<template
|
|
54
|
+
v-slot:headers="{ columns: tableColumns, isSorted, getSortIcon, toggleSort, sortBy }"
|
|
55
|
+
>
|
|
56
|
+
<zd-grid-header-row
|
|
57
|
+
v-if="instance.showHeader"
|
|
58
|
+
:name="instance.name"
|
|
59
|
+
:selectable="instance.selectable"
|
|
60
|
+
:headerBackground="instance.headerBackground"
|
|
61
|
+
:showSelectAll="instance.showSelectAll"
|
|
62
|
+
:allselectedState="allselectedState"
|
|
63
|
+
:visibleColumns="visibleColumns"
|
|
64
|
+
:dragColumns="instance.dragColumns"
|
|
65
|
+
:headerCellTextColor="instance.headerCellTextColor"
|
|
66
|
+
:resizeColumns="instance.resizeColumns"
|
|
67
|
+
:getSortIcon="getSortIcon"
|
|
68
|
+
:toggleSort="toggleSort"
|
|
69
|
+
:sortBy="sortBy"
|
|
70
|
+
:tableColumns="tableColumns"
|
|
71
|
+
:isSorted="isSorted"
|
|
72
|
+
@resizeMousedown="resizeMouseDownHandler($event.column, $event.event)"
|
|
73
|
+
@resizeClick="resizeClickHandler($event.event)"
|
|
74
|
+
@selectAllClick="selectAllClick($event)"
|
|
75
|
+
></zd-grid-header-row>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<template
|
|
79
|
+
v-if="addTopPadding()"
|
|
80
|
+
v-slot:body.prepend="{ headers }"
|
|
81
|
+
>
|
|
82
|
+
<tr>
|
|
83
|
+
<td
|
|
84
|
+
:colspan="headers.length"
|
|
85
|
+
:style="`padding-top:${scrollData.startHeight}px`"
|
|
86
|
+
>
|
|
87
|
+
</td>
|
|
88
|
+
</tr>
|
|
89
|
+
</template>
|
|
90
|
+
|
|
91
|
+
<template
|
|
92
|
+
v-if="addBottomPadding()"
|
|
93
|
+
v-slot:body.append="{ headers }"
|
|
94
|
+
>
|
|
95
|
+
<tr>
|
|
96
|
+
<td
|
|
97
|
+
:colspan="headers.length"
|
|
98
|
+
:style="`padding-top:${scrollData.endHeight}px`"
|
|
99
|
+
>
|
|
100
|
+
</td>
|
|
101
|
+
</tr>
|
|
102
|
+
</template>
|
|
103
|
+
|
|
104
|
+
<template
|
|
105
|
+
v-if="instance.datasource.data.length"
|
|
106
|
+
v-slot:body="{ items, internalItems }"
|
|
107
|
+
>
|
|
108
|
+
<template v-for="(item, i) in items">
|
|
109
|
+
<zd-tree-grid-row
|
|
110
|
+
v-if="shouldRender(i)"
|
|
111
|
+
v-show="isOpened(item)"
|
|
112
|
+
:key="item.id"
|
|
113
|
+
:isSelected="isSelected(internalItems[i])"
|
|
114
|
+
:isCurrentRow="isCurrentRow(item)"
|
|
115
|
+
:selectable="instance.selectable"
|
|
116
|
+
:selectionDisabled="instance.callDisableSelection(item)"
|
|
117
|
+
:cellSelection="instance.cellSelection"
|
|
118
|
+
:isCurrent="isCurrent"
|
|
119
|
+
:columns="visibleColumns"
|
|
120
|
+
:row="item"
|
|
121
|
+
:fixedLeft="fixedLeft"
|
|
122
|
+
:fixedRight="fixedRight"
|
|
123
|
+
:indeterminate="isIndeterminate(item)"
|
|
124
|
+
:hasChildOnDemand="hasChildOnDemand(item)"
|
|
125
|
+
@cellFocus="cellFocus($event)"
|
|
126
|
+
@cellClick="cellClick($event)"
|
|
127
|
+
@click="rowClick(item, $event)"
|
|
128
|
+
@focusin="cellFocusIn($event)"
|
|
129
|
+
@checkboxClick="selectRowClick(item, !isSelected(internalItems[i]), $event)"
|
|
130
|
+
@expandIconClick="toggleExpand(item, i, $event)"
|
|
131
|
+
></zd-tree-grid-row>
|
|
132
|
+
</template>
|
|
133
|
+
</template>
|
|
134
|
+
|
|
135
|
+
<template v-slot:no-data>
|
|
136
|
+
<zd-iterable-no-data>
|
|
137
|
+
<template v-slot:errorSlot>
|
|
138
|
+
<slot name="errorSlot"></slot>
|
|
139
|
+
</template>
|
|
140
|
+
<template v-slot:noResultSlot>
|
|
141
|
+
<slot name="noResultSlot"></slot>
|
|
142
|
+
</template>
|
|
143
|
+
<template v-slot:noDataSlot>
|
|
144
|
+
<slot name="noDataSlot"></slot>
|
|
145
|
+
</template>
|
|
146
|
+
</zd-iterable-no-data>
|
|
147
|
+
</template>
|
|
148
|
+
|
|
149
|
+
<template v-slot:bottom>
|
|
150
|
+
<zd-grid-footer v-if="instance.showFooter && !hasFooterSlot"></zd-grid-footer>
|
|
151
|
+
<slot name="footerSlot"></slot>
|
|
152
|
+
</template>
|
|
153
|
+
</v-data-table>
|
|
154
|
+
</template>
|
|
155
|
+
|
|
156
|
+
<script lang="ts" src="./ZdTreeGrid.ts"></script>
|
|
157
|
+
|
|
158
|
+
<style lang="scss">
|
|
159
|
+
.zd-tree-grid {
|
|
160
|
+
.zd-table-cell-text-first {
|
|
161
|
+
display: inline-flex;
|
|
162
|
+
width: 100%;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&.theme--light {
|
|
166
|
+
tbody {
|
|
167
|
+
td {
|
|
168
|
+
&.zd-table-cell {
|
|
169
|
+
color: var(--zd-font-color);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
&.theme--dark {
|
|
175
|
+
tbody {
|
|
176
|
+
td {
|
|
177
|
+
&.zd-table-cell {
|
|
178
|
+
color: #fff;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
tbody {
|
|
184
|
+
td {
|
|
185
|
+
&.zd-table-cell {
|
|
186
|
+
&.first {
|
|
187
|
+
padding-left: 5px !important;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.zd-table-cell-text {
|
|
191
|
+
.search-result {
|
|
192
|
+
background: var(--v-grey-lighten4);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
</style>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Grid, GridColumn } from '@zeedhi/common';
|
|
2
|
+
import { IDictionary } from '@zeedhi/core';
|
|
3
|
+
import { PropType, computed, defineComponent, inject } from 'vue';
|
|
4
|
+
import { GetActions } from '../../zd-grid/ZdGrid';
|
|
5
|
+
|
|
6
|
+
export default defineComponent({
|
|
7
|
+
props: {
|
|
8
|
+
row: {
|
|
9
|
+
type: Object as PropType<IDictionary<any>>,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
column: {
|
|
13
|
+
type: Object as PropType<GridColumn>,
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
cssClass: {
|
|
17
|
+
type: Array as PropType<(IDictionary<boolean> | string)[]>,
|
|
18
|
+
default: () => [],
|
|
19
|
+
},
|
|
20
|
+
cssStyle: {
|
|
21
|
+
type: Array as PropType<IDictionary[]>,
|
|
22
|
+
default: () => [],
|
|
23
|
+
},
|
|
24
|
+
cellSelection: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
isCurrent: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
},
|
|
31
|
+
hasChildOnDemand: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
},
|
|
34
|
+
showExpandIcon: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
},
|
|
37
|
+
isFirstCell: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
emits: ['focusin', 'click', 'expandIconClick'],
|
|
42
|
+
setup(props, { emit }) {
|
|
43
|
+
const tabindex = computed(() => (props.cellSelection ? 0 : ''));
|
|
44
|
+
const getActions = inject<GetActions>('getActions');
|
|
45
|
+
const gridInstance = inject<Grid>('gridInstance');
|
|
46
|
+
|
|
47
|
+
if (!getActions || !gridInstance) {
|
|
48
|
+
throw new Error('gridInstance');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const conditionalProps = computed(() => {
|
|
52
|
+
const { row, column } = props;
|
|
53
|
+
return gridInstance.getConditionalProps({ row, column });
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const click = (event: Event) => {
|
|
57
|
+
emit('click', event);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const focusin = (event: Event) => {
|
|
61
|
+
emit('focusin', event);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const getMergedConditionals = (propName: keyof GridColumn) => {
|
|
65
|
+
return conditionalProps.value[propName] || props.column[propName];
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const expandIconClick = (event: Event) => {
|
|
69
|
+
emit('expandIconClick', event);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const highlightSearchResult = (text: string) => {
|
|
73
|
+
if (typeof text !== 'string') return text;
|
|
74
|
+
|
|
75
|
+
if (gridInstance.datasource.search) {
|
|
76
|
+
const reg = new RegExp(gridInstance.datasource.search, 'gi');
|
|
77
|
+
return text.replace(reg, (value) => `<span class="search-result">${value}</span>`);
|
|
78
|
+
}
|
|
79
|
+
return text;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
tabindex,
|
|
84
|
+
click,
|
|
85
|
+
focusin,
|
|
86
|
+
conditionalProps,
|
|
87
|
+
getActions,
|
|
88
|
+
getMergedConditionals,
|
|
89
|
+
expandIconClick,
|
|
90
|
+
highlightSearchResult,
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
});
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<td
|
|
3
|
+
:tabindex="tabindex"
|
|
4
|
+
:class="[
|
|
5
|
+
'zd-grid__cell', 'zd-tree-grid__cell', `text-${column.align}`,
|
|
6
|
+
getMergedConditionals('cssClass'),
|
|
7
|
+
{ 'zd-grid__cell--is-current': isCurrent },
|
|
8
|
+
...cssClass,
|
|
9
|
+
]"
|
|
10
|
+
:style="[
|
|
11
|
+
getMergedConditionals('style'),
|
|
12
|
+
getMergedConditionals('cssStyle'),
|
|
13
|
+
...cssStyle,
|
|
14
|
+
]"
|
|
15
|
+
@click="click"
|
|
16
|
+
@focusin="focusin($event)"
|
|
17
|
+
>
|
|
18
|
+
<template v-if="column.type !== 'action'">
|
|
19
|
+
<v-skeleton-loader v-if="column.loading" loading type="text"/>
|
|
20
|
+
<zd-grid-cell-content
|
|
21
|
+
v-show="!column.loading"
|
|
22
|
+
:column="column"
|
|
23
|
+
:row="row"
|
|
24
|
+
:value="row[column.name]"
|
|
25
|
+
:conditionalProps="conditionalProps"
|
|
26
|
+
>
|
|
27
|
+
<template #default="{ formattedValue }">
|
|
28
|
+
<div
|
|
29
|
+
:class="[
|
|
30
|
+
'zd-grid-cell-wrapper',
|
|
31
|
+
`zd-grid-cell-align-${column.align}`
|
|
32
|
+
]"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
:class="['zd-tree-grid-expand', `level${row.tree__level}`]"
|
|
36
|
+
v-if="showExpandIcon"
|
|
37
|
+
>
|
|
38
|
+
<v-icon
|
|
39
|
+
:class="{ 'opened': row.tree__opened }"
|
|
40
|
+
v-if="(row.tree__children || []).length > 0 && hasChildOnDemand"
|
|
41
|
+
tabindex="-1"
|
|
42
|
+
@click="expandIconClick($event)"
|
|
43
|
+
@mousedown.prevent.stop
|
|
44
|
+
>
|
|
45
|
+
{{ $getIcon('chevronRight') }}
|
|
46
|
+
</v-icon>
|
|
47
|
+
</div>
|
|
48
|
+
<div
|
|
49
|
+
:class="[
|
|
50
|
+
{
|
|
51
|
+
'zd-table-cell-text-first' : isFirstCell,
|
|
52
|
+
},
|
|
53
|
+
'zd-table-cell-text',
|
|
54
|
+
]"
|
|
55
|
+
:key="row.tree__searched ? 'a' : 'b'"
|
|
56
|
+
v-html="highlightSearchResult(formattedValue)"
|
|
57
|
+
></div>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
</zd-grid-cell-content>
|
|
61
|
+
</template>
|
|
62
|
+
<zd-grid-action
|
|
63
|
+
v-else
|
|
64
|
+
:actions="getActions({ row, column })"
|
|
65
|
+
></zd-grid-action>
|
|
66
|
+
</td>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script lang="ts" src="./ZdTreeGridCell.ts"></script>
|
|
70
|
+
|
|
71
|
+
<style lang="scss">
|
|
72
|
+
.zd-tree-grid__cell {
|
|
73
|
+
.search-result {
|
|
74
|
+
background: rgba(var(--v-theme-grey-lighten-4));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.zd-grid-cell-wrapper {
|
|
78
|
+
display: flex;
|
|
79
|
+
gap: .75rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.zd-grid-cell-align {
|
|
83
|
+
&-right {
|
|
84
|
+
justify-content: end;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&-left {
|
|
88
|
+
justify-content: start;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&-center {
|
|
92
|
+
justify-content: center;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.zd-tree-grid-expand {
|
|
97
|
+
text-align: end;
|
|
98
|
+
vertical-align: baseline;
|
|
99
|
+
height: 10px;
|
|
100
|
+
display: inline-block;
|
|
101
|
+
|
|
102
|
+
&.level1 {
|
|
103
|
+
width: 24px !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&-action {
|
|
107
|
+
height: 100%;
|
|
108
|
+
display: inline-grid;
|
|
109
|
+
justify-content: end;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.v-icon {
|
|
113
|
+
transition: transform 0.3s ease;
|
|
114
|
+
-webkit-transition: transform 0.3s ease;
|
|
115
|
+
font-size: 20px;
|
|
116
|
+
|
|
117
|
+
&::after {
|
|
118
|
+
content: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&.opened {
|
|
122
|
+
transform: rotate(90deg);
|
|
123
|
+
-webkit-transform: rotate(90deg);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
$levelPading: 20px;
|
|
128
|
+
@for $i from 1 through 10 {
|
|
129
|
+
&.level#{$i} { width: $i * $levelPading }
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
</style>
|