knt-shared 1.10.4 → 1.10.5

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.esm.js CHANGED
@@ -6817,6 +6817,12 @@ function useTableEdit(props, dataSource, getRowKey) {
6817
6817
  cancelEdit(record);
6818
6818
  });
6819
6819
  };
6820
+ const clearEditingRows = () => {
6821
+ Object.keys(editingStateMap).forEach((key) => delete editingStateMap[key]);
6822
+ Object.keys(editValueMap).forEach((key) => delete editValueMap[key]);
6823
+ Object.keys(originalDataMap).forEach((key) => delete originalDataMap[key]);
6824
+ Object.keys(validationErrorMap).forEach((key) => delete validationErrorMap[key]);
6825
+ };
6820
6826
  return {
6821
6827
  editingStateMap,
6822
6828
  editValueMap,
@@ -6833,6 +6839,7 @@ function useTableEdit(props, dataSource, getRowKey) {
6833
6839
  getEditingRows,
6834
6840
  saveAllEdits,
6835
6841
  cancelAllEdits,
6842
+ clearEditingRows,
6836
6843
  getChangedValues
6837
6844
  };
6838
6845
  }
@@ -7156,6 +7163,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
7156
7163
  getEditingRows,
7157
7164
  saveAllEdits,
7158
7165
  cancelAllEdits,
7166
+ clearEditingRows,
7159
7167
  getChangedValues
7160
7168
  } = useTableEdit(getMergedProps, dataSource, getRowKey);
7161
7169
  const originalColumnsMap = computed(() => {
@@ -7837,6 +7845,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
7837
7845
  getEditingRows,
7838
7846
  saveAllEdits,
7839
7847
  cancelAllEdits,
7848
+ clearEditingRows,
7840
7849
  isEditing,
7841
7850
  getEditValue,
7842
7851
  setEditValue,
@@ -7881,6 +7890,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
7881
7890
  getEditingRows,
7882
7891
  saveAllEdits,
7883
7892
  cancelAllEdits,
7893
+ clearEditingRows,
7884
7894
  isEditing,
7885
7895
  getEditValue,
7886
7896
  setEditValue,
@@ -8350,7 +8360,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
8350
8360
  };
8351
8361
  }
8352
8362
  });
8353
- const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-b3a2e402"]]);
8363
+ const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-1a0967ac"]]);
8354
8364
  function useTable(options = {}) {
8355
8365
  const tableRef = ref(null);
8356
8366
  const formRef = ref(null);
@@ -8627,6 +8637,13 @@ function useTable(options = {}) {
8627
8637
  table.cancelAllEdits();
8628
8638
  }
8629
8639
  };
8640
+ const clearEditingRows = () => {
8641
+ const table = getTable();
8642
+ if (!table) return;
8643
+ if (table.clearEditingRows) {
8644
+ table.clearEditingRows();
8645
+ }
8646
+ };
8630
8647
  const isEditing = (record, column) => {
8631
8648
  const table = getTable();
8632
8649
  if (!table) return false;
@@ -8694,6 +8711,7 @@ function useTable(options = {}) {
8694
8711
  getEditingRows,
8695
8712
  saveAllEdits,
8696
8713
  cancelAllEdits,
8714
+ clearEditingRows,
8697
8715
  isEditing,
8698
8716
  getEditValue,
8699
8717
  setEditValue,