@yh-ui/yh-ui 1.0.62 → 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/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.62";
5
+ const version$1 = "1.0.63";
6
6
  const packageJson = {
7
7
  version: version$1};
8
8
 
@@ -546,12 +546,12 @@ const useZIndex = (zIndexOverrides) => {
546
546
  };
547
547
  };
548
548
 
549
- function useSKU(specs, skus, initialSelection = []) {
549
+ function useSKU(specs, skus, initialSelection = [], checkStock = true) {
550
550
  const selectedValueIds = ref(initialSelection);
551
551
  const pathDict = computed(() => {
552
552
  const dict = {};
553
553
  skus.forEach((sku) => {
554
- if (sku.stock <= 0) return;
554
+ if (checkStock && sku.stock <= 0) return;
555
555
  const powerSet = getPowerSet(sku.specValueIds);
556
556
  powerSet.forEach((path) => {
557
557
  const key = path.join(",");
@@ -569,7 +569,7 @@ function useSKU(specs, skus, initialSelection = []) {
569
569
  }
570
570
  const query = tempSelected.filter((v) => !!v).sort((a, b) => String(a).localeCompare(String(b))).join(",");
571
571
  if (!query) return true;
572
- return !!pathDict.value[query];
572
+ return query in pathDict.value;
573
573
  };
574
574
  const toggleValue = (specIndex, valueId) => {
575
575
  if (selectedValueIds.value[specIndex] === valueId) {
@@ -6172,7 +6172,7 @@ function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
6172
6172
  }
6173
6173
 
6174
6174
  const _hoisted_1$1m = ["value", "placeholder", "disabled", "readonly", "maxlength", "minlength", "rows", "name", "id", "tabindex", "autocomplete", "autofocus", "aria-label", "inputmode"];
6175
- const _hoisted_2$X = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "minlength", "name", "id", "tabindex", "list", "autocomplete", "autofocus", "aria-label", "inputmode", "aria-invalid", "aria-describedby"];
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"];
6176
6176
  const _hoisted_3$K = {
6177
6177
  key: 0,
6178
6178
  viewBox: "0 0 24 24",
@@ -6607,7 +6607,7 @@ return (_ctx, _cache) => {
6607
6607
  onCompositionstart: handleCompositionStart,
6608
6608
  onCompositionupdate: handleCompositionUpdate,
6609
6609
  onCompositionend: handleCompositionEnd
6610
- }, null, 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2$X)
6610
+ }, null, 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2$Y)
6611
6611
  ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */)),
6612
6612
  createCommentVNode(" 后置图标/文本/内容 "),
6613
6613
  (hasSuffix.value)
@@ -7988,7 +7988,7 @@ const controlsPositions = ["", "right"];
7988
7988
  const YhInputNumber = withInstall(_sfc_main$26);
7989
7989
 
7990
7990
  const _hoisted_1$1g = ["draggable", "onDragstart", "onDragover", "onDrop"];
7991
- const _hoisted_2$W = ["onClick"];
7991
+ const _hoisted_2$X = ["onClick"];
7992
7992
  const _hoisted_3$J = ["value", "placeholder", "disabled", "readonly"];
7993
7993
 
7994
7994
  const _sfc_main$25 = /*@__PURE__*/Object.assign({
@@ -8327,7 +8327,7 @@ return (_ctx, _cache) => {
8327
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"
8328
8328
  })
8329
8329
  ], -1 /* CACHED */)
8330
- ]))], 10 /* CLASS, PROPS */, _hoisted_2$W))
8330
+ ]))], 10 /* CLASS, PROPS */, _hoisted_2$X))
8331
8331
  : createCommentVNode("v-if", true)
8332
8332
  ], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_1$1g)
8333
8333
  ])
@@ -9422,7 +9422,7 @@ const formItemProps = {
9422
9422
  };
9423
9423
 
9424
9424
  const _hoisted_1$1e = ["data-prop"];
