lew-ui 2.7.48 → 2.7.50

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/index.js CHANGED
@@ -6580,17 +6580,12 @@ function createFunctionalComponent(component) {
6580
6580
  name: getUniqueId(),
6581
6581
  setup(props, ctx) {
6582
6582
  return () => {
6583
- try {
6584
- if (component.length >= 2) {
6585
- return component(props, ctx);
6586
- } else if (component.length === 1) {
6587
- return component(props);
6588
- } else {
6589
- return component();
6590
- }
6591
- } catch (error) {
6592
- console.warn("[formatComponent] 函数式组件执行出错:", error);
6593
- return null;
6583
+ if (component.length >= 2) {
6584
+ return component(props, ctx);
6585
+ } else if (component.length === 1) {
6586
+ return component(props);
6587
+ } else {
6588
+ return component();
6594
6589
  }
6595
6590
  };
6596
6591
  }
@@ -6628,24 +6623,19 @@ function isValidComponent(componentSource) {
6628
6623
  }
6629
6624
  function formatComponent(componentSource) {
6630
6625
  const componentType = detectComponentType(componentSource);
6631
- try {
6632
- switch (componentType) {
6633
- case "vnode":
6634
- return createVNodeComponent(componentSource);
6635
- case "text":
6636
- return createTextComponent(String(componentSource));
6637
- case "functional":
6638
- return createFunctionalComponent(componentSource);
6639
- case "options":
6640
- case "instance":
6641
- return createOptionsComponent(componentSource);
6642
- case "unknown":
6643
- default:
6644
- return void 0;
6645
- }
6646
- } catch (error) {
6647
- console.error("[formatComponent] 组件格式化失败:", error, componentSource);
6648
- return void 0;
6626
+ switch (componentType) {
6627
+ case "vnode":
6628
+ return createVNodeComponent(componentSource);
6629
+ case "text":
6630
+ return createTextComponent(String(componentSource));
6631
+ case "functional":
6632
+ return createFunctionalComponent(componentSource);
6633
+ case "options":
6634
+ case "instance":
6635
+ return createOptionsComponent(componentSource);
6636
+ case "unknown":
6637
+ default:
6638
+ return void 0;
6649
6639
  }
6650
6640
  }
6651
6641
  const _sfc_main$16 = /* @__PURE__ */ defineComponent({
@@ -7028,7 +7018,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
7028
7018
  };
7029
7019
  }
7030
7020
  });
7031
- const LewDescItem = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-67c52aba"]]);
7021
+ const LewDescItem = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-5711d988"]]);
7032
7022
  const _sfc_main$14 = /* @__PURE__ */ defineComponent({
7033
7023
  __name: "LewDesc",
7034
7024
  props: descProps,
@@ -14226,12 +14216,20 @@ const popoverProps = {
14226
14216
  },
14227
14217
  offset: {
14228
14218
  type: Array,
14229
- default: () => [0, 8],
14219
+ default: [0, 8],
14230
14220
  validator: validators.array({
14231
14221
  componentName: "LewPopover",
14232
14222
  propName: "offset"
14233
14223
  })
14234
14224
  },
14225
+ delay: {
14226
+ type: Array,
14227
+ default: [120, 120],
14228
+ validator: validators.array({
14229
+ componentName: "LewPopover",
14230
+ propName: "delay"
14231
+ })
14232
+ },
14235
14233
  popoverBodyClassName: {
14236
14234
  type: String,
14237
14235
  default: "lew-popover-body",
@@ -14335,7 +14333,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
14335
14333
  duration: [250, 250],
14336
14334
  arrow: false,
14337
14335
  offset: offset2,
14338
- delay: trigger === "mouseenter" ? [120, 120] : void 0,
14336
+ delay: trigger === "mouseenter" ? props.delay : void 0,
14339
14337
  appendTo: () => document.body,
14340
14338
  allowHTML: true,
14341
14339
  maxWidth: "none",
@@ -15602,13 +15600,8 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
15602
15600
  async function init() {
15603
15601
  let _tree = [];
15604
15602
  if (_initMethod.value) {
15605
- try {
15606
- const newOptions = await _initMethod.value();
15607
- _tree = newOptions || [];
15608
- } catch (error) {
15609
- console.error("[LewCascader] initMethod failed", error);
15610
- _tree = [];
15611
- }
15603
+ const newOptions = await _initMethod.value();
15604
+ _tree = newOptions || [];
15612
15605
  } else if (_loadMethod.value && !state.loading) {
15613
15606
  state.loading = true;
15614
15607
  _tree = await _loadMethod.value() || [];
@@ -16033,7 +16026,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
16033
16026
  };
16034
16027
  }
16035
16028
  });
16036
- const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-326ee17b"]]);
16029
+ const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-45a2695b"]]);
16037
16030
  const cascaderModel = {
16038
16031
  modelValue: {
16039
16032
  type: String
@@ -16269,7 +16262,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16269
16262
  };
16270
16263
  }
16271
16264
  });
