@sdata/web-vue 4.2.0 → 4.3.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.
Files changed (94) hide show
  1. package/dist/sd.css +17 -117
  2. package/dist/sd.min.css +2 -2
  3. package/es/_components/auto-tooltip/auto-tooltip.vue_vue_type_script_setup_true_lang.js +17 -50
  4. package/es/_components/input-label/input-label.vue_vue_type_script_setup_true_lang.js +2 -2
  5. package/es/_components/picker/input-range.vue_vue_type_script_setup_true_lang.js +1 -1
  6. package/es/_components/picker/input.vue_vue_type_script_setup_true_lang.js +1 -1
  7. package/es/_components/select-view/style/index.css +0 -39
  8. package/es/anchor/anchor.vue.d.ts +1 -1
  9. package/es/anchor/index.d.ts +3 -3
  10. package/es/auto-complete/auto-complete.vue.d.ts +4 -4
  11. package/es/auto-complete/auto-complete.vue_vue_type_script_setup_true_lang.js +6 -6
  12. package/es/avatar/avatar.vue_vue_type_script_setup_true_lang.js +1 -1
  13. package/es/button/button.vue_vue_type_script_setup_true_lang.js +1 -1
  14. package/es/cascader/cascader-option.vue_vue_type_script_setup_true_lang.js +1 -1
  15. package/es/cascader/cascader-panel.vue.d.ts +1 -1
  16. package/es/cascader/cascader.vue.d.ts +1 -1
  17. package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +1 -1
  18. package/es/clamp/index.d.ts +212 -0
  19. package/es/clamp/index.js +15 -0
  20. package/es/clamp/style/css.js +1 -0
  21. package/es/clamp/style/index.css +0 -0
  22. package/es/clamp/style/index.d.ts +1 -0
  23. package/es/clamp/style/index.js +1 -0
  24. package/es/clamp/style/index.scss +1 -0
  25. package/es/clamp/style/token.scss +1 -0
  26. package/es/color-picker/color-picker.vue_vue_type_script_setup_true_lang.js +1 -1
  27. package/es/components.d.ts +4 -0
  28. package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +2 -2
  29. package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +2 -2
  30. package/es/drawer/drawer.vue_vue_type_script_setup_true_lang.js +1 -1
  31. package/es/ellipsis/ellipsis.vue.d.ts +8 -15
  32. package/es/ellipsis/ellipsis.vue_vue_type_script_setup_true_lang.js +113 -118
  33. package/es/ellipsis/index.d.ts +14 -16
  34. package/es/ellipsis/performant-ellipsis.vue.d.ts +3 -5
  35. package/es/ellipsis/performant-ellipsis.vue_vue_type_script_setup_true_lang.js +12 -24
  36. package/es/ellipsis/style/index.css +0 -2
  37. package/es/ellipsis/style/index.scss +3 -2
  38. package/es/file-previewer/file-previewer.vue_vue_type_script_setup_true_lang.js +1 -1
  39. package/es/image/image.vue_vue_type_script_setup_true_lang.js +1 -1
  40. package/es/image/preview.vue_vue_type_script_setup_true_lang.js +1 -1
  41. package/es/index.css +17 -117
  42. package/es/index.d.ts +2 -0
  43. package/es/index.js +4 -3
  44. package/es/index.scss +1 -0
  45. package/es/input/input.vue_vue_type_script_setup_true_lang.js +2 -2
  46. package/es/input-tag/index.d.ts +0 -4
  47. package/es/input-tag/input-tag.vue.d.ts +3 -7
  48. package/es/input-tag/input-tag.vue_vue_type_script_setup_true_lang.js +85 -157
  49. package/es/input-tag/style/index.css +6 -39
  50. package/es/input-tag/style/index.scss +7 -0
  51. package/es/input-tag/style/input-tag.scss +0 -45
  52. package/es/link/link.vue_vue_type_script_setup_true_lang.js +2 -2
  53. package/es/list/index.d.ts +3 -3
  54. package/es/list/list.vue.d.ts +1 -1
  55. package/es/menu/base-menu.vue_vue_type_script_setup_true_lang.js +3 -3
  56. package/es/menu/overflow-wrap.vue_vue_type_script_setup_true_lang.js +21 -27
  57. package/es/menu/style/index.css +5 -2
  58. package/es/menu/style/index.scss +5 -2
  59. package/es/modal/index.js +1 -1
  60. package/es/modal/modal.vue_vue_type_script_setup_true_lang.js +1 -1
  61. package/es/popover/style/index.css +0 -1
  62. package/es/popover/style/index.scss +0 -1
  63. package/es/rate/rate.vue_vue_type_script_setup_true_lang.js +1 -1
  64. package/es/sd-vue.js +7 -2
  65. package/es/secret/secret.vue_vue_type_script_setup_true_lang.js +2 -2
  66. package/es/select/select.vue_vue_type_script_setup_true_lang.js +2 -2
  67. package/es/sender/sender.vue_vue_type_script_setup_true_lang.js +1 -1
  68. package/es/table/index.d.ts +8 -8
  69. package/es/table/table-tr.vue.d.ts +1 -1
  70. package/es/table/table.vue.d.ts +2 -2
  71. package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +1 -1
  72. package/es/tag-group/index.d.ts +4 -6
  73. package/es/tag-group/style/index.css +6 -29
  74. package/es/tag-group/style/index.scss +9 -34
  75. package/es/tag-group/tag-group.vue.d.ts +8 -11
  76. package/es/tag-group/tag-group.vue_vue_type_script_setup_true_lang.js +91 -272
  77. package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +2 -2
  78. package/es/time-picker/time-picker.vue_vue_type_script_setup_true_lang.js +1 -1
  79. package/es/tree/node-switcher.vue_vue_type_script_setup_true_lang.js +1 -1
  80. package/es/tree/tree.vue.d.ts +12 -12
  81. package/es/tree/tree.vue_vue_type_script_setup_true_lang.js +1 -1
  82. package/es/tree-select/tree-select.vue_vue_type_script_setup_true_lang.js +2 -2
  83. package/es/trigger/trigger.vue_vue_type_script_setup_true_lang.js +3 -3
  84. package/es/typography/base.vue.d.ts +15 -15
  85. package/es/typography/base.vue_vue_type_script_setup_true_lang.js +93 -164
  86. package/es/typography/interface.d.ts +1 -2
  87. package/es/typography/style/index.css +0 -5
  88. package/es/typography/style/index.scss +0 -7
  89. package/json/vetur-attributes.json +0 -20
  90. package/json/vetur-tags.json +2 -10
  91. package/json/web-types.json +3 -53
  92. package/package.json +2 -1
  93. package/es/typography/utils/measure.d.ts +0 -6
  94. package/es/typography/utils/measure.js +0 -69