9425
- const _hoisted_2$V = {
9425
+ const _hoisted_2$W = {
9426
9426
  key: 0,
9427
9427
  viewBox: "0 0 1024 1024",
9428
9428
  width: "16",
@@ -9610,7 +9610,7 @@ return (_ctx, _cache) => {
9610
9610
  class: normalizeClass([unref(ns).e('status-icon'), unref(ns).is(currentValidateStatus.value)])
9611
9611
  }, [
9612
9612
  (currentValidateStatus.value === 'success')
9613
- ? (openBlock(), createElementBlock("svg", _hoisted_2$V, [...(_cache[0] || (_cache[0] = [
9613
+ ? (openBlock(), createElementBlock("svg", _hoisted_2$W, [...(_cache[0] || (_cache[0] = [
9614
9614
  createElementVNode("path", {
9615
9615
  fill: "currentColor",
9616
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"
@@ -9682,15 +9682,15 @@ const formSchemaProps = {
9682
9682
  };
9683
9683
 
9684
9684
  const _hoisted_1$1d = { class: "yh-form--grid" };
9685
- const _hoisted_2$U = {
9685
+ const _hoisted_2$V = {
9686
9686
  key: 0,
9687
9687
  class: "yh-form-col yh-form-col--24"
9688
9688
  };
9689
9689
  const _hoisted_3$H = ["onClick"];
9690
9690
  const _hoisted_4$u = { class: "yh-form-schema__group-title-text" };
9691
9691
  const _hoisted_5$n = { class: "yh-form--grid" };
9692
- const _hoisted_6$k = ["title"];
9693
- const _hoisted_7$g = {
9692
+ const _hoisted_6$l = ["title"];
9693
+ const _hoisted_7$h = {
9694
9694
  class: "yh-form--grid",
9695
9695
  style: {"flex":"1"}
9696
9696
  };
@@ -9963,7 +9963,7 @@ return (_ctx, _cache) => {
9963
9963
  return (openBlock(), createElementBlock(Fragment, { key: index }, [
9964
9964
  createCommentVNode(" ===== 分组渲染 ===== "),
9965
9965
  (isGroup(item))
9966
- ? (openBlock(), createElementBlock("div", _hoisted_2$U, [
9966
+ ? (openBlock(), createElementBlock("div", _hoisted_2$V, [
9967
9967
  createElementVNode("fieldset", mergeProps({
9968
9968
  class: [unref(ns).e('group'), {
9969
9969
  'is-collapsed': collapsedMap[getGroupTitle(item)]
@@ -10102,7 +10102,7 @@ return (_ctx, _cache) => {
10102
10102
  key: 0,
10103
10103
  class: normalizeClass(unref(ns).e('tooltip')),
10104
10104
  title: subItem.tooltip
10105
- }, "?", 10 /* CLASS, PROPS */, _hoisted_6$k))
10105
+ }, "?", 10 /* CLASS, PROPS */, _hoisted_6$l))
10106
10106
  : createCommentVNode("v-if", true)
10107
10107
  ]),
10108
10108
  key: "0"
@@ -10168,7 +10168,7 @@ return (_ctx, _cache) => {
10168
10168
  key: rowIdx,
10169
10169
  class: normalizeClass(unref(ns).e('list-row'))
10170
10170
  }, [
10171
- createElementVNode("div", _hoisted_7$g, [
10171
+ createElementVNode("div", _hoisted_7$h, [
10172
10172
  (openBlock(true), createElementBlock(Fragment, null, renderList(item.listSchema, (sub) => {
10173
10173
  return (openBlock(), createElementBlock("div", {
10174
10174
  key: sub.field,
@@ -11014,7 +11014,7 @@ const switchEmits = {
11014
11014
  };
11015
11015
 
11016
11016
  const _hoisted_1$1b = ["aria-checked", "aria-disabled"];
11017
- const _hoisted_2$T = ["id", "name", "disabled", "checked", "tabindex", "aria-label"];
11017
+ const _hoisted_2$U = ["id", "name", "disabled", "checked", "tabindex", "aria-label"];
11018
11018
  const _hoisted_3$G = { key: 1 };
11019
11019
  const _hoisted_4$t = { key: 1 };
11020
11020
 
@@ -11128,7 +11128,7 @@ return (_ctx, _cache) => {
11128
11128
  "aria-label": props.ariaLabel,
11129
11129
  onChange: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"])),
11130
11130
  onKeydown: withKeys(handleClick, ["enter"])
11131
- }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$T),
11131
+ }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$U),
11132
11132
  createCommentVNode(" 左侧标签(非内嵌模式) "),
11133
11133
  (!props.inlinePrompt && (props.inactiveIcon || props.inactiveText))
11134
11134
  ? (openBlock(), createElementBlock("span", {
@@ -11247,7 +11247,7 @@ return (_ctx, _cache) => {
11247
11247
  const YhSwitch = withInstall(_sfc_main$1Y);
11248
11248
 
11249
11249
  const _hoisted_1$1a = ["id", "value", "placeholder", "disabled", "name", "autocomplete", "autofocus", "aria-expanded", "aria-controls", "aria-activedescendant"];
11250
- const _hoisted_2$S = ["id"];
11250
+ const _hoisted_2$T = ["id"];
11251
11251
  const _hoisted_3$F = ["id", "aria-selected", "onClick", "onMouseenter"];
11252
11252
 
11253
11253
  const _sfc_main$1X = /*@__PURE__*/Object.assign({
@@ -11332,7 +11332,7 @@ const wrapperClasses = computed(() => [
11332
11332
  }
11333
11333
  ]);
11334
11334
  const updateDropdownPosition = () => {
11335
- if (!wrapperRef.value || !props.teleported) return;
11335
+ if (typeof window === "undefined" || !wrapperRef.value || !props.teleported) return;
11336
11336
  const rect = wrapperRef.value.getBoundingClientRect();
11337
11337
  const styles = window.getComputedStyle(wrapperRef.value);
11338
11338
  const primary = styles.getPropertyValue("--yh-color-primary").trim();
@@ -11379,24 +11379,28 @@ const handleScroll = () => {
11379
11379
  };
11380
11380
  const handleOutsideClick = (e) => {
11381
11381
  const target = e.target;
11382
- 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) {
11383
11383
  return;
11384
11384
  }
11385
11385
  visible.value = false;
11386
11386
  };
11387
11387
  onMounted(() => {
11388
- if (props.teleported) {
11389
- window.addEventListener("resize", handleResize);
11390
- window.addEventListener("scroll", handleScroll, true);
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);
11391
11394
  }
11392
- window.addEventListener("click", handleOutsideClick);
11393
11395
  });
11394
11396
  onBeforeUnmount(() => {
11395
- if (props.teleported) {
11396
- window.removeEventListener("resize", handleResize);
11397
- window.removeEventListener("scroll", handleScroll, true);
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);
11398
11403
  }
11399
- window.removeEventListener("click", handleOutsideClick);
11400
11404
  if (debounceTimer) {
11401
11405
  clearTimeout(debounceTimer);
11402
11406
  }
@@ -11713,6 +11717,7 @@ return (_ctx, _cache) => {
11713
11717
  ref: dropdownRef,
11714
11718
  class: normalizeClass([unref(ns).e('dropdown'), __props.popperClass]),
11715
11719
  style: normalizeStyle(__props.teleported ? dropdownStyle.value : {}),
11720
+ "data-popper-root": "",
11716
11721
  onMousedown: _cache[2] || (_cache[2] = $event => (isClickingDropdown.value = true)),
11717
11722
  onMouseup: _cache[3] || (_cache[3] = $event => (isClickingDropdown.value = false))
11718
11723
  }, [
@@ -11762,7 +11767,7 @@ return (_ctx, _cache) => {
11762
11767
  ])
11763
11768
  ], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_3$F))
11764
11769
  }), 128 /* KEYED_FRAGMENT */))
11765
- ], 10 /* CLASS, PROPS */, _hoisted_2$S)
11770
+ ], 10 /* CLASS, PROPS */, _hoisted_2$T)
11766
11771
  ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
11767
11772
  : (unref(slots).empty)
11768
11773
  ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
@@ -11958,7 +11963,7 @@ const tooltipEmits = {
11958
11963
  };
11959
11964
 
11960
11965
  const _hoisted_1$19 = ["id", "data-placement"];
11961
- const _hoisted_2$R = ["innerHTML"];
11966
+ const _hoisted_2$S = ["innerHTML"];
11962
11967
  const _hoisted_3$E = { key: 1 };
11963
11968
 
11964
11969
  const _sfc_main$1W = /*@__PURE__*/Object.assign({
@@ -12024,6 +12029,7 @@ const popperClasses = computed(() => [
12024
12029
  ]);
12025
12030
  const updatePosition = async () => {
12026
12031
  if (!triggerRef.value || !popperRef.value || typeof window === "undefined") return;
12032
+ if (props.showArrow && !arrowRef.value) return;
12027
12033
  const { x, y, placement, middlewareData } = await computePosition(
12028
12034
  triggerRef.value,
12029
12035
  popperRef.value,
@@ -12202,6 +12208,7 @@ onMounted(() => {
12202
12208
  });
12203
12209
  onUnmounted(() => {
12204
12210
  stopAutoUpdate();
12211
+ cleanup = null;
12205
12212
  if (showTimer) {
12206
12213
  clearTimeout(showTimer);
12207
12214
  showTimer = null;
@@ -12262,7 +12269,7 @@ return (_ctx, _cache) => {
12262
12269
  ? (openBlock(), createElementBlock("span", {
12263
12270
  key: 0,
12264
12271
  innerHTML: _ctx.content
12265
- }, null, 8 /* PROPS */, _hoisted_2$R))
12272
+ }, null, 8 /* PROPS */, _hoisted_2$S))
12266
12273
  : (openBlock(), createElementBlock("span", _hoisted_3$E, toDisplayString(_ctx.content), 1 /* TEXT */))
12267
12274
  ])
12268
12275
  ], 6 /* CLASS, STYLE */),
@@ -12305,11 +12312,11 @@ const YhTooltip = withInstall(_sfc_main$1W);
12305
12312
  const SelectContextKey = Symbol("SelectContextKey");
12306
12313
 
12307
12314
  const _hoisted_1$18 = ["onClick"];
12308
- const _hoisted_2$Q = ["id", "value", "placeholder", "disabled", "readonly", "aria-label", "aria-expanded", "aria-controls"];
12315
+ const _hoisted_2$R = ["id", "value", "placeholder", "disabled", "readonly", "aria-label", "aria-expanded", "aria-controls"];
12309
12316
  const _hoisted_3$D = ["id"];
12310
12317
  const _hoisted_4$s = ["aria-selected", "onClick", "onMouseenter"];
12311
12318
  const _hoisted_5$m = ["aria-selected", "onClick", "onMouseenter"];
12312
- const _hoisted_6$j = { key: 0 };
12319
+ const _hoisted_6$k = { key: 0 };
12313
12320
 
12314
12321
  const _sfc_main$1V = /*@__PURE__*/Object.assign({
12315
12322
  name: "YhSelect"
@@ -12394,7 +12401,7 @@ const onOptionDestroy = (value) => {
12394
12401
  };
12395
12402
  const dropdownStyle = ref({});
12396
12403
  const updateDropdownPosition = () => {
12397
- if (!wrapperRef.value || !props.teleported) return;
12404
+ if (typeof window === "undefined" || !wrapperRef.value || !props.teleported) return;
12398
12405
  const rect = wrapperRef.value.getBoundingClientRect();
12399
12406
  const styles = window.getComputedStyle(wrapperRef.value);
12400
12407
  const primary = styles.getPropertyValue("--yh-color-primary").trim();
@@ -12426,18 +12433,22 @@ const handleOutsideClick = (e) => {
12426
12433
  }
12427
12434
  };
12428
12435
  onMounted(() => {
12429
- if (props.teleported) {
12430
- window.addEventListener("scroll", updateDropdownPosition, true);
12431
- window.addEventListener("resize", updateDropdownPosition);
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);
12432
12442
  }
12433
- window.addEventListener("click", handleOutsideClick);
12434
12443
  });
12435
12444
  onBeforeUnmount(() => {
12436
- if (props.teleported) {
12437
- window.removeEventListener("scroll", updateDropdownPosition, true);
12438
- window.removeEventListener("resize", updateDropdownPosition);
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);
12439
12451
  }
12440
- window.removeEventListener("click", handleOutsideClick);
12441
12452
  });
12442
12453
  const allOptions = computed(() => {
12443
12454
  return [...createdOptions.value, ...slotOptions.value, ...props.options || []];
@@ -12615,12 +12626,23 @@ const toggleDropdown = () => {
12615
12626
  const handleInput = (event) => {
12616
12627
  const target = event.target;
12617
12628
  query.value = target.value;
12618
- if (props.remote && props.remoteMethod) {
12619
- props.remoteMethod(query.value);
12620
- } else if (props.filterMethod) {
12629
+ if (!(props.remote && props.remoteMethod) && props.filterMethod) {
12621
12630
  props.filterMethod(query.value);
12622
12631
  }
12623
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
+ );
12624
12646
  const handleKeydown = (event) => {
12625
12647
  switch (event.key) {
12626
12648
  case "ArrowDown":
@@ -12769,7 +12791,12 @@ provide(SelectContextKey, {
12769
12791
  __expose({
12770
12792
  focus,
12771
12793
  blur,
12772
- inputRef
12794
+ inputRef,
12795
+ triggerRemoteMethod: (val) => {
12796
+ if (props.remote && props.remoteMethod) {
12797
+ props.remoteMethod(val);
12798
+ }
12799
+ }
12773
12800
  });
12774
12801
 
12775
12802
  return (_ctx, _cache) => {
@@ -12866,7 +12893,7 @@ return (_ctx, _cache) => {
12866
12893
  onFocus: handleFocus,
12867
12894
  onBlur: handleBlur,
12868
12895
  onKeydown: handleKeydown
12869
- }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$Q),
12896
+ }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$R),
12870
12897
  createCommentVNode(" 单选显示值 "),
12871
12898
  (!__props.multiple && hasValue.value && !query.value)
12872
12899
  ? (openBlock(), createElementBlock("span", {
@@ -13070,7 +13097,7 @@ return (_ctx, _cache) => {
13070
13097
  ], 8 /* PROPS */, ["disabled"])),
13071
13098
  createCommentVNode(" 隐藏插槽,用于注册 Option "),
13072
13099
  (_ctx.$slots.default)
13073
- ? withDirectives((openBlock(), createElementBlock("div", _hoisted_6$j, [
13100
+ ? withDirectives((openBlock(), createElementBlock("div", _hoisted_6$k, [
13074
13101
  renderSlot(_ctx.$slots, "default")
13075
13102
  ], 512 /* NEED_PATCH */)), [
13076
13103
  [vShow, false]
@@ -13177,7 +13204,7 @@ const defaultCascaderConfig = {
13177
13204
  };
13178
13205
 
13179
13206
  const _hoisted_1$17 = ["onClick", "onMouseenter"];
13180
- const _hoisted_2$P = ["onClick"];
13207
+ const _hoisted_2$Q = ["onClick"];
13181
13208
  const _hoisted_3$C = {
13182
13209
  key: 0,
13183
13210
  viewBox: "0 0 1024 1024",
@@ -13372,7 +13399,7 @@ return (_ctx, _cache) => {
13372
13399
  ]))]))
13373
13400
  : createCommentVNode("v-if", true)
13374
13401
  ], 2 /* CLASS */)
13375
- ], 10 /* CLASS, PROPS */, _hoisted_2$P))
13402
+ ], 10 /* CLASS, PROPS */, _hoisted_2$Q))
13376
13403
  : createCommentVNode("v-if", true),
13377
13404
  createCommentVNode(" 标签内容 "),
13378
13405
  createElementVNode("span", {
@@ -13415,7 +13442,7 @@ return (_ctx, _cache) => {
13415
13442
  });
13416
13443
 
13417
13444
  const _hoisted_1$16 = ["onClick"];
13418
- const _hoisted_2$O = ["id", "value", "placeholder", "disabled", "readonly", "aria-expanded"];
13445
+ const _hoisted_2$P = ["id", "value", "placeholder", "disabled", "readonly", "aria-expanded"];
13419
13446
  const _hoisted_3$B = ["onClick"];
13420
13447
 
13421
13448
  const _sfc_main$1S = /*@__PURE__*/Object.assign({
@@ -13487,7 +13514,7 @@ const expandedPath = ref([]);
13487
13514
  const isClickingDropdown = ref(false);
13488
13515
  const dropdownStyle = ref({});
13489
13516
  const updateDropdownPosition = () => {
13490
- if (!wrapperRef.value || !props.teleported) return;
13517
+ if (typeof window === "undefined" || !wrapperRef.value || !props.teleported) return;
13491
13518
  const rect = wrapperRef.value.getBoundingClientRect();
13492
13519
  const styles = window.getComputedStyle(wrapperRef.value);
13493
13520
  const primary = styles.getPropertyValue("--yh-color-primary").trim();
@@ -13510,15 +13537,19 @@ watch(visible, (val) => {
13510
13537
  }
13511
13538
  });
13512
13539
  onMounted(() => {
13513
- if (props.teleported) {
13514
- window.addEventListener("scroll", updateDropdownPosition, true);
13515
- window.addEventListener("resize", updateDropdownPosition);
13540
+ if (typeof window !== "undefined") {
13541
+ if (props.teleported) {
13542
+ window.addEventListener("scroll", updateDropdownPosition, true);
13543
+ window.addEventListener("resize", updateDropdownPosition);
13544
+ }
13516
13545
  }
13517
13546
  });
13518
13547
  onBeforeUnmount(() => {
13519
- if (props.teleported) {
13520
- window.removeEventListener("scroll", updateDropdownPosition, true);
13521
- window.removeEventListener("resize", updateDropdownPosition);
13548
+ if (typeof window !== "undefined") {
13549
+ if (props.teleported) {
13550
+ window.removeEventListener("scroll", updateDropdownPosition, true);
13551
+ window.removeEventListener("resize", updateDropdownPosition);
13552
+ }
13522
13553
  }
13523
13554
  });
13524
13555
  const isMultiple = computed(() => config.value.multiple);
@@ -13938,7 +13969,7 @@ return (_ctx, _cache) => {
13938
13969
  onInput: handleInput,
13939
13970
  onFocus: handleFocus,
13940
13971
  onBlur: handleBlur
13941
- }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$O),
13972
+ }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$P),
13942
13973
  createCommentVNode(" 单选显示值 "),
13943
13974
  (!isMultiple.value && hasValue.value && !query.value)
13944
13975
  ? (openBlock(), createElementBlock("span", {
@@ -14774,7 +14805,7 @@ const generateTimeOptions = (start, end, step, format = "HH:mm", _includeEnd = f
14774
14805
  };
14775
14806
 
14776
14807
  const _hoisted_1$15 = ["id", "value", "placeholder", "disabled", "readonly", "name", "aria-expanded", "aria-controls"];
14777
- const _hoisted_2$N = {
14808
+ const _hoisted_2$O = {
14778
14809
  key: 1,
14779
14810
  viewBox: "0 0 1024 1024",
14780
14811
  width: "1em",
@@ -15160,7 +15191,7 @@ return (_ctx, _cache) => {
15160
15191
  }, [
15161
15192
  (__props.clearIcon)
15162
15193
  ? (openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon), { key: 0 }))
15163
- : (openBlock(), createElementBlock("svg", _hoisted_2$N, [...(_cache[2] || (_cache[2] = [
15194
+ : (openBlock(), createElementBlock("svg", _hoisted_2$O, [...(_cache[2] || (_cache[2] = [
15164
15195
  createElementVNode("path", {
15165
15196
  fill: "currentColor",
15166
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"
@@ -15363,7 +15394,7 @@ const getCurrentTimeState = () => {
15363
15394
  };
15364
15395
 
15365
15396
  const _hoisted_1$14 = ["onClick"];
15366
- const _hoisted_2$M = ["onClick"];
15397
+ const _hoisted_2$N = ["onClick"];
15367
15398
  const _hoisted_3$z = ["onClick"];
15368
15399
  const _hoisted_4$q = ["onClick"];
15369
15400
  const ITEM_HEIGHT = 32;
@@ -15703,7 +15734,7 @@ return (_ctx, _cache) => {
15703
15734
  key: item.value,
15704
15735
  class: normalizeClass([unref(ns).e('item'), unref(ns).is('selected', __props.modelValue.minutes === item.value), unref(ns).is('disabled', item.disabled)]),
15705
15736
  onClick: $event => (handleItemClick('minutes', item.value, item.disabled))
15706
- }, toDisplayString(formatNumber(item.value)), 11 /* TEXT, CLASS, PROPS */, _hoisted_2$M))
15737
+ }, toDisplayString(formatNumber(item.value)), 11 /* TEXT, CLASS, PROPS */, _hoisted_2$N))
15707
15738
  }), 128 /* KEYED_FRAGMENT */))
15708
15739
  ], 2 /* CLASS */)
15709
15740
  ], 34 /* CLASS, NEED_HYDRATION */))
@@ -15811,7 +15842,7 @@ return (_ctx, _cache) => {
15811
15842
  });
15812
15843
 
15813
15844
  const _hoisted_1$13 = ["id", "value", "placeholder", "disabled", "readonly", "name", "tabindex", "aria-expanded"];
15814
- const _hoisted_2$L = ["value", "placeholder", "disabled", "readonly", "tabindex"];
15845
+ const _hoisted_2$M = ["value", "placeholder", "disabled", "readonly", "tabindex"];
15815
15846
  const _hoisted_3$y = ["value", "placeholder", "disabled", "readonly", "tabindex"];
15816
15847
  const _hoisted_4$p = {
15817
15848
  key: 1,
@@ -16318,7 +16349,7 @@ return (_ctx, _cache) => {
16318
16349
  onBlur: handleBlur,
16319
16350
  onKeydown: handleKeydown,
16320
16351
  onChange: handleStartInputChange
16321
- }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$L),
16352
+ }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$M),
16322
16353
  createElementVNode("span", {
16323
16354
  class: normalizeClass(unref(ns).e('range-separator'))
16324
16355
  }, [
@@ -17813,7 +17844,7 @@ const _hoisted_1$_ = {
17813
17844
  width: "1em",
17814
17845
  height: "1em"
17815
17846
  };
17816
- const _hoisted_2$K = ["placeholder", "value"];
17847
+ const _hoisted_2$L = ["placeholder", "value"];
17817
17848
  const _hoisted_3$x = ["placeholder", "value"];
17818
17849
  const _hoisted_4$o = ["placeholder", "value"];
17819
17850
  const _hoisted_5$l = {
@@ -17822,16 +17853,18 @@ const _hoisted_5$l = {
17822
17853
  width: "1em",
17823
17854
  height: "1em"
17824
17855
  };
17825
- const _hoisted_6$i = ["onClick"];
17826
- const _hoisted_7$f = ["value"];
17827
- const _hoisted_8$c = ["value"];
17828
- const _hoisted_9$9 = ["value"];
17829
- const _hoisted_10$5 = ["value"];
17830
- const _hoisted_11$4 = ["value"];
17831
- const _hoisted_12$3 = ["value"];
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"];
17832
17863
  const _hoisted_13$3 = ["value"];
17833
17864
  const _hoisted_14$2 = ["value"];
17834
17865
  const _hoisted_15$2 = ["value"];
17866
+ const _hoisted_16$2 = ["value"];
17867
+ const _hoisted_17$2 = ["onClick"];
17835
17868
  const DROPDOWN_GAP = 8;
17836
17869
  const PANEL_OFFSET = 4;
17837
17870
  const DEFAULT_PANEL_WIDTH = 380;
@@ -17950,6 +17983,12 @@ const selectSize = computed(
17950
17983
  );
17951
17984
  const getFormat = () => {
17952
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
+ }
17953
17992
  return DEFAULT_FORMATS[props.type] || "YYYY-MM-DD";
17954
17993
  };
17955
17994
  const displayValue = computed(() => {
@@ -18118,7 +18157,8 @@ const performFinalSelect = (date) => {
18118
18157
  };
18119
18158
  const dropdownStyle = ref({});
18120
18159
  const updatePosition = async () => {
18121
- if (!wrapperRef.value || !props.teleported || props.panelOnly) return;
18160
+ if (typeof window === "undefined" || !wrapperRef.value || !props.teleported || props.panelOnly)
18161
+ return;
18122
18162
  await nextTick();
18123
18163
  const rect = wrapperRef.value.getBoundingClientRect();
18124
18164
  const viewportWidth = window.innerWidth;
@@ -18182,7 +18222,7 @@ watch(visible, (val) => {
18182
18222
  currentView.value = getInitialView(props.type);
18183
18223
  void updatePosition();
18184
18224
  syncInnerDate();
18185
- if (!props.panelOnly) {
18225
+ if (!props.panelOnly && typeof window !== "undefined") {
18186
18226
  window.addEventListener("click", handleOutsideClick, true);
18187
18227
  if (props.teleported) {
18188
18228
  window.addEventListener("scroll", updatePosition, true);
@@ -18193,7 +18233,7 @@ watch(visible, (val) => {
18193
18233
  if (!confirmed.value) {
18194
18234
  emitChange(originalValue.value);
18195
18235
  }
18196
- if (!props.panelOnly) {
18236
+ if (!props.panelOnly && typeof window !== "undefined") {
18197
18237
  window.removeEventListener("click", handleOutsideClick, true);
18198
18238
  window.removeEventListener("scroll", updatePosition, true);
18199
18239
  window.removeEventListener("resize", updatePosition);
@@ -18253,7 +18293,7 @@ const handleConfirmClick = () => {
18253
18293
  };
18254
18294
  onMounted(() => {
18255
18295
  syncInnerDate();
18256
- if (visible.value && !props.panelOnly) {
18296
+ if (visible.value && !props.panelOnly && typeof window !== "undefined") {
18257
18297
  void updatePosition();
18258
18298
  window.addEventListener("click", handleOutsideClick, true);
18259
18299
  if (props.teleported) {
@@ -18263,7 +18303,7 @@ onMounted(() => {
18263
18303
  }
18264
18304
  });
18265
18305
  onBeforeUnmount(() => {
18266
- if (!props.panelOnly) {
18306
+ if (!props.panelOnly && typeof window !== "undefined") {
18267
18307
  window.removeEventListener("click", handleOutsideClick, true);
18268
18308
  window.removeEventListener("scroll", updatePosition, true);
18269
18309
  window.removeEventListener("resize", updatePosition);
@@ -18309,7 +18349,7 @@ return (_ctx, _cache) => {
18309
18349
  readonly: "",
18310
18350
  onFocus: _cache[0] || (_cache[0] = e => emit('focus', e)),
18311
18351
  onBlur: _cache[1] || (_cache[1] = e => emit('blur', e))
18312
- }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$K))
18352
+ }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$L))
18313
18353
  : (openBlock(), createElementBlock("div", {
18314
18354
  key: 1,
18315
18355
  class: normalizeClass(unref(ns).e('range-input-wrapper'))
@@ -18372,331 +18412,363 @@ return (_ctx, _cache) => {
18372
18412
  key: 0,
18373
18413
  ref_key: "panelRef",
18374
18414
  ref: panelRef,
18375
- 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) : '']),
18376
18416
  style: normalizeStyle(!_ctx.panelOnly && props.teleported ? dropdownStyle.value : {}),
18377
18417
  onClick: _cache[24] || (_cache[24] = withModifiers(() => {}, ["stop"]))
18378
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),
18379
18433
  createElementVNode("div", {
18380
- class: normalizeClass(unref(ns).e('header'))
18434
+ class: normalizeClass(unref(ns).e('main'))
18381
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),
18382
18450
  createElementVNode("div", {
18383
- class: normalizeClass(unref(ns).e('header-group'))
18451
+ class: normalizeClass(unref(ns).e('header'))
18384
18452
  }, [
18385
- createElementVNode("button", {
18386
- class: normalizeClass([unref(ns).e('header-btns'), unref(ns).em('header-btns', 'double-left')]),
18387
- onClick: _cache[6] || (_cache[6] = $event => (moveYear(-1)))
18388
- }, " « ", 2 /* CLASS */),
18389
- (currentView.value === 'date')
18390
- ? (openBlock(), createElementBlock("button", {
18391
- key: 0,
18392
- class: normalizeClass([unref(ns).e('header-btns'), unref(ns).em('header-btns', 'left')]),
18393
- onClick: _cache[7] || (_cache[7] = $event => (moveMonth(-1)))
18394
- }, " ‹ ", 2 /* CLASS */))
18395
- : createCommentVNode("v-if", true)
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 */)
18396
18487
  ], 2 /* CLASS */),
18397
- createElementVNode("span", {
18398
- class: normalizeClass(unref(ns).e('header-label')),
18399
- onClick: handleHeaderClick
18400
- }, toDisplayString(headerLabel.value), 3 /* TEXT, CLASS */),
18401
18488
  createElementVNode("div", {
18402
- class: normalizeClass(unref(ns).e('header-group'))
18489
+ class: normalizeClass(unref(ns).e('content'))
18403
18490
  }, [
18404
18491
  (currentView.value === 'date')
18405
- ? (openBlock(), createElementBlock("button", {
18492
+ ? (openBlock(), createBlock(_sfc_main$1M, {
18406
18493
  key: 0,
18407
- class: normalizeClass([unref(ns).e('header-btns'), unref(ns).em('header-btns', 'right')]),
18408
- onClick: _cache[8] || (_cache[8] = $event => (moveMonth(1)))
18409
- }, " › ", 2 /* CLASS */))
18410
- : createCommentVNode("v-if", true),
18411
- createElementVNode("button", {
18412
- class: normalizeClass([unref(ns).e('header-btns'), unref(ns).em('header-btns', 'double-right')]),
18413
- onClick: _cache[9] || (_cache[9] = $event => (moveYear(1)))
18414
- }, " » ", 2 /* CLASS */)
18415
- ], 2 /* CLASS */)
18416
- ], 2 /* CLASS */),
18417
- createElementVNode("div", {
18418
- class: normalizeClass(unref(ns).e('content'))
18419
- }, [
18420
- (currentView.value === 'date')
18421
- ? (openBlock(), createBlock(_sfc_main$1M, {
18422
- key: 0,
18423
- date: innerDate.value,
18424
- "selected-date": parsedSelectedDate.value,
18425
- "selection-mode": _ctx.type === 'week' ? 'week' : 'date',
18426
- "range-state": parsedRangeState.value,
18427
- "disabled-date": _ctx.disabledDate,
18428
- "first-day-of-week": _ctx.firstDayOfWeek,
18429
- "cell-shape": _ctx.cellShape,
18430
- "cell-render": _ctx.cellRender,
18431
- onSelect: handleSelect,
18432
- onHover: _cache[10] || (_cache[10] = val => rangeHoverDate.value = val)
18433
- }, {
18434
- "date-cell": withCtx((slotProps) => [
18435
- renderSlot(_ctx.$slots, "date-cell", normalizeProps(guardReactiveProps(slotProps)))
18436
- ]),
18437
- _: 3 /* FORWARDED */
18438
- }, 8 /* PROPS */, ["date", "selected-date", "selection-mode", "range-state", "disabled-date", "first-day-of-week", "cell-shape", "cell-render"]))
18439
- : (currentView.value === 'month')
18440
- ? (openBlock(), createBlock(_sfc_main$1L, {
18441
- key: 1,
18442
18494
  date: innerDate.value,
18443
18495
  "selected-date": parsedSelectedDate.value,
18496
+ "selection-mode": _ctx.type === 'week' ? 'week' : 'date',
18444
18497
  "range-state": parsedRangeState.value,
18445
18498
  "disabled-date": _ctx.disabledDate,
18499
+ "first-day-of-week": _ctx.firstDayOfWeek,
18446
18500
  "cell-shape": _ctx.cellShape,
18501
+ "cell-render": _ctx.cellRender,
18447
18502
  onSelect: handleSelect,
18448
- onHover: _cache[11] || (_cache[11] = val => rangeHoverDate.value = val)
18449
- }, null, 8 /* PROPS */, ["date", "selected-date", "range-state", "disabled-date", "cell-shape"]))
18450
- : (currentView.value === 'year')
18451
- ? (openBlock(), createBlock(_sfc_main$1K, {
18452
- key: 2,
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,
18453
18513
  date: innerDate.value,
18454
18514
  "selected-date": parsedSelectedDate.value,
18455
18515
  "range-state": parsedRangeState.value,
18456
18516
  "disabled-date": _ctx.disabledDate,
18457
18517
  "cell-shape": _ctx.cellShape,
18458
18518
  onSelect: handleSelect,
18459
- onHover: _cache[12] || (_cache[12] = val => rangeHoverDate.value = val)
18519
+ onHover: _cache[11] || (_cache[11] = val => rangeHoverDate.value = val)
18460
18520
  }, null, 8 /* PROPS */, ["date", "selected-date", "range-state", "disabled-date", "cell-shape"]))
18461
- : (currentView.value === 'quarter')
18462
- ? (openBlock(), createBlock(_sfc_main$1J, {
18463
- key: 3,
18521
+ : (currentView.value === 'year')
18522
+ ? (openBlock(), createBlock(_sfc_main$1K, {
18523
+ key: 2,
18464
18524
  date: innerDate.value,
18465
18525
  "selected-date": parsedSelectedDate.value,
18466
18526
  "range-state": parsedRangeState.value,
18467
18527
  "disabled-date": _ctx.disabledDate,
18468
18528
  "cell-shape": _ctx.cellShape,
18469
18529
  onSelect: handleSelect,
18470
- onHover: _cache[13] || (_cache[13] = val => rangeHoverDate.value = val)
18530
+ onHover: _cache[12] || (_cache[12] = val => rangeHoverDate.value = val)
18471
18531
  }, null, 8 /* PROPS */, ["date", "selected-date", "range-state", "disabled-date", "cell-shape"]))
18472
- : createCommentVNode("v-if", true)
18473
- ], 2 /* CLASS */),
18474
- (_ctx.$slots.extra)
18475
- ? (openBlock(), createElementBlock("div", {
18476
- key: 0,
18477
- class: normalizeClass(unref(ns).e('extra'))
18478
- }, [
18479
- renderSlot(_ctx.$slots, "extra")
18480
- ], 2 /* CLASS */))
18481
- : createCommentVNode("v-if", true),
18482
- (_ctx.presets.length > 0)
18483
- ? (openBlock(), createElementBlock("div", {
18484
- key: 1,
18485
- class: normalizeClass(unref(ns).e('presets'))
18486
- }, [
18487
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.presets, (p) => {
18488
- return (openBlock(), createElementBlock("button", {
18489
- key: p.label,
18490
- class: normalizeClass(unref(ns).e('preset-item')),
18491
- onClick: $event => (handlePresetClick(p))
18492
- }, toDisplayString(p.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_6$i))
18493
- }), 128 /* KEYED_FRAGMENT */))
18494
- ], 2 /* CLASS */))
18495
- : createCommentVNode("v-if", true),
18496
- (shouldShowFooter.value)
18497
- ? (openBlock(), createElementBlock("div", {
18498
- key: 2,
18499
- class: normalizeClass(unref(ns).e('footer'))
18500
- }, [
18501
- renderSlot(_ctx.$slots, "footer", {}, () => [
18502
- (_ctx.type === 'datetime')
18503
- ? (openBlock(), createElementBlock("div", {
18504
- key: 0,
18505
- class: normalizeClass(unref(ns).e('footer-time'))
18506
- }, [
18507
- withDirectives(createElementVNode("select", {
18508
- "onUpdate:modelValue": _cache[14] || (_cache[14] = $event => ((timeState.value.hour) = $event)),
18509
- onChange: updateSingleTime
18510
- }, [
18511
- (openBlock(), createElementBlock(Fragment, null, renderList(24, (h) => {
18512
- return createElementVNode("option", {
18513
- key: h - 1,
18514
- value: h - 1
18515
- }, toDisplayString(String(h - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_7$f)
18516
- }), 64 /* STABLE_FRAGMENT */))
18517
- ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
18518
- [vModelSelect, timeState.value.hour]
18519
- ]),
18520
- createElementVNode("span", {
18521
- class: normalizeClass(unref(ns).e('time-separator'))
18522
- }, ":", 2 /* CLASS */),
18523
- withDirectives(createElementVNode("select", {
18524
- "onUpdate:modelValue": _cache[15] || (_cache[15] = $event => ((timeState.value.minute) = $event)),
18525
- onChange: updateSingleTime
18526
- }, [
18527
- (openBlock(), createElementBlock(Fragment, null, renderList(60, (m) => {
18528
- return createElementVNode("option", {
18529
- key: m - 1,
18530
- value: m - 1
18531
- }, toDisplayString(String(m - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_8$c)
18532
- }), 64 /* STABLE_FRAGMENT */))
18533
- ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
18534
- [vModelSelect, timeState.value.minute]
18535
- ]),
18536
- ((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
18537
- ? (openBlock(), createElementBlock("span", {
18538
- key: 0,
18539
- class: normalizeClass(unref(ns).e('time-separator'))
18540
- }, ":", 2 /* CLASS */))
18541
- : createCommentVNode("v-if", true),
18542
- ((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
18543
- ? withDirectives((openBlock(), createElementBlock("select", {
18544
- key: 1,
18545
- "onUpdate:modelValue": _cache[16] || (_cache[16] = $event => ((timeState.value.second) = $event)),
18546
- onChange: updateSingleTime
18547
- }, [
18548
- (openBlock(), createElementBlock(Fragment, null, renderList(60, (s) => {
18549
- return createElementVNode("option", {
18550
- key: s - 1,
18551
- value: s - 1
18552
- }, toDisplayString(String(s - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_9$9)
18553
- }), 64 /* STABLE_FRAGMENT */))
18554
- ], 544 /* NEED_HYDRATION, NEED_PATCH */)), [
18555
- [vModelSelect, timeState.value.second]
18556
- ])
18557
- : createCommentVNode("v-if", true)
18558
- ], 2 /* CLASS */))
18559
- : (_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')
18560
18560
  ? (openBlock(), createElementBlock("div", {
18561
- key: 1,
18562
- class: normalizeClass(unref(ns).e('footer-time-range'))
18561
+ key: 0,
18562
+ class: normalizeClass(unref(ns).e('footer-time'))
18563
18563
  }, [
18564
- createElementVNode("div", {
18565
- class: normalizeClass(unref(ns).e('footer-time'))
18564
+ withDirectives(createElementVNode("select", {
18565
+ "onUpdate:modelValue": _cache[14] || (_cache[14] = $event => ((timeState.value.hour) = $event)),
18566
+ onChange: updateSingleTime
18566
18567
  }, [
18567
- createElementVNode("span", {
18568
- class: normalizeClass(unref(ns).e('time-label'))
18569
- }, toDisplayString(unref(t)("datepicker.startTime") || "Start") + ":", 3 /* TEXT, CLASS */),
18570
- withDirectives(createElementVNode("select", {
18571
- "onUpdate:modelValue": _cache[17] || (_cache[17] = $event => ((startTimeState.value.hour) = $event)),
18572
- onChange: updateRangeStartTime
18573
- }, [
18574
- (openBlock(), createElementBlock(Fragment, null, renderList(24, (h) => {
18575
- return createElementVNode("option", {
18576
- key: h - 1,
18577
- value: h - 1
18578
- }, toDisplayString(String(h - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_10$5)
18579
- }), 64 /* STABLE_FRAGMENT */))
18580
- ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
18581
- [vModelSelect, startTimeState.value.hour]
18582
- ]),
18583
- createElementVNode("span", {
18584
- class: normalizeClass(unref(ns).e('time-separator'))
18585
- }, ":", 2 /* CLASS */),
18586
- withDirectives(createElementVNode("select", {
18587
- "onUpdate:modelValue": _cache[18] || (_cache[18] = $event => ((startTimeState.value.minute) = $event)),
18588
- onChange: updateRangeStartTime
18589
- }, [
18590
- (openBlock(), createElementBlock(Fragment, null, renderList(60, (m) => {
18591
- return createElementVNode("option", {
18592
- key: m - 1,
18593
- value: m - 1
18594
- }, toDisplayString(String(m - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_11$4)
18595
- }), 64 /* STABLE_FRAGMENT */))
18596
- ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
18597
- [vModelSelect, startTimeState.value.minute]
18598
- ]),
18599
- ((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
18600
- ? (openBlock(), createElementBlock("span", {
18601
- key: 0,
18602
- class: normalizeClass(unref(ns).e('time-separator'))
18603
- }, ":", 2 /* CLASS */))
18604
- : createCommentVNode("v-if", true),
18605
- ((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
18606
- ? withDirectives((openBlock(), createElementBlock("select", {
18607
- key: 1,
18608
- "onUpdate:modelValue": _cache[19] || (_cache[19] = $event => ((startTimeState.value.second) = $event)),
18609
- onChange: updateRangeStartTime
18610
- }, [
18611
- (openBlock(), createElementBlock(Fragment, null, renderList(60, (s) => {
18612
- return createElementVNode("option", {
18613
- key: s - 1,
18614
- value: s - 1
18615
- }, toDisplayString(String(s - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_12$3)
18616
- }), 64 /* STABLE_FRAGMENT */))
18617
- ], 544 /* NEED_HYDRATION, NEED_PATCH */)), [
18618
- [vModelSelect, startTimeState.value.second]
18619
- ])
18620
- : createCommentVNode("v-if", true)
18621
- ], 2 /* CLASS */),
18622
- createElementVNode("div", {
18623
- 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
18624
18583
  }, [
18625
- createElementVNode("span", {
18626
- class: normalizeClass(unref(ns).e('time-label'))
18627
- }, toDisplayString(unref(t)("datepicker.endTime") || "End") + ":", 3 /* TEXT, CLASS */),
18628
- withDirectives(createElementVNode("select", {
18629
- "onUpdate:modelValue": _cache[20] || (_cache[20] = $event => ((endTimeState.value.hour) = $event)),
18630
- onChange: updateRangeEndTime
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'))
18631
18623
  }, [
18632
- (openBlock(), createElementBlock(Fragment, null, renderList(24, (h) => {
18633
- return createElementVNode("option", {
18634
- key: h - 1,
18635
- value: h - 1
18636
- }, toDisplayString(String(h - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_13$3)
18637
- }), 64 /* STABLE_FRAGMENT */))
18638
- ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
18639
- [vModelSelect, endTimeState.value.hour]
18640
- ]),
18641
- createElementVNode("span", {
18642
- class: normalizeClass(unref(ns).e('time-separator'))
18643
- }, ":", 2 /* CLASS */),
18644
- withDirectives(createElementVNode("select", {
18645
- "onUpdate:modelValue": _cache[21] || (_cache[21] = $event => ((endTimeState.value.minute) = $event)),
18646
- onChange: updateRangeEndTime
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'))
18647
18681
  }, [
18648
- (openBlock(), createElementBlock(Fragment, null, renderList(60, (m) => {
18649
- return createElementVNode("option", {
18650
- key: m - 1,
18651
- value: m - 1
18652
- }, toDisplayString(String(m - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_14$2)
18653
- }), 64 /* STABLE_FRAGMENT */))
18654
- ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
18655
- [vModelSelect, endTimeState.value.minute]
18656
- ]),
18657
- ((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
18658
- ? (openBlock(), createElementBlock("span", {
18659
- key: 0,
18660
- class: normalizeClass(unref(ns).e('time-separator'))
18661
- }, ":", 2 /* CLASS */))
18662
- : createCommentVNode("v-if", true),
18663
- ((props.timeFormat || 'HH:mm:ss').toLowerCase().includes('s'))
18664
- ? withDirectives((openBlock(), createElementBlock("select", {
18665
- key: 1,
18666
- "onUpdate:modelValue": _cache[22] || (_cache[22] = $event => ((endTimeState.value.second) = $event)),
18667
- onChange: updateRangeEndTime
18668
- }, [
18669
- (openBlock(), createElementBlock(Fragment, null, renderList(60, (s) => {
18670
- return createElementVNode("option", {
18671
- key: s - 1,
18672
- value: s - 1
18673
- }, toDisplayString(String(s - 1).padStart(2, "0")), 9 /* TEXT, PROPS */, _hoisted_15$2)
18674
- }), 64 /* STABLE_FRAGMENT */))
18675
- ], 544 /* NEED_HYDRATION, NEED_PATCH */)), [
18676
- [vModelSelect, endTimeState.value.second]
18677
- ])
18678
- : createCommentVNode("v-if", true)
18679
- ], 2 /* CLASS */)
18680
- ], 2 /* CLASS */))
18681
- : createCommentVNode("v-if", true),
18682
- createElementVNode("div", {
18683
- class: normalizeClass(unref(ns).e('footer-btns'))
18684
- }, [
18685
- (isRange.value || _ctx.type.includes('datetime'))
18686
- ? (openBlock(), createElementBlock("button", {
18687
- key: 0,
18688
- class: normalizeClass(unref(ns).e('footer-btn')),
18689
- onClick: _cache[23] || (_cache[23] = $event => (!_ctx.panelOnly && (visible.value = false)))
18690
- }, toDisplayString(unref(t)("datepicker.cancel")), 3 /* TEXT, CLASS */))
18691
- : createCommentVNode("v-if", true),
18692
- createElementVNode("button", {
18693
- class: normalizeClass([unref(ns).e('footer-btn'), unref(ns).e('footer-btn--confirm')]),
18694
- onClick: handleConfirmClick
18695
- }, toDisplayString(unref(t)("datepicker.confirm")), 3 /* TEXT, CLASS */)
18696
- ], 2 /* CLASS */)
18697
- ])
18698
- ], 2 /* CLASS */))
18699
- : createCommentVNode("v-if", true)
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 */)
18700
18772
  ], 6 /* CLASS, STYLE */))
18701
18773
  : createCommentVNode("v-if", true)
18702
18774
  ]),
@@ -18715,7 +18787,7 @@ const transferSizes = ["large", "default", "small"];
18715
18787
  const transferPanelContextKey = Symbol("transferPanelContextKey");
18716
18788
 
18717
18789
  const _hoisted_1$Z = ["placeholder", "disabled"];
18718
- const _hoisted_2$J = ["onClick"];
18790
+ const _hoisted_2$K = ["onClick"];
18719
18791
  const _hoisted_3$w = ["onClick"];
18720
18792
 
18721
18793
  const _sfc_main$1H = /*@__PURE__*/Object.assign({
@@ -19052,7 +19124,7 @@ return (_ctx, _cache) => {
19052
19124
  createTextVNode(toDisplayString(getLabel(item)), 1 /* TEXT */)
19053
19125
  ])
19054
19126
  ], 2 /* CLASS */)
19055
- ], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$J))
19127
+ ], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$K))
19056
19128
  }), 128 /* KEYED_FRAGMENT */))
19057
19129
  ], 6 /* CLASS, STYLE */)
19058
19130
  ], 4 /* STYLE */)
@@ -19118,7 +19190,7 @@ return (_ctx, _cache) => {
19118
19190
  });
19119
19191
 
19120
19192
  const _hoisted_1$Y = ["disabled"];
19121
- const _hoisted_2$I = ["disabled"];
19193
+ const _hoisted_2$J = ["disabled"];
19122
19194
 
19123
19195
  const _sfc_main$1G = /*@__PURE__*/Object.assign({
19124
19196
  name: "YhTransfer"
@@ -19373,7 +19445,7 @@ return (_ctx, _cache) => {
19373
19445
  class: normalizeClass(unref(ns).e('button__text'))
19374
19446
  }, toDisplayString(__props.buttonTexts[1]), 3 /* TEXT, CLASS */))
19375
19447
  : createCommentVNode("v-if", true)
19376
- ], 10 /* CLASS, PROPS */, _hoisted_2$I)
19448
+ ], 10 /* CLASS, PROPS */, _hoisted_2$J)
19377
19449
  ])
19378
19450
  ], 2 /* CLASS */),
19379
19451
  createVNode(_sfc_main$1H, {
@@ -19816,7 +19888,7 @@ const useTree = (props, emit) => {
19816
19888
  };
19817
19889
 
19818
19890
  const _hoisted_1$X = ["onClick"];
19819
- const _hoisted_2$H = ["placeholder", "disabled", "readonly"];
19891
+ const _hoisted_2$I = ["placeholder", "disabled", "readonly"];
19820
19892
  const _hoisted_3$v = ["onClick"];
19821
19893
  const _hoisted_4$n = ["onClick"];
19822
19894
  const _hoisted_5$k = {
@@ -19825,13 +19897,13 @@ const _hoisted_5$k = {
19825
19897
  width: "1em",
19826
19898
  height: "1em"
19827
19899
  };
19828
- const _hoisted_6$h = {
19900
+ const _hoisted_6$i = {
19829
19901
  key: 0,
19830
19902
  viewBox: "0 0 1024 1024",
19831
19903
  width: "1em",
19832
19904
  height: "1em"
19833
19905
  };
19834
- const _hoisted_7$e = {
19906
+ const _hoisted_7$f = {
19835
19907
  key: 1,
19836
19908
  viewBox: "0 0 1024 1024",
19837
19909
  width: "1em",
@@ -20127,7 +20199,7 @@ return (_ctx, _cache) => {
20127
20199
  autocomplete: "off",
20128
20200
  onInput: handleInput,
20129
20201
  onFocus: handleInputFocus
20130
- }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$H), [
20202
+ }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2$I), [
20131
20203
  [vModelText, query.value]
20132
20204
  ]),
20133
20205
  createElementVNode("span", {
@@ -20259,14 +20331,14 @@ return (_ctx, _cache) => {
20259
20331
  class: normalizeClass(unref(ns).e('checkbox-inner'))
20260
20332
  }, [
20261
20333
  (node.checked && !node.indeterminate)
20262
- ? (openBlock(), createElementBlock("svg", _hoisted_6$h, [...(_cache[8] || (_cache[8] = [
20334
+ ? (openBlock(), createElementBlock("svg", _hoisted_6$i, [...(_cache[8] || (_cache[8] = [
20263
20335
  createElementVNode("path", {
20264
20336
  fill: "currentColor",
20265
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"
20266
20338
  }, null, -1 /* CACHED */)
20267
20339
  ]))]))
20268
20340
  : (node.indeterminate)
20269
- ? (openBlock(), createElementBlock("svg", _hoisted_7$e, [...(_cache[9] || (_cache[9] = [
20341
+ ? (openBlock(), createElementBlock("svg", _hoisted_7$f, [...(_cache[9] || (_cache[9] = [
20270
20342
  createElementVNode("path", {
20271
20343
  fill: "currentColor",
20272
20344
  d: "M192 448h640v128H192z"
@@ -20556,7 +20628,7 @@ const _hoisted_1$W = {
20556
20628
  viewBox: "0 0 1024 1024",
20557
20629
  xmlns: "http://www.w3.org/2000/svg"
20558
20630
  };
20559
- const _hoisted_2$G = {
20631
+ const _hoisted_2$H = {
20560
20632
  key: 1,
20561
20633
  viewBox: "0 0 1024 1024",
20562
20634
  xmlns: "http://www.w3.org/2000/svg"
@@ -20572,7 +20644,7 @@ const _hoisted_4$m = {
20572
20644
  xmlns: "http://www.w3.org/2000/svg"
20573
20645
  };
20574
20646
  const _hoisted_5$j = ["innerHTML"];
20575
- const _hoisted_6$g = ["aria-label"];
20647
+ const _hoisted_6$h = ["aria-label"];
20576
20648
 
20577
20649
  const _sfc_main$1C = /*@__PURE__*/Object.assign({
20578
20650
  name: "YhMessage"
@@ -20711,7 +20783,7 @@ return (_ctx, _cache) => {
20711
20783
  }, null, -1 /* CACHED */)
20712
20784
  ]))]))
20713
20785
  : (__props.type === 'warning')
20714
- ? (openBlock(), createElementBlock("svg", _hoisted_2$G, [...(_cache[1] || (_cache[1] = [
20786
+ ? (openBlock(), createElementBlock("svg", _hoisted_2$H, [...(_cache[1] || (_cache[1] = [
20715
20787
  createElementVNode("path", {
20716
20788
  fill: "currentColor",
20717
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"
@@ -20779,7 +20851,7 @@ return (_ctx, _cache) => {
20779
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"
20780
20852
  })
20781
20853
  ], -1 /* CACHED */)
20782
- ]))], 10 /* CLASS, PROPS */, _hoisted_6$g))
20854
+ ]))], 10 /* CLASS, PROPS */, _hoisted_6$h))
20783
20855
  : createCommentVNode("v-if", true)
20784
20856
  ], 38 /* CLASS, STYLE, NEED_HYDRATION */), [
20785
20857
  [vShow, visible.value]
@@ -20962,7 +21034,7 @@ const _hoisted_1$V = {
20962
21034
  viewBox: "0 0 1024 1024",
20963
21035
  xmlns: "http://www.w3.org/2000/svg"
20964
21036
  };
20965
- const _hoisted_2$F = {
21037
+ const _hoisted_2$G = {
20966
21038
  key: 1,
20967
21039
  viewBox: "0 0 1024 1024",
20968
21040
  xmlns: "http://www.w3.org/2000/svg"
@@ -20978,7 +21050,7 @@ const _hoisted_4$l = {
20978
21050
  xmlns: "http://www.w3.org/2000/svg"
20979
21051
  };
20980
21052
  const _hoisted_5$i = ["innerHTML"];
20981
- const _hoisted_6$f = ["aria-label"];
21053
+ const _hoisted_6$g = ["aria-label"];
20982
21054
 
20983
21055
  const _sfc_main$1B = /*@__PURE__*/Object.assign({
20984
21056
  name: "YhNotification"
@@ -21147,7 +21219,7 @@ return (_ctx, _cache) => {
21147
21219
  }, null, -1 /* CACHED */)
21148
21220
  ]))]))
21149
21221
  : (__props.type === 'warning')
21150
- ? (openBlock(), createElementBlock("svg", _hoisted_2$F, [...(_cache[1] || (_cache[1] = [
21222
+ ? (openBlock(), createElementBlock("svg", _hoisted_2$G, [...(_cache[1] || (_cache[1] = [
21151
21223
  createElementVNode("path", {
21152
21224
  fill: "currentColor",
21153
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"
@@ -21231,7 +21303,7 @@ return (_ctx, _cache) => {
21231
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"
21232
21304
  })
21233
21305
  ], -1 /* CACHED */)
21234
- ]))], 10 /* CLASS, PROPS */, _hoisted_6$f))
21306
+ ]))], 10 /* CLASS, PROPS */, _hoisted_6$g))
21235
21307
  : createCommentVNode("v-if", true)
21236
21308
  ], 38 /* CLASS, STYLE, NEED_HYDRATION */), [
21237
21309
  [vShow, visible.value]
@@ -21809,7 +21881,7 @@ const _hoisted_1$T = {
21809
21881
  height: "1em",
21810
21882
  class: "yh-color-picker__empty"
21811
21883
  };
21812
- const _hoisted_2$E = ["title"];
21884
+ const _hoisted_2$F = ["title"];
21813
21885
  const _hoisted_3$s = ["onClick"];
21814
21886
  const _hoisted_4$k = ["title"];
21815
21887
  const _hoisted_5$h = ["value"];
@@ -22028,7 +22100,7 @@ return (_ctx, _cache) => {
22028
22100
  })
22029
22101
  }, null, 6 /* CLASS, STYLE */),
22030
22102
  createTextVNode(" " + toDisplayString(contrastInfo.value.suggestion), 1 /* TEXT */)
22031
- ], 10 /* CLASS, PROPS */, _hoisted_2$E),
22103
+ ], 10 /* CLASS, PROPS */, _hoisted_2$F),
22032
22104
  createElementVNode("div", {
22033
22105
  class: normalizeClass(unref(ns).e('sliders'))
22034
22106
  }, [
@@ -22192,7 +22264,7 @@ const _hoisted_1$S = {
22192
22264
  key: 0,
22193
22265
  style: {"width":"0","height":"0","position":"absolute","visibility":"hidden","pointer-events":"none"}
22194
22266
  };
22195
- const _hoisted_2$D = ["id"];
22267
+ const _hoisted_2$E = ["id"];
22196
22268
  const _hoisted_3$r = ["offset", "stop-color"];
22197
22269
 
22198
22270
  const _sfc_main$1w = /*@__PURE__*/Object.assign({
@@ -22334,7 +22406,7 @@ return (_ctx, _cache) => {
22334
22406
  "stop-color": stop.color
22335
22407
  }, null, 8 /* PROPS */, _hoisted_3$r))
22336
22408
  }), 128 /* KEYED_FRAGMENT */))
22337
- ], 8 /* PROPS */, _hoisted_2$D)
22409
+ ], 8 /* PROPS */, _hoisted_2$E)
22338
22410
  ])
22339
22411
  ]))
22340
22412
  : createCommentVNode("v-if", true),
@@ -23853,7 +23925,7 @@ const _hoisted_1$O = {
23853
23925
  width: "20",
23854
23926
  height: "20"
23855
23927
  };
23856
- const _hoisted_2$C = {
23928
+ const _hoisted_2$D = {
23857
23929
  key: 0,
23858
23930
  fill: "currentColor",
23859
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"
@@ -23873,9 +23945,9 @@ const _hoisted_5$g = {
23873
23945
  fill: "currentColor",
23874
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"
23875
23947
  };
23876
- const _hoisted_6$e = ["aria-label"];
23877
- const _hoisted_7$d = { key: 0 };
23878
- const _hoisted_8$b = {
23948
+ const _hoisted_6$f = ["aria-label"];
23949
+ const _hoisted_7$e = { key: 0 };
23950
+ const _hoisted_8$c = {
23879
23951
  key: 2,
23880
23952
  viewBox: "0 0 1024 1024",
23881
23953
  width: "16",
@@ -24007,7 +24079,7 @@ return (_ctx, _cache) => {
24007
24079
  createCommentVNode(" 默认类型图标 (这里可以预置几个 SVG) "),
24008
24080
  (openBlock(), createElementBlock("svg", _hoisted_1$O, [
24009
24081
  (_ctx.type === 'success')
24010
- ? (openBlock(), createElementBlock("path", _hoisted_2$C))
24082
+ ? (openBlock(), createElementBlock("path", _hoisted_2$D))
24011
24083
  : createCommentVNode("v-if", true),
24012
24084
  (_ctx.type === 'info')
24013
24085
  ? (openBlock(), createElementBlock("path", _hoisted_3$q))
@@ -24086,20 +24158,20 @@ return (_ctx, _cache) => {
24086
24158
  }, [
24087
24159
  renderSlot(_ctx.$slots, "close", {}, () => [
24088
24160
  (_ctx.closeText)
24089
- ? (openBlock(), createElementBlock("span", _hoisted_7$d, toDisplayString(_ctx.closeText), 1 /* TEXT */))
24161
+ ? (openBlock(), createElementBlock("span", _hoisted_7$e, toDisplayString(_ctx.closeText), 1 /* TEXT */))
24090
24162
  : (_ctx.closeIcon)
24091
24163
  ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon), {
24092
24164
  key: 1,
24093
24165
  style: {"width":"16px","height":"16px"}
24094
24166
  }))
24095
- : (openBlock(), createElementBlock("svg", _hoisted_8$b, [...(_cache[0] || (_cache[0] = [
24167
+ : (openBlock(), createElementBlock("svg", _hoisted_8$c, [...(_cache[0] || (_cache[0] = [
24096
24168
  createElementVNode("path", {
24097
24169
  fill: "currentColor",
24098
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"
24099
24171
  }, null, -1 /* CACHED */)
24100
24172
  ]))]))
24101
24173
  ])
24102
- ], 10 /* CLASS, PROPS */, _hoisted_6$e))
24174
+ ], 10 /* CLASS, PROPS */, _hoisted_6$f))
24103
24175
  : createCommentVNode("v-if", true),
24104
24176
  createCommentVNode(" 倒计时进度条 "),
24105
24177
  (_ctx.showProgress && _ctx.duration > 0)
@@ -24531,15 +24603,15 @@ const progressProps = {
24531
24603
  };
24532
24604
 
24533
24605
  const _hoisted_1$M = ["aria-valuenow"];
24534
- const _hoisted_2$B = ["innerHTML"];
24606
+ const _hoisted_2$C = ["innerHTML"];
24535
24607
  const _hoisted_3$p = ["viewBox"];
24536
24608
  const _hoisted_4$i = { key: 0 };
24537
24609
  const _hoisted_5$f = ["id"];
24538
- const _hoisted_6$d = ["offset", "stop-color"];
24539
- const _hoisted_7$c = ["d", "stroke", "stroke-width", "stroke-linecap"];
24540
- const _hoisted_8$a = ["d", "stroke", "stroke-linecap", "stroke-width"];
24541
- const _hoisted_9$8 = ["width", "height", "innerHTML"];
24542
- const _hoisted_10$4 = ["innerHTML"];
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"];
24543
24615
 
24544
24616
  const _sfc_main$1o = /*@__PURE__*/Object.assign({
24545
24617
  name: "YhProgress"
@@ -24712,7 +24784,7 @@ return (_ctx, _cache) => {
24712
24784
  height: "16",
24713
24785
  style: {"vertical-align":"middle"},
24714
24786
  innerHTML: statusIconSvg.value
24715
- }, null, 8 /* PROPS */, _hoisted_2$B))
24787
+ }, null, 8 /* PROPS */, _hoisted_2$C))
24716
24788
  ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
24717
24789
  : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
24718
24790
  createCommentVNode(" eslint-enable vue/no-v-html "),
@@ -24768,7 +24840,7 @@ return (_ctx, _cache) => {
24768
24840
  key: i,
24769
24841
  offset: stop.offset,
24770
24842
  "stop-color": stop.color
24771
- }, null, 8 /* PROPS */, _hoisted_6$d))
24843
+ }, null, 8 /* PROPS */, _hoisted_6$e))
24772
24844
  }), 128 /* KEYED_FRAGMENT */))
24773
24845
  ], 8 /* PROPS */, _hoisted_5$f)
24774
24846
  ]))
@@ -24784,7 +24856,7 @@ return (_ctx, _cache) => {
24784
24856
  fill: "none",
24785
24857
  "stroke-linecap": _ctx.strokeLinecap,
24786
24858
  style: normalizeStyle(getCircleParams(index).trackStyle)
24787
- }, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_7$c),
24859
+ }, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_7$d),
24788
24860
  createElementVNode("path", {
24789
24861
  class: normalizeClass(unref(ns).e('circle-path')),
24790
24862
  d: getCircleParams(index).path,
@@ -24793,7 +24865,7 @@ return (_ctx, _cache) => {
24793
24865
  "stroke-linecap": _ctx.strokeLinecap,
24794
24866
  "stroke-width": p > 0 ? _ctx.strokeWidth : 0,
24795
24867
  style: normalizeStyle(getCircleParams(index).pathStyle)
24796
- }, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_8$a)
24868
+ }, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_8$b)
24797
24869
  ]))
24798
24870
  }), 128 /* KEYED_FRAGMENT */))
24799
24871
  ], 10 /* CLASS, PROPS */, _hoisted_3$p)),
@@ -24829,7 +24901,7 @@ return (_ctx, _cache) => {
24829
24901
  verticalAlign: 'middle'
24830
24902
  }),
24831
24903
  innerHTML: statusIconSvg.value
24832
- }, null, 12 /* STYLE, PROPS */, _hoisted_9$8))
24904
+ }, null, 12 /* STYLE, PROPS */, _hoisted_9$9))
24833
24905
  ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
24834
24906
  : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
24835
24907
  createCommentVNode(" eslint-enable vue/no-v-html "),
@@ -24872,7 +24944,7 @@ return (_ctx, _cache) => {
24872
24944
  verticalAlign: 'middle'
24873
24945
  }),
24874
24946
  innerHTML: statusIconSvg.value
24875
- }, null, 12 /* STYLE, PROPS */, _hoisted_10$4))
24947
+ }, null, 12 /* STYLE, PROPS */, _hoisted_10$5))
24876
24948
  ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
24877
24949
  : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
24878
24950
  createCommentVNode(" eslint-enable vue/no-v-html "),
@@ -25376,6 +25448,10 @@ const internalVisible = ref(false);
25376
25448
  const visible = computed({
25377
25449
  get: () => props.visible !== null ? props.visible : internalVisible.value,
25378
25450
  set: (val) => {
25451
+ if (props.visible !== null) {
25452
+ emit("update:visible", val);
25453
+ return;
25454
+ }
25379
25455
  internalVisible.value = val;
25380
25456
  emit("update:visible", val);
25381
25457
  }
@@ -25746,7 +25822,7 @@ const dialogEmits = {
25746
25822
  };
25747
25823
 
25748
25824
  const _hoisted_1$L = ["aria-labelledby"];
25749
- const _hoisted_2$A = ["id"];
25825
+ const _hoisted_2$B = ["id"];
25750
25826
 
25751
25827
  const _sfc_main$1l = /*@__PURE__*/Object.assign({
25752
25828
  name: "YhDialog",
@@ -25767,14 +25843,25 @@ const lastClickPos = ref(null);
25767
25843
  const handleDocumentClick = (e) => {
25768
25844
  lastClickPos.value = { x: e.clientX, y: e.clientY };
25769
25845
  };
25770
- onMounted(() => {
25771
- if (typeof window !== "undefined") {
25772
- document.addEventListener("click", handleDocumentClick, true);
25773
- }
25774
- });
25846
+ useEventListener(
25847
+ () => typeof document !== "undefined" ? document : null,
25848
+ "pointerdown",
25849
+ (e) => handleDocumentClick(e),
25850
+ true
25851
+ );
25775
25852
  onBeforeUnmount(() => {
25776
- if (typeof window !== "undefined") {
25777
- document.removeEventListener("click", handleDocumentClick, true);
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();
25778
25865
  }
25779
25866
  });
25780
25867
  const { themeStyle: themeVars } = useComponentTheme(
@@ -25789,6 +25876,8 @@ const rendered = ref(false);
25789
25876
  useScrollLock(computed(() => props.modelValue && props.lockScroll));
25790
25877
  const offset = ref({ x: 0, y: 0 });
25791
25878
  const isDragging = ref(false);
25879
+ let activeMouseMoveListener = null;
25880
+ let activeMouseUpListener = null;
25792
25881
  const handleMouseDown = (e) => {
25793
25882
  if (!props.draggable || props.fullscreen) return;
25794
25883
  if (e.button !== 0) return;
@@ -25820,11 +25909,19 @@ const handleMouseDown = (e) => {
25820
25909
  const onMouseUp = (upEvent) => {
25821
25910
  isDragging.value = false;
25822
25911
  emit("dragEnd", upEvent);
25823
- document.removeEventListener("mousemove", onMouseMove);
25824
- document.removeEventListener("mouseup", onMouseUp);
25912
+ if (typeof document !== "undefined") {
25913
+ document.removeEventListener("mousemove", onMouseMove);
25914
+ document.removeEventListener("mouseup", onMouseUp);
25915
+ }
25916
+ activeMouseMoveListener = null;
25917
+ activeMouseUpListener = null;
25825
25918
  };
25826
- document.addEventListener("mousemove", onMouseMove);
25827
- document.addEventListener("mouseup", onMouseUp);
25919
+ activeMouseMoveListener = onMouseMove;
25920
+ activeMouseUpListener = onMouseUp;
25921
+ if (typeof document !== "undefined") {
25922
+ document.addEventListener("mousemove", onMouseMove);
25923
+ document.addEventListener("mouseup", onMouseUp);
25924
+ }
25828
25925
  };
25829
25926
  let prevFocusedElement = null;
25830
25927
  const trapFocus = (e) => {
@@ -25943,6 +26040,9 @@ const footerStyle = computed(() => {
25943
26040
  return styles;
25944
26041
  });
25945
26042
  const doClose = () => {
26043
+ if (typeof window !== "undefined" && prevFocusedElement) {
26044
+ prevFocusedElement.focus();
26045
+ }
25946
26046
  emit("update:modelValue", false);
25947
26047
  };
25948
26048
  const handleClose = () => {
@@ -25997,6 +26097,19 @@ watch(
25997
26097
  emit("opened");
25998
26098
  } else {
25999
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
+ }
26000
26113
  if (typeof window !== "undefined" && prevFocusedElement) {
26001
26114
  prevFocusedElement.focus();
26002
26115
  }
@@ -26083,7 +26196,7 @@ return (_ctx, _cache) => {
26083
26196
  : (_ctx.title)
26084
26197
  ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.title), { key: 2 }))
26085
26198
  : createCommentVNode("v-if", true)
26086
- ], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$A)
26199
+ ], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$B)
26087
26200
  ]),
26088
26201
  (_ctx.showClose)
26089
26202
  ? (openBlock(), createElementBlock("button", {
@@ -26865,6 +26978,7 @@ const watermarkInnerStyle = computed(() => {
26865
26978
  };
26866
26979
  });
26867
26980
  const renderWatermark = () => {
26981
+ if (typeof document === "undefined") return;
26868
26982
  const canvas = document.createElement("canvas");
26869
26983
  const ratio = typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
26870
26984
  const canvasWidth = props.width + props.gap[0];
@@ -26903,7 +27017,7 @@ const renderWatermark = () => {
26903
27017
  }
26904
27018
  };
26905
27019
  const createOrUpdateWatermark = () => {
26906
- if (!containerRef.value) return;
27020
+ if (typeof document === "undefined" || !containerRef.value) return;
26907
27021
  if (watermarkRef && watermarkRef.parentNode) {
26908
27022
  watermarkRef.parentNode.removeChild(watermarkRef);
26909
27023
  }
@@ -26986,9 +27100,18 @@ onMounted(() => {
26986
27100
  });
26987
27101
  });
26988
27102
  onBeforeUnmount(() => {
26989
- if (darkObserver) darkObserver.disconnect();
26990
- if (observer) observer.disconnect();
26991
- if (checkTimer) clearInterval(checkTimer);
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
+ }
26992
27115
  if (watermarkRef && watermarkRef.parentNode) {
26993
27116
  watermarkRef.parentNode.removeChild(watermarkRef);
26994
27117
  }
@@ -27146,13 +27269,13 @@ async function loadViewer() {
27146
27269
  }
27147
27270
 
27148
27271
  const _hoisted_1$J = ["accept", "multiple"];
27149
- const _hoisted_2$z = ["innerHTML"];
27272
+ const _hoisted_2$A = ["innerHTML"];
27150
27273
  const _hoisted_3$o = ["src", "alt", "crossorigin"];
27151
27274
  const _hoisted_4$h = ["onClick"];
27152
27275
  const _hoisted_5$e = ["onClick"];
27153
- const _hoisted_6$c = ["onClick"];
27154
- const _hoisted_7$b = ["src", "crossorigin"];
27155
- const _hoisted_8$9 = ["onClick"];
27276
+ const _hoisted_6$d = ["onClick"];
27277
+ const _hoisted_7$c = ["src", "crossorigin"];
27278
+ const _hoisted_8$a = ["onClick"];
27156
27279
 
27157
27280
  const _sfc_main$1i = /*@__PURE__*/Object.assign({
27158
27281
  name: "YhUpload"
@@ -27298,23 +27421,23 @@ const attrAccept = (file, accept) => {
27298
27421
  });
27299
27422
  };
27300
27423
  const handleFiles = async (files) => {
27301
- if (props.limit && props.fileList.length + files.length > props.limit) {
27302
- emit("exceed", files, props.fileList);
27303
- return;
27304
- }
27305
- const validFiles = [];
27306
- for (const file of files) {
27307
- const rawFile = file;
27308
- if (props.accept && !attrAccept(rawFile, props.accept)) {
27424
+ const filteredByRules = files.filter((file) => {
27425
+ if (props.accept && !attrAccept(file, props.accept)) {
27309
27426
  console.warn(
27310
- `[YhUpload] Auto Remove: File format does not match "${props.accept}" - ${rawFile.name}`
27427
+ `[YhUpload] Auto Remove: File format does not match "${props.accept}" - ${file.name}`
27311
27428
  );
27312
- continue;
27429
+ return false;
27313
27430
  }
27314
- if (props.maxSize && rawFile.size / 1024 > props.maxSize) {
27315
- console.warn(`[YhUpload] Auto Remove: File size exceeds limit - ${rawFile.name}`);
27316
- continue;
27431
+ if (props.maxSize && file.size / 1024 > props.maxSize) {
27432
+ console.warn(`[YhUpload] Auto Remove: File size exceeds limit - ${file.name}`);
27433
+ return false;
27317
27434
  }
27435
+ return true;
27436
+ });
27437
+ const passedFiles = [];
27438
+ for (const file of filteredByRules) {
27439
+ const rawFile = file;
27440
+ let finalFile = rawFile;
27318
27441
  if (props.beforeUpload) {
27319
27442
  try {
27320
27443
  const result = await props.beforeUpload(rawFile);
@@ -27322,12 +27445,22 @@ const handleFiles = async (files) => {
27322
27445
  if (result instanceof Blob) {
27323
27446
  const newRawFile = result;
27324
27447
  if (!newRawFile.uid) newRawFile.uid = Date.now() + Math.random();
27325
- Object.assign(rawFile, newRawFile);
27448
+ finalFile = newRawFile;
27326
27449
  }
27327
27450
  } catch {
27328
27451
  continue;
27329
27452
  }
27330
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;
27331
27464
  if (!rawFile.uid) rawFile.uid = Date.now() + Math.random();
27332
27465
  const uploadFile = {
27333
27466
  name: props.directory && rawFile.webkitRelativePath ? rawFile.webkitRelativePath : rawFile.name,
@@ -27629,7 +27762,7 @@ return (_ctx, _cache) => {
27629
27762
  createElementVNode("div", {
27630
27763
  class: normalizeClass(unref(ns).e('text')),
27631
27764
  innerHTML: unref(t)('upload.tip')
27632
- }, null, 10 /* CLASS, PROPS */, _hoisted_2$z)
27765
+ }, null, 10 /* CLASS, PROPS */, _hoisted_2$A)
27633
27766
  ], 2 /* CLASS */)
27634
27767
  ])
27635
27768
  ])
@@ -27750,7 +27883,7 @@ return (_ctx, _cache) => {
27750
27883
  name: "delete",
27751
27884
  size: 18
27752
27885
  })
27753
- ], 8 /* PROPS */, _hoisted_6$c))
27886
+ ], 8 /* PROPS */, _hoisted_6$d))
27754
27887
  : createCommentVNode("v-if", true)
27755
27888
  ], 2 /* CLASS */),
27756
27889
  createCommentVNode(" Progress Bar overlay "),
@@ -27784,7 +27917,7 @@ return (_ctx, _cache) => {
27784
27917
  src: file.url,
27785
27918
  class: normalizeClass(unref(ns).e('thumbnail-img')),
27786
27919
  crossorigin: _ctx.crossorigin
27787
- }, null, 10 /* CLASS, PROPS */, _hoisted_7$b))
27920
+ }, null, 10 /* CLASS, PROPS */, _hoisted_7$c))
27788
27921
  : (openBlock(), createBlock(unref(YhIcon), {
27789
27922
  key: 1,
27790
27923
  name: "image",
@@ -27806,7 +27939,7 @@ return (_ctx, _cache) => {
27806
27939
  createElementVNode("div", {
27807
27940
  class: normalizeClass(unref(ns).e('name')),
27808
27941
  onClick: $event => (handlePreview(file))
27809
- }, toDisplayString(file.name), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$9)
27942
+ }, toDisplayString(file.name), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$a)
27810
27943
  ], 2 /* CLASS */),
27811
27944
  createElementVNode("div", {
27812
27945
  class: normalizeClass(unref(ns).e('status-icon-wrapper'))
@@ -28256,7 +28389,7 @@ const paginationProps = {
28256
28389
  };
28257
28390
 
28258
28391
  const _hoisted_1$I = ["disabled"];
28259
- const _hoisted_2$y = { key: 0 };
28392
+ const _hoisted_2$z = { key: 0 };
28260
28393
  const _hoisted_3$n = {
28261
28394
  key: 1,
28262
28395
  viewBox: "0 0 1024 1024",
@@ -28265,8 +28398,8 @@ const _hoisted_3$n = {
28265
28398
  };
28266
28399
  const _hoisted_4$g = ["onClick"];
28267
28400
  const _hoisted_5$d = ["disabled"];
28268
- const _hoisted_6$b = { key: 0 };
28269
- const _hoisted_7$a = {
28401
+ const _hoisted_6$c = { key: 0 };
28402
+ const _hoisted_7$b = {
28270
28403
  key: 1,
28271
28404
  viewBox: "0 0 1024 1024",
28272
28405
  width: "1em",
@@ -28380,9 +28513,14 @@ const layoutComponents = computed(() => {
28380
28513
  return props.layout.split(",").map((item) => item.trim());
28381
28514
  });
28382
28515
  __expose({
28383
- currentPage: internalCurrentPage.value,
28384
- pageSize: props.pageSize,
28385
- pageCount: pageCount.value
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)
28386
28524
  });
28387
28525
 
28388
28526
  return (_ctx, _cache) => {
@@ -28436,7 +28574,7 @@ return (_ctx, _cache) => {
28436
28574
  }, [
28437
28575
  renderSlot(_ctx.$slots, "prev-icon", {}, () => [
28438
28576
  (_ctx.prevText)
28439
- ? (openBlock(), createElementBlock("span", _hoisted_2$y, toDisplayString(_ctx.prevText), 1 /* TEXT */))
28577
+ ? (openBlock(), createElementBlock("span", _hoisted_2$z, toDisplayString(_ctx.prevText), 1 /* TEXT */))
28440
28578
  : (openBlock(), createElementBlock("svg", _hoisted_3$n, [...(_cache[6] || (_cache[6] = [
28441
28579
  createElementVNode("path", {
28442
28580
  fill: "currentColor",
@@ -28504,8 +28642,8 @@ return (_ctx, _cache) => {
28504
28642
  }, [
28505
28643
  renderSlot(_ctx.$slots, "next-icon", {}, () => [
28506
28644
  (_ctx.nextText)
28507
- ? (openBlock(), createElementBlock("span", _hoisted_6$b, toDisplayString(_ctx.nextText), 1 /* TEXT */))
28508
- : (openBlock(), createElementBlock("svg", _hoisted_7$a, [...(_cache[7] || (_cache[7] = [
28645
+ ? (openBlock(), createElementBlock("span", _hoisted_6$c, toDisplayString(_ctx.nextText), 1 /* TEXT */))
28646
+ : (openBlock(), createElementBlock("svg", _hoisted_7$b, [...(_cache[7] || (_cache[7] = [
28509
28647
  createElementVNode("path", {
28510
28648
  fill: "currentColor",
28511
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"
@@ -28758,14 +28896,14 @@ const imageViewerEmits = {
28758
28896
  };
28759
28897
 
28760
28898
  const _hoisted_1$H = ["title", "aria-label"];
28761
- const _hoisted_2$x = ["title", "aria-label"];
28899
+ const _hoisted_2$y = ["title", "aria-label"];
28762
28900
  const _hoisted_3$m = ["title", "aria-label"];
28763
28901
  const _hoisted_4$f = ["title", "aria-label"];
28764
28902
  const _hoisted_5$c = ["title", "aria-label"];
28765
- const _hoisted_6$a = ["title", "aria-label"];
28766
- const _hoisted_7$9 = ["title", "aria-label"];
28767
- const _hoisted_8$8 = ["title", "aria-label"];
28768
- const _hoisted_9$7 = ["src"];
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"];
28769
28907
 
28770
28908
  const _sfc_main$1f = /*@__PURE__*/Object.assign({
28771
28909
  name: "YhImageViewer"
@@ -28792,6 +28930,7 @@ const handleClose = () => {
28792
28930
  emit("close");
28793
28931
  };
28794
28932
  const initViewerJS = async () => {
28933
+ if (typeof document === "undefined") return;
28795
28934
  let ViewerClass;
28796
28935
  try {
28797
28936
  ViewerClass = await loadViewer();
@@ -28811,7 +28950,7 @@ const initViewerJS = async () => {
28811
28950
  ...props.viewerOptions,
28812
28951
  initialViewIndex: props.initialIndex,
28813
28952
  hidden: () => {
28814
- if (viewerList) {
28953
+ if (viewerList && typeof document !== "undefined") {
28815
28954
  document.body.removeChild(viewerList);
28816
28955
  viewerList = null;
28817
28956
  }
@@ -28867,6 +29006,23 @@ watch(
28867
29006
  index.value = val;
28868
29007
  }
28869
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
+ );
28870
29026
  const handleKeyDown = (e) => {
28871
29027
  if (props.viewerMode === "viewerjs") return;
28872
29028
  if (e.key === "Escape" && props.closeOnPressEscape) {
@@ -28882,19 +29038,23 @@ const handleKeyDown = (e) => {
28882
29038
  }
28883
29039
  };
28884
29040
  onMounted(async () => {
28885
- if (props.viewerMode === "viewerjs") {
28886
- await initViewerJS();
28887
- } else {
28888
- window.addEventListener("keydown", handleKeyDown);
29041
+ if (typeof window !== "undefined") {
29042
+ if (props.viewerMode === "viewerjs") {
29043
+ await initViewerJS();
29044
+ } else {
29045
+ window.addEventListener("keydown", handleKeyDown);
29046
+ }
28889
29047
  }
28890
29048
  });
28891
29049
  onUnmounted(() => {
28892
- window.removeEventListener("keydown", handleKeyDown);
29050
+ if (typeof window !== "undefined") {
29051
+ window.removeEventListener("keydown", handleKeyDown);
29052
+ }
28893
29053
  if (viewer) {
28894
29054
  viewer.destroy();
28895
29055
  viewer = null;
28896
29056
  }
28897
- if (viewerList) {
29057
+ if (typeof document !== "undefined" && viewerList) {
28898
29058
  document.body.removeChild(viewerList);
28899
29059
  viewerList = null;
28900
29060
  }
@@ -28963,7 +29123,7 @@ return (_ctx, _cache) => {
28963
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"
28964
29124
  })
28965
29125
  ], -1 /* CACHED */)
28966
- ]))], 10 /* CLASS, PROPS */, _hoisted_2$x),
29126
+ ]))], 10 /* CLASS, PROPS */, _hoisted_2$y),
28967
29127
  createElementVNode("span", {
28968
29128
  class: normalizeClass([unref(ns).e('btn'), unref(ns).e('next')]),
28969
29129
  title: unref(t)('imageviewer.next'),
@@ -29042,7 +29202,7 @@ return (_ctx, _cache) => {
29042
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"
29043
29203
  })
29044
29204
  ], -1 /* CACHED */)
29045
- ]))], 10 /* CLASS, PROPS */, _hoisted_6$a),
29205
+ ]))], 10 /* CLASS, PROPS */, _hoisted_6$b),
29046
29206
  createElementVNode("i", {
29047
29207
  class: normalizeClass(unref(ns).e('rotate-left')),
29048
29208
  title: unref(t)('imageviewer.rotateLeft'),
@@ -29059,7 +29219,7 @@ return (_ctx, _cache) => {
29059
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"
29060
29220
  })
29061
29221
  ], -1 /* CACHED */)
29062
- ]))], 10 /* CLASS, PROPS */, _hoisted_7$9),
29222
+ ]))], 10 /* CLASS, PROPS */, _hoisted_7$a),
29063
29223
  createElementVNode("i", {
29064
29224
  class: normalizeClass(unref(ns).e('rotate-right')),
29065
29225
  title: unref(t)('imageviewer.rotateRight'),
@@ -29076,7 +29236,7 @@ return (_ctx, _cache) => {
29076
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"
29077
29237
  })
29078
29238
  ], -1 /* CACHED */)
29079
- ]))], 10 /* CLASS, PROPS */, _hoisted_8$8)
29239
+ ]))], 10 /* CLASS, PROPS */, _hoisted_8$9)
29080
29240
  ], 2 /* CLASS */)
29081
29241
  ], 2 /* CLASS */))
29082
29242
  : createCommentVNode("v-if", true),
@@ -29090,7 +29250,7 @@ return (_ctx, _cache) => {
29090
29250
  style: normalizeStyle({
29091
29251
  transform: transform.value
29092
29252
  })
29093
- }, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_9$7)
29253
+ }, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_9$8)
29094
29254
  ], 2 /* CLASS */)
