@zeedhi/vuetify 3.0.11 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/zd-vuetify.css +60 -58
- package/dist/zd-vuetify.min.css +1 -1
- package/dist/zd-vuetify.min.js +14 -14
- package/dist/zd-vuetify.mjs +1061 -792
- package/environments.json +16 -0
- package/package.json +3 -3
- package/src/components/index.ts +3 -1
- package/src/components/zd-alert/ZdAlert.ts +1 -1
- package/src/components/zd-badge/ZdBadge.ts +1 -1
- package/src/components/zd-breadcrumbs/ZdBreadcrumbs.ts +2 -1
- package/src/components/zd-button/ZdButton.ts +1 -1
- package/src/components/zd-button-group/ZdButtonGroup.ts +1 -1
- package/src/components/zd-card/ZdCard.ts +1 -1
- package/src/components/zd-card/ZdCard.vue +2 -2
- package/src/components/zd-carousel/ZdCarousel.ts +3 -1
- package/src/components/zd-checkbox/ZdCheckbox.ts +1 -1
- package/src/components/zd-checkbox-multiple/ZdCheckboxMultiple.ts +3 -1
- package/src/components/zd-chip/ZdChip.ts +1 -1
- package/src/components/zd-code-viewer/ZdCodeViewer.ts +1 -1
- package/src/components/zd-col/ZdCol.ts +1 -1
- package/src/components/zd-collapse-card/ZdCollapseCard.ts +3 -1
- package/src/components/zd-component/ZdComponent.ts +23 -1
- package/src/components/zd-component/ZdComponentRender.ts +2 -0
- package/src/components/zd-container/ZdContainer.ts +1 -1
- package/src/components/zd-currency/ZdCurrency.ts +1 -1
- package/src/components/zd-date-input/ZdDateInput.ts +1 -1
- package/src/components/zd-date-range/ZdDateRange.ts +1 -1
- package/src/components/zd-divider/ZdDivider.ts +1 -1
- package/src/components/zd-dropdown/ZdDropdown.ts +2 -1
- package/src/components/zd-dropdown/ZdDropdown.vue +1 -1
- package/src/components/zd-footer/ZdFooter.ts +1 -1
- package/src/components/zd-form/ZdForm.ts +2 -1
- package/src/components/zd-frame/ZdFrame.ts +3 -1
- package/src/components/zd-frame-page/ZdFramePage.ts +1 -1
- package/src/components/zd-frame-page/ZdFramePage.vue +1 -1
- package/src/components/zd-grid/ZdGrid.ts +10 -2
- package/src/components/zd-grid/ZdGrid.vue +1 -1
- package/src/components/zd-grid/cell/ZdGridCellContent.vue +5 -7
- package/src/components/zd-grid/column-header/ZdGridColumnHeader.vue +4 -7
- package/src/components/zd-grid-editable/ZdGridEditable.ts +9 -2
- package/src/components/zd-grid-editable/cell/ZdGridEditableCell.vue +1 -0
- package/src/components/zd-header/ZdHeader.ts +4 -1
- package/src/components/zd-icon/ZdIcon.ts +1 -1
- package/src/components/zd-image/ZdImage.ts +1 -1
- package/src/components/zd-increment/ZdIncrement.ts +1 -1
- package/src/components/zd-input/ZdInput.ts +10 -3
- package/src/components/zd-iterable/ZdIterable.ts +2 -0
- package/src/components/zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton.ts +6 -1
- package/src/components/zd-iterable/zd-iterable-page-info/ZdIterablePageInfo.ts +1 -1
- package/src/components/zd-iterable/zd-iterable-page-size/ZdIterablePageSize.ts +2 -1
- package/src/components/zd-iterable/zd-iterable-pagination/ZdIterablePagination.ts +8 -3
- package/src/components/zd-iterable/zd-search/ZdSearch.ts +1 -1
- package/src/components/zd-iterable-component-render/ZdIterableComponentRender.ts +12 -1
- package/src/components/zd-layout/ZdLayout.ts +1 -1
- package/src/components/zd-list/ZdList.scss +3 -0
- package/src/components/zd-list/ZdList.ts +2 -1
- package/src/components/zd-list/ZdListGroup.ts +2 -1
- package/src/components/zd-list/ZdListGroup.vue +14 -16
- package/src/components/zd-list/ZdListItem.ts +1 -1
- package/src/components/zd-loading/ZdLoading.ts +1 -1
- package/src/components/zd-loading/ZdLoading.vue +30 -53
- package/src/components/zd-login/ZdLogin.ts +3 -1
- package/src/components/zd-login/ZdLoginButton.ts +1 -1
- package/src/components/zd-main/ZdMain.ts +1 -1
- package/src/components/zd-master-detail/ZdMasterDetail.ts +1 -1
- package/src/components/zd-menu/ZdMenu.ts +9 -4
- package/src/components/zd-menu/ZdMenu.vue +6 -5
- package/src/components/zd-menu/ZdMenuButton.ts +1 -1
- package/src/components/zd-menu/ZdMenuGroup.ts +2 -1
- package/src/components/zd-menu/ZdMenuLink.ts +1 -1
- package/src/components/zd-menu/ZdMenuSeparator.ts +1 -1
- package/src/components/zd-modal/ZdModal.ts +1 -21
- package/src/components/zd-modal/ZdModal.vue +18 -77
- package/src/components/zd-modal/ZdModalCard.ts +100 -0
- package/src/components/zd-modal/ZdModalCard.vue +47 -0
- package/src/components/zd-modal/ZdModalCloseButton.ts +1 -1
- package/src/components/zd-month/ZdMonth.ts +1 -1
- package/src/components/zd-number-input/ZdNumberInput.ts +1 -1
- package/src/components/zd-password/ZdPassword.ts +1 -1
- package/src/components/zd-progress/ZdProgress.ts +2 -1
- package/src/components/zd-radio/ZdRadio.ts +2 -1
- package/src/components/zd-row/ZdRow.ts +1 -1
- package/src/components/zd-select/ZdSelect.ts +10 -2
- package/src/components/zd-select/ZdSelect.vue +2 -6
- package/src/components/zd-select-multiple/ZdSelectMultiple.ts +6 -1
- package/src/components/zd-select-multiple/ZdSelectMultiple.vue +1 -1
- package/src/components/zd-svg-map/ZdSvgMap.ts +1 -1
- package/src/components/zd-switch/ZdSwitch.ts +1 -1
- package/src/components/zd-table/ZdTable.ts +1 -1
- package/src/components/zd-tabs/ZdTab.ts +1 -1
- package/src/components/zd-tabs/ZdTabItem.vue +1 -0
- package/src/components/zd-tabs/ZdTabs.ts +4 -3
- package/src/components/zd-tabs/ZdTabs.vue +14 -5
- package/src/components/zd-tag/ZdTag.ts +1 -1
- package/src/components/zd-text/ZdText.ts +1 -1
- package/src/components/zd-text-input/ZdTextInput.ts +1 -1
- package/src/components/zd-text-input/ZdTextInput.vue +2 -2
- package/src/components/zd-textarea/ZdTextarea.ts +5 -1
- package/src/components/zd-textarea/ZdTextarea.vue +5 -2
- package/src/components/zd-time/ZdTime.ts +1 -1
- package/src/components/zd-tooltip/ZdTooltip.ts +1 -1
- package/src/components/zd-tooltip-overflow/ZdTooltipOverflow.vue +45 -0
- package/src/components/zd-tree/ZdTree.ts +5 -1
- package/src/components/zd-tree-grid/ZdTreeGrid.ts +2 -1
- package/src/composables/columnDrag.ts +9 -11
- package/src/composables/tableNavigation.ts +5 -1
- package/src/composables/useTooltipManager.ts +24 -0
- package/src/directives/index.ts +1 -0
- package/src/directives/v-tooltip-overflow.ts +97 -0
- package/src/index.ts +11 -0
- package/src/styles/_zd-input.scss +3 -2
- package/src/utils/fillHeight.ts +3 -2
- package/src/utils/index.ts +1 -0
- package/src/utils/plugins/getIconPlugin.ts +4 -3
- package/src/utils/tooltip-overflow/index.ts +2 -0
- package/src/utils/tooltip-overflow/install.ts +27 -0
- package/src/utils/tooltip-overflow/uninstall.ts +32 -0
- package/types/components/zd-alert/ZdAlert.d.ts +429 -351
- package/types/components/zd-badge/ZdBadge.d.ts +235 -211
- package/types/components/zd-breadcrumbs/ZdBreadcrumbs.d.ts +249 -222
- package/types/components/zd-button/ZdButton.d.ts +251 -227
- package/types/components/zd-button-group/ZdButtonGroup.d.ts +227 -212
- package/types/components/zd-card/ZdCard.d.ts +246 -222
- package/types/components/zd-carousel/ZdCarousel.d.ts +705 -701
- package/types/components/zd-checkbox/ZdCheckbox.d.ts +41 -14
- package/types/components/zd-checkbox-multiple/ZdCheckboxMultiple.d.ts +779 -746
- package/types/components/zd-chip/ZdChip.d.ts +246 -222
- package/types/components/zd-code-viewer/ZdCodeViewer.d.ts +264 -234
- package/types/components/zd-col/ZdCol.d.ts +244 -220
- package/types/components/zd-collapse-card/ZdCollapseCard.d.ts +541 -457
- package/types/components/zd-component/ZdComponent.d.ts +12 -5
- package/types/components/zd-component/ZdComponentRender.d.ts +12 -4
- package/types/components/zd-container/ZdContainer.d.ts +247 -223
- package/types/components/zd-currency/ZdCurrency.d.ts +765 -738
- package/types/components/zd-date-input/ZdDateInput.d.ts +62 -29
- package/types/components/zd-date-range/ZdDateRange.d.ts +776 -749
- package/types/components/zd-dialog/ZdDialog.d.ts +36 -12
- package/types/components/zd-divider/ZdDivider.d.ts +244 -220
- package/types/components/zd-dropdown/ZdDropdown.d.ts +342 -324
- package/types/components/zd-footer/ZdFooter.d.ts +624 -562
- package/types/components/zd-form/ZdForm.d.ts +12 -4
- package/types/components/zd-frame/ZdFrame.d.ts +13 -4
- package/types/components/zd-frame-page/ZdFramePage.d.ts +242 -215
- package/types/components/zd-grid/ZdGrid.d.ts +4500 -4527
- package/types/components/zd-grid/cell/ZdGridAction.d.ts +2 -2
- package/types/components/zd-grid/cell/ZdGridCell.d.ts +4 -4
- package/types/components/zd-grid/cell/ZdGridCellContent.d.ts +4 -4
- package/types/components/zd-grid/column-header/ZdGridColumnHeader.d.ts +2 -2
- package/types/components/zd-grid/composables/grid-instance.d.ts +1927 -1238
- package/types/components/zd-grid/footer/ZdGridFooter.d.ts +1927 -1238
- package/types/components/zd-grid/row/ZdGridRow.d.ts +6 -6
- package/types/components/zd-grid/toolbar/ZdGridToolbar.d.ts +1927 -1238
- package/types/components/zd-grid-editable/ZdGridEditable.d.ts +5102 -6303
- package/types/components/zd-grid-editable/cell/ZdGridEditableCell.d.ts +341 -341
- package/types/components/zd-grid-editable/row/ZdGridEditableRow.d.ts +6 -6
- package/types/components/zd-header/ZdHeader.d.ts +640 -582
- package/types/components/zd-icon/ZdIcon.d.ts +39 -15
- package/types/components/zd-image/ZdImage.d.ts +241 -220
- package/types/components/zd-increment/ZdIncrement.d.ts +765 -738
- package/types/components/zd-input/ZdInput.d.ts +15 -6
- package/types/components/zd-iterable/ZdIterable.d.ts +26 -12
- package/types/components/zd-iterable/ZdIterableNoData.d.ts +1927 -1238
- package/types/components/zd-iterable/zd-iterable-columns-button/ZdIterableColumnsButton.d.ts +753 -470
- package/types/components/zd-iterable/zd-iterable-page-info/ZdIterablePageInfo.d.ts +750 -461
- package/types/components/zd-iterable/zd-iterable-page-size/ZdIterablePageSize.d.ts +1659 -987
- package/types/components/zd-iterable/zd-iterable-pagination/ZdIterablePagination.d.ts +762 -470
- package/types/components/zd-iterable/zd-search/ZdSearch.d.ts +50 -23
- package/types/components/zd-iterable-component-render/ZdIterableComponentRender.d.ts +1224 -1080
- package/types/components/zd-layout/ZdLayout.d.ts +243 -222
- package/types/components/zd-list/ZdList.d.ts +671 -432
- package/types/components/zd-list/ZdListGroup.d.ts +809 -570
- package/types/components/zd-list/ZdListItem.d.ts +424 -294
- package/types/components/zd-loading/ZdLoading.d.ts +35 -14
- package/types/components/zd-login/ZdLogin.d.ts +455 -425
- package/types/components/zd-login/ZdLoginButton.d.ts +678 -654
- package/types/components/zd-main/ZdMain.d.ts +241 -220
- package/types/components/zd-master-detail/ZdMasterDetail.d.ts +261 -237
- package/types/components/zd-menu/ZdMenu.d.ts +1257 -3206
- package/types/components/zd-menu/ZdMenuButton.d.ts +244 -220
- package/types/components/zd-menu/ZdMenuGroup.d.ts +1219 -5391
- package/types/components/zd-menu/ZdMenuLink.d.ts +2042 -9432
- package/types/components/zd-menu/ZdMenuSeparator.d.ts +244 -220
- package/types/components/zd-modal/ZdModal.d.ts +0 -2
- package/types/components/zd-modal/ZdModalCard.d.ts +125 -0
- package/types/components/zd-modal/ZdModalCloseButton.d.ts +244 -220
- package/types/components/zd-month/ZdMonth.d.ts +774 -747
- package/types/components/zd-number-input/ZdNumberInput.d.ts +766 -739
- package/types/components/zd-password/ZdPassword.d.ts +765 -738
- package/types/components/zd-progress/ZdProgress.d.ts +363 -336
- package/types/components/zd-radio/ZdRadio.d.ts +44 -14
- package/types/components/zd-row/ZdRow.d.ts +244 -220
- package/types/components/zd-select/ZdSelect.d.ts +17 -5
- package/types/components/zd-select-multiple/ZdSelectMultiple.d.ts +17 -5
- package/types/components/zd-svg-map/ZdSvgMap.d.ts +37 -13
- package/types/components/zd-switch/ZdSwitch.d.ts +764 -737
- package/types/components/zd-table/ZdTable.d.ts +547 -346
- package/types/components/zd-tabs/ZdTab.d.ts +233 -156
- package/types/components/zd-tabs/ZdTabItem.d.ts +36 -12
- package/types/components/zd-tabs/ZdTabs.d.ts +492 -306
- package/types/components/zd-tag/ZdTag.d.ts +244 -220
- package/types/components/zd-text/ZdText.d.ts +264 -234
- package/types/components/zd-text-input/ZdTextInput.d.ts +41 -14
- package/types/components/zd-textarea/ZdTextarea.d.ts +55 -15
- package/types/components/zd-time/ZdTime.d.ts +774 -747
- package/types/components/zd-toggleable/ZdToggleable.d.ts +13 -4
- package/types/components/zd-tooltip/ZdTooltip.d.ts +250 -226
- package/types/components/zd-tree/ZdTree.d.ts +799 -763
- package/types/components/zd-tree/ZdTreeAfterTitle.d.ts +3 -3
- package/types/components/zd-tree/ZdTreeCheckbox.d.ts +5 -5
- package/types/components/zd-tree-grid/ZdTreeGrid.d.ts +2230 -2214
- package/types/components/zd-tree-grid/cell/ZdTreeGridCell.d.ts +4 -4
- package/types/components/zd-tree-grid/row/ZdTreeGridRow.d.ts +6 -6
- package/types/composables/cellSelection.d.ts +2 -264
- package/types/composables/gridColumns.d.ts +200 -147
- package/types/composables/gridSorting.d.ts +1 -1
- package/types/composables/tableNavigation.d.ts +3 -2
- package/types/composables/useTooltipManager.d.ts +13 -0
- package/types/directives/index.d.ts +1 -0
- package/types/directives/v-tooltip-overflow.d.ts +12 -0
- package/types/index.d.ts +1 -0
- package/types/utils/fillHeight.d.ts +1 -1
- package/types/utils/index.d.ts +1 -0
- package/types/utils/tooltip-overflow/index.d.ts +2 -0
- package/types/utils/tooltip-overflow/install.d.ts +13 -0
- package/types/utils/tooltip-overflow/uninstall.d.ts +14 -0
- package/src/components/tooltip-overflow/ZdTooltipOverflow.ts +0 -63
- package/src/components/tooltip-overflow/ZdTooltipOverflow.vue +0 -63
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
3
|
ref="root"
|
|
4
4
|
:id="instance.name"
|
|
5
5
|
v-show="instance.isVisible"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<v-tabs
|
|
15
15
|
v-model="instance.activeTab"
|
|
16
16
|
show-arrows
|
|
17
|
-
@
|
|
17
|
+
@update:model-value="change"
|
|
18
18
|
:theme="instance.theme"
|
|
19
19
|
:color="instance.color"
|
|
20
20
|
:bg-color="instance.backgroudColor"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
>
|
|
38
38
|
</zd-tab>
|
|
39
39
|
</v-tabs>
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
<v-window
|
|
42
42
|
v-model="instance.activeTab"
|
|
43
43
|
>
|
|
@@ -94,13 +94,22 @@
|
|
|
94
94
|
|
|
95
95
|
.v-tabs{
|
|
96
96
|
flex-grow: 0;
|
|
97
|
+
flex-shrink: 0;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
.v-
|
|
100
|
+
.v-window {
|
|
100
101
|
flex-grow: 1;
|
|
101
102
|
overflow-y: auto;
|
|
102
103
|
|
|
103
|
-
|
|
104
|
+
&__container {
|
|
105
|
+
height: 100%;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.v-tabs-window-item {
|
|
110
|
+
height: 100%;
|
|
111
|
+
|
|
112
|
+
> .v-container {
|
|
104
113
|
height:100% !important;
|
|
105
114
|
}
|
|
106
115
|
}
|
|
@@ -20,7 +20,7 @@ const tagComponent = defineComponent({
|
|
|
20
20
|
props: ZdTagProps,
|
|
21
21
|
inheritAttrs: false,
|
|
22
22
|
setup(props, ctx) {
|
|
23
|
-
const { instance, root } = useCreateInstance<Tag>(props, ctx, Tag);
|
|
23
|
+
const { instance, root } = useCreateInstance<Tag>(props, ctx, Tag, ZdTagProps);
|
|
24
24
|
|
|
25
25
|
const { click, focus, blur, mouseenter, mouseleave } = useGetMethods(instance, root);
|
|
26
26
|
|
|
@@ -24,7 +24,7 @@ const textComponent = defineComponent({
|
|
|
24
24
|
props: ZdTextProps,
|
|
25
25
|
inheritAttrs: false,
|
|
26
26
|
setup(props, ctx) {
|
|
27
|
-
const { instance, root } = useCreateInstance<Text>(props, ctx, Text);
|
|
27
|
+
const { instance, root } = useCreateInstance<Text>(props, ctx, Text, ZdTextProps);
|
|
28
28
|
|
|
29
29
|
const { click, mouseenter, mouseleave } = useGetMethods(instance, root);
|
|
30
30
|
|
|
@@ -72,7 +72,7 @@ const textInputComponent = defineComponent({
|
|
|
72
72
|
props: ZdTextInputProps,
|
|
73
73
|
inheritAttrs: false,
|
|
74
74
|
setup(props, ctx) {
|
|
75
|
-
const { instance, root } = useCreateInstance<TextInput>(props, ctx, TextInput);
|
|
75
|
+
const { instance, root } = useCreateInstance<TextInput>(props, ctx, TextInput, ZdTextInputProps);
|
|
76
76
|
|
|
77
77
|
const textInputScope = useTextInput(instance, ctx, root);
|
|
78
78
|
const { maskOptions } = useMaska(instance, { disable: props.disableMaska });
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
!instance.showHelper &&
|
|
20
20
|
!(
|
|
21
21
|
instance.alwaysShowError &&
|
|
22
|
-
$refs.
|
|
23
|
-
$refs.
|
|
22
|
+
$refs.root &&
|
|
23
|
+
$refs.root.errorMessages.length
|
|
24
24
|
),
|
|
25
25
|
'zd-no-label': !instance.showLabel,
|
|
26
26
|
'zd-text-input--suffix': !!instance.suffix,
|
|
@@ -46,6 +46,10 @@ export const ZdTextareaProps = buildProps({
|
|
|
46
46
|
type: [Number, String],
|
|
47
47
|
default: 5,
|
|
48
48
|
},
|
|
49
|
+
maxRows: {
|
|
50
|
+
type: [Number, String],
|
|
51
|
+
default: 10,
|
|
52
|
+
},
|
|
49
53
|
height: {
|
|
50
54
|
type: [String, Number],
|
|
51
55
|
default: 'auto',
|
|
@@ -60,7 +64,7 @@ const textareaComponent = defineComponent({
|
|
|
60
64
|
props: ZdTextareaProps,
|
|
61
65
|
inheritAttrs: false,
|
|
62
66
|
setup(props, ctx) {
|
|
63
|
-
const { instance, root } = useCreateInstance<Textarea>(props, ctx, Textarea);
|
|
67
|
+
const { instance, root } = useCreateInstance<Textarea>(props, ctx, Textarea, ZdTextareaProps);
|
|
64
68
|
|
|
65
69
|
const { click, mouseenter, mouseleave, focus, blur } = useGetMethods(instance, root);
|
|
66
70
|
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
!instance.showHelper &&
|
|
18
18
|
!(
|
|
19
19
|
instance.alwaysShowError &&
|
|
20
|
-
$refs.
|
|
21
|
-
$refs.
|
|
20
|
+
$refs.root &&
|
|
21
|
+
$refs.root.errorMessages.length
|
|
22
22
|
),
|
|
23
23
|
'zd-no-label': !instance.showLabel,
|
|
24
24
|
'zd-text-input--prepend-icon':
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
rounded: instance.rounded,
|
|
76
76
|
rowHeight: instance.rowHeight,
|
|
77
77
|
rows: instance.rows,
|
|
78
|
+
maxRows: instance.maxRows,
|
|
78
79
|
rules: instance.rules,
|
|
79
80
|
singleLine: true,
|
|
80
81
|
type: instance.type,
|
|
@@ -109,6 +110,8 @@
|
|
|
109
110
|
textarea {
|
|
110
111
|
padding: var(--spacing-2);
|
|
111
112
|
line-height: unset;
|
|
113
|
+
-webkit-mask-image: none;
|
|
114
|
+
mask-image: none;
|
|
112
115
|
}
|
|
113
116
|
|
|
114
117
|
&.zd-text-align-left {
|
|
@@ -79,7 +79,7 @@ export default defineComponent({
|
|
|
79
79
|
name: 'ZdTime',
|
|
80
80
|
props: ZdTimeProps,
|
|
81
81
|
setup(props, ctx) {
|
|
82
|
-
const { instance, root } = useCreateInstance<Time>(props, ctx, Time);
|
|
82
|
+
const { instance, root } = useCreateInstance<Time>(props, ctx, Time, ZdTimeProps);
|
|
83
83
|
const { isMobile } = useIsMobile();
|
|
84
84
|
const textInputInstance = ref<any>(null);
|
|
85
85
|
const pickerRef = ref<any>(null);
|
|
@@ -69,7 +69,7 @@ const tooltipComponent = defineComponent({
|
|
|
69
69
|
ZdActivatorWrapper,
|
|
70
70
|
},
|
|
71
71
|
setup(props, ctx) {
|
|
72
|
-
const { instance, root } = useCreateInstance<Tooltip>(props, ctx, Tooltip);
|
|
72
|
+
const { instance, root } = useCreateInstance<Tooltip>(props, ctx, Tooltip, ZdTooltipProps);
|
|
73
73
|
|
|
74
74
|
const getLocation = (): any => {
|
|
75
75
|
if (instance.right) return 'right';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-tooltip
|
|
3
|
+
:model-value="isVisible"
|
|
4
|
+
:activator="targetElement"
|
|
5
|
+
:text="text"
|
|
6
|
+
location="bottom"
|
|
7
|
+
:openOnClick="false"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
import { useTooltipManager } from '../../composables/useTooltipManager';
|
|
13
|
+
|
|
14
|
+
const { isVisible, text, targetElement} = useTooltipManager();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style lang="scss">
|
|
18
|
+
.zd-tooltip-overflow {
|
|
19
|
+
&--hidden {
|
|
20
|
+
text-overflow: unset;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&--wrap {
|
|
24
|
+
white-space: pre-wrap;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--clamp {
|
|
28
|
+
white-space: normal;
|
|
29
|
+
-webkit-box-orient: vertical;
|
|
30
|
+
display: -webkit-box;
|
|
31
|
+
|
|
32
|
+
&-2 { -webkit-line-clamp: 2; line-clamp: 2; }
|
|
33
|
+
&-3 { -webkit-line-clamp: 3; line-clamp: 3; }
|
|
34
|
+
&-4 { -webkit-line-clamp: 4; line-clamp: 4; }
|
|
35
|
+
&-5 { -webkit-line-clamp: 5; line-clamp: 5; }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&--ellipsis {
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
text-overflow: ellipsis;
|
|
41
|
+
overflow-wrap: break-word;
|
|
42
|
+
white-space: pre;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -48,18 +48,22 @@ export const ZdTreeProps = buildProps({
|
|
|
48
48
|
afterTitleSlot: {
|
|
49
49
|
type: [String, Object] as PropType<ITreeConditionComponent>,
|
|
50
50
|
default: () => [],
|
|
51
|
+
watch: false,
|
|
51
52
|
},
|
|
52
53
|
toolbarSlot: {
|
|
53
54
|
type: Array as PropType<IComponentRender[]>,
|
|
54
55
|
default: () => [],
|
|
56
|
+
watch: false,
|
|
55
57
|
},
|
|
56
58
|
titleSlot: {
|
|
57
59
|
type: Array as PropType<ITreeConditionComponent[]>,
|
|
58
60
|
default: () => [],
|
|
61
|
+
watch: false,
|
|
59
62
|
},
|
|
60
63
|
datasource: {
|
|
61
64
|
type: Object as PropType<IDatasource>,
|
|
62
65
|
default: () => ({}),
|
|
66
|
+
watch: false,
|
|
63
67
|
},
|
|
64
68
|
parentField: {
|
|
65
69
|
type: String,
|
|
@@ -125,7 +129,7 @@ export default defineComponent({
|
|
|
125
129
|
props: ZdTreeProps,
|
|
126
130
|
setup(props, ctx) {
|
|
127
131
|
const treeRef = ref<any>();
|
|
128
|
-
const { instance, root } = useCreateInstance<Tree>(props, ctx, Tree);
|
|
132
|
+
const { instance, root } = useCreateInstance<Tree>(props, ctx, Tree, ZdTreeProps);
|
|
129
133
|
const selectedNodesTitle = ref('');
|
|
130
134
|
const beforeNodeState = ref<IDictionary>({});
|
|
131
135
|
const proxy = getCurrentInstance()?.proxy;
|
|
@@ -38,6 +38,7 @@ export const ZdTreeGridProps = buildProps({
|
|
|
38
38
|
footerSlot: {
|
|
39
39
|
type: Array,
|
|
40
40
|
default: () => [],
|
|
41
|
+
watch: false,
|
|
41
42
|
},
|
|
42
43
|
});
|
|
43
44
|
|
|
@@ -45,7 +46,7 @@ const treeGridComponent = defineComponent({
|
|
|
45
46
|
props: ZdTreeGridProps,
|
|
46
47
|
inheritAttrs: false,
|
|
47
48
|
setup(props, ctx) {
|
|
48
|
-
const { instance, root } = useCreateInstance<TreeGrid, ComponentPublicInstance>(props, ctx, TreeGrid);
|
|
49
|
+
const { instance, root } = useCreateInstance<TreeGrid, ComponentPublicInstance>(props, ctx, TreeGrid, ZdTreeGridProps);
|
|
49
50
|
|
|
50
51
|
const gridScope = useGridInstance({ instance, root });
|
|
51
52
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GridColumn, IGrid } from '@zeedhi/common';
|
|
2
2
|
import Sortable, { MoveEvent, SortableEvent } from 'sortablejs';
|
|
3
|
-
import { ComputedRef, UnwrapNestedRefs, UnwrapRef, onMounted, watch } from 'vue';
|
|
3
|
+
import { ComputedRef, UnwrapNestedRefs, UnwrapRef, onMounted, onUnmounted, watch } from 'vue';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Composable for components that can have their columns dragged
|
|
@@ -33,10 +33,12 @@ export function useColumnDrag<T extends IGrid>({
|
|
|
33
33
|
return event.related.classList.contains('sort-handle');
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
let sortableInstance: Sortable | null = null;
|
|
37
|
+
|
|
36
38
|
const initDragColumns = () => {
|
|
37
39
|
const tr = rootEl.value?.querySelector<HTMLElement>('thead tr');
|
|
38
40
|
if (tr) {
|
|
39
|
-
Sortable.create(tr, {
|
|
41
|
+
sortableInstance = Sortable.create(tr, {
|
|
40
42
|
onEnd: sortColumns,
|
|
41
43
|
onMove: checkMove,
|
|
42
44
|
handle: '.sort-handle',
|
|
@@ -46,15 +48,7 @@ export function useColumnDrag<T extends IGrid>({
|
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
const destroyDragColumns = () => {
|
|
49
|
-
|
|
50
|
-
if (tr) {
|
|
51
|
-
Sortable.create(tr, {
|
|
52
|
-
onEnd: sortColumns,
|
|
53
|
-
onMove: checkMove,
|
|
54
|
-
handle: '.sort-handle',
|
|
55
|
-
scroll: false,
|
|
56
|
-
}).destroy();
|
|
57
|
-
}
|
|
51
|
+
sortableInstance?.destroy();
|
|
58
52
|
};
|
|
59
53
|
|
|
60
54
|
const sortColumns = (event: SortableEvent) => {
|
|
@@ -101,5 +95,9 @@ export function useColumnDrag<T extends IGrid>({
|
|
|
101
95
|
return orderHeaders(instance.columns);
|
|
102
96
|
};
|
|
103
97
|
|
|
98
|
+
onUnmounted(() => {
|
|
99
|
+
destroyDragColumns();
|
|
100
|
+
});
|
|
101
|
+
|
|
104
102
|
return {};
|
|
105
103
|
}
|
|
@@ -7,9 +7,11 @@ import { ComputedRef, UnwrapNestedRefs } from 'vue';
|
|
|
7
7
|
export function useTableNavigation<T extends IDataNavigator & IViewNavigator>({
|
|
8
8
|
instance,
|
|
9
9
|
rootEl,
|
|
10
|
+
isNavigableRow,
|
|
10
11
|
}: {
|
|
11
12
|
instance: UnwrapNestedRefs<T>;
|
|
12
13
|
rootEl: ComputedRef<HTMLElement | undefined>;
|
|
14
|
+
isNavigableRow?: (element: Element) => boolean;
|
|
13
15
|
}) {
|
|
14
16
|
const navigate = (direction: 'up' | 'down' | 'left' | 'right', event?: Event) => {
|
|
15
17
|
if (direction === 'up' || direction === 'down') {
|
|
@@ -115,7 +117,9 @@ export function useTableNavigation<T extends IDataNavigator & IViewNavigator>({
|
|
|
115
117
|
};
|
|
116
118
|
|
|
117
119
|
const getArrayFromTrElement = (node: Element | HTMLElement | null) => {
|
|
118
|
-
return getArrayFromElementTag('TR', node).filter(
|
|
120
|
+
return getArrayFromElementTag('TR', node).filter(
|
|
121
|
+
(element) => isElementVisible(element) && (isNavigableRow?.(element) ?? true),
|
|
122
|
+
);
|
|
119
123
|
};
|
|
120
124
|
|
|
121
125
|
const findNextTd = (
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { computed, ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface TooltipManager {
|
|
4
|
+
text: string;
|
|
5
|
+
targetElement: HTMLElement | null;
|
|
6
|
+
showTooltip: (element: HTMLElement, text: string) => void;
|
|
7
|
+
hideTooltip: () => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const text = ref('');
|
|
11
|
+
|
|
12
|
+
const targetElement = ref<HTMLElement | null>(null);
|
|
13
|
+
|
|
14
|
+
export function useTooltipManager() {
|
|
15
|
+
const showTooltip = (element: HTMLElement, content: string) => {
|
|
16
|
+
targetElement.value = element;
|
|
17
|
+
text.value = content;
|
|
18
|
+
}
|
|
19
|
+
const hideTooltip = () => {
|
|
20
|
+
targetElement.value = null;
|
|
21
|
+
}
|
|
22
|
+
const isVisible = computed(() => (targetElement.value !== null));
|
|
23
|
+
return { isVisible, text, targetElement, showTooltip, hideTooltip };
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { vTooltipOverflow } from './v-tooltip-overflow';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Directive } from 'vue';
|
|
2
|
+
import { useTooltipManager } from '../composables/useTooltipManager';
|
|
3
|
+
|
|
4
|
+
type OverflowType = 'hidden' | 'wrap' | 'ellipsis' | number;
|
|
5
|
+
|
|
6
|
+
interface DirectiveBinding {
|
|
7
|
+
value: string | number | boolean;
|
|
8
|
+
modifiers: {
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
wrap?: boolean;
|
|
11
|
+
ellipsis?: boolean;
|
|
12
|
+
};
|
|
13
|
+
arg?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const vTooltipOverflow: Directive<HTMLElement, DirectiveBinding> = {
|
|
17
|
+
mounted(el: HTMLElement, binding) {
|
|
18
|
+
const tooltipManager = useTooltipManager();
|
|
19
|
+
|
|
20
|
+
// Determine overflow type from modifiers or arg
|
|
21
|
+
let overflowType: OverflowType = 'ellipsis'; // default
|
|
22
|
+
|
|
23
|
+
if (binding.modifiers.hidden) {
|
|
24
|
+
overflowType = 'hidden';
|
|
25
|
+
} else if (binding.modifiers.wrap) {
|
|
26
|
+
overflowType = 'wrap';
|
|
27
|
+
} else if (binding.modifiers.ellipsis) {
|
|
28
|
+
overflowType = 'ellipsis';
|
|
29
|
+
} else if (binding.arg && !Number.isNaN(Number(binding.arg))) {
|
|
30
|
+
overflowType = Number(binding.arg);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Apply overflow styles
|
|
34
|
+
applyOverflowStyles(el, overflowType);
|
|
35
|
+
|
|
36
|
+
// Get tooltip text
|
|
37
|
+
const tooltipText = String(binding.value);
|
|
38
|
+
|
|
39
|
+
// Handle mouse enter
|
|
40
|
+
const onMouseEnter = () => {
|
|
41
|
+
// Check if element is overflowing
|
|
42
|
+
const isOverflowing = checkOverflow(el, overflowType);
|
|
43
|
+
|
|
44
|
+
if (isOverflowing) {
|
|
45
|
+
tooltipManager.showTooltip(el, tooltipText);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Handle mouse leave
|
|
50
|
+
const onMouseLeave = () => {
|
|
51
|
+
tooltipManager.hideTooltip();
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Store handlers on element for cleanup
|
|
55
|
+
(el as any)._tooltipOverflowHandlers = {
|
|
56
|
+
mouseenter: onMouseEnter,
|
|
57
|
+
mouseleave: onMouseLeave,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
el.addEventListener('mouseenter', onMouseEnter);
|
|
61
|
+
el.addEventListener('mouseleave', onMouseLeave);
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
unmounted(el: HTMLElement) {
|
|
65
|
+
// Remove event listeners
|
|
66
|
+
const handlers = (el as any)._tooltipOverflowHandlers;
|
|
67
|
+
if (handlers) {
|
|
68
|
+
el.removeEventListener('mouseenter', handlers.mouseenter);
|
|
69
|
+
el.removeEventListener('mouseleave', handlers.mouseleave);
|
|
70
|
+
delete (el as any)._tooltipOverflowHandlers;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
function applyOverflowStyles(el: HTMLElement, overflowType: OverflowType): void {
|
|
76
|
+
el.classList.add('zd-tooltip-overflow');
|
|
77
|
+
|
|
78
|
+
if (overflowType === 'hidden') {
|
|
79
|
+
el.classList.add('zd-tooltip-overflow--hidden');
|
|
80
|
+
} else if (overflowType === 'wrap') {
|
|
81
|
+
el.classList.add('zd-tooltip-overflow--wrap');
|
|
82
|
+
} else if (overflowType === 'ellipsis') {
|
|
83
|
+
el.classList.add('zd-tooltip-overflow--ellipsis');
|
|
84
|
+
} else if (typeof overflowType === 'number') {
|
|
85
|
+
el.classList.add('zd-tooltip-overflow--clamp', `zd-tooltip-overflow--clamp-${overflowType}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function checkOverflow(el: HTMLElement, overflowType: OverflowType): boolean {
|
|
90
|
+
// If it's a clamp value, always show tooltip
|
|
91
|
+
if (typeof overflowType === 'number') {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Check if element is overflowing
|
|
96
|
+
return el.scrollWidth > el.clientWidth;
|
|
97
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { SlVueTreeNext } from 'sl-vue-tree-next';
|
|
|
11
11
|
import { RegisterComponents } from './components';
|
|
12
12
|
import './styles/index.scss';
|
|
13
13
|
import { formatSizePlugin, getIconPlugin, styleObjectPlugin } from './utils/plugins';
|
|
14
|
+
import { vTooltipOverflow } from './directives';
|
|
15
|
+
import { installTooltipOverflow, setupTooltipOverflowCleanup } from './utils/tooltip-overflow';
|
|
14
16
|
|
|
15
17
|
interface IDisplayOptions {
|
|
16
18
|
mobileBreakpoint?: number | DisplayBreakpoint;
|
|
@@ -56,6 +58,14 @@ const ZeedhiVuetify = {
|
|
|
56
58
|
// styleObject
|
|
57
59
|
// eslint-disable-next-line no-param-reassign
|
|
58
60
|
app.config.globalProperties.$styleObject = styleObjectPlugin;
|
|
61
|
+
|
|
62
|
+
app.directive('tooltip-overflow', vTooltipOverflow);
|
|
63
|
+
|
|
64
|
+
// Install the root ZdTooltipOverflow component
|
|
65
|
+
const tooltipData = installTooltipOverflow(app);
|
|
66
|
+
|
|
67
|
+
// Setup cleanup on app unmount
|
|
68
|
+
setupTooltipOverflowCleanup(app, tooltipData);
|
|
59
69
|
},
|
|
60
70
|
};
|
|
61
71
|
|
|
@@ -63,4 +73,5 @@ export * from './errors';
|
|
|
63
73
|
export * from './utils';
|
|
64
74
|
export * from './components';
|
|
65
75
|
export * from './composables';
|
|
76
|
+
export * from './propsMixins';
|
|
66
77
|
export default ZeedhiVuetify;
|
|
@@ -147,6 +147,7 @@
|
|
|
147
147
|
|
|
148
148
|
>.v-input__details {
|
|
149
149
|
min-height: 11px;
|
|
150
|
+
padding: 2px 4px;
|
|
150
151
|
|
|
151
152
|
.v-messages {
|
|
152
153
|
min-height: 11px;
|
|
@@ -191,11 +192,11 @@
|
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
194
|
|
|
194
|
-
&.error--
|
|
195
|
+
&.v-input--error:not(.v-input--focused) {
|
|
195
196
|
&.v-input {
|
|
196
197
|
>.v-input__control {
|
|
197
198
|
>.v-field {
|
|
198
|
-
border:
|
|
199
|
+
border-color: rgb(var(--v-theme-error));;
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
}
|
package/src/utils/fillHeight.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function setFillHeight(element: HTMLElement) {
|
|
1
|
+
export function setFillHeight(element: HTMLElement, fillHeight: boolean | string = false) {
|
|
2
2
|
const parent = element.parentElement;
|
|
3
3
|
if (parent) {
|
|
4
4
|
parent.style.display = 'flex';
|
|
@@ -7,7 +7,8 @@ export function setFillHeight(element: HTMLElement) {
|
|
|
7
7
|
Array.from(parent.children).forEach((child) => {
|
|
8
8
|
const childElement = child as HTMLElement;
|
|
9
9
|
if (childElement === element) {
|
|
10
|
-
|
|
10
|
+
const flexBasis = typeof fillHeight === 'string' ? fillHeight : '0';
|
|
11
|
+
(childElement as HTMLElement).style.flex = `1 1 ${flexBasis}`;
|
|
11
12
|
(childElement as HTMLElement).style.overflowY = 'auto';
|
|
12
13
|
} else {
|
|
13
14
|
(childElement as HTMLElement).style.flex = '0 0 auto';
|
package/src/utils/index.ts
CHANGED
|
@@ -16,10 +16,11 @@ export default function getIconPlugin(name?: string) {
|
|
|
16
16
|
/**
|
|
17
17
|
* Converte uma string para camelCase (ex: "hello-world" -> "helloWorld")
|
|
18
18
|
*/
|
|
19
|
-
const toCamelCase = (str: string) => {
|
|
19
|
+
const toCamelCase = (str: string): string => {
|
|
20
20
|
return str
|
|
21
|
-
.
|
|
22
|
-
.replace(
|
|
21
|
+
.replace(/[^a-zA-Z0-9]+(.)/g, (_m, chr) => chr.toUpperCase()) // Remove símbolos e capitaliza a letra seguinte
|
|
22
|
+
.replace(/^[A-Z]/, (m) => m.toLowerCase()) // Garante que a primeira letra seja minúscula
|
|
23
|
+
.replace(/[^a-zA-Z0-9]/g, ''); // Limpa qualquer resíduo
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
const camelizedName = toCamelCase(name);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { App, VNode, createVNode, render } from 'vue';
|
|
2
|
+
import ZdTooltipOverflow from '../../components/zd-tooltip-overflow/ZdTooltipOverflow.vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Mounts a root instance of ZdTooltipOverflow component
|
|
6
|
+
*
|
|
7
|
+
* @param app - The Vue application instance
|
|
8
|
+
* @returns An object containing the container element and tooltip VNode for cleanup
|
|
9
|
+
*/
|
|
10
|
+
export function installTooltipOverflow(app: App) {
|
|
11
|
+
// Create the container
|
|
12
|
+
const tooltipContainer = document.createElement('div');
|
|
13
|
+
tooltipContainer.id = 'zeedhi-tooltip-container';
|
|
14
|
+
|
|
15
|
+
// Create VNode and inherit context
|
|
16
|
+
const tooltipVNode: VNode = createVNode(ZdTooltipOverflow);
|
|
17
|
+
tooltipVNode.appContext = app._context;
|
|
18
|
+
|
|
19
|
+
// Render and append
|
|
20
|
+
render(tooltipVNode, tooltipContainer);
|
|
21
|
+
document.body.appendChild(tooltipContainer);
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
container: tooltipContainer,
|
|
25
|
+
vNode: tooltipVNode,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { App, VNode, render } from 'vue';
|
|
2
|
+
|
|
3
|
+
interface TooltipCleanupData {
|
|
4
|
+
container: HTMLElement;
|
|
5
|
+
vNode: VNode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Unmounts the ZdTooltipOverflow component and removes it from the DOM
|
|
10
|
+
* Also patches the app.unmount method to ensure cleanup happens
|
|
11
|
+
*
|
|
12
|
+
* @param app - The Vue application instance
|
|
13
|
+
* @param cleanupData - Object containing the container and VNode to cleanup
|
|
14
|
+
*/
|
|
15
|
+
export function setupTooltipOverflowCleanup(app: App, cleanupData: TooltipCleanupData): void {
|
|
16
|
+
const { container } = cleanupData;
|
|
17
|
+
|
|
18
|
+
const originalUnmount = app.unmount;
|
|
19
|
+
|
|
20
|
+
app.unmount = () => {
|
|
21
|
+
// 1. Unmount our manual component (triggers onUnmounted inside ZdTooltipOverflow)
|
|
22
|
+
render(null, container);
|
|
23
|
+
|
|
24
|
+
// 2. Remove the container from the DOM
|
|
25
|
+
if (container.parentNode) {
|
|
26
|
+
container.parentNode.removeChild(container);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 3. Proceed with the normal app unmount
|
|
30
|
+
originalUnmount();
|
|
31
|
+
};
|
|
32
|
+
}
|