@@ -1,10 +1,9 @@
1
1
  import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
2
2
  import { getPrefixCls } from "../_utils/global-config.js";
3
- import resize_observer_default from "../_components/resize-observer.js";
3
+ import { WrapClamp } from "../clamp/index.js";
4
4
  import Popover from "../popover/index.js";
5
- import Ellipsis from "../ellipsis/index.js";
6
5
  import Tag from "../tag/index.js";
7
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useSlots, watch, withCtx } from "vue";
6
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
8
7
  import { createReusableTemplate } from "@vueuse/core";
9
8
  import { isFunction, isString } from "es-toolkit";
10
9
  import { isNumber as isNumber$1 } from "es-toolkit/compat";
@@ -19,14 +18,9 @@ var tag_group_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
19
18
  },
20
19
  setup(__props) {
21
20
  const props = __props;
22
- useSlots();
23
21
  const prefixCls = getPrefixCls("tag-group");
24
- const innerRef = ref();
25
- const measureRef = ref();
26
- const responsiveVisibleCount = ref(null);
27
- const responsiveItemMaxWidth = ref(0);
28
- const [DefineTagGroupItem, ReuseTagGroupItem] = createReusableTemplate();
29
- const [DefineTagGroupCounter, ReuseTagGroupCounter] = createReusableTemplate();
22
+ const [DefineItem, ReuseItem] = createReusableTemplate();
23
+ const [DefineCounter, ReuseCounter] = createReusableTemplate();
30
24
  const isResponsiveMaxCount = computed(() => props.maxCount === "responsive");
31
25
  const cls = computed(() => [prefixCls, {
32
26
  [`${prefixCls}-responsive`]: isResponsiveMaxCount.value,
@@ -50,9 +44,7 @@ var tag_group_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
50
44
  label: option,
51
45
  value: option
52
46
  },
53
- itemProps: {},
54
- isCounter: false,
55
- hiddenCount: 0
47
+ itemProps: {}
56
48
  };
57
49
  const normalizedLabel = resolveOptionField(option, label, "label");
58
50
  const normalizedValue = resolveOptionField(option, value, "value");
@@ -64,293 +56,120 @@ var tag_group_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
64
56
  label: normalizedLabel,
65
57
  value: normalizedValue
66
58
  }),
67
- itemProps: normalizeItemProps(option, label, value),
68
- isCounter: false,
69
- hiddenCount: 0
70
- };
71
- }
72
- function createOverflowOption(hiddenCount) {
73
- const label = `+${hiddenCount}`;
74
- return {
75
- key: `${OVERFLOW_COUNTER_VALUE}-${hiddenCount}`,
76
- label,
77
- value: `${OVERFLOW_COUNTER_VALUE}-${hiddenCount}`,
78
- raw: {
79
- label,
80
- value: `${OVERFLOW_COUNTER_VALUE}-${hiddenCount}`
81
- },
82
- itemProps: { closable: false },
83
- isCounter: true,
84
- hiddenCount
59
+ itemProps: normalizeItemProps(option, label, value)
85
60
  };
86
61
  }
87
62
  const normalizedOptions = computed(() => props.options.map((option, index) => normalizeOption(option, index)));
