next-element-vue 0.5.4 → 0.5.6

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.umd.js CHANGED
@@ -2,8 +2,8 @@
2
2
  /**
3
3
  * 作  者:huangteng
4
4
  * 邮  箱:htengweb@163.com
5
- * 当前版本:0.5.4 v
6
- * 发布日期:2025-03-06
5
+ * 当前版本:0.5.6 v
6
+ * 发布日期:2025-03-27
7
7
  * 地  址:https://www.npmjs.com/package/next-element-vue
8
8
  */
9
9
 
@@ -3062,7 +3062,7 @@
3062
3062
  },
3063
3063
  emits: [ "change", "select", "close" ],
3064
3064
  setup(props, {emit: emit}) {
3065
- const {t: t} = useLocale(), router = vue.getCurrentInstance().appContext.config.globalProperties.$router, _activeTab = vue.computed((() => router.currentRoute.value.fullPath)), _tabs = vue.computed((() => props.tabs)), defaultIndex = _tabs.value?.findIndex((v => v.path === _activeTab.value));
3065
+ const {t: t} = useLocale(), router = vue.getCurrentInstance().appContext.config.globalProperties.$router, _activeTab = vue.computed((() => router.currentRoute.value.path)), _tabs = vue.computed((() => props.tabs)), defaultIndex = _tabs.value?.findIndex((v => v.path === _activeTab.value));
3066
3066
  if (defaultIndex < 0) {
3067
3067
  const tab = _tabs.value[0];
3068
3068
  tab && tab.path && router.replace({
@@ -3101,7 +3101,7 @@
3101
3101
  path: tab.path,
3102
3102
  query: tab.query || {}
3103
3103
  };
3104
- tab.name && (to = {
3104
+ !tab.path && tab.name && (to = {
3105
3105
  name: tab.name,
3106
3106
  params: tab.params || {}
3107
3107
  }), router.push(to), emit("select", tab, index);
@@ -3135,12 +3135,12 @@
3135
3135
  if (active === tab.path) {
3136
3136
  const prevTag = tabsView.value[index - 1];
3137
3137
  let to = {
3138
- path: tab.path,
3139
- query: tab.query || {}
3138
+ path: prevTag.path,
3139
+ query: prevTag.query || {}
3140
3140
  };
3141
- tab.name && (to = {
3142
- name: tab.name,
3143
- params: tab.params || {}
3141
+ !prevTag.path && prevTag.name && (to = {
3142
+ name: prevTag.name,
3143
+ params: prevTag.params || {}
3144
3144
  }), router.push(to), emit("close", prevTag, tabsView.value);
3145
3145
  }
3146
3146
  tabsView.value.splice(index, 1);
@@ -4421,8 +4421,8 @@
4421
4421
  onCloseTableDialog(), emit("select", _rows);
4422
4422
  }, onClickAddEdit = (row, tableFormParams) => {
4423
4423
  _column.addEditData?.(row, tableFormParams);
4424
- }, renderSelectTypeContent = (row, index) => {
4425
- const rowKey = _options.rowKey, value = valueExist(row[rowKey], index);
4424
+ }, renderSelectTypeContent = row => {
4425
+ const rowKey = _options.rowKey, value = valueExist(row[rowKey], null);
4426
4426
  return "checkbox" === _options.selectType ? vue.createVNode(elementPlus.ElCheckbox, {
4427
4427
  value: value,
4428
4428
  onChange: event => ((event, row) => {
@@ -4467,7 +4467,8 @@
4467
4467
  });
4468
4468
  const _onCloseTag = (tag, i) => {
4469
4469
  const rows = vue.toRaw(multipleSelection.value);
4470
- rows.splice(i, 1), multipleSelection.value = rows, _updateTags(), emit("select", rows);
4470
+ rows.splice(i, 1), multipleSelection.value = rows, "radio" === _options.selectType && (sinleSelection.value = null),
4471
+ _updateTags(), emit("select", rows);
4471
4472
  }, renderContent = () => {
4472
4473
  let _slot, _slot2;
4473
4474
  return vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
@@ -4533,7 +4534,7 @@
4533
4534
  headerAlign: _options.headerAlign,
4534
4535
  align: _options.cellAlign
4535
4536
  }, {
4536
- default: ({row: row, $index: $index}) => renderSelectTypeContent(row, $index)
4537
+ default: ({row: row}) => renderSelectTypeContent(row)
4537
4538
  }) ]
4538
4539
  }) ]
4539
4540
  }) : vue.createVNode(elementPlus.ElRadioGroup, {
@@ -4554,7 +4555,7 @@
4554
4555
  headerAlign: _options.headerAlign,
4555
4556
  align: _options.cellAlign
4556
4557
  }, {
4557
- default: ({row: row, $index: $index}) => renderSelectTypeContent(row, $index)
4558
+ default: ({row: row}) => renderSelectTypeContent(row)
4558
4559
  }) ]
4559
4560
  }) ]
