lew-ui 2.6.16 → 2.6.18

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.
@@ -3,7 +3,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
3
3
  required: true;
4
4
  type: import('vue').PropType<any>;
5
5
  };
6
- prefixesValue: import('vue').PropType<any>;
6
+ prefixValue: import('vue').PropType<any>;
7
7
  suffixValue: import('vue').PropType<any>;
8
8
  type: {
9
9
  type: StringConstructor;
@@ -137,7 +137,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
137
137
  required: true;
138
138
  type: import('vue').PropType<any>;
139
139
  };
140
- prefixesValue: import('vue').PropType<any>;
140
+ prefixValue: import('vue').PropType<any>;
141
141
  suffixValue: import('vue').PropType<any>;
142
142
  type: {
143
143
  type: StringConstructor;
@@ -11,7 +11,7 @@ export declare const inputModel: {
11
11
  default: undefined;
12
12
  description: string;
13
13
  };
14
- prefixesValue: {
14
+ prefixValue: {
15
15
  type: (NumberConstructor | StringConstructor)[];
16
16
  default: undefined;
17
17
  description: string;
package/dist/index.mjs CHANGED
@@ -8276,7 +8276,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
8276
8276
  };
8277
8277
  }
8278
8278
  });
8279
- const LewMenu = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-e5879da8"]]);
8279
+ const LewMenu = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-7efba584"]]);
8280
8280
  const menuTreeModel = {
8281
8281
  modelValue: {
8282
8282
  type: String,
@@ -8461,7 +8461,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
8461
8461
  };
8462
8462
  }
8463
8463
  });
8464
- const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-968be483"]]);
8464
+ const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-c8b67784"]]);
8465
8465
  const _sfc_main$R = /* @__PURE__ */ defineComponent({
8466
8466
  __name: "LewMenuTree",
8467
8467
  props: /* @__PURE__ */ mergeModels(menuTreeProps, {
@@ -8589,7 +8589,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
8589
8589
  };
8590
8590
  }
8591
8591
  });
