bkui-vue 0.0.1-beta.215 → 0.0.1-beta.217

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
@@ -15347,13 +15347,6 @@ var Component$j = defineComponent({
15347
15347
  initActiveOptionValue();
15348
15348
  }
15349
15349
  });
15350
- const watchOnce = watch(isPopoverShow, () => {
15351
- setTimeout(() => {
15352
- var _a, _b;
15353
- enableVirtualRender.value && ((_b = (_a = virtualRenderRef.value) == null ? void 0 : _a.reset) == null ? void 0 : _b.call(_a));
15354
- watchOnce();
15355
- });
15356
- });
15357
15350
  const initActiveOptionValue = () => {
15358
15351
  var _a;
15359
15352
  const firstSelected = selected.value[0];
@@ -15573,6 +15566,12 @@ var Component$j = defineComponent({
15573
15566
  hidePopover();
15574
15567
  handleBlur();
15575
15568
  };
15569
+ const handlePopoverShow = () => {
15570
+ setTimeout(() => {
15571
+ var _a, _b;
15572
+ enableVirtualRender.value && ((_b = (_a = virtualRenderRef.value) == null ? void 0 : _a.reset) == null ? void 0 : _b.call(_a));
15573
+ });
15574
+ };
15576
15575
  provide(selectKey, reactive({
15577
15576
  multiple,
15578
15577
  selected,
@@ -15640,7 +15639,8 @@ var Component$j = defineComponent({
15640
15639
  handleInputChange,
15641
15640
  handleInputEnter,
15642
15641
  handleKeydown,
15643
- handleSelectedAllOptionMouseEnter
15642
+ handleSelectedAllOptionMouseEnter,
15643
+ handlePopoverShow
15644
15644
  };
15645
15645
  },
15646
15646
  render() {
@@ -15799,6 +15799,7 @@ var Component$j = defineComponent({
15799
15799
  "class": selectClass
15800
15800
  }, [createVNode(BkPopover2, mergeProps(this.popoverConfig, {
15801
15801
  "onClickoutside": this.handleClickOutside,
15802
+ "onAfterShow": this.handlePopoverShow,
15802
15803
  "ref": "popoverRef"
15803
15804
  }), {
15804
15805
  default: () => renderSelectTrigger(),
@@ -16242,7 +16243,8 @@ const TABLE_ROW_ATTRIBUTE = {
16242
16243
  ROW_SELECTION: "__row_selection",
16243
16244
  ROW_SELECTION_ALL: "__row_selection_all",
16244
16245
  ROW_SELECTION_INDETERMINATE: "__row_selection_indeterminate",
16245
- ROW_SOURCE_DATA: "__row_source_data"
16246
+ ROW_SOURCE_DATA: "__row_source_data",
16247
+ ROW_SKIP_CFG: "__row_skip_config"
16246
16248
  };
16247
16249
  const COLUMN_ATTRIBUTE = {
16248
16250
  COL_UID: "__col_$uuid"
@@ -18094,7 +18096,6 @@ class TableRender {
18094
18096
  const {
18095
18097
  resolveFixedColumnStyle
18096
18098
  } = useFixedColumn(this.props, this.colgroups);
18097
- const skipRow = /* @__PURE__ */ new Map();
18098
18099
  const rowLength = rows.length;
18099
18100
  return createVNode("tbody", null, [rows.map((row, rowIndex) => {
18100
18101
  const rowStyle = [...formatPropAsArray(this.props.rowStyle, [row, rowIndex, this]), {
@@ -18102,7 +18103,6 @@ class TableRender {
18102
18103
  }];
18103
18104
  const rowClass = [...formatPropAsArray(this.props.rowClass, [row, rowIndex, this]), `hover-${this.props.rowHover}`];
18104
18105
  const rowKey = row[TABLE_ROW_ATTRIBUTE.ROW_UID];
18105
- let skipColumn = 0;
18106
18106
  return [createVNode(TableRow, {
18107
18107
  "key": rowKey
18108
18108
  }, {
@@ -18112,6 +18112,7 @@ class TableRender {
18112
18112
  "onClick": (e) => this.handleRowClick(e, row, rowIndex, rows),
18113
18113
  "onDblclick": (e) => this.handleRowDblClick(e, row, rowIndex, rows)
18114
18114
  }, [this.filterColgroups.map((column, index) => {
18115
+ var _a, _b;
18115
18116
  const cellStyle = [resolveFixedColumnStyle(column), ...formatPropAsArray(this.props.cellStyle, [column, index, row, rowIndex, this])];
18116
18117
  const tdCtxClass = {
18117
18118
  cell: true,
@@ -18122,15 +18123,14 @@ class TableRender {
18122
18123
  colspan,
18123
18124
  rowspan
18124
18125
  } = resolveCellSpan(column, index, row, rowIndex);
18125
- const skipCurrentRow = skipRow.get(index);
18126
- if (skipColumn === 0 && !skipCurrentRow) {
18126
+ const skipRowKey = TABLE_ROW_ATTRIBUTE.ROW_SKIP_CFG;
18127
+ const columnIdKey = column[COLUMN_ATTRIBUTE.COL_UID];
18128
+ const {
18129
+ skipRow = false,
18130
+ skipCol = false
18131
+ } = (_b = (_a = row[skipRowKey]) == null ? void 0 : _a[columnIdKey]) != null ? _b : {};
18132
+ if (!skipRow && !skipCol) {
18127
18133
  let _slot2;
18128
- if (colspan > 1) {
18129
- skipColumn = colspan - 1;
18130
- }
18131
- if (rowspan > 1) {
18132
- skipRow.set(index, rowspan - 1);
18133
- }
18134
18134
  const cellClass = [this.getColumnClass(column, index), ...formatPropAsArray(this.props.cellClass, [column, index, row, rowIndex, this]), {
18135
18135
  "expand-row": row[TABLE_ROW_ATTRIBUTE.ROW_EXPAND],
18136
18136
  "is-last": rowIndex + rowspan >= rowLength
@@ -18150,12 +18150,6 @@ class TableRender {
18150
18150
  default: () => [_slot2]
18151
18151
  })]);
18152
18152
  }
18153
- if (skipColumn > 0) {
18154
- skipColumn = skipColumn - 1;
18155
- }
18156
- if (skipCurrentRow > 0) {
18157
- skipRow.set(index, skipCurrentRow - 1);
18158
- }
18159
18153
  return null;
18160
18154
  })])]
18161
18155
  }), this.renderExpandRow(row, rowClass)];
@@ -18746,30 +18740,84 @@ const useInit = (props2, targetColumns) => {
18746
18740
  return false;
18747
18741
  });
18748
18742
  const indexData = reactive([]);
18743
+ const neepColspanOrRowspan = computed(() => colgroups.some((col) => typeof col.rowspan === "function" || /^\d$/.test(`${col.rowspan}`) || typeof col.colspan === "function" || /^\d$/.test(`${col.colspan}`)));
18749
18744
  const initIndexData = (keepLocalAction = false) => {
18745
+ let preRowId = null;
18746
+ const skipConfig = {};
18750
18747
  indexData.splice(0, indexData.length, ...props2.data.map((item, index) => {
18751
18748
  const rowId = getRowKey(item, props2, index);
18749
+ const cfg = neepColspanOrRowspan.value ? getSkipConfig(item, rowId, index, skipConfig, preRowId) : {};
18750
+ preRowId = rowId;
18752
18751
  return __spreadProps(__spreadValues({}, item), {
18753
18752
  [TABLE_ROW_ATTRIBUTE.ROW_INDEX]: index,
18754
18753
  [TABLE_ROW_ATTRIBUTE.ROW_UID]: rowId,
18755
18754
  [TABLE_ROW_ATTRIBUTE.ROW_EXPAND]: keepLocalAction ? isRowExpand(rowId) : false,
18756
18755
  [TABLE_ROW_ATTRIBUTE.ROW_SELECTION]: resolveSelection(item, rowId),
18757
- [TABLE_ROW_ATTRIBUTE.ROW_SOURCE_DATA]: __spreadValues({}, item)
18756
+ [TABLE_ROW_ATTRIBUTE.ROW_SOURCE_DATA]: __spreadValues({}, item),
18757
+ [TABLE_ROW_ATTRIBUTE.ROW_SKIP_CFG]: cfg
18758
18758
  });
18759
18759
  }));
18760
18760
  initSelectionAllByData();
18761
18761
  };
18762
18762
  const updateIndexData = (selectedAll) => {
18763
- indexData.forEach((item) => {
18763
+ let preRowId = null;
18764
+ const skipConfig = {};
18765
+ indexData.forEach((item, index) => {
18766
+ const rowId = item[TABLE_ROW_ATTRIBUTE.ROW_UID];
18767
+ const cfg = neepColspanOrRowspan.value ? getSkipConfig(item, rowId, index, skipConfig, preRowId) : {};
18764
18768
  Object.assign(item, {
18765
18769
  [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])
18770
+ [TABLE_ROW_ATTRIBUTE.ROW_SELECTION]: typeof selectedAll === "boolean" ? selectedAll : resolveSelection(item, item[TABLE_ROW_ATTRIBUTE.ROW_UID]),
18771
+ [TABLE_ROW_ATTRIBUTE.ROW_SKIP_CFG]: cfg
18767
18772
  });
18773
+ preRowId = item[TABLE_ROW_ATTRIBUTE.ROW_UID];
18768
18774
  });
18769
18775
  if (typeof selectedAll !== "boolean") {
18770
18776
  initSelectionAllByData();
18771
18777
  }
18772
18778
  };
18779
+ const getSkipConfig = (row, rowId, rowIndex, skipCfg, preRowId) => {
18780
+ var _a2;
18781
+ let skipColumnNum = 0;
18782
+ const preRowConfig = (_a2 = skipCfg[preRowId]) != null ? _a2 : {};
18783
+ if (!skipCfg[rowId]) {
18784
+ skipCfg[rowId] = {};
18785
+ }
18786
+ colgroups.forEach((column, index) => {
18787
+ var _a3, _b2;
18788
+ const { colspan, rowspan } = resolveCellSpan(column, index, row, rowIndex);
18789
+ const colId = column[COLUMN_ATTRIBUTE.COL_UID];
18790
+ const preRowColSkipLen = (_b2 = (_a3 = preRowConfig[colId]) == null ? void 0 : _a3.skipRowLen) != null ? _b2 : 0;
18791
+ const target = {
18792
+ [colId]: {
18793
+ skipRowLen: 0,
18794
+ skipRow: false,
18795
+ skipCol: false,
18796
+ skipColLen: 0
18797
+ }
18798
+ };
18799
+ if (skipColumnNum > 0) {
18800
+ target[colId].skipColLen = skipColumnNum;
18801
+ target[colId].skipCol = true;
18802
+ skipColumnNum = skipColumnNum - 1;
18803
+ }
18804
+ if (preRowColSkipLen > 1) {
18805
+ target[colId].skipRowLen = preRowColSkipLen - 1;
18806
+ target[colId].skipRow = true;
18807
+ } else {
18808
+ if (rowspan > 1) {
18809
+ target[colId].skipRowLen = rowspan;
18810
+ target[colId].skipRow = false;
18811
+ }
18812
+ }
18813
+ if (colspan > 1) {
18814
+ target[colId].skipColLen = colspan;
18815
+ skipColumnNum = colspan - 1;
18816
+ }
18817
+ Object.assign(skipCfg[rowId], __spreadValues({}, target));
18818
+ });
18819
+ return skipCfg[rowId];
18820
+ };
18773
18821
  const asyncSelection = (row, value, all = false) => {
18774
18822
  if (props2.asyncData && props2.rowKey) {
18775
18823
  if (all) {