88
63
  const visibleCount = computed(() => {
89
- if (isResponsiveMaxCount.value) {
90
- var _responsiveVisibleCou;
91
- if (!normalizedOptions.value.length) return 0;
92
- return Math.min(normalizedOptions.value.length, Math.max(1, (_responsiveVisibleCou = responsiveVisibleCount.value) !== null && _responsiveVisibleCou !== void 0 ? _responsiveVisibleCou : normalizedOptions.value.length));
93
- }
94
64
  if (typeof props.maxCount === "number" && props.maxCount > 0) return Math.min(props.maxCount, normalizedOptions.value.length);
95
65
  return normalizedOptions.value.length;
96
66
  });
97
67
  const visibleOptions = computed(() => normalizedOptions.value.slice(0, visibleCount.value));
98
68
  const hiddenOptions = computed(() => normalizedOptions.value.slice(visibleCount.value));
99
- const overflowOption = computed(() => createOverflowOption(hiddenOptions.value.length));
100
- const measureCounterOptions = computed(() => Array.from({ length: Math.max(normalizedOptions.value.length - 1, 0) }, (_, index) => createOverflowOption(index + 1)));
101
- function resolveOptionLabel(option) {
102
- if (option.isCounter) return option.label;
69
+ const resolveOptionLabel = (option) => {
103
70
  const label = option.raw.label;
104
71
  return isFunction(label) ? label() : option.label;
105
- }
106
- function getOuterWidth(element) {
107
- if (!element) return 0;
108
- const style = window.getComputedStyle(element);
109
- const marginLeft = Number.parseFloat(style.marginLeft || "0") || 0;
110
- const marginRight = Number.parseFloat(style.marginRight || "0") || 0;
111
- return element.offsetWidth + marginLeft + marginRight;
112
- }
113
- function getCounterWidth(hiddenCount) {
114
- if (!measureRef.value || hiddenCount <= 0) return 0;
115
- return getOuterWidth(measureRef.value.querySelector(`[data-hidden-count="${hiddenCount}"]`));
116
- }
117
- function setResponsiveState(visibleCount, itemMaxWidth = 0) {
118
- responsiveVisibleCount.value = visibleCount;
119
- responsiveItemMaxWidth.value = itemMaxWidth;
120
- }
121
- function findResponsiveState(totalItems, itemWidths, availableWidth) {
122
- for (let candidate = totalItems; candidate >= 1; candidate -= 1) {
123
- const hiddenCount = totalItems - candidate;
124
- const counterWidth = getCounterWidth(hiddenCount);
125
- const visibleWidth = itemWidths.slice(0, candidate).reduce((sum, width) => sum + width, 0);
126
- if (hiddenCount === 0 && visibleWidth <= availableWidth) return {
127
- visibleCount: candidate,
128
- itemMaxWidth: 0
129
- };
130
- if (hiddenCount > 0 && candidate > 1 && visibleWidth + counterWidth <= availableWidth) return {
131
- visibleCount: candidate,
132
- itemMaxWidth: 0
133
- };
134
- if (hiddenCount > 0 && candidate === 1) {
135
- const leadItemWidth = Math.max(availableWidth - counterWidth, 0);
136
- if (leadItemWidth > 0) return {
137
- visibleCount: 1,
138
- itemMaxWidth: leadItemWidth
139
- };
140
- }
141
- }
142
- return {
143
- visibleCount: 1,
144
- itemMaxWidth: Math.max(availableWidth - getCounterWidth(totalItems - 1), 0)
145
- };
146
- }
147
- function syncResponsiveItems() {
148
- if (!isResponsiveMaxCount.value) {
149
- responsiveVisibleCount.value = null;
150
- responsiveItemMaxWidth.value = 0;
151
- return;
152
- }
153
- const totalItems = normalizedOptions.value.length;
154
- if (totalItems <= 1) {
155
- setResponsiveState(totalItems);
156
- return;
157
- }
158
- const innerElement = innerRef.value;
159
- const measureElement = measureRef.value;
160
- if (!innerElement || !measureElement) {
161
- setResponsiveState(totalItems);
162
- return;
163
- }
164
- const availableWidth = Math.max(innerElement.clientWidth, 0);
165
- if (availableWidth <= 0) {
166
- setResponsiveState(1);
167
- return;
168
- }
169
- const responsiveState = findResponsiveState(totalItems, Array.from(measureElement.querySelectorAll("[data-measure-item=\"true\"]")).slice(0, totalItems).map(getOuterWidth), availableWidth);
170
- setResponsiveState(responsiveState.visibleCount, responsiveState.itemMaxWidth);
171
- }
172
- function handleResize() {
173
- nextTick(() => {
174
- syncResponsiveItems();
175
- });
176
- }
177
- function isCompressedResponsiveItem(index, value) {
178
- return isResponsiveMaxCount.value && !String(value).startsWith(OVERFLOW_COUNTER_VALUE) && hiddenOptions.value.length > 0 && index === 0 && responsiveItemMaxWidth.value > 0;
179
- }
180
- function getItemWrapperClass(option, measure) {
181
- return [`${prefixCls}-item`, { [`${prefixCls}-item-measure`]: Boolean(measure) }];
182
- }
183
- function getCounterWrapperClass(measure) {
184
- return [
185
- `${prefixCls}-item`,
186
- `${prefixCls}-item-counter`,
187
- { [`${prefixCls}-item-measure`]: Boolean(measure) }
188
- ];
189
- }
190
- function getItemWrapperStyle(option, index, measure) {
191
- if (measure || !isCompressedResponsiveItem(index, option.value)) return;
192
- return { maxWidth: `${responsiveItemMaxWidth.value}px` };
193
- }
194
- function getItemContentClass(option, index) {
195
- return [`${prefixCls}-item-content`, { [`${prefixCls}-item-content-overflow`]: isCompressedResponsiveItem(index, option.value) }];
196
- }
197
- function getItemContentStyle(option, index) {
198
- if (!isCompressedResponsiveItem(index, option.value)) return;
199
- return { maxWidth: "100%" };
200
- }
201
- function getCounterContentClass() {
202
- return `${prefixCls}-counter-content`;
203
- }
204
- onMounted(() => {
205
- nextTick(() => {
206
- syncResponsiveItems();
207
- });
208
- });
209
- watch([normalizedOptions, () => props.maxCount], () => {
210
- nextTick(() => {
211
- syncResponsiveItems();
212
- });
213
- }, { deep: true });
72
+ };
214
73
  return (_ctx, _cache) => {
215
74
  return openBlock(), createElementBlock(Fragment, null, [
216
- createVNode(unref(DefineTagGroupItem), null, {
217
- default: withCtx((slotProps) => [(openBlock(), createBlock(resolveDynamicComponent(slotProps.measure ? "span" : "li"), {
218
- class: normalizeClass(getItemWrapperClass(slotProps.option, slotProps.measure)),
219
- style: normalizeStyle(getItemWrapperStyle(slotProps.option, slotProps.index, slotProps.measure)),
220
- "data-measure-item": slotProps.measure && !slotProps.option.isCounter ? "true" : void 0,
221
- "data-hidden-count": slotProps.measure && slotProps.option.isCounter ? slotProps.hiddenCount : void 0
75
+ createVNode(unref(DefineItem), null, {
76
+ default: withCtx(({ option, index, itemTag }) => [(openBlock(), createBlock(resolveDynamicComponent(itemTag), {
77
+ class: normalizeClass(`${unref(prefixCls)}-item`),
78
+ role: itemTag === "span" ? "listitem" : void 0
222
79
  }, {
223
80
  default: withCtx(() => [renderSlot(_ctx.$slots, "item", {
224
- data: slotProps.option.raw,
225
- option: slotProps.option.raw,
226
- label: resolveOptionLabel(slotProps.option),
227
- value: slotProps.option.value,
228
- index: slotProps.index,
229
- itemClass: getItemContentClass(slotProps.option, slotProps.index),
230
- itemStyle: getItemContentStyle(slotProps.option, slotProps.index),
231
- isOverflow: isCompressedResponsiveItem(slotProps.index, slotProps.option.value),
232
- measure: Boolean(slotProps.measure)
233
- }, () => [createVNode(unref(Tag), mergeProps(slotProps.option.itemProps, {
234
- class: getItemContentClass(slotProps.option, slotProps.index),
235
- style: getItemContentStyle(slotProps.option, slotProps.index),
81
+ data: option.raw,
82
+ option: option.raw,
83
+ label: resolveOptionLabel(option),
84
+ value: option.value,
85
+ index,
86
+ itemClass: `${unref(prefixCls)}-item-content`,
87
+ itemStyle: void 0,
88
+ isOverflow: false,
89
+ measure: false
90
+ }, () => [createVNode(unref(Tag), mergeProps(option.itemProps, {
91
+ class: `${unref(prefixCls)}-item-content`,
236
92
  visible: true,
237
93
  nowrap: true
238
94
  }), {
239
95
  default: withCtx(() => [_ctx.$slots.label ? renderSlot(_ctx.$slots, "label", {
240
- data: slotProps.option.raw,
241
- option: slotProps.option.raw
242
- }, void 0, void 0, 0) : isCompressedResponsiveItem(slotProps.index, slotProps.option.value) ? (openBlock(), createBlock(unref(Ellipsis), {
243
- key: 1,
244
- class: normalizeClass(`${unref(prefixCls)}-item-ellipsis`)
245
- }, {
246
- default: withCtx(() => [createTextVNode(toDisplayString(resolveOptionLabel(slotProps.option)), 1)]),
247
- _: 2
248
- }, 1032, ["class"])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(resolveOptionLabel(slotProps.option)), 1)], 64))]),
249
- _: 2
250
- }, 1040, ["class", "style"])])]),
251
- _: 2
252
- }, 1032, [
253
- "class",
254
- "style",
255
- "data-measure-item",
256
- "data-hidden-count"
257
- ]))]),
258
- _: 3
259
- }),
260
- createVNode(unref(DefineTagGroupCounter), null, {
261
- default: withCtx((slotProps) => [(openBlock(), createBlock(resolveDynamicComponent(slotProps.measure ? "span" : "li"), {
262
- class: normalizeClass(getCounterWrapperClass(slotProps.measure)),
263
- "data-hidden-count": slotProps.hiddenCount
264
- }, {
265
- default: withCtx(() => [renderSlot(_ctx.$slots, "counter", {
266
- label: slotProps.option.label,
267
- value: slotProps.option.value,
268
- hiddenCount: slotProps.hiddenCount,
269
- measure: Boolean(slotProps.measure),
270
- counterClass: getCounterContentClass()
271
- }, () => [createVNode(unref(Tag), mergeProps(slotProps.option.itemProps, {
272
- class: getCounterContentClass(),
273
- visible: true,
274
- nowrap: true,
275
- ellipsis: false
276
- }), {
277
- default: withCtx(() => [createTextVNode(toDisplayString(slotProps.option.label), 1)]),
96
+ data: option.raw,
97
+ option: option.raw
98
+ }, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(resolveOptionLabel(option)), 1)], 64))]),
278
99
  _: 2
279
100
  }, 1040, ["class"])])]),
280
101
  _: 2
281
- }, 1032, ["class", "data-hidden-count"]))]),
102
+ }, 1032, ["class", "role"]))]),
282
103
  _: 3