8592
- const LewMenuTree = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-ab7e2078"]]);
8592
+ const LewMenuTree = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-a49a0d3f"]]);
8593
8593
  const dropdownModel = {
8594
8594
  selectedKeys: {
8595
8595
  type: Array,
@@ -11873,7 +11873,7 @@ const inputModel = {
11873
11873
  default: void 0,
11874
11874
  description: "输入框的值,支持 v-model 双向绑定"
11875
11875
  },
11876
- prefixesValue: {
11876
+ prefixValue: {
11877
11877
  type: [String, Number],
11878
11878
  default: void 0,
11879
11879
  description: "输入框前缀的值"
@@ -12094,12 +12094,12 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
12094
12094
  props: /* @__PURE__ */ mergeModels(inputProps, {
12095
12095
  "modelValue": { required: true },
12096
12096
  "modelModifiers": {},
12097
- "prefixesValue": {},
12098
- "prefixesValueModifiers": {},
12097
+ "prefixValue": {},
12098
+ "prefixValueModifiers": {},
12099
12099
  "suffixValue": {},
12100
12100
  "suffixValueModifiers": {}
12101
12101
  }),
12102
- emits: /* @__PURE__ */ mergeModels(["clear", "blur", "focus", "change", "input", "ok"], ["update:modelValue", "update:prefixesValue", "update:suffixValue"]),
12102
+ emits: /* @__PURE__ */ mergeModels(["clear", "blur", "focus", "change", "input", "ok"], ["update:modelValue", "update:prefixValue", "update:suffixValue"]),
12103
12103
  setup(__props2, { expose: __expose2, emit: __emit2 }) {
12104
12104
  var _a;
12105
12105
  const { enter } = useMagicKeys();
@@ -12110,7 +12110,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
12110
12110
  const emit2 = __emit2;
12111
12111
  const props2 = __props2;
12112
12112
  const modelValue2 = useModel(__props2, "modelValue");
12113
- const prefixesValue = useModel(__props2, "prefixesValue");
12113
+ const prefixValue = useModel(__props2, "prefixValue");
12114
12114
  const suffixValue = useModel(__props2, "suffixValue");
12115
12115
  const lewInputRef = ref();
12116
12116
  const lewInputCountRef = ref();
@@ -12186,14 +12186,14 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
12186
12186
  });
12187
12187
  });
12188
12188
  const prefixesChange = (item) => {
12189
- prefixesValue.value = item.value;
12189
+ prefixValue.value = item.value;
12190
12190
  };
12191
12191
  const suffixChange = (item) => {
12192
12192
  suffixValue.value = item.value;
12193
12193
  };
12194
12194
  const getPrefixesLabel = computed(() => {
12195
12195
  var _a2;
12196
- return ((_a2 = props2.prefixesOptions.find((e) => e.value === prefixesValue.value)) == null ? void 0 : _a2.label) || "";
12196
+ return ((_a2 = props2.prefixesOptions.find((e) => e.value === prefixValue.value)) == null ? void 0 : _a2.label) || "";
12197
12197
  });
12198
12198
  const getSuffixLabel = computed(() => {
12199
12199
  var _a2;
@@ -12230,7 +12230,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
12230
12230
  return {
12231
12231
  ...e,
12232
12232
  onClick: () => {
12233
- prefixesValue.value = e.value;
12233
+ prefixValue.value = e.value;
12234
12234
  }
12235
12235
  };
12236
12236
  });
@@ -12256,11 +12256,11 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
12256
12256
  style: normalizeStyle({ width: _ctx.autoWidth ? "auto" : unref(any2px)(_ctx.width) })
12257
12257
  }, [
12258
12258
  _ctx.prefixes ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$A, [
12259
- _ctx.prefixes === "text" ? (openBlock(), createElementBlock("div", _hoisted_2$l, toDisplayString$1(prefixesValue.value), 1)) : createCommentVNode("", true),
12259
+ _ctx.prefixes === "text" ? (openBlock(), createElementBlock("div", _hoisted_2$l, toDisplayString$1(prefixValue.value), 1)) : createCommentVNode("", true),
12260
12260
  _ctx.prefixes === "icon" ? (openBlock(), createElementBlock("div", _hoisted_3$f, [
12261
12261
  createVNode(Icon, {
12262
12262
  size: unref(getIconSize),
12263
- type: prefixesValue.value
12263
+ type: prefixValue.value
12264
12264
  }, null, 8, ["size", "type"])
12265
12265
  ])) : createCommentVNode("", true),
12266
12266
  _ctx.prefixes === "select" ? (openBlock(), createElementBlock("div", _hoisted_4$b, [
@@ -12434,7 +12434,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
12434
12434
  };
12435
12435
  }
12436
12436
  });
12437
- const LewInput = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-377a31b7"]]);
12437
+ const LewInput = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-52405f50"]]);
12438
12438
  const inputNumberModel = {
12439
12439
  modelValue: {
12440
12440
  type: Number,
@@ -12732,7 +12732,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
12732
12732
  };
12733
12733
  }
12734
12734
  });