16272
- const LewCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-3aec2da1"]]);
16265
+ const LewCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-c80437bd"]]);
16273
16266
  const _sfc_main$R = /* @__PURE__ */ defineComponent({
16274
16267
  __name: "LewCheckboxGroup",
16275
16268
  props: /* @__PURE__ */ mergeModels(checkboxGroupProps, {
@@ -21377,7 +21370,6 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
21377
21370
  }
21378
21371
  if (typeof value === "string") {
21379
21372
  try {
21380
- console.log(formData);
21381
21373
  return Boolean(parser.evaluate(value, formData));
21382
21374
  } catch {
21383
21375
  return false;
@@ -21514,7 +21506,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
21514
21506
  };
21515
21507
  }
21516
21508
  });
21517
- const LewForm = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-2babc77a"]]);
21509
+ const LewForm = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-3720697c"]]);
21518
21510
  const inputEmits = {
21519
21511
  change: (value) => value,
21520
21512
  input: (value) => value,
@@ -23037,149 +23029,113 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
23037
23029
  function openInput() {
23038
23030
  if (isInputActive.value || props.disabled || props.readonly)
23039
23031
  return;
23040
- try {
23041
- if (props.maxLength > 0 && Array.isArray(modelValue.value) && modelValue.value.length >= props.maxLength) {
23042
- LewMessage.warning(locale.t("inputTag.maxLength", { maxLength: props.maxLength }));
23043
- return;
23032
+ if (props.maxLength > 0 && Array.isArray(modelValue.value) && modelValue.value.length >= props.maxLength) {
23033
+ LewMessage.warning(locale.t("inputTag.maxLength", { maxLength: props.maxLength }));
23034
+ return;
23035
+ }
23036
+ isInputActive.value = true;
23037
+ nextTick(() => {
23038
+ if (lewInputRef.value && typeof lewInputRef.value.toFocus === "function") {
23039
+ lewInputRef.value.toFocus();
23044
23040
  }
23045
- isInputActive.value = true;
23046
- nextTick(() => {
23047
- if (lewInputRef.value && typeof lewInputRef.value.toFocus === "function") {
23048
- lewInputRef.value.toFocus();
23049
- }
23050
- });
23051
- originalKeydownHandler = document.onkeydown;
23052
- document.onkeydown = function(event) {
23053
- try {
23054
- const keyCode = event.key || event.code;
23041
+ });
23042
+ originalKeydownHandler = document.onkeydown;
23043
+ document.onkeydown = function(event) {
23044
+ const keyCode = event.key || event.code;
23045
+ if (inputValue.value) {
23046
+ if (keyCode === "Enter" || keyCode === "NumpadEnter") {
23047
+ isTagMarkedForDeletion.value = false;
23048
+ document.onkeydown = originalKeydownHandler;
23049
+ isInputActive.value = false;
23055
23050
  if (inputValue.value) {
23056
- if (keyCode === "Enter" || keyCode === "NumpadEnter") {
23057
- isTagMarkedForDeletion.value = false;
23058
- document.onkeydown = originalKeydownHandler;
23059
- isInputActive.value = false;
23060
- if (inputValue.value) {
23061
- if (props.allowDuplicates) {
23062
- addTag();
23063
- } else {
23064
- if (!Array.isArray(modelValue.value) || !modelValue.value.includes(inputValue.value)) {
23065
- addTag();
23066
- } else {
23067
- LewMessage.warning(locale.t("inputTag.duplicate"));
23068
- }
23069
- }
23070
- openInput();
23071
- }
23072
- }
23073
- } else {
23074
- if (keyCode === "Backspace" || keyCode === "Delete") {
23075
- if (Array.isArray(modelValue.value) && modelValue.value.length > 0 && isTagMarkedForDeletion.value) {
23076
- try {
23077
- const newValue = [...modelValue.value || []];
23078
- newValue.splice(newValue.length - 1, 1);
23079
- modelValue.value = newValue;
23080
- emit("change", cloneDeep(newValue));
23081
- } catch (error) {
23082
- console.error("删除标签时出错:", error);
23083
- }
23084
- isTagMarkedForDeletion.value = false;
23051
+ if (props.allowDuplicates) {
23052
+ addTag();
23053
+ } else {
23054
+ if (!Array.isArray(modelValue.value) || !modelValue.value.includes(inputValue.value)) {
23055
+ addTag();
23085
23056
  } else {
23086
- isTagMarkedForDeletion.value = true;
23087
- }
23088
- }
23089
- if (keyCode === "Enter" || keyCode === "NumpadEnter") {
23090
- if (lewInputRef.value && typeof lewInputRef.value.toBlur === "function") {
23091
- lewInputRef.value.toBlur();
23057
+ LewMessage.warning(locale.t("inputTag.duplicate"));
23092
23058
  }
23093
23059
  }
23060
+ openInput();
23094
23061
  }
23095
- } catch (error) {
23096
- console.error("键盘事件处理出错:", error);
23097
- document.onkeydown = originalKeydownHandler;
23098
23062
  }
23099
- };
23100
- } catch (error) {
23101
- console.error("打开输入框时出错:", error);
23102
- isInputActive.value = false;
23103
- }
23063
+ } else {
23064
+ if (keyCode === "Backspace" || keyCode === "Delete") {
23065
+ if (Array.isArray(modelValue.value) && modelValue.value.length > 0 && isTagMarkedForDeletion.value) {
23066
+ const newValue = [...modelValue.value || []];
23067
+ newValue.splice(newValue.length - 1, 1);
23068
+ modelValue.value = newValue;
23069
+ emit("change", cloneDeep(newValue));
23070
+ isTagMarkedForDeletion.value = false;
23071
+ } else {
23072
+ isTagMarkedForDeletion.value = true;
23073
+ }
23074
+ }
23075
+ if (keyCode === "Enter" || keyCode === "NumpadEnter") {
23076
+ if (lewInputRef.value && typeof lewInputRef.value.toBlur === "function") {
23077
+ lewInputRef.value.toBlur();
23078
+ }
23079
+ }
23080
+ }
23081
+ };
23104
23082
  }
23105
23083
  onUnmounted(() => {
23106
- try {
23107
- if (document.onkeydown && document.onkeydown !== originalKeydownHandler) {
23108
- document.onkeydown = originalKeydownHandler;
23109
- }
23110
- } catch (error) {
23111
- console.error("卸载组件时清除键盘事件处理器出错:", error);
23084
+ if (document.onkeydown && document.onkeydown !== originalKeydownHandler) {
23085
+ document.onkeydown = originalKeydownHandler;
23112
23086
  }
23113
23087
  });
23114
23088
  function addTag() {
23115
- try {
23116
- const _value = Array.isArray(modelValue.value) ? [...modelValue.value] : [];
23117
- if (!inputValue.value || inputValue.value.trim() === "") {
23118
- return;
23119
- }
23120
- if (props.maxLength > 0 && _value.length >= props.maxLength) {
23121
- inputValue.value = "";
23122
- isInputActive.value = false;
23123
- LewMessage.warning(locale.t("inputTag.maxLength", { maxLength: props.maxLength }));
23124
- return;
23125
- }
23126
- _value.push(inputValue.value);
23127
- const addedValue = inputValue.value;
23089
+ const _value = Array.isArray(modelValue.value) ? [...modelValue.value] : [];
23090
+ if (!inputValue.value || inputValue.value.trim() === "") {
23091
+ return;
23092
+ }
23093
+ if (props.maxLength > 0 && _value.length >= props.maxLength) {
23128
23094
  inputValue.value = "";
23129
- modelValue.value = _value;
23130
- emit("change", cloneDeep(_value));
23131
- emit("add", addedValue);
23132
- } catch (error) {
23133
- console.error("添加标签时出错:", error);
23095
+ isInputActive.value = false;
23096
+ LewMessage.warning(locale.t("inputTag.maxLength", { maxLength: props.maxLength }));
23097
+ return;
23134
23098
  }
23099
+ _value.push(inputValue.value);
23100
+ const addedValue = inputValue.value;
23101
+ inputValue.value = "";
23102
+ modelValue.value = _value;
23103
+ emit("change", cloneDeep(_value));
23104
+ emit("add", addedValue);
23135
23105
  }
23136
23106
  function delTag(index2) {
23137
- try {
23138
- if (!Array.isArray(modelValue.value) || index2 < 0 || index2 >= modelValue.value.length) {
23139
- return;
23140
- }
23141
- const removedTag = modelValue.value[index2];
23142
- const newValue = [...modelValue.value];
23143
- newValue.splice(index2, 1);
23144
- modelValue.value = newValue;
23145
- if (newValue.length === 0) {
23146
- autoWidthDelay.value = true;
23147
- setTimeout(() => {
23148
- autoWidthDelay.value = false;
23149
- }, 550);
23150
- }
23151
- emit("change", cloneDeep(newValue));
23152
- emit("remove", removedTag, index2);
23153
- } catch (error) {
23154
- console.error("删除标签时出错:", error);
23107
+ if (!Array.isArray(modelValue.value) || index2 < 0 || index2 >= modelValue.value.length) {
23108
+ return;
23109
+ }
23110
+ const removedTag = modelValue.value[index2];
23111
+ const newValue = [...modelValue.value];
23112
+ newValue.splice(index2, 1);
23113
+ modelValue.value = newValue;
23114
+ if (newValue.length === 0) {
23115
+ autoWidthDelay.value = true;
23116
+ setTimeout(() => {
23117
+ autoWidthDelay.value = false;
23118
+ }, 550);
23155
23119
  }
23120
+ emit("change", cloneDeep(newValue));
23121
+ emit("remove", removedTag, index2);
23156
23122
  }
23157
23123
  const getInputClassNames = computed(() => {
23158
- try {
23159
- const { size, readonly: readonly2, disabled, clearable } = props;
23160
- return object2class("lew-input-tag-view", {
23161
- size,
23162
- readonly: readonly2,
23163
- disabled,
23164
- clearable
23165
- });
23166
- } catch (error) {
23167
- console.error("计算输入框类名时出错:", error);
23168
- return "lew-input-tag-view";
23169
- }
23124
+ const { size, readonly: readonly2, disabled, clearable } = props;
23125
+ return object2class("lew-input-tag-view", {
23126
+ size,
23127
+ readonly: readonly2,
23128
+ disabled,
23129
+ clearable
23130
+ });
23170
23131
  });
23171
23132
  const getIconSize = computed(() => {
23172
- try {
23173
- const size = {
23174
- small: 13,
23175
- medium: 14,
23176
- large: 16
23177
- };
23178
- return size[props.size] || 14;
23179
- } catch (error) {
23180
- console.error("计算图标大小时出错:", error);
23181
- return 14;
23182
- }
23133
+ const size = {
23134
+ small: 13,
23135
+ medium: 14,
23136
+ large: 16
23137
+ };
23138
+ return size[props.size] || 14;
23183
23139
  });
23184
23140
  function clear() {
23185
23141
  modelValue.value = [];
@@ -23280,7 +23236,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
23280
23236
  };
23281
23237
  }
23282
23238
  });
23283
- const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-3efd3712"]]);
23239
+ const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-b91654f1"]]);
23284
23240
  const radioEmits = {
23285
23241
  change: () => true
23286
23242
  };
@@ -23435,7 +23391,7 @@ const radioGroupProps = {
23435
23391
  };
23436
23392
  const _hoisted_1$p = {
23437
23393
  key: 0,
23438
- class: "lew-icon-radio-box"
23394
+ class: "lew-radio-icon-box"
23439
23395
  };
23440
23396
  const _hoisted_2$h = {
23441
23397
  key: 1,
@@ -23485,7 +23441,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23485
23441
  _ctx.iconable || !_ctx.iconable && !_ctx.block ? (openBlock(), createElementBlock("div", _hoisted_1$p, [
23486
23442
  createVNode(CommonIcon, {
23487
23443
  "stroke-width": 4,
23488
- class: "lew-icon-radio",
23444
+ class: "lew-radio-icon",
23489
23445
  type: "check",
23490
23446
  size: unref(getIconSize)
23491
23447
  }, null, 8, ["size"])
@@ -23495,7 +23451,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23495
23451
  };
23496
23452
  }
23497
23453
  });
23498
- const LewRadio = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-1f483c6a"]]);
23454
+ const LewRadio = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-aaf2d10e"]]);
23499
23455
  const _sfc_main$x = /* @__PURE__ */ defineComponent({
23500
23456
  __name: "LewRadioGroup",
23501
23457
  props: /* @__PURE__ */ mergeModels(radioGroupProps, {
@@ -24001,14 +23957,10 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
24001
23957
  });
24002
23958
  async function init() {
24003
23959
  if (_initMethod.value) {
24004
- try {
24005
- const newOptions = await _initMethod.value();
24006
- state.sourceOptions = newOptions;
24007
- state.options = flattenSelectOptions(newOptions);
24008
- findKeyword();
24009
- } catch (error) {
24010
- console.error("[LewSelect] initMethod failed", error);
24011
- }
23960
+ const newOptions = await _initMethod.value();
23961
+ state.sourceOptions = newOptions;
23962
+ state.options = flattenSelectOptions(newOptions);
23963
+ findKeyword();
24012
23964
  }
24013
23965
  if (props.enableSearchCache) {
24014
23966
  state.searchCache.set("", state.options);
@@ -24408,7 +24360,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
24408
24360
  };
24409
24361
  }
24410
24362
  });
24411
- const LewSelect = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-a83dc3a0"]]);
24363
+ const LewSelect = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-cd2e8d44"]]);
24412
24364
  const selectMultipleEmits = {
24413
24365
  change: (value) => value,
24414
24366
  select: (item) => item,
@@ -24840,13 +24792,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
24840
24792
  }
24841
24793
  async function init() {
24842
24794
  if (_initMethod.value) {
24843
- try {
24844
- const newOptions = await _initMethod.value();
24845
- state.sourceOptions = newOptions;
24846
- state.options = flattenSelectOptions(newOptions);
24847
- } catch (error) {
24848
- console.error("[LewSelectMultiple] initMethod failed", error);
24849
- }
24795
+ const newOptions = await _initMethod.value();
24796
+ state.sourceOptions = newOptions;
24797
+ state.options = flattenSelectOptions(newOptions);
24850
24798
  }
24851
24799
  if (props.enableSearchCache) {
24852
24800
  state.searchCache.set("", state.options);
@@ -25083,6 +25031,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
25083
25031
  trigger: "hover",
25084
25032
  "popover-body-class-name": "lew-select-multiple-popover-tag",
25085
25033
  placement: "top-start",
25034
+ delay: [250, 250],
25086
25035
  style: { "width": "100%" },
25087
25036
  "trigger-width": _ctx.width
25088
25037
  }, {
@@ -25219,7 +25168,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
25219
25168
  };
25220
25169
  }
25221
25170
  });
25222
- const LewSelectMultiple = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-1797cc5d"]]);
25171
+ const LewSelectMultiple = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-bb9b06f8"]]);
25223
25172
  const sliderEmits = {
25224
25173
  change: (value) => value
25225
25174
  };
@@ -25419,27 +25368,23 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
25419
25368
  if (props.readonly || props.disabled || !trackRef.value || !dotRef.value) {
25420
25369
  return;
25421
25370
  }
25422
- try {
25423
- const trackRect = trackRef.value.getBoundingClientRect();
25424
- const clickX = Math.max(0, Math.min(e.clientX - trackRect.left, trackRect.width));
25425
- const step = safeNumber(props.step, 1);
25426
- if (step <= 0)
25427
- return;
25428
- const trackMax = getTrackMax.value;
25429
- const trackMin = getTrackMin.value;
25430
- const range = trackMax - trackMin;
25431
- if (range <= 0)
25432
- return;
25433
- const stepSize = trackRect.width / (range / step);
25434
- const nearestStep = Math.round(clickX / stepSize) * stepSize;
25435
- const newValue = calculateValue(nearestStep);
25436
- const clampedValue = Math.max(getMin.value, Math.min(getMax.value, newValue));
25437
- if (clampedValue >= getMin.value && clampedValue <= getMax.value) {
25438
- throttledUpdateView(clampedValue);
25439
- throttledUpdateModelValue(clampedValue);
25440
- }
25441
- } catch (error) {
25442
- console.warn("[LewSlider] setDot error:", error);
25371
+ const trackRect = trackRef.value.getBoundingClientRect();
25372
+ const clickX = Math.max(0, Math.min(e.clientX - trackRect.left, trackRect.width));
25373
+ const step = safeNumber(props.step, 1);
25374
+ if (step <= 0)
25375
+ return;
25376
+ const trackMax = getTrackMax.value;
25377
+ const trackMin = getTrackMin.value;
25378
+ const range = trackMax - trackMin;
25379
+ if (range <= 0)
25380
+ return;
25381
+ const stepSize = trackRect.width / (range / step);
25382
+ const nearestStep = Math.round(clickX / stepSize) * stepSize;
25383
+ const newValue = calculateValue(nearestStep);
25384
+ const clampedValue = Math.max(getMin.value, Math.min(getMax.value, newValue));
25385
+ if (clampedValue >= getMin.value && clampedValue <= getMax.value) {
25386
+ throttledUpdateView(clampedValue);
25387
+ throttledUpdateModelValue(clampedValue);
25443
25388
  }
25444
25389
  }
25445
25390
  function calculateNearestStep(value) {
@@ -25465,51 +25410,39 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
25465
25410
  function setDotByValue(value) {
25466
25411
  if (!dotRef.value)
25467
25412
  return;
25468
- try {
25469
- const safeValue = safeNumber(value, getMin.value);
25470
- const clampedValue = Math.max(getMin.value, Math.min(getMax.value, safeValue));
25471
- const nearestStep = calculateNearestStep(clampedValue);
25472
- const clampedStep = Math.max(0, Math.min(100, nearestStep));
25473
- dotRef.value.style.left = `${clampedStep}%`;
25474
- } catch (error) {
25475
- console.warn("[LewSlider] setDotByValue error:", error);
25476
- }
25413
+ const safeValue = safeNumber(value, getMin.value);
25414
+ const clampedValue = Math.max(getMin.value, Math.min(getMax.value, safeValue));
25415
+ const nearestStep = calculateNearestStep(clampedValue);
25416
+ const clampedStep = Math.max(0, Math.min(100, nearestStep));
25417
+ dotRef.value.style.left = `${clampedStep}%`;
25477
25418
  }
25478
25419
  let _dragmove = () => {
25479
25420
  };
25480
25421
  function init() {
25481
- try {
25482
- const el = dotRef.value;
25483
- const parentEl = trackRef.value;
25484
- const step = safeNumber(props.step, 1);
25485
- if (el && parentEl && !props.readonly && !props.disabled) {
25486
- _dragmove = dragmove({
25487
- el,
25488
- parentEl,
25489
- direction: "horizontal",
25490
- step: () => step,
25491
- max: () => getMax.value,
25492
- min: () => getMin.value,
25493
- trackMax: () => getTrackMax.value,
25494
- trackMin: () => getTrackMin.value,
25495
- callback: (e) => {
25496
- try {
25497
- const newValue = calculateValue(e.x);
25498
- const clampedValue = Math.max(getMin.value, Math.min(getMax.value, newValue));
25499
- throttledUpdateView(clampedValue);
25500
- throttledUpdateModelValue(clampedValue);
25501
- } catch (error) {
25502
- console.warn("[LewSlider] drag callback error:", error);
25503
- }
25504
- }
25505
- });
25506
- }
25507
- const currentValue = modelValue.value || getMin.value;
25508
- internalViewValue.value = currentValue;
25509
- setDotByValue(currentValue);
25510
- } catch (error) {
25511
- console.warn("[LewSlider] init error:", error);
25422
+ const el = dotRef.value;
25423
+ const parentEl = trackRef.value;
25424
+ const step = safeNumber(props.step, 1);
25425
+ if (el && parentEl && !props.readonly && !props.disabled) {
25426
+ _dragmove = dragmove({
25427
+ el,
25428
+ parentEl,
25429
+ direction: "horizontal",
25430
+ step: () => step,
25431
+ max: () => getMax.value,
25432
+ min: () => getMin.value,
25433
+ trackMax: () => getTrackMax.value,
25434
+ trackMin: () => getTrackMin.value,
25435
+ callback: (e) => {
25436
+ const newValue = calculateValue(e.x);
25437
+ const clampedValue = Math.max(getMin.value, Math.min(getMax.value, newValue));
25438
+ throttledUpdateView(clampedValue);
25439
+ throttledUpdateModelValue(clampedValue);
25440
+ }
25441
+ });
25512
25442
  }
25443
+ const currentValue = modelValue.value || getMin.value;
25444
+ internalViewValue.value = currentValue;
25445
+ setDotByValue(currentValue);
25513
25446
  }
25514
25447
  watch(
25515
25448
  [
@@ -25533,13 +25466,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
25533
25466
  });
25534
25467
  });
25535
25468
  onUnmounted(() => {
25536
- try {
25537
- _dragmove();
25538
- throttledUpdateView.cancel();
25539
- throttledUpdateModelValue.cancel();
25540
- } catch (error) {
25541
- console.warn("[LewSlider] cleanup error:", error);
25542
- }
25469
+ _dragmove();
25470
+ throttledUpdateView.cancel();
25471
+ throttledUpdateModelValue.cancel();
25543
25472
  });
25544
25473
  watch(
25545
25474
  modelValue,
@@ -25595,13 +25524,8 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
25595
25524
  };
25596
25525
  });
25597
25526
  function safeFormatTooltip(value) {
25598
- try {
25599
- const formatFn = safeFunction(props.formatTooltip, (val) => val.toString());
25600
- return formatFn(value);
25601
- } catch (error) {
25602
- console.warn("[LewSlider] formatTooltip error:", error);
25603
- return value.toString();
25604
- }
25527
+ const formatFn = safeFunction(props.formatTooltip, (val) => val.toString());
25528
+ return formatFn(value);
25605
25529
  }
25606
25530
  function isValidOption(option) {
25607
25531
  return option && typeof option === "object" && "label" in option && "value" in option && typeof option.label === "string" && !Number.isNaN(safeNumber(option.value));
@@ -25769,7 +25693,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
25769
25693
  };
25770
25694
  }
25771
25695
  });