29095
29255
  ], 6 /* CLASS, STYLE */))
29096
29256
  : createCommentVNode("v-if", true)
@@ -29101,7 +29261,7 @@ return (_ctx, _cache) => {
29101
29261
  });
29102
29262
 
29103
29263
  const _hoisted_1$G = ["src", "alt", "crossorigin", "loading"];
29104
- const _hoisted_2$w = ["src", "alt", "crossorigin"];
29264
+ const _hoisted_2$x = ["src", "alt", "crossorigin"];
29105
29265
 
29106
29266
  const _sfc_main$1e = /*@__PURE__*/Object.assign({
29107
29267
  name: "YhImage"
@@ -29205,8 +29365,9 @@ const initLazyLoad = () => {
29205
29365
  const getRoot = () => {
29206
29366
  if (!isClient || !container.value) return null;
29207
29367
  if (typeof props.scrollContainer === "string") {
29368
+ if (typeof document === "undefined") return null;
29208
29369
  return document.querySelector(props.scrollContainer);
29209
- } else if (props.scrollContainer instanceof HTMLElement) {
29370
+ } else if (typeof HTMLElement !== "undefined" && props.scrollContainer instanceof HTMLElement) {
29210
29371
  return props.scrollContainer;
29211
29372
  }
29212
29373
  const scrollContainer = getScrollContainer(container.value);
@@ -29358,7 +29519,7 @@ return (_ctx, _cache) => {
29358
29519
  onLoad: onImgLoad,
29359
29520
  onError: onImgError,
29360
29521
  onClick: clickHandler
29361
- }, null, 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2$w)
29522
+ }, null, 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2$x)
29362
29523
  ], 64 /* STABLE_FRAGMENT */))
