knt-shared 1.8.8 → 1.8.10

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
@@ -22,84 +22,6 @@ var _export_sfc$1 = (sfc, props) => {
22
22
  }
23
23
  return sfc;
24
24
  };
25
- const _sfc_main$z = defineComponent({
26
- name: "IconExclamationCircle",
27
- props: {
28
- size: {
29
- type: [Number, String]
30
- },
31
- strokeWidth: {
32
- type: Number,
33
- default: 4
34
- },
35
- strokeLinecap: {
36
- type: String,
37
- default: "butt",
38
- validator: (value) => {
39
- return ["butt", "round", "square"].includes(value);
40
- }
41
- },
42
- strokeLinejoin: {
43
- type: String,
44
- default: "miter",
45
- validator: (value) => {
46
- return ["arcs", "bevel", "miter", "miter-clip", "round"].includes(value);
47
- }
48
- },
49
- rotate: Number,
50
- spin: Boolean
51
- },
52
- emits: {
53
- click: (ev) => true
54
- },
55
- setup(props, { emit }) {
56
- const prefixCls = getPrefixCls("icon");
57
- const cls = computed(() => [prefixCls, `${prefixCls}-exclamation-circle`, { [`${prefixCls}-spin`]: props.spin }]);
58
- const innerStyle = computed(() => {
59
- const styles = {};
60
- if (props.size) {
61
- styles.fontSize = isNumber$1(props.size) ? `${props.size}px` : props.size;
62
- }
63
- if (props.rotate) {
64
- styles.transform = `rotate(${props.rotate}deg)`;
65
- }
66
- return styles;
67
- });
68
- const onClick = (ev) => {
69
- emit("click", ev);
70
- };
71
- return {
72
- cls,
73
- innerStyle,
74
- onClick
75
- };
76
- }
77
- });
78
- const _hoisted_1$u = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
79
- function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
80
- return openBlock(), createElementBlock("svg", {
81
- viewBox: "0 0 48 48",
82
- fill: "none",
83
- xmlns: "http://www.w3.org/2000/svg",
84
- stroke: "currentColor",
85
- class: normalizeClass(_ctx.cls),
86
- style: normalizeStyle(_ctx.innerStyle),
87
- "stroke-width": _ctx.strokeWidth,
88
- "stroke-linecap": _ctx.strokeLinecap,
89
- "stroke-linejoin": _ctx.strokeLinejoin,
90
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
91
- }, _cache[1] || (_cache[1] = [
92
- createElementVNode("path", { d: "M24 28V14m0 16v4M6 24c0-9.941 8.059-18 18-18s18 8.059 18 18-8.059 18-18 18S6 33.941 6 24Z" }, null, -1)
93
- ]), 14, _hoisted_1$u);
94
- }
95
- var _IconExclamationCircle = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["render", _sfc_render$h]]);
96
- const IconExclamationCircle = Object.assign(_IconExclamationCircle, {
97
- install: (app, options) => {
98
- var _a;
99
- const iconPrefix = (_a = options == null ? void 0 : options.iconPrefix) != null ? _a : "";
100
- app.component(iconPrefix + _IconExclamationCircle.name, _IconExclamationCircle);
101
- }
102
- });
103
25
  const _sfc_main$y = defineComponent({
104
26
  name: "IconPlus",
105
27
  props: {
@@ -2383,7 +2305,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2383
2305
  ])
2384
2306
  ])) : createCommentVNode("", true),
2385
2307
  __props.file.status === "error" ? (openBlock(), createElementBlock("div", _hoisted_6$4, [
2386
- createVNode(unref(IconExclamationCircle))
2308
+ !__props.disabled ? (openBlock(), createBlock(unref(IconDelete), {
2309
+ key: 0,
2310
+ class: "action-icon",
2311
+ onClick: handleRemove
2312
+ })) : createCommentVNode("", true)
2387
2313
  ])) : createCommentVNode("", true)
2388
2314
  ], 46, _hoisted_1$c);
2389
2315
  };
@@ -2396,7 +2322,7 @@ const _export_sfc = (sfc, props) => {
2396
2322
  }
2397
2323
  return target;
2398
2324
  };
2399
- const SortableFileItem = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-b7fe69e3"]]);
2325
+ const SortableFileItem = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-07a9ff47"]]);
2400
2326
  const _hoisted_1$b = { class: "sortable-file-list" };
2401
2327
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
2402
2328
  ...{
@@ -7206,7 +7132,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7206
7132
  return raw;
7207
7133
  }
