@zeedhi/vuetify 1.112.0 → 3.0.1
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,243 @@
|
|
|
1
|
+
import { IDynamicFilterItem, Input, Radio, Select } from '@zeedhi/common';
|
|
2
|
+
import { Config, IEventParam, Metadata, Utils, dayjs } from '@zeedhi/core';
|
|
3
|
+
import cloneDeep from 'lodash.clonedeep';
|
|
4
|
+
import debounce from 'lodash.debounce';
|
|
5
|
+
import { PropType, computed, defineComponent, reactive } from 'vue';
|
|
6
|
+
import { isArrayOperation } from '../../../utils';
|
|
7
|
+
|
|
8
|
+
export const TekGridColumnFilterProps = {
|
|
9
|
+
hasFilterData: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false,
|
|
12
|
+
},
|
|
13
|
+
column: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
modelValue: {
|
|
18
|
+
type: Array as PropType<IDynamicFilterItem[]>,
|
|
19
|
+
default: [],
|
|
20
|
+
},
|
|
21
|
+
instanceName: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
filterRelationsDatasource: {
|
|
26
|
+
type: [Object, null] as PropType<boolean | null>,
|
|
27
|
+
required: false,
|
|
28
|
+
},
|
|
29
|
+
filterOperationsDatasource: {
|
|
30
|
+
type: [Object, null] as PropType<boolean | null>,
|
|
31
|
+
required: false,
|
|
32
|
+
},
|
|
33
|
+
isHovering: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
multiple: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
} as const;
|
|
42
|
+
|
|
43
|
+
type InputType = Input | Select | Radio;
|
|
44
|
+
|
|
45
|
+
const tekGridColumnFilter = defineComponent({
|
|
46
|
+
props: TekGridColumnFilterProps,
|
|
47
|
+
inheritAttrs: false,
|
|
48
|
+
emits: ['update:modelValue'],
|
|
49
|
+
setup(props, ctx) {
|
|
50
|
+
const getValueInputName = (index: number) => `${props.instanceName}-${props.column.name}-filter-value-${index}`;
|
|
51
|
+
|
|
52
|
+
const focusValueInput = (index: number) => {
|
|
53
|
+
const valueInputName = getValueInputName(index);
|
|
54
|
+
const input = Metadata.getInstance<Input>(valueInputName);
|
|
55
|
+
|
|
56
|
+
input.setFocus();
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const createNewFilter = () => {
|
|
60
|
+
return reactive<IDynamicFilterItem>({
|
|
61
|
+
operation: 'CONTAINS',
|
|
62
|
+
relation: 'AND',
|
|
63
|
+
value: undefined,
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
let newFilter = createNewFilter();
|
|
68
|
+
|
|
69
|
+
const convertToDateFormat = (value: string, revert: boolean) => {
|
|
70
|
+
const dateFormat = props.column!.componentProps.dateFormat || Config.dateFormat;
|
|
71
|
+
const displayFormat = props.column!.componentProps.displayFormat || Config.displayFormat;
|
|
72
|
+
|
|
73
|
+
if (revert) {
|
|
74
|
+
if (dayjs(value, displayFormat).isValid() || !dayjs(value, dateFormat).isValid()) {
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
return dayjs(value, dateFormat).format(displayFormat);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (dayjs(value, dateFormat).isValid() || !dayjs(value, displayFormat).isValid()) {
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
return dayjs(value, displayFormat).format(dateFormat);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const checkDateValueFormat = (value: string | string[], revert = false) => {
|
|
87
|
+
if (!['ZdDate', 'ZdDateRange'].includes(props.column!.componentProps.component)) return value;
|
|
88
|
+
|
|
89
|
+
if (Array.isArray(value)) {
|
|
90
|
+
return value.map((item) => convertToDateFormat(item, revert));
|
|
91
|
+
}
|
|
92
|
+
return convertToDateFormat(value, revert);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// use WeakMap to avoid memory leaks
|
|
96
|
+
const idMap = new WeakMap<object, string>();
|
|
97
|
+
let idCounter = 0;
|
|
98
|
+
|
|
99
|
+
// retrieves a unique id for each item
|
|
100
|
+
const getId = (item: object) => {
|
|
101
|
+
if (!idMap.has(item)) {
|
|
102
|
+
idMap.set(item, `__item__${idCounter++}`);
|
|
103
|
+
}
|
|
104
|
+
return idMap.get(item)!;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// use computed to generate unique ids for each filter item
|
|
108
|
+
// this is needed for the v-for :key updates
|
|
109
|
+
const modelWithIds = computed(() => {
|
|
110
|
+
if (!props.multiple) {
|
|
111
|
+
if (props.modelValue.length > 0) {
|
|
112
|
+
return [{ id: getId(props.modelValue[0]), item: props.modelValue[0] }];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return [{ id: getId(newFilter), item: newFilter }];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return [...props.modelValue, newFilter].map((item) => ({
|
|
119
|
+
id: getId(item),
|
|
120
|
+
item,
|
|
121
|
+
}));
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const debounceUpdateModel = debounce((modelValue: IDynamicFilterItem[]) => {
|
|
125
|
+
if (Utils.isEqual(modelValue, props.modelValue)) return;
|
|
126
|
+
ctx.emit('update:modelValue', modelValue);
|
|
127
|
+
newFilter = createNewFilter();
|
|
128
|
+
}, 500);
|
|
129
|
+
|
|
130
|
+
const changeRelation = (index: number, { component }: IEventParam<InputType>) => {
|
|
131
|
+
const modelValue = cloneDeep(props.modelValue);
|
|
132
|
+
const isNewFilter = index === modelValue.length;
|
|
133
|
+
const filter = isNewFilter ? newFilter : modelValue[index];
|
|
134
|
+
const { value } = component;
|
|
135
|
+
|
|
136
|
+
focusValueInput(index);
|
|
137
|
+
|
|
138
|
+
// update item type value
|
|
139
|
+
filter.relation = value;
|
|
140
|
+
|
|
141
|
+
if (isNewFilter) return;
|
|
142
|
+
|
|
143
|
+
debounceUpdateModel(modelValue);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const changeOperation = (index: number, { component }: IEventParam<InputType>) => {
|
|
147
|
+
const modelValue = cloneDeep(props.modelValue);
|
|
148
|
+
const filterItem = modelValue[index];
|
|
149
|
+
const isNewFilter = index === modelValue.length;
|
|
150
|
+
const filter = isNewFilter ? newFilter : filterItem;
|
|
151
|
+
const { value } = component;
|
|
152
|
+
|
|
153
|
+
focusValueInput(index);
|
|
154
|
+
|
|
155
|
+
// if operation is IN, NOT_IN or BETWEEN, value should be an array
|
|
156
|
+
if (isArrayOperation(value)) {
|
|
157
|
+
filter.value = Array.isArray(filterItem.value) ? filterItem.value : [filterItem.value];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// update item type value
|
|
161
|
+
filter.operation = value;
|
|
162
|
+
|
|
163
|
+
if (isNewFilter) return;
|
|
164
|
+
|
|
165
|
+
debounceUpdateModel(modelValue);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const changeValue = (item: IDynamicFilterItem, index: number, { component }: IEventParam<InputType>) => {
|
|
169
|
+
const modelValue = cloneDeep(props.modelValue);
|
|
170
|
+
const filter = cloneDeep(item);
|
|
171
|
+
const { value } = component;
|
|
172
|
+
const isNewFilter = props.multiple && index === modelValue.length;
|
|
173
|
+
let formattedValue = value;
|
|
174
|
+
|
|
175
|
+
if (value && isArrayOperation(filter.operation)) {
|
|
176
|
+
formattedValue = value.split(';');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
filter.value = checkDateValueFormat(formattedValue);
|
|
180
|
+
|
|
181
|
+
if (!props.multiple) {
|
|
182
|
+
debounceUpdateModel([filter]);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (isNewFilter) {
|
|
187
|
+
// only emit event when newFilter has value
|
|
188
|
+
if (!filter.value) return;
|
|
189
|
+
|
|
190
|
+
debounceUpdateModel([...modelValue, filter]);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (!filter.value) {
|
|
195
|
+
// when removing the last (not new) filter, should pass its operation and relation to the new filter
|
|
196
|
+
if (index === modelValue.length - 1) {
|
|
197
|
+
newFilter.operation = filter.operation;
|
|
198
|
+
newFilter.relation = filter.relation;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
modelValue.splice(index, 1);
|
|
202
|
+
|
|
203
|
+
// if the removed filter was the first, should set the new first relation to AND
|
|
204
|
+
if (modelValue.length > 0 && index === 0) {
|
|
205
|
+
modelValue[0].relation = 'AND';
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// if the removed filter was the last, should set the newFilter relation to AND
|
|
209
|
+
if (modelValue.length === 0) {
|
|
210
|
+
newFilter.relation = 'AND';
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
debounceUpdateModel(modelValue);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
const getComponentType = (operation: string) => {
|
|
218
|
+
return isArrayOperation(operation) ? 'ZdTextInput' : props.column.componentProps.component;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const getComponentHint = (operation: string) => {
|
|
222
|
+
return isArrayOperation(operation) ? 'TEKGRID_MULTIPLE_VALUE_HINT' : '';
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const getItemValue = (item: IDynamicFilterItem) => {
|
|
226
|
+
return isArrayOperation(item.operation) ? item.value.join(';') : item.value;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
return {
|
|
230
|
+
changeValue,
|
|
231
|
+
changeRelation,
|
|
232
|
+
changeOperation,
|
|
233
|
+
getValueInputName,
|
|
234
|
+
newFilter,
|
|
235
|
+
getComponentType,
|
|
236
|
+
getComponentHint,
|
|
237
|
+
modelWithIds,
|
|
238
|
+
getItemValue,
|
|
239
|
+
};
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
export default tekGridColumnFilter;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-menu
|
|
3
|
+
offset-overflow
|
|
4
|
+
offset-y
|
|
5
|
+
transition="scale-transition"
|
|
6
|
+
content-class="tek-grid-column-filter__menu"
|
|
7
|
+
:close-on-content-click="false"
|
|
8
|
+
>
|
|
9
|
+
<template #activator="{ props }">
|
|
10
|
+
<zd-grid-header-icon
|
|
11
|
+
v-bind="props"
|
|
12
|
+
:icon="$getIcon('filter')"
|
|
13
|
+
:hidden="!isHovering && !hasFilterData"
|
|
14
|
+
:color="hasFilterData ? 'primary' : ''"
|
|
15
|
+
></zd-grid-header-icon>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<v-card
|
|
19
|
+
class="zd-pa-4 zd-pb-0"
|
|
20
|
+
:min-width="200"
|
|
21
|
+
:max-height="300"
|
|
22
|
+
>
|
|
23
|
+
<template
|
|
24
|
+
v-for="({ item, id }, filterIndex) in modelWithIds"
|
|
25
|
+
:key="id"
|
|
26
|
+
>
|
|
27
|
+
<!-- relation -->
|
|
28
|
+
<zd-radio
|
|
29
|
+
v-if="multiple && filterIndex > 0"
|
|
30
|
+
:name="`${instanceName}-${column.name}-filter-relation-${filterIndex}`"
|
|
31
|
+
v-bind="{
|
|
32
|
+
showLabel: false,
|
|
33
|
+
showHelper: false,
|
|
34
|
+
vertical: false,
|
|
35
|
+
cssClass: 'zd-mb-2',
|
|
36
|
+
datasource: filterRelationsDatasource,
|
|
37
|
+
dataValue: 'value',
|
|
38
|
+
dataLabel: 'text',
|
|
39
|
+
value: item.relation,
|
|
40
|
+
events: {
|
|
41
|
+
change: (params) => changeRelation(filterIndex, params),
|
|
42
|
+
},
|
|
43
|
+
}"
|
|
44
|
+
/>
|
|
45
|
+
|
|
46
|
+
<!-- operation -->
|
|
47
|
+
<zd-select
|
|
48
|
+
v-if="multiple && item.operation"
|
|
49
|
+
:name="`${instanceName}-${column.name}-filter-operation-${filterIndex}`"
|
|
50
|
+
v-bind="{
|
|
51
|
+
autocomplete: false,
|
|
52
|
+
showLabel: false,
|
|
53
|
+
showHelper: false,
|
|
54
|
+
clearable: false,
|
|
55
|
+
cssClass: 'zd-mb-2',
|
|
56
|
+
datasource: filterOperationsDatasource,
|
|
57
|
+
dataValue: 'value',
|
|
58
|
+
dataText: 'text',
|
|
59
|
+
value: item.operation,
|
|
60
|
+
events: {
|
|
61
|
+
change: (params) => changeOperation(filterIndex, params),
|
|
62
|
+
},
|
|
63
|
+
}"
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
<!-- value -->
|
|
67
|
+
<component
|
|
68
|
+
:name="`${instanceName}-${column.name}-filter-value-${filterIndex}`"
|
|
69
|
+
:is="getComponentType(item.operation)"
|
|
70
|
+
v-bind="{
|
|
71
|
+
...column.componentProps,
|
|
72
|
+
showLabel: false,
|
|
73
|
+
showHelper: true,
|
|
74
|
+
autofill: false,
|
|
75
|
+
cssClass: 'zd-mb-2',
|
|
76
|
+
value: getItemValue(item),
|
|
77
|
+
persistentHint: true,
|
|
78
|
+
hint: getComponentHint(item.operation),
|
|
79
|
+
events: {
|
|
80
|
+
input: (params) => changeValue(item, filterIndex, params),
|
|
81
|
+
change: (params) => changeValue(item, filterIndex, params),
|
|
82
|
+
},
|
|
83
|
+
}"
|
|
84
|
+
/>
|
|
85
|
+
</template>
|
|
86
|
+
</v-card>
|
|
87
|
+
</v-menu>
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<script lang="ts" src="./TekGridColumnFilter.ts"></script>
|
|
91
|
+
|
|
92
|
+
<style lang="scss">
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Column, GridColumn, IDynamicFilterItem, TekGridColumn } from '@zeedhi/common';
|
|
2
|
+
import { IDictionary } from '@zeedhi/core';
|
|
3
|
+
import { PropType, UnwrapRef, defineComponent, inject } from 'vue';
|
|
4
|
+
import { ResizeParams } from '../../../composables/columnResize';
|
|
5
|
+
import { CalcWidth } from '../../zd-grid/ZdGrid';
|
|
6
|
+
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
props: {
|
|
9
|
+
selectable: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false,
|
|
12
|
+
},
|
|
13
|
+
headerBackground: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: '',
|
|
16
|
+
},
|
|
17
|
+
showSelectAll: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
allselectedState: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 0,
|
|
24
|
+
},
|
|
25
|
+
visibleColumns: {
|
|
26
|
+
type: Array as PropType<GridColumn[]>,
|
|
27
|
+
default: () => [],
|
|
28
|
+
},
|
|
29
|
+
dragColumns: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
33
|
+
headerCellTextColor: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: '',
|
|
36
|
+
},
|
|
37
|
+
resizeColumns: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
getSortIcon: {
|
|
42
|
+
type: Function,
|
|
43
|
+
default: () => {},
|
|
44
|
+
},
|
|
45
|
+
isSorted: {
|
|
46
|
+
type: Function,
|
|
47
|
+
default: () => {},
|
|
48
|
+
},
|
|
49
|
+
toggleSort: {
|
|
50
|
+
type: Function,
|
|
51
|
+
default: () => {},
|
|
52
|
+
},
|
|
53
|
+
tableColumns: {
|
|
54
|
+
type: Array as PropType<any[]>,
|
|
55
|
+
default: () => [],
|
|
56
|
+
},
|
|
57
|
+
sortBy: {
|
|
58
|
+
type: Array as PropType<any[]>,
|
|
59
|
+
default: () => [],
|
|
60
|
+
},
|
|
61
|
+
disableCheckbox: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false,
|
|
64
|
+
},
|
|
65
|
+
sortable: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: true,
|
|
68
|
+
},
|
|
69
|
+
name: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: '',
|
|
72
|
+
},
|
|
73
|
+
modelValue: {
|
|
74
|
+
type: Object as PropType<IDictionary<IDynamicFilterItem[]>>,
|
|
75
|
+
default: () => [],
|
|
76
|
+
},
|
|
77
|
+
instanceName: {
|
|
78
|
+
type: String,
|
|
79
|
+
required: true,
|
|
80
|
+
},
|
|
81
|
+
filterRelationsDatasource: {
|
|
82
|
+
type: [Object, null],
|
|
83
|
+
required: false,
|
|
84
|
+
},
|
|
85
|
+
filterOperationsDatasource: {
|
|
86
|
+
type: [Object, null],
|
|
87
|
+
required: false,
|
|
88
|
+
},
|
|
89
|
+
columnFilterButton: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
required: true,
|
|
92
|
+
},
|
|
93
|
+
columnHasFilter: {
|
|
94
|
+
type: Function as PropType<(columnName: string) => boolean>,
|
|
95
|
+
required: true,
|
|
96
|
+
},
|
|
97
|
+
level: {
|
|
98
|
+
type: Number,
|
|
99
|
+
default: 0,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
emits: ['selectAllClick', 'resizeMousedown', 'resizeClick', 'update:modelValue'],
|
|
103
|
+
setup(props, { emit }) {
|
|
104
|
+
const calcWidth = inject<CalcWidth>('calcWidth');
|
|
105
|
+
|
|
106
|
+
if (!calcWidth) {
|
|
107
|
+
// TODO: use NotProvidedError
|
|
108
|
+
throw new Error('calcWidth');
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const selectAllClick = (event: Event) => {
|
|
112
|
+
emit('selectAllClick', event);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const resizeMousedown = (column: GridColumn, event: ResizeParams) => {
|
|
116
|
+
emit('resizeMousedown', { event, column });
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const resizeClick = (event: Event) => {
|
|
120
|
+
emit('resizeClick', { event });
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const findOrderIndex = (sortBy: readonly any[], column: UnwrapRef<Column>) => {
|
|
124
|
+
return sortBy.findIndex((sort) => sort.key === column.name);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const updateModelValue = (columnName: string, value: IDynamicFilterItem[]) => {
|
|
128
|
+
const modelValue = { ...props.modelValue };
|
|
129
|
+
modelValue[columnName] = value;
|
|
130
|
+
emit('update:modelValue', modelValue);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const showFilterButton = (column: TekGridColumn) => {
|
|
134
|
+
return column.type !== 'action' && props.columnFilterButton && column.filterable;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
calcWidth,
|
|
139
|
+
resizeMousedown,
|
|
140
|
+
resizeClick,
|
|
141
|
+
findOrderIndex,
|
|
142
|
+
updateModelValue,
|
|
143
|
+
showFilterButton,
|
|
144
|
+
selectAllClick,
|
|
145
|
+
};
|
|
146
|
+
},
|
|
147
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<zd-grid-header-row
|
|
3
|
+
:name="name"
|
|
4
|
+
:selectable="selectable"
|
|
5
|
+
:headerBackground="headerBackground"
|
|
6
|
+
:showSelectAll="showSelectAll"
|
|
7
|
+
:allselectedState="allselectedState"
|
|
8
|
+
:visibleColumns="visibleColumns"
|
|
9
|
+
:dragColumns="dragColumns"
|
|
10
|
+
:headerCellTextColor="headerCellTextColor"
|
|
11
|
+
:resizeColumns="resizeColumns"
|
|
12
|
+
:getSortIcon="getSortIcon"
|
|
13
|
+
:toggleSort="toggleSort"
|
|
14
|
+
:sortBy="sortBy"
|
|
15
|
+
:tableColumns="tableColumns"
|
|
16
|
+
:isSorted="isSorted"
|
|
17
|
+
:disableCheckbox="disableCheckbox"
|
|
18
|
+
@selectAllClick="selectAllClick"
|
|
19
|
+
>
|
|
20
|
+
<template #default="{ column, index, isHovering }">
|
|
21
|
+
<zd-grid-column-header
|
|
22
|
+
:cssStyle="{
|
|
23
|
+
'color': headerCellTextColor,
|
|
24
|
+
width: calcWidth(column),
|
|
25
|
+
}"
|
|
26
|
+
:action="column.type === 'action'"
|
|
27
|
+
:overflow="column.overflow"
|
|
28
|
+
:helperText="column.helperText"
|
|
29
|
+
:label="column.label"
|
|
30
|
+
:columnAlign="column.align"
|
|
31
|
+
:orderIndex="findOrderIndex(sortBy, column)"
|
|
32
|
+
:isSortable="sortable && column.sortable"
|
|
33
|
+
:resizeColumns="resizeColumns"
|
|
34
|
+
:sortIcon="getSortIcon(tableColumns[index])"
|
|
35
|
+
:isSorted="isSorted(tableColumns[index])"
|
|
36
|
+
:isHovering="isHovering"
|
|
37
|
+
@click="toggleSort(tableColumns[index])"
|
|
38
|
+
@resizeMousedown="resizeMousedown(column, $event)"
|
|
39
|
+
@resizeClick="resizeClick($event)"
|
|
40
|
+
>
|
|
41
|
+
<template #prepend v-if="index === 0">
|
|
42
|
+
<tek-grid-indentation
|
|
43
|
+
:level="level"
|
|
44
|
+
:show-divider="false"
|
|
45
|
+
></tek-grid-indentation>
|
|
46
|
+
</template>
|
|
47
|
+
<template #label>
|
|
48
|
+
<span
|
|
49
|
+
v-if="column.aggregation"
|
|
50
|
+
class="tek-grid-column-aggregation"
|
|
51
|
+
>({{ $t(`TEKGRID_AGGREGATION_${column.aggregation}`) }})
|
|
52
|
+
</span>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<template
|
|
56
|
+
#append="{ isHovering }"
|
|
57
|
+
v-if="showFilterButton(column)"
|
|
58
|
+
>
|
|
59
|
+
<tek-grid-column-filter
|
|
60
|
+
:modelValue="modelValue[column.name]"
|
|
61
|
+
:hasFilterData="columnHasFilter(column.name)"
|
|
62
|
+
:column="column"
|
|
63
|
+
:instanceName="instanceName"
|
|
64
|
+
:filterRelationsDatasource="filterRelationsDatasource"
|
|
65
|
+
:filterOperationsDatasource="filterOperationsDatasource"
|
|
66
|
+
:isHovering="isHovering"
|
|
67
|
+
:multiple="!!filterRelationsDatasource && !!filterOperationsDatasource"
|
|
68
|
+
@update:modelValue="updateModelValue(column.name, $event)"
|
|
69
|
+
></tek-grid-column-filter>
|
|
70
|
+
</template>
|
|
71
|
+
</zd-grid-column-header>
|
|
72
|
+
</template>
|
|
73
|
+
</zd-grid-header-row>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<script lang="ts" src="./TekGridHeaderRow.ts"></script>
|
|
77
|
+
|
|
78
|
+
<style lang="scss"></style>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { TekGrid, TekGridColumnsButton } from '@zeedhi/common';
|
|
2
|
+
import sortable from 'sortablejs';
|
|
3
|
+
import { ComponentPublicInstance, computed, defineComponent, mergeProps, nextTick, ref, watch } from 'vue';
|
|
4
|
+
import { useButtonInstance, useCreateInstance } from '../..';
|
|
5
|
+
import { ZdIterableColumnsButtonProps } from '../../zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton';
|
|
6
|
+
import optionsModal from './TekGridColumnsOptionsModal';
|
|
7
|
+
|
|
8
|
+
export const TekGridColumnsButtonProps = {
|
|
9
|
+
...ZdIterableColumnsButtonProps,
|
|
10
|
+
hideGroups: {
|
|
11
|
+
type: [Boolean, String],
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const tekGridColumnsButton = defineComponent({
|
|
17
|
+
props: TekGridColumnsButtonProps,
|
|
18
|
+
inheritAttrs: false,
|
|
19
|
+
setup(props, ctx) {
|
|
20
|
+
const { instance, root } = useCreateInstance<TekGridColumnsButton, ComponentPublicInstance>(
|
|
21
|
+
props,
|
|
22
|
+
ctx,
|
|
23
|
+
TekGridColumnsButton,
|
|
24
|
+
);
|
|
25
|
+
const buttonScope = useButtonInstance({ instance, root });
|
|
26
|
+
|
|
27
|
+
const menuIsOpened = ref(false);
|
|
28
|
+
|
|
29
|
+
const sortableInitialized = ref(false);
|
|
30
|
+
|
|
31
|
+
const teste = (a: any) => {
|
|
32
|
+
console.warn(a);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
watch(menuIsOpened, () => {
|
|
36
|
+
if (!menuIsOpened.value || sortableInitialized.value) return;
|
|
37
|
+
|
|
38
|
+
sortableInitialized.value = true;
|
|
39
|
+
nextTick(() => {
|
|
40
|
+
const columnsTableBody = document.querySelector(`#${instance.name}_columns_table tbody`);
|
|
41
|
+
if (columnsTableBody) {
|
|
42
|
+
sortable.create(columnsTableBody as HTMLElement, {
|
|
43
|
+
handle: '.sortHandle',
|
|
44
|
+
dragClass: 'tek-grid-columns-button-sortable-drag',
|
|
45
|
+
onEnd: sortEnd,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const gridGroupColumnNames = computed(() => {
|
|
52
|
+
return instance.iterableComponent.columns.filter((column) => column.grouped).map((column) => column.name) || [];
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const sortEnd = (event: any) => {
|
|
56
|
+
const grid: TekGrid = instance.iterableComponent as any;
|
|
57
|
+
const newOrder = Array.from(event.srcElement.querySelectorAll('tr')).map((row: any) => row.getAttribute('name'));
|
|
58
|
+
const groupColumnNames: string[] = [];
|
|
59
|
+
const newColumns = newOrder.map((columnName) => {
|
|
60
|
+
const column = grid.getColumn(columnName);
|
|
61
|
+
if (column.grouped) {
|
|
62
|
+
groupColumnNames.push(columnName);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return column;
|
|
66
|
+
});
|
|
67
|
+
const ignoredColumns = grid.columns.filter((column) => instance.ignoreColumns.indexOf(column.name) !== -1);
|
|
68
|
+
grid.columns = newColumns.concat(ignoredColumns);
|
|
69
|
+
|
|
70
|
+
if (grid.updateGrouping && JSON.stringify(groupColumnNames) !== JSON.stringify(gridGroupColumnNames)) {
|
|
71
|
+
grid.updateGrouping();
|
|
72
|
+
}
|
|
73
|
+
grid.changeLayout();
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const moreOptions = () => {
|
|
77
|
+
optionsModal.show(instance);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const close = () => {
|
|
81
|
+
menuIsOpened.value = false;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return {
|
|
85
|
+
...buttonScope,
|
|
86
|
+
instance,
|
|
87
|
+
root,
|
|
88
|
+
menuIsOpened,
|
|
89
|
+
moreOptions,
|
|
90
|
+
close,
|
|
91
|
+
teste,
|
|
92
|
+
mergeProps,
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export default tekGridColumnsButton;
|