adata-ui 4.0.43 → 4.0.44
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/README.md +84 -84
- package/dist/module.json +1 -1
- package/dist/runtime/components/Alert.vue +26 -26
- package/dist/runtime/components/Chip.vue +24 -0
- package/dist/runtime/components/Chip.vue.d.ts +19 -0
- package/dist/runtime/components/DigitBadge.vue.d.ts +1 -1
- package/dist/runtime/components/Header.vue.d.ts +1 -1
- package/dist/runtime/components/Tag.vue +4 -4
- package/dist/runtime/components/accordion/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/button/Button.vue +1 -1
- package/dist/runtime/components/button/Button.vue.d.ts +3 -3
- package/dist/runtime/components/forms/input/textarea/ATextarea.vue.d.ts +1 -1
- package/dist/runtime/components/pill-tabs/PillTabs.vue.d.ts +1 -1
- package/dist/runtime/components/row-card/RowCard.vue +1 -1
- package/dist/runtime/components/select-row/index.vue +117 -0
- package/dist/runtime/components/select-row/index.vue.d.ts +31 -0
- package/dist/runtime/components/tree-select/TreeSelect.vue +132 -0
- package/dist/runtime/components/tree-select/TreeSelect.vue.d.ts +22 -0
- package/dist/runtime/components/tree-select/TreeService.d.ts +54 -0
- package/dist/runtime/components/tree-select/TreeService.js +209 -0
- package/dist/runtime/components/tree-select/components/tree-select-nodes.vue +100 -0
- package/dist/runtime/components/tree-select/components/tree-select-nodes.vue.d.ts +9 -0
- package/dist/runtime/components/tree-select/types.d.ts +29 -0
- package/dist/runtime/components/tree-select/types.js +0 -0
- package/dist/runtime/composables/highlight.d.ts +1 -0
- package/dist/runtime/composables/highlight.js +15 -0
- package/dist/runtime/composables/projectState.d.ts +2 -2
- package/dist/runtime/i18n.d.ts +1 -1
- package/dist/runtime/icons/arrow/arrow-right.vue +24 -24
- package/dist/runtime/icons/calendar.vue +24 -24
- package/dist/runtime/icons/download.vue +26 -26
- package/dist/runtime/icons/file/excel.vue +88 -88
- package/dist/runtime/icons/more.vue +36 -36
- package/dist/runtime/icons/plus-circle.vue +24 -24
- package/dist/runtime/icons/upload.vue +26 -26
- package/dist/runtime/icons/warning-triangle.vue +29 -29
- package/dist/runtime/server/tsconfig.json +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TreeData } from './types.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
options: TreeData[];
|
|
4
|
+
modelValue: (string | number)[];
|
|
5
|
+
type?: 'checkbox' | 'select';
|
|
6
|
+
isSearch?: boolean;
|
|
7
|
+
searchText?: string;
|
|
8
|
+
asyncSearch?: (keyword: string) => TreeData[];
|
|
9
|
+
withoutId?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import("vue").DefineComponent<Props, {
|
|
12
|
+
reset: () => void;
|
|
13
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
|
+
"update:modelValue": (item: (string | number)[]) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((item: (string | number)[]) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
type: "checkbox" | "select";
|
|
19
|
+
searchText: string;
|
|
20
|
+
withoutId: boolean;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { TreeData, TreeNestedNode, TreeNode, TreeNodeStateEditable } from './types.js';
|
|
2
|
+
export declare const useTreeService: (withoutId?: boolean) => {
|
|
3
|
+
tree: import("vue").Ref<(Map<string | number, {
|
|
4
|
+
id: string | number;
|
|
5
|
+
name: string;
|
|
6
|
+
state: import("./types.js").TreeNodeState;
|
|
7
|
+
level: number;
|
|
8
|
+
expandable: boolean;
|
|
9
|
+
expandableClosed: boolean;
|
|
10
|
+
parent: string | number | null;
|
|
11
|
+
hidden?: boolean | undefined;
|
|
12
|
+
child: (string | number)[];
|
|
13
|
+
}> & Omit<Map<string | number, TreeNode>, keyof Map<any, any>>) | null, Map<string | number, TreeNode> | (Map<string | number, {
|
|
14
|
+
id: string | number;
|
|
15
|
+
name: string;
|
|
16
|
+
state: import("./types.js").TreeNodeState;
|
|
17
|
+
level: number;
|
|
18
|
+
expandable: boolean;
|
|
19
|
+
expandableClosed: boolean;
|
|
20
|
+
parent: string | number | null;
|
|
21
|
+
hidden?: boolean | undefined;
|
|
22
|
+
child: (string | number)[];
|
|
23
|
+
}> & Omit<Map<string | number, TreeNode>, keyof Map<any, any>>) | null>;
|
|
24
|
+
nestedTree: import("vue").Ref<{
|
|
25
|
+
id: string | number;
|
|
26
|
+
name: string;
|
|
27
|
+
state: import("./types.js").TreeNodeState;
|
|
28
|
+
level: number;
|
|
29
|
+
expandable: boolean;
|
|
30
|
+
expandableClosed: boolean;
|
|
31
|
+
text: string;
|
|
32
|
+
hidden: boolean;
|
|
33
|
+
child: /*elided*/ any[];
|
|
34
|
+
}[], TreeNestedNode[] | {
|
|
35
|
+
id: string | number;
|
|
36
|
+
name: string;
|
|
37
|
+
state: import("./types.js").TreeNodeState;
|
|
38
|
+
level: number;
|
|
39
|
+
expandable: boolean;
|
|
40
|
+
expandableClosed: boolean;
|
|
41
|
+
text: string;
|
|
42
|
+
hidden: boolean;
|
|
43
|
+
child: /*elided*/ any[];
|
|
44
|
+
}[]>;
|
|
45
|
+
initTree: (data: TreeData[]) => void;
|
|
46
|
+
setState: (idNode: string | number, state: TreeNodeStateEditable) => void;
|
|
47
|
+
reset: () => void;
|
|
48
|
+
setExpandableClosed: (idNode: string | number, expandableClosed: boolean) => void;
|
|
49
|
+
collectSelectedIds: (tree: Map<string | number, TreeNode>) => (string | number)[];
|
|
50
|
+
updateNestedTree: (searchText?: string) => void;
|
|
51
|
+
searchedData: (data: TreeData[], searchText: string) => void;
|
|
52
|
+
toggleHiddenNodes: (hidden: boolean) => void;
|
|
53
|
+
toggleExpandableNodes: (expandableClosed: boolean) => void;
|
|
54
|
+
};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import highlight from "../../composables/highlight.js";
|
|
2
|
+
import { ref } from "#imports";
|
|
3
|
+
export const useTreeService = (withoutId) => {
|
|
4
|
+
const tree = ref(null);
|
|
5
|
+
const nestedTree = ref([]);
|
|
6
|
+
const createdTreeBool = ref(false);
|
|
7
|
+
const initTree = (data) => {
|
|
8
|
+
if (!createdTreeBool.value) {
|
|
9
|
+
tree.value = generateTree(data, 0);
|
|
10
|
+
createdTreeBool.value = true;
|
|
11
|
+
updateNestedTree();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const generateTree = (data, level, parent = null) => {
|
|
15
|
+
const treeMap = /* @__PURE__ */ new Map();
|
|
16
|
+
data.forEach((item) => {
|
|
17
|
+
const id = item.id;
|
|
18
|
+
const child = item.children ? item.children.map((child2) => child2.id) : [];
|
|
19
|
+
treeMap.set(id, {
|
|
20
|
+
id,
|
|
21
|
+
name: item.name,
|
|
22
|
+
level,
|
|
23
|
+
expandable: child.length > 0,
|
|
24
|
+
expandableClosed: true,
|
|
25
|
+
child,
|
|
26
|
+
parent,
|
|
27
|
+
state: "unchecked",
|
|
28
|
+
hidden: false
|
|
29
|
+
});
|
|
30
|
+
if (item.children && item.children.length > 0) {
|
|
31
|
+
const childTreeMap = generateTree(item.children, level + 1, id);
|
|
32
|
+
childTreeMap.forEach((value, key) => treeMap.set(key, value));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return treeMap;
|
|
36
|
+
};
|
|
37
|
+
const updateNestedTree = (searchText = "") => {
|
|
38
|
+
if (!tree.value) return;
|
|
39
|
+
const nodesFromLevel0 = getNodesByLevel(0);
|
|
40
|
+
nestedTree.value = nodesFromLevel0.map((flatNode) => createNestedNode(flatNode));
|
|
41
|
+
highlightTree(nestedTree.value, searchText);
|
|
42
|
+
};
|
|
43
|
+
function highlightTree(nodes, searchText) {
|
|
44
|
+
nodes.forEach((node) => {
|
|
45
|
+
node.text = highlight(node.text, searchText);
|
|
46
|
+
if (node.child.length) {
|
|
47
|
+
highlightTree(node.child, searchText);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const createNestedNode = (node) => {
|
|
52
|
+
return {
|
|
53
|
+
id: node.id,
|
|
54
|
+
name: node.name,
|
|
55
|
+
text: withoutId ? `${node.name}` : `${node.id} - ${node.name}`,
|
|
56
|
+
state: node.state,
|
|
57
|
+
level: node.level,
|
|
58
|
+
expandable: node.expandable,
|
|
59
|
+
expandableClosed: node.expandableClosed,
|
|
60
|
+
hidden: node?.hidden ?? false,
|
|
61
|
+
child: node.child.map((id) => {
|
|
62
|
+
const childNode = getNodeById(id);
|
|
63
|
+
return childNode ? createNestedNode(childNode) : null;
|
|
64
|
+
}).filter((n) => n)
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
const getNodeById = (idNode) => {
|
|
68
|
+
if (!tree.value) return null;
|
|
69
|
+
return tree.value.get(idNode) || null;
|
|
70
|
+
};
|
|
71
|
+
const getChildNodesFromNode = (idNode) => {
|
|
72
|
+
if (!tree.value) return [];
|
|
73
|
+
const node = getNodeById(idNode);
|
|
74
|
+
if (!node) return [];
|
|
75
|
+
return node.child.map((id) => getNodeById(id)).filter((n) => n);
|
|
76
|
+
};
|
|
77
|
+
const getParentNode = (idNode) => {
|
|
78
|
+
if (!tree.value) return null;
|
|
79
|
+
const node = getNodeById(idNode);
|
|
80
|
+
if (!node || !node.parent) return null;
|
|
81
|
+
return getNodeById(node.parent);
|
|
82
|
+
};
|
|
83
|
+
const getNodesByLevel = (level) => {
|
|
84
|
+
if (!tree.value) return [];
|
|
85
|
+
const nodes = [];
|
|
86
|
+
tree.value.forEach((node) => {
|
|
87
|
+
if (node.level === level) {
|
|
88
|
+
nodes.push(node);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return nodes;
|
|
92
|
+
};
|
|
93
|
+
const setState = (idNode, state) => {
|
|
94
|
+
if (!tree.value) return;
|
|
95
|
+
const node = getNodeById(idNode);
|
|
96
|
+
if (!node) return;
|
|
97
|
+
node.state = state;
|
|
98
|
+
tree.value.set(idNode, node);
|
|
99
|
+
setStateChildNodes(node, state);
|
|
100
|
+
setStateParentNodes(node);
|
|
101
|
+
updateNestedTree();
|
|
102
|
+
};
|
|
103
|
+
const setStateChildNodes = (node, state) => {
|
|
104
|
+
if (!tree.value) return;
|
|
105
|
+
node.child.forEach((id) => {
|
|
106
|
+
const childNode = getNodeById(id);
|
|
107
|
+
if (childNode) {
|
|
108
|
+
childNode.state = state;
|
|
109
|
+
tree.value.set(id, childNode);
|
|
110
|
+
setStateChildNodes(childNode, state);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
const setStateParentNodes = (node) => {
|
|
115
|
+
if (!tree.value) return;
|
|
116
|
+
const parentNode = getParentNode(node.id);
|
|
117
|
+
if (!parentNode) return;
|
|
118
|
+
const childNodes = getChildNodesFromNode(parentNode.id);
|
|
119
|
+
const checkedCount = childNodes.filter((n) => n.state === "checked").length;
|
|
120
|
+
const indeterminateCount = childNodes.filter((n) => n.state === "indeterminate").length;
|
|
121
|
+
if (checkedCount === childNodes.length) {
|
|
122
|
+
parentNode.state = "checked";
|
|
123
|
+
} else if (checkedCount > 0 || indeterminateCount > 0) {
|
|
124
|
+
parentNode.state = "indeterminate";
|
|
125
|
+
} else {
|
|
126
|
+
parentNode.state = "unchecked";
|
|
127
|
+
}
|
|
128
|
+
tree.value.set(parentNode.id, parentNode);
|
|
129
|
+
setStateParentNodes(parentNode);
|
|
130
|
+
};
|
|
131
|
+
const setExpandableClosed = (idNode, expandableClosed) => {
|
|
132
|
+
if (!tree.value) return;
|
|
133
|
+
const node = getNodeById(idNode);
|
|
134
|
+
if (!node) return;
|
|
135
|
+
if (!expandableClosed && node.expandable && node.child.length === 0) {
|
|
136
|
+
}
|
|
137
|
+
node.expandableClosed = expandableClosed;
|
|
138
|
+
tree.value.set(node.id, node);
|
|
139
|
+
updateNestedTree();
|
|
140
|
+
};
|
|
141
|
+
const reset = () => {
|
|
142
|
+
if (!tree.value) return;
|
|
143
|
+
tree.value.forEach((node) => {
|
|
144
|
+
node.state = "unchecked";
|
|
145
|
+
});
|
|
146
|
+
updateNestedTree();
|
|
147
|
+
};
|
|
148
|
+
const collectSelectedIds = (tree2) => {
|
|
149
|
+
const selectedIds = /* @__PURE__ */ new Set();
|
|
150
|
+
const areAllChildrenChecked = (node) => {
|
|
151
|
+
const childNodes = getChildNodesFromNode(node.id);
|
|
152
|
+
return childNodes.length > 0 && childNodes.every((child) => child.state === "checked");
|
|
153
|
+
};
|
|
154
|
+
tree2.forEach((node) => {
|
|
155
|
+
if (node.state === "checked") {
|
|
156
|
+
if (node.parent && getNodeById(node.parent)?.state === "checked") {
|
|
157
|
+
return;
|
|
158
|
+
} else if (areAllChildrenChecked(node)) {
|
|
159
|
+
selectedIds.add(node.id);
|
|
160
|
+
} else {
|
|
161
|
+
selectedIds.add(node.id);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
return Array.from(selectedIds);
|
|
166
|
+
};
|
|
167
|
+
function hideSearchedData(data, searchText) {
|
|
168
|
+
data.forEach((node) => {
|
|
169
|
+
const existingNode = tree.value.get(node.id);
|
|
170
|
+
if (existingNode) {
|
|
171
|
+
tree.value.set(node.id, { ...existingNode, hidden: false, expandableClosed: false });
|
|
172
|
+
}
|
|
173
|
+
if (node.children?.length) {
|
|
174
|
+
hideSearchedData(node.children);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
function searchedData(data, searchText) {
|
|
179
|
+
if (!tree.value) return;
|
|
180
|
+
toggleHiddenNodes(true);
|
|
181
|
+
hideSearchedData(data, searchText);
|
|
182
|
+
updateNestedTree(searchText);
|
|
183
|
+
}
|
|
184
|
+
const toggleHiddenNodes = (hidden) => {
|
|
185
|
+
if (!tree.value) return;
|
|
186
|
+
tree.value.forEach((node, key) => {
|
|
187
|
+
tree.value.set(key, { ...node, hidden });
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
const toggleExpandableNodes = (expandableClosed) => {
|
|
191
|
+
if (!tree.value) return;
|
|
192
|
+
tree.value.forEach((node, key) => {
|
|
193
|
+
tree.value.set(key, { ...node, expandableClosed });
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
return {
|
|
197
|
+
tree,
|
|
198
|
+
nestedTree,
|
|
199
|
+
initTree,
|
|
200
|
+
setState,
|
|
201
|
+
reset,
|
|
202
|
+
setExpandableClosed,
|
|
203
|
+
collectSelectedIds,
|
|
204
|
+
updateNestedTree,
|
|
205
|
+
searchedData,
|
|
206
|
+
toggleHiddenNodes,
|
|
207
|
+
toggleExpandableNodes
|
|
208
|
+
};
|
|
209
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<li
|
|
3
|
+
:style="{ 'padding-left': `${node.level * 20}px` }"
|
|
4
|
+
:class="[
|
|
5
|
+
{ 'bg-[#2C3E500D] dark:bg-[#E3E5E80D]': node.state === 'checked' && type === 'select' }
|
|
6
|
+
]"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
v-if="!node?.hidden"
|
|
10
|
+
class="flex items-center gap-1 p-2"
|
|
11
|
+
>
|
|
12
|
+
<div class="min-w-4">
|
|
13
|
+
<i-chevron-down
|
|
14
|
+
v-if="node.expandable"
|
|
15
|
+
width="16"
|
|
16
|
+
height="16"
|
|
17
|
+
:class="['cursor-pointer transition-all', { '-rotate-90': node.expandableClosed }]"
|
|
18
|
+
@click="toggleExpand(node)"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
<div
|
|
22
|
+
v-if="type === 'select'"
|
|
23
|
+
class="w-full"
|
|
24
|
+
>
|
|
25
|
+
<input
|
|
26
|
+
:id="node.id.toString()"
|
|
27
|
+
type="checkbox"
|
|
28
|
+
class="hidden"
|
|
29
|
+
:checked="node.state === 'checked'"
|
|
30
|
+
@change="handleCheckboxChange"
|
|
31
|
+
>
|
|
32
|
+
<label
|
|
33
|
+
:for="node.id.toString()"
|
|
34
|
+
class="flex grow cursor-pointer items-center justify-between gap-4"
|
|
35
|
+
>
|
|
36
|
+
<span
|
|
37
|
+
:class="{ 'font-semibold': node.level === 0 }"
|
|
38
|
+
v-html="node.text"
|
|
39
|
+
/>
|
|
40
|
+
<checkbox-active
|
|
41
|
+
v-if="node.state === 'checked'"
|
|
42
|
+
class="min-w-4 text-blue-700"
|
|
43
|
+
/>
|
|
44
|
+
</label>
|
|
45
|
+
</div>
|
|
46
|
+
<adt-checkbox
|
|
47
|
+
v-if="type === 'checkbox'"
|
|
48
|
+
size="lg"
|
|
49
|
+
:model-value="node.state === 'checked'"
|
|
50
|
+
:name="`${node.id}`"
|
|
51
|
+
:intermediate="node.state === 'indeterminate'"
|
|
52
|
+
side="right"
|
|
53
|
+
always-intermediate
|
|
54
|
+
@change="handleCheckboxChange"
|
|
55
|
+
>
|
|
56
|
+
<span
|
|
57
|
+
class="heading-05"
|
|
58
|
+
v-html="node.text"
|
|
59
|
+
/>
|
|
60
|
+
</adt-checkbox>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<!-- <a-transition-height> -->
|
|
64
|
+
<ul v-if="node.expandable && !node.expandableClosed">
|
|
65
|
+
<template
|
|
66
|
+
v-for="childNode in node.child"
|
|
67
|
+
:key="childNode.id"
|
|
68
|
+
>
|
|
69
|
+
<tree-select-nodes
|
|
70
|
+
:node="childNode"
|
|
71
|
+
:toggle-expand="toggleExpand"
|
|
72
|
+
:toggle-checkbox="toggleCheckbox"
|
|
73
|
+
:type="type"
|
|
74
|
+
/>
|
|
75
|
+
</template>
|
|
76
|
+
</ul>
|
|
77
|
+
<!-- </a-transition-height> -->
|
|
78
|
+
</li>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script setup>
|
|
82
|
+
import IChevronDown from "#icons/arrow/chevron-down.vue";
|
|
83
|
+
import CheckboxActive from "#icons/checkbox/checkbox-active.vue";
|
|
84
|
+
const props = defineProps({
|
|
85
|
+
node: { type: Object, required: true },
|
|
86
|
+
toggleExpand: { type: Function, required: true },
|
|
87
|
+
toggleCheckbox: { type: Function, required: true },
|
|
88
|
+
type: { type: String, required: true }
|
|
89
|
+
});
|
|
90
|
+
const handleCheckboxChange = (event) => {
|
|
91
|
+
props.toggleCheckbox(props.node.id, event.target.checked);
|
|
92
|
+
};
|
|
93
|
+
const toggleExpand = (node) => {
|
|
94
|
+
props.toggleExpand(node);
|
|
95
|
+
};
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style scoped>
|
|
99
|
+
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TreeNestedNode } from '~/src/runtime/components/tree-select/types';
|
|
2
|
+
interface Props {
|
|
3
|
+
node: TreeNestedNode;
|
|
4
|
+
toggleExpand: Function;
|
|
5
|
+
toggleCheckbox: Function;
|
|
6
|
+
type: 'checkbox' | 'select';
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface TreeNode {
|
|
2
|
+
id: string | number;
|
|
3
|
+
name: string;
|
|
4
|
+
state: TreeNodeState;
|
|
5
|
+
level: number;
|
|
6
|
+
expandable: boolean;
|
|
7
|
+
expandableClosed: boolean;
|
|
8
|
+
parent: string | number | null;
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
child: (string | number)[];
|
|
11
|
+
}
|
|
12
|
+
export interface TreeNestedNode {
|
|
13
|
+
id: string | number;
|
|
14
|
+
name: string;
|
|
15
|
+
state: TreeNodeState;
|
|
16
|
+
level: number;
|
|
17
|
+
expandable: boolean;
|
|
18
|
+
expandableClosed: boolean;
|
|
19
|
+
text: string;
|
|
20
|
+
hidden: boolean;
|
|
21
|
+
child: TreeNestedNode[];
|
|
22
|
+
}
|
|
23
|
+
export type TreeData = {
|
|
24
|
+
id: number | string;
|
|
25
|
+
name: string;
|
|
26
|
+
children?: TreeData[];
|
|
27
|
+
};
|
|
28
|
+
export type TreeNodeState = 'checked' | 'unchecked' | 'indeterminate';
|
|
29
|
+
export type TreeNodeStateEditable = 'checked' | 'unchecked';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (text: string, search?: string): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function(text, search = "") {
|
|
2
|
+
let label = text || "";
|
|
3
|
+
const index = label.toLowerCase().indexOf(search?.toLowerCase());
|
|
4
|
+
const regExp = new RegExp(search, "gi");
|
|
5
|
+
if (index >= 0) {
|
|
6
|
+
label = label.replace(
|
|
7
|
+
regExp,
|
|
8
|
+
`<span class="bg-yellow-200 dark:text-gray-950 dark:bg-yellow-300">${label.substring(
|
|
9
|
+
index,
|
|
10
|
+
index + search.length
|
|
11
|
+
)}</span>`
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
return label;
|
|
15
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const useCurrentModule: () =>
|
|
2
|
-
export declare const useContacts: () => any
|
|
1
|
+
export declare const useCurrentModule: () => import("vue").Ref<string, string>;
|
|
2
|
+
export declare const useContacts: () => import("vue").Ref<any, any>;
|
package/dist/runtime/i18n.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<template>
|
|
6
|
-
<svg
|
|
7
|
-
width="25"
|
|
8
|
-
height="24"
|
|
9
|
-
viewBox="0 0 25 24"
|
|
10
|
-
fill="none"
|
|
11
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
-
>
|
|
13
|
-
<path
|
|
14
|
-
fill-rule="evenodd"
|
|
15
|
-
clip-rule="evenodd"
|
|
16
|
-
d="M8.70938 5.23017C8.99647 4.93159 9.47125 4.92228 9.76983 5.20938L16.2698 11.4594C16.4169 11.6008 16.5 11.796 16.5 12C16.5 12.204 16.4169 12.3992 16.2698 12.5406L9.76983 18.7906C9.47125 19.0777 8.99647 19.0684 8.70938 18.7698C8.42228 18.4713 8.43159 17.9965 8.73017 17.7094L14.6679 12L8.73017 6.29063C8.43159 6.00353 8.42228 5.52875 8.70938 5.23017Z"
|
|
17
|
-
fill="currentColor"
|
|
18
|
-
/>
|
|
19
|
-
</svg>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<style scoped>
|
|
23
|
-
|
|
24
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<svg
|
|
7
|
+
width="25"
|
|
8
|
+
height="24"
|
|
9
|
+
viewBox="0 0 25 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill-rule="evenodd"
|
|
15
|
+
clip-rule="evenodd"
|
|
16
|
+
d="M8.70938 5.23017C8.99647 4.93159 9.47125 4.92228 9.76983 5.20938L16.2698 11.4594C16.4169 11.6008 16.5 11.796 16.5 12C16.5 12.204 16.4169 12.3992 16.2698 12.5406L9.76983 18.7906C9.47125 19.0777 8.99647 19.0684 8.70938 18.7698C8.42228 18.4713 8.43159 17.9965 8.73017 17.7094L14.6679 12L8.73017 6.29063C8.43159 6.00353 8.42228 5.52875 8.70938 5.23017Z"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<style scoped>
|
|
23
|
+
|
|
24
|
+
</style>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<template>
|
|
6
|
-
<svg
|
|
7
|
-
width="16"
|
|
8
|
-
height="16"
|
|
9
|
-
viewBox="0 0 16 16"
|
|
10
|
-
fill="none"
|
|
11
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
-
>
|
|
13
|
-
<path
|
|
14
|
-
fill-rule="evenodd"
|
|
15
|
-
clip-rule="evenodd"
|
|
16
|
-
d="M10.5669 1C10.8568 1 11.0919 1.23505 11.0919 1.525V2.295H12.4919C13.495 2.295 14.3002 3.11434 14.3002 4.115V6.70493V13.18C14.3002 14.1807 13.495 15 12.4919 15H3.50853C2.50534 15 1.7002 14.1807 1.7002 13.18V6.70493V4.115C1.7002 3.11434 2.50534 2.295 3.50853 2.295H4.90857V1.525C4.90857 1.23505 5.14362 1 5.43356 1C5.72351 1 5.95856 1.23505 5.95856 1.525V2.295H10.0419V1.525C10.0419 1.23505 10.2769 1 10.5669 1ZM4.90857 3.345V4.11439C4.90857 4.40434 5.14362 4.63939 5.43356 4.63939C5.72351 4.63939 5.95856 4.40434 5.95856 4.11439V3.345H10.0419V4.11439C10.0419 4.40434 10.2769 4.63939 10.5669 4.63939C10.8568 4.63939 11.0919 4.40434 11.0919 4.11439V3.345H12.4919C12.9062 3.345 13.2502 3.68525 13.2502 4.115V6.17993H2.75019V4.115C2.75019 3.68525 3.09418 3.345 3.50853 3.345H4.90857ZM13.2502 7.22993V13.18C13.2502 13.6098 12.9062 13.95 12.4919 13.95H3.50853C3.09418 13.95 2.75019 13.6098 2.75019 13.18V7.22993H13.2502Z"
|
|
17
|
-
fill="currentColor"
|
|
18
|
-
/>
|
|
19
|
-
</svg>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<style scoped>
|
|
23
|
-
|
|
24
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<svg
|
|
7
|
+
width="16"
|
|
8
|
+
height="16"
|
|
9
|
+
viewBox="0 0 16 16"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill-rule="evenodd"
|
|
15
|
+
clip-rule="evenodd"
|
|
16
|
+
d="M10.5669 1C10.8568 1 11.0919 1.23505 11.0919 1.525V2.295H12.4919C13.495 2.295 14.3002 3.11434 14.3002 4.115V6.70493V13.18C14.3002 14.1807 13.495 15 12.4919 15H3.50853C2.50534 15 1.7002 14.1807 1.7002 13.18V6.70493V4.115C1.7002 3.11434 2.50534 2.295 3.50853 2.295H4.90857V1.525C4.90857 1.23505 5.14362 1 5.43356 1C5.72351 1 5.95856 1.23505 5.95856 1.525V2.295H10.0419V1.525C10.0419 1.23505 10.2769 1 10.5669 1ZM4.90857 3.345V4.11439C4.90857 4.40434 5.14362 4.63939 5.43356 4.63939C5.72351 4.63939 5.95856 4.40434 5.95856 4.11439V3.345H10.0419V4.11439C10.0419 4.40434 10.2769 4.63939 10.5669 4.63939C10.8568 4.63939 11.0919 4.40434 11.0919 4.11439V3.345H12.4919C12.9062 3.345 13.2502 3.68525 13.2502 4.115V6.17993H2.75019V4.115C2.75019 3.68525 3.09418 3.345 3.50853 3.345H4.90857ZM13.2502 7.22993V13.18C13.2502 13.6098 12.9062 13.95 12.4919 13.95H3.50853C3.09418 13.95 2.75019 13.6098 2.75019 13.18V7.22993H13.2502Z"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<style scoped>
|
|
23
|
+
|
|
24
|
+
</style>
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<template>
|
|
6
|
-
<svg
|
|
7
|
-
width="16"
|
|
8
|
-
height="16"
|
|
9
|
-
viewBox="0 0 16 16"
|
|
10
|
-
fill="none"
|
|
11
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
-
>
|
|
13
|
-
<path
|
|
14
|
-
d="M8.52496 1.525C8.52496 1.23505 8.28991 1 7.99996 1C7.71001 1 7.47496 1.23505 7.47496 1.525V9.97001L6.21285 8.7079C6.00783 8.50288 5.67542 8.50288 5.4704 8.7079C5.26537 8.91293 5.26537 9.24534 5.4704 9.45036L7.62872 11.6087C7.72717 11.7071 7.86071 11.7625 7.99994 11.7625C8.13918 11.7625 8.27272 11.7071 8.37117 11.6087L10.5295 9.45036C10.7345 9.24534 10.7345 8.91293 10.5295 8.7079C10.3245 8.50288 9.99206 8.50288 9.78704 8.7079L8.52496 9.96999V1.525Z"
|
|
15
|
-
fill="currentColor"
|
|
16
|
-
/>
|
|
17
|
-
<path
|
|
18
|
-
d="M1.525 10.7124C1.81494 10.7124 2.04999 10.9475 2.04999 11.2374V13.9499H13.9499V11.2374C13.9499 10.9475 14.185 10.7124 14.4749 10.7124C14.7649 10.7124 14.9999 10.9475 14.9999 11.2374V14.4749C14.9999 14.7649 14.7649 14.9999 14.4749 14.9999H1.525C1.23505 14.9999 1 14.7649 1 14.4749V11.2374C1 10.9475 1.23505 10.7124 1.525 10.7124Z"
|
|
19
|
-
fill="currentColor"
|
|
20
|
-
/>
|
|
21
|
-
</svg>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<style scoped>
|
|
25
|
-
|
|
26
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<svg
|
|
7
|
+
width="16"
|
|
8
|
+
height="16"
|
|
9
|
+
viewBox="0 0 16 16"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
d="M8.52496 1.525C8.52496 1.23505 8.28991 1 7.99996 1C7.71001 1 7.47496 1.23505 7.47496 1.525V9.97001L6.21285 8.7079C6.00783 8.50288 5.67542 8.50288 5.4704 8.7079C5.26537 8.91293 5.26537 9.24534 5.4704 9.45036L7.62872 11.6087C7.72717 11.7071 7.86071 11.7625 7.99994 11.7625C8.13918 11.7625 8.27272 11.7071 8.37117 11.6087L10.5295 9.45036C10.7345 9.24534 10.7345 8.91293 10.5295 8.7079C10.3245 8.50288 9.99206 8.50288 9.78704 8.7079L8.52496 9.96999V1.525Z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
<path
|
|
18
|
+
d="M1.525 10.7124C1.81494 10.7124 2.04999 10.9475 2.04999 11.2374V13.9499H13.9499V11.2374C13.9499 10.9475 14.185 10.7124 14.4749 10.7124C14.7649 10.7124 14.9999 10.9475 14.9999 11.2374V14.4749C14.9999 14.7649 14.7649 14.9999 14.4749 14.9999H1.525C1.23505 14.9999 1 14.7649 1 14.4749V11.2374C1 10.9475 1.23505 10.7124 1.525 10.7124Z"
|
|
19
|
+
fill="currentColor"
|
|
20
|
+
/>
|
|
21
|
+
</svg>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<style scoped>
|
|
25
|
+
|
|
26
|
+
</style>
|