7208
7134
  function resolveEmptyConfig(col) {
7209
- const colRaw = normalizeEmptyConfig(col.emptyConfig);
7135
+ const colRaw = normalizeEmptyConfig(
7136
+ col.emptyConfig
7137
+ );
7210
7138
  if (colRaw === false) return false;
7211
7139
  if (colRaw !== void 0) {
7212
7140
  return { enabled: true, text: "-", ...colRaw };
@@ -7219,13 +7147,16 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7219
7147
  }
7220
7148
  function resolveEllipsisEmptyConfig(col) {
7221
7149
  var _a;
7222
- const ellipsis = (_a = originalColumnsMap.value.get(col.dataIndex)) == null ? void 0 : _a.ellipsis;
7150
+ const ellipsis = (_a = originalColumnsMap.value.get(
7151
+ col.dataIndex
7152
+ )) == null ? void 0 : _a.ellipsis;
7223
7153
  if (ellipsis && typeof ellipsis === "object" && "emptyConfig" in ellipsis) {
7224
7154
  const ellipsisRaw = normalizeEmptyConfig(
7225
7155
  ellipsis.emptyConfig
7226
7156
  );
7227
7157
  if (ellipsisRaw === false) return false;
7228
- if (ellipsisRaw !== void 0) return { enabled: true, text: "-", ...ellipsisRaw };
7158
+ if (ellipsisRaw !== void 0)
7159
+ return { enabled: true, text: "-", ...ellipsisRaw };
7229
7160
  }
7230
7161
  return resolveEmptyConfig(col);
7231
7162
  }
@@ -7250,7 +7181,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7250
7181
  function resolveEllipsisTooltip(value, record, col) {
7251
7182
  var _a;
7252
7183
  const config = resolveEllipsisEmptyConfig(col);
7253
- const ellipsis = (_a = originalColumnsMap.value.get(col.dataIndex)) == null ? void 0 : _a.ellipsis;
7184
+ const ellipsis = (_a = originalColumnsMap.value.get(
7185
+ col.dataIndex
7186
+ )) == null ? void 0 : _a.ellipsis;
7254
7187
  const configuredTooltip = ellipsis && typeof ellipsis === "object" ? ellipsis.tooltip ?? true : true;
7255
7188
  if (!config || config.enabled === false) return configuredTooltip;
7256
7189
  if (isEmptyValue(value, record, config)) return false;
@@ -7319,7 +7252,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7319
7252
  watch(settingColumns, (newCols) => {
7320
7253
  if (!isColumnSettingReady.value) return;
7321
7254
  const currentKeys = new Set(checkedColumns.value);
7322
- const newKeys = newCols.filter((col) => col.dataIndex && !currentKeys.has(col.dataIndex)).map((col) => col.dataIndex);
7255
+ const newKeys = newCols.filter(
7256
+ (col) => col.dataIndex && !currentKeys.has(col.dataIndex)
7257
+ ).map((col) => col.dataIndex);
7323
7258
  if (newKeys.length > 0) {
7324
7259
  checkedColumns.value = [...checkedColumns.value, ...newKeys];
7325
7260
  }
@@ -7369,7 +7304,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7369
7304
  }
7370
7305
  return (pagination.current - 1) * pagination.pageSize + rowIndex + 1;
7371
7306
  };
7372
- const showConfirmModal = (action, record) => {
7307
+ const showConfirmModal = (action, slotProps) => {
7373
7308
  Modal.confirm({
7374
7309
  title: action.popConfirm.title,
7375
7310
  content: action.popConfirm.content,
@@ -7377,7 +7312,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7377
7312
  cancelText: action.popConfirm.cancelText,
7378
7313
  onOk: () => {
7379
7314
  var _a, _b;
7380
- return (_b = (_a = action.popConfirm).onConfirm) == null ? void 0 : _b.call(_a, record);
7315
+ return (_b = (_a = action.popConfirm).onConfirm) == null ? void 0 : _b.call(_a, slotProps);
7381
7316
  },
7382
7317
  onCancel: action.popConfirm.onCancel
7383
7318
  });
@@ -7425,9 +7360,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7425
7360
  }
7426
7361
  return action.disabled || false;
7427
7362
  };
7428
- const handleActionClick = (action, record) => {
7363
+ const handleActionClick = (action, slotProps) => {
7429
7364
  if (action.onClick) {
7430
- action.onClick(record);
7365
+ action.onClick(slotProps);
7431
7366
  }
7432
7367
  };
7433
7368
  const handleTableChange = (data, extra, currentData) => {
@@ -7610,9 +7545,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7610
7545
  ...selectableRows
7611
7546
  ]);
7612
7547
  } else {
7613
- selectedRowKeys.value = [
7614
- .../* @__PURE__ */ new Set([...otherPagesKeys, ...frozenKeys])
7615
- ];
7548
+ selectedRowKeys.value = [.../* @__PURE__ */ new Set([...otherPagesKeys, ...frozenKeys])];
7616
7549
  selectedRows.value = dedupeRowsByKey([...otherPagesRows, ...frozenRows]);
7617
7550
  }
7618
7551
  }
