lew-ui 2.6.0 → 2.6.2

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.mjs CHANGED
@@ -14,7 +14,7 @@ const isClient = typeof window !== "undefined" && typeof document !== "undefined
14
14
  typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
15
15
  const toString$2 = Object.prototype.toString;
16
16
  const isObject$3 = (val) => toString$2.call(val) === "[object Object]";
17
- const noop$1 = () => {
17
+ const noop = () => {
18
18
  };
19
19
  const isIOS = /* @__PURE__ */ getIsIOS();
20
20
  function getIsIOS() {
@@ -35,11 +35,11 @@ const bypassFilter = (invoke) => {
35
35
  function debounceFilter(ms, options = {}) {
36
36
  let timer;
37
37
  let maxTimer;
38
- let lastRejector = noop$1;
38
+ let lastRejector = noop;
39
39
  const _clearTimeout = (timer2) => {
40
40
  clearTimeout(timer2);
41
41
  lastRejector();
42
- lastRejector = noop$1;
42
+ lastRejector = noop;
43
43
  };
44
44
  const filter = (invoke) => {
45
45
  const duration = toValue(ms);
@@ -290,7 +290,7 @@ function useEventListener$1(...args) {
290
290
  [target, events, listeners, options] = args;
291
291
  }
292
292
  if (!target)
293
- return noop$1;
293
+ return noop;
294
294
  if (!Array.isArray(events))
295
295
  events = [events];
296
296
  if (!Array.isArray(listeners))
@@ -330,11 +330,11 @@ let _iOSWorkaround = false;
330
330
  function onClickOutside(target, handler, options = {}) {
331
331
  const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;
332
332
  if (!window2)
333
- return noop$1;
333
+ return noop;
334
334
  if (isIOS && !_iOSWorkaround) {
335
335
  _iOSWorkaround = true;
336
- Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop$1));
337
- window2.document.documentElement.addEventListener("click", noop$1);
336
+ Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop));
337
+ window2.document.documentElement.addEventListener("click", noop);
338
338
  }
339
339
  let shouldListen = true;
340
340
  const shouldIgnore = (event) => {
@@ -399,8 +399,8 @@ function useAsyncState(promise, initialState, options) {
399
399
  const {
400
400
  immediate = true,
401
401
  delay = 0,
402
- onError = noop$1,
403
- onSuccess = noop$1,
402
+ onError = noop,
403
+ onSuccess = noop,
404
404
  resetOnExecute = true,
405
405
  shallow = true,
406
406
  throwError
@@ -575,7 +575,7 @@ function useMagicKeys(options = {}) {
575
575
  target = defaultWindow,
576
576
  aliasMap = DefaultMagicKeysAliasMap,
577
577
  passive: passive2 = true,
578
- onEventFired = noop$1
578
+ onEventFired = noop
579
579
  } = options;
580
580
  const current = reactive(/* @__PURE__ */ new Set());
581
581
  const obj = {
@@ -805,7 +805,7 @@ function arrayMap(array2, iteratee) {
805
805
  return result;
806
806
  }
807
807
  var isArray$1 = Array.isArray;
808
- var INFINITY$2 = 1 / 0;
808
+ var INFINITY$1 = 1 / 0;
809
809
  var symbolProto$2 = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString$1 = symbolProto$2 ? symbolProto$2.toString : void 0;
810
810
  function baseToString(value) {
811
811
  if (typeof value == "string") {
@@ -818,7 +818,7 @@ function baseToString(value) {
818
818
  return symbolToString$1 ? symbolToString$1.call(value) : "";
819
819
  }
820
820
  var result = value + "";
821
- return result == "0" && 1 / value == -INFINITY$2 ? "-0" : result;
821
+ return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
822
822
  }
823
823
  var reWhitespace = /\s/;
824
824
  function trimmedEndIndex(string2) {
@@ -945,8 +945,6 @@ function apply$1(func, thisArg, args) {
945
945
  }
946
946
  return func.apply(thisArg, args);
947
947
  }
948
- function noop() {
949
- }
950
948
  function copyArray(source, array2) {
951
949
  var index2 = -1, length = source.length;
952
950
  array2 || (array2 = Array(length));
@@ -1390,8 +1388,8 @@ function isKeyable(value) {
1390
1388
  var type = typeof value;
1391
1389
  return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1392
1390
  }
1393
- function getMapData(map2, key) {
1394
- var data = map2.__data__;
1391
+ function getMapData(map, key) {
1392
+ var data = map.__data__;
1395
1393
  return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
1396
1394
  }
1397
1395
  function mapCacheDelete(key) {
@@ -1474,13 +1472,13 @@ function castPath(value, object2) {
1474
1472
  }
1475
1473
  return isKey(value, object2) ? [value] : stringToPath(toString$1(value));
1476
1474
  }
1477
- var INFINITY$1 = 1 / 0;
1475
+ var INFINITY = 1 / 0;
1478
1476
  function toKey(value) {
1479
1477
  if (typeof value == "string" || isSymbol(value)) {
1480
1478
  return value;
1481
1479
  }
1482
1480
  var result = value + "";
1483
- return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
1481
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
1484
1482
  }
1485
1483
  function baseGet(object2, path) {
1486
1484
  path = castPath(path, object2);
@@ -1515,8 +1513,6 @@ function baseFlatten(array2, depth, predicate, isStrict, result) {
1515
1513
  {
1516
1514
  arrayPush(result, value);
1517
1515
  }
1518
- } else if (!isStrict) {
1519
- result[result.length] = value;
1520
1516
  }
1521
1517
  }
1522
1518
  return result;
@@ -1558,12 +1554,12 @@ function stackGet(key) {
1558
1554
  function stackHas(key) {
1559
1555
  return this.__data__.has(key);
1560
1556
  }
1561
- var LARGE_ARRAY_SIZE$2 = 200;
1557
+ var LARGE_ARRAY_SIZE$1 = 200;
1562
1558
  function stackSet(key, value) {
1563
1559
  var data = this.__data__;
1564
1560
  if (data instanceof ListCache) {
1565
1561
  var pairs = data.__data__;
1566
- if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE$2 - 1) {
1562
+ if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE$1 - 1) {
1567
1563
  pairs.push([key, value]);
1568
1564
  this.size = ++data.size;
1569
1565
  return this;
@@ -1902,9 +1898,9 @@ function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
1902
1898
  stack["delete"](other);
1903
1899
  return result;
1904
1900
  }
1905
- function mapToArray(map2) {
1906
- var index2 = -1, result = Array(map2.size);
1907
- map2.forEach(function(value, key) {
1901
+ function mapToArray(map) {
1902
+ var index2 = -1, result = Array(map.size);
1903
+ map.forEach(function(value, key) {
1908
1904
  result[++index2] = [key, value];
1909
1905
  });
1910
1906
  return result;
@@ -2228,7 +2224,7 @@ var now$1 = function() {
2228
2224
  return root.Date.now();
2229
2225
  };
2230
2226
  var FUNC_ERROR_TEXT$1 = "Expected a function";
2231
- var nativeMax = Math.max, nativeMin$1 = Math.min;
2227
+ var nativeMax = Math.max, nativeMin = Math.min;
2232
2228
  function debounce$2(func, wait, options) {
2233
2229
  var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
2234
2230
  if (typeof func != "function") {
@@ -2255,7 +2251,7 @@ function debounce$2(func, wait, options) {
2255
2251
  }
2256
2252
  function remainingWait(time) {
2257
2253
  var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
2258
- return maxing ? nativeMin$1(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
2254
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
2259
2255
  }
2260
2256
  function shouldInvoke(time) {
2261
2257
  var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
@@ -2390,13 +2386,13 @@ function baseMerge(object2, source, srcIndex, customizer, stack) {
2390
2386
  }
2391
2387
  }, keysIn);
2392
2388
  }
2393
- var LARGE_ARRAY_SIZE$1 = 200;
2389
+ var LARGE_ARRAY_SIZE = 200;
2394
2390
  function baseDifference(array2, values, iteratee, comparator) {
2395
2391
  var index2 = -1, includes = arrayIncludes, isCommon = true, length = array2.length, result = [], valuesLength = values.length;
2396
2392
  if (!length) {
2397
2393
  return result;
2398
2394
  }
2399
- if (values.length >= LARGE_ARRAY_SIZE$1) {
2395
+ if (values.length >= LARGE_ARRAY_SIZE) {
2400
2396
  includes = cacheHas;
2401
2397
  isCommon = false;
2402
2398
  values = new SetCache(values);
@@ -2420,15 +2416,8 @@ function baseDifference(array2, values, iteratee, comparator) {
2420
2416
  return result;
2421
2417
  }
2422
2418
  var difference = baseRest(function(array2, values) {
2423
- return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values, 1, isArrayLikeObject, true)) : [];
2419
+ return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values, 1, isArrayLikeObject)) : [];
2424
2420
  });
2425
- function castFunction(value) {
2426
- return typeof value == "function" ? value : identity;
2427
- }
2428
- function forEach$1(collection, iteratee) {
2429
- var func = isArray$1(collection) ? arrayEach : baseEach;
2430
- return func(collection, castFunction(iteratee));
2431
- }
2432
2421
  var htmlEscapes = {
2433
2422
  "&": "&amp;",
2434
2423
  "<": "&lt;",
@@ -2442,28 +2431,6 @@ function escape$1(string2) {
2442
2431
  string2 = toString$1(string2);
2443
2432
  return string2 && reHasUnescapedHtml.test(string2) ? string2.replace(reUnescapedHtml, escapeHtmlChar) : string2;
2444
2433
  }
2445
- function findIndex$1(array2, predicate, fromIndex) {
2446
- var length = array2 == null ? 0 : array2.length;
2447
- if (!length) {
2448
- return -1;
2449
- }
2450
- var index2 = 0;
2451
- return baseFindIndex(array2, baseIteratee(predicate), index2);
2452
- }
2453
- function baseMap(collection, iteratee) {
2454
- var index2 = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
2455
- baseEach(collection, function(value, key, collection2) {
2456
- result[++index2] = iteratee(value, key, collection2);
2457
- });
2458
- return result;
2459
- }
2460
- function map(collection, iteratee) {
2461
- var func = isArray$1(collection) ? arrayMap : baseMap;
2462
- return func(collection, baseIteratee(iteratee));
2463
- }
2464
- function flatMap(collection, iteratee) {
2465
- return baseFlatten(map(collection, iteratee));
2466
- }
2467
2434
  var objectProto$1 = Object.prototype;
2468
2435
  var hasOwnProperty$3 = objectProto$1.hasOwnProperty;
2469
2436
  function baseHas(object2, key) {
@@ -2476,46 +2443,6 @@ var stringTag = "[object String]";
2476
2443
  function isString$1(value) {
2477
2444
  return typeof value == "string" || !isArray$1(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
2478
2445
  }
2479
- var nativeMin = Math.min;
2480
- function baseIntersection(arrays, iteratee, comparator) {
2481
- var includes = arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = [];
2482
- while (othIndex--) {
2483
- var array2 = arrays[othIndex];
2484
- if (othIndex && iteratee) {
2485
- array2 = arrayMap(array2, baseUnary(iteratee));
2486
- }
2487
- maxLength = nativeMin(array2.length, maxLength);
2488
- caches[othIndex] = length >= 120 && array2.length >= 120 ? new SetCache(othIndex && array2) : void 0;
2489
- }
2490
- array2 = arrays[0];
2491
- var index2 = -1, seen = caches[0];
2492
- outer:
2493
- while (++index2 < length && result.length < maxLength) {
2494
- var value = array2[index2], computed2 = value;
2495
- value = value !== 0 ? value : 0;
2496
- if (!(seen ? cacheHas(seen, computed2) : includes(result, computed2))) {
2497
- othIndex = othLength;
2498
- while (--othIndex) {
2499
- var cache2 = caches[othIndex];
2500
- if (!(cache2 ? cacheHas(cache2, computed2) : includes(arrays[othIndex], computed2))) {
2501
- continue outer;
2502
- }
2503
- }
2504
- if (seen) {
2505
- seen.push(computed2);
2506
- }
2507
- result.push(value);
2508
- }
2509
- }
2510
- return result;
2511
- }
2512
- function castArrayLikeObject(value) {
2513
- return isArrayLikeObject(value) ? value : [];
2514
- }
2515
- var intersection = baseRest(function(arrays) {
2516
- var mapped = arrayMap(arrays, castArrayLikeObject);
2517
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
2518
- });
2519
2446
  var mapTag = "[object Map]", setTag = "[object Set]";
2520
2447
  var objectProto = Object.prototype;
2521
2448
  var hasOwnProperty$2 = objectProto.hasOwnProperty;
@@ -2609,18 +2536,6 @@ function pickBy(object2, predicate) {
2609
2536
  return predicate(value, path[0]);
2610
2537
  });
2611
2538
  }
2612
- function baseSome(collection, predicate) {
2613
- var result;
2614
- baseEach(collection, function(value, index2, collection2) {
2615
- result = predicate(value, index2, collection2);
2616
- return !result;
2617
- });
2618
- return !!result;
2619
- }
2620
- function some(collection, predicate, guard) {
2621
- var func = isArray$1(collection) ? arraySome : baseSome;
2622
- return func(collection, baseIteratee(predicate));
2623
- }
2624
2539
  function sumBy(array2, iteratee) {
2625
2540
  return array2 && array2.length ? baseSum(array2, baseIteratee(iteratee)) : 0;
2626
2541
  }
@@ -2640,48 +2555,6 @@ function throttle(func, wait, options) {
2640
2555
  "trailing": trailing
2641
2556
  });
2642
2557
  }
2643
- var INFINITY = 1 / 0;
2644
- var createSet = !(Set$1 && 1 / setToArray(new Set$1([, -0]))[1] == INFINITY) ? noop : function(values) {
2645
- return new Set$1(values);
2646
- };
2647
- var LARGE_ARRAY_SIZE = 200;
2648
- function baseUniq(array2, iteratee, comparator) {
2649
- var index2 = -1, includes = arrayIncludes, length = array2.length, isCommon = true, result = [], seen = result;
2650
- if (length >= LARGE_ARRAY_SIZE) {
2651
- var set = createSet(array2);
2652
- if (set) {
2653
- return setToArray(set);
2654
- }
2655
- isCommon = false;
2656
- includes = cacheHas;
2657
- seen = new SetCache();
2658
- } else {
2659
- seen = result;
2660
- }
2661
- outer:
2662
- while (++index2 < length) {
2663
- var value = array2[index2], computed2 = value;
2664
- value = value !== 0 ? value : 0;
2665
- if (isCommon && computed2 === computed2) {
2666
- var seenIndex = seen.length;
2667
- while (seenIndex--) {
2668
- if (seen[seenIndex] === computed2) {
2669
- continue outer;
2670
- }
2671
- }
2672
- result.push(value);
2673
- } else if (!includes(seen, computed2, comparator)) {
2674
- if (seen !== result) {
2675
- seen.push(computed2);
2676
- }
2677
- result.push(value);
2678
- }
2679
- }
2680
- return result;
2681
- }
2682
- function uniq(array2) {
2683
- return array2 && array2.length ? baseUniq(array2) : [];
2684
- }
2685
2558
  var idCounter$1 = 0;
2686
2559
  function uniqueId(prefix) {
2687
2560
  var id = ++idCounter$1;
@@ -3143,7 +3016,7 @@ const X = createLucideIcon("XIcon", [
3143
3016
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
3144
3017
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
3145
3018
  ]);
3146
- const _sfc_main$12 = /* @__PURE__ */ defineComponent({
3019
+ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
3147
3020
  __name: "Icon",
3148
3021
  props: {
3149
3022
  type: {
@@ -3245,7 +3118,7 @@ const _export_sfc = (sfc, props2) => {
3245
3118
  }
3246
3119
  return target;
3247
3120
  };
3248
- const Icon = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-550e8cab"]]);
3121
+ const Icon = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-550e8cab"]]);
3249
3122
  const iconColorType = {
3250
3123
  normal: "gray",
3251
3124
  warning: "orange",
@@ -3581,6 +3454,44 @@ const poll = ({
3581
3454
  };
3582
3455
  execute();
3583
3456
  };
3457
+ const insertChildByKey = (tree, key, newChild) => {
3458
+ var _a;
3459
+ for (let i = 0; i < tree.length; i++) {
3460
+ if (tree[i].key === key) {
3461
+ tree[i].children = newChild;
3462
+ return true;
3463
+ }
3464
+ if ((_a = tree[i].children) == null ? void 0 : _a.length) {
3465
+ if (insertChildByKey(tree[i].children, key, newChild)) {
3466
+ return true;
3467
+ }
3468
+ }
3469
+ }
3470
+ return false;
3471
+ };
3472
+ const findAllChildrenKeys = (node) => {
3473
+ var _a;
3474
+ const keys2 = [];
3475
+ const traverse = (item) => {
3476
+ var _a2;
3477
+ if (item.key !== void 0) keys2.push(item.key);
3478
+ (_a2 = item.children) == null ? void 0 : _a2.forEach(traverse);
3479
+ };
3480
+ (_a = node.children) == null ? void 0 : _a.forEach(traverse);
3481
+ return keys2;
3482
+ };
3483
+ const findNodeByKey = (key, tree) => {
3484
+ var _a;
3485
+ const queue = cloneDeep(tree);
3486
+ while (queue.length > 0) {
3487
+ const node = queue.shift();
3488
+ if (node.key === key) return node;
3489
+ if ((_a = node.children) == null ? void 0 : _a.length) {
3490
+ queue.push(...node.children);
3491
+ }
3492
+ }
3493
+ return null;
3494
+ };
3584
3495
  const imageProps = {
3585
3496
  src: {
3586
3497
  type: String,
@@ -3688,17 +3599,17 @@ const imageProps = {
3688
3599
  }
3689
3600
  }
3690
3601
  };
3691
- const _hoisted_1$K = {
3602
+ const _hoisted_1$L = {
3692
3603
  key: 0,
3693
3604
  class: "skeletons"
3694
3605
  };
3695
- const _hoisted_2$t = ["alt"];
3696
- const _hoisted_3$m = {
3606
+ const _hoisted_2$s = ["alt"];
3607
+ const _hoisted_3$l = {
3697
3608
  key: 2,
3698
3609
  class: "lew-image-box"
3699
3610
  };
3700
3611
  const _hoisted_4$e = ["src", "lazy", "alt"];
3701
- const _sfc_main$11 = /* @__PURE__ */ defineComponent({
3612
+ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
3702
3613
  __name: "LewImage",
3703
3614
  props: imageProps,
3704
3615
  setup(__props2) {
@@ -3745,19 +3656,19 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
3745
3656
  style: normalizeStyle(unref(imageStyleObject))
3746
3657
  }, {
3747
3658
  default: withCtx(() => [
3748
- unref(_loading) || _ctx.loading || !_ctx.src ? (openBlock(), createElementBlock("div", _hoisted_1$K)) : unref(_error) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3659
+ unref(_loading) || _ctx.loading || !_ctx.src ? (openBlock(), createElementBlock("div", _hoisted_1$L)) : unref(_error) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3749
3660
  _ctx.$slots.error ? renderSlot(_ctx.$slots, "error", { key: 0 }, void 0, true) : withDirectives((openBlock(), createElementBlock("img", {
3750
3661
  key: 1,
3751
3662
  class: "lew-image-fail-icon",
3752
3663
  src: _imports_0,
3753
3664
  alt: unref(locale).t("image.fail")
3754
- }, null, 8, _hoisted_2$t)), [
3665
+ }, null, 8, _hoisted_2$s)), [
3755
3666
  [_directive_tooltip, {
3756
3667
  content: unref(locale).t("image.fail"),
3757
3668
  trigger: "mouseenter"
3758
3669
  }]
3759
3670
  ])
3760
- ], 64)) : (openBlock(), createElementBlock("div", _hoisted_3$m, [
3671
+ ], 64)) : (openBlock(), createElementBlock("div", _hoisted_3$l, [
3761
3672
  createElementVNode("img", {
3762
3673
  class: "lew-image",
3763
3674
  src: _ctx.src,
@@ -3775,7 +3686,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
3775
3686
  };
3776
3687
  }
3777
3688
  });
3778
- const LewImage = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-f1c1be76"]]);
3689
+ const LewImage = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-f1c1be76"]]);
3779
3690
  const avatarProps = {
3780
3691
  size: {
3781
3692
  type: [Number, String],
@@ -3901,12 +3812,12 @@ const avatarProps = {
3901
3812
  }
3902
3813
  }
3903
3814
  };
3904
- const _hoisted_1$J = {
3815
+ const _hoisted_1$K = {
3905
3816
  key: 0,
3906
3817
  class: "skeletons"
3907
3818
  };
3908
- const _hoisted_2$s = ["src", "alt"];
3909
- const _sfc_main$10 = /* @__PURE__ */ defineComponent({
3819
+ const _hoisted_2$r = ["src", "alt"];
3820
+ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
3910
3821
  __name: "LewAvatar",
3911
3822
  props: avatarProps,
3912
3823
  setup(__props2) {
@@ -4055,7 +3966,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
4055
3966
  class: "lew-avatar-text",
4056
3967
  style: normalizeStyle(unref(textStyleObject))
4057
3968
  }, toDisplayString$1(unref(altText)), 5)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
4058
- unref(_loading) || _ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_1$J)) : unref(_error) || !_ctx.src ? (openBlock(), createBlock(Icon, {
3969
+ unref(_loading) || _ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_1$K)) : unref(_error) || !_ctx.src ? (openBlock(), createBlock(Icon, {
4059
3970
  key: 1,
4060
3971
  size: unref(getIconSize),
4061
3972
  type: "user"
@@ -4065,7 +3976,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
4065
3976
  alt: _ctx.alt,
4066
3977
  lazy: "",
4067
3978
  style: normalizeStyle(unref(imageStyleObject))
4068
- }, null, 12, _hoisted_2$s)) : createCommentVNode("", true)
3979
+ }, null, 12, _hoisted_2$r)) : createCommentVNode("", true)
4069
3980
  ], 64))
4070
3981
  ], 4),
4071
3982
  _ctx.status ? (openBlock(), createElementBlock("i", {
@@ -4076,7 +3987,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
4076
3987
  };
4077
3988
  }
4078
3989
  });
4079
- const LewAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-27c30e37"]]);
3990
+ const LewAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-27c30e37"]]);
4080
3991
  const validColors = [
4081
3992
  "blue",
4082
3993
  "gray",
@@ -4198,13 +4109,13 @@ const buttonProps = {
4198
4109
  description: "点击按钮时触发的异步请求函数"
4199
4110
  }
4200
4111
  };
4201
- const _hoisted_1$I = ["disabled"];
4202
- const _hoisted_2$r = {
4112
+ const _hoisted_1$J = ["disabled"];
4113
+ const _hoisted_2$q = {
4203
4114
  key: 0,
4204
4115
  class: "lew-button-content"
4205
4116
  };
4206
- const _hoisted_3$l = { class: "lew-button-text" };
4207
- const _sfc_main$$ = /* @__PURE__ */ defineComponent({
4117
+ const _hoisted_3$k = { class: "lew-button-text" };
4118
+ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
4208
4119
  __name: "LewButton",
4209
4120
  props: buttonProps,
4210
4121
  emits: ["click"],
@@ -4315,18 +4226,18 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
4315
4226
  type: "loader"
4316
4227
  }, null, 8, ["size"])
4317
4228
  ], 2),
4318
- _ctx.$slots.default || _ctx.text ? (openBlock(), createElementBlock("div", _hoisted_2$r, [
4319
- createElementVNode("span", _hoisted_3$l, [
4229
+ _ctx.$slots.default || _ctx.text ? (openBlock(), createElementBlock("div", _hoisted_2$q, [
4230
+ createElementVNode("span", _hoisted_3$k, [
4320
4231
  _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }, void 0, true) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
4321
4232
  createTextVNode(toDisplayString$1(_ctx.text), 1)
4322
4233
  ], 64))
4323
4234
  ])
4324
4235
  ])) : createCommentVNode("", true)
4325
- ], 14, _hoisted_1$I);
4236
+ ], 14, _hoisted_1$J);
4326
4237
  };
4327
4238
  }
4328
4239
  });
4329
- const LewButton = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__scopeId", "data-v-45a88edc"]]);
4240
+ const LewButton = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-6acb7c29"]]);
4330
4241
  const tagProps = {
4331
4242
  text: {
4332
4243
  type: String,
@@ -4386,16 +4297,16 @@ const tagProps = {
4386
4297
  default: false
4387
4298
  }
4388
4299
  };
4389
- const _hoisted_1$H = {
4300
+ const _hoisted_1$I = {
4390
4301
  key: 0,
4391
4302
  class: "lew-tag-left"
4392
4303
  };
4393
- const _hoisted_2$q = { class: "lew-tag-value" };
4394
- const _hoisted_3$k = {
4304
+ const _hoisted_2$p = { class: "lew-tag-value" };
4305
+ const _hoisted_3$j = {
4395
4306
  key: 1,
4396
4307
  class: "lew-tag-right"
4397
4308
  };
4398
- const _sfc_main$_ = /* @__PURE__ */ defineComponent({
4309
+ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
4399
4310
  __name: "LewTag",
4400
4311
  props: tagProps,
4401
4312
  emits: ["close"],
@@ -4477,13 +4388,13 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
4477
4388
  class: "lew-tag",
4478
4389
  style: normalizeStyle(unref(tagStyle))
4479
4390
  }, [
4480
- _ctx.$slots.left ? (openBlock(), createElementBlock("div", _hoisted_1$H, [
4391
+ _ctx.$slots.left ? (openBlock(), createElementBlock("div", _hoisted_1$I, [
4481
4392
  renderSlot(_ctx.$slots, "left")
4482
4393
  ])) : createCommentVNode("", true),
4483
- createElementVNode("div", _hoisted_2$q, [
4394
+ createElementVNode("div", _hoisted_2$p, [
4484
4395
  createVNode(unref(LewTextTrim), { text: unref(displayText) }, null, 8, ["text"])
4485
4396
  ]),
4486
- _ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_3$k, [
4397
+ _ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_3$j, [
4487
4398
  renderSlot(_ctx.$slots, "right")
4488
4399
  ])) : createCommentVNode("", true),
4489
4400
  _ctx.closable ? (openBlock(), createElementBlock("div", {
@@ -4549,11 +4460,11 @@ const badgeProps = {
4549
4460
  }
4550
4461
  }
4551
4462
  };
4552
- const _hoisted_1$G = {
4463
+ const _hoisted_1$H = {
4553
4464
  key: 2,
4554
4465
  class: "lew-badge-text"
4555
4466
  };
4556
- const _sfc_main$Z = /* @__PURE__ */ defineComponent({
4467
+ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
4557
4468
  __name: "LewBadge",
4558
4469
  props: badgeProps,
4559
4470
  setup(__props2) {
@@ -4605,7 +4516,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
4605
4516
  class: normalizeClass(["lew-badge-dot", { "is-processing": _ctx.processing }]),
4606
4517
  style: normalizeStyle(unref(getStyle))
4607
4518
  }, null, 6)),
4608
- _ctx.text ? (openBlock(), createElementBlock("span", _hoisted_1$G, toDisplayString$1(_ctx.text), 1)) : renderSlot(_ctx.$slots, "default", { key: 3 })
4519
+ _ctx.text ? (openBlock(), createElementBlock("span", _hoisted_1$H, toDisplayString$1(_ctx.text), 1)) : renderSlot(_ctx.$slots, "default", { key: 3 })
4609
4520
  ], 4);
4610
4521
  };
4611
4522
  }
@@ -4672,7 +4583,7 @@ const titleProps = {
4672
4583
  }
4673
4584
  }
4674
4585
  };
4675
- const _sfc_main$Y = /* @__PURE__ */ defineComponent({
4586
+ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
4676
4587
  __name: "LewTitle",
4677
4588
  props: titleProps,
4678
4589
  setup(__props2) {
@@ -4699,7 +4610,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
4699
4610
  };
4700
4611
  }
4701
4612
  });
4702
- const LewTitle = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-1c7220e8"]]);
4613
+ const LewTitle = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-1c7220e8"]]);
4703
4614
  var top = "top";
4704
4615
  var bottom = "bottom";
4705
4616
  var right = "right";
@@ -5845,18 +5756,18 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
5845
5756
  };
5846
5757
  }
5847
5758
  function order(modifiers) {
5848
- var map2 = /* @__PURE__ */ new Map();
5759
+ var map = /* @__PURE__ */ new Map();
5849
5760
  var visited = /* @__PURE__ */ new Set();
5850
5761
  var result = [];
5851
5762
  modifiers.forEach(function(modifier) {
5852
- map2.set(modifier.name, modifier);
5763
+ map.set(modifier.name, modifier);
5853
5764
  });
5854
5765
  function sort(modifier) {
5855
5766
  visited.add(modifier.name);
5856
5767
  var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
5857
5768
  requires.forEach(function(dep) {
5858
5769
  if (!visited.has(dep)) {
5859
- var depModifier = map2.get(dep);
5770
+ var depModifier = map.get(dep);
5860
5771
  if (depModifier) {
5861
5772
  sort(depModifier);
5862
5773
  }
@@ -7515,7 +7426,7 @@ const clearMeasureCache = () => {
7515
7426
  sharedMeasureSpan = null;
7516
7427
  }
7517
7428
  };
7518
- const _sfc_main$X = /* @__PURE__ */ defineComponent({
7429
+ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
7519
7430
  __name: "LewTextTrim",
7520
7431
  props: textTrimProps,
7521
7432
  setup(__props2) {
@@ -7667,7 +7578,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
7667
7578
  };
7668
7579
  }
7669
7580
  });
7670
- const LewTextTrim = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-fb6a0a04"]]);
7581
+ const LewTextTrim = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-fb6a0a04"]]);
7671
7582
  const flexProps = {
7672
7583
  direction: {
7673
7584
  type: String,
@@ -7757,7 +7668,7 @@ const flexProps = {
7757
7668
  }
7758
7669
  }
7759
7670
  };
7760
- const _sfc_main$W = /* @__PURE__ */ defineComponent({
7671
+ const _sfc_main$X = /* @__PURE__ */ defineComponent({
7761
7672
  __name: "LewFlex",
7762
7673
  props: flexProps,
7763
7674
  setup(__props2) {
@@ -7804,7 +7715,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
7804
7715
  };
7805
7716
  }
7806
7717
  });
7807
- const LewFlex = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-21564e51"]]);
7718
+ const LewFlex = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-21564e51"]]);
7808
7719
  const markProps = {
7809
7720
  color: {
7810
7721
  type: String,
@@ -7874,7 +7785,7 @@ const markProps = {
7874
7785
  typeDesc: `pointer | default | text | move | not-allowed`
7875
7786
  }
7876
7787
  };
7877
- const _sfc_main$V = /* @__PURE__ */ defineComponent({
7788
+ const _sfc_main$W = /* @__PURE__ */ defineComponent({
7878
7789
  __name: "LewMark",
7879
7790
  props: markProps,
7880
7791
  emits: ["click"],
@@ -7903,7 +7814,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
7903
7814
  };
7904
7815
  }
7905
7816
  });
7906
- const LewMark = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-7475c5ce"]]);
7817
+ const LewMark = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-7475c5ce"]]);
7907
7818
  const expandProps = {
7908
7819
  collapseHeight: {
7909
7820
  type: [Number, String],
@@ -7911,7 +7822,7 @@ const expandProps = {
7911
7822
  description: `组件收起状态时的高度,可以是数字(单位为像素)或字符串(如 '50px'、'3rem' 等)`
7912
7823
  }
7913
7824
  };
7914
- const _sfc_main$U = /* @__PURE__ */ defineComponent({
7825
+ const _sfc_main$V = /* @__PURE__ */ defineComponent({
7915
7826
  __name: "LewExpand",
7916
7827
  props: expandProps,
7917
7828
  setup(__props2) {
@@ -7941,6 +7852,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
7941
7852
  key: 0,
7942
7853
  onClick: _cache[0] || (_cache[0] = ($event) => isRef(collapse) ? collapse.value = !unref(collapse) : collapse = !unref(collapse)),
7943
7854
  gap: "5",
7855
+ x: "center",
7944
7856
  class: "lew-expand-btn"
7945
7857
  }, {
7946
7858
  default: withCtx(() => [
@@ -7958,7 +7870,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
7958
7870
  };
7959
7871
  }
7960
7872
  });
7961
- const LewExpand = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-1fe5a721"]]);
7873
+ const LewExpand = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-c9d905d9"]]);
7962
7874
  const backTopProps = {
7963
7875
  right: {
7964
7876
  type: Number,
@@ -8025,7 +7937,7 @@ function useEventListener(target, event, callback) {
8025
7937
  onMounted(() => target.addEventListener(event, callback, true));
8026
7938
  onUnmounted(() => target.removeEventListener(event, callback, true));
8027
7939
  }
8028
- const _sfc_main$T = /* @__PURE__ */ defineComponent({
7940
+ const _sfc_main$U = /* @__PURE__ */ defineComponent({
8029
7941
  __name: "LewBackTop",
8030
7942
  props: backTopProps,
8031
7943
  emits: ["click"],
@@ -8080,7 +7992,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
8080
7992
  };
8081
7993
  }
8082
7994
  });
8083
- const LewBackTop = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-85f05def"]]);
7995
+ const LewBackTop = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-85f05def"]]);
8084
7996
  const stepsModel = {
8085
7997
  modelValue: {
8086
7998
  type: [String, Number],
@@ -8137,14 +8049,14 @@ const stepsProps = {
8137
8049
  description: "步骤条的最小宽度"
8138
8050
  }
8139
8051
  };
8140
- const _hoisted_1$F = { class: "lew-steps lew-scrollbar" };
8141
- const _hoisted_2$p = { class: "lew-steps-item-index" };
8142
- const _hoisted_3$j = {
8052
+ const _hoisted_1$G = { class: "lew-steps lew-scrollbar" };
8053
+ const _hoisted_2$o = { class: "lew-steps-item-index" };
8054
+ const _hoisted_3$i = {
8143
8055
  key: 4,
8144
8056
  class: "index"
8145
8057
  };
8146
8058
  const _hoisted_4$d = { class: "lew-steps-item-info" };
8147
- const _sfc_main$S = /* @__PURE__ */ defineComponent({
8059
+ const _sfc_main$T = /* @__PURE__ */ defineComponent({
8148
8060
  __name: "LewSteps",
8149
8061
  props: /* @__PURE__ */ mergeModels(stepsProps, {
8150
8062
  "modelValue": {},
@@ -8154,7 +8066,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
8154
8066
  setup(__props2) {
8155
8067
  const stepsValue = useModel(__props2, "modelValue");
8156
8068
  return (_ctx, _cache) => {
8157
- return openBlock(), createElementBlock("div", _hoisted_1$F, [
8069
+ return openBlock(), createElementBlock("div", _hoisted_1$G, [
8158
8070
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index2) => {
8159
8071
  return openBlock(), createElementBlock("div", {
8160
8072
  key: index2,
@@ -8167,7 +8079,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
8167
8079
  }]),
8168
8080
  style: normalizeStyle({ minWidth: unref(any2px)(_ctx.minWidth) })
8169
8081
  }, [
8170
- createElementVNode("div", _hoisted_2$p, [
8082
+ createElementVNode("div", _hoisted_2$o, [
8171
8083
  index2 === (stepsValue.value || 1) - 1 && _ctx.status === "loading" ? (openBlock(), createBlock(Icon, {
8172
8084
  key: 0,
8173
8085
  size: 16,
@@ -8190,7 +8102,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
8190
8102
  size: 16,
8191
8103
  "stroke-width": 3,
8192
8104
  type: "check"
8193
- })) : (openBlock(), createElementBlock("span", _hoisted_3$j, toDisplayString$1(index2 + 1), 1))
8105
+ })) : (openBlock(), createElementBlock("span", _hoisted_3$i, toDisplayString$1(index2 + 1), 1))
8194
8106
  ]),
8195
8107
  createElementVNode("div", _hoisted_4$d, [
8196
8108
  createElementVNode("div", {
@@ -8249,10 +8161,10 @@ const menuProps = {
8249
8161
  }
8250
8162
  }
8251
8163
  };
8252
- const _hoisted_1$E = { class: "lew-menu" };
8253
- const _hoisted_2$o = { class: "lew-menu-item" };
8254
- const _hoisted_3$i = ["onClick"];
8255
- const _sfc_main$R = /* @__PURE__ */ defineComponent({
8164
+ const _hoisted_1$F = { class: "lew-menu" };
8165
+ const _hoisted_2$n = { class: "lew-menu-item" };
8166
+ const _hoisted_3$h = ["onClick"];
8167
+ const _sfc_main$S = /* @__PURE__ */ defineComponent({
8256
8168
  __name: "LewMenu",
8257
8169
  props: /* @__PURE__ */ mergeModels(menuProps, {
8258
8170
  "modelValue": {},
@@ -8267,16 +8179,16 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
8267
8179
  emit2("change", item);
8268
8180
  };
8269
8181
  return (_ctx, _cache) => {
8270
- return openBlock(), createElementBlock("div", _hoisted_1$E, [
8182
+ return openBlock(), createElementBlock("div", _hoisted_1$F, [
8271
8183
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item) => {
8272
8184
  return openBlock(), createElementBlock(Fragment, {
8273
8185
  key: item.label
8274
8186
  }, [
8275
- createElementVNode("div", _hoisted_2$o, [
8187
+ createElementVNode("div", _hoisted_2$n, [
8276
8188
  createVNode(unref(LewTextTrim), {
8277
8189
  text: item.label
8278
8190
  }, null, 8, ["text"]),
8279
- item.tagText ? (openBlock(), createBlock(unref(_sfc_main$_), {
8191
+ item.tagText ? (openBlock(), createBlock(unref(_sfc_main$$), {
8280
8192
  key: 0,
8281
8193
  color: item.tagColor,
8282
8194
  round: "",
@@ -8306,7 +8218,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
8306
8218
  createVNode(unref(LewTextTrim), {
8307
8219
  text: cItem.label
8308
8220
  }, null, 8, ["text"]),
8309
- cItem.tagText ? (openBlock(), createBlock(unref(_sfc_main$_), {
8221
+ cItem.tagText ? (openBlock(), createBlock(unref(_sfc_main$$), {
8310
8222
  key: 1,
8311
8223
  color: cItem.tagColor,
8312
8224
  round: "",
@@ -8318,7 +8230,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
8318
8230
  ]),
8319
8231
  _: 2
8320
8232
  }, 1032, ["color", "type"])) : createCommentVNode("", true)
8321
- ], 10, _hoisted_3$i);
8233
+ ], 10, _hoisted_3$h);
8322
8234
  }), 128))
8323
8235
  ], 64);
8324
8236
  }), 128))
@@ -8326,7 +8238,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
8326
8238
  };
8327
8239
  }
8328
8240
  });
8329
- const LewMenu = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-4af03d56"]]);
8241
+ const LewMenu = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-4af03d56"]]);
8330
8242
  const menuTreeModel = {
8331
8243
  modelValue: {
8332
8244
  type: String,
@@ -8351,13 +8263,6 @@ const menuTreeModel = {
8351
8263
  description: "菜单树是否折叠。"
8352
8264
  }
8353
8265
  };
8354
- const menuTreeItemModel = {
8355
- modelValue: {
8356
- type: Boolean,
8357
- default: false,
8358
- description: "菜单树项的展开状态,true 表示展开,false 表示折叠。"
8359
- }
8360
- };
8361
8266
  const menuTreeProps = {
8362
8267
  options: {
8363
8268
  type: Array,
@@ -8401,20 +8306,11 @@ const menuTreeItemProps = {
8401
8306
  },
8402
8307
  description: "菜单树项的图标。"
8403
8308
  },
8404
- tagText: {
8405
- type: String,
8406
- default: "",
8407
- description: "菜单树项的标签文本。"
8408
- },
8409
- tagType: {
8410
- type: String,
8411
- default: "light",
8412
- description: "菜单树项的标签类型。"
8413
- },
8414
- tagColor: {
8415
- type: String,
8416
- default: "error",
8417
- description: "菜单树项的标签颜色。"
8309
+ renderLabel: {
8310
+ type: Function,
8311
+ default: () => {
8312
+ },
8313
+ description: "自定义渲染标签内容的函数。"
8418
8314
  },
8419
8315
  disabled: {
8420
8316
  type: Boolean,
@@ -8432,29 +8328,15 @@ const menuTreeItemProps = {
8432
8328
  description: "是否为叶子节点。"
8433
8329
  }
8434
8330
  };
8435
- const _hoisted_1$D = { class: "lew-menu-tree-item" };
8436
- const _sfc_main$Q = /* @__PURE__ */ defineComponent({
8331
+ const _hoisted_1$E = { class: "lew-menu-tree-item" };
8332
+ const _sfc_main$R = /* @__PURE__ */ defineComponent({
8437
8333
  __name: "LewMenuTreeItem",
8438
- props: {
8439
- ...menuTreeItemProps,
8440
- renderLabel: {
8441
- type: Function,
8442
- default: () => {
8443
- },
8444
- description: "自定义渲染标签内容的函数。"
8445
- }
8446
- },
8334
+ props: menuTreeItemProps,
8447
8335
  emits: ["change"],
8448
8336
  setup(__props2, { emit: __emit2 }) {
8449
8337
  const props2 = __props2;
8450
- const { modelValue: modelValue2, expandKeys, modelValueKeyPath, collapsed } = inject("menu-tree");
8338
+ const { modelValue: modelValue2, expandKeys, modelValueKeyPath, collapsed } = inject("lew-menu-tree");
8451
8339
  const emit2 = __emit2;
8452
- const tagRef = ref();
8453
- const tagWidth = ref(0);
8454
- onMounted(() => {
8455
- var _a, _b;
8456
- tagWidth.value = (_b = (_a = tagRef.value) == null ? void 0 : _a.$el) == null ? void 0 : _b.offsetWidth;
8457
- });
8458
8340
  const change2 = () => {
8459
8341
  if (props2.disabled) return;
8460
8342
  if (!props2.isLeaf) {
@@ -8475,8 +8357,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
8475
8357
  return (_ctx, _cache) => {
8476
8358
  var _a;
8477
8359
  const _component_lew_text_trim = resolveComponent("lew-text-trim");
8478
- const _component_lew_tag = resolveComponent("lew-tag");
8479
- return openBlock(), createElementBlock("div", _hoisted_1$D, [
8360
+ return openBlock(), createElementBlock("div", _hoisted_1$E, [
8480
8361
  createVNode(unref(LewFlex), {
8481
8362
  x: "start",
8482
8363
  y: "center",
@@ -8500,7 +8381,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
8500
8381
  props: props2
8501
8382
  }, void 0, true) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
8502
8383
  (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon()), { class: "lew-menu-tree-item-icon" })),
8503
- __props2.renderLabel() ? (openBlock(), createBlock(resolveDynamicComponent(__props2.renderLabel()), {
8384
+ _ctx.renderLabel() ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderLabel()), {
8504
8385
  key: 0,
8505
8386
  class: "lew-menu-tree-item-text"
8506
8387
  })) : (openBlock(), createBlock(_component_lew_text_trim, {
@@ -8508,27 +8389,13 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
8508
8389
  class: "lew-menu-tree-item-text",
8509
8390
  placement: "right",
8510
8391
  style: normalizeStyle({
8511
- maxWidth: `calc(100% - ${_ctx.renderIcon() || _ctx.tagText ? unref(tagWidth) + 30 - (_ctx.isLeaf ? 30 : 0) : 0}px)`
8392
+ maxWidth: `calc(100% - ${_ctx.renderIcon() ? 30 : 0}px)`
8512
8393
  }),
8513
8394
  text: _ctx.label,
8514
8395
  delay: [250, 250]
8515
8396
  }, null, 8, ["style", "text"])),
8516
- _ctx.tagText ? (openBlock(), createBlock(_component_lew_tag, {
8517
- key: 2,
8518
- ref_key: "tagRef",
8519
- ref: tagRef,
8520
- color: _ctx.tagColor,
8521
- type: _ctx.tagType,
8522
- round: "",
8523
- size: "small"
8524
- }, {
8525
- default: withCtx(() => [
8526
- createTextVNode(toDisplayString$1(_ctx.tagText), 1)
8527
- ]),
8528
- _: 1
8529
- }, 8, ["color", "type"])) : createCommentVNode("", true),
8530
8397
  !_ctx.isLeaf ? (openBlock(), createBlock(Icon, {
8531
- key: 3,
8398
+ key: 2,
8532
8399
  class: "lew-menu-tree-item-chevron-right",
8533
8400
  size: 14,
8534
8401
  style: normalizeStyle({
@@ -8559,8 +8426,8 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
8559
8426
  };
8560
8427
  }
8561
8428
  });
8562
- const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-9df21f62"]]);
8563
- const _sfc_main$P = /* @__PURE__ */ defineComponent({
8429
+ const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-fc6ce882"]]);
8430
+ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
8564
8431
  __name: "LewMenuTree",
8565
8432
  props: /* @__PURE__ */ mergeModels(menuTreeProps, {
8566
8433
  "modelValue": {},
@@ -8592,7 +8459,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
8592
8459
  };
8593
8460
  return findKeyPath(props2.options) || [];
8594
8461
  });
8595
- provide("menu-tree", {
8462
+ provide("lew-menu-tree", {
8596
8463
  modelValue: modelValue2,
8597
8464
  expandKeys,
8598
8465
  collapsed,
@@ -8602,13 +8469,13 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
8602
8469
  width: collapsed.value ? any2px(44) : any2px(props2.width)
8603
8470
  }));
8604
8471
  const hoverMenu = resolveDirective("hover-menu");
8605
- const transformTree = (tree) => {
8472
+ const transformTree2 = (tree) => {
8606
8473
  return tree.map((item) => {
8607
8474
  var _a;
8608
8475
  return {
8609
8476
  ...item,
8610
8477
  active: item.value === modelValue2.value || getModelValueKeyPath.value.includes(item.value),
8611
- children: ((_a = item.children) == null ? void 0 : _a.length) ? transformTree(item.children) : void 0
8478
+ children: ((_a = item.children) == null ? void 0 : _a.length) ? transformTree2(item.children) : void 0
8612
8479
  };
8613
8480
  });
8614
8481
  };
@@ -8618,7 +8485,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
8618
8485
  return [
8619
8486
  { label: item2.label, disabled: true },
8620
8487
  { isDividerLine: true },
8621
- ...transformTree(item2.children) || []
8488
+ ...transformTree2(item2.children) || []
8622
8489
  ];
8623
8490
  };
8624
8491
  const handleMenuSelect = (item2) => {
@@ -8647,16 +8514,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
8647
8514
  }
8648
8515
  ]
8649
8516
  ] : [];
8650
- const {
8651
- tagText,
8652
- tagType,
8653
- tagColor,
8654
- disabled,
8655
- renderIcon,
8656
- renderLabel,
8657
- label,
8658
- value
8659
- } = item;
8517
+ const { disabled, renderIcon, renderLabel, label, value } = item;
8660
8518
  return withDirectives(
8661
8519
  h(
8662
8520
  LewMenuTreeItem,
@@ -8666,9 +8524,6 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
8666
8524
  level,
8667
8525
  isLeaf: !((_a = item.children) == null ? void 0 : _a.length),
8668
8526
  disabled,
8669
- tagText,
8670
- tagType,
8671
- tagColor,
8672
8527
  renderIcon: () => renderIcon,
8673
8528
  renderLabel: () => renderLabel,
8674
8529
  onChange: () => emit2("change", item)
@@ -8682,6 +8537,10 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
8682
8537
  );
8683
8538
  };
8684
8539
  const emit2 = __emit2;
8540
+ onMounted(() => {
8541
+ expandKeys.value = cloneDeep(expandKeys.value);
8542
+ modelValue2.value = cloneDeep(modelValue2.value);
8543
+ });
8685
8544
  return (_ctx, _cache) => {
8686
8545
  return openBlock(), createElementBlock("div", {
8687
8546
  style: normalizeStyle(menuTreeStyle.value),
@@ -8696,7 +8555,14 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
8696
8555
  };
8697
8556
  }
8698
8557
  });
8699
- const LewMenuTree = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-83c85c7d"]]);
8558
+ const LewMenuTree = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-232bc2f6"]]);
8559
+ const dropdownModel = {
8560
+ selectedKeys: {
8561
+ type: Array,
8562
+ default: () => [],
8563
+ description: "选中项的key值"
8564
+ }
8565
+ };
8700
8566
  const dropdownProps = {
8701
8567
  trigger: {
8702
8568
  type: String,
@@ -8752,13 +8618,22 @@ const dropdownProps = {
8752
8618
  }
8753
8619
  return true;
8754
8620
  }
8621
+ },
8622
+ checkbox: {
8623
+ type: Boolean,
8624
+ default: false,
8625
+ description: "是否开启checkbox模式"
8755
8626
  }
8756
8627
  };
8757
- const _sfc_main$O = /* @__PURE__ */ defineComponent({
8628
+ const _sfc_main$P = /* @__PURE__ */ defineComponent({
8758
8629
  __name: "LewDropdown",
8759
- props: dropdownProps,
8760
- emits: ["change"],
8630
+ props: /* @__PURE__ */ mergeModels(dropdownProps, {
8631
+ "selectedKeys": {},
8632
+ "selectedKeysModifiers": {}
8633
+ }),
8634
+ emits: /* @__PURE__ */ mergeModels(["change"], ["update:selectedKeys"]),
8761
8635
  setup(__props2, { expose: __expose2, emit: __emit2 }) {
8636
+ const selectedKeys = useModel(__props2, "selectedKeys");
8762
8637
  const emit2 = __emit2;
8763
8638
  const lewPopoverRef = ref();
8764
8639
  const show = () => {
@@ -8768,6 +8643,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
8768
8643
  lewPopoverRef.value.hide();
8769
8644
  };
8770
8645
  const change2 = (item) => {
8646
+ console.log(item);
8771
8647
  emit2("change", item);
8772
8648
  hide2();
8773
8649
  };
@@ -8788,9 +8664,12 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
8788
8664
  ]),
8789
8665
  "popover-body": withCtx(() => [
8790
8666
  createVNode(unref(_LewContextMenu), {
8667
+ "selected-keys": selectedKeys.value,
8668
+ "onUpdate:selectedKeys": _cache[0] || (_cache[0] = ($event) => selectedKeys.value = $event),
8669
+ checkbox: _ctx.checkbox,
8791
8670
  options: _ctx.options,
8792
8671
  onSelect: change2
8793
- }, null, 8, ["options"])
8672
+ }, null, 8, ["selected-keys", "checkbox", "options"])
8794
8673
  ]),
8795
8674
  _: 3
8796
8675
  }, 8, ["trigger", "placement"]);
@@ -8847,9 +8726,9 @@ const breadcrumbProps = {
8847
8726
  }
8848
8727
  }
8849
8728
  };
8850
- const _hoisted_1$C = { class: "lew-breadcrumb" };
8851
- const _hoisted_2$n = ["onClick"];
8852
- const _hoisted_3$h = {
8729
+ const _hoisted_1$D = { class: "lew-breadcrumb" };
8730
+ const _hoisted_2$m = ["onClick"];
8731
+ const _hoisted_3$g = {
8853
8732
  key: 0,
8854
8733
  class: "lew-breadcrumb-parting"
8855
8734
  };
@@ -8873,14 +8752,14 @@ const _hoisted_5$7 = {
8873
8752
  "stroke-linecap": "butt",
8874
8753
  "stroke-linejoin": "miter"
8875
8754
  };
8876
- const _sfc_main$N = /* @__PURE__ */ defineComponent({
8755
+ const _sfc_main$O = /* @__PURE__ */ defineComponent({
8877
8756
  __name: "LewBreadcrumb",
8878
8757
  props: breadcrumbProps,
8879
8758
  emits: ["change"],
8880
8759
  setup(__props2, { emit: __emit2 }) {
8881
8760
  const emit2 = __emit2;
8882
8761
  return (_ctx, _cache) => {
8883
- return openBlock(), createElementBlock("div", _hoisted_1$C, [
8762
+ return openBlock(), createElementBlock("div", _hoisted_1$D, [
8884
8763
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index2) => {
8885
8764
  return openBlock(), createElementBlock("div", {
8886
8765
  key: index2,
@@ -8889,8 +8768,8 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
8889
8768
  createElementVNode("span", {
8890
8769
  class: normalizeClass({ "lew-breadcrumb-isPath": !!item.value }),
8891
8770
  onClick: ($event) => emit2("change", item)
8892
- }, toDisplayString$1(item.label), 11, _hoisted_2$n),
8893
- index2 != _ctx.options.length - 1 ? (openBlock(), createElementBlock("div", _hoisted_3$h, [
8771
+ }, toDisplayString$1(item.label), 11, _hoisted_2$m),
8772
+ index2 != _ctx.options.length - 1 ? (openBlock(), createElementBlock("div", _hoisted_3$g, [
8894
8773
  _ctx.separator === "sprit" ? (openBlock(), createElementBlock("svg", _hoisted_4$c, _cache[0] || (_cache[0] = [
8895
8774
  createElementVNode("path", { d: "M29.506 6.502 18.493 41.498" }, null, -1)
8896
8775
  ]))) : createCommentVNode("", true),
@@ -8904,9 +8783,9 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
8904
8783
  };
8905
8784
  }
8906
8785
  });
8907
- const LewBreadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-52d91f51"]]);
8908
- const _hoisted_1$B = ["width", "height"];
8909
- const _sfc_main$M = /* @__PURE__ */ defineComponent({
8786
+ const LewBreadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-52d91f51"]]);
8787
+ const _hoisted_1$C = ["width", "height"];
8788
+ const _sfc_main$N = /* @__PURE__ */ defineComponent({
8910
8789
  __name: "RequiredIcon",
8911
8790
  props: {
8912
8791
  size: {
@@ -8931,7 +8810,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
8931
8810
  fill: "#DF3F52",
8932
8811
  "p-id": "10883"
8933
8812
  }, null, -1)
8934
- ]), 8, _hoisted_1$B);
8813
+ ]), 8, _hoisted_1$C);
8935
8814
  };
8936
8815
  }
8937
8816
  });
@@ -9211,7 +9090,7 @@ const formTypeAsMap = {
9211
9090
  upload: "array",
9212
9091
  "input-number": "number"
9213
9092
  };
9214
- const _sfc_main$L = /* @__PURE__ */ defineComponent({
9093
+ const _sfc_main$M = /* @__PURE__ */ defineComponent({
9215
9094
  __name: "LewGetLabelWidth",
9216
9095
  props: {
9217
9096
  size: {
@@ -9251,7 +9130,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
9251
9130
  key: index2
9252
9131
  }, {
9253
9132
  default: withCtx(() => [
9254
- item.required && item.label ? (openBlock(), createBlock(_sfc_main$M, {
9133
+ item.required && item.label ? (openBlock(), createBlock(_sfc_main$N, {
9255
9134
  key: 0,
9256
9135
  size: unref(requiredIconSizeMap)[__props2.size]
9257
9136
  }, null, 8, ["size"])) : createCommentVNode("", true),
@@ -9270,7 +9149,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
9270
9149
  };
9271
9150
  }
9272
9151
  });
9273
- const LewGetLabelWidth = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-8bc09ff2"]]);
9152
+ const LewGetLabelWidth = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-8bc09ff2"]]);
9274
9153
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
9275
9154
  function getDefaultExportFromCjs(x2) {
9276
9155
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -11531,11 +11410,11 @@ class ArraySchema extends Schema {
11531
11410
  }
11532
11411
  }
11533
11412
  create$2.prototype = ArraySchema.prototype;
11534
- const _hoisted_1$A = {
11413
+ const _hoisted_1$B = {
11535
11414
  key: 0,
11536
11415
  class: "lew-label-box"
11537
11416
  };
11538
- const _sfc_main$K = /* @__PURE__ */ defineComponent({
11417
+ const _sfc_main$L = /* @__PURE__ */ defineComponent({
11539
11418
  __name: "LewFormItem",
11540
11419
  props: /* @__PURE__ */ mergeModels(formItemProps, {
11541
11420
  "modelValue": {
@@ -11682,8 +11561,8 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
11682
11561
  style: normalizeStyle(_ctx.direction === "x" ? `width:${unref(any2px)(_ctx.labelWidth)}` : ""),
11683
11562
  class: "lew-label-box-wrapper"
11684
11563
  }, [
11685
- _ctx.as ? (openBlock(), createElementBlock("div", _hoisted_1$A, [
11686
- unref(curRequired) && _ctx.label ? (openBlock(), createBlock(_sfc_main$M, {
11564
+ _ctx.as ? (openBlock(), createElementBlock("div", _hoisted_1$B, [
11565
+ unref(curRequired) && _ctx.label ? (openBlock(), createBlock(_sfc_main$N, {
11687
11566
  key: 0,
11688
11567
  size: unref(requiredIconSizeMap)[_ctx.size]
11689
11568
  }, null, 8, ["size"])) : createCommentVNode("", true),
@@ -11731,8 +11610,8 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
11731
11610
  };
11732
11611
  }
11733
11612
  });
11734
- const LewFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-5eb9eff7"]]);
11735
- const _sfc_main$J = /* @__PURE__ */ defineComponent({
11613
+ const LewFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-5eb9eff7"]]);
11614
+ const _sfc_main$K = /* @__PURE__ */ defineComponent({
11736
11615
  __name: "LewForm",
11737
11616
  props: formProps,
11738
11617
  emits: ["change", "mounted"],
@@ -11858,7 +11737,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
11858
11737
  };
11859
11738
  }
11860
11739
  });
11861
- const LewForm = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-20503251"]]);
11740
+ const LewForm = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-20503251"]]);
11862
11741
  const inputModel = {
11863
11742
  modelValue: {
11864
11743
  type: [String, Number],
@@ -12042,12 +11921,12 @@ const inputProps = {
12042
11921
  description: "是否允许通过回车键确认输入"
12043
11922
  }
12044
11923
  };
12045
- const _hoisted_1$z = {
11924
+ const _hoisted_1$A = {
12046
11925
  key: 0,
12047
11926
  class: "lew-input-prefixes"
12048
11927
  };
12049
- const _hoisted_2$m = { key: 0 };
12050
- const _hoisted_3$g = {
11928
+ const _hoisted_2$l = { key: 0 };
11929
+ const _hoisted_3$f = {
12051
11930
  key: 1,
12052
11931
  class: "lew-input-prefixes-icon"
12053
11932
  };
@@ -12081,7 +11960,7 @@ const _hoisted_12$2 = {
12081
11960
  key: 2,
12082
11961
  class: "lew-input-suffix-select"
12083
11962
  };
12084
- const _sfc_main$I = /* @__PURE__ */ defineComponent({
11963
+ const _sfc_main$J = /* @__PURE__ */ defineComponent({
12085
11964
  __name: "LewInput",
12086
11965
  props: /* @__PURE__ */ mergeModels(inputProps, {
12087
11966
  "modelValue": { required: true },
@@ -12223,16 +12102,16 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
12223
12102
  class: normalizeClass(["lew-input-view", unref(getInputClassNames)]),
12224
12103
  style: normalizeStyle({ width: _ctx.autoWidth ? "auto" : unref(any2px)(_ctx.width) })
12225
12104
  }, [
12226
- _ctx.prefixes ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$z, [
12227
- _ctx.prefixes === "text" ? (openBlock(), createElementBlock("div", _hoisted_2$m, toDisplayString$1(prefixesValue.value), 1)) : createCommentVNode("", true),
12228
- _ctx.prefixes === "icon" ? (openBlock(), createElementBlock("div", _hoisted_3$g, [
12105
+ _ctx.prefixes ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$A, [
12106
+ _ctx.prefixes === "text" ? (openBlock(), createElementBlock("div", _hoisted_2$l, toDisplayString$1(prefixesValue.value), 1)) : createCommentVNode("", true),
12107
+ _ctx.prefixes === "icon" ? (openBlock(), createElementBlock("div", _hoisted_3$f, [
12229
12108
  createVNode(Icon, {
12230
12109
  size: unref(getIconSize),
12231
12110
  type: prefixesValue.value
12232
12111
  }, null, 8, ["size", "type"])
12233
12112
  ])) : createCommentVNode("", true),
12234
12113
  _ctx.prefixes === "select" ? (openBlock(), createElementBlock("div", _hoisted_4$b, [
12235
- createVNode(unref(_sfc_main$O), {
12114
+ createVNode(unref(_sfc_main$P), {
12236
12115
  placement: "bottom",
12237
12116
  trigger: "click",
12238
12117
  options: _ctx.prefixesOptions,
@@ -12362,7 +12241,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
12362
12241
  }, null, 8, ["size", "type"])
12363
12242
  ])) : createCommentVNode("", true),
12364
12243
  _ctx.suffix === "select" ? (openBlock(), createElementBlock("div", _hoisted_12$2, [
12365
- createVNode(unref(_sfc_main$O), {
12244
+ createVNode(unref(_sfc_main$P), {
12366
12245
  placement: "bottom",
12367
12246
  trigger: "click",
12368
12247
  options: _ctx.suffixOptions,
@@ -12402,7 +12281,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
12402
12281
  };
12403
12282
  }
12404
12283
  });
12405
- const LewInput = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-349c1ed8"]]);
12284
+ const LewInput = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-349c1ed8"]]);
12406
12285
  const inputNumberModel = {
12407
12286
  modelValue: {
12408
12287
  type: Number,
@@ -12513,8 +12392,8 @@ const inputNumberProps = {
12513
12392
  description: "聚焦时是否选中内容"
12514
12393
  }
12515
12394
  };
12516
- const _hoisted_1$y = ["placeholder", "min", "max", "step"];
12517
- const _sfc_main$H = /* @__PURE__ */ defineComponent({
12395
+ const _hoisted_1$z = ["placeholder", "min", "max", "step"];
12396
+ const _sfc_main$I = /* @__PURE__ */ defineComponent({
12518
12397
  __name: "LewInputNumber",
12519
12398
  props: /* @__PURE__ */ mergeModels(inputNumberProps, {
12520
12399
  "modelValue": { required: true },
@@ -12660,7 +12539,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
12660
12539
  onChange: changeFn,
12661
12540
  onBlur: blur,
12662
12541
  onFocus: focus
12663
- }, null, 44, _hoisted_1$y), [
12542
+ }, null, 44, _hoisted_1$z), [
12664
12543
  [_directive_tooltip, {
12665
12544
  content: unref(validationMessage),
12666
12545
  triggerFrom: "input-number"
@@ -12700,7 +12579,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
12700
12579
  };
12701
12580
  }
12702
12581
  });
12703
- const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-0d81db44"]]);
12582
+ const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-0d81db44"]]);
12704
12583
  const textareaModel = {
12705
12584
  modelValue: {
12706
12585
  type: String,
@@ -12814,12 +12693,12 @@ const textareaProps = {
12814
12693
  description: "是否启用回车键确认(启用后,Shift+Enter可换行)"
12815
12694
  }
12816
12695
  };
12817
- const _hoisted_1$x = ["placeholder", "maxlength", "disabled", "readonly"];
12818
- const _hoisted_2$l = {
12696
+ const _hoisted_1$y = ["placeholder", "maxlength", "disabled", "readonly"];
12697
+ const _hoisted_2$k = {
12819
12698
  key: 0,
12820
12699
  class: "lew-textarea-count"
12821
12700
  };
12822
- const _sfc_main$G = /* @__PURE__ */ defineComponent({
12701
+ const _sfc_main$H = /* @__PURE__ */ defineComponent({
12823
12702
  __name: "LewTextarea",
12824
12703
  props: /* @__PURE__ */ mergeModels(textareaProps, {
12825
12704
  "modelValue": {},
@@ -12956,10 +12835,10 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
12956
12835
  onBlur: blur,
12957
12836
  onInput: _cache[1] || (_cache[1] = ($event) => emit2("input", modelValue2.value)),
12958
12837
  onChange: _cache[2] || (_cache[2] = ($event) => emit2("change", modelValue2.value))
12959
- }, null, 40, _hoisted_1$x), [
12838
+ }, null, 40, _hoisted_1$y), [
12960
12839
  [vModelText, modelValue2.value]
12961
12840
  ]),
12962
- modelValue2.value && _ctx.showCount ? (openBlock(), createElementBlock("div", _hoisted_2$l, toDisplayString$1(modelValue2.value.length) + toDisplayString$1(_ctx.maxLength ? " / " + _ctx.maxLength : ""), 1)) : createCommentVNode("", true),
12841
+ modelValue2.value && _ctx.showCount ? (openBlock(), createElementBlock("div", _hoisted_2$k, toDisplayString$1(modelValue2.value.length) + toDisplayString$1(_ctx.maxLength ? " / " + _ctx.maxLength : ""), 1)) : createCommentVNode("", true),
12963
12842
  createVNode(Transition, { name: "lew-form-icon-ani" }, {
12964
12843
  default: withCtx(() => [
12965
12844
  _ctx.clearable && modelValue2.value && !_ctx.readonly ? (openBlock(), createBlock(Icon, {
@@ -12981,7 +12860,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
12981
12860
  };
12982
12861
  }
12983
12862
  });
12984
- const LewTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-db6ed8ea"]]);
12863
+ const LewTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-c1810ae2"]]);
12985
12864
  const inputTagModel = {
12986
12865
  modelValue: {
12987
12866
  type: Array,
@@ -13031,7 +12910,7 @@ const inputTagProps = {
13031
12910
  description: "输入框宽度,支持数字(单位:像素)或带单位的字符串"
13032
12911
  }
13033
12912
  };
13034
- const _sfc_main$F = /* @__PURE__ */ defineComponent({
12913
+ const _sfc_main$G = /* @__PURE__ */ defineComponent({
13035
12914
  __name: "LewInputTag",
13036
12915
  props: /* @__PURE__ */ mergeModels(inputTagProps, {
13037
12916
  "modelValue": {},
@@ -13164,7 +13043,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
13164
13043
  createVNode(TransitionGroup, { name: "tag-list" }, {
13165
13044
  default: withCtx(() => [
13166
13045
  (openBlock(true), createElementBlock(Fragment, null, renderList(modelValue2.value, (item, index2) => {
13167
- return openBlock(), createBlock(unref(_sfc_main$_), {
13046
+ return openBlock(), createBlock(unref(_sfc_main$$), {
13168
13047
  key: index2,
13169
13048
  type: "light",
13170
13049
  style: normalizeStyle({
@@ -13221,7 +13100,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
13221
13100
  };
13222
13101
  }
13223
13102
  });
13224
- const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-835c2532"]]);
13103
+ const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-835c2532"]]);
13225
13104
  const checkboxModel = {
13226
13105
  modelValue: {
13227
13106
  type: Boolean,
@@ -13361,16 +13240,16 @@ const checkboxGroupProps = {
13361
13240
  description: "是否显示复选框的图标(仅在块状模式下生效)"
13362
13241
  }
13363
13242
  };
13364
- const _hoisted_1$w = {
13243
+ const _hoisted_1$x = {
13365
13244
  key: 0,
13366
13245
  class: "lew-checkbox-icon-box"
13367
13246
  };
13368
- const _hoisted_2$k = { class: "lew-checkbox-icon-certain" };
13369
- const _hoisted_3$f = {
13247
+ const _hoisted_2$j = { class: "lew-checkbox-icon-certain" };
13248
+ const _hoisted_3$e = {
13370
13249
  key: 1,
13371
13250
  class: "lew-checkbox-label"
13372
13251
  };
13373
- const _sfc_main$E = /* @__PURE__ */ defineComponent({
13252
+ const _sfc_main$F = /* @__PURE__ */ defineComponent({
13374
13253
  __name: "LewCheckbox",
13375
13254
  props: /* @__PURE__ */ mergeModels(checkboxProps, {
13376
13255
  "modelValue": {
@@ -13422,8 +13301,8 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
13422
13301
  class: normalizeClass(["lew-checkbox", unref(getCheckboxClassName)]),
13423
13302
  onClick: withModifiers(setChecked, ["stop"])
13424
13303
  }, [
13425
- _ctx.iconable || !_ctx.iconable && !_ctx.block ? (openBlock(), createElementBlock("div", _hoisted_1$w, [
13426
- withDirectives(createElementVNode("i", _hoisted_2$k, null, 512), [
13304
+ _ctx.iconable || !_ctx.iconable && !_ctx.block ? (openBlock(), createElementBlock("div", _hoisted_1$x, [
13305
+ withDirectives(createElementVNode("i", _hoisted_2$j, null, 512), [
13427
13306
  [vShow, _ctx.certain]
13428
13307
  ]),
13429
13308
  createVNode(Icon, {
@@ -13433,13 +13312,13 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
13433
13312
  size: unref(getIconSize)
13434
13313
  }, null, 8, ["size"])
13435
13314
  ])) : createCommentVNode("", true),
13436
- _ctx.label ? (openBlock(), createElementBlock("span", _hoisted_3$f, toDisplayString$1(_ctx.label), 1)) : createCommentVNode("", true)
13315
+ _ctx.label ? (openBlock(), createElementBlock("span", _hoisted_3$e, toDisplayString$1(_ctx.label), 1)) : createCommentVNode("", true)
13437
13316
  ], 2);
13438
13317
  };
13439
13318
  }
13440
13319
  });
13441
- const LewCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-82bf2f93"]]);
13442
- const _sfc_main$D = /* @__PURE__ */ defineComponent({
13320
+ const LewCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-3a44fadd"]]);
13321
+ const _sfc_main$E = /* @__PURE__ */ defineComponent({
13443
13322
  __name: "LewCheckboxGroup",
13444
13323
  props: /* @__PURE__ */ mergeModels(checkboxGroupProps, {
13445
13324
  "modelValue": {
@@ -13529,7 +13408,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
13529
13408
  };
13530
13409
  }
13531
13410
  });
13532
- const LewCheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-59d7549a"]]);
13411
+ const LewCheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-59d7549a"]]);
13533
13412
  const radioProps = {
13534
13413
  checked: {
13535
13414
  type: Boolean,
@@ -13646,15 +13525,15 @@ const radioGroupProps = {
13646
13525
  }
13647
13526
  }
13648
13527
  };
13649
- const _hoisted_1$v = {
13528
+ const _hoisted_1$w = {
13650
13529
  key: 0,
13651
13530
  class: "lew-icon-radio-box"
13652
13531
  };
13653
- const _hoisted_2$j = {
13532
+ const _hoisted_2$i = {
13654
13533
  key: 1,
13655
13534
  class: "lew-radio-label"
13656
13535
  };
13657
- const _sfc_main$C = /* @__PURE__ */ defineComponent({
13536
+ const _sfc_main$D = /* @__PURE__ */ defineComponent({
13658
13537
  __name: "LewRadio",
13659
13538
  props: radioProps,
13660
13539
  emits: ["change"],
@@ -13695,7 +13574,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
13695
13574
  class: normalizeClass(["lew-radio", unref(getRadioClassName)]),
13696
13575
  onClick: withModifiers(setChecked, ["stop"])
13697
13576
  }, [
13698
- _ctx.iconable || !_ctx.iconable && !_ctx.block ? (openBlock(), createElementBlock("div", _hoisted_1$v, [
13577
+ _ctx.iconable || !_ctx.iconable && !_ctx.block ? (openBlock(), createElementBlock("div", _hoisted_1$w, [
13699
13578
  createVNode(Icon, {
13700
13579
  "stroke-width": 4,
13701
13580
  class: "lew-icon-radio",
@@ -13703,13 +13582,13 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
13703
13582
  size: unref(getIconSize)
13704
13583
  }, null, 8, ["size"])
13705
13584
  ])) : createCommentVNode("", true),
13706
- _ctx.label ? (openBlock(), createElementBlock("span", _hoisted_2$j, toDisplayString$1(_ctx.label), 1)) : createCommentVNode("", true)
13585
+ _ctx.label ? (openBlock(), createElementBlock("span", _hoisted_2$i, toDisplayString$1(_ctx.label), 1)) : createCommentVNode("", true)
13707
13586
  ], 2);
13708
13587
  };
13709
13588
  }
13710
13589
  });
13711
- const LewRadio = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-215a5b67"]]);
13712
- const _sfc_main$B = /* @__PURE__ */ defineComponent({
13590
+ const LewRadio = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-215a5b67"]]);
13591
+ const _sfc_main$C = /* @__PURE__ */ defineComponent({
13713
13592
  __name: "LewRadioGroup",
13714
13593
  props: /* @__PURE__ */ mergeModels(radioGroupProps, {
13715
13594
  "modelValue": {},
@@ -13762,7 +13641,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
13762
13641
  };
13763
13642
  }
13764
13643
  });
13765
- const LewRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-502691be"]]);
13644
+ const LewRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-502691be"]]);
13766
13645
  const tabsModel = {
13767
13646
  modelValue: {
13768
13647
  type: [String, Number],
@@ -13864,8 +13743,8 @@ const tabsProps = {
13864
13743
  description: "是否将所有标签页设置为只读状态"
13865
13744
  }
13866
13745
  };
13867
- const _hoisted_1$u = ["onClick"];
13868
- const _sfc_main$A = /* @__PURE__ */ defineComponent({
13746
+ const _hoisted_1$v = ["onClick"];
13747
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
13869
13748
  __name: "LewTabs",
13870
13749
  props: /* @__PURE__ */ mergeModels(tabsProps, {
13871
13750
  "modelValue": {
@@ -14037,7 +13916,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
14037
13916
  class: normalizeClass(["lew-tabs-item", { "lew-tabs-item-active": tabsValue.value === item.value }]),
14038
13917
  style: normalizeStyle(unref(getItemStyle)),
14039
13918
  onClick: ($event) => selectItem(item.value)
14040
- }, toDisplayString$1(item.label), 15, _hoisted_1$u);
13919
+ }, toDisplayString$1(item.label), 15, _hoisted_1$v);
14041
13920
  }), 128))
14042
13921
  ], 544)
14043
13922
  ], 6)
@@ -14045,7 +13924,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
14045
13924
  };
14046
13925
  }
14047
13926
  });
14048
- const LewTabs = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-3311f66e"]]);
13927
+ const LewTabs = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-0d554416"]]);
14049
13928
  function vue3h(ele, props2, children) {
14050
13929
  const { attrs, on, ...rest } = props2;
14051
13930
  let event = {};
@@ -15104,14 +14983,14 @@ const defaultSearchMethod = (params) => {
15104
14983
  });
15105
14984
  return flattenOptions(group);
15106
14985
  };
15107
- const _hoisted_1$t = ["readonly", "placeholder"];
15108
- const _hoisted_2$i = { class: "lew-select-options-box" };
15109
- const _hoisted_3$e = {
14986
+ const _hoisted_1$u = ["readonly", "placeholder"];
14987
+ const _hoisted_2$h = { class: "lew-select-options-box" };
14988
+ const _hoisted_3$d = {
15110
14989
  key: 1,
15111
14990
  class: "lew-result-count"
15112
14991
  };
15113
14992
  const _hoisted_4$a = ["onClick"];
15114
- const _sfc_main$z = /* @__PURE__ */ defineComponent({
14993
+ const _sfc_main$A = /* @__PURE__ */ defineComponent({
15115
14994
  __name: "LewSelect",
15116
14995
  props: /* @__PURE__ */ mergeModels(selectProps, {
15117
14996
  "modelValue": {},
@@ -15304,6 +15183,9 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
15304
15183
  inputRef.value.blur();
15305
15184
  emit2("blur");
15306
15185
  };
15186
+ const isShowScrollBar = computed(() => {
15187
+ return getVirtualHeight.value >= 280;
15188
+ });
15307
15189
  watch(
15308
15190
  () => selectValue.value,
15309
15191
  () => {
@@ -15372,7 +15254,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
15372
15254
  placeholder: unref(state).keywordBackup || _ctx.placeholder ? _ctx.placeholder : unref(locale).t("select.placeholder"),
15373
15255
  onInput: _cache[1] || (_cache[1] = //@ts-ignore
15374
15256
  (...args) => unref(searchDebounce) && unref(searchDebounce)(...args))
15375
- }, null, 44, _hoisted_1$t), [
15257
+ }, null, 44, _hoisted_1$u), [
15376
15258
  [vModelText, unref(state).keyword]
15377
15259
  ])
15378
15260
  ], 2)
@@ -15383,11 +15265,12 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
15383
15265
  style: normalizeStyle(`width:${unref(state).selectWidth}px`)
15384
15266
  }, [
15385
15267
  renderSlot(_ctx.$slots, "header", {}, void 0, true),
15386
- createElementVNode("div", _hoisted_2$i, [
15268
+ createElementVNode("div", _hoisted_2$h, [
15387
15269
  unref(state).options && unref(state).options.length === 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
15388
15270
  _ctx.$slots.empty ? renderSlot(_ctx.$slots, "empty", { key: 0 }, void 0, true) : (openBlock(), createBlock(unref(LewFlex), {
15389
15271
  key: 1,
15390
15272
  direction: "y",
15273
+ x: "center",
15391
15274
  class: "lew-not-found"
15392
15275
  }, {
15393
15276
  default: withCtx(() => [
@@ -15396,76 +15279,73 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
15396
15279
  _: 1
15397
15280
  }))
15398
15281
  ], 64)) : createCommentVNode("", true),
15399
- _ctx.searchable && unref(state).options && unref(state).options.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$e, " 共 " + toDisplayString$1(unref(getResultNum)) + " 条结果 ", 1)) : createCommentVNode("", true),
15400
- createElementVNode("div", {
15401
- class: "lew-select-options-list",
15402
- style: normalizeStyle({
15403
- height: `${unref(getVirtualHeight)}px`
15404
- })
15405
- }, [
15406
- createVNode(Transition, { name: "fade" }, {
15407
- default: withCtx(() => [
15408
- unref(state).options.length > 0 && unref(state).visible ? (openBlock(), createBlock(unref(VirtList), {
15409
- key: 0,
15410
- ref_key: "virtListRef",
15411
- ref: virtListRef,
15412
- list: unref(state).options,
15413
- minSize: _ctx.itemHeight,
15414
- buffer: 5,
15415
- "item-key": "value",
15416
- class: "lew-scrollbar"
15417
- }, {
15418
- default: withCtx(({ itemData: templateProps }) => [
15419
- createElementVNode("div", {
15420
- style: normalizeStyle({ height: _ctx.itemHeight + "px" }),
15421
- onClick: ($event) => selectHandle(templateProps)
15422
- }, [
15423
- _ctx.$slots.item ? renderSlot(_ctx.$slots, "item", {
15424
- key: 0,
15425
- props: {
15426
- ...templateProps,
15427
- checked: unref(getChecked)(templateProps.value)
15428
- }
15429
- }, void 0, true) : (openBlock(), createElementBlock("div", {
15430
- key: 1,
15431
- class: normalizeClass(["lew-select-item", getSelectItemClassName(templateProps)])
15432
- }, [
15433
- createVNode(unref(LewTextTrim), {
15434
- text: templateProps.isGroup ? `${templateProps.label} (${templateProps.total})` : templateProps.label,
15435
- delay: [500, 0],
15436
- class: "lew-select-label"
15437
- }, null, 8, ["text"]),
15438
- unref(getChecked)(templateProps.value) && _ctx.showCheckIcon ? (openBlock(), createBlock(Icon, {
15439
- key: 0,
15440
- class: "lew-icon-check",
15441
- size: 16,
15442
- strokeWidth: 3,
15443
- type: "check"
15444
- })) : createCommentVNode("", true)
15445
- ], 2))
15446
- ], 12, _hoisted_4$a)
15447
- ]),
15448
- _: 3
15449
- }, 8, ["list", "minSize"])) : createCommentVNode("", true)
15450
- ]),
15451
- _: 3
15452
- })
15453
- ], 4)
15454
- ]),
15455
- renderSlot(_ctx.$slots, "footer", {}, void 0, true)
15456
- ], 6)
15457
- ]),
15458
- _: 3
15459
- }, 8, ["trigger", "disabled", "style", "loading"]);
15460
- };
15461
- }
15462
- });
15463
- const LewSelect = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-d4c03889"]]);
15464
- const selectMultipleModel = {
15465
- modelValue: {
15466
- type: Array,
15467
- default: () => [],
15468
- description: "多选框的选中值数组"
15282
+ _ctx.searchable && unref(state).options && unref(state).options.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$d, " 共 " + toDisplayString$1(unref(getResultNum)) + " 条结果 ", 1)) : createCommentVNode("", true),
15283
+ createVNode(Transition, { name: "fade" }, {
15284
+ default: withCtx(() => [
15285
+ unref(state).options.length > 0 && unref(state).visible ? (openBlock(), createBlock(unref(VirtList), {
15286
+ key: 0,
15287
+ ref_key: "virtListRef",
15288
+ ref: virtListRef,
15289
+ list: unref(state).options,
15290
+ minSize: _ctx.itemHeight,
15291
+ buffer: 5,
15292
+ "item-key": "value",
15293
+ class: "lew-select-options-list lew-scrollbar",
15294
+ style: normalizeStyle({
15295
+ height: `${unref(getVirtualHeight)}px`,
15296
+ paddingRight: unref(isShowScrollBar) ? "5px" : "0px"
15297
+ })
15298
+ }, {
15299
+ default: withCtx(({ itemData: templateProps }) => [
15300
+ createElementVNode("div", {
15301
+ style: normalizeStyle({ height: _ctx.itemHeight + "px" }),
15302
+ onClick: ($event) => selectHandle(templateProps)
15303
+ }, [
15304
+ _ctx.$slots.item ? renderSlot(_ctx.$slots, "item", {
15305
+ key: 0,
15306
+ props: {
15307
+ ...templateProps,
15308
+ checked: unref(getChecked)(templateProps.value)
15309
+ }
15310
+ }, void 0, true) : (openBlock(), createElementBlock("div", {
15311
+ key: 1,
15312
+ class: normalizeClass(["lew-select-item", getSelectItemClassName(templateProps)])
15313
+ }, [
15314
+ createVNode(unref(LewTextTrim), {
15315
+ text: templateProps.isGroup ? `${templateProps.label} (${templateProps.total})` : templateProps.label,
15316
+ delay: [500, 0],
15317
+ class: "lew-select-label"
15318
+ }, null, 8, ["text"]),
15319
+ unref(getChecked)(templateProps.value) && _ctx.showCheckIcon ? (openBlock(), createBlock(Icon, {
15320
+ key: 0,
15321
+ class: "lew-icon-check",
15322
+ size: 16,
15323
+ strokeWidth: 3,
15324
+ type: "check"
15325
+ })) : createCommentVNode("", true)
15326
+ ], 2))
15327
+ ], 12, _hoisted_4$a)
15328
+ ]),
15329
+ _: 3
15330
+ }, 8, ["list", "minSize", "style"])) : createCommentVNode("", true)
15331
+ ]),
15332
+ _: 3
15333
+ })
15334
+ ]),
15335
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
15336
+ ], 6)
15337
+ ]),
15338
+ _: 3
15339
+ }, 8, ["trigger", "disabled", "style", "loading"]);
15340
+ };
15341
+ }
15342
+ });
15343
+ const LewSelect = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-499efdf9"]]);
15344
+ const selectMultipleModel = {
15345
+ modelValue: {
15346
+ type: Array,
15347
+ default: () => [],
15348
+ description: "多选框的选中值数组"
15469
15349
  }
15470
15350
  };
15471
15351
  const selectMultipleProps = {
@@ -15570,17 +15450,17 @@ const selectMultipleProps = {
15570
15450
  description: "选择框默认值"
15571
15451
  }
15572
15452
  };
15573
- const _hoisted_1$s = {
15453
+ const _hoisted_1$t = {
15574
15454
  key: 0,
15575
15455
  class: "lew-search-input"
15576
15456
  };
15577
- const _hoisted_2$h = { class: "lew-select-options-box" };
15578
- const _hoisted_3$d = {
15457
+ const _hoisted_2$g = { class: "lew-select-options-box" };
15458
+ const _hoisted_3$c = {
15579
15459
  key: 1,
15580
15460
  class: "lew-result-count"
15581
15461
  };
15582
15462
  const _hoisted_4$9 = ["onClick"];
15583
- const _sfc_main$y = /* @__PURE__ */ defineComponent({
15463
+ const _sfc_main$z = /* @__PURE__ */ defineComponent({
15584
15464
  __name: "LewSelectMultiple",
15585
15465
  props: /* @__PURE__ */ mergeModels(selectMultipleProps, {
15586
15466
  "modelValue": {},
@@ -15777,6 +15657,9 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
15777
15657
  height = height >= 280 ? 280 : height;
15778
15658
  return height;
15779
15659
  });
15660
+ const isShowScrollBar = computed(() => {
15661
+ return getVirtualHeight.value >= 280;
15662
+ });
15780
15663
  const hideHandle = () => {
15781
15664
  state.visible = false;
15782
15665
  emit2("blur");
@@ -15852,7 +15735,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
15852
15735
  createVNode(TransitionGroup, { name: "list" }, {
15853
15736
  default: withCtx(() => [
15854
15737
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSelectedRows), (item) => {
15855
- return openBlock(), createBlock(unref(_sfc_main$_), {
15738
+ return openBlock(), createBlock(unref(_sfc_main$$), {
15856
15739
  key: item.value,
15857
15740
  type: "light",
15858
15741
  size: _ctx.size,
@@ -15900,7 +15783,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
15900
15783
  }, {
15901
15784
  default: withCtx(() => [
15902
15785
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSelectedRows), (item) => {
15903
- return openBlock(), createBlock(unref(_sfc_main$_), {
15786
+ return openBlock(), createBlock(unref(_sfc_main$$), {
15904
15787
  key: item.value,
15905
15788
  type: "light",
15906
15789
  size: _ctx.size,
@@ -15936,7 +15819,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
15936
15819
  style: normalizeStyle(`width:${unref(state).selectWidth}px`)
15937
15820
  }, [
15938
15821
  renderSlot(_ctx.$slots, "header", {}, void 0, true),
15939
- _ctx.searchable ? (openBlock(), createElementBlock("div", _hoisted_1$s, [
15822
+ _ctx.searchable ? (openBlock(), createElementBlock("div", _hoisted_1$t, [
15940
15823
  withDirectives(createElementVNode("input", {
15941
15824
  ref_key: "searchInputRef",
15942
15825
  ref: searchInputRef,
@@ -15948,11 +15831,12 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
15948
15831
  [vModelText, unref(state).keyword]
15949
15832
  ])
15950
15833
  ])) : createCommentVNode("", true),
15951
- createElementVNode("div", _hoisted_2$h, [
15834
+ createElementVNode("div", _hoisted_2$g, [
15952
15835
  unref(state).options && unref(state).options.length === 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
15953
15836
  _ctx.$slots.empty ? renderSlot(_ctx.$slots, "empty", { key: 0 }, void 0, true) : (openBlock(), createBlock(unref(LewFlex), {
15954
15837
  key: 1,
15955
15838
  direction: "y",
15839
+ x: "center",
15956
15840
  class: "lew-not-found"
15957
15841
  }, {
15958
15842
  default: withCtx(() => [
@@ -15961,7 +15845,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
15961
15845
  _: 1
15962
15846
  }))
15963
15847
  ], 64)) : createCommentVNode("", true),
15964
- _ctx.searchable && unref(state).options && unref(state).options.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$d, " 共 " + toDisplayString$1(unref(getResultNum)) + " 条结果 ", 1)) : createCommentVNode("", true),
15848
+ _ctx.searchable && unref(state).options && unref(state).options.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$c, " 共 " + toDisplayString$1(unref(getResultNum)) + " 条结果 ", 1)) : createCommentVNode("", true),
15965
15849
  createVNode(Transition, { name: "fade" }, {
15966
15850
  default: withCtx(() => [
15967
15851
  unref(state).options.length > 0 && unref(state).visible ? (openBlock(), createBlock(unref(VirtList), {
@@ -15973,7 +15857,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
15973
15857
  buffer: 5,
15974
15858
  itemKey: "value",
15975
15859
  style: normalizeStyle({
15976
- height: `${unref(getVirtualHeight)}px`
15860
+ height: `${unref(getVirtualHeight)}px`,
15861
+ paddingRight: unref(isShowScrollBar) ? "5px" : "0px"
15977
15862
  }),
15978
15863
  class: "lew-select-options-list lew-scrollbar"
15979
15864
  }, {
@@ -16019,7 +15904,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
16019
15904
  };
16020
15905
  }
16021
15906
  });
16022
- const LewSelectMultiple = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-67da2ebd"]]);
15907
+ const LewSelectMultiple = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-184bf6d0"]]);
16023
15908
  const getMonthDate = (year, month) => {
16024
15909
  const ret = [];
16025
15910
  if (!year || !month) {
@@ -16411,9 +16296,9 @@ var dayjs_min = { exports: {} };
16411
16296
  })(dayjs_min);
16412
16297
  var dayjs_minExports = dayjs_min.exports;
16413
16298
  const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
16414
- const _hoisted_1$r = { class: "lew-date" };
16415
- const _hoisted_2$g = { class: "lew-date-control-left" };
16416
- const _hoisted_3$c = { class: "cur-date" };
16299
+ const _hoisted_1$s = { class: "lew-date" };
16300
+ const _hoisted_2$f = { class: "lew-date-control-left" };
16301
+ const _hoisted_3$b = { class: "cur-date" };
16417
16302
  const _hoisted_4$8 = { class: "lew-date-control-right" };
16418
16303
  const _hoisted_5$5 = { class: "lew-date-box" };
16419
16304
  const _hoisted_6$4 = { class: "lew-date-num" };
@@ -16424,7 +16309,7 @@ const _hoisted_9$2 = {
16424
16309
  class: "lew-date-item-today"
16425
16310
  };
16426
16311
  const _hoisted_10$2 = { class: "lew-date-value" };
16427
- const _sfc_main$x = /* @__PURE__ */ defineComponent({
16312
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
16428
16313
  __name: "LewDate",
16429
16314
  props: /* @__PURE__ */ mergeModels(dateProps, {
16430
16315
  "modelValue": {},
@@ -16509,14 +16394,14 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
16509
16394
  ];
16510
16395
  });
16511
16396
  return (_ctx, _cache) => {
16512
- return openBlock(), createElementBlock("div", _hoisted_1$r, [
16397
+ return openBlock(), createElementBlock("div", _hoisted_1$s, [
16513
16398
  createVNode(unref(LewFlex), {
16514
16399
  x: "start",
16515
16400
  mode: "between",
16516
16401
  class: "lew-date-control"
16517
16402
  }, {
16518
16403
  default: withCtx(() => [
16519
- createElementVNode("div", _hoisted_2$g, [
16404
+ createElementVNode("div", _hoisted_2$f, [
16520
16405
  createVNode(unref(LewButton), {
16521
16406
  type: "light",
16522
16407
  color: "gray",
@@ -16542,7 +16427,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
16542
16427
  _: 1
16543
16428
  })
16544
16429
  ]),
16545
- createElementVNode("div", _hoisted_3$c, toDisplayString$1(unref(dayjs)(`${unref(dateState).year}-${unref(dateState).month}`).format("YYYY-MM")), 1),
16430
+ createElementVNode("div", _hoisted_3$b, toDisplayString$1(unref(dayjs)(`${unref(dateState).year}-${unref(dateState).month}`).format("YYYY-MM")), 1),
16546
16431
  createElementVNode("div", _hoisted_4$8, [
16547
16432
  createVNode(unref(LewButton), {
16548
16433
  type: "light",
@@ -16598,10 +16483,10 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
16598
16483
  };
16599
16484
  }
16600
16485
  });
16601
- const LewDate = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-76ca625a"]]);
16602
- const _hoisted_1$q = { class: "lew-date-picker-view" };
16603
- const _hoisted_2$f = ["onClick"];
16604
- const _sfc_main$w = /* @__PURE__ */ defineComponent({
16486
+ const LewDate = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-76ca625a"]]);
16487
+ const _hoisted_1$r = { class: "lew-date-picker-view" };
16488
+ const _hoisted_2$e = ["onClick"];
16489
+ const _sfc_main$x = /* @__PURE__ */ defineComponent({
16605
16490
  __name: "LewDatePicker",
16606
16491
  props: /* @__PURE__ */ mergeModels(datePickerProps, {
16607
16492
  "modelValue": {},
@@ -16692,7 +16577,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
16692
16577
  onHide: hideHandle
16693
16578
  }, {
16694
16579
  trigger: withCtx(() => [
16695
- createElementVNode("div", _hoisted_1$q, [
16580
+ createElementVNode("div", _hoisted_1$r, [
16696
16581
  createElementVNode("div", {
16697
16582
  class: normalizeClass(["lew-date-picker", unref(lewDatePickerClassNames)]),
16698
16583
  style: normalizeStyle(unref(getDatePickerInputStyle))
@@ -16758,7 +16643,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
16758
16643
  ]])
16759
16644
  }, [
16760
16645
  createTextVNode(toDisplayString$1(item.label), 1)
16761
- ], 10, _hoisted_2$f)), [
16646
+ ], 10, _hoisted_2$e)), [
16762
16647
  [_directive_tooltip, {
16763
16648
  content: unref(dayjs)(item.value).format(_ctx.valueFormat),
16764
16649
  placement: "right",
@@ -16789,7 +16674,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
16789
16674
  };
16790
16675
  }
16791
16676
  });
16792
- const LewDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-76499cb8"]]);
16677
+ const LewDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-76499cb8"]]);
16793
16678
  const dateRangePickerModel = {
16794
16679
  modelValue: {
16795
16680
  type: Object,
@@ -16903,9 +16788,9 @@ const dateRangeProps = {
16903
16788
  description: "日期格式化字符串"
16904
16789
  }
16905
16790
  };
16906
- const _hoisted_1$p = { class: "lew-date-range" };
16907
- const _hoisted_2$e = { class: "lew-date" };
16908
- const _hoisted_3$b = { class: "lew-date-control-left" };
16791
+ const _hoisted_1$q = { class: "lew-date-range" };
16792
+ const _hoisted_2$d = { class: "lew-date" };
16793
+ const _hoisted_3$a = { class: "lew-date-control-left" };
16909
16794
  const _hoisted_4$7 = { class: "cur-date" };
16910
16795
  const _hoisted_5$4 = { class: "lew-date-control-right" };
16911
16796
  const _hoisted_6$3 = { class: "lew-date-box" };
@@ -16926,7 +16811,7 @@ const _hoisted_17 = {
16926
16811
  key: 0,
16927
16812
  class: "lew-date-item-today"
16928
16813
  };
16929
- const _sfc_main$v = /* @__PURE__ */ defineComponent({
16814
+ const _sfc_main$w = /* @__PURE__ */ defineComponent({
16930
16815
  __name: "LewDateRange",
16931
16816
  props: /* @__PURE__ */ mergeModels(dateRangeProps, {
16932
16817
  "modelValue": {},
@@ -17189,15 +17074,15 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
17189
17074
  ];
17190
17075
  });
17191
17076
  return (_ctx, _cache) => {
17192
- return openBlock(), createElementBlock("div", _hoisted_1$p, [
17193
- createElementVNode("div", _hoisted_2$e, [
17077
+ return openBlock(), createElementBlock("div", _hoisted_1$q, [
17078
+ createElementVNode("div", _hoisted_2$d, [
17194
17079
  createVNode(unref(LewFlex), {
17195
17080
  x: "start",
17196
17081
  mode: "between",
17197
17082
  class: "lew-date-control"
17198
17083
  }, {
17199
17084
  default: withCtx(() => [
17200
- createElementVNode("div", _hoisted_3$b, [
17085
+ createElementVNode("div", _hoisted_3$a, [
17201
17086
  createVNode(unref(LewButton), {
17202
17087
  type: "light",
17203
17088
  color: "gray",
@@ -17376,13 +17261,13 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
17376
17261
  };
17377
17262
  }
17378
17263
  });
17379
- const LewDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-ae73681c"]]);
17380
- const _hoisted_1$o = { class: "lew-date-range-picker-view" };
17381
- const _hoisted_2$d = {
17264
+ const LewDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-ae73681c"]]);
17265
+ const _hoisted_1$p = { class: "lew-date-range-picker-view" };
17266
+ const _hoisted_2$c = {
17382
17267
  key: 0,
17383
17268
  class: "lew-date-range-picker-placeholder"
17384
17269
  };
17385
- const _hoisted_3$a = {
17270
+ const _hoisted_3$9 = {
17386
17271
  key: 1,
17387
17272
  class: "lew-date-range-picker-dateValue lew-date-range-picker-start"
17388
17273
  };
@@ -17395,7 +17280,7 @@ const _hoisted_6$2 = {
17395
17280
  key: 3,
17396
17281
  class: "lew-date-range-picker-dateValue lew-date-range-picker-end"
17397
17282
  };
17398
- const _sfc_main$u = /* @__PURE__ */ defineComponent({
17283
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
17399
17284
  __name: "LewDateRangePicker",
17400
17285
  props: /* @__PURE__ */ mergeModels(dateRangePickerProps, {
17401
17286
  "modelValue": {},
@@ -17483,7 +17368,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
17483
17368
  onHide: hideHandle
17484
17369
  }, {
17485
17370
  trigger: withCtx(() => [
17486
- createElementVNode("div", _hoisted_1$o, [
17371
+ createElementVNode("div", _hoisted_1$p, [
17487
17372
  createElementVNode("div", {
17488
17373
  class: normalizeClass(["lew-date-range-picker", unref(lewDateRangeClassNames)]),
17489
17374
  style: normalizeStyle(unref(getDateRangePickerInputStyle))
@@ -17496,7 +17381,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
17496
17381
  })
17497
17382
  }, {
17498
17383
  default: withCtx(() => [
17499
- !modelValue2.value || !modelValue2.value[unref(startKey)] ? (openBlock(), createElementBlock("div", _hoisted_2$d, toDisplayString$1(_ctx.placeholderStart ? _ctx.placeholderStart : unref(locale).t("dateRangePicker.placeholderStart")), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$a, toDisplayString$1(modelValue2.value[unref(startKey)]), 1)),
17384
+ !modelValue2.value || !modelValue2.value[unref(startKey)] ? (openBlock(), createElementBlock("div", _hoisted_2$c, toDisplayString$1(_ctx.placeholderStart ? _ctx.placeholderStart : unref(locale).t("dateRangePicker.placeholderStart")), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$9, toDisplayString$1(modelValue2.value[unref(startKey)]), 1)),
17500
17385
  createElementVNode("div", _hoisted_4$6, [
17501
17386
  createVNode(Icon, {
17502
17387
  size: 14,
@@ -17546,7 +17431,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
17546
17431
  };
17547
17432
  }
17548
17433
  });
17549
- const LewDateRangePicker = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-79279649"]]);
17434
+ const LewDateRangePicker = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-79279649"]]);
17550
17435
  const cascaderModel = {
17551
17436
  modelValue: {
17552
17437
  type: [String, Number],
@@ -17634,13 +17519,13 @@ const cascaderProps = {
17634
17519
  description: "是否只读"
17635
17520
  }
17636
17521
  };
17637
- const _hoisted_1$n = { key: 1 };
17638
- const _hoisted_2$c = {
17522
+ const _hoisted_1$o = { key: 1 };
17523
+ const _hoisted_2$b = {
17639
17524
  class: "lew-cascader-item-padding",
17640
17525
  style: { height: "38px" }
17641
17526
  };
17642
- const _hoisted_3$9 = ["onClick"];
17643
- const _sfc_main$t = /* @__PURE__ */ defineComponent({
17527
+ const _hoisted_3$8 = ["onClick"];
17528
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
17644
17529
  __name: "LewCascader",
17645
17530
  props: /* @__PURE__ */ mergeModels(cascaderProps, {
17646
17531
  "modelValue": {
@@ -17986,7 +17871,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
17986
17871
  _ctx.showAllLevels ? (openBlock(), createBlock(unref(LewTextTrim), {
17987
17872
  key: 0,
17988
17873
  text: unref(getLabel).join(" / ")
17989
- }, null, 8, ["text"])) : unref(getLabel) ? (openBlock(), createElementBlock("span", _hoisted_1$n, toDisplayString$1(unref(getLabel)[unref(getLabel).length - 1]), 1)) : createCommentVNode("", true)
17874
+ }, null, 8, ["text"])) : unref(getLabel) ? (openBlock(), createElementBlock("span", _hoisted_1$o, toDisplayString$1(unref(getLabel)[unref(getLabel).length - 1]), 1)) : createCommentVNode("", true)
17990
17875
  ], 4), [
17991
17876
  [vShow, unref(getLabel) && unref(getLabel).length > 0]
17992
17877
  ]),
@@ -18039,7 +17924,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
18039
17924
  }
18040
17925
  }, {
18041
17926
  default: withCtx(({ itemData: templateProps }) => [
18042
- createElementVNode("div", _hoisted_2$c, [
17927
+ createElementVNode("div", _hoisted_2$b, [
18043
17928
  createElementVNode("div", {
18044
17929
  class: normalizeClass(["lew-cascader-item", {
18045
17930
  "lew-cascader-item-disabled": templateProps.disabled,
@@ -18078,7 +17963,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
18078
17963
  class: "lew-cascader-icon",
18079
17964
  type: "chevron-right"
18080
17965
  })) : createCommentVNode("", true)
18081
- ], 10, _hoisted_3$9)
17966
+ ], 10, _hoisted_3$8)
18082
17967
  ])
18083
17968
  ]),
18084
17969
  _: 2
@@ -18129,7 +18014,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
18129
18014
  };
18130
18015
  }
18131
18016
  });
18132
- const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-45aeb534"]]);
18017
+ const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-45aeb534"]]);
18133
18018
  const treeSelectModel = {
18134
18019
  modelValue: {
18135
18020
  type: [String, Number],
@@ -18182,7 +18067,7 @@ const treeSelectProps = {
18182
18067
  default: false,
18183
18068
  description: "是否可清空"
18184
18069
  },
18185
- showCheckbox: {
18070
+ checkable: {
18186
18071
  type: Boolean,
18187
18072
  default: false,
18188
18073
  description: "是否显示复选框"
@@ -18284,14 +18169,14 @@ const treeSelectProps = {
18284
18169
  description: "异步加载子节点数据的方法"
18285
18170
  }
18286
18171
  };
18287
- const _hoisted_1$m = ["readonly", "placeholder"];
18288
- const _hoisted_2$b = { class: "lew-select-options-box" };
18289
- const _hoisted_3$8 = {
18172
+ const _hoisted_1$n = ["readonly", "placeholder"];
18173
+ const _hoisted_2$a = { class: "lew-select-options-box" };
18174
+ const _hoisted_3$7 = {
18290
18175
  key: 0,
18291
18176
  class: "result-count"
18292
18177
  };
18293
18178
  const _hoisted_4$5 = { class: "tree-select-wrapper lew-scrollbar" };
18294
- const _sfc_main$s = /* @__PURE__ */ defineComponent({
18179
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
18295
18180
  __name: "LewTreeSelect",
18296
18181
  props: /* @__PURE__ */ mergeModels(treeSelectProps, {
18297
18182
  "modelValue": {},
@@ -18323,14 +18208,13 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
18323
18208
  // 树加载
18324
18209
  initLoading: true,
18325
18210
  // 初始化 loading
18326
- treeList: [],
18327
- // 树列表
18328
- hideBySelect: false,
18329
- // 记录是否通过选择隐藏
18211
+ valueIsChange: false,
18212
+ // 记录
18330
18213
  keyword: props2.defaultValue || treeSelectValue.value,
18331
18214
  // 搜索关键字
18332
- keywordBackup: props2.defaultValue
18215
+ keywordBackup: props2.defaultValue,
18333
18216
  // 搜索关键字备份
18217
+ resultText: ""
18334
18218
  });
18335
18219
  const getSelectWidth = () => {
18336
18220
  var _a2;
@@ -18348,18 +18232,15 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
18348
18232
  const search = async (e) => {
18349
18233
  const keyword = e.target.value;
18350
18234
  if (props2.searchable) {
18351
- state.searchLoading = true;
18352
- await lewTreeRef.value.init(keyword);
18353
- state.treeList = lewTreeRef.value.getTreeList();
18354
- state.searchLoading = false;
18235
+ await lewTreeRef.value.search(keyword);
18355
18236
  }
18356
18237
  };
18357
- const change2 = ({ item }) => {
18358
- if (item.disabled) {
18359
- return;
18360
- }
18361
- state.hideBySelect = true;
18362
- emit2("change", item[props2.keyField]);
18238
+ const change2 = (e) => {
18239
+ const { value } = e;
18240
+ treeSelectValue.value = value;
18241
+ state.valueIsChange = true;
18242
+ getKeywordLabel(value);
18243
+ emit2("change", e);
18363
18244
  setTimeout(() => {
18364
18245
  hide2();
18365
18246
  }, 100);
@@ -18374,22 +18255,6 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
18374
18255
  const getValueStyle = computed(() => {
18375
18256
  return state.visible ? "opacity:0.6" : "";
18376
18257
  });
18377
- const findKeyword = () => {
18378
- if (lewTreeRef.value && treeSelectValue.value) {
18379
- state.treeList = lewTreeRef.value.getTreeList();
18380
- const treeItem = state.treeList.find((e) => {
18381
- return e[props2.keyField] === treeSelectValue.value;
18382
- });
18383
- if (treeItem !== void 0) {
18384
- if (props2.showAllLevels && treeItem.labelPaths && treeItem.labelPaths.length > 0) {
18385
- state.keyword = treeItem.labelPaths.join(" / ");
18386
- } else {
18387
- state.keyword = treeItem.label[0];
18388
- }
18389
- }
18390
- }
18391
- };
18392
- findKeyword();
18393
18258
  const getSelectClassName = computed(() => {
18394
18259
  let { clearable, size, align, disabled, readonly: readonly2, searchable } = props2;
18395
18260
  clearable = clearable ? !!treeSelectValue.value : false;
@@ -18416,40 +18281,48 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
18416
18281
  };
18417
18282
  return size[props2.size];
18418
18283
  });
18284
+ const getKeywordLabel = (value) => {
18285
+ if (lewTreeRef.value && value) {
18286
+ let tree = lewTreeRef.value.getTree();
18287
+ const treeItem = findNodeByKey(value, tree);
18288
+ if (treeItem !== void 0) {
18289
+ const { labelPaths, label } = treeItem;
18290
+ if (props2.showAllLevels && labelPaths && labelPaths.length > 0) {
18291
+ state.keyword = labelPaths.join(" / ");
18292
+ } else {
18293
+ state.keyword = label[0];
18294
+ }
18295
+ }
18296
+ }
18297
+ };
18298
+ getKeywordLabel(treeSelectValue.value);
18419
18299
  const showHandle = () => {
18420
18300
  state.visible = true;
18421
18301
  state.keywordBackup = cloneDeep(state.keyword);
18302
+ state.valueIsChange = false;
18422
18303
  if (props2.searchable) {
18423
18304
  state.keyword = "";
18424
18305
  }
18425
- state.hideBySelect = false;
18426
18306
  getSelectWidth();
18427
- if (props2.searchable && state.treeList.length === 0) {
18307
+ if (props2.searchable) {
18428
18308
  search({ target: { value: "" } });
18429
18309
  }
18430
18310
  };
18431
18311
  const hideHandle = () => {
18432
18312
  state.visible = false;
18433
- if (!state.hideBySelect && treeSelectValue.value) {
18434
- findKeyword();
18313
+ if (!state.valueIsChange && treeSelectValue.value) {
18314
+ state.keywordBackup ? state.keyword = state.keywordBackup : getKeywordLabel(treeSelectValue.value);
18435
18315
  }
18436
18316
  if (!treeSelectValue.value && state.keyword) {
18437
18317
  state.keyword = "";
18438
18318
  state.keywordBackup = "";
18439
18319
  }
18440
18320
  inputRef.value.blur();
18321
+ lewTreeRef.value.reset();
18441
18322
  emit2("blur");
18442
18323
  };
18443
- watch(
18444
- () => treeSelectValue.value,
18445
- () => {
18446
- findKeyword();
18447
- }
18448
- );
18449
- const searchCount = computed(() => {
18450
- return state.treeList.filter((e) => {
18451
- return e.level === 0;
18452
- }).length;
18324
+ const getPlaceholder = computed(() => {
18325
+ return state.keywordBackup || props2.placeholder;
18453
18326
  });
18454
18327
  __expose2({ show, hide: hide2 });
18455
18328
  return (_ctx, _cache) => {
@@ -18505,10 +18378,10 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
18505
18378
  class: "value",
18506
18379
  style: normalizeStyle(unref(getValueStyle)),
18507
18380
  readonly: !_ctx.searchable,
18508
- placeholder: unref(state).keywordBackup || props2.placeholder,
18381
+ placeholder: unref(getPlaceholder),
18509
18382
  onInput: _cache[1] || (_cache[1] = //@ts-ignore
18510
18383
  (...args) => unref(searchDebounce) && unref(searchDebounce)(...args))
18511
- }, null, 44, _hoisted_1$m), [
18384
+ }, null, 44, _hoisted_1$n), [
18512
18385
  [vModelText, unref(state).keyword]
18513
18386
  ])
18514
18387
  ], 2)
@@ -18519,8 +18392,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
18519
18392
  style: normalizeStyle(`width:${unref(state).selectWidth}px`)
18520
18393
  }, [
18521
18394
  renderSlot(_ctx.$slots, "header", {}, void 0, true),
18522
- createElementVNode("div", _hoisted_2$b, [
18523
- _ctx.searchable && (unref(state).treeList || []).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$8, " 共 " + toDisplayString$1(unref(numFormat)(unref(searchCount))) + " 条结果 ", 1)) : createCommentVNode("", true),
18395
+ createElementVNode("div", _hoisted_2$a, [
18396
+ _ctx.searchable && unref(state).resultText ? (openBlock(), createElementBlock("div", _hoisted_3$7, toDisplayString$1(unref(state).resultText), 1)) : createCommentVNode("", true),
18524
18397
  createElementVNode("div", _hoisted_4$5, [
18525
18398
  createVNode(unref(LewTree), mergeProps({
18526
18399
  ref_key: "lewTreeRef",
@@ -18532,14 +18405,16 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
18532
18405
  labelField: _ctx.labelField,
18533
18406
  disabledField: _ctx.disabledField,
18534
18407
  showLine: _ctx.showLine,
18535
- showCheckbox: _ctx.showCheckbox,
18408
+ checkable: _ctx.checkable,
18409
+ searchable: _ctx.searchable,
18536
18410
  dataSource: _ctx.dataSource,
18537
18411
  loadMethod: _ctx.loadMethod,
18538
18412
  initTree: _ctx.initTree,
18539
18413
  expandAll: _ctx.expandAll
18540
18414
  }, {
18541
18415
  "is-select": true,
18542
- onInitEnd: _cache[3] || (_cache[3] = ($event) => unref(state).initLoading = false),
18416
+ onLoadStart: _cache[3] || (_cache[3] = ($event) => unref(state).searchLoading = true),
18417
+ onLoadEnd: _cache[4] || (_cache[4] = ($event) => (unref(state).searchLoading = false, unref(state).initLoading = false, unref(state).resultText = $event)),
18543
18418
  onChange: change2
18544
18419
  }), createSlots({ _: 2 }, [
18545
18420
  _ctx.$slots.empty ? {
@@ -18567,9 +18442,9 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
18567
18442
  };
18568
18443
  }
18569
18444
  });
18570
- const LewTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-30b3646c"]]);
18571
- const _hoisted_1$l = { class: "lew-form-modal lew-scrollbar" };
18572
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
18445
+ const LewTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-d895e863"]]);
18446
+ const _hoisted_1$m = { class: "lew-form-modal lew-scrollbar" };
18447
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
18573
18448
  __name: "FormModal",
18574
18449
  props: {
18575
18450
  options: {
@@ -18639,7 +18514,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
18639
18514
  title: `${unref(editIndex) >= 0 ? "编辑" : "新增"}数据`
18640
18515
  }, {
18641
18516
  default: withCtx(() => [
18642
- createElementVNode("div", _hoisted_1$l, [
18517
+ createElementVNode("div", _hoisted_1$m, [
18643
18518
  createVNode(unref(LewForm), {
18644
18519
  siz: __props2.size,
18645
18520
  onMounted: formMounted,
@@ -18655,7 +18530,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
18655
18530
  };
18656
18531
  }
18657
18532
  });
18658
- const FormModal = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-b9fc98a8"]]);
18533
+ const FormModal = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-b9fc98a8"]]);
18659
18534
  const inputTableModel = {
18660
18535
  modelValue: {
18661
18536
  type: Array,
@@ -18793,7 +18668,7 @@ const inputTableProps = {
18793
18668
  description: "指定一个不可重复的字段,用于添加数据时检查重复"
18794
18669
  }
18795
18670
  };
18796
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
18671
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
18797
18672
  __name: "LewInputTable",
18798
18673
  props: /* @__PURE__ */ mergeModels(inputTableProps, {
18799
18674
  "modelValue": { required: true },
@@ -18971,7 +18846,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
18971
18846
  })
18972
18847
  }, {
18973
18848
  default: withCtx(() => [
18974
- createVNode(unref(_sfc_main$g), {
18849
+ createVNode(unref(_sfc_main$h), {
18975
18850
  size: _ctx.size,
18976
18851
  checkable: _ctx.batchDeletable,
18977
18852
  "row-key": _ctx.rowKey,
@@ -19131,7 +19006,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
19131
19006
  };
19132
19007
  }
19133
19008
  });
19134
- const LewInputTable = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-fad857e7"]]);
19009
+ const LewInputTable = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-fad857e7"]]);
19135
19010
  const switchModel = {
19136
19011
  modelValue: {
19137
19012
  type: Boolean,
@@ -19194,8 +19069,8 @@ const switchProps = {
19194
19069
  description: "是否显示加载状态"
19195
19070
  }
19196
19071
  };
19197
- const _hoisted_1$k = ["disabled"];
19198
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
19072
+ const _hoisted_1$l = ["disabled"];
19073
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
19199
19074
  __name: "LewSwitch",
19200
19075
  props: /* @__PURE__ */ mergeModels(switchProps, {
19201
19076
  "modelValue": {},
@@ -19293,7 +19168,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
19293
19168
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue2.value = $event),
19294
19169
  type: "checkbox",
19295
19170
  disabled: _ctx.disabled
19296
- }, null, 8, _hoisted_1$k), [
19171
+ }, null, 8, _hoisted_1$l), [
19297
19172
  [vShow, false],
19298
19173
  [vModelCheckbox, modelValue2.value]
19299
19174
  ]),
@@ -19302,7 +19177,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
19302
19177
  };
19303
19178
  }
19304
19179
  });
19305
- const LewSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-8254e1d2"]]);
19180
+ const LewSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-8254e1d2"]]);
19306
19181
  const sliderModel = {
19307
19182
  modelValue: {
19308
19183
  type: [Number, void 0],
@@ -19392,9 +19267,9 @@ const sliderProps = {
19392
19267
  description: "格式化 tooltip 内容"
19393
19268
  }
19394
19269
  };
19395
- const _hoisted_1$j = { class: "lew-slider-track-line" };
19396
- const _hoisted_2$a = ["onClick"];
19397
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
19270
+ const _hoisted_1$k = { class: "lew-slider-track-line" };
19271
+ const _hoisted_2$9 = ["onClick"];
19272
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
19398
19273
  __name: "LewSlider",
19399
19274
  props: /* @__PURE__ */ mergeModels(sliderProps, {
19400
19275
  "modelValue": {},
@@ -19603,7 +19478,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
19603
19478
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {
19604
19479
  }, ["stop"]))
19605
19480
  }, null, 4),
19606
- createElementVNode("div", _hoisted_1$j, [
19481
+ createElementVNode("div", _hoisted_1$k, [
19607
19482
  createElementVNode("div", {
19608
19483
  class: "lew-slider-track-line-range",
19609
19484
  style: normalizeStyle({
@@ -19640,7 +19515,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
19640
19515
  class: normalizeClass(["lew-slider-track-step-label-text", {
19641
19516
  "lew-slider-track-step-label-text-disabled": Number(item.value) < Number(unref(getMin)) || Number(item.value) > Number(unref(getMax))
19642
19517
  }])
19643
- }, toDisplayString$1(item.label), 11, _hoisted_2$a)
19518
+ }, toDisplayString$1(item.label), 11, _hoisted_2$9)
19644
19519
  ], 4);
19645
19520
  }), 128))
19646
19521
  ]),
@@ -19667,7 +19542,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
19667
19542
  };
19668
19543
  }
19669
19544
  });
19670
- const LewSlider = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-45230045"]]);
19545
+ const LewSlider = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-45230045"]]);
19671
19546
  const sliderRangeModel = {
19672
19547
  modelValue: {
19673
19548
  type: Array,
@@ -19757,8 +19632,8 @@ const sliderRangeProps = {
19757
19632
  description: "格式化 tooltip 内容"
19758
19633
  }
19759
19634
  };
19760
- const _hoisted_1$i = { class: "lew-slider-track-line" };
19761
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
19635
+ const _hoisted_1$j = { class: "lew-slider-track-line" };
19636
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
19762
19637
  __name: "LewSliderRange",
19763
19638
  props: /* @__PURE__ */ mergeModels(sliderRangeProps, {
19764
19639
  "modelValue": {},
@@ -19977,7 +19852,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
19977
19852
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {
19978
19853
  }, ["stop"]))
19979
19854
  }, null, 4),
19980
- createElementVNode("div", _hoisted_1$i, [
19855
+ createElementVNode("div", _hoisted_1$j, [
19981
19856
  createElementVNode("div", {
19982
19857
  class: "lew-slider-track-line-range",
19983
19858
  style: normalizeStyle({
@@ -20058,7 +19933,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
20058
19933
  };
20059
19934
  }
20060
19935
  });
20061
- const LewSliderRange = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-fe8fb539"]]);
19936
+ const LewSliderRange = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-4ea82a0c"]]);
20062
19937
  const colorPickerModel = {
20063
19938
  modelValue: {
20064
19939
  type: String,
@@ -20092,8 +19967,8 @@ const colorPickerProps = {
20092
19967
  description: "是否只读"
20093
19968
  }
20094
19969
  };
20095
- const _hoisted_1$h = ["placeholder"];
20096
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
19970
+ const _hoisted_1$i = ["placeholder"];
19971
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
20097
19972
  __name: "LewColorPicker",
20098
19973
  props: /* @__PURE__ */ mergeModels(colorPickerProps, {
20099
19974
  "modelValue": {},
@@ -20207,7 +20082,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
20207
20082
  onFocus: focus,
20208
20083
  onBlur: blur,
20209
20084
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue2.value = $event)
20210
- }, null, 44, _hoisted_1$h), [
20085
+ }, null, 44, _hoisted_1$i), [
20211
20086
  [vModelText, modelValue2.value]
20212
20087
  ])
20213
20088
  ], 6)
@@ -20215,7 +20090,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
20215
20090
  };
20216
20091
  }
20217
20092
  });
20218
- const LewColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-dbf02989"]]);
20093
+ const LewColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-dbf02989"]]);
20219
20094
  const uploadProps = {
20220
20095
  accept: {
20221
20096
  type: String,
@@ -20349,27 +20224,18 @@ const uploadByCardProps = {
20349
20224
  }
20350
20225
  }
20351
20226
  };
20352
- const statusMap = {
20353
- pending: "待上传",
20354
- success: "上传成功",
20355
- fail: "上传失败",
20356
- uploading: "上传中",
20357
- complete: "已上传",
20358
- wrong_type: "非法格式",
20359
- wrong_size: "文件大小超出限制"
20227
+ const statusConfig = {
20228
+ pending: { text: "待上传", color: "gray" },
20229
+ success: { text: "上传成功", color: "green" },
20230
+ fail: { text: "上传失败", color: "red" },
20231
+ uploading: { text: "上传中", color: "blue" },
20232
+ complete: { text: "已上传", color: "gray" },
20233
+ wrong_type: { text: "非法格式", color: "red" },
20234
+ wrong_size: { text: "文件大小超出限制", color: "red" }
20360
20235
  };
20361
- const statusColorMap = {
20362
- pending: "gray",
20363
- success: "green",
20364
- fail: "red",
20365
- uploading: "blue",
20366
- complete: "gray",
20367
- wrong_type: "red",
20368
- wrong_size: "red"
20369
- };
20370
- const _hoisted_1$g = ["src"];
20371
- const _hoisted_2$9 = { key: 1 };
20372
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
20236
+ const _hoisted_1$h = ["src"];
20237
+ const _hoisted_2$8 = { key: 1 };
20238
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
20373
20239
  __name: "LewUploadByList",
20374
20240
  props: /* @__PURE__ */ mergeModels(uploadByListProps, {
20375
20241
  "modelValue": {},
@@ -20427,6 +20293,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
20427
20293
  const urlParts = url.split("/");
20428
20294
  return urlParts[urlParts.length - 1];
20429
20295
  };
20296
+ const getStatus = computed(() => (item) => {
20297
+ return statusConfig[item.status || "complete"];
20298
+ });
20430
20299
  return (_ctx, _cache) => {
20431
20300
  return withDirectives((openBlock(), createBlock(unref(LewFlex), {
20432
20301
  direction: "y",
@@ -20466,7 +20335,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
20466
20335
  key: 1,
20467
20336
  class: "lew-upload-file-icon",
20468
20337
  src: unref(getFileIcon)(item.name)
20469
- }, null, 8, _hoisted_1$g))
20338
+ }, null, 8, _hoisted_1$h))
20470
20339
  ]),
20471
20340
  _: 2
20472
20341
  }, 1032, ["style"]),
@@ -20579,7 +20448,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
20579
20448
  item.status === "uploading" && item.percent && item.size ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
20580
20449
  createTextVNode(toDisplayString$1(unref(formatBytes)(item.percent / 100 * item.size) + " / "), 1)
20581
20450
  ], 64)) : createCommentVNode("", true),
20582
- item.size ? (openBlock(), createElementBlock("span", _hoisted_2$9, toDisplayString$1(unref(formatBytes)(item.size)), 1)) : createCommentVNode("", true)
20451
+ item.size ? (openBlock(), createElementBlock("span", _hoisted_2$8, toDisplayString$1(unref(formatBytes)(item.size)), 1)) : createCommentVNode("", true)
20583
20452
  ], 4),
20584
20453
  createVNode(unref(LewFlex), {
20585
20454
  style: { "max-width": "200px" },
@@ -20587,11 +20456,11 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
20587
20456
  x: "end"
20588
20457
  }, {
20589
20458
  default: withCtx(() => [
20590
- item.status && item.status !== "pending" ? (openBlock(), createBlock(unref(_sfc_main$_), {
20591
- key: 0,
20459
+ item.status && item.status !== "pending" ? (openBlock(), createBlock(unref(_sfc_main$$), {
20592
20460
  type: "light",
20593
20461
  size: "small",
20594
- color: unref(statusColorMap)[item.status || "complete"]
20462
+ key: item.status,
20463
+ color: unref(getStatus)(item).color
20595
20464
  }, {
20596
20465
  left: withCtx(() => [
20597
20466
  createVNode(Icon, {
@@ -20602,7 +20471,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
20602
20471
  }, null, 8, ["type", "loading"])
20603
20472
  ]),
20604
20473
  default: withCtx(() => [
20605
- createTextVNode(" " + toDisplayString$1(unref(statusMap)[item.status || "complete"]), 1)
20474
+ createTextVNode(" " + toDisplayString$1(unref(getStatus)(item).text), 1)
20606
20475
  ]),
20607
20476
  _: 2
20608
20477
  }, 1032, ["color"])) : createCommentVNode("", true)
@@ -20630,9 +20499,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
20630
20499
  };
20631
20500
  }
20632
20501
  });
20633
- const LewUploadByList = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-67388e0d"]]);
20634
- const _hoisted_1$f = ["src"];
20635
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
20502
+ const LewUploadByList = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-9eb98361"]]);
20503
+ const _hoisted_1$g = ["src"];
20504
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
20636
20505
  __name: "LewUploadByCard",
20637
20506
  props: /* @__PURE__ */ mergeModels(uploadByCardProps, {
20638
20507
  "modelValue": {},
@@ -20671,6 +20540,9 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
20671
20540
  medium: 80,
20672
20541
  large: 88
20673
20542
  };
20543
+ const getStatus = computed(() => (item) => {
20544
+ return statusConfig[item.status || "complete"];
20545
+ });
20674
20546
  const emit2 = __emit2;
20675
20547
  const modelValue2 = useModel(__props2, "modelValue");
20676
20548
  return (_ctx, _cache) => {
@@ -20731,13 +20603,13 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
20731
20603
  createVNode(Icon, {
20732
20604
  size: rightTopBtnIconSizeMap[_ctx.size],
20733
20605
  type: "tips",
20734
- color: unref(statusColorMap)[item.status || "complete"]
20606
+ color: unref(getStatus)(item).color
20735
20607
  }, null, 8, ["size", "color"])
20736
20608
  ]),
20737
20609
  _: 2
20738
20610
  }, 1032, ["style"])), [
20739
20611
  [_directive_tooltip, {
20740
- content: unref(statusMap)[item.status || "complete"],
20612
+ content: unref(getStatus)(item).text,
20741
20613
  trigger: "mouseenter"
20742
20614
  }]
20743
20615
  ]) : createCommentVNode("", true),
@@ -20787,7 +20659,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
20787
20659
  }),
20788
20660
  class: "lew-upload-file-icon",
20789
20661
  src: unref(getFileIcon)(item.name)
20790
- }, null, 12, _hoisted_1$f))
20662
+ }, null, 12, _hoisted_1$g))
20791
20663
  ]),
20792
20664
  _: 2
20793
20665
  }, 1032, ["style"])
@@ -20831,9 +20703,9 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
20831
20703
  };
20832
20704
  }
20833
20705
  });
20834
- const LewUploadByCard = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-6415c0b9"]]);
20835
- const _hoisted_1$e = ["multiple", "accept"];
20836
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
20706
+ const LewUploadByCard = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-cf133017"]]);
20707
+ const _hoisted_1$f = ["multiple", "accept"];
20708
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
20837
20709
  __name: "LewUpload",
20838
20710
  props: /* @__PURE__ */ mergeModels(uploadProps, {
20839
20711
  "modelValue": {},
@@ -21152,7 +21024,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
21152
21024
  multiple: _ctx.multiple,
21153
21025
  accept: _ctx.accept,
21154
21026
  onChange: withModifiers(clickUpload, ["stop"])
21155
- }, null, 40, _hoisted_1$e),
21027
+ }, null, 40, _hoisted_1$f),
21156
21028
  createElementVNode("input", {
21157
21029
  class: "lew-upload-input",
21158
21030
  ref_key: "inputPasteRef",
@@ -21182,7 +21054,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
21182
21054
  };
21183
21055
  }
21184
21056
  });
21185
- const LewUpload = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-ed98bac5"]]);
21057
+ const LewUpload = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-f27730be"]]);
21186
21058
  const rateModel = {
21187
21059
  modelValue: {
21188
21060
  type: Number,
@@ -21226,8 +21098,8 @@ const rateProps = {
21226
21098
  description: "是否禁用"
21227
21099
  }
21228
21100
  };
21229
- const _hoisted_1$d = ["onMousemove", "onClick"];
21230
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
21101
+ const _hoisted_1$e = ["onMousemove", "onClick"];
21102
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
21231
21103
  __name: "LewRate",
21232
21104
  props: /* @__PURE__ */ mergeModels(rateProps, {
21233
21105
  "modelValue": {},
@@ -21347,7 +21219,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
21347
21219
  trigger: "hover"
21348
21220
  }]
21349
21221
  ])
21350
- ], 44, _hoisted_1$d);
21222
+ ], 44, _hoisted_1$e);
21351
21223
  }), 128))
21352
21224
  ]),
21353
21225
  _: 1
@@ -21355,7 +21227,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
21355
21227
  };
21356
21228
  }
21357
21229
  });
21358
- const LewRate = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-c80783e5"]]);
21230
+ const LewRate = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-c80783e5"]]);
21359
21231
  const tableModel = {
21360
21232
  selectedKeys: {
21361
21233
  type: [Array, String, Number, void 0],
@@ -21444,7 +21316,7 @@ const tableProps = {
21444
21316
  }
21445
21317
  }
21446
21318
  };
21447
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
21319
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
21448
21320
  __name: "SortIcon",
21449
21321
  props: {
21450
21322
  sortValue: {
@@ -21505,10 +21377,10 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
21505
21377
  };
21506
21378
  }
21507
21379
  });
21508
- const SortIcon = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-62110f01"]]);
21509
- const _hoisted_1$c = { class: "lew-table-wrapper" };
21510
- const _hoisted_2$8 = { class: "lew-table-header" };
21511
- const _hoisted_3$7 = { class: "lew-table-tr" };
21380
+ const SortIcon = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-62110f01"]]);
21381
+ const _hoisted_1$d = { class: "lew-table-wrapper" };
21382
+ const _hoisted_2$7 = { class: "lew-table-header" };
21383
+ const _hoisted_3$6 = { class: "lew-table-tr" };
21512
21384
  const _hoisted_4$4 = { class: "lew-table-title-span" };
21513
21385
  const _hoisted_5$2 = { class: "lew-table-main" };
21514
21386
  const _hoisted_6$1 = { class: "lew-table-tr" };
@@ -21528,7 +21400,7 @@ const _hoisted_14 = {
21528
21400
  };
21529
21401
  const _hoisted_15 = ["onMouseenter"];
21530
21402
  const _hoisted_16 = { class: "lew-table-footer" };
21531
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
21403
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
21532
21404
  __name: "LewTable",
21533
21405
  props: /* @__PURE__ */ mergeModels(tableProps, {
21534
21406
  "selectedKeys": {},
@@ -21872,7 +21744,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
21872
21744
  }
21873
21745
  });
21874
21746
  return (_ctx, _cache) => {
21875
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
21747
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
21876
21748
  createElementVNode("i", {
21877
21749
  style: normalizeStyle({ left: unref(any2px)(unref(state).fixedLeftWidth) }),
21878
21750
  class: normalizeClass([{
@@ -21885,7 +21757,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
21885
21757
  "lew-hide-line-right": !unref(state).isScrollbarVisible || !unref(state).isInitialized || ["all", "right"].includes(unref(state).hiddenScrollLine)
21886
21758
  }, "lew-table-scroll-line-right"])
21887
21759
  }, null, 6),
21888
- createElementVNode("div", _hoisted_2$8, [
21760
+ createElementVNode("div", _hoisted_2$7, [
21889
21761
  renderSlot(_ctx.$slots, "table-header")
21890
21762
  ]),
21891
21763
  createElementVNode("div", {
@@ -21910,7 +21782,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
21910
21782
  ref: fixedLeftRef,
21911
21783
  class: "lew-table-fixed-left"
21912
21784
  }, [
21913
- createElementVNode("div", _hoisted_3$7, [
21785
+ createElementVNode("div", _hoisted_3$6, [
21914
21786
  _ctx.checkable ? (openBlock(), createBlock(unref(LewFlex), {
21915
21787
  key: 0,
21916
21788
  class: "lew-table-td",
@@ -22262,8 +22134,8 @@ const paginationProps = {
22262
22134
  }
22263
22135
  }
22264
22136
  };
22265
- const _hoisted_1$b = ["onClick"];
22266
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
22137
+ const _hoisted_1$c = ["onClick"];
22138
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
22267
22139
  __name: "LewPagination",
22268
22140
  props: /* @__PURE__ */ mergeModels(paginationProps, {
22269
22141
  "total": { default: 0 },
@@ -22446,7 +22318,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
22446
22318
  active: Number(page) === Number(currentPage.value)
22447
22319
  }]),
22448
22320
  onClick: ($event) => changePage(page)
22449
- }, toDisplayString$1(page), 11, _hoisted_1$b);
22321
+ }, toDisplayString$1(page), 11, _hoisted_1$c);
22450
22322
  }), 128)),
22451
22323
  unref(endEllipsis) ? (openBlock(), createElementBlock("div", {
22452
22324
  key: 3,
@@ -22512,7 +22384,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
22512
22384
  };
22513
22385
  }
22514
22386
  });
22515
- const LewPagination = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-27faebf9"]]);
22387
+ const LewPagination = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-27faebf9"]]);
22516
22388
  const treeModel = {
22517
22389
  modelValue: {
22518
22390
  type: [Array, String],
@@ -22538,15 +22410,25 @@ const treeProps = {
22538
22410
  return true;
22539
22411
  }
22540
22412
  },
22413
+ height: {
22414
+ type: String,
22415
+ default: "100%",
22416
+ description: "树组件的高度"
22417
+ },
22541
22418
  multiple: {
22542
22419
  type: Boolean,
22543
22420
  default: false,
22544
22421
  description: "是否允许多选"
22545
22422
  },
22546
- showCheckbox: {
22423
+ checkable: {
22547
22424
  type: Boolean,
22548
22425
  default: false,
22549
- description: "是否显示复选框"
22426
+ description: "是否显示选框"
22427
+ },
22428
+ searchable: {
22429
+ type: Boolean,
22430
+ default: false,
22431
+ description: "是否显示搜索框"
22550
22432
  },
22551
22433
  expandAll: {
22552
22434
  type: Boolean,
@@ -22563,23 +22445,6 @@ const treeProps = {
22563
22445
  default: false,
22564
22446
  description: "是否显示连接线"
22565
22447
  },
22566
- trigger: {
22567
- type: String,
22568
- default: "click",
22569
- description: "节点展开收起的触发方式",
22570
- validator: (value) => {
22571
- if (!["click", "hover"].includes(value)) {
22572
- console.warn('[LewTree] trigger必须是 "click" 或 "hover"');
22573
- return false;
22574
- }
22575
- return true;
22576
- }
22577
- },
22578
- placeholder: {
22579
- type: String,
22580
- default: "请选择",
22581
- description: "选择框默认文本"
22582
- },
22583
22448
  keyField: {
22584
22449
  type: String,
22585
22450
  default: "key",
@@ -22608,43 +22473,80 @@ const treeProps = {
22608
22473
  isSelect: {
22609
22474
  type: Boolean,
22610
22475
  default: false,
22476
+ hidden: true,
22611
22477
  description: "是否作为选择器使用"
22612
22478
  }
22613
22479
  };
22614
- const flattenTree = (tree) => {
22615
- return flatMap(cloneDeep(tree), (node) => {
22616
- const { children } = node;
22617
- delete node.children;
22618
- return [node, ...flattenTree(children)];
22619
- });
22480
+ const treeItemProps = {
22481
+ label: {
22482
+ type: String,
22483
+ default: "",
22484
+ description: '菜单树项的标题文本。也可以使用具名插槽 "label" 自定义标题内容。'
22485
+ },
22486
+ __key: {
22487
+ type: [String, Number],
22488
+ required: true,
22489
+ description: "菜单树项的唯一标识符。",
22490
+ validator(value) {
22491
+ if (value === "") {
22492
+ console.warn("[LewTreeItem] key 不能为空。");
22493
+ return false;
22494
+ }
22495
+ return true;
22496
+ }
22497
+ },
22498
+ render: {
22499
+ type: Function,
22500
+ default: () => {
22501
+ },
22502
+ description: "菜单树项的图标。"
22503
+ },
22504
+ disabled: {
22505
+ type: Boolean,
22506
+ default: false,
22507
+ description: "菜单树项是否禁用。"
22508
+ },
22509
+ level: {
22510
+ type: Number,
22511
+ default: 1,
22512
+ description: "菜单树项的层级,从 1 开始。"
22513
+ },
22514
+ isLeaf: {
22515
+ type: Boolean,
22516
+ default: false,
22517
+ description: "是否为叶子节点。"
22518
+ },
22519
+ extend: {
22520
+ type: Object,
22521
+ default: () => {
22522
+ },
22523
+ description: "扩展数据。"
22524
+ }
22620
22525
  };
22621
22526
  const findAllNodes = (tree = [], keyField = "key") => {
22622
22527
  const nodes = /* @__PURE__ */ new Set();
22623
- function traverse(node) {
22528
+ const traverse = (node) => {
22529
+ var _a;
22624
22530
  nodes.add(node[keyField]);
22625
- (node.children || []).forEach((child) => {
22626
- traverse(child);
22627
- });
22628
- }
22629
- tree.forEach((node) => {
22630
- traverse(node);
22631
- });
22632
- return Array.from(nodes) || [];
22531
+ if (((_a = node.children) == null ? void 0 : _a.length) > 0) {
22532
+ node.children.forEach((child) => traverse(child));
22533
+ }
22534
+ };
22535
+ tree.forEach((node) => traverse(node));
22536
+ return Array.from(nodes);
22633
22537
  };
22634
22538
  const findLeafNodes = (tree = [], keyField = "key") => {
22635
22539
  const leafNodes = /* @__PURE__ */ new Set();
22636
- function traverse(node) {
22637
- if (!node.children || node.children.length === 0) {
22540
+ const traverse = (node) => {
22541
+ var _a;
22542
+ if (!((_a = node.children) == null ? void 0 : _a.length)) {
22638
22543
  leafNodes.add(node[keyField]);
22544
+ } else {
22545
+ node.children.forEach((child) => traverse(child));
22639
22546
  }
22640
- (node.children || []).forEach((child) => {
22641
- traverse(child);
22642
- });
22643
- }
22644
- tree.forEach((node) => {
22645
- traverse(node);
22646
- });
22647
- return Array.from(leafNodes) || [];
22547
+ };
22548
+ tree.forEach((node) => traverse(node));
22549
+ return Array.from(leafNodes);
22648
22550
  };
22649
22551
  const formatTree = ({
22650
22552
  dataSource,
@@ -22657,39 +22559,46 @@ const formatTree = ({
22657
22559
  }) => {
22658
22560
  return dataSource.map((node, index2) => {
22659
22561
  const { children, ...rest } = node;
22562
+ const key = rest[keyField];
22563
+ const label = rest[labelField];
22564
+ const keyPaths = [...parentKeyPaths, key];
22565
+ const labelPaths = [...parentLabelPaths, label];
22566
+ const isLeaf = has(rest, "isLeaf") ? rest.isLeaf : !(children == null ? void 0 : children.length);
22660
22567
  const currentNode = {
22661
22568
  ...rest,
22662
- key: rest[keyField],
22663
- label: rest[labelField],
22664
- keyPaths: [...parentKeyPaths, rest[keyField]],
22665
- labelPaths: [...parentLabelPaths, rest[labelField]],
22666
- isLeaf: has(rest, "isLeaf") ? rest.isLeaf : (children || []).length === 0,
22667
- parentKey: parent ? parent[keyField] : null,
22569
+ key,
22570
+ label,
22571
+ keyPaths,
22572
+ labelPaths,
22573
+ isLeaf,
22574
+ parentKey: (parent == null ? void 0 : parent[keyField]) ?? null,
22668
22575
  level: parentKeyPaths.length,
22669
22576
  parentKeyPaths,
22670
22577
  parentLabelPaths,
22671
22578
  treeIndex: index2
22672
22579
  };
22673
- if (!free) {
22674
- currentNode.leafNodeValues = findLeafNodes(children);
22675
- currentNode.allNodeValues = findAllNodes(children);
22580
+ if (!free && (children == null ? void 0 : children.length) > 0) {
22581
+ currentNode.leafNodeValues = findLeafNodes(children, keyField);
22582
+ currentNode.allNodeValues = findAllNodes(children, keyField);
22583
+ } else if (!free) {
22584
+ currentNode.leafNodeValues = [];
22585
+ currentNode.allNodeValues = [];
22676
22586
  }
22677
- const formattedNode = {
22587
+ return {
22678
22588
  ...currentNode,
22679
- children: children ? formatTree({
22589
+ children: (children == null ? void 0 : children.length) > 0 ? formatTree({
22680
22590
  dataSource: children,
22681
22591
  parent: currentNode,
22682
- parentKeyPaths: currentNode.keyPaths,
22683
- parentLabelPaths: currentNode.labelPaths,
22592
+ parentKeyPaths: keyPaths,
22593
+ parentLabelPaths: labelPaths,
22684
22594
  keyField,
22685
22595
  labelField,
22686
22596
  free
22687
22597
  }) : []
22688
22598
  };
22689
- return formattedNode;
22690
22599
  });
22691
22600
  };
22692
- const tree2List = async ({
22601
+ const transformTree = async ({
22693
22602
  initTree = null,
22694
22603
  dataSource = [],
22695
22604
  keyField = "key",
@@ -22698,307 +22607,502 @@ const tree2List = async ({
22698
22607
  keyword = ""
22699
22608
  }) => {
22700
22609
  let tree = [];
22701
- if (initTree) {
22702
- const _tree = await initTree();
22703
- if (isArray$1(_tree)) {
22610
+ const status = "success";
22611
+ try {
22612
+ if (initTree) {
22613
+ try {
22614
+ const _tree = await initTree();
22615
+ if (isArray$1(_tree)) {
22616
+ tree = formatTree({
22617
+ dataSource: _tree,
22618
+ parentKeyPaths: [],
22619
+ parentLabelPaths: [],
22620
+ keyField,
22621
+ labelField,
22622
+ free
22623
+ });
22624
+ } else {
22625
+ return {
22626
+ status: "error",
22627
+ result: [],
22628
+ error: new Error(
22629
+ "The initTree function should return a Promise that resolves to an array"
22630
+ )
22631
+ };
22632
+ }
22633
+ } catch (error2) {
22634
+ return {
22635
+ status: "error",
22636
+ result: [],
22637
+ error: error2 instanceof Error ? error2 : new Error(String(error2))
22638
+ };
22639
+ }
22640
+ } else if ((dataSource == null ? void 0 : dataSource.length) > 0) {
22704
22641
  tree = formatTree({
22705
- dataSource: _tree,
22642
+ dataSource,
22643
+ parentKeyPaths: [],
22644
+ parentLabelPaths: [],
22706
22645
  keyField,
22707
22646
  labelField,
22708
22647
  free
22709
22648
  });
22710
- } else {
22711
- return new Error(
22712
- "The initTree function should return a Promise that resolves to an array"
22713
- );
22714
22649
  }
22715
- } else if (dataSource && dataSource.length > 0) {
22716
- tree = formatTree({ dataSource, keyField, labelField, free });
22717
- }
22718
- if (keyword) {
22719
- const _tree = [];
22720
- const filterTree = (node) => {
22721
- for (let i = 0; i < node.length; i++) {
22722
- const { labelPaths, children } = node[i];
22723
- if (some(labelPaths, (label) => label.includes(keyword))) {
22724
- _tree.push(node[i]);
22725
- } else if (children) {
22726
- filterTree(children || []);
22727
- }
22650
+ if (keyword) {
22651
+ const _tree = [];
22652
+ const filterTree = (nodes) => {
22653
+ nodes.forEach((node) => {
22654
+ const { labelPaths, children } = node;
22655
+ if (labelPaths == null ? void 0 : labelPaths.some(
22656
+ (label) => String(label).toLowerCase().includes(keyword.toLowerCase())
22657
+ )) {
22658
+ _tree.push(node);
22659
+ } else if (children && children.length > 0) {
22660
+ filterTree(children);
22661
+ }
22662
+ });
22663
+ };
22664
+ filterTree(tree);
22665
+ if (_tree.length > 0) {
22666
+ tree = formatTree({
22667
+ dataSource: _tree,
22668
+ parentKeyPaths: [],
22669
+ parentLabelPaths: [],
22670
+ keyField,
22671
+ labelField,
22672
+ free
22673
+ });
22674
+ } else {
22675
+ tree = [];
22728
22676
  }
22677
+ }
22678
+ return { status, result: tree };
22679
+ } catch (error2) {
22680
+ return {
22681
+ status: "error",
22682
+ result: [],
22683
+ error: error2 instanceof Error ? error2 : new Error(String(error2))
22729
22684
  };
22730
- filterTree(tree);
22731
- tree = formatTree({
22732
- dataSource: _tree,
22685
+ }
22686
+ };
22687
+ const _hoisted_1$b = {
22688
+ key: 0,
22689
+ class: "lew-tree-item-main"
22690
+ };
22691
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
22692
+ __name: "LewTreeItem",
22693
+ props: treeItemProps,
22694
+ emits: ["change", "expand"],
22695
+ setup(__props2, { emit: __emit2 }) {
22696
+ const props2 = __props2;
22697
+ const {
22698
+ modelValue: modelValue2,
22699
+ expandKeys,
22700
+ multiple,
22701
+ checkable,
22702
+ expandAll,
22703
+ _dataSource,
22704
+ loadMethod,
22733
22705
  keyField,
22734
22706
  labelField,
22735
- free
22707
+ free,
22708
+ cacheDataSource
22709
+ } = inject("lew-tree");
22710
+ const emit2 = __emit2;
22711
+ const loading = ref(false);
22712
+ const loaded = ref(false);
22713
+ const areSomeChildrenSelected = (node) => {
22714
+ if (!node.children || node.children.length === 0) return false;
22715
+ const childKeys = findAllChildrenKeys(node);
22716
+ return childKeys.some((key) => modelValue2.value.includes(key)) && !childKeys.every((key) => modelValue2.value.includes(key));
22717
+ };
22718
+ const select = () => {
22719
+ if (props2.disabled) return;
22720
+ let newModelValue = cloneDeep(modelValue2.value);
22721
+ if (multiple) {
22722
+ const index2 = newModelValue.indexOf(props2.__key);
22723
+ if (free) {
22724
+ if (index2 > -1) {
22725
+ newModelValue.splice(index2, 1);
22726
+ } else {
22727
+ newModelValue.push(props2.__key);
22728
+ }
22729
+ } else {
22730
+ if (index2 > -1) {
22731
+ newModelValue.splice(index2, 1);
22732
+ if (props2.extend && props2.extend.children && props2.extend.children.length > 0) {
22733
+ const childKeys = findAllChildrenKeys(props2.extend);
22734
+ newModelValue = newModelValue.filter(
22735
+ (key) => !childKeys.includes(key)
22736
+ );
22737
+ }
22738
+ if (props2.extend && props2.extend.parentKeyPaths && props2.extend.parentKeyPaths.length > 0) {
22739
+ props2.extend.parentKeyPaths.forEach((parentKey) => {
22740
+ const parentIndex = newModelValue.indexOf(parentKey);
22741
+ if (parentIndex > -1) {
22742
+ newModelValue.splice(parentIndex, 1);
22743
+ }
22744
+ });
22745
+ }
22746
+ } else {
22747
+ newModelValue.push(props2.__key);
22748
+ if (props2.extend && props2.extend.children && props2.extend.children.length > 0) {
22749
+ const childKeys = findAllChildrenKeys(props2.extend);
22750
+ childKeys.forEach((key) => {
22751
+ if (!newModelValue.includes(key)) {
22752
+ newModelValue.push(key);
22753
+ }
22754
+ });
22755
+ }
22756
+ }
22757
+ if (props2.extend && props2.extend.parentKey && props2.extend.parentKeyPaths) {
22758
+ const parentKey = props2.extend.parentKey;
22759
+ const parentNode = findNodeByKey(parentKey, _dataSource.value);
22760
+ const siblingKeys = ((parentNode == null ? void 0 : parentNode.children) || []).map((e) => e.key);
22761
+ if (siblingKeys.length > 0 && siblingKeys.every(
22762
+ (key) => newModelValue.includes(key)
22763
+ )) {
22764
+ if (!newModelValue.includes(parentKey)) {
22765
+ newModelValue.push(parentKey);
22766
+ }
22767
+ } else {
22768
+ newModelValue = newModelValue.filter(
22769
+ (key) => key !== parentKey
22770
+ );
22771
+ }
22772
+ }
22773
+ }
22774
+ } else {
22775
+ newModelValue = props2.__key;
22776
+ }
22777
+ modelValue2.value = newModelValue;
22778
+ emit2("change");
22779
+ };
22780
+ const expand = async () => {
22781
+ if (!props2.isLeaf) {
22782
+ const index2 = expandKeys.value.indexOf(props2.__key);
22783
+ if (index2 > -1) {
22784
+ expandKeys.value.splice(index2, 1);
22785
+ } else if (loadMethod && !loading.value && !loaded.value) {
22786
+ loading.value = true;
22787
+ let _tree = await loadMethod(
22788
+ cloneDeep({
22789
+ ...props2,
22790
+ key: props2.__key,
22791
+ value: props2.__key,
22792
+ extend: props2.extend
22793
+ })
22794
+ ) || [];
22795
+ const { status, result, error: error2 } = await transformTree({
22796
+ dataSource: _tree,
22797
+ keyField,
22798
+ labelField,
22799
+ free
22800
+ });
22801
+ if (status === "success") {
22802
+ loaded.value = true;
22803
+ insertChildByKey(
22804
+ _dataSource.value,
22805
+ props2.__key,
22806
+ result
22807
+ );
22808
+ _dataSource.value = formatTree({
22809
+ dataSource: _dataSource.value,
22810
+ keyField,
22811
+ labelField,
22812
+ free
22813
+ });
22814
+ cacheDataSource.value = cloneDeep(_dataSource.value);
22815
+ console.log(_dataSource.value, "lew-tree-item");
22816
+ expandKeys.value = [
22817
+ ...expandKeys.value,
22818
+ props2.__key
22819
+ ];
22820
+ } else {
22821
+ loaded.value = false;
22822
+ LewMessage$1.error(error2.message);
22823
+ }
22824
+ loading.value = false;
22825
+ } else {
22826
+ expandKeys.value.push(props2.__key);
22827
+ }
22828
+ }
22829
+ expandKeys.value = cloneDeep(expandKeys.value);
22830
+ emit2("expand");
22831
+ };
22832
+ const isNodeSelected = computed(() => {
22833
+ if (multiple) {
22834
+ return modelValue2.value.includes(props2.__key);
22835
+ } else {
22836
+ return modelValue2.value === props2.__key;
22837
+ }
22736
22838
  });
22839
+ const isNodePartiallySelected = computed(() => {
22840
+ if (!multiple || free) return false;
22841
+ return props2.extend && areSomeChildrenSelected(props2.extend);
22842
+ });
22843
+ return (_ctx, _cache) => {
22844
+ return openBlock(), createElementBlock(Fragment, null, [
22845
+ createElementVNode("div", {
22846
+ class: normalizeClass(["lew-tree-item", {
22847
+ "lew-tree-item-expand-all": unref(expandAll),
22848
+ "lew-tree-item-expand": (unref(expandKeys) || []).includes(_ctx.__key),
22849
+ "lew-tree-item-certain": unref(isNodePartiallySelected),
22850
+ "lew-tree-item-selected": unref(isNodeSelected),
22851
+ "lew-tree-item-leaf": _ctx.isLeaf,
22852
+ "lew-tree-item-disabled": _ctx.disabled
22853
+ }])
22854
+ }, [
22855
+ createElementVNode("div", {
22856
+ onClick: withModifiers(expand, ["stop"]),
22857
+ class: "lew-tree-chevron-right"
22858
+ }, [
22859
+ unref(loading) ? (openBlock(), createBlock(Icon, {
22860
+ key: 0,
22861
+ size: 14,
22862
+ loading: "",
22863
+ class: "lew-cascader-loading-icon",
22864
+ type: "loader"
22865
+ })) : (openBlock(), createBlock(Icon, {
22866
+ key: 1,
22867
+ class: "lew-tree-chevron-right-icon",
22868
+ size: 14,
22869
+ type: "chevron-right"
22870
+ }))
22871
+ ]),
22872
+ createElementVNode("div", {
22873
+ class: "lew-tree-item-label",
22874
+ onClick: select
22875
+ }, [
22876
+ unref(checkable) ? (openBlock(), createBlock(unref(LewCheckbox), {
22877
+ key: 0,
22878
+ certain: unref(isNodePartiallySelected),
22879
+ checked: unref(isNodeSelected),
22880
+ class: "lew-tree-checkbox"
22881
+ }, null, 8, ["certain", "checked"])) : createCommentVNode("", true),
22882
+ _ctx.$slots.item ? renderSlot(_ctx.$slots, "item", {
22883
+ key: 1,
22884
+ props: {
22885
+ ...props2,
22886
+ checked: unref(isNodeSelected),
22887
+ certain: unref(isNodePartiallySelected)
22888
+ }
22889
+ }, void 0, true) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
22890
+ _ctx.render() ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.render()), {
22891
+ key: 0,
22892
+ class: "lew-tree-item-text"
22893
+ })) : (openBlock(), createBlock(unref(LewTextTrim), {
22894
+ key: 1,
22895
+ class: "lew-tree-item-text",
22896
+ placement: "right",
22897
+ text: _ctx.label,
22898
+ delay: [250, 250]
22899
+ }, null, 8, ["text"]))
22900
+ ], 64))
22901
+ ])
22902
+ ], 2),
22903
+ !_ctx.isLeaf ? (openBlock(), createBlock(unref(LewCollapseTransition), { key: 0 }, {
22904
+ default: withCtx(() => [
22905
+ (unref(expandKeys) || []).length > 0 && unref(expandKeys).includes(_ctx.__key) || unref(expandAll) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
22906
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
22907
+ ])) : createCommentVNode("", true)
22908
+ ]),
22909
+ _: 3
22910
+ })) : createCommentVNode("", true)
22911
+ ], 64);
22912
+ };
22737
22913
  }
22738
- return {
22739
- newTree: tree,
22740
- newTreeList: flattenTree(tree)
22741
- };
22742
- };
22743
- const _hoisted_1$a = ["onClick"];
22744
- const _hoisted_2$7 = ["onClick"];
22745
- const _hoisted_3$6 = {
22914
+ });
22915
+ const LewTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-85641b32"]]);
22916
+ const _hoisted_1$a = {
22746
22917
  key: 0,
22747
- class: "lew-tree-line"
22918
+ class: "lew-result-count"
22748
22919
  };
22749
- const _hoisted_4$3 = { key: 3 };
22920
+ const DEBOUNCE_TIME = 250;
22750
22921
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
22751
22922
  __name: "LewTree",
22752
22923
  props: /* @__PURE__ */ mergeModels(treeProps, {
22753
- "modelValue": {
22754
- default: void 0
22755
- },
22924
+ "modelValue": {},
22756
22925
  "modelModifiers": {},
22757
- "expandedKeys": {
22758
- default: []
22759
- },
22760
- "expandedKeysModifiers": {}
22926
+ "expandKeys": { required: false, default: [] },
22927
+ "expandKeysModifiers": {}
22761
22928
  }),
22762
- emits: /* @__PURE__ */ mergeModels(["change", "initStart", "initEnd"], ["update:modelValue", "update:expandedKeys"]),
22929
+ emits: /* @__PURE__ */ mergeModels(["change", "expand", "loadStart", "loadEnd"], ["update:modelValue", "update:expandKeys"]),
22763
22930
  setup(__props2, { expose: __expose2, emit: __emit2 }) {
22764
- var _a;
22765
- const app2 = (_a = getCurrentInstance()) == null ? void 0 : _a.appContext.app;
22766
- if (app2 && !app2.directive("loading")) {
22767
- app2.use(LewLoading);
22768
- }
22769
22931
  const props2 = __props2;
22770
- const emit2 = __emit2;
22771
22932
  const modelValue2 = useModel(__props2, "modelValue");
22772
- const expandedKeys = useModel(
22773
- __props2,
22774
- "expandedKeys"
22775
- );
22776
- const certainKeys = ref([]);
22777
- const loadingKeys = ref([]);
22933
+ const expandKeys = useModel(__props2, "expandKeys");
22934
+ const _dataSource = ref([]);
22778
22935
  const loading = ref(false);
22779
- const treeList = ref([]);
22780
- let treeBackup = [];
22781
- const init = async (keyword = "") => {
22782
- let _treeList = [];
22936
+ const keyword = ref("");
22937
+ const lastSearchKeyword = ref("");
22938
+ const searchTimer = ref(null);
22939
+ const cacheDataSource = ref([]);
22940
+ provide("lew-tree", {
22941
+ modelValue: modelValue2,
22942
+ expandKeys,
22943
+ multiple: props2.multiple,
22944
+ checkable: props2.checkable,
22945
+ expandAll: props2.expandAll,
22946
+ free: props2.free,
22947
+ showLine: props2.showLine,
22948
+ loadMethod: props2.loadMethod,
22949
+ keyField: props2.keyField,
22950
+ labelField: props2.labelField,
22951
+ cacheDataSource,
22952
+ _dataSource
22953
+ });
22954
+ const renderMenuTreeItem = (item, level = 0) => {
22955
+ const { disabled, label, key, isLeaf, children } = item;
22956
+ return h(
22957
+ LewTreeItem,
22958
+ {
22959
+ label,
22960
+ key,
22961
+ __key: key,
22962
+ level,
22963
+ isLeaf: isLeaf !== void 0 ? isLeaf : (children || []).length === 0,
22964
+ disabled,
22965
+ extend: item,
22966
+ onChange: () => emit2("change", cloneDeep({ extend: item, key, value: key })),
22967
+ onExpand: () => emit2("expand", cloneDeep({ extend: item, key, value: key }))
22968
+ },
22969
+ () => (item.children || []).map(
22970
+ (child) => renderMenuTreeItem(child, level + 1)
22971
+ )
22972
+ );
22973
+ };
22974
+ const emit2 = __emit2;
22975
+ const init = async (searchKeyword = "") => {
22976
+ if (searchKeyword === "" && cacheDataSource.value.length > 0) {
22977
+ _dataSource.value = cacheDataSource.value;
22978
+ emit2("loadEnd", getResultText.value);
22979
+ return;
22980
+ }
22783
22981
  if (!props2.isSelect) {
22784
22982
  loading.value = true;
22785
22983
  }
22786
- emit2("initStart");
22984
+ emit2("loadStart");
22985
+ lastSearchKeyword.value = searchKeyword;
22787
22986
  const { dataSource, initTree, keyField, labelField, free } = props2;
22788
- const { newTreeList, newTree } = await tree2List({
22987
+ const { status, result, error: error2 } = await transformTree({
22789
22988
  initTree,
22790
22989
  dataSource,
22791
22990
  keyField,
22792
22991
  labelField,
22793
22992
  free,
22794
- keyword
22993
+ keyword: searchKeyword
22795
22994
  });
22796
- treeBackup = newTree;
22797
- _treeList = newTreeList;
22798
- treeList.value = _treeList;
22799
- expandedKeys.value = [];
22800
- certainKeys.value = [];
22801
- loadingKeys.value = [];
22802
- loading.value = false;
22803
- emit2("initEnd");
22804
- return _treeList;
22805
- };
22806
- init();
22807
- const expandHandle = async (item) => {
22808
- if (props2.expandAll || item.isLeaf) {
22995
+ if (lastSearchKeyword.value !== searchKeyword) {
22996
+ loading.value = false;
22809
22997
  return;
22810
22998
  }
22811
- let _expandedKeys = cloneDeep(expandedKeys.value || []);
22812
- let i = _expandedKeys.findIndex((e) => e === item.key);
22813
- if (i >= 0) {
22814
- _expandedKeys.splice(i, 1);
22815
- expandedKeys.value = _expandedKeys;
22816
- } else if (props2.loadMethod && !loadingKeys.value.includes(item.key)) {
22817
- const index2 = treeList.value.findIndex(
22818
- (e) => e.parentKey === item.key
22819
- );
22820
- if (index2 < 0) {
22821
- loadingKeys.value.push(item.key);
22822
- let _tree = await props2.loadMethod(cloneDeep(item)) || [];
22823
- insertChildByKey(treeBackup, item.key, _tree);
22824
- const { newTree, newTreeList } = await tree2List({
22825
- dataSource: treeBackup,
22826
- keyField: props2.keyField,
22827
- labelField: props2.labelField,
22828
- free: props2.free
22829
- });
22830
- treeBackup = newTree;
22831
- treeList.value = newTreeList;
22832
- const i2 = loadingKeys.value.findIndex((e) => e === item.key);
22833
- if (i2 >= 0) {
22834
- loadingKeys.value.splice(i2, 1);
22835
- }
22999
+ if (status === "success") {
23000
+ _dataSource.value = result;
23001
+ if (searchKeyword === "" && cacheDataSource.value.length === 0) {
23002
+ cacheDataSource.value = cloneDeep(result);
22836
23003
  }
22837
- expandedKeys.value = [
22838
- ...expandedKeys.value,
22839
- item.key
22840
- ];
22841
23004
  } else {
22842
- expandedKeys.value = [..._expandedKeys, item.key];
23005
+ LewMessage.error(error2.message);
22843
23006
  }
23007
+ expandKeys.value = cloneDeep(expandKeys.value);
23008
+ modelValue2.value = cloneDeep(modelValue2.value);
23009
+ loading.value = false;
23010
+ emit2("loadEnd", getResultText.value);
22844
23011
  };
22845
- const insertChildByKey = (tree, key, newChild) => {
22846
- const index2 = findIndex$1(tree, (node) => node.key === key);
22847
- if (index2 !== -1) {
22848
- tree[index2].children = newChild;
22849
- } else {
22850
- forEach$1(tree, (node) => {
22851
- insertChildByKey(node.children, key, newChild);
22852
- });
22853
- }
23012
+ const reset = () => {
23013
+ _dataSource.value = cloneDeep(cacheDataSource.value);
23014
+ emit2("loadEnd", getResultText.value);
22854
23015
  };
22855
- const select = (item) => {
22856
- let _modelValue = cloneDeep(modelValue2.value) || [];
22857
- if (props2.multiple && isArray$1(_modelValue)) {
22858
- if (_modelValue && isArray$1(_modelValue) && _modelValue.includes(item.key)) {
22859
- const i = _modelValue.findIndex((e) => e === item.key);
22860
- _modelValue.splice(i, 1);
22861
- if (!props2.free) {
22862
- _modelValue = uniq(
22863
- difference(_modelValue, item.allNodeValues)
22864
- );
22865
- }
22866
- } else {
22867
- _modelValue && _modelValue.push(item.key);
22868
- if (!props2.free && isArray$1(_modelValue)) {
22869
- _modelValue = uniq([..._modelValue, ...item.allNodeValues]);
22870
- }
22871
- }
22872
- if (!props2.free) {
22873
- const { __certainKeys, __modelValue } = formatValues({
22874
- tree: treeList.value,
22875
- values: _modelValue
22876
- });
22877
- certainKeys.value = __certainKeys;
22878
- modelValue2.value = __modelValue;
22879
- } else {
22880
- modelValue2.value = _modelValue;
22881
- }
22882
- } else {
22883
- modelValue2.value = modelValue2.value === item.key ? "" : item.key;
22884
- }
22885
- emit2("change", { item, value: modelValue2.value });
22886
- };
22887
- const formatValues = ({ tree, values }) => {
22888
- let _modelValue = new Set(values);
22889
- let _certainKeys = new Set(values);
22890
- const stack = cloneDeep(tree);
22891
- while (stack.length > 0) {
22892
- const currentNode = stack.pop();
22893
- const key = currentNode.key;
22894
- const childValues = currentNode.leafNodeValues || [];
22895
- const isAllChildValuesInValues = childValues.every(
22896
- (value) => _modelValue.has(value)
22897
- );
22898
- if (!isAllChildValuesInValues && childValues.length > 0) {
22899
- _modelValue.delete(key);
22900
- } else if (childValues.length > 0) {
22901
- _modelValue.add(key);
22902
- }
22903
- const array1 = Array.from(childValues);
22904
- const array2 = Array.from(_modelValue);
22905
- if (intersection(array1, array2).length > 0 && !_modelValue.has(key)) {
22906
- _certainKeys.add(key);
22907
- } else {
22908
- _certainKeys.delete(key);
22909
- }
23016
+ const search = (keyword2) => {
23017
+ if (searchTimer.value !== null) {
23018
+ clearTimeout(searchTimer.value);
22910
23019
  }
22911
- return {
22912
- __certainKeys: Array.from(_certainKeys),
22913
- __modelValue: Array.from(_modelValue)
22914
- };
23020
+ searchTimer.value = setTimeout(() => {
23021
+ init(keyword2);
23022
+ searchTimer.value = null;
23023
+ }, DEBOUNCE_TIME);
22915
23024
  };
22916
- const getTreeList = () => {
22917
- return cloneDeep(treeList.value);
22918
- };
22919
- __expose2({ init, getTreeList });
23025
+ const getResultText = computed(() => {
23026
+ return _dataSource.value.length > 0 ? `共 ${numFormat(_dataSource.value.length)} 条结果` : "";
23027
+ });
23028
+ __expose2({
23029
+ search,
23030
+ reset,
23031
+ getTree: () => _dataSource.value
23032
+ });
23033
+ onMounted(() => {
23034
+ init();
23035
+ });
22920
23036
  return (_ctx, _cache) => {
23037
+ const _component_lew_input = resolveComponent("lew-input");
23038
+ const _component_lew_empty = resolveComponent("lew-empty");
22921
23039
  const _directive_loading = resolveDirective("loading");
22922
- return withDirectives((openBlock(), createElementBlock("div", {
22923
- style: normalizeStyle({
22924
- minHeight: unref(loading) ? "250px" : ""
22925
- })
22926
- }, [
22927
- unref(treeList) && unref(treeList).length > 0 && !unref(loading) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(treeList), (item, index2) => {
22928
- return openBlock(), createBlock(unref(LewFlex), {
22929
- key: index2,
23040
+ return withDirectives((openBlock(), createBlock(unref(LewFlex), {
23041
+ direction: "y",
23042
+ gap: "0",
23043
+ class: "lew-tree-wrapper"
23044
+ }, {
23045
+ default: withCtx(() => [
23046
+ _ctx.searchable && !_ctx.isSelect ? (openBlock(), createBlock(unref(LewFlex), {
23047
+ key: 0,
22930
23048
  direction: "y",
22931
- gap: "0px",
22932
- x: "start"
23049
+ gap: "0",
23050
+ class: "lew-tree-header"
22933
23051
  }, {
22934
23052
  default: withCtx(() => [
22935
- _ctx.expandAll || item.level === 0 || (expandedKeys.value || []).includes(item.parentKey) && unref(intersection)(item.parentKeyPaths, expandedKeys.value).length === (item.parentKeyPaths || []).length ? (openBlock(), createElementBlock("div", {
22936
- key: 0,
22937
- class: normalizeClass(["lew-tree-item", {
22938
- "lew-tree-item-expand-all": _ctx.expandAll,
22939
- "lew-tree-item-expand": (expandedKeys.value || []).includes(item.key),
22940
- "lew-tree-item-certain": _ctx.multiple && unref(certainKeys).includes(item.key) && !(modelValue2.value || []).includes(item.key),
22941
- "lew-tree-item-selected": _ctx.multiple ? (modelValue2.value || []).includes(item.key) : modelValue2.value === item.key,
22942
- "lew-tree-item-leaf": item.isLeaf,
22943
- "lew-tree-item-disabled": item.disabled
22944
- }]),
22945
- style: normalizeStyle({
22946
- paddingLeft: `${item.level * 26}px`
22947
- })
22948
- }, [
22949
- createElementVNode("div", {
22950
- class: "lew-tree-chevron-right",
22951
- onClick: withModifiers(($event) => expandHandle(item), ["stop"])
22952
- }, [
22953
- unref(loadingKeys).includes(item.key) ? (openBlock(), createBlock(Icon, {
22954
- key: 0,
22955
- size: 14,
22956
- loading: "",
22957
- class: "lew-cascader-loading-icon",
22958
- type: "loader"
22959
- })) : (openBlock(), createBlock(Icon, {
22960
- key: 1,
22961
- class: "lew-tree-chevron-right-icon",
22962
- size: 14,
22963
- type: "chevron-right"
22964
- }))
22965
- ], 8, _hoisted_1$a),
22966
- createElementVNode("div", {
22967
- class: "lew-tree-item-label",
22968
- onClick: ($event) => select(item)
22969
- }, [
22970
- item.level > 0 && _ctx.showLine ? (openBlock(), createElementBlock("div", _hoisted_3$6)) : createCommentVNode("", true),
22971
- _ctx.showCheckbox ? (openBlock(), createBlock(unref(LewCheckbox), {
22972
- key: 1,
22973
- certain: _ctx.multiple && unref(certainKeys).includes(item.key) && !(modelValue2.value || []).includes(item.key),
22974
- checked: _ctx.multiple ? (modelValue2.value || []).includes(item.key) : modelValue2.value === item.key,
22975
- class: "lew-tree-checkbox"
22976
- }, null, 8, ["certain", "checked"])) : createCommentVNode("", true),
22977
- _ctx.$slots.item ? renderSlot(_ctx.$slots, "item", {
22978
- key: 2,
22979
- props: {
22980
- ...item,
22981
- checked: _ctx.multiple ? (modelValue2.value || []).includes(item.key) : modelValue2.value === item.key
22982
- }
22983
- }, void 0, true) : (openBlock(), createElementBlock("span", _hoisted_4$3, toDisplayString$1(item.label), 1))
22984
- ], 8, _hoisted_2$7)
22985
- ], 6)) : createCommentVNode("", true)
23053
+ createVNode(_component_lew_input, {
23054
+ width: "100%",
23055
+ modelValue: unref(keyword),
23056
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(keyword) ? keyword.value = $event : null),
23057
+ size: "small",
23058
+ placeholder: "搜索",
23059
+ onInput: _cache[1] || (_cache[1] = ($event) => search(unref(keyword)))
23060
+ }, null, 8, ["modelValue"]),
23061
+ _ctx.searchable && unref(getResultText) ? (openBlock(), createElementBlock("div", _hoisted_1$a, toDisplayString$1(unref(getResultText)), 1)) : createCommentVNode("", true)
23062
+ ]),
23063
+ _: 1
23064
+ })) : createCommentVNode("", true),
23065
+ unref(_dataSource) && unref(_dataSource).length === 0 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
23066
+ _ctx.$slots.empty ? renderSlot(_ctx.$slots, "empty", { key: 0 }, void 0, true) : (openBlock(), createBlock(unref(LewFlex), {
23067
+ key: 1,
23068
+ direction: "y",
23069
+ x: "center",
23070
+ class: "lew-not-found"
23071
+ }, {
23072
+ default: withCtx(() => [
23073
+ createVNode(_component_lew_empty, { title: "暂无结果" })
23074
+ ]),
23075
+ _: 1
23076
+ }))
23077
+ ], 64)) : createCommentVNode("", true),
23078
+ createVNode(unref(LewFlex), {
23079
+ direction: "y",
23080
+ y: "start",
23081
+ gap: "0",
23082
+ class: normalizeClass(["lew-tree lew-scrollbar", { "lew-tree-line": _ctx.showLine }]),
23083
+ style: normalizeStyle({ height: unref(any2px)(_ctx.height) })
23084
+ }, {
23085
+ default: withCtx(() => [
23086
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(_dataSource), (item) => {
23087
+ return openBlock(), createBlock(resolveDynamicComponent(renderMenuTreeItem(item)), {
23088
+ key: item.key
23089
+ });
23090
+ }), 128))
22986
23091
  ]),
22987
- _: 2
22988
- }, 1024);
22989
- }), 128)) : !unref(loading) ? (openBlock(), createBlock(unref(LewFlex), { key: 1 }, {
22990
- default: withCtx(() => [
22991
- _ctx.$slots.empty ? renderSlot(_ctx.$slots, "empty", { key: 0 }, void 0, true) : (openBlock(), createBlock(unref(_sfc_main$2), { key: 1 }))
22992
- ]),
22993
- _: 3
22994
- })) : createCommentVNode("", true)
22995
- ], 4)), [
22996
- [_directive_loading, { visible: unref(loading) }]
23092
+ _: 1
23093
+ }, 8, ["class", "style"])
23094
+ ]),
23095
+ _: 3
23096
+ })), [
23097
+ [_directive_loading, {
23098
+ visible: unref(loading),
23099
+ text: "加载中..."
23100
+ }]
22997
23101
  ]);
22998
23102
  };
22999
23103
  }
23000
23104
  });
23001
- const LewTree = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-fd444c1f"]]);
23105
+ const LewTree = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-11fe5966"]]);
23002
23106
  const collapseModel = {
23003
23107
  modelValue: {
23004
23108
  type: [Array, String],
@@ -23874,7 +23978,7 @@ const _hoisted_3$5 = {
23874
23978
  key: 1,
23875
23979
  class: "lew-alert-title"
23876
23980
  };
23877
- const _hoisted_4$2 = {
23981
+ const _hoisted_4$3 = {
23878
23982
  key: 2,
23879
23983
  class: "lew-alert-content"
23880
23984
  };
@@ -23910,7 +24014,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
23910
24014
  _ctx.$slots.title ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
23911
24015
  renderSlot(_ctx.$slots, "title", {}, void 0, true)
23912
24016
  ])) : (openBlock(), createElementBlock("div", _hoisted_3$5, toDisplayString$1(_ctx.title), 1)),
23913
- _ctx.$slots.content ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
24017
+ _ctx.$slots.content ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
23914
24018
  renderSlot(_ctx.$slots, "content", {}, void 0, true)
23915
24019
  ])) : _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_5$1, toDisplayString$1(_ctx.content), 1)) : createCommentVNode("", true),
23916
24020
  _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6, [
@@ -24266,7 +24370,7 @@ const _hoisted_3$3 = {
24266
24370
  key: 0,
24267
24371
  class: "lew-popok-title"
24268
24372
  };
24269
- const _hoisted_4$1 = {
24373
+ const _hoisted_4$2 = {
24270
24374
  key: 1,
24271
24375
  class: "lew-popok-content"
24272
24376
  };
@@ -24322,7 +24426,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
24322
24426
  ]),
24323
24427
  createElementVNode("div", _hoisted_2$3, [
24324
24428
  _ctx.title ? (openBlock(), createElementBlock("div", _hoisted_3$3, toDisplayString$1(_ctx.title), 1)) : createCommentVNode("", true),
24325
- _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_4$1, toDisplayString$1(_ctx.content), 1)) : createCommentVNode("", true),
24429
+ _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_4$2, toDisplayString$1(_ctx.content), 1)) : createCommentVNode("", true),
24326
24430
  createElementVNode("div", _hoisted_5, [
24327
24431
  createVNode(unref(LewButton), mergeProps({
24328
24432
  text: "取消",
@@ -25035,7 +25139,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
25035
25139
  LewAlert,
25036
25140
  LewAvatar,
25037
25141
  LewBackTop,
25038
- LewBadge: _sfc_main$Z,
25142
+ LewBadge: _sfc_main$_,
25039
25143
  LewBreadcrumb,
25040
25144
  LewButton,
25041
25145
  LewCascader,
@@ -25052,7 +25156,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
25052
25156
  LewDesc,
25053
25157
  LewDescItem,
25054
25158
  LewDrawer: _sfc_main$4,
25055
- LewDropdown: _sfc_main$O,
25159
+ LewDropdown: _sfc_main$P,
25056
25160
  LewEmpty: _sfc_main$2,
25057
25161
  LewExpand,
25058
25162
  LewFlex,
@@ -25078,11 +25182,11 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
25078
25182
  LewSelectMultiple,
25079
25183
  LewSlider,
25080
25184
  LewSliderRange,
25081
- LewSteps: _sfc_main$S,
25185
+ LewSteps: _sfc_main$T,
25082
25186
  LewSwitch,
25083
- LewTable: _sfc_main$g,
25187
+ LewTable: _sfc_main$h,
25084
25188
  LewTabs,
25085
- LewTag: _sfc_main$_,
25189
+ LewTag: _sfc_main$$,
25086
25190
  LewTextTrim,
25087
25191
  LewTextarea,
25088
25192
  LewTitle,
@@ -25117,6 +25221,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
25117
25221
  descProps,
25118
25222
  drawerModel,
25119
25223
  drawerProps,
25224
+ dropdownModel,
25120
25225
  dropdownProps,
25121
25226
  emptyProps,
25122
25227
  expandProps,
@@ -25137,7 +25242,6 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
25137
25242
  markProps,
25138
25243
  menuModel,
25139
25244
  menuProps,
25140
- menuTreeItemModel,
25141
25245
  menuTreeItemProps,
25142
25246
  menuTreeModel,
25143
25247
  menuTreeProps,
@@ -25162,8 +25266,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
25162
25266
  sliderProps,
25163
25267
  sliderRangeModel,
25164
25268
  sliderRangeProps,
25165
- statusColorMap,
25166
- statusMap,
25269
+ statusConfig,
25167
25270
  stepsModel,
25168
25271
  stepsProps,
25169
25272
  switchModel,
@@ -25178,6 +25281,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
25178
25281
  textareaProps,
25179
25282
  tipsIconSizeMap,
25180
25283
  titleProps,
25284
+ treeItemProps,
25181
25285
  treeModel,
25182
25286
  treeProps,
25183
25287
  treeSelectModel,
@@ -25315,33 +25419,21 @@ const LewLoading = {
25315
25419
  const initLewContextMenu = () => {
25316
25420
  window.LewContextMenu = {
25317
25421
  menu: {},
25318
- // 存储菜单配置
25319
- disabledIds: [],
25320
- // 禁用右键菜单的元素ID
25321
25422
  contextMenu: null,
25322
- // 右键菜单事件处理函数
25323
25423
  instance: tippy(document.body, {
25324
25424
  theme: "light",
25325
25425
  animation: "shift-away-subtle",
25326
25426
  trigger: "manual",
25327
- // 手动触发
25328
25427
  interactive: true,
25329
- // 允许与菜单交互
25330
25428
  placement: "right-start",
25331
- // 菜单出现位置
25332
25429
  duration: [250, 250],
25333
- // 动画持续时间
25334
25430
  delay: [250, 0],
25335
- // 显示和隐藏的延迟
25336
25431
  arrow: false,
25337
- // 不显示箭头
25338
25432
  appendTo: () => document.body,
25339
- // 添加到body
25340
- allowHTML: true
25341
- // 允许HTML内容
25433
+ allowHTML: true,
25434
+ zIndex: 2e3
25342
25435
  }),
25343
25436
  menuInstance: {}
25344
- // 存储子菜单实例
25345
25437
  };
25346
25438
  window.LewContextMenu.instance.popper.children[0].setAttribute(
25347
25439
  "data-lew",
@@ -25357,52 +25449,55 @@ const findContextMenuId = (el) => {
25357
25449
  return "";
25358
25450
  }
25359
25451
  };
25452
+ const createContextMenu = (options, onSelect) => {
25453
+ const menuDom = document.createElement("div");
25454
+ createApp({
25455
+ render() {
25456
+ return h(_LewContextMenu, { options, onSelect });
25457
+ }
25458
+ }).mount(menuDom);
25459
+ return menuDom;
25460
+ };
25360
25461
  const LewVContextMenu = {
25361
25462
  install(app2) {
25362
25463
  app2.directive("context-menu", {
25363
- // 指令挂载时的处理
25364
25464
  mounted(el, binding) {
25365
25465
  if (!window.LewContextMenu) {
25366
25466
  initLewContextMenu();
25367
25467
  }
25368
- let elId = el.id;
25369
- if (!elId) {
25370
- elId = getUniqueId();
25371
- el.setAttribute("lew-context-menu-id", elId);
25372
- const { options } = binding.value;
25373
- window.LewContextMenu.menu[elId] = options || [];
25374
- }
25375
- const { disabled } = binding.value;
25376
- if (disabled) {
25377
- window.LewContextMenu.disabledIds.push(elId);
25378
- }
25468
+ const {
25469
+ options = [],
25470
+ disabled = false,
25471
+ selectHandler = () => {
25472
+ }
25473
+ } = binding.value;
25474
+ const elId = el.id || getUniqueId();
25475
+ el.setAttribute("lew-context-menu-id", elId);
25476
+ window.LewContextMenu.menu[elId] = { options, selectHandler, disabled };
25379
25477
  if (!window.LewContextMenu.contextMenu) {
25380
25478
  window.LewContextMenu.contextMenu = (e) => {
25381
25479
  const id = findContextMenuId(e.target);
25382
- if (window.LewContextMenu.disabledIds.includes(id) || !id) {
25383
- return;
25384
- }
25480
+ const menuConfig = window.LewContextMenu.menu[id];
25481
+ if (!id || (menuConfig == null ? void 0 : menuConfig.disabled)) return;
25385
25482
  e.preventDefault();
25386
- const options = window.LewContextMenu.menu[id];
25387
25483
  const { instance } = window.LewContextMenu;
25388
25484
  instance.hide();
25389
- const menuDom = document.createElement("div");
25390
- createApp({
25391
- render() {
25392
- return h(_LewContextMenu, {
25393
- options,
25394
- onSelect: (item) => {
25395
- const { selectHandler } = binding.value;
25396
- if (isFunction$1(selectHandler)) {
25397
- selectHandler(item);
25398
- }
25399
- if (!(item.children || []).length) {
25400
- instance.hide();
25401
- }
25402
- }
25403
- });
25485
+ const menuDom = createContextMenu(
25486
+ menuConfig.options,
25487
+ ({ item, parent, value }) => {
25488
+ if (isFunction$1(menuConfig.selectHandler)) {
25489
+ menuConfig.selectHandler({
25490
+ item,
25491
+ parent,
25492
+ value,
25493
+ menuConfig
25494
+ });
25495
+ }
25496
+ if (!(item.children || []).length) {
25497
+ instance.hide();
25498
+ }
25404
25499
  }
25405
- }).mount(menuDom);
25500
+ );
25406
25501
  setTimeout(() => {
25407
25502
  instance.setProps({
25408
25503
  content: menuDom,
@@ -25418,27 +25513,31 @@ const LewVContextMenu = {
25418
25513
  instance.show();
25419
25514
  }, 120);
25420
25515
  };
25421
- window.addEventListener("contextmenu", (e) => {
25422
- window.LewContextMenu.contextMenu(e, "contextmenu");
25423
- });
25516
+ window.addEventListener(
25517
+ "contextmenu",
25518
+ window.LewContextMenu.contextMenu
25519
+ );
25424
25520
  }
25425
25521
  },
25426
- // 指令更新时的处理
25427
25522
  updated(el, binding) {
25428
25523
  const id = findContextMenuId(el);
25429
25524
  if (id) {
25430
- const { options, disabled } = binding.value;
25431
- window.LewContextMenu.menu[id] = options || [];
25432
- if (disabled) {
25433
- window.LewContextMenu.disabledIds.push(id);
25434
- } else {
25435
- window.LewContextMenu.disabledIds = window.LewContextMenu.disabledIds.filter(
25436
- (item) => item !== id
25437
- );
25438
- }
25525
+ const {
25526
+ options = [],
25527
+ disabled = false,
25528
+ selectHandler = () => {
25529
+ }
25530
+ } = binding.value;
25531
+ window.LewContextMenu.menu[id] = { options, disabled, selectHandler };
25439
25532
  } else {
25440
25533
  console.error("发生未知错误!找不到 lew-context-menu-id。");
25441
25534
  }
25535
+ },
25536
+ unmounted(el) {
25537
+ const id = findContextMenuId(el);
25538
+ if (id) {
25539
+ delete window.LewContextMenu.menu[id];
25540
+ }
25442
25541
  }
25443
25542
  });
25444
25543
  }
@@ -25462,8 +25561,12 @@ const contextMenuProps = {
25462
25561
  }
25463
25562
  };
25464
25563
  const _hoisted_1$1 = ["onClick"];
25465
- const _hoisted_2$1 = { class: "lew-context-menu-label" };
25466
- const _hoisted_3$1 = { class: "lew-context-menu-label-text" };
25564
+ const _hoisted_2$1 = {
25565
+ key: 0,
25566
+ class: "lew-context-menu-checkbox"
25567
+ };
25568
+ const _hoisted_3$1 = { class: "lew-context-menu-label" };
25569
+ const _hoisted_4$1 = { class: "lew-context-menu-label-text" };
25467
25570
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25468
25571
  __name: "LewContextMenu",
25469
25572
  props: contextMenuProps,
@@ -25471,8 +25574,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25471
25574
  setup(__props2, { emit: __emit2 }) {
25472
25575
  const props2 = __props2;
25473
25576
  const emit2 = __emit2;
25474
- const clickItem = (item) => {
25475
- emit2("select", item);
25577
+ const clickItem = (item, options) => {
25578
+ emit2("select", {
25579
+ item,
25580
+ parent: options,
25581
+ value: item.value
25582
+ });
25476
25583
  };
25477
25584
  const uniqueId2 = getUniqueId();
25478
25585
  let itemRefs = ref([]);
@@ -25487,8 +25594,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25487
25594
  render() {
25488
25595
  return h(_LewContextMenu, {
25489
25596
  options: item.children,
25490
- onSelect: (item2) => {
25491
- emit2("select", item2);
25597
+ onSelect: (e) => {
25598
+ emit2("select", e);
25492
25599
  }
25493
25600
  });
25494
25601
  }
@@ -25546,24 +25653,36 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25546
25653
  createElementVNode("div", {
25547
25654
  ref_for: true,
25548
25655
  ref: (el) => unref(itemRefs).push(el),
25549
- onClick: ($event) => clickItem(item),
25656
+ onClick: ($event) => clickItem(item, _ctx.options),
25550
25657
  class: normalizeClass(["lew-context-menu-item", {
25551
25658
  "lew-context-menu-item-active": item.active
25552
25659
  }]),
25553
25660
  style: normalizeStyle({ "animation-delay": index2 * 15 + "ms" })
25554
25661
  }, [
25555
- createElementVNode("div", _hoisted_2$1, [
25662
+ _ctx.options.filter((e) => e.checkbox).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
25663
+ item.checked ? (openBlock(), createBlock(Icon, {
25664
+ key: 0,
25665
+ size: 12,
25666
+ "stroke-width": 2.5,
25667
+ type: "check"
25668
+ })) : createCommentVNode("", true)
25669
+ ])) : createCommentVNode("", true),
25670
+ createElementVNode("div", _hoisted_3$1, [
25556
25671
  item.renderIcon ? (openBlock(), createBlock(renderIcon, {
25557
25672
  key: 0,
25558
25673
  renderIcon: item.renderIcon
25559
25674
  }, null, 8, ["renderIcon"])) : createCommentVNode("", true),
25560
- createElementVNode("div", _hoisted_3$1, toDisplayString$1(item.label), 1)
25675
+ createElementVNode("div", _hoisted_4$1, toDisplayString$1(item.label), 1)
25561
25676
  ]),
25562
- (item.children || []).length > 0 ? (openBlock(), createBlock(Icon, {
25563
- key: 0,
25677
+ _ctx.options.filter((e) => e.children).length > 0 ? (openBlock(), createBlock(Icon, {
25678
+ key: 1,
25679
+ class: "lew-context-menu-item-chevron",
25680
+ style: normalizeStyle({
25681
+ opacity: (item.children || []).length > 0 ? 1 : 0
25682
+ }),
25564
25683
  size: 14,
25565
25684
  type: "chevron-right"
25566
- })) : createCommentVNode("", true)
25685
+ }, null, 8, ["style"])) : createCommentVNode("", true)
25567
25686
  ], 14, _hoisted_1$1)
25568
25687
  ], 2);
25569
25688
  }), 128)) : (openBlock(), createBlock(unref(_sfc_main$2), {
@@ -25580,7 +25699,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25580
25699
  };
25581
25700
  }
25582
25701
  });
25583
- const _LewContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-189cc6df"]]);
25702
+ const _LewContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-31b81ff7"]]);
25584
25703
  const initLewHoverMenu = () => {
25585
25704
  window.LewHoverMenu = {
25586
25705
  menu: {},
@@ -27907,11 +28026,11 @@ const generate = (ast, options = {}) => {
27907
28026
  generator.deindent(needIndent);
27908
28027
  generator.push(`}`);
27909
28028
  delete ast.helpers;
27910
- const { code, map: map2 } = generator.context();
28029
+ const { code, map } = generator.context();
27911
28030
  return {
27912
28031
  ast,
27913
28032
  code,
27914
- map: map2 ? map2.toJSON() : void 0
28033
+ map: map ? map.toJSON() : void 0
27915
28034
  // eslint-disable-line @typescript-eslint/no-explicit-any
27916
28035
  };
27917
28036
  };
@@ -31625,22 +31744,30 @@ if (process.env.NODE_ENV !== "production") ;
31625
31744
  const en = {
31626
31745
  name: "en",
31627
31746
  image: {
31628
- fail: "Image load failed"
31747
+ fail: "Unable to load image, please try again later"
31629
31748
  },
31630
31749
  input: {
31631
31750
  placeholder: "Please input",
31632
31751
  copy: "Copy",
31633
- copySuccess: "Copy success!",
31634
- copyFailed: "Copy failed!"
31752
+ copySuccess: "Copied to clipboard",
31753
+ copyFailed: "Copy failed, please try again"
31635
31754
  },
31636
- textarea: {
31637
- placeholder: "Please input"
31755
+ inputTag: {
31756
+ placeholder: "Press Enter after input to add tag",
31757
+ maxLength: "Reached the limit of {maxLength} tags, delete some tags to continue adding",
31758
+ duplicate: "Tag already exists, please input a new tag"
31638
31759
  },
31639
31760
  select: {
31640
31761
  placeholder: "Please select"
31641
31762
  },
31642
- inputTag: {
31643
- placeholder: "Press Enter to add"
31763
+ selectMultiple: {
31764
+ placeholder: "Please select"
31765
+ },
31766
+ cascader: {
31767
+ placeholder: "Please select"
31768
+ },
31769
+ textarea: {
31770
+ placeholder: "Please input"
31644
31771
  },
31645
31772
  datePicker: {
31646
31773
  Mon: "Mon",
@@ -31650,21 +31777,23 @@ const en = {
31650
31777
  Fri: "Fri",
31651
31778
  Sat: "Sat",
31652
31779
  Sun: "Sun",
31653
- placeholder: "Please select date",
31780
+ placeholder: "Select date"
31781
+ },
31782
+ dateRangePicker: {
31654
31783
  placeholderStart: "Start date",
31655
31784
  placeholderEnd: "End date"
31656
31785
  },
31657
31786
  upload: {
31658
- dropActive: "Drop to upload file",
31659
- click: "Click,",
31660
- paste: "Ctrl + V paste,",
31661
- drag: "Drag file to here",
31662
- accept: "Support {accept}",
31663
- limit: "Upload up to {limit} files",
31664
- maxFileSize: "File size limit {maxFileSize}"
31787
+ dropActive: "Release to start uploading",
31788
+ click: "Click to upload, ",
31789
+ paste: "paste, ",
31790
+ drag: "or drag files here",
31791
+ accept: "Support uploading {accept}",
31792
+ limit: "Maximum {limit} files can be uploaded",
31793
+ maxFileSize: "Single file should not exceed {maxFileSize}"
31665
31794
  },
31666
31795
  pagination: {
31667
- pageSize: "{pageSize} / Page"
31796
+ pageSize: "{pageSize} items/page"
31668
31797
  }
31669
31798
  };
31670
31799
  const zh = {
@@ -31722,6 +31851,391 @@ const zh = {
31722
31851
  pageSize: "{pageSize} 条/页"
31723
31852
  }
31724
31853
  };
31854
+ const ja = {
31855
+ name: "ja",
31856
+ image: {
31857
+ fail: "画像を読み込めませんでした。後でもう一度お試しください。"
31858
+ },
31859
+ input: {
31860
+ placeholder: "入力してください",
31861
+ copy: "コピー",
31862
+ copySuccess: "クリップボードにコピーしました",
31863
+ copyFailed: "コピーに失敗しました。もう一度お試しください"
31864
+ },
31865
+ inputTag: {
31866
+ placeholder: "タグを入力してEnterキーを押してください",
31867
+ maxLength: "タグの上限({maxLength}個)に達しました。新しいタグを追加するには、既存のタグを削除してください",
31868
+ duplicate: "同じタグが既に存在します。別のタグを入力してください"
31869
+ },
31870
+ select: {
31871
+ placeholder: "選択してください"
31872
+ },
31873
+ selectMultiple: {
31874
+ placeholder: "選択してください"
31875
+ },
31876
+ cascader: {
31877
+ placeholder: "選択してください"
31878
+ },
31879
+ textarea: {
31880
+ placeholder: "入力してください"
31881
+ },
31882
+ datePicker: {
31883
+ Mon: "月",
31884
+ Tue: "火",
31885
+ Wed: "水",
31886
+ Thu: "木",
31887
+ Fri: "金",
31888
+ Sat: "土",
31889
+ Sun: "日",
31890
+ placeholder: "日付を選択"
31891
+ },
31892
+ dateRangePicker: {
31893
+ placeholderStart: "開始日",
31894
+ placeholderEnd: "終了日"
31895
+ },
31896
+ upload: {
31897
+ dropActive: "ドロップしてアップロードを開始",
31898
+ click: "クリックして、",
31899
+ paste: "貼り付けて、",
31900
+ drag: "またはファイルをここにドラッグ",
31901
+ accept: "{accept}形式のファイルに対応",
31902
+ limit: "最大{limit}個のファイルをアップロード可能",
31903
+ maxFileSize: "1ファイルあたり{maxFileSize}まで"
31904
+ },
31905
+ pagination: {
31906
+ pageSize: "表示件数:{pageSize}件"
31907
+ }
31908
+ };
31909
+ const ko = {
31910
+ name: "ko",
31911
+ image: {
31912
+ fail: "이미지를 불러올 수 없습니다. 나중에 다시 시도해주세요"
31913
+ },
31914
+ input: {
31915
+ placeholder: "입력해주세요",
31916
+ copy: "복사",
31917
+ copySuccess: "클립보드에 복사되었습니다",
31918
+ copyFailed: "복사에 실패했습니다. 다시 시도해주세요"
31919
+ },
31920
+ inputTag: {
31921
+ placeholder: "태그를 입력하고 Enter를 눌러주세요",
31922
+ maxLength: "태그 {maxLength}개 제한에 도달했습니다. 새로운 태그를 추가하려면 기존 태그를 삭제해주세요",
31923
+ duplicate: "동일한 태그가 이미 존재합니다. 다른 태그를 입력해주세요"
31924
+ },
31925
+ select: {
31926
+ placeholder: "선택해주세요"
31927
+ },
31928
+ selectMultiple: {
31929
+ placeholder: "선택해주세요"
31930
+ },
31931
+ cascader: {
31932
+ placeholder: "선택해주세요"
31933
+ },
31934
+ textarea: {
31935
+ placeholder: "입력해주세요"
31936
+ },
31937
+ datePicker: {
31938
+ Mon: "월",
31939
+ Tue: "화",
31940
+ Wed: "수",
31941
+ Thu: "목",
31942
+ Fri: "금",
31943
+ Sat: "토",
31944
+ Sun: "일",
31945
+ placeholder: "날짜 선택"
31946
+ },
31947
+ dateRangePicker: {
31948
+ placeholderStart: "시작일",
31949
+ placeholderEnd: "종료일"
31950
+ },
31951
+ upload: {
31952
+ dropActive: "파일을 놓으면 업로드가 시작됩니다",
31953
+ click: "클릭하여 업로드",
31954
+ paste: "붙여넣기",
31955
+ drag: "또는 여기에 파일을 끌어다 놓으세요",
31956
+ accept: "{accept} 파일 업로드 가능",
31957
+ limit: "최대 {limit}개의 파일을 업로드할 수 있습니다",
31958
+ maxFileSize: "파일당 {maxFileSize} 이하여야 합니다"
31959
+ },
31960
+ pagination: {
31961
+ pageSize: "페이지당 {pageSize}개"
31962
+ }
31963
+ };
31964
+ const fr = {
31965
+ name: "fr",
31966
+ image: {
31967
+ fail: "Impossible de charger l'image pour le moment, veuillez réessayer plus tard"
31968
+ },
31969
+ input: {
31970
+ placeholder: "Veuillez saisir",
31971
+ copy: "Copier",
31972
+ copySuccess: "Copié dans le presse-papiers",
31973
+ copyFailed: "La copie a échoué, veuillez réessayer"
31974
+ },
31975
+ inputTag: {
31976
+ placeholder: "Saisissez une étiquette et appuyez sur Entrée pour l'ajouter",
31977
+ maxLength: "Vous avez atteint la limite de {maxLength} étiquettes, supprimez-en quelques-unes pour continuer",
31978
+ duplicate: "Cette étiquette existe déjà, veuillez en saisir une nouvelle"
31979
+ },
31980
+ select: {
31981
+ placeholder: "Veuillez sélectionner"
31982
+ },
31983
+ selectMultiple: {
31984
+ placeholder: "Veuillez sélectionner"
31985
+ },
31986
+ cascader: {
31987
+ placeholder: "Veuillez sélectionner"
31988
+ },
31989
+ textarea: {
31990
+ placeholder: "Veuillez saisir"
31991
+ },
31992
+ datePicker: {
31993
+ Mon: "Lun",
31994
+ Tue: "Mar",
31995
+ Wed: "Mer",
31996
+ Thu: "Jeu",
31997
+ Fri: "Ven",
31998
+ Sat: "Sam",
31999
+ Sun: "Dim",
32000
+ placeholder: "Sélectionner une date"
32001
+ },
32002
+ dateRangePicker: {
32003
+ placeholderStart: "Date de début",
32004
+ placeholderEnd: "Date de fin"
32005
+ },
32006
+ upload: {
32007
+ dropActive: "Relâchez pour commencer le téléchargement",
32008
+ click: "Cliquez pour télécharger, ",
32009
+ paste: "collez, ",
32010
+ drag: "ou faites glisser les fichiers ici",
32011
+ accept: "Prend en charge le téléchargement de {accept}",
32012
+ limit: "Vous pouvez télécharger jusqu'à {limit} fichiers",
32013
+ maxFileSize: "Chaque fichier ne doit pas dépasser {maxFileSize}"
32014
+ },
32015
+ pagination: {
32016
+ pageSize: "{pageSize} par page"
32017
+ }
32018
+ };
32019
+ const it = {
32020
+ name: "it",
32021
+ image: {
32022
+ fail: "Impossibile caricare l'immagine, si prega di riprovare più tardi"
32023
+ },
32024
+ input: {
32025
+ placeholder: "Inserisci",
32026
+ copy: "Copia",
32027
+ copySuccess: "Copiato negli appunti",
32028
+ copyFailed: "Copia fallita, si prega di riprovare"
32029
+ },
32030
+ inputTag: {
32031
+ placeholder: "Digita e premi Invio per aggiungere un tag",
32032
+ maxLength: "Hai raggiunto il limite di {maxLength} tag, rimuovine alcuni per continuare",
32033
+ duplicate: "Questo tag esiste già, inserisci un nuovo tag"
32034
+ },
32035
+ select: {
32036
+ placeholder: "Seleziona"
32037
+ },
32038
+ selectMultiple: {
32039
+ placeholder: "Seleziona"
32040
+ },
32041
+ cascader: {
32042
+ placeholder: "Seleziona"
32043
+ },
32044
+ textarea: {
32045
+ placeholder: "Inserisci"
32046
+ },
32047
+ datePicker: {
32048
+ Mon: "Lun",
32049
+ Tue: "Mar",
32050
+ Wed: "Mer",
32051
+ Thu: "Gio",
32052
+ Fri: "Ven",
32053
+ Sat: "Sab",
32054
+ Sun: "Dom",
32055
+ placeholder: "Seleziona data"
32056
+ },
32057
+ dateRangePicker: {
32058
+ placeholderStart: "Data iniziale",
32059
+ placeholderEnd: "Data finale"
32060
+ },
32061
+ upload: {
32062
+ dropActive: "Rilascia per iniziare il caricamento",
32063
+ click: "Clicca per caricare, ",
32064
+ paste: "incolla, ",
32065
+ drag: "o trascina i file qui",
32066
+ accept: "Supporta il caricamento di {accept}",
32067
+ limit: "È possibile caricare un massimo di {limit} file",
32068
+ maxFileSize: "Ogni file non deve superare {maxFileSize}"
32069
+ },
32070
+ pagination: {
32071
+ pageSize: "{pageSize} per pagina"
32072
+ }
32073
+ };
32074
+ const es = {
32075
+ name: "es",
32076
+ image: {
32077
+ fail: "No se puede cargar la imagen, por favor inténtelo de nuevo más tarde"
32078
+ },
32079
+ input: {
32080
+ placeholder: "Por favor, introduzca",
32081
+ copy: "Copiar",
32082
+ copySuccess: "Copiado al portapapeles",
32083
+ copyFailed: "Error al copiar, por favor inténtelo de nuevo"
32084
+ },
32085
+ inputTag: {
32086
+ placeholder: "Escriba y presione Enter para añadir una etiqueta",
32087
+ maxLength: "Ha alcanzado el límite de {maxLength} etiquetas, elimine algunas para continuar añadiendo",
32088
+ duplicate: "Esta etiqueta ya existe, por favor introduzca una nueva"
32089
+ },
32090
+ select: {
32091
+ placeholder: "Por favor, seleccione"
32092
+ },
32093
+ selectMultiple: {
32094
+ placeholder: "Por favor, seleccione"
32095
+ },
32096
+ cascader: {
32097
+ placeholder: "Por favor, seleccione"
32098
+ },
32099
+ textarea: {
32100
+ placeholder: "Por favor, introduzca"
32101
+ },
32102
+ datePicker: {
32103
+ Mon: "Lun",
32104
+ Tue: "Mar",
32105
+ Wed: "Mié",
32106
+ Thu: "Jue",
32107
+ Fri: "Vie",
32108
+ Sat: "Sáb",
32109
+ Sun: "Dom",
32110
+ placeholder: "Seleccionar fecha"
32111
+ },
32112
+ dateRangePicker: {
32113
+ placeholderStart: "Fecha de inicio",
32114
+ placeholderEnd: "Fecha de fin"
32115
+ },
32116
+ upload: {
32117
+ dropActive: "Suelte para comenzar la carga",
32118
+ click: "Haga clic para cargar, ",
32119
+ paste: "pegue, ",
32120
+ drag: "o arrastre archivos aquí",
32121
+ accept: "Admite la carga de {accept}",
32122
+ limit: "Se pueden cargar un máximo de {limit} archivos",
32123
+ maxFileSize: "Cada archivo no debe exceder {maxFileSize}"
32124
+ },
32125
+ pagination: {
32126
+ pageSize: "{pageSize} por página"
32127
+ }
32128
+ };
32129
+ const de = {
32130
+ name: "de",
32131
+ image: {
32132
+ fail: "Bild kann derzeit nicht geladen werden, bitte versuchen Sie es später erneut"
32133
+ },
32134
+ input: {
32135
+ placeholder: "Bitte eingeben",
32136
+ copy: "Kopieren",
32137
+ copySuccess: "In die Zwischenablage kopiert",
32138
+ copyFailed: "Kopieren fehlgeschlagen, bitte versuchen Sie es erneut"
32139
+ },
32140
+ inputTag: {
32141
+ placeholder: "Tag eingeben und Enter drücken zum Hinzufügen",
32142
+ maxLength: "Sie haben das Limit von {maxLength} Tags erreicht, löschen Sie einige, um weitere hinzuzufügen",
32143
+ duplicate: "Dieser Tag existiert bereits, bitte geben Sie einen neuen Tag ein"
32144
+ },
32145
+ select: {
32146
+ placeholder: "Bitte auswählen"
32147
+ },
32148
+ selectMultiple: {
32149
+ placeholder: "Bitte auswählen"
32150
+ },
32151
+ cascader: {
32152
+ placeholder: "Bitte auswählen"
32153
+ },
32154
+ textarea: {
32155
+ placeholder: "Bitte eingeben"
32156
+ },
32157
+ datePicker: {
32158
+ Mon: "Mo",
32159
+ Tue: "Di",
32160
+ Wed: "Mi",
32161
+ Thu: "Do",
32162
+ Fri: "Fr",
32163
+ Sat: "Sa",
32164
+ Sun: "So",
32165
+ placeholder: "Datum auswählen"
32166
+ },
32167
+ dateRangePicker: {
32168
+ placeholderStart: "Startdatum",
32169
+ placeholderEnd: "Enddatum"
32170
+ },
32171
+ upload: {
32172
+ dropActive: "Loslassen, um mit dem Upload zu beginnen",
32173
+ click: "Klicken zum Hochladen, ",
32174
+ paste: "Einfügen, ",
32175
+ drag: "oder Dateien hierher ziehen",
32176
+ accept: "Unterstützt {accept}",
32177
+ limit: "Maximal {limit} Dateien",
32178
+ maxFileSize: "Einzelne Datei nicht größer als {maxFileSize}"
32179
+ },
32180
+ pagination: {
32181
+ pageSize: "{pageSize} pro Seite"
32182
+ }
32183
+ };
32184
+ const pt = {
32185
+ name: "pt",
32186
+ image: {
32187
+ fail: "Não foi possível carregar a imagem, por favor tente novamente mais tarde"
32188
+ },
32189
+ input: {
32190
+ placeholder: "Por favor, digite",
32191
+ copy: "Copiar",
32192
+ copySuccess: "Copiado para a área de transferência",
32193
+ copyFailed: "Falha ao copiar, por favor tente novamente"
32194
+ },
32195
+ inputTag: {
32196
+ placeholder: "Digite e pressione Enter para adicionar uma tag",
32197
+ maxLength: "Atingiu o limite de {maxLength} tags, remova algumas para continuar adicionando",
32198
+ duplicate: "Esta tag já existe, por favor digite uma nova tag"
32199
+ },
32200
+ select: {
32201
+ placeholder: "Por favor, selecione"
32202
+ },
32203
+ selectMultiple: {
32204
+ placeholder: "Por favor, selecione"
32205
+ },
32206
+ cascader: {
32207
+ placeholder: "Por favor, selecione"
32208
+ },
32209
+ textarea: {
32210
+ placeholder: "Por favor, digite"
32211
+ },
32212
+ datePicker: {
32213
+ Mon: "Seg",
32214
+ Tue: "Ter",
32215
+ Wed: "Qua",
32216
+ Thu: "Qui",
32217
+ Fri: "Sex",
32218
+ Sat: "Sáb",
32219
+ Sun: "Dom",
32220
+ placeholder: "Selecionar data"
32221
+ },
32222
+ dateRangePicker: {
32223
+ placeholderStart: "Data inicial",
32224
+ placeholderEnd: "Data final"
32225
+ },
32226
+ upload: {
32227
+ dropActive: "Solte para iniciar o upload",
32228
+ click: "Clique para fazer upload, ",
32229
+ paste: "cole, ",
32230
+ drag: "ou arraste arquivos para aqui",
32231
+ accept: "Suporta upload de {accept}",
32232
+ limit: "Máximo de {limit} arquivos podem ser enviados",
32233
+ maxFileSize: "Cada arquivo não deve exceder {maxFileSize}"
32234
+ },
32235
+ pagination: {
32236
+ pageSize: "{pageSize} por página"
32237
+ }
32238
+ };
31725
32239
  let i18nInstance = null;
31726
32240
  let currentLocale = "zh";
31727
32241
  const setLocale = (locale2) => {
@@ -31739,12 +32253,20 @@ const getLocale = () => {
31739
32253
  const useI18n = () => {
31740
32254
  if (!i18nInstance) {
31741
32255
  i18nInstance = createI18n({
32256
+ globalInjection: true,
31742
32257
  legacy: false,
31743
32258
  locale: currentLocale,
31744
32259
  fallbackLocale: currentLocale,
31745
32260
  messages: {
31746
32261
  en,
31747
- zh
32262
+ zh,
32263
+ ja,
32264
+ ko,
32265
+ de,
32266
+ pt,
32267
+ fr,
32268
+ it,
32269
+ es
31748
32270
  }
31749
32271
  });
31750
32272
  }
@@ -31777,7 +32299,7 @@ export {
31777
32299
  LewAvatar,
31778
32300
  LewBackTop,
31779
32301
  index$1 as LewBacktop,
31780
- _sfc_main$Z as LewBadge,
32302
+ _sfc_main$_ as LewBadge,
31781
32303
  LewBreadcrumb,
31782
32304
  LewButton,
31783
32305
  LewCascader,
@@ -31796,7 +32318,7 @@ export {
31796
32318
  LewDescItem,
31797
32319
  LewDialog$1 as LewDialog,
31798
32320
  _sfc_main$4 as LewDrawer,
31799
- _sfc_main$O as LewDropdown,
32321
+ _sfc_main$P as LewDropdown,
31800
32322
  _sfc_main$2 as LewEmpty,
31801
32323
  LewExpand,
31802
32324
  LewFlex,
@@ -31825,11 +32347,11 @@ export {
31825
32347
  LewSelectMultiple,
31826
32348
  LewSlider,
31827
32349
  LewSliderRange,
31828
- _sfc_main$S as LewSteps,
32350
+ _sfc_main$T as LewSteps,
31829
32351
  LewSwitch,
31830
- _sfc_main$g as LewTable,
32352
+ _sfc_main$h as LewTable,
31831
32353
  LewTabs,
31832
- _sfc_main$_ as LewTag,
32354
+ _sfc_main$$ as LewTag,
31833
32355
  LewTextTrim,
31834
32356
  LewTextarea,
31835
32357
  LewTitle,
@@ -31866,6 +32388,7 @@ export {
31866
32388
  dateRangePickerModel,
31867
32389
  dateRangePickerProps,
31868
32390
  dateRangeProps,
32391
+ de,
31869
32392
  index as default,
31870
32393
  descItemProps,
31871
32394
  descProps,
@@ -31873,10 +32396,14 @@ export {
31873
32396
  dragmove,
31874
32397
  drawerModel,
31875
32398
  drawerProps,
32399
+ dropdownModel,
31876
32400
  dropdownProps,
31877
32401
  emptyProps,
31878
32402
  en,
32403
+ es,
31879
32404
  expandProps,
32405
+ findAllChildrenKeys,
32406
+ findNodeByKey,
31880
32407
  flattenNestedObject,
31881
32408
  flexProps,
31882
32409
  formItemProps,
@@ -31884,6 +32411,7 @@ export {
31884
32411
  formTypeAsMap,
31885
32412
  formatBytes,
31886
32413
  formatFormByMap,
32414
+ fr,
31887
32415
  getAssetsFile,
31888
32416
  getColorType,
31889
32417
  getFileIcon,
@@ -31903,13 +32431,16 @@ export {
31903
32431
  inputTableProps,
31904
32432
  inputTagModel,
31905
32433
  inputTagProps,
32434
+ insertChildByKey,
31906
32435
  isValidCssValue,
32436
+ it,
32437
+ ja,
32438
+ ko,
31907
32439
  lewDescSizePaddingMap,
31908
32440
  locale,
31909
32441
  markProps,
31910
32442
  menuModel,
31911
32443
  menuProps,
31912
- menuTreeItemModel,
31913
32444
  menuTreeItemProps,
31914
32445
  menuTreeModel,
31915
32446
  menuTreeProps,
@@ -31923,6 +32454,7 @@ export {
31923
32454
  poll,
31924
32455
  popokProps,
31925
32456
  popoverProps,
32457
+ pt,
31926
32458
  radioGroupModel,
31927
32459
  radioGroupProps,
31928
32460
  radioProps,
@@ -31940,8 +32472,7 @@ export {
31940
32472
  sliderProps,
31941
32473
  sliderRangeModel,
31942
32474
  sliderRangeProps,
31943
- statusColorMap,
31944
- statusMap,
32475
+ statusConfig,
31945
32476
  stepsModel,
31946
32477
  stepsProps,
31947
32478
  switchModel,
@@ -31956,6 +32487,7 @@ export {
31956
32487
  textareaProps,
31957
32488
  tipsIconSizeMap,
31958
32489
  titleProps,
32490
+ treeItemProps,
31959
32491
  treeModel,
31960
32492
  treeProps,
31961
32493
  treeSelectModel,