4560
4561
  }) ]), vue.createVNode("div", {
@@ -5008,10 +5009,9 @@
5008
5009
  disabled: col.disabled,
5009
5010
  placeholder: placeholder,
5010
5011
  onInput: event => ((val, key) => {
5011
- let value = val;
5012
- value = value.replace(/[^0-9\.]/g, ""), value = value.replace(/^\./, "0."), value = value.replace(/\.{2,}/g, "."),
5013
- value = value.replace(".", "DUMMY"), value = value.replace(/\./g, ""), value = value.replace("DUMMY", "."),
5014
- formParams[key] = Number(value);
5012
+ let value = val.toString();
5013
+ value = value.replace(/[^0-9.]/g, ""), value.startsWith(".") && (value = "0" + value),
5014
+ value = value.replace(/^(\d*\.\d*)\./g, "$1"), formParams[key] = value;
5015
5015
  })(event, col.prop),
5016
5016
  onChange: event => col.onChange?.(event, col, formParams, formColumns)
5017
5017
  }, {
@@ -5201,7 +5201,8 @@
5201
5201
  onSelect: rows => ((rows, col) => {
5202
5202
  rows && (col.tableSelectRows = rows);
5203
5203
  const {value: value} = col.tableSelectProps || {};
5204
- formParams[col.prop] = rows.map((row => row[value || "value"])), col.onTableSelect?.(formParams, rows, col);
5204
+ formParams[col.prop] = rows.map((row => row[value || "value"])), col.onTableSelect?.(formParams, rows, col),
5205
+ ruleFormRef.value?.validateField(col.prop);
5205
5206
  })(rows, col)
5206
5207
  }, null) : "uploadImage" === col.type ? vue.createVNode(UploadImage, {
5207
5208
  modelValue: formParams[col.prop],
@@ -5269,9 +5270,7 @@
5269
5270
  placement: "top"
5270
5271
  }, {
5271
5272
  default: () => [ vue.createVNode(elementPlus.ElIcon, {
5272
- style: {
5273
- "margin-left": "5px"
5274
- },
5273
+ class: ns$8.e("item-tip"),
5275
5274
  color: "#f3d19e"
5276
5275
  }, {
5277
5276
  default: () => [ vue.createVNode(info_filled_default, null, null) ]
@@ -5540,7 +5539,7 @@
5540
5539
  }), onClickHeaderAdd = (row = {}) => {
5541
5540
  const {dialogTitle: dialogTitle} = options;
5542
5541
  addEditDialog.isEditing = !0, addEditDialog.title = dialogTitle + " " + t("next.table.add"),
5543
- addEditDialog.rowInfo = row, emit("click-add-edit", row), vue.nextTick((() => {
5542
+ addEditDialog.rowInfo = row, emit("click-add-edit", row, options), vue.nextTick((() => {
5544
5543
  addEditDialog.visible = !0;
5545
5544
  }));
5546
5545
  }, onClickDeleteRows = rows => {
@@ -5554,7 +5553,8 @@
5554
5553
  }, onClickRowEdit = scoped => {
5555
5554
  const {dialogTitle: dialogTitle} = options;
5556
5555
  addEditDialog.isEditing = !0, addEditDialog.title = dialogTitle + " " + t("next.table.edit"),
5557
- addEditDialog.rowInfo = scoped.row, emit("click-add-edit", scoped.row), vue.nextTick((() => {
5556
+ addEditDialog.rowInfo = scoped.row, emit("click-add-edit", scoped.row, options),
5557
+ vue.nextTick((() => {
5558
5558
  addEditDialog.visible = !0;
5559
5559
  }));
5560
5560
  }, onClickRowView = scoped => {
@@ -8270,7 +8270,7 @@
8270
8270
  })(app);
8271
8271
  };
8272
8272
  var index = {
8273
- version: "0.5.4",
8273
+ version: "0.5.6",
8274
8274
  install: install
8275
8275
  };
8276
8276
  exports.NextCarousel = NextCarousel, exports.NextContainer = NextContainer, exports.NextCrudTable = NextCrudTable,
@@ -8318,7 +8318,7 @@
8318
8318
  }), exports.useGetDerivedNamespace = useGetDerivedNamespace, exports.useLanguage = (locale, lang) => {
8319
8319
  const localeRef = vue.isRef(locale) ? locale : vue.ref(locale), nextLang = localeLang[lang] || localeLang["zh-cn"];
8320
8320
  localeRef.value.name = lang, localeRef.value.next = nextLang.next;
8321
- }, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.5.4",
8321
+ }, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.5.6",
8322
8322
  Object.defineProperty(exports, "__esModule", {
8323
8323
  value: !0
8324
8324
  });