29363
29524
  : createCommentVNode("v-if", true),
29364
29525
  createCommentVNode(" Viewer "),
@@ -29473,7 +29634,7 @@ const descriptionsItemProps = {
29473
29634
  const descriptionsKey = Symbol("descriptionsKey");
29474
29635
 
29475
29636
  const _hoisted_1$F = { key: 2 };
29476
- const _hoisted_2$v = ["colspan"];
29637
+ const _hoisted_2$w = ["colspan"];
29477
29638
  const _hoisted_3$l = ["colspan"];
29478
29639
  const _hoisted_4$e = ["colspan"];
29479
29640
 
@@ -29638,7 +29799,7 @@ return (_ctx, _cache) => {
29638
29799
  (item.slots.default)
29639
29800
  ? (openBlock(), createBlock(resolveDynamicComponent(item.slots.default), { key: 0 }))
29640
29801
  : createCommentVNode("v-if", true)
29641
- ], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$v)
29802
+ ], 14 /* CLASS, STYLE, PROPS */, _hoisted_2$w)
29642
29803
  ], 64 /* STABLE_FRAGMENT */))
29643
29804
  }), 128 /* KEYED_FRAGMENT */))
29644
29805
  ], 2 /* CLASS */))
@@ -29811,7 +29972,7 @@ const tabsEmits = {
29811
29972
  const TABS_INJECTION_KEY = Symbol("yhTabs");
29812
29973
 
29813
29974
  const _hoisted_1$E = ["tabindex", "aria-selected", "onClick", "onKeydown", "onMouseenter"];
29814
- const _hoisted_2$u = ["onClick"];
29975
+ const _hoisted_2$v = ["onClick"];
29815
29976
 
29816
29977
  const _sfc_main$1b = /*@__PURE__*/Object.assign({
29817
29978
  name: "YhTabs"
@@ -29833,6 +29994,7 @@ const panes = ref([]);
29833
29994
  const activeTab = ref(props.modelValue);
29834
29995
  const navRef = ref();
29835
29996
  const indicatorRef = ref();
29997
+ const rootRef = ref();
29836
29998
  watch(
29837
29999
  () => props.modelValue,
29838
30000
  (val) => {
@@ -29927,9 +30089,10 @@ const updateIndicator = () => {
29927
30089
  indicatorRef.value.style.width = "";
29928
30090
  indicatorRef.value.style.height = "";
29929
30091
  indicatorRef.value.style.transform = "";
29930
- const computedStyle = getComputedStyle(navRef.value.closest(`.${ns.b()}`));
29931
- const defaultIndicatorWidth = computedStyle.getPropertyValue("--yh-tabs-indicator-width").trim() || "40px";
29932
- const defaultIndicatorHeight = computedStyle.getPropertyValue("--yh-tabs-indicator-height").trim() || "20px";
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";
29933
30096
  const navRect = navRef.value.getBoundingClientRect();
29934
30097
  const activeRect = activeEl.getBoundingClientRect();
29935
30098
  if (isVertical) {
@@ -30016,6 +30179,8 @@ __expose({
30016
30179
 
30017
30180
  return (_ctx, _cache) => {
30018
30181
  return (openBlock(), createElementBlock("div", {
30182
+ ref_key: "rootRef",
30183
+ ref: rootRef,
30019
30184
  class: normalizeClass(tabsClass.value),
30020
30185
  style: normalizeStyle(tabsStyle.value)
30021
30186
  }, [
@@ -30072,7 +30237,7 @@ return (_ctx, _cache) => {
30072
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"
30073
30238
  })
30074
30239
  ], -1 /* CACHED */)
30075
- ]))], 10 /* CLASS, PROPS */, _hoisted_2$u))
30240
+ ]))], 10 /* CLASS, PROPS */, _hoisted_2$v))
30076
30241
  : createCommentVNode("v-if", true)
