@v-c/overflow 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Item.cjs +89 -108
- package/dist/Item.js +85 -106
- package/dist/Overflow.cjs +266 -314
- package/dist/Overflow.js +262 -312
- package/dist/RawItem.cjs +29 -46
- package/dist/RawItem.js +27 -45
- package/dist/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/context.cjs +12 -19
- package/dist/context.js +11 -20
- package/dist/hooks/channelUpdate.cjs +9 -10
- package/dist/hooks/channelUpdate.js +7 -10
- package/dist/hooks/useEffectState.cjs +26 -31
- package/dist/hooks/useEffectState.js +24 -32
- package/dist/index.cjs +6 -6
- package/dist/index.js +3 -5
- package/package.json +5 -4
package/dist/Overflow.js
CHANGED
|
@@ -1,321 +1,271 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, watchEffect, createVNode, mergeProps, isVNode } from "vue";
|
|
2
|
-
import ResizeObserver from "@v-c/resize-observer";
|
|
3
|
-
import { classNames } from "@v-c/util";
|
|
4
1
|
import { OverflowContextProvider } from "./context.js";
|
|
5
2
|
import useEffectState, { useBatcher } from "./hooks/useEffectState.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import Item_default from "./Item.js";
|
|
4
|
+
import RawItem_default from "./RawItem.js";
|
|
5
|
+
import { computed, createVNode, defineComponent, isVNode, mergeProps, ref, watchEffect } from "vue";
|
|
6
|
+
import ResizeObserver from "@v-c/resize-observer";
|
|
7
|
+
import { classNames } from "@v-c/util";
|
|
8
8
|
function _isSlot(s) {
|
|
9
|
-
|
|
9
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
var RESPONSIVE = "responsive";
|
|
12
|
+
var INVALIDATE = "invalidate";
|
|
13
13
|
function defaultRenderRest(omittedItems) {
|
|
14
|
-
|
|
14
|
+
return `+ ${omittedItems.length} ...`;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
}, _isSlot(_slot2 = renderRawRest(omittedItems.value)) ? _slot2 : {
|
|
268
|
-
default: () => [_slot2]
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
return createVNode(Item, mergeProps(itemSharedProps, restContextProps), {
|
|
272
|
-
default: () => typeof mergedRenderRestFn === "function" ? mergedRenderRestFn(omittedItems.value) : mergedRenderRestFn
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
|
-
const {
|
|
276
|
-
class: classAttr,
|
|
277
|
-
style: styleAttr,
|
|
278
|
-
...restAttrs
|
|
279
|
-
} = attrs;
|
|
280
|
-
const overflowNode = createVNode(Component, mergeProps({
|
|
281
|
-
"class": classNames(!invalidate.value && prefixCls, classAttr),
|
|
282
|
-
"style": styleAttr
|
|
283
|
-
}, restAttrs), {
|
|
284
|
-
default: () => [prefix && createVNode(Item, mergeProps(itemSharedProps, {
|
|
285
|
-
"responsive": isResponsive.value,
|
|
286
|
-
"responsiveDisabled": !shouldResponsive.value,
|
|
287
|
-
"order": -1,
|
|
288
|
-
"class": `${itemPrefixCls.value}-prefix`,
|
|
289
|
-
"registerSize": registerPrefixSize,
|
|
290
|
-
"display": true
|
|
291
|
-
}), {
|
|
292
|
-
default: () => prefix
|
|
293
|
-
}), mergedData.value.map(internalRenderItemNode), showRest.value ? restNode() : null, suffix && createVNode(Item, mergeProps(itemSharedProps, {
|
|
294
|
-
"responsive": isResponsive.value,
|
|
295
|
-
"responsiveDisabled": !shouldResponsive.value,
|
|
296
|
-
"order": mergedDisplayCount.value,
|
|
297
|
-
"class": `${itemPrefixCls.value}-suffix`,
|
|
298
|
-
"registerSize": registerSuffixSize,
|
|
299
|
-
"display": true,
|
|
300
|
-
"style": suffixStyle
|
|
301
|
-
}), {
|
|
302
|
-
default: () => suffix
|
|
303
|
-
}), slots.default?.()]
|
|
304
|
-
});
|
|
305
|
-
return isResponsive.value ? createVNode(ResizeObserver, {
|
|
306
|
-
"onResize": onOverflowResize,
|
|
307
|
-
"disabled": !shouldResponsive.value
|
|
308
|
-
}, _isSlot(overflowNode) ? overflowNode : {
|
|
309
|
-
default: () => [overflowNode]
|
|
310
|
-
}) : overflowNode;
|
|
311
|
-
};
|
|
312
|
-
}
|
|
16
|
+
var Overflow = /* @__PURE__ */ defineComponent({
|
|
17
|
+
name: "Overflow",
|
|
18
|
+
inheritAttrs: false,
|
|
19
|
+
props: {
|
|
20
|
+
prefixCls: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "vc-overflow"
|
|
23
|
+
},
|
|
24
|
+
data: {
|
|
25
|
+
type: Array,
|
|
26
|
+
default: () => []
|
|
27
|
+
},
|
|
28
|
+
renderItem: Function,
|
|
29
|
+
renderRawItem: Function,
|
|
30
|
+
itemKey: [
|
|
31
|
+
String,
|
|
32
|
+
Number,
|
|
33
|
+
Function
|
|
34
|
+
],
|
|
35
|
+
itemWidth: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 10
|
|
38
|
+
},
|
|
39
|
+
maxCount: [Number, String],
|
|
40
|
+
renderRest: [Function, Object],
|
|
41
|
+
renderRawRest: Function,
|
|
42
|
+
prefix: {},
|
|
43
|
+
suffix: {},
|
|
44
|
+
component: [
|
|
45
|
+
String,
|
|
46
|
+
Object,
|
|
47
|
+
Function
|
|
48
|
+
],
|
|
49
|
+
itemComponent: [
|
|
50
|
+
String,
|
|
51
|
+
Object,
|
|
52
|
+
Function
|
|
53
|
+
],
|
|
54
|
+
onVisibleChange: Function,
|
|
55
|
+
ssr: String
|
|
56
|
+
},
|
|
57
|
+
emits: ["visibleChange"],
|
|
58
|
+
setup(props, { attrs, slots, emit }) {
|
|
59
|
+
const notifyEffectUpdate = useBatcher();
|
|
60
|
+
const [containerWidth, setContainerWidth] = useEffectState(notifyEffectUpdate, null);
|
|
61
|
+
const mergedContainerWidth = computed(() => containerWidth.value || 0);
|
|
62
|
+
const [itemWidths, setItemWidths] = useEffectState(notifyEffectUpdate, /* @__PURE__ */ new Map());
|
|
63
|
+
const [prevRestWidth, setPrevRestWidth] = useEffectState(notifyEffectUpdate, 0);
|
|
64
|
+
const [restWidth, setRestWidth] = useEffectState(notifyEffectUpdate, 0);
|
|
65
|
+
const [prefixWidth, setPrefixWidth] = useEffectState(notifyEffectUpdate, 0);
|
|
66
|
+
const [suffixWidth, setSuffixWidth] = useEffectState(notifyEffectUpdate, 0);
|
|
67
|
+
const suffixFixedStart = ref(null);
|
|
68
|
+
const displayCount = ref(null);
|
|
69
|
+
const mergedDisplayCount = computed(() => {
|
|
70
|
+
if (displayCount.value === null && props.ssr === "full") return Number.MAX_SAFE_INTEGER;
|
|
71
|
+
return displayCount.value || 0;
|
|
72
|
+
});
|
|
73
|
+
const restReady = ref(false);
|
|
74
|
+
const itemPrefixCls = computed(() => `${props.prefixCls}-item`);
|
|
75
|
+
const mergedRestWidth = computed(() => Math.max(prevRestWidth.value, restWidth.value));
|
|
76
|
+
const data = computed(() => props.data ?? []);
|
|
77
|
+
const isResponsive = computed(() => props.maxCount === RESPONSIVE);
|
|
78
|
+
const shouldResponsive = computed(() => data.value.length && isResponsive.value);
|
|
79
|
+
const invalidate = computed(() => props.maxCount === INVALIDATE);
|
|
80
|
+
const showRest = computed(() => shouldResponsive.value || typeof props.maxCount === "number" && data.value.length > props.maxCount);
|
|
81
|
+
const mergedData = computed(() => {
|
|
82
|
+
let items = data.value;
|
|
83
|
+
if (shouldResponsive.value) if (containerWidth.value === null && props.ssr === "full") items = data.value;
|
|
84
|
+
else {
|
|
85
|
+
const mergedItemWidth = props.itemWidth ?? 10;
|
|
86
|
+
const maxLen = Math.min(data.value.length, mergedContainerWidth.value / mergedItemWidth);
|
|
87
|
+
items = data.value.slice(0, Math.floor(maxLen));
|
|
88
|
+
}
|
|
89
|
+
else if (typeof props.maxCount === "number") items = data.value.slice(0, props.maxCount);
|
|
90
|
+
return items;
|
|
91
|
+
});
|
|
92
|
+
const omittedItems = computed(() => {
|
|
93
|
+
if (shouldResponsive.value) return data.value.slice(mergedDisplayCount.value + 1);
|
|
94
|
+
return data.value.slice(mergedData.value.length);
|
|
95
|
+
});
|
|
96
|
+
const getKey = (item, index) => {
|
|
97
|
+
const { itemKey } = props;
|
|
98
|
+
if (typeof itemKey === "function") return itemKey(item);
|
|
99
|
+
if (itemKey != null) return item?.[itemKey] ?? index;
|
|
100
|
+
return index;
|
|
101
|
+
};
|
|
102
|
+
function updateDisplayCount(count, suffixFixedStartVal, notReady) {
|
|
103
|
+
if (displayCount.value === count && (suffixFixedStartVal === void 0 || suffixFixedStartVal === suffixFixedStart.value)) return;
|
|
104
|
+
displayCount.value = count;
|
|
105
|
+
if (!notReady) {
|
|
106
|
+
restReady.value = count < data.value.length - 1;
|
|
107
|
+
props.onVisibleChange?.(count);
|
|
108
|
+
emit("visibleChange", count);
|
|
109
|
+
}
|
|
110
|
+
if (suffixFixedStartVal !== void 0) suffixFixedStart.value = suffixFixedStartVal;
|
|
111
|
+
}
|
|
112
|
+
function onOverflowResize(_, element) {
|
|
113
|
+
setContainerWidth(element.clientWidth);
|
|
114
|
+
}
|
|
115
|
+
function registerSize(key, width) {
|
|
116
|
+
setItemWidths((origin) => {
|
|
117
|
+
const clone = new Map(origin || []);
|
|
118
|
+
if (width === null) clone.delete(key);
|
|
119
|
+
else clone.set(key, width);
|
|
120
|
+
return clone;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function registerOverflowSize(_, width) {
|
|
124
|
+
setRestWidth(width ?? 0);
|
|
125
|
+
setPrevRestWidth(restWidth.value);
|
|
126
|
+
}
|
|
127
|
+
function registerPrefixSize(_, width) {
|
|
128
|
+
setPrefixWidth(width ?? 0);
|
|
129
|
+
}
|
|
130
|
+
function registerSuffixSize(_, width) {
|
|
131
|
+
setSuffixWidth(width ?? 0);
|
|
132
|
+
}
|
|
133
|
+
function getItemWidth(index) {
|
|
134
|
+
const key = getKey(mergedData.value[index], index);
|
|
135
|
+
return itemWidths.value?.get(key);
|
|
136
|
+
}
|
|
137
|
+
watchEffect(() => {
|
|
138
|
+
const container = mergedContainerWidth.value;
|
|
139
|
+
const rest = mergedRestWidth.value;
|
|
140
|
+
const list = mergedData.value;
|
|
141
|
+
if (container && typeof rest === "number" && list) {
|
|
142
|
+
let totalWidth = prefixWidth.value + suffixWidth.value;
|
|
143
|
+
const len = list.length;
|
|
144
|
+
const lastIndex = len - 1;
|
|
145
|
+
if (!len) {
|
|
146
|
+
updateDisplayCount(0, null);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
for (let i = 0; i < len; i += 1) {
|
|
150
|
+
let currentItemWidth = getItemWidth(i);
|
|
151
|
+
if (props.ssr === "full") currentItemWidth = currentItemWidth || 0;
|
|
152
|
+
if (currentItemWidth === void 0) {
|
|
153
|
+
updateDisplayCount(i - 1, void 0, true);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
totalWidth += currentItemWidth;
|
|
157
|
+
if (lastIndex === 0 && totalWidth <= container || i === lastIndex - 1 && totalWidth + (getItemWidth(lastIndex) || 0) <= container) {
|
|
158
|
+
updateDisplayCount(lastIndex, null);
|
|
159
|
+
break;
|
|
160
|
+
} else if (totalWidth + rest > container) {
|
|
161
|
+
updateDisplayCount(i - 1, totalWidth - currentItemWidth - suffixWidth.value + restWidth.value);
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if ((props.suffix ?? slots.suffix?.()) && getItemWidth(0) + suffixWidth.value > container) suffixFixedStart.value = null;
|
|
166
|
+
}
|
|
167
|
+
}, { flush: "post" });
|
|
168
|
+
return () => {
|
|
169
|
+
const { prefixCls = "vc-overflow", component: Component = "div", itemComponent } = props;
|
|
170
|
+
const renderItem = slots?.renderItem ?? props?.renderItem;
|
|
171
|
+
const renderRawItem = slots?.renderRawItem ?? props?.renderRawItem;
|
|
172
|
+
const renderRest = slots?.renderRest ?? props?.renderRest;
|
|
173
|
+
const renderRawRest = slots?.renderRawRest ?? props?.renderRawRest;
|
|
174
|
+
let prefix = slots?.prefix ?? props?.prefix;
|
|
175
|
+
let suffix = slots?.suffix ?? props?.suffix;
|
|
176
|
+
if (typeof prefix === "function") prefix = prefix();
|
|
177
|
+
if (typeof suffix === "function") suffix = suffix();
|
|
178
|
+
const displayRest = restReady.value && !!omittedItems.value.length;
|
|
179
|
+
let suffixStyle = {};
|
|
180
|
+
if (suffixFixedStart.value !== null && shouldResponsive.value) suffixStyle = {
|
|
181
|
+
position: "absolute",
|
|
182
|
+
left: `${suffixFixedStart.value}px`,
|
|
183
|
+
top: 0
|
|
184
|
+
};
|
|
185
|
+
const itemSharedProps = {
|
|
186
|
+
prefixCls: itemPrefixCls.value,
|
|
187
|
+
responsive: shouldResponsive.value,
|
|
188
|
+
component: itemComponent,
|
|
189
|
+
invalidate: invalidate.value
|
|
190
|
+
};
|
|
191
|
+
const internalRenderItemNode = (item, index) => {
|
|
192
|
+
const key = getKey(item, index);
|
|
193
|
+
if (renderRawItem) {
|
|
194
|
+
let _slot;
|
|
195
|
+
return createVNode(OverflowContextProvider, {
|
|
196
|
+
"key": key,
|
|
197
|
+
"value": {
|
|
198
|
+
...itemSharedProps,
|
|
199
|
+
order: index,
|
|
200
|
+
item,
|
|
201
|
+
itemKey: key,
|
|
202
|
+
registerSize,
|
|
203
|
+
display: index <= mergedDisplayCount.value
|
|
204
|
+
}
|
|
205
|
+
}, _isSlot(_slot = renderRawItem(item, index)) ? _slot : { default: () => [_slot] });
|
|
206
|
+
}
|
|
207
|
+
return createVNode(Item_default, mergeProps(itemSharedProps, {
|
|
208
|
+
"order": index,
|
|
209
|
+
"key": key,
|
|
210
|
+
"item": item,
|
|
211
|
+
"renderItem": renderItem,
|
|
212
|
+
"itemKey": key,
|
|
213
|
+
"registerSize": registerSize,
|
|
214
|
+
"display": index <= mergedDisplayCount.value
|
|
215
|
+
}), null);
|
|
216
|
+
};
|
|
217
|
+
const restContextProps = {
|
|
218
|
+
order: displayRest ? mergedDisplayCount.value : Number.MAX_SAFE_INTEGER,
|
|
219
|
+
class: `${itemPrefixCls.value}-rest`,
|
|
220
|
+
registerSize: registerOverflowSize,
|
|
221
|
+
display: displayRest
|
|
222
|
+
};
|
|
223
|
+
const mergedRenderRestFn = renderRest ?? defaultRenderRest;
|
|
224
|
+
const restNode = () => {
|
|
225
|
+
if (renderRawRest) {
|
|
226
|
+
let _slot2;
|
|
227
|
+
return createVNode(OverflowContextProvider, { "value": {
|
|
228
|
+
...itemSharedProps,
|
|
229
|
+
...restContextProps
|
|
230
|
+
} }, _isSlot(_slot2 = renderRawRest(omittedItems.value)) ? _slot2 : { default: () => [_slot2] });
|
|
231
|
+
}
|
|
232
|
+
return createVNode(Item_default, mergeProps(itemSharedProps, restContextProps), { default: () => typeof mergedRenderRestFn === "function" ? mergedRenderRestFn(omittedItems.value) : mergedRenderRestFn });
|
|
233
|
+
};
|
|
234
|
+
const { class: classAttr, style: styleAttr,...restAttrs } = attrs;
|
|
235
|
+
const overflowNode = createVNode(Component, mergeProps({
|
|
236
|
+
"class": classNames(!invalidate.value && prefixCls, classAttr),
|
|
237
|
+
"style": styleAttr
|
|
238
|
+
}, restAttrs), { default: () => [
|
|
239
|
+
prefix && createVNode(Item_default, mergeProps(itemSharedProps, {
|
|
240
|
+
"responsive": isResponsive.value,
|
|
241
|
+
"responsiveDisabled": !shouldResponsive.value,
|
|
242
|
+
"order": -1,
|
|
243
|
+
"class": `${itemPrefixCls.value}-prefix`,
|
|
244
|
+
"registerSize": registerPrefixSize,
|
|
245
|
+
"display": true
|
|
246
|
+
}), { default: () => prefix }),
|
|
247
|
+
mergedData.value.map(internalRenderItemNode),
|
|
248
|
+
showRest.value ? restNode() : null,
|
|
249
|
+
suffix && createVNode(Item_default, mergeProps(itemSharedProps, {
|
|
250
|
+
"responsive": isResponsive.value,
|
|
251
|
+
"responsiveDisabled": !shouldResponsive.value,
|
|
252
|
+
"order": mergedDisplayCount.value,
|
|
253
|
+
"class": `${itemPrefixCls.value}-suffix`,
|
|
254
|
+
"registerSize": registerSuffixSize,
|
|
255
|
+
"display": true,
|
|
256
|
+
"style": suffixStyle
|
|
257
|
+
}), { default: () => suffix }),
|
|
258
|
+
slots.default?.()
|
|
259
|
+
] });
|
|
260
|
+
return isResponsive.value ? createVNode(ResizeObserver, {
|
|
261
|
+
"onResize": onOverflowResize,
|
|
262
|
+
"disabled": !shouldResponsive.value
|
|
263
|
+
}, _isSlot(overflowNode) ? overflowNode : { default: () => [overflowNode] }) : overflowNode;
|
|
264
|
+
};
|
|
265
|
+
}
|
|
313
266
|
});
|
|
314
|
-
|
|
315
|
-
Overflow.Item = RawItem;
|
|
267
|
+
Overflow.Item = RawItem_default;
|
|
316
268
|
Overflow.RESPONSIVE = RESPONSIVE;
|
|
317
269
|
Overflow.INVALIDATE = INVALIDATE;
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
Overflow as default
|
|
321
|
-
};
|
|
270
|
+
var Overflow_default = Overflow;
|
|
271
|
+
export { Overflow_default as default };
|