25772
- const LewSlider = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-dd0bfebf"]]);
25696
+ const LewSlider = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-ac55f226"]]);
25773
25697
  const sliderRangeEmits = {
25774
25698
  change: (value) => value
25775
25699
  };
@@ -26703,7 +26627,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
26703
26627
  };
26704
26628
  }
26705
26629
  });
26706
- const LewTabs = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-ec12ccef"]]);
26630
+ const LewTabs = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-c3168264"]]);
26707
26631
  const textareaEmits = {
26708
26632
  change: (value) => value,
26709
26633
  input: (value) => value,
@@ -28265,13 +28189,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
28265
28189
  return;
28266
28190
  }
28267
28191
  if (props.beforeDelete && isFunction$1(props.beforeDelete)) {
28268
- try {
28269
- const shouldDelete = await props.beforeDelete(fileItem);
28270
- if (!shouldDelete) {
28271
- return;
28272
- }
28273
- } catch (error) {
28274
- console.error("[LewUpload] beforeDelete callback error:", error);
28192
+ const shouldDelete = await props.beforeDelete(fileItem);
28193
+ if (!shouldDelete) {
28275
28194
  return;
28276
28195
  }
28277
28196
  }
@@ -28501,7 +28420,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
28501
28420
  };
28502
28421
  }