@@ -8228,7 +8161,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8228
8161
  "cancel-text": action.popConfirm.cancelText,
8229
8162
  onOk: ($event) => {
8230
8163
  var _a2, _b2;
8231
- return (_b2 = (_a2 = action.popConfirm).onConfirm) == null ? void 0 : _b2.call(_a2, slotProps.record);
8164
+ return (_b2 = (_a2 = action.popConfirm).onConfirm) == null ? void 0 : _b2.call(_a2, slotProps);
8232
8165
  },
8233
8166
  onCancel: action.popConfirm.onCancel
8234
8167
  }, {
@@ -8258,7 +8191,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8258
8191
  key: 1,
8259
8192
  status: action.color,
8260
8193
  disabled: getActionDisabled(action, slotProps.record),
8261
- onClick: ($event) => handleActionClick(action, slotProps.record)
8194
+ onClick: ($event) => handleActionClick(action, slotProps)
8262
8195
  }, createSlots({
8263
8196
  default: withCtx(() => [
8264
8197
  createTextVNode(" " + toDisplayString(action.label), 1)
@@ -8284,7 +8217,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8284
8217
  action.popConfirm ? (openBlock(), createBlock(unref(Doption), {
8285
8218
  key: 0,
8286
8219
  disabled: getActionDisabled(action, slotProps.record),
8287
- onClick: () => showConfirmModal(action, slotProps.record)
8220
+ onClick: () => showConfirmModal(action, slotProps)
8288
8221
  }, {
8289
8222
  default: withCtx(() => [
8290
8223
  createTextVNode(toDisplayString(action.label), 1)
@@ -8293,7 +8226,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8293
8226
  }, 1032, ["disabled", "onClick"])) : (openBlock(), createBlock(unref(Doption), {
8294
8227
  key: 1,
8295
8228
  disabled: getActionDisabled(action, slotProps.record),
8296
- onClick: ($event) => handleActionClick(action, slotProps.record)
8229
+ onClick: ($event) => handleActionClick(action, slotProps)
8297
8230
  }, createSlots({
8298
8231
  default: withCtx(() => [
8299
8232
  createTextVNode(" " + toDisplayString(action.label), 1)
@@ -8345,13 +8278,25 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8345
8278
  )), 1)
8346
8279
  ], 64)) : col.dataIndex && ((_a = originalColumnsMap.value.get(col.dataIndex)) == null ? void 0 : _a.ellipsis) && typeof ((_b = originalColumnsMap.value.get(col.dataIndex)) == null ? void 0 : _b.ellipsis) === "object" ? (openBlock(), createBlock(unref(BasicTextEllipsis), {
8347
8280
  key: 6,
8348
- text: resolveEllipsisText(slotProps.record[col.dataIndex], slotProps.record, col),
8281
+ text: resolveEllipsisText(
8282
+ slotProps.record[col.dataIndex],
8283
+ slotProps.record,
8284
+ col
8285
+ ),
8349
8286
  lines: originalColumnsMap.value.get(col.dataIndex).ellipsis.lines ?? 1,
8350
- tooltip: resolveEllipsisTooltip(slotProps.record[col.dataIndex], slotProps.record, col),
8287
+ tooltip: resolveEllipsisTooltip(
8288
+ slotProps.record[col.dataIndex],
8289
+ slotProps.record,
8290
+ col
8291
+ ),
8351
8292
  tooltipTrigger: originalColumnsMap.value.get(col.dataIndex).ellipsis.tooltipTrigger ?? "hover",
8352
8293
  tooltipProps: originalColumnsMap.value.get(col.dataIndex).ellipsis.tooltipProps
8353
8294
  }, null, 8, ["text", "lines", "tooltip", "tooltipTrigger", "tooltipProps"])) : (openBlock(), createElementBlock(Fragment, { key: 7 }, [
8354
- createTextVNode(toDisplayString(resolveEmptyValue(slotProps.record[col.dataIndex], slotProps.record, col)), 1)
8295
+ createTextVNode(toDisplayString(resolveEmptyValue(
8296
+ slotProps.record[col.dataIndex],
8297
+ slotProps.record,
8298
+ col
8299
+ )), 1)
8355
8300
  ], 64))
8356
8301
  ];
8357
8302
  })
@@ -8362,7 +8307,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8362
8307
  };
8363
8308
  }
8364
8309
  });
8365
- const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-f752ab5b"]]);
8310
+ const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-5f63dbb6"]]);
8366
8311
  function useTable(options = {}) {
8367
8312
  const tableRef = ref(null);
8368
8313
  const formRef = ref(null);