lew-ui 2.7.61 → 2.7.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8783,10 +8783,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
8783
8783
  state.isAllChecked = isEmpty(uncheckedKeys) && props.multiple && props.checkable && checkedKeys.length > 0;
8784
8784
  }
8785
8785
  function setAllRowsChecked(checked) {
8786
- state.selectedRowsMap = mapValues(
8787
- keyBy(state.dataSource, _rowKey),
8788
- () => checked
8789
- );
8786
+ state.selectedRowsMap = mapValues(keyBy(state.dataSource, _rowKey), () => checked);
8790
8787
  if (props.multiple) {
8791
8788
  selectedKeys.value = checked ? keys(state.selectedRowsMap) : [];
8792
8789
  }
@@ -8805,10 +8802,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
8805
8802
  }
8806
8803
  function updateSelectedKeys(keys2) {
8807
8804
  if (props.multiple) {
8808
- state.selectedRowsMap = mapValues(
8809
- keyBy(state.dataSource, _rowKey),
8810
- () => false
8811
- );
8805
+ state.selectedRowsMap = mapValues(keyBy(state.dataSource, _rowKey), () => false);
8812
8806
  keys2.forEach((key) => {
8813
8807
  state.selectedRowsMap[key] = true;
8814
8808
  });
@@ -8905,9 +8899,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
8905
8899
  style: tdGroupStyle
8906
8900
  },
8907
8901
  {
8908
- default: () => column.children.map(
8909
- (child) => readerHeaderTd({ column: child })
8910
- )
8902
+ default: () => column.children.map((child) => readerHeaderTd({ column: child }))
8911
8903
  }
8912
8904
  ) : null
8913
8905
  ]
@@ -9064,10 +9056,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9064
9056
  state.showTooltip = false;
9065
9057
  state.isDragging = false;
9066
9058
  }
9067
- const throttledTooltipUpdate = throttle(
9068
- updateTooltipPosition,
9069
- TOOLTIP_THROTTLE_DELAY
9070
- );
9059
+ const throttledTooltipUpdate = throttle(updateTooltipPosition, TOOLTIP_THROTTLE_DELAY);
9071
9060
  function dragStart(event, row, index2) {
9072
9061
  if (!props.sortable) return;
9073
9062
  initDragState();
@@ -9154,8 +9143,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9154
9143
  }
9155
9144
  function updateDragTarget(mouseY) {
9156
9145
  state.lastMouseY = mouseY;
9157
- if (!state.dragRowId || Object.keys(state.trPositionsMap).length === 0)
9158
- return;
9146
+ if (!state.dragRowId || Object.keys(state.trPositionsMap).length === 0) return;
9159
9147
  const dragDistance = Math.abs(state.initialDragY - mouseY);
9160
9148
  const minDragDistance = 5;
9161
9149
  if (dragDistance < minDragDistance) {
@@ -9163,12 +9151,10 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9163
9151
  }
9164
9152
  let targetRowId = "";
9165
9153
  let isAbove = false;
9166
- const positionEntries = Object.entries(state.trPositionsMap).map(
9167
- ([id, pos]) => ({
9168
- id,
9169
- ...pos
9170
- })
9171
- );
9154
+ const positionEntries = Object.entries(state.trPositionsMap).map(([id, pos]) => ({
9155
+ id,
9156
+ ...pos
9157
+ }));
9172
9158
  positionEntries.sort((a, b) => a.top - b.top);
9173
9159
  for (const entry of positionEntries) {
9174
9160
  if (entry.id === state.dragRowId) continue;
@@ -14514,14 +14500,6 @@ const popoverProps = {
14514
14500
  componentName: "LewPopover",
14515
14501
  propName: "popoverBodyClassName"
14516
14502
  })
14517
- },
14518
- triggerTarget: {
14519
- type: Object,
14520
- default: null,
14521
- validator: validators.object({
14522
- componentName: "LewPopover",
14523
- propName: "triggerTarget"
14524
- })
14525
14503
  }
14526
14504
  };
14527
14505
  const _hoisted_1$H = { class: "lew-popover" };
@@ -14569,15 +14547,6 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
14569
14547
  },
14570
14548
  watchOptions
14571
14549
  );