30077
30242
  ], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_1$E))
30078
30243
  }), 128 /* KEYED_FRAGMENT */)),
@@ -30354,6 +30519,7 @@ const { themeStyle } = useComponentTheme(
30354
30519
  const steps = ref([]);
30355
30520
  const isResponsiveVertical = ref(false);
30356
30521
  const checkResponsive = () => {
30522
+ if (typeof window === "undefined") return;
30357
30523
  if (props.responsive) {
30358
30524
  isResponsiveVertical.value = window.innerWidth < props.responsiveBreakpoint;
30359
30525
  } else {
@@ -30361,13 +30527,13 @@ const checkResponsive = () => {
30361
30527
  }
30362
30528
  };
30363
30529
  onMounted(() => {
30364
- if (props.responsive) {
30530
+ if (props.responsive && typeof window !== "undefined") {
30365
30531
  checkResponsive();
30366
30532
  window.addEventListener("resize", checkResponsive);
30367
30533
  }
30368
30534
  });
30369
30535
  onUnmounted(() => {
30370
- if (props.responsive) {
30536
+ if (props.responsive && typeof window !== "undefined") {
30371
30537
  window.removeEventListener("resize", checkResponsive);
30372
30538
  }
30373
30539
  });
@@ -31288,6 +31454,7 @@ const setupObserver = () => {
31288
31454
  observer.disconnect();
31289
31455
  observer = null;
31290
31456
  }
31457
+ if (!placeholderRef.value) return;
31291
31458
  const rootContainer = resolveScrollContainer();
31292
31459
  observer = new IntersectionObserver(
31293
31460
  (entries) => {
@@ -31353,7 +31520,8 @@ watch(
31353
31520
  );
31354
31521
  watch(
31355
31522
  () => props.useObserver,
31356
- () => {
31523
+ async () => {
31524
+ await nextTick();
31357
31525
  if (props.useObserver) {
31358
31526
  if (scrollContainer.value) {
31359
31527
  scrollContainer.value.removeEventListener("scroll", handleScroll);
@@ -31721,7 +31889,7 @@ const dropdownMenuProps = {
31721
31889
  const DROPDOWN_INJECTION_KEY = Symbol("dropdown");
31722
31890
 
31723
31891
  const _hoisted_1$C = ["tabindex"];
31724
- const _hoisted_2$t = ["onClick"];
31892
+ const _hoisted_2$u = ["onClick"];
31725
31893
 
31726
31894
  const _sfc_main$15 = /*@__PURE__*/Object.assign({
31727
31895
  name: "YhDropdown"
@@ -31768,11 +31936,9 @@ const handleItemClick = (command) => {
31768
31936
  };
31769
31937
  const handleShow = () => {
31770
31938
  emit("show");
31771
- emit("update:visible", true);
31772
31939
  };
31773
31940
  const handleHide = () => {
31774
31941
  emit("hide");
31775
- emit("update:visible", false);
31776
31942
  };
31777
31943
  const handleButtonClick = (event) => {
31778
31944
  emit("click", event);
@@ -31886,7 +32052,7 @@ return (_ctx, _cache) => {
31886
32052
  }, null, 8 /* PROPS */, ["name", "class"]))
31887
32053
  : createCommentVNode("v-if", true),
31888
32054
  createElementVNode("span", null, toDisplayString(item.label), 1 /* TEXT */)
31889
- ], 10 /* CLASS, PROPS */, _hoisted_2$t)
32055
+ ], 10 /* CLASS, PROPS */, _hoisted_2$u)
31890
32056
  ], 64 /* STABLE_FRAGMENT */))
31891
32057
  }), 128 /* KEYED_FRAGMENT */))
31892
32058
  ], 64 /* STABLE_FRAGMENT */))
@@ -32327,7 +32493,7 @@ const MENU_INJECTION_KEY = Symbol("menu");
32327
32493
  const SUB_MENU_INJECTION_KEY = Symbol("subMenu");
32328
32494
 
32329
32495
  const _hoisted_1$B = ["tabindex"];
32330
- const _hoisted_2$s = { style: {"max-width":"300px","word-break":"break-all"} };
32496
+ const _hoisted_2$t = { style: {"max-width":"300px","word-break":"break-all"} };
32331
32497
 
