bkui-vue 0.0.1-beta.457 → 0.0.1-beta.458

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
@@ -17513,7 +17513,8 @@ const TABLE_ROW_ATTRIBUTE = {
17513
17513
  };
17514
17514
  const COLUMN_ATTRIBUTE = {
17515
17515
  COL_UID: "__col_$uuid",
17516
- COL_SOURCE_DATA: "__col_source_data"
17516
+ COL_SOURCE_DATA: "__col_source_data",
17517
+ SORT_TYPE: "__sort_type"
17517
17518
  };
17518
17519
  const SCROLLY_WIDTH = 6;
17519
17520
  const LINE_HEIGHT = 42;
@@ -17831,9 +17832,9 @@ var usePagination = (props2, indexData) => {
17831
17832
  endIndex.value = pagination2.current * pagination2.limit;
17832
17833
  };
17833
17834
  const pageData = reactive([]);
17834
- const sort = (sourceData, sortFn) => {
17835
+ const sort = (sourceData, sortFn, activeSortColumn) => {
17835
17836
  if (typeof sortFn === "function") {
17836
- sourceData.sort(sortFn);
17837
+ sourceData.sort((a2, b2) => sortFn(a2, b2, activeSortColumn[COLUMN_ATTRIBUTE.SORT_TYPE]));
17837
17838
  }
17838
17839
  };
17839
17840
  const filter = (sourceData, filterFn) => {
@@ -17850,12 +17851,12 @@ var usePagination = (props2, indexData) => {
17850
17851
  sortScope
17851
17852
  } = (_a = activeSortColumn == null ? void 0 : activeSortColumn.sort) != null ? _a : {};
17852
17853
  if (sortScope === SortScope.ALL) {
17853
- sort(sourceData, sortFn);
17854
+ sort(sourceData, sortFn, activeSortColumn);
17854
17855
  }
17855
17856
  pageData.length = 0;
17856
17857
  pageData.push(...sourceData.slice(startIndex.value, endIndex.value));
17857
17858
  filter(pageData, filterFn);
17858
- sort(pageData, sortFn);
17859
+ sort(pageData, sortFn, activeSortColumn);
17859
17860
  };
17860
17861
  const watchEffectFn = (filterFn, sortFn, activeSortColumn) => {
17861
17862
  pagination2 = resolvePaginationOption(props2.pagination, pagination2);
@@ -19133,16 +19134,6 @@ const isRowSelectEnable = (props2, {
19133
19134
  }
19134
19135
  return true;
19135
19136
  };
19136
- const getRowId = (row, index2, props2) => {
19137
- if (row[TABLE_ROW_ATTRIBUTE.ROW_UID] !== void 0) {
19138
- return row[TABLE_ROW_ATTRIBUTE.ROW_UID];
19139
- }
19140
- const key2 = getRowKey(row, props2, index2);
19141
- if (key2 !== void 0 && row[key2] !== void 0) {
19142
- return row[key2];
19143
- }
19144
- return index2;
19145
- };
19146
19137
  const getRowSourceData = (row) => unref(row[TABLE_ROW_ATTRIBUTE.ROW_SOURCE_DATA] || row);
19147
19138
  const getColumnSourceData = (column) => unref(column[COLUMN_ATTRIBUTE.COL_SOURCE_DATA] || column);
19148
19139
  var TableCell = defineComponent({
@@ -20180,14 +20171,10 @@ class TableRender {
20180
20171
  "--row-height": `${this.getRowHeight(row, rowIndex)}px`
20181
20172
  }];
20182
20173
  const rowClass = [...formatPropAsArray(this.props.rowClass, [row, rowIndex, this]), `hover-${this.props.rowHover}`];
20183
- const rowKey = getRowId(row, rowIndex, this.props);
20184
- return [createVNode(TableRow, {
20185
- "key": rowKey
20186
- }, {
20174
+ return [createVNode(TableRow, null, {
20187
20175
  default: () => [createVNode("tr", {
20188
20176
  "style": rowStyle,
20189
20177
  "class": rowClass,
20190
- "data-key": rowKey,
20191
20178
  "onClick": (e) => this.handleRowClick(e, row, rowIndex, rows),
20192
20179
  "onDblclick": (e) => this.handleRowDblClick(e, row, rowIndex, rows),
20193
20180
  "onMouseenter": (e) => this.handleRowEnter(e, row, rowIndex, rows),
@@ -20198,7 +20185,6 @@ class TableRender {
20198
20185
  const tdCtxClass = {
20199
20186
  "expand-cell": column.type === "expand"
20200
20187
  };
20201
- const cellKey = `__CELL_${rowIndex}_${index2}`;
20202
20188
  const {
20203
20189
  colspan,
20204
20190
  rowspan
@@ -20231,7 +20217,6 @@ class TableRender {
20231
20217
  return createVNode("td", {
20232
20218
  "class": cellClass,
20233
20219
  "style": cellStyle,
20234
- "key": cellKey,
20235
20220
  "colspan": colspan,
20236
20221
  "rowspan": rowspan,
20237
20222
  "onClick": (event) => handleEmit(event, EMIT_EVENTS.CELL_CLICK),
@@ -20248,20 +20233,16 @@ class TableRender {
20248
20233
  }
20249
20234
  return null;
20250
20235
  })])]
20251
- }), this.renderExpandRow(row, rowClass, rowIndex)];
20236
+ }), this.renderExpandRow(row, rowClass)];
20252
20237
  })]);
20253
20238
  }
20254
- renderExpandRow(row, rowClass, rowIndex) {
20239
+ renderExpandRow(row, rowClass) {
20255
20240
  const isExpand = !!row[TABLE_ROW_ATTRIBUTE.ROW_EXPAND];
20256
20241
  if (isExpand) {
20257
20242
  const resovledClass = [...rowClass, {
20258
20243
  row_expend: true
20259
20244
  }];
20260
- const rowId = getRowId(row, rowIndex, this.props);
20261
- const rowKey = `${rowId}_expand`;
20262
- return createVNode(TableRow, {
20263
- "key": rowKey
20264
- }, {
20245
+ return createVNode(TableRow, null, {
20265
20246
  default: () => {
20266
20247
  var _a, _b, _c;
20267
20248
  return [createVNode("tr", {
@@ -21216,6 +21197,9 @@ var Component$f = defineComponent({
21216
21197
  if (typeof sortFn === "function") {
21217
21198
  columnSortFn = sortFn;
21218
21199
  activeSortColumn = column;
21200
+ Object.assign(activeSortColumn, {
21201
+ [COLUMN_ATTRIBUTE.SORT_TYPE]: type
21202
+ });
21219
21203
  resolvePageData(columnFilterFn, columnSortFn, activeSortColumn);
21220
21204
  (_b = (_a = refVirtualRender.value) == null ? void 0 : _a.reset) == null ? void 0 : _b.call(_a);
21221
21205
  }
@@ -31811,7 +31795,6 @@ var FormItem = defineComponent({
31811
31795
  }
31812
31796
  });
31813
31797
  const BkForm = withInstallProps(Form, { FormItem, ComposeFormItem });
31814
- const containerKey = Symbol("containerProps");
31815
31798
  const colProps = {
31816
31799
  span: PropTypes.number.def(1),
31817
31800
  offset: PropTypes.number.def(0),
@@ -31827,7 +31810,7 @@ var Col = defineComponent({
31827
31810
  col,
31828
31811
  gutter,
31829
31812
  flex
31830
- } = inject(containerKey);
31813
+ } = inject("containerProps");
31831
31814
  const {
31832
31815
  span,
31833
31816
  offset: offset2,
@@ -31878,7 +31861,7 @@ var Container = defineComponent({
31878
31861
  flex,
31879
31862
  extCls
31880
31863
  } = props2;
31881
- provide(containerKey, {
31864
+ provide("containerProps", {
31882
31865
  col,
31883
31866
  gutter,
31884
31867
  flex
@@ -31910,7 +31893,7 @@ var Row = defineComponent({
31910
31893
  col,
31911
31894
  gutter,
31912
31895
  flex
31913
- } = inject(containerKey);
31896
+ } = inject("containerProps");
31914
31897
  provide("containerProps", {
31915
31898
  col,
31916
31899
  gutter,