@expcat/tigercat-vue 2.0.0 → 2.0.4
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/{chunk-KE6RGD4Y.mjs → chunk-26OI3TEA.mjs} +25 -55
- package/dist/{chunk-A7QIMKWQ.mjs → chunk-2T2NEZRZ.mjs} +1 -1
- package/dist/chunk-4HUYX5WW.mjs +239 -0
- package/dist/{chunk-IDUEWMWN.mjs → chunk-7KCOF5US.mjs} +61 -62
- package/dist/{chunk-RHV6DWY6.mjs → chunk-7VHXZX7Y.mjs} +20 -28
- package/dist/{chunk-IZRQ7LB3.mjs → chunk-AU6IC6K7.mjs} +1 -1
- package/dist/{chunk-O6BN5R6J.mjs → chunk-AUMTHL6N.mjs} +1 -1
- package/dist/{chunk-MNSVJBNH.mjs → chunk-B4MDHE3L.mjs} +18 -4
- package/dist/{chunk-N7LWKAYS.mjs → chunk-BZ6MVFV7.mjs} +190 -174
- package/dist/{chunk-TK3QU367.mjs → chunk-DI6RRAGQ.mjs} +3 -3
- package/dist/{chunk-4ZZYQITT.mjs → chunk-FWO7RNGI.mjs} +249 -220
- package/dist/{chunk-EZZD4OCV.mjs → chunk-GS4SV2HK.mjs} +1 -1
- package/dist/{chunk-EUSODI5E.mjs → chunk-HKYRRQS7.mjs} +11 -5
- package/dist/{chunk-D4APFWWS.mjs → chunk-IPGPLFUZ.mjs} +18 -4
- package/dist/{chunk-JKPXJ3VB.mjs → chunk-JALHMWKW.mjs} +14 -6
- package/dist/{chunk-OHPXOLNB.mjs → chunk-K3WTQBE4.mjs} +40 -15
- package/dist/{chunk-VMYV5EWI.mjs → chunk-KICZSLOX.mjs} +9 -8
- package/dist/{chunk-SK2QJ66E.mjs → chunk-KROVW4AW.mjs} +19 -59
- package/dist/{chunk-AQMPCLX7.mjs → chunk-NMAJD353.mjs} +248 -253
- package/dist/{chunk-4BO6JNA6.mjs → chunk-OAPIT53X.mjs} +4 -4
- package/dist/{chunk-SYRRMZT2.mjs → chunk-OQVGB7X6.mjs} +43 -29
- package/dist/{chunk-DWK5GUMB.mjs → chunk-OTGGPXDT.mjs} +26 -19
- package/dist/{chunk-DWPZRG7A.mjs → chunk-PGF7HLLR.mjs} +43 -39
- package/dist/chunk-Q7Y22OFX.mjs +330 -0
- package/dist/{chunk-NP6DZQ3O.mjs → chunk-RID7A5V7.mjs} +1 -1
- package/dist/{chunk-DKMKJZ7A.mjs → chunk-S5RTMAQN.mjs} +1 -1
- package/dist/{chunk-SJ7W5I5H.mjs → chunk-TCV6YPH5.mjs} +1 -1
- package/dist/{chunk-LFENEILY.mjs → chunk-WC5MKASU.mjs} +110 -99
- package/dist/components/ActivityFeed.mjs +3 -3
- package/dist/components/AutoComplete.mjs +2 -1
- package/dist/components/BackTop.d.mts +2 -2
- package/dist/components/Cascader.mjs +2 -1
- package/dist/components/ColorPicker.mjs +2 -1
- package/dist/components/CropUpload.mjs +3 -3
- package/dist/components/DataExport.mjs +3 -3
- package/dist/components/DataTableWithToolbar.mjs +6 -6
- package/dist/components/DatePicker.mjs +2 -1
- package/dist/components/DonutChart.d.mts +1 -1
- package/dist/components/Drawer.d.mts +2 -2
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/Dropdown.d.mts +2 -2
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/FloatButton.d.mts +1 -1
- package/dist/components/FormItem.mjs +2 -1
- package/dist/components/Image.mjs +3 -3
- package/dist/components/Loading.mjs +2 -2
- package/dist/components/Mentions.mjs +2 -1
- package/dist/components/Menu.mjs +2 -2
- package/dist/components/Modal.d.mts +1 -1
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/NotificationCenter.mjs +3 -3
- package/dist/components/PieChart.d.mts +1 -1
- package/dist/components/Popconfirm.d.mts +2 -2
- package/dist/components/Popconfirm.mjs +3 -3
- package/dist/components/Popover.d.mts +2 -2
- package/dist/components/Popover.mjs +3 -3
- package/dist/components/Select.mjs +2 -1
- package/dist/components/Spotlight.d.mts +1 -1
- package/dist/components/Spotlight.mjs +2 -2
- package/dist/components/Table.mjs +3 -2
- package/dist/components/TimePicker.mjs +2 -1
- package/dist/components/Tooltip.d.mts +2 -2
- package/dist/components/Tooltip.mjs +3 -3
- package/dist/components/Tour.mjs +2 -2
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/index.mjs +4 -2
- package/package.json +2 -2
- package/dist/chunk-BDTPFPSB.mjs +0 -163
- package/dist/chunk-EWUHEW6W.mjs +0 -219
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-LPZBXTJ6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useFloatingPopup
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-26OI3TEA.mjs";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
renderVueOverlayTeleport
|
|
9
|
+
} from "./chunk-Q7Y22OFX.mjs";
|
|
10
10
|
|
|
11
11
|
// src/components/Image.ts
|
|
12
12
|
import {
|
|
@@ -86,6 +86,9 @@ var Image = defineComponent({
|
|
|
86
86
|
triggerRef: hoverTriggerRef,
|
|
87
87
|
floatingRef: hoverFloatingRef,
|
|
88
88
|
floatingStyles: hoverFloatingStyles,
|
|
89
|
+
floatingClasses: hoverFloatingClasses,
|
|
90
|
+
positioned: hoverPositioned,
|
|
91
|
+
overlayTarget: hoverOverlayTarget,
|
|
89
92
|
triggerHandlers: hoverTriggerHandlers
|
|
90
93
|
} = useFloatingPopup({
|
|
91
94
|
props: floatingPopupProps,
|
|
@@ -237,14 +240,18 @@ var Image = defineComponent({
|
|
|
237
240
|
emit("preview-open-change", val);
|
|
238
241
|
}
|
|
239
242
|
}) : null;
|
|
240
|
-
const hoverPreviewEl = hoverPreviewEnabled.value && hoverVisible.value && props.src ?
|
|
243
|
+
const hoverPreviewEl = hoverPreviewEnabled.value && hoverVisible.value && props.src ? renderVueOverlayTeleport(
|
|
241
244
|
h(
|
|
242
245
|
"div",
|
|
243
246
|
{
|
|
244
247
|
ref: hoverFloatingRef,
|
|
245
248
|
style: hoverFloatingStyles.value,
|
|
249
|
+
"data-positioned": hoverPositioned.value,
|
|
246
250
|
"aria-hidden": true,
|
|
247
|
-
class:
|
|
251
|
+
class: classNames(
|
|
252
|
+
hoverFloatingClasses.value,
|
|
253
|
+
"rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] p-1 shadow-lg"
|
|
254
|
+
)
|
|
248
255
|
},
|
|
249
256
|
[
|
|
250
257
|
h("img", {
|
|
@@ -253,7 +260,8 @@ var Image = defineComponent({
|
|
|
253
260
|
class: "block max-w-[16rem] max-h-[16rem] object-contain"
|
|
254
261
|
})
|
|
255
262
|
]
|
|
256
|
-
)
|
|
263
|
+
),
|
|
264
|
+
hoverOverlayTarget.value
|
|
257
265
|
) : null;
|
|
258
266
|
return h(
|
|
259
267
|
"div",
|
|
@@ -4,6 +4,10 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
FORM_ITEM_CONTROL_INJECTION_KEY
|
|
6
6
|
} from "./chunk-P2LZ2MR5.mjs";
|
|
7
|
+
import {
|
|
8
|
+
renderVueOverlayTeleport,
|
|
9
|
+
useVueAnchoredOverlay
|
|
10
|
+
} from "./chunk-Q7Y22OFX.mjs";
|
|
7
11
|
|
|
8
12
|
// src/components/FormItem.ts
|
|
9
13
|
import {
|
|
@@ -108,6 +112,8 @@ var FormItem = defineComponent({
|
|
|
108
112
|
const errorMessage = ref("");
|
|
109
113
|
const shakeTrigger = ref(0);
|
|
110
114
|
const prevFormError = ref("");
|
|
115
|
+
const contentRef = ref(null);
|
|
116
|
+
const errorRef = ref(null);
|
|
111
117
|
const instanceId = ++formItemIdCounter;
|
|
112
118
|
const baseId = `tiger-form-item-${instanceId}`;
|
|
113
119
|
const labelId = `${baseId}-label`;
|
|
@@ -226,6 +232,16 @@ var FormItem = defineComponent({
|
|
|
226
232
|
const hasError = computed(() => {
|
|
227
233
|
return !!errorMessage.value;
|
|
228
234
|
});
|
|
235
|
+
const popupErrorVisible = computed(
|
|
236
|
+
() => props.showMessage && hasError.value && props.errorDisplayMode === "popup"
|
|
237
|
+
);
|
|
238
|
+
const overlay = useVueAnchoredOverlay({
|
|
239
|
+
enabled: popupErrorVisible,
|
|
240
|
+
referenceRef: contentRef,
|
|
241
|
+
floatingRef: errorRef,
|
|
242
|
+
placement: "bottom-start",
|
|
243
|
+
offset: 4
|
|
244
|
+
});
|
|
229
245
|
provide(FORM_ITEM_CONTROL_INJECTION_KEY, {
|
|
230
246
|
status: computed(() => hasError.value ? "error" : void 0),
|
|
231
247
|
errorMessage: computed(
|
|
@@ -317,6 +333,7 @@ var FormItem = defineComponent({
|
|
|
317
333
|
const contentElement = h(
|
|
318
334
|
"div",
|
|
319
335
|
{
|
|
336
|
+
ref: contentRef,
|
|
320
337
|
class: classNames(contentClasses.value, props.errorDisplayMode === "popup" && "relative")
|
|
321
338
|
},
|
|
322
339
|
[
|
|
@@ -333,21 +350,29 @@ var FormItem = defineComponent({
|
|
|
333
350
|
},
|
|
334
351
|
fieldChildren
|
|
335
352
|
),
|
|
336
|
-
props.showMessage &&
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
353
|
+
props.showMessage && renderVueOverlayTeleport(
|
|
354
|
+
h(
|
|
355
|
+
"div",
|
|
356
|
+
{
|
|
357
|
+
ref: errorRef,
|
|
358
|
+
id: hasError.value ? errorId : void 0,
|
|
359
|
+
role: hasError.value ? "alert" : void 0,
|
|
360
|
+
class: props.errorDisplayMode === "block" ? classNames(
|
|
361
|
+
"mt-1 p-2 rounded bg-red-50 border border-red-200 text-red-600 text-sm",
|
|
362
|
+
!hasError.value && "hidden"
|
|
363
|
+
) : props.errorDisplayMode === "popup" ? classNames(
|
|
364
|
+
"px-2 py-1 rounded bg-red-600 text-white text-xs shadow-lg",
|
|
365
|
+
overlay.floatingClasses.value,
|
|
366
|
+
!hasError.value && "hidden"
|
|
367
|
+
) : errorClasses.value,
|
|
368
|
+
style: props.errorDisplayMode === "popup" ? overlay.floatingStyles.value : void 0,
|
|
369
|
+
"data-positioned": props.errorDisplayMode === "popup" ? overlay.positioned.value : void 0,
|
|
370
|
+
"aria-hidden": hasError.value ? void 0 : "true"
|
|
371
|
+
},
|
|
372
|
+
hasError.value ? errorMessage.value : ""
|
|
373
|
+
),
|
|
374
|
+
overlay.target.value,
|
|
375
|
+
props.errorDisplayMode !== "popup"
|
|
351
376
|
)
|
|
352
377
|
]
|
|
353
378
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useFloatingPopup
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-26OI3TEA.mjs";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
renderVueOverlayTeleport
|
|
6
|
+
} from "./chunk-Q7Y22OFX.mjs";
|
|
7
7
|
|
|
8
8
|
// src/components/Popconfirm.ts
|
|
9
9
|
import { defineComponent, computed, h, cloneVNode, isVNode } from "vue";
|
|
@@ -93,6 +93,9 @@ var Popconfirm = defineComponent({
|
|
|
93
93
|
floatingRef,
|
|
94
94
|
closeAndRestoreFocus,
|
|
95
95
|
floatingStyles,
|
|
96
|
+
floatingClasses,
|
|
97
|
+
positioned,
|
|
98
|
+
overlayTarget,
|
|
96
99
|
actualPlacement
|
|
97
100
|
} = useFloatingPopup({ props, emit, multiTrigger: false });
|
|
98
101
|
const popconfirmId = createPopconfirmId();
|
|
@@ -118,9 +121,6 @@ var Popconfirm = defineComponent({
|
|
|
118
121
|
);
|
|
119
122
|
});
|
|
120
123
|
const triggerClasses = computed(() => getPopconfirmTriggerClasses(props.disabled));
|
|
121
|
-
const contentWrapperClasses = computed(
|
|
122
|
-
() => classNames("absolute z-50", currentVisible.value ? "block" : "hidden")
|
|
123
|
-
);
|
|
124
124
|
const arrowClasses = computed(() => getPopconfirmArrowClasses(actualPlacement.value));
|
|
125
125
|
const contentClasses = getPopconfirmContentClasses();
|
|
126
126
|
const titleClasses = getPopconfirmTitleClasses();
|
|
@@ -211,8 +211,9 @@ var Popconfirm = defineComponent({
|
|
|
211
211
|
"div",
|
|
212
212
|
{
|
|
213
213
|
ref: floatingRef,
|
|
214
|
-
class:
|
|
214
|
+
class: floatingClasses.value,
|
|
215
215
|
style: floatingStyles.value,
|
|
216
|
+
"data-positioned": positioned.value,
|
|
216
217
|
hidden: !currentVisible.value,
|
|
217
218
|
"aria-hidden": !currentVisible.value
|
|
218
219
|
},
|
|
@@ -272,7 +273,7 @@ var Popconfirm = defineComponent({
|
|
|
272
273
|
class: containerClasses.value,
|
|
273
274
|
style: mergeStyleValues(attrs.style, props.style)
|
|
274
275
|
},
|
|
275
|
-
[trigger,
|
|
276
|
+
[trigger, renderVueOverlayTeleport(content, overlayTarget.value)]
|
|
276
277
|
);
|
|
277
278
|
};
|
|
278
279
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
useVueFloating
|
|
6
|
-
} from "./chunk-BDTPFPSB.mjs";
|
|
2
|
+
renderVueOverlayTeleport,
|
|
3
|
+
useVueAnchoredOverlay
|
|
4
|
+
} from "./chunk-Q7Y22OFX.mjs";
|
|
7
5
|
|
|
8
6
|
// src/components/Dropdown.ts
|
|
9
7
|
import {
|
|
@@ -29,9 +27,7 @@ import {
|
|
|
29
27
|
getDropdownChevronClasses,
|
|
30
28
|
getDropdownMenuClasses,
|
|
31
29
|
getDropdownItemClasses,
|
|
32
|
-
getTransformOrigin,
|
|
33
30
|
injectDropdownStyles,
|
|
34
|
-
FLOATING_OVERLAY_Z_INDEX,
|
|
35
31
|
DROPDOWN_CHEVRON_PATH,
|
|
36
32
|
DROPDOWN_ENTER_CLASS,
|
|
37
33
|
handleMenuNavigation,
|
|
@@ -312,54 +308,22 @@ var Dropdown = defineComponent({
|
|
|
312
308
|
handleMenuNavigation(floatingRef.value, event);
|
|
313
309
|
}
|
|
314
310
|
};
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
placement: currentPlacement
|
|
319
|
-
} = useVueFloating({
|
|
311
|
+
const clickOutsideEnabled = computed(() => props.trigger === "click");
|
|
312
|
+
const portalEnabled = computed(() => props.portal);
|
|
313
|
+
const overlay = useVueAnchoredOverlay({
|
|
320
314
|
referenceRef: triggerRef,
|
|
321
315
|
floatingRef,
|
|
322
316
|
enabled: currentVisible,
|
|
323
317
|
placement: props.placement,
|
|
324
|
-
offset: props.offset
|
|
318
|
+
offset: props.offset,
|
|
319
|
+
portal: portalEnabled,
|
|
320
|
+
containerRef,
|
|
321
|
+
dismissOnOutside: clickOutsideEnabled,
|
|
322
|
+
dismissOnEscape: true,
|
|
323
|
+
onDismiss: () => setVisible(false)
|
|
325
324
|
});
|
|
326
|
-
const clickOutsideEnabled = computed(() => currentVisible.value && props.trigger === "click");
|
|
327
|
-
let cleanupClickOutside = null;
|
|
328
|
-
watch(
|
|
329
|
-
clickOutsideEnabled,
|
|
330
|
-
(enabled) => {
|
|
331
|
-
cleanupClickOutside?.();
|
|
332
|
-
cleanupClickOutside = null;
|
|
333
|
-
if (enabled) {
|
|
334
|
-
cleanupClickOutside = useVueClickOutside({
|
|
335
|
-
enabled: currentVisible,
|
|
336
|
-
refs: [containerRef, floatingRef],
|
|
337
|
-
onOutsideClick: () => setVisible(false),
|
|
338
|
-
defer: true
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
{ immediate: true }
|
|
343
|
-
);
|
|
344
|
-
let cleanupEscapeKey = null;
|
|
345
|
-
watch(
|
|
346
|
-
currentVisible,
|
|
347
|
-
(visible) => {
|
|
348
|
-
cleanupEscapeKey?.();
|
|
349
|
-
cleanupEscapeKey = null;
|
|
350
|
-
if (visible) {
|
|
351
|
-
cleanupEscapeKey = useVueEscapeKey({
|
|
352
|
-
enabled: currentVisible,
|
|
353
|
-
onEscape: () => setVisible(false)
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
|
-
{ immediate: true }
|
|
358
|
-
);
|
|
359
325
|
onBeforeUnmount(() => {
|
|
360
326
|
if (hoverTimer) clearTimeout(hoverTimer);
|
|
361
|
-
cleanupClickOutside?.();
|
|
362
|
-
cleanupEscapeKey?.();
|
|
363
327
|
});
|
|
364
328
|
const containerClasses = computed(
|
|
365
329
|
() => classNames(
|
|
@@ -371,14 +335,9 @@ var Dropdown = defineComponent({
|
|
|
371
335
|
);
|
|
372
336
|
const mergedStyle = computed(() => mergeStyleValues(attrsStyle, props.style));
|
|
373
337
|
const triggerClasses = computed(() => getDropdownTriggerClasses(props.disabled));
|
|
374
|
-
const menuWrapperClasses =
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
left: `${x.value}px`,
|
|
378
|
-
top: `${y.value}px`,
|
|
379
|
-
zIndex: FLOATING_OVERLAY_Z_INDEX,
|
|
380
|
-
transformOrigin: getTransformOrigin(currentPlacement.value)
|
|
381
|
-
}));
|
|
338
|
+
const menuWrapperClasses = computed(
|
|
339
|
+
() => classNames(overlay.floatingClasses.value, DROPDOWN_ENTER_CLASS)
|
|
340
|
+
);
|
|
382
341
|
const dropdownContext = reactive({
|
|
383
342
|
closeOnClick: props.closeOnClick,
|
|
384
343
|
handleItemClick
|
|
@@ -443,8 +402,9 @@ var Dropdown = defineComponent({
|
|
|
443
402
|
"div",
|
|
444
403
|
{
|
|
445
404
|
ref: floatingRef,
|
|
446
|
-
class: menuWrapperClasses,
|
|
447
|
-
style:
|
|
405
|
+
class: menuWrapperClasses.value,
|
|
406
|
+
style: overlay.floatingStyles.value,
|
|
407
|
+
"data-positioned": overlay.positioned.value,
|
|
448
408
|
"data-tiger-dropdown-menu": "",
|
|
449
409
|
onMouseenter: handleMouseEnter,
|
|
450
410
|
onMouseleave: handleMouseLeave,
|
|
@@ -453,7 +413,7 @@ var Dropdown = defineComponent({
|
|
|
453
413
|
},
|
|
454
414
|
[cloneVNode(menuNode, { id: menuId })]
|
|
455
415
|
) : null;
|
|
456
|
-
const menu = menuWrapper ?
|
|
416
|
+
const menu = menuWrapper ? renderVueOverlayTeleport(menuWrapper, overlay.target.value, !props.portal) : null;
|
|
457
417
|
const {
|
|
458
418
|
class: _class,
|
|
459
419
|
style: _style,
|