ll-plus 2.1.10 → 2.1.12
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/es/component.mjs +2 -0
- package/es/component.mjs.map +1 -1
- package/es/components/code-editor/src/code-editor.vue2.mjs.map +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +2 -0
- package/es/components/index.mjs.map +1 -1
- package/es/components/key-value/index.d.ts +4 -4
- package/es/components/key-value/src/components/key-value-item.vue.d.ts +2 -2
- package/es/components/key-value/src/components/key-value-item.vue2.mjs +6 -2
- package/es/components/key-value/src/components/key-value-item.vue2.mjs.map +1 -1
- package/es/components/key-value/src/config/key-value-item.d.ts +2 -2
- package/es/components/key-value/src/config/key-value-item.mjs.map +1 -1
- package/es/components/key-value/src/config/key-value.d.ts +3 -3
- package/es/components/key-value/src/config/key-value.mjs +2 -2
- package/es/components/key-value/src/config/key-value.mjs.map +1 -1
- package/es/components/key-value/src/key-value.vue.d.ts +4 -4
- package/es/components/key-value/src/key-value.vue2.mjs +7 -4
- package/es/components/key-value/src/key-value.vue2.mjs.map +1 -1
- package/es/components/tag-group/index.d.ts +394 -0
- package/es/components/tag-group/index.mjs +10 -0
- package/es/components/tag-group/index.mjs.map +1 -0
- package/es/components/tag-group/src/tag-group.d.ts +14 -0
- package/es/components/tag-group/src/tag-group.mjs +22 -0
- package/es/components/tag-group/src/tag-group.mjs.map +1 -0
- package/es/components/tag-group/src/tag-group.vue.d.ts +388 -0
- package/es/components/tag-group/src/tag-group.vue.mjs +8 -0
- package/es/components/tag-group/src/tag-group.vue.mjs.map +1 -0
- package/es/components/tag-group/src/tag-group.vue2.mjs +325 -0
- package/es/components/tag-group/src/tag-group.vue2.mjs.map +1 -0
- package/es/index.mjs +2 -0
- package/es/index.mjs.map +1 -1
- package/es/utils/props/runtime.d.ts +2 -2
- package/global.d.ts +1 -0
- package/index.full.js +474 -127
- package/index.full.min.js +21 -21
- package/index.full.min.js.map +1 -1
- package/index.full.min.mjs +21 -21
- package/index.full.min.mjs.map +1 -1
- package/index.full.mjs +474 -130
- package/lib/component.js +18 -16
- package/lib/component.js.map +1 -1
- package/lib/components/code-editor/src/code-editor.vue2.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +22 -17
- package/lib/components/index.js.map +1 -1
- package/lib/components/key-value/index.d.ts +4 -4
- package/lib/components/key-value/src/components/key-value-item.vue.d.ts +2 -2
- package/lib/components/key-value/src/components/key-value-item.vue2.js +6 -2
- package/lib/components/key-value/src/components/key-value-item.vue2.js.map +1 -1
- package/lib/components/key-value/src/config/key-value-item.d.ts +2 -2
- package/lib/components/key-value/src/config/key-value-item.js.map +1 -1
- package/lib/components/key-value/src/config/key-value.d.ts +3 -3
- package/lib/components/key-value/src/config/key-value.js +2 -2
- package/lib/components/key-value/src/config/key-value.js.map +1 -1
- package/lib/components/key-value/src/key-value.vue.d.ts +4 -4
- package/lib/components/key-value/src/key-value.vue2.js +6 -3
- package/lib/components/key-value/src/key-value.vue2.js.map +1 -1
- package/lib/components/tag-group/index.d.ts +394 -0
- package/lib/components/tag-group/index.js +17 -0
- package/lib/components/tag-group/index.js.map +1 -0
- package/lib/components/tag-group/src/tag-group.d.ts +14 -0
- package/lib/components/tag-group/src/tag-group.js +25 -0
- package/lib/components/tag-group/src/tag-group.js.map +1 -0
- package/lib/components/tag-group/src/tag-group.vue.d.ts +388 -0
- package/lib/components/tag-group/src/tag-group.vue.js +12 -0
- package/lib/components/tag-group/src/tag-group.vue.js.map +1 -0
- package/lib/components/tag-group/src/tag-group.vue2.js +329 -0
- package/lib/components/tag-group/src/tag-group.vue2.js.map +1 -0
- package/lib/index.js +22 -17
- package/lib/index.js.map +1 -1
- package/lib/utils/props/runtime.d.ts +2 -2
- package/package.json +1 -1
- package/theme-chalk/css/form.css +1 -1
- package/theme-chalk/css/index.css +1 -1
- package/theme-chalk/css/tag-group.css +5 -0
- package/types/packages/components/index.d.ts +1 -0
- package/types/packages/components/key-value/index.d.ts +4 -4
- package/types/packages/components/key-value/src/components/key-value-item.vue.d.ts +2 -2
- package/types/packages/components/key-value/src/config/key-value-item.d.ts +2 -2
- package/types/packages/components/key-value/src/config/key-value.d.ts +3 -3
- package/types/packages/components/key-value/src/key-value.vue.d.ts +4 -4
- package/types/packages/components/tag-group/index.d.ts +394 -0
- package/types/packages/components/tag-group/src/tag-group.d.ts +14 -0
- package/types/packages/components/tag-group/src/tag-group.vue.d.ts +388 -0
- package/types/packages/utils/props/runtime.d.ts +2 -2
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { defineComponent, ref, toRef, reactive, nextTick, watch, onMounted, onUnmounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, unref, createElementBlock, Fragment, renderList, toDisplayString, createVNode, createCommentVNode, withModifiers } from 'vue';
|
|
2
|
+
import { Form, Popover } from 'ant-design-vue';
|
|
3
|
+
import '../../../utils/index.mjs';
|
|
4
|
+
import { tagGroupProps, tagGroupEmits } from './tag-group.mjs';
|
|
5
|
+
import { createNamespace } from '../../../utils/create-namespace.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const _hoisted_1 = ["onClick"];
|
|
9
|
+
const _hoisted_2 = ["onClick"];
|
|
10
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
...{ name: "LlTagGroup" },
|
|
12
|
+
__name: "tag-group",
|
|
13
|
+
props: tagGroupProps,
|
|
14
|
+
emits: tagGroupEmits,
|
|
15
|
+
setup(__props, { emit: __emit }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const emits = __emit;
|
|
18
|
+
const bem = createNamespace("tag-group");
|
|
19
|
+
const formItemContext = Form.useInjectFormItemContext();
|
|
20
|
+
const loading = ref(false);
|
|
21
|
+
const inputValue = ref("");
|
|
22
|
+
const visible = ref(false);
|
|
23
|
+
const value = toRef(props.value?.length ? props.value.split(",") : []);
|
|
24
|
+
const more = ref(0);
|
|
25
|
+
const btnRef = ref();
|
|
26
|
+
const mouseMove = ref(false);
|
|
27
|
+
const tagsTypeRef = ref(null);
|
|
28
|
+
const tagRefs = reactive([]);
|
|
29
|
+
const filterOptionsValue = ref(props.options);
|
|
30
|
+
const innerOptions = ref(props.options);
|
|
31
|
+
const tagsTypeWidth = ref(0);
|
|
32
|
+
const shownArr = ref([]);
|
|
33
|
+
const getTagRefs = (i) => {
|
|
34
|
+
return (el) => {
|
|
35
|
+
if (el) {
|
|
36
|
+
tagRefs[i] = toRef(el);
|
|
37
|
+
} else {
|
|
38
|
+
tagRefs.splice(i, 1);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const getWidth = () => {
|
|
43
|
+
nextTick(() => {
|
|
44
|
+
if (tagsTypeRef.value) {
|
|
45
|
+
tagsTypeWidth.value = tagsTypeRef.value.offsetWidth - 90;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const handleEnter = () => {
|
|
50
|
+
let arr = value.value;
|
|
51
|
+
if (!inputValue.value)
|
|
52
|
+
return;
|
|
53
|
+
if (innerOptions.value.indexOf(inputValue.value) < 0) {
|
|
54
|
+
innerOptions.value.push(inputValue.value);
|
|
55
|
+
emits("update:options", innerOptions.value);
|
|
56
|
+
arr.push(inputValue.value);
|
|
57
|
+
} else {
|
|
58
|
+
if (arr.indexOf(inputValue.value) < 0) {
|
|
59
|
+
arr.push(inputValue.value);
|
|
60
|
+
} else {
|
|
61
|
+
arr = arr.filter((e) => e !== inputValue.value);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
value.value = arr;
|
|
65
|
+
};
|
|
66
|
+
const handleDel = (idx) => {
|
|
67
|
+
value.value.splice(idx, 1);
|
|
68
|
+
};
|
|
69
|
+
const handleClickFilter = (item) => {
|
|
70
|
+
let arr = value.value;
|
|
71
|
+
if (arr.indexOf(item) >= 0) {
|
|
72
|
+
arr = arr.filter((e) => e !== item);
|
|
73
|
+
} else {
|
|
74
|
+
arr.push(item);
|
|
75
|
+
}
|
|
76
|
+
value.value = arr;
|
|
77
|
+
};
|
|
78
|
+
watch(
|
|
79
|
+
() => props.options,
|
|
80
|
+
(n) => {
|
|
81
|
+
innerOptions.value = n;
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
deep: true,
|
|
85
|
+
immediate: true
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
watch(
|
|
89
|
+
[() => value.value.length, tagsTypeWidth],
|
|
90
|
+
async (n, o) => {
|
|
91
|
+
await nextTick();
|
|
92
|
+
const arr = [];
|
|
93
|
+
let moreLeftValue = 0;
|
|
94
|
+
for (const i in value.value) {
|
|
95
|
+
const tagetWidth = tagRefs[i].value.offsetWidth + 10;
|
|
96
|
+
if (moreLeftValue + tagetWidth >= n[1]) {
|
|
97
|
+
break;
|
|
98
|
+
} else {
|
|
99
|
+
moreLeftValue += tagetWidth;
|
|
100
|
+
arr.push(value.value[i]);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
more.value = n[0] - arr.length > 0 ? n[0] - arr.length : 0;
|
|
104
|
+
shownArr.value = arr;
|
|
105
|
+
emits("update:value", value.value.join(","));
|
|
106
|
+
emits("change", value.value.join(","));
|
|
107
|
+
if (o[0]) {
|
|
108
|
+
if (n[0] !== o[0]) {
|
|
109
|
+
formItemContext.onFieldChange();
|
|
110
|
+
formItemContext.onFieldBlur();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
deep: true,
|
|
116
|
+
immediate: true
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
watch(
|
|
120
|
+
() => [innerOptions, inputValue],
|
|
121
|
+
() => {
|
|
122
|
+
if (!inputValue.value)
|
|
123
|
+
filterOptionsValue.value = innerOptions.value;
|
|
124
|
+
filterOptionsValue.value = innerOptions.value.filter(
|
|
125
|
+
(e) => e.indexOf(inputValue.value) >= 0
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
deep: true,
|
|
130
|
+
immediate: true
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
onMounted(async () => {
|
|
134
|
+
getWidth();
|
|
135
|
+
window.addEventListener("resize", getWidth);
|
|
136
|
+
});
|
|
137
|
+
onUnmounted(() => {
|
|
138
|
+
window.removeEventListener("resize", getWidth);
|
|
139
|
+
});
|
|
140
|
+
return (_ctx, _cache) => {
|
|
141
|
+
const _component_ll_icon = resolveComponent("ll-icon");
|
|
142
|
+
const _component_LlInput = resolveComponent("LlInput");
|
|
143
|
+
const _component_a_spin = resolveComponent("a-spin");
|
|
144
|
+
return openBlock(), createBlock(_component_a_spin, { spinning: loading.value }, {
|
|
145
|
+
default: withCtx(() => [
|
|
146
|
+
createElementVNode(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
ref_key: "tagsTypeRef",
|
|
150
|
+
ref: tagsTypeRef,
|
|
151
|
+
class: normalizeClass(unref(bem).b())
|
|
152
|
+
},
|
|
153
|
+
[
|
|
154
|
+
createElementVNode(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
class: normalizeClass(unref(bem).e("tag-container"))
|
|
158
|
+
},
|
|
159
|
+
[
|
|
160
|
+
(openBlock(true), createElementBlock(
|
|
161
|
+
Fragment,
|
|
162
|
+
null,
|
|
163
|
+
renderList(value.value, (item, i) => {
|
|
164
|
+
return openBlock(), createElementBlock(
|
|
165
|
+
"div",
|
|
166
|
+
{
|
|
167
|
+
key: i,
|
|
168
|
+
ref_for: true,
|
|
169
|
+
ref: getTagRefs(i),
|
|
170
|
+
class: normalizeClass([
|
|
171
|
+
unref(bem).m("item"),
|
|
172
|
+
!shownArr.value.includes(item) ? unref(bem).is("hidden") : ""
|
|
173
|
+
])
|
|
174
|
+
},
|
|
175
|
+
[
|
|
176
|
+
createElementVNode(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
class: normalizeClass(unref(bem).m("text"))
|
|
180
|
+
},
|
|
181
|
+
toDisplayString(item),
|
|
182
|
+
3
|
|
183
|
+
/* TEXT, CLASS */
|
|
184
|
+
),
|
|
185
|
+
createElementVNode("span", {
|
|
186
|
+
class: normalizeClass(unref(bem).m("close")),
|
|
187
|
+
onClick: ($event) => handleDel(i)
|
|
188
|
+
}, [
|
|
189
|
+
createVNode(_component_ll_icon, {
|
|
190
|
+
"icon-name": "icon-close2",
|
|
191
|
+
color: "#909399",
|
|
192
|
+
"class-name": unref(bem).m("close-icon")
|
|
193
|
+
}, null, 8, ["class-name"])
|
|
194
|
+
], 10, _hoisted_1)
|
|
195
|
+
],
|
|
196
|
+
2
|
|
197
|
+
/* CLASS */
|
|
198
|
+
);
|
|
199
|
+
}),
|
|
200
|
+
128
|
|
201
|
+
/* KEYED_FRAGMENT */
|
|
202
|
+
))
|
|
203
|
+
],
|
|
204
|
+
2
|
|
205
|
+
/* CLASS */
|
|
206
|
+
),
|
|
207
|
+
createElementVNode(
|
|
208
|
+
"div",
|
|
209
|
+
{
|
|
210
|
+
class: normalizeClass(unref(bem).e("add-container"))
|
|
211
|
+
},
|
|
212
|
+
[
|
|
213
|
+
more.value > 0 ? (openBlock(), createElementBlock(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
key: 0,
|
|
217
|
+
class: normalizeClass(unref(bem).m("more"))
|
|
218
|
+
},
|
|
219
|
+
"+" + toDisplayString(more.value),
|
|
220
|
+
3
|
|
221
|
+
/* TEXT, CLASS */
|
|
222
|
+
)) : createCommentVNode("v-if", true),
|
|
223
|
+
createVNode(unref(Popover), {
|
|
224
|
+
visible: visible.value,
|
|
225
|
+
"onUpdate:visible": _cache[3] || (_cache[3] = ($event) => visible.value = $event),
|
|
226
|
+
"overlay-class-name": unref(bem).e("popover"),
|
|
227
|
+
"arrow-point-at-center": "",
|
|
228
|
+
trigger: "click",
|
|
229
|
+
placement: "bottom"
|
|
230
|
+
}, {
|
|
231
|
+
content: withCtx(() => [
|
|
232
|
+
createVNode(_component_LlInput, {
|
|
233
|
+
value: inputValue.value,
|
|
234
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
235
|
+
placeholder: "\u8F93\u5165\u540E\u56DE\u8F66\u65B0\u5EFA",
|
|
236
|
+
"prefix-icon": `icon-search`,
|
|
237
|
+
style: { width: "300px", paddingLeft: "18px" },
|
|
238
|
+
onPressEnter: withModifiers(handleEnter, ["prevent"])
|
|
239
|
+
}, null, 8, ["value"]),
|
|
240
|
+
filterOptionsValue.value.length > 0 ? (openBlock(), createElementBlock(
|
|
241
|
+
"ul",
|
|
242
|
+
{
|
|
243
|
+
key: 0,
|
|
244
|
+
class: normalizeClass(unref(bem).m("select-box"))
|
|
245
|
+
},
|
|
246
|
+
[
|
|
247
|
+
(openBlock(true), createElementBlock(
|
|
248
|
+
Fragment,
|
|
249
|
+
null,
|
|
250
|
+
renderList(filterOptionsValue.value, (item, i) => {
|
|
251
|
+
return openBlock(), createElementBlock("li", {
|
|
252
|
+
key: i,
|
|
253
|
+
class: normalizeClass(unref(bem).m("select-item")),
|
|
254
|
+
onClick: ($event) => handleClickFilter(item)
|
|
255
|
+
}, [
|
|
256
|
+
createElementVNode(
|
|
257
|
+
"span",
|
|
258
|
+
{
|
|
259
|
+
class: normalizeClass(unref(bem).m("select-text"))
|
|
260
|
+
},
|
|
261
|
+
toDisplayString(item),
|
|
262
|
+
3
|
|
263
|
+
/* TEXT, CLASS */
|
|
264
|
+
),
|
|
265
|
+
value.value.indexOf(item) >= 0 ? (openBlock(), createBlock(_component_ll_icon, {
|
|
266
|
+
key: 0,
|
|
267
|
+
"icon-name": "icon-check",
|
|
268
|
+
class: normalizeClass(unref(bem).m("select-check")),
|
|
269
|
+
color: "#1890FF"
|
|
270
|
+
}, null, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
271
|
+
], 10, _hoisted_2);
|
|
272
|
+
}),
|
|
273
|
+
128
|
|
274
|
+
/* KEYED_FRAGMENT */
|
|
275
|
+
))
|
|
276
|
+
],
|
|
277
|
+
2
|
|
278
|
+
/* CLASS */
|
|
279
|
+
)) : createCommentVNode("v-if", true)
|
|
280
|
+
]),
|
|
281
|
+
default: withCtx(() => [
|
|
282
|
+
createElementVNode(
|
|
283
|
+
"div",
|
|
284
|
+
{
|
|
285
|
+
ref_key: "btnRef",
|
|
286
|
+
ref: btnRef,
|
|
287
|
+
class: normalizeClass([
|
|
288
|
+
mouseMove.value || visible.value ? unref(bem).is("active") : "",
|
|
289
|
+
unref(bem).m("add-item")
|
|
290
|
+
]),
|
|
291
|
+
onMouseover: _cache[1] || (_cache[1] = ($event) => mouseMove.value = true),
|
|
292
|
+
onMouseleave: _cache[2] || (_cache[2] = ($event) => mouseMove.value = false)
|
|
293
|
+
},
|
|
294
|
+
[
|
|
295
|
+
createVNode(_component_ll_icon, {
|
|
296
|
+
"icon-name": "icon-add",
|
|
297
|
+
color: "#666",
|
|
298
|
+
"class-name": unref(bem).m("add-icon")
|
|
299
|
+
}, null, 8, ["class-name"])
|
|
300
|
+
],
|
|
301
|
+
34
|
|
302
|
+
/* CLASS, NEED_HYDRATION */
|
|
303
|
+
)
|
|
304
|
+
]),
|
|
305
|
+
_: 1
|
|
306
|
+
/* STABLE */
|
|
307
|
+
}, 8, ["visible", "overlay-class-name"])
|
|
308
|
+
],
|
|
309
|
+
2
|
|
310
|
+
/* CLASS */
|
|
311
|
+
)
|
|
312
|
+
],
|
|
313
|
+
2
|
|
314
|
+
/* CLASS */
|
|
315
|
+
)
|
|
316
|
+
]),
|
|
317
|
+
_: 1
|
|
318
|
+
/* STABLE */
|
|
319
|
+
}, 8, ["spinning"]);
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
export { _sfc_main as default };
|
|
325
|
+
//# sourceMappingURL=tag-group.vue2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-group.vue2.mjs","sources":["../../../../../packages/components/tag-group/src/tag-group.vue"],"sourcesContent":["<template>\n <a-spin :spinning=\"loading\">\n <div ref=\"tagsTypeRef\" :class=\"bem.b()\">\n <div :class=\"bem.e('tag-container')\">\n <template v-for=\"(item, i) in value\" :key=\"i\">\n <div\n :ref=\"getTagRefs(i)\"\n :class=\"[\n bem.m('item'),\n !shownArr.includes(item) ? bem.is('hidden') : ''\n ]\"\n >\n <div :class=\"bem.m('text')\">\n {{ item }}\n </div>\n <span :class=\"bem.m('close')\" @click=\"handleDel(i)\">\n <ll-icon\n icon-name=\"icon-close2\"\n :color=\"'#909399'\"\n :class-name=\"bem.m('close-icon')\"\n />\n </span>\n </div>\n </template>\n </div>\n\n <div :class=\"bem.e('add-container')\">\n <div v-if=\"more > 0\" :class=\"bem.m('more')\">+{{ more }}</div>\n <Popover\n v-model:visible=\"visible\"\n :overlay-class-name=\"bem.e('popover')\"\n arrow-point-at-center\n trigger=\"click\"\n placement=\"bottom\"\n >\n <template #content>\n <LlInput\n v-model:value=\"inputValue\"\n placeholder=\"输入后回车新建\"\n :prefix-icon=\"`icon-search`\"\n :style=\"{ width: '300px', paddingLeft: '18px' }\"\n @press-enter.prevent=\"handleEnter\"\n />\n <ul\n v-if=\"filterOptionsValue.length > 0\"\n :class=\"bem.m('select-box')\"\n >\n <li\n v-for=\"(item, i) in filterOptionsValue\"\n :key=\"i\"\n :class=\"bem.m('select-item')\"\n @click=\"handleClickFilter(item)\"\n >\n <span :class=\"bem.m('select-text')\">\n {{ item }}\n </span>\n <ll-icon\n v-if=\"value.indexOf(item) >= 0\"\n icon-name=\"icon-check\"\n :class=\"bem.m('select-check')\"\n color=\"#1890FF\"\n />\n </li>\n </ul>\n </template>\n <div\n ref=\"btnRef\"\n :class=\"[\n mouseMove || visible ? bem.is('active') : '',\n bem.m('add-item')\n ]\"\n @mouseover=\"mouseMove = true\"\n @mouseleave=\"mouseMove = false\"\n >\n <ll-icon\n icon-name=\"icon-add\"\n :color=\"'#666'\"\n :class-name=\"bem.m('add-icon')\"\n />\n </div>\n </Popover>\n </div>\n </div>\n </a-spin>\n</template>\n\n<script setup lang=\"ts\">\nimport { Form } from 'ant-design-vue'\nimport {\n ref,\n reactive,\n nextTick,\n onMounted,\n toRef,\n watch,\n onUnmounted\n} from 'vue'\nimport { Popover } from 'ant-design-vue'\nimport { createNamespace } from '@ll-plus/utils'\nimport { tagGroupProps, tagGroupEmits } from './tag-group'\nimport type { Ref } from 'vue'\ndefineOptions({ name: 'LlTagGroup' })\n\nconst props = defineProps(tagGroupProps)\nconst emits = defineEmits(tagGroupEmits)\nconst bem = createNamespace('tag-group')\nconst formItemContext = Form.useInjectFormItemContext()\n\nconst loading = ref(false)\nconst inputValue = ref('')\nconst visible = ref(false)\nconst value = toRef(props.value?.length ? props.value.split(',') : [])\nconst more = ref(0)\nconst btnRef = ref()\nconst mouseMove = ref(false)\nconst tagsTypeRef = ref<HTMLDivElement | null>(null)\nconst tagRefs: Ref<HTMLDivElement>[] = reactive([])\nconst filterOptionsValue = ref(props.options)\nconst innerOptions = ref(props.options)\nconst tagsTypeWidth = ref(0)\nconst shownArr = ref<string[]>([])\nconst getTagRefs = (i: number) => {\n return (el: any) => {\n if (el) {\n tagRefs[i] = toRef(el)\n } else {\n tagRefs.splice(i, 1)\n }\n }\n}\n\nconst getWidth = () => {\n nextTick(() => {\n if (tagsTypeRef.value) {\n tagsTypeWidth.value = tagsTypeRef.value.offsetWidth - 90\n }\n })\n}\n\nconst handleEnter = () => {\n let arr = value.value\n if (!inputValue.value) return\n if (innerOptions.value.indexOf(inputValue.value) < 0) {\n innerOptions.value.push(inputValue.value)\n emits('update:options', innerOptions.value)\n arr.push(inputValue.value)\n } else {\n if (arr.indexOf(inputValue.value) < 0) {\n arr.push(inputValue.value)\n } else {\n arr = arr.filter(e => e !== inputValue.value)\n }\n }\n value.value = arr\n // inputValue.value = ''\n}\n\nconst handleDel = (idx: number) => {\n value.value.splice(idx, 1)\n}\n\nconst handleClickFilter = (item: string) => {\n let arr = value.value\n if (arr.indexOf(item) >= 0) {\n arr = arr.filter(e => e !== item)\n } else {\n arr.push(item)\n }\n value.value = arr\n}\nwatch(\n () => props.options,\n n => {\n innerOptions.value = n\n },\n {\n deep: true,\n immediate: true\n }\n)\nwatch(\n [() => value.value.length, tagsTypeWidth],\n async (n, o) => {\n await nextTick()\n const arr: string[] = []\n let moreLeftValue = 0\n for (const i in value.value) {\n const tagetWidth = tagRefs[i].value.offsetWidth + 10\n if (moreLeftValue + tagetWidth >= n[1]) {\n break\n } else {\n moreLeftValue += tagetWidth\n arr.push(value.value[i])\n }\n }\n more.value = n[0] - arr.length > 0 ? n[0] - arr.length : 0\n shownArr.value = arr\n emits('update:value', value.value.join(','))\n emits('change', value.value.join(','))\n\n if (o[0]) {\n if (n[0] !== o[0]) {\n formItemContext.onFieldChange()\n formItemContext.onFieldBlur()\n }\n }\n },\n {\n deep: true,\n immediate: true\n }\n)\nwatch(\n () => [innerOptions, inputValue],\n () => {\n if (!inputValue.value) filterOptionsValue.value = innerOptions.value\n filterOptionsValue.value = innerOptions.value.filter(\n (e: string) => e.indexOf(inputValue.value) >= 0\n )\n },\n {\n deep: true,\n immediate: true\n }\n)\nonMounted(async () => {\n getWidth()\n window.addEventListener('resize', getWidth)\n})\nonUnmounted(() => {\n window.removeEventListener('resize', getWidth)\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAuGA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AACd,IAAM,MAAA,GAAA,GAAM,gBAAgB,WAAW,CAAA,CAAA;AACvC,IAAM,MAAA,eAAA,GAAkB,KAAK,wBAAyB,EAAA,CAAA;AAEtD,IAAM,MAAA,OAAA,GAAU,IAAI,KAAK,CAAA,CAAA;AACzB,IAAM,MAAA,UAAA,GAAa,IAAI,EAAE,CAAA,CAAA;AACzB,IAAM,MAAA,OAAA,GAAU,IAAI,KAAK,CAAA,CAAA;AACzB,IAAM,MAAA,KAAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/es/index.mjs
CHANGED
|
@@ -68,6 +68,8 @@ export { tableProps } from './components/table/src/config/table.mjs';
|
|
|
68
68
|
export { LlTable } from './components/table/index.mjs';
|
|
69
69
|
export { tabsSimpleEmits, tabsSimpleProps } from './components/tabs-simple/src/tabs-simple.mjs';
|
|
70
70
|
export { LlTabsSimple } from './components/tabs-simple/index.mjs';
|
|
71
|
+
export { tagGroupEmits, tagGroupProps } from './components/tag-group/src/tag-group.mjs';
|
|
72
|
+
export { LlTagGroup } from './components/tag-group/index.mjs';
|
|
71
73
|
export { LlTextarea } from './components/textarea/index.mjs';
|
|
72
74
|
export { LlTimePicker } from './components/time-picker/index.mjs';
|
|
73
75
|
export { LlTimeRange } from './components/time-range/index.mjs';
|
package/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../packages/ll-plus/index.ts"],"sourcesContent":["import installer from './defaults'\n// 按需导入 import {ZIcon} from 'll-plus'\nexport * from '@ll-plus/components/index'\n\nexport const install = installer.install\nexport default installer\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../packages/ll-plus/index.ts"],"sourcesContent":["import installer from './defaults'\n// 按需导入 import {ZIcon} from 'll-plus'\nexport * from '@ll-plus/components/index'\n\nexport const install = installer.install\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAM,UAAU,SAAU,CAAA;;;;"}
|
|
@@ -27,6 +27,6 @@ export declare const buildProp: <Type = never, Value = never, Validator = never,
|
|
|
27
27
|
export type TestProps = Record<string, {
|
|
28
28
|
[epPropKey]: true;
|
|
29
29
|
} | NativePropType | EpPropInput<any, any, any, any, any>>;
|
|
30
|
-
export declare const buildProps: <Props extends Record<string, {
|
|
30
|
+
export declare const buildProps: <Props extends Record<string, NativePropType | EpPropInput<any, any, any, any, any> | {
|
|
31
31
|
__epPropKey: true;
|
|
32
|
-
}
|
|
32
|
+
}>>(props: Props) => { [K in keyof Props]: IfEpProp<Props[K], Props[K], IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>>; };
|
package/global.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ declare module '@vue/runtime-core' {
|
|
|
20
20
|
LlIconBase: typeof import('ll-plus')['LlIconBase']
|
|
21
21
|
LlInput: typeof import('ll-plus')['LlInput']
|
|
22
22
|
LlInputNumber: typeof import('ll-plus')['LlInputNumber']
|
|
23
|
+
LlKeyValue: typeof import('ll-plus')['LlKeyValue']
|
|
23
24
|
LlModal: typeof import('ll-plus')['LlModal']
|
|
24
25
|
LlOperateIcon: typeof import('ll-plus')['LlOperateIcon']
|
|
25
26
|
LlSelect: typeof import('ll-plus')['LlSelect']
|