@yh-ui/yh-ui 1.0.61 → 1.0.63
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/chunks/mermaid.mjs +3 -3
- package/dist/full.mjs +1762 -934
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1 -1
- package/dist/sandbox-entry.cjs +23 -0
- package/dist/sandbox-entry.d.ts +4 -0
- package/dist/sandbox-entry.mjs +4 -0
- package/package.json +7 -7
package/dist/full.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { inject, ref, unref, computed, onUnmounted, watch, useId as useId$1, sha
|
|
|
2
2
|
import AsyncValidator from 'async-validator';
|
|
3
3
|
import { autoUpdate, computePosition, offset, flip, shift, arrow } from '@floating-ui/dom';
|
|
4
4
|
|
|
5
|
-
const version$1 = "1.0.
|
|
5
|
+
const version$1 = "1.0.63";
|
|
6
6
|
const packageJson = {
|
|
7
7
|
version: version$1};
|
|
8
8
|
|
|
@@ -476,6 +476,32 @@ const useNamespace = (block) => {
|
|
|
476
476
|
};
|
|
477
477
|
};
|
|
478
478
|
|
|
479
|
+
const configProviderContextKey = Symbol(
|
|
480
|
+
"configProviderContextKey"
|
|
481
|
+
);
|
|
482
|
+
const useConfig = () => {
|
|
483
|
+
const configRef = inject(configProviderContextKey, null);
|
|
484
|
+
const globalOptions = inject("yh-ui-options", null);
|
|
485
|
+
const globalSize = computed(() => {
|
|
486
|
+
const config = unref(configRef);
|
|
487
|
+
return config?.size || globalOptions?.size || "default";
|
|
488
|
+
});
|
|
489
|
+
const globalZIndex = computed(() => {
|
|
490
|
+
const config = unref(configRef);
|
|
491
|
+
return config?.zIndex || globalOptions?.zIndex || 2e3;
|
|
492
|
+
});
|
|
493
|
+
const globalLocale = computed(() => {
|
|
494
|
+
const config = unref(configRef);
|
|
495
|
+
return config?.locale || globalOptions?.locale;
|
|
496
|
+
});
|
|
497
|
+
return {
|
|
498
|
+
config: configRef,
|
|
499
|
+
globalSize,
|
|
500
|
+
globalZIndex,
|
|
501
|
+
globalLocale
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
|
|
479
505
|
const defaultInitialZIndex = 2e3;
|
|
480
506
|
const zIndexContextKey = Symbol("zIndexContextKey");
|
|
481
507
|
const zIndexCounterKey = Symbol("zIndexCounterKey");
|
|
@@ -498,11 +524,11 @@ const createZIndexCounter = (initialValue = defaultInitialZIndex) => {
|
|
|
498
524
|
return { current: initialValue };
|
|
499
525
|
};
|
|
500
526
|
const useZIndex = (zIndexOverrides) => {
|
|
501
|
-
const
|
|
527
|
+
const { globalZIndex } = useConfig();
|
|
502
528
|
const appCounter = inject(zIndexCounterKey, null);
|
|
503
529
|
const initialZIndex = computed(() => {
|
|
504
530
|
const override = unref(zIndexOverrides);
|
|
505
|
-
return override ?? unref(
|
|
531
|
+
return override ?? unref(globalZIndex) ?? defaultInitialZIndex;
|
|
506
532
|
});
|
|
507
533
|
const currentZIndex = computed(() => initialZIndex.value);
|
|
508
534
|
const nextZIndex = () => {
|
|
@@ -520,12 +546,12 @@ const useZIndex = (zIndexOverrides) => {
|
|
|
520
546
|
};
|
|
521
547
|
};
|
|
522
548
|
|
|
523
|
-
function useSKU(specs, skus, initialSelection = []) {
|
|
549
|
+
function useSKU(specs, skus, initialSelection = [], checkStock = true) {
|
|
524
550
|
const selectedValueIds = ref(initialSelection);
|
|
525
551
|
const pathDict = computed(() => {
|
|
526
552
|
const dict = {};
|
|
527
553
|
skus.forEach((sku) => {
|
|
528
|
-
if (sku.stock <= 0) return;
|
|
554
|
+
if (checkStock && sku.stock <= 0) return;
|
|
529
555
|
const powerSet = getPowerSet(sku.specValueIds);
|
|
530
556
|
powerSet.forEach((path) => {
|
|
531
557
|
const key = path.join(",");
|
|
@@ -543,7 +569,7 @@ function useSKU(specs, skus, initialSelection = []) {
|
|
|
543
569
|
}
|
|
544
570
|
const query = tempSelected.filter((v) => !!v).sort((a, b) => String(a).localeCompare(String(b))).join(",");
|
|
545
571
|
if (!query) return true;
|
|
546
|
-
return
|
|
572
|
+
return query in pathDict.value;
|
|
547
573
|
};
|
|
548
574
|
const toggleValue = (specIndex, valueId) => {
|
|
549
575
|
if (selectedValueIds.value[specIndex] === valueId) {
|
|
@@ -2232,32 +2258,6 @@ const en$1 = {
|
|
|
2232
2258
|
}
|
|
2233
2259
|
};
|
|
2234
2260
|
|
|
2235
|
-
const configProviderContextKey = Symbol(
|
|
2236
|
-
"configProviderContextKey"
|
|
2237
|
-
);
|
|
2238
|
-
const useConfig = () => {
|
|
2239
|
-
const configRef = inject(configProviderContextKey, null);
|
|
2240
|
-
const globalOptions = inject("yh-ui-options", null);
|
|
2241
|
-
const globalSize = computed(() => {
|
|
2242
|
-
const config = unref(configRef);
|
|
2243
|
-
return config?.size || globalOptions?.size || "default";
|
|
2244
|
-
});
|
|
2245
|
-
const globalZIndex = computed(() => {
|
|
2246
|
-
const config = unref(configRef);
|
|
2247
|
-
return config?.zIndex || globalOptions?.zIndex || 2e3;
|
|
2248
|
-
});
|
|
2249
|
-
const globalLocale = computed(() => {
|
|
2250
|
-
const config = unref(configRef);
|
|
2251
|
-
return config?.locale || globalOptions?.locale;
|
|
2252
|
-
});
|
|
2253
|
-
return {
|
|
2254
|
-
config: configRef,
|
|
2255
|
-
globalSize,
|
|
2256
|
-
globalZIndex,
|
|
2257
|
-
globalLocale
|
|
2258
|
-
};
|
|
2259
|
-
};
|
|
2260
|
-
|
|
2261
2261
|
var __create$2 = Object.create;
|
|
2262
2262
|
var __defProp$2 = Object.defineProperty;
|
|
2263
2263
|
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
@@ -2567,12 +2567,7 @@ var dayjs$1 = typeof import_dayjs$1.default === "function" ? import_dayjs$1.defa
|
|
|
2567
2567
|
);
|
|
2568
2568
|
var dayjs_default$1 = dayjs$1;
|
|
2569
2569
|
|
|
2570
|
-
const dayjsLocales =
|
|
2571
|
-
["../../../../node_modules/dayjs/locale/*.js", "../../../../dayjs/locale/*.js"],
|
|
2572
|
-
{
|
|
2573
|
-
eager: false
|
|
2574
|
-
}
|
|
2575
|
-
);
|
|
2570
|
+
const dayjsLocales = {};
|
|
2576
2571
|
const loadedLocales = /* @__PURE__ */ new Set(["en"]);
|
|
2577
2572
|
const localeMapping = {
|
|
2578
2573
|
"zh-cn": "zh-cn",
|
|
@@ -6177,7 +6172,7 @@ function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
|
|
|
6177
6172
|
}
|
|
6178
6173
|
|
|
6179
6174
|
const _hoisted_1$1m = ["value", "placeholder", "disabled", "readonly", "maxlength", "minlength", "rows", "name", "id", "tabindex", "autocomplete", "autofocus", "aria-label", "inputmode"];
|
|
6180
|
-
const _hoisted_2$
|
|
6175
|
+
const _hoisted_2$Y = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "minlength", "name", "id", "tabindex", "list", "autocomplete", "autofocus", "aria-label", "inputmode", "aria-invalid", "aria-describedby"];
|
|
6181
6176
|
const _hoisted_3$K = {
|
|
6182
6177
|
key: 0,
|
|
6183
6178
|
viewBox: "0 0 24 24",
|
|
@@ -6612,7 +6607,7 @@ return (_ctx, _cache) => {
|
|
|
6612
6607
|
onCompositionstart: handleCompositionStart,
|
|
6613
6608
|
onCompositionupdate: handleCompositionUpdate,
|
|
6614
6609
|
onCompositionend: handleCompositionEnd
|
|
6615
|
-
}, null, 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2$
|
|
6610
|
+
}, null, 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2$Y)
|
|
6616
6611
|
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */)),
|
|
6617
6612
|
createCommentVNode(" 后置图标/文本/内容 "),
|
|
6618
6613
|
(hasSuffix.value)
|
|
@@ -7993,7 +7988,7 @@ const controlsPositions = ["", "right"];
|
|
|
7993
7988
|
const YhInputNumber = withInstall(_sfc_main$26);
|
|
7994
7989
|
|
|
7995
7990
|
const _hoisted_1$1g = ["draggable", "onDragstart", "onDragover", "onDrop"];
|
|
7996
|
-
const _hoisted_2$
|
|
7991
|
+
const _hoisted_2$X = ["onClick"];
|
|
7997
7992
|
const _hoisted_3$J = ["value", "placeholder", "disabled", "readonly"];
|
|
7998
7993
|
|
|
7999
7994
|
const _sfc_main$25 = /*@__PURE__*/Object.assign({
|
|
@@ -8332,7 +8327,7 @@ return (_ctx, _cache) => {
|
|
|
8332
8327
|
d: "M576 512l277.333333 277.333333-64 64-277.333333-277.333333L234.666667 853.333333 170.666667 789.333333l277.333333-277.333333L170.666667 234.666667 234.666667 170.666667l277.333333 277.333333L789.333333 170.666667 853.333333 234.666667 576 512z"
|
|
8333
8328
|
})
|
|
8334
8329
|
], -1 /* CACHED */)
|
|
8335
|
-
]))], 10 /* CLASS, PROPS */, _hoisted_2$
|
|
8330
|
+
]))], 10 /* CLASS, PROPS */, _hoisted_2$X))
|
|
8336
8331
|
: createCommentVNode("v-if", true)
|
|
8337
8332
|
], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_1$1g)
|
|
8338
8333
|
])
|
|
@@ -9427,7 +9422,7 @@ const formItemProps = {
|
|
|
9427
9422
|
};
|
|
9428
9423
|
|
|
9429
9424
|
const _hoisted_1$1e = ["data-prop"];
|
|
9430
|
-
const _hoisted_2$
|
|
9425
|
+
const _hoisted_2$W = {
|
|
9431
9426
|
key: 0,
|
|
9432
9427
|
viewBox: "0 0 1024 1024",
|
|
9433
9428
|
width: "16",
|
|
@@ -9615,7 +9610,7 @@ return (_ctx, _cache) => {
|
|
|
9615
9610
|
class: normalizeClass([unref(ns).e('status-icon'), unref(ns).is(currentValidateStatus.value)])
|
|
9616
9611
|
}, [
|
|
9617
9612
|
(currentValidateStatus.value === 'success')
|
|
9618
|
-
? (openBlock(), createElementBlock("svg", _hoisted_2$
|
|
9613
|
+
? (openBlock(), createElementBlock("svg", _hoisted_2$W, [...(_cache[0] || (_cache[0] = [
|
|
9619
9614
|
createElementVNode("path", {
|
|
9620
9615
|
fill: "currentColor",
|
|
9621
9616
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-55.808 536.32l-114.944-114.88a32 32 0 1 0-45.248 45.248l137.536 137.472a32 32 0 0 0 45.248 0l310.4-310.272a32 32 0 1 0-45.248-45.248L456.192 600.32z"
|
|
@@ -9687,15 +9682,15 @@ const formSchemaProps = {
|
|
|
9687
9682
|
};
|
|
9688
9683
|
|
|
9689
9684
|
const _hoisted_1$1d = { class: "yh-form--grid" };
|
|
9690
|
-
const _hoisted_2$
|
|
9685
|
+
const _hoisted_2$V = {
|
|
9691
9686
|
key: 0,
|
|
9692
9687
|
class: "yh-form-col yh-form-col--24"
|
|
9693
9688
|
};
|
|
9694
9689
|
const _hoisted_3$H = ["onClick"];
|
|
9695
9690
|
const _hoisted_4$u = { class: "yh-form-schema__group-title-text" };
|
|
9696
9691
|
const _hoisted_5$n = { class: "yh-form--grid" };
|
|
9697
|
-
const _hoisted_6$
|
|
9698
|
-
const _hoisted_7$
|
|
9692
|
+
const _hoisted_6$l = ["title"];
|
|
9693
|
+
const _hoisted_7$h = {
|
|
9699
9694
|
class: "yh-form--grid",
|
|
9700
9695
|
style: {"flex":"1"}
|
|
9701
9696
|
};
|
|
@@ -9968,7 +9963,7 @@ return (_ctx, _cache) => {
|
|
|
9968
9963
|
return (openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
9969
9964
|
createCommentVNode(" ===== 分组渲染 ===== "),
|
|
9970
9965
|
(isGroup(item))
|
|
9971
|
-
? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
9966
|
+
? (openBlock(), createElementBlock("div", _hoisted_2$V, [
|
|
9972
9967
|
createElementVNode("fieldset", mergeProps({
|
|
9973
9968
|
class: [unref(ns).e('group'), {
|
|
9974
9969
|
'is-collapsed': collapsedMap[getGroupTitle(item)]
|
|
@@ -10107,7 +10102,7 @@ return (_ctx, _cache) => {
|
|
|
10107
10102
|
key: 0,
|
|
10108
10103
|
class: normalizeClass(unref(ns).e('tooltip')),
|
|
10109
10104
|
title: subItem.tooltip
|
|
10110
|
-
}, "?", 10 /* CLASS, PROPS */, _hoisted_6$
|
|
10105
|
+
}, "?", 10 /* CLASS, PROPS */, _hoisted_6$l))
|
|
10111
10106
|
: createCommentVNode("v-if", true)
|
|
10112
10107
|
]),
|
|
10113
10108
|
key: "0"
|
|
@@ -10173,7 +10168,7 @@ return (_ctx, _cache) => {
|
|
|
10173
10168
|
key: rowIdx,
|
|
10174
10169
|
class: normalizeClass(unref(ns).e('list-row'))
|
|
10175
10170
|
}, [
|
|
10176
|
-
createElementVNode("div", _hoisted_7$
|
|
10171
|
+
createElementVNode("div", _hoisted_7$h, [
|
|
10177
10172
|
(openBlock(true), createElementBlock(Fragment, null, renderList(item.listSchema, (sub) => {
|
|
10178
10173
|
return (openBlock(), createElementBlock("div", {
|
|
10179
10174
|
key: sub.field,
|
|
@@ -11019,7 +11014,7 @@ const switchEmits = {
|
|
|
11019
11014
|
};
|
|
11020
11015
|
|
|
11021
11016
|
const _hoisted_1$1b = ["aria-checked", "aria-disabled"];
|
|
11022
|
-
const _hoisted_2$
|
|
11017
|
+
const _hoisted_2$U = ["id", "name", "disabled", "checked", "tabindex", "aria-label"];
|
|
11023
11018
|
const _hoisted_3$G = { key: 1 };
|
|
11024
11019
|
const _hoisted_4$t = { key: 1 };
|
|
11025
11020
|
|
|
@@ -11133,7 +11128,7 @@ return (_ctx, _cache) => {
|
|
|
11133
11128
|
"aria-label": props.ariaLabel,
|
|
11134
11129
|
onChange: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"])),
|
|
11135
11130
|
onKeydown: withKeys(handleClick, ["enter"])
|
|
11136
|
-
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$
|
|
11131
|
+
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$U),
|
|
11137
11132
|
createCommentVNode(" 左侧标签(非内嵌模式) "),
|
|
11138
11133
|
(!props.inlinePrompt && (props.inactiveIcon || props.inactiveText))
|
|
11139
11134
|
? (openBlock(), createElementBlock("span", {
|
|
@@ -11252,7 +11247,7 @@ return (_ctx, _cache) => {
|
|
|
11252
11247
|
const YhSwitch = withInstall(_sfc_main$1Y);
|
|
11253
11248
|
|
|
11254
11249
|
const _hoisted_1$1a = ["id", "value", "placeholder", "disabled", "name", "autocomplete", "autofocus", "aria-expanded", "aria-controls", "aria-activedescendant"];
|
|
11255
|
-
const _hoisted_2$
|
|
11250
|
+
const _hoisted_2$T = ["id"];
|
|
11256
11251
|
const _hoisted_3$F = ["id", "aria-selected", "onClick", "onMouseenter"];
|
|
11257
11252
|
|
|
11258
11253
|
const _sfc_main$1X = /*@__PURE__*/Object.assign({
|
|
@@ -11337,7 +11332,7 @@ const wrapperClasses = computed(() => [
|
|
|
11337
11332
|
}
|
|
11338
11333
|
]);
|
|
11339
11334
|
const updateDropdownPosition = () => {
|
|
11340
|
-
if (!wrapperRef.value || !props.teleported) return;
|
|
11335
|
+
if (typeof window === "undefined" || !wrapperRef.value || !props.teleported) return;
|
|
11341
11336
|
const rect = wrapperRef.value.getBoundingClientRect();
|
|
11342
11337
|
const styles = window.getComputedStyle(wrapperRef.value);
|
|
11343
11338
|
const primary = styles.getPropertyValue("--yh-color-primary").trim();
|
|
@@ -11384,24 +11379,28 @@ const handleScroll = () => {
|
|
|
11384
11379
|
};
|
|
11385
11380
|
const handleOutsideClick = (e) => {
|
|
11386
11381
|
const target = e.target;
|
|
11387
|
-
if (wrapperRef.value?.contains(target) || dropdownRef.value?.contains(target)) {
|
|
11382
|
+
if (wrapperRef.value?.contains(target) || dropdownRef.value?.contains(target) || target.closest?.("[data-popper-root]") === dropdownRef.value) {
|
|
11388
11383
|
return;
|
|
11389
11384
|
}
|
|
11390
11385
|
visible.value = false;
|
|
11391
11386
|
};
|
|
11392
11387
|
onMounted(() => {
|
|
11393
|
-
if (
|
|
11394
|
-
|
|
11395
|
-
|
|
11388
|
+
if (typeof window !== "undefined") {
|
|
11389
|
+
if (props.teleported) {
|
|
11390
|
+
window.addEventListener("resize", handleResize);
|
|
11391
|
+
window.addEventListener("scroll", handleScroll, true);
|
|
11392
|
+
}
|
|
11393
|
+
window.addEventListener("click", handleOutsideClick);
|
|
11396
11394
|
}
|
|
11397
|
-
window.addEventListener("click", handleOutsideClick);
|
|
11398
11395
|
});
|
|
11399
11396
|
onBeforeUnmount(() => {
|
|
11400
|
-
if (
|
|
11401
|
-
|
|
11402
|
-
|
|
11397
|
+
if (typeof window !== "undefined") {
|
|
11398
|
+
if (props.teleported) {
|
|
11399
|
+
window.removeEventListener("resize", handleResize);
|
|
11400
|
+
window.removeEventListener("scroll", handleScroll, true);
|
|
11401
|
+
}
|
|
11402
|
+
window.removeEventListener("click", handleOutsideClick);
|
|
11403
11403
|
}
|
|
11404
|
-
window.removeEventListener("click", handleOutsideClick);
|
|
11405
11404
|
if (debounceTimer) {
|
|
11406
11405
|
clearTimeout(debounceTimer);
|
|
11407
11406
|
}
|
|
@@ -11718,6 +11717,7 @@ return (_ctx, _cache) => {
|
|
|
11718
11717
|
ref: dropdownRef,
|
|
11719
11718
|
class: normalizeClass([unref(ns).e('dropdown'), __props.popperClass]),
|
|
11720
11719
|
style: normalizeStyle(__props.teleported ? dropdownStyle.value : {}),
|
|
11720
|
+
"data-popper-root": "",
|
|
11721
11721
|
onMousedown: _cache[2] || (_cache[2] = $event => (isClickingDropdown.value = true)),
|
|
11722
11722
|
onMouseup: _cache[3] || (_cache[3] = $event => (isClickingDropdown.value = false))
|
|
11723
11723
|
}, [
|
|
@@ -11767,7 +11767,7 @@ return (_ctx, _cache) => {
|
|
|
11767
11767
|
])
|
|
11768
11768
|
], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_3$F))
|
|
11769
11769
|
}), 128 /* KEYED_FRAGMENT */))
|
|
11770
|
-
], 10 /* CLASS, PROPS */, _hoisted_2$
|
|
11770
|
+
], 10 /* CLASS, PROPS */, _hoisted_2$T)
|
|
11771
11771
|
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
11772
11772
|
: (unref(slots).empty)
|
|
11773
11773
|
? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
@@ -11963,7 +11963,7 @@ const tooltipEmits = {
|
|
|
11963
11963
|
};
|
|
11964
11964
|
|
|
11965
11965
|
const _hoisted_1$19 = ["id", "data-placement"];
|
|
11966
|
-
const _hoisted_2$
|
|
11966
|
+
const _hoisted_2$S = ["innerHTML"];
|
|
11967
11967
|
const _hoisted_3$E = { key: 1 };
|
|
11968
11968
|
|
|
11969
11969
|
const _sfc_main$1W = /*@__PURE__*/Object.assign({
|
|
@@ -12029,6 +12029,7 @@ const popperClasses = computed(() => [
|
|
|
12029
12029
|
]);
|
|
12030
12030
|
const updatePosition = async () => {
|
|
12031
12031
|
if (!triggerRef.value || !popperRef.value || typeof window === "undefined") return;
|
|
12032
|
+
if (props.showArrow && !arrowRef.value) return;
|
|
12032
12033
|
const { x, y, placement, middlewareData } = await computePosition(
|
|
12033
12034
|
triggerRef.value,
|
|
12034
12035
|
popperRef.value,
|
|
@@ -12207,6 +12208,7 @@ onMounted(() => {
|
|
|
12207
12208
|
});
|
|
12208
12209
|
onUnmounted(() => {
|
|
12209
12210
|
stopAutoUpdate();
|
|
12211
|
+
cleanup = null;
|
|
12210
12212
|
if (showTimer) {
|
|
12211
12213
|
clearTimeout(showTimer);
|
|
12212
12214
|
showTimer = null;
|
|
@@ -12267,7 +12269,7 @@ return (_ctx, _cache) => {
|
|
|
12267
12269
|
? (openBlock(), createElementBlock("span", {
|
|
12268
12270
|
key: 0,
|
|
12269
12271
|
innerHTML: _ctx.content
|
|
12270
|
-
}, null, 8 /* PROPS */, _hoisted_2$
|
|
12272
|
+
}, null, 8 /* PROPS */, _hoisted_2$S))
|
|
12271
12273
|
: (openBlock(), createElementBlock("span", _hoisted_3$E, toDisplayString(_ctx.content), 1 /* TEXT */))
|
|
12272
12274
|
])
|
|
12273
12275
|
], 6 /* CLASS, STYLE */),
|
|
@@ -12310,11 +12312,11 @@ const YhTooltip = withInstall(_sfc_main$1W);
|
|
|
12310
12312
|
const SelectContextKey = Symbol("SelectContextKey");
|
|
12311
12313
|
|
|
12312
12314
|
const _hoisted_1$18 = ["onClick"];
|
|
12313
|
-
const _hoisted_2$
|
|
12315
|
+
const _hoisted_2$R = ["id", "value", "placeholder", "disabled", "readonly", "aria-label", "aria-expanded", "aria-controls"];
|
|
12314
12316
|
const _hoisted_3$D = ["id"];
|
|
12315
12317
|
const _hoisted_4$s = ["aria-selected", "onClick", "onMouseenter"];
|
|
12316
12318
|
const _hoisted_5$m = ["aria-selected", "onClick", "onMouseenter"];
|
|
12317
|
-
const _hoisted_6$
|
|
12319
|
+
const _hoisted_6$k = { key: 0 };
|
|
12318
12320
|
|
|
12319
12321
|
const _sfc_main$1V = /*@__PURE__*/Object.assign({
|
|
12320
12322
|
name: "YhSelect"
|
|
@@ -12399,7 +12401,7 @@ const onOptionDestroy = (value) => {
|
|
|
12399
12401
|
};
|
|
12400
12402
|
const dropdownStyle = ref({});
|
|
12401
12403
|
const updateDropdownPosition = () => {
|
|
12402
|
-
if (!wrapperRef.value || !props.teleported) return;
|
|
12404
|
+
if (typeof window === "undefined" || !wrapperRef.value || !props.teleported) return;
|
|
12403
12405
|
const rect = wrapperRef.value.getBoundingClientRect();
|
|
12404
12406
|
const styles = window.getComputedStyle(wrapperRef.value);
|
|
12405
12407
|
const primary = styles.getPropertyValue("--yh-color-primary").trim();
|
|
@@ -12431,18 +12433,22 @@ const handleOutsideClick = (e) => {
|
|
|
12431
12433
|
}
|
|
12432
12434
|
};
|
|
12433
12435
|
onMounted(() => {
|
|
12434
|
-
if (
|
|
12435
|
-
|
|
12436
|
-
|
|
12436
|
+
if (typeof window !== "undefined") {
|
|
12437
|
+
if (props.teleported) {
|
|
12438
|
+
window.addEventListener("scroll", updateDropdownPosition, true);
|
|
12439
|
+
window.addEventListener("resize", updateDropdownPosition);
|
|
12440
|
+
}
|
|
12441
|
+
window.addEventListener("click", handleOutsideClick);
|
|
12437
12442
|
}
|
|
12438
|
-
window.addEventListener("click", handleOutsideClick);
|
|
12439
12443
|
});
|
|
12440
12444
|
onBeforeUnmount(() => {
|
|
12441
|
-
if (
|
|
12442
|
-
|
|
12443
|
-
|
|
12445
|
+
if (typeof window !== "undefined") {
|
|
12446
|
+
if (props.teleported) {
|
|
12447
|
+
window.removeEventListener("scroll", updateDropdownPosition, true);
|
|
12448
|
+
window.removeEventListener("resize", updateDropdownPosition);
|
|
12449
|
+
}
|
|
12450
|
+
window.removeEventListener("click", handleOutsideClick);
|
|
12444
12451
|
}
|
|
12445
|
-
window.removeEventListener("click", handleOutsideClick);
|
|
12446
12452
|
});
|
|
12447
12453
|
const allOptions = computed(() => {
|
|
12448
12454
|
return [...createdOptions.value, ...slotOptions.value, ...props.options || []];
|
|
@@ -12620,12 +12626,23 @@ const toggleDropdown = () => {
|
|
|
12620
12626
|
const handleInput = (event) => {
|
|
12621
12627
|
const target = event.target;
|
|
12622
12628
|
query.value = target.value;
|
|
12623
|
-
if (props.remote && props.remoteMethod) {
|
|
12624
|
-
props.remoteMethod(query.value);
|
|
12625
|
-
} else if (props.filterMethod) {
|
|
12629
|
+
if (!(props.remote && props.remoteMethod) && props.filterMethod) {
|
|
12626
12630
|
props.filterMethod(query.value);
|
|
12627
12631
|
}
|
|
12628
12632
|
};
|
|
12633
|
+
watch(query, (val) => {
|
|
12634
|
+
if (props.remote && props.remoteMethod) {
|
|
12635
|
+
props.remoteMethod(val);
|
|
12636
|
+
}
|
|
12637
|
+
});
|
|
12638
|
+
watch(
|
|
12639
|
+
() => props.modelValue,
|
|
12640
|
+
() => {
|
|
12641
|
+
if (props.remote && props.remoteMethod) {
|
|
12642
|
+
props.remoteMethod(query.value);
|
|
12643
|
+
}
|
|
12644
|
+
}
|
|
12645
|
+
);
|
|
12629
12646
|
const handleKeydown = (event) => {
|
|
12630
12647
|
switch (event.key) {
|
|
12631
12648
|
case "ArrowDown":
|
|
@@ -12774,7 +12791,12 @@ provide(SelectContextKey, {
|
|
|
12774
12791
|
__expose({
|
|
12775
12792
|
focus,
|
|
12776
12793
|
blur,
|
|
12777
|
-
inputRef
|
|
12794
|
+
inputRef,
|
|
12795
|
+
triggerRemoteMethod: (val) => {
|
|
12796
|
+
if (props.remote && props.remoteMethod) {
|
|
12797
|
+
props.remoteMethod(val);
|
|
12798
|
+
}
|
|
12799
|
+
}
|
|
12778
12800
|
});
|
|
12779
12801
|
|
|
12780
12802
|
return (_ctx, _cache) => {
|
|
@@ -12871,7 +12893,7 @@ return (_ctx, _cache) => {
|
|
|
12871
12893
|
onFocus: handleFocus,
|
|
12872
12894
|
onBlur: handleBlur,
|
|
12873
12895
|
onKeydown: handleKeydown
|
|
12874
|
-
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$
|
|
12896
|
+
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$R),
|
|
12875
12897
|
createCommentVNode(" 单选显示值 "),
|
|
12876
12898
|
(!__props.multiple && hasValue.value && !query.value)
|
|
12877
12899
|
? (openBlock(), createElementBlock("span", {
|
|
@@ -13075,7 +13097,7 @@ return (_ctx, _cache) => {
|
|
|
13075
13097
|
], 8 /* PROPS */, ["disabled"])),
|
|
13076
13098
|
createCommentVNode(" 隐藏插槽,用于注册 Option "),
|
|
13077
13099
|
(_ctx.$slots.default)
|
|
13078
|
-
? withDirectives((openBlock(), createElementBlock("div", _hoisted_6$
|
|
13100
|
+
? withDirectives((openBlock(), createElementBlock("div", _hoisted_6$k, [
|
|
13079
13101
|
renderSlot(_ctx.$slots, "default")
|
|
13080
13102
|
], 512 /* NEED_PATCH */)), [
|
|
13081
13103
|
[vShow, false]
|
|
@@ -13182,7 +13204,7 @@ const defaultCascaderConfig = {
|
|
|
13182
13204
|
};
|
|
13183
13205
|
|
|
13184
13206
|
const _hoisted_1$17 = ["onClick", "onMouseenter"];
|
|
13185
|
-
const _hoisted_2$
|
|
13207
|
+
const _hoisted_2$Q = ["onClick"];
|
|
13186
13208
|
const _hoisted_3$C = {
|
|
13187
13209
|
key: 0,
|
|
13188
13210
|
viewBox: "0 0 1024 1024",
|
|
@@ -13377,7 +13399,7 @@ return (_ctx, _cache) => {
|
|
|
13377
13399
|
]))]))
|
|
13378
13400
|
: createCommentVNode("v-if", true)
|
|
13379
13401
|
], 2 /* CLASS */)
|
|
13380
|
-
], 10 /* CLASS, PROPS */, _hoisted_2$
|
|
13402
|
+
], 10 /* CLASS, PROPS */, _hoisted_2$Q))
|
|
13381
13403
|
: createCommentVNode("v-if", true),
|
|
13382
13404
|
createCommentVNode(" 标签内容 "),
|
|
13383
13405
|
createElementVNode("span", {
|
|
@@ -13420,7 +13442,7 @@ return (_ctx, _cache) => {
|
|
|
13420
13442
|
});
|
|
13421
13443
|
|
|
13422
13444
|
const _hoisted_1$16 = ["onClick"];
|
|
13423
|
-
const _hoisted_2$
|
|
13445
|
+
const _hoisted_2$P = ["id", "value", "placeholder", "disabled", "readonly", "aria-expanded"];
|
|
13424
13446
|
const _hoisted_3$B = ["onClick"];
|
|
13425
13447
|
|
|
13426
13448
|
const _sfc_main$1S = /*@__PURE__*/Object.assign({
|
|
@@ -13492,7 +13514,7 @@ const expandedPath = ref([]);
|
|
|
13492
13514
|
const isClickingDropdown = ref(false);
|
|
13493
13515
|
const dropdownStyle = ref({});
|
|
13494
13516
|
const updateDropdownPosition = () => {
|
|
13495
|
-
if (!wrapperRef.value || !props.teleported) return;
|
|
13517
|
+
if (typeof window === "undefined" || !wrapperRef.value || !props.teleported) return;
|
|
13496
13518
|
const rect = wrapperRef.value.getBoundingClientRect();
|
|
13497
13519
|
const styles = window.getComputedStyle(wrapperRef.value);
|
|
13498
13520
|
const primary = styles.getPropertyValue("--yh-color-primary").trim();
|
|
@@ -13515,15 +13537,19 @@ watch(visible, (val) => {
|
|
|
13515
13537
|
}
|
|
13516
13538
|
});
|
|
13517
13539
|
onMounted(() => {
|
|
13518
|
-
if (
|
|
13519
|
-
|
|
13520
|
-
|
|
13540
|
+
if (typeof window !== "undefined") {
|
|
13541
|
+
if (props.teleported) {
|
|
13542
|
+
window.addEventListener("scroll", updateDropdownPosition, true);
|
|
13543
|
+
window.addEventListener("resize", updateDropdownPosition);
|
|
13544
|
+
}
|
|
13521
13545
|
}
|
|
13522
13546
|
});
|
|
13523
13547
|
onBeforeUnmount(() => {
|
|
13524
|
-
if (
|
|
13525
|
-
|
|
13526
|
-
|
|
13548
|
+
if (typeof window !== "undefined") {
|
|
13549
|
+
if (props.teleported) {
|
|
13550
|
+
window.removeEventListener("scroll", updateDropdownPosition, true);
|
|
13551
|
+
window.removeEventListener("resize", updateDropdownPosition);
|
|
13552
|
+
}
|
|
13527
13553
|
}
|
|
13528
13554
|
});
|
|
13529
13555
|
const isMultiple = computed(() => config.value.multiple);
|
|
@@ -13943,7 +13969,7 @@ return (_ctx, _cache) => {
|
|
|
13943
13969
|
onInput: handleInput,
|
|
13944
13970
|
onFocus: handleFocus,
|
|
13945
13971
|
onBlur: handleBlur
|
|
13946
|
-
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$
|
|
13972
|
+
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$P),
|
|
13947
13973
|
createCommentVNode(" 单选显示值 "),
|
|
13948
13974
|
(!isMultiple.value && hasValue.value && !query.value)
|
|
13949
13975
|
? (openBlock(), createElementBlock("span", {
|
|
@@ -14779,7 +14805,7 @@ const generateTimeOptions = (start, end, step, format = "HH:mm", _includeEnd = f
|
|
|
14779
14805
|
};
|
|
14780
14806
|
|
|
14781
14807
|
const _hoisted_1$15 = ["id", "value", "placeholder", "disabled", "readonly", "name", "aria-expanded", "aria-controls"];
|
|
14782
|
-
const _hoisted_2$
|
|
14808
|
+
const _hoisted_2$O = {
|
|
14783
14809
|
key: 1,
|
|
14784
14810
|
viewBox: "0 0 1024 1024",
|
|
14785
14811
|
width: "1em",
|
|
@@ -15165,7 +15191,7 @@ return (_ctx, _cache) => {
|
|
|
15165
15191
|
}, [
|
|
15166
15192
|
(__props.clearIcon)
|
|
15167
15193
|
? (openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon), { key: 0 }))
|
|
15168
|
-
: (openBlock(), createElementBlock("svg", _hoisted_2$
|
|
15194
|
+
: (openBlock(), createElementBlock("svg", _hoisted_2$O, [...(_cache[2] || (_cache[2] = [
|
|
15169
15195
|
createElementVNode("path", {
|
|
15170
15196
|
fill: "currentColor",
|
|
15171
15197
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336L512 457.664z"
|
|
@@ -15368,7 +15394,7 @@ const getCurrentTimeState = () => {
|
|
|
15368
15394
|
};
|
|
15369
15395
|
|
|
15370
15396
|
const _hoisted_1$14 = ["onClick"];
|
|
15371
|
-
const _hoisted_2$
|
|
15397
|
+
const _hoisted_2$N = ["onClick"];
|
|
15372
15398
|
const _hoisted_3$z = ["onClick"];
|
|
15373
15399
|
const _hoisted_4$q = ["onClick"];
|
|
15374
15400
|
const ITEM_HEIGHT = 32;
|
|
@@ -15708,7 +15734,7 @@ return (_ctx, _cache) => {
|
|
|
15708
15734
|
key: item.value,
|
|
15709
15735
|
class: normalizeClass([unref(ns).e('item'), unref(ns).is('selected', __props.modelValue.minutes === item.value), unref(ns).is('disabled', item.disabled)]),
|
|
15710
15736
|
onClick: $event => (handleItemClick('minutes', item.value, item.disabled))
|
|
15711
|
-
}, toDisplayString(formatNumber(item.value)), 11 /* TEXT, CLASS, PROPS */, _hoisted_2$
|
|
15737
|
+
}, toDisplayString(formatNumber(item.value)), 11 /* TEXT, CLASS, PROPS */, _hoisted_2$N))
|
|
15712
15738
|
}), 128 /* KEYED_FRAGMENT */))
|
|
15713
15739
|
], 2 /* CLASS */)
|
|
15714
15740
|
], 34 /* CLASS, NEED_HYDRATION */))
|
|
@@ -15816,7 +15842,7 @@ return (_ctx, _cache) => {
|
|
|
15816
15842
|
});
|
|
15817
15843
|
|
|
15818
15844
|
const _hoisted_1$13 = ["id", "value", "placeholder", "disabled", "readonly", "name", "tabindex", "aria-expanded"];
|
|
15819
|
-
const _hoisted_2$
|
|
15845
|
+
const _hoisted_2$M = ["value", "placeholder", "disabled", "readonly", "tabindex"];
|
|
15820
15846
|
const _hoisted_3$y = ["value", "placeholder", "disabled", "readonly", "tabindex"];
|
|
15821
15847
|
const _hoisted_4$p = {
|
|
15822
15848
|
key: 1,
|
|
@@ -16323,7 +16349,7 @@ return (_ctx, _cache) => {
|
|
|
16323
16349
|
onBlur: handleBlur,
|
|
16324
16350
|
onKeydown: handleKeydown,
|
|
16325
16351
|
onChange: handleStartInputChange
|
|
16326
|
-
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$
|
|
16352
|
+
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$M),
|
|
16327
16353
|
createElementVNode("span", {
|
|
16328
16354
|
class: normalizeClass(unref(ns).e('range-separator'))
|
|
16329
16355
|
}, [
|
|
@@ -17818,7 +17844,7 @@ const _hoisted_1$_ = {
|
|
|
17818
17844
|
width: "1em",
|
|
17819
17845
|
height: "1em"
|
|
17820
17846
|
};
|
|
17821
|
-
const _hoisted_2$
|
|
17847
|
+
const _hoisted_2$L = ["placeholder", "value"];
|
|
17822
17848
|
const _hoisted_3$x = ["placeholder", "value"];
|
|
17823
17849
|
const _hoisted_4$o = ["placeholder", "value"];
|
|
17824
17850
|
const _hoisted_5$l = {
|
|
@@ -17827,16 +17853,18 @@ const _hoisted_5$l = {
|
|
|
17827
17853
|
width: "1em",
|
|
17828
17854
|
height: "1em"
|
|
17829
17855
|
};
|
|
17830
|
-
const _hoisted_6$
|
|
17831
|
-
const _hoisted_7$
|
|
17832
|
-
const _hoisted_8$
|
|
17833
|
-
const _hoisted_9$
|
|
17834
|
-
const _hoisted_10$
|
|
17835
|
-
const _hoisted_11$
|
|
17836
|
-
const _hoisted_12$
|
|
17856
|
+
const _hoisted_6$j = ["onClick"];
|
|
17857
|
+
const _hoisted_7$g = ["onClick"];
|
|
17858
|
+
const _hoisted_8$d = ["value"];
|
|
17859
|
+
const _hoisted_9$a = ["value"];
|
|
17860
|
+
const _hoisted_10$6 = ["value"];
|
|
17861
|
+
const _hoisted_11$5 = ["value"];
|
|
17862
|
+
const _hoisted_12$4 = ["value"];
|
|
17837
17863
|
const _hoisted_13$3 = ["value"];
|
|
17838
17864
|
const _hoisted_14$2 = ["value"];
|
|
17839
17865
|
const _hoisted_15$2 = ["value"];
|
|
17866
|
+
const _hoisted_16$2 = ["value"];
|
|
17867
|
+
const _hoisted_17$2 = ["onClick"];
|
|
17840
17868
|
const DROPDOWN_GAP = 8;
|
|
17841
17869
|
const PANEL_OFFSET = 4;
|
|
17842
17870
|
const DEFAULT_PANEL_WIDTH = 380;
|
|
@@ -17955,6 +17983,12 @@ const selectSize = computed(
|
|
|
17955
17983
|
);
|
|
17956
17984
|
const getFormat = () => {
|
|
17957
17985
|
if (props.format) return props.format;
|
|
17986
|
+
if (props.dateFormat) {
|
|
17987
|
+
if (props.type.includes("datetime")) {
|
|
17988
|
+
return `${props.dateFormat} ${props.timeFormat || "HH:mm:ss"}`;
|
|
17989
|
+
}
|
|
17990
|
+
return props.dateFormat;
|
|
17991
|
+
}
|
|
17958
17992
|
return DEFAULT_FORMATS[props.type] || "YYYY-MM-DD";
|
|
17959
17993
|
};
|
|
17960
17994
|
const displayValue = computed(() => {
|
|
@@ -18123,7 +18157,8 @@ const performFinalSelect = (date) => {
|
|
|
18123
18157
|
};
|
|
18124
18158
|
const dropdownStyle = ref({});
|
|
18125
18159
|
const updatePosition = async () => {
|
|
18126
|
-
if (!wrapperRef.value || !props.teleported || props.panelOnly)
|
|
18160
|
+
if (typeof window === "undefined" || !wrapperRef.value || !props.teleported || props.panelOnly)
|
|
18161
|
+
return;
|
|
18127
18162
|
await nextTick();
|
|
18128
18163
|
const rect = wrapperRef.value.getBoundingClientRect();
|
|
18129
18164
|
const viewportWidth = window.innerWidth;
|
|
@@ -18187,7 +18222,7 @@ watch(visible, (val) => {
|
|
|
18187
18222
|
currentView.value = getInitialView(props.type);
|
|
18188
18223
|
void updatePosition();
|
|
18189
18224
|
syncInnerDate();
|
|
18190
|
-
if (!props.panelOnly) {
|
|
18225
|
+
if (!props.panelOnly && typeof window !== "undefined") {
|
|
18191
18226
|
window.addEventListener("click", handleOutsideClick, true);
|
|
18192
18227
|
if (props.teleported) {
|
|
18193
18228
|
window.addEventListener("scroll", updatePosition, true);
|
|
@@ -18198,7 +18233,7 @@ watch(visible, (val) => {
|
|
|
18198
18233
|
if (!confirmed.value) {
|
|
18199
18234
|
emitChange(originalValue.value);
|
|
18200
18235
|
}
|
|
18201
|
-
if (!props.panelOnly) {
|
|
18236
|
+
if (!props.panelOnly && typeof window !== "undefined") {
|
|
18202
18237
|
window.removeEventListener("click", handleOutsideClick, true);
|
|
18203
18238
|
window.removeEventListener("scroll", updatePosition, true);
|
|
18204
18239
|
window.removeEventListener("resize", updatePosition);
|
|
@@ -18258,7 +18293,7 @@ const handleConfirmClick = () => {
|
|
|
18258
18293
|
};
|
|
18259
18294
|
onMounted(() => {
|
|
18260
18295
|
syncInnerDate();
|
|
18261
|
-
if (visible.value && !props.panelOnly) {
|
|
18296
|
+
if (visible.value && !props.panelOnly && typeof window !== "undefined") {
|
|
18262
18297
|
void updatePosition();
|
|
18263
18298
|
window.addEventListener("click", handleOutsideClick, true);
|
|
18264
18299
|
if (props.teleported) {
|
|
@@ -18268,7 +18303,7 @@ onMounted(() => {
|
|
|
18268
18303
|
}
|
|
18269
18304
|
});
|
|
18270
18305
|
onBeforeUnmount(() => {
|
|
18271
|
-
if (!props.panelOnly) {
|
|
18306
|
+
if (!props.panelOnly && typeof window !== "undefined") {
|
|
18272
18307
|
window.removeEventListener("click", handleOutsideClick, true);
|
|
18273
18308
|
window.removeEventListener("scroll", updatePosition, true);
|
|
18274
18309
|
window.removeEventListener("resize", updatePosition);
|
|
@@ -18314,7 +18349,7 @@ return (_ctx, _cache) => {
|
|
|
18314
18349
|
readonly: "",
|
|
18315
18350
|
onFocus: _cache[0] || (_cache[0] = e => emit('focus', e)),
|
|
18316
18351
|
onBlur: _cache[1] || (_cache[1] = e => emit('blur', e))
|
|
18317
|
-
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$
|
|
18352
|
+
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$L))
|
|
18318
18353
|
: (openBlock(), createElementBlock("div", {
|
|
18319
18354
|
key: 1,
|
|
18320
18355
|
class: normalizeClass(unref(ns).e('range-input-wrapper'))
|
|
@@ -18377,331 +18412,363 @@ return (_ctx, _cache) => {
|
|
|
18377
18412
|
key: 0,
|
|
18378
18413
|
ref_key: "panelRef",
|
|
18379
18414
|
ref: panelRef,
|
|
18380
|
-
class: normalizeClass([unref(ns).e('panel'), _ctx.popperClass, unref(ns).is('plain', _ctx.panelOnly)]),
|
|
18415
|
+
class: normalizeClass([unref(ns).e('panel'), _ctx.popperClass, unref(ns).is('plain', _ctx.panelOnly), _ctx.presets.length > 0 ? unref(ns).em('panel', 'has-presets-' + _ctx.presetPosition) : '']),
|
|
18381
18416
|
style: normalizeStyle(!_ctx.panelOnly && props.teleported ? dropdownStyle.value : {}),
|
|
18382
18417
|
onClick: _cache[24] || (_cache[24] = withModifiers(() => {}, ["stop"]))
|
|
18383
18418
|
}, [
|
|
18419
|
+
(_ctx.presets.length > 0 && (_ctx.presetPosition === 'left' || _ctx.presetPosition === 'right'))
|
|
18420
|
+
? (openBlock(), createElementBlock("div", {
|
|
18421
|
+
key: 0,
|
|
18422
|
+
class: normalizeClass([unref(ns).e('presets'), unref(ns).is(_ctx.presetPosition)])
|
|
18423
|
+
}, [
|
|
18424
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.presets, (p) => {
|
|
18425
|
+
return (openBlock(), createElementBlock("button", {
|
|
18426
|
+
key: p.label,
|
|
18427
|
+
class: normalizeClass(unref(ns).e('preset-item')),
|
|
18428
|
+
onClick: $event => (handlePresetClick(p))
|
|
18429
|
+
}, toDisplayString(p.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_6$j))
|
|
18430
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
18431
|
+
], 2 /* CLASS */))
|
|
18432
|
+
: createCommentVNode("v-if", true),
|
|
18384
18433
|
createElementVNode("div", {
|
|
18385
|
-
class: normalizeClass(unref(ns).e('
|
|
18434
|
+
class: normalizeClass(unref(ns).e('main'))
|
|
18386
18435
|
}, [
|
|
18436
|
+
(_ctx.presets.length > 0 && _ctx.presetPosition === 'top')
|
|
18437
|
+
? (openBlock(), createElementBlock("div", {
|
|
18438
|
+
key: 0,
|
|
18439
|
+
class: normalizeClass([unref(ns).e('presets'), unref(ns).is('top')])
|
|
18440
|
+
}, [
|
|
18441
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.presets, (p) => {
|
|
18442
|
+
return (openBlock(), createElementBlock("button", {
|
|
18443
|
+
key: p.label,
|
|
18444
|
+
class: normalizeClass(unref(ns).e('preset-item')),
|
|
18445
|
+
onClick: $event => (handlePresetClick(p))
|
|
18446
|
+
}, toDisplayString(p.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_7$g))
|
|
18447
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
18448
|
+
], 2 /* CLASS */))
|
|
18449
|
+
: createCommentVNode("v-if", true),
|
|
18387
18450
|
createElementVNode("div", {
|
|
18388
|
-
class: normalizeClass(unref(ns).e('header
|
|
18451
|
+
class: normalizeClass(unref(ns).e('header'))
|
|
18389
18452
|
}, [
|
|
18390
|
-
createElementVNode("
|
|
18391
|
-
class: normalizeClass(
|
|
18392
|
-
|
|
18393
|
-
|
|
18394
|
-
|
|
18395
|
-
|
|
18396
|
-
|
|
18397
|
-
|
|
18398
|
-
|
|
18399
|
-
|
|
18400
|
-
|
|
18453
|
+
createElementVNode("div", {
|
|
18454
|
+
class: normalizeClass(unref(ns).e('header-group'))
|
|
18455
|
+
}, [
|
|
18456
|
+
createElementVNode("button", {
|
|
18457
|
+
class: normalizeClass([unref(ns).e('header-btns'), unref(ns).em('header-btns', 'double-left')]),
|
|
18458
|
+
onClick: _cache[6] || (_cache[6] = $event => (moveYear(-1)))
|
|
18459
|
+
}, " « ", 2 /* CLASS */),
|
|
18460
|
+
(currentView.value === 'date')
|
|
18461
|
+
? (openBlock(), createElementBlock("button", {
|
|
18462
|
+
key: 0,
|
|
18463
|
+
class: normalizeClass([unref(ns).e('header-btns'), unref(ns).em('header-btns', 'left')]),
|
|
18464
|
+
onClick: _cache[7] || (_cache[7] = $event => (moveMonth(-1)))
|
|
18465
|
+
}, " ‹ ", 2 /* CLASS */))
|
|
18466
|
+
: createCommentVNode("v-if", true)
|
|
18467
|
+
], 2 /* CLASS */),
|
|
18468
|
+
createElementVNode("span", {
|
|
18469
|
+
class: normalizeClass(unref(ns).e('header-label')),
|
|
18470
|
+
onClick: handleHeaderClick
|
|
18471
|
+
}, toDisplayString(headerLabel.value), 3 /* TEXT, CLASS */),
|
|
18472
|
+
createElementVNode("div", {
|
|
18473
|
+
class: normalizeClass(unref(ns).e('header-group'))
|
|
18474
|
+
}, [
|
|
18475
|
+
(currentView.value === 'date')
|
|
18476
|
+
? (openBlock(), createElementBlock("button", {
|
|
18477
|
+
key: 0,
|
|
18478
|
+
class: normalizeClass([unref(ns).e('header-btns'), unref(ns).em('header-btns', 'right')]),
|
|
18479
|
+
onClick: _cache[8] || (_cache[8] = $event => (moveMonth(1)))
|
|
18480
|
+
}, " › ", 2 /* CLASS */))
|
|
18481
|
+
: createCommentVNode("v-if", true),
|
|
18482
|
+
createElementVNode("button", {
|
|
18483
|
+
class: normalizeClass([unref(ns).e('header-btns'), unref(ns).em('header-btns', 'double-right')]),
|
|
18484
|
+
onClick: _cache[9] || (_cache[9] = $event => (moveYear(1)))
|
|
18485
|
+
}, " » ", 2 /* CLASS */)
|
|
18486
|
+
], 2 /* CLASS */)
|
|
18401
18487
|
], 2 /* CLASS */),
|
|
18402
|
-
createElementVNode("span", {
|
|
18403
|
-
class: normalizeClass(unref(ns).e('header-label')),
|
|
18404
|
-
onClick: handleHeaderClick
|
|
18405
|
-
}, toDisplayString(headerLabel.value), 3 /* TEXT, CLASS */),
|
|
18406
18488
|
createElementVNode("div", {
|
|
18407
|
-
class: normalizeClass(unref(ns).e('
|
|
18489
|
+
class: normalizeClass(unref(ns).e('content'))
|
|
18408
18490
|
}, [
|
|
18409
18491
|
(currentView.value === 'date')
|
|
18410
|
-
? (openBlock(),
|
|
18492
|
+
? (openBlock(), createBlock(_sfc_main$1M, {
|
|
18411
18493
|
key: 0,
|
|
18412
|
-
class: normalizeClass([unref(ns).e('header-btns'), unref(ns).em('header-btns', 'right')]),
|
|
18413
|
-
onClick: _cache[8] || (_cache[8] = $event => (moveMonth(1)))
|
|
18414
|
-
}, " › ", 2 /* CLASS */))
|
|
18415
|
-
: createCommentVNode("v-if", true),
|
|
18416
|
-
createElementVNode("button", {
|
|
18417
|
-
class: normalizeClass([unref(ns).e('header-btns'), unref(ns).em('header-btns', 'double-right')]),
|
|
18418
|
-
onClick: _cache[9] || (_cache[9] = $event => (moveYear(1)))
|
|
18419
|
-
}, " » ", 2 /* CLASS */)
|
|
18420
|
-
], 2 /* CLASS */)
|
|
18421
|
-
], 2 /* CLASS */),
|
|
18422
|
-
createElementVNode("div", {
|
|
18423
|
-
class: normalizeClass(unref(ns).e('content'))
|
|
18424
|
-
}, [
|
|
18425
|
-
(currentView.value === 'date')
|
|
18426
|
-
? (openBlock(), createBlock(_sfc_main$1M, {
|
|
18427
|
-
key: 0,
|
|
18428
|
-
date: innerDate.value,
|
|
18429
|
-
"selected-date": parsedSelectedDate.value,
|
|
18430
|
-
"selection-mode": _ctx.type === 'week' ? 'week' : 'date',
|
|
18431
|
-
"range-state": parsedRangeState.value,
|
|
18432
|
-
"disabled-date": _ctx.disabledDate,
|
|
18433
|
-
"first-day-of-week": _ctx.firstDayOfWeek,
|
|
18434
|
-
"cell-shape": _ctx.cellShape,
|
|
18435
|
-
"cell-render": _ctx.cellRender,
|
|
18436
|
-
onSelect: handleSelect,
|
|
18437
|
-
onHover: _cache[10] || (_cache[10] = val => rangeHoverDate.value = val)
|
|
18438
|
-
}, {
|
|
18439
|
-
"date-cell": withCtx((slotProps) => [
|
|
18440
|
-
renderSlot(_ctx.$slots, "date-cell", normalizeProps(guardReactiveProps(slotProps)))
|
|
18441
|
-
]),
|
|
18442
|
-
_: 3 /* FORWARDED */
|
|
18443
|
-
}, 8 /* PROPS */, ["date", "selected-date", "selection-mode", "range-state", "disabled-date", "first-day-of-week", "cell-shape", "cell-render"]))
|
|
18444
|
-
: (currentView.value === 'month')
|
|
18445
|
-
? (openBlock(), createBlock(_sfc_main$1L, {
|
|
18446
|
-
key: 1,
|
|
18447
18494
|
date: innerDate.value,
|
|
18448
18495
|
"selected-date": parsedSelectedDate.value,
|
|
18496
|
+
"selection-mode": _ctx.type === 'week' ? 'week' : 'date',
|
|
18449
18497
|
"range-state": parsedRangeState.value,
|
|
18450
18498
|
"disabled-date": _ctx.disabledDate,
|
|
18499
|
+
"first-day-of-week": _ctx.firstDayOfWeek,
|
|
18451
18500
|
"cell-shape": _ctx.cellShape,
|
|
18501
|
+
"cell-render": _ctx.cellRender,
|
|
18452
18502
|
onSelect: handleSelect,
|
|
18453
|
-
onHover: _cache[
|
|
18454
|
-
},
|
|
18455
|
-
|
|
18456
|
-
|
|
18457
|
-
|
|
18503
|
+
onHover: _cache[10] || (_cache[10] = val => rangeHoverDate.value = val)
|
|
18504
|
+
}, {
|
|
18505
|
+
"date-cell": withCtx((slotProps) => [
|
|
18506
|
+
renderSlot(_ctx.$slots, "date-cell", normalizeProps(guardReactiveProps(slotProps)))
|
|
18507
|
+
]),
|
|
18508
|
+
_: 3 /* FORWARDED */
|
|
18509
|
+
}, 8 /* PROPS */, ["date", "selected-date", "selection-mode", "range-state", "disabled-date", "first-day-of-week", "cell-shape", "cell-render"]))
|
|
18510
|
+
: (currentView.value === 'month')
|
|
18511
|
+
? (openBlock(), createBlock(_sfc_main$1L, {
|
|
18512
|
+
key: 1,
|
|
18458
18513
|
date: innerDate.value,
|
|
18459
18514
|
"selected-date": parsedSelectedDate.value,
|
|
18460
18515
|
"range-state": parsedRangeState.value,
|
|
18461
18516
|
"disabled-date": _ctx.disabledDate,
|
|
18462
18517
|
"cell-shape": _ctx.cellShape,
|
|
18463
18518
|
onSelect: handleSelect,
|
|
18464
|
-
onHover: _cache[
|
|
18519
|
+
onHover: _cache[11] || (_cache[11] = val => rangeHoverDate.value = val)
|
|
18465
18520
|
}, null, 8 /* PROPS */, ["date", "selected-date", "range-state", "disabled-date", "cell-shape"]))
|
|
18466
|
-
: (currentView.value === '
|
|
18467
|
-
? (openBlock(), createBlock(_sfc_main$
|
|
18468
|
-
key:
|
|
18521
|
+
: (currentView.value === 'year')
|
|
18522
|
+
? (openBlock(), createBlock(_sfc_main$1K, {
|
|
18523
|
+
key: 2,
|
|
18469
18524
|
date: innerDate.value,
|
|
18470
18525
|
"selected-date": parsedSelectedDate.value,
|
|
18471
18526
|
"range-state": parsedRangeState.value,
|
|
18472
18527
|
"disabled-date": _ctx.disabledDate,
|
|
18473
18528
|
"cell-shape": _ctx.cellShape,
|
|
18474
18529
|
onSelect: handleSelect,
|
|
18475
|
-
onHover: _cache[
|
|
18530
|
+
onHover: _cache[12] || (_cache[12] = val => rangeHoverDate.value = val)
|
|
18476
18531
|
}, null, 8 /* PROPS */, ["date", "selected-date", "range-state", "disabled-date", "cell-shape"]))
|
|
18477
|
-
:
|
|
18478
|
-
|
|
18479
|
-
|
|
18480
|
-
|
|
18481
|
-
|
|
18482
|
-
|
|
18483
|
-
|
|
18484
|
-
|
|
18485
|
-
|
|
18486
|
-
|
|
18487
|
-
|
|
18488
|
-
|
|
18489
|
-
|
|
18490
|
-
|
|
18491
|
-
|
|
18492
|
-
|
|
18493
|
-
|
|
18494
|
-
|
|
18495
|
-
|
|
18496
|
-
|
|
18497
|
-
|
|
18498
|
-
|
|
18499
|
-
|
|
18500
|
-
|
|
18501
|
-
|
|
18502
|
-
|
|
18503
|
-
|
|
18504
|
-
|
|
18505
|
-
}, [
|
|
18506
|
-
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
18507
|
-
(_ctx.type === 'datetime')
|
|
18508
|
-
? (openBlock(), createElementBlock("div", {
|
|
18509
|
-
key: 0,
|
|
18510
|
-
class: normalizeClass(unref(ns).e('footer-time'))
|
|
18511
|
-
}, [
|
|
18512
|
-
withDirectives(createElementVNode("select", {
|
|
18513
|
-
"onUpdate:modelValue": _cache[14] || (_cache[14] = $event => ((timeState.value.hour) = $event)),
|
|
18514
|
-
onChange: updateSingleTime
|
|
18515
|
-
}, [
|
|
18516
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(24, (h) => {
|
|
18517
|
-
return createElementVNode("option", {
|
|
18518
|
-
key: h - 1,
|
|
18519
|
-
value: h - 1
|
|
18520
|
-
}, toDisplayString(String(h - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_7$f)
|
|
18521
|
-
}), 64 /* STABLE_FRAGMENT */))
|
|
18522
|
-
], 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
18523
|
-
[vModelSelect, timeState.value.hour]
|
|
18524
|
-
]),
|
|
18525
|
-
createElementVNode("span", {
|
|
18526
|
-
class: normalizeClass(unref(ns).e('time-separator'))
|
|
18527
|
-
}, ":", 2 /* CLASS */),
|
|
18528
|
-
withDirectives(createElementVNode("select", {
|
|
18529
|
-
"onUpdate:modelValue": _cache[15] || (_cache[15] = $event => ((timeState.value.minute) = $event)),
|
|
18530
|
-
onChange: updateSingleTime
|
|
18531
|
-
}, [
|
|
18532
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(60, (m) => {
|
|
18533
|
-
return createElementVNode("option", {
|
|
18534
|
-
key: m - 1,
|
|
18535
|
-
value: m - 1
|
|
18536
|
-
}, toDisplayString(String(m - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_8$c)
|
|
18537
|
-
}), 64 /* STABLE_FRAGMENT */))
|
|
18538
|
-
], 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
18539
|
-
[vModelSelect, timeState.value.minute]
|
|
18540
|
-
]),
|
|
18541
|
-
((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
|
|
18542
|
-
? (openBlock(), createElementBlock("span", {
|
|
18543
|
-
key: 0,
|
|
18544
|
-
class: normalizeClass(unref(ns).e('time-separator'))
|
|
18545
|
-
}, ":", 2 /* CLASS */))
|
|
18546
|
-
: createCommentVNode("v-if", true),
|
|
18547
|
-
((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
|
|
18548
|
-
? withDirectives((openBlock(), createElementBlock("select", {
|
|
18549
|
-
key: 1,
|
|
18550
|
-
"onUpdate:modelValue": _cache[16] || (_cache[16] = $event => ((timeState.value.second) = $event)),
|
|
18551
|
-
onChange: updateSingleTime
|
|
18552
|
-
}, [
|
|
18553
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(60, (s) => {
|
|
18554
|
-
return createElementVNode("option", {
|
|
18555
|
-
key: s - 1,
|
|
18556
|
-
value: s - 1
|
|
18557
|
-
}, toDisplayString(String(s - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_9$9)
|
|
18558
|
-
}), 64 /* STABLE_FRAGMENT */))
|
|
18559
|
-
], 544 /* NEED_HYDRATION, NEED_PATCH */)), [
|
|
18560
|
-
[vModelSelect, timeState.value.second]
|
|
18561
|
-
])
|
|
18562
|
-
: createCommentVNode("v-if", true)
|
|
18563
|
-
], 2 /* CLASS */))
|
|
18564
|
-
: (_ctx.type === 'datetimerange')
|
|
18532
|
+
: (currentView.value === 'quarter')
|
|
18533
|
+
? (openBlock(), createBlock(_sfc_main$1J, {
|
|
18534
|
+
key: 3,
|
|
18535
|
+
date: innerDate.value,
|
|
18536
|
+
"selected-date": parsedSelectedDate.value,
|
|
18537
|
+
"range-state": parsedRangeState.value,
|
|
18538
|
+
"disabled-date": _ctx.disabledDate,
|
|
18539
|
+
"cell-shape": _ctx.cellShape,
|
|
18540
|
+
onSelect: handleSelect,
|
|
18541
|
+
onHover: _cache[13] || (_cache[13] = val => rangeHoverDate.value = val)
|
|
18542
|
+
}, null, 8 /* PROPS */, ["date", "selected-date", "range-state", "disabled-date", "cell-shape"]))
|
|
18543
|
+
: createCommentVNode("v-if", true)
|
|
18544
|
+
], 2 /* CLASS */),
|
|
18545
|
+
(_ctx.$slots.extra)
|
|
18546
|
+
? (openBlock(), createElementBlock("div", {
|
|
18547
|
+
key: 1,
|
|
18548
|
+
class: normalizeClass(unref(ns).e('extra'))
|
|
18549
|
+
}, [
|
|
18550
|
+
renderSlot(_ctx.$slots, "extra")
|
|
18551
|
+
], 2 /* CLASS */))
|
|
18552
|
+
: createCommentVNode("v-if", true),
|
|
18553
|
+
(shouldShowFooter.value)
|
|
18554
|
+
? (openBlock(), createElementBlock("div", {
|
|
18555
|
+
key: 2,
|
|
18556
|
+
class: normalizeClass(unref(ns).e('footer'))
|
|
18557
|
+
}, [
|
|
18558
|
+
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
18559
|
+
(_ctx.type === 'datetime')
|
|
18565
18560
|
? (openBlock(), createElementBlock("div", {
|
|
18566
|
-
key:
|
|
18567
|
-
class: normalizeClass(unref(ns).e('footer-time
|
|
18561
|
+
key: 0,
|
|
18562
|
+
class: normalizeClass(unref(ns).e('footer-time'))
|
|
18568
18563
|
}, [
|
|
18569
|
-
createElementVNode("
|
|
18570
|
-
|
|
18564
|
+
withDirectives(createElementVNode("select", {
|
|
18565
|
+
"onUpdate:modelValue": _cache[14] || (_cache[14] = $event => ((timeState.value.hour) = $event)),
|
|
18566
|
+
onChange: updateSingleTime
|
|
18571
18567
|
}, [
|
|
18572
|
-
|
|
18573
|
-
|
|
18574
|
-
|
|
18575
|
-
|
|
18576
|
-
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
|
|
18580
|
-
|
|
18581
|
-
|
|
18582
|
-
|
|
18583
|
-
|
|
18584
|
-
|
|
18585
|
-
]
|
|
18586
|
-
|
|
18587
|
-
]),
|
|
18588
|
-
createElementVNode("span", {
|
|
18589
|
-
class: normalizeClass(unref(ns).e('time-separator'))
|
|
18590
|
-
}, ":", 2 /* CLASS */),
|
|
18591
|
-
withDirectives(createElementVNode("select", {
|
|
18592
|
-
"onUpdate:modelValue": _cache[18] || (_cache[18] = $event => ((startTimeState.value.minute) = $event)),
|
|
18593
|
-
onChange: updateRangeStartTime
|
|
18594
|
-
}, [
|
|
18595
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(60, (m) => {
|
|
18596
|
-
return createElementVNode("option", {
|
|
18597
|
-
key: m - 1,
|
|
18598
|
-
value: m - 1
|
|
18599
|
-
}, toDisplayString(String(m - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_11$4)
|
|
18600
|
-
}), 64 /* STABLE_FRAGMENT */))
|
|
18601
|
-
], 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
18602
|
-
[vModelSelect, startTimeState.value.minute]
|
|
18603
|
-
]),
|
|
18604
|
-
((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
|
|
18605
|
-
? (openBlock(), createElementBlock("span", {
|
|
18606
|
-
key: 0,
|
|
18607
|
-
class: normalizeClass(unref(ns).e('time-separator'))
|
|
18608
|
-
}, ":", 2 /* CLASS */))
|
|
18609
|
-
: createCommentVNode("v-if", true),
|
|
18610
|
-
((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
|
|
18611
|
-
? withDirectives((openBlock(), createElementBlock("select", {
|
|
18612
|
-
key: 1,
|
|
18613
|
-
"onUpdate:modelValue": _cache[19] || (_cache[19] = $event => ((startTimeState.value.second) = $event)),
|
|
18614
|
-
onChange: updateRangeStartTime
|
|
18615
|
-
}, [
|
|
18616
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(60, (s) => {
|
|
18617
|
-
return createElementVNode("option", {
|
|
18618
|
-
key: s - 1,
|
|
18619
|
-
value: s - 1
|
|
18620
|
-
}, toDisplayString(String(s - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_12$3)
|
|
18621
|
-
}), 64 /* STABLE_FRAGMENT */))
|
|
18622
|
-
], 544 /* NEED_HYDRATION, NEED_PATCH */)), [
|
|
18623
|
-
[vModelSelect, startTimeState.value.second]
|
|
18624
|
-
])
|
|
18625
|
-
: createCommentVNode("v-if", true)
|
|
18626
|
-
], 2 /* CLASS */),
|
|
18627
|
-
createElementVNode("div", {
|
|
18628
|
-
class: normalizeClass(unref(ns).e('footer-time'))
|
|
18568
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(24, (h) => {
|
|
18569
|
+
return createElementVNode("option", {
|
|
18570
|
+
key: h - 1,
|
|
18571
|
+
value: h - 1
|
|
18572
|
+
}, toDisplayString(String(h - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_8$d)
|
|
18573
|
+
}), 64 /* STABLE_FRAGMENT */))
|
|
18574
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
18575
|
+
[vModelSelect, timeState.value.hour]
|
|
18576
|
+
]),
|
|
18577
|
+
createElementVNode("span", {
|
|
18578
|
+
class: normalizeClass(unref(ns).e('time-separator'))
|
|
18579
|
+
}, ":", 2 /* CLASS */),
|
|
18580
|
+
withDirectives(createElementVNode("select", {
|
|
18581
|
+
"onUpdate:modelValue": _cache[15] || (_cache[15] = $event => ((timeState.value.minute) = $event)),
|
|
18582
|
+
onChange: updateSingleTime
|
|
18629
18583
|
}, [
|
|
18630
|
-
|
|
18631
|
-
|
|
18632
|
-
|
|
18633
|
-
|
|
18634
|
-
|
|
18635
|
-
|
|
18584
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(60, (m) => {
|
|
18585
|
+
return createElementVNode("option", {
|
|
18586
|
+
key: m - 1,
|
|
18587
|
+
value: m - 1
|
|
18588
|
+
}, toDisplayString(String(m - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_9$a)
|
|
18589
|
+
}), 64 /* STABLE_FRAGMENT */))
|
|
18590
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
18591
|
+
[vModelSelect, timeState.value.minute]
|
|
18592
|
+
]),
|
|
18593
|
+
((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
|
|
18594
|
+
? (openBlock(), createElementBlock("span", {
|
|
18595
|
+
key: 0,
|
|
18596
|
+
class: normalizeClass(unref(ns).e('time-separator'))
|
|
18597
|
+
}, ":", 2 /* CLASS */))
|
|
18598
|
+
: createCommentVNode("v-if", true),
|
|
18599
|
+
((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
|
|
18600
|
+
? withDirectives((openBlock(), createElementBlock("select", {
|
|
18601
|
+
key: 1,
|
|
18602
|
+
"onUpdate:modelValue": _cache[16] || (_cache[16] = $event => ((timeState.value.second) = $event)),
|
|
18603
|
+
onChange: updateSingleTime
|
|
18604
|
+
}, [
|
|
18605
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(60, (s) => {
|
|
18606
|
+
return createElementVNode("option", {
|
|
18607
|
+
key: s - 1,
|
|
18608
|
+
value: s - 1
|
|
18609
|
+
}, toDisplayString(String(s - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_10$6)
|
|
18610
|
+
}), 64 /* STABLE_FRAGMENT */))
|
|
18611
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */)), [
|
|
18612
|
+
[vModelSelect, timeState.value.second]
|
|
18613
|
+
])
|
|
18614
|
+
: createCommentVNode("v-if", true)
|
|
18615
|
+
], 2 /* CLASS */))
|
|
18616
|
+
: (_ctx.type === 'datetimerange')
|
|
18617
|
+
? (openBlock(), createElementBlock("div", {
|
|
18618
|
+
key: 1,
|
|
18619
|
+
class: normalizeClass(unref(ns).e('footer-time-range'))
|
|
18620
|
+
}, [
|
|
18621
|
+
createElementVNode("div", {
|
|
18622
|
+
class: normalizeClass(unref(ns).e('footer-time'))
|
|
18636
18623
|
}, [
|
|
18637
|
-
(
|
|
18638
|
-
|
|
18639
|
-
|
|
18640
|
-
|
|
18641
|
-
|
|
18642
|
-
|
|
18643
|
-
|
|
18644
|
-
|
|
18645
|
-
|
|
18646
|
-
|
|
18647
|
-
|
|
18648
|
-
|
|
18649
|
-
|
|
18650
|
-
|
|
18651
|
-
|
|
18624
|
+
createElementVNode("span", {
|
|
18625
|
+
class: normalizeClass(unref(ns).e('time-label'))
|
|
18626
|
+
}, toDisplayString(unref(t)("datepicker.startTime") || "Start") + ":", 3 /* TEXT, CLASS */),
|
|
18627
|
+
withDirectives(createElementVNode("select", {
|
|
18628
|
+
"onUpdate:modelValue": _cache[17] || (_cache[17] = $event => ((startTimeState.value.hour) = $event)),
|
|
18629
|
+
onChange: updateRangeStartTime
|
|
18630
|
+
}, [
|
|
18631
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(24, (h) => {
|
|
18632
|
+
return createElementVNode("option", {
|
|
18633
|
+
key: h - 1,
|
|
18634
|
+
value: h - 1
|
|
18635
|
+
}, toDisplayString(String(h - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_11$5)
|
|
18636
|
+
}), 64 /* STABLE_FRAGMENT */))
|
|
18637
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
18638
|
+
[vModelSelect, startTimeState.value.hour]
|
|
18639
|
+
]),
|
|
18640
|
+
createElementVNode("span", {
|
|
18641
|
+
class: normalizeClass(unref(ns).e('time-separator'))
|
|
18642
|
+
}, ":", 2 /* CLASS */),
|
|
18643
|
+
withDirectives(createElementVNode("select", {
|
|
18644
|
+
"onUpdate:modelValue": _cache[18] || (_cache[18] = $event => ((startTimeState.value.minute) = $event)),
|
|
18645
|
+
onChange: updateRangeStartTime
|
|
18646
|
+
}, [
|
|
18647
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(60, (m) => {
|
|
18648
|
+
return createElementVNode("option", {
|
|
18649
|
+
key: m - 1,
|
|
18650
|
+
value: m - 1
|
|
18651
|
+
}, toDisplayString(String(m - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_12$4)
|
|
18652
|
+
}), 64 /* STABLE_FRAGMENT */))
|
|
18653
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
18654
|
+
[vModelSelect, startTimeState.value.minute]
|
|
18655
|
+
]),
|
|
18656
|
+
((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
|
|
18657
|
+
? (openBlock(), createElementBlock("span", {
|
|
18658
|
+
key: 0,
|
|
18659
|
+
class: normalizeClass(unref(ns).e('time-separator'))
|
|
18660
|
+
}, ":", 2 /* CLASS */))
|
|
18661
|
+
: createCommentVNode("v-if", true),
|
|
18662
|
+
((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
|
|
18663
|
+
? withDirectives((openBlock(), createElementBlock("select", {
|
|
18664
|
+
key: 1,
|
|
18665
|
+
"onUpdate:modelValue": _cache[19] || (_cache[19] = $event => ((startTimeState.value.second) = $event)),
|
|
18666
|
+
onChange: updateRangeStartTime
|
|
18667
|
+
}, [
|
|
18668
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(60, (s) => {
|
|
18669
|
+
return createElementVNode("option", {
|
|
18670
|
+
key: s - 1,
|
|
18671
|
+
value: s - 1
|
|
18672
|
+
}, toDisplayString(String(s - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_13$3)
|
|
18673
|
+
}), 64 /* STABLE_FRAGMENT */))
|
|
18674
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */)), [
|
|
18675
|
+
[vModelSelect, startTimeState.value.second]
|
|
18676
|
+
])
|
|
18677
|
+
: createCommentVNode("v-if", true)
|
|
18678
|
+
], 2 /* CLASS */),
|
|
18679
|
+
createElementVNode("div", {
|
|
18680
|
+
class: normalizeClass(unref(ns).e('footer-time'))
|
|
18652
18681
|
}, [
|
|
18653
|
-
(
|
|
18654
|
-
|
|
18655
|
-
|
|
18656
|
-
|
|
18657
|
-
|
|
18658
|
-
|
|
18659
|
-
|
|
18660
|
-
|
|
18661
|
-
|
|
18662
|
-
|
|
18663
|
-
|
|
18664
|
-
|
|
18665
|
-
|
|
18666
|
-
|
|
18667
|
-
|
|
18668
|
-
|
|
18669
|
-
|
|
18670
|
-
|
|
18671
|
-
|
|
18672
|
-
|
|
18673
|
-
|
|
18674
|
-
|
|
18675
|
-
|
|
18676
|
-
|
|
18677
|
-
|
|
18678
|
-
|
|
18679
|
-
|
|
18680
|
-
|
|
18681
|
-
|
|
18682
|
-
|
|
18683
|
-
|
|
18684
|
-
|
|
18685
|
-
|
|
18686
|
-
|
|
18687
|
-
|
|
18688
|
-
|
|
18689
|
-
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18682
|
+
createElementVNode("span", {
|
|
18683
|
+
class: normalizeClass(unref(ns).e('time-label'))
|
|
18684
|
+
}, toDisplayString(unref(t)("datepicker.endTime") || "End") + ":", 3 /* TEXT, CLASS */),
|
|
18685
|
+
withDirectives(createElementVNode("select", {
|
|
18686
|
+
"onUpdate:modelValue": _cache[20] || (_cache[20] = $event => ((endTimeState.value.hour) = $event)),
|
|
18687
|
+
onChange: updateRangeEndTime
|
|
18688
|
+
}, [
|
|
18689
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(24, (h) => {
|
|
18690
|
+
return createElementVNode("option", {
|
|
18691
|
+
key: h - 1,
|
|
18692
|
+
value: h - 1
|
|
18693
|
+
}, toDisplayString(String(h - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_14$2)
|
|
18694
|
+
}), 64 /* STABLE_FRAGMENT */))
|
|
18695
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
18696
|
+
[vModelSelect, endTimeState.value.hour]
|
|
18697
|
+
]),
|
|
18698
|
+
createElementVNode("span", {
|
|
18699
|
+
class: normalizeClass(unref(ns).e('time-separator'))
|
|
18700
|
+
}, ":", 2 /* CLASS */),
|
|
18701
|
+
withDirectives(createElementVNode("select", {
|
|
18702
|
+
"onUpdate:modelValue": _cache[21] || (_cache[21] = $event => ((endTimeState.value.minute) = $event)),
|
|
18703
|
+
onChange: updateRangeEndTime
|
|
18704
|
+
}, [
|
|
18705
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(60, (m) => {
|
|
18706
|
+
return createElementVNode("option", {
|
|
18707
|
+
key: m - 1,
|
|
18708
|
+
value: m - 1
|
|
18709
|
+
}, toDisplayString(String(m - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_15$2)
|
|
18710
|
+
}), 64 /* STABLE_FRAGMENT */))
|
|
18711
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
18712
|
+
[vModelSelect, endTimeState.value.minute]
|
|
18713
|
+
]),
|
|
18714
|
+
((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
|
|
18715
|
+
? (openBlock(), createElementBlock("span", {
|
|
18716
|
+
key: 0,
|
|
18717
|
+
class: normalizeClass(unref(ns).e('time-separator'))
|
|
18718
|
+
}, ":", 2 /* CLASS */))
|
|
18719
|
+
: createCommentVNode("v-if", true),
|
|
18720
|
+
((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
|
|
18721
|
+
? withDirectives((openBlock(), createElementBlock("select", {
|
|
18722
|
+
key: 1,
|
|
18723
|
+
"onUpdate:modelValue": _cache[22] || (_cache[22] = $event => ((endTimeState.value.second) = $event)),
|
|
18724
|
+
onChange: updateRangeEndTime
|
|
18725
|
+
}, [
|
|
18726
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(60, (s) => {
|
|
18727
|
+
return createElementVNode("option", {
|
|
18728
|
+
key: s - 1,
|
|
18729
|
+
value: s - 1
|
|
18730
|
+
}, toDisplayString(String(s - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_16$2)
|
|
18731
|
+
}), 64 /* STABLE_FRAGMENT */))
|
|
18732
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */)), [
|
|
18733
|
+
[vModelSelect, endTimeState.value.second]
|
|
18734
|
+
])
|
|
18735
|
+
: createCommentVNode("v-if", true)
|
|
18736
|
+
], 2 /* CLASS */)
|
|
18737
|
+
], 2 /* CLASS */))
|
|
18738
|
+
: createCommentVNode("v-if", true),
|
|
18739
|
+
createElementVNode("div", {
|
|
18740
|
+
class: normalizeClass(unref(ns).e('footer-btns'))
|
|
18741
|
+
}, [
|
|
18742
|
+
(isRange.value || _ctx.type.includes('datetime'))
|
|
18743
|
+
? (openBlock(), createElementBlock("button", {
|
|
18744
|
+
key: 0,
|
|
18745
|
+
class: normalizeClass(unref(ns).e('footer-btn')),
|
|
18746
|
+
onClick: _cache[23] || (_cache[23] = $event => (!_ctx.panelOnly && (visible.value = false)))
|
|
18747
|
+
}, toDisplayString(unref(t)("datepicker.cancel")), 3 /* TEXT, CLASS */))
|
|
18748
|
+
: createCommentVNode("v-if", true),
|
|
18749
|
+
createElementVNode("button", {
|
|
18750
|
+
class: normalizeClass([unref(ns).e('footer-btn'), unref(ns).e('footer-btn--confirm')]),
|
|
18751
|
+
onClick: handleConfirmClick
|
|
18752
|
+
}, toDisplayString(unref(t)("datepicker.confirm")), 3 /* TEXT, CLASS */)
|
|
18753
|
+
], 2 /* CLASS */)
|
|
18754
|
+
])
|
|
18755
|
+
], 2 /* CLASS */))
|
|
18756
|
+
: createCommentVNode("v-if", true),
|
|
18757
|
+
(_ctx.presets.length > 0 && _ctx.presetPosition === 'bottom')
|
|
18758
|
+
? (openBlock(), createElementBlock("div", {
|
|
18759
|
+
key: 3,
|
|
18760
|
+
class: normalizeClass([unref(ns).e('presets'), unref(ns).is('bottom')])
|
|
18761
|
+
}, [
|
|
18762
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.presets, (p) => {
|
|
18763
|
+
return (openBlock(), createElementBlock("button", {
|
|
18764
|
+
key: p.label,
|
|
18765
|
+
class: normalizeClass(unref(ns).e('preset-item')),
|
|
18766
|
+
onClick: $event => (handlePresetClick(p))
|
|
18767
|
+
}, toDisplayString(p.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_17$2))
|
|
18768
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
18769
|
+
], 2 /* CLASS */))
|
|
18770
|
+
: createCommentVNode("v-if", true)
|
|
18771
|
+
], 2 /* CLASS */)
|
|
18705
18772
|
], 6 /* CLASS, STYLE */))
|
|
18706
18773
|
: createCommentVNode("v-if", true)
|
|
18707
18774
|
]),
|
|
@@ -18720,7 +18787,7 @@ const transferSizes = ["large", "default", "small"];
|
|
|
18720
18787
|
const transferPanelContextKey = Symbol("transferPanelContextKey");
|
|
18721
18788
|
|
|
18722
18789
|
const _hoisted_1$Z = ["placeholder", "disabled"];
|
|
18723
|
-
const _hoisted_2$
|
|
18790
|
+
const _hoisted_2$K = ["onClick"];
|
|
18724
18791
|
const _hoisted_3$w = ["onClick"];
|
|
18725
18792
|
|
|
18726
18793
|
const _sfc_main$1H = /*@__PURE__*/Object.assign({
|
|
@@ -19057,7 +19124,7 @@ return (_ctx, _cache) => {
|
|
|
19057
19124
|
createTextVNode(toDisplayString(getLabel(item)), 1 /* TEXT */)
|
|
19058
19125
|
])
|
|
19059
19126
|
], 2 /* CLASS */)
|
|
19060
|
-
], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$
|
|
19127
|
+
], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$K))
|
|
19061
19128
|
}), 128 /* KEYED_FRAGMENT */))
|
|
19062
19129
|
], 6 /* CLASS, STYLE */)
|
|
19063
19130
|
], 4 /* STYLE */)
|
|
@@ -19123,7 +19190,7 @@ return (_ctx, _cache) => {
|
|
|
19123
19190
|
});
|
|
19124
19191
|
|
|
19125
19192
|
const _hoisted_1$Y = ["disabled"];
|
|
19126
|
-
const _hoisted_2$
|
|
19193
|
+
const _hoisted_2$J = ["disabled"];
|
|
19127
19194
|
|
|
19128
19195
|
const _sfc_main$1G = /*@__PURE__*/Object.assign({
|
|
19129
19196
|
name: "YhTransfer"
|
|
@@ -19378,7 +19445,7 @@ return (_ctx, _cache) => {
|
|
|
19378
19445
|
class: normalizeClass(unref(ns).e('button__text'))
|
|
19379
19446
|
}, toDisplayString(__props.buttonTexts[1]), 3 /* TEXT, CLASS */))
|
|
19380
19447
|
: createCommentVNode("v-if", true)
|
|
19381
|
-
], 10 /* CLASS, PROPS */, _hoisted_2$
|
|
19448
|
+
], 10 /* CLASS, PROPS */, _hoisted_2$J)
|
|
19382
19449
|
])
|
|
19383
19450
|
], 2 /* CLASS */),
|
|
19384
19451
|
createVNode(_sfc_main$1H, {
|
|
@@ -19821,7 +19888,7 @@ const useTree = (props, emit) => {
|
|
|
19821
19888
|
};
|
|
19822
19889
|
|
|
19823
19890
|
const _hoisted_1$X = ["onClick"];
|
|
19824
|
-
const _hoisted_2$
|
|
19891
|
+
const _hoisted_2$I = ["placeholder", "disabled", "readonly"];
|
|
19825
19892
|
const _hoisted_3$v = ["onClick"];
|
|
19826
19893
|
const _hoisted_4$n = ["onClick"];
|
|
19827
19894
|
const _hoisted_5$k = {
|
|
@@ -19830,13 +19897,13 @@ const _hoisted_5$k = {
|
|
|
19830
19897
|
width: "1em",
|
|
19831
19898
|
height: "1em"
|
|
19832
19899
|
};
|
|
19833
|
-
const _hoisted_6$
|
|
19900
|
+
const _hoisted_6$i = {
|
|
19834
19901
|
key: 0,
|
|
19835
19902
|
viewBox: "0 0 1024 1024",
|
|
19836
19903
|
width: "1em",
|
|
19837
19904
|
height: "1em"
|
|
19838
19905
|
};
|
|
19839
|
-
const _hoisted_7$
|
|
19906
|
+
const _hoisted_7$f = {
|
|
19840
19907
|
key: 1,
|
|
19841
19908
|
viewBox: "0 0 1024 1024",
|
|
19842
19909
|
width: "1em",
|
|
@@ -20132,7 +20199,7 @@ return (_ctx, _cache) => {
|
|
|
20132
20199
|
autocomplete: "off",
|
|
20133
20200
|
onInput: handleInput,
|
|
20134
20201
|
onFocus: handleInputFocus
|
|
20135
|
-
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$
|
|
20202
|
+
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$I), [
|
|
20136
20203
|
[vModelText, query.value]
|
|
20137
20204
|
]),
|
|
20138
20205
|
createElementVNode("span", {
|
|
@@ -20264,14 +20331,14 @@ return (_ctx, _cache) => {
|
|
|
20264
20331
|
class: normalizeClass(unref(ns).e('checkbox-inner'))
|
|
20265
20332
|
}, [
|
|
20266
20333
|
(node.checked && !node.indeterminate)
|
|
20267
|
-
? (openBlock(), createElementBlock("svg", _hoisted_6$
|
|
20334
|
+
? (openBlock(), createElementBlock("svg", _hoisted_6$i, [...(_cache[8] || (_cache[8] = [
|
|
20268
20335
|
createElementVNode("path", {
|
|
20269
20336
|
fill: "currentColor",
|
|
20270
20337
|
d: "M406.656 706.944L195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
|
|
20271
20338
|
}, null, -1 /* CACHED */)
|
|
20272
20339
|
]))]))
|
|
20273
20340
|
: (node.indeterminate)
|
|
20274
|
-
? (openBlock(), createElementBlock("svg", _hoisted_7$
|
|
20341
|
+
? (openBlock(), createElementBlock("svg", _hoisted_7$f, [...(_cache[9] || (_cache[9] = [
|
|
20275
20342
|
createElementVNode("path", {
|
|
20276
20343
|
fill: "currentColor",
|
|
20277
20344
|
d: "M192 448h640v128H192z"
|
|
@@ -20561,7 +20628,7 @@ const _hoisted_1$W = {
|
|
|
20561
20628
|
viewBox: "0 0 1024 1024",
|
|
20562
20629
|
xmlns: "http://www.w3.org/2000/svg"
|
|
20563
20630
|
};
|
|
20564
|
-
const _hoisted_2$
|
|
20631
|
+
const _hoisted_2$H = {
|
|
20565
20632
|
key: 1,
|
|
20566
20633
|
viewBox: "0 0 1024 1024",
|
|
20567
20634
|
xmlns: "http://www.w3.org/2000/svg"
|
|
@@ -20577,7 +20644,7 @@ const _hoisted_4$m = {
|
|
|
20577
20644
|
xmlns: "http://www.w3.org/2000/svg"
|
|
20578
20645
|
};
|
|
20579
20646
|
const _hoisted_5$j = ["innerHTML"];
|
|
20580
|
-
const _hoisted_6$
|
|
20647
|
+
const _hoisted_6$h = ["aria-label"];
|
|
20581
20648
|
|
|
20582
20649
|
const _sfc_main$1C = /*@__PURE__*/Object.assign({
|
|
20583
20650
|
name: "YhMessage"
|
|
@@ -20716,7 +20783,7 @@ return (_ctx, _cache) => {
|
|
|
20716
20783
|
}, null, -1 /* CACHED */)
|
|
20717
20784
|
]))]))
|
|
20718
20785
|
: (__props.type === 'warning')
|
|
20719
|
-
? (openBlock(), createElementBlock("svg", _hoisted_2$
|
|
20786
|
+
? (openBlock(), createElementBlock("svg", _hoisted_2$H, [...(_cache[1] || (_cache[1] = [
|
|
20720
20787
|
createElementVNode("path", {
|
|
20721
20788
|
fill: "currentColor",
|
|
20722
20789
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256zm0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4z"
|
|
@@ -20784,7 +20851,7 @@ return (_ctx, _cache) => {
|
|
|
20784
20851
|
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
20785
20852
|
})
|
|
20786
20853
|
], -1 /* CACHED */)
|
|
20787
|
-
]))], 10 /* CLASS, PROPS */, _hoisted_6$
|
|
20854
|
+
]))], 10 /* CLASS, PROPS */, _hoisted_6$h))
|
|
20788
20855
|
: createCommentVNode("v-if", true)
|
|
20789
20856
|
], 38 /* CLASS, STYLE, NEED_HYDRATION */), [
|
|
20790
20857
|
[vShow, visible.value]
|
|
@@ -20967,7 +21034,7 @@ const _hoisted_1$V = {
|
|
|
20967
21034
|
viewBox: "0 0 1024 1024",
|
|
20968
21035
|
xmlns: "http://www.w3.org/2000/svg"
|
|
20969
21036
|
};
|
|
20970
|
-
const _hoisted_2$
|
|
21037
|
+
const _hoisted_2$G = {
|
|
20971
21038
|
key: 1,
|
|
20972
21039
|
viewBox: "0 0 1024 1024",
|
|
20973
21040
|
xmlns: "http://www.w3.org/2000/svg"
|
|
@@ -20983,7 +21050,7 @@ const _hoisted_4$l = {
|
|
|
20983
21050
|
xmlns: "http://www.w3.org/2000/svg"
|
|
20984
21051
|
};
|
|
20985
21052
|
const _hoisted_5$i = ["innerHTML"];
|
|
20986
|
-
const _hoisted_6$
|
|
21053
|
+
const _hoisted_6$g = ["aria-label"];
|
|
20987
21054
|
|
|
20988
21055
|
const _sfc_main$1B = /*@__PURE__*/Object.assign({
|
|
20989
21056
|
name: "YhNotification"
|
|
@@ -21152,7 +21219,7 @@ return (_ctx, _cache) => {
|
|
|
21152
21219
|
}, null, -1 /* CACHED */)
|
|
21153
21220
|
]))]))
|
|
21154
21221
|
: (__props.type === 'warning')
|
|
21155
|
-
? (openBlock(), createElementBlock("svg", _hoisted_2$
|
|
21222
|
+
? (openBlock(), createElementBlock("svg", _hoisted_2$G, [...(_cache[1] || (_cache[1] = [
|
|
21156
21223
|
createElementVNode("path", {
|
|
21157
21224
|
fill: "currentColor",
|
|
21158
21225
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256zm0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4z"
|
|
@@ -21236,7 +21303,7 @@ return (_ctx, _cache) => {
|
|
|
21236
21303
|
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
21237
21304
|
})
|
|
21238
21305
|
], -1 /* CACHED */)
|
|
21239
|
-
]))], 10 /* CLASS, PROPS */, _hoisted_6$
|
|
21306
|
+
]))], 10 /* CLASS, PROPS */, _hoisted_6$g))
|
|
21240
21307
|
: createCommentVNode("v-if", true)
|
|
21241
21308
|
], 38 /* CLASS, STYLE, NEED_HYDRATION */), [
|
|
21242
21309
|
[vShow, visible.value]
|
|
@@ -21814,7 +21881,7 @@ const _hoisted_1$T = {
|
|
|
21814
21881
|
height: "1em",
|
|
21815
21882
|
class: "yh-color-picker__empty"
|
|
21816
21883
|
};
|
|
21817
|
-
const _hoisted_2$
|
|
21884
|
+
const _hoisted_2$F = ["title"];
|
|
21818
21885
|
const _hoisted_3$s = ["onClick"];
|
|
21819
21886
|
const _hoisted_4$k = ["title"];
|
|
21820
21887
|
const _hoisted_5$h = ["value"];
|
|
@@ -22033,7 +22100,7 @@ return (_ctx, _cache) => {
|
|
|
22033
22100
|
})
|
|
22034
22101
|
}, null, 6 /* CLASS, STYLE */),
|
|
22035
22102
|
createTextVNode(" " + toDisplayString(contrastInfo.value.suggestion), 1 /* TEXT */)
|
|
22036
|
-
], 10 /* CLASS, PROPS */, _hoisted_2$
|
|
22103
|
+
], 10 /* CLASS, PROPS */, _hoisted_2$F),
|
|
22037
22104
|
createElementVNode("div", {
|
|
22038
22105
|
class: normalizeClass(unref(ns).e('sliders'))
|
|
22039
22106
|
}, [
|
|
@@ -22197,7 +22264,7 @@ const _hoisted_1$S = {
|
|
|
22197
22264
|
key: 0,
|
|
22198
22265
|
style: {"width":"0","height":"0","position":"absolute","visibility":"hidden","pointer-events":"none"}
|
|
22199
22266
|
};
|
|
22200
|
-
const _hoisted_2$
|
|
22267
|
+
const _hoisted_2$E = ["id"];
|
|
22201
22268
|
const _hoisted_3$r = ["offset", "stop-color"];
|
|
22202
22269
|
|
|
22203
22270
|
const _sfc_main$1w = /*@__PURE__*/Object.assign({
|
|
@@ -22339,7 +22406,7 @@ return (_ctx, _cache) => {
|
|
|
22339
22406
|
"stop-color": stop.color
|
|
22340
22407
|
}, null, 8 /* PROPS */, _hoisted_3$r))
|
|
22341
22408
|
}), 128 /* KEYED_FRAGMENT */))
|
|
22342
|
-
], 8 /* PROPS */, _hoisted_2$
|
|
22409
|
+
], 8 /* PROPS */, _hoisted_2$E)
|
|
22343
22410
|
])
|
|
22344
22411
|
]))
|
|
22345
22412
|
: createCommentVNode("v-if", true),
|
|
@@ -23858,7 +23925,7 @@ const _hoisted_1$O = {
|
|
|
23858
23925
|
width: "20",
|
|
23859
23926
|
height: "20"
|
|
23860
23927
|
};
|
|
23861
|
-
const _hoisted_2$
|
|
23928
|
+
const _hoisted_2$D = {
|
|
23862
23929
|
key: 0,
|
|
23863
23930
|
fill: "currentColor",
|
|
23864
23931
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-55.8 560.3L342.3 510.4a32 32 0 1 0-45.2 45.2l136 136a32 32 0 0 0 45.2 0l311.4-311.4a32 32 0 1 0-45.2-45.2L456.2 624.3z"
|
|
@@ -23878,9 +23945,9 @@ const _hoisted_5$g = {
|
|
|
23878
23945
|
fill: "currentColor",
|
|
23879
23946
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm170.3 535.1a32 32 0 0 0 0-45.2L557.3 512l125-125a32 32 0 0 0-45.2-45.2L512 466.7l-125-125a32 32 0 0 0-45.2 45.2l125 125-125 125a32 32 0 0 0 45.2 45.2l125-125 125 125a32 32 0 0 0 45.2 0z"
|
|
23880
23947
|
};
|
|
23881
|
-
const _hoisted_6$
|
|
23882
|
-
const _hoisted_7$
|
|
23883
|
-
const _hoisted_8$
|
|
23948
|
+
const _hoisted_6$f = ["aria-label"];
|
|
23949
|
+
const _hoisted_7$e = { key: 0 };
|
|
23950
|
+
const _hoisted_8$c = {
|
|
23884
23951
|
key: 2,
|
|
23885
23952
|
viewBox: "0 0 1024 1024",
|
|
23886
23953
|
width: "16",
|
|
@@ -24012,7 +24079,7 @@ return (_ctx, _cache) => {
|
|
|
24012
24079
|
createCommentVNode(" 默认类型图标 (这里可以预置几个 SVG) "),
|
|
24013
24080
|
(openBlock(), createElementBlock("svg", _hoisted_1$O, [
|
|
24014
24081
|
(_ctx.type === 'success')
|
|
24015
|
-
? (openBlock(), createElementBlock("path", _hoisted_2$
|
|
24082
|
+
? (openBlock(), createElementBlock("path", _hoisted_2$D))
|
|
24016
24083
|
: createCommentVNode("v-if", true),
|
|
24017
24084
|
(_ctx.type === 'info')
|
|
24018
24085
|
? (openBlock(), createElementBlock("path", _hoisted_3$q))
|
|
@@ -24091,20 +24158,20 @@ return (_ctx, _cache) => {
|
|
|
24091
24158
|
}, [
|
|
24092
24159
|
renderSlot(_ctx.$slots, "close", {}, () => [
|
|
24093
24160
|
(_ctx.closeText)
|
|
24094
|
-
? (openBlock(), createElementBlock("span", _hoisted_7$
|
|
24161
|
+
? (openBlock(), createElementBlock("span", _hoisted_7$e, toDisplayString(_ctx.closeText), 1 /* TEXT */))
|
|
24095
24162
|
: (_ctx.closeIcon)
|
|
24096
24163
|
? (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon), {
|
|
24097
24164
|
key: 1,
|
|
24098
24165
|
style: {"width":"16px","height":"16px"}
|
|
24099
24166
|
}))
|
|
24100
|
-
: (openBlock(), createElementBlock("svg", _hoisted_8$
|
|
24167
|
+
: (openBlock(), createElementBlock("svg", _hoisted_8$c, [...(_cache[0] || (_cache[0] = [
|
|
24101
24168
|
createElementVNode("path", {
|
|
24102
24169
|
fill: "currentColor",
|
|
24103
24170
|
d: "M810.7 274.7L749.3 213.3 512 450.7 274.7 213.3 213.3 274.7 450.7 512 213.3 749.3 274.7 810.7 512 573.3 749.3 810.7 810.7 749.3 573.3 512z"
|
|
24104
24171
|
}, null, -1 /* CACHED */)
|
|
24105
24172
|
]))]))
|
|
24106
24173
|
])
|
|
24107
|
-
], 10 /* CLASS, PROPS */, _hoisted_6$
|
|
24174
|
+
], 10 /* CLASS, PROPS */, _hoisted_6$f))
|
|
24108
24175
|
: createCommentVNode("v-if", true),
|
|
24109
24176
|
createCommentVNode(" 倒计时进度条 "),
|
|
24110
24177
|
(_ctx.showProgress && _ctx.duration > 0)
|
|
@@ -24536,15 +24603,15 @@ const progressProps = {
|
|
|
24536
24603
|
};
|
|
24537
24604
|
|
|
24538
24605
|
const _hoisted_1$M = ["aria-valuenow"];
|
|
24539
|
-
const _hoisted_2$
|
|
24606
|
+
const _hoisted_2$C = ["innerHTML"];
|
|
24540
24607
|
const _hoisted_3$p = ["viewBox"];
|
|
24541
24608
|
const _hoisted_4$i = { key: 0 };
|
|
24542
24609
|
const _hoisted_5$f = ["id"];
|
|
24543
|
-
const _hoisted_6$
|
|
24544
|
-
const _hoisted_7$
|
|
24545
|
-
const _hoisted_8$
|
|
24546
|
-
const _hoisted_9$
|
|
24547
|
-
const _hoisted_10$
|
|
24610
|
+
const _hoisted_6$e = ["offset", "stop-color"];
|
|
24611
|
+
const _hoisted_7$d = ["d", "stroke", "stroke-width", "stroke-linecap"];
|
|
24612
|
+
const _hoisted_8$b = ["d", "stroke", "stroke-linecap", "stroke-width"];
|
|
24613
|
+
const _hoisted_9$9 = ["width", "height", "innerHTML"];
|
|
24614
|
+
const _hoisted_10$5 = ["innerHTML"];
|
|
24548
24615
|
|
|
24549
24616
|
const _sfc_main$1o = /*@__PURE__*/Object.assign({
|
|
24550
24617
|
name: "YhProgress"
|
|
@@ -24717,7 +24784,7 @@ return (_ctx, _cache) => {
|
|
|
24717
24784
|
height: "16",
|
|
24718
24785
|
style: {"vertical-align":"middle"},
|
|
24719
24786
|
innerHTML: statusIconSvg.value
|
|
24720
|
-
}, null, 8 /* PROPS */, _hoisted_2$
|
|
24787
|
+
}, null, 8 /* PROPS */, _hoisted_2$C))
|
|
24721
24788
|
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
24722
24789
|
: (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
24723
24790
|
createCommentVNode(" eslint-enable vue/no-v-html "),
|
|
@@ -24773,7 +24840,7 @@ return (_ctx, _cache) => {
|
|
|
24773
24840
|
key: i,
|
|
24774
24841
|
offset: stop.offset,
|
|
24775
24842
|
"stop-color": stop.color
|
|
24776
|
-
}, null, 8 /* PROPS */, _hoisted_6$
|
|
24843
|
+
}, null, 8 /* PROPS */, _hoisted_6$e))
|
|
24777
24844
|
}), 128 /* KEYED_FRAGMENT */))
|
|
24778
24845
|
], 8 /* PROPS */, _hoisted_5$f)
|
|
24779
24846
|
]))
|
|
@@ -24789,7 +24856,7 @@ return (_ctx, _cache) => {
|
|
|
24789
24856
|
fill: "none",
|
|
24790
24857
|
"stroke-linecap": _ctx.strokeLinecap,
|
|
24791
24858
|
style: normalizeStyle(getCircleParams(index).trackStyle)
|
|
24792
|
-
}, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_7$
|
|
24859
|
+
}, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_7$d),
|
|
24793
24860
|
createElementVNode("path", {
|
|
24794
24861
|
class: normalizeClass(unref(ns).e('circle-path')),
|
|
24795
24862
|
d: getCircleParams(index).path,
|
|
@@ -24798,7 +24865,7 @@ return (_ctx, _cache) => {
|
|
|
24798
24865
|
"stroke-linecap": _ctx.strokeLinecap,
|
|
24799
24866
|
"stroke-width": p > 0 ? _ctx.strokeWidth : 0,
|
|
24800
24867
|
style: normalizeStyle(getCircleParams(index).pathStyle)
|
|
24801
|
-
}, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_8$
|
|
24868
|
+
}, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_8$b)
|
|
24802
24869
|
]))
|
|
24803
24870
|
}), 128 /* KEYED_FRAGMENT */))
|
|
24804
24871
|
], 10 /* CLASS, PROPS */, _hoisted_3$p)),
|
|
@@ -24834,7 +24901,7 @@ return (_ctx, _cache) => {
|
|
|
24834
24901
|
verticalAlign: 'middle'
|
|
24835
24902
|
}),
|
|
24836
24903
|
innerHTML: statusIconSvg.value
|
|
24837
|
-
}, null, 12 /* STYLE, PROPS */, _hoisted_9$
|
|
24904
|
+
}, null, 12 /* STYLE, PROPS */, _hoisted_9$9))
|
|
24838
24905
|
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
24839
24906
|
: (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
24840
24907
|
createCommentVNode(" eslint-enable vue/no-v-html "),
|
|
@@ -24877,7 +24944,7 @@ return (_ctx, _cache) => {
|
|
|
24877
24944
|
verticalAlign: 'middle'
|
|
24878
24945
|
}),
|
|
24879
24946
|
innerHTML: statusIconSvg.value
|
|
24880
|
-
}, null, 12 /* STYLE, PROPS */, _hoisted_10$
|
|
24947
|
+
}, null, 12 /* STYLE, PROPS */, _hoisted_10$5))
|
|
24881
24948
|
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
24882
24949
|
: (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
24883
24950
|
createCommentVNode(" eslint-enable vue/no-v-html "),
|
|
@@ -25381,6 +25448,10 @@ const internalVisible = ref(false);
|
|
|
25381
25448
|
const visible = computed({
|
|
25382
25449
|
get: () => props.visible !== null ? props.visible : internalVisible.value,
|
|
25383
25450
|
set: (val) => {
|
|
25451
|
+
if (props.visible !== null) {
|
|
25452
|
+
emit("update:visible", val);
|
|
25453
|
+
return;
|
|
25454
|
+
}
|
|
25384
25455
|
internalVisible.value = val;
|
|
25385
25456
|
emit("update:visible", val);
|
|
25386
25457
|
}
|
|
@@ -25751,7 +25822,7 @@ const dialogEmits = {
|
|
|
25751
25822
|
};
|
|
25752
25823
|
|
|
25753
25824
|
const _hoisted_1$L = ["aria-labelledby"];
|
|
25754
|
-
const _hoisted_2$
|
|
25825
|
+
const _hoisted_2$B = ["id"];
|
|
25755
25826
|
|
|
25756
25827
|
const _sfc_main$1l = /*@__PURE__*/Object.assign({
|
|
25757
25828
|
name: "YhDialog",
|
|
@@ -25772,14 +25843,25 @@ const lastClickPos = ref(null);
|
|
|
25772
25843
|
const handleDocumentClick = (e) => {
|
|
25773
25844
|
lastClickPos.value = { x: e.clientX, y: e.clientY };
|
|
25774
25845
|
};
|
|
25775
|
-
|
|
25776
|
-
|
|
25777
|
-
|
|
25778
|
-
|
|
25779
|
-
|
|
25846
|
+
useEventListener(
|
|
25847
|
+
() => typeof document !== "undefined" ? document : null,
|
|
25848
|
+
"pointerdown",
|
|
25849
|
+
(e) => handleDocumentClick(e),
|
|
25850
|
+
true
|
|
25851
|
+
);
|
|
25780
25852
|
onBeforeUnmount(() => {
|
|
25781
|
-
if (typeof
|
|
25782
|
-
|
|
25853
|
+
if (typeof document !== "undefined") {
|
|
25854
|
+
if (activeMouseMoveListener) {
|
|
25855
|
+
document.removeEventListener("mousemove", activeMouseMoveListener);
|
|
25856
|
+
activeMouseMoveListener = null;
|
|
25857
|
+
}
|
|
25858
|
+
if (activeMouseUpListener) {
|
|
25859
|
+
document.removeEventListener("mouseup", activeMouseUpListener);
|
|
25860
|
+
activeMouseUpListener = null;
|
|
25861
|
+
}
|
|
25862
|
+
}
|
|
25863
|
+
if (typeof window !== "undefined" && prevFocusedElement) {
|
|
25864
|
+
prevFocusedElement.focus();
|
|
25783
25865
|
}
|
|
25784
25866
|
});
|
|
25785
25867
|
const { themeStyle: themeVars } = useComponentTheme(
|
|
@@ -25794,6 +25876,8 @@ const rendered = ref(false);
|
|
|
25794
25876
|
useScrollLock(computed(() => props.modelValue && props.lockScroll));
|
|
25795
25877
|
const offset = ref({ x: 0, y: 0 });
|
|
25796
25878
|
const isDragging = ref(false);
|
|
25879
|
+
let activeMouseMoveListener = null;
|
|
25880
|
+
let activeMouseUpListener = null;
|
|
25797
25881
|
const handleMouseDown = (e) => {
|
|
25798
25882
|
if (!props.draggable || props.fullscreen) return;
|
|
25799
25883
|
if (e.button !== 0) return;
|
|
@@ -25825,11 +25909,19 @@ const handleMouseDown = (e) => {
|
|
|
25825
25909
|
const onMouseUp = (upEvent) => {
|
|
25826
25910
|
isDragging.value = false;
|
|
25827
25911
|
emit("dragEnd", upEvent);
|
|
25828
|
-
document
|
|
25829
|
-
|
|
25912
|
+
if (typeof document !== "undefined") {
|
|
25913
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
25914
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
25915
|
+
}
|
|
25916
|
+
activeMouseMoveListener = null;
|
|
25917
|
+
activeMouseUpListener = null;
|
|
25830
25918
|
};
|
|
25831
|
-
|
|
25832
|
-
|
|
25919
|
+
activeMouseMoveListener = onMouseMove;
|
|
25920
|
+
activeMouseUpListener = onMouseUp;
|
|
25921
|
+
if (typeof document !== "undefined") {
|
|
25922
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
25923
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
25924
|
+
}
|
|
25833
25925
|
};
|
|
25834
25926
|
let prevFocusedElement = null;
|
|
25835
25927
|
const trapFocus = (e) => {
|
|
@@ -25948,6 +26040,9 @@ const footerStyle = computed(() => {
|
|
|
25948
26040
|
return styles;
|
|
25949
26041
|
});
|
|
25950
26042
|
const doClose = () => {
|
|
26043
|
+
if (typeof window !== "undefined" && prevFocusedElement) {
|
|
26044
|
+
prevFocusedElement.focus();
|
|
26045
|
+
}
|
|
25951
26046
|
emit("update:modelValue", false);
|
|
25952
26047
|
};
|
|
25953
26048
|
const handleClose = () => {
|
|
@@ -26002,6 +26097,19 @@ watch(
|
|
|
26002
26097
|
emit("opened");
|
|
26003
26098
|
} else {
|
|
26004
26099
|
visible.value = false;
|
|
26100
|
+
if (isDragging.value) {
|
|
26101
|
+
isDragging.value = false;
|
|
26102
|
+
if (typeof document !== "undefined") {
|
|
26103
|
+
if (activeMouseMoveListener) {
|
|
26104
|
+
document.removeEventListener("mousemove", activeMouseMoveListener);
|
|
26105
|
+
activeMouseMoveListener = null;
|
|
26106
|
+
}
|
|
26107
|
+
if (activeMouseUpListener) {
|
|
26108
|
+
document.removeEventListener("mouseup", activeMouseUpListener);
|
|
26109
|
+
activeMouseUpListener = null;
|
|
26110
|
+
}
|
|
26111
|
+
}
|
|
26112
|
+
}
|
|
26005
26113
|
if (typeof window !== "undefined" && prevFocusedElement) {
|
|
26006
26114
|
prevFocusedElement.focus();
|
|
26007
26115
|
}
|
|
@@ -26088,7 +26196,7 @@ return (_ctx, _cache) => {
|
|
|
26088
26196
|
: (_ctx.title)
|
|
26089
26197
|
? (openBlock(), createBlock(resolveDynamicComponent(_ctx.title), { key: 2 }))
|
|
26090
26198
|
: createCommentVNode("v-if", true)
|
|
26091
|
-
], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$
|
|
26199
|
+
], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$B)
|
|
26092
26200
|
]),
|
|
26093
26201
|
(_ctx.showClose)
|
|
26094
26202
|
? (openBlock(), createElementBlock("button", {
|
|
@@ -26870,6 +26978,7 @@ const watermarkInnerStyle = computed(() => {
|
|
|
26870
26978
|
};
|
|
26871
26979
|
});
|
|
26872
26980
|
const renderWatermark = () => {
|
|
26981
|
+
if (typeof document === "undefined") return;
|
|
26873
26982
|
const canvas = document.createElement("canvas");
|
|
26874
26983
|
const ratio = typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
|
|
26875
26984
|
const canvasWidth = props.width + props.gap[0];
|
|
@@ -26908,7 +27017,7 @@ const renderWatermark = () => {
|
|
|
26908
27017
|
}
|
|
26909
27018
|
};
|
|
26910
27019
|
const createOrUpdateWatermark = () => {
|
|
26911
|
-
if (!containerRef.value) return;
|
|
27020
|
+
if (typeof document === "undefined" || !containerRef.value) return;
|
|
26912
27021
|
if (watermarkRef && watermarkRef.parentNode) {
|
|
26913
27022
|
watermarkRef.parentNode.removeChild(watermarkRef);
|
|
26914
27023
|
}
|
|
@@ -26991,9 +27100,18 @@ onMounted(() => {
|
|
|
26991
27100
|
});
|
|
26992
27101
|
});
|
|
26993
27102
|
onBeforeUnmount(() => {
|
|
26994
|
-
if (
|
|
26995
|
-
|
|
26996
|
-
|
|
27103
|
+
if (checkTimer) {
|
|
27104
|
+
clearInterval(checkTimer);
|
|
27105
|
+
checkTimer = null;
|
|
27106
|
+
}
|
|
27107
|
+
if (observer) {
|
|
27108
|
+
observer.disconnect();
|
|
27109
|
+
observer = null;
|
|
27110
|
+
}
|
|
27111
|
+
if (darkObserver) {
|
|
27112
|
+
darkObserver.disconnect();
|
|
27113
|
+
darkObserver = null;
|
|
27114
|
+
}
|
|
26997
27115
|
if (watermarkRef && watermarkRef.parentNode) {
|
|
26998
27116
|
watermarkRef.parentNode.removeChild(watermarkRef);
|
|
26999
27117
|
}
|
|
@@ -27151,13 +27269,13 @@ async function loadViewer() {
|
|
|
27151
27269
|
}
|
|
27152
27270
|
|
|
27153
27271
|
const _hoisted_1$J = ["accept", "multiple"];
|
|
27154
|
-
const _hoisted_2$
|
|
27272
|
+
const _hoisted_2$A = ["innerHTML"];
|
|
27155
27273
|
const _hoisted_3$o = ["src", "alt", "crossorigin"];
|
|
27156
27274
|
const _hoisted_4$h = ["onClick"];
|
|
27157
27275
|
const _hoisted_5$e = ["onClick"];
|
|
27158
|
-
const _hoisted_6$
|
|
27159
|
-
const _hoisted_7$
|
|
27160
|
-
const _hoisted_8$
|
|
27276
|
+
const _hoisted_6$d = ["onClick"];
|
|
27277
|
+
const _hoisted_7$c = ["src", "crossorigin"];
|
|
27278
|
+
const _hoisted_8$a = ["onClick"];
|
|
27161
27279
|
|
|
27162
27280
|
const _sfc_main$1i = /*@__PURE__*/Object.assign({
|
|
27163
27281
|
name: "YhUpload"
|
|
@@ -27303,23 +27421,23 @@ const attrAccept = (file, accept) => {
|
|
|
27303
27421
|
});
|
|
27304
27422
|
};
|
|
27305
27423
|
const handleFiles = async (files) => {
|
|
27306
|
-
|
|
27307
|
-
|
|
27308
|
-
return;
|
|
27309
|
-
}
|
|
27310
|
-
const validFiles = [];
|
|
27311
|
-
for (const file of files) {
|
|
27312
|
-
const rawFile = file;
|
|
27313
|
-
if (props.accept && !attrAccept(rawFile, props.accept)) {
|
|
27424
|
+
const filteredByRules = files.filter((file) => {
|
|
27425
|
+
if (props.accept && !attrAccept(file, props.accept)) {
|
|
27314
27426
|
console.warn(
|
|
27315
|
-
`[YhUpload] Auto Remove: File format does not match "${props.accept}" - ${
|
|
27427
|
+
`[YhUpload] Auto Remove: File format does not match "${props.accept}" - ${file.name}`
|
|
27316
27428
|
);
|
|
27317
|
-
|
|
27429
|
+
return false;
|
|
27318
27430
|
}
|
|
27319
|
-
if (props.maxSize &&
|
|
27320
|
-
console.warn(`[YhUpload] Auto Remove: File size exceeds limit - ${
|
|
27321
|
-
|
|
27431
|
+
if (props.maxSize && file.size / 1024 > props.maxSize) {
|
|
27432
|
+
console.warn(`[YhUpload] Auto Remove: File size exceeds limit - ${file.name}`);
|
|
27433
|
+
return false;
|
|
27322
27434
|
}
|
|
27435
|
+
return true;
|
|
27436
|
+
});
|
|
27437
|
+
const passedFiles = [];
|
|
27438
|
+
for (const file of filteredByRules) {
|
|
27439
|
+
const rawFile = file;
|
|
27440
|
+
let finalFile = rawFile;
|
|
27323
27441
|
if (props.beforeUpload) {
|
|
27324
27442
|
try {
|
|
27325
27443
|
const result = await props.beforeUpload(rawFile);
|
|
@@ -27327,12 +27445,22 @@ const handleFiles = async (files) => {
|
|
|
27327
27445
|
if (result instanceof Blob) {
|
|
27328
27446
|
const newRawFile = result;
|
|
27329
27447
|
if (!newRawFile.uid) newRawFile.uid = Date.now() + Math.random();
|
|
27330
|
-
|
|
27448
|
+
finalFile = newRawFile;
|
|
27331
27449
|
}
|
|
27332
27450
|
} catch {
|
|
27333
27451
|
continue;
|
|
27334
27452
|
}
|
|
27335
27453
|
}
|
|
27454
|
+
passedFiles.push({ rawFile, finalFile });
|
|
27455
|
+
}
|
|
27456
|
+
if (props.limit && props.fileList.length + passedFiles.length > props.limit) {
|
|
27457
|
+
const rawFilesOnly = passedFiles.map((item) => item.finalFile);
|
|
27458
|
+
emit("exceed", rawFilesOnly, props.fileList);
|
|
27459
|
+
return;
|
|
27460
|
+
}
|
|
27461
|
+
const validFiles = [];
|
|
27462
|
+
for (const item of passedFiles) {
|
|
27463
|
+
const rawFile = item.finalFile;
|
|
27336
27464
|
if (!rawFile.uid) rawFile.uid = Date.now() + Math.random();
|
|
27337
27465
|
const uploadFile = {
|
|
27338
27466
|
name: props.directory && rawFile.webkitRelativePath ? rawFile.webkitRelativePath : rawFile.name,
|
|
@@ -27634,7 +27762,7 @@ return (_ctx, _cache) => {
|
|
|
27634
27762
|
createElementVNode("div", {
|
|
27635
27763
|
class: normalizeClass(unref(ns).e('text')),
|
|
27636
27764
|
innerHTML: unref(t)('upload.tip')
|
|
27637
|
-
}, null, 10 /* CLASS, PROPS */, _hoisted_2$
|
|
27765
|
+
}, null, 10 /* CLASS, PROPS */, _hoisted_2$A)
|
|
27638
27766
|
], 2 /* CLASS */)
|
|
27639
27767
|
])
|
|
27640
27768
|
])
|
|
@@ -27755,7 +27883,7 @@ return (_ctx, _cache) => {
|
|
|
27755
27883
|
name: "delete",
|
|
27756
27884
|
size: 18
|
|
27757
27885
|
})
|
|
27758
|
-
], 8 /* PROPS */, _hoisted_6$
|
|
27886
|
+
], 8 /* PROPS */, _hoisted_6$d))
|
|
27759
27887
|
: createCommentVNode("v-if", true)
|
|
27760
27888
|
], 2 /* CLASS */),
|
|
27761
27889
|
createCommentVNode(" Progress Bar overlay "),
|
|
@@ -27789,7 +27917,7 @@ return (_ctx, _cache) => {
|
|
|
27789
27917
|
src: file.url,
|
|
27790
27918
|
class: normalizeClass(unref(ns).e('thumbnail-img')),
|
|
27791
27919
|
crossorigin: _ctx.crossorigin
|
|
27792
|
-
}, null, 10 /* CLASS, PROPS */, _hoisted_7$
|
|
27920
|
+
}, null, 10 /* CLASS, PROPS */, _hoisted_7$c))
|
|
27793
27921
|
: (openBlock(), createBlock(unref(YhIcon), {
|
|
27794
27922
|
key: 1,
|
|
27795
27923
|
name: "image",
|
|
@@ -27811,7 +27939,7 @@ return (_ctx, _cache) => {
|
|
|
27811
27939
|
createElementVNode("div", {
|
|
27812
27940
|
class: normalizeClass(unref(ns).e('name')),
|
|
27813
27941
|
onClick: $event => (handlePreview(file))
|
|
27814
|
-
}, toDisplayString(file.name), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$
|
|
27942
|
+
}, toDisplayString(file.name), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$a)
|
|
27815
27943
|
], 2 /* CLASS */),
|
|
27816
27944
|
createElementVNode("div", {
|
|
27817
27945
|
class: normalizeClass(unref(ns).e('status-icon-wrapper'))
|
|
@@ -28261,7 +28389,7 @@ const paginationProps = {
|
|
|
28261
28389
|
};
|
|
28262
28390
|
|
|
28263
28391
|
const _hoisted_1$I = ["disabled"];
|
|
28264
|
-
const _hoisted_2$
|
|
28392
|
+
const _hoisted_2$z = { key: 0 };
|
|
28265
28393
|
const _hoisted_3$n = {
|
|
28266
28394
|
key: 1,
|
|
28267
28395
|
viewBox: "0 0 1024 1024",
|
|
@@ -28270,8 +28398,8 @@ const _hoisted_3$n = {
|
|
|
28270
28398
|
};
|
|
28271
28399
|
const _hoisted_4$g = ["onClick"];
|
|
28272
28400
|
const _hoisted_5$d = ["disabled"];
|
|
28273
|
-
const _hoisted_6$
|
|
28274
|
-
const _hoisted_7$
|
|
28401
|
+
const _hoisted_6$c = { key: 0 };
|
|
28402
|
+
const _hoisted_7$b = {
|
|
28275
28403
|
key: 1,
|
|
28276
28404
|
viewBox: "0 0 1024 1024",
|
|
28277
28405
|
width: "1em",
|
|
@@ -28385,9 +28513,14 @@ const layoutComponents = computed(() => {
|
|
|
28385
28513
|
return props.layout.split(",").map((item) => item.trim());
|
|
28386
28514
|
});
|
|
28387
28515
|
__expose({
|
|
28388
|
-
currentPage:
|
|
28389
|
-
|
|
28390
|
-
|
|
28516
|
+
currentPage: computed({
|
|
28517
|
+
get: () => internalCurrentPage.value,
|
|
28518
|
+
set: (val) => {
|
|
28519
|
+
internalCurrentPage.value = val;
|
|
28520
|
+
}
|
|
28521
|
+
}),
|
|
28522
|
+
pageSize: computed(() => props.pageSize),
|
|
28523
|
+
pageCount: computed(() => pageCount.value)
|
|
28391
28524
|
});
|
|
28392
28525
|
|
|
28393
28526
|
return (_ctx, _cache) => {
|
|
@@ -28441,7 +28574,7 @@ return (_ctx, _cache) => {
|
|
|
28441
28574
|
}, [
|
|
28442
28575
|
renderSlot(_ctx.$slots, "prev-icon", {}, () => [
|
|
28443
28576
|
(_ctx.prevText)
|
|
28444
|
-
? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
28577
|
+
? (openBlock(), createElementBlock("span", _hoisted_2$z, toDisplayString(_ctx.prevText), 1 /* TEXT */))
|
|
28445
28578
|
: (openBlock(), createElementBlock("svg", _hoisted_3$n, [...(_cache[6] || (_cache[6] = [
|
|
28446
28579
|
createElementVNode("path", {
|
|
28447
28580
|
fill: "currentColor",
|
|
@@ -28509,8 +28642,8 @@ return (_ctx, _cache) => {
|
|
|
28509
28642
|
}, [
|
|
28510
28643
|
renderSlot(_ctx.$slots, "next-icon", {}, () => [
|
|
28511
28644
|
(_ctx.nextText)
|
|
28512
|
-
? (openBlock(), createElementBlock("span", _hoisted_6$
|
|
28513
|
-
: (openBlock(), createElementBlock("svg", _hoisted_7$
|
|
28645
|
+
? (openBlock(), createElementBlock("span", _hoisted_6$c, toDisplayString(_ctx.nextText), 1 /* TEXT */))
|
|
28646
|
+
: (openBlock(), createElementBlock("svg", _hoisted_7$b, [...(_cache[7] || (_cache[7] = [
|
|
28514
28647
|
createElementVNode("path", {
|
|
28515
28648
|
fill: "currentColor",
|
|
28516
28649
|
d: "M341.3 824.6l312.6-312.6L341.3 199.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L721.8 489.4c12.5 12.5 12.5 32.8 0 45.3L386.6 869.9c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3z"
|
|
@@ -28763,14 +28896,14 @@ const imageViewerEmits = {
|
|
|
28763
28896
|
};
|
|
28764
28897
|
|
|
28765
28898
|
const _hoisted_1$H = ["title", "aria-label"];
|
|
28766
|
-
const _hoisted_2$
|
|
28899
|
+
const _hoisted_2$y = ["title", "aria-label"];
|
|
28767
28900
|
const _hoisted_3$m = ["title", "aria-label"];
|
|
28768
28901
|
const _hoisted_4$f = ["title", "aria-label"];
|
|
28769
28902
|
const _hoisted_5$c = ["title", "aria-label"];
|
|
28770
|
-
const _hoisted_6$
|
|
28771
|
-
const _hoisted_7$
|
|
28772
|
-
const _hoisted_8$
|
|
28773
|
-
const _hoisted_9$
|
|
28903
|
+
const _hoisted_6$b = ["title", "aria-label"];
|
|
28904
|
+
const _hoisted_7$a = ["title", "aria-label"];
|
|
28905
|
+
const _hoisted_8$9 = ["title", "aria-label"];
|
|
28906
|
+
const _hoisted_9$8 = ["src"];
|
|
28774
28907
|
|
|
28775
28908
|
const _sfc_main$1f = /*@__PURE__*/Object.assign({
|
|
28776
28909
|
name: "YhImageViewer"
|
|
@@ -28797,6 +28930,7 @@ const handleClose = () => {
|
|
|
28797
28930
|
emit("close");
|
|
28798
28931
|
};
|
|
28799
28932
|
const initViewerJS = async () => {
|
|
28933
|
+
if (typeof document === "undefined") return;
|
|
28800
28934
|
let ViewerClass;
|
|
28801
28935
|
try {
|
|
28802
28936
|
ViewerClass = await loadViewer();
|
|
@@ -28816,7 +28950,7 @@ const initViewerJS = async () => {
|
|
|
28816
28950
|
...props.viewerOptions,
|
|
28817
28951
|
initialViewIndex: props.initialIndex,
|
|
28818
28952
|
hidden: () => {
|
|
28819
|
-
if (viewerList) {
|
|
28953
|
+
if (viewerList && typeof document !== "undefined") {
|
|
28820
28954
|
document.body.removeChild(viewerList);
|
|
28821
28955
|
viewerList = null;
|
|
28822
28956
|
}
|
|
@@ -28872,6 +29006,23 @@ watch(
|
|
|
28872
29006
|
index.value = val;
|
|
28873
29007
|
}
|
|
28874
29008
|
);
|
|
29009
|
+
watch(
|
|
29010
|
+
() => props.urlList,
|
|
29011
|
+
async () => {
|
|
29012
|
+
if (props.viewerMode === "viewerjs") {
|
|
29013
|
+
if (viewer) {
|
|
29014
|
+
viewer.destroy();
|
|
29015
|
+
viewer = null;
|
|
29016
|
+
}
|
|
29017
|
+
if (typeof document !== "undefined" && viewerList) {
|
|
29018
|
+
document.body.removeChild(viewerList);
|
|
29019
|
+
viewerList = null;
|
|
29020
|
+
}
|
|
29021
|
+
await initViewerJS();
|
|
29022
|
+
}
|
|
29023
|
+
},
|
|
29024
|
+
{ deep: true }
|
|
29025
|
+
);
|
|
28875
29026
|
const handleKeyDown = (e) => {
|
|
28876
29027
|
if (props.viewerMode === "viewerjs") return;
|
|
28877
29028
|
if (e.key === "Escape" && props.closeOnPressEscape) {
|
|
@@ -28887,19 +29038,23 @@ const handleKeyDown = (e) => {
|
|
|
28887
29038
|
}
|
|
28888
29039
|
};
|
|
28889
29040
|
onMounted(async () => {
|
|
28890
|
-
if (
|
|
28891
|
-
|
|
28892
|
-
|
|
28893
|
-
|
|
29041
|
+
if (typeof window !== "undefined") {
|
|
29042
|
+
if (props.viewerMode === "viewerjs") {
|
|
29043
|
+
await initViewerJS();
|
|
29044
|
+
} else {
|
|
29045
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
29046
|
+
}
|
|
28894
29047
|
}
|
|
28895
29048
|
});
|
|
28896
29049
|
onUnmounted(() => {
|
|
28897
|
-
window
|
|
29050
|
+
if (typeof window !== "undefined") {
|
|
29051
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
29052
|
+
}
|
|
28898
29053
|
if (viewer) {
|
|
28899
29054
|
viewer.destroy();
|
|
28900
29055
|
viewer = null;
|
|
28901
29056
|
}
|
|
28902
|
-
if (viewerList) {
|
|
29057
|
+
if (typeof document !== "undefined" && viewerList) {
|
|
28903
29058
|
document.body.removeChild(viewerList);
|
|
28904
29059
|
viewerList = null;
|
|
28905
29060
|
}
|
|
@@ -28968,7 +29123,7 @@ return (_ctx, _cache) => {
|
|
|
28968
29123
|
d: "M609.4 824.6L296.8 512l312.6-312.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L228.9 489.4c-12.5 12.5-12.5 32.8 0 45.3l335.2 335.2c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3z"
|
|
28969
29124
|
})
|
|
28970
29125
|
], -1 /* CACHED */)
|
|
28971
|
-
]))], 10 /* CLASS, PROPS */, _hoisted_2$
|
|
29126
|
+
]))], 10 /* CLASS, PROPS */, _hoisted_2$y),
|
|
28972
29127
|
createElementVNode("span", {
|
|
28973
29128
|
class: normalizeClass([unref(ns).e('btn'), unref(ns).e('next')]),
|
|
28974
29129
|
title: unref(t)('imageviewer.next'),
|
|
@@ -29047,7 +29202,7 @@ return (_ctx, _cache) => {
|
|
|
29047
29202
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 64a384 384 0 1 0 0 768 384 384 0 0 0 0-768zm0 128a256 256 0 1 1 0 512 256 256 0 0 1 0-512z"
|
|
29048
29203
|
})
|
|
29049
29204
|
], -1 /* CACHED */)
|
|
29050
|
-
]))], 10 /* CLASS, PROPS */, _hoisted_6$
|
|
29205
|
+
]))], 10 /* CLASS, PROPS */, _hoisted_6$b),
|
|
29051
29206
|
createElementVNode("i", {
|
|
29052
29207
|
class: normalizeClass(unref(ns).e('rotate-left')),
|
|
29053
29208
|
title: unref(t)('imageviewer.rotateLeft'),
|
|
@@ -29064,7 +29219,7 @@ return (_ctx, _cache) => {
|
|
|
29064
29219
|
d: "M512 128c-212.1 0-384 171.9-384 384s171.9 384 384 384 384-171.9 384-384h-64c0 176.7-143.3 320-320 320s-320-143.3-320-320 143.3-320 320-320v64l192-128-192-128v64z"
|
|
29065
29220
|
})
|
|
29066
29221
|
], -1 /* CACHED */)
|
|
29067
|
-
]))], 10 /* CLASS, PROPS */, _hoisted_7$
|
|
29222
|
+
]))], 10 /* CLASS, PROPS */, _hoisted_7$a),
|
|
29068
29223
|
createElementVNode("i", {
|
|
29069
29224
|
class: normalizeClass(unref(ns).e('rotate-right')),
|
|
29070
29225
|
title: unref(t)('imageviewer.rotateRight'),
|
|
@@ -29081,7 +29236,7 @@ return (_ctx, _cache) => {
|
|
|
29081
29236
|
d: "M512 128V64L320 192l192 128v-64c176.7 0 320 143.3 320 320s-143.3 320-320 320-320-143.3-320-320h-64c0 212.1 171.9 384 384 384s384-171.9 384-384-171.9-384-384-384z"
|
|
29082
29237
|
})
|
|
29083
29238
|
], -1 /* CACHED */)
|
|
29084
|
-
]))], 10 /* CLASS, PROPS */, _hoisted_8$
|
|
29239
|
+
]))], 10 /* CLASS, PROPS */, _hoisted_8$9)
|
|
29085
29240
|
], 2 /* CLASS */)
|
|
29086
29241
|
], 2 /* CLASS */))
|
|
29087
29242
|
: createCommentVNode("v-if", true),
|
|
@@ -29095,7 +29250,7 @@ return (_ctx, _cache) => {
|
|
|
29095
29250
|
style: normalizeStyle({
|
|
29096
29251
|
transform: transform.value
|
|
29097
29252
|
})
|
|
29098
|
-
}, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_9$
|
|
29253
|
+
}, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_9$8)
|
|
29099
29254
|
], 2 /* CLASS */)
|
|
29100
29255
|
], 6 /* CLASS, STYLE */))
|
|
29101
29256
|
: createCommentVNode("v-if", true)
|
|
@@ -29106,7 +29261,7 @@ return (_ctx, _cache) => {
|
|
|
29106
29261
|
});
|
|
29107
29262
|
|
|
29108
29263
|
const _hoisted_1$G = ["src", "alt", "crossorigin", "loading"];
|
|
29109
|
-
const _hoisted_2$
|
|
29264
|
+
const _hoisted_2$x = ["src", "alt", "crossorigin"];
|
|
29110
29265
|
|
|
29111
29266
|
const _sfc_main$1e = /*@__PURE__*/Object.assign({
|
|
29112
29267
|
name: "YhImage"
|
|
@@ -29210,8 +29365,9 @@ const initLazyLoad = () => {
|
|
|
29210
29365
|
const getRoot = () => {
|
|
29211
29366
|
if (!isClient || !container.value) return null;
|
|
29212
29367
|
if (typeof props.scrollContainer === "string") {
|
|
29368
|
+
if (typeof document === "undefined") return null;
|
|
29213
29369
|
return document.querySelector(props.scrollContainer);
|
|
29214
|
-
} else if (props.scrollContainer instanceof HTMLElement) {
|
|
29370
|
+
} else if (typeof HTMLElement !== "undefined" && props.scrollContainer instanceof HTMLElement) {
|
|
29215
29371
|
return props.scrollContainer;
|
|
29216
29372
|
}
|
|
29217
29373
|
const scrollContainer = getScrollContainer(container.value);
|
|
@@ -29363,7 +29519,7 @@ return (_ctx, _cache) => {
|
|
|
29363
29519
|
onLoad: onImgLoad,
|
|
29364
29520
|
onError: onImgError,
|
|
29365
29521
|
onClick: clickHandler
|
|
29366
|
-
}, null, 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2$
|
|
29522
|
+
}, null, 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2$x)
|
|
29367
29523
|
], 64 /* STABLE_FRAGMENT */))
|
|
29368
29524
|
: createCommentVNode("v-if", true),
|
|
29369
29525
|
createCommentVNode(" Viewer "),
|
|
@@ -29478,7 +29634,7 @@ const descriptionsItemProps = {
|
|
|
29478
29634
|
const descriptionsKey = Symbol("descriptionsKey");
|
|
29479
29635
|
|
|
29480
29636
|
const _hoisted_1$F = { key: 2 };
|
|
29481
|
-
const _hoisted_2$
|
|
29637
|
+
const _hoisted_2$w = ["colspan"];
|
|
29482
29638
|
const _hoisted_3$l = ["colspan"];
|
|
29483
29639
|
const _hoisted_4$e = ["colspan"];
|
|
29484
29640
|
|
|
@@ -29643,7 +29799,7 @@ return (_ctx, _cache) => {
|
|
|
29643
29799
|
(item.slots.default)
|
|
29644
29800
|
? (openBlock(), createBlock(resolveDynamicComponent(item.slots.default), { key: 0 }))
|
|
29645
29801
|
: createCommentVNode("v-if", true)
|
|
29646
|
-
], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$
|
|
29802
|
+
], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$w)
|
|
29647
29803
|
], 64 /* STABLE_FRAGMENT */))
|
|
29648
29804
|
}), 128 /* KEYED_FRAGMENT */))
|
|
29649
29805
|
], 2 /* CLASS */))
|
|
@@ -29816,7 +29972,7 @@ const tabsEmits = {
|
|
|
29816
29972
|
const TABS_INJECTION_KEY = Symbol("yhTabs");
|
|
29817
29973
|
|
|
29818
29974
|
const _hoisted_1$E = ["tabindex", "aria-selected", "onClick", "onKeydown", "onMouseenter"];
|
|
29819
|
-
const _hoisted_2$
|
|
29975
|
+
const _hoisted_2$v = ["onClick"];
|
|
29820
29976
|
|
|
29821
29977
|
const _sfc_main$1b = /*@__PURE__*/Object.assign({
|
|
29822
29978
|
name: "YhTabs"
|
|
@@ -29838,6 +29994,7 @@ const panes = ref([]);
|
|
|
29838
29994
|
const activeTab = ref(props.modelValue);
|
|
29839
29995
|
const navRef = ref();
|
|
29840
29996
|
const indicatorRef = ref();
|
|
29997
|
+
const rootRef = ref();
|
|
29841
29998
|
watch(
|
|
29842
29999
|
() => props.modelValue,
|
|
29843
30000
|
(val) => {
|
|
@@ -29932,9 +30089,10 @@ const updateIndicator = () => {
|
|
|
29932
30089
|
indicatorRef.value.style.width = "";
|
|
29933
30090
|
indicatorRef.value.style.height = "";
|
|
29934
30091
|
indicatorRef.value.style.transform = "";
|
|
29935
|
-
const
|
|
29936
|
-
const
|
|
29937
|
-
const
|
|
30092
|
+
const rootEl = navRef.value.closest(`.${ns.b()}`) || rootRef.value;
|
|
30093
|
+
const computedStyle = rootEl ? getComputedStyle(rootEl) : null;
|
|
30094
|
+
const defaultIndicatorWidth = computedStyle?.getPropertyValue("--yh-tabs-indicator-width").trim() || "40px";
|
|
30095
|
+
const defaultIndicatorHeight = computedStyle?.getPropertyValue("--yh-tabs-indicator-height").trim() || "20px";
|
|
29938
30096
|
const navRect = navRef.value.getBoundingClientRect();
|
|
29939
30097
|
const activeRect = activeEl.getBoundingClientRect();
|
|
29940
30098
|
if (isVertical) {
|
|
@@ -30021,6 +30179,8 @@ __expose({
|
|
|
30021
30179
|
|
|
30022
30180
|
return (_ctx, _cache) => {
|
|
30023
30181
|
return (openBlock(), createElementBlock("div", {
|
|
30182
|
+
ref_key: "rootRef",
|
|
30183
|
+
ref: rootRef,
|
|
30024
30184
|
class: normalizeClass(tabsClass.value),
|
|
30025
30185
|
style: normalizeStyle(tabsStyle.value)
|
|
30026
30186
|
}, [
|
|
@@ -30077,7 +30237,7 @@ return (_ctx, _cache) => {
|
|
|
30077
30237
|
d: "M764.3 260.3a32 32 0 0 0-45.3 0L512 467.2 305 260.3a32 32 0 0 0-45.3 45.2L466.8 512 259.7 718.5a32 32 0 0 0 45.3 45.3L512 556.7l207 207a32 32 0 0 0 45.3-45.2L557.2 512l207-206.5a32 32 0 0 0 0-45.2z"
|
|
30078
30238
|
})
|
|
30079
30239
|
], -1 /* CACHED */)
|
|
30080
|
-
]))], 10 /* CLASS, PROPS */, _hoisted_2$
|
|
30240
|
+
]))], 10 /* CLASS, PROPS */, _hoisted_2$v))
|
|
30081
30241
|
: createCommentVNode("v-if", true)
|
|
30082
30242
|
], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_1$E))
|
|
30083
30243
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
@@ -30359,6 +30519,7 @@ const { themeStyle } = useComponentTheme(
|
|
|
30359
30519
|
const steps = ref([]);
|
|
30360
30520
|
const isResponsiveVertical = ref(false);
|
|
30361
30521
|
const checkResponsive = () => {
|
|
30522
|
+
if (typeof window === "undefined") return;
|
|
30362
30523
|
if (props.responsive) {
|
|
30363
30524
|
isResponsiveVertical.value = window.innerWidth < props.responsiveBreakpoint;
|
|
30364
30525
|
} else {
|
|
@@ -30366,13 +30527,13 @@ const checkResponsive = () => {
|
|
|
30366
30527
|
}
|
|
30367
30528
|
};
|
|
30368
30529
|
onMounted(() => {
|
|
30369
|
-
if (props.responsive) {
|
|
30530
|
+
if (props.responsive && typeof window !== "undefined") {
|
|
30370
30531
|
checkResponsive();
|
|
30371
30532
|
window.addEventListener("resize", checkResponsive);
|
|
30372
30533
|
}
|
|
30373
30534
|
});
|
|
30374
30535
|
onUnmounted(() => {
|
|
30375
|
-
if (props.responsive) {
|
|
30536
|
+
if (props.responsive && typeof window !== "undefined") {
|
|
30376
30537
|
window.removeEventListener("resize", checkResponsive);
|
|
30377
30538
|
}
|
|
30378
30539
|
});
|
|
@@ -30720,16 +30881,17 @@ const configProviderProps = {
|
|
|
30720
30881
|
default: "default"
|
|
30721
30882
|
},
|
|
30722
30883
|
locale: {
|
|
30723
|
-
type: Object
|
|
30724
|
-
default: zhCn
|
|
30884
|
+
type: Object
|
|
30725
30885
|
},
|
|
30726
30886
|
size: {
|
|
30727
|
-
type: String
|
|
30728
|
-
default: "default"
|
|
30887
|
+
type: String
|
|
30729
30888
|
},
|
|
30730
30889
|
zIndex: {
|
|
30731
|
-
type: Number
|
|
30732
|
-
|
|
30890
|
+
type: Number
|
|
30891
|
+
},
|
|
30892
|
+
namespace: {
|
|
30893
|
+
type: String,
|
|
30894
|
+
default: ""
|
|
30733
30895
|
},
|
|
30734
30896
|
message: {
|
|
30735
30897
|
type: Object,
|
|
@@ -30744,6 +30906,7 @@ const ConfigProvider = defineComponent({
|
|
|
30744
30906
|
name: "YhConfigProvider",
|
|
30745
30907
|
props: configProviderProps,
|
|
30746
30908
|
setup(props, { slots }) {
|
|
30909
|
+
const globalOptions = inject("yh-ui-options", null);
|
|
30747
30910
|
const containerRef = ref(null);
|
|
30748
30911
|
const isMounted = ref(false);
|
|
30749
30912
|
let themeManager = null;
|
|
@@ -30797,11 +30960,14 @@ const ConfigProvider = defineComponent({
|
|
|
30797
30960
|
}
|
|
30798
30961
|
);
|
|
30799
30962
|
const config = computed(() => ({
|
|
30800
|
-
size: props.size,
|
|
30801
|
-
zIndex: props.zIndex,
|
|
30802
|
-
locale: props.locale,
|
|
30963
|
+
size: props.size ?? globalOptions?.size ?? "default",
|
|
30964
|
+
zIndex: props.zIndex ?? globalOptions?.zIndex ?? 2e3,
|
|
30965
|
+
locale: props.locale ?? globalOptions?.locale ?? zhCn,
|
|
30803
30966
|
message: props.message
|
|
30804
30967
|
}));
|
|
30968
|
+
const mergedNamespace = computed(() => {
|
|
30969
|
+
return props.namespace || globalOptions?.namespace || defaultNamespace;
|
|
30970
|
+
});
|
|
30805
30971
|
const themeStyles = computed(() => {
|
|
30806
30972
|
const manager = getThemeManager();
|
|
30807
30973
|
const themeState = manager.state;
|
|
@@ -30820,6 +30986,7 @@ const ConfigProvider = defineComponent({
|
|
|
30820
30986
|
return manager.getThemeStyles(colors);
|
|
30821
30987
|
});
|
|
30822
30988
|
provide(configProviderContextKey, config);
|
|
30989
|
+
provide(namespaceContextKey, mergedNamespace);
|
|
30823
30990
|
return () => {
|
|
30824
30991
|
return h$2(
|
|
30825
30992
|
"div",
|
|
@@ -31287,6 +31454,7 @@ const setupObserver = () => {
|
|
|
31287
31454
|
observer.disconnect();
|
|
31288
31455
|
observer = null;
|
|
31289
31456
|
}
|
|
31457
|
+
if (!placeholderRef.value) return;
|
|
31290
31458
|
const rootContainer = resolveScrollContainer();
|
|
31291
31459
|
observer = new IntersectionObserver(
|
|
31292
31460
|
(entries) => {
|
|
@@ -31352,7 +31520,8 @@ watch(
|
|
|
31352
31520
|
);
|
|
31353
31521
|
watch(
|
|
31354
31522
|
() => props.useObserver,
|
|
31355
|
-
() => {
|
|
31523
|
+
async () => {
|
|
31524
|
+
await nextTick();
|
|
31356
31525
|
if (props.useObserver) {
|
|
31357
31526
|
if (scrollContainer.value) {
|
|
31358
31527
|
scrollContainer.value.removeEventListener("scroll", handleScroll);
|
|
@@ -31720,7 +31889,7 @@ const dropdownMenuProps = {
|
|
|
31720
31889
|
const DROPDOWN_INJECTION_KEY = Symbol("dropdown");
|
|
31721
31890
|
|
|
31722
31891
|
const _hoisted_1$C = ["tabindex"];
|
|
31723
|
-
const _hoisted_2$
|
|
31892
|
+
const _hoisted_2$u = ["onClick"];
|
|
31724
31893
|
|
|
31725
31894
|
const _sfc_main$15 = /*@__PURE__*/Object.assign({
|
|
31726
31895
|
name: "YhDropdown"
|
|
@@ -31767,11 +31936,9 @@ const handleItemClick = (command) => {
|
|
|
31767
31936
|
};
|
|
31768
31937
|
const handleShow = () => {
|
|
31769
31938
|
emit("show");
|
|
31770
|
-
emit("update:visible", true);
|
|
31771
31939
|
};
|
|
31772
31940
|
const handleHide = () => {
|
|
31773
31941
|
emit("hide");
|
|
31774
|
-
emit("update:visible", false);
|
|
31775
31942
|
};
|
|
31776
31943
|
const handleButtonClick = (event) => {
|
|
31777
31944
|
emit("click", event);
|
|
@@ -31885,7 +32052,7 @@ return (_ctx, _cache) => {
|
|
|
31885
32052
|
}, null, 8 /* PROPS */, ["name", "class"]))
|
|
31886
32053
|
: createCommentVNode("v-if", true),
|
|
31887
32054
|
createElementVNode("span", null, toDisplayString(item.label), 1 /* TEXT */)
|
|
31888
|
-
], 10 /* CLASS, PROPS */, _hoisted_2$
|
|
32055
|
+
], 10 /* CLASS, PROPS */, _hoisted_2$u)
|
|
31889
32056
|
], 64 /* STABLE_FRAGMENT */))
|
|
31890
32057
|
}), 128 /* KEYED_FRAGMENT */))
|
|
31891
32058
|
], 64 /* STABLE_FRAGMENT */))
|
|
@@ -32326,7 +32493,7 @@ const MENU_INJECTION_KEY = Symbol("menu");
|
|
|
32326
32493
|
const SUB_MENU_INJECTION_KEY = Symbol("subMenu");
|
|
32327
32494
|
|
|
32328
32495
|
const _hoisted_1$B = ["tabindex"];
|
|
32329
|
-
const _hoisted_2$
|
|
32496
|
+
const _hoisted_2$t = { style: {"max-width":"300px","word-break":"break-all"} };
|
|
32330
32497
|
|
|
32331
32498
|
const _sfc_main$12 = /*@__PURE__*/Object.assign({
|
|
32332
32499
|
name: "YhMenuItem"
|
|
@@ -32416,7 +32583,7 @@ return (_ctx, _cache) => {
|
|
|
32416
32583
|
style: {"flex":"1","min-width":"0","overflow":"hidden"}
|
|
32417
32584
|
}, {
|
|
32418
32585
|
content: withCtx(() => [
|
|
32419
|
-
createElementVNode("div", _hoisted_2$
|
|
32586
|
+
createElementVNode("div", _hoisted_2$t, [
|
|
32420
32587
|
(renderLabelContent.value)
|
|
32421
32588
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
32422
32589
|
(typeof renderLabelContent.value === 'string')
|
|
@@ -32468,7 +32635,7 @@ return (_ctx, _cache) => {
|
|
|
32468
32635
|
});
|
|
32469
32636
|
|
|
32470
32637
|
const _hoisted_1$A = { style: {"max-width":"300px","word-break":"break-all"} };
|
|
32471
|
-
const _hoisted_2$
|
|
32638
|
+
const _hoisted_2$s = { style: {"max-width":"300px","word-break":"break-all"} };
|
|
32472
32639
|
|
|
32473
32640
|
const _sfc_main$11 = /*@__PURE__*/Object.assign({
|
|
32474
32641
|
name: "YhSubMenu"
|
|
@@ -32751,7 +32918,7 @@ return (_ctx, _cache) => {
|
|
|
32751
32918
|
style: {"flex":"1","min-width":"0","overflow":"hidden"}
|
|
32752
32919
|
}, {
|
|
32753
32920
|
content: withCtx(() => [
|
|
32754
|
-
createElementVNode("div", _hoisted_2$
|
|
32921
|
+
createElementVNode("div", _hoisted_2$s, [
|
|
32755
32922
|
(renderLabelContent.value)
|
|
32756
32923
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
32757
32924
|
(typeof renderLabelContent.value === 'string')
|
|
@@ -33305,6 +33472,7 @@ const DEFAULT_CHINA_HOLIDAYS_2026 = {
|
|
|
33305
33472
|
};
|
|
33306
33473
|
|
|
33307
33474
|
const _hoisted_1$z = ["onClick", "onMouseenter"];
|
|
33475
|
+
const _hoisted_2$r = ["onClick"];
|
|
33308
33476
|
|
|
33309
33477
|
const _sfc_main$Z = /*@__PURE__*/Object.assign({
|
|
33310
33478
|
name: "YhCalendar"
|
|
@@ -33326,6 +33494,42 @@ const { themeStyle } = useComponentTheme(
|
|
|
33326
33494
|
);
|
|
33327
33495
|
const now = dayjs_default();
|
|
33328
33496
|
const displayDate = ref(props.modelValue ? dayjs_default(props.modelValue) : now);
|
|
33497
|
+
const currentMode = ref(props.mode || "month");
|
|
33498
|
+
watch(
|
|
33499
|
+
() => props.mode,
|
|
33500
|
+
(val) => {
|
|
33501
|
+
if (val) currentMode.value = val;
|
|
33502
|
+
}
|
|
33503
|
+
);
|
|
33504
|
+
const handleModeChange = (mode) => {
|
|
33505
|
+
currentMode.value = mode;
|
|
33506
|
+
emit("update:mode", mode);
|
|
33507
|
+
emit("panel-change", displayDate.value.toDate(), mode);
|
|
33508
|
+
};
|
|
33509
|
+
const monthsList = computed(() => {
|
|
33510
|
+
const dateLocale = locale.value.yh?.datepicker;
|
|
33511
|
+
if (dateLocale?.months) {
|
|
33512
|
+
return [
|
|
33513
|
+
dateLocale.months.jan,
|
|
33514
|
+
dateLocale.months.feb,
|
|
33515
|
+
dateLocale.months.mar,
|
|
33516
|
+
dateLocale.months.apr,
|
|
33517
|
+
dateLocale.months.may,
|
|
33518
|
+
dateLocale.months.jun,
|
|
33519
|
+
dateLocale.months.jul,
|
|
33520
|
+
dateLocale.months.aug,
|
|
33521
|
+
dateLocale.months.sep,
|
|
33522
|
+
dateLocale.months.oct,
|
|
33523
|
+
dateLocale.months.nov,
|
|
33524
|
+
dateLocale.months.dec
|
|
33525
|
+
];
|
|
33526
|
+
}
|
|
33527
|
+
return ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
33528
|
+
});
|
|
33529
|
+
const selectMonth = (monthIndex) => {
|
|
33530
|
+
displayDate.value = displayDate.value.month(monthIndex);
|
|
33531
|
+
handleModeChange("month");
|
|
33532
|
+
};
|
|
33329
33533
|
const selectedDate = ref(props.modelValue ? dayjs_default(props.modelValue) : void 0);
|
|
33330
33534
|
const rangeStart = ref(
|
|
33331
33535
|
props.rangeValue?.[0] ? dayjs_default(props.rangeValue[0]) : void 0
|
|
@@ -33356,6 +33560,11 @@ const monthKeys = [
|
|
|
33356
33560
|
"dec"
|
|
33357
33561
|
];
|
|
33358
33562
|
const title = computed(() => {
|
|
33563
|
+
if (currentMode.value === "year") {
|
|
33564
|
+
const dateLocale2 = locale.value.yh?.datepicker;
|
|
33565
|
+
const year = displayDate.value.year();
|
|
33566
|
+
return dateLocale2?.year ? `${year}${dateLocale2.year}` : `${year}`;
|
|
33567
|
+
}
|
|
33359
33568
|
if (props.monthHeaderFormat) {
|
|
33360
33569
|
return displayDate.value.format(props.monthHeaderFormat);
|
|
33361
33570
|
}
|
|
@@ -33516,7 +33725,23 @@ const handleCellHover = (cell) => {
|
|
|
33516
33725
|
};
|
|
33517
33726
|
const moveMonth = (delta) => {
|
|
33518
33727
|
displayDate.value = displayDate.value.add(delta, "month");
|
|
33519
|
-
emit("panel-change", displayDate.value.toDate(),
|
|
33728
|
+
emit("panel-change", displayDate.value.toDate(), currentMode.value);
|
|
33729
|
+
};
|
|
33730
|
+
const handlePrev = () => {
|
|
33731
|
+
if (currentMode.value === "year") {
|
|
33732
|
+
displayDate.value = displayDate.value.subtract(1, "year");
|
|
33733
|
+
emit("panel-change", displayDate.value.toDate(), "year");
|
|
33734
|
+
} else {
|
|
33735
|
+
moveMonth(-1);
|
|
33736
|
+
}
|
|
33737
|
+
};
|
|
33738
|
+
const handleNext = () => {
|
|
33739
|
+
if (currentMode.value === "year") {
|
|
33740
|
+
displayDate.value = displayDate.value.add(1, "year");
|
|
33741
|
+
emit("panel-change", displayDate.value.toDate(), "year");
|
|
33742
|
+
} else {
|
|
33743
|
+
moveMonth(1);
|
|
33744
|
+
}
|
|
33520
33745
|
};
|
|
33521
33746
|
const goToday = () => {
|
|
33522
33747
|
displayDate.value = now;
|
|
@@ -33552,6 +33777,15 @@ watch(
|
|
|
33552
33777
|
multipleSelected.value = val?.map((d) => dayjs_default(d)) || [];
|
|
33553
33778
|
}
|
|
33554
33779
|
);
|
|
33780
|
+
watch(
|
|
33781
|
+
() => props.selectionMode,
|
|
33782
|
+
() => {
|
|
33783
|
+
selectedDate.value = props.modelValue ? dayjs_default(props.modelValue) : void 0;
|
|
33784
|
+
rangeStart.value = props.rangeValue?.[0] ? dayjs_default(props.rangeValue[0]) : void 0;
|
|
33785
|
+
rangeEnd.value = props.rangeValue?.[1] ? dayjs_default(props.rangeValue[1]) : void 0;
|
|
33786
|
+
multipleSelected.value = props.multipleValue?.map((d) => dayjs_default(d)) || [];
|
|
33787
|
+
}
|
|
33788
|
+
);
|
|
33555
33789
|
onMounted(() => {
|
|
33556
33790
|
if (props.defaultValue && !props.modelValue) {
|
|
33557
33791
|
selectedDate.value = dayjs_default(props.defaultValue);
|
|
@@ -33611,7 +33845,9 @@ return (_ctx, _cache) => {
|
|
|
33611
33845
|
class: normalizeClass(unref(ns).e('header'))
|
|
33612
33846
|
}, [
|
|
33613
33847
|
createElementVNode("div", {
|
|
33614
|
-
class: normalizeClass(unref(ns).e('title'))
|
|
33848
|
+
class: normalizeClass(unref(ns).e('title')),
|
|
33849
|
+
onClick: _cache[0] || (_cache[0] = $event => (currentMode.value === 'month' ? handleModeChange('year') : handleModeChange('month'))),
|
|
33850
|
+
style: {"cursor":"pointer"}
|
|
33615
33851
|
}, [
|
|
33616
33852
|
renderSlot(_ctx.$slots, "header", { date: title.value }, () => [
|
|
33617
33853
|
createTextVNode(toDisplayString(title.value), 1 /* TEXT */)
|
|
@@ -33626,10 +33862,10 @@ return (_ctx, _cache) => {
|
|
|
33626
33862
|
createVNode(unref(YhButton), {
|
|
33627
33863
|
class: "yh-calendar__nav-btn",
|
|
33628
33864
|
size: "small",
|
|
33629
|
-
onClick: _cache[
|
|
33865
|
+
onClick: _cache[1] || (_cache[1] = $event => (handlePrev()))
|
|
33630
33866
|
}, {
|
|
33631
33867
|
default: withCtx(() => [
|
|
33632
|
-
createTextVNode(toDisplayString(unref(t)("calendar.prevMonth")), 1 /* TEXT */)
|
|
33868
|
+
createTextVNode(toDisplayString(currentMode.value === "year" ? unref(t)("calendar.prevYear", "\u4E0A\u4E00\u5E74") : unref(t)("calendar.prevMonth")), 1 /* TEXT */)
|
|
33633
33869
|
]),
|
|
33634
33870
|
_: 1 /* STABLE */
|
|
33635
33871
|
}),
|
|
@@ -33646,10 +33882,10 @@ return (_ctx, _cache) => {
|
|
|
33646
33882
|
createVNode(unref(YhButton), {
|
|
33647
33883
|
class: "yh-calendar__nav-btn",
|
|
33648
33884
|
size: "small",
|
|
33649
|
-
onClick: _cache[
|
|
33885
|
+
onClick: _cache[2] || (_cache[2] = $event => (handleNext()))
|
|
33650
33886
|
}, {
|
|
33651
33887
|
default: withCtx(() => [
|
|
33652
|
-
createTextVNode(toDisplayString(unref(t)("calendar.nextMonth")), 1 /* TEXT */)
|
|
33888
|
+
createTextVNode(toDisplayString(currentMode.value === "year" ? unref(t)("calendar.nextYear", "\u4E0B\u4E00\u5E74") : unref(t)("calendar.nextMonth")), 1 /* TEXT */)
|
|
33653
33889
|
]),
|
|
33654
33890
|
_: 1 /* STABLE */
|
|
33655
33891
|
})
|
|
@@ -33660,74 +33896,94 @@ return (_ctx, _cache) => {
|
|
|
33660
33896
|
createElementVNode("div", {
|
|
33661
33897
|
class: normalizeClass(unref(ns).e('body'))
|
|
33662
33898
|
}, [
|
|
33663
|
-
|
|
33664
|
-
|
|
33665
|
-
|
|
33666
|
-
|
|
33667
|
-
|
|
33668
|
-
(
|
|
33669
|
-
|
|
33670
|
-
|
|
33671
|
-
|
|
33672
|
-
|
|
33673
|
-
|
|
33674
|
-
|
|
33675
|
-
|
|
33676
|
-
|
|
33677
|
-
|
|
33899
|
+
(currentMode.value === 'month')
|
|
33900
|
+
? (openBlock(), createElementBlock("table", {
|
|
33901
|
+
key: 0,
|
|
33902
|
+
class: normalizeClass(unref(ns).e('table'))
|
|
33903
|
+
}, [
|
|
33904
|
+
createElementVNode("thead", null, [
|
|
33905
|
+
createElementVNode("tr", null, [
|
|
33906
|
+
(_ctx.showWeekNumber)
|
|
33907
|
+
? (openBlock(), createElementBlock("th", {
|
|
33908
|
+
key: 0,
|
|
33909
|
+
class: normalizeClass(unref(ns).e('week-number-header'))
|
|
33910
|
+
}, toDisplayString(unref(t)("calendar.week")), 3 /* TEXT, CLASS */))
|
|
33911
|
+
: createCommentVNode("v-if", true),
|
|
33912
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(weekDays.value, (day) => {
|
|
33913
|
+
return (openBlock(), createElementBlock("th", {
|
|
33914
|
+
key: day.value,
|
|
33915
|
+
class: normalizeClass([unref(ns).e('weekday'), {
|
|
33678
33916
|
[unref(ns).em('weekday', 'weekend')]: _ctx.highlightWeekends && (day.value === 0 || day.value === 6)
|
|
33679
33917
|
}])
|
|
33680
|
-
}, [
|
|
33681
|
-
createElementVNode("span", null, toDisplayString(day.label), 1 /* TEXT */)
|
|
33682
|
-
], 2 /* CLASS */))
|
|
33683
|
-
}), 128 /* KEYED_FRAGMENT */))
|
|
33684
|
-
])
|
|
33685
|
-
]),
|
|
33686
|
-
createElementVNode("tbody", null, [
|
|
33687
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, rowIndex) => {
|
|
33688
|
-
return (openBlock(), createElementBlock("tr", { key: rowIndex }, [
|
|
33689
|
-
(_ctx.showWeekNumber)
|
|
33690
|
-
? (openBlock(), createElementBlock("td", {
|
|
33691
|
-
key: 0,
|
|
33692
|
-
class: normalizeClass(unref(ns).e('week-number'))
|
|
33693
|
-
}, toDisplayString(row.weekNumber), 3 /* TEXT, CLASS */))
|
|
33694
|
-
: createCommentVNode("v-if", true),
|
|
33695
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(row.cells, (cell, cellIndex) => {
|
|
33696
|
-
return (openBlock(), createElementBlock("td", {
|
|
33697
|
-
key: cellIndex,
|
|
33698
|
-
class: normalizeClass([unref(ns).e('day'), unref(ns).is('today', cell.isToday), unref(ns).is('selected', cell.isSelected), unref(ns).is('disabled', cell.isDisabled), unref(ns).is('weekend', _ctx.highlightWeekends && cell.isWeekend), unref(ns).is('holiday', cell.isHoliday), unref(ns).is('workday', cell.isWorkday), unref(ns).is('in-range', cell.isInRange), unref(ns).is('range-start', cell.isRangeStart), unref(ns).is('range-end', cell.isRangeEnd), unref(ns).is('other-month', cell.type !== 'current-month'), unref(ns).is('hidden', !_ctx.showOtherMonths && cell.type !== 'current-month'), unref(ns).is(cell.type, true), getCellExtraClass(cell)]),
|
|
33699
|
-
onClick: $event => (selectDate(cell)),
|
|
33700
|
-
onMouseenter: $event => (handleCellHover(cell))
|
|
33701
|
-
}, [
|
|
33702
|
-
createElementVNode("div", {
|
|
33703
|
-
class: normalizeClass(unref(ns).e('day-inner'))
|
|
33704
33918
|
}, [
|
|
33705
|
-
|
|
33706
|
-
|
|
33707
|
-
|
|
33708
|
-
|
|
33709
|
-
|
|
33710
|
-
|
|
33711
|
-
|
|
33712
|
-
|
|
33713
|
-
|
|
33714
|
-
|
|
33715
|
-
|
|
33716
|
-
|
|
33717
|
-
|
|
33718
|
-
|
|
33919
|
+
createElementVNode("span", null, toDisplayString(day.label), 1 /* TEXT */)
|
|
33920
|
+
], 2 /* CLASS */))
|
|
33921
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
33922
|
+
])
|
|
33923
|
+
]),
|
|
33924
|
+
createElementVNode("tbody", null, [
|
|
33925
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, rowIndex) => {
|
|
33926
|
+
return (openBlock(), createElementBlock("tr", { key: rowIndex }, [
|
|
33927
|
+
(_ctx.showWeekNumber)
|
|
33928
|
+
? (openBlock(), createElementBlock("td", {
|
|
33929
|
+
key: 0,
|
|
33930
|
+
class: normalizeClass(unref(ns).e('week-number'))
|
|
33931
|
+
}, toDisplayString(row.weekNumber), 3 /* TEXT, CLASS */))
|
|
33932
|
+
: createCommentVNode("v-if", true),
|
|
33933
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(row.cells, (cell, cellIndex) => {
|
|
33934
|
+
return (openBlock(), createElementBlock("td", {
|
|
33935
|
+
key: cellIndex,
|
|
33936
|
+
class: normalizeClass([unref(ns).e('day'), unref(ns).is('today', cell.isToday), unref(ns).is('selected', cell.isSelected), unref(ns).is('disabled', cell.isDisabled), unref(ns).is('weekend', _ctx.highlightWeekends && cell.isWeekend), unref(ns).is('holiday', cell.isHoliday), unref(ns).is('workday', cell.isWorkday), unref(ns).is('in-range', cell.isInRange), unref(ns).is('range-start', cell.isRangeStart), unref(ns).is('range-end', cell.isRangeEnd), unref(ns).is('other-month', cell.type !== 'current-month'), unref(ns).is('hidden', !_ctx.showOtherMonths && cell.type !== 'current-month'), unref(ns).is(cell.type, true), getCellExtraClass(cell)]),
|
|
33937
|
+
onClick: $event => (selectDate(cell)),
|
|
33938
|
+
onMouseenter: $event => (handleCellHover(cell))
|
|
33719
33939
|
}, [
|
|
33720
|
-
|
|
33721
|
-
|
|
33722
|
-
}
|
|
33723
|
-
|
|
33724
|
-
|
|
33725
|
-
|
|
33940
|
+
createElementVNode("div", {
|
|
33941
|
+
class: normalizeClass(unref(ns).e('day-inner'))
|
|
33942
|
+
}, [
|
|
33943
|
+
createCommentVNode(" 日期数字 "),
|
|
33944
|
+
createElementVNode("div", {
|
|
33945
|
+
class: normalizeClass(unref(ns).e('day-value'))
|
|
33946
|
+
}, toDisplayString(cell.day), 3 /* TEXT, CLASS */),
|
|
33947
|
+
createCommentVNode(" 假期/补班标记 "),
|
|
33948
|
+
(_ctx.showHoliday && (cell.isHoliday || cell.isWorkday))
|
|
33949
|
+
? (openBlock(), createElementBlock("div", {
|
|
33950
|
+
key: 0,
|
|
33951
|
+
class: normalizeClass([unref(ns).e('day-badge'), cell.isHoliday ? unref(ns).em('day-badge', 'holiday') : unref(ns).em('day-badge', 'workday')])
|
|
33952
|
+
}, toDisplayString(cell.isHoliday ? unref(t)("calendar.holiday") : unref(t)("calendar.workday")), 3 /* TEXT, CLASS */))
|
|
33953
|
+
: createCommentVNode("v-if", true),
|
|
33954
|
+
createCommentVNode(" 自定义内容插槽 "),
|
|
33955
|
+
createElementVNode("div", {
|
|
33956
|
+
class: normalizeClass(unref(ns).e('day-content'))
|
|
33957
|
+
}, [
|
|
33958
|
+
renderSlot(_ctx.$slots, "date-cell", {
|
|
33959
|
+
data: getSlotData(cell)
|
|
33960
|
+
})
|
|
33961
|
+
], 2 /* CLASS */)
|
|
33962
|
+
], 2 /* CLASS */)
|
|
33963
|
+
], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_1$z))
|
|
33964
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
33965
|
+
]))
|
|
33726
33966
|
}), 128 /* KEYED_FRAGMENT */))
|
|
33727
|
-
])
|
|
33728
|
-
|
|
33729
|
-
|
|
33730
|
-
|
|
33967
|
+
])
|
|
33968
|
+
], 2 /* CLASS */))
|
|
33969
|
+
: (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
33970
|
+
createCommentVNode(" 年视图 "),
|
|
33971
|
+
createElementVNode("div", {
|
|
33972
|
+
class: normalizeClass(unref(ns).e('months-grid'))
|
|
33973
|
+
}, [
|
|
33974
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(monthsList.value, (monthName, index) => {
|
|
33975
|
+
return (openBlock(), createElementBlock("div", {
|
|
33976
|
+
key: index,
|
|
33977
|
+
class: normalizeClass([unref(ns).e('month-cell'), unref(ns).is('current-month', displayDate.value.year() === unref(now).year() && index === unref(now).month())]),
|
|
33978
|
+
onClick: $event => (selectMonth(index))
|
|
33979
|
+
}, [
|
|
33980
|
+
createElementVNode("div", {
|
|
33981
|
+
class: normalizeClass(unref(ns).e('month-cell-inner'))
|
|
33982
|
+
}, toDisplayString(monthName), 3 /* TEXT, CLASS */)
|
|
33983
|
+
], 10 /* CLASS, PROPS */, _hoisted_2$r))
|
|
33984
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
33985
|
+
], 2 /* CLASS */)
|
|
33986
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
33731
33987
|
], 2 /* CLASS */),
|
|
33732
33988
|
createCommentVNode(" 底部插槽 "),
|
|
33733
33989
|
(_ctx.$slots.footer)
|
|
@@ -33844,23 +34100,34 @@ onBeforeUnmount(() => {
|
|
|
33844
34100
|
resizeObserver.disconnect();
|
|
33845
34101
|
resizeObserver = null;
|
|
33846
34102
|
}
|
|
34103
|
+
if (heightResetTimer !== null) {
|
|
34104
|
+
clearTimeout(heightResetTimer);
|
|
34105
|
+
heightResetTimer = null;
|
|
34106
|
+
}
|
|
33847
34107
|
});
|
|
33848
34108
|
const isRefreshing = computed(() => props.loading && props.items && props.items.length > 0);
|
|
33849
34109
|
const minContainerHeight = ref("auto");
|
|
34110
|
+
let heightResetTimer = null;
|
|
33850
34111
|
watch(
|
|
33851
34112
|
() => props.loading,
|
|
33852
34113
|
(val) => {
|
|
33853
34114
|
if (val && containerRef.value) {
|
|
34115
|
+
if (heightResetTimer !== null) {
|
|
34116
|
+
clearTimeout(heightResetTimer);
|
|
34117
|
+
heightResetTimer = null;
|
|
34118
|
+
}
|
|
33854
34119
|
const height = containerRef.value.offsetHeight;
|
|
33855
34120
|
if (height > 0) {
|
|
33856
34121
|
minContainerHeight.value = `${height}px`;
|
|
33857
34122
|
}
|
|
33858
34123
|
} else {
|
|
33859
|
-
|
|
33860
|
-
|
|
33861
|
-
|
|
33862
|
-
|
|
33863
|
-
|
|
34124
|
+
if (heightResetTimer !== null) {
|
|
34125
|
+
clearTimeout(heightResetTimer);
|
|
34126
|
+
}
|
|
34127
|
+
heightResetTimer = setTimeout(() => {
|
|
34128
|
+
minContainerHeight.value = "auto";
|
|
34129
|
+
heightResetTimer = null;
|
|
34130
|
+
}, 300);
|
|
33864
34131
|
}
|
|
33865
34132
|
}
|
|
33866
34133
|
);
|
|
@@ -34517,6 +34784,7 @@ const flattenedNodes = computed(() => {
|
|
|
34517
34784
|
return result;
|
|
34518
34785
|
});
|
|
34519
34786
|
const handleNodeClick = (node, e) => {
|
|
34787
|
+
if (dragNode.value) return;
|
|
34520
34788
|
if (node.disabled) return;
|
|
34521
34789
|
currentNodeKey.value = node.key;
|
|
34522
34790
|
emit("update:currentNodeKey", node.key);
|
|
@@ -35238,7 +35506,12 @@ function getInitialRemain() {
|
|
|
35238
35506
|
const now = Date.now() + serverOffset;
|
|
35239
35507
|
const value = props.value;
|
|
35240
35508
|
if (isTargetTimestamp(value)) {
|
|
35241
|
-
|
|
35509
|
+
let target = value instanceof Date ? value.getTime() : value;
|
|
35510
|
+
if (props.timezoneOffset !== void 0 && props.timezoneOffset !== null) {
|
|
35511
|
+
const localOffset = -(/* @__PURE__ */ new Date()).getTimezoneOffset();
|
|
35512
|
+
const tzAdjustment = (props.timezoneOffset - localOffset) * 60 * 1e3;
|
|
35513
|
+
target = target - tzAdjustment;
|
|
35514
|
+
}
|
|
35242
35515
|
return Math.max(0, target - now);
|
|
35243
35516
|
}
|
|
35244
35517
|
return Math.max(0, value instanceof Date ? value.getTime() : value);
|
|
@@ -35398,96 +35671,99 @@ const digits = computed(() => {
|
|
|
35398
35671
|
});
|
|
35399
35672
|
|
|
35400
35673
|
return (_ctx, _cache) => {
|
|
35401
|
-
return (
|
|
35402
|
-
|
|
35403
|
-
|
|
35404
|
-
|
|
35405
|
-
|
|
35406
|
-
|
|
35407
|
-
|
|
35408
|
-
|
|
35409
|
-
|
|
35410
|
-
|
|
35411
|
-
|
|
35412
|
-
|
|
35413
|
-
|
|
35414
|
-
|
|
35415
|
-
|
|
35416
|
-
|
|
35417
|
-
|
|
35418
|
-
|
|
35419
|
-
|
|
35420
|
-
|
|
35421
|
-
|
|
35422
|
-
|
|
35423
|
-
|
|
35424
|
-
|
|
35425
|
-
|
|
35426
|
-
|
|
35427
|
-
|
|
35428
|
-
|
|
35429
|
-
|
|
35430
|
-
|
|
35431
|
-
|
|
35432
|
-
|
|
35433
|
-
|
|
35434
|
-
|
|
35435
|
-
|
|
35436
|
-
|
|
35437
|
-
|
|
35674
|
+
return (_ctx.keepAliveOnFinish || status.value !== 'finished')
|
|
35675
|
+
? (openBlock(), createElementBlock("div", {
|
|
35676
|
+
key: 0,
|
|
35677
|
+
class: normalizeClass(rootClass.value),
|
|
35678
|
+
style: normalizeStyle(unref(themeStyle))
|
|
35679
|
+
}, [
|
|
35680
|
+
createCommentVNode(" 标题 "),
|
|
35681
|
+
renderSlot(_ctx.$slots, "prefix", {}, () => [
|
|
35682
|
+
(_ctx.title)
|
|
35683
|
+
? (openBlock(), createElementBlock("span", {
|
|
35684
|
+
key: 0,
|
|
35685
|
+
class: normalizeClass(unref(ns).e('title'))
|
|
35686
|
+
}, toDisplayString(_ctx.title), 3 /* TEXT, CLASS */))
|
|
35687
|
+
: createCommentVNode("v-if", true)
|
|
35688
|
+
]),
|
|
35689
|
+
createCommentVNode(" 主体内容 "),
|
|
35690
|
+
createElementVNode("div", {
|
|
35691
|
+
class: normalizeClass(unref(ns).e('content'))
|
|
35692
|
+
}, [
|
|
35693
|
+
createCommentVNode(" 默认插槽:完全自定义渲染 "),
|
|
35694
|
+
renderSlot(_ctx.$slots, "default", {
|
|
35695
|
+
current: formatContext.value,
|
|
35696
|
+
remaining: remain.value,
|
|
35697
|
+
formatted: displayText.value,
|
|
35698
|
+
status: status.value,
|
|
35699
|
+
isWarning: isWarning.value,
|
|
35700
|
+
isFinished: isFinished.value
|
|
35701
|
+
}, () => [
|
|
35702
|
+
createCommentVNode(" 翻牌模式 "),
|
|
35703
|
+
(_ctx.flipAnimation)
|
|
35704
|
+
? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(digits.value, (digit, idx) => {
|
|
35705
|
+
return (openBlock(), createElementBlock(Fragment, {
|
|
35706
|
+
key: digit.key
|
|
35707
|
+
}, [
|
|
35708
|
+
createCommentVNode(" 分隔符 "),
|
|
35709
|
+
(idx > 0)
|
|
35710
|
+
? (openBlock(), createElementBlock("span", {
|
|
35711
|
+
key: 0,
|
|
35712
|
+
class: normalizeClass(unref(ns).e('separator'))
|
|
35713
|
+
}, [
|
|
35714
|
+
renderSlot(_ctx.$slots, "separator", {}, () => [
|
|
35715
|
+
createTextVNode(toDisplayString(_ctx.separator), 1 /* TEXT */)
|
|
35716
|
+
])
|
|
35717
|
+
], 2 /* CLASS */))
|
|
35718
|
+
: createCommentVNode("v-if", true),
|
|
35719
|
+
createElementVNode("div", {
|
|
35720
|
+
class: normalizeClass(unref(ns).e('block'))
|
|
35438
35721
|
}, [
|
|
35439
|
-
|
|
35440
|
-
|
|
35441
|
-
|
|
35442
|
-
|
|
35443
|
-
|
|
35444
|
-
|
|
35445
|
-
|
|
35446
|
-
|
|
35447
|
-
|
|
35448
|
-
|
|
35722
|
+
createElementVNode("div", {
|
|
35723
|
+
class: normalizeClass(unref(ns).e('flip-card'))
|
|
35724
|
+
}, [
|
|
35725
|
+
renderSlot(_ctx.$slots, `${digit.key}-cell`, {
|
|
35726
|
+
value: digit.value
|
|
35727
|
+
}, () => [
|
|
35728
|
+
createElementVNode("span", {
|
|
35729
|
+
class: normalizeClass(unref(ns).e('value')),
|
|
35730
|
+
style: normalizeStyle(valueStyleComputed.value)
|
|
35731
|
+
}, toDisplayString(digit.value), 7 /* TEXT, CLASS, STYLE */)
|
|
35732
|
+
])
|
|
35733
|
+
], 2 /* CLASS */),
|
|
35734
|
+
(digit.label)
|
|
35735
|
+
? (openBlock(), createElementBlock("span", {
|
|
35736
|
+
key: 0,
|
|
35737
|
+
class: normalizeClass(unref(ns).e('label'))
|
|
35738
|
+
}, toDisplayString(digit.label), 3 /* TEXT, CLASS */))
|
|
35739
|
+
: createCommentVNode("v-if", true)
|
|
35740
|
+
], 2 /* CLASS */)
|
|
35741
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
35742
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
35743
|
+
: (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
35744
|
+
createCommentVNode(" 常规模式 "),
|
|
35745
|
+
createElementVNode("span", {
|
|
35746
|
+
class: normalizeClass(unref(ns).e('value')),
|
|
35747
|
+
style: normalizeStyle(valueStyleComputed.value)
|
|
35449
35748
|
}, [
|
|
35450
|
-
renderSlot(_ctx.$slots,
|
|
35451
|
-
value
|
|
35452
|
-
}, () => [
|
|
35453
|
-
createElementVNode("span", {
|
|
35454
|
-
class: normalizeClass(unref(ns).e('value')),
|
|
35455
|
-
style: normalizeStyle(valueStyleComputed.value)
|
|
35456
|
-
}, toDisplayString(digit.value), 7 /* TEXT, CLASS, STYLE */)
|
|
35749
|
+
renderSlot(_ctx.$slots, "value", { text: displayText.value }, () => [
|
|
35750
|
+
createTextVNode(toDisplayString(displayText.value), 1 /* TEXT */)
|
|
35457
35751
|
])
|
|
35458
|
-
],
|
|
35459
|
-
|
|
35460
|
-
|
|
35461
|
-
|
|
35462
|
-
|
|
35463
|
-
|
|
35464
|
-
|
|
35465
|
-
|
|
35466
|
-
|
|
35467
|
-
|
|
35468
|
-
|
|
35469
|
-
|
|
35470
|
-
|
|
35471
|
-
|
|
35472
|
-
|
|
35473
|
-
}, [
|
|
35474
|
-
renderSlot(_ctx.$slots, "value", { text: displayText.value }, () => [
|
|
35475
|
-
createTextVNode(toDisplayString(displayText.value), 1 /* TEXT */)
|
|
35476
|
-
])
|
|
35477
|
-
], 6 /* CLASS, STYLE */)
|
|
35478
|
-
], 64 /* STABLE_FRAGMENT */))
|
|
35479
|
-
])
|
|
35480
|
-
], 2 /* CLASS */),
|
|
35481
|
-
createCommentVNode(" 后缀 "),
|
|
35482
|
-
renderSlot(_ctx.$slots, "suffix", {}, () => [
|
|
35483
|
-
(_ctx.suffix)
|
|
35484
|
-
? (openBlock(), createElementBlock("span", {
|
|
35485
|
-
key: 0,
|
|
35486
|
-
class: normalizeClass(unref(ns).e('suffix'))
|
|
35487
|
-
}, toDisplayString(_ctx.suffix), 3 /* TEXT, CLASS */))
|
|
35488
|
-
: createCommentVNode("v-if", true)
|
|
35489
|
-
])
|
|
35490
|
-
], 6 /* CLASS, STYLE */))
|
|
35752
|
+
], 6 /* CLASS, STYLE */)
|
|
35753
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
35754
|
+
])
|
|
35755
|
+
], 2 /* CLASS */),
|
|
35756
|
+
createCommentVNode(" 后缀 "),
|
|
35757
|
+
renderSlot(_ctx.$slots, "suffix", {}, () => [
|
|
35758
|
+
(_ctx.suffix)
|
|
35759
|
+
? (openBlock(), createElementBlock("span", {
|
|
35760
|
+
key: 0,
|
|
35761
|
+
class: normalizeClass(unref(ns).e('suffix'))
|
|
35762
|
+
}, toDisplayString(_ctx.suffix), 3 /* TEXT, CLASS */))
|
|
35763
|
+
: createCommentVNode("v-if", true)
|
|
35764
|
+
])
|
|
35765
|
+
], 6 /* CLASS, STYLE */))
|
|
35766
|
+
: createCommentVNode("v-if", true)
|
|
35491
35767
|
}
|
|
35492
35768
|
}
|
|
35493
35769
|
|
|
@@ -37629,13 +37905,13 @@ const _hoisted_2$p = ["checked", "indeterminate"];
|
|
|
37629
37905
|
const _hoisted_3$j = ["rowspan"];
|
|
37630
37906
|
const _hoisted_4$c = ["rowspan"];
|
|
37631
37907
|
const _hoisted_5$b = ["colspan", "rowspan", "onClick", "onContextmenu"];
|
|
37632
|
-
const _hoisted_6$
|
|
37633
|
-
const _hoisted_7$
|
|
37634
|
-
const _hoisted_8$
|
|
37635
|
-
const _hoisted_9$
|
|
37636
|
-
const _hoisted_10$
|
|
37637
|
-
const _hoisted_11$
|
|
37638
|
-
const _hoisted_12$
|
|
37908
|
+
const _hoisted_6$a = ["onPointerdown"];
|
|
37909
|
+
const _hoisted_7$9 = ["checked", "indeterminate"];
|
|
37910
|
+
const _hoisted_8$8 = ["onClick", "onContextmenu"];
|
|
37911
|
+
const _hoisted_9$7 = ["onPointerdown"];
|
|
37912
|
+
const _hoisted_10$4 = ["src", "alt"];
|
|
37913
|
+
const _hoisted_11$4 = ["onClick", "onDblclick", "onContextmenu"];
|
|
37914
|
+
const _hoisted_12$3 = ["type", "checked", "disabled", "onChange"];
|
|
37639
37915
|
const _hoisted_13$2 = ["onClick"];
|
|
37640
37916
|
const _hoisted_14$1 = ["colspan", "rowspan", "data-row-key", "data-prop", "onClick", "onDblclick"];
|
|
37641
37917
|
const _hoisted_15$1 = ["onClick"];
|
|
@@ -38722,7 +38998,7 @@ return (_ctx, _cache) => {
|
|
|
38722
38998
|
key: 0,
|
|
38723
38999
|
class: normalizeClass(unref(ns).e('resize-handle')),
|
|
38724
39000
|
onPointerdown: withModifiers($event => (unref(handleResizeStart)($event, cell.column, $event.currentTarget.parentElement)), ["stop"])
|
|
38725
|
-
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_6$
|
|
39001
|
+
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_6$a))
|
|
38726
39002
|
: createCommentVNode("v-if", true)
|
|
38727
39003
|
], 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_5$b))
|
|
38728
39004
|
}), 128 /* KEYED_FRAGMENT */))
|
|
@@ -38754,7 +39030,7 @@ return (_ctx, _cache) => {
|
|
|
38754
39030
|
checked: unref(isAllSelected),
|
|
38755
39031
|
indeterminate: unref(isIndeterminate),
|
|
38756
39032
|
onChange: _cache[1] || (_cache[1] = (...args) => (unref(toggleAllSelection) && unref(toggleAllSelection)(...args)))
|
|
38757
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_7$
|
|
39033
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_7$9))
|
|
38758
39034
|
: createCommentVNode("v-if", true)
|
|
38759
39035
|
], 2 /* CLASS */)
|
|
38760
39036
|
], 6 /* CLASS, STYLE */))
|
|
@@ -38872,9 +39148,9 @@ return (_ctx, _cache) => {
|
|
|
38872
39148
|
key: 0,
|
|
38873
39149
|
class: normalizeClass(unref(ns).e('resize-handle')),
|
|
38874
39150
|
onPointerdown: withModifiers($event => (unref(handleResizeStart)($event, column, $event.currentTarget.parentElement)), ["stop"])
|
|
38875
|
-
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_9$
|
|
39151
|
+
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_9$7))
|
|
38876
39152
|
: createCommentVNode("v-if", true)
|
|
38877
|
-
], 16 /* FULL_PROPS */, _hoisted_8$
|
|
39153
|
+
], 16 /* FULL_PROPS */, _hoisted_8$8))
|
|
38878
39154
|
}), 128 /* KEYED_FRAGMENT */))
|
|
38879
39155
|
], 6 /* CLASS, STYLE */)
|
|
38880
39156
|
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
@@ -38921,7 +39197,7 @@ return (_ctx, _cache) => {
|
|
|
38921
39197
|
createElementVNode("img", {
|
|
38922
39198
|
src: _ctx.emptyConfig.image,
|
|
38923
39199
|
alt: unref(t)('common.noData')
|
|
38924
|
-
}, null, 8 /* PROPS */, _hoisted_10$
|
|
39200
|
+
}, null, 8 /* PROPS */, _hoisted_10$4)
|
|
38925
39201
|
], 2 /* CLASS */))
|
|
38926
39202
|
: createCommentVNode("v-if", true),
|
|
38927
39203
|
createElementVNode("div", {
|
|
@@ -39000,7 +39276,7 @@ return (_ctx, _cache) => {
|
|
|
39000
39276
|
checked: unref(isRowSelected)(row),
|
|
39001
39277
|
disabled: !unref(isRowSelectable)(row, rowIndex),
|
|
39002
39278
|
onChange: $event => (unref(toggleRowSelection)(row))
|
|
39003
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_12$
|
|
39279
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_12$3)
|
|
39004
39280
|
], 6 /* CLASS, STYLE */))
|
|
39005
39281
|
: createCommentVNode("v-if", true),
|
|
39006
39282
|
createCommentVNode(" 展开列 "),
|
|
@@ -39131,7 +39407,7 @@ return (_ctx, _cache) => {
|
|
|
39131
39407
|
: createCommentVNode("v-if", true)
|
|
39132
39408
|
], 64 /* STABLE_FRAGMENT */))
|
|
39133
39409
|
}), 128 /* KEYED_FRAGMENT */))
|
|
39134
|
-
], 16 /* FULL_PROPS */, _hoisted_11$
|
|
39410
|
+
], 16 /* FULL_PROPS */, _hoisted_11$4),
|
|
39135
39411
|
createCommentVNode(" 展开行内容 "),
|
|
39136
39412
|
(_ctx.expandConfig && expandedRowKeys.value.has(getRowKeyFn(row)))
|
|
39137
39413
|
? (openBlock(), createElementBlock("tr", {
|
|
@@ -40524,6 +40800,7 @@ watch(dropdownVisible, (val) => {
|
|
|
40524
40800
|
nextTick(updateDropdownPosition);
|
|
40525
40801
|
emit("open");
|
|
40526
40802
|
} else {
|
|
40803
|
+
dropdownStyle.value = {};
|
|
40527
40804
|
emit("close");
|
|
40528
40805
|
}
|
|
40529
40806
|
});
|
|
@@ -40552,6 +40829,7 @@ const debouncedSearch = (keyword, trigger) => {
|
|
|
40552
40829
|
}, props.debounce);
|
|
40553
40830
|
};
|
|
40554
40831
|
const handleInput = (event) => {
|
|
40832
|
+
if (event.isComposing) return;
|
|
40555
40833
|
const target = event.target;
|
|
40556
40834
|
const value = target.value;
|
|
40557
40835
|
const rawCursor = target.selectionStart;
|
|
@@ -41444,10 +41722,26 @@ const loadFileTree = async (type, keyword = "") => {
|
|
|
41444
41722
|
try {
|
|
41445
41723
|
let nodes = [];
|
|
41446
41724
|
if (props.fileLoader) {
|
|
41447
|
-
nodes = await props.fileLoader(keyword, type);
|
|
41725
|
+
nodes = await props.fileLoader(keyword, type, props.fileRoot);
|
|
41448
41726
|
} else {
|
|
41449
41727
|
nodes = generateMockFileTree(type, keyword);
|
|
41450
41728
|
}
|
|
41729
|
+
if (props.fileRoot && props.fileRoot !== "/") {
|
|
41730
|
+
const prefix = props.fileRoot.endsWith("/") ? props.fileRoot.slice(0, -1) : props.fileRoot;
|
|
41731
|
+
const applyRoot = (list) => {
|
|
41732
|
+
return list.map((node) => {
|
|
41733
|
+
const newNode = { ...node };
|
|
41734
|
+
if (newNode.path) {
|
|
41735
|
+
newNode.path = newNode.path.startsWith("/") ? `${prefix}${newNode.path}` : `${prefix}/${newNode.path}`;
|
|
41736
|
+
}
|
|
41737
|
+
if (newNode.children) {
|
|
41738
|
+
newNode.children = applyRoot(newNode.children);
|
|
41739
|
+
}
|
|
41740
|
+
return newNode;
|
|
41741
|
+
});
|
|
41742
|
+
};
|
|
41743
|
+
nodes = applyRoot(nodes);
|
|
41744
|
+
}
|
|
41451
41745
|
fileTreeData.value = nodes;
|
|
41452
41746
|
emit("file-load", type, nodes);
|
|
41453
41747
|
if (props.fileTreeExpandedLevel > 0) {
|
|
@@ -41797,6 +42091,10 @@ watch(showFileTree, (val) => {
|
|
|
41797
42091
|
onBeforeUnmount(() => {
|
|
41798
42092
|
window.removeEventListener("scroll", updatePanelPosition, true);
|
|
41799
42093
|
window.removeEventListener("resize", updatePanelPosition, true);
|
|
42094
|
+
if (searchDebounceTimer) {
|
|
42095
|
+
clearTimeout(searchDebounceTimer);
|
|
42096
|
+
searchDebounceTimer = null;
|
|
42097
|
+
}
|
|
41800
42098
|
});
|
|
41801
42099
|
const refreshFileTree = () => {
|
|
41802
42100
|
if (currentFileType.value) {
|
|
@@ -41851,7 +42149,8 @@ return (_ctx, _cache) => {
|
|
|
41851
42149
|
onFocus: _cache[0] || (_cache[0] = $event => (emit('focus', $event))),
|
|
41852
42150
|
onBlur: _cache[1] || (_cache[1] = $event => (emit('blur', $event))),
|
|
41853
42151
|
onInput: _cache[2] || (_cache[2] = $event => (emit('input', $event))),
|
|
41854
|
-
onKeydown: _cache[3] || (_cache[3] = $event => (emit('keydown', $event)))
|
|
42152
|
+
onKeydown: _cache[3] || (_cache[3] = $event => (emit('keydown', $event))),
|
|
42153
|
+
onChange: _cache[4] || (_cache[4] = $event => (emit('change', $event)))
|
|
41855
42154
|
}), createSlots({
|
|
41856
42155
|
option: withCtx(({ option }) => [
|
|
41857
42156
|
createElementVNode("div", {
|
|
@@ -42027,9 +42326,11 @@ watch(
|
|
|
42027
42326
|
const innerValue = computed({
|
|
42028
42327
|
get: () => localValue.value,
|
|
42029
42328
|
set: (val) => {
|
|
42030
|
-
localValue.value
|
|
42031
|
-
|
|
42032
|
-
|
|
42329
|
+
if (localValue.value !== val) {
|
|
42330
|
+
localValue.value = val;
|
|
42331
|
+
emit("update:modelValue", val);
|
|
42332
|
+
emit("change", val);
|
|
42333
|
+
}
|
|
42033
42334
|
}
|
|
42034
42335
|
});
|
|
42035
42336
|
const filteredCommands = computed(() => {
|
|
@@ -44662,7 +44963,9 @@ function sanitizeMarkup(html, options = {}) {
|
|
|
44662
44963
|
}
|
|
44663
44964
|
function sanitizeHighlightedHtml(html, options = {}) {
|
|
44664
44965
|
const source = options.sanitizer ? options.sanitizer(html) : html;
|
|
44665
|
-
return source.replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/<iframe[\s\S]*?>[\s\S]*?<\/iframe>/gi, "").replace(/<object[\s\S]*?>[\s\S]*?<\/object>/gi, "").replace(/<embed[\s\S]*?>/gi, "").replace(/<img[\s\S]*?>/gi, "").replace(
|
|
44966
|
+
return source.replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/<iframe[\s\S]*?>[\s\S]*?<\/iframe>/gi, "").replace(/<object[\s\S]*?>[\s\S]*?<\/object>/gi, "").replace(/<embed[\s\S]*?>/gi, "").replace(/<img[\s\S]*?>/gi, "").replace(/<[^>]+>/g, (tag) => {
|
|
44967
|
+
return tag.replace(/\son[a-z-]+\s*=\s*(['"]).*?\1/gi, "").replace(/\son[a-z-]+\s*=\s*[^\s>]+/gi, "");
|
|
44968
|
+
}).replace(/javascript:/gi, "");
|
|
44666
44969
|
}
|
|
44667
44970
|
function sanitizeSvgMarkup(svg, options = {}) {
|
|
44668
44971
|
return sanitizeMarkup(svg, {
|
|
@@ -45279,16 +45582,16 @@ const _hoisted_2$h = ["innerHTML"];
|
|
|
45279
45582
|
const _hoisted_3$e = { class: "hljs json" };
|
|
45280
45583
|
const _hoisted_4$9 = ["innerHTML"];
|
|
45281
45584
|
const _hoisted_5$9 = { key: 0 };
|
|
45282
|
-
const _hoisted_6$
|
|
45283
|
-
const _hoisted_7$
|
|
45284
|
-
const _hoisted_8$
|
|
45285
|
-
const _hoisted_9$
|
|
45585
|
+
const _hoisted_6$9 = { key: 0 };
|
|
45586
|
+
const _hoisted_7$8 = ["href", "title", "onClick"];
|
|
45587
|
+
const _hoisted_8$7 = { key: 0 };
|
|
45588
|
+
const _hoisted_9$6 = {
|
|
45286
45589
|
key: 1,
|
|
45287
45590
|
class: "publish-time"
|
|
45288
45591
|
};
|
|
45289
|
-
const _hoisted_10$
|
|
45290
|
-
const _hoisted_11$
|
|
45291
|
-
const _hoisted_12$
|
|
45592
|
+
const _hoisted_10$3 = { class: "code-edit-modal" };
|
|
45593
|
+
const _hoisted_11$3 = { class: "code-edit-header" };
|
|
45594
|
+
const _hoisted_12$2 = { class: "code-edit-body" };
|
|
45292
45595
|
const _hoisted_13$1 = { class: "code-edit-footer" };
|
|
45293
45596
|
|
|
45294
45597
|
const _sfc_main$y = /*@__PURE__*/Object.assign({
|
|
@@ -45296,10 +45599,12 @@ const _sfc_main$y = /*@__PURE__*/Object.assign({
|
|
|
45296
45599
|
}, {
|
|
45297
45600
|
__name: 'ai-bubble',
|
|
45298
45601
|
props: aiBubbleProps,
|
|
45299
|
-
|
|
45602
|
+
emits: ["copy-fail"],
|
|
45603
|
+
setup(__props, { emit: __emit }) {
|
|
45300
45604
|
|
|
45301
45605
|
|
|
45302
45606
|
const props = __props;
|
|
45607
|
+
const emit = __emit;
|
|
45303
45608
|
const ns = useNamespace("ai-bubble");
|
|
45304
45609
|
const { t } = useLocale();
|
|
45305
45610
|
const hasMounted = ref(false);
|
|
@@ -45308,22 +45613,24 @@ const { themeStyle } = useComponentTheme(
|
|
|
45308
45613
|
computed(() => props.themeOverrides)
|
|
45309
45614
|
);
|
|
45310
45615
|
const playingAsset = ref(null);
|
|
45311
|
-
|
|
45616
|
+
const audioInstance = ref(null);
|
|
45312
45617
|
const handleAudioToggle = (url) => {
|
|
45313
45618
|
if (playingAsset.value === url) {
|
|
45314
|
-
audioInstance?.pause();
|
|
45619
|
+
audioInstance.value?.pause();
|
|
45315
45620
|
playingAsset.value = null;
|
|
45316
45621
|
} else {
|
|
45317
|
-
if (audioInstance) {
|
|
45318
|
-
audioInstance.pause();
|
|
45622
|
+
if (audioInstance.value) {
|
|
45623
|
+
audioInstance.value.pause();
|
|
45624
|
+
audioInstance.value.src = "";
|
|
45319
45625
|
}
|
|
45320
45626
|
playingAsset.value = url;
|
|
45321
|
-
|
|
45322
|
-
audioInstance.
|
|
45627
|
+
const audio = new Audio(url);
|
|
45628
|
+
audioInstance.value = audio;
|
|
45629
|
+
audio.play().catch((err) => {
|
|
45323
45630
|
console.warn("Audio playback failed:", err);
|
|
45324
45631
|
playingAsset.value = null;
|
|
45325
45632
|
});
|
|
45326
|
-
|
|
45633
|
+
audio.onended = () => {
|
|
45327
45634
|
playingAsset.value = null;
|
|
45328
45635
|
};
|
|
45329
45636
|
}
|
|
@@ -45496,13 +45803,37 @@ const toggleCodeBlock = (id) => {
|
|
|
45496
45803
|
expandedCodeBlocks.value.add(id);
|
|
45497
45804
|
}
|
|
45498
45805
|
};
|
|
45806
|
+
const copyTextToClipboard = async (text) => {
|
|
45807
|
+
if (typeof navigator !== "undefined" && navigator.clipboard && navigator.clipboard.writeText) {
|
|
45808
|
+
try {
|
|
45809
|
+
await navigator.clipboard.writeText(text);
|
|
45810
|
+
return true;
|
|
45811
|
+
} catch {
|
|
45812
|
+
}
|
|
45813
|
+
}
|
|
45814
|
+
if (typeof document !== "undefined") {
|
|
45815
|
+
try {
|
|
45816
|
+
const textarea = document.createElement("textarea");
|
|
45817
|
+
textarea.value = text;
|
|
45818
|
+
textarea.style.position = "fixed";
|
|
45819
|
+
textarea.style.opacity = "0";
|
|
45820
|
+
document.body.appendChild(textarea);
|
|
45821
|
+
textarea.select();
|
|
45822
|
+
const successful = document.execCommand("copy");
|
|
45823
|
+
document.body.removeChild(textarea);
|
|
45824
|
+
if (successful) return true;
|
|
45825
|
+
} catch {
|
|
45826
|
+
}
|
|
45827
|
+
}
|
|
45828
|
+
return false;
|
|
45829
|
+
};
|
|
45499
45830
|
const copyCode = async (code, id) => {
|
|
45500
|
-
|
|
45501
|
-
|
|
45831
|
+
const success = await copyTextToClipboard(code);
|
|
45832
|
+
if (success) {
|
|
45502
45833
|
copiedCodeBlocks.value.add(id);
|
|
45503
45834
|
setTimeout(() => copiedCodeBlocks.value.delete(id), 2e3);
|
|
45504
|
-
}
|
|
45505
|
-
|
|
45835
|
+
} else {
|
|
45836
|
+
emit("copy-fail", new Error("Copy failed"));
|
|
45506
45837
|
}
|
|
45507
45838
|
};
|
|
45508
45839
|
const openCodeEditor = async (code, id, lang) => {
|
|
@@ -45529,12 +45860,12 @@ const saveEditCode = async (id) => {
|
|
|
45529
45860
|
if (monacoEditor.value) {
|
|
45530
45861
|
editCodeContent.value = monacoEditor.value.getValue();
|
|
45531
45862
|
}
|
|
45532
|
-
|
|
45533
|
-
|
|
45863
|
+
const success = await copyTextToClipboard(editCodeContent.value);
|
|
45864
|
+
if (success) {
|
|
45534
45865
|
copiedCodeBlocks.value.add(id);
|
|
45535
45866
|
setTimeout(() => copiedCodeBlocks.value.delete(id), 2e3);
|
|
45536
|
-
}
|
|
45537
|
-
|
|
45867
|
+
} else {
|
|
45868
|
+
emit("copy-fail", new Error("Copy failed"));
|
|
45538
45869
|
}
|
|
45539
45870
|
editingCodeBlock.value = null;
|
|
45540
45871
|
editCodeContent.value = "";
|
|
@@ -46082,9 +46413,10 @@ watch(
|
|
|
46082
46413
|
{ immediate: true }
|
|
46083
46414
|
);
|
|
46084
46415
|
onBeforeUnmount(() => {
|
|
46085
|
-
if (audioInstance) {
|
|
46086
|
-
audioInstance.pause();
|
|
46087
|
-
audioInstance =
|
|
46416
|
+
if (audioInstance.value) {
|
|
46417
|
+
audioInstance.value.pause();
|
|
46418
|
+
audioInstance.value.src = "";
|
|
46419
|
+
audioInstance.value = null;
|
|
46088
46420
|
}
|
|
46089
46421
|
if (streamTimer) {
|
|
46090
46422
|
clearInterval(streamTimer);
|
|
@@ -46348,7 +46680,7 @@ return (_ctx, _cache) => {
|
|
|
46348
46680
|
: createCommentVNode("v-if", true)
|
|
46349
46681
|
]),
|
|
46350
46682
|
(_ctx.structuredData.data && typeof _ctx.structuredData.data === 'object')
|
|
46351
|
-
? (openBlock(), createElementBlock("tbody", _hoisted_6$
|
|
46683
|
+
? (openBlock(), createElementBlock("tbody", _hoisted_6$9, [
|
|
46352
46684
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.structuredData.data.rows, (row, idx) => {
|
|
46353
46685
|
return (openBlock(), createElementBlock("tr", { key: idx }, [
|
|
46354
46686
|
(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, cIdx) => {
|
|
@@ -46510,7 +46842,7 @@ return (_ctx, _cache) => {
|
|
|
46510
46842
|
class: normalizeClass(unref(ns).e('citation-link-icon'))
|
|
46511
46843
|
}, null, 8 /* PROPS */, ["class"]))
|
|
46512
46844
|
: createCommentVNode("v-if", true)
|
|
46513
|
-
], 10 /* CLASS, PROPS */, _hoisted_7$
|
|
46845
|
+
], 10 /* CLASS, PROPS */, _hoisted_7$8))
|
|
46514
46846
|
}), 128 /* KEYED_FRAGMENT */))
|
|
46515
46847
|
], 2 /* CLASS */)
|
|
46516
46848
|
], 2 /* CLASS */))
|
|
@@ -46559,10 +46891,10 @@ return (_ctx, _cache) => {
|
|
|
46559
46891
|
}, [
|
|
46560
46892
|
createElementVNode("h4", null, toDisplayString(hoveredCitation.value.title), 1 /* TEXT */),
|
|
46561
46893
|
(hoveredCitation.value.abstract)
|
|
46562
|
-
? (openBlock(), createElementBlock("p", _hoisted_8$
|
|
46894
|
+
? (openBlock(), createElementBlock("p", _hoisted_8$7, toDisplayString(hoveredCitation.value.abstract), 1 /* TEXT */))
|
|
46563
46895
|
: createCommentVNode("v-if", true),
|
|
46564
46896
|
(hoveredCitation.value.publishTime)
|
|
46565
|
-
? (openBlock(), createElementBlock("span", _hoisted_9$
|
|
46897
|
+
? (openBlock(), createElementBlock("span", _hoisted_9$6, toDisplayString(hoveredCitation.value.publishTime), 1 /* TEXT */))
|
|
46566
46898
|
: createCommentVNode("v-if", true)
|
|
46567
46899
|
], 2 /* CLASS */)
|
|
46568
46900
|
], 2 /* CLASS */)
|
|
@@ -46587,8 +46919,8 @@ return (_ctx, _cache) => {
|
|
|
46587
46919
|
class: "code-edit-modal-overlay",
|
|
46588
46920
|
onClick: withModifiers(cancelEditCode, ["self"])
|
|
46589
46921
|
}, [
|
|
46590
|
-
createElementVNode("div", _hoisted_10$
|
|
46591
|
-
createElementVNode("div", _hoisted_11$
|
|
46922
|
+
createElementVNode("div", _hoisted_10$3, [
|
|
46923
|
+
createElementVNode("div", _hoisted_11$3, [
|
|
46592
46924
|
_cache[3] || (_cache[3] = createElementVNode("h3", null, "Edit Code", -1 /* CACHED */)),
|
|
46593
46925
|
createVNode(unref(YhButton), {
|
|
46594
46926
|
text: "",
|
|
@@ -46600,7 +46932,7 @@ return (_ctx, _cache) => {
|
|
|
46600
46932
|
_: 1 /* STABLE */
|
|
46601
46933
|
})
|
|
46602
46934
|
]),
|
|
46603
|
-
createElementVNode("div", _hoisted_12$
|
|
46935
|
+
createElementVNode("div", _hoisted_12$2, [
|
|
46604
46936
|
createElementVNode("div", {
|
|
46605
46937
|
ref_key: "monacoContainer",
|
|
46606
46938
|
ref: monacoContainer,
|
|
@@ -46718,14 +47050,14 @@ const emit = __emit;
|
|
|
46718
47050
|
const ns = useNamespace("ai-chat");
|
|
46719
47051
|
const { t } = useLocale();
|
|
46720
47052
|
const { themeStyle } = useComponentTheme("ai-chat", props.themeOverrides);
|
|
46721
|
-
const contentRef = ref();
|
|
46722
47053
|
const virtualScrollEnabled = computed(() => props.virtualScroll && props.messages.length > 50);
|
|
46723
|
-
const { visibleItems, totalHeight, offsetY, startIndex, onScroll, scrollToIndex } = useVirtualScroll$1({
|
|
47054
|
+
const { visibleItems, totalHeight, offsetY, startIndex, onScroll, scrollToIndex, containerRef } = useVirtualScroll$1({
|
|
46724
47055
|
items: computed(() => props.messages),
|
|
46725
47056
|
itemHeight: props.estimatedItemHeight,
|
|
46726
47057
|
containerHeight: props.virtualHeight,
|
|
46727
47058
|
overscan: 5
|
|
46728
47059
|
});
|
|
47060
|
+
const contentRef = containerRef;
|
|
46729
47061
|
const scrollToBottom = () => {
|
|
46730
47062
|
nextTick(() => {
|
|
46731
47063
|
if (virtualScrollEnabled.value && props.messages.length > 0) {
|
|
@@ -46784,8 +47116,8 @@ return (_ctx, _cache) => {
|
|
|
46784
47116
|
createCommentVNode(" Messages List "),
|
|
46785
47117
|
createElementVNode("div", {
|
|
46786
47118
|
class: normalizeClass(unref(ns).e('content')),
|
|
46787
|
-
ref_key: "
|
|
46788
|
-
ref:
|
|
47119
|
+
ref_key: "containerRef",
|
|
47120
|
+
ref: containerRef,
|
|
46789
47121
|
style: normalizeStyle(virtualScrollEnabled.value ? {
|
|
46790
47122
|
height: props.virtualHeight + 'px',
|
|
46791
47123
|
overflow: 'auto'
|
|
@@ -48376,24 +48708,29 @@ const actionItems = computed(() => {
|
|
|
48376
48708
|
icon: defaultIcons[item] || "more",
|
|
48377
48709
|
label: "",
|
|
48378
48710
|
// 通常泡泡底座不需要文字标签
|
|
48379
|
-
tooltip: defaultLabels.value[item] || item
|
|
48711
|
+
tooltip: defaultLabels.value[item] || item,
|
|
48712
|
+
_original: item
|
|
48380
48713
|
};
|
|
48381
48714
|
}
|
|
48382
48715
|
return {
|
|
48383
48716
|
...item,
|
|
48384
|
-
icon: item.icon || defaultIcons[item.key] || "more"
|
|
48717
|
+
icon: item.icon || defaultIcons[item.key] || "more",
|
|
48718
|
+
_original: item
|
|
48385
48719
|
};
|
|
48386
48720
|
});
|
|
48387
48721
|
});
|
|
48388
48722
|
const handleClick = (item) => {
|
|
48389
|
-
if (typeof item === "
|
|
48390
|
-
|
|
48391
|
-
|
|
48723
|
+
if (typeof item === "string") {
|
|
48724
|
+
emit("click", item, item);
|
|
48725
|
+
return;
|
|
48726
|
+
}
|
|
48727
|
+
if (item.disabled) return;
|
|
48728
|
+
emit("click", item.key, item._original);
|
|
48392
48729
|
};
|
|
48393
48730
|
|
|
48394
48731
|
return (_ctx, _cache) => {
|
|
48395
48732
|
return (openBlock(), createElementBlock("div", {
|
|
48396
|
-
class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.direction), unref(ns).m(_ctx.size)]),
|
|
48733
|
+
class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.direction), unref(ns).m(_ctx.size), unref(ns).m(props.variant)]),
|
|
48397
48734
|
style: normalizeStyle(unref(themeStyle))
|
|
48398
48735
|
}, [
|
|
48399
48736
|
(openBlock(true), createElementBlock(Fragment, null, renderList(actionItems.value, (item, index) => {
|
|
@@ -48691,13 +49028,28 @@ watch(
|
|
|
48691
49028
|
localValue.value = val;
|
|
48692
49029
|
}
|
|
48693
49030
|
);
|
|
49031
|
+
const isComposing = ref(false);
|
|
49032
|
+
const handleCompositionStart = () => {
|
|
49033
|
+
isComposing.value = true;
|
|
49034
|
+
};
|
|
49035
|
+
const handleCompositionEnd = (e) => {
|
|
49036
|
+
isComposing.value = false;
|
|
49037
|
+
const val = e.target.value;
|
|
49038
|
+
innerValue.value = val;
|
|
49039
|
+
nextTick(() => {
|
|
49040
|
+
autoResize();
|
|
49041
|
+
updateCommandPanelPosition();
|
|
49042
|
+
});
|
|
49043
|
+
};
|
|
48694
49044
|
const innerValue = computed({
|
|
48695
49045
|
get: () => localValue.value,
|
|
48696
49046
|
set: (val) => {
|
|
48697
49047
|
localValue.value = val;
|
|
48698
49048
|
emit("update:modelValue", val);
|
|
48699
49049
|
emit("change", val);
|
|
48700
|
-
|
|
49050
|
+
if (!isComposing.value) {
|
|
49051
|
+
checkCommandTrigger(val);
|
|
49052
|
+
}
|
|
48701
49053
|
}
|
|
48702
49054
|
});
|
|
48703
49055
|
const autoResize = () => {
|
|
@@ -48707,7 +49059,12 @@ const autoResize = () => {
|
|
|
48707
49059
|
el.style.height = `${Math.min(el.scrollHeight, 200)}px`;
|
|
48708
49060
|
};
|
|
48709
49061
|
const handleInput = (e) => {
|
|
48710
|
-
|
|
49062
|
+
const val = e.target.value;
|
|
49063
|
+
if (isComposing.value) {
|
|
49064
|
+
localValue.value = val;
|
|
49065
|
+
return;
|
|
49066
|
+
}
|
|
49067
|
+
innerValue.value = val;
|
|
48711
49068
|
nextTick(() => {
|
|
48712
49069
|
autoResize();
|
|
48713
49070
|
updateCommandPanelPosition();
|
|
@@ -48860,13 +49217,22 @@ const getCommandIcon = (command) => {
|
|
|
48860
49217
|
if (command.icon) return command.icon;
|
|
48861
49218
|
return "command";
|
|
48862
49219
|
};
|
|
49220
|
+
const triggerCommand = (keyword) => {
|
|
49221
|
+
showCommandPanel.value = true;
|
|
49222
|
+
commandSearchText.value = keyword;
|
|
49223
|
+
filterCommands(keyword);
|
|
49224
|
+
selectedCommandIndex.value = 0;
|
|
49225
|
+
emit("command-panel-show");
|
|
49226
|
+
emit("command-search", keyword);
|
|
49227
|
+
};
|
|
48863
49228
|
__expose({
|
|
48864
49229
|
focus: () => textareaRef.value?.focus(),
|
|
48865
49230
|
blur: () => textareaRef.value?.blur(),
|
|
48866
49231
|
clear: () => {
|
|
48867
49232
|
localValue.value = "";
|
|
48868
49233
|
hideCommandPanel();
|
|
48869
|
-
}
|
|
49234
|
+
},
|
|
49235
|
+
triggerCommand
|
|
48870
49236
|
});
|
|
48871
49237
|
|
|
48872
49238
|
return (_ctx, _cache) => {
|
|
@@ -48919,7 +49285,9 @@ return (_ctx, _cache) => {
|
|
|
48919
49285
|
onFocus: _cache[1] || (_cache[1] = $event => (isFocused.value = true)),
|
|
48920
49286
|
onBlur: _cache[2] || (_cache[2] = $event => (isFocused.value = false)),
|
|
48921
49287
|
onInput: handleInput,
|
|
48922
|
-
onKeydown: handleKeyDown
|
|
49288
|
+
onKeydown: handleKeyDown,
|
|
49289
|
+
onCompositionstart: handleCompositionStart,
|
|
49290
|
+
onCompositionend: handleCompositionEnd
|
|
48923
49291
|
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_1$i), [
|
|
48924
49292
|
[vModelText, innerValue.value]
|
|
48925
49293
|
])
|
|
@@ -49189,6 +49557,29 @@ const aiArtifactsProps = {
|
|
|
49189
49557
|
chartLoadingText: {
|
|
49190
49558
|
type: String,
|
|
49191
49559
|
default: void 0
|
|
49560
|
+
},
|
|
49561
|
+
// ========== Vue SFC 沙箱相关属性 ==========
|
|
49562
|
+
/**
|
|
49563
|
+
* Vue SFC 沙箱渲染器使用的 yh-ui bundle URL。
|
|
49564
|
+
* 默认使用 esm.sh CDN(会自动打包 @yh-ui/icons 等所有依赖,只需外部化 vue)。
|
|
49565
|
+
* 消费端可传入自托管的 bundle 地址,文档站可通过 provide('yhSandboxYhUiUrl', ...) 全局覆盖。
|
|
49566
|
+
*
|
|
49567
|
+
* @example '/assets/yh-ui-sandbox-bundle.js'
|
|
49568
|
+
* @default 'https://esm.sh/@yh-ui/yh-ui?external=vue'
|
|
49569
|
+
*/
|
|
49570
|
+
sandboxYhUiUrl: {
|
|
49571
|
+
type: String,
|
|
49572
|
+
default: void 0
|
|
49573
|
+
},
|
|
49574
|
+
/**
|
|
49575
|
+
* Vue SFC 沙箱渲染器使用的 yh-ui CSS URL。
|
|
49576
|
+
*
|
|
49577
|
+
* @example '/assets/yh-ui-bundle.css'
|
|
49578
|
+
* @default 'https://unpkg.com/@yh-ui/yh-ui/dist/style.css'
|
|
49579
|
+
*/
|
|
49580
|
+
sandboxYhUiCssUrl: {
|
|
49581
|
+
type: String,
|
|
49582
|
+
default: void 0
|
|
49192
49583
|
}
|
|
49193
49584
|
};
|
|
49194
49585
|
const aiArtifactsEmits = {
|
|
@@ -49201,11 +49592,154 @@ const aiArtifactsEmits = {
|
|
|
49201
49592
|
close: () => true
|
|
49202
49593
|
};
|
|
49203
49594
|
|
|
49595
|
+
const DEFAULT_SANDBOX_YH_UI_URL = "https://esm.sh/@yh-ui/yh-ui?external=vue";
|
|
49596
|
+
const DEFAULT_SANDBOX_YH_UI_CSS_URL = "https://unpkg.com/@yh-ui/yh-ui/dist/style.css";
|
|
49597
|
+
const VUE_CDN = "https://unpkg.com/vue@3.5.27/dist/vue.esm-browser.js";
|
|
49598
|
+
const SFC_LOADER_CDN = "https://unpkg.com/vue3-sfc-loader@0.9.5/dist/vue3-sfc-loader.js";
|
|
49599
|
+
function createSandboxHtml(options) {
|
|
49600
|
+
const { yhUiUrl, yhUiCssUrl } = options;
|
|
49601
|
+
return `<!DOCTYPE html>
|
|
49602
|
+
<html lang="zh-CN">
|
|
49603
|
+
<head>
|
|
49604
|
+
<meta charset="UTF-8">
|
|
49605
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
49606
|
+
<script>
|
|
49607
|
+
const pathSegments = window.parent.location.pathname.split('/');
|
|
49608
|
+
const baseIndex = pathSegments.indexOf('yh-ui');
|
|
49609
|
+
const subpath = baseIndex !== -1 ? '/' + pathSegments.slice(1, baseIndex + 1).join('/') + '/' : '/';
|
|
49610
|
+
document.write('<base href="' + window.parent.location.origin + subpath + '">');
|
|
49611
|
+
<\/script>
|
|
49612
|
+
<link rel="stylesheet" href="${yhUiCssUrl}">
|
|
49613
|
+
<style>
|
|
49614
|
+
body {
|
|
49615
|
+
margin: 0;
|
|
49616
|
+
padding: 0;
|
|
49617
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
49618
|
+
background-color: var(--yh-ai-artifacts-bg-color, #ffffff);
|
|
49619
|
+
color: var(--yh-text-color-primary, #303133);
|
|
49620
|
+
min-height: 100vh;
|
|
49621
|
+
overflow-x: hidden;
|
|
49622
|
+
}
|
|
49623
|
+
#app { padding: 20px; box-sizing: border-box; }
|
|
49624
|
+
.loading-container {
|
|
49625
|
+
display: flex;
|
|
49626
|
+
flex-direction: column;
|
|
49627
|
+
align-items: center;
|
|
49628
|
+
justify-content: center;
|
|
49629
|
+
height: 100vh;
|
|
49630
|
+
color: #909399;
|
|
49631
|
+
font-size: 14px;
|
|
49632
|
+
}
|
|
49633
|
+
.loading-spinner {
|
|
49634
|
+
width: 28px;
|
|
49635
|
+
height: 28px;
|
|
49636
|
+
border: 3px solid #ebeef5;
|
|
49637
|
+
border-top-color: #409eff;
|
|
49638
|
+
border-radius: 50%;
|
|
49639
|
+
animation: spin 0.8s linear infinite;
|
|
49640
|
+
margin-bottom: 12px;
|
|
49641
|
+
}
|
|
49642
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
49643
|
+
</style>
|
|
49644
|
+
|
|
49645
|
+
<!-- importmap: only vue needs to be listed; esm.sh bundles all other deps -->
|
|
49646
|
+
<script type="importmap">
|
|
49647
|
+
{
|
|
49648
|
+
"imports": {
|
|
49649
|
+
"vue": "${VUE_CDN}"
|
|
49650
|
+
}
|
|
49651
|
+
}
|
|
49652
|
+
<\/script>
|
|
49653
|
+
|
|
49654
|
+
<!-- vue3-sfc-loader provides runtime SFC compilation (UMD, global) -->
|
|
49655
|
+
<script src="${SFC_LOADER_CDN}"><\/script>
|
|
49656
|
+
</head>
|
|
49657
|
+
<body>
|
|
49658
|
+
<div id="app">
|
|
49659
|
+
<div class="loading-container">
|
|
49660
|
+
<div class="loading-spinner"></div>
|
|
49661
|
+
<p>\u6B63\u5728\u7F16\u8BD1\u5E76\u6E32\u67D3\u7EC4\u4EF6...</p>
|
|
49662
|
+
</div>
|
|
49663
|
+
</div>
|
|
49664
|
+
|
|
49665
|
+
<script>
|
|
49666
|
+
// Polyfill process for libraries checking process.env.NODE_ENV
|
|
49667
|
+
window.process = { env: { NODE_ENV: 'development' } };
|
|
49668
|
+
<\/script>
|
|
49669
|
+
|
|
49670
|
+
<script type="module">
|
|
49671
|
+
import * as Vue from 'vue';
|
|
49672
|
+
window.Vue = Vue;
|
|
49673
|
+
|
|
49674
|
+
// yhUiUrl is baked in at Blob-creation time; esm.sh auto-bundles all
|
|
49675
|
+
// transitive deps (@yh-ui/icons, dayjs, @floating-ui/dom, etc.)
|
|
49676
|
+
// Use dynamic import and handle both default export (CDN) and named exports (local bundle)
|
|
49677
|
+
const yhUiModule = await import('${yhUiUrl}');
|
|
49678
|
+
const YhUi = yhUiModule.default || { install: yhUiModule.install };
|
|
49679
|
+
|
|
49680
|
+
let currentApp = null;
|
|
49681
|
+
|
|
49682
|
+
window.addEventListener('message', async (event) => {
|
|
49683
|
+
const { type, code } = event.data || {};
|
|
49684
|
+
if (type !== 'render-vue' || !code) return;
|
|
49685
|
+
|
|
49686
|
+
try {
|
|
49687
|
+
if (currentApp) {
|
|
49688
|
+
currentApp.unmount();
|
|
49689
|
+
currentApp = null;
|
|
49690
|
+
}
|
|
49691
|
+
|
|
49692
|
+
const { loadModule } = window['vue3-sfc-loader'];
|
|
49693
|
+
const loaderOptions = {
|
|
49694
|
+
moduleCache: { vue: Vue },
|
|
49695
|
+
async getFile(url) {
|
|
49696
|
+
if (url === 'App.vue') return code;
|
|
49697
|
+
return '';
|
|
49698
|
+
},
|
|
49699
|
+
addStyle(styleStr) {
|
|
49700
|
+
const el = document.createElement('style');
|
|
49701
|
+
el.textContent = styleStr;
|
|
49702
|
+
document.head.appendChild(el);
|
|
49703
|
+
}
|
|
49704
|
+
};
|
|
49705
|
+
|
|
49706
|
+
const component = await loadModule('App.vue', loaderOptions);
|
|
49707
|
+
const app = Vue.createApp(component);
|
|
49708
|
+
app.use(YhUi);
|
|
49709
|
+
|
|
49710
|
+
// Replace loading indicator
|
|
49711
|
+
document.getElementById('app').innerHTML = '';
|
|
49712
|
+
app.mount('#app');
|
|
49713
|
+
currentApp = app;
|
|
49714
|
+
} catch (err) {
|
|
49715
|
+
document.getElementById('app').innerHTML =
|
|
49716
|
+
'<div style="padding:20px;color:#f56c6c;border:1px solid #fde2e2;' +
|
|
49717
|
+
'background:#fef0f0;border-radius:8px;font-family:monospace;' +
|
|
49718
|
+
'white-space:pre-wrap;font-size:13px;line-height:1.6;">' +
|
|
49719
|
+
'<h3 style="margin-top:0;margin-bottom:10px;">\u7F16\u8BD1/\u6E32\u67D3\u5931\u8D25:</h3>' +
|
|
49720
|
+
'<div>' + (err.stack || err.message || String(err)) + '</div></div>';
|
|
49721
|
+
}
|
|
49722
|
+
});
|
|
49723
|
+
|
|
49724
|
+
// Tell the parent that we are ready to receive code
|
|
49725
|
+
window.parent.postMessage({ type: 'renderer-ready' }, '*');
|
|
49726
|
+
<\/script>
|
|
49727
|
+
</body>
|
|
49728
|
+
</html>`;
|
|
49729
|
+
}
|
|
49730
|
+
|
|
49204
49731
|
const _hoisted_1$h = ["onClick"];
|
|
49205
49732
|
const _hoisted_2$e = ["src", "sandbox"];
|
|
49206
|
-
const _hoisted_3$b = ["
|
|
49207
|
-
const _hoisted_4$8 =
|
|
49208
|
-
const _hoisted_5$8 =
|
|
49733
|
+
const _hoisted_3$b = ["src"];
|
|
49734
|
+
const _hoisted_4$8 = ["src"];
|
|
49735
|
+
const _hoisted_5$8 = ["src"];
|
|
49736
|
+
const _hoisted_6$8 = ["src"];
|
|
49737
|
+
const _hoisted_7$7 = { style: {"width":"100%","height":"100%","margin":"0","padding":"16px","overflow":"auto","font-family":"monospace","white-space":"pre-wrap","box-sizing":"border-box"} };
|
|
49738
|
+
const _hoisted_8$6 = ["src"];
|
|
49739
|
+
const _hoisted_9$5 = ["src"];
|
|
49740
|
+
const _hoisted_10$2 = ["innerHTML"];
|
|
49741
|
+
const _hoisted_11$2 = { key: 0 };
|
|
49742
|
+
const _hoisted_12$1 = { key: 1 };
|
|
49209
49743
|
|
|
49210
49744
|
const _sfc_main$p = /*@__PURE__*/Object.assign({
|
|
49211
49745
|
name: "YhAiArtifacts"
|
|
@@ -49227,6 +49761,31 @@ const { themeStyle } = useComponentTheme(
|
|
|
49227
49761
|
);
|
|
49228
49762
|
const internalMode = ref(props.mode);
|
|
49229
49763
|
const currentVersionState = ref(props.data?.currentVersion || "");
|
|
49764
|
+
const isPreviewable = computed(() => {
|
|
49765
|
+
if (!props.data?.type) return false;
|
|
49766
|
+
const type = props.data.type;
|
|
49767
|
+
if (slots[type]) return true;
|
|
49768
|
+
const previewableTypes = [
|
|
49769
|
+
"html",
|
|
49770
|
+
"sandbox",
|
|
49771
|
+
"echarts",
|
|
49772
|
+
"chart",
|
|
49773
|
+
"canvas",
|
|
49774
|
+
"image",
|
|
49775
|
+
"video",
|
|
49776
|
+
"audio",
|
|
49777
|
+
"pdf",
|
|
49778
|
+
"iframe",
|
|
49779
|
+
"vue"
|
|
49780
|
+
];
|
|
49781
|
+
return previewableTypes.includes(type);
|
|
49782
|
+
});
|
|
49783
|
+
const activeMode = computed(() => {
|
|
49784
|
+
if (internalMode.value === "preview" && !isPreviewable.value) {
|
|
49785
|
+
return "code";
|
|
49786
|
+
}
|
|
49787
|
+
return internalMode.value;
|
|
49788
|
+
});
|
|
49230
49789
|
const escapeHtml = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
49231
49790
|
const echartsRef = ref(null);
|
|
49232
49791
|
const echartsInstance = shallowRef(null);
|
|
@@ -49251,6 +49810,12 @@ const getIcon = (type) => {
|
|
|
49251
49810
|
if (type === "canvas") return "edit";
|
|
49252
49811
|
if (type === "sandbox") return "play";
|
|
49253
49812
|
if (type === "diagram") return "connection";
|
|
49813
|
+
if (type === "image") return "image";
|
|
49814
|
+
if (type === "video") return "file-video";
|
|
49815
|
+
if (type === "audio") return "file-audio";
|
|
49816
|
+
if (type === "pdf") return "file-pdf";
|
|
49817
|
+
if (type === "text") return "document-text";
|
|
49818
|
+
if (type === "iframe") return "link";
|
|
49254
49819
|
return "document";
|
|
49255
49820
|
};
|
|
49256
49821
|
const currentVersionData = computed(() => {
|
|
@@ -49291,12 +49856,7 @@ const revokeCurrentUrl = () => {
|
|
|
49291
49856
|
}
|
|
49292
49857
|
};
|
|
49293
49858
|
watch(
|
|
49294
|
-
() => [
|
|
49295
|
-
props.visible,
|
|
49296
|
-
currentVersionData.value?.content,
|
|
49297
|
-
props.data?.type,
|
|
49298
|
-
internalMode.value
|
|
49299
|
-
],
|
|
49859
|
+
() => [props.visible, currentVersionData.value?.content, props.data?.type, activeMode.value],
|
|
49300
49860
|
([visible, content, type, mode]) => {
|
|
49301
49861
|
revokeCurrentUrl();
|
|
49302
49862
|
if (visible && content && (type === "html" || type === "sandbox") && (mode === "preview" || mode === "inline") && typeof window !== "undefined") {
|
|
@@ -49391,7 +49951,7 @@ const initECharts = async () => {
|
|
|
49391
49951
|
}
|
|
49392
49952
|
};
|
|
49393
49953
|
watch(
|
|
49394
|
-
() => [props.visible, isEChartsContainer.value, getEchartsOption.value,
|
|
49954
|
+
() => [props.visible, isEChartsContainer.value, getEchartsOption.value, activeMode.value],
|
|
49395
49955
|
([newVisible, isChart, , mode]) => {
|
|
49396
49956
|
if (newVisible && isChart && (mode === "preview" || mode === "inline")) {
|
|
49397
49957
|
nextTick(() => {
|
|
@@ -49401,8 +49961,99 @@ watch(
|
|
|
49401
49961
|
},
|
|
49402
49962
|
{ immediate: true }
|
|
49403
49963
|
);
|
|
49964
|
+
const vueRendererIframeRef = ref(null);
|
|
49965
|
+
const injectedYhUiUrl = inject("yhSandboxYhUiUrl", "");
|
|
49966
|
+
const injectedYhUiCssUrl = inject("yhSandboxYhUiCssUrl", "");
|
|
49967
|
+
const injectedRendererUrl = inject("yhSandboxRendererUrl", "");
|
|
49968
|
+
const resolveRootUrl = (url) => {
|
|
49969
|
+
if (typeof window === "undefined" || !url.startsWith("/")) return url;
|
|
49970
|
+
const pathSegments = window.location.pathname.split("/");
|
|
49971
|
+
const baseIndex = pathSegments.indexOf("yh-ui");
|
|
49972
|
+
const subpath = baseIndex !== -1 ? "/" + pathSegments.slice(1, baseIndex + 1).join("/") : "";
|
|
49973
|
+
if (subpath && !url.startsWith(subpath)) {
|
|
49974
|
+
return `${window.location.origin}${subpath}${url.replace(/^\/+/, "")}`;
|
|
49975
|
+
}
|
|
49976
|
+
return `${window.location.origin}${url}`;
|
|
49977
|
+
};
|
|
49978
|
+
const resolvedSandboxYhUiUrl = computed(() => {
|
|
49979
|
+
const url = props.sandboxYhUiUrl || injectedYhUiUrl || DEFAULT_SANDBOX_YH_UI_URL;
|
|
49980
|
+
return resolveRootUrl(url);
|
|
49981
|
+
});
|
|
49982
|
+
const resolvedSandboxYhUiCssUrl = computed(() => {
|
|
49983
|
+
const url = props.sandboxYhUiCssUrl || injectedYhUiCssUrl || DEFAULT_SANDBOX_YH_UI_CSS_URL;
|
|
49984
|
+
return resolveRootUrl(url);
|
|
49985
|
+
});
|
|
49986
|
+
const vueRendererSrc = computed(() => {
|
|
49987
|
+
if (injectedRendererUrl) {
|
|
49988
|
+
const rendererUrl = resolveRootUrl(injectedRendererUrl);
|
|
49989
|
+
const params = new URLSearchParams({
|
|
49990
|
+
jsUrl: resolvedSandboxYhUiUrl.value,
|
|
49991
|
+
cssUrl: resolvedSandboxYhUiCssUrl.value
|
|
49992
|
+
});
|
|
49993
|
+
return `${rendererUrl}?${params.toString()}`;
|
|
49994
|
+
}
|
|
49995
|
+
return vueRendererBlobUrl.value;
|
|
49996
|
+
});
|
|
49997
|
+
const vueRendererBlobUrl = ref("");
|
|
49998
|
+
const revokeSandboxBlobUrl = () => {
|
|
49999
|
+
if (vueRendererBlobUrl.value) {
|
|
50000
|
+
try {
|
|
50001
|
+
URL.revokeObjectURL(vueRendererBlobUrl.value);
|
|
50002
|
+
} catch {
|
|
50003
|
+
}
|
|
50004
|
+
vueRendererBlobUrl.value = "";
|
|
50005
|
+
}
|
|
50006
|
+
};
|
|
50007
|
+
const createVueSandbox = () => {
|
|
50008
|
+
if (typeof window === "undefined") return;
|
|
50009
|
+
if (injectedRendererUrl) return;
|
|
50010
|
+
revokeSandboxBlobUrl();
|
|
50011
|
+
const html = createSandboxHtml({
|
|
50012
|
+
yhUiUrl: resolvedSandboxYhUiUrl.value,
|
|
50013
|
+
yhUiCssUrl: resolvedSandboxYhUiCssUrl.value
|
|
50014
|
+
});
|
|
50015
|
+
const blob = new Blob([html], { type: "text/html;charset=utf-8" });
|
|
50016
|
+
vueRendererBlobUrl.value = URL.createObjectURL(blob);
|
|
50017
|
+
};
|
|
50018
|
+
watch([resolvedSandboxYhUiUrl, resolvedSandboxYhUiCssUrl], () => {
|
|
50019
|
+
if (typeof window !== "undefined" && !injectedRendererUrl) {
|
|
50020
|
+
createVueSandbox();
|
|
50021
|
+
}
|
|
50022
|
+
});
|
|
50023
|
+
const sendVueCodeToRenderer = () => {
|
|
50024
|
+
const iframe = vueRendererIframeRef.value;
|
|
50025
|
+
const content = currentVersionData.value?.content;
|
|
50026
|
+
if (iframe && iframe.contentWindow && content) {
|
|
50027
|
+
iframe.contentWindow.postMessage(
|
|
50028
|
+
{
|
|
50029
|
+
type: "render-vue",
|
|
50030
|
+
code: content
|
|
50031
|
+
},
|
|
50032
|
+
"*"
|
|
50033
|
+
);
|
|
50034
|
+
}
|
|
50035
|
+
};
|
|
50036
|
+
const onVueRendererLoad = () => {
|
|
50037
|
+
sendVueCodeToRenderer();
|
|
50038
|
+
};
|
|
50039
|
+
const handleRendererMessage = (event) => {
|
|
50040
|
+
if (event.data?.type === "renderer-ready") {
|
|
50041
|
+
sendVueCodeToRenderer();
|
|
50042
|
+
}
|
|
50043
|
+
};
|
|
50044
|
+
watch(
|
|
50045
|
+
() => currentVersionData.value?.content,
|
|
50046
|
+
() => {
|
|
50047
|
+
if (props.data?.type === "vue") {
|
|
50048
|
+
nextTick(() => {
|
|
50049
|
+
sendVueCodeToRenderer();
|
|
50050
|
+
});
|
|
50051
|
+
}
|
|
50052
|
+
}
|
|
50053
|
+
);
|
|
49404
50054
|
onBeforeUnmount(() => {
|
|
49405
50055
|
revokeCurrentUrl();
|
|
50056
|
+
revokeSandboxBlobUrl();
|
|
49406
50057
|
if (chartResizeObserver) {
|
|
49407
50058
|
chartResizeObserver.disconnect();
|
|
49408
50059
|
chartResizeObserver = null;
|
|
@@ -49411,9 +50062,16 @@ onBeforeUnmount(() => {
|
|
|
49411
50062
|
echartsInstance.value.dispose();
|
|
49412
50063
|
echartsInstance.value = null;
|
|
49413
50064
|
}
|
|
50065
|
+
if (typeof window !== "undefined") {
|
|
50066
|
+
window.removeEventListener("message", handleRendererMessage);
|
|
50067
|
+
}
|
|
49414
50068
|
});
|
|
49415
50069
|
onMounted(() => {
|
|
49416
50070
|
loadHighlightStyle();
|
|
50071
|
+
if (typeof window !== "undefined") {
|
|
50072
|
+
window.addEventListener("message", handleRendererMessage);
|
|
50073
|
+
createVueSandbox();
|
|
50074
|
+
}
|
|
49417
50075
|
});
|
|
49418
50076
|
const chartContainerStyle = computed(() => ({
|
|
49419
50077
|
height: typeof props.chartHeight === "number" ? props.chartHeight + "px" : props.chartHeight
|
|
@@ -49425,9 +50083,9 @@ return (_ctx, _cache) => {
|
|
|
49425
50083
|
(_ctx.visible)
|
|
49426
50084
|
? (openBlock(), createElementBlock("div", {
|
|
49427
50085
|
key: 0,
|
|
49428
|
-
class: normalizeClass([unref(ns).b(), unref(ns).m(
|
|
50086
|
+
class: normalizeClass([unref(ns).b(), unref(ns).m(activeMode.value), unref(ns).is('fullscreen', props.fullscreen)]),
|
|
49429
50087
|
style: normalizeStyle([{
|
|
49430
|
-
width: typeof _ctx.width === 'number' ? _ctx.width + 'px' : _ctx.width
|
|
50088
|
+
width: props.fullscreen ? '100%' : typeof _ctx.width === 'number' ? _ctx.width + 'px' : _ctx.width
|
|
49431
50089
|
}, unref(themeStyle)])
|
|
49432
50090
|
}, [
|
|
49433
50091
|
createCommentVNode(" Header "),
|
|
@@ -49447,25 +50105,28 @@ return (_ctx, _cache) => {
|
|
|
49447
50105
|
createElementVNode("div", {
|
|
49448
50106
|
class: normalizeClass(unref(ns).e('actions'))
|
|
49449
50107
|
}, [
|
|
49450
|
-
|
|
49451
|
-
|
|
49452
|
-
|
|
49453
|
-
|
|
49454
|
-
|
|
49455
|
-
|
|
49456
|
-
|
|
49457
|
-
|
|
49458
|
-
|
|
49459
|
-
|
|
49460
|
-
|
|
49461
|
-
|
|
49462
|
-
|
|
49463
|
-
|
|
49464
|
-
|
|
49465
|
-
|
|
49466
|
-
|
|
49467
|
-
|
|
49468
|
-
|
|
50108
|
+
(isPreviewable.value)
|
|
50109
|
+
? (openBlock(), createElementBlock("div", {
|
|
50110
|
+
key: 0,
|
|
50111
|
+
class: normalizeClass(unref(ns).e('tabs'))
|
|
50112
|
+
}, [
|
|
50113
|
+
createElementVNode("button", {
|
|
50114
|
+
class: normalizeClass([unref(ns).e('tab'), unref(ns).is('active', activeMode.value === 'preview')]),
|
|
50115
|
+
onClick: _cache[0] || (_cache[0] = $event => (toggleMode('preview')))
|
|
50116
|
+
}, toDisplayString(unref(t)("ai.artifacts.preview")), 3 /* TEXT, CLASS */),
|
|
50117
|
+
(_ctx.data?.type === 'html')
|
|
50118
|
+
? (openBlock(), createElementBlock("button", {
|
|
50119
|
+
key: 0,
|
|
50120
|
+
class: normalizeClass([unref(ns).e('tab'), unref(ns).is('active', activeMode.value === 'inline')]),
|
|
50121
|
+
onClick: _cache[1] || (_cache[1] = $event => (toggleMode('inline')))
|
|
50122
|
+
}, toDisplayString(unref(t)("ai.artifacts.inline")), 3 /* TEXT, CLASS */))
|
|
50123
|
+
: createCommentVNode("v-if", true),
|
|
50124
|
+
createElementVNode("button", {
|
|
50125
|
+
class: normalizeClass([unref(ns).e('tab'), unref(ns).is('active', activeMode.value === 'code')]),
|
|
50126
|
+
onClick: _cache[2] || (_cache[2] = $event => (toggleMode('code')))
|
|
50127
|
+
}, toDisplayString(unref(t)("ai.artifacts.code")), 3 /* TEXT, CLASS */)
|
|
50128
|
+
], 2 /* CLASS */))
|
|
50129
|
+
: createCommentVNode("v-if", true),
|
|
49469
50130
|
createVNode(unref(YhButton), {
|
|
49470
50131
|
text: "",
|
|
49471
50132
|
circle: "",
|
|
@@ -49507,107 +50168,191 @@ return (_ctx, _cache) => {
|
|
|
49507
50168
|
createElementVNode("div", {
|
|
49508
50169
|
class: normalizeClass(unref(ns).e('content'))
|
|
49509
50170
|
}, [
|
|
49510
|
-
(
|
|
50171
|
+
(activeMode.value === 'preview' || activeMode.value === 'inline')
|
|
49511
50172
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
49512
|
-
(
|
|
49513
|
-
|
|
50173
|
+
createCommentVNode(" Check if a slot with the name of the type is defined, allowing custom preview rendering "),
|
|
50174
|
+
(_ctx.data?.type && unref(slots)[_ctx.data.type])
|
|
50175
|
+
? renderSlot(_ctx.$slots, _ctx.data.type, {
|
|
49514
50176
|
key: 0,
|
|
49515
|
-
|
|
49516
|
-
|
|
49517
|
-
|
|
49518
|
-
|
|
49519
|
-
|
|
49520
|
-
|
|
49521
|
-
withDirectives(createElementVNode("div", {
|
|
49522
|
-
class: normalizeClass(unref(ns).e('echarts-wrapper')),
|
|
49523
|
-
style: normalizeStyle([chartContainerStyle.value, {"position":"relative"}])
|
|
49524
|
-
}, [
|
|
49525
|
-
createElementVNode("div", {
|
|
49526
|
-
ref_key: "echartsRef",
|
|
49527
|
-
ref: echartsRef,
|
|
49528
|
-
class: normalizeClass(unref(ns).e('echarts-container')),
|
|
49529
|
-
style: {"width":"100%","height":"100%"}
|
|
49530
|
-
}, null, 2 /* CLASS */),
|
|
49531
|
-
(echartsLoading.value)
|
|
49532
|
-
? (openBlock(), createBlock(unref(YhSpin), {
|
|
49533
|
-
key: 0,
|
|
49534
|
-
class: normalizeClass(unref(ns).e('chart-loading')),
|
|
49535
|
-
style: {"position":"absolute","top":"50%","left":"50%","transform":"translate(-50%, -50%)"}
|
|
49536
|
-
}, {
|
|
49537
|
-
default: withCtx(() => [
|
|
49538
|
-
createElementVNode("span", null, toDisplayString(_ctx.chartLoadingText ?? unref(t)("ai.artifacts.renderingChart")), 1 /* TEXT */)
|
|
49539
|
-
]),
|
|
49540
|
-
_: 1 /* STABLE */
|
|
49541
|
-
}, 8 /* PROPS */, ["class"]))
|
|
49542
|
-
: (echartsError.value)
|
|
49543
|
-
? (openBlock(), createElementBlock("div", {
|
|
49544
|
-
key: 1,
|
|
49545
|
-
class: normalizeClass(unref(ns).e('chart-error')),
|
|
49546
|
-
style: {"position":"absolute","top":"50%","left":"50%","transform":"translate(-50%, -50%)","display":"flex","flex-direction":"column","align-items":"center"}
|
|
49547
|
-
}, [
|
|
49548
|
-
createVNode(unref(YhIcon), { name: "warning" }),
|
|
49549
|
-
createElementVNode("span", null, toDisplayString(unref(t)("ai.artifacts.chartLoadError") === "ai.artifacts.chartLoadError" ? unref(t)("common.close") === "\u5173\u95ED" ? "\u56FE\u8868\u52A0\u8F7D\u5931\u8D25" : "Chart loading failed" : unref(t)("ai.artifacts.chartLoadError")) + ": " + toDisplayString(echartsError.value.message), 1 /* TEXT */)
|
|
49550
|
-
], 2 /* CLASS */))
|
|
49551
|
-
: createCommentVNode("v-if", true)
|
|
49552
|
-
], 6 /* CLASS, STYLE */), [
|
|
49553
|
-
[vShow, isEChartsContainer.value]
|
|
49554
|
-
]),
|
|
49555
|
-
createCommentVNode(" 其他类型 "),
|
|
49556
|
-
(_ctx.data?.type !== 'html' && _ctx.data?.type !== 'sandbox' && !isEChartsContainer.value)
|
|
49557
|
-
? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
49558
|
-
createCommentVNode(" 通用图表 "),
|
|
49559
|
-
(_ctx.data?.type === 'chart')
|
|
49560
|
-
? (openBlock(), createElementBlock("div", {
|
|
50177
|
+
data: currentVersionData.value,
|
|
50178
|
+
title: _ctx.data.title
|
|
50179
|
+
})
|
|
50180
|
+
: (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
50181
|
+
(_ctx.data?.type === 'html' || _ctx.data?.type === 'sandbox')
|
|
50182
|
+
? (openBlock(), createElementBlock("iframe", {
|
|
49561
50183
|
key: 0,
|
|
49562
|
-
|
|
49563
|
-
|
|
49564
|
-
|
|
49565
|
-
|
|
49566
|
-
|
|
49567
|
-
|
|
49568
|
-
|
|
49569
|
-
|
|
49570
|
-
|
|
49571
|
-
|
|
49572
|
-
|
|
49573
|
-
|
|
49574
|
-
|
|
49575
|
-
|
|
49576
|
-
|
|
49577
|
-
|
|
49578
|
-
|
|
49579
|
-
|
|
49580
|
-
|
|
49581
|
-
|
|
49582
|
-
|
|
49583
|
-
|
|
49584
|
-
|
|
49585
|
-
|
|
49586
|
-
|
|
49587
|
-
|
|
49588
|
-
|
|
49589
|
-
|
|
49590
|
-
|
|
49591
|
-
|
|
49592
|
-
|
|
49593
|
-
|
|
49594
|
-
createCommentVNode(" 占位 "),
|
|
49595
|
-
createElementVNode("div", {
|
|
49596
|
-
class: normalizeClass(unref(ns).e('placeholder'))
|
|
50184
|
+
src: sandboxSrcUrl.value,
|
|
50185
|
+
class: normalizeClass(unref(ns).e('sandbox')),
|
|
50186
|
+
sandbox: _ctx.data?.type === 'sandbox' ? 'allow-scripts' : ''
|
|
50187
|
+
}, null, 10 /* CLASS, PROPS */, _hoisted_2$e))
|
|
50188
|
+
: createCommentVNode("v-if", true),
|
|
50189
|
+
createCommentVNode(" ECharts 图表 (使用 v-show 保持 DOM) "),
|
|
50190
|
+
withDirectives(createElementVNode("div", {
|
|
50191
|
+
class: normalizeClass(unref(ns).e('echarts-wrapper')),
|
|
50192
|
+
style: normalizeStyle([chartContainerStyle.value, {"position":"relative"}])
|
|
50193
|
+
}, [
|
|
50194
|
+
createElementVNode("div", {
|
|
50195
|
+
ref_key: "echartsRef",
|
|
50196
|
+
ref: echartsRef,
|
|
50197
|
+
class: normalizeClass(unref(ns).e('echarts-container')),
|
|
50198
|
+
style: {"width":"100%","height":"100%"}
|
|
50199
|
+
}, null, 2 /* CLASS */),
|
|
50200
|
+
(echartsLoading.value)
|
|
50201
|
+
? (openBlock(), createBlock(unref(YhSpin), {
|
|
50202
|
+
key: 0,
|
|
50203
|
+
class: normalizeClass(unref(ns).e('chart-loading')),
|
|
50204
|
+
style: {"position":"absolute","top":"50%","left":"50%","transform":"translate(-50%, -50%)"}
|
|
50205
|
+
}, {
|
|
50206
|
+
default: withCtx(() => [
|
|
50207
|
+
createElementVNode("span", null, toDisplayString(_ctx.chartLoadingText ?? unref(t)("ai.artifacts.renderingChart")), 1 /* TEXT */)
|
|
50208
|
+
]),
|
|
50209
|
+
_: 1 /* STABLE */
|
|
50210
|
+
}, 8 /* PROPS */, ["class"]))
|
|
50211
|
+
: (echartsError.value)
|
|
50212
|
+
? (openBlock(), createElementBlock("div", {
|
|
50213
|
+
key: 1,
|
|
50214
|
+
class: normalizeClass(unref(ns).e('chart-error')),
|
|
50215
|
+
style: {"position":"absolute","top":"50%","left":"50%","transform":"translate(-50%, -50%)","display":"flex","flex-direction":"column","align-items":"center"}
|
|
49597
50216
|
}, [
|
|
49598
|
-
createVNode(unref(YhIcon), { name: "
|
|
49599
|
-
createElementVNode("
|
|
49600
|
-
], 2 /* CLASS */)
|
|
49601
|
-
|
|
50217
|
+
createVNode(unref(YhIcon), { name: "warning" }),
|
|
50218
|
+
createElementVNode("span", null, toDisplayString(unref(t)("ai.artifacts.chartLoadError") === "ai.artifacts.chartLoadError" ? unref(t)("common.close") === "\u5173\u95ED" ? "\u56FE\u8868\u52A0\u8F7D\u5931\u8D25" : "Chart loading failed" : unref(t)("ai.artifacts.chartLoadError")) + ": " + toDisplayString(echartsError.value.message), 1 /* TEXT */)
|
|
50219
|
+
], 2 /* CLASS */))
|
|
50220
|
+
: createCommentVNode("v-if", true)
|
|
50221
|
+
], 6 /* CLASS, STYLE */), [
|
|
50222
|
+
[vShow, isEChartsContainer.value]
|
|
50223
|
+
]),
|
|
50224
|
+
createCommentVNode(" 其他类型 "),
|
|
50225
|
+
(_ctx.data?.type !== 'html' && _ctx.data?.type !== 'sandbox' && !isEChartsContainer.value)
|
|
50226
|
+
? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
50227
|
+
createCommentVNode(" Image Preview "),
|
|
50228
|
+
(_ctx.data?.type === 'image')
|
|
50229
|
+
? (openBlock(), createElementBlock("div", {
|
|
50230
|
+
key: 0,
|
|
50231
|
+
class: normalizeClass(unref(ns).e('image-container')),
|
|
50232
|
+
style: {"width":"100%","height":"100%","display":"flex","align-items":"center","justify-content":"center","overflow":"auto","padding":"16px","box-sizing":"border-box"}
|
|
50233
|
+
}, [
|
|
50234
|
+
createElementVNode("img", {
|
|
50235
|
+
src: currentVersionData.value?.content,
|
|
50236
|
+
style: {"max-width":"100%","max-height":"100%","object-fit":"contain"}
|
|
50237
|
+
}, null, 8 /* PROPS */, _hoisted_3$b)
|
|
50238
|
+
], 2 /* CLASS */))
|
|
50239
|
+
: (_ctx.data?.type === 'video')
|
|
50240
|
+
? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
50241
|
+
createCommentVNode(" Video Preview "),
|
|
50242
|
+
createElementVNode("div", {
|
|
50243
|
+
class: normalizeClass(unref(ns).e('video-container')),
|
|
50244
|
+
style: {"width":"100%","height":"100%","display":"flex","align-items":"center","justify-content":"center","padding":"16px","box-sizing":"border-box"}
|
|
50245
|
+
}, [
|
|
50246
|
+
createElementVNode("video", {
|
|
50247
|
+
src: currentVersionData.value?.content,
|
|
50248
|
+
controls: "",
|
|
50249
|
+
style: {"max-width":"100%","max-height":"100%"}
|
|
50250
|
+
}, null, 8 /* PROPS */, _hoisted_4$8)
|
|
50251
|
+
], 2 /* CLASS */)
|
|
50252
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
50253
|
+
: (_ctx.data?.type === 'audio')
|
|
50254
|
+
? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
50255
|
+
createCommentVNode(" Audio Preview "),
|
|
50256
|
+
createElementVNode("div", {
|
|
50257
|
+
class: normalizeClass(unref(ns).e('audio-container')),
|
|
50258
|
+
style: {"width":"100%","height":"100%","display":"flex","align-items":"center","justify-content":"center","padding":"16px","box-sizing":"border-box"}
|
|
50259
|
+
}, [
|
|
50260
|
+
createElementVNode("audio", {
|
|
50261
|
+
src: currentVersionData.value?.content,
|
|
50262
|
+
controls: "",
|
|
50263
|
+
style: {"max-width":"100%"}
|
|
50264
|
+
}, null, 8 /* PROPS */, _hoisted_5$8)
|
|
50265
|
+
], 2 /* CLASS */)
|
|
50266
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
50267
|
+
: (_ctx.data?.type === 'pdf')
|
|
50268
|
+
? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
50269
|
+
createCommentVNode(" PDF Preview "),
|
|
50270
|
+
createElementVNode("iframe", {
|
|
50271
|
+
src: currentVersionData.value?.content,
|
|
50272
|
+
style: {"width":"100%","height":"100%","border":"none"}
|
|
50273
|
+
}, null, 8 /* PROPS */, _hoisted_6$8)
|
|
50274
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
50275
|
+
: (_ctx.data?.type === 'text')
|
|
50276
|
+
? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
50277
|
+
createCommentVNode(" Plain Text Preview "),
|
|
50278
|
+
createElementVNode("pre", _hoisted_7$7, toDisplayString(currentVersionData.value?.content), 1 /* TEXT */)
|
|
50279
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
50280
|
+
: (_ctx.data?.type === 'iframe')
|
|
50281
|
+
? (openBlock(), createElementBlock(Fragment, { key: 5 }, [
|
|
50282
|
+
createCommentVNode(" Generic Iframe Preview "),
|
|
50283
|
+
createElementVNode("iframe", {
|
|
50284
|
+
src: currentVersionData.value?.content,
|
|
50285
|
+
style: {"width":"100%","height":"100%","border":"none"}
|
|
50286
|
+
}, null, 8 /* PROPS */, _hoisted_8$6)
|
|
50287
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
50288
|
+
: (_ctx.data?.type === 'vue' && vueRendererSrc.value)
|
|
50289
|
+
? (openBlock(), createElementBlock(Fragment, { key: 6 }, [
|
|
50290
|
+
createCommentVNode(" Vue SFC Preview (Sandbox) "),
|
|
50291
|
+
createCommentVNode(" Uses static vue-renderer.html when injected (avoids blob: COEP issue), "),
|
|
50292
|
+
createCommentVNode(" otherwise falls back to a blob: URL for consumer apps. "),
|
|
50293
|
+
createElementVNode("iframe", {
|
|
50294
|
+
ref_key: "vueRendererIframeRef",
|
|
50295
|
+
ref: vueRendererIframeRef,
|
|
50296
|
+
src: vueRendererSrc.value,
|
|
50297
|
+
style: {"width":"100%","height":"100%","border":"none"},
|
|
50298
|
+
onLoad: onVueRendererLoad
|
|
50299
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_9$5)
|
|
50300
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
50301
|
+
: (_ctx.data?.type === 'chart')
|
|
50302
|
+
? (openBlock(), createElementBlock(Fragment, { key: 7 }, [
|
|
50303
|
+
createCommentVNode(" 通用图表 "),
|
|
50304
|
+
createElementVNode("div", {
|
|
50305
|
+
class: normalizeClass(unref(ns).e('chart-container')),
|
|
50306
|
+
style: normalizeStyle(chartContainerStyle.value)
|
|
50307
|
+
}, [
|
|
50308
|
+
renderSlot(_ctx.$slots, "chart", {
|
|
50309
|
+
data: currentVersionData.value,
|
|
50310
|
+
title: _ctx.data.title
|
|
50311
|
+
}, () => [
|
|
50312
|
+
createElementVNode("div", {
|
|
50313
|
+
class: normalizeClass(unref(ns).e('placeholder'))
|
|
50314
|
+
}, [
|
|
50315
|
+
createVNode(unref(YhIcon), { name: "chart-bar" }),
|
|
50316
|
+
createElementVNode("p", null, toDisplayString(unref(t)("ai.artifacts.renderingChart")), 1 /* TEXT */)
|
|
50317
|
+
], 2 /* CLASS */)
|
|
50318
|
+
])
|
|
50319
|
+
], 6 /* CLASS, STYLE */)
|
|
50320
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
50321
|
+
: (_ctx.data?.type === 'canvas')
|
|
50322
|
+
? (openBlock(), createElementBlock(Fragment, { key: 8 }, [
|
|
50323
|
+
createCommentVNode(" 画布 "),
|
|
50324
|
+
createElementVNode("div", {
|
|
50325
|
+
class: normalizeClass(unref(ns).e('canvas-container'))
|
|
50326
|
+
}, [
|
|
50327
|
+
renderSlot(_ctx.$slots, "canvas", { data: currentVersionData.value }, () => [
|
|
50328
|
+
createElementVNode("div", {
|
|
50329
|
+
class: normalizeClass(unref(ns).e('placeholder'))
|
|
50330
|
+
}, [
|
|
50331
|
+
createVNode(unref(YhIcon), { name: "edit" }),
|
|
50332
|
+
createElementVNode("p", null, toDisplayString(unref(t)("ai.artifacts.renderingCanvas")), 1 /* TEXT */)
|
|
50333
|
+
], 2 /* CLASS */)
|
|
50334
|
+
])
|
|
50335
|
+
], 2 /* CLASS */)
|
|
50336
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
50337
|
+
: (openBlock(), createElementBlock(Fragment, { key: 9 }, [
|
|
50338
|
+
createCommentVNode(" 占位 "),
|
|
50339
|
+
createElementVNode("div", {
|
|
50340
|
+
class: normalizeClass(unref(ns).e('placeholder'))
|
|
50341
|
+
}, [
|
|
50342
|
+
createVNode(unref(YhIcon), { name: "sparkles" }),
|
|
50343
|
+
createElementVNode("p", null, toDisplayString(unref(t)("ai.artifacts.rendering")), 1 /* TEXT */)
|
|
50344
|
+
], 2 /* CLASS */)
|
|
50345
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
50346
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
50347
|
+
: createCommentVNode("v-if", true)
|
|
49602
50348
|
], 64 /* STABLE_FRAGMENT */))
|
|
49603
|
-
: createCommentVNode("v-if", true)
|
|
49604
50349
|
], 64 /* STABLE_FRAGMENT */))
|
|
49605
50350
|
: (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
49606
50351
|
createCommentVNode(" eslint-disable-next-line vue/no-v-html "),
|
|
49607
50352
|
createElementVNode("pre", {
|
|
49608
50353
|
class: normalizeClass(unref(ns).e('code-viewer'))
|
|
49609
50354
|
}, [
|
|
49610
|
-
createElementVNode("code", { innerHTML: highlightedCode.value }, null, 8 /* PROPS */,
|
|
50355
|
+
createElementVNode("code", { innerHTML: highlightedCode.value }, null, 8 /* PROPS */, _hoisted_10$2)
|
|
49611
50356
|
], 2 /* CLASS */)
|
|
49612
50357
|
], 64 /* STABLE_FRAGMENT */))
|
|
49613
50358
|
], 2 /* CLASS */),
|
|
@@ -49616,10 +50361,10 @@ return (_ctx, _cache) => {
|
|
|
49616
50361
|
class: normalizeClass(unref(ns).e('footer'))
|
|
49617
50362
|
}, [
|
|
49618
50363
|
(currentVersionData.value?.timestamp)
|
|
49619
|
-
? (openBlock(), createElementBlock("span",
|
|
50364
|
+
? (openBlock(), createElementBlock("span", _hoisted_11$2, toDisplayString(currentVersionData.value.timestamp), 1 /* TEXT */))
|
|
49620
50365
|
: createCommentVNode("v-if", true),
|
|
49621
50366
|
(currentVersionData.value?.description)
|
|
49622
|
-
? (openBlock(), createElementBlock("span",
|
|
50367
|
+
? (openBlock(), createElementBlock("span", _hoisted_12$1, toDisplayString(currentVersionData.value.description), 1 /* TEXT */))
|
|
49623
50368
|
: createCommentVNode("v-if", true)
|
|
49624
50369
|
], 2 /* CLASS */)
|
|
49625
50370
|
], 6 /* CLASS, STYLE */))
|
|
@@ -49739,8 +50484,15 @@ const syncAmplitudes = () => {
|
|
|
49739
50484
|
const toggleRecording = () => {
|
|
49740
50485
|
if (props.recording === void 0 || props.recording === null) {
|
|
49741
50486
|
localRecording.value = !localRecording.value;
|
|
49742
|
-
if (localRecording.value)
|
|
49743
|
-
|
|
50487
|
+
if (localRecording.value) {
|
|
50488
|
+
emit("update:recording", true);
|
|
50489
|
+
emit("start");
|
|
50490
|
+
startVisualizer();
|
|
50491
|
+
} else {
|
|
50492
|
+
emit("update:recording", false);
|
|
50493
|
+
emit("stop");
|
|
50494
|
+
stopVisualizer();
|
|
50495
|
+
}
|
|
49744
50496
|
return;
|
|
49745
50497
|
}
|
|
49746
50498
|
const newStatus = !props.recording;
|
|
@@ -49755,7 +50507,11 @@ const toggleRecording = () => {
|
|
|
49755
50507
|
};
|
|
49756
50508
|
const handleCancel = (e) => {
|
|
49757
50509
|
e.stopPropagation();
|
|
50510
|
+
if (props.recording === void 0 || props.recording === null) {
|
|
50511
|
+
localRecording.value = false;
|
|
50512
|
+
}
|
|
49758
50513
|
emit("update:recording", false);
|
|
50514
|
+
emit("stop");
|
|
49759
50515
|
emit("cancel");
|
|
49760
50516
|
stopVisualizer();
|
|
49761
50517
|
};
|
|
@@ -49787,7 +50543,7 @@ return (_ctx, _cache) => {
|
|
|
49787
50543
|
disabled: props.variant === 'inline' || !props.teleport
|
|
49788
50544
|
}, [
|
|
49789
50545
|
createElementVNode("div", {
|
|
49790
|
-
class: normalizeClass([unref(ns).b(), unref(ns).m(props.variant), unref(ns).m(props.position), unref(ns).is('recording',
|
|
50546
|
+
class: normalizeClass([unref(ns).b(), unref(ns).m(props.variant), unref(ns).m(props.position), unref(ns).is('recording', isCurrentlyRecording.value)]),
|
|
49791
50547
|
style: normalizeStyle([props.variant !== 'inline' ? {
|
|
49792
50548
|
position: props.teleport ? 'fixed' : 'relative',
|
|
49793
50549
|
[props.position.split('-')[0]]: props.teleport ? props.offset[0] + 'px' : 'auto',
|
|
@@ -49800,7 +50556,7 @@ return (_ctx, _cache) => {
|
|
|
49800
50556
|
createCommentVNode(" Waveform Visualizer "),
|
|
49801
50557
|
createVNode(Transition, { name: "yh-voice-expand" }, {
|
|
49802
50558
|
default: withCtx(() => [
|
|
49803
|
-
(
|
|
50559
|
+
(isCurrentlyRecording.value)
|
|
49804
50560
|
? (openBlock(), createElementBlock("div", {
|
|
49805
50561
|
key: 0,
|
|
49806
50562
|
class: normalizeClass(unref(ns).e('visualizer'))
|
|
@@ -49860,24 +50616,24 @@ return (_ctx, _cache) => {
|
|
|
49860
50616
|
createCommentVNode(" Main Trigger Button "),
|
|
49861
50617
|
createElementVNode("button", {
|
|
49862
50618
|
class: normalizeClass([unref(ns).e('trigger'), {
|
|
49863
|
-
'is-active':
|
|
50619
|
+
'is-active': isCurrentlyRecording.value
|
|
49864
50620
|
}]),
|
|
49865
50621
|
onClick: toggleRecording
|
|
49866
50622
|
}, [
|
|
49867
50623
|
createElementVNode("span", {
|
|
49868
50624
|
class: normalizeClass(unref(ns).e('mic'))
|
|
49869
50625
|
}, [
|
|
49870
|
-
(props.variant === 'sphere' &&
|
|
50626
|
+
(props.variant === 'sphere' && isCurrentlyRecording.value)
|
|
49871
50627
|
? (openBlock(), createElementBlock("div", {
|
|
49872
50628
|
key: 0,
|
|
49873
50629
|
class: normalizeClass(unref(ns).e('sphere-inner'))
|
|
49874
50630
|
}, null, 2 /* CLASS */))
|
|
49875
50631
|
: (openBlock(), createBlock(unref(YhIcon), {
|
|
49876
50632
|
key: 1,
|
|
49877
|
-
name:
|
|
50633
|
+
name: isCurrentlyRecording.value ? 'video-pause' : 'microphone'
|
|
49878
50634
|
}, null, 8 /* PROPS */, ["name"]))
|
|
49879
50635
|
], 2 /* CLASS */),
|
|
49880
|
-
(!
|
|
50636
|
+
(!isCurrentlyRecording.value && props.variant === 'inline')
|
|
49881
50637
|
? (openBlock(), createElementBlock("span", {
|
|
49882
50638
|
key: 0,
|
|
49883
50639
|
class: normalizeClass(unref(ns).e('label'))
|
|
@@ -50033,7 +50789,8 @@ const {
|
|
|
50033
50789
|
totalHeight,
|
|
50034
50790
|
offsetY,
|
|
50035
50791
|
onScroll: handleVirtualScroll,
|
|
50036
|
-
scrollToIndex
|
|
50792
|
+
scrollToIndex,
|
|
50793
|
+
containerRef
|
|
50037
50794
|
} = useVirtualScroll$1({
|
|
50038
50795
|
itemHeight: computed(() => props.virtualScrollItemHeight),
|
|
50039
50796
|
containerHeight: computed(() => props.virtualScrollHeight),
|
|
@@ -50179,7 +50936,8 @@ return (_ctx, _cache) => {
|
|
|
50179
50936
|
: (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
50180
50937
|
createCommentVNode(" Conversation List with groups "),
|
|
50181
50938
|
createElementVNode("div", {
|
|
50182
|
-
|
|
50939
|
+
ref_key: "containerRef",
|
|
50940
|
+
ref: containerRef,
|
|
50183
50941
|
class: normalizeClass([unref(ns).e('list'), unref(ns).is('virtual', _ctx.virtualScroll)]),
|
|
50184
50942
|
style: normalizeStyle(listStyle.value),
|
|
50185
50943
|
onScrollPassive: _cache[9] || (_cache[9] = $event => (_ctx.virtualScroll ? unref(handleVirtualScroll)($event) : void 0))
|
|
@@ -50696,7 +51454,7 @@ const handleClick = (item) => {
|
|
|
50696
51454
|
|
|
50697
51455
|
return (_ctx, _cache) => {
|
|
50698
51456
|
return (openBlock(), createElementBlock("div", {
|
|
50699
|
-
class: normalizeClass([unref(ns).b(), unref(ns).m(
|
|
51457
|
+
class: normalizeClass([unref(ns).b(), unref(ns).m(props.layout)]),
|
|
50700
51458
|
style: normalizeStyle(unref(themeStyle))
|
|
50701
51459
|
}, [
|
|
50702
51460
|
createCommentVNode(" Title Section "),
|
|
@@ -51276,9 +52034,9 @@ const scrollToSource = (id) => {
|
|
|
51276
52034
|
const el = sourceRefs.value[id];
|
|
51277
52035
|
if (el) {
|
|
51278
52036
|
el.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
51279
|
-
el.classList.add(ns.is("highlighted"));
|
|
52037
|
+
el.classList.add(ns.is("highlighted", true));
|
|
51280
52038
|
setTimeout(() => {
|
|
51281
|
-
el.classList.remove(ns.is("highlighted"));
|
|
52039
|
+
el.classList.remove(ns.is("highlighted", true));
|
|
51282
52040
|
highlightedSourceId.value = null;
|
|
51283
52041
|
}, 2e3);
|
|
51284
52042
|
}
|
|
@@ -51917,15 +52675,14 @@ const { visibleItems, totalHeight, offsetY, startIndex, onScroll, scrollToIndex,
|
|
|
51917
52675
|
overscan: 5
|
|
51918
52676
|
});
|
|
51919
52677
|
const scrollRef = containerRef;
|
|
51920
|
-
const scrollToBottom = () => {
|
|
52678
|
+
const scrollToBottom = async () => {
|
|
51921
52679
|
if (!props.autoScroll) return;
|
|
51922
|
-
nextTick(
|
|
51923
|
-
|
|
51924
|
-
|
|
51925
|
-
|
|
51926
|
-
|
|
51927
|
-
|
|
51928
|
-
});
|
|
52680
|
+
await nextTick();
|
|
52681
|
+
if (props.virtualScroll) {
|
|
52682
|
+
scrollToIndex(props.items.length - 1);
|
|
52683
|
+
} else if (scrollRef.value) {
|
|
52684
|
+
scrollRef.value.scrollTop = scrollRef.value.scrollHeight;
|
|
52685
|
+
}
|
|
51929
52686
|
};
|
|
51930
52687
|
watch(
|
|
51931
52688
|
() => props.items,
|
|
@@ -55153,13 +55910,33 @@ const dependenciesLinks = computed(() => {
|
|
|
55153
55910
|
});
|
|
55154
55911
|
return links;
|
|
55155
55912
|
});
|
|
55913
|
+
let activeScrollTarget = null;
|
|
55914
|
+
let scrollTimer = null;
|
|
55156
55915
|
const handleBodyScroll = (e) => {
|
|
55157
55916
|
const target = e.target;
|
|
55158
|
-
|
|
55917
|
+
if (activeScrollTarget && activeScrollTarget !== target) return;
|
|
55918
|
+
activeScrollTarget = target;
|
|
55919
|
+
if (scrollTimer) clearTimeout(scrollTimer);
|
|
55920
|
+
scrollTimer = setTimeout(() => {
|
|
55921
|
+
activeScrollTarget = null;
|
|
55922
|
+
}, 100);
|
|
55923
|
+
let scrollT = target.scrollTop;
|
|
55924
|
+
if (sidebarBodyRef.value && timelineBodyRef.value) {
|
|
55925
|
+
const maxSidebar = sidebarBodyRef.value.scrollHeight - sidebarBodyRef.value.clientHeight;
|
|
55926
|
+
const maxTimeline = timelineBodyRef.value.scrollHeight - timelineBodyRef.value.clientHeight;
|
|
55927
|
+
if (maxSidebar > 0 && maxTimeline > 0) {
|
|
55928
|
+
const maxScroll = Math.min(maxSidebar, maxTimeline);
|
|
55929
|
+
if (scrollT > maxScroll) {
|
|
55930
|
+
scrollT = maxScroll;
|
|
55931
|
+
target.scrollTop = maxScroll;
|
|
55932
|
+
}
|
|
55933
|
+
}
|
|
55934
|
+
}
|
|
55935
|
+
scrollTop.value = scrollT;
|
|
55159
55936
|
if (sidebarBodyRef.value && target === timelineBodyRef.value) {
|
|
55160
|
-
sidebarBodyRef.value.scrollTop =
|
|
55937
|
+
sidebarBodyRef.value.scrollTop = scrollT;
|
|
55161
55938
|
} else if (timelineBodyRef.value && target === sidebarBodyRef.value) {
|
|
55162
|
-
timelineBodyRef.value.scrollTop =
|
|
55939
|
+
timelineBodyRef.value.scrollTop = scrollT;
|
|
55163
55940
|
}
|
|
55164
55941
|
if (sidebarHeaderRef.value && target === sidebarBodyRef.value) {
|
|
55165
55942
|
sidebarHeaderRef.value.scrollLeft = target.scrollLeft;
|
|
@@ -55210,8 +55987,10 @@ const onDragStart = (e, task, type) => {
|
|
|
55210
55987
|
dragInitS = dayjs_default(task.startDate);
|
|
55211
55988
|
dragInitE = dayjs_default(task.endDate);
|
|
55212
55989
|
dragInitP = task.progress || 0;
|
|
55213
|
-
document
|
|
55214
|
-
|
|
55990
|
+
if (typeof document !== "undefined") {
|
|
55991
|
+
document.addEventListener("mousemove", onDragMove);
|
|
55992
|
+
document.addEventListener("mouseup", onDragEnd);
|
|
55993
|
+
}
|
|
55215
55994
|
};
|
|
55216
55995
|
const onDragMove = (e) => {
|
|
55217
55996
|
if (!activeDragTask.value) return;
|
|
@@ -55261,8 +56040,10 @@ const onDragEnd = () => {
|
|
|
55261
56040
|
emit("update:data", [...props.data]);
|
|
55262
56041
|
activeDragTask.value = null;
|
|
55263
56042
|
dragType = null;
|
|
55264
|
-
document
|
|
55265
|
-
|
|
56043
|
+
if (typeof document !== "undefined") {
|
|
56044
|
+
document.removeEventListener("mousemove", onDragMove);
|
|
56045
|
+
document.removeEventListener("mouseup", onDragEnd);
|
|
56046
|
+
}
|
|
55266
56047
|
};
|
|
55267
56048
|
const handleTaskClick = (e, task) => {
|
|
55268
56049
|
if (dragType) return;
|
|
@@ -55293,10 +56074,22 @@ onMounted(() => {
|
|
|
55293
56074
|
}
|
|
55294
56075
|
});
|
|
55295
56076
|
onBeforeUnmount(() => {
|
|
56077
|
+
if (scrollTimer) {
|
|
56078
|
+
clearTimeout(scrollTimer);
|
|
56079
|
+
scrollTimer = null;
|
|
56080
|
+
}
|
|
55296
56081
|
if (resizeObserver) {
|
|
55297
56082
|
resizeObserver.disconnect();
|
|
55298
56083
|
resizeObserver = null;
|
|
55299
56084
|
}
|
|
56085
|
+
if (typeof document !== "undefined") {
|
|
56086
|
+
document.removeEventListener("mousemove", onDragMove);
|
|
56087
|
+
document.removeEventListener("mouseup", onDragEnd);
|
|
56088
|
+
}
|
|
56089
|
+
if (activeDragTask.value) {
|
|
56090
|
+
dragType = null;
|
|
56091
|
+
activeDragTask.value = null;
|
|
56092
|
+
}
|
|
55300
56093
|
});
|
|
55301
56094
|
|
|
55302
56095
|
return (_ctx, _cache) => {
|
|
@@ -55783,7 +56576,8 @@ const { themeStyle } = useComponentTheme(
|
|
|
55783
56576
|
const { selectedValueIds, isValueSelectable, selectedSku, toggleValue } = useSKU(
|
|
55784
56577
|
props.specs,
|
|
55785
56578
|
props.skus,
|
|
55786
|
-
props.modelValue
|
|
56579
|
+
props.modelValue,
|
|
56580
|
+
props.checkStock
|
|
55787
56581
|
);
|
|
55788
56582
|
const handleValueClick = (index, spec, value) => {
|
|
55789
56583
|
emit("select", spec, value);
|
|
@@ -56432,6 +57226,19 @@ const setupObserver = () => {
|
|
|
56432
57226
|
};
|
|
56433
57227
|
onMounted(setupObserver);
|
|
56434
57228
|
onUnmounted(() => observer?.disconnect());
|
|
57229
|
+
watch(
|
|
57230
|
+
() => props.exposure,
|
|
57231
|
+
(val) => {
|
|
57232
|
+
if (val) {
|
|
57233
|
+
setupObserver();
|
|
57234
|
+
} else {
|
|
57235
|
+
if (observer) {
|
|
57236
|
+
observer.disconnect();
|
|
57237
|
+
observer = null;
|
|
57238
|
+
}
|
|
57239
|
+
}
|
|
57240
|
+
}
|
|
57241
|
+
);
|
|
56435
57242
|
const currentImage = ref(props.image);
|
|
56436
57243
|
const isHovering = ref(false);
|
|
56437
57244
|
const videoActive = ref(false);
|
|
@@ -56902,11 +57709,12 @@ const { themeStyle } = useComponentTheme(
|
|
|
56902
57709
|
computed(() => props.themeOverrides)
|
|
56903
57710
|
);
|
|
56904
57711
|
const rootStyle = computed(() => {
|
|
56905
|
-
const { width, height } = props;
|
|
57712
|
+
const { width, height, loadingColor } = props;
|
|
56906
57713
|
return {
|
|
56907
57714
|
...themeStyle.value,
|
|
56908
57715
|
width: typeof width === "number" ? `${width}px` : width,
|
|
56909
|
-
height: typeof height === "number" ? `${height}px` : height
|
|
57716
|
+
height: typeof height === "number" ? `${height}px` : height,
|
|
57717
|
+
...loadingColor ? { "--yh-magnifier-loading-color": loadingColor } : {}
|
|
56910
57718
|
};
|
|
56911
57719
|
});
|
|
56912
57720
|
const currentIndex = ref(props.modelValue);
|
|
@@ -56999,6 +57807,7 @@ const handleMouseEnter = () => {
|
|
|
56999
57807
|
};
|
|
57000
57808
|
const handleMouseLeave = () => {
|
|
57001
57809
|
visible.value = false;
|
|
57810
|
+
currentScale.value = props.scale;
|
|
57002
57811
|
emit("leave");
|
|
57003
57812
|
emit("zoom-end");
|
|
57004
57813
|
};
|
|
@@ -57030,17 +57839,32 @@ const handleWheel = (e) => {
|
|
|
57030
57839
|
) / 10;
|
|
57031
57840
|
emit("scale-change", currentScale.value);
|
|
57032
57841
|
};
|
|
57842
|
+
let wheelListener = null;
|
|
57033
57843
|
const addWheelListener = () => {
|
|
57034
|
-
containerRef.value
|
|
57844
|
+
if (!props.wheelZoom || !containerRef.value) return;
|
|
57845
|
+
removeWheelListener();
|
|
57846
|
+
wheelListener = (e) => {
|
|
57847
|
+
handleWheel(e);
|
|
57848
|
+
};
|
|
57849
|
+
containerRef.value.addEventListener("wheel", wheelListener, { passive: false });
|
|
57035
57850
|
};
|
|
57036
57851
|
const removeWheelListener = () => {
|
|
57037
|
-
containerRef.value
|
|
57038
|
-
|
|
57039
|
-
|
|
57040
|
-
if (el) {
|
|
57041
|
-
nextTick(addWheelListener);
|
|
57852
|
+
if (wheelListener && containerRef.value) {
|
|
57853
|
+
containerRef.value.removeEventListener("wheel", wheelListener);
|
|
57854
|
+
wheelListener = null;
|
|
57042
57855
|
}
|
|
57043
|
-
}
|
|
57856
|
+
};
|
|
57857
|
+
watch(
|
|
57858
|
+
[containerRef, () => props.wheelZoom],
|
|
57859
|
+
([el, wz]) => {
|
|
57860
|
+
if (el && wz) {
|
|
57861
|
+
nextTick(addWheelListener);
|
|
57862
|
+
} else {
|
|
57863
|
+
removeWheelListener();
|
|
57864
|
+
}
|
|
57865
|
+
},
|
|
57866
|
+
{ immediate: true }
|
|
57867
|
+
);
|
|
57044
57868
|
const previewStyle = computed(() => {
|
|
57045
57869
|
const isInside = resolvedPosition.value === "inside";
|
|
57046
57870
|
const base = {
|
|
@@ -57121,6 +57945,7 @@ const handleFullscreenKeydown = (e) => {
|
|
|
57121
57945
|
if (e.key === "Escape") closeFullscreen();
|
|
57122
57946
|
};
|
|
57123
57947
|
watch(fullscreenVisible, (val) => {
|
|
57948
|
+
if (typeof document === "undefined") return;
|
|
57124
57949
|
if (val) {
|
|
57125
57950
|
document.addEventListener("keydown", handleFullscreenKeydown);
|
|
57126
57951
|
document.documentElement.style.overflow = "hidden";
|
|
@@ -57133,9 +57958,11 @@ watch(fullscreenVisible, (val) => {
|
|
|
57133
57958
|
});
|
|
57134
57959
|
onUnmounted(() => {
|
|
57135
57960
|
removeWheelListener();
|
|
57136
|
-
document
|
|
57137
|
-
|
|
57138
|
-
|
|
57961
|
+
if (typeof document !== "undefined") {
|
|
57962
|
+
document.removeEventListener("keydown", handleFullscreenKeydown);
|
|
57963
|
+
document.documentElement.style.overflow = "";
|
|
57964
|
+
document.body.style.overflow = "";
|
|
57965
|
+
}
|
|
57139
57966
|
});
|
|
57140
57967
|
__expose({ visible, currentScale, currentIndex, switchImage });
|
|
57141
57968
|
|
|
@@ -58616,7 +59443,8 @@ const { themeStyle } = useComponentTheme(
|
|
|
58616
59443
|
const { t } = useLocale();
|
|
58617
59444
|
const displayPrice = computed(() => {
|
|
58618
59445
|
const raw = props.centUnit ? props.price / 100 : props.price;
|
|
58619
|
-
|
|
59446
|
+
const len = Math.max(0, Math.min(20, Number(props.decimalLength) || 0));
|
|
59447
|
+
return raw.toFixed(len);
|
|
58620
59448
|
});
|
|
58621
59449
|
const priceLabel = computed(() => props.label || t("submitbar.total"));
|
|
58622
59450
|
const selectedText = computed(() => {
|
|
@@ -58702,11 +59530,11 @@ return (_ctx, _cache) => {
|
|
|
58702
59530
|
createElementVNode("span", {
|
|
58703
59531
|
class: normalizeClass(unref(ns).e('price-int'))
|
|
58704
59532
|
}, toDisplayString(displayPrice.value.split(".")[0]), 3 /* TEXT, CLASS */),
|
|
58705
|
-
(_ctx.decimalLength > 0)
|
|
59533
|
+
(Number(_ctx.decimalLength) > 0)
|
|
58706
59534
|
? (openBlock(), createElementBlock("span", {
|
|
58707
59535
|
key: 0,
|
|
58708
59536
|
class: normalizeClass(unref(ns).e('price-dec'))
|
|
58709
|
-
}, "." + toDisplayString(displayPrice.value.split(".")[1]), 3 /* TEXT, CLASS */))
|
|
59537
|
+
}, "." + toDisplayString(displayPrice.value.split(".")[1] || ""), 3 /* TEXT, CLASS */))
|
|
58710
59538
|
: createCommentVNode("v-if", true)
|
|
58711
59539
|
], 2 /* CLASS */)
|
|
58712
59540
|
])
|