@zeedhi/vuetify 3.0.9 → 3.0.10
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/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/zd-date-input/ZdDateInput.js +23 -86
- package/dist/components/zd-date-range/ZdDateRange.js +22 -84
- package/dist/components/zd-tabs/ZdTab.js +0 -3
- package/dist/components/zd-text/ZdText.js +3 -2
- package/dist/composables/index.js +2 -0
- package/dist/composables/useDateKeydown.js +87 -0
- package/dist/composables/usePickerValue.js +19 -0
- package/dist/composables/useTableLayout.js +212 -0
- package/dist/utils/isArrayOperation.js +4 -0
- package/dist/zd-vuetify.css +14120 -13554
- package/dist/zd-vuetify.js +8322 -4831
- package/package.json +4 -4
- package/src/components/zd-badge/ZdBadge.vue +2 -2
- package/src/components/zd-card/ZdCard.vue +2 -2
- package/src/components/zd-col/ZdCol.vue +1 -0
- package/src/components/zd-container/ZdContainer.vue +2 -2
- package/src/components/zd-date-input/ZdDateInput.ts +27 -94
- package/src/components/zd-date-input/ZdDateInput.vue +1 -0
- package/src/components/zd-date-range/ZdDateRange.ts +22 -88
- package/src/components/zd-date-range/ZdDateRange.vue +12 -14
- package/src/components/zd-footer/ZdFooter.vue +1 -0
- package/src/components/zd-grid/footer/ZdGridFooter.vue +2 -2
- package/src/components/zd-grid/toolbar/ZdGridToolbar.vue +2 -2
- package/src/components/zd-header/ZdHeader.vue +5 -5
- package/src/components/zd-iterable/ZdIterableNoData.vue +6 -6
- package/src/components/zd-iterable-component-render/ZdIterableComponentRender.vue +10 -10
- package/src/components/zd-layout/ZdLayout.vue +2 -2
- package/src/components/zd-login/ZdLogin.vue +4 -4
- package/src/components/zd-main/ZdMain.vue +2 -2
- package/src/components/zd-master-detail/ZdMasterDetail.vue +2 -2
- package/src/components/zd-modal/ZdModal.vue +2 -2
- package/src/components/zd-progress/ZdProgress.vue +2 -2
- package/src/components/zd-row/ZdRow.vue +1 -0
- package/src/components/zd-select/ZdSelect.vue +4 -4
- package/src/components/zd-select-multiple/ZdSelectMultiple.vue +4 -4
- package/src/components/zd-tabs/ZdTab.ts +0 -3
- package/src/components/zd-tabs/ZdTab.vue +1 -1
- package/src/components/zd-tabs/ZdTabItem.vue +11 -10
- package/src/components/zd-tabs/ZdTabs.vue +4 -20
- package/src/components/zd-text/ZdText.ts +3 -2
- package/src/components/zd-time/ZdTime.vue +1 -0
- package/src/components/zd-tooltip/ZdTooltip.vue +2 -2
- package/src/components/zd-tree/ZdTree.vue +4 -4
- package/src/composables/index.ts +2 -0
- package/src/composables/useDateKeydown.ts +109 -0
- package/src/composables/usePickerValue.ts +22 -0
- package/types/components/tek-grid/TekGrid.d.ts +7258 -0
- package/types/components/tek-grid/column-filter/TekGridColumnFilter.d.ts +129 -0
- package/types/components/tek-grid/column-header/TekGridHeaderRow.d.ts +225 -0
- package/types/components/tek-grid/columns-button/TekGridColumnsButton.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/indentation/TekGridIndentation.d.ts +32 -0
- package/types/components/tek-grid/layout-options/TekGridLayoutOptions.d.ts +1892 -0
- package/types/components/tek-grid/row/TekGridFooterRow.d.ts +90 -0
- package/types/components/tek-grid/row/TekGridGroupRow.d.ts +87 -0
- package/types/components/zd-date-input/ZdDateInput.d.ts +2 -2
- package/types/components/zd-date-range/ZdDateRange.d.ts +22 -7
- package/types/components/zd-grid-editable/cell/ZdGridEditableCell.d.ts +1 -1
- package/types/components/zd-layout/ZdLayout.d.ts +1 -1
- package/types/components/zd-list/ZdList.d.ts +3 -3
- package/types/components/zd-list/ZdListGroup.d.ts +2 -2
- package/types/components/zd-list/ZdListItem.d.ts +1 -1
- package/types/components/zd-month/ZdMonth.d.ts +2 -2
- package/types/components/zd-tabs/ZdTab.d.ts +0 -9
- package/types/components/zd-text/ZdText.d.ts +46 -37
- package/types/components/zd-time/ZdTime.d.ts +2 -2
- package/types/composables/index.d.ts +2 -0
- package/types/composables/useDateKeydown.d.ts +5 -0
- package/types/composables/usePickerValue.d.ts +10 -0
- package/types/composables/useTableLayout.d.ts +25 -0
- package/types/utils/isArrayOperation.d.ts +2 -0
- package/.package.json +0 -54
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
@mouseleave="mouseleave"
|
|
15
15
|
>
|
|
16
16
|
<component
|
|
17
|
-
v-for="(child
|
|
17
|
+
v-for="(child) in instance.children"
|
|
18
18
|
:is="child.component"
|
|
19
|
-
:key="
|
|
19
|
+
:key="child.name"
|
|
20
20
|
:parent="instance"
|
|
21
21
|
:theme="instance.theme"
|
|
22
22
|
v-bind="child"
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
>
|
|
38
38
|
<v-layout style="flex-direction: column;">
|
|
39
39
|
<component
|
|
40
|
-
v-for="(child
|
|
40
|
+
v-for="(child) in modal.children"
|
|
41
41
|
v-bind="child"
|
|
42
|
-
:key="
|
|
42
|
+
:key="child.name"
|
|
43
43
|
:is="child.component"
|
|
44
44
|
:parent="modal">
|
|
45
45
|
</component>
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
>
|
|
19
19
|
<slot name="centerSlot">
|
|
20
20
|
<component
|
|
21
|
-
v-for="(child
|
|
21
|
+
v-for="(child) in instance.centerSlot"
|
|
22
22
|
:is="child.component"
|
|
23
23
|
v-bind="child"
|
|
24
|
-
:key="
|
|
24
|
+
:key="child.name"
|
|
25
25
|
:parent="instance"
|
|
26
26
|
/>
|
|
27
27
|
</slot>
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
<template v-if="!hasItemBeforeSlot">
|
|
90
90
|
<component
|
|
91
91
|
ref="itemBefore"
|
|
92
|
-
v-for="(child
|
|
93
|
-
:key="
|
|
92
|
+
v-for="(child) in instance.itemBeforeSlot"
|
|
93
|
+
:key="child.name"
|
|
94
94
|
:is="child.component"
|
|
95
95
|
:parent="instance"
|
|
96
96
|
v-bind="child"
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
>
|
|
129
129
|
<template v-if="!hasItemAfterSlot">
|
|
130
130
|
<component
|
|
131
|
-
v-for="(child
|
|
132
|
-
:key="
|
|
131
|
+
v-for="(child) in instance.itemAfterSlot"
|
|
132
|
+
:key="child.name"
|
|
133
133
|
:is="child.component"
|
|
134
134
|
:parent="instance"
|
|
135
135
|
v-bind="child"
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
<template v-if="!hasItemBeforeSlot">
|
|
115
115
|
<component
|
|
116
116
|
ref="itemBefore"
|
|
117
|
-
v-for="(child
|
|
118
|
-
:key="
|
|
117
|
+
v-for="(child) in instance.itemBeforeSlot"
|
|
118
|
+
:key="child.name"
|
|
119
119
|
:is="child.component"
|
|
120
120
|
:parent="instance"
|
|
121
121
|
v-bind="child"
|
|
@@ -188,8 +188,8 @@
|
|
|
188
188
|
>
|
|
189
189
|
<template v-if="!hasItemAfterSlot">
|
|
190
190
|
<component
|
|
191
|
-
v-for="(child
|
|
192
|
-
:key="
|
|
191
|
+
v-for="(child) in instance.itemAfterSlot"
|
|
192
|
+
:key="child.name"
|
|
193
193
|
:is="child.component"
|
|
194
194
|
:parent="instance"
|
|
195
195
|
v-bind="child"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-tab
|
|
3
3
|
:id="instance.name"
|
|
4
|
+
ref="root"
|
|
4
5
|
v-show="instance.isVisible"
|
|
5
6
|
:class="['zd-tabs-tab', instance.cssClass]"
|
|
6
7
|
:style="$styleObject(instance.cssStyle)"
|
|
7
8
|
:name="instance.tabName"
|
|
8
|
-
:key="instance.index"
|
|
9
9
|
:disabled="instance.disabled"
|
|
10
10
|
:theme="instance.theme"
|
|
11
11
|
:color="instance.color"
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-window-item
|
|
2
|
+
<v-tabs-window-item
|
|
3
3
|
class="zd-tabs-tab-item"
|
|
4
4
|
v-show="isVisible"
|
|
5
5
|
:value="index"
|
|
6
6
|
>
|
|
7
7
|
<v-container fluid>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
<slot>
|
|
9
|
+
<component
|
|
10
|
+
v-for="(child) in children"
|
|
11
|
+
v-bind="child"
|
|
12
|
+
:key="child.name"
|
|
13
|
+
:is="child.component"
|
|
14
|
+
>
|
|
15
|
+
</component>
|
|
16
|
+
</slot>
|
|
16
17
|
</v-container>
|
|
17
|
-
</v-window-item>
|
|
18
|
+
</v-tabs-window-item>
|
|
18
19
|
</template>
|
|
19
20
|
|
|
20
21
|
<script lang="ts" src="./ZdTabItem.ts"></script>
|
|
@@ -25,28 +25,12 @@
|
|
|
25
25
|
:max="instance.max"
|
|
26
26
|
>
|
|
27
27
|
<zd-tab
|
|
28
|
-
v-for="(tab, index) in instance.tabs " :key="
|
|
28
|
+
v-for="(tab, index) in instance.tabs " :key="tab.name"
|
|
29
29
|
v-bind="{
|
|
30
|
-
|
|
31
|
-
name:
|
|
32
|
-
disabled: tab.disabled,
|
|
33
|
-
cssClass: tab.cssClass,
|
|
34
|
-
cssStyle: tab.cssStyle,
|
|
30
|
+
...tab,
|
|
31
|
+
name: tab.name,
|
|
35
32
|
tabName: tab.name,
|
|
36
|
-
index: index,
|
|
37
|
-
isVisible: tab.isVisible,
|
|
38
|
-
tabTitle: tab.tabTitle,
|
|
39
|
-
theme: tab.theme,
|
|
40
|
-
color: tab.color,
|
|
41
33
|
dense: tab.dense || instance.dense,
|
|
42
|
-
direction: tab.direction,
|
|
43
|
-
fixed: tab.fixed,
|
|
44
|
-
iconName: tab.iconName,
|
|
45
|
-
rounded: tab.rounded,
|
|
46
|
-
selectedClass: tab.selectedClass,
|
|
47
|
-
value: tab.value,
|
|
48
|
-
variant:tab.variant,
|
|
49
|
-
width: tab.width,
|
|
50
34
|
}"
|
|
51
35
|
@click="clickTab($event, index)"
|
|
52
36
|
@keydown="keydown($event, index)"
|
|
@@ -60,7 +44,7 @@
|
|
|
60
44
|
<zd-tab-item
|
|
61
45
|
v-for="(tab, index) in instance.tabs"
|
|
62
46
|
v-show="tab.isVisible && index === instance.activeTab"
|
|
63
|
-
:key="
|
|
47
|
+
:key="tab.name"
|
|
64
48
|
:value="index"
|
|
65
49
|
:children ="tab.children"
|
|
66
50
|
v-bind ="{
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Text } from '@zeedhi/common';
|
|
2
2
|
import { defineComponent } from 'vue';
|
|
3
3
|
import { buildProps } from '../../utils';
|
|
4
|
-
import {
|
|
4
|
+
import { useCreateInstance, useGetMethods } from '../zd-component/ZdComponent';
|
|
5
|
+
import { ZdComponentRenderProps } from '../zd-component/ZdComponentRender';
|
|
5
6
|
|
|
6
7
|
export const ZdTextProps = buildProps({
|
|
7
|
-
...
|
|
8
|
+
...ZdComponentRenderProps,
|
|
8
9
|
compile: {
|
|
9
10
|
type: [Boolean, String],
|
|
10
11
|
default: false,
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
>
|
|
16
16
|
<template v-slot:activator="{ props }">
|
|
17
17
|
<zd-activator-wrapper
|
|
18
|
-
v-for="(child
|
|
19
|
-
:key="
|
|
18
|
+
v-for="(child) in instance.children"
|
|
19
|
+
:key="child.name"
|
|
20
20
|
v-bind="mergeProps(props, $attrs)"
|
|
21
21
|
:child-props="child"
|
|
22
22
|
:parent="instance.parent"
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
>
|
|
22
22
|
<div v-if="instance.toolbarSlot.length && !$slots.toolbarSlot" class="zd-mb-4 zd-tree-toolbar">
|
|
23
23
|
<component
|
|
24
|
-
v-for="(child
|
|
25
|
-
:key="
|
|
24
|
+
v-for="(child) in instance.toolbarSlot"
|
|
25
|
+
:key="child.name"
|
|
26
26
|
:is="child.component"
|
|
27
27
|
:parent="instance"
|
|
28
28
|
v-bind="child"
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
</span>
|
|
86
86
|
<span v-else class='zd-display-inline-flex'>
|
|
87
87
|
<component
|
|
88
|
-
v-for="(comp
|
|
88
|
+
v-for="(comp) in instance.getSlotComponent(instance.titleSlot, node)"
|
|
89
89
|
:class="[
|
|
90
90
|
'item-title',
|
|
91
91
|
{ 'has-children': node.children.length }
|
|
92
92
|
]"
|
|
93
|
-
:key="
|
|
93
|
+
:key="comp.name"
|
|
94
94
|
:is="comp.component"
|
|
95
95
|
v-bind="comp"
|
|
96
96
|
/>
|
package/src/composables/index.ts
CHANGED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { DateInput, DateRange } from '@zeedhi/common';
|
|
2
|
+
import { Mask } from '@zeedhi/core';
|
|
3
|
+
import { UnwrapNestedRefs, onMounted } from 'vue';
|
|
4
|
+
|
|
5
|
+
const isPrintableKey = (key: string) => {
|
|
6
|
+
return key.length === 1;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const keyAllowed = (key: string) => {
|
|
10
|
+
return ['Tab', 'ArrowLeft', 'ArrowRight', 'Enter', 'Delete', 'Backspace'].includes(
|
|
11
|
+
key,
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function useDateKeydown(
|
|
16
|
+
instance: UnwrapNestedRefs<DateRange | DateInput >,
|
|
17
|
+
options: {
|
|
18
|
+
isMaskDelimiterFn: (value: string, position: number) => boolean;
|
|
19
|
+
},
|
|
20
|
+
) {
|
|
21
|
+
const { isMaskDelimiterFn } = options;
|
|
22
|
+
|
|
23
|
+
const findNextEditablePosition = (value: string, start: number) => {
|
|
24
|
+
let editablePosition = start;
|
|
25
|
+
while (isMaskDelimiterFn(value, editablePosition)) {
|
|
26
|
+
editablePosition += 1;
|
|
27
|
+
}
|
|
28
|
+
return editablePosition;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const keydown = (event?: Event) => {
|
|
32
|
+
if (!(event instanceof KeyboardEvent)) return;
|
|
33
|
+
|
|
34
|
+
const inputEl = event.target as HTMLInputElement;
|
|
35
|
+
let start = inputEl.selectionStart;
|
|
36
|
+
const end = inputEl.selectionEnd;
|
|
37
|
+
const { value } = inputEl;
|
|
38
|
+
const numbers = /[0-9]/;
|
|
39
|
+
|
|
40
|
+
if (start === null || end === null) return;
|
|
41
|
+
|
|
42
|
+
if (!numbers.test(event.key) && !keyAllowed(event.key)) {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (event.key === 'Backspace' && start === end && start > 0) {
|
|
48
|
+
while (
|
|
49
|
+
isMaskDelimiterFn(inputEl.value, start - 1) &&
|
|
50
|
+
inputEl.value[start - 1] !== ' '
|
|
51
|
+
) {
|
|
52
|
+
start -= 1;
|
|
53
|
+
}
|
|
54
|
+
inputEl.value = `${value.slice(0, start - 1)} ${value.substring(start)}`; // Keep this for mask behavior
|
|
55
|
+
inputEl.selectionStart = start - 1;
|
|
56
|
+
inputEl.selectionEnd = start - 1;
|
|
57
|
+
if (Mask.getValueWithoutMask(inputEl.value) === '') {
|
|
58
|
+
if (instance instanceof DateRange) {
|
|
59
|
+
instance.value = [];
|
|
60
|
+
} else {
|
|
61
|
+
instance.value = '';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
} else if (
|
|
66
|
+
(event.key === 'Backspace' || event.key === 'Delete') &&
|
|
67
|
+
(start !== 0 || end !== value.length)
|
|
68
|
+
) {
|
|
69
|
+
const selectionText = value.substring(start, end).replace(/[0-9]/g, ' ');
|
|
70
|
+
inputEl.value = value.slice(0, start) + selectionText + value.substring(end);
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
} else if (
|
|
73
|
+
(event.key === 'Backspace' || event.key === 'Delete') &&
|
|
74
|
+
start === 0 && end === value.length
|
|
75
|
+
) { // Clear all
|
|
76
|
+
if (instance instanceof DateRange) {
|
|
77
|
+
instance.value = [];
|
|
78
|
+
} else {
|
|
79
|
+
instance.value = '';
|
|
80
|
+
}
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
} else {
|
|
83
|
+
if (!isPrintableKey(event.key) || isMaskDelimiterFn(event.key, 0)) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
// Adjust cursor position to the next editable character for both DateInput and DateRange
|
|
87
|
+
start = findNextEditablePosition(value, start);
|
|
88
|
+
|
|
89
|
+
const firstSlice = value.slice(0, start);
|
|
90
|
+
const secondSlice = value.slice(start + 1);
|
|
91
|
+
|
|
92
|
+
inputEl.value = firstSlice + event.key + secondSlice;
|
|
93
|
+
const nextPos = findNextEditablePosition(value, start + 1);
|
|
94
|
+
inputEl.selectionStart = nextPos;
|
|
95
|
+
inputEl.selectionEnd = nextPos;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
onMounted(() => {
|
|
100
|
+
const afterKeydown = instance.events.afterKeydown;
|
|
101
|
+
const afterKeydownEvents = Array.isArray(afterKeydown) ? afterKeydown : [afterKeydown];
|
|
102
|
+
|
|
103
|
+
afterKeydownEvents.push(({ event }: { event?: Event }) => keydown(event));
|
|
104
|
+
|
|
105
|
+
instance.events.afterKeydown = afterKeydownEvents.filter((f) => f);
|
|
106
|
+
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DateInput, DateRange } from '@zeedhi/common';
|
|
2
|
+
import { UnwrapNestedRefs, computed } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Composable to create a computed property to be used as a v-model for a date picker.
|
|
6
|
+
* It acts as a bridge between the date picker and the component's `getNativeDate` and `setNativeDate` methods.
|
|
7
|
+
* @param instance The instance of the date component (e.g., DateInput, DateRange).
|
|
8
|
+
*/
|
|
9
|
+
export function usePickerValue(instance: UnwrapNestedRefs<DateInput | DateRange>) {
|
|
10
|
+
const pickerValue = computed({
|
|
11
|
+
get: () => {
|
|
12
|
+
return instance.getNativeDate();
|
|
13
|
+
},
|
|
14
|
+
set: (value: any) => {
|
|
15
|
+
instance.setNativeDate(value);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
pickerValue,
|
|
21
|
+
};
|
|
22
|
+
}
|