@zeedhi/vuetify 3.0.6 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.js +275 -0
- package/dist/components/tek-grid/TekGrid.js +287 -0
- package/dist/components/tek-grid/column-filter/TekGridColumnFilter.js +201 -0
- package/dist/components/tek-grid/column-header/TekGridHeaderRow.js +134 -0
- package/dist/components/tek-grid/columns-button/TekGridColumnsButton.js +79 -0
- package/dist/components/tek-grid/columns-button/TekGridColumnsOptionsController.js +416 -0
- package/dist/components/tek-grid/columns-button/TekGridColumnsOptionsModal.js +501 -0
- package/dist/components/tek-grid/filter-button/TekGridFilterButton.js +36 -0
- package/dist/components/tek-grid/indentation/TekGridIndentation.js +20 -0
- package/dist/components/tek-grid/layout-options/TekGridLayoutOptions.js +101 -0
- package/dist/components/tek-grid/row/TekGridFooterRow.js +57 -0
- package/dist/components/tek-grid/row/TekGridGroupRow.js +58 -0
- package/dist/components/tooltip-overflow/ZdTooltipOverflow.js +56 -0
- package/dist/components/zd-activator-wrapper/ZdActivatorWrapper.js +33 -0
- package/dist/components/zd-alert/ZdAlert.js +112 -0
- package/dist/components/zd-badge/ZdBadge.js +28 -0
- package/dist/components/zd-breadcrumbs/ZdBreadcrumbs.js +55 -0
- package/dist/components/zd-button/ZdButton.js +230 -0
- package/dist/components/zd-button-group/ZdButtonGroup.js +110 -0
- package/dist/components/zd-card/ZdCard.js +132 -0
- package/dist/components/zd-carousel/ZdCarousel.js +242 -0
- package/dist/components/zd-checkbox/ZdCheckbox.js +35 -0
- package/dist/components/zd-checkbox-multiple/ZdCheckboxMultiple.js +62 -0
- package/dist/components/zd-chip/ZdChip.js +94 -0
- package/dist/components/zd-code-viewer/ZdCodeViewer.js +55 -0
- package/dist/components/zd-code-viewer/prism.js +14 -0
- package/dist/components/zd-col/ZdCol.js +45 -0
- package/dist/components/zd-collapse-card/ZdCollapseCard.js +85 -0
- package/dist/components/zd-component/ZdComponent.js +259 -0
- package/dist/components/zd-component/ZdComponentRender.js +14 -0
- package/dist/components/zd-container/ZdContainer.js +42 -0
- package/dist/components/zd-currency/ZdCurrency.js +24 -0
- package/dist/components/zd-date-input/ZdDateInput.js +247 -0
- package/dist/components/zd-date-range/ZdDateRange.js +251 -0
- package/dist/components/zd-dialog/ZdDialog.js +34 -0
- package/dist/components/zd-divider/ZdDivider.js +28 -0
- package/dist/components/zd-dropdown/ZdDropdown.js +93 -0
- package/dist/components/zd-footer/ZdFooter.js +77 -0
- package/dist/components/zd-form/ZdForm.js +85 -0
- package/dist/components/zd-frame/ZdFrame.js +76 -0
- package/dist/components/zd-frame-page/ZdFramePage.js +21 -0
- package/dist/components/zd-grid/ZdGrid.js +284 -0
- package/dist/components/zd-grid/cell/ZdGridAction.js +12 -0
- package/dist/components/zd-grid/cell/ZdGridCell.js +59 -0
- package/dist/components/zd-grid/cell/ZdGridCellContent.js +59 -0
- package/dist/components/zd-grid/cell/ZdGridCheckbox.js +38 -0
- package/dist/components/zd-grid/column-header/ZdGridColumnHeader.js +70 -0
- package/dist/components/zd-grid/column-header/ZdGridHeaderIcon.js +31 -0
- package/dist/components/zd-grid/column-header/ZdGridHeaderRow.js +102 -0
- package/dist/components/zd-grid/column-header/ZdGridSort.js +32 -0
- package/dist/components/zd-grid/composables/grid-instance.js +12 -0
- package/dist/components/zd-grid/footer/ZdGridFooter.js +16 -0
- package/dist/components/zd-grid/helper/ZdGridHelper.js +12 -0
- package/dist/components/zd-grid/row/TableRow.js +25 -0
- package/dist/components/zd-grid/row/ZdGridRow.js +70 -0
- package/dist/components/zd-grid/toolbar/ZdGridToolbar.js +15 -0
- package/dist/components/zd-grid-editable/ZdGridEditable.js +174 -0
- package/dist/components/zd-grid-editable/cell/ZdGridEditableCell.js +135 -0
- package/dist/components/zd-grid-editable/row/ZdGridEditableRow.js +99 -0
- package/dist/components/zd-header/ZdHeader.js +111 -0
- package/dist/components/zd-icon/ZdIcon.js +63 -0
- package/dist/components/zd-image/ZdImage.js +48 -0
- package/dist/components/zd-increment/ZdIncrement.js +38 -0
- package/dist/components/zd-input/ZdInput.js +164 -0
- package/dist/components/zd-iterable/ZdIterable.js +38 -0
- package/dist/components/zd-iterable/ZdIterableNoData.js +20 -0
- package/dist/components/zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton.js +50 -0
- package/dist/components/zd-iterable/zd-iterable-page-info/ZdIterablePageInfo.js +21 -0
- package/dist/components/zd-iterable/zd-iterable-page-size/ZdIterablePageSize.js +55 -0
- package/dist/components/zd-iterable/zd-iterable-pagination/ZdIterablePagination.js +36 -0
- package/dist/components/zd-iterable/zd-search/ZdSearch.js +42 -0
- package/dist/components/zd-iterable-component-render/ZdIterableComponentRender.js +108 -0
- package/dist/components/zd-layout/ZdLayout.js +41 -0
- package/dist/components/zd-list/ZdList.js +84 -0
- package/dist/components/zd-list/ZdListGroup.js +38 -0
- package/dist/components/zd-list/ZdListItem.js +66 -0
- package/dist/components/zd-loading/ZdLoading.js +61 -0
- package/dist/components/zd-login/ZdLogin.js +68 -0
- package/dist/components/zd-login/ZdLoginButton.js +28 -0
- package/dist/components/zd-main/ZdMain.js +33 -0
- package/dist/components/zd-master-detail/ZdMasterDetail.js +48 -0
- package/dist/components/zd-menu/ZdMenu.js +302 -0
- package/dist/components/zd-menu/ZdMenuButton.js +42 -0
- package/dist/components/zd-menu/ZdMenuGroup.js +66 -0
- package/dist/components/zd-menu/ZdMenuLink.js +63 -0
- package/dist/components/zd-menu/ZdMenuSeparator.js +26 -0
- package/dist/components/zd-modal/ZdModal.js +123 -0
- package/dist/components/zd-modal/ZdModalCloseButton.js +36 -0
- package/dist/components/zd-month/ZdMonth.js +31 -0
- package/dist/components/zd-number-input/ZdNumberInput.js +84 -0
- package/dist/components/zd-password/ZdPassword.js +23 -0
- package/dist/components/zd-progress/ZdProgress.js +52 -0
- package/dist/components/zd-radio/ZdRadio.js +56 -0
- package/dist/components/zd-row/ZdRow.js +43 -0
- package/dist/components/zd-select/ZdSelect.js +191 -0
- package/dist/components/zd-select-multiple/ZdSelectMultiple.js +326 -0
- package/dist/components/zd-svg-map/ZdSvgMap.js +211 -0
- package/dist/components/zd-switch/ZdSwitch.js +39 -0
- package/dist/components/zd-table/ZdTable.js +42 -0
- package/dist/components/zd-tabs/ZdTab.js +92 -0
- package/dist/components/zd-tabs/ZdTabItem.js +17 -0
- package/dist/components/zd-tabs/ZdTabs.js +84 -0
- package/dist/components/zd-tag/ZdTag.js +34 -0
- package/dist/components/zd-text/ZdText.js +35 -0
- package/dist/components/zd-text-input/ZdTextInput.js +174 -0
- package/dist/components/zd-textarea/ZdTextarea.js +76 -0
- package/dist/components/zd-time/ZdTime.js +159 -0
- package/dist/components/zd-toggleable/ZdToggleable.js +13 -0
- package/dist/components/zd-tooltip/ZdTooltip.js +92 -0
- package/dist/components/zd-tree/ZdTree.js +315 -0
- package/dist/components/zd-tree/ZdTreeAfterTitle.js +17 -0
- package/dist/components/zd-tree/ZdTreeCheckbox.js +97 -0
- package/dist/components/zd-tree-grid/ZdTreeGrid.js +101 -0
- package/dist/components/zd-tree-grid/cell/ZdTreeGridCell.js +81 -0
- package/dist/components/zd-tree-grid/row/ZdTreeGridRow.js +85 -0
- package/dist/composables/cellSelection.js +37 -0
- package/dist/composables/columnDrag.js +82 -0
- package/dist/composables/columnResize.js +115 -0
- package/dist/composables/density.js +13 -0
- package/dist/composables/doubleClick.js +32 -0
- package/dist/composables/fixedColumns.js +106 -0
- package/dist/composables/gridColorVars.js +30 -0
- package/dist/composables/gridColumns.js +87 -0
- package/dist/composables/gridSelection.js +91 -0
- package/dist/composables/gridSorting.js +19 -0
- package/dist/composables/hasSlot.js +25 -0
- package/dist/composables/index.js +16 -0
- package/dist/composables/maska.js +36 -0
- package/dist/composables/tableNavigation.js +126 -0
- package/dist/composables/useIsMobile.js +8 -0
- package/dist/composables/useTableLayout.js +212 -0
- package/dist/composables/virtualScroll.js +92 -0
- package/dist/composables/watchUrl.js +14 -0
- package/dist/errors/index.js +3 -0
- package/dist/errors/not-provided.js +11 -0
- package/dist/errors/row-not-found.js +9 -0
- package/dist/errors/zeedhi-error.js +8 -0
- package/dist/index.js +49 -0
- package/dist/propsMixins/heightProps.js +17 -0
- package/dist/propsMixins/index.js +3 -0
- package/dist/propsMixins/interfaces.js +1 -0
- package/dist/propsMixins/widthProps.js +13 -0
- package/dist/utils/buildProps.js +3 -0
- package/dist/utils/fillHeight.js +18 -0
- package/dist/utils/icons/icons.js +28 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/isArrayOperation.js +4 -0
- package/dist/utils/logger/logger.js +7 -0
- package/dist/utils/mergeDictionaries.js +22 -0
- package/dist/utils/plugins/formatSizePlugin.js +6 -0
- package/dist/utils/plugins/getIconPlugin.js +11 -0
- package/dist/utils/plugins/index.js +4 -0
- package/dist/utils/plugins/styleObjectPlugin.js +13 -0
- package/dist/zd-vuetify.css +22578 -22810
- package/dist/zd-vuetify.js +9696 -13977
- package/package.json +8 -6
- package/src/components/index.ts +0 -27
- package/src/components/zd-date-input/ZdDateInput.ts +11 -9
- package/src/components/zd-date-input/ZdDateInput.vue +42 -46
- package/src/components/zd-date-range/ZdDateRange.ts +24 -23
- package/src/components/zd-date-range/ZdDateRange.vue +42 -54
- package/src/components/zd-month/ZdMonth.ts +0 -17
- package/src/components/zd-month/ZdMonth.vue +0 -1
- package/src/components/zd-text-input/ZdTextInput.ts +4 -0
- package/src/components/zd-text-input/ZdTextInput.vue +1 -0
- package/src/components/zd-time/ZdTime.ts +11 -50
- package/src/components/zd-time/ZdTime.vue +41 -29
- package/src/composables/index.ts +1 -1
- package/src/composables/useIsMobile.ts +9 -0
- package/src/errors/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/utils/index.ts +0 -1
- package/types/components/index.d.ts +80 -88
- package/types/components/tek-grid/TekGrid.d.ts +7258 -7258
- package/types/components/tek-grid/column-filter/TekGridColumnFilter.d.ts +129 -129
- package/types/components/tek-grid/column-header/TekGridHeaderRow.d.ts +225 -225
- package/types/components/tek-grid/columns-button/TekGridColumnsButton.d.ts +2432 -2432
- package/types/components/tek-grid/columns-button/TekGridColumnsOptionsController.d.ts +65 -65
- package/types/components/tek-grid/columns-button/TekGridColumnsOptionsModal.d.ts +9 -9
- package/types/components/tek-grid/filter-button/TekGridFilterButton.d.ts +2920 -2920
- package/types/components/tek-grid/indentation/TekGridIndentation.d.ts +32 -32
- package/types/components/tek-grid/layout-options/TekGridLayoutOptions.d.ts +1892 -1892
- package/types/components/tek-grid/row/TekGridFooterRow.d.ts +90 -90
- package/types/components/tek-grid/row/TekGridGroupRow.d.ts +87 -87
- package/types/components/tooltip-overflow/ZdTooltipOverflow.d.ts +50 -50
- package/types/components/zd-activator-wrapper/ZdActivatorWrapper.d.ts +25 -25
- package/types/components/zd-alert/ZdAlert.d.ts +884 -884
- package/types/components/zd-badge/ZdBadge.d.ts +624 -624
- package/types/components/zd-breadcrumbs/ZdBreadcrumbs.d.ts +697 -697
- package/types/components/zd-button/ZdButton.d.ts +1158 -1158
- package/types/components/zd-button-group/ZdButtonGroup.d.ts +785 -785
- package/types/components/zd-card/ZdCard.d.ts +1028 -1028
- package/types/components/zd-carousel/ZdCarousel.d.ts +2007 -2007
- package/types/components/zd-checkbox/ZdCheckbox.d.ts +655 -642
- package/types/components/zd-checkbox-multiple/ZdCheckboxMultiple.d.ts +2040 -2010
- package/types/components/zd-chip/ZdChip.d.ts +1256 -1256
- package/types/components/zd-code-viewer/ZdCodeViewer.d.ts +791 -791
- package/types/components/zd-code-viewer/prism.d.ts +14 -14
- package/types/components/zd-col/ZdCol.d.ts +741 -741
- package/types/components/zd-collapse-card/ZdCollapseCard.d.ts +1583 -1583
- package/types/components/zd-component/ZdComponent.d.ts +104 -104
- package/types/components/zd-component/ZdComponentRender.d.ts +80 -80
- package/types/components/zd-container/ZdContainer.d.ts +722 -722
- package/types/components/zd-currency/ZdCurrency.d.ts +2068 -2024
- package/types/components/zd-date-input/ZdDateInput.d.ts +986 -960
- package/types/components/zd-date-range/ZdDateRange.d.ts +2305 -0
- package/types/components/zd-dialog/ZdDialog.d.ts +262 -262
- package/types/components/zd-divider/ZdDivider.d.ts +623 -623
- package/types/components/zd-dropdown/ZdDropdown.d.ts +836 -836
- package/types/components/zd-footer/ZdFooter.d.ts +1262 -1262
- package/types/components/zd-form/ZdForm.d.ts +118 -118
- package/types/components/zd-frame/ZdFrame.d.ts +138 -138
- package/types/components/zd-frame-page/ZdFramePage.d.ts +805 -805
- package/types/components/zd-grid/ZdGrid.d.ts +7304 -7304
- package/types/components/zd-grid/cell/ZdGridAction.d.ts +14 -14
- package/types/components/zd-grid/cell/ZdGridCell.d.ts +68 -68
- package/types/components/zd-grid/cell/ZdGridCellContent.d.ts +58 -58
- package/types/components/zd-grid/cell/ZdGridCheckbox.d.ts +53 -53
- package/types/components/zd-grid/column-header/ZdGridColumnHeader.d.ts +112 -112
- package/types/components/zd-grid/column-header/ZdGridHeaderIcon.d.ts +46 -46
- package/types/components/zd-grid/column-header/ZdGridHeaderRow.d.ts +165 -165
- package/types/components/zd-grid/column-header/ZdGridSort.d.ts +47 -47
- package/types/components/zd-grid/composables/grid-instance.d.ts +2085 -2085
- package/types/components/zd-grid/footer/ZdGridFooter.d.ts +2087 -2087
- package/types/components/zd-grid/helper/ZdGridHelper.d.ts +16 -16
- package/types/components/zd-grid/row/TableRow.d.ts +34 -34
- package/types/components/zd-grid/row/ZdGridRow.d.ts +105 -105
- package/types/components/zd-grid/toolbar/ZdGridToolbar.d.ts +2086 -2086
- package/types/components/zd-grid-editable/ZdGridEditable.d.ts +8663 -8663
- package/types/components/zd-grid-editable/cell/ZdGridEditableCell.d.ts +637 -637
- package/types/components/zd-grid-editable/row/ZdGridEditableRow.d.ts +126 -126
- package/types/components/zd-header/ZdHeader.d.ts +1320 -1320
- package/types/components/zd-icon/ZdIcon.d.ts +383 -383
- package/types/components/zd-image/ZdImage.d.ts +753 -753
- package/types/components/zd-increment/ZdIncrement.d.ts +2113 -2069
- package/types/components/zd-input/ZdInput.d.ts +204 -200
- package/types/components/zd-iterable/ZdIterable.d.ts +130 -130
- package/types/components/zd-iterable/ZdIterableNoData.d.ts +2089 -2089
- package/types/components/zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton.d.ts +1645 -1645
- package/types/components/zd-iterable/zd-iterable-page-info/ZdIterablePageInfo.d.ts +1081 -1081
- package/types/components/zd-iterable/zd-iterable-page-size/ZdIterablePageSize.d.ts +2807 -2763
- package/types/components/zd-iterable/zd-iterable-pagination/ZdIterablePagination.d.ts +1653 -1627
- package/types/components/zd-iterable/zd-search/ZdSearch.d.ts +792 -766
- package/types/components/zd-iterable-component-render/ZdIterableComponentRender.d.ts +2484 -2484
- package/types/components/zd-layout/ZdLayout.d.ts +647 -647
- package/types/components/zd-list/ZdList.d.ts +1140 -1140
- package/types/components/zd-list/ZdListGroup.d.ts +1332 -1332
- package/types/components/zd-list/ZdListItem.d.ts +848 -848
- package/types/components/zd-loading/ZdLoading.d.ts +350 -350
- package/types/components/zd-login/ZdLogin.d.ts +1072 -1072
- package/types/components/zd-login/ZdLoginButton.d.ts +1913 -1910
- package/types/components/zd-main/ZdMain.d.ts +619 -619
- package/types/components/zd-master-detail/ZdMasterDetail.d.ts +684 -684
- package/types/components/zd-menu/ZdMenu.d.ts +4484 -4484
- package/types/components/zd-menu/ZdMenuButton.d.ts +1142 -1142
- package/types/components/zd-menu/ZdMenuGroup.d.ts +6286 -6286
- package/types/components/zd-menu/ZdMenuLink.d.ts +10437 -10437
- package/types/components/zd-menu/ZdMenuSeparator.d.ts +600 -600
- package/types/components/zd-modal/ZdModal.d.ts +10 -10
- package/types/components/zd-modal/ZdModalCloseButton.d.ts +1137 -1137
- package/types/components/zd-month/ZdMonth.d.ts +2260 -2217
- package/types/components/zd-number-input/ZdNumberInput.d.ts +2065 -2021
- package/types/components/zd-password/ZdPassword.d.ts +2058 -2014
- package/types/components/zd-progress/ZdProgress.d.ts +859 -859
- package/types/components/zd-radio/ZdRadio.d.ts +695 -682
- package/types/components/zd-row/ZdRow.d.ts +734 -734
- package/types/components/zd-select/ZdSelect.d.ts +321 -313
- package/types/components/zd-select-multiple/ZdSelectMultiple.d.ts +341 -333
- package/types/components/zd-svg-map/ZdSvgMap.d.ts +414 -414
- package/types/components/zd-switch/ZdSwitch.d.ts +1948 -1918
- package/types/components/zd-table/ZdTable.d.ts +1092 -1092
- package/types/components/zd-tabs/ZdTab.d.ts +674 -674
- package/types/components/zd-tabs/ZdTabItem.d.ts +268 -268
- package/types/components/zd-tabs/ZdTabs.d.ts +929 -929
- package/types/components/zd-tag/ZdTag.d.ts +613 -613
- package/types/components/zd-text/ZdText.d.ts +670 -670
- package/types/components/zd-text-input/ZdTextInput.d.ts +772 -746
- package/types/components/zd-textarea/ZdTextarea.d.ts +903 -877
- package/types/components/zd-time/ZdTime.d.ts +2271 -2224
- package/types/components/zd-toggleable/ZdToggleable.d.ts +203 -199
- package/types/components/zd-tooltip/ZdTooltip.d.ts +781 -781
- package/types/components/zd-tree/ZdTree.d.ts +1879 -1878
- package/types/components/zd-tree/ZdTreeAfterTitle.d.ts +28 -26
- package/types/components/zd-tree/ZdTreeCheckbox.d.ts +74 -74
- package/types/components/zd-tree-grid/ZdTreeGrid.d.ts +4178 -4178
- package/types/components/zd-tree-grid/cell/ZdTreeGridCell.d.ts +92 -92
- package/types/components/zd-tree-grid/row/ZdTreeGridRow.d.ts +124 -124
- package/types/composables/cellSelection.d.ts +281 -281
- package/types/composables/columnDrag.d.ts +9 -9
- package/types/composables/columnResize.d.ts +18 -18
- package/types/composables/density.d.ts +12 -12
- package/types/composables/doubleClick.d.ts +6 -6
- package/types/composables/fixedColumns.d.ts +14 -14
- package/types/composables/gridColorVars.d.ts +13 -13
- package/types/composables/gridColumns.d.ts +285 -285
- package/types/composables/gridSelection.d.ts +15 -15
- package/types/composables/gridSorting.d.ts +17 -17
- package/types/composables/hasSlot.d.ts +8 -8
- package/types/composables/index.d.ts +16 -16
- package/types/composables/maska.d.ts +16 -16
- package/types/composables/tableNavigation.d.ts +11 -11
- package/types/composables/useIsMobile.d.ts +3 -0
- package/types/composables/useTableLayout.d.ts +25 -25
- package/types/composables/virtualScroll.d.ts +26 -26
- package/types/composables/watchUrl.d.ts +8 -8
- package/types/errors/index.d.ts +3 -2
- package/types/errors/not-provided.d.ts +7 -7
- package/types/errors/row-not-found.d.ts +7 -7
- package/types/errors/zeedhi-error.d.ts +6 -6
- package/types/index.d.ts +22 -21
- package/types/propsMixins/heightProps.d.ts +17 -17
- package/types/propsMixins/index.d.ts +5 -5
- package/types/propsMixins/interfaces.d.ts +2 -2
- package/types/propsMixins/widthProps.d.ts +13 -13
- package/types/utils/buildProps.d.ts +2 -2
- package/types/utils/fillHeight.d.ts +1 -1
- package/types/utils/icons/icons.d.ts +5 -5
- package/types/utils/index.d.ts +6 -7
- package/types/utils/isArrayOperation.d.ts +2 -2
- package/types/utils/logger/logger.d.ts +3 -3
- package/types/utils/mergeDictionaries.d.ts +3 -3
- package/types/utils/plugins/formatSizePlugin.d.ts +1 -1
- package/types/utils/plugins/getIconPlugin.d.ts +1 -1
- package/types/utils/plugins/index.d.ts +4 -4
- package/types/utils/plugins/styleObjectPlugin.d.ts +1 -1
- package/.package.json +0 -52
- package/rollup.config.prod.js +0 -26
- package/rollup.scss.config.js +0 -13
- package/src/components/tek-grid/TekGrid.ts +0 -320
- package/src/components/tek-grid/TekGrid.vue +0 -235
- package/src/components/tek-grid/column-filter/TekGridColumnFilter.ts +0 -243
- package/src/components/tek-grid/column-filter/TekGridColumnFilter.vue +0 -93
- package/src/components/tek-grid/column-header/TekGridHeaderRow.ts +0 -147
- package/src/components/tek-grid/column-header/TekGridHeaderRow.vue +0 -78
- package/src/components/tek-grid/columns-button/TekGridColumnsButton.ts +0 -97
- package/src/components/tek-grid/columns-button/TekGridColumnsButton.vue +0 -273
- package/src/components/tek-grid/columns-button/TekGridColumnsOptionsController.ts +0 -469
- package/src/components/tek-grid/columns-button/TekGridColumnsOptionsModal.ts +0 -512
- package/src/components/tek-grid/filter-button/TekGridFilterButton.ts +0 -46
- package/src/components/tek-grid/filter-button/TekGridFilterButton.vue +0 -28
- package/src/components/tek-grid/indentation/TekGridIndentation.ts +0 -21
- package/src/components/tek-grid/indentation/TekGridIndentation.vue +0 -33
- package/src/components/tek-grid/layout-options/TekGridLayoutOptions.ts +0 -117
- package/src/components/tek-grid/layout-options/TekGridLayoutOptions.vue +0 -172
- package/src/components/tek-grid/row/TekGridFooterRow.ts +0 -62
- package/src/components/tek-grid/row/TekGridFooterRow.vue +0 -64
- package/src/components/tek-grid/row/TekGridGroupRow.ts +0 -65
- package/src/components/tek-grid/row/TekGridGroupRow.vue +0 -65
- package/src/composables/useTableLayout.ts +0 -293
- package/src/utils/isArrayOperation.ts +0 -5
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { SelectMultiple } from '@zeedhi/common';
|
|
2
|
+
import { FormatterParserProvider } from '@zeedhi/core';
|
|
3
|
+
import { computed, defineComponent, nextTick, onMounted, onUnmounted, ref } from 'vue';
|
|
4
|
+
import { buildProps } from '../../utils';
|
|
5
|
+
import { getRootElement } from '../zd-component/ZdComponent';
|
|
6
|
+
import { useCreateInputInstance } from '../zd-input/ZdInput';
|
|
7
|
+
import { ZdSelectProps, useSelect } from '../zd-select/ZdSelect';
|
|
8
|
+
/**
|
|
9
|
+
* Select Multiple component
|
|
10
|
+
*/
|
|
11
|
+
export const ZdSelectMultipleProps = buildProps({
|
|
12
|
+
...ZdSelectProps,
|
|
13
|
+
value: {
|
|
14
|
+
type: [Array, String],
|
|
15
|
+
default: () => [],
|
|
16
|
+
},
|
|
17
|
+
showSelectAll: {
|
|
18
|
+
type: [Boolean, String],
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
maxRows: {
|
|
22
|
+
type: [String, Number],
|
|
23
|
+
default: null,
|
|
24
|
+
},
|
|
25
|
+
limit: {
|
|
26
|
+
type: [String, Number],
|
|
27
|
+
default: null,
|
|
28
|
+
},
|
|
29
|
+
showCheckboxAll: {
|
|
30
|
+
type: [String, Boolean],
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
33
|
+
checkboxAll: {
|
|
34
|
+
type: [String, Boolean],
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const selectMultipleComponent = defineComponent({
|
|
39
|
+
props: ZdSelectMultipleProps,
|
|
40
|
+
inheritAttrs: false,
|
|
41
|
+
setup(props, ctx) {
|
|
42
|
+
const { instance, root } = useCreateInputInstance(props, ctx, SelectMultiple);
|
|
43
|
+
const selectScope = useSelect(instance, ctx, root);
|
|
44
|
+
const element = ref();
|
|
45
|
+
const checkboxItem = ref([]);
|
|
46
|
+
let initialHeight;
|
|
47
|
+
const expandedMode = ref(false);
|
|
48
|
+
let rows = 1;
|
|
49
|
+
const lastDisplayedChip = ref(0);
|
|
50
|
+
const hasHiddenRows = ref(false);
|
|
51
|
+
const maxRowsNumber = () => {
|
|
52
|
+
return Number(instance.maxRows || Infinity);
|
|
53
|
+
};
|
|
54
|
+
const selectItem = (item) => {
|
|
55
|
+
return checkboxItem.value.includes(item);
|
|
56
|
+
};
|
|
57
|
+
const toggleItem = (item) => {
|
|
58
|
+
const index = checkboxItem.value.indexOf(item.value);
|
|
59
|
+
if (index === -1) {
|
|
60
|
+
checkboxItem.value.push(item.value);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
checkboxItem.value.splice(index, 1);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const formattedValue = computed({
|
|
67
|
+
get() {
|
|
68
|
+
return instance.formatter(instance.selectValue);
|
|
69
|
+
},
|
|
70
|
+
set(value) {
|
|
71
|
+
instance.selectValue = value.map((row) => row.originalRow);
|
|
72
|
+
instance.updateSelectValue(instance.selectValue);
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
const formattedData = computed(() => {
|
|
76
|
+
const formatted = instance.formatter(instance.datasource.data);
|
|
77
|
+
const { disabledItems } = instance;
|
|
78
|
+
if (disabledItems.length === 0)
|
|
79
|
+
return formatted;
|
|
80
|
+
const disabledValues = disabledItems.map((item) => {
|
|
81
|
+
if (item && typeof item === 'object') {
|
|
82
|
+
return item[instance.dataValue];
|
|
83
|
+
}
|
|
84
|
+
return item;
|
|
85
|
+
});
|
|
86
|
+
const disabledKey = instance.dataDisabled || 'disabled';
|
|
87
|
+
return formatted.map((item) => ({
|
|
88
|
+
...item,
|
|
89
|
+
[disabledKey]: disabledValues.includes(item.value),
|
|
90
|
+
}));
|
|
91
|
+
});
|
|
92
|
+
const ajustSize = () => {
|
|
93
|
+
if (instance.dense) {
|
|
94
|
+
return 'x-small';
|
|
95
|
+
}
|
|
96
|
+
return 'small';
|
|
97
|
+
};
|
|
98
|
+
const disabledLength = computed(() => {
|
|
99
|
+
return formattedData.value.filter((item) => item.disabled).length;
|
|
100
|
+
});
|
|
101
|
+
const allSelected = computed(() => {
|
|
102
|
+
const dataLength = formattedValue.value.length - instance.insertedValues.length;
|
|
103
|
+
return dataLength && dataLength === instance.datasource.total - disabledLength.value;
|
|
104
|
+
});
|
|
105
|
+
const limitValue = computed(() => {
|
|
106
|
+
return instance.isFocused ? instance.limit || Infinity : 1;
|
|
107
|
+
});
|
|
108
|
+
const moreItemsText = computed(() => {
|
|
109
|
+
const selectedLength = formattedValue.value.length;
|
|
110
|
+
let moreChip = 0;
|
|
111
|
+
if (instance.limit) {
|
|
112
|
+
moreChip = selectedLength - limitValue.value;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
moreChip = selectedLength - lastDisplayedChip.value - 1;
|
|
116
|
+
}
|
|
117
|
+
return instance.getMoreChipText(moreChip);
|
|
118
|
+
});
|
|
119
|
+
const getMarginX = (element) => {
|
|
120
|
+
const cs = getComputedStyle(element);
|
|
121
|
+
return parseFloat(cs.marginLeft) + parseFloat(cs.marginRight);
|
|
122
|
+
};
|
|
123
|
+
const getPaddingX = (element) => {
|
|
124
|
+
const cs = getComputedStyle(element);
|
|
125
|
+
return parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);
|
|
126
|
+
};
|
|
127
|
+
const getChips = () => {
|
|
128
|
+
const rootValue = getRootElement(root);
|
|
129
|
+
const chips = rootValue.value?.getElementsByClassName('v-chip');
|
|
130
|
+
const chipContainers = Array.from(chips).map((chip) => chip.parentElement);
|
|
131
|
+
return chipContainers;
|
|
132
|
+
};
|
|
133
|
+
const onSelectAll = (event) => {
|
|
134
|
+
const rootValue = getRootElement(root);
|
|
135
|
+
const input = rootValue.value?.querySelector('input');
|
|
136
|
+
input?.select();
|
|
137
|
+
nextTick(() => {
|
|
138
|
+
instance.onSelectAll(!allSelected.value, event, instance.value);
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
const checkOverflow = () => {
|
|
142
|
+
const chips = getChips();
|
|
143
|
+
if (chips.length > 0) {
|
|
144
|
+
const firstChip = chips[0];
|
|
145
|
+
if (firstChip.clientWidth < firstChip.scrollWidth) {
|
|
146
|
+
lastDisplayedChip.value = -1;
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
};
|
|
152
|
+
const calcDisplay = (force = false) => {
|
|
153
|
+
const chips = getChips();
|
|
154
|
+
const element = getRootElement(root);
|
|
155
|
+
if (chips.length === 0)
|
|
156
|
+
return;
|
|
157
|
+
if (element.value.offsetHeight > initialHeight || force) {
|
|
158
|
+
instance.datasource.loading = true;
|
|
159
|
+
lastDisplayedChip.value = getLastChipIndex(chips);
|
|
160
|
+
instance.datasource.loading = false;
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
lastDisplayedChip.value = instance.value?.length || 0;
|
|
164
|
+
};
|
|
165
|
+
const getLastChipIndex = (chips) => {
|
|
166
|
+
let lastIndex = -1;
|
|
167
|
+
let filledWidth = 0;
|
|
168
|
+
const firstChip = chips[0];
|
|
169
|
+
let baseTop = firstChip.offsetTop;
|
|
170
|
+
const marginX = getMarginX(firstChip);
|
|
171
|
+
const rootElement = getRootElement(root);
|
|
172
|
+
const inputArea = rootElement.value?.querySelector('.v-field__input');
|
|
173
|
+
if (!inputArea)
|
|
174
|
+
return 0;
|
|
175
|
+
let inputWidth = inputArea.offsetWidth;
|
|
176
|
+
inputWidth -= getPaddingX(inputArea);
|
|
177
|
+
let rowCount = 1;
|
|
178
|
+
hasHiddenRows.value = chips.some((chip, index) => {
|
|
179
|
+
if (chip.offsetTop === baseTop) {
|
|
180
|
+
const chipWidth = chip.offsetWidth + marginX;
|
|
181
|
+
filledWidth += chipWidth;
|
|
182
|
+
if (filledWidth <= inputWidth - 66) {
|
|
183
|
+
lastIndex = index;
|
|
184
|
+
}
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
rowCount += 1;
|
|
188
|
+
if (rowCount <= rows) {
|
|
189
|
+
baseTop = chip.offsetTop;
|
|
190
|
+
filledWidth = chip.offsetWidth + marginX;
|
|
191
|
+
lastIndex = index;
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
return true;
|
|
195
|
+
});
|
|
196
|
+
if (!hasHiddenRows.value) {
|
|
197
|
+
const length = instance.value?.length || 0;
|
|
198
|
+
lastIndex = length - 1;
|
|
199
|
+
}
|
|
200
|
+
return lastIndex;
|
|
201
|
+
};
|
|
202
|
+
const refreshDisplay = () => {
|
|
203
|
+
if (instance.limit)
|
|
204
|
+
return;
|
|
205
|
+
expandedMode.value = true;
|
|
206
|
+
nextTick(() => {
|
|
207
|
+
expandedMode.value = false;
|
|
208
|
+
if (!checkOverflow()) {
|
|
209
|
+
calcDisplay(true);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
const isMoreVisible = (index) => {
|
|
214
|
+
if (instance.limit) {
|
|
215
|
+
return index === limitValue.value;
|
|
216
|
+
}
|
|
217
|
+
return !expandedMode.value && hasHiddenRows.value && index === lastDisplayedChip.value + 1;
|
|
218
|
+
};
|
|
219
|
+
const onLoadMoreIntersect = (isIntersecting, entries) => {
|
|
220
|
+
const { intersectionRatio } = entries[0];
|
|
221
|
+
if (intersectionRatio === 1 || !isIntersecting || instance.datasource.loading)
|
|
222
|
+
return;
|
|
223
|
+
instance.loadMore();
|
|
224
|
+
};
|
|
225
|
+
const isChipVisible = (index) => {
|
|
226
|
+
if (instance.limit) {
|
|
227
|
+
return index < limitValue.value;
|
|
228
|
+
}
|
|
229
|
+
return expandedMode.value || !hasHiddenRows.value || index <= lastDisplayedChip.value;
|
|
230
|
+
};
|
|
231
|
+
const handleResize = () => {
|
|
232
|
+
refreshDisplay();
|
|
233
|
+
};
|
|
234
|
+
const selectClick = (event) => {
|
|
235
|
+
const input = getRootElement(root);
|
|
236
|
+
if (!instance.limit) {
|
|
237
|
+
rows = maxRowsNumber();
|
|
238
|
+
nextTick(() => {
|
|
239
|
+
calcDisplay(true);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
instance.click(event, input.value);
|
|
243
|
+
};
|
|
244
|
+
const focus = (event) => {
|
|
245
|
+
rows = maxRowsNumber();
|
|
246
|
+
refreshDisplay();
|
|
247
|
+
selectScope.focus(event);
|
|
248
|
+
};
|
|
249
|
+
const selectBlur = (event) => {
|
|
250
|
+
if (!instance.limit && rows !== 1) {
|
|
251
|
+
rows = 1;
|
|
252
|
+
calcDisplay();
|
|
253
|
+
nextTick(() => checkOverflow());
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
refreshDisplay();
|
|
257
|
+
}
|
|
258
|
+
selectScope.blur(event);
|
|
259
|
+
};
|
|
260
|
+
const selectFormatterFn = FormatterParserProvider.getFormatter('ZdSelect');
|
|
261
|
+
const formattedDataDiscreteText = (item) => {
|
|
262
|
+
let formatterProps;
|
|
263
|
+
if (instance.dataTextDiscrete) {
|
|
264
|
+
formatterProps = {
|
|
265
|
+
dataText: instance.dataTextDiscrete,
|
|
266
|
+
dataTextSeparator: instance.dataTextSeparator,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
formatterProps = {
|
|
271
|
+
dataText: instance.dataText,
|
|
272
|
+
dataTextSeparator: instance.dataTextSeparator,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
return selectFormatterFn(item, formatterProps);
|
|
276
|
+
};
|
|
277
|
+
const removeItem = (item) => {
|
|
278
|
+
const rootValue = root.value;
|
|
279
|
+
rootValue.select(item.value, false);
|
|
280
|
+
};
|
|
281
|
+
const selectChange = (value, event) => {
|
|
282
|
+
const input = getRootElement(root);
|
|
283
|
+
instance.selectChange(value.map((item) => item.originalRow), event, input.value);
|
|
284
|
+
};
|
|
285
|
+
let observer;
|
|
286
|
+
onMounted(() => {
|
|
287
|
+
const componentRef = getRootElement(root);
|
|
288
|
+
element.value = componentRef.value;
|
|
289
|
+
observer = new ResizeObserver(handleResize);
|
|
290
|
+
observer.observe(element.value);
|
|
291
|
+
if (!element)
|
|
292
|
+
return;
|
|
293
|
+
initialHeight = element.value.offsetHeight;
|
|
294
|
+
});
|
|
295
|
+
onUnmounted(() => {
|
|
296
|
+
observer?.disconnect();
|
|
297
|
+
});
|
|
298
|
+
return {
|
|
299
|
+
...selectScope,
|
|
300
|
+
instance,
|
|
301
|
+
root,
|
|
302
|
+
moreItemsText,
|
|
303
|
+
formattedData,
|
|
304
|
+
allSelected,
|
|
305
|
+
formattedValue,
|
|
306
|
+
limitValue,
|
|
307
|
+
onSelectAll,
|
|
308
|
+
calcDisplay,
|
|
309
|
+
getLastChipIndex,
|
|
310
|
+
refreshDisplay,
|
|
311
|
+
isMoreVisible,
|
|
312
|
+
isChipVisible,
|
|
313
|
+
removeItem,
|
|
314
|
+
selectClick,
|
|
315
|
+
selectBlur,
|
|
316
|
+
selectChange,
|
|
317
|
+
formattedDataDiscreteText,
|
|
318
|
+
ajustSize,
|
|
319
|
+
onLoadMoreIntersect,
|
|
320
|
+
selectItem,
|
|
321
|
+
toggleItem,
|
|
322
|
+
focus,
|
|
323
|
+
};
|
|
324
|
+
},
|
|
325
|
+
});
|
|
326
|
+
export default selectMultipleComponent;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { SvgMap } from '@zeedhi/common';
|
|
2
|
+
import { computed, defineComponent, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
|
|
3
|
+
import { useTheme } from 'vuetify';
|
|
4
|
+
import { buildProps } from '../../utils';
|
|
5
|
+
import { useGetMethods } from '../zd-component/ZdComponent';
|
|
6
|
+
import { ZdComponentRenderProps } from '../zd-component/ZdComponentRender';
|
|
7
|
+
import { useCreateInputInstance } from '../zd-input/ZdInput';
|
|
8
|
+
export const ZdSvgMapProps = buildProps({
|
|
9
|
+
...ZdComponentRenderProps,
|
|
10
|
+
areaColor: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '#bdbdbd',
|
|
13
|
+
},
|
|
14
|
+
areaHoverColor: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '#999',
|
|
17
|
+
},
|
|
18
|
+
areaSelectColor: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'primary',
|
|
21
|
+
},
|
|
22
|
+
height: {
|
|
23
|
+
type: [Number, String],
|
|
24
|
+
default: 'auto',
|
|
25
|
+
},
|
|
26
|
+
width: {
|
|
27
|
+
type: [Number, String],
|
|
28
|
+
default: 'auto',
|
|
29
|
+
},
|
|
30
|
+
multiple: {
|
|
31
|
+
type: [Boolean, String],
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
selectedArea: {
|
|
35
|
+
type: [String, Array],
|
|
36
|
+
default: '',
|
|
37
|
+
},
|
|
38
|
+
src: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '',
|
|
41
|
+
},
|
|
42
|
+
tooltipData: {
|
|
43
|
+
type: [Object, String],
|
|
44
|
+
default: null,
|
|
45
|
+
},
|
|
46
|
+
keyColumn: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: '',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
export default defineComponent({
|
|
52
|
+
props: ZdSvgMapProps,
|
|
53
|
+
inheritAttrs: false,
|
|
54
|
+
setup(props, ctx) {
|
|
55
|
+
const container = ref(null);
|
|
56
|
+
const { instance, root } = useCreateInputInstance(props, ctx, SvgMap);
|
|
57
|
+
const componentScope = useGetMethods(instance, root);
|
|
58
|
+
const theme = useTheme();
|
|
59
|
+
const showTooltip = ref(false);
|
|
60
|
+
const pathId = ref(null);
|
|
61
|
+
const cursor = reactive({
|
|
62
|
+
left: 0,
|
|
63
|
+
top: 0,
|
|
64
|
+
reverseX: false,
|
|
65
|
+
reverseY: false,
|
|
66
|
+
right: 0,
|
|
67
|
+
bottom: 0,
|
|
68
|
+
});
|
|
69
|
+
function ThemeColor(color = '') {
|
|
70
|
+
if (!color)
|
|
71
|
+
return '';
|
|
72
|
+
if (color[0] === '#')
|
|
73
|
+
return color;
|
|
74
|
+
const parts = color.split(' ');
|
|
75
|
+
let themeColors;
|
|
76
|
+
let idx;
|
|
77
|
+
idx = parts.indexOf('light');
|
|
78
|
+
if (idx !== -1) {
|
|
79
|
+
themeColors = theme.themes.value.light.colors;
|
|
80
|
+
parts.splice(idx, 1);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
idx = parts.indexOf('dark');
|
|
84
|
+
if (idx !== -1) {
|
|
85
|
+
themeColors = theme.themes.value.dark.colors;
|
|
86
|
+
parts.splice(idx, 1);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
themeColors = theme.current.value.colors;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return themeColors[parts[0]] || parts[0];
|
|
93
|
+
}
|
|
94
|
+
const cssVars = computed(() => ({
|
|
95
|
+
'--area-color': ThemeColor(instance.areaColor),
|
|
96
|
+
'--area-hover-color': ThemeColor(instance.areaHoverColor),
|
|
97
|
+
'--area-select-color': ThemeColor(instance.areaSelectColor),
|
|
98
|
+
}));
|
|
99
|
+
const tooltipContent = computed(() => {
|
|
100
|
+
const { keyColumn, tooltipData } = instance;
|
|
101
|
+
if (!tooltipData)
|
|
102
|
+
return null;
|
|
103
|
+
return tooltipData.data.find((row) => row[keyColumn] === pathId.value);
|
|
104
|
+
});
|
|
105
|
+
const tooltipStyle = computed(() => {
|
|
106
|
+
const directionX = cursor.reverseX ? 'right' : 'left';
|
|
107
|
+
const directionY = cursor.reverseY ? 'bottom' : 'top';
|
|
108
|
+
const valX = cursor.reverseX ? cursor.right : cursor.left;
|
|
109
|
+
const valY = cursor.reverseY ? cursor.bottom : cursor.top;
|
|
110
|
+
return {
|
|
111
|
+
position: 'absolute',
|
|
112
|
+
[directionX]: `${valX}px`,
|
|
113
|
+
[directionY]: `${valY}px`,
|
|
114
|
+
pointerEvents: 'none',
|
|
115
|
+
maxWidth: '300px',
|
|
116
|
+
minWidth: '120px',
|
|
117
|
+
background: 'white',
|
|
118
|
+
boxShadow: '0 2px 8px rgba(0,0,0,0.18)',
|
|
119
|
+
borderRadius: '4px',
|
|
120
|
+
padding: '8px 12px',
|
|
121
|
+
whiteSpace: 'pre-line',
|
|
122
|
+
zIndex: 9999,
|
|
123
|
+
userSelect: 'none',
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
function pathMouseMove(event, path) {
|
|
127
|
+
pathId.value = path.getAttribute(instance.keyColumn);
|
|
128
|
+
const hasId = !!pathId.value;
|
|
129
|
+
showTooltip.value = hasId;
|
|
130
|
+
if (!container.value || !hasId)
|
|
131
|
+
return;
|
|
132
|
+
const svgRect = container.value.getBoundingClientRect();
|
|
133
|
+
const offsetX = event.clientX - svgRect.left;
|
|
134
|
+
const offsetY = event.clientY - svgRect.top;
|
|
135
|
+
cursor.reverseX = offsetX > svgRect.width / 2;
|
|
136
|
+
cursor.reverseY = offsetY > svgRect.height / 2;
|
|
137
|
+
let left = offsetX + 15;
|
|
138
|
+
let top = offsetY + 20;
|
|
139
|
+
const tooltipEl = container.value.parentElement?.querySelector('.zd-svg-map__tooltip');
|
|
140
|
+
if (tooltipEl) {
|
|
141
|
+
if (left + tooltipEl.offsetWidth > svgRect.width) {
|
|
142
|
+
left = offsetX - tooltipEl.offsetWidth - 15;
|
|
143
|
+
}
|
|
144
|
+
if (top + tooltipEl.offsetHeight > svgRect.height) {
|
|
145
|
+
top = offsetY - tooltipEl.offsetHeight - 20;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
cursor.left = left;
|
|
149
|
+
cursor.top = top;
|
|
150
|
+
cursor.right = svgRect.width - left;
|
|
151
|
+
cursor.bottom = svgRect.height - top;
|
|
152
|
+
}
|
|
153
|
+
function svgMouseOut() {
|
|
154
|
+
showTooltip.value = false;
|
|
155
|
+
pathId.value = null;
|
|
156
|
+
}
|
|
157
|
+
const pathMouseMoveHandlers = new WeakMap();
|
|
158
|
+
function contentChange() {
|
|
159
|
+
const paths = container.value?.querySelectorAll('path');
|
|
160
|
+
paths?.forEach((path) => {
|
|
161
|
+
const handler = (event) => pathMouseMove(event, path);
|
|
162
|
+
pathMouseMoveHandlers.set(path, handler);
|
|
163
|
+
path.addEventListener('mousemove', handler);
|
|
164
|
+
});
|
|
165
|
+
container.value?.querySelector('svg')?.addEventListener('mouseout', svgMouseOut);
|
|
166
|
+
}
|
|
167
|
+
function removeListeners() {
|
|
168
|
+
const paths = container.value?.querySelectorAll('path');
|
|
169
|
+
paths?.forEach((path) => {
|
|
170
|
+
const handler = pathMouseMoveHandlers.get(path);
|
|
171
|
+
if (handler) {
|
|
172
|
+
path.removeEventListener('mousemove', handler);
|
|
173
|
+
pathMouseMoveHandlers.delete(path);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
container.value?.querySelector('svg')?.removeEventListener('mouseout', svgMouseOut);
|
|
177
|
+
}
|
|
178
|
+
function mapClick(event) {
|
|
179
|
+
if (event.target.nodeName === 'path') {
|
|
180
|
+
if (event.target.id) {
|
|
181
|
+
instance.mapClick(event.target);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
instance.mapClick(event.target.parentNode);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
onMounted(() => {
|
|
189
|
+
if (container.value) {
|
|
190
|
+
instance.svgContainer = container.value;
|
|
191
|
+
instance.setViewBeforeUpdate(removeListeners);
|
|
192
|
+
instance.setViewUpdate(contentChange);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
onBeforeUnmount(() => {
|
|
196
|
+
removeListeners();
|
|
197
|
+
});
|
|
198
|
+
return {
|
|
199
|
+
container,
|
|
200
|
+
showTooltip,
|
|
201
|
+
tooltipContent,
|
|
202
|
+
tooltipStyle,
|
|
203
|
+
root,
|
|
204
|
+
mapClick,
|
|
205
|
+
instance,
|
|
206
|
+
pathId,
|
|
207
|
+
cssVars,
|
|
208
|
+
...componentScope,
|
|
209
|
+
};
|
|
210
|
+
},
|
|
211
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Switch } from '@zeedhi/common';
|
|
2
|
+
import { defineComponent } from 'vue';
|
|
3
|
+
import { buildProps } from '../../utils';
|
|
4
|
+
import { getRootElement, useCreateInstance, useGetMethods } from '../zd-component/ZdComponent';
|
|
5
|
+
import { ZdToggleableProps } from '../zd-toggleable/ZdToggleable';
|
|
6
|
+
/**
|
|
7
|
+
* Switch component
|
|
8
|
+
*/
|
|
9
|
+
export const ZdSwitchProps = buildProps({
|
|
10
|
+
...ZdToggleableProps,
|
|
11
|
+
inset: {
|
|
12
|
+
type: [Boolean, String],
|
|
13
|
+
default: false,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
const switchComponent = defineComponent({
|
|
17
|
+
props: ZdSwitchProps,
|
|
18
|
+
inheritAttrs: false,
|
|
19
|
+
setup(props, ctx) {
|
|
20
|
+
const { instance, root } = useCreateInstance(props, ctx, Switch);
|
|
21
|
+
const { click, focus, blur, mouseenter, mouseleave } = useGetMethods(instance, root);
|
|
22
|
+
const switchChange = (value) => {
|
|
23
|
+
const rootElement = getRootElement(root);
|
|
24
|
+
ctx.emit('update:value', value);
|
|
25
|
+
instance.change(undefined, rootElement.value);
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
instance,
|
|
29
|
+
root,
|
|
30
|
+
click,
|
|
31
|
+
focus,
|
|
32
|
+
blur,
|
|
33
|
+
mouseenter,
|
|
34
|
+
mouseleave,
|
|
35
|
+
switchChange,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
export default switchComponent;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Table } from '@zeedhi/common';
|
|
2
|
+
import { defineComponent } from 'vue';
|
|
3
|
+
import { HeightProps } from '../../propsMixins';
|
|
4
|
+
import { buildProps } from '../../utils';
|
|
5
|
+
import { useCreateInstance, useGetMethods } from '../zd-component/ZdComponent';
|
|
6
|
+
import { ZdIterableProps } from '../zd-iterable/ZdIterable';
|
|
7
|
+
export const ZdTableProps = buildProps({
|
|
8
|
+
...ZdIterableProps,
|
|
9
|
+
...HeightProps,
|
|
10
|
+
caption: {
|
|
11
|
+
type: [String, Object],
|
|
12
|
+
default() {
|
|
13
|
+
return {};
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
fillWidth: {
|
|
17
|
+
type: [String, Boolean],
|
|
18
|
+
default: false,
|
|
19
|
+
},
|
|
20
|
+
showTableHead: {
|
|
21
|
+
type: [String, Boolean],
|
|
22
|
+
default: true,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
const tableComponent = defineComponent({
|
|
26
|
+
props: ZdTableProps,
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
setup(props, ctx) {
|
|
29
|
+
const { instance, root } = useCreateInstance(props, ctx, Table);
|
|
30
|
+
const { click, focus, blur, mouseenter, mouseleave } = useGetMethods(instance, root);
|
|
31
|
+
return {
|
|
32
|
+
instance,
|
|
33
|
+
root,
|
|
34
|
+
click,
|
|
35
|
+
focus,
|
|
36
|
+
blur,
|
|
37
|
+
mouseenter,
|
|
38
|
+
mouseleave,
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
export default tableComponent;
|