283
104
  }),
284
- createElementVNode("span", { class: normalizeClass(cls.value) }, [normalizedOptions.value.length === 0 ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
285
- isResponsiveMaxCount.value ? (openBlock(), createBlock(resize_observer_default, {
286
- key: 0,
287
- onResize: handleResize
288
- }, {
289
- default: withCtx(() => [createElementVNode("span", {
290
- class: normalizeClass(`${unref(prefixCls)}-resize-observer`),
291
- "aria-hidden": "true"
292
- }, null, 2)]),
293
- _: 1
294
- })) : createCommentVNode("", true),
295
- createElementVNode("ul", {
296
- ref_key: "innerRef",
297
- ref: innerRef,
298
- class: normalizeClass(`${unref(prefixCls)}-inner`)
299
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleOptions.value, (option, index) => {
300
- return openBlock(), createBlock(unref(ReuseTagGroupItem), {
301
- key: option.key,
302
- option,
303
- index,
304
- "hidden-count": 0
305
- }, null, 8, ["option", "index"]);
306
- }), 128)), hiddenOptions.value.length > 0 ? (openBlock(), createBlock(unref(Popover), { key: 0 }, {
307
- default: withCtx(() => [createVNode(unref(ReuseTagGroupCounter), {
308
- option: overflowOption.value,
309
- index: visibleOptions.value.length,
310
- "hidden-count": hiddenOptions.value.length
311
- }, null, 8, [
312
- "option",
313
- "index",
314
- "hidden-count"
315
- ])]),
316
- content: withCtx(() => [createElementVNode("ul", { class: normalizeClass(`${unref(prefixCls)}-popover`) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(hiddenOptions.value, (option, index) => {
317
- return openBlock(), createBlock(unref(ReuseTagGroupItem), {
105
+ createVNode(unref(DefineCounter), null, {
106
+ default: withCtx(({ hiddenOptions, itemTag }) => [hiddenOptions.length > 0 ? (openBlock(), createBlock(unref(Popover), { key: 0 }, {
107
+ default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(itemTag), {
108
+ class: normalizeClass([`${unref(prefixCls)}-item`, `${unref(prefixCls)}-item-counter`]),
109
+ role: itemTag === "span" ? "listitem" : void 0
110
+ }, {
111
+ default: withCtx(() => [renderSlot(_ctx.$slots, "counter", {
112
+ label: `+${hiddenOptions.length}`,
113
+ value: `${OVERFLOW_COUNTER_VALUE}-${hiddenOptions.length}`,
114
+ hiddenCount: hiddenOptions.length,
115
+ measure: false,
116
+ counterClass: `${unref(prefixCls)}-counter-content`
117
+ }, () => [createVNode(unref(Tag), {
118
+ class: normalizeClass(`${unref(prefixCls)}-counter-content`),
119
+ visible: true,
120
+ nowrap: true,
121
+ ellipsis: false,
122
+ textContent: toDisplayString(`+${hiddenOptions.length}`)
123
+ }, null, 8, ["class", "textContent"])])]),
124
+ _: 2
125
+ }, 1032, ["class", "role"]))]),
126
+ content: withCtx(() => [createElementVNode("ul", { class: normalizeClass(`${unref(prefixCls)}-popover`) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(hiddenOptions, (option, index) => {
127
+ return openBlock(), createBlock(unref(ReuseItem), {
318
128
  key: `hidden-${option.key}`,
319
129
  option,
320
- index: visibleOptions.value.length + index,
321
- "hidden-count": 0
130
+ index: visibleCount.value + index,
131
+ "item-tag": "li"
322
132
  }, null, 8, ["option", "index"]);
323
133
  }), 128))], 2)]),
324
- _: 1
325
- })) : createCommentVNode("", true)], 2),
326
- isResponsiveMaxCount.value && normalizedOptions.value.length > 1 ? (openBlock(), createElementBlock("span", {
327
- key: 1,
328
- ref_key: "measureRef",
329
- ref: measureRef,
330
- class: normalizeClass(`${unref(prefixCls)}-measure`),
331
- "aria-hidden": "true"
332
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(normalizedOptions.value, (option, index) => {
333
- return openBlock(), createBlock(unref(ReuseTagGroupItem), {
334
- key: `measure-${option.key}`,
335
- option,
336
- index,
337
- "hidden-count": 0,
338
- measure: true
339
- }, null, 8, ["option", "index"]);
340
- }), 128)), (openBlock(true), createElementBlock(Fragment, null, renderList(measureCounterOptions.value, (counterOption) => {
341
- return openBlock(), createBlock(unref(ReuseTagGroupCounter), {
342
- key: `counter-${counterOption.hiddenCount}`,
343
- option: counterOption,
344
- index: normalizedOptions.value.length,
345
- "hidden-count": counterOption.hiddenCount,
346
- measure: true
347
- }, null, 8, [
348
- "option",
349
- "index",
350
- "hidden-count"
351
- ]);
352
- }), 128))], 2)) : createCommentVNode("", true)
353
- ], 64))], 2)
134
+ _: 2
135
+ }, 1024)) : createCommentVNode("", true)]),
136
+ _: 3
137
+ }),
138
+ createElementVNode("span", { class: normalizeClass(cls.value) }, [normalizedOptions.value.length === 0 ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : isResponsiveMaxCount.value ? (openBlock(), createBlock(unref(WrapClamp), {
139
+ key: 1,
140
+ items: normalizedOptions.value,
141
+ "item-key": "key",
142
+ "max-lines": 1,
143
+ as: "div",
144
+ role: "list",
145
+ class: normalizeClass(`${unref(prefixCls)}-inner`)
146
+ }, {
147
+ item: withCtx(({ item, index }) => [createVNode(unref(ReuseItem), {
148
+ option: item,
149
+ index,
150
+ "item-tag": "span"
151
+ }, null, 8, ["option", "index"])]),
152
+ after: withCtx(({ hiddenItems }) => [(openBlock(), createBlock(unref(ReuseCounter), {
153
+ key: hiddenItems.length,
154
+ "hidden-options": hiddenItems,
155
+ "item-tag": "span"
156
+ }, null, 8, ["hidden-options"]))]),
157
+ _: 1
158
+ }, 8, ["items", "class"])) : (openBlock(), createElementBlock("ul", {
159
+ key: 2,
160
+ class: normalizeClass(`${unref(prefixCls)}-inner`)
161
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleOptions.value, (option, index) => {
162
+ return openBlock(), createBlock(unref(ReuseItem), {
163
+ key: option.key,
164
+ option,
165
+ index,
166
+ "item-tag": "li"
167
+ }, null, 8, ["option", "index"]);
168
+ }), 128)), (openBlock(), createBlock(unref(ReuseCounter), {
169
+ key: hiddenOptions.value.length,
170
+ "hidden-options": hiddenOptions.value,
171
+ "item-tag": "li"
172
+ }, null, 8, ["hidden-options"]))], 2))], 2)
354
173
  ], 64);
