bkui-vue 2.0.1-beta.15.table.10 → 2.0.1-beta.15.table.11

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.
@@ -17913,8 +17913,9 @@ var tableProps = {
17913
17913
  }
17914
17914
  }).def(null)
17915
17915
  };
17916
+ // EXTERNAL MODULE: ../../node_modules/lodash/lodash.js
17917
+ var lodash = __webpack_require__(6635);
17916
17918
  ;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
17917
-
17918
17919
  /*
17919
17920
  * Tencent is pleased to support the open source community by making
17920
17921
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -17944,6 +17945,7 @@ var tableProps = {
17944
17945
 
17945
17946
 
17946
17947
 
17948
+
17947
17949
  var TableColumnProp = {
17948
17950
  label: LabelFunctionStringType,
17949
17951
  field: LabelFunctionStringType,
@@ -17967,15 +17969,16 @@ var TableColumnProp = {
17967
17969
  /* harmony default export */ const table_column = ((0,external_vue_namespaceObject.defineComponent)({
17968
17970
  name: 'TableColumn',
17969
17971
  props: TableColumnProp,
17970
- setup: function setup(props) {
17972
+ setup: function setup(props, _ref) {
17973
+ var slots = _ref.slots;
17971
17974
  var initTableColumns = (0,external_vue_namespaceObject.inject)(PROVIDE_KEY_INIT_COL, function () {});
17972
- var column = (0,external_vue_namespaceObject.reactive)(Object.assign({}, props, {
17973
- field: props.prop || props.field
17974
- }));
17975
17975
  (0,external_vue_namespaceObject.watch)(function () {
17976
17976
  return [props];
17977
- }, function () {
17978
- initTableColumns();
17977
+ }, function (oldVal, newVal) {
17978
+ var _newVal$;
17979
+ if (!(0,lodash.isEqual)((0,external_vue_namespaceObject.toRaw)(oldVal === null || oldVal === void 0 ? void 0 : oldVal[0]), (0,external_vue_namespaceObject.toRaw)((_newVal$ = newVal === null || newVal === void 0 ? void 0 : newVal[0]) !== null && _newVal$ !== void 0 ? _newVal$ : {}))) {
17980
+ initTableColumns();
17981
+ }
17979
17982
  }, {
17980
17983
  immediate: true,
17981
17984
  deep: true
@@ -17983,19 +17986,14 @@ var TableColumnProp = {
17983
17986
  (0,external_vue_namespaceObject.onUnmounted)(function () {
17984
17987
  initTableColumns();
17985
17988
  });
17986
- return {
17987
- column: column
17989
+ return function () {
17990
+ var _slots$default;
17991
+ return (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots, {
17992
+ row: {}
17993
+ });
17988
17994
  };
17989
- },
17990
- render: function render() {
17991
- var _this$$slots$default, _this$$slots;
17992
- return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(_this$$slots$default = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots, {
17993
- row: {}
17994
- })]);
17995
17995
  }
17996
17996
  }));
17997
- // EXTERNAL MODULE: ../../node_modules/lodash/lodash.js
17998
- var lodash = __webpack_require__(6635);
17999
17997
  ;// CONCATENATED MODULE: ../../packages/table/src/events.ts
18000
17998
 
18001
17999
  var _EMIT_EVENT_TYPES;
@@ -18409,12 +18407,18 @@ function v4(options, buf, offset) {
18409
18407
  var columns = [];
18410
18408
  var columnIndex = 0;
18411
18409
  var columnCache = new WeakMap();
18410
+ var getPropRawData = function getPropRawData(prop) {
18411
+ if ((0,external_vue_namespaceObject.isRef)(prop)) {
18412
+ return (0,external_vue_namespaceObject.unref)(prop);
18413
+ }
18414
+ return (0,external_vue_namespaceObject.toRaw)(prop);
18415
+ };
18412
18416
  var copyProps = function copyProps(props) {
18413
18417
  return Object.keys(props !== null && props !== void 0 ? props : {}).reduce(function (result, key) {
18414
18418
  var target = key.replace(/-(\w)/g, function (_, letter) {
18415
18419
  return letter.toUpperCase();
18416
18420
  });
18417
- return Object.assign(result, defineProperty_defineProperty({}, target, props[key]));
18421
+ return Object.assign(result, defineProperty_defineProperty({}, target, getPropRawData(props[key])));
18418
18422
  }, {});
18419
18423
  };
18420
18424
  var getNodeCtxUid = function getNodeCtxUid(ctx) {
@@ -18445,6 +18449,9 @@ function v4(options, buf, offset) {
18445
18449
  }
18446
18450
  return;
18447
18451
  }
18452
+ if (Array.isArray(node)) {
18453
+ node.forEach(resolveChildNode);
18454
+ }
18448
18455
  if (Array.isArray(node === null || node === void 0 ? void 0 : node.children)) {
18449
18456
  node.children.forEach(resolveChildNode);
18450
18457
  }
@@ -18458,26 +18465,24 @@ function v4(options, buf, offset) {
18458
18465
  }
18459
18466
  return;
18460
18467
  };
18461
- var setNodeInstanceId = function setNodeInstanceId(column, uniqueId) {
18462
- if (!columnCache.has(column)) {
18463
- columnCache.set(columnCache, {
18464
- uniqueId: uniqueId,
18465
- column: column
18466
- });
18467
- }
18468
- };
18469
18468
  var resolveColumns = function resolveColumns(children) {
18470
18469
  columns.length = 0;
18471
18470
  columnIndex = 0;
18472
- children.forEach(resolveChildNode);
18471
+ var GhostBody = children.find(function (node) {
18472
+ var _node$type3;
18473
+ return ((_node$type3 = node.type) === null || _node$type3 === void 0 ? void 0 : _node$type3.name) === 'GhostBody';
18474
+ });
18475
+ if (GhostBody) {
18476
+ var _GhostBody$children$d, _GhostBody$children, _GhostBody$children$d2;
18477
+ ((_GhostBody$children$d = (_GhostBody$children = GhostBody.children) === null || _GhostBody$children === void 0 || (_GhostBody$children$d2 = _GhostBody$children["default"]) === null || _GhostBody$children$d2 === void 0 ? void 0 : _GhostBody$children$d2.call(_GhostBody$children)) !== null && _GhostBody$children$d !== void 0 ? _GhostBody$children$d : []).forEach(resolveChildNode);
18478
+ }
18473
18479
  columns.sort(function (col1, col2) {
18474
18480
  return col1.index - col2.index;
18475
18481
  });
18476
18482
  return columns;
18477
18483
  };
18478
18484
  return {
18479
- resolveColumns: resolveColumns,
18480
- setNodeInstanceId: setNodeInstanceId
18485
+ resolveColumns: resolveColumns
18481
18486
  };
18482
18487
  });
18483
18488
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
@@ -20243,6 +20248,7 @@ var useColumns = function useColumns(props) {
20243
20248
  * @param columns
20244
20249
  */
20245
20250
  var formatColumns = function formatColumns() {
20251
+ sortColumns.length = 0;
20246
20252
  resolveDraggableColumn();
20247
20253
  var skipColNum = 0;
20248
20254
  (tableColumnList || []).forEach(function (col, index) {
@@ -20866,6 +20872,51 @@ const loading_less_namespaceObject = loading_less_x({ });
20866
20872
  renderScrollLoading: renderScrollLoading
20867
20873
  };
20868
20874
  });
20875
+ ;// CONCATENATED MODULE: ../../packages/table/src/components/ghost-body.tsx
20876
+
20877
+ /*
20878
+ * Tencent is pleased to support the open source community by making
20879
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
20880
+ *
20881
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
20882
+ *
20883
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
20884
+ *
20885
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
20886
+ *
20887
+ * ---------------------------------------------------
20888
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
20889
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
20890
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
20891
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
20892
+ *
20893
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
20894
+ * the Software.
20895
+ *
20896
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
20897
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20898
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
20899
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20900
+ * IN THE SOFTWARE.
20901
+ */
20902
+
20903
+ /* harmony default export */ const ghost_body = ((0,external_vue_namespaceObject.defineComponent)({
20904
+ name: 'GhostBody',
20905
+ setup: function setup(_, ctx) {
20906
+ var columnGhostStyle = {
20907
+ zIndex: -1,
20908
+ width: 0,
20909
+ height: 0,
20910
+ display: 'none'
20911
+ };
20912
+ return function () {
20913
+ var _ctx$slots$default, _ctx$slots;
20914
+ return (0,external_vue_namespaceObject.createVNode)("div", {
20915
+ "style": columnGhostStyle
20916
+ }, [(_ctx$slots$default = (_ctx$slots = ctx.slots)["default"]) === null || _ctx$slots$default === void 0 ? void 0 : _ctx$slots$default.call(_ctx$slots)]);
20917
+ };
20918
+ }
20919
+ }));
20869
20920
  ;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-layout.tsx
20870
20921
 
20871
20922
 
@@ -20907,6 +20958,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
20907
20958
 
20908
20959
 
20909
20960
 
20961
+
20910
20962
  /* harmony default export */ const use_layout = (function (props, ctx) {
20911
20963
  var _props$rowHeight;
20912
20964
  var refRoot = (0,external_vue_namespaceObject.ref)(null);
@@ -20991,23 +21043,19 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
20991
21043
  });
20992
21044
  var bodyClass = defineProperty_defineProperty({}, resolveClassName('table-body'), true);
20993
21045
  var footerClass = (0,external_vue_namespaceObject.computed)(function () {
20994
- return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-footer'), true), 'is-hidden', !props.pagination || !props.data.length));
21046
+ return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-footer'), true), 'is-hidden', footHeight.value === 0));
20995
21047
  });
20996
- var columnGhostStyle = {
20997
- zIndex: -1,
20998
- width: 0,
20999
- height: 0,
21000
- display: 'none'
21001
- };
21002
21048
  var renderContainer = function renderContainer(childrend) {
21003
21049
  var _ctx$slots$default, _ctx$slots;
21004
21050
  return (0,external_vue_namespaceObject.createVNode)("div", {
21005
21051
  "ref": refRoot,
21006
21052
  "style": tableStyle.value,
21007
21053
  "class": tableClass.value
21008
- }, [childrend, (0,external_vue_namespaceObject.createVNode)("div", {
21009
- "style": columnGhostStyle
21010
- }, [(_ctx$slots$default = (_ctx$slots = ctx.slots)["default"]) === null || _ctx$slots$default === void 0 ? void 0 : _ctx$slots$default.call(_ctx$slots)])]);
21054
+ }, [childrend, (0,external_vue_namespaceObject.createVNode)(ghost_body, null, {
21055
+ "default": function _default() {
21056
+ return [(_ctx$slots$default = (_ctx$slots = ctx.slots)["default"]) === null || _ctx$slots$default === void 0 ? void 0 : _ctx$slots$default.call(_ctx$slots)];
21057
+ }
21058
+ })]);
21011
21059
  };
