bkui-vue 0.0.1-beta.215 → 0.0.1-beta.216
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.cjs.js +39 -39
- package/dist/index.esm.js +67 -20
- package/dist/index.umd.js +40 -40
- package/lib/table/const.d.ts +1 -0
- package/lib/table/index.js +1 -1
- package/lib/table/utils.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -16242,7 +16242,8 @@ const TABLE_ROW_ATTRIBUTE = {
|
|
16242
16242
|
ROW_SELECTION: "__row_selection",
|
16243
16243
|
ROW_SELECTION_ALL: "__row_selection_all",
|
16244
16244
|
ROW_SELECTION_INDETERMINATE: "__row_selection_indeterminate",
|
16245
|
-
ROW_SOURCE_DATA: "__row_source_data"
|
16245
|
+
ROW_SOURCE_DATA: "__row_source_data",
|
16246
|
+
ROW_SKIP_CFG: "__row_skip_config"
|
16246
16247
|
};
|
16247
16248
|
const COLUMN_ATTRIBUTE = {
|
16248
16249
|
COL_UID: "__col_$uuid"
|
@@ -18094,7 +18095,6 @@ class TableRender {
|
|
18094
18095
|
const {
|
18095
18096
|
resolveFixedColumnStyle
|
18096
18097
|
} = useFixedColumn(this.props, this.colgroups);
|
18097
|
-
const skipRow = /* @__PURE__ */ new Map();
|
18098
18098
|
const rowLength = rows.length;
|
18099
18099
|
return createVNode("tbody", null, [rows.map((row, rowIndex) => {
|
18100
18100
|
const rowStyle = [...formatPropAsArray(this.props.rowStyle, [row, rowIndex, this]), {
|
@@ -18102,7 +18102,6 @@ class TableRender {
|
|
18102
18102
|
}];
|
18103
18103
|
const rowClass = [...formatPropAsArray(this.props.rowClass, [row, rowIndex, this]), `hover-${this.props.rowHover}`];
|
18104
18104
|
const rowKey = row[TABLE_ROW_ATTRIBUTE.ROW_UID];
|
18105
|
-
let skipColumn = 0;
|
18106
18105
|
return [createVNode(TableRow, {
|
18107
18106
|
"key": rowKey
|
18108
18107
|
}, {
|
@@ -18112,6 +18111,7 @@ class TableRender {
|
|
18112
18111
|
"onClick": (e) => this.handleRowClick(e, row, rowIndex, rows),
|
18113
18112
|
"onDblclick": (e) => this.handleRowDblClick(e, row, rowIndex, rows)
|
18114
18113
|
}, [this.filterColgroups.map((column, index) => {
|
18114
|
+
var _a, _b;
|
18115
18115
|
const cellStyle = [resolveFixedColumnStyle(column), ...formatPropAsArray(this.props.cellStyle, [column, index, row, rowIndex, this])];
|
18116
18116
|
const tdCtxClass = {
|
18117
18117
|
cell: true,
|
@@ -18122,15 +18122,14 @@ class TableRender {
|
|
18122
18122
|
colspan,
|
18123
18123
|
rowspan
|
18124
18124
|
} = resolveCellSpan(column, index, row, rowIndex);
|
18125
|
-
const
|
18126
|
-
|
18125
|
+
const skipRowKey = TABLE_ROW_ATTRIBUTE.ROW_SKIP_CFG;
|
18126
|
+
const columnIdKey = column[COLUMN_ATTRIBUTE.COL_UID];
|
18127
|
+
const {
|
18128
|
+
skipRow = false,
|
18129
|
+
skipCol = false
|
18130
|
+
} = (_b = (_a = row[skipRowKey]) == null ? void 0 : _a[columnIdKey]) != null ? _b : {};
|
18131
|
+
if (!skipRow && !skipCol) {
|
18127
18132
|
let _slot2;
|
18128
|
-
if (colspan > 1) {
|
18129
|
-
skipColumn = colspan - 1;
|
18130
|
-
}
|
18131
|
-
if (rowspan > 1) {
|
18132
|
-
skipRow.set(index, rowspan - 1);
|
18133
|
-
}
|
18134
18133
|
const cellClass = [this.getColumnClass(column, index), ...formatPropAsArray(this.props.cellClass, [column, index, row, rowIndex, this]), {
|
18135
18134
|
"expand-row": row[TABLE_ROW_ATTRIBUTE.ROW_EXPAND],
|
18136
18135
|
"is-last": rowIndex + rowspan >= rowLength
|
@@ -18150,12 +18149,6 @@ class TableRender {
|
|
18150
18149
|
default: () => [_slot2]
|
18151
18150
|
})]);
|
18152
18151
|
}
|
18153
|
-
if (skipColumn > 0) {
|
18154
|
-
skipColumn = skipColumn - 1;
|
18155
|
-
}
|
18156
|
-
if (skipCurrentRow > 0) {
|
18157
|
-
skipRow.set(index, skipCurrentRow - 1);
|
18158
|
-
}
|
18159
18152
|
return null;
|
18160
18153
|
})])]
|
18161
18154
|
}), this.renderExpandRow(row, rowClass)];
|
@@ -18746,30 +18739,84 @@ const useInit = (props2, targetColumns) => {
|
|
18746
18739
|
return false;
|
18747
18740
|
});
|
18748
18741
|
const indexData = reactive([]);
|
18742
|
+
const neepColspanOrRowspan = computed(() => colgroups.some((col) => typeof col.rowspan === "function" || /^\d$/.test(`${col.rowspan}`) || typeof col.colspan === "function" || /^\d$/.test(`${col.colspan}`)));
|
18749
18743
|
const initIndexData = (keepLocalAction = false) => {
|
18744
|
+
let preRowId = null;
|
18745
|
+
const skipConfig = {};
|
18750
18746
|
indexData.splice(0, indexData.length, ...props2.data.map((item, index) => {
|
18751
18747
|
const rowId = getRowKey(item, props2, index);
|
18748
|
+
const cfg = neepColspanOrRowspan.value ? getSkipConfig(item, rowId, index, skipConfig, preRowId) : {};
|
18749
|
+
preRowId = rowId;
|
18752
18750
|
return __spreadProps(__spreadValues({}, item), {
|
18753
18751
|
[TABLE_ROW_ATTRIBUTE.ROW_INDEX]: index,
|
18754
18752
|
[TABLE_ROW_ATTRIBUTE.ROW_UID]: rowId,
|
18755
18753
|
[TABLE_ROW_ATTRIBUTE.ROW_EXPAND]: keepLocalAction ? isRowExpand(rowId) : false,
|
18756
18754
|
[TABLE_ROW_ATTRIBUTE.ROW_SELECTION]: resolveSelection(item, rowId),
|
18757
|
-
[TABLE_ROW_ATTRIBUTE.ROW_SOURCE_DATA]: __spreadValues({}, item)
|
18755
|
+
[TABLE_ROW_ATTRIBUTE.ROW_SOURCE_DATA]: __spreadValues({}, item),
|
18756
|
+
[TABLE_ROW_ATTRIBUTE.ROW_SKIP_CFG]: cfg
|
18758
18757
|
});
|
18759
18758
|
}));
|
18760
18759
|
initSelectionAllByData();
|
18761
18760
|
};
|
18762
18761
|
const updateIndexData = (selectedAll) => {
|
18763
|
-
|
18762
|
+
let preRowId = null;
|
18763
|
+
const skipConfig = {};
|
18764
|
+
indexData.forEach((item, index) => {
|
18765
|
+
const rowId = item[TABLE_ROW_ATTRIBUTE.ROW_UID];
|
18766
|
+
const cfg = neepColspanOrRowspan.value ? getSkipConfig(item, rowId, index, skipConfig, preRowId) : {};
|
18764
18767
|
Object.assign(item, {
|
18765
18768
|
[TABLE_ROW_ATTRIBUTE.ROW_EXPAND]: isRowExpand(item[TABLE_ROW_ATTRIBUTE.ROW_UID]),
|
18766
|
-
[TABLE_ROW_ATTRIBUTE.ROW_SELECTION]: typeof selectedAll === "boolean" ? selectedAll : resolveSelection(item, item[TABLE_ROW_ATTRIBUTE.ROW_UID])
|
18769
|
+
[TABLE_ROW_ATTRIBUTE.ROW_SELECTION]: typeof selectedAll === "boolean" ? selectedAll : resolveSelection(item, item[TABLE_ROW_ATTRIBUTE.ROW_UID]),
|
18770
|
+
[TABLE_ROW_ATTRIBUTE.ROW_SKIP_CFG]: cfg
|
18767
18771
|
});
|
18772
|
+
preRowId = item[TABLE_ROW_ATTRIBUTE.ROW_UID];
|
18768
18773
|
});
|
18769
18774
|
if (typeof selectedAll !== "boolean") {
|
18770
18775
|
initSelectionAllByData();
|
18771
18776
|
}
|
18772
18777
|
};
|
18778
|
+
const getSkipConfig = (row, rowId, rowIndex, skipCfg, preRowId) => {
|
18779
|
+
var _a2;
|
18780
|
+
let skipColumnNum = 0;
|
18781
|
+
const preRowConfig = (_a2 = skipCfg[preRowId]) != null ? _a2 : {};
|
18782
|
+
if (!skipCfg[rowId]) {
|
18783
|
+
skipCfg[rowId] = {};
|
18784
|
+
}
|
18785
|
+
colgroups.forEach((column, index) => {
|
18786
|
+
var _a3, _b2;
|
18787
|
+
const { colspan, rowspan } = resolveCellSpan(column, index, row, rowIndex);
|
18788
|
+
const colId = column[COLUMN_ATTRIBUTE.COL_UID];
|
18789
|
+
const preRowColSkipLen = (_b2 = (_a3 = preRowConfig[colId]) == null ? void 0 : _a3.skipRowLen) != null ? _b2 : 0;
|
18790
|
+
const target = {
|
18791
|
+
[colId]: {
|
18792
|
+
skipRowLen: 0,
|
18793
|
+
skipRow: false,
|
18794
|
+
skipCol: false,
|
18795
|
+
skipColLen: 0
|
18796
|
+
}
|
18797
|
+
};
|
18798
|
+
if (skipColumnNum > 0) {
|
18799
|
+
target[colId].skipColLen = skipColumnNum;
|
18800
|
+
target[colId].skipCol = true;
|
18801
|
+
skipColumnNum = skipColumnNum - 1;
|
18802
|
+
}
|
18803
|
+
if (preRowColSkipLen > 1) {
|
18804
|
+
target[colId].skipRowLen = preRowColSkipLen - 1;
|
18805
|
+
target[colId].skipRow = true;
|
18806
|
+
} else {
|
18807
|
+
if (rowspan > 1) {
|
18808
|
+
target[colId].skipRowLen = rowspan;
|
18809
|
+
target[colId].skipRow = false;
|
18810
|
+
}
|
18811
|
+
}
|
18812
|
+
if (colspan > 1) {
|
18813
|
+
target[colId].skipColLen = colspan;
|
18814
|
+
skipColumnNum = colspan - 1;
|
18815
|
+
}
|
18816
|
+
Object.assign(skipCfg[rowId], __spreadValues({}, target));
|
18817
|
+
});
|
18818
|
+
return skipCfg[rowId];
|
18819
|
+
};
|
18773
18820
|
const asyncSelection = (row, value, all = false) => {
|
18774
18821
|
if (props2.asyncData && props2.rowKey) {
|
18775
18822
|
if (all) {
|