355
174
  };
356
175
  }
@@ -8,14 +8,14 @@ import { isActivationKey } from "../_utils/keyboard.js";
8
8
  import IconClose from "../icon/icon-close/index.js";
9
9
  import { useI18n } from "../locale/index.js";
10
10
  import { useAllowClear } from "../_hooks/use-allow-clear.js";
11
+ import { omit } from "../_utils/omit.js";
12
+ import Tooltip from "../tooltip/index.js";
11
13
  import { useCursor } from "../_hooks/use-cursor.js";
12
14
  import { useFitWidth } from "../_hooks/use-fit-width.js";
13
15
  import { isReadonlyModificationKey, useReadonlyTip, useReadonlyTipText } from "../_hooks/use-readonly-tip.js";
14
16
  import { INPUT_EVENTS } from "../_utils/constant.js";
15
17
  import { countGraphemes, sliceGraphemes } from "../_utils/grapheme.js";
16
- import { omit } from "../_utils/omit.js";
17
18
  import pick from "../_utils/pick.js";
18
- import Tooltip from "../tooltip/index.js";
19
19
  import { getSizeStyles } from "./utils.js";
20
20
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderSlot, toDisplayString, toRef, toRefs, unref, useAttrs, watch, withCtx } from "vue";
21
21
  //#region components/textarea/textarea.vue?vue&type=script&setup=true&lang.ts
