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