32332
32498
  const _sfc_main$12 = /*@__PURE__*/Object.assign({
32333
32499
  name: "YhMenuItem"
@@ -32417,7 +32583,7 @@ return (_ctx, _cache) => {
32417
32583
  style: {"flex":"1","min-width":"0","overflow":"hidden"}
32418
32584
  }, {
32419
32585
  content: withCtx(() => [
32420
- createElementVNode("div", _hoisted_2$s, [
32586
+ createElementVNode("div", _hoisted_2$t, [
32421
32587
  (renderLabelContent.value)
32422
32588
  ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
32423
32589
  (typeof renderLabelContent.value === 'string')
@@ -32469,7 +32635,7 @@ return (_ctx, _cache) => {
32469
32635
  });
32470
32636
 
32471
32637
  const _hoisted_1$A = { style: {"max-width":"300px","word-break":"break-all"} };
32472
- const _hoisted_2$r = { style: {"max-width":"300px","word-break":"break-all"} };
32638
+ const _hoisted_2$s = { style: {"max-width":"300px","word-break":"break-all"} };
32473
32639
 
32474
32640
  const _sfc_main$11 = /*@__PURE__*/Object.assign({
32475
32641
  name: "YhSubMenu"
@@ -32752,7 +32918,7 @@ return (_ctx, _cache) => {
32752
32918
  style: {"flex":"1","min-width":"0","overflow":"hidden"}
32753
32919
  }, {
32754
32920
  content: withCtx(() => [
32755
- createElementVNode("div", _hoisted_2$r, [
32921
+ createElementVNode("div", _hoisted_2$s, [
32756
32922
  (renderLabelContent.value)
32757
32923
  ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
32758
32924
  (typeof renderLabelContent.value === 'string')
@@ -33306,6 +33472,7 @@ const DEFAULT_CHINA_HOLIDAYS_2026 = {
33306
33472
  };
33307
33473
 
33308
33474
  const _hoisted_1$z = ["onClick", "onMouseenter"];
33475
+ const _hoisted_2$r = ["onClick"];
33309
33476
 
33310
33477
  const _sfc_main$Z = /*@__PURE__*/Object.assign({
33311
33478
  name: "YhCalendar"
@@ -33327,6 +33494,42 @@ const { themeStyle } = useComponentTheme(
33327
33494
  );
33328
33495
  const now = dayjs_default();
33329
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
+ };
33330
33533
  const selectedDate = ref(props.modelValue ? dayjs_default(props.modelValue) : void 0);
33331
33534
  const rangeStart = ref(
33332
33535
  props.rangeValue?.[0] ? dayjs_default(props.rangeValue[0]) : void 0
@@ -33357,6 +33560,11 @@ const monthKeys = [
33357
33560
  "dec"
33358
33561
  ];
33359
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
+ }
33360
33568
  if (props.monthHeaderFormat) {
33361
33569
  return displayDate.value.format(props.monthHeaderFormat);
33362
33570
  }
@@ -33517,7 +33725,23 @@ const handleCellHover = (cell) => {
33517
33725
  };
33518
33726
  const moveMonth = (delta) => {
33519
33727
  displayDate.value = displayDate.value.add(delta, "month");
33520
- emit("panel-change", displayDate.value.toDate(), props.mode);
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
+ }
33521
33745
  };
33522
33746
  const goToday = () => {
33523
33747
  displayDate.value = now;
@@ -33553,6 +33777,15 @@ watch(
33553
33777
  multipleSelected.value = val?.map((d) => dayjs_default(d)) || [];
33554
33778
  }
33555
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
+ );
33556
33789
  onMounted(() => {
33557
33790
  if (props.defaultValue && !props.modelValue) {
33558
33791
  selectedDate.value = dayjs_default(props.defaultValue);
@@ -33612,7 +33845,9 @@ return (_ctx, _cache) => {
33612
33845
  class: normalizeClass(unref(ns).e('header'))
33613
33846
  }, [
33614
33847
  createElementVNode("div", {
33615
- 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"}
33616
33851
  }, [
33617
33852
  renderSlot(_ctx.$slots, "header", { date: title.value }, () => [
33618
33853
  createTextVNode(toDisplayString(title.value), 1 /* TEXT */)
@@ -33627,10 +33862,10 @@ return (_ctx, _cache) => {
33627
33862
  createVNode(unref(YhButton), {
33628
33863
  class: "yh-calendar__nav-btn",
33629
33864
  size: "small",
33630
- onClick: _cache[0] || (_cache[0] = $event => (moveMonth(-1)))
33865
+ onClick: _cache[1] || (_cache[1] = $event => (handlePrev()))
33631
33866
  }, {
33632
33867
  default: withCtx(() => [
33633
- 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 */)
33634
33869
  ]),
33635
33870
  _: 1 /* STABLE */
33636
33871
  }),
@@ -33647,10 +33882,10 @@ return (_ctx, _cache) => {
33647
33882
  createVNode(unref(YhButton), {
33648
33883
  class: "yh-calendar__nav-btn",
33649
33884
  size: "small",
33650
- onClick: _cache[1] || (_cache[1] = $event => (moveMonth(1)))
33885
+ onClick: _cache[2] || (_cache[2] = $event => (handleNext()))
33651
33886
  }, {
33652
33887
  default: withCtx(() => [
33653
- 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 */)
33654
33889
  ]),
33655
33890
  _: 1 /* STABLE */
33656
33891
  })
@@ -33661,74 +33896,94 @@ return (_ctx, _cache) => {
33661
33896
  createElementVNode("div", {
33662
33897
  class: normalizeClass(unref(ns).e('body'))
33663
33898
  }, [
33664
- createElementVNode("table", {
33665
- class: normalizeClass(unref(ns).e('table'))
33666
- }, [
33667
- createElementVNode("thead", null, [
33668
- createElementVNode("tr", null, [
33669
- (_ctx.showWeekNumber)
33670
- ? (openBlock(), createElementBlock("th", {
33671
- key: 0,
33672
- class: normalizeClass(unref(ns).e('week-number-header'))
33673
- }, toDisplayString(unref(t)("calendar.week")), 3 /* TEXT, CLASS */))
33674
- : createCommentVNode("v-if", true),
33675
- (openBlock(true), createElementBlock(Fragment, null, renderList(weekDays.value, (day) => {
33676
- return (openBlock(), createElementBlock("th", {
33677
- key: day.value,
33678
- class: normalizeClass([unref(ns).e('weekday'), {
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'), {
33679
33916
  [unref(ns).em('weekday', 'weekend')]: _ctx.highlightWeekends && (day.value === 0 || day.value === 6)
33680
33917
  }])
33681
- }, [
33682
- createElementVNode("span", null, toDisplayString(day.label), 1 /* TEXT */)
33683
- ], 2 /* CLASS */))
33684
- }), 128 /* KEYED_FRAGMENT */))
33685
- ])
33686
- ]),
33687
- createElementVNode("tbody", null, [
33688
- (openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, rowIndex) => {
33689
- return (openBlock(), createElementBlock("tr", { key: rowIndex }, [
33690
- (_ctx.showWeekNumber)
33691
- ? (openBlock(), createElementBlock("td", {
33692
- key: 0,
33693
- class: normalizeClass(unref(ns).e('week-number'))
33694
- }, toDisplayString(row.weekNumber), 3 /* TEXT, CLASS */))
33695
- : createCommentVNode("v-if", true),
33696
- (openBlock(true), createElementBlock(Fragment, null, renderList(row.cells, (cell, cellIndex) => {
33697
- return (openBlock(), createElementBlock("td", {
33698
- key: cellIndex,
33699
- 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)]),
33700
- onClick: $event => (selectDate(cell)),
33701
- onMouseenter: $event => (handleCellHover(cell))
33702
- }, [
33703
- createElementVNode("div", {
33704
- class: normalizeClass(unref(ns).e('day-inner'))
33705
33918
  }, [
33706
- createCommentVNode(" 日期数字 "),
33707
- createElementVNode("div", {
33708
- class: normalizeClass(unref(ns).e('day-value'))
33709
- }, toDisplayString(cell.day), 3 /* TEXT, CLASS */),
33710
- createCommentVNode(" 假期/补班标记 "),
33711
- (_ctx.showHoliday && (cell.isHoliday || cell.isWorkday))
33712
- ? (openBlock(), createElementBlock("div", {
33713
- key: 0,
33714
- class: normalizeClass([unref(ns).e('day-badge'), cell.isHoliday ? unref(ns).em('day-badge', 'holiday') : unref(ns).em('day-badge', 'workday')])
33715
- }, toDisplayString(cell.isHoliday ? unref(t)("calendar.holiday") : unref(t)("calendar.workday")), 3 /* TEXT, CLASS */))
33716
- : createCommentVNode("v-if", true),
33717
- createCommentVNode(" 自定义内容插槽 "),
33718
- createElementVNode("div", {
33719
- class: normalizeClass(unref(ns).e('day-content'))
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))
33720
33939
  }, [
33721
- renderSlot(_ctx.$slots, "date-cell", {
33722
- data: getSlotData(cell)
33723
- })
33724
- ], 2 /* CLASS */)
33725
- ], 2 /* CLASS */)
33726
- ], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_1$z))
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
+ ]))
33727
33966
  }), 128 /* KEYED_FRAGMENT */))
33728
- ]))
33729
- }), 128 /* KEYED_FRAGMENT */))
33730
- ])
33731
- ], 2 /* CLASS */)
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 */))
33732
33987
  ], 2 /* CLASS */),
33733
33988
  createCommentVNode(" 底部插槽 "),
33734
33989
  (_ctx.$slots.footer)
@@ -33845,23 +34100,34 @@ onBeforeUnmount(() => {
33845
34100
  resizeObserver.disconnect();
33846
34101
  resizeObserver = null;
33847
34102
  }
34103
+ if (heightResetTimer !== null) {
34104
+ clearTimeout(heightResetTimer);
34105
+ heightResetTimer = null;
34106
+ }
33848
34107
  });
33849
34108
  const isRefreshing = computed(() => props.loading && props.items && props.items.length > 0);
33850
34109
  const minContainerHeight = ref("auto");
34110
+ let heightResetTimer = null;
33851
34111
  watch(
33852
34112
  () => props.loading,
33853
34113
  (val) => {
33854
34114
  if (val && containerRef.value) {
34115
+ if (heightResetTimer !== null) {
34116
+ clearTimeout(heightResetTimer);
34117
+ heightResetTimer = null;
34118
+ }
33855
34119
  const height = containerRef.value.offsetHeight;
33856
34120
  if (height > 0) {
33857
34121
  minContainerHeight.value = `${height}px`;
33858
34122
  }
33859
34123
  } else {
33860
- nextTick(() => {
33861
- setTimeout(() => {
33862
- minContainerHeight.value = "auto";
33863
- }, 300);
33864
- });
34124
+ if (heightResetTimer !== null) {
34125
+ clearTimeout(heightResetTimer);
34126
+ }
34127
+ heightResetTimer = setTimeout(() => {
34128
+ minContainerHeight.value = "auto";
34129
+ heightResetTimer = null;
34130
+ }, 300);
33865
34131
  }
33866
34132
  }
33867
34133
  );
@@ -34518,6 +34784,7 @@ const flattenedNodes = computed(() => {
34518
34784
  return result;
34519
34785
  });
34520
34786
  const handleNodeClick = (node, e) => {
34787
+ if (dragNode.value) return;
34521
34788
  if (node.disabled) return;
34522
34789
  currentNodeKey.value = node.key;
34523
34790
  emit("update:currentNodeKey", node.key);
@@ -35239,7 +35506,12 @@ function getInitialRemain() {
35239
35506
  const now = Date.now() + serverOffset;
35240
35507
  const value = props.value;
35241
35508
  if (isTargetTimestamp(value)) {
35242
- const target = value instanceof Date ? value.getTime() : value;
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
+ }
35243
35515
  return Math.max(0, target - now);
35244
35516
  }
35245
35517
  return Math.max(0, value instanceof Date ? value.getTime() : value);
@@ -35399,96 +35671,99 @@ const digits = computed(() => {
35399
35671
  });
35400
35672
 
35401
35673
  return (_ctx, _cache) => {
35402
- return (openBlock(), createElementBlock("div", {
35403
- class: normalizeClass(rootClass.value),
35404
- style: normalizeStyle(unref(themeStyle))
35405
- }, [
35406
- createCommentVNode(" 标题 "),
35407
- renderSlot(_ctx.$slots, "prefix", {}, () => [
35408
- (_ctx.title)
35409
- ? (openBlock(), createElementBlock("span", {
35410
- key: 0,
35411
- class: normalizeClass(unref(ns).e('title'))
35412
- }, toDisplayString(_ctx.title), 3 /* TEXT, CLASS */))
35413
- : createCommentVNode("v-if", true)
35414
- ]),
35415
- createCommentVNode(" 主体内容 "),
35416
- createElementVNode("div", {
35417
- class: normalizeClass(unref(ns).e('content'))
35418
- }, [
35419
- createCommentVNode(" 默认插槽:完全自定义渲染 "),
35420
- renderSlot(_ctx.$slots, "default", {
35421
- current: formatContext.value,
35422
- remaining: remain.value,
35423
- formatted: displayText.value,
35424
- status: status.value,
35425
- isWarning: isWarning.value,
35426
- isFinished: isFinished.value
35427
- }, () => [
35428
- createCommentVNode(" 翻牌模式 "),
35429
- (_ctx.flipAnimation)
35430
- ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(digits.value, (digit, idx) => {
35431
- return (openBlock(), createElementBlock(Fragment, {
35432
- key: digit.key
35433
- }, [
35434
- createCommentVNode(" 分隔符 "),
35435
- (idx > 0)
35436
- ? (openBlock(), createElementBlock("span", {
35437
- key: 0,
35438
- class: normalizeClass(unref(ns).e('separator'))
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'))
35439
35721
  }, [
35440
- renderSlot(_ctx.$slots, "separator", {}, () => [
35441
- createTextVNode(toDisplayString(_ctx.separator), 1 /* TEXT */)
35442
- ])
35443
- ], 2 /* CLASS */))
35444
- : createCommentVNode("v-if", true),
35445
- createElementVNode("div", {
35446
- class: normalizeClass(unref(ns).e('block'))
35447
- }, [
35448
- createElementVNode("div", {
35449
- class: normalizeClass(unref(ns).e('flip-card'))
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)
35450
35748
  }, [
35451
- renderSlot(_ctx.$slots, `${digit.key}-cell`, {
35452
- value: digit.value
35453
- }, () => [
35454
- createElementVNode("span", {
35455
- class: normalizeClass(unref(ns).e('value')),
35456
- style: normalizeStyle(valueStyleComputed.value)
35457
- }, toDisplayString(digit.value), 7 /* TEXT, CLASS, STYLE */)
35749
+ renderSlot(_ctx.$slots, "value", { text: displayText.value }, () => [
35750
+ createTextVNode(toDisplayString(displayText.value), 1 /* TEXT */)
35458
35751
  ])
35459
- ], 2 /* CLASS */),
35460
- (digit.label)
35461
- ? (openBlock(), createElementBlock("span", {
35462
- key: 0,
35463
- class: normalizeClass(unref(ns).e('label'))
35464
- }, toDisplayString(digit.label), 3 /* TEXT, CLASS */))
35465
- : createCommentVNode("v-if", true)
35466
- ], 2 /* CLASS */)
35467
- ], 64 /* STABLE_FRAGMENT */))
35468
- }), 128 /* KEYED_FRAGMENT */))
35469
- : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
35470
- createCommentVNode(" 常规模式 "),
35471
- createElementVNode("span", {
35472
- class: normalizeClass(unref(ns).e('value')),
35473
- style: normalizeStyle(valueStyleComputed.value)
35474
- }, [
35475
- renderSlot(_ctx.$slots, "value", { text: displayText.value }, () => [
35476
- createTextVNode(toDisplayString(displayText.value), 1 /* TEXT */)
35477
- ])
35478
- ], 6 /* CLASS, STYLE */)
35479
- ], 64 /* STABLE_FRAGMENT */))
35480
- ])
35481
- ], 2 /* CLASS */),
35482
- createCommentVNode(" 后缀 "),
35483
- renderSlot(_ctx.$slots, "suffix", {}, () => [
35484
- (_ctx.suffix)
35485
- ? (openBlock(), createElementBlock("span", {
35486
- key: 0,
35487
- class: normalizeClass(unref(ns).e('suffix'))
35488
- }, toDisplayString(_ctx.suffix), 3 /* TEXT, CLASS */))
35489
- : createCommentVNode("v-if", true)
35490
- ])
35491
- ], 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)
35492
35767
  }
35493
35768
  }
35494
35769
 
@@ -37630,13 +37905,13 @@ const _hoisted_2$p = ["checked", "indeterminate"];
37630
37905
  const _hoisted_3$j = ["rowspan"];
37631
37906
  const _hoisted_4$c = ["rowspan"];
37632
37907
  const _hoisted_5$b = ["colspan", "rowspan", "onClick", "onContextmenu"];
37633
- const _hoisted_6$9 = ["onPointerdown"];
37634
- const _hoisted_7$8 = ["checked", "indeterminate"];
37635
- const _hoisted_8$7 = ["onClick", "onContextmenu"];
37636
- const _hoisted_9$6 = ["onPointerdown"];
37637
- const _hoisted_10$3 = ["src", "alt"];
37638
- const _hoisted_11$3 = ["onClick", "onDblclick", "onContextmenu"];
37639
- const _hoisted_12$2 = ["type", "checked", "disabled", "onChange"];
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"];
37640
37915
  const _hoisted_13$2 = ["onClick"];
37641
37916
  const _hoisted_14$1 = ["colspan", "rowspan", "data-row-key", "data-prop", "onClick", "onDblclick"];
37642
37917
  const _hoisted_15$1 = ["onClick"];
@@ -38723,7 +38998,7 @@ return (_ctx, _cache) => {
38723
38998
  key: 0,
38724
38999
  class: normalizeClass(unref(ns).e('resize-handle')),
38725
39000
  onPointerdown: withModifiers($event => (unref(handleResizeStart)($event, cell.column, $event.currentTarget.parentElement)), ["stop"])
38726
- }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_6$9))
39001
+ }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_6$a))
38727
39002
  : createCommentVNode("v-if", true)
38728
39003
  ], 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_5$b))
38729
39004
  }), 128 /* KEYED_FRAGMENT */))
@@ -38755,7 +39030,7 @@ return (_ctx, _cache) => {
38755
39030
  checked: unref(isAllSelected),
38756
39031
  indeterminate: unref(isIndeterminate),
38757
39032
  onChange: _cache[1] || (_cache[1] = (...args) => (unref(toggleAllSelection) && unref(toggleAllSelection)(...args)))
38758
- }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_7$8))
39033
+ }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_7$9))
38759
39034
  : createCommentVNode("v-if", true)
38760
39035
  ], 2 /* CLASS */)
38761
39036
  ], 6 /* CLASS, STYLE */))
@@ -38873,9 +39148,9 @@ return (_ctx, _cache) => {
38873
39148
  key: 0,
38874
39149
  class: normalizeClass(unref(ns).e('resize-handle')),
38875
39150
  onPointerdown: withModifiers($event => (unref(handleResizeStart)($event, column, $event.currentTarget.parentElement)), ["stop"])
38876
- }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_9$6))
39151
+ }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_9$7))
38877
39152
  : createCommentVNode("v-if", true)
38878
- ], 16 /* FULL_PROPS */, _hoisted_8$7))
39153
+ ], 16 /* FULL_PROPS */, _hoisted_8$8))
38879
39154
  }), 128 /* KEYED_FRAGMENT */))
38880
39155
  ], 6 /* CLASS, STYLE */)
38881
39156
  ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
@@ -38922,7 +39197,7 @@ return (_ctx, _cache) => {
38922
39197
  createElementVNode("img", {
38923
39198
  src: _ctx.emptyConfig.image,
38924
39199
  alt: unref(t)('common.noData')
38925
- }, null, 8 /* PROPS */, _hoisted_10$3)
39200
+ }, null, 8 /* PROPS */, _hoisted_10$4)
38926
39201
  ], 2 /* CLASS */))
38927
39202
  : createCommentVNode("v-if", true),
38928
39203
  createElementVNode("div", {
@@ -39001,7 +39276,7 @@ return (_ctx, _cache) => {
39001
39276
  checked: unref(isRowSelected)(row),
39002
39277
  disabled: !unref(isRowSelectable)(row, rowIndex),
39003
39278
  onChange: $event => (unref(toggleRowSelection)(row))
39004
- }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_12$2)
39279
+ }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_12$3)
39005
39280
  ], 6 /* CLASS, STYLE */))
39006
39281
  : createCommentVNode("v-if", true),
39007
39282
  createCommentVNode(" 展开列 "),
@@ -39132,7 +39407,7 @@ return (_ctx, _cache) => {
39132
39407
  : createCommentVNode("v-if", true)
39133
39408
  ], 64 /* STABLE_FRAGMENT */))
39134
39409
  }), 128 /* KEYED_FRAGMENT */))
39135
- ], 16 /* FULL_PROPS */, _hoisted_11$3),
39410
+ ], 16 /* FULL_PROPS */, _hoisted_11$4),
39136
39411
  createCommentVNode(" 展开行内容 "),
39137
39412
  (_ctx.expandConfig && expandedRowKeys.value.has(getRowKeyFn(row)))
39138
39413
  ? (openBlock(), createElementBlock("tr", {
@@ -40525,6 +40800,7 @@ watch(dropdownVisible, (val) => {
40525
40800
  nextTick(updateDropdownPosition);
40526
40801
  emit("open");
40527
40802
  } else {
40803
+ dropdownStyle.value = {};
40528
40804
  emit("close");
40529
40805
  }
40530
40806
  });
@@ -40553,6 +40829,7 @@ const debouncedSearch = (keyword, trigger) => {
40553
40829
  }, props.debounce);
40554
40830
  };