14572
- watchDebounced(
14573
- () => props.triggerTarget,
14574
- (value) => {
14575
- instance?.setProps({
14576
- triggerTarget: value
14577
- });
14578
- },
14579
- watchOptions
14580
- );
14581
14550
  watchDebounced(
14582
14551
  () => props.offset,
14583
14552
  (value) => {
@@ -14591,7 +14560,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
14591
14560
  if (instance) {
14592
14561
  return;
14593
14562
  }
14594
- let { placement, triggerTarget, offset: offset2, trigger, disabled } = props;
14563
+ let { placement, offset: offset2, trigger, disabled } = props;
14595
14564
  if (trigger === "hover") {
14596
14565
  trigger = "mouseenter";
14597
14566
  }
@@ -14601,7 +14570,6 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
14601
14570
  instance = tippy(triggerRef.value, {
14602
14571
  theme: "light",
14603
14572
  trigger,
14604
- triggerTarget,
14605
14573
  content: bodyRef.value,
14606
14574
  animation: "shift-away-subtle",
14607
14575
  interactive: true,
@@ -15561,6 +15529,9 @@ function useVirtList(userProps, emitFunction) {
15561
15529
  slotSize.footerSize = 0;
15562
15530
  }
15563
15531
  });
15532
+ onActivated(() => {
15533
+ scrollToOffset(reactiveData.offset);
15534
+ });
15564
15535
  function getVirtualSize2beginInView() {
15565
15536
  return reactiveData.virtualSize + getRangeSize(reactiveData.renderBegin, reactiveData.inViewBegin);
15566
15537
  }
@@ -16277,7 +16248,9 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16277
16248
  let _value;
16278
16249
  let _items;
16279
16250
  if (props.onlyLeafSelectable) {
16280
- _items = findItemsByValues(selectedKeys.value).filter((item) => item.isLeaf);
16251
+ _items = findItemsByValues(selectedKeys.value).filter(
16252
+ (item) => item.isLeaf
16253
+ );
16281
16254
  _value = _items.map((item) => item.key);
16282
16255
  } else {
16283
16256
  _value = cloneDeep(selectedKeys.value);
@@ -16327,7 +16300,10 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16327
16300
  state.optionsGroup = [formattedTree];
16328
16301
  state.optionsTree = formattedTree;
16329
16302
  if (formattedTree.length > 0 && !props.free) {
16330
- initTreeSelection({ tree: formattedTree, keys: modelValue.value });
16303
+ initTreeSelection({
16304
+ tree: formattedTree,
16305
+ keys: modelValue.value
16306
+ });
16331
16307
  }
16332
16308
  } catch (error) {
16333
16309
  console.error("Cascader initialization failed:", error);
@@ -16361,19 +16337,24 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16361
16337
  updateModelValue();
16362
16338
  }
16363
16339
  setTimeout(() => {
16364
- lewPopoverRef.value && lewPopoverRef.value.refresh();
16340
+ if (lewPopoverRef.value) {
16341
+ lewPopoverRef.value.refresh();
16342
+ }
16365
16343
  }, 100);
16366
16344
  }
16367
16345
  function getSelected() {
16368
16346
  if (props.multiple) {
16369
16347
  return findItemsByValues(modelValue.value);
16370
16348
  } else {
16371
- return findObjectByValue(state.optionsTree, modelValue.value, nodeCache);
16349
+ return findObjectByValue(
16350
+ state.optionsTree,
16351
+ modelValue.value,
16352
+ nodeCache
16353
+ );
16372
16354
  }
16373
16355
  }
16374
16356
  async function selectItem(item, level) {
16375
- if (item.disabled)
16376
- return;
16357
+ if (item.disabled) return;
16377
16358
  if (!item.isLeaf && !isEqual(item.valuePaths, state.activeValues)) {
16378
16359
  state.optionsGroup = state.optionsGroup.slice(0, level + 1);
16379
16360
  if (_loadMethod.value && !item.isLeaf) {
@@ -16410,7 +16391,11 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16410
16391
  updateModelValue();
16411
16392
  });
16412
16393
  }
16413
- const _options = findChildrenByValue(state.optionsTree, item.value, nodeCache);
16394
+ const _options = findChildrenByValue(
16395
+ state.optionsTree,
16396
+ item.value,
16397
+ nodeCache
16398
+ );
16414
16399
  state.optionsGroup.push(_options);
16415
16400
  loadedDataCache.set(item.value, _options);
16416
16401
  loadedData[item.value] = _options;
@@ -16427,14 +16412,14 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16427
16412
  }
16428
16413
  if (!props.multiple) {
16429
16414
  modelValue.value = item.value;
16415
+ emit("change", item.value, toRaw(item));
16430
16416
  if (props.onlyLeafSelectable && item.isLeaf) {
16431
16417
  setTimeout(() => {
16432
16418
  hide2();
16433
16419
  }, 100);
16434
16420
  }
16435
16421
  }