28503
28422
  });
28504
- const LewUpload = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-741ec8ee"]]);
28423
+ const LewUpload = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-42853cc3"]]);
28505
28424
  const statusValues = ["online", "processing", "away", "offline", "busy"];
28506
28425
  const placementValues = ["top-left", "top-right", "bottom-left", "bottom-right"];
28507
28426
  const shapeValues = ["circle", "square", "sharp"];
@@ -28693,13 +28612,15 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
28693
28612
  };
28694
28613
  });
28695
28614
  const altText = computed(() => {
28696
- if (!props.alt) return "";
28615
+ if (!props.alt)
28616
+ return "";
28697
28617
  const result = props.alt.split(" ").map((word) => word.charAt(0)).join("").toUpperCase();
28698
28618
  return result.length > 2 ? result.charAt(0) : result;
28699
28619
  });
28700
28620
  const dotStyleObject = computed(() => {
28701
28621
  const { status, statusPlacement, shape, size } = props;
28702
- if (!status) return {};
28622
+ if (!status)
28623
+ return {};
28703
28624
  const statusPlacementConfig = shape === "circle" ? STATUS_PLACEMENT_CONFIG_CIRCLE : STATUS_PLACEMENT_CONFIG_SQUARE;
28704
28625
  return {
28705
28626
  ...statusPlacementConfig[statusPlacement],
@@ -28762,7 +28683,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
28762
28683
  };
28763
28684
  }
28764
28685
  });
