lew-ui 2.7.61 → 2.7.62

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;
@@ -16277,7 +16263,9 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16277
16263
  let _value;
16278
16264
  let _items;
16279
16265
  if (props.onlyLeafSelectable) {
16280
- _items = findItemsByValues(selectedKeys.value).filter((item) => item.isLeaf);
16266
+ _items = findItemsByValues(selectedKeys.value).filter(
16267
+ (item) => item.isLeaf
16268
+ );
16281
16269
  _value = _items.map((item) => item.key);
16282
16270
  } else {
16283
16271
  _value = cloneDeep(selectedKeys.value);
@@ -16327,7 +16315,10 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16327
16315
  state.optionsGroup = [formattedTree];
16328
16316
  state.optionsTree = formattedTree;
16329
16317
  if (formattedTree.length > 0 && !props.free) {
16330
- initTreeSelection({ tree: formattedTree, keys: modelValue.value });
16318
+ initTreeSelection({
16319
+ tree: formattedTree,
16320
+ keys: modelValue.value
16321
+ });
16331
16322
  }
16332
16323
  } catch (error) {
16333
16324
  console.error("Cascader initialization failed:", error);
@@ -16361,19 +16352,24 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16361
16352
  updateModelValue();
16362
16353
  }
16363
16354
  setTimeout(() => {
16364
- lewPopoverRef.value && lewPopoverRef.value.refresh();
16355
+ if (lewPopoverRef.value) {
16356
+ lewPopoverRef.value.refresh();
16357
+ }
16365
16358
  }, 100);
16366
16359
  }
16367
16360
  function getSelected() {
16368
16361
  if (props.multiple) {
16369
16362
  return findItemsByValues(modelValue.value);
16370
16363
  } else {
16371
- return findObjectByValue(state.optionsTree, modelValue.value, nodeCache);
16364
+ return findObjectByValue(
16365
+ state.optionsTree,
16366
+ modelValue.value,
16367
+ nodeCache
16368
+ );
16372
16369
  }
16373
16370
  }
16374
16371
  async function selectItem(item, level) {
16375
- if (item.disabled)
16376
- return;
16372
+ if (item.disabled) return;
16377
16373
  if (!item.isLeaf && !isEqual(item.valuePaths, state.activeValues)) {
16378
16374
  state.optionsGroup = state.optionsGroup.slice(0, level + 1);
16379
16375
  if (_loadMethod.value && !item.isLeaf) {
@@ -16410,7 +16406,11 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16410
16406
  updateModelValue();
16411
16407
  });
16412
16408
  }
16413
- const _options = findChildrenByValue(state.optionsTree, item.value, nodeCache);
16409
+ const _options = findChildrenByValue(
16410
+ state.optionsTree,
16411
+ item.value,
16412
+ nodeCache
16413
+ );
16414
16414
  state.optionsGroup.push(_options);
16415
16415
  loadedDataCache.set(item.value, _options);
16416
16416
  loadedData[item.value] = _options;
@@ -16427,14 +16427,14 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16427
16427
  }
16428
16428
  if (!props.multiple) {
16429
16429
  modelValue.value = item.value;
16430
+ emit("change", item.value, toRaw(item));
16430
16431
  if (props.onlyLeafSelectable && item.isLeaf) {
16431
16432
  setTimeout(() => {
16432
16433
  hide2();
16433
16434
  }, 100);
16434
16435
  }
16435
16436
  }
16436
- if (item.isLeaf)
16437
- return;
16437
+ if (item.isLeaf) return;
16438
16438
  if (isEqual(item.valuePaths, state.activeValues)) {
16439
16439
  state.activeValues = item.parentValuePaths || [];
16440
16440
  if (level < state.optionsGroup.length - 1) {
@@ -16643,7 +16643,10 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16643
16643
  class: "lew-cascader-icon",
16644
16644
  type: "chevron-right"
16645
16645
  }, null, 512), [
16646
- [vShow, !templateProps.loading && !templateProps.isLeaf]
16646
+ [
16647
+ vShow,
16648
+ !templateProps.loading && !templateProps.isLeaf
16649
+ ]
16647
16650
  ])
