knt-shared 1.8.8 → 1.8.9

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
@@ -7206,7 +7206,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7206
7206
  return raw;
7207
7207
  }
7208
7208
  function resolveEmptyConfig(col) {
7209
- const colRaw = normalizeEmptyConfig(col.emptyConfig);
7209
+ const colRaw = normalizeEmptyConfig(
7210
+ col.emptyConfig
7211
+ );
7210
7212
  if (colRaw === false) return false;
7211
7213
  if (colRaw !== void 0) {
7212
7214
  return { enabled: true, text: "-", ...colRaw };
@@ -7219,13 +7221,16 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7219
7221
  }
7220
7222
  function resolveEllipsisEmptyConfig(col) {
7221
7223
  var _a;
7222
- const ellipsis = (_a = originalColumnsMap.value.get(col.dataIndex)) == null ? void 0 : _a.ellipsis;
7224
+ const ellipsis = (_a = originalColumnsMap.value.get(
7225
+ col.dataIndex
7226
+ )) == null ? void 0 : _a.ellipsis;
7223
7227
  if (ellipsis && typeof ellipsis === "object" && "emptyConfig" in ellipsis) {
7224
7228
  const ellipsisRaw = normalizeEmptyConfig(
7225
7229
  ellipsis.emptyConfig
7226
7230
  );
7227
7231
  if (ellipsisRaw === false) return false;
7228
- if (ellipsisRaw !== void 0) return { enabled: true, text: "-", ...ellipsisRaw };
7232
+ if (ellipsisRaw !== void 0)
7233
+ return { enabled: true, text: "-", ...ellipsisRaw };
7229
7234
  }
7230
7235
  return resolveEmptyConfig(col);
7231
7236
  }
@@ -7250,7 +7255,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7250
7255
  function resolveEllipsisTooltip(value, record, col) {
7251
7256
  var _a;
7252
7257
  const config = resolveEllipsisEmptyConfig(col);
7253
- const ellipsis = (_a = originalColumnsMap.value.get(col.dataIndex)) == null ? void 0 : _a.ellipsis;
7258
+ const ellipsis = (_a = originalColumnsMap.value.get(
7259
+ col.dataIndex
7260
+ )) == null ? void 0 : _a.ellipsis;
7254
7261
  const configuredTooltip = ellipsis && typeof ellipsis === "object" ? ellipsis.tooltip ?? true : true;
7255
7262
  if (!config || config.enabled === false) return configuredTooltip;
7256
7263
  if (isEmptyValue(value, record, config)) return false;
@@ -7319,7 +7326,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7319
7326
  watch(settingColumns, (newCols) => {
7320
7327
  if (!isColumnSettingReady.value) return;
7321
7328
  const currentKeys = new Set(checkedColumns.value);
7322
- const newKeys = newCols.filter((col) => col.dataIndex && !currentKeys.has(col.dataIndex)).map((col) => col.dataIndex);
7329
+ const newKeys = newCols.filter(
7330
+ (col) => col.dataIndex && !currentKeys.has(col.dataIndex)
7331
+ ).map((col) => col.dataIndex);
7323
7332
  if (newKeys.length > 0) {
7324
7333
  checkedColumns.value = [...checkedColumns.value, ...newKeys];
7325
7334
  }
@@ -7369,7 +7378,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7369
7378
  }
7370
7379
  return (pagination.current - 1) * pagination.pageSize + rowIndex + 1;
7371
7380
  };
7372
- const showConfirmModal = (action, record) => {
7381
+ const showConfirmModal = (action, slotProps) => {
7373
7382
  Modal.confirm({
7374
7383
  title: action.popConfirm.title,
7375
7384
  content: action.popConfirm.content,
@@ -7377,7 +7386,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7377
7386
  cancelText: action.popConfirm.cancelText,
7378
7387
  onOk: () => {
7379
7388
  var _a, _b;
7380
- return (_b = (_a = action.popConfirm).onConfirm) == null ? void 0 : _b.call(_a, record);
7389
+ return (_b = (_a = action.popConfirm).onConfirm) == null ? void 0 : _b.call(_a, slotProps);
7381
7390
  },
7382
7391
  onCancel: action.popConfirm.onCancel
7383
7392
  });
@@ -7425,9 +7434,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7425
7434
  }
7426
7435
  return action.disabled || false;
7427
7436
  };
7428
- const handleActionClick = (action, record) => {
7437
+ const handleActionClick = (action, slotProps) => {
7429
7438
  if (action.onClick) {
7430
- action.onClick(record);
7439
+ action.onClick(slotProps);
7431
7440
  }
7432
7441
  };
7433
7442
  const handleTableChange = (data, extra, currentData) => {
@@ -7610,9 +7619,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7610
7619
  ...selectableRows
7611
7620
  ]);
7612
7621
  } else {
7613
- selectedRowKeys.value = [
7614
- .../* @__PURE__ */ new Set([...otherPagesKeys, ...frozenKeys])
7615
- ];
7622
+ selectedRowKeys.value = [.../* @__PURE__ */ new Set([...otherPagesKeys, ...frozenKeys])];
7616
7623
  selectedRows.value = dedupeRowsByKey([...otherPagesRows, ...frozenRows]);
7617
7624
  }
7618
7625
  }
