knt-shared 1.5.0 → 1.5.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
@@ -1,5 +1,5 @@
1
1
  import { getCurrentInstance, inject, defineComponent, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, resolveComponent, createCommentVNode, createVNode, createBlock, unref, reactive, Fragment, renderList, withModifiers, ref, watch, onMounted, onUnmounted, withDirectives, vModelText, vShow, toDisplayString, withCtx, createTextVNode, useCssVars, nextTick, mergeProps, createSlots, renderSlot, onBeforeUnmount, toRef, normalizeProps, guardReactiveProps, h, resolveDynamicComponent, useSlots } from "vue";
2
- import { Message, Transfer, Mention, Upload, Rate, Slider, Switch, RangePicker, TimePicker, DatePicker, TreeSelect, Cascader, CheckboxGroup, Checkbox, RadioGroup, Radio, Select, AutoComplete, Textarea, InputPassword, InputNumber, Input, ImagePreviewGroup, Image } from "@arco-design/web-vue";
2
+ import { Message, Transfer, Mention, Upload, Rate, Slider, Switch, RangePicker, TimePicker, DatePicker, TreeSelect, Cascader, CheckboxGroup, Checkbox, RadioGroup, Radio, Select, AutoComplete, Textarea, InputPassword, InputNumber, Input, ImagePreviewGroup, Image, Modal } from "@arco-design/web-vue";
3
3
  const configProviderInjectionKey = Symbol("ArcoConfigProvider");
4
4
  const CLASS_PREFIX = "arco";
5
5
  const GLOBAL_CONFIG_NAME = "$arco";
@@ -2096,7 +2096,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2096
2096
  emits: ["register", "update:modelValue", "change", "success", "handleSuccess", "error", "handlError", "progress", "remove", "preview", "exceed", "sortChange"],
2097
2097
  setup(__props, { expose: __expose, emit: __emit }) {
2098
2098
  useCssVars((_ctx) => ({
2099
- "v5e570a54": cardSizeValue.value
2099
+ "v51ea86e4": cardSizeValue.value
2100
2100
  }));
2101
2101
  const props = __props;
2102
2102
  const emit = __emit;
@@ -2120,6 +2120,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2120
2120
  const propsData = unref(getProps);
2121
2121
  if (!propsData.showUploadButton) return true;
2122
2122
  if (propsData.readonly) return true;
2123
+ if (propsData.disabled) return true;
2123
2124
  if (propsData.maxCount && fileListRef.value.length >= propsData.maxCount) {
2124
2125
  return true;
2125
2126
  }
@@ -2707,7 +2708,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2707
2708
  };
2708
2709
  }
2709
2710
  });
2710
- const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-640a0bf9"]]);
2711
+ const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-6291bab5"]]);
2711
2712
  function useUpload(props) {
2712
2713
  const uploadRef = ref(null);
2713
2714
  const fileListRef = ref((props == null ? void 0 : props.defaultFileList) || []);
@@ -3931,7 +3932,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3931
3932
  };
3932
3933
  }
3933
3934
  });
3934
- const BasicReadonlyField = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-60b318e5"]]);
3935
+ const BasicReadonlyField = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-1428cd76"]]);
3935
3936
  function useReadonlyField(options) {
3936
3937
  const defaultEmptyText = (options == null ? void 0 : options.defaultEmptyText) || "-";
3937
3938
  const globalLabelMap = (options == null ? void 0 : options.globalLabelMap) || {};
@@ -6222,6 +6223,19 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6222
6223
  }
6223
6224
  return (pagination.current - 1) * pagination.pageSize + rowIndex + 1;
6224
6225
  };
6226
+ const showConfirmModal = (action, record) => {
6227
+ Modal.confirm({
6228
+ title: action.popConfirm.title,
6229
+ content: action.popConfirm.content,
6230
+ okText: action.popConfirm.okText,
6231
+ cancelText: action.popConfirm.cancelText,
6232
+ onOk: () => {
6233
+ var _a, _b;
6234
+ return (_b = (_a = action.popConfirm).onConfirm) == null ? void 0 : _b.call(_a, record);
6235
+ },
6236
+ onCancel: action.popConfirm.onCancel
6237
+ });
6238
+ };
6225
6239
  const renderCustomCell = (col, slotProps) => {
6226
6240
  if (!col.customRender) return null;
6227
6241
  const result = col.customRender(slotProps);
@@ -6445,7 +6459,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6445
6459
  };
6446
6460
  }
