knt-shared 1.1.4 → 1.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"BasicTable.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Table/BasicTable.vue"],"names":[],"mappings":"AA0LA;AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAYtD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAA+B,qBAAqB,EAAyC,MAAM,SAAS,CAAC;AA6hCvJ,iBAAS,cAAc,uCAuxBiE,GAAG;wBAE1D,GAAG;;;QACN,GAAG;EAGhC;AAqDD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;0BArkCc,SAAS,EAAE;mBAOlB;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;+BAeX,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE;gCAIlB,MAAM,GAAG,MAAM;;;;;;;;;;;;0BAMf,OAAO,CAAC,qBAAqB,CAAC;;oBAI1C,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO;6BAGtB,WAAW,EAAE;;yBAIjB,OAAO,CAAC,eAAe,CAAC;0BAQ7B,OAAO;;kCAMO,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFAohC5D,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,E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I;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AACxD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -1232,7 +1232,10 @@ const _hoisted_5$1 = {
1232
1232
  key: 0,
1233
1233
  class: "toolbar-title"
1234
1234
  };
1235
- const _hoisted_6 = { class: "toolbar-right" };
1235
+ const _hoisted_6 = {
1236
+ key: 0,
1237
+ class: "toolbar-right"
1238
+ };
1236
1239
  const _hoisted_7 = { class: "column-setting" };
1237
1240
  const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1238
1241
  ...{
@@ -1366,11 +1369,11 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1366
1369
  return { show: false };
1367
1370
  }
1368
1371
  return {
1369
- show: true,
1370
- showRefresh: true,
1371
- showColumnSetting: true,
1372
- showFullscreen: true,
1373
- showDensity: true,
1372
+ show: false,
1373
+ showRefresh: false,
1374
+ showColumnSetting: false,
1375
+ showFullscreen: false,
1376
+ showDensity: false,
1374
1377
  ...toolbar
1375
1378
  };
1376
1379
  });
@@ -1535,7 +1538,33 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1535
1538
  });
1536
1539
  const getBindValues = vue.computed(() => {
1537
1540
  const mergedProps = getMergedProps.value;
1538
- const { columns, data, loading, pagination, search, toolbar, api, beforeFetch, afterFetch, onFetchError, immediate, showIndexColumn, indexColumnProps, showActionColumn, actionColumn, rowKey, expandable, scroll, draggable, bordered, stripe, showHeader, size, rowSelection, ...rest } = mergedProps;
1541
+ const {
1542
+ columns,
1543
+ data,
1544
+ loading,
1545
+ pagination,
1546
+ search,
1547
+ toolbar,
1548
+ api,
1549
+ beforeFetch,
1550
+ afterFetch,
1551
+ onFetchError,
1552
+ immediate,
1553
+ showIndexColumn,
1554
+ indexColumnProps,
1555
+ showActionColumn,
1556
+ actionColumn,
1557
+ rowKey,
1558
+ expandable,
1559
+ scroll,
1560
+ draggable,
1561
+ bordered,
1562
+ stripe,
1563
+ showHeader,
1564
+ size,
1565
+ rowSelection,
1566
+ ...rest
1567
+ } = mergedProps;
1539
1568
  return rest;
1540
1569
  });
1541
1570
  const getIndexNumber = (rowIndex) => {
@@ -1682,12 +1711,16 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1682
1711
  };
1683
1712
  const handleSelect = (rowKeys, rowKey, record) => {
1684
1713
  selectedRowKeys.value = rowKeys;
1685
- selectedRows.value = dataSource.value.filter((item) => rowKeys.includes(getRowKey(item)));
1714
+ selectedRows.value = dataSource.value.filter(
1715
+ (item) => rowKeys.includes(getRowKey(item))
1716
+ );
1686
1717
  emit("select", rowKeys, rowKey, record);
1687
1718
  };