16436
- if (item.isLeaf)
16437
- return;
16422
+ if (item.isLeaf) return;
16438
16423
  if (isEqual(item.valuePaths, state.activeValues)) {
16439
16424
  state.activeValues = item.parentValuePaths || [];
16440
16425
  if (level < state.optionsGroup.length - 1) {
@@ -16643,7 +16628,10 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16643
16628
  class: "lew-cascader-icon",
16644
16629
  type: "chevron-right"
16645
16630
  }, null, 512), [
16646
- [vShow, !templateProps.loading && !templateProps.isLeaf]
16631
+ [
16632
+ vShow,
16633
+ !templateProps.loading && !templateProps.isLeaf
16634
+ ]
16647
16635
  ])
16648
16636
  ], 2)
16649
16637
  ], 8, _hoisted_2$s)
@@ -16663,7 +16651,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16663
16651
  };
16664
16652
  }
16665
16653
  });
16666
- const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-7cea69f7"]]);
16654
+ const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-dd8d6365"]]);
16667
16655
  const cascaderModel = {
16668
16656
  modelValue: {
16669
16657
  type: String
@@ -23035,7 +23023,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
23035
23023
  };
23036
23024
  }
23037
23025
  });
23038
- const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-67533033"]]);
23026
+ const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-aa6b53e5"]]);
23039
23027
  const inputTableEmits = {
23040
23028
  change: (value) => value
23041
23029
  };
@@ -23686,7 +23674,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23686
23674
  originalKeydownHandler = document.onkeydown;
23687
23675
  document.onkeydown = function(event) {
23688
23676
  const keyCode = event.key || event.code;
23689
- if (!isInputActive.value) return;
23677
+ if (!isInputActive.value)
23678
+ return;
23690
23679
  if (inputValue.value) {
23691
23680
  if (keyCode === "Enter" || keyCode === "NumpadEnter") {
23692
23681
  isTagMarkedForDeletion.value = false;
@@ -23726,7 +23715,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23726
23715
  }
23727
23716
  }
23728
23717
  function openInput() {
23729
- if (isInputActive.value || props.disabled || props.readonly) return;
23718
+ if (isInputActive.value || props.disabled || props.readonly)
23719
+ return;
23730
23720
  if (props.maxLength > 0 && Array.isArray(modelValue.value) && modelValue.value.length >= props.maxLength) {
23731
23721
  LewMessage.warning(locale.t("inputTag.maxLength", { maxLength: props.maxLength }));
23732
23722
  return;
@@ -23741,7 +23731,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23741
23731
  }
23742
23732
  function addTag() {
23743
23733
  const _value = Array.isArray(modelValue.value) ? [...modelValue.value] : [];
23744
- if (!inputValue.value || inputValue.value.trim() === "") return;
23734
+ if (!inputValue.value || inputValue.value.trim() === "")
23735
+ return;
23745
23736
  if (props.maxLength > 0 && _value.length >= props.maxLength) {
23746
23737
  inputValue.value = "";
23747
23738
  isInputActive.value = false;
@@ -23786,7 +23777,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23786
23777
  }
23787
23778
  }
23788
23779
  function onFocus() {
23789
- if (props.disabled || props.readonly) return;
23780
+ if (props.disabled || props.readonly)
23781
+ return;
23790
23782
  isInputActive.value = true;
23791
23783
  attachKeydownListener();
23792
23784
  }
@@ -23897,7 +23889,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23897
23889
  };
23898
23890
  }
23899
23891
  });
23900
- const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-60df733b"]]);
23892
+ const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-d9c5ffa5"]]);
23901
23893
  const radioEmits = {
23902
23894
  change: () => true
23903
23895
  };
@@ -27336,7 +27328,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
27336
27328
  };
27337
27329
  }
27338
27330
  });
27339
- const LewTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-dadd6f86"]]);
27331
+ const LewTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-0f4c61a3"]]);
27340
27332
  const uploadEmits = {
27341
27333
  change: (files) => files,
27342
27334
  delete: (file) => file
@@ -31022,7 +31014,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
31022
31014
  };
31023
31015
  }
31024
31016
  });
31025
- const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-4a79a5c9"]]);
31017
+ const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-871c625a"]]);
31026
31018
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
31027
31019
  __name: "LewMenuTree",
31028
31020
  props: /* @__PURE__ */ mergeModels(menuTreeProps, {