28765
- const LewAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-c104afd2"]]);
28686
+ const LewAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-03d7476d"]]);
28766
28687
  const badgeProps = {
28767
28688
  text: {
28768
28689
  type: String,
@@ -28993,13 +28914,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
28993
28914
  return;
28994
28915
  }
28995
28916
  _loading.value = true;
28996
- try {
28997
- await props.request();
28998
- } catch (error) {
28999
- console.error("[LewButton] Request failed:", error);
29000
- } finally {
29001
- _loading.value = false;
29002
- }
28917
+ await props.request();
28918
+ _loading.value = false;
29003
28919
  }
29004
28920
  }
29005
28921
  const instance = getCurrentInstance();
@@ -29064,7 +28980,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
29064
28980
  };
29065
28981
  }
29066
28982
  });
29067
- const LewButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-59a7540b"]]);
28983
+ const LewButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-5136ad0e"]]);
29068
28984
  const flexProps = {
29069
28985
  direction: {
29070
28986
  type: String,
@@ -29541,15 +29457,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
29541
29457
  if (props.disabled || isClosing.value)
29542
29458
  return;
29543
29459
  if (props.close) {
29544
- try {
29545
- isClosing.value = true;
29546
- await props.close();
29547
- } catch (error) {
29548
- console.error("[LewTag] Error in close function:", error);
29549
- } finally {
29550
- emit("close");
29551
- isClosing.value = false;
29552
- }
29460
+ isClosing.value = true;
29461
+ await props.close();
29462
+ emit("close");
29463
+ isClosing.value = false;
29553
29464
  } else {
29554
29465
  emit("close");
29555
29466
  }
@@ -29828,24 +29739,16 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
29828
29739
  const { x: x2, y: y2 } = useMouse();
29829
29740
  if (props.delay && Array.isArray(props.delay) && props.delay[0] > 0) {
29830
29741
  setTimeout(() => {
29831
- try {
29832
- const element = lewTextTrimRef.value;
29833
- if (!element)
29834
- return;
29835
- const rect = element.getBoundingClientRect();
29836
- if (x2.value >= rect.left && x2.value <= rect.right && y2.value >= rect.top && y2.value <= rect.bottom) {
29837
- tippyInstance?.show();
29838
- }
29839
- } catch (error) {
29840
- console.error("Error showing tooltip:", error);
29742
+ const element = lewTextTrimRef.value;
29743
+ if (!element)
29744
+ return;
29745
+ const rect = element.getBoundingClientRect();
29746
+ if (x2.value >= rect.left && x2.value <= rect.right && y2.value >= rect.top && y2.value <= rect.bottom) {
29747
+ tippyInstance?.show();
29841
29748
  }
29842
29749
  }, props.delay[0]);
29843
29750
  } else {
29844
- try {
29845
- tippyInstance?.show();
29846
- } catch (error) {
29847
- console.error("Error showing tooltip:", error);
29848
- }
29751
+ tippyInstance?.show();
29849
29752
  }
29850
29753
  }
29851
29754
  function sanitizeHtml(html) {
@@ -29916,7 +29819,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
29916
29819
  };
29917
29820
  }
29918
29821
  });