21012
21060
  var renderHeader = function renderHeader(childrend, settings, fixedRows) {
21013
21061
  return (0,external_vue_namespaceObject.createVNode)("div", {
@@ -23144,7 +23192,7 @@ function use_render_isSlot(s) {
23144
23192
  ctx.emit(EMIT_EVENTS.PAGE_LIMIT_CHANGE, limit);
23145
23193
  };
23146
23194
  var handlePageChange = function handlePageChange(current) {
23147
- if (typeof_typeof(props.pagination) === 'object' && current !== props.pagination.current) {
23195
+ if (typeof_typeof(props.pagination) === 'object' && current !== pagination.options.current) {
23148
23196
  pagination.setPagination({
23149
23197
  current: current,
23150
23198
  value: current
@@ -38,51 +38,9 @@ declare const BkTableColumn: {
38
38
  } & {
39
39
  default: number;
40
40
  };
41
- }>>, {
42
- column: {
43
- fixed?: boolean | "left" | "right";
44
- resizable?: boolean;
45
- minWidth?: string | number;
46
- index?: number;
47
- columnKey?: string;
48
- colspan?: import("../table/props").SpanFunctionString;
49
- rowspan?: import("../table/props").SpanFunctionString;
50
- render?: import("../table/props").RenderFunctionString;
51
- sort?: string | boolean | {
52
- sortFn?: Function;
53
- sortScope?: import("../table/props").SortScope;
54
- value?: import("../table/const").SORT_OPTION;
55
- };
56
- filter?: string | boolean | {
57
- list: any[];
58
- filterFn?: Function;
59
- match?: import("../table/props").FullEnum;
60
- checked?: any[];
61
- filterScope?: import("../table/props").SortScope;
62
- btnSave?: string | boolean;
63
- btnReset?: string | boolean;
64
- height?: number;
65
- maxHeight?: number;
66
- };
67
- type?: "index" | "expand" | "__COL_TYPE_NONE" | "selection";
68
- label?: import("../table/props").LabelFunctionString;
69
- width?: string | number;
70
- className?: import("../table/props").RowClassFunctionString;
71
- align?: "" | "left" | "right" | "center";
72
- showOverflowTooltip?: boolean | {
73
- content: string | ((col: import("../../bkui-vue").TableIColumn, row: any) => string);
74
- disabled?: boolean | ((col: import("../../bkui-vue").TableIColumn, row: any) => boolean);
75
- allowHtml?: boolean;
76
- watchCellResize?: boolean;
77
- mode?: "auto" | "static";
78
- popoverOption?: any;
79
- resizerWay?: import("../table/props").ResizerWay;
80
- showHead?: boolean;
81
- };
82
- field: import("../table/props").LabelFunctionString;
83
- prop?: import("../table/props").LabelFunctionString;
84
- };
85
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
41
+ }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
42
+ [key: string]: any;
43
+ }>[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
86
44
  label: import("vue-types").VueTypeDef<import("../table/props").LabelFunctionString>;
87
45
  field: import("vue-types").VueTypeDef<import("../table/props").LabelFunctionString>;
88
46
  render: import("vue-types").VueTypeDef<import("../table/props").RenderFunctionString>;
@@ -175,51 +133,9 @@ declare const BkTableColumn: {
175
133
  } & {
176
134
  default: number;
177
135
  };
178
- }>>, {
179
- column: {
180
- fixed?: boolean | "left" | "right";
181
- resizable?: boolean;
182
- minWidth?: string | number;
183
- index?: number;
184
- columnKey?: string;
185
- colspan?: import("../table/props").SpanFunctionString;
186
- rowspan?: import("../table/props").SpanFunctionString;
187
- render?: import("../table/props").RenderFunctionString;
188
- sort?: string | boolean | {
189
- sortFn?: Function;
190
- sortScope?: import("../table/props").SortScope;
191
- value?: import("../table/const").SORT_OPTION;
192
- };
193
- filter?: string | boolean | {
194
- list: any[];
195
- filterFn?: Function;
196
- match?: import("../table/props").FullEnum;
197
- checked?: any[];
198
- filterScope?: import("../table/props").SortScope;
199
- btnSave?: string | boolean;
200
- btnReset?: string | boolean;
201
- height?: number;
202
- maxHeight?: number;
203
- };
204
- type?: "index" | "expand" | "__COL_TYPE_NONE" | "selection";
205
- label?: import("../table/props").LabelFunctionString;
206
- width?: string | number;
207
- className?: import("../table/props").RowClassFunctionString;
208
- align?: "" | "left" | "right" | "center";
209
- showOverflowTooltip?: boolean | {
210
- content: string | ((col: import("../../bkui-vue").TableIColumn, row: any) => string);
211
- disabled?: boolean | ((col: import("../../bkui-vue").TableIColumn, row: any) => boolean);
212
- allowHtml?: boolean;
213
- watchCellResize?: boolean;
214
- mode?: "auto" | "static";
215
- popoverOption?: any;
216
- resizerWay?: import("../table/props").ResizerWay;
217
- showHead?: boolean;
218
- };
219
- field: import("../table/props").LabelFunctionString;
220
- prop?: import("../table/props").LabelFunctionString;
221
- };
222
- }, {}, {}, {}, {
136
+ }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
137
+ [key: string]: any;
138
+ }>[], {}, {}, {}, {
223
139
  fixed: boolean | "left" | "right";
224
140
  resizable: boolean;
225
141
  minWidth: string | number;
@@ -270,51 +186,9 @@ declare const BkTableColumn: {
270
186
  } & {
271
187
  default: number;
272
188
  };
273
- }>>, {
274
- column: {
275
- fixed?: boolean | "left" | "right";
276
- resizable?: boolean;
277
- minWidth?: string | number;
278
- index?: number;
279
- columnKey?: string;
280
- colspan?: import("../table/props").SpanFunctionString;
281
- rowspan?: import("../table/props").SpanFunctionString;
282
- render?: import("../table/props").RenderFunctionString;
283
- sort?: string | boolean | {
284
- sortFn?: Function;
285
- sortScope?: import("../table/props").SortScope;
286
- value?: import("../table/const").SORT_OPTION;
287
- };
288
- filter?: string | boolean | {
289
- list: any[];
290
- filterFn?: Function;
291
- match?: import("../table/props").FullEnum;
292
- checked?: any[];
293
- filterScope?: import("../table/props").SortScope;
294
- btnSave?: string | boolean;
295
- btnReset?: string | boolean;
296
- height?: number;
297
- maxHeight?: number;
298
- };
299
- type?: "index" | "expand" | "__COL_TYPE_NONE" | "selection";
300
- label?: import("../table/props").LabelFunctionString;
301
- width?: string | number;
302
- className?: import("../table/props").RowClassFunctionString;
303
- align?: "" | "left" | "right" | "center";
304
- showOverflowTooltip?: boolean | {
305
- content: string | ((col: import("../../bkui-vue").TableIColumn, row: any) => string);
306
- disabled?: boolean | ((col: import("../../bkui-vue").TableIColumn, row: any) => boolean);
307
- allowHtml?: boolean;
308
- watchCellResize?: boolean;
309
- mode?: "auto" | "static";
310
- popoverOption?: any;
311
- resizerWay?: import("../table/props").ResizerWay;
312
- showHead?: boolean;
313
- };
314
- field: import("../table/props").LabelFunctionString;
315
- prop?: import("../table/props").LabelFunctionString;
316
- };
317
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
189
+ }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
190
+ [key: string]: any;
191
+ }>[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
318
192
  fixed: boolean | "left" | "right";
319
193
  resizable: boolean;
320
194
  minWidth: string | number;