6447
6461
  if (!Array.isArray(result[listField])) {
6448
- console.warn(`API 响应格式警告:${listField} 字段不是数组,已转换为空数组`);
6462
+ console.warn(
6463
+ `API 响应格式警告:${listField} 字段不是数组,已转换为空数组`
6464
+ );
6449
6465
  }
6450
6466
  let data = Array.isArray(result[listField]) ? result[listField] : [];
6451
6467
  let total = typeof result[totalField] === "number" ? result[totalField] : data.length;
@@ -6855,25 +6871,25 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6855
6871
  }, {
6856
6872
  content: withCtx(() => [
6857
6873
  createVNode(_component_a_doption, { value: "mini" }, {
6858
- default: withCtx(() => [..._cache[3] || (_cache[3] = [
6874
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
6859
6875
  createTextVNode("紧凑", -1)
6860
6876
  ])]),
6861
6877
  _: 1
6862
6878
  }),
6863
6879
  createVNode(_component_a_doption, { value: "small" }, {
6864
- default: withCtx(() => [..._cache[4] || (_cache[4] = [
6880
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
6865
6881
  createTextVNode("偏小", -1)
6866
6882
  ])]),
6867
6883
  _: 1
6868
6884
  }),
6869
6885
  createVNode(_component_a_doption, { value: "medium" }, {
6870
- default: withCtx(() => [..._cache[5] || (_cache[5] = [
6886
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
6871
6887
  createTextVNode("默认", -1)
6872
6888
  ])]),
6873
6889
  _: 1
6874
6890
  }),
6875
6891
  createVNode(_component_a_doption, { value: "large" }, {
6876
- default: withCtx(() => [..._cache[6] || (_cache[6] = [
6892
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
6877
6893
  createTextVNode("宽松", -1)
6878
6894
  ])]),
6879
6895
  _: 1
@@ -7052,40 +7068,16 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7052
7068
  return openBlock(), createElementBlock(Fragment, {
7053
7069
  key: action.label
7054
7070
  }, [
7055
- action.popConfirm ? (openBlock(), createBlock(_component_a_popconfirm, {
7071
+ action.popConfirm ? (openBlock(), createBlock(_component_a_doption, {
7056
7072
  key: 0,
7057
- content: action.popConfirm.title,
7058
- "ok-text": action.popConfirm.okText,
7059
- "cancel-text": action.popConfirm.cancelText,
7060
- position: "lt",
7061
- onOk: ($event) => {
7062
- var _a2, _b2;
7063
- return (_b2 = (_a2 = action.popConfirm).onConfirm) == null ? void 0 : _b2.call(_a2, slotProps.record);
7064
- },
7065
- onCancel: action.popConfirm.onCancel
7073
+ disabled: getActionDisabled(action, slotProps.record),
7074
+ onClick: () => showConfirmModal(action, slotProps.record)
7066
7075
  }, {
7067
7076
  default: withCtx(() => [
7068
- createVNode(_component_a_doption, {
7069
- disabled: getActionDisabled(action, slotProps.record),
7070
- onClick: _cache[2] || (_cache[2] = withModifiers(() => {
7071
- }, ["stop"]))
7072
- }, createSlots({
7073
- default: withCtx(() => [
7074
- createTextVNode(" " + toDisplayString(action.label), 1)
7075
- ]),
7076
- _: 2
7077
- }, [
7078
- action.icon ? {
7079
- name: "icon",
7080
- fn: withCtx(() => [
7081
- (openBlock(), createBlock(resolveDynamicComponent(action.icon)))
7082
- ]),
7083
- key: "0"
7084
- } : void 0
7085
- ]), 1032, ["disabled"])
7077
+ createTextVNode(toDisplayString(action.label), 1)
7086
7078
  ]),
7087
7079
  _: 2
7088
- }, 1032, ["content", "ok-text", "cancel-text", "onOk", "onCancel"])) : (openBlock(), createBlock(_component_a_doption, {
7080
+ }, 1032, ["disabled", "onClick"])) : (openBlock(), createBlock(_component_a_doption, {
7089
7081
  key: 1,
7090
7082
  disabled: getActionDisabled(action, slotProps.record),
7091
7083
  onClick: ($event) => handleActionClick(action, slotProps.record)
@@ -7153,7 +7145,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7153
7145
  };
7154
7146
  }
7155
7147
  });
7156
- const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-a9281777"]]);
7148
+ const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-e9508ce7"]]);
7157
7149
  function useTable(options = {}) {
7158
7150
  const tableRef = ref(null);
7159
7151
  const formRef = ref(null);