@cck-ui/core 0.28.0 → 0.29.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/cjs/components/affix/affix.cjs +461 -0
- package/cjs/components/affix/affix.cjs.map +1 -0
- package/cjs/components/affix/affix.module.cjs +7 -0
- package/cjs/components/affix/affix.module.cjs.map +1 -0
- package/cjs/components/affix/affix.utils.cjs +14 -0
- package/cjs/components/affix/affix.utils.cjs.map +1 -0
- package/cjs/components/affix/index.cjs +14 -0
- package/cjs/components/affix/index.cjs.map +1 -0
- package/cjs/components/portal/portal.cjs +10 -3
- package/cjs/components/portal/portal.cjs.map +1 -1
- package/cjs/core/utils/get-default-z-index/get-default-z-index.cjs +16 -0
- package/cjs/core/utils/get-default-z-index/get-default-z-index.cjs.map +1 -0
- package/cjs/index.cjs +108 -103
- package/cjs/index.cjs.map +1 -1
- package/esm/components/affix/affix.mjs +459 -0
- package/esm/components/affix/affix.mjs.map +1 -0
- package/esm/components/affix/affix.module.mjs +7 -0
- package/esm/components/affix/affix.module.mjs.map +1 -0
- package/esm/components/affix/affix.utils.mjs +15 -0
- package/esm/components/affix/affix.utils.mjs.map +1 -0
- package/esm/components/affix/index.mjs +11 -0
- package/esm/components/affix/index.mjs.map +1 -0
- package/esm/components/portal/portal.mjs +11 -4
- package/esm/components/portal/portal.mjs.map +1 -1
- package/esm/core/utils/get-default-z-index/get-default-z-index.mjs +16 -0
- package/esm/core/utils/get-default-z-index/get-default-z-index.mjs.map +1 -0
- package/esm/index.mjs +5 -2
- package/esm/index.mjs.map +1 -1
- package/lib/components/affix/affix.types.d.ts +40 -0
- package/lib/components/affix/affix.utils.d.ts +6 -0
- package/lib/components/affix/index.d.ts +6 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/portal/portal.types.d.ts +9 -0
- package/lib/core/utils/get-default-z-index/get-default-z-index.d.ts +9 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/styles/affix.css +8 -0
- package/styles/affix.layer.css +9 -0
- package/styles.css +9 -0
- package/styles.layer.css +9 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_get_default_z_index = require("../../core/utils/get-default-z-index/get-default-z-index.cjs");
|
|
4
|
+
const require_export_helper = require("../../_virtual/_/plugin-vue/export-helper.cjs");
|
|
5
|
+
const require_use_component_props = require("../../core/config-provider/use-component-props/use-component-props.cjs");
|
|
6
|
+
const require_index = require("../../core/box/index.cjs");
|
|
7
|
+
const require_use_styles = require("../../core/styles-api/use-styles/use-styles.cjs");
|
|
8
|
+
const require_index$1 = require("../portal/index.cjs");
|
|
9
|
+
const require_affix_module = require("./affix.module.cjs");
|
|
10
|
+
const require_affix_utils = require("./affix.utils.cjs");
|
|
11
|
+
let vue = require("vue");
|
|
12
|
+
let clsx = require("clsx");
|
|
13
|
+
clsx = require_runtime.__toESM(clsx);
|
|
14
|
+
//#region packages/@cck-ui/core/src/components/affix/affix.vue
|
|
15
|
+
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
16
|
+
name: "CAffix",
|
|
17
|
+
__name: "affix",
|
|
18
|
+
props: {
|
|
19
|
+
size: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
variant: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
className: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: false
|
|
30
|
+
},
|
|
31
|
+
style: {
|
|
32
|
+
type: [
|
|
33
|
+
Object,
|
|
34
|
+
Function,
|
|
35
|
+
Array
|
|
36
|
+
],
|
|
37
|
+
required: false,
|
|
38
|
+
skipCheck: true
|
|
39
|
+
},
|
|
40
|
+
__vars: {
|
|
41
|
+
type: null,
|
|
42
|
+
required: false
|
|
43
|
+
},
|
|
44
|
+
__size: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: false
|
|
47
|
+
},
|
|
48
|
+
hiddenFrom: {
|
|
49
|
+
type: null,
|
|
50
|
+
required: false
|
|
51
|
+
},
|
|
52
|
+
visibleFrom: {
|
|
53
|
+
type: null,
|
|
54
|
+
required: false
|
|
55
|
+
},
|
|
56
|
+
lightHidden: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
required: false
|
|
59
|
+
},
|
|
60
|
+
darkHidden: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
required: false
|
|
63
|
+
},
|
|
64
|
+
mod: {
|
|
65
|
+
type: [
|
|
66
|
+
Object,
|
|
67
|
+
String,
|
|
68
|
+
Array
|
|
69
|
+
],
|
|
70
|
+
required: false
|
|
71
|
+
},
|
|
72
|
+
m: {
|
|
73
|
+
type: null,
|
|
74
|
+
required: false
|
|
75
|
+
},
|
|
76
|
+
my: {
|
|
77
|
+
type: null,
|
|
78
|
+
required: false
|
|
79
|
+
},
|
|
80
|
+
mx: {
|
|
81
|
+
type: null,
|
|
82
|
+
required: false
|
|
83
|
+
},
|
|
84
|
+
mt: {
|
|
85
|
+
type: null,
|
|
86
|
+
required: false
|
|
87
|
+
},
|
|
88
|
+
mb: {
|
|
89
|
+
type: null,
|
|
90
|
+
required: false
|
|
91
|
+
},
|
|
92
|
+
ms: {
|
|
93
|
+
type: null,
|
|
94
|
+
required: false
|
|
95
|
+
},
|
|
96
|
+
me: {
|
|
97
|
+
type: null,
|
|
98
|
+
required: false
|
|
99
|
+
},
|
|
100
|
+
mis: {
|
|
101
|
+
type: null,
|
|
102
|
+
required: false
|
|
103
|
+
},
|
|
104
|
+
mie: {
|
|
105
|
+
type: null,
|
|
106
|
+
required: false
|
|
107
|
+
},
|
|
108
|
+
ml: {
|
|
109
|
+
type: null,
|
|
110
|
+
required: false
|
|
111
|
+
},
|
|
112
|
+
mr: {
|
|
113
|
+
type: null,
|
|
114
|
+
required: false
|
|
115
|
+
},
|
|
116
|
+
p: {
|
|
117
|
+
type: null,
|
|
118
|
+
required: false
|
|
119
|
+
},
|
|
120
|
+
py: {
|
|
121
|
+
type: null,
|
|
122
|
+
required: false
|
|
123
|
+
},
|
|
124
|
+
px: {
|
|
125
|
+
type: null,
|
|
126
|
+
required: false
|
|
127
|
+
},
|
|
128
|
+
pt: {
|
|
129
|
+
type: null,
|
|
130
|
+
required: false
|
|
131
|
+
},
|
|
132
|
+
pb: {
|
|
133
|
+
type: null,
|
|
134
|
+
required: false
|
|
135
|
+
},
|
|
136
|
+
ps: {
|
|
137
|
+
type: null,
|
|
138
|
+
required: false
|
|
139
|
+
},
|
|
140
|
+
pe: {
|
|
141
|
+
type: null,
|
|
142
|
+
required: false
|
|
143
|
+
},
|
|
144
|
+
pis: {
|
|
145
|
+
type: null,
|
|
146
|
+
required: false
|
|
147
|
+
},
|
|
148
|
+
pie: {
|
|
149
|
+
type: null,
|
|
150
|
+
required: false
|
|
151
|
+
},
|
|
152
|
+
pl: {
|
|
153
|
+
type: null,
|
|
154
|
+
required: false
|
|
155
|
+
},
|
|
156
|
+
pr: {
|
|
157
|
+
type: null,
|
|
158
|
+
required: false
|
|
159
|
+
},
|
|
160
|
+
bd: {
|
|
161
|
+
type: null,
|
|
162
|
+
required: false
|
|
163
|
+
},
|
|
164
|
+
bdrs: {
|
|
165
|
+
type: null,
|
|
166
|
+
required: false
|
|
167
|
+
},
|
|
168
|
+
bg: {
|
|
169
|
+
type: null,
|
|
170
|
+
required: false
|
|
171
|
+
},
|
|
172
|
+
c: {
|
|
173
|
+
type: null,
|
|
174
|
+
required: false
|
|
175
|
+
},
|
|
176
|
+
opacity: {
|
|
177
|
+
type: [
|
|
178
|
+
String,
|
|
179
|
+
Object,
|
|
180
|
+
Number
|
|
181
|
+
],
|
|
182
|
+
required: false
|
|
183
|
+
},
|
|
184
|
+
ff: {
|
|
185
|
+
type: [String, Object],
|
|
186
|
+
required: false
|
|
187
|
+
},
|
|
188
|
+
fz: {
|
|
189
|
+
type: null,
|
|
190
|
+
required: false
|
|
191
|
+
},
|
|
192
|
+
fw: {
|
|
193
|
+
type: null,
|
|
194
|
+
required: false
|
|
195
|
+
},
|
|
196
|
+
lts: {
|
|
197
|
+
type: null,
|
|
198
|
+
required: false
|
|
199
|
+
},
|
|
200
|
+
ta: {
|
|
201
|
+
type: [String, Object],
|
|
202
|
+
required: false
|
|
203
|
+
},
|
|
204
|
+
lh: {
|
|
205
|
+
type: null,
|
|
206
|
+
required: false
|
|
207
|
+
},
|
|
208
|
+
fs: {
|
|
209
|
+
type: null,
|
|
210
|
+
required: false
|
|
211
|
+
},
|
|
212
|
+
tt: {
|
|
213
|
+
type: [String, Object],
|
|
214
|
+
required: false
|
|
215
|
+
},
|
|
216
|
+
td: {
|
|
217
|
+
type: null,
|
|
218
|
+
required: false
|
|
219
|
+
},
|
|
220
|
+
w: {
|
|
221
|
+
type: null,
|
|
222
|
+
required: false
|
|
223
|
+
},
|
|
224
|
+
miw: {
|
|
225
|
+
type: null,
|
|
226
|
+
required: false
|
|
227
|
+
},
|
|
228
|
+
maw: {
|
|
229
|
+
type: null,
|
|
230
|
+
required: false
|
|
231
|
+
},
|
|
232
|
+
h: {
|
|
233
|
+
type: null,
|
|
234
|
+
required: false
|
|
235
|
+
},
|
|
236
|
+
mih: {
|
|
237
|
+
type: null,
|
|
238
|
+
required: false
|
|
239
|
+
},
|
|
240
|
+
mah: {
|
|
241
|
+
type: null,
|
|
242
|
+
required: false
|
|
243
|
+
},
|
|
244
|
+
bgsz: {
|
|
245
|
+
type: null,
|
|
246
|
+
required: false
|
|
247
|
+
},
|
|
248
|
+
bgp: {
|
|
249
|
+
type: null,
|
|
250
|
+
required: false
|
|
251
|
+
},
|
|
252
|
+
bgr: {
|
|
253
|
+
type: null,
|
|
254
|
+
required: false
|
|
255
|
+
},
|
|
256
|
+
bga: {
|
|
257
|
+
type: null,
|
|
258
|
+
required: false
|
|
259
|
+
},
|
|
260
|
+
pos: {
|
|
261
|
+
type: [String, Object],
|
|
262
|
+
required: false
|
|
263
|
+
},
|
|
264
|
+
top: {
|
|
265
|
+
type: null,
|
|
266
|
+
required: false
|
|
267
|
+
},
|
|
268
|
+
left: {
|
|
269
|
+
type: null,
|
|
270
|
+
required: false
|
|
271
|
+
},
|
|
272
|
+
bottom: {
|
|
273
|
+
type: null,
|
|
274
|
+
required: false
|
|
275
|
+
},
|
|
276
|
+
right: {
|
|
277
|
+
type: null,
|
|
278
|
+
required: false
|
|
279
|
+
},
|
|
280
|
+
inset: {
|
|
281
|
+
type: null,
|
|
282
|
+
required: false
|
|
283
|
+
},
|
|
284
|
+
display: {
|
|
285
|
+
type: null,
|
|
286
|
+
required: false
|
|
287
|
+
},
|
|
288
|
+
flex: {
|
|
289
|
+
type: null,
|
|
290
|
+
required: false
|
|
291
|
+
},
|
|
292
|
+
zIndex: {
|
|
293
|
+
type: null,
|
|
294
|
+
required: false
|
|
295
|
+
},
|
|
296
|
+
withinPortal: {
|
|
297
|
+
type: Boolean,
|
|
298
|
+
required: false
|
|
299
|
+
},
|
|
300
|
+
portalProps: {
|
|
301
|
+
type: Object,
|
|
302
|
+
required: false
|
|
303
|
+
},
|
|
304
|
+
position: {
|
|
305
|
+
type: Object,
|
|
306
|
+
required: false
|
|
307
|
+
},
|
|
308
|
+
unstyled: {
|
|
309
|
+
type: Boolean,
|
|
310
|
+
required: false
|
|
311
|
+
},
|
|
312
|
+
classNames: {
|
|
313
|
+
type: null,
|
|
314
|
+
required: false
|
|
315
|
+
},
|
|
316
|
+
styles: {
|
|
317
|
+
type: null,
|
|
318
|
+
required: false
|
|
319
|
+
},
|
|
320
|
+
vars: {
|
|
321
|
+
type: Function,
|
|
322
|
+
required: false
|
|
323
|
+
},
|
|
324
|
+
attributes: {
|
|
325
|
+
type: null,
|
|
326
|
+
required: false
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
setup(__props, { expose: __expose }) {
|
|
330
|
+
const _root = (0, vue.ref)(null);
|
|
331
|
+
const attrs = (0, vue.useAttrs)();
|
|
332
|
+
const rawProps = __props;
|
|
333
|
+
console.log("rawProps.size:", rawProps.size);
|
|
334
|
+
const defaultProps = {
|
|
335
|
+
position: {
|
|
336
|
+
bottom: 0,
|
|
337
|
+
right: 0
|
|
338
|
+
},
|
|
339
|
+
zIndex: require_get_default_z_index.getDefaultZIndex("modal"),
|
|
340
|
+
withinPortal: true
|
|
341
|
+
};
|
|
342
|
+
const props = require_use_component_props.useComponentProps({
|
|
343
|
+
component: "CAffix",
|
|
344
|
+
defaultProps,
|
|
345
|
+
props: rawProps
|
|
346
|
+
});
|
|
347
|
+
console.log("attrs.size:", attrs.size);
|
|
348
|
+
console.log("props.value.size:", props.value.size);
|
|
349
|
+
const affixSpecificProps = [
|
|
350
|
+
"portalProps",
|
|
351
|
+
"withinPortal",
|
|
352
|
+
"position",
|
|
353
|
+
"zIndex",
|
|
354
|
+
"classNames",
|
|
355
|
+
"styles",
|
|
356
|
+
"unstyled",
|
|
357
|
+
"vars",
|
|
358
|
+
"attributes",
|
|
359
|
+
"size"
|
|
360
|
+
];
|
|
361
|
+
const styleProps = (0, vue.computed)(() => {
|
|
362
|
+
const { style: attrsStyle, ...restAttrs } = attrs;
|
|
363
|
+
const combinedStyle = attrsStyle ?? props.value.style;
|
|
364
|
+
return {
|
|
365
|
+
...props.value,
|
|
366
|
+
...restAttrs,
|
|
367
|
+
style: combinedStyle
|
|
368
|
+
};
|
|
369
|
+
});
|
|
370
|
+
const getStyles = require_use_styles.useStyles({
|
|
371
|
+
name: "Affix",
|
|
372
|
+
props: styleProps,
|
|
373
|
+
classes: require_affix_module.default,
|
|
374
|
+
className: () => props.value.className,
|
|
375
|
+
style: () => props.value.style,
|
|
376
|
+
classNames: props.value.classNames,
|
|
377
|
+
styles: props.value.styles,
|
|
378
|
+
unstyled: props.value.unstyled,
|
|
379
|
+
attributes: props.value.attributes,
|
|
380
|
+
vars: props.value.vars,
|
|
381
|
+
varsResolver: require_affix_utils.varsResolver
|
|
382
|
+
});
|
|
383
|
+
const rootAttrs = (0, vue.computed)(() => getStyles("root"));
|
|
384
|
+
const portalPropsFinal = (0, vue.computed)(() => ({ ...props.value.portalProps }));
|
|
385
|
+
const mergedAttrs = (0, vue.computed)(() => {
|
|
386
|
+
const propsValue = props.value;
|
|
387
|
+
const others = {};
|
|
388
|
+
for (const key in propsValue) if (!affixSpecificProps.includes(key)) others[key] = propsValue[key];
|
|
389
|
+
const { className: rootClassName, style: rootStyle, ...restRoot } = rootAttrs.value;
|
|
390
|
+
const mergedClassName = (0, clsx.default)(rootClassName, propsValue.className, attrs.className, attrs.class);
|
|
391
|
+
const mergedStyle = [
|
|
392
|
+
rootStyle,
|
|
393
|
+
propsValue.style,
|
|
394
|
+
attrs.style
|
|
395
|
+
].filter(Boolean);
|
|
396
|
+
const finalStyle = mergedStyle.length === 1 ? mergedStyle[0] : mergedStyle;
|
|
397
|
+
const userMod = propsValue.mod;
|
|
398
|
+
const restMod = "mod" in restRoot ? restRoot.mod : void 0;
|
|
399
|
+
const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean), ...Array.isArray(restMod) ? restMod : [restMod].filter(Boolean)].filter(Boolean);
|
|
400
|
+
const { class: attrsClass, className: attrsClassName, style: attrsStyle, mod: attrsMod, ...restAttrs } = attrs;
|
|
401
|
+
const hiddenFrom = propsValue.hiddenFrom ?? attrs.hiddenFrom;
|
|
402
|
+
const visibleFrom = propsValue.visibleFrom ?? attrs.visibleFrom;
|
|
403
|
+
const lightHidden = propsValue.lightHidden ?? attrs.lightHidden ?? false;
|
|
404
|
+
const darkHidden = propsValue.darkHidden ?? attrs.darkHidden ?? false;
|
|
405
|
+
return {
|
|
406
|
+
...restRoot,
|
|
407
|
+
...restAttrs,
|
|
408
|
+
...others,
|
|
409
|
+
className: mergedClassName,
|
|
410
|
+
style: finalStyle,
|
|
411
|
+
mod: mergedMod,
|
|
412
|
+
id: propsValue.id || attrs.id || void 0,
|
|
413
|
+
size: propsValue.size,
|
|
414
|
+
variant: propsValue.variant,
|
|
415
|
+
hiddenFrom,
|
|
416
|
+
visibleFrom,
|
|
417
|
+
lightHidden,
|
|
418
|
+
darkHidden
|
|
419
|
+
};
|
|
420
|
+
});
|
|
421
|
+
__expose({ root: (0, vue.computed)(() => _root.value?.root ?? null) });
|
|
422
|
+
const __returned__ = {
|
|
423
|
+
_root,
|
|
424
|
+
attrs,
|
|
425
|
+
rawProps,
|
|
426
|
+
defaultProps,
|
|
427
|
+
props,
|
|
428
|
+
affixSpecificProps,
|
|
429
|
+
styleProps,
|
|
430
|
+
getStyles,
|
|
431
|
+
rootAttrs,
|
|
432
|
+
portalPropsFinal,
|
|
433
|
+
mergedAttrs,
|
|
434
|
+
get CPortal() {
|
|
435
|
+
return require_index$1.CPortal;
|
|
436
|
+
},
|
|
437
|
+
get CBox() {
|
|
438
|
+
return require_index.CBox;
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
442
|
+
enumerable: false,
|
|
443
|
+
value: true
|
|
444
|
+
});
|
|
445
|
+
return __returned__;
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
449
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)($setup["CPortal"], (0, vue.mergeProps)($setup.portalPropsFinal, { disabled: !$setup.props.withinPortal }), {
|
|
450
|
+
default: (0, vue.withCtx)(() => [(0, vue.createVNode)($setup["CBox"], (0, vue.mergeProps)({ ref: "_root" }, $setup.mergedAttrs, { size: $setup.props.size }), {
|
|
451
|
+
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
|
|
452
|
+
_: 3
|
|
453
|
+
}, 16, ["size"])]),
|
|
454
|
+
_: 3
|
|
455
|
+
}, 16, ["disabled"]);
|
|
456
|
+
}
|
|
457
|
+
var affix_default = /*#__PURE__*/ require_export_helper.default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/affix/affix.vue"]]);
|
|
458
|
+
//#endregion
|
|
459
|
+
exports.default = affix_default;
|
|
460
|
+
|
|
461
|
+
//# sourceMappingURL=affix.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affix.cjs","names":[],"sources":["../../../src/components/affix/affix.vue"],"sourcesContent":["<template>\n <c-portal v-bind=\"portalPropsFinal\" :disabled=\"!props.withinPortal\">\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\" :size=\"props.size\">\n <slot />\n </c-box>\n </c-portal>\n</template>\n\n<script setup lang=\"ts\">\nimport cx from 'clsx'\nimport { computed, ref, useAttrs } from 'vue'\nimport CPortal from '../portal'\nimport {\n CBox,\n CBreakpoint,\n CStyleProp,\n getDefaultZIndex,\n useComponentProps,\n useStyles,\n} from '../../core'\nimport { AffixFactory, AffixProps } from './affix.types'\nimport classes from './affix.module.css'\nimport { varsResolver } from './affix.utils'\n\ndefineOptions({\n name: 'CAffix',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<AffixProps>()\n\nconsole.log('rawProps.size:', rawProps.size)\n\nconst defaultProps = {\n position: { bottom: 0, right: 0 },\n zIndex: getDefaultZIndex('modal'),\n withinPortal: true,\n} satisfies Partial<AffixProps>\n\nconst props = useComponentProps({\n component: 'CAffix',\n defaultProps,\n props: rawProps,\n})\n\nconsole.log('attrs.size:', attrs.size)\nconsole.log('props.value.size:', props.value.size)\n\nconst affixSpecificProps = [\n 'portalProps',\n 'withinPortal',\n 'position',\n 'zIndex',\n 'classNames',\n 'styles',\n 'unstyled',\n 'vars',\n 'attributes',\n 'size',\n]\n\nconst styleProps = computed(() => {\n const { style: attrsStyle, ...restAttrs } = attrs\n const combinedStyle = (attrsStyle ?? props.value.style) as CStyleProp\n return {\n ...props.value,\n ...restAttrs,\n style: combinedStyle,\n }\n})\n\nconst getStyles = useStyles<AffixFactory>({\n name: 'Affix',\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst portalPropsFinal = computed(() => ({\n ...props.value.portalProps,\n}))\n\nconst mergedAttrs = computed(() => {\n const propsValue = props.value\n\n const others: Record<string, any> = {}\n for (const key in propsValue) {\n if (!affixSpecificProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n\n const root = rootAttrs.value\n const { className: rootClassName, style: rootStyle, ...restRoot } = root\n\n const mergedClassName = cx(\n rootClassName,\n propsValue.className,\n attrs.className as string | undefined,\n attrs.class as string | undefined\n )\n\n const mergedStyle = [rootStyle, propsValue.style, attrs.style].filter(Boolean) as CStyleProp[]\n const finalStyle = mergedStyle.length === 1 ? mergedStyle[0] : mergedStyle\n\n const userMod = propsValue.mod\n const restMod = 'mod' in restRoot ? restRoot.mod : undefined\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(Array.isArray(restMod) ? restMod : [restMod].filter(Boolean)),\n ].filter(Boolean)\n\n const {\n class: attrsClass,\n className: attrsClassName,\n style: attrsStyle,\n mod: attrsMod,\n ...restAttrs\n } = attrs\n\n const hiddenFrom = (propsValue.hiddenFrom ?? attrs.hiddenFrom) as CBreakpoint | undefined\n const visibleFrom = (propsValue.visibleFrom ?? attrs.visibleFrom) as CBreakpoint | undefined\n const lightHidden = propsValue.lightHidden ?? attrs.lightHidden ?? false\n const darkHidden = propsValue.darkHidden ?? attrs.darkHidden ?? false\n\n return {\n ...restRoot,\n ...restAttrs,\n ...others,\n className: mergedClassName,\n style: finalStyle,\n mod: mergedMod,\n id: propsValue.id || attrs.id || undefined,\n size: propsValue.size,\n variant: propsValue.variant,\n hiddenFrom,\n visibleFrom,\n lightHidden,\n darkHidden,\n }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BA,MAAM,SAAA,GAAA,IAAA,IAAA,CAA8C,IAAI;EACxD,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,QAAQ,IAAI,kBAAkB,SAAS,IAAI;EAE3C,MAAM,eAAe;GACnB,UAAU;IAAE,QAAQ;IAAG,OAAO;GAAE;GAChC,QAAQ,4BAAA,iBAAiB,OAAO;GAChC,cAAc;EAChB;EAEA,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;EAED,QAAQ,IAAI,eAAe,MAAM,IAAI;EACrC,QAAQ,IAAI,qBAAqB,MAAM,MAAM,IAAI;EAEjD,MAAM,qBAAqB;GACzB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,cAAA,GAAA,IAAA,SAAA,OAA4B;GAChC,MAAM,EAAE,OAAO,YAAY,GAAG,cAAc;GAC5C,MAAM,gBAAiB,cAAc,MAAM,MAAM;GACjD,OAAO;IACL,GAAG,MAAM;IACT,GAAG;IACH,OAAO;GACT;EACF,CAAC;EAED,MAAM,YAAY,mBAAA,UAAwB;GACxC,MAAM;GACN,OAAO;GACP,SAAA,qBAAA;GACA,iBAAiB,MAAM,MAAM;GAC7B,aAAa,MAAM,MAAM;GACzB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;GAClB,cAAA,oBAAA;EACF,CAAC;EAED,MAAM,aAAA,GAAA,IAAA,SAAA,OAA2B,UAAU,MAAM,CAAC;EAElD,MAAM,oBAAA,GAAA,IAAA,SAAA,QAAmC,EACvC,GAAG,MAAM,MAAM,YACjB,EAAE;EAEF,MAAM,eAAA,GAAA,IAAA,SAAA,OAA6B;GACjC,MAAM,aAAa,MAAM;GAEzB,MAAM,SAA8B,CAAC;GACrC,KAAK,MAAM,OAAO,YAChB,IAAI,CAAC,mBAAmB,SAAS,GAAG,GAClC,OAAO,OAAO,WAAW;GAK7B,MAAM,EAAE,WAAW,eAAe,OAAO,WAAW,GAAG,aAD1C,UAAU;GAGvB,MAAM,mBAAA,GAAA,KAAA,QAAA,CACJ,eACA,WAAW,WACX,MAAM,WACN,MAAM,KACR;GAEA,MAAM,cAAc;IAAC;IAAW,WAAW;IAAO,MAAM;GAAK,CAAC,CAAC,OAAO,OAAO;GAC7E,MAAM,aAAa,YAAY,WAAW,IAAI,YAAY,KAAK;GAE/D,MAAM,UAAU,WAAW;GAC3B,MAAM,UAAU,SAAS,WAAW,SAAS,MAAM,KAAA;GACnD,MAAM,YAAY,CAChB,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,GAC/D,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,CACjE,CAAC,CAAC,OAAO,OAAO;GAEhB,MAAM,EACJ,OAAO,YACP,WAAW,gBACX,OAAO,YACP,KAAK,UACL,GAAG,cACD;GAEJ,MAAM,aAAc,WAAW,cAAc,MAAM;GACnD,MAAM,cAAe,WAAW,eAAe,MAAM;GACrD,MAAM,cAAc,WAAW,eAAe,MAAM,eAAe;GACnE,MAAM,aAAa,WAAW,cAAc,MAAM,cAAc;GAEhE,OAAO;IACL,GAAG;IACH,GAAG;IACH,GAAG;IACH,WAAW;IACX,OAAO;IACP,KAAK;IACL,IAAI,WAAW,MAAM,MAAM,MAAM,KAAA;IACjC,MAAM,WAAW;IACjB,SAAS,WAAW;IACpB;IACA;IACA;IACA;GACF;EACF,CAAC;EAED,SAAa,EACX,OAAA,GAAA,IAAA,SAAA,OAAqB,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;mDAtJY,OAAA,aAAA,GAAA,IAAA,WAAA,CAAA,OAJO,kBAAgB,EAAG,UAAQ,CAAG,OAAA,MAAM,aAAA,CAAA,GAAA;kCAG5C,EAAA,GAAA,IAAA,YAAA,CAAA,OAAA,UAAA,GAAA,IAAA,WAAA,CAAA,EAFD,KAAI,QAAO,GAAS,OAAA,aAAW,EAAG,MAAM,OAAA,MAAM,KAAA,CAAA,GAAA;mCAC3C,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affix.module.cjs","names":[],"sources":["../../../src/components/affix/affix.module.css"],"sourcesContent":[".root {\n position: fixed;\n z-index: var(--affix-z-index);\n inset-inline-start: var(--affix-left);\n inset-inline-end: var(--affix-right);\n top: var(--affix-top);\n bottom: var(--affix-bottom);\n}\n"],"mappings":";;AAAA,IAAA,uBAAe,EAAC,QAAO,YAAW"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_get_size = require("../../core/utils/get-size/get-size.cjs");
|
|
3
|
+
//#region packages/@cck-ui/core/src/components/affix/affix.utils.ts
|
|
4
|
+
const varsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs").createVarsResolver((_, { zIndex, position }) => ({ root: {
|
|
5
|
+
"--affix-bottom": require_get_size.getSpacing(position?.bottom),
|
|
6
|
+
"--affix-left": require_get_size.getSpacing(position?.left),
|
|
7
|
+
"--affix-right": require_get_size.getSpacing(position?.right),
|
|
8
|
+
"--affix-top": require_get_size.getSpacing(position?.top),
|
|
9
|
+
"--affix-z-index": zIndex?.toString()
|
|
10
|
+
} }));
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.varsResolver = varsResolver;
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=affix.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affix.utils.cjs","names":["createVarsResolver","getSpacing"],"sources":["../../../src/components/affix/affix.utils.ts"],"sourcesContent":["import { createVarsResolver, getSpacing } from '../../core'\nimport { AffixFactory } from './affix.types'\n\nexport const varsResolver = createVarsResolver<AffixFactory>((_, { zIndex, position }) => ({\n root: {\n '--affix-bottom': getSpacing(position?.bottom),\n '--affix-left': getSpacing(position?.left),\n '--affix-right': getSpacing(position?.right),\n '--affix-top': getSpacing(position?.top),\n '--affix-z-index': zIndex?.toString(),\n },\n}))\n"],"mappings":";;;AAGA,MAAa,4FAAeA,CAAAA,CAAAA,oBAAkC,GAAG,EAAE,QAAQ,gBAAgB,EACzF,MAAM;CACJ,kBAAkBC,iBAAAA,WAAW,UAAU,MAAM;CAC7C,gBAAgBA,iBAAAA,WAAW,UAAU,IAAI;CACzC,iBAAiBA,iBAAAA,WAAW,UAAU,KAAK;CAC3C,eAAeA,iBAAAA,WAAW,UAAU,GAAG;CACvC,mBAAmB,QAAQ,SAAS;AACtC,EACF,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_install = require("../../core/utils/vue/install.cjs");
|
|
3
|
+
const require_statics = require("../../core/utils/vue/statics.cjs");
|
|
4
|
+
const require_affix_module = require("./affix.module.cjs");
|
|
5
|
+
const require_affix_utils = require("./affix.utils.cjs");
|
|
6
|
+
const require_affix = require("./affix.cjs");
|
|
7
|
+
//#region packages/@cck-ui/core/src/components/affix/index.ts
|
|
8
|
+
const AffixWithStatic = require_statics.withPropsFactory(require_statics.withExtend(require_statics.withVarsResolver(require_statics.withClasses(require_affix.default, require_affix_module.default), require_affix_utils.varsResolver)));
|
|
9
|
+
const CAffix = require_install.withInstall(AffixWithStatic);
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.CAffix = CAffix;
|
|
12
|
+
exports.default = CAffix;
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["withPropsFactory","withExtend","withVarsResolver","withClasses","Affix","classes","varsResolver","withInstall"],"sources":["../../../src/components/affix/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n withVarsResolver,\n} from '../../core'\nimport Affix from './affix.vue'\nimport { varsResolver } from './affix.utils'\nimport classes from './affix.module.css'\n\nconst AffixWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(Affix, classes), varsResolver))\n)\n\nexport const CAffix: SFCWithInstallAndClasses<typeof Affix, typeof classes> =\n withInstall(AffixWithStatic)\n\nexport default CAffix\n\nexport * from './affix.types'\n"],"mappings":";;;;;;;AAYA,MAAM,kBAAkBA,gBAAAA,iBACtBC,gBAAAA,WAAWC,gBAAAA,iBAAiBC,gBAAAA,YAAYC,cAAAA,SAAOC,qBAAAA,OAAO,GAAGC,oBAAAA,YAAY,CAAC,CACxE;AAEA,MAAa,SACXC,gBAAAA,YAAY,eAAe"}
|
|
@@ -11,6 +11,10 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
11
11
|
type: null,
|
|
12
12
|
required: false
|
|
13
13
|
},
|
|
14
|
+
disabled: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
required: false
|
|
17
|
+
},
|
|
14
18
|
reuseTargetNode: {
|
|
15
19
|
type: Boolean,
|
|
16
20
|
required: false
|
|
@@ -19,7 +23,10 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
19
23
|
setup(__props, { expose: __expose }) {
|
|
20
24
|
const attrs = (0, vue.useAttrs)();
|
|
21
25
|
const rawProps = __props;
|
|
22
|
-
const defaultProps = {
|
|
26
|
+
const defaultProps = {
|
|
27
|
+
reuseTargetNode: true,
|
|
28
|
+
disabled: false
|
|
29
|
+
};
|
|
23
30
|
const props = require_use_component_props.useComponentProps({
|
|
24
31
|
component: "CPortal",
|
|
25
32
|
defaultProps,
|
|
@@ -104,10 +111,10 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
104
111
|
}
|
|
105
112
|
});
|
|
106
113
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
107
|
-
return $setup.container ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
|
|
114
|
+
return $setup.container && !$setup.props.disabled ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
|
|
108
115
|
key: 0,
|
|
109
116
|
to: $setup.container
|
|
110
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "default")], 8, ["to"])) : (0, vue.
|
|
117
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "default")], 8, ["to"])) : (0, vue.renderSlot)(_ctx.$slots, "default", { key: 1 });
|
|
111
118
|
}
|
|
112
119
|
var portal_default = /*#__PURE__*/ require_export_helper.default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/portal/portal.vue"]]);
|
|
113
120
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.cjs","names":[],"sources":["../../../src/components/portal/portal.vue"],"sourcesContent":["<template>\n <Teleport v-if=\"container\" :to=\"container\">\n <slot />\n </Teleport>\n</template>\n\n<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref, useAttrs } from 'vue'\nimport { PortalProps } from './portal.types'\nimport { useComponentProps } from '../../core'\n\ndefineOptions({\n name: 'CPortal',\n})\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<PortalProps>()\n\nconst defaultProps = {\n reuseTargetNode: true,\n} satisfies Partial<PortalProps>\n\nconst props = useComponentProps({\n component: 'CPortal',\n defaultProps,\n props: rawProps,\n})\n\nconst container = ref<HTMLElement | null>(null)\nlet createdNode: HTMLElement | null = null\n\nfunction createPortalNode(nodeAttrs: Record<string, any>): HTMLElement {\n const node = document.createElement('div')\n node.setAttribute('data-portal', 'true')\n\n const className = nodeAttrs.class || nodeAttrs.className\n if (className) {\n node.classList.add(...String(className).split(' ').filter(Boolean))\n }\n if (nodeAttrs.style) {\n Object.assign(node.style, nodeAttrs.style)\n }\n if (nodeAttrs.id) {\n node.setAttribute('id', nodeAttrs.id)\n }\n Object.keys(nodeAttrs).forEach((key) => {\n if (!['class', 'className', 'style', 'id'].includes(key)) {\n node.setAttribute(key, nodeAttrs[key])\n }\n })\n\n return node\n}\n\nfunction getTargetNode(): HTMLElement {\n const target = props.value.target\n const reuseTargetNode = props.value.reuseTargetNode\n\n if (target) {\n if (typeof target === 'string') {\n const found = document.querySelector<HTMLElement>(target)\n if (found) {\n return found\n }\n const node = createPortalNode(attrs)\n document.body.appendChild(node)\n createdNode = node\n return node\n }\n return target\n }\n\n if (reuseTargetNode) {\n const existing = document.querySelector<HTMLElement>('[data-cck-shared-portal]')\n if (existing) {\n return existing\n }\n const node = createPortalNode(attrs)\n node.setAttribute('data-cck-shared-portal', 'true')\n document.body.appendChild(node)\n createdNode = node\n return node\n }\n\n const node = createPortalNode(attrs)\n document.body.appendChild(node)\n createdNode = node\n return node\n}\n\nonMounted(() => {\n container.value = getTargetNode()\n})\n\nonBeforeUnmount(() => {\n if (createdNode && !createdNode.hasAttribute('data-cck-shared-portal')) {\n if (createdNode.parentNode) {\n createdNode.parentNode.removeChild(createdNode)\n }\n }\n})\n\ndefineExpose({\n root: container,\n})\n</script>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"portal.cjs","names":[],"sources":["../../../src/components/portal/portal.vue"],"sourcesContent":["<template>\n <Teleport v-if=\"container && !props.disabled\" :to=\"container\">\n <slot />\n </Teleport>\n <template v-else>\n <slot />\n </template>\n</template>\n\n<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref, useAttrs } from 'vue'\nimport { PortalProps } from './portal.types'\nimport { useComponentProps } from '../../core'\n\ndefineOptions({\n name: 'CPortal',\n})\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<PortalProps>()\n\nconst defaultProps = {\n reuseTargetNode: true,\n disabled: false,\n} satisfies Partial<PortalProps>\n\nconst props = useComponentProps({\n component: 'CPortal',\n defaultProps,\n props: rawProps,\n})\n\nconst container = ref<HTMLElement | null>(null)\nlet createdNode: HTMLElement | null = null\n\nfunction createPortalNode(nodeAttrs: Record<string, any>): HTMLElement {\n const node = document.createElement('div')\n node.setAttribute('data-portal', 'true')\n\n const className = nodeAttrs.class || nodeAttrs.className\n if (className) {\n node.classList.add(...String(className).split(' ').filter(Boolean))\n }\n if (nodeAttrs.style) {\n Object.assign(node.style, nodeAttrs.style)\n }\n if (nodeAttrs.id) {\n node.setAttribute('id', nodeAttrs.id)\n }\n Object.keys(nodeAttrs).forEach((key) => {\n if (!['class', 'className', 'style', 'id'].includes(key)) {\n node.setAttribute(key, nodeAttrs[key])\n }\n })\n\n return node\n}\n\nfunction getTargetNode(): HTMLElement {\n const target = props.value.target\n const reuseTargetNode = props.value.reuseTargetNode\n\n if (target) {\n if (typeof target === 'string') {\n const found = document.querySelector<HTMLElement>(target)\n if (found) {\n return found\n }\n const node = createPortalNode(attrs)\n document.body.appendChild(node)\n createdNode = node\n return node\n }\n return target\n }\n\n if (reuseTargetNode) {\n const existing = document.querySelector<HTMLElement>('[data-cck-shared-portal]')\n if (existing) {\n return existing\n }\n const node = createPortalNode(attrs)\n node.setAttribute('data-cck-shared-portal', 'true')\n document.body.appendChild(node)\n createdNode = node\n return node\n }\n\n const node = createPortalNode(attrs)\n document.body.appendChild(node)\n createdNode = node\n return node\n}\n\nonMounted(() => {\n container.value = getTargetNode()\n})\n\nonBeforeUnmount(() => {\n if (createdNode && !createdNode.hasAttribute('data-cck-shared-portal')) {\n if (createdNode.parentNode) {\n createdNode.parentNode.removeChild(createdNode)\n }\n }\n})\n\ndefineExpose({\n root: container,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAkBA,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,eAAe;GACnB,iBAAiB;GACjB,UAAU;EACZ;EAEA,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAA,GAAA,IAAA,IAAA,CAAoC,IAAI;EAC9C,IAAI,cAAkC;EAEtC,SAAS,iBAAiB,WAA6C;GACrE,MAAM,OAAO,SAAS,cAAc,KAAK;GACzC,KAAK,aAAa,eAAe,MAAM;GAEvC,MAAM,YAAY,UAAU,SAAS,UAAU;GAC/C,IAAI,WACF,KAAK,UAAU,IAAI,GAAG,OAAO,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC;GAEpE,IAAI,UAAU,OACZ,OAAO,OAAO,KAAK,OAAO,UAAU,KAAK;GAE3C,IAAI,UAAU,IACZ,KAAK,aAAa,MAAM,UAAU,EAAE;GAEtC,OAAO,KAAK,SAAS,CAAC,CAAC,SAAS,QAAQ;IACtC,IAAI,CAAC;KAAC;KAAS;KAAa;KAAS;IAAI,CAAC,CAAC,SAAS,GAAG,GACrD,KAAK,aAAa,KAAK,UAAU,IAAI;GAEzC,CAAC;GAED,OAAO;EACT;EAEA,SAAS,gBAA6B;GACpC,MAAM,SAAS,MAAM,MAAM;GAC3B,MAAM,kBAAkB,MAAM,MAAM;GAEpC,IAAI,QAAQ;IACV,IAAI,OAAO,WAAW,UAAU;KAC9B,MAAM,QAAQ,SAAS,cAA2B,MAAM;KACxD,IAAI,OACF,OAAO;KAET,MAAM,OAAO,iBAAiB,KAAK;KACnC,SAAS,KAAK,YAAY,IAAI;KAC9B,cAAc;KACd,OAAO;IACT;IACA,OAAO;GACT;GAEA,IAAI,iBAAiB;IACnB,MAAM,WAAW,SAAS,cAA2B,0BAA0B;IAC/E,IAAI,UACF,OAAO;IAET,MAAM,OAAO,iBAAiB,KAAK;IACnC,KAAK,aAAa,0BAA0B,MAAM;IAClD,SAAS,KAAK,YAAY,IAAI;IAC9B,cAAc;IACd,OAAO;GACT;GAEA,MAAM,OAAO,iBAAiB,KAAK;GACnC,SAAS,KAAK,YAAY,IAAI;GAC9B,cAAc;GACd,OAAO;EACT;EAEA,CAAA,GAAA,IAAA,UAAA,OAAgB;GACd,UAAU,QAAQ,cAAc;EAClC,CAAC;EAED,CAAA,GAAA,IAAA,gBAAA,OAAsB;GACpB,IAAI,eAAe,CAAC,YAAY,aAAa,wBAAwB;QAC/D,YAAY,YACd,YAAY,WAAW,YAAY,WAAW;GAAA;EAGpD,CAAC;EAED,SAAa,EACX,MAAM,UACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;QA5GiB,OAAA,aAAS,CAAK,OAAA,MAAM,aAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAEzB,IAAA,UAAA;;EAFoC,IAAI,OAAA;yBACzC,KAAA,QAAA,SAAA,CAAA,GAAA,GAAA,CAAA,IAAA,CAAA,MAAA,GAAA,IAAA,WAAA,CAGA,KAAA,QAAA,WAAA,EAAA,KAAA,EAAA,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region packages/@cck-ui/core/src/core/utils/get-default-z-index/get-default-z-index.ts
|
|
3
|
+
const elevations = {
|
|
4
|
+
app: 100,
|
|
5
|
+
modal: 200,
|
|
6
|
+
popover: 300,
|
|
7
|
+
overlay: 400,
|
|
8
|
+
max: 9999
|
|
9
|
+
};
|
|
10
|
+
function getDefaultZIndex(level) {
|
|
11
|
+
return elevations[level];
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.getDefaultZIndex = getDefaultZIndex;
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=get-default-z-index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-default-z-index.cjs","names":[],"sources":["../../../../src/core/utils/get-default-z-index/get-default-z-index.ts"],"sourcesContent":["const elevations = {\n app: 100,\n modal: 200,\n popover: 300,\n overlay: 400,\n max: 9999,\n} as const\n\nexport function getDefaultZIndex(level: keyof typeof elevations) {\n return elevations[level]\n}\n"],"mappings":";;AAAA,MAAM,aAAa;CACjB,KAAK;CACL,OAAO;CACP,SAAS;CACT,SAAS;CACT,KAAK;AACP;AAEA,SAAgB,iBAAiB,OAAgC;CAC/D,OAAO,WAAW;AACpB"}
|