knt-shared 1.7.8 → 1.7.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/components/Table/BasicTable.vue.d.ts.map +1 -1
- package/dist/components/Table/types.d.ts +161 -75
- package/dist/components/Table/types.d.ts.map +1 -1
- package/dist/index.cjs.js +111 -79
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +111 -79
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +18 -8
- package/dist/utils/utils.d.ts +16 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1663,7 +1663,7 @@ const _hoisted_4$4 = {
|
|
|
1663
1663
|
};
|
|
1664
1664
|
const _hoisted_5$4 = { class: "progress-bar" };
|
|
1665
1665
|
const _hoisted_6$3 = { class: "controls-bottom" };
|
|
1666
|
-
const _hoisted_7$
|
|
1666
|
+
const _hoisted_7$2 = { class: "controls-left" };
|
|
1667
1667
|
const _hoisted_8$1 = { class: "volume-slider-container" };
|
|
1668
1668
|
const _hoisted_9 = { class: "time-display" };
|
|
1669
1669
|
const _hoisted_10 = { class: "controls-right" };
|
|
@@ -1922,7 +1922,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
1922
1922
|
])
|
|
1923
1923
|
]),
|
|
1924
1924
|
vue.createElementVNode("div", _hoisted_6$3, [
|
|
1925
|
-
vue.createElementVNode("div", _hoisted_7$
|
|
1925
|
+
vue.createElementVNode("div", _hoisted_7$2, [
|
|
1926
1926
|
vue.createElementVNode("button", {
|
|
1927
1927
|
class: "control-button",
|
|
1928
1928
|
onClick: togglePlay
|
|
@@ -2108,7 +2108,7 @@ const _hoisted_6$2 = {
|
|
|
2108
2108
|
key: 0,
|
|
2109
2109
|
class: "upload-text"
|
|
2110
2110
|
};
|
|
2111
|
-
const _hoisted_7$
|
|
2111
|
+
const _hoisted_7$1 = {
|
|
2112
2112
|
key: 1,
|
|
2113
2113
|
class: "upload-tip sortable-tip"
|
|
2114
2114
|
};
|
|
@@ -2757,7 +2757,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
2757
2757
|
key: "0"
|
|
2758
2758
|
} : void 0
|
|
2759
2759
|
]), 1040, ["file-list"]),
|
|
2760
|
-
getProps.value.tip ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$
|
|
2760
|
+
getProps.value.tip ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$1, vue.toDisplayString(getProps.value.tip), 1)) : vue.createCommentVNode("", true)
|
|
2761
2761
|
])),
|
|
2762
2762
|
previewImageUrl.value ? (vue.openBlock(), vue.createBlock(vue.unref(ArcoVue.Image), {
|
|
2763
2763
|
key: 3,
|
|
@@ -6004,25 +6004,24 @@ function useTableEdit(props, dataSource, getRowKey) {
|
|
|
6004
6004
|
getChangedValues
|
|
6005
6005
|
};
|
|
6006
6006
|
}
|
|
6007
|
-
const _hoisted_1$5 = {
|
|
6008
|
-
const _hoisted_2$4 = {
|
|
6007
|
+
const _hoisted_1$5 = {
|
|
6009
6008
|
key: 0,
|
|
6010
6009
|
class: "basic-table-search"
|
|
6011
6010
|
};
|
|
6012
|
-
const
|
|
6011
|
+
const _hoisted_2$4 = {
|
|
6013
6012
|
key: 1,
|
|
6014
6013
|
class: "basic-table-toolbar"
|
|
6015
6014
|
};
|
|
6016
|
-
const
|
|
6017
|
-
const
|
|
6015
|
+
const _hoisted_3$3 = { class: "toolbar-left" };
|
|
6016
|
+
const _hoisted_4$2 = {
|
|
6018
6017
|
key: 0,
|
|
6019
6018
|
class: "toolbar-title"
|
|
6020
6019
|
};
|
|
6021
|
-
const
|
|
6020
|
+
const _hoisted_5$2 = {
|
|
6022
6021
|
key: 0,
|
|
6023
6022
|
class: "toolbar-right"
|
|
6024
6023
|
};
|
|
6025
|
-
const
|
|
6024
|
+
const _hoisted_6$1 = { class: "column-setting" };
|
|
6026
6025
|
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
6027
6026
|
...{
|
|
6028
6027
|
name: "BasicTable"
|
|
@@ -6030,18 +6029,32 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6030
6029
|
__name: "BasicTable",
|
|
6031
6030
|
props: {
|
|
6032
6031
|
tableId: {},
|
|
6032
|
+
search: { type: [Boolean, Object], default: () => ({ show: false }) },
|
|
6033
|
+
toolbar: { type: [Boolean, Object], default: () => ({ show: false }) },
|
|
6034
|
+
immediate: { type: Boolean, default: true },
|
|
6035
|
+
api: {},
|
|
6036
|
+
fetchSetting: {},
|
|
6037
|
+
beforeFetch: {},
|
|
6038
|
+
afterFetch: {},
|
|
6039
|
+
onFetchError: {},
|
|
6040
|
+
showIndexColumn: { type: Boolean, default: false },
|
|
6041
|
+
indexColumnProps: {},
|
|
6042
|
+
showActionColumn: { type: Boolean, default: false },
|
|
6043
|
+
actionColumn: {},
|
|
6044
|
+
autoHeight: { type: Boolean, default: false },
|
|
6045
|
+
maxHeight: {},
|
|
6046
|
+
editConfig: {},
|
|
6033
6047
|
columns: { default: () => [] },
|
|
6034
6048
|
data: { default: () => [] },
|
|
6035
|
-
loading: { type: Boolean, default: false },
|
|
6036
|
-
size: { default: "medium" },
|
|
6037
6049
|
bordered: { type: Boolean, default: true },
|
|
6050
|
+
hoverable: { type: Boolean },
|
|
6038
6051
|
stripe: { type: Boolean, default: false },
|
|
6039
|
-
|
|
6040
|
-
|
|
6052
|
+
size: { default: "medium" },
|
|
6053
|
+
tableLayoutFixed: { type: Boolean },
|
|
6054
|
+
loading: { type: [Boolean, Object], default: false },
|
|
6041
6055
|
rowSelection: {},
|
|
6042
6056
|
expandable: {},
|
|
6043
6057
|
scroll: {},
|
|
6044
|
-
draggable: {},
|
|
6045
6058
|
pagination: { type: [Boolean, Object], default: () => ({
|
|
6046
6059
|
current: 1,
|
|
6047
6060
|
pageSize: 20,
|
|
@@ -6050,24 +6063,30 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6050
6063
|
showPageSize: true,
|
|
6051
6064
|
pageSizeOptions: [5, 10, 20, 50, 100]
|
|
6052
6065
|
}) },
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6066
|
+
pagePosition: {},
|
|
6067
|
+
rowKey: { type: [String, Function], default: "id" },
|
|
6068
|
+
showHeader: { type: Boolean, default: true },
|
|
6069
|
+
draggable: {},
|
|
6070
|
+
indentSize: {},
|
|
6071
|
+
rowClass: {},
|
|
6072
|
+
columnResizable: { type: Boolean },
|
|
6073
|
+
stickyHeader: { type: [Boolean, Number] },
|
|
6074
|
+
spanMethod: {},
|
|
6075
|
+
spanAll: { type: Boolean },
|
|
6076
|
+
selectedKeys: {},
|
|
6077
|
+
defaultSelectedKeys: {},
|
|
6078
|
+
expandedKeys: {},
|
|
6079
|
+
defaultExpandedKeys: {},
|
|
6080
|
+
defaultExpandAllRows: { type: Boolean },
|
|
6081
|
+
loadMore: {},
|
|
6082
|
+
filterIconAlignLeft: { type: Boolean },
|
|
6083
|
+
hideExpandButtonOnEmpty: { type: Boolean },
|
|
6084
|
+
summary: { type: [Boolean, Function] },
|
|
6085
|
+
summaryText: {},
|
|
6086
|
+
summarySpanMethod: {},
|
|
6087
|
+
scrollbar: { type: [Boolean, Object] },
|
|
6088
|
+
showEmptyTree: { type: Boolean },
|
|
6089
|
+
virtualListProps: {}
|
|
6071
6090
|
},
|
|
6072
6091
|
emits: ["register", "change", "select", "selectAll", "expand", "row-click", "row-dblclick", "cell-click", "search", "reset", "fetch-success", "fetch-error", "edit-save", "edit-cancel", "edit-delete", "edit-add"],
|
|
6073
6092
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -6104,6 +6123,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6104
6123
|
const loadingRef = vue.ref(false);
|
|
6105
6124
|
const tableSizeRef = vue.ref(props.size);
|
|
6106
6125
|
const isFullscreen = vue.ref(false);
|
|
6126
|
+
const tableWrapperRef = vue.ref();
|
|
6107
6127
|
const selectedRowKeys = vue.ref([]);
|
|
6108
6128
|
const selectedRows = vue.ref([]);
|
|
6109
6129
|
const getStorageKey = () => {
|
|
@@ -6119,9 +6139,6 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6119
6139
|
setStoredColumns(newValue);
|
|
6120
6140
|
}
|
|
6121
6141
|
});
|
|
6122
|
-
const handleFullscreenChange = () => {
|
|
6123
|
-
isFullscreen.value = !!document.fullscreenElement;
|
|
6124
|
-
};
|
|
6125
6142
|
const paginationRef = vue.ref({
|
|
6126
6143
|
current: 1,
|
|
6127
6144
|
pageSize: 20,
|
|
@@ -6380,10 +6397,21 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6380
6397
|
const getBindValues = vue.computed(() => {
|
|
6381
6398
|
const mergedProps = getMergedProps.value;
|
|
6382
6399
|
const {
|
|
6400
|
+
// 已单独处理、直接绑定到 <a-table> 的属性
|
|
6383
6401
|
columns,
|
|
6384
6402
|
data,
|
|
6385
6403
|
loading,
|
|
6386
6404
|
pagination,
|
|
6405
|
+
rowSelection,
|
|
6406
|
+
expandable,
|
|
6407
|
+
scroll,
|
|
6408
|
+
draggable,
|
|
6409
|
+
bordered,
|
|
6410
|
+
stripe,
|
|
6411
|
+
showHeader,
|
|
6412
|
+
size,
|
|
6413
|
+
rowKey,
|
|
6414
|
+
// 自定义功能 props(已在各 computed/方法中消费,不透传给 a-table)
|
|
6387
6415
|
search,
|
|
6388
6416
|
toolbar,
|
|
6389
6417
|
api,
|
|
@@ -6396,15 +6424,10 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6396
6424
|
indexColumnProps,
|
|
6397
6425
|
showActionColumn,
|
|
6398
6426
|
actionColumn,
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
bordered,
|
|
6404
|
-
stripe,
|
|
6405
|
-
showHeader,
|
|
6406
|
-
size,
|
|
6407
|
-
rowSelection,
|
|
6427
|
+
tableId,
|
|
6428
|
+
autoHeight,
|
|
6429
|
+
maxHeight,
|
|
6430
|
+
editConfig,
|
|
6408
6431
|
...rest
|
|
6409
6432
|
} = mergedProps;
|
|
6410
6433
|
return rest;
|
|
@@ -6558,23 +6581,8 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6558
6581
|
const handleColumnChange = (values) => {
|
|
6559
6582
|
checkedColumns.value = values;
|
|
6560
6583
|
};
|
|
6561
|
-
const handleFullscreen =
|
|
6562
|
-
|
|
6563
|
-
if (!wrapper) return;
|
|
6564
|
-
try {
|
|
6565
|
-
if (!isFullscreen.value) {
|
|
6566
|
-
if (wrapper.requestFullscreen) {
|
|
6567
|
-
await wrapper.requestFullscreen();
|
|
6568
|
-
}
|
|
6569
|
-
} else {
|
|
6570
|
-
if (document.exitFullscreen && document.fullscreenElement) {
|
|
6571
|
-
await document.exitFullscreen();
|
|
6572
|
-
}
|
|
6573
|
-
}
|
|
6574
|
-
} catch (error) {
|
|
6575
|
-
console.error("全屏操作失败:", error);
|
|
6576
|
-
ArcoVue.Message.error("全屏操作失败");
|
|
6577
|
-
}
|
|
6584
|
+
const handleFullscreen = () => {
|
|
6585
|
+
isFullscreen.value = !isFullscreen.value;
|
|
6578
6586
|
};
|
|
6579
6587
|
const handleSelect = (rowKeys, rowKey, record) => {
|
|
6580
6588
|
selectedRowKeys.value = rowKeys;
|
|
@@ -6792,8 +6800,12 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6792
6800
|
await ((_b = (_a = searchFormRef.value) == null ? void 0 : _a.setFieldsValue) == null ? void 0 : _b.call(_a, values));
|
|
6793
6801
|
};
|
|
6794
6802
|
const expandAll = () => {
|
|
6803
|
+
var _a;
|
|
6804
|
+
(_a = tableRef.value) == null ? void 0 : _a.expandAll(true);
|
|
6795
6805
|
};
|
|
6796
6806
|
const collapseAll = () => {
|
|
6807
|
+
var _a;
|
|
6808
|
+
(_a = tableRef.value) == null ? void 0 : _a.expandAll(false);
|
|
6797
6809
|
};
|
|
6798
6810
|
__expose({
|
|
6799
6811
|
getDataSource,
|
|
@@ -6837,7 +6849,6 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6837
6849
|
await vue.nextTick();
|
|
6838
6850
|
initPagination();
|
|
6839
6851
|
initColumnSetting();
|
|
6840
|
-
document.addEventListener("fullscreenchange", handleFullscreenChange);
|
|
6841
6852
|
const tableInstance = {
|
|
6842
6853
|
getDataSource,
|
|
6843
6854
|
setDataSource,
|
|
@@ -6945,12 +6956,6 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6945
6956
|
}
|
|
6946
6957
|
});
|
|
6947
6958
|
vue.onBeforeUnmount(() => {
|
|
6948
|
-
document.removeEventListener("fullscreenchange", handleFullscreenChange);
|
|
6949
|
-
if (document.fullscreenElement) {
|
|
6950
|
-
document.exitFullscreen().catch((error) => {
|
|
6951
|
-
console.error("退出全屏失败:", error);
|
|
6952
|
-
});
|
|
6953
|
-
}
|
|
6954
6959
|
handleRefresh.cancel();
|
|
6955
6960
|
debouncedFetchData.cancel();
|
|
6956
6961
|
dataSource.value = [];
|
|
@@ -6963,8 +6968,12 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6963
6968
|
searchFormRef.value = null;
|
|
6964
6969
|
});
|
|
6965
6970
|
return (_ctx, _cache) => {
|
|
6966
|
-
return vue.openBlock(), vue.createElementBlock("div",
|
|
6967
|
-
|
|
6971
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
6972
|
+
ref_key: "tableWrapperRef",
|
|
6973
|
+
ref: tableWrapperRef,
|
|
6974
|
+
class: vue.normalizeClass(["basic-table-wrapper", { "is-fullscreen": isFullscreen.value }])
|
|
6975
|
+
}, [
|
|
6976
|
+
getSearchConfig.value.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
|
|
6968
6977
|
vue.createVNode(vue.unref(_sfc_main$9), vue.mergeProps({
|
|
6969
6978
|
ref_key: "searchFormRef",
|
|
6970
6979
|
ref: searchFormRef
|
|
@@ -6983,13 +6992,13 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6983
6992
|
]), 1040),
|
|
6984
6993
|
vue.createVNode(vue.unref(ArcoVue.Divider), { class: "!mt-0" })
|
|
6985
6994
|
])) : vue.createCommentVNode("", true),
|
|
6986
|
-
getToolbarConfig.value.show || getToolbarConfig.value.title || _ctx.$slots.tableTitle ? (vue.openBlock(), vue.createElementBlock("div",
|
|
6987
|
-
vue.createElementVNode("div",
|
|
6995
|
+
getToolbarConfig.value.show || getToolbarConfig.value.title || _ctx.$slots.tableTitle ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$4, [
|
|
6996
|
+
vue.createElementVNode("div", _hoisted_3$3, [
|
|
6988
6997
|
vue.renderSlot(_ctx.$slots, "tableTitle", {}, () => [
|
|
6989
|
-
getToolbarConfig.value.title ? (vue.openBlock(), vue.createElementBlock("div",
|
|
6998
|
+
getToolbarConfig.value.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, vue.toDisplayString(getToolbarConfig.value.title), 1)) : vue.createCommentVNode("", true)
|
|
6990
6999
|
], true)
|
|
6991
7000
|
]),
|
|
6992
|
-
getToolbarConfig.value.show ? (vue.openBlock(), vue.createElementBlock("div",
|
|
7001
|
+
getToolbarConfig.value.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$2, [
|
|
6993
7002
|
vue.createVNode(vue.unref(ArcoVue.Space), null, {
|
|
6994
7003
|
default: vue.withCtx(() => [
|
|
6995
7004
|
getToolbarConfig.value.actions && getToolbarConfig.value.actions.length > 0 ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(getToolbarConfig.value.actions, (action, index) => {
|
|
@@ -7098,7 +7107,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7098
7107
|
position: "br"
|
|
7099
7108
|
}, {
|
|
7100
7109
|
content: vue.withCtx(() => [
|
|
7101
|
-
vue.createElementVNode("div",
|
|
7110
|
+
vue.createElementVNode("div", _hoisted_6$1, [
|
|
7102
7111
|
vue.createVNode(vue.unref(ArcoVue.CheckboxGroup), {
|
|
7103
7112
|
modelValue: checkedColumns.value,
|
|
7104
7113
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checkedColumns.value = $event),
|
|
@@ -7323,11 +7332,11 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7323
7332
|
};
|
|
7324
7333
|
})
|
|
7325
7334
|
]), 1040, ["columns", "data", "loading", "pagination", "row-selection", "expandable", "scroll", "draggable", "bordered", "stripe", "show-header", "size", "row-key"])
|
|
7326
|
-
]);
|
|
7335
|
+
], 2);
|
|
7327
7336
|
};
|
|
7328
7337
|
}
|
|
7329
7338
|
});
|
|
7330
|
-
const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
7339
|
+
const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-0b094e75"]]);
|
|
7331
7340
|
function useTable(options = {}) {
|
|
7332
7341
|
const tableRef = vue.ref(null);
|
|
7333
7342
|
const formRef = vue.ref(null);
|
|
@@ -9571,6 +9580,28 @@ function openWindow(url, opt2) {
|
|
|
9571
9580
|
noreferrer && feature.push("noreferrer=yes");
|
|
9572
9581
|
window.open(url, target, feature.join(","));
|
|
9573
9582
|
}
|
|
9583
|
+
function removeFields(obj, fieldsToRemove = ["id"], _seen = /* @__PURE__ */ new WeakSet()) {
|
|
9584
|
+
if (Array.isArray(obj)) {
|
|
9585
|
+
return obj.map((item) => removeFields(item, fieldsToRemove, _seen));
|
|
9586
|
+
}
|
|
9587
|
+
if (obj !== null && typeof obj === "object") {
|
|
9588
|
+
if (obj instanceof Date || obj instanceof RegExp || obj instanceof Map || obj instanceof Set) {
|
|
9589
|
+
return obj;
|
|
9590
|
+
}
|
|
9591
|
+
if (_seen.has(obj)) {
|
|
9592
|
+
return obj;
|
|
9593
|
+
}
|
|
9594
|
+
_seen.add(obj);
|
|
9595
|
+
const newObj = {};
|
|
9596
|
+
for (const key of Object.keys(obj)) {
|
|
9597
|
+
if (!fieldsToRemove.includes(key)) {
|
|
9598
|
+
newObj[key] = removeFields(obj[key], fieldsToRemove, _seen);
|
|
9599
|
+
}
|
|
9600
|
+
}
|
|
9601
|
+
return newObj;
|
|
9602
|
+
}
|
|
9603
|
+
return obj;
|
|
9604
|
+
}
|
|
9574
9605
|
function dataURLtoBlob(base64Buf) {
|
|
9575
9606
|
const arr = base64Buf.split(",");
|
|
9576
9607
|
const typeItem = arr[0];
|
|
@@ -9856,6 +9887,7 @@ exports.mergeFormSchemas = mergeFormSchemas;
|
|
|
9856
9887
|
exports.mergeTableColumns = mergeTableColumns;
|
|
9857
9888
|
exports.openWindow = openWindow;
|
|
9858
9889
|
exports.registerComponent = registerComponent;
|
|
9890
|
+
exports.removeFields = removeFields;
|
|
9859
9891
|
exports.rendererMap = rendererMap;
|
|
9860
9892
|
exports.rgbToHex = rgbToHex;
|
|
9861
9893
|
exports.safeToString = safeToString;
|