40555
40831
  const handleInput = (event) => {
40832
+ if (event.isComposing) return;
40556
40833
  const target = event.target;
40557
40834
  const value = target.value;
40558
40835
  const rawCursor = target.selectionStart;
@@ -41445,10 +41722,26 @@ const loadFileTree = async (type, keyword = "") => {
41445
41722
  try {
41446
41723
  let nodes = [];
41447
41724
  if (props.fileLoader) {
41448
- nodes = await props.fileLoader(keyword, type);
41725
+ nodes = await props.fileLoader(keyword, type, props.fileRoot);
41449
41726
  } else {
41450
41727
  nodes = generateMockFileTree(type, keyword);
41451
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
+ }
41452
41745
  fileTreeData.value = nodes;
41453
41746
  emit("file-load", type, nodes);
41454
41747
  if (props.fileTreeExpandedLevel > 0) {
@@ -41798,6 +42091,10 @@ watch(showFileTree, (val) => {
41798
42091
  onBeforeUnmount(() => {
41799
42092
  window.removeEventListener("scroll", updatePanelPosition, true);
41800
42093
  window.removeEventListener("resize", updatePanelPosition, true);
42094
+ if (searchDebounceTimer) {
42095
+ clearTimeout(searchDebounceTimer);
42096
+ searchDebounceTimer = null;
42097
+ }
41801
42098
  });
41802
42099
  const refreshFileTree = () => {
41803
42100
  if (currentFileType.value) {
@@ -41852,7 +42149,8 @@ return (_ctx, _cache) => {
41852
42149
  onFocus: _cache[0] || (_cache[0] = $event => (emit('focus', $event))),
41853
42150
  onBlur: _cache[1] || (_cache[1] = $event => (emit('blur', $event))),
41854
42151
  onInput: _cache[2] || (_cache[2] = $event => (emit('input', $event))),
41855
- 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)))
41856
42154
  }), createSlots({
41857
42155
  option: withCtx(({ option }) => [
41858
42156
  createElementVNode("div", {
@@ -42028,9 +42326,11 @@ watch(
42028
42326
  const innerValue = computed({
42029
42327
  get: () => localValue.value,
42030
42328
  set: (val) => {
42031
- localValue.value = val;
42032
- emit("update:modelValue", val);
42033
- emit("change", val);
42329
+ if (localValue.value !== val) {
42330
+ localValue.value = val;
42331
+ emit("update:modelValue", val);
42332
+ emit("change", val);
42333
+ }
42034
42334
  }
42035
42335
  });
42036
42336
  const filteredCommands = computed(() => {
@@ -44663,7 +44963,9 @@ function sanitizeMarkup(html, options = {}) {
44663
44963
  }
44664
44964
  function sanitizeHighlightedHtml(html, options = {}) {
44665
44965
  const source = options.sanitizer ? options.sanitizer(html) : html;
44666
- 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(/\son[a-z-]+\s*=\s*(['"]).*?\1/gi, "").replace(/\son[a-z-]+\s*=\s*[^\s>]+/gi, "").replace(/javascript:/gi, "");
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, "");
44667
44969
  }
44668
44970
  function sanitizeSvgMarkup(svg, options = {}) {
44669
44971
  return sanitizeMarkup(svg, {
@@ -45280,16 +45582,16 @@ const _hoisted_2$h = ["innerHTML"];
45280
45582
  const _hoisted_3$e = { class: "hljs json" };
45281
45583
  const _hoisted_4$9 = ["innerHTML"];
45282
45584
  const _hoisted_5$9 = { key: 0 };
45283
- const _hoisted_6$8 = { key: 0 };
45284
- const _hoisted_7$7 = ["href", "title", "onClick"];
45285
- const _hoisted_8$6 = { key: 0 };
45286
- const _hoisted_9$5 = {
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 = {
45287
45589
  key: 1,
45288
45590
  class: "publish-time"
45289
45591
  };
45290
- const _hoisted_10$2 = { class: "code-edit-modal" };
45291
- const _hoisted_11$2 = { class: "code-edit-header" };
45292
- const _hoisted_12$1 = { class: "code-edit-body" };
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" };
45293
45595
  const _hoisted_13$1 = { class: "code-edit-footer" };
45294
45596
 
45295
45597
  const _sfc_main$y = /*@__PURE__*/Object.assign({
@@ -45297,10 +45599,12 @@ const _sfc_main$y = /*@__PURE__*/Object.assign({
45297
45599
  }, {
45298
45600
  __name: 'ai-bubble',
45299
45601
  props: aiBubbleProps,
45300
- setup(__props) {
45602
+ emits: ["copy-fail"],
45603
+ setup(__props, { emit: __emit }) {
45301
45604
 
45302
45605
 
45303
45606
  const props = __props;
45607
+ const emit = __emit;
45304
45608
  const ns = useNamespace("ai-bubble");
45305
45609
  const { t } = useLocale();
45306
45610
  const hasMounted = ref(false);
@@ -45309,22 +45613,24 @@ const { themeStyle } = useComponentTheme(
45309
45613
  computed(() => props.themeOverrides)
45310
45614
  );
45311
45615
  const playingAsset = ref(null);
45312
- let audioInstance = null;
45616
+ const audioInstance = ref(null);
45313
45617
  const handleAudioToggle = (url) => {
45314
45618
  if (playingAsset.value === url) {
45315
- audioInstance?.pause();
45619
+ audioInstance.value?.pause();
45316
45620
  playingAsset.value = null;
45317
45621
  } else {
45318
- if (audioInstance) {
45319
- audioInstance.pause();
45622
+ if (audioInstance.value) {
45623
+ audioInstance.value.pause();
45624
+ audioInstance.value.src = "";
45320
45625
  }
45321
45626
  playingAsset.value = url;
45322
- audioInstance = new Audio(url);
45323
- audioInstance.play().catch((err) => {
45627
+ const audio = new Audio(url);
45628
+ audioInstance.value = audio;
45629
+ audio.play().catch((err) => {
45324
45630
  console.warn("Audio playback failed:", err);
45325
45631
  playingAsset.value = null;
45326
45632
  });
45327
- audioInstance.onended = () => {
45633
+ audio.onended = () => {
45328
45634
  playingAsset.value = null;
45329
45635
  };
45330
45636
  }
@@ -45497,13 +45803,37 @@ const toggleCodeBlock = (id) => {
45497
45803
  expandedCodeBlocks.value.add(id);
45498
45804
  }
45499
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
+ };
45500
45830
  const copyCode = async (code, id) => {
45501
- try {
45502
- await navigator.clipboard.writeText(code);
45831
+ const success = await copyTextToClipboard(code);
45832
+ if (success) {
45503
45833
  copiedCodeBlocks.value.add(id);
45504
45834
  setTimeout(() => copiedCodeBlocks.value.delete(id), 2e3);
45505
- } catch (e) {
45506
- console.error("Copy failed:", e);
45835
+ } else {
45836
+ emit("copy-fail", new Error("Copy failed"));
45507
45837
  }
45508
45838
  };
45509
45839
  const openCodeEditor = async (code, id, lang) => {
@@ -45530,12 +45860,12 @@ const saveEditCode = async (id) => {
45530
45860
  if (monacoEditor.value) {
45531
45861
  editCodeContent.value = monacoEditor.value.getValue();
45532
45862
  }
45533
- try {
45534
- await navigator.clipboard.writeText(editCodeContent.value);
45863
+ const success = await copyTextToClipboard(editCodeContent.value);
45864
+ if (success) {
45535
45865
  copiedCodeBlocks.value.add(id);
45536
45866
  setTimeout(() => copiedCodeBlocks.value.delete(id), 2e3);
45537
- } catch (e) {
45538
- console.error("Copy edited code failed:", e);
45867
+ } else {
45868
+ emit("copy-fail", new Error("Copy failed"));
45539
45869
  }
45540
45870
  editingCodeBlock.value = null;
45541
45871
  editCodeContent.value = "";
@@ -46083,9 +46413,10 @@ watch(
46083
46413
  { immediate: true }
46084
46414
  );
46085
46415
  onBeforeUnmount(() => {
46086
- if (audioInstance) {
46087
- audioInstance.pause();
46088
- audioInstance = null;
46416
+ if (audioInstance.value) {
46417
+ audioInstance.value.pause();
46418
+ audioInstance.value.src = "";
46419
+ audioInstance.value = null;
46089
46420
  }
46090
46421
  if (streamTimer) {
46091
46422
  clearInterval(streamTimer);
@@ -46349,7 +46680,7 @@ return (_ctx, _cache) => {
46349
46680
  : createCommentVNode("v-if", true)
46350
46681
  ]),
46351
46682
  (_ctx.structuredData.data && typeof _ctx.structuredData.data === 'object')
46352
- ? (openBlock(), createElementBlock("tbody", _hoisted_6$8, [
46683
+ ? (openBlock(), createElementBlock("tbody", _hoisted_6$9, [
46353
46684
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.structuredData.data.rows, (row, idx) => {
46354
46685
  return (openBlock(), createElementBlock("tr", { key: idx }, [
46355
46686
  (openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, cIdx) => {
@@ -46511,7 +46842,7 @@ return (_ctx, _cache) => {
46511
46842
  class: normalizeClass(unref(ns).e('citation-link-icon'))
46512
46843
  }, null, 8 /* PROPS */, ["class"]))
46513
46844
  : createCommentVNode("v-if", true)
46514
- ], 10 /* CLASS, PROPS */, _hoisted_7$7))
46845
+ ], 10 /* CLASS, PROPS */, _hoisted_7$8))
46515
46846
  }), 128 /* KEYED_FRAGMENT */))
46516
46847
  ], 2 /* CLASS */)
46517
46848
  ], 2 /* CLASS */))
@@ -46560,10 +46891,10 @@ return (_ctx, _cache) => {
46560
46891
  }, [
46561
46892
  createElementVNode("h4", null, toDisplayString(hoveredCitation.value.title), 1 /* TEXT */),
46562
46893
  (hoveredCitation.value.abstract)
46563
- ? (openBlock(), createElementBlock("p", _hoisted_8$6, toDisplayString(hoveredCitation.value.abstract), 1 /* TEXT */))
46894
+ ? (openBlock(), createElementBlock("p", _hoisted_8$7, toDisplayString(hoveredCitation.value.abstract), 1 /* TEXT */))
46564
46895
  : createCommentVNode("v-if", true),
46565
46896
  (hoveredCitation.value.publishTime)
46566
- ? (openBlock(), createElementBlock("span", _hoisted_9$5, toDisplayString(hoveredCitation.value.publishTime), 1 /* TEXT */))
46897
+ ? (openBlock(), createElementBlock("span", _hoisted_9$6, toDisplayString(hoveredCitation.value.publishTime), 1 /* TEXT */))
46567
46898
  : createCommentVNode("v-if", true)
46568
46899
  ], 2 /* CLASS */)
46569
46900
  ], 2 /* CLASS */)
@@ -46588,8 +46919,8 @@ return (_ctx, _cache) => {
46588
46919
  class: "code-edit-modal-overlay",
46589
46920
  onClick: withModifiers(cancelEditCode, ["self"])
46590
46921
  }, [
46591
- createElementVNode("div", _hoisted_10$2, [
46592
- createElementVNode("div", _hoisted_11$2, [
46922
+ createElementVNode("div", _hoisted_10$3, [
46923
+ createElementVNode("div", _hoisted_11$3, [
46593
46924
  _cache[3] || (_cache[3] = createElementVNode("h3", null, "Edit Code", -1 /* CACHED */)),
46594
46925
  createVNode(unref(YhButton), {
46595
46926
  text: "",
@@ -46601,7 +46932,7 @@ return (_ctx, _cache) => {
46601
46932
  _: 1 /* STABLE */
46602
46933
  })
46603
46934
  ]),
46604
- createElementVNode("div", _hoisted_12$1, [
46935
+ createElementVNode("div", _hoisted_12$2, [
46605
46936
  createElementVNode("div", {
46606
46937
  ref_key: "monacoContainer",
46607
46938
  ref: monacoContainer,
@@ -46719,14 +47050,14 @@ const emit = __emit;
46719
47050
  const ns = useNamespace("ai-chat");
46720
47051
  const { t } = useLocale();
46721
47052
  const { themeStyle } = useComponentTheme("ai-chat", props.themeOverrides);
46722
- const contentRef = ref();
46723
47053
  const virtualScrollEnabled = computed(() => props.virtualScroll && props.messages.length > 50);
46724
- const { visibleItems, totalHeight, offsetY, startIndex, onScroll, scrollToIndex } = useVirtualScroll$1({
47054
+ const { visibleItems, totalHeight, offsetY, startIndex, onScroll, scrollToIndex, containerRef } = useVirtualScroll$1({
46725
47055
  items: computed(() => props.messages),
46726
47056
  itemHeight: props.estimatedItemHeight,
46727
47057
  containerHeight: props.virtualHeight,
46728
47058
  overscan: 5
46729
47059
  });
47060
+ const contentRef = containerRef;
46730
47061
  const scrollToBottom = () => {
46731
47062
  nextTick(() => {
46732
47063
  if (virtualScrollEnabled.value && props.messages.length > 0) {
@@ -46785,8 +47116,8 @@ return (_ctx, _cache) => {
46785
47116
  createCommentVNode(" Messages List "),
46786
47117
  createElementVNode("div", {
46787
47118
  class: normalizeClass(unref(ns).e('content')),
46788
- ref_key: "contentRef",
46789
- ref: contentRef,
47119
+ ref_key: "containerRef",
47120
+ ref: containerRef,
46790
47121
  style: normalizeStyle(virtualScrollEnabled.value ? {
46791
47122
  height: props.virtualHeight + 'px',
46792
47123
  overflow: 'auto'
@@ -48377,24 +48708,29 @@ const actionItems = computed(() => {
48377
48708
  icon: defaultIcons[item] || "more",
48378
48709
  label: "",
48379
48710
  // 通常泡泡底座不需要文字标签
48380
- tooltip: defaultLabels.value[item] || item
48711
+ tooltip: defaultLabels.value[item] || item,
48712
+ _original: item
48381
48713
  };
48382
48714
  }
48383
48715
  return {
48384
48716
  ...item,
48385
- icon: item.icon || defaultIcons[item.key] || "more"
48717
+ icon: item.icon || defaultIcons[item.key] || "more",
48718
+ _original: item
48386
48719
  };
48387
48720
  });
48388
48721
  });
48389
48722
  const handleClick = (item) => {
48390
- if (typeof item === "object" && item.disabled) return;
48391
- const key = typeof item === "string" ? item : item.key;
48392
- emit("click", key, item);
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);
48393
48729
  };
48394
48730
 
48395
48731
  return (_ctx, _cache) => {
48396
48732
  return (openBlock(), createElementBlock("div", {
48397
- 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)]),
48398
48734
  style: normalizeStyle(unref(themeStyle))
48399
48735
  }, [
48400
48736
  (openBlock(true), createElementBlock(Fragment, null, renderList(actionItems.value, (item, index) => {
@@ -48692,13 +49028,28 @@ watch(
48692
49028
  localValue.value = val;
48693
49029
  }
48694
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
+ };
48695
49044
  const innerValue = computed({
48696
49045
  get: () => localValue.value,
48697
49046
  set: (val) => {
48698
49047
  localValue.value = val;
48699
49048
  emit("update:modelValue", val);
48700
49049
  emit("change", val);
48701
- checkCommandTrigger(val);
49050
+ if (!isComposing.value) {
49051
+ checkCommandTrigger(val);
49052
+ }
48702
49053
  }
48703
49054
  });
48704
49055
  const autoResize = () => {
@@ -48708,7 +49059,12 @@ const autoResize = () => {
48708
49059
  el.style.height = `${Math.min(el.scrollHeight, 200)}px`;
48709
49060
  };
48710
49061
  const handleInput = (e) => {
48711
- innerValue.value = e.target.value;
49062
+ const val = e.target.value;
49063
+ if (isComposing.value) {
49064
+ localValue.value = val;
49065
+ return;
49066
+ }
49067
+ innerValue.value = val;
48712
49068
  nextTick(() => {
48713
49069
  autoResize();
48714
49070
  updateCommandPanelPosition();
@@ -48861,13 +49217,22 @@ const getCommandIcon = (command) => {
48861
49217
  if (command.icon) return command.icon;
48862
49218
  return "command";
48863
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
+ };
48864
49228
  __expose({
48865
49229
  focus: () => textareaRef.value?.focus(),
48866
49230
  blur: () => textareaRef.value?.blur(),
48867
49231
  clear: () => {
48868
49232
  localValue.value = "";
48869
49233
  hideCommandPanel();
48870
- }
49234
+ },
49235
+ triggerCommand
48871
49236
  });
48872
49237
 
48873
49238
  return (_ctx, _cache) => {
@@ -48920,7 +49285,9 @@ return (_ctx, _cache) => {
48920
49285
  onFocus: _cache[1] || (_cache[1] = $event => (isFocused.value = true)),
48921
49286
  onBlur: _cache[2] || (_cache[2] = $event => (isFocused.value = false)),
48922
49287
  onInput: handleInput,
48923
- onKeydown: handleKeyDown
49288
+ onKeydown: handleKeyDown,
49289
+ onCompositionstart: handleCompositionStart,
49290
+ onCompositionend: handleCompositionEnd
48924
49291
  }, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_1$i), [
48925
49292
  [vModelText, innerValue.value]
48926
49293
  ])
@@ -49190,6 +49557,29 @@ const aiArtifactsProps = {
49190
49557
  chartLoadingText: {
49191
49558
  type: String,
49192
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
49193
49583
  }
49194
49584
  };
49195
49585
  const aiArtifactsEmits = {
@@ -49202,11 +49592,154 @@ const aiArtifactsEmits = {
49202
49592
  close: () => true
49203
49593
  };
49204
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
+
49205
49731
  const _hoisted_1$h = ["onClick"];
49206
49732
  const _hoisted_2$e = ["src", "sandbox"];
49207
- const _hoisted_3$b = ["innerHTML"];
49208
- const _hoisted_4$8 = { key: 0 };
49209
- const _hoisted_5$8 = { key: 1 };
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 };
49210
49743
 
49211
49744
  const _sfc_main$p = /*@__PURE__*/Object.assign({
49212
49745
  name: "YhAiArtifacts"
@@ -49228,6 +49761,31 @@ const { themeStyle } = useComponentTheme(
49228
49761
  );
49229
49762
  const internalMode = ref(props.mode);
49230
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
+ });
49231
49789
  const escapeHtml = (value) => value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
49232
49790
  const echartsRef = ref(null);
49233
49791
  const echartsInstance = shallowRef(null);
@@ -49252,6 +49810,12 @@ const getIcon = (type) => {
49252
49810
  if (type === "canvas") return "edit";
49253
49811
  if (type === "sandbox") return "play";
49254
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";
49255
49819
  return "document";
49256
49820
  };
49257
49821
  const currentVersionData = computed(() => {
@@ -49292,12 +49856,7 @@ const revokeCurrentUrl = () => {
49292
49856
  }
49293
49857
  };
49294
49858
  watch(
49295
- () => [
49296
- props.visible,
49297
- currentVersionData.value?.content,
49298
- props.data?.type,
49299
- internalMode.value
49300
- ],
49859
+ () => [props.visible, currentVersionData.value?.content, props.data?.type, activeMode.value],
49301
49860
  ([visible, content, type, mode]) => {
49302
49861
  revokeCurrentUrl();
49303
49862
  if (visible && content && (type === "html" || type === "sandbox") && (mode === "preview" || mode === "inline") && typeof window !== "undefined") {
@@ -49392,7 +49951,7 @@ const initECharts = async () => {
49392
49951
  }
49393
49952
  };
49394
49953
  watch(
49395
- () => [props.visible, isEChartsContainer.value, getEchartsOption.value, internalMode.value],
49954
+ () => [props.visible, isEChartsContainer.value, getEchartsOption.value, activeMode.value],
49396
49955
  ([newVisible, isChart, , mode]) => {
49397
49956
  if (newVisible && isChart && (mode === "preview" || mode === "inline")) {
49398
49957
  nextTick(() => {
@@ -49402,8 +49961,99 @@ watch(
49402
49961
  },
49403
49962
  { immediate: true }
49404
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
+ );
49405
50054
  onBeforeUnmount(() => {
49406
50055
  revokeCurrentUrl();
50056
+ revokeSandboxBlobUrl();
49407
50057
  if (chartResizeObserver) {
49408
50058
  chartResizeObserver.disconnect();
49409
50059
  chartResizeObserver = null;
@@ -49412,9 +50062,16 @@ onBeforeUnmount(() => {
49412
50062
  echartsInstance.value.dispose();
49413
50063
  echartsInstance.value = null;
49414
50064
  }
50065
+ if (typeof window !== "undefined") {
50066
+ window.removeEventListener("message", handleRendererMessage);
50067
+ }
49415
50068
  });
49416
50069
  onMounted(() => {
49417
50070
  loadHighlightStyle();
50071
+ if (typeof window !== "undefined") {
50072
+ window.addEventListener("message", handleRendererMessage);
50073
+ createVueSandbox();
50074
+ }
49418
50075
  });
49419
50076
  const chartContainerStyle = computed(() => ({
49420
50077
  height: typeof props.chartHeight === "number" ? props.chartHeight + "px" : props.chartHeight
@@ -49426,9 +50083,9 @@ return (_ctx, _cache) => {
49426
50083
  (_ctx.visible)
49427
50084
  ? (openBlock(), createElementBlock("div", {
49428
50085
  key: 0,
49429
- class: normalizeClass([unref(ns).b(), unref(ns).m(internalMode.value)]),
50086
+ class: normalizeClass([unref(ns).b(), unref(ns).m(activeMode.value), unref(ns).is('fullscreen', props.fullscreen)]),
49430
50087
  style: normalizeStyle([{
49431
- width: typeof _ctx.width === 'number' ? _ctx.width + 'px' : _ctx.width
50088
+ width: props.fullscreen ? '100%' : typeof _ctx.width === 'number' ? _ctx.width + 'px' : _ctx.width
49432
50089
  }, unref(themeStyle)])
49433
50090
  }, [
49434
50091
  createCommentVNode(" Header "),
@@ -49448,25 +50105,28 @@ return (_ctx, _cache) => {
49448
50105
  createElementVNode("div", {
49449
50106
  class: normalizeClass(unref(ns).e('actions'))
49450
50107
  }, [
49451
- createElementVNode("div", {
49452
- class: normalizeClass(unref(ns).e('tabs'))
49453
- }, [
49454
- createElementVNode("button", {
49455
- class: normalizeClass([unref(ns).e('tab'), unref(ns).is('active', internalMode.value === 'preview')]),
49456
- onClick: _cache[0] || (_cache[0] = $event => (toggleMode('preview')))
49457
- }, toDisplayString(unref(t)("ai.artifacts.preview")), 3 /* TEXT, CLASS */),
49458
- (_ctx.data?.type === 'html')
49459
- ? (openBlock(), createElementBlock("button", {
49460
- key: 0,
49461
- class: normalizeClass([unref(ns).e('tab'), unref(ns).is('active', internalMode.value === 'inline')]),
49462
- onClick: _cache[1] || (_cache[1] = $event => (toggleMode('inline')))
49463
- }, toDisplayString(unref(t)("ai.artifacts.inline")), 3 /* TEXT, CLASS */))
49464
- : createCommentVNode("v-if", true),
49465
- createElementVNode("button", {
49466
- class: normalizeClass([unref(ns).e('tab'), unref(ns).is('active', internalMode.value === 'code')]),
49467
- onClick: _cache[2] || (_cache[2] = $event => (toggleMode('code')))
49468
- }, toDisplayString(unref(t)("ai.artifacts.code")), 3 /* TEXT, CLASS */)
49469
- ], 2 /* CLASS */),
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),
49470
50130
  createVNode(unref(YhButton), {
49471
50131
  text: "",
49472
50132
  circle: "",
@@ -49508,107 +50168,191 @@ return (_ctx, _cache) => {
49508
50168
  createElementVNode("div", {
49509
50169
  class: normalizeClass(unref(ns).e('content'))
49510
50170
  }, [
49511
- (internalMode.value === 'preview' || internalMode.value === 'inline')
50171
+ (activeMode.value === 'preview' || activeMode.value === 'inline')
49512
50172
  ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
49513
- (_ctx.data?.type === 'html' || _ctx.data?.type === 'sandbox')
49514
- ? (openBlock(), createElementBlock("iframe", {
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, {
49515
50176
  key: 0,
49516
- src: sandboxSrcUrl.value,
49517
- class: normalizeClass(unref(ns).e('sandbox')),
49518
- sandbox: _ctx.data?.type === 'sandbox' ? 'allow-scripts' : ''
49519
- }, null, 10 /* CLASS, PROPS */, _hoisted_2$e))
49520
- : createCommentVNode("v-if", true),
49521
- createCommentVNode(" ECharts 图表 (使用 v-show 保持 DOM) "),
49522
- withDirectives(createElementVNode("div", {
49523
- class: normalizeClass(unref(ns).e('echarts-wrapper')),
49524
- style: normalizeStyle([chartContainerStyle.value, {"position":"relative"}])
49525
- }, [
49526
- createElementVNode("div", {
49527
- ref_key: "echartsRef",
49528
- ref: echartsRef,
49529
- class: normalizeClass(unref(ns).e('echarts-container')),
49530
- style: {"width":"100%","height":"100%"}
49531
- }, null, 2 /* CLASS */),
49532
- (echartsLoading.value)
49533
- ? (openBlock(), createBlock(unref(YhSpin), {
49534
- key: 0,
49535
- class: normalizeClass(unref(ns).e('chart-loading')),
49536
- style: {"position":"absolute","top":"50%","left":"50%","transform":"translate(-50%, -50%)"}
49537
- }, {
49538
- default: withCtx(() => [
49539
- createElementVNode("span", null, toDisplayString(_ctx.chartLoadingText ?? unref(t)("ai.artifacts.renderingChart")), 1 /* TEXT */)
49540
- ]),
49541
- _: 1 /* STABLE */
49542
- }, 8 /* PROPS */, ["class"]))
49543
- : (echartsError.value)
49544
- ? (openBlock(), createElementBlock("div", {
49545
- key: 1,
49546
- class: normalizeClass(unref(ns).e('chart-error')),
49547
- style: {"position":"absolute","top":"50%","left":"50%","transform":"translate(-50%, -50%)","display":"flex","flex-direction":"column","align-items":"center"}
49548
- }, [
49549
- createVNode(unref(YhIcon), { name: "warning" }),
49550
- 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 */)
49551
- ], 2 /* CLASS */))
49552
- : createCommentVNode("v-if", true)
49553
- ], 6 /* CLASS, STYLE */), [
49554
- [vShow, isEChartsContainer.value]
49555
- ]),
49556
- createCommentVNode(" 其他类型 "),
49557
- (_ctx.data?.type !== 'html' && _ctx.data?.type !== 'sandbox' && !isEChartsContainer.value)
49558
- ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
49559
- createCommentVNode(" 通用图表 "),
49560
- (_ctx.data?.type === 'chart')
49561
- ? (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", {
49562
50183
  key: 0,
49563
- class: normalizeClass(unref(ns).e('chart-container')),
49564
- style: normalizeStyle(chartContainerStyle.value)
49565
- }, [
49566
- renderSlot(_ctx.$slots, "chart", {
49567
- data: currentVersionData.value,
49568
- title: _ctx.data.title
49569
- }, () => [
49570
- createElementVNode("div", {
49571
- class: normalizeClass(unref(ns).e('placeholder'))
49572
- }, [
49573
- createVNode(unref(YhIcon), { name: "chart-bar" }),
49574
- createElementVNode("p", null, toDisplayString(unref(t)("ai.artifacts.renderingChart")), 1 /* TEXT */)
49575
- ], 2 /* CLASS */)
49576
- ])
49577
- ], 6 /* CLASS, STYLE */))
49578
- : (_ctx.data?.type === 'canvas')
49579
- ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
49580
- createCommentVNode(" 画布 "),
49581
- createElementVNode("div", {
49582
- class: normalizeClass(unref(ns).e('canvas-container'))
49583
- }, [
49584
- renderSlot(_ctx.$slots, "canvas", { data: currentVersionData.value }, () => [
49585
- createElementVNode("div", {
49586
- class: normalizeClass(unref(ns).e('placeholder'))
49587
- }, [
49588
- createVNode(unref(YhIcon), { name: "edit" }),
49589
- createElementVNode("p", null, toDisplayString(unref(t)("ai.artifacts.renderingCanvas")), 1 /* TEXT */)
49590
- ], 2 /* CLASS */)
49591
- ])
49592
- ], 2 /* CLASS */)
49593
- ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
49594
- : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
49595
- createCommentVNode(" 占位 "),
49596
- createElementVNode("div", {
49597
- 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"}
49598
50216
  }, [
49599
- createVNode(unref(YhIcon), { name: "sparkles" }),
49600
- createElementVNode("p", null, toDisplayString(unref(t)("ai.artifacts.rendering")), 1 /* TEXT */)
49601
- ], 2 /* CLASS */)
49602
- ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
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)
49603
50348
  ], 64 /* STABLE_FRAGMENT */))
49604
- : createCommentVNode("v-if", true)
49605
50349
  ], 64 /* STABLE_FRAGMENT */))
49606
50350
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
49607
50351
  createCommentVNode(" eslint-disable-next-line vue/no-v-html "),
49608
50352
  createElementVNode("pre", {
49609
50353
  class: normalizeClass(unref(ns).e('code-viewer'))
49610
50354
  }, [
49611
- createElementVNode("code", { innerHTML: highlightedCode.value }, null, 8 /* PROPS */, _hoisted_3$b)
50355
+ createElementVNode("code", { innerHTML: highlightedCode.value }, null, 8 /* PROPS */, _hoisted_10$2)
49612
50356
  ], 2 /* CLASS */)
49613
50357
  ], 64 /* STABLE_FRAGMENT */))
49614
50358
  ], 2 /* CLASS */),
@@ -49617,10 +50361,10 @@ return (_ctx, _cache) => {
49617
50361
  class: normalizeClass(unref(ns).e('footer'))
49618
50362
  }, [
49619
50363
  (currentVersionData.value?.timestamp)
49620
- ? (openBlock(), createElementBlock("span", _hoisted_4$8, toDisplayString(currentVersionData.value.timestamp), 1 /* TEXT */))
50364
+ ? (openBlock(), createElementBlock("span", _hoisted_11$2, toDisplayString(currentVersionData.value.timestamp), 1 /* TEXT */))
49621
50365
  : createCommentVNode("v-if", true),
49622
50366
  (currentVersionData.value?.description)
49623
- ? (openBlock(), createElementBlock("span", _hoisted_5$8, toDisplayString(currentVersionData.value.description), 1 /* TEXT */))
50367
+ ? (openBlock(), createElementBlock("span", _hoisted_12$1, toDisplayString(currentVersionData.value.description), 1 /* TEXT */))
49624
50368
  : createCommentVNode("v-if", true)
49625
50369
  ], 2 /* CLASS */)
49626
50370
  ], 6 /* CLASS, STYLE */))
@@ -49740,8 +50484,15 @@ const syncAmplitudes = () => {
49740
50484
  const toggleRecording = () => {
49741
50485
  if (props.recording === void 0 || props.recording === null) {
49742
50486
  localRecording.value = !localRecording.value;
49743
- if (localRecording.value) startVisualizer();
49744
- else stopVisualizer();
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
+ }
49745
50496
  return;
49746
50497
  }
49747
50498
  const newStatus = !props.recording;
@@ -49756,7 +50507,11 @@ const toggleRecording = () => {
49756
50507
  };
49757
50508
  const handleCancel = (e) => {
49758
50509
  e.stopPropagation();
50510
+ if (props.recording === void 0 || props.recording === null) {
50511
+ localRecording.value = false;
50512
+ }
49759
50513
  emit("update:recording", false);
50514
+ emit("stop");
49760
50515
  emit("cancel");
49761
50516
  stopVisualizer();
49762
50517
  };
@@ -49788,7 +50543,7 @@ return (_ctx, _cache) => {
49788
50543
  disabled: props.variant === 'inline' || !props.teleport
49789
50544
  }, [
49790
50545
  createElementVNode("div", {
49791
- class: normalizeClass([unref(ns).b(), unref(ns).m(props.variant), unref(ns).m(props.position), unref(ns).is('recording', props.recording || localRecording.value)]),
50546
+ class: normalizeClass([unref(ns).b(), unref(ns).m(props.variant), unref(ns).m(props.position), unref(ns).is('recording', isCurrentlyRecording.value)]),
49792
50547
  style: normalizeStyle([props.variant !== 'inline' ? {
49793
50548
  position: props.teleport ? 'fixed' : 'relative',
49794
50549
  [props.position.split('-')[0]]: props.teleport ? props.offset[0] + 'px' : 'auto',
@@ -49801,7 +50556,7 @@ return (_ctx, _cache) => {
49801
50556
  createCommentVNode(" Waveform Visualizer "),
49802
50557
  createVNode(Transition, { name: "yh-voice-expand" }, {
49803
50558
  default: withCtx(() => [
49804
- (props.recording || localRecording.value)
50559
+ (isCurrentlyRecording.value)
49805
50560
  ? (openBlock(), createElementBlock("div", {
49806
50561
  key: 0,
49807
50562
  class: normalizeClass(unref(ns).e('visualizer'))
@@ -49861,24 +50616,24 @@ return (_ctx, _cache) => {
49861
50616
  createCommentVNode(" Main Trigger Button "),
49862
50617
  createElementVNode("button", {
49863
50618
  class: normalizeClass([unref(ns).e('trigger'), {
49864
- 'is-active': props.recording || localRecording.value
50619
+ 'is-active': isCurrentlyRecording.value
49865
50620
  }]),
49866
50621
  onClick: toggleRecording
49867
50622
  }, [
49868
50623
  createElementVNode("span", {
49869
50624
  class: normalizeClass(unref(ns).e('mic'))
49870
50625
  }, [
49871
- (props.variant === 'sphere' && (props.recording || localRecording.value))
50626
+ (props.variant === 'sphere' && isCurrentlyRecording.value)
49872
50627
  ? (openBlock(), createElementBlock("div", {
49873
50628
  key: 0,
49874
50629
  class: normalizeClass(unref(ns).e('sphere-inner'))
49875
50630
  }, null, 2 /* CLASS */))
49876
50631
  : (openBlock(), createBlock(unref(YhIcon), {
49877
50632
  key: 1,
49878
- name: props.recording || localRecording.value ? 'video-pause' : 'microphone'
50633
+ name: isCurrentlyRecording.value ? 'video-pause' : 'microphone'
49879
50634
  }, null, 8 /* PROPS */, ["name"]))
49880
50635
  ], 2 /* CLASS */),
49881
- (!(props.recording || localRecording.value) && props.variant === 'inline')
50636
+ (!isCurrentlyRecording.value && props.variant === 'inline')
49882
50637
  ? (openBlock(), createElementBlock("span", {
49883
50638
  key: 0,
49884
50639
  class: normalizeClass(unref(ns).e('label'))
@@ -50034,7 +50789,8 @@ const {
50034
50789
  totalHeight,
50035
50790
  offsetY,
50036
50791
  onScroll: handleVirtualScroll,
50037
- scrollToIndex
50792
+ scrollToIndex,
50793
+ containerRef
50038
50794
  } = useVirtualScroll$1({
50039
50795
  itemHeight: computed(() => props.virtualScrollItemHeight),
50040
50796
  containerHeight: computed(() => props.virtualScrollHeight),
@@ -50180,7 +50936,8 @@ return (_ctx, _cache) => {
50180
50936
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
50181
50937
  createCommentVNode(" Conversation List with groups "),
50182
50938
  createElementVNode("div", {
50183
- ref: "virtualScrollContainerRef",
50939
+ ref_key: "containerRef",
50940
+ ref: containerRef,
50184
50941
  class: normalizeClass([unref(ns).e('list'), unref(ns).is('virtual', _ctx.virtualScroll)]),
50185
50942
  style: normalizeStyle(listStyle.value),
50186
50943
  onScrollPassive: _cache[9] || (_cache[9] = $event => (_ctx.virtualScroll ? unref(handleVirtualScroll)($event) : void 0))
@@ -50697,7 +51454,7 @@ const handleClick = (item) => {
50697
51454
 
50698
51455
  return (_ctx, _cache) => {
50699
51456
  return (openBlock(), createElementBlock("div", {
50700
- class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.layout)]),
51457
+ class: normalizeClass([unref(ns).b(), unref(ns).m(props.layout)]),
50701
51458
  style: normalizeStyle(unref(themeStyle))
50702
51459
  }, [
50703
51460
  createCommentVNode(" Title Section "),
@@ -51277,9 +52034,9 @@ const scrollToSource = (id) => {
51277
52034
  const el = sourceRefs.value[id];
51278
52035
  if (el) {
51279
52036
  el.scrollIntoView({ behavior: "smooth", block: "center" });
51280
- el.classList.add(ns.is("highlighted"));
52037
+ el.classList.add(ns.is("highlighted", true));
51281
52038
  setTimeout(() => {
51282
- el.classList.remove(ns.is("highlighted"));
52039
+ el.classList.remove(ns.is("highlighted", true));
51283
52040
  highlightedSourceId.value = null;
51284
52041
  }, 2e3);
51285
52042
  }
@@ -51918,15 +52675,14 @@ const { visibleItems, totalHeight, offsetY, startIndex, onScroll, scrollToIndex,
51918
52675
  overscan: 5
51919
52676
  });
51920
52677
  const scrollRef = containerRef;
51921
- const scrollToBottom = () => {
52678
+ const scrollToBottom = async () => {
51922
52679
  if (!props.autoScroll) return;
51923
- nextTick(() => {
51924
- if (props.virtualScroll) {
51925
- scrollToIndex(props.items.length - 1);
51926
- } else if (scrollRef.value) {
51927
- scrollRef.value.scrollTop = scrollRef.value.scrollHeight;
51928
- }
51929
- });
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
+ }
51930
52686
  };
51931
52687
  watch(
51932
52688
  () => props.items,
@@ -55154,13 +55910,33 @@ const dependenciesLinks = computed(() => {
55154
55910
  });
55155
55911
  return links;
55156
55912
  });
55913
+ let activeScrollTarget = null;
55914
+ let scrollTimer = null;
55157
55915
  const handleBodyScroll = (e) => {
55158
55916
  const target = e.target;
55159
- scrollTop.value = target.scrollTop;
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;
55160
55936
  if (sidebarBodyRef.value && target === timelineBodyRef.value) {
55161
- sidebarBodyRef.value.scrollTop = target.scrollTop;
55937
+ sidebarBodyRef.value.scrollTop = scrollT;
55162
55938
  } else if (timelineBodyRef.value && target === sidebarBodyRef.value) {
55163
- timelineBodyRef.value.scrollTop = target.scrollTop;
55939
+ timelineBodyRef.value.scrollTop = scrollT;
55164
55940
  }
55165
55941
  if (sidebarHeaderRef.value && target === sidebarBodyRef.value) {
55166
55942
  sidebarHeaderRef.value.scrollLeft = target.scrollLeft;
@@ -55211,8 +55987,10 @@ const onDragStart = (e, task, type) => {
55211
55987
  dragInitS = dayjs_default(task.startDate);
55212
55988
  dragInitE = dayjs_default(task.endDate);
55213
55989
  dragInitP = task.progress || 0;
55214
- document.addEventListener("mousemove", onDragMove);
55215
- document.addEventListener("mouseup", onDragEnd);
55990
+ if (typeof document !== "undefined") {
55991
+ document.addEventListener("mousemove", onDragMove);
55992
+ document.addEventListener("mouseup", onDragEnd);
55993
+ }
55216
55994
  };
55217
55995
  const onDragMove = (e) => {
55218
55996
  if (!activeDragTask.value) return;
@@ -55262,8 +56040,10 @@ const onDragEnd = () => {
55262
56040
  emit("update:data", [...props.data]);
55263
56041
  activeDragTask.value = null;
55264
56042
  dragType = null;
55265
- document.removeEventListener("mousemove", onDragMove);
55266
- document.removeEventListener("mouseup", onDragEnd);
56043
+ if (typeof document !== "undefined") {
56044
+ document.removeEventListener("mousemove", onDragMove);
56045
+ document.removeEventListener("mouseup", onDragEnd);
56046
+ }
55267
56047
  };
55268
56048
  const handleTaskClick = (e, task) => {
55269
56049
  if (dragType) return;
@@ -55294,10 +56074,22 @@ onMounted(() => {
55294
56074
  }
55295
56075
  });
55296
56076
  onBeforeUnmount(() => {
56077
+ if (scrollTimer) {
56078
+ clearTimeout(scrollTimer);
56079
+ scrollTimer = null;
56080
+ }
55297
56081
  if (resizeObserver) {
55298
56082
  resizeObserver.disconnect();
55299
56083
  resizeObserver = null;
55300
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
+ }
55301
56093
  });
55302
56094
 
55303
56095
  return (_ctx, _cache) => {
@@ -55784,7 +56576,8 @@ const { themeStyle } = useComponentTheme(
55784
56576
  const { selectedValueIds, isValueSelectable, selectedSku, toggleValue } = useSKU(
55785
56577
  props.specs,
55786
56578
  props.skus,
55787
- props.modelValue
56579
+ props.modelValue,
56580
+ props.checkStock
55788
56581
  );
55789
56582
  const handleValueClick = (index, spec, value) => {
55790
56583
  emit("select", spec, value);
@@ -56433,6 +57226,19 @@ const setupObserver = () => {
56433
57226
  };
56434
57227
  onMounted(setupObserver);
56435
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
+ );
56436
57242
  const currentImage = ref(props.image);
56437
57243
  const isHovering = ref(false);
56438
57244
  const videoActive = ref(false);
@@ -56903,11 +57709,12 @@ const { themeStyle } = useComponentTheme(
56903
57709
  computed(() => props.themeOverrides)
56904
57710
  );
56905
57711
  const rootStyle = computed(() => {
56906
- const { width, height } = props;
57712
+ const { width, height, loadingColor } = props;
56907
57713
  return {
56908
57714
  ...themeStyle.value,
56909
57715
  width: typeof width === "number" ? `${width}px` : width,
56910
- height: typeof height === "number" ? `${height}px` : height
57716
+ height: typeof height === "number" ? `${height}px` : height,
57717
+ ...loadingColor ? { "--yh-magnifier-loading-color": loadingColor } : {}
56911
57718
  };
56912
57719
  });
56913
57720
  const currentIndex = ref(props.modelValue);
@@ -57000,6 +57807,7 @@ const handleMouseEnter = () => {
57000
57807
  };
57001
57808
  const handleMouseLeave = () => {
57002
57809
  visible.value = false;
57810
+ currentScale.value = props.scale;
57003
57811
  emit("leave");
57004
57812
  emit("zoom-end");
57005
57813
  };
@@ -57031,17 +57839,32 @@ const handleWheel = (e) => {
57031
57839
  ) / 10;
57032
57840
  emit("scale-change", currentScale.value);
57033
57841
  };
57842
+ let wheelListener = null;
57034
57843
  const addWheelListener = () => {
57035
- containerRef.value?.addEventListener("wheel", handleWheel, { passive: false });
57844
+ if (!props.wheelZoom || !containerRef.value) return;
57845
+ removeWheelListener();
57846
+ wheelListener = (e) => {
57847
+ handleWheel(e);
57848
+ };
57849
+ containerRef.value.addEventListener("wheel", wheelListener, { passive: false });
57036
57850
  };
57037
57851
  const removeWheelListener = () => {
57038
- containerRef.value?.removeEventListener("wheel", handleWheel);
57039
- };
57040
- watch(containerRef, (el) => {
57041
- if (el) {
57042
- nextTick(addWheelListener);
57852
+ if (wheelListener && containerRef.value) {
57853
+ containerRef.value.removeEventListener("wheel", wheelListener);
57854
+ wheelListener = null;
57043
57855
  }
57044
- });
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
+ );
57045
57868
  const previewStyle = computed(() => {
57046
57869
  const isInside = resolvedPosition.value === "inside";
57047
57870
  const base = {
@@ -57122,6 +57945,7 @@ const handleFullscreenKeydown = (e) => {
57122
57945
  if (e.key === "Escape") closeFullscreen();
57123
57946
  };
57124
57947
  watch(fullscreenVisible, (val) => {
57948
+ if (typeof document === "undefined") return;
57125
57949
  if (val) {
57126
57950
  document.addEventListener("keydown", handleFullscreenKeydown);
57127
57951
  document.documentElement.style.overflow = "hidden";
@@ -57134,9 +57958,11 @@ watch(fullscreenVisible, (val) => {
57134
57958
  });
57135
57959
  onUnmounted(() => {
57136
57960
  removeWheelListener();
57137
- document.removeEventListener("keydown", handleFullscreenKeydown);
57138
- document.documentElement.style.overflow = "";
57139
- document.body.style.overflow = "";
57961
+ if (typeof document !== "undefined") {
57962
+ document.removeEventListener("keydown", handleFullscreenKeydown);
57963
+ document.documentElement.style.overflow = "";
57964
+ document.body.style.overflow = "";
57965
+ }
57140
57966
  });
57141
57967
  __expose({ visible, currentScale, currentIndex, switchImage });
57142
57968
 
@@ -58617,7 +59443,8 @@ const { themeStyle } = useComponentTheme(
58617
59443
  const { t } = useLocale();
58618
59444
  const displayPrice = computed(() => {
58619
59445
  const raw = props.centUnit ? props.price / 100 : props.price;
58620
- return raw.toFixed(props.decimalLength);
59446
+ const len = Math.max(0, Math.min(20, Number(props.decimalLength) || 0));
59447
+ return raw.toFixed(len);
58621
59448
  });
58622
59449
  const priceLabel = computed(() => props.label || t("submitbar.total"));
58623
59450
  const selectedText = computed(() => {
@@ -58703,11 +59530,11 @@ return (_ctx, _cache) => {
58703
59530
  createElementVNode("span", {
58704
59531
  class: normalizeClass(unref(ns).e('price-int'))
58705
59532
  }, toDisplayString(displayPrice.value.split(".")[0]), 3 /* TEXT, CLASS */),
58706
- (_ctx.decimalLength > 0)
59533
+ (Number(_ctx.decimalLength) > 0)
58707
59534
  ? (openBlock(), createElementBlock("span", {
58708
59535
  key: 0,
58709
59536
  class: normalizeClass(unref(ns).e('price-dec'))
58710
- }, "." + toDisplayString(displayPrice.value.split(".")[1]), 3 /* TEXT, CLASS */))
59537
+ }, "." + toDisplayString(displayPrice.value.split(".")[1] || ""), 3 /* TEXT, CLASS */))
58711
59538
  : createCommentVNode("v-if", true)
58712
59539
  ], 2 /* CLASS */)
58713
59540
  ])