@@ -8228,7 +8235,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8228
8235
  "cancel-text": action.popConfirm.cancelText,
8229
8236
  onOk: ($event) => {
8230
8237
  var _a2, _b2;
8231
- return (_b2 = (_a2 = action.popConfirm).onConfirm) == null ? void 0 : _b2.call(_a2, slotProps.record);
8238
+ return (_b2 = (_a2 = action.popConfirm).onConfirm) == null ? void 0 : _b2.call(_a2, slotProps);
8232
8239
  },
8233
8240
  onCancel: action.popConfirm.onCancel
8234
8241
  }, {
@@ -8258,7 +8265,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8258
8265
  key: 1,
8259
8266
  status: action.color,
8260
8267
  disabled: getActionDisabled(action, slotProps.record),
8261
- onClick: ($event) => handleActionClick(action, slotProps.record)
8268
+ onClick: ($event) => handleActionClick(action, slotProps)
8262
8269
  }, createSlots({
8263
8270
  default: withCtx(() => [
8264
8271
  createTextVNode(" " + toDisplayString(action.label), 1)
@@ -8284,7 +8291,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8284
8291
  action.popConfirm ? (openBlock(), createBlock(unref(Doption), {
8285
8292
  key: 0,
8286
8293
  disabled: getActionDisabled(action, slotProps.record),
8287
- onClick: () => showConfirmModal(action, slotProps.record)
8294
+ onClick: () => showConfirmModal(action, slotProps)
8288
8295
  }, {
8289
8296
  default: withCtx(() => [
8290
8297
  createTextVNode(toDisplayString(action.label), 1)
@@ -8293,7 +8300,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8293
8300
  }, 1032, ["disabled", "onClick"])) : (openBlock(), createBlock(unref(Doption), {
8294
8301
  key: 1,
8295
8302
  disabled: getActionDisabled(action, slotProps.record),
8296
- onClick: ($event) => handleActionClick(action, slotProps.record)
8303
+ onClick: ($event) => handleActionClick(action, slotProps)
8297
8304
  }, createSlots({
8298
8305
  default: withCtx(() => [
8299
8306
  createTextVNode(" " + toDisplayString(action.label), 1)
@@ -8345,13 +8352,25 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8345
8352
  )), 1)
8346
8353
  ], 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
8354
  key: 6,
8348
- text: resolveEllipsisText(slotProps.record[col.dataIndex], slotProps.record, col),
8355
+ text: resolveEllipsisText(
8356
+ slotProps.record[col.dataIndex],
8357
+ slotProps.record,
8358
+ col
8359
+ ),
8349
8360
  lines: originalColumnsMap.value.get(col.dataIndex).ellipsis.lines ?? 1,
8350
- tooltip: resolveEllipsisTooltip(slotProps.record[col.dataIndex], slotProps.record, col),
8361
+ tooltip: resolveEllipsisTooltip(
8362
+ slotProps.record[col.dataIndex],
8363
+ slotProps.record,
8364
+ col
8365
+ ),
8351
8366
  tooltipTrigger: originalColumnsMap.value.get(col.dataIndex).ellipsis.tooltipTrigger ?? "hover",
8352
8367
  tooltipProps: originalColumnsMap.value.get(col.dataIndex).ellipsis.tooltipProps
8353
8368
  }, null, 8, ["text", "lines", "tooltip", "tooltipTrigger", "tooltipProps"])) : (openBlock(), createElementBlock(Fragment, { key: 7 }, [
8354
- createTextVNode(toDisplayString(resolveEmptyValue(slotProps.record[col.dataIndex], slotProps.record, col)), 1)
8369
+ createTextVNode(toDisplayString(resolveEmptyValue(
8370
+ slotProps.record[col.dataIndex],
8371
+ slotProps.record,
8372
+ col
8373
+ )), 1)
8355
8374
  ], 64))
8356
8375
  ];
8357
8376
  })
@@ -8362,7 +8381,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8362
8381
  };
8363
8382
  }
8364
8383
  });
8365
- const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-f752ab5b"]]);
8384
+ const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-5f63dbb6"]]);
8366
8385
  function useTable(options = {}) {
8367
8386
  const tableRef = ref(null);
8368
8387
  const formRef = ref(null);