@@ -4,9 +4,9 @@ import { getPrefixCls } from "../_utils/global-config.js";
4
4
  import { isArray, isUndefined } from "../_utils/is.js";
5
5
  import { useI18n } from "../locale/index.js";
6
6
  import { useAllowClear } from "../_hooks/use-allow-clear.js";
7
+ import Trigger from "../trigger/index.js";
7
8
  import useState from "../_hooks/use-state.js";
8
9
  import useMergeState from "../_hooks/use-merge-state.js";
9
- import Trigger from "../trigger/index.js";
10
10
  import input_default from "../_components/picker/input.js";
11
11
  import { dayjs, getDateValue, getSortedDayjsArray, isValueChange } from "../_utils/date.js";
12
12
  import { getFormattedValue, isValidInputValue, isValidRangeValue } from "./utils/index.js";
@@ -1,7 +1,7 @@
1
1
  import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
2
2
  import icon_hover_default from "../_components/icon-hover.js";
3
- import IconLoading from "../icon/icon-loading/index.js";
4
3
  import usePickSlots from "../_hooks/use-pick-slots.js";
4
+ import IconLoading from "../icon/icon-loading/index.js";
5
5
  import IconCaretDown from "../icon/icon-caret-down/index.js";
6
6
  import useTreeContext from "./hooks/use-tree-context.js";