12735
- const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-d241e508"]]);
12735
+ const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-2cedebdb"]]);
12736
12736
  const textareaModel = {
12737
12737
  modelValue: {
12738
12738
  type: String,
@@ -15254,7 +15254,9 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
15254
15254
  () => props2.options,
15255
15255
  () => {
15256
15256
  var _a;
15257
- state.keyword = (_a = props2.options.find((e) => e.value === selectValue.value)) == null ? void 0 : _a.label;
15257
+ state.keyword = (_a = props2.options.find(
15258
+ (e) => e.value === selectValue.value
15259
+ )) == null ? void 0 : _a.label;
15258
15260
  },
15259
15261
  {
15260
15262
  deep: true
@@ -15436,7 +15438,9 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
15436
15438
  if (props2.searchable) {
15437
15439
  search({ target: { value: "" } });
15438
15440
  }
15439
- const index2 = state.options.findIndex((e) => e.value === selectValue.value);
15441
+ const index2 = state.options.findIndex(
15442
+ (e) => e.value === selectValue.value
15443
+ );
15440
15444
  if (index2 > -1) {
15441
15445
  poll({
15442
15446
  callback: () => {
@@ -15617,7 +15621,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
15617
15621
  };
15618
15622
  }
15619
15623
  });
15620
- const LewSelect = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-3a88394b"]]);
15624
+ const LewSelect = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-83898055"]]);
15621
15625
  const selectMultipleModel = {
15622
15626
  modelValue: {
15623
15627
  type: Array,
@@ -16951,7 +16955,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
16951
16955
  };
16952
16956
  }
16953
16957
  });
16954
- const LewDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-d8485a76"]]);
16958
+ const LewDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-15f91150"]]);
16955
16959
  const dateRangePickerModel = {
16956
16960
  modelValue: {
16957
16961
  type: Object,
@@ -18065,7 +18069,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
18065
18069
  emit2("blur");
18066
18070
  };
18067
18071
  const getCascaderWidth = computed(() => {
18068
- const _hasChildOptions = state.optionsGroup.filter((e) => e && e.length > 0).length;
18072
+ const _hasChildOptions = state.optionsGroup.filter(
18073
+ (e) => e && e.length > 0
18074
+ ).length;
18069
18075
  if (_hasChildOptions > 1) {
18070
18076
  return _hasChildOptions * 200;
18071
18077
  }
@@ -18078,7 +18084,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
18078
18084
  };
18079
18085
  });
18080
18086
  const getLabel = computed(() => {
18081
- const item = findObjectByValue(state.optionsTree, cascaderValue.value);
18087
+ const item = findObjectByValue(
18088
+ state.optionsTree,
18089
+ cascaderValue.value
18090
+ );
18082
18091
  return (item == null ? void 0 : item.labelPaths) || [];
18083
18092
  });
18084
18093
  const ok = () => {
@@ -18200,10 +18209,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
18200
18209
  createElementVNode("div", {
18201
18210
  class: normalizeClass(["lew-cascader-item", {
18202
18211
  "lew-cascader-item-disabled": templateProps.disabled,
18203
- "lew-cascader-item-hover": unref(state).activeLabels.includes(
18212
+ "lew-cascader-item-hover": unref(state).activeLabels.includes(templateProps.label),
18213
+ "lew-cascader-item-active": _ctx.free ? unref(state).activeLabels.includes(
18204
18214
  templateProps.label
18205
- ),
18206
- "lew-cascader-item-active": _ctx.free ? unref(state).activeLabels.includes(templateProps.label) && unref(state).tobeLabels.includes(templateProps.label) : unref(state).activeLabels.includes(templateProps.label),
18215
+ ) && unref(state).tobeLabels.includes(templateProps.label) : unref(state).activeLabels.includes(templateProps.label),
18207
18216
  "lew-cascader-item-tobe": unref(state).tobeLabels.includes(
18208
18217
  templateProps.label
18209
18218
  ),
@@ -18286,7 +18295,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
18286
18295
  };
18287
18296
  }
18288
18297
  });
18289
- const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-e672baf2"]]);
18298
+ const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-d985e541"]]);
18290
18299
  const treeSelectModel = {
18291
18300
  modelValue: {
18292
18301
  type: [String, Number],
@@ -21769,9 +21778,12 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
21769
21778
  });
21770
21779
  const calculateColumnWidth = (column) => {
21771
21780
  if (column.children && column.children.length > 0) {
21772
- const totalChildWidth = column.children.reduce((sum, child) => {
21773
- return sum + (calculateColumnWidth(child) || 100);
21774
- }, 0);
21781
+ const totalChildWidth = column.children.reduce(
21782
+ (sum, child) => {
21783
+ return sum + (calculateColumnWidth(child) || 100);
21784
+ },
21785
+ 0
21786
+ );
21775
21787
  column.width = totalChildWidth;
21776
21788
  return totalChildWidth;
21777
21789
  }
@@ -21819,7 +21831,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
21819
21831
  return getLeafColumns(formatColumns.value).filter((col) => !col.fixed);
21820
21832
  });
21821
21833
  const getFixedColumns = computed(() => (direction) => {
21822
- return getLeafColumns(formatColumns.value).filter((col) => col.fixed === direction);
21834
+ return getLeafColumns(formatColumns.value).filter(
21835
+ (col) => col.fixed === direction
21836
+ );
21823
21837
  });
21824
21838
  const columnLevel = computed(() => {
21825
21839
  const findMaxDepth = (columns, currentDepth = 1) => {
@@ -21841,12 +21855,17 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
21841
21855
  });
21842
21856
  const updateAllCheckedState = () => {
21843
21857
  const checkedKeys = keys(pickBy(state.selectedRowsMap, Boolean));
21844
- const allDataKeys = props2.dataSource.map((row) => String(row[props2.rowKey]));
21858
+ const allDataKeys = props2.dataSource.map(
21859
+ (row) => String(row[props2.rowKey])
21860
+ );
21845
21861
  const uncheckedKeys = difference(allDataKeys, checkedKeys);
21846
21862
  state.isAllChecked = isEmpty(uncheckedKeys) && props2.multiple && props2.checkable && checkedKeys.length > 0;
21847
21863
  };
21848
21864
  const setAllRowsChecked = (checked) => {
21849
- state.selectedRowsMap = mapValues(keyBy(props2.dataSource, props2.rowKey), () => checked);
21865
+ state.selectedRowsMap = mapValues(
21866
+ keyBy(props2.dataSource, props2.rowKey),
21867
+ () => checked
21868
+ );
21850
21869
  if (props2.multiple) {
21851
21870
  selectedKeys.value = checked ? keys(state.selectedRowsMap) : [];
21852
21871
  }
@@ -21867,7 +21886,10 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
21867
21886
  };
21868
21887
  const updateSelectedKeys = (keys2) => {
21869
21888
  if (props2.multiple) {
21870
- state.selectedRowsMap = mapValues(keyBy(props2.dataSource, props2.rowKey), () => false);
21889
+ state.selectedRowsMap = mapValues(
21890
+ keyBy(props2.dataSource, props2.rowKey),
21891
+ () => false
21892
+ );
21871
21893
  keys2.forEach((key) => {
21872
21894
  state.selectedRowsMap[key] = true;
21873
21895
  });
@@ -21905,7 +21927,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
21905
21927
  const tdWidth = width / (totalColumnWidth.value - fixedWidth) * (state.scrollClientWidth - fixedWidth);
21906
21928
  return `${sizeStyle};width: ${tdWidth}px;${customStyle}`;
21907
21929
  });
21908
- const renderCell = ({ column, row, index: index2 }) => {
21930
+ const renderCell = ({
21931
+ column,
21932
+ row,
21933
+ index: index2
21934
+ }) => {
21909
21935
  if (column.customRender) {
21910
21936
  return column.customRender({ row, column, index: index2, text: row[column.field] });
21911
21937
  }
@@ -21968,7 +21994,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
21968
21994
  class: "lew-table-td-group",
21969
21995
  style: `display: flex;`
21970
21996
  },
21971
- column.children.map((child) => readerHeaderTd({ column: child }))
21997
+ column.children.map(
21998
+ (child) => readerHeaderTd({ column: child })
21999
+ )
21972
22000
  ) : null
21973
22001
  ]
21974
22002
  );
@@ -22015,11 +22043,13 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
22015
22043
  };
