@expcat/tigercat-vue 2.1.3 → 2.2.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/README.md +13 -19
- package/dist/{chunk-XHNQITBG.mjs → chunk-2EOVE7AX.mjs} +1 -1
- package/dist/{chunk-FGQ7VMHF.mjs → chunk-3GNK4XIP.mjs} +2 -2
- package/dist/{chunk-7SUS7OIH.mjs → chunk-4337NE24.mjs} +1 -1
- package/dist/{chunk-ZIGSSG3J.mjs → chunk-4JH6QUWR.mjs} +4 -4
- package/dist/{chunk-BLTPZIJN.mjs → chunk-4RJPEIBE.mjs} +1 -1
- package/dist/{chunk-UUY7X4DY.mjs → chunk-5G47QDGH.mjs} +1 -1
- package/dist/{chunk-XWL3IP7Z.mjs → chunk-5IVN54XY.mjs} +2 -2
- package/dist/{chunk-2SC2HIVS.mjs → chunk-5XIHKQL7.mjs} +2 -2
- package/dist/{chunk-MPYKNKZU.mjs → chunk-66JX7T3H.mjs} +1 -1
- package/dist/{chunk-BFIYTA3E.mjs → chunk-72XR5ZIW.mjs} +6 -2
- package/dist/{chunk-XCIQNTJN.mjs → chunk-77L52YWC.mjs} +37 -5
- package/dist/chunk-7L5MXXHC.mjs +85 -0
- package/dist/{chunk-5YYI73DZ.mjs → chunk-7WK6OSB5.mjs} +30 -22
- package/dist/{chunk-2GYERJBM.mjs → chunk-AIONRIMJ.mjs} +3 -3
- package/dist/{chunk-XY2NDPX7.mjs → chunk-ASQ5XLPR.mjs} +1 -1
- package/dist/{chunk-ETJ4QD6U.mjs → chunk-AYCK22RG.mjs} +1 -1
- package/dist/{chunk-3VZRHFXF.mjs → chunk-AZWRMAUF.mjs} +1 -1
- package/dist/{chunk-QIEFLYF3.mjs → chunk-BLHE5KSM.mjs} +6 -1
- package/dist/{chunk-UFQRKWKG.mjs → chunk-BW2SDXPE.mjs} +1 -1
- package/dist/{chunk-CGNBG7NB.mjs → chunk-CSMFWD6T.mjs} +1 -1
- package/dist/{chunk-MTOGCPOV.mjs → chunk-DY2B4W52.mjs} +2 -1
- package/dist/{chunk-RLII7QEJ.mjs → chunk-E2DXPILZ.mjs} +1 -1
- package/dist/{chunk-IWGC7M62.mjs → chunk-ED4EXBY6.mjs} +1 -1
- package/dist/{chunk-4VJB4XFH.mjs → chunk-EL2B7DEV.mjs} +1 -1
- package/dist/{chunk-35JLHFUT.mjs → chunk-ETW3MBHS.mjs} +22 -1
- package/dist/{chunk-KO7NA3F6.mjs → chunk-FM2P4ENM.mjs} +1 -1
- package/dist/{chunk-C5WYGY6Z.mjs → chunk-GAIFRCYZ.mjs} +7 -4
- package/dist/chunk-GFSZU7EJ.mjs +98 -0
- package/dist/{chunk-SBRQ3OFZ.mjs → chunk-GXYTMCB7.mjs} +1 -1
- package/dist/{chunk-SC4MACIG.mjs → chunk-I4BT2CJO.mjs} +3 -3
- package/dist/{chunk-XXREA57H.mjs → chunk-IE5CXLWU.mjs} +1 -1
- package/dist/{chunk-APWDXCWD.mjs → chunk-IK6D7U2T.mjs} +1 -1
- package/dist/{chunk-TQEN6GDE.mjs → chunk-IKM3NBMK.mjs} +5 -6
- package/dist/{chunk-WUIS6PLE.mjs → chunk-IWIRPC5E.mjs} +1 -1
- package/dist/{chunk-LYCCTNID.mjs → chunk-IZCJWB77.mjs} +1 -1
- package/dist/{chunk-2XITUFL6.mjs → chunk-JRDQVGMH.mjs} +1 -1
- package/dist/chunk-JUSJUVFQ.mjs +76 -0
- package/dist/{chunk-MNVDK2BL.mjs → chunk-KHA3HBEO.mjs} +2 -2
- package/dist/{chunk-SG7V5ROT.mjs → chunk-KIGQEL2O.mjs} +2 -2
- package/dist/{chunk-QFASGPNS.mjs → chunk-KINOD42K.mjs} +1 -1
- package/dist/{chunk-HZJH4DNQ.mjs → chunk-LQP4TYEZ.mjs} +1 -1
- package/dist/{chunk-VMM2KJAS.mjs → chunk-MKKYUGVP.mjs} +1 -1
- package/dist/{chunk-F2LUNHMK.mjs → chunk-NKUXUYVK.mjs} +1 -1
- package/dist/{chunk-JBSMLUJJ.mjs → chunk-NVL4UWPJ.mjs} +1 -1
- package/dist/{chunk-OO27UB75.mjs → chunk-NWPALCKN.mjs} +1 -1
- package/dist/chunk-OEHI4BZZ.mjs +168 -0
- package/dist/{chunk-ZWKDK6AF.mjs → chunk-OZZKYZD6.mjs} +1 -1
- package/dist/{chunk-AGZARRL3.mjs → chunk-P7TCGBAE.mjs} +1 -1
- package/dist/{chunk-5TASA6W6.mjs → chunk-QEWVTGKG.mjs} +1 -1
- package/dist/{chunk-VDBAGIPC.mjs → chunk-QHOOB7IK.mjs} +1 -1
- package/dist/{chunk-ZW2VXGO3.mjs → chunk-RBST5GCI.mjs} +6 -3
- package/dist/{chunk-5RJDVHNT.mjs → chunk-S77CILEG.mjs} +1 -1
- package/dist/{chunk-3VUEZQOO.mjs → chunk-SEVE2FQJ.mjs} +2 -2
- package/dist/{chunk-IEYMYVIN.mjs → chunk-SJYR5CSS.mjs} +1 -1
- package/dist/{chunk-QUUCZPN5.mjs → chunk-TOK2QAHM.mjs} +1 -1
- package/dist/{chunk-LMVNBPQP.mjs → chunk-TYVMTJAK.mjs} +1 -1
- package/dist/{chunk-AJTD3TMG.mjs → chunk-TZRNMUWB.mjs} +1 -1
- package/dist/{chunk-JL4IFWYN.mjs → chunk-V3NTKQZN.mjs} +1 -1
- package/dist/{chunk-Y63TRXZO.mjs → chunk-VFRB5L7W.mjs} +1 -1
- package/dist/{chunk-LY64PCAS.mjs → chunk-WQBCO22E.mjs} +1 -1
- package/dist/{chunk-MVG5DA7S.mjs → chunk-WT5FY6VG.mjs} +1 -1
- package/dist/{chunk-ZO2SVLGC.mjs → chunk-XEOI2KHJ.mjs} +2 -2
- package/dist/{chunk-OY5PZMFI.mjs → chunk-XOGS6MRO.mjs} +3 -1
- package/dist/{chunk-YPONYV6R.mjs → chunk-YQYSWVVW.mjs} +1 -1
- package/dist/{chunk-A5XTNVXI.mjs → chunk-ZC6WO5VD.mjs} +1 -1
- package/dist/{chunk-HSKBYNCP.mjs → chunk-ZMSGID63.mjs} +7 -5
- package/dist/{chunk-G6PIOE4B.mjs → chunk-ZQUNC2MI.mjs} +1 -1
- package/dist/components/ActivityFeed.mjs +4 -4
- package/dist/components/Anchor.mjs +1 -1
- package/dist/components/AreaChart.mjs +3 -3
- package/dist/components/AutoComplete.mjs +2 -2
- package/dist/components/BackTop.mjs +1 -1
- package/dist/components/BarChart.mjs +3 -3
- package/dist/components/Calendar.d.mts +12 -3
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Cascader.mjs +2 -2
- package/dist/components/ChartTooltip.mjs +2 -2
- package/dist/components/Code.d.mts +19 -1
- package/dist/components/Code.mjs +1 -1
- package/dist/components/CodeEditor.d.mts +2 -2
- package/dist/components/ColorPicker.mjs +2 -2
- package/dist/components/CommentThread.mjs +2 -2
- package/dist/components/ContextMenu.mjs +2 -2
- package/dist/components/CropUpload.mjs +4 -4
- package/dist/components/DataExport.mjs +3 -3
- package/dist/components/DataTableWithToolbar.mjs +7 -7
- package/dist/components/DatePicker.mjs +3 -3
- package/dist/components/DonutChart.mjs +4 -4
- package/dist/components/Drag.d.mts +62 -0
- package/dist/components/Drag.mjs +9 -0
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/FloatButton.mjs +2 -2
- package/dist/components/Footer.d.mts +10 -0
- package/dist/components/Footer.mjs +1 -1
- package/dist/components/FormItem.mjs +2 -2
- package/dist/components/FullscreenButton.d.mts +58 -0
- package/dist/components/FullscreenButton.mjs +10 -0
- package/dist/components/FunnelChart.mjs +3 -3
- package/dist/components/GaugeChart.mjs +3 -3
- package/dist/components/HeatmapChart.mjs +3 -3
- package/dist/components/Icon.d.mts +3 -3
- package/dist/components/Image.mjs +5 -5
- package/dist/components/ImageCropper.mjs +1 -1
- package/dist/components/ImageGroup.mjs +3 -3
- package/dist/components/ImagePreview.mjs +2 -2
- package/dist/components/ImageViewer.mjs +3 -3
- package/dist/components/LineChart.mjs +3 -3
- package/dist/components/List.mjs +3 -3
- package/dist/components/Loading.d.mts +1 -1
- package/dist/components/Loading.mjs +2 -2
- package/dist/components/Mentions.mjs +2 -2
- package/dist/components/Menu.d.mts +4 -4
- package/dist/components/Menu.mjs +2 -2
- package/dist/components/Message.mjs +2 -2
- package/dist/components/MessageContainer.mjs +2 -2
- package/dist/components/MessageRoot.mjs +1 -1
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/NavigationMenu.mjs +2 -2
- package/dist/components/Notification.mjs +2 -2
- package/dist/components/NotificationCenter.mjs +5 -5
- package/dist/components/NotificationContainer.mjs +2 -2
- package/dist/components/NotificationRoot.mjs +1 -1
- package/dist/components/NumberKeyboard.mjs +2 -2
- package/dist/components/PieChart.mjs +3 -3
- package/dist/components/Popconfirm.mjs +3 -3
- package/dist/components/Popover.mjs +3 -3
- package/dist/components/RadarChart.mjs +3 -3
- package/dist/components/Rate.mjs +1 -1
- package/dist/components/ScatterChart.mjs +3 -3
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Select.mjs +2 -2
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/SplitButton.mjs +3 -3
- package/dist/components/Spotlight.mjs +2 -2
- package/dist/components/SunburstChart.mjs +3 -3
- package/dist/components/Table.mjs +4 -4
- package/dist/components/Text.d.mts +23 -73
- package/dist/components/Text.mjs +2 -1
- package/dist/components/TimePicker.mjs +2 -2
- package/dist/components/Tooltip.mjs +3 -3
- package/dist/components/Tour.mjs +2 -2
- package/dist/components/TreeMapChart.mjs +3 -3
- package/dist/components/TreeSelect.mjs +2 -2
- package/dist/components/Upload.mjs +3 -3
- package/dist/composables/useFullscreen.d.mts +14 -0
- package/dist/composables/useFullscreen.mjs +6 -0
- package/dist/index.d.mts +5 -2
- package/dist/index.mjs +43 -0
- package/package.json +17 -2
- package/dist/chunk-I77GUQV4.mjs +0 -93
- /package/dist/{chunk-TMOWIIJQ.mjs → chunk-CW2A2SDU.mjs} +0 -0
- /package/dist/{chunk-PFE3YML2.mjs → chunk-JBFAACVC.mjs} +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
renderVueOverlayTeleport,
|
|
9
9
|
useVueAnchoredOverlay
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VFRB5L7W.mjs";
|
|
11
11
|
import {
|
|
12
12
|
useTigerConfig
|
|
13
13
|
} from "./chunk-4GOTWNOO.mjs";
|
|
@@ -60,6 +60,8 @@ import {
|
|
|
60
60
|
mergeStyleValues,
|
|
61
61
|
mergeTigerLocale,
|
|
62
62
|
moveFocusInMenu,
|
|
63
|
+
resolveMenuSearchQuery,
|
|
64
|
+
shouldShowMenuSearch,
|
|
63
65
|
nextOpenKeys,
|
|
64
66
|
nextSelectedKeys,
|
|
65
67
|
reconcileSearchOpenKeys,
|
|
@@ -161,7 +163,7 @@ var Menu = defineComponent({
|
|
|
161
163
|
popupPortal: { type: Boolean, default: true },
|
|
162
164
|
className: { type: String, default: void 0 },
|
|
163
165
|
style: { type: Object, default: void 0 },
|
|
164
|
-
searchable: { type: Boolean, default: false },
|
|
166
|
+
searchable: { type: [Boolean, String], default: false },
|
|
165
167
|
searchValue: { type: String, default: void 0 },
|
|
166
168
|
defaultSearchValue: { type: String, default: "" },
|
|
167
169
|
searchPlaceholder: { type: String, default: void 0 },
|
|
@@ -225,10 +227,11 @@ var Menu = defineComponent({
|
|
|
225
227
|
emit("update:searchValue", value);
|
|
226
228
|
emit("search", value);
|
|
227
229
|
};
|
|
230
|
+
const showSearch = computed(() => shouldShowMenuSearch(props.searchable, collapsed.value));
|
|
228
231
|
const searchResult = computed(
|
|
229
232
|
() => resolveSearchFilter({
|
|
230
233
|
items: props.items,
|
|
231
|
-
query: currentSearchValue.value,
|
|
234
|
+
query: resolveMenuSearchQuery(props.searchable, collapsed.value, currentSearchValue.value),
|
|
232
235
|
filterMode: props.filterMode
|
|
233
236
|
})
|
|
234
237
|
);
|
|
@@ -348,7 +351,7 @@ var Menu = defineComponent({
|
|
|
348
351
|
...passthroughAttrs.value
|
|
349
352
|
},
|
|
350
353
|
[
|
|
351
|
-
|
|
354
|
+
showSearch.value ? h("div", { class: menuSearchFieldClasses }, [
|
|
352
355
|
h("input", {
|
|
353
356
|
type: "search",
|
|
354
357
|
value: currentSearchValue.value,
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useFullscreen
|
|
3
|
+
} from "./chunk-JUSJUVFQ.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useTigerConfig
|
|
6
|
+
} from "./chunk-4GOTWNOO.mjs";
|
|
7
|
+
|
|
8
|
+
// src/components/FullscreenButton.ts
|
|
9
|
+
import { computed, defineComponent, h } from "vue";
|
|
10
|
+
import {
|
|
11
|
+
classNames,
|
|
12
|
+
coerceClassValue,
|
|
13
|
+
fullscreenButtonClasses,
|
|
14
|
+
getFullscreenLabels,
|
|
15
|
+
getIconDefinition,
|
|
16
|
+
mergeTigerLocale
|
|
17
|
+
} from "@expcat/tigercat-core";
|
|
18
|
+
function renderGlyph(name) {
|
|
19
|
+
const definition = getIconDefinition(name);
|
|
20
|
+
if (!definition) return void 0;
|
|
21
|
+
return h(
|
|
22
|
+
"svg",
|
|
23
|
+
{
|
|
24
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
+
viewBox: definition.viewBox,
|
|
26
|
+
fill: "none",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
"stroke-width": "1.5",
|
|
29
|
+
"stroke-linecap": "round",
|
|
30
|
+
"stroke-linejoin": "round",
|
|
31
|
+
class: "h-5 w-5",
|
|
32
|
+
"aria-hidden": "true"
|
|
33
|
+
},
|
|
34
|
+
definition.paths.map((d) => h("path", { d }))
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
var FullscreenButton = defineComponent({
|
|
38
|
+
name: "TigerFullscreenButton",
|
|
39
|
+
inheritAttrs: false,
|
|
40
|
+
props: {
|
|
41
|
+
target: {
|
|
42
|
+
type: [Object, Function],
|
|
43
|
+
default: void 0
|
|
44
|
+
},
|
|
45
|
+
locale: {
|
|
46
|
+
type: Object,
|
|
47
|
+
default: void 0
|
|
48
|
+
},
|
|
49
|
+
labels: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: void 0
|
|
52
|
+
},
|
|
53
|
+
className: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: void 0
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
emits: ["change", "error"],
|
|
59
|
+
setup(props, { emit, attrs }) {
|
|
60
|
+
const config = useTigerConfig();
|
|
61
|
+
const labelSet = computed(
|
|
62
|
+
() => getFullscreenLabels(mergeTigerLocale(config.value.locale, props.locale), props.labels)
|
|
63
|
+
);
|
|
64
|
+
const fullscreen = useFullscreen(() => ({
|
|
65
|
+
target: props.target,
|
|
66
|
+
onChange: (next) => emit("change", next),
|
|
67
|
+
onError: (error) => emit("error", error)
|
|
68
|
+
}));
|
|
69
|
+
return () => {
|
|
70
|
+
const label = fullscreen.isFullscreen.value ? labelSet.value.exitAriaLabel : labelSet.value.enterAriaLabel;
|
|
71
|
+
return h(
|
|
72
|
+
"button",
|
|
73
|
+
{
|
|
74
|
+
...attrs,
|
|
75
|
+
type: "button",
|
|
76
|
+
class: classNames(
|
|
77
|
+
fullscreenButtonClasses,
|
|
78
|
+
props.className,
|
|
79
|
+
coerceClassValue(attrs.class)
|
|
80
|
+
),
|
|
81
|
+
"aria-label": label,
|
|
82
|
+
"aria-pressed": fullscreen.isFullscreen.value,
|
|
83
|
+
disabled: !fullscreen.supported,
|
|
84
|
+
onClick: () => {
|
|
85
|
+
void fullscreen.toggle();
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
renderGlyph(fullscreen.isFullscreen.value ? "fullscreen-exit" : "fullscreen")
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
var FullscreenButton_default = FullscreenButton;
|
|
94
|
+
|
|
95
|
+
export {
|
|
96
|
+
FullscreenButton,
|
|
97
|
+
FullscreenButton_default
|
|
98
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Table,
|
|
3
3
|
tableProps
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5XIHKQL7.mjs";
|
|
5
5
|
import {
|
|
6
6
|
Select
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FM2P4ENM.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Popover
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KIGQEL2O.mjs";
|
|
11
11
|
import {
|
|
12
12
|
Input
|
|
13
13
|
} from "./chunk-DU5F2EE7.mjs";
|
|
@@ -187,9 +187,8 @@ var Anchor = defineComponent({
|
|
|
187
187
|
const config = useTigerConfig();
|
|
188
188
|
const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
|
|
189
189
|
const labelSet = computed(() => getAnchorLabels(mergedLocale.value, props.labels));
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
);
|
|
190
|
+
const resolveContainer = () => resolveAnchorScrollContainer(props.getContainer, anchorRef.value);
|
|
191
|
+
const scrollLock = createProgrammaticScrollLock(() => resolveContainer());
|
|
193
192
|
const scrollOffset = computed(() => props.targetOffset ?? props.offsetTop);
|
|
194
193
|
const links = computed(() => sortAnchorHrefsByDocumentOrder(linkEntries.value));
|
|
195
194
|
const registerLink = (href, node) => {
|
|
@@ -217,7 +216,7 @@ var Anchor = defineComponent({
|
|
|
217
216
|
let stopObserver = null;
|
|
218
217
|
const setupObserver = () => {
|
|
219
218
|
stopObserver?.();
|
|
220
|
-
const container =
|
|
219
|
+
const container = resolveContainer();
|
|
221
220
|
const root = container === window ? null : container;
|
|
222
221
|
stopObserver = createAnchorObserver(links.value, {
|
|
223
222
|
offsetTop: scrollOffset.value,
|
|
@@ -230,7 +229,7 @@ var Anchor = defineComponent({
|
|
|
230
229
|
});
|
|
231
230
|
};
|
|
232
231
|
const scrollTo = (href) => {
|
|
233
|
-
scrollToAnchor(href,
|
|
232
|
+
scrollToAnchor(href, resolveContainer(), scrollOffset.value);
|
|
234
233
|
};
|
|
235
234
|
const handleLinkClick = (href, event, targetAttr) => {
|
|
236
235
|
const hasTargetElement = Boolean(getAnchorTargetElement(href));
|
|
@@ -263,7 +262,7 @@ var Anchor = defineComponent({
|
|
|
263
262
|
inkRef.value.style.width = next.width;
|
|
264
263
|
};
|
|
265
264
|
const resolvedKey = computed(() => {
|
|
266
|
-
const resolved = resolveScrollRoot(props.getContainer);
|
|
265
|
+
const resolved = resolveScrollRoot(props.getContainer, { from: anchorRef.value });
|
|
267
266
|
return resolved.isWindow ? "window" : resolved.target;
|
|
268
267
|
});
|
|
269
268
|
watch(activeLink, () => {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// src/composables/useFullscreen.ts
|
|
2
|
+
import {
|
|
3
|
+
getCurrentInstance,
|
|
4
|
+
onBeforeUnmount,
|
|
5
|
+
onMounted,
|
|
6
|
+
ref,
|
|
7
|
+
toValue
|
|
8
|
+
} from "vue";
|
|
9
|
+
import {
|
|
10
|
+
exitElementFullscreen,
|
|
11
|
+
getFullscreenElement,
|
|
12
|
+
isElementFullscreen,
|
|
13
|
+
isFullscreenSupported,
|
|
14
|
+
requestElementFullscreen,
|
|
15
|
+
resolveFullscreenTarget,
|
|
16
|
+
subscribeFullscreenChange
|
|
17
|
+
} from "@expcat/tigercat-core";
|
|
18
|
+
function useFullscreen(options = {}) {
|
|
19
|
+
const getOptions = () => toValue(options);
|
|
20
|
+
const supported = isFullscreenSupported();
|
|
21
|
+
const isFullscreen = ref(false);
|
|
22
|
+
let stop;
|
|
23
|
+
const sync = () => {
|
|
24
|
+
const current = getOptions();
|
|
25
|
+
const target = resolveFullscreenTarget(current.target);
|
|
26
|
+
const next = isElementFullscreen(target);
|
|
27
|
+
isFullscreen.value = next;
|
|
28
|
+
current.onChange?.(next);
|
|
29
|
+
};
|
|
30
|
+
const enter = async () => {
|
|
31
|
+
const current = getOptions();
|
|
32
|
+
const target = resolveFullscreenTarget(current.target);
|
|
33
|
+
if (!target) return;
|
|
34
|
+
if (isElementFullscreen(target)) return;
|
|
35
|
+
try {
|
|
36
|
+
await requestElementFullscreen(target);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
const err = error instanceof Error ? error : new Error("Fullscreen request failed");
|
|
39
|
+
current.onError?.(err);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const exit = async () => {
|
|
43
|
+
if (!getFullscreenElement()) return;
|
|
44
|
+
const current = getOptions();
|
|
45
|
+
try {
|
|
46
|
+
await exitElementFullscreen();
|
|
47
|
+
} catch (error) {
|
|
48
|
+
const err = error instanceof Error ? error : new Error("Fullscreen exit failed");
|
|
49
|
+
current.onError?.(err);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const toggle = async () => {
|
|
53
|
+
if (isFullscreen.value) await exit();
|
|
54
|
+
else await enter();
|
|
55
|
+
};
|
|
56
|
+
if (getCurrentInstance()) {
|
|
57
|
+
onMounted(() => {
|
|
58
|
+
sync();
|
|
59
|
+
stop = subscribeFullscreenChange(sync);
|
|
60
|
+
});
|
|
61
|
+
onBeforeUnmount(() => {
|
|
62
|
+
stop?.();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
isFullscreen,
|
|
67
|
+
supported,
|
|
68
|
+
enter,
|
|
69
|
+
exit,
|
|
70
|
+
toggle
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
useFullscreen
|
|
76
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePopup
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OZZKYZD6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
assignOverlayTriggerRef,
|
|
6
6
|
renderOverlayTrigger
|
|
7
7
|
} from "./chunk-CMYPAPF2.mjs";
|
|
8
8
|
import {
|
|
9
9
|
renderVueOverlayTeleport
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VFRB5L7W.mjs";
|
|
11
11
|
|
|
12
12
|
// src/components/Tooltip.ts
|
|
13
13
|
import { defineComponent, computed, h, useId } from "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePopup
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OZZKYZD6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
assignOverlayTriggerRef,
|
|
6
6
|
renderOverlayTrigger
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
renderVueOverlayTeleport,
|
|
10
10
|
useVueFocusTrap
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VFRB5L7W.mjs";
|
|
12
12
|
|
|
13
13
|
// src/components/Popover.ts
|
|
14
14
|
import { defineComponent, computed, h, nextTick, useId, watch } from "vue";
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTigerConfig
|
|
3
|
+
} from "./chunk-4GOTWNOO.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/Text.ts
|
|
6
|
+
import { defineComponent, computed, h, onBeforeUnmount, ref } from "vue";
|
|
7
|
+
import {
|
|
8
|
+
copyTextToClipboard,
|
|
9
|
+
createCopyStatusReset,
|
|
10
|
+
getCodeLabels,
|
|
11
|
+
getIconDefinition,
|
|
12
|
+
getTextClasses,
|
|
13
|
+
isTextCopyable,
|
|
14
|
+
mergeTigerLocale,
|
|
15
|
+
resolveLocaleText,
|
|
16
|
+
resolveTextCopyableOptions,
|
|
17
|
+
resolveTextCopyContent,
|
|
18
|
+
resolveTextTag,
|
|
19
|
+
textCopyableBodyClasses,
|
|
20
|
+
textCopyableButtonClasses,
|
|
21
|
+
textCopyableLiveClasses,
|
|
22
|
+
textCopyableRootClasses
|
|
23
|
+
} from "@expcat/tigercat-core";
|
|
24
|
+
var copyIcon = getIconDefinition("copy");
|
|
25
|
+
var Text = defineComponent({
|
|
26
|
+
name: "TigerText",
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
props: {
|
|
29
|
+
tag: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "p"
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "base"
|
|
36
|
+
},
|
|
37
|
+
weight: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "normal"
|
|
40
|
+
},
|
|
41
|
+
align: {
|
|
42
|
+
type: String
|
|
43
|
+
},
|
|
44
|
+
color: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "default"
|
|
47
|
+
},
|
|
48
|
+
truncate: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
italic: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
underline: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
lineThrough: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
copyable: {
|
|
65
|
+
type: [Boolean, Object],
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
locale: {
|
|
69
|
+
type: Object,
|
|
70
|
+
default: void 0
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
emits: ["copy"],
|
|
74
|
+
setup(props, { slots, attrs, emit }) {
|
|
75
|
+
const config = useTigerConfig();
|
|
76
|
+
const textClasses = computed(() => getTextClasses(props));
|
|
77
|
+
const resolvedTag = computed(() => resolveTextTag(props.tag));
|
|
78
|
+
const copyable = computed(() => isTextCopyable(props.copyable));
|
|
79
|
+
const copyOptions = computed(() => resolveTextCopyableOptions(props.copyable));
|
|
80
|
+
const bodyRef = ref(null);
|
|
81
|
+
const copyStatus = ref("idle");
|
|
82
|
+
const reset = createCopyStatusReset((status) => {
|
|
83
|
+
copyStatus.value = status;
|
|
84
|
+
});
|
|
85
|
+
const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
|
|
86
|
+
const labels = computed(() => getCodeLabels(mergedLocale.value));
|
|
87
|
+
const idleLabel = computed(
|
|
88
|
+
() => resolveLocaleText(labels.value.copyLabel, copyOptions.value?.tooltip)
|
|
89
|
+
);
|
|
90
|
+
const buttonLabel = computed(() => {
|
|
91
|
+
if (copyStatus.value === "failed") return labels.value.copyFailedLabel;
|
|
92
|
+
if (copyStatus.value === "copied") return labels.value.copiedLabel;
|
|
93
|
+
return idleLabel.value;
|
|
94
|
+
});
|
|
95
|
+
const liveText = computed(() => copyStatus.value === "idle" ? "" : buttonLabel.value);
|
|
96
|
+
const handleCopy = async () => {
|
|
97
|
+
const options = copyOptions.value;
|
|
98
|
+
if (!options) return;
|
|
99
|
+
const fallback = bodyRef.value?.textContent ?? "";
|
|
100
|
+
const text = resolveTextCopyContent(options, fallback);
|
|
101
|
+
const ok = await copyTextToClipboard(text);
|
|
102
|
+
if (ok) {
|
|
103
|
+
reset.schedule("copied");
|
|
104
|
+
options.onCopy?.(text);
|
|
105
|
+
emit("copy", text);
|
|
106
|
+
} else {
|
|
107
|
+
reset.schedule("failed");
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
onBeforeUnmount(() => {
|
|
111
|
+
reset.dispose();
|
|
112
|
+
});
|
|
113
|
+
return () => {
|
|
114
|
+
const content = slots.default?.();
|
|
115
|
+
if (!copyable.value) {
|
|
116
|
+
return h(resolvedTag.value, { ...attrs, class: [textClasses.value, attrs.class] }, content);
|
|
117
|
+
}
|
|
118
|
+
const bodyClass = [
|
|
119
|
+
textCopyableBodyClasses,
|
|
120
|
+
props.truncate ? "truncate" : void 0,
|
|
121
|
+
textClasses.value
|
|
122
|
+
];
|
|
123
|
+
const copySvg = copyIcon ? h(
|
|
124
|
+
"svg",
|
|
125
|
+
{
|
|
126
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
127
|
+
viewBox: copyIcon.viewBox,
|
|
128
|
+
fill: "none",
|
|
129
|
+
stroke: "currentColor",
|
|
130
|
+
"stroke-width": "1.5",
|
|
131
|
+
"stroke-linecap": "round",
|
|
132
|
+
"stroke-linejoin": "round",
|
|
133
|
+
class: "h-3.5 w-3.5",
|
|
134
|
+
"aria-hidden": "true"
|
|
135
|
+
},
|
|
136
|
+
copyIcon.paths.map((d) => h("path", { d }))
|
|
137
|
+
) : void 0;
|
|
138
|
+
return h(resolvedTag.value, { ...attrs, class: [textCopyableRootClasses, attrs.class] }, [
|
|
139
|
+
h(
|
|
140
|
+
"span",
|
|
141
|
+
{
|
|
142
|
+
ref: bodyRef,
|
|
143
|
+
class: bodyClass
|
|
144
|
+
},
|
|
145
|
+
content
|
|
146
|
+
),
|
|
147
|
+
h(
|
|
148
|
+
"button",
|
|
149
|
+
{
|
|
150
|
+
type: "button",
|
|
151
|
+
class: textCopyableButtonClasses,
|
|
152
|
+
"aria-label": buttonLabel.value,
|
|
153
|
+
title: buttonLabel.value,
|
|
154
|
+
onClick: handleCopy
|
|
155
|
+
},
|
|
156
|
+
copySvg
|
|
157
|
+
),
|
|
158
|
+
h("span", { class: textCopyableLiveClasses, "aria-live": "polite" }, liveText.value)
|
|
159
|
+
]);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
var Text_default = Text;
|
|
164
|
+
|
|
165
|
+
export {
|
|
166
|
+
Text,
|
|
167
|
+
Text_default
|
|
168
|
+
};
|
|
@@ -83,8 +83,10 @@ var BackTop = defineComponent({
|
|
|
83
83
|
const config = useTigerConfig();
|
|
84
84
|
const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
|
|
85
85
|
const labelSet = computed(() => getBackTopLabels(mergedLocale.value, props.labels));
|
|
86
|
+
const hostRef = ref(null);
|
|
87
|
+
const resolveRoot = () => resolveScrollRoot(props.target, { from: hostRef.value });
|
|
86
88
|
const resolvedKey = computed(() => {
|
|
87
|
-
const root =
|
|
89
|
+
const root = resolveRoot();
|
|
88
90
|
return root.isWindow ? "window" : root.target;
|
|
89
91
|
});
|
|
90
92
|
let visibilityController;
|
|
@@ -99,7 +101,7 @@ var BackTop = defineComponent({
|
|
|
99
101
|
};
|
|
100
102
|
const bind = () => {
|
|
101
103
|
unbind();
|
|
102
|
-
const root =
|
|
104
|
+
const root = resolveRoot();
|
|
103
105
|
const eventTarget = getScrollRootEventTarget(root);
|
|
104
106
|
const scrollNode = root.target;
|
|
105
107
|
if (!eventTarget || !scrollNode) return;
|
|
@@ -115,7 +117,7 @@ var BackTop = defineComponent({
|
|
|
115
117
|
visibilityController.update();
|
|
116
118
|
};
|
|
117
119
|
const handleClick = (event) => {
|
|
118
|
-
const root =
|
|
120
|
+
const root = resolveRoot();
|
|
119
121
|
if (!root.target) {
|
|
120
122
|
emit("click", event);
|
|
121
123
|
return;
|
|
@@ -165,6 +167,7 @@ var BackTop = defineComponent({
|
|
|
165
167
|
"button",
|
|
166
168
|
{
|
|
167
169
|
...attrs,
|
|
170
|
+
ref: hostRef,
|
|
168
171
|
type: "button",
|
|
169
172
|
class: buttonClasses.value,
|
|
170
173
|
style: mergedStyle.value,
|