29919
- const LewTextTrim = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-aa4e5a18"]]);
29822
+ const LewTextTrim = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-4408f6f3"]]);
29920
29823
  const titleEmits = {
29921
29824
  click: (event) => event
29922
29825
  };
@@ -30659,17 +30562,13 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
30659
30562
  return;
30660
30563
  const instance = props.dropdownInstance || window.LewContextMenu?.instance || null;
30661
30564
  if (isFunction$1(item.onClick)) {
30662
- try {
30663
- const proxyItem = createItemProxy(item);
30664
- const proxyOptions = new Proxy(_options.value, {
30665
- get(target, prop, receiver) {
30666
- return Reflect.get(target, prop, receiver);
30667
- }
30668
- });
30669
- item.onClick?.(proxyItem, proxyOptions, instance);
30670
- } catch (error) {
30671
- console.error("[LewContextMenu] Error in onClick handler:", error);
30672
- }
30565
+ const proxyItem = createItemProxy(item);
30566
+ const proxyOptions = new Proxy(_options.value, {
30567
+ get(target, prop, receiver) {
30568
+ return Reflect.get(target, prop, receiver);
30569
+ }
30570
+ });
30571
+ item.onClick?.(proxyItem, proxyOptions, instance);
30673
30572
  } else {
30674
30573
  instance?.hide();
30675
30574
  }