1688
1719
  const handleSelectAll = (checked) => {
1689
1720
  if (checked) {
1690
- selectedRowKeys.value = dataSource.value.map((item) => getRowKey(item));
1721
+ selectedRowKeys.value = dataSource.value.map(
1722
+ (item) => getRowKey(item)
1723
+ );
1691
1724
  selectedRows.value = [...dataSource.value];
1692
1725
  } else {
1693
1726
  selectedRowKeys.value = [];
@@ -1751,7 +1784,9 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1751
1784
  let data = Array.isArray(result.data) ? result.data : [];
1752
1785
  let total = typeof result.total === "number" ? result.total : 0;
1753
1786
  if (total < data.length) {
1754
- console.warn(`数据一致性警告:total(${total}) 小于 data.length(${data.length})`);
1787
+ console.warn(
1788
+ `数据一致性警告:total(${total}) 小于 data.length(${data.length})`
1789
+ );
1755
1790
  }
1756
1791
  if (mergedProps.afterFetch) {
1757
1792
  const processed = mergedProps.afterFetch(result);
@@ -1848,12 +1883,18 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1848
1883
  };
1849
1884
  const setSelectedRowKeys = (keys) => {
1850
1885
  selectedRowKeys.value = keys;
1851
- selectedRows.value = dataSource.value.filter((item) => keys.includes(getRowKey(item)));
1886
+ selectedRows.value = dataSource.value.filter(
1887
+ (item) => keys.includes(getRowKey(item))
1888
+ );
1852
1889
  };
1853
1890
  const deleteSelectRowByKey = (key) => {
1854
- dataSource.value = dataSource.value.filter((item) => getRowKey(item) !== key);
1891
+ dataSource.value = dataSource.value.filter(
1892
+ (item) => getRowKey(item) !== key
1893
+ );
1855
1894
  selectedRowKeys.value = selectedRowKeys.value.filter((k) => k !== key);
1856
- selectedRows.value = selectedRows.value.filter((item) => getRowKey(item) !== key);
1895
+ selectedRows.value = selectedRows.value.filter(
1896
+ (item) => getRowKey(item) !== key
1897
+ );
1857
1898
  };
1858
1899
  const getPaginationInfo = () => getPaginationConfig.value;
1859
1900
  const setPagination = async (info) => {
@@ -1988,7 +2029,9 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1988
2029
  },
1989
2030
  // 实际方法名是 removeSchema
1990
2031
  appendSchemaByField: () => {
1991
- console.warn("appendSchemaByField 方法暂不支持,请使用 updateSchema 或 setProps");
2032
+ console.warn(
2033
+ "appendSchemaByField 方法暂不支持,请使用 updateSchema 或 setProps"
2034
+ );
1992
2035
  },
1993
2036
  getSchema: (field) => {
1994
2037
  var _a, _b;
@@ -2051,13 +2094,13 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
2051
2094
  }), null, 16),
2052
2095
  vue.createVNode(_component_a_divider, { class: "!mt-0" })
2053
2096
  ])) : vue.createCommentVNode("", true),
2054
- getToolbarConfig.value.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
2097
+ getToolbarConfig.value.show || getToolbarConfig.value.title || _ctx.$slots.tableTitle ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
2055
2098
  vue.createElementVNode("div", _hoisted_4$1, [
2056
2099
  vue.renderSlot(_ctx.$slots, "tableTitle", {}, () => [
2057
2100
  getToolbarConfig.value.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, vue.toDisplayString(getToolbarConfig.value.title), 1)) : vue.createCommentVNode("", true)
2058
2101
  ], true)
2059
2102
  ]),
2060
- vue.createElementVNode("div", _hoisted_6, [
2103
+ getToolbarConfig.value.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
2061
2104
  vue.createVNode(_component_a_space, null, {
2062
2105
  default: vue.withCtx(() => [
2063
2106
  getToolbarConfig.value.actions && getToolbarConfig.value.actions.length > 0 ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(getToolbarConfig.value.actions, (action, index) => {
@@ -2211,7 +2254,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
2211
2254
  ]),
2212
2255
  _: 1
2213
2256
  })
2214
- ])
2257
+ ])) : vue.createCommentVNode("", true)
2215
2258
  ])) : vue.createCommentVNode("", true),
2216
2259
  vue.createVNode(_component_a_table, vue.mergeProps({
2217
2260
  ref_key: "tableRef",
@@ -2314,7 +2357,11 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
2314
2357
  _: 2
2315
2358
  }, 1024)
2316
2359
  ], true) : _ctx.$slots[col.dataIndex] ? vue.renderSlot(_ctx.$slots, col.dataIndex, vue.normalizeProps(vue.mergeProps({ key: 2 }, slotProps)), void 0, true) : col.customRender ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderCustomCell(col, slotProps)), { key: 3 })) : col.format ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 4 }, [
2317
- vue.createTextVNode(vue.toDisplayString(col.format(slotProps.record[col.dataIndex], slotProps.record, slotProps.rowIndex)), 1)
2360
+ vue.createTextVNode(vue.toDisplayString(col.format(
2361
+ slotProps.record[col.dataIndex],
2362
+ slotProps.record,
2363
+ slotProps.rowIndex
2364
+ )), 1)
2318
2365
  ], 64)) : vue.createCommentVNode("", true)
2319
2366
  ])
2320
2367
  };
@@ -2331,7 +2378,7 @@ const _export_sfc = (sfc, props) => {
2331
2378
  }
2332
2379
  return target;
2333
2380
  };
2334
- const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-f4f3062d"]]);
2381
+ const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-1cf1331c"]]);
2335
2382
  function useTable(options = {}) {
2336
2383
  const tableRef = vue.ref(null);
2337
2384
  const formRef = vue.ref(null);