22016
22044
  const computeTableRowHeight = () => {
22017
22045
  nextTick(() => {
22018
- (trRefArr.value || []).forEach((element, index2) => {
22019
- if (element) {
22020
- trHeightArr.value[index2] = element.getBoundingClientRect().height;
22046
+ (trRefArr.value || []).forEach(
22047
+ (element, index2) => {
22048
+ if (element) {
22049
+ trHeightArr.value[index2] = element.getBoundingClientRect().height;
22050
+ }
22021
22051
  }
22022
- });
22052
+ );
22023
22053
  });
22024
22054
  };
22025
22055
  const handleTableResize = throttle(() => {
@@ -22027,7 +22057,10 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
22027
22057
  const table = tableRef.value;
22028
22058
  if (!table) return;
22029
22059
  computeTableRowHeight();
22030
- let totalWidth = formatColumns.value.reduce((sum, col) => sum + Number(col.width), 0);
22060
+ let totalWidth = formatColumns.value.reduce(
22061
+ (sum, col) => sum + Number(col.width),
22062
+ 0
22063
+ );
22031
22064
  if (props2.checkable) {
22032
22065
  totalWidth += getCheckableWidth.value;
22033
22066
  }
@@ -22069,7 +22102,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
22069
22102
  onActivated(() => {
22070
22103
  init();
22071
22104
  if (props2.checkable && !props2.rowKey) {
22072
- throw new Error("LewTable error: rowKey is required when checkable is enabled!");
22105
+ throw new Error(
22106
+ "LewTable error: rowKey is required when checkable is enabled!"
22107
+ );
22073
22108
  }
22074
22109
  if (props2.columns.some(
22075
22110
  (col) => !col.width && (!col.children || col.children.length === 0)
@@ -22086,7 +22121,10 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
22086
22121
  watch(
22087
22122
  () => props2.dataSource,
22088
22123
  () => {
22089
- state.selectedRowsMap = mapValues(keyBy(props2.dataSource, props2.rowKey), () => false);
22124
+ state.selectedRowsMap = mapValues(
22125
+ keyBy(props2.dataSource, props2.rowKey),
22126
+ () => false
22127
+ );
22090
22128
  updateAllCheckedState();
22091
22129
  },
22092
22130
  { deep: true }
@@ -22147,7 +22185,10 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
22147
22185
  createElementVNode("div", {
22148
22186
  ref_key: "tableRef",
22149
22187
  ref: tableRef,
22150
- class: normalizeClass(["lew-table lew-scrollbar", { "lew-table-bordered": _ctx.bordered, "lew-table-scroll": unref(state).isScroll }]),
22188
+ class: normalizeClass(["lew-table lew-scrollbar", {
22189
+ "lew-table-bordered": _ctx.bordered,
22190
+ "lew-table-scroll": unref(state).isScroll
22191
+ }]),
22151
22192
  style: normalizeStyle(`max-height: ${unref(any2px)(_ctx.maxHeight)}`),
22152
22193
  onScroll: updateScrollState,
22153
22194
  onMouseleave: _cache[3] || (_cache[3] = ($event) => unref(state).hoverRowIndex = -1)
@@ -22626,7 +22667,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
22626
22667
  key: 0,
22627
22668
  class: "lew-pagination-page-btn",
22628
22669
  onClick: _cache[1] || (_cache[1] = ($event) => changePage(1))
22629
- }, "1")) : createCommentVNode("", true),
22670
+ }, " 1 ")) : createCommentVNode("", true),
22630
22671
  unref(startEllipsis) ? (openBlock(), createElementBlock("div", {
22631
22672
  key: 1,
22632
22673
  class: "lew-pagination-page-btn",
@@ -22713,7 +22754,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
22713
22754
  };
22714
22755
  }
22715
22756
  });
22716
- const LewPagination = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-2b643fcc"]]);
22757
+ const LewPagination = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-c1243157"]]);
22717
22758
  const treeModel = {
22718
22759
  modelValue: {
22719
22760
  type: [Array, String],
@@ -23240,7 +23281,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
23240
23281
  };
23241
23282
  }
23242
23283
  });
23243
- const LewTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-71f8c23d"]]);
23284
+ const LewTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-5989ad97"]]);
23244
23285
  const _hoisted_1$a = {
23245
23286
  key: 0,
23246
23287
  class: "lew-result-count"