knt-shared 1.9.0 → 1.9.2

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
@@ -2932,12 +2932,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2932
2932
  preload: "metadata"
2933
2933
  }) },
2934
2934
  emptyText: { default: "-" },
2935
- showEmptyState: { type: Boolean, default: true }
2935
+ showEmptyState: { type: Boolean, default: true },
2936
+ showErrorMessage: { type: Boolean, default: true },
2937
+ showSuccessMessage: { type: Boolean, default: true }
2936
2938
  },
2937
2939
  emits: ["register", "update:modelValue", "change", "success", "handleSuccess", "error", "handlError", "progress", "remove", "preview", "exceed", "sortChange"],
2938
2940
  setup(__props, { expose: __expose, emit: __emit }) {
2939
2941
  useCssVars((_ctx) => ({
2940
- "f72d42ee": cardSizeValue.value
2942
+ "fa001152": cardSizeValue.value
2941
2943
  }));
2942
2944
  const MAX_SIZE_UNIT_BYTES = {
2943
2945
  B: 1,
@@ -3171,7 +3173,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3171
3173
  if (code !== 200) {
3172
3174
  const errorMsg = message ? `上传失败: ${message}` : "上传失败";
3173
3175
  onError(new Error(errorMsg));
3174
- Message.error(errorMsg);
3176
+ if (propsData.showErrorMessage) Message.error(errorMsg);
3175
3177
  return;
3176
3178
  }
3177
3179
  const extractedUrl = extractUrlFromResponse(response);
@@ -3179,14 +3181,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3179
3181
  if (!extractedUrl) {
3180
3182
  logger.warn("响应中未找到 URL 字段,可能导致上传状态异常");
3181
3183
  }
3182
- Message.success(`${fileItem.name} 上传成功`);
3184
+ if (propsData.showSuccessMessage) Message.success(`${fileItem.name} 上传成功`);
3183
3185
  onSuccess(normalizedResponse);
3184
3186
  } catch (error) {
3185
3187
  onSuccess({ data: xhr.responseText });
3186
3188
  }
3187
3189
  } else {
3188
3190
  const errorMsg = `上传失败: HTTP ${xhr.status}`;
3189
- Message.error(errorMsg);
3191
+ if (propsData.showErrorMessage) Message.error(errorMsg);
3190
3192
  onError(new Error(errorMsg));
3191
3193
  }
3192
3194
  });
@@ -3592,7 +3594,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3592
3594
  };
3593
3595
  }
3594
3596
  });
3595
- const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-13e8439f"]]);
3597
+ const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-47c7dc74"]]);
3596
3598
  function useUpload(props) {
3597
3599
  const uploadRef = ref(null);
3598
3600
  const fileListRef = ref((props == null ? void 0 : props.defaultFileList) || []);
@@ -8155,7 +8157,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
8155
8157
  key: action.label
8156
8158
  }, [
8157
8159
  action.popConfirm ? (openBlock(), createBlock(unref(Popconfirm), {
8158
- key: 0,
8160
+ key: `${action.label}-confirm`,
8159
8161
  content: action.popConfirm.title,
8160
8162
  "ok-text": action.popConfirm.okText,
8161
8163
  "cancel-text": action.popConfirm.cancelText,
@@ -8188,7 +8190,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
8188
8190
  ]),
8189
8191
  _: 2
8190
8192
  }, 1032, ["content", "ok-text", "cancel-text", "onOk", "onCancel"])) : (openBlock(), createBlock(unref(Link), {
8191
- key: 1,
8193
+ key: `${action.label}-link`,
8192
8194
  status: action.color,
8193
8195
  disabled: getActionDisabled(action, slotProps.record),
8194
8196
  onClick: ($event) => handleActionClick(action, slotProps)
@@ -8307,7 +8309,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
8307
8309
  };
8308
8310
  }
8309
8311
  });
8310
- const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-5f63dbb6"]]);
8312
+ const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-b3a2e402"]]);
8311
8313
  function useTable(options = {}) {
8312
8314
  const tableRef = ref(null);
8313
8315
  const formRef = ref(null);