bkui-vue 0.0.1-beta.456 → 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
@@ -11159,10 +11159,10 @@ var Component$u = defineComponent({
11159
11159
  },
11160
11160
  computed: {
11161
11161
  dialogWidth() {
11162
- return /^\d+$/.test(`${this.width}`) ? `${this.width}px` : this.width;
11162
+ return /^\d+\.?\d*$/.test(`${this.width}`) ? `${this.width}px` : this.width;
11163
11163
  },
11164
11164
  dialogHeight() {
11165
- return /^\d+$/.test(`${this.height}`) ? `${this.height}px` : this.height;
11165
+ return /^\d+\.?\d*$/.test(`${this.height}`) ? `${this.height}px` : this.height;
11166
11166
  },
11167
11167
  compStyle() {
11168
11168
  return {
@@ -13627,13 +13627,20 @@ var usePopperId = (props2, prefix = "#") => {
13627
13627
  }
13628
13628
  };
13629
13629
  const resolveCommonBoundary = () => {
13630
- if (!/^body$/i.test(props2.boundary) && typeof props2.boundary === "string") {
13631
- if (!isAvailableId(props2.boundary)) {
13632
- console.error("props.boundary is not available selector");
13633
- resolvedBoundary = "body";
13630
+ if (!/^body$/i.test(props2.boundary)) {
13631
+ if (typeof props2.boundary === "string") {
13632
+ if (!isAvailableId(props2.boundary)) {
13633
+ console.error("props.boundary is not available selector");
13634
+ resolvedBoundary = "body";
13635
+ return;
13636
+ }
13637
+ resolvedBoundary = props2.boundary;
13638
+ return;
13639
+ }
13640
+ if (isElement(props2.boundary)) {
13641
+ resolvedBoundary = props2.boundary;
13634
13642
  return;
13635
13643
  }
13636
- resolvedBoundary = props2.boundary;
13637
13644
  }
13638
13645
  };
13639
13646
  resolveBoundary(resolveParentBoundary);
@@ -17506,7 +17513,8 @@ const TABLE_ROW_ATTRIBUTE = {
17506
17513
  };
17507
17514
  const COLUMN_ATTRIBUTE = {
17508
17515
  COL_UID: "__col_$uuid",
17509
- COL_SOURCE_DATA: "__col_source_data"
17516
+ COL_SOURCE_DATA: "__col_source_data",
17517
+ SORT_TYPE: "__sort_type"
17510
17518
  };
17511
17519
  const SCROLLY_WIDTH = 6;
17512
17520
  const LINE_HEIGHT = 42;
@@ -17824,9 +17832,9 @@ var usePagination = (props2, indexData) => {
17824
17832
  endIndex.value = pagination2.current * pagination2.limit;
17825
17833
  };
17826
17834
  const pageData = reactive([]);
17827
- const sort = (sourceData, sortFn) => {
17835
+ const sort = (sourceData, sortFn, activeSortColumn) => {
17828
17836
  if (typeof sortFn === "function") {
17829
- sourceData.sort(sortFn);
17837
+ sourceData.sort((a2, b2) => sortFn(a2, b2, activeSortColumn[COLUMN_ATTRIBUTE.SORT_TYPE]));
17830
17838
  }
17831
17839
  };
17832
17840
  const filter = (sourceData, filterFn) => {
@@ -17843,12 +17851,12 @@ var usePagination = (props2, indexData) => {
17843
17851
  sortScope
17844
17852
  } = (_a = activeSortColumn == null ? void 0 : activeSortColumn.sort) != null ? _a : {};
17845
17853
  if (sortScope === SortScope.ALL) {
17846
- sort(sourceData, sortFn);
17854
+ sort(sourceData, sortFn, activeSortColumn);
17847
17855
  }
17848
17856
  pageData.length = 0;
17849
17857
  pageData.push(...sourceData.slice(startIndex.value, endIndex.value));
17850
17858
  filter(pageData, filterFn);
17851
- sort(pageData, sortFn);
17859
+ sort(pageData, sortFn, activeSortColumn);
17852
17860
  };
17853
17861
  const watchEffectFn = (filterFn, sortFn, activeSortColumn) => {
17854
17862
  pagination2 = resolvePaginationOption(props2.pagination, pagination2);
@@ -19126,16 +19134,6 @@ const isRowSelectEnable = (props2, {
19126
19134
  }
19127
19135
  return true;
19128
19136
  };
19129
- const getRowId = (row, index2, props2) => {
19130
- if (row[TABLE_ROW_ATTRIBUTE.ROW_UID] !== void 0) {
19131
- return row[TABLE_ROW_ATTRIBUTE.ROW_UID];
19132
- }
19133
- const key2 = getRowKey(row, props2, index2);
19134
- if (key2 !== void 0 && row[key2] !== void 0) {
19135
- return row[key2];
19136
- }
19137
- return index2;
19138
- };
19139
19137
  const getRowSourceData = (row) => unref(row[TABLE_ROW_ATTRIBUTE.ROW_SOURCE_DATA] || row);
19140
19138
  const getColumnSourceData = (column) => unref(column[COLUMN_ATTRIBUTE.COL_SOURCE_DATA] || column);
19141
19139
  var TableCell = defineComponent({
@@ -20173,14 +20171,10 @@ class TableRender {
20173
20171
  "--row-height": `${this.getRowHeight(row, rowIndex)}px`
20174
20172
  }];
20175
20173
  const rowClass = [...formatPropAsArray(this.props.rowClass, [row, rowIndex, this]), `hover-${this.props.rowHover}`];
20176
- const rowKey = getRowId(row, rowIndex, this.props);
20177
- return [createVNode(TableRow, {
20178
- "key": rowKey
20179
- }, {
20174
+ return [createVNode(TableRow, null, {
20180
20175
  default: () => [createVNode("tr", {
20181
20176
  "style": rowStyle,
20182
20177
  "class": rowClass,
20183
- "data-key": rowKey,
20184
20178
  "onClick": (e) => this.handleRowClick(e, row, rowIndex, rows),
20185
20179
  "onDblclick": (e) => this.handleRowDblClick(e, row, rowIndex, rows),
20186
20180
  "onMouseenter": (e) => this.handleRowEnter(e, row, rowIndex, rows),
@@ -20191,7 +20185,6 @@ class TableRender {
20191
20185
  const tdCtxClass = {
20192
20186
  "expand-cell": column.type === "expand"
20193
20187
  };
20194
- const cellKey = `__CELL_${rowIndex}_${index2}`;
20195
20188
  const {
20196
20189
  colspan,
20197
20190
  rowspan
@@ -20224,7 +20217,6 @@ class TableRender {
20224
20217
  return createVNode("td", {
20225
20218
  "class": cellClass,
20226
20219
  "style": cellStyle,
20227
- "key": cellKey,
20228
20220
  "colspan": colspan,
20229
20221
  "rowspan": rowspan,
20230
20222
  "onClick": (event) => handleEmit(event, EMIT_EVENTS.CELL_CLICK),
@@ -20241,20 +20233,16 @@ class TableRender {
20241
20233
  }
20242
20234
  return null;
20243
20235
  })])]
20244
- }), this.renderExpandRow(row, rowClass, rowIndex)];
20236
+ }), this.renderExpandRow(row, rowClass)];
20245
20237
  })]);
20246
20238
  }
20247
- renderExpandRow(row, rowClass, rowIndex) {
20239
+ renderExpandRow(row, rowClass) {
20248
20240
  const isExpand = !!row[TABLE_ROW_ATTRIBUTE.ROW_EXPAND];
20249
20241
  if (isExpand) {
20250
20242
  const resovledClass = [...rowClass, {
20251
20243
  row_expend: true
20252
20244
  }];
20253
- const rowId = getRowId(row, rowIndex, this.props);
20254
- const rowKey = `${rowId}_expand`;
20255
- return createVNode(TableRow, {
20256
- "key": rowKey
20257
- }, {
20245
+ return createVNode(TableRow, null, {
20258
20246
  default: () => {
20259
20247
  var _a, _b, _c;
20260
20248
  return [createVNode("tr", {
@@ -21209,6 +21197,9 @@ var Component$f = defineComponent({
21209
21197
  if (typeof sortFn === "function") {
21210
21198
  columnSortFn = sortFn;
21211
21199
  activeSortColumn = column;
21200
+ Object.assign(activeSortColumn, {
21201
+ [COLUMN_ATTRIBUTE.SORT_TYPE]: type
21202
+ });
21212
21203
  resolvePageData(columnFilterFn, columnSortFn, activeSortColumn);
21213
21204
  (_b = (_a = refVirtualRender.value) == null ? void 0 : _a.reset) == null ? void 0 : _b.call(_a);
21214
21205
  }
@@ -31804,7 +31795,6 @@ var FormItem = defineComponent({
31804
31795
  }
31805
31796
  });
31806
31797
  const BkForm = withInstallProps(Form, { FormItem, ComposeFormItem });
31807
- const containerKey = Symbol("containerProps");
31808
31798
  const colProps = {
31809
31799
  span: PropTypes.number.def(1),
31810
31800
  offset: PropTypes.number.def(0),
@@ -31820,7 +31810,7 @@ var Col = defineComponent({
31820
31810
  col,
31821
31811
  gutter,
31822
31812
  flex
31823
- } = inject(containerKey);
31813
+ } = inject("containerProps");
31824
31814
  const {
31825
31815
  span,
31826
31816
  offset: offset2,
@@ -31871,7 +31861,7 @@ var Container = defineComponent({
31871
31861
  flex,
31872
31862
  extCls
31873
31863
  } = props2;
31874
- provide(containerKey, {
31864
+ provide("containerProps", {
31875
31865
  col,
31876
31866
  gutter,
31877
31867
  flex
@@ -31903,7 +31893,7 @@ var Row = defineComponent({
31903
31893
  col,
31904
31894
  gutter,
31905
31895
  flex
31906
- } = inject(containerKey);
31896
+ } = inject("containerProps");
31907
31897
  provide("containerProps", {
31908
31898
  col,
31909
31899
  gutter,