@@ -30716,36 +30615,28 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
30716
30615
  if (!el || option?.disabled || !option?.children?.length) {
30717
30616
  return;
30718
30617
  }
30719
- try {
30720
- if (!window.LewContextMenu) {
30721
- initLewContextMenu();
30722
- }
30723
- const { element: menuDom, app } = createSubMenu(option.children);
30724
- const tippyInstances = tippy(el, {
30725
- ...TIPPY_CONFIG,
30726
- content: menuDom
30727
- });
30728
- const tippyInstance = Array.isArray(tippyInstances) ? tippyInstances[0] : tippyInstances;
30729
- subMenuInstances.set(index2, { app, tippy: tippyInstance });
30730
- window.LewContextMenu.menuInstance[`${uniqueId}-${index2}`] = tippyInstance;
30731
- const popperElement = tippyInstance.popper?.children?.[0];
30732
- popperElement?.setAttribute("data-lew", "popover");
30733
- } catch (error) {
30734
- console.error("[LewContextMenu] Failed to initialize submenu:", error);
30618
+ if (!window.LewContextMenu) {
30619
+ initLewContextMenu();
30735
30620
  }
30621
+ const { element: menuDom, app } = createSubMenu(option.children);
30622
+ const tippyInstances = tippy(el, {
30623
+ ...TIPPY_CONFIG,
30624
+ content: menuDom
30625
+ });
30626
+ const tippyInstance = Array.isArray(tippyInstances) ? tippyInstances[0] : tippyInstances;
30627
+ subMenuInstances.set(index2, { app, tippy: tippyInstance });
30628
+ window.LewContextMenu.menuInstance[`${uniqueId}-${index2}`] = tippyInstance;
30629
+ const popperElement = tippyInstance.popper?.children?.[0];
30630
+ popperElement?.setAttribute("data-lew", "popover");
30736
30631
  });