7
7
  import IconFile from "../icon/icon-file/index.js";
@@ -164,6 +164,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
164
164
  node?: TreeNodeData;
165
165
  e?: Event;
166
166
  }) => any;
167
+ expand: (_expandKeys: (string | number)[], _data: {
168
+ expanded?: boolean;
169
+ expandedNodes: TreeNodeData[];
170
+ node?: TreeNodeData;
171
+ e?: Event;
172
+ }) => any;
167
173
  check: (_checkedKeys: (string | number)[], _data: {
168
174
  checked?: boolean;
169
175
  checkedNodes: TreeNodeData[];
@@ -176,12 +182,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
176
182
  dragOver: (_ev: DragEvent, _node: TreeNodeData) => any;
177
183
  dragLeave: (_ev: DragEvent, _node: TreeNodeData) => any;
178
184
  dragEnd: (_ev: DragEvent, _node: TreeNodeData) => any;
179
- expand: (_expandKeys: (string | number)[], _data: {
180
- expanded?: boolean;
181
- expandedNodes: TreeNodeData[];
182
- node?: TreeNodeData;
183
- e?: Event;
184
- }) => any;
185
185
  "update:selectedKeys": (_selectedKeys: (string | number)[]) => any;
186
186
  "update:checkedKeys": (_checkedKeys: (string | number)[]) => any;
187
187
  "update:halfCheckedKeys": (_halfCheckedKeys: (string | number)[]) => any;
@@ -350,6 +350,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
350
350
  node?: TreeNodeData;
351
351
  e?: Event;
352
352
  }) => any) | undefined;
353
+ onExpand?: ((_expandKeys: (string | number)[], _data: {
354
+ expanded?: boolean;
355
+ expandedNodes: TreeNodeData[];
356
+ node?: TreeNodeData;
357
+ e?: Event;
358
+ }) => any) | undefined;
353
359
  onCheck?: ((_checkedKeys: (string | number)[], _data: {
354
360
  checked?: boolean;
355
361
  checkedNodes: TreeNodeData[];
@@ -362,12 +368,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
362
368
  onDragOver?: ((_ev: DragEvent, _node: TreeNodeData) => any) | undefined;
363
369
  onDragLeave?: ((_ev: DragEvent, _node: TreeNodeData) => any) | undefined;
364
370
  onDragEnd?: ((_ev: DragEvent, _node: TreeNodeData) => any) | undefined;
365
- onExpand?: ((_expandKeys: (string | number)[], _data: {
366
- expanded?: boolean;
367
- expandedNodes: TreeNodeData[];
368
- node?: TreeNodeData;
369
- e?: Event;
370
- }) => any) | undefined;
371
371
  "onUpdate:selectedKeys"?: ((_selectedKeys: (string | number)[]) => any) | undefined;
372
372
  "onUpdate:checkedKeys"?: ((_checkedKeys: (string | number)[]) => any) | undefined;
373
373
  "onUpdate:halfCheckedKeys"?: ((_halfCheckedKeys: (string | number)[]) => any) | undefined;
@@ -4,8 +4,8 @@ import { isArray, isFunction, isUndefined } from "../_utils/is.js";
4
4
  import { KEYBOARD_KEY } from "../_utils/keyboard.js";
5
5
  import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/asyncToGenerator.js";
6
6
  import virtual_list_default from "../_components/virtual-list/index.js";
7
- import useMergeState from "../_hooks/use-merge-state.js";
8
7
  import usePickSlots from "../_hooks/use-pick-slots.js";
8
+ import useMergeState from "../_hooks/use-merge-state.js";
9
9
  import { isLeafNode, isNodeExpandable, isNodeSelectable } from "./utils/index.js";
10
10
  import useTreeData from "./hooks/use-tree-data.js";
11
11
  import { getCheckedStateByCheck, isNodeCheckable } from "./utils/check-utils.js";
@@ -6,10 +6,10 @@ import { isFunction, isObject, isUndefined } from "../_utils/is.js";
6
6
  import { useAllowClear } from "../_hooks/use-allow-clear.js";
7
7
  import { useDropdownVirtualListProps } from "../_hooks/use-dropdown-virtual-list-props.js";
8
8
  import { resolveDropdownVirtualListProps } from "../_utils/virtual-dropdown.js";
9
- import useMergeState from "../_hooks/use-merge-state.js";
10
- import { useReadonlyTip, useReadonlyTipText } from "../_hooks/use-readonly-tip.js";
11
9
  import Trigger from "../trigger/index.js";
12
10
  import Tooltip from "../tooltip/index.js";
11
+ import useMergeState from "../_hooks/use-merge-state.js";
12
+ import { useReadonlyTip, useReadonlyTipText } from "../_hooks/use-readonly-tip.js";
13
13
  import Empty from "../empty/index.js";
14
14
  import Spin from "../spin/index.js";
15
15
  import select_view_default from "../_components/select-view/select-view.js";
@@ -5,15 +5,15 @@ import { isEmptyChildren, mergeFirstChild } from "../_utils/vue-utils.js";
5
5
  import { off, on } from "../_utils/dom.js";
6
6
  import { throttleByRaf } from "../_utils/throttle-by-raf.js";
7
7
  import { KEYBOARD_KEY } from "../_utils/keyboard.js";
8
- import { omit } from "../_utils/omit.js";
9
- import client_only_default from "../_components/client-only.js";
10
8
  import { useFirstElement } from "../_hooks/use-first-element.js";
11
9
  import resize_observer_v2_default from "../_components/resize-observer-v2.js";
10
+ import client_only_default from "../_components/client-only.js";
12
11
  import usePickSlots from "../_hooks/use-pick-slots.js";
13
12
  import usePopupManager from "../_hooks/use-popup-manager.js";
14
13
  import { useResizeObserver as useResizeObserver$1 } from "../_hooks/use-resize-observer.js";
15
14
  import { useTeleportContainer } from "../_hooks/use-teleport-container.js";
16
15
  import { createFloatingOptions } from "../_utils/floating.js";
16
+ import { omit } from "../_utils/omit.js";
17
17
  import { triggerInjectionKey } from "./context.js";
18
18
  import { getScrollElements, getTransformOrigin } from "./utils.js";
19
19
  import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, getCurrentInstance, inject, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onDeactivated, onMounted, openBlock, provide, reactive, ref, renderSlot, unref, useAttrs, useSlots, vShow, watch, withCtx, withDirectives } from "vue";
@@ -572,7 +572,7 @@ var trigger_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
572
572
  }));