16648
16651
  ], 2)
16649
16652
  ], 8, _hoisted_2$s)
@@ -16663,7 +16666,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
16663
16666
  };
16664
16667
  }
16665
16668
  });
16666
- const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-7cea69f7"]]);
16669
+ const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-dd8d6365"]]);
16667
16670
  const cascaderModel = {
16668
16671
  modelValue: {
16669
16672
  type: String
@@ -23035,7 +23038,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
23035
23038
  };
23036
23039
  }
23037
23040
  });
23038
- const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-67533033"]]);
23041
+ const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-aa6b53e5"]]);
23039
23042
  const inputTableEmits = {
23040
23043
  change: (value) => value
23041
23044
  };
@@ -23686,7 +23689,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23686
23689
  originalKeydownHandler = document.onkeydown;
23687
23690
  document.onkeydown = function(event) {
23688
23691
  const keyCode = event.key || event.code;
23689
- if (!isInputActive.value) return;
23692
+ if (!isInputActive.value)
23693
+ return;
23690
23694
  if (inputValue.value) {
23691
23695
  if (keyCode === "Enter" || keyCode === "NumpadEnter") {
23692
23696
  isTagMarkedForDeletion.value = false;
@@ -23726,7 +23730,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23726
23730
  }
23727
23731
  }
23728
23732
  function openInput() {
23729
- if (isInputActive.value || props.disabled || props.readonly) return;
23733
+ if (isInputActive.value || props.disabled || props.readonly)
23734
+ return;
23730
23735
  if (props.maxLength > 0 && Array.isArray(modelValue.value) && modelValue.value.length >= props.maxLength) {
23731
23736
  LewMessage.warning(locale.t("inputTag.maxLength", { maxLength: props.maxLength }));
23732
23737
  return;
@@ -23741,7 +23746,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23741
23746
  }
23742
23747
  function addTag() {
23743
23748
  const _value = Array.isArray(modelValue.value) ? [...modelValue.value] : [];
23744
- if (!inputValue.value || inputValue.value.trim() === "") return;
23749
+ if (!inputValue.value || inputValue.value.trim() === "")
23750
+ return;
23745
23751
  if (props.maxLength > 0 && _value.length >= props.maxLength) {
23746
23752
  inputValue.value = "";
23747
23753
  isInputActive.value = false;
@@ -23786,7 +23792,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23786
23792
  }
23787
23793
  }
23788
23794
  function onFocus() {
23789
- if (props.disabled || props.readonly) return;
23795
+ if (props.disabled || props.readonly)
23796
+ return;
23790
23797
  isInputActive.value = true;
23791
23798
  attachKeydownListener();
23792
23799
  }
@@ -23897,7 +23904,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23897
23904
  };
23898
23905
  }
23899
23906
  });
23900
- const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-60df733b"]]);
23907
+ const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-d9c5ffa5"]]);
23901
23908
  const radioEmits = {
23902
23909
  change: () => true
23903
23910
  };
@@ -27336,7 +27343,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
27336
27343
  };
27337
27344
  }
27338
27345
  });
27339
- const LewTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-dadd6f86"]]);
27346
+ const LewTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-0f4c61a3"]]);
27340
27347
  const uploadEmits = {
27341
27348
  change: (files) => files,
27342
27349
  delete: (file) => file
@@ -31022,7 +31029,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
31022
31029
  };
31023
31030
  }
31024
31031
  });
31025
- const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-4a79a5c9"]]);
31032
+ const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-871c625a"]]);
31026
31033
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
31027
31034
  __name: "LewMenuTree",
31028
31035
  props: /* @__PURE__ */ mergeModels(menuTreeProps, {