30737
30632
  }
30738
30633
  function cleanup() {
30739
30634
  subMenuInstances.forEach(({ app, tippy: tippy2 }, index2) => {
30740
- try {
30741
- app?.unmount?.();
30742
- tippy2?.destroy?.();
30743
- const key = `${uniqueId}-${index2}`;
30744
- if (window.LewContextMenu?.menuInstance?.[key]) {
30745
- delete window.LewContextMenu.menuInstance[key];
30746
- }
30747
- } catch (error) {
30748
- console.warn("[LewContextMenu] Failed to cleanup submenu instance:", error);
30635
+ app?.unmount?.();
30636
+ tippy2?.destroy?.();
30637
+ const key = `${uniqueId}-${index2}`;
30638
+ if (window.LewContextMenu?.menuInstance?.[key]) {
30639
+ delete window.LewContextMenu.menuInstance[key];
30749
30640
  }
30750
30641
  });
30751
30642
  subMenuInstances.clear();
@@ -30826,7 +30717,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
30826
30717
  };
30827
30718
  }
30828
30719
  });
30829
- const LewContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-98f71517"]]);
30720
+ const LewContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-10d9d549"]]);
30830
30721
  const dropdownModel = {
30831
30722
  selectedKeys: {
30832
30723
  type: Array,