573
573
  return children.value;
574
574
  };
575
- const popupElementAttrs = computed(() => _objectSpread2({
575
+ const popupElementAttrs = computed(() => mergeProps({
576
576
  "id": popupId,
577
577
  "class": [`${prefixCls}-popup`, `${prefixCls}-position-${popupPosition.value}`],
578
578
  "style": _objectSpread2(_objectSpread2(_objectSpread2({}, mergedPopupStyle.value), isPositioned.value ? {} : { visibility: "hidden" }), {}, {
@@ -1,5 +1,5 @@
1
1
  import type { Options as ClipboardOptions } from 'copy-to-clipboard';
2
- import { type PropType } from 'vue';
2
+ import type { PropType } from 'vue';
3
3
  import type { BaseProps, EllipsisConfig } from './interface';
4
4
  interface BaseInternalProps extends BaseProps {
5
5
  component: keyof HTMLElementTagNameMap;
@@ -42,14 +42,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
42
42
  editTooltipProps: ObjectConstructor;
43
43
  copyTooltipProps: ObjectConstructor;
44
44
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
45
- copy: (_text: string) => void;
46
- ellipsis: (_isEllipsis: boolean) => void;
47
- change: (_text: string) => void;
48
- expand: (_expanded: boolean) => void;
49
- editStart: () => void;
50
- "update:editText": (_text: string) => void;
51
- editEnd: () => void;
52
- "update:editing": (_editing: boolean) => void;
45
+ copy: (text: string) => any;
46
+ ellipsis: (isEllipsis: boolean) => any;
47
+ change: (text: string) => any;
48
+ expand: (expanded: boolean) => any;
49
+ editStart: () => any;
50
+ "update:editText": (text: string) => any;
51
+ editEnd: () => any;
52
+ "update:editing": (editing: boolean) => any;
53
53
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
54
54
  component: {
55
55
  type: PropType<BaseInternalProps["component"]>;
@@ -88,14 +88,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
88
88
  editTooltipProps: ObjectConstructor;
89
89
  copyTooltipProps: ObjectConstructor;
90
90
  }>> & Readonly<{
91
- onCopy?: ((_text: string) => any) | undefined;
92
- onEllipsis?: ((_isEllipsis: boolean) => any) | undefined;
93
- onChange?: ((_text: string) => any) | undefined;
94
- onExpand?: ((_expanded: boolean) => any) | undefined;
91
+ onCopy?: ((text: string) => any) | undefined;
92
+ onEllipsis?: ((isEllipsis: boolean) => any) | undefined;
93
+ onChange?: ((text: string) => any) | undefined;
94
+ onExpand?: ((expanded: boolean) => any) | undefined;
95
95
  onEditStart?: (() => any) | undefined;
96
- "onUpdate:editText"?: ((_text: string) => any) | undefined;
96
+ "onUpdate:editText"?: ((text: string) => any) | undefined;
97
97
  onEditEnd?: (() => any) | undefined;
98
- "onUpdate:editing"?: ((_editing: boolean) => any) | undefined;
98
+ "onUpdate:editing"?: ((editing: boolean) => any) | undefined;
99
99
  }>, {
100
100
  bold: boolean;
101
101
  underline: boolean;