bkui-vue 2.0.1-beta.15.table.7 → 2.0.1-beta.15.table.9
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 +37 -37
- package/dist/index.esm.js +6282 -6273
- package/dist/index.umd.js +38 -38
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/index.js +1 -1
- package/lib/table/hooks/use-cell.d.ts +3 -3
- package/lib/table/hooks/use-column-template.d.ts +2 -2
- package/lib/table/hooks/use-layout.d.ts +3 -2
- package/lib/table/index.d.ts +15 -0
- package/lib/table/index.js +549 -527
- package/lib/table/props.d.ts +11 -0
- package/lib/table/table.css +10 -2
- package/lib/table/table.d.ts +7 -0
- package/lib/table/table.less +11 -16
- package/lib/table/table.variable.css +10 -2
- package/lib/table-column/index.js +10 -1
- package/package.json +1 -1
package/lib/table/index.js
CHANGED
@@ -9,6 +9,8 @@ import * as __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__ from "lodash/de
|
|
9
9
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_get_9427f899__ from "lodash/get";
|
10
10
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_virtual_render_927587a8__ from "../virtual-render";
|
11
11
|
import "../virtual-render/virtual-render.less";
|
12
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__ from "../loading";
|
13
|
+
import "../loading/loading.less";
|
12
14
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_pagination_95c6c47e__ from "../pagination";
|
13
15
|
import "../pagination/pagination.less";
|
14
16
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_exception_7490d0fd__ from "../exception";
|
@@ -16,16 +18,14 @@ import "../exception/exception.less";
|
|
16
18
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__ from "../directives";
|
17
19
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__ from "../checkbox";
|
18
20
|
import "../checkbox/checkbox.less";
|
19
|
-
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
|
20
21
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_button_a2ea7c9a__ from "../button";
|
21
22
|
import "../button/button.less";
|
23
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
|
22
24
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e__ from "../input";
|
23
25
|
import "../input/input.less";
|
24
26
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__ from "../popover";
|
25
27
|
import "../popover/popover.less";
|
26
28
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon__3efece53__ from "../icon/";
|
27
|
-
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__ from "../loading";
|
28
|
-
import "../loading/loading.less";
|
29
29
|
/******/ var __webpack_modules__ = ({
|
30
30
|
|
31
31
|
/***/ 6635:
|
@@ -17902,7 +17902,16 @@ var tableProps = {
|
|
17902
17902
|
/**
|
17903
17903
|
* 启用Scrollbar
|
17904
17904
|
*/
|
17905
|
-
scrollbar: shared_namespaceObject.PropTypes.bool.def(true)
|
17905
|
+
scrollbar: shared_namespaceObject.PropTypes.bool.def(true),
|
17906
|
+
/**
|
17907
|
+
* 固定在底部的配置项
|
17908
|
+
*/
|
17909
|
+
fixedBottom: (0,external_vue_types_namespaceObject.toType)('FixedBottomOption', {
|
17910
|
+
"default": {
|
17911
|
+
position: 'relative',
|
17912
|
+
height: LINE_HEIGHT
|
17913
|
+
}
|
17914
|
+
}).def(null)
|
17906
17915
|
};
|
17907
17916
|
;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
|
17908
17917
|
|
@@ -18457,12 +18466,9 @@ function v4(options, buf, offset) {
|
|
18457
18466
|
});
|
18458
18467
|
}
|
18459
18468
|
};
|
18460
|
-
var resolveColumns = function resolveColumns(
|
18461
|
-
var _instance$slots$defau, _instance$slots, _instance$slots$defau2;
|
18462
|
-
var instance = target !== null && target !== void 0 ? target : (0,external_vue_namespaceObject.getCurrentInstance)();
|
18469
|
+
var resolveColumns = function resolveColumns(children) {
|
18463
18470
|
columns.length = 0;
|
18464
18471
|
columnIndex = 0;
|
18465
|
-
var children = (_instance$slots$defau = (_instance$slots = instance.slots) === null || _instance$slots === void 0 || (_instance$slots$defau2 = _instance$slots["default"]) === null || _instance$slots$defau2 === void 0 ? void 0 : _instance$slots$defau2.call(_instance$slots)) !== null && _instance$slots$defau !== void 0 ? _instance$slots$defau : [];
|
18466
18472
|
children.forEach(resolveChildNode);
|
18467
18473
|
columns.sort(function (col1, col2) {
|
18468
18474
|
return col1.index - col2.index;
|
@@ -20783,6 +20789,90 @@ const virtual_render_namespaceObject = virtual_render_x({ ["default"]: () => __W
|
|
20783
20789
|
var virtual_render_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
20784
20790
|
var virtual_render_less_y = x => () => x
|
20785
20791
|
const virtual_render_less_namespaceObject = virtual_render_less_x({ });
|
20792
|
+
;// CONCATENATED MODULE: external "../loading"
|
20793
|
+
var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
20794
|
+
var loading_y = x => () => x
|
20795
|
+
const loading_namespaceObject = loading_x({ ["BkLoadingMode"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingMode, ["BkLoadingSize"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingSize, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__["default"] });
|
20796
|
+
;// CONCATENATED MODULE: external "../loading/loading.less"
|
20797
|
+
var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
20798
|
+
var loading_less_y = x => () => x
|
20799
|
+
const loading_less_namespaceObject = loading_less_x({ });
|
20800
|
+
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-scroll-loading.tsx
|
20801
|
+
|
20802
|
+
|
20803
|
+
/*
|
20804
|
+
* Tencent is pleased to support the open source community by making
|
20805
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
20806
|
+
*
|
20807
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
20808
|
+
*
|
20809
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
20810
|
+
*
|
20811
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
20812
|
+
*
|
20813
|
+
* ---------------------------------------------------
|
20814
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
20815
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
20816
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
20817
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
20818
|
+
*
|
20819
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
20820
|
+
* the Software.
|
20821
|
+
*
|
20822
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
20823
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20824
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
20825
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
20826
|
+
* IN THE SOFTWARE.
|
20827
|
+
*/
|
20828
|
+
|
20829
|
+
|
20830
|
+
|
20831
|
+
|
20832
|
+
/* harmony default export */ const use_scroll_loading = (function (props, ctx) {
|
20833
|
+
var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
|
20834
|
+
var getLoadingOption = function getLoadingOption() {
|
20835
|
+
if (typeof refScrollLoading.value === 'boolean') {
|
20836
|
+
return {
|
20837
|
+
loading: !!refScrollLoading.value,
|
20838
|
+
inline: true,
|
20839
|
+
title: '',
|
20840
|
+
size: loading_namespaceObject.BkLoadingSize.Normal,
|
20841
|
+
mode: loading_namespaceObject.BkLoadingMode.Default,
|
20842
|
+
indicator: null
|
20843
|
+
};
|
20844
|
+
}
|
20845
|
+
return refScrollLoading.value;
|
20846
|
+
};
|
20847
|
+
var isRender = (0,external_vue_namespaceObject.computed)(function () {
|
20848
|
+
return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
|
20849
|
+
});
|
20850
|
+
var renderScrollLoading = function renderScrollLoading() {
|
20851
|
+
var _ctx$slots$fixedBotto3, _ctx$slots$fixedBotto4, _ctx$slots2;
|
20852
|
+
if (isRender.value) {
|
20853
|
+
var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
|
20854
|
+
var _getLoadingOption = getLoadingOption(),
|
20855
|
+
loading = _getLoadingOption.loading,
|
20856
|
+
size = _getLoadingOption.size,
|
20857
|
+
mode = _getLoadingOption.mode,
|
20858
|
+
title = _getLoadingOption.title,
|
20859
|
+
inline = _getLoadingOption.inline,
|
20860
|
+
indicator = _getLoadingOption.indicator;
|
20861
|
+
return (_ctx$slots$fixedBotto = (_ctx$slots$fixedBotto2 = (_ctx$slots = ctx.slots).fixedBottom) === null || _ctx$slots$fixedBotto2 === void 0 ? void 0 : _ctx$slots$fixedBotto2.call(_ctx$slots)) !== null && _ctx$slots$fixedBotto !== void 0 ? _ctx$slots$fixedBotto : (0,external_vue_namespaceObject.createVNode)(loading_namespaceObject["default"], {
|
20862
|
+
loading: loading,
|
20863
|
+
size: size,
|
20864
|
+
mode: mode,
|
20865
|
+
title: title,
|
20866
|
+
inline: inline,
|
20867
|
+
indicator: indicator
|
20868
|
+
}, null);
|
20869
|
+
}
|
20870
|
+
return (_ctx$slots$fixedBotto3 = (_ctx$slots$fixedBotto4 = (_ctx$slots2 = ctx.slots).fixedBottom) === null || _ctx$slots$fixedBotto4 === void 0 ? void 0 : _ctx$slots$fixedBotto4.call(_ctx$slots2)) !== null && _ctx$slots$fixedBotto3 !== void 0 ? _ctx$slots$fixedBotto3 : null;
|
20871
|
+
};
|
20872
|
+
return {
|
20873
|
+
renderScrollLoading: renderScrollLoading
|
20874
|
+
};
|
20875
|
+
});
|
20786
20876
|
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-layout.tsx
|
20787
20877
|
|
20788
20878
|
|
@@ -20823,6 +20913,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20823
20913
|
|
20824
20914
|
|
20825
20915
|
|
20916
|
+
|
20826
20917
|
/* harmony default export */ const use_layout = (function (props, ctx) {
|
20827
20918
|
var _props$rowHeight;
|
20828
20919
|
var refRoot = (0,external_vue_namespaceObject.ref)(null);
|
@@ -20837,8 +20928,14 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20837
20928
|
var layout = (0,external_vue_namespaceObject.reactive)({});
|
20838
20929
|
var fixedColumns = (0,external_vue_namespaceObject.reactive)([]);
|
20839
20930
|
var lineHeight = (0,external_vue_namespaceObject.ref)((_props$rowHeight = props.rowHeight) !== null && _props$rowHeight !== void 0 ? _props$rowHeight : LINE_HEIGHT);
|
20931
|
+
var fixedBottomHeight = (0,external_vue_namespaceObject.computed)(function () {
|
20932
|
+
var _props$fixedBottom, _props$fixedBottom$he, _props$fixedBottom2, _props$fixedBottom$he2, _props$fixedBottom3;
|
20933
|
+
return ((_props$fixedBottom = props.fixedBottom) === null || _props$fixedBottom === void 0 ? void 0 : _props$fixedBottom.position) === 'relative' ? (_props$fixedBottom$he = (_props$fixedBottom2 = props.fixedBottom) === null || _props$fixedBottom2 === void 0 ? void 0 : _props$fixedBottom2.height) !== null && _props$fixedBottom$he !== void 0 ? _props$fixedBottom$he : LINE_HEIGHT : (_props$fixedBottom$he2 = (_props$fixedBottom3 = props.fixedBottom) === null || _props$fixedBottom3 === void 0 ? void 0 : _props$fixedBottom3.height) !== null && _props$fixedBottom$he2 !== void 0 ? _props$fixedBottom$he2 : 0;
|
20934
|
+
});
|
20840
20935
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
20841
20936
|
resolveClassName = _usePrefix.resolveClassName;
|
20937
|
+
var _useScrollLoading = use_scroll_loading(props, ctx),
|
20938
|
+
renderScrollLoading = _useScrollLoading.renderScrollLoading;
|
20842
20939
|
var tableClass = (0,external_vue_namespaceObject.computed)(function () {
|
20843
20940
|
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty({}, resolveClassName('table'), true), resolvePropBorderToClassStr(props.border));
|
20844
20941
|
});
|
@@ -20853,17 +20950,19 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20853
20950
|
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-head'), true), 'has-settings', !!props.settings));
|
20854
20951
|
});
|
20855
20952
|
var setFixedColumnShawdow = function setFixedColumnShawdow() {
|
20953
|
+
var _refRoot$value, _refRoot$value2;
|
20856
20954
|
var rightShawdow = offsetRight.value > 0 ? '0 0 10px rgb(0 0 0 / 12%)' : null;
|
20857
20955
|
var leftShawdow = translateX.value > 0 ? '0 0 10px rgb(0 0 0 / 12%)' : null;
|
20858
|
-
refRoot.value.style.setProperty('--shadow-right', rightShawdow);
|
20859
|
-
refRoot.value.style.setProperty('--shadow-left', leftShawdow);
|
20956
|
+
(_refRoot$value = refRoot.value) === null || _refRoot$value === void 0 || (_refRoot$value = _refRoot$value.style) === null || _refRoot$value === void 0 || _refRoot$value.setProperty('--shadow-right', rightShawdow);
|
20957
|
+
(_refRoot$value2 = refRoot.value) === null || _refRoot$value2 === void 0 || (_refRoot$value2 = _refRoot$value2.style) === null || _refRoot$value2 === void 0 || _refRoot$value2.setProperty('--shadow-left', leftShawdow);
|
20860
20958
|
};
|
20861
20959
|
var setRootStyleVars = (0,shared_namespaceObject.throttle)(function () {
|
20862
|
-
|
20863
|
-
refRoot.value.style.setProperty('--drag-offset-
|
20864
|
-
refRoot.value.style.setProperty('--
|
20865
|
-
refRoot.value.style.setProperty('--translate-
|
20866
|
-
refRoot.value.style.setProperty('--translate-x
|
20960
|
+
var _refRoot$value3, _refRoot$value4, _refRoot$value5, _refRoot$value6, _refRoot$value7;
|
20961
|
+
(_refRoot$value3 = refRoot.value) === null || _refRoot$value3 === void 0 || (_refRoot$value3 = _refRoot$value3.style) === null || _refRoot$value3 === void 0 || _refRoot$value3.setProperty('--drag-offset-x', "".concat(dragOffsetX.value, "px"));
|
20962
|
+
(_refRoot$value4 = refRoot.value) === null || _refRoot$value4 === void 0 || (_refRoot$value4 = _refRoot$value4.style) === null || _refRoot$value4 === void 0 || _refRoot$value4.setProperty('--drag-offset-h-x', "".concat(dragOffsetX.value - 2, "px"));
|
20963
|
+
(_refRoot$value5 = refRoot.value) === null || _refRoot$value5 === void 0 || (_refRoot$value5 = _refRoot$value5.style) === null || _refRoot$value5 === void 0 || _refRoot$value5.setProperty('--translate-y', "".concat(translateY.value, "px"));
|
20964
|
+
(_refRoot$value6 = refRoot.value) === null || _refRoot$value6 === void 0 || (_refRoot$value6 = _refRoot$value6.style) === null || _refRoot$value6 === void 0 || _refRoot$value6.setProperty('--translate-x', "".concat(translateX.value, "px"));
|
20965
|
+
(_refRoot$value7 = refRoot.value) === null || _refRoot$value7 === void 0 || (_refRoot$value7 = _refRoot$value7.style) === null || _refRoot$value7 === void 0 || _refRoot$value7.setProperty('--translate-x-1', "-".concat(translateX.value, "px"));
|
20867
20966
|
setFixedColumnShawdow();
|
20868
20967
|
});
|
20869
20968
|
var setTranslateX = function setTranslateX(val) {
|
@@ -20875,11 +20974,12 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20875
20974
|
setRootStyleVars();
|
20876
20975
|
};
|
20877
20976
|
var initRootStyleVars = function initRootStyleVars() {
|
20878
|
-
|
20879
|
-
refRoot.value.style.setProperty('--drag-offset-
|
20880
|
-
refRoot.value.style.setProperty('--
|
20881
|
-
refRoot.value.style.setProperty('--translate-
|
20882
|
-
refRoot.value.style.setProperty('--translate-x
|
20977
|
+
var _refRoot$value8, _refRoot$value9, _refRoot$value10, _refRoot$value11, _refRoot$value12;
|
20978
|
+
(_refRoot$value8 = refRoot.value) === null || _refRoot$value8 === void 0 || (_refRoot$value8 = _refRoot$value8.style) === null || _refRoot$value8 === void 0 || _refRoot$value8.setProperty('--drag-offset-x', '-1000px');
|
20979
|
+
(_refRoot$value9 = refRoot.value) === null || _refRoot$value9 === void 0 || (_refRoot$value9 = _refRoot$value9.style) === null || _refRoot$value9 === void 0 || _refRoot$value9.setProperty('--drag-offset-h-x', '-1000px');
|
20980
|
+
(_refRoot$value10 = refRoot.value) === null || _refRoot$value10 === void 0 || (_refRoot$value10 = _refRoot$value10.style) === null || _refRoot$value10 === void 0 || _refRoot$value10.setProperty('--translate-y', '0px');
|
20981
|
+
(_refRoot$value11 = refRoot.value) === null || _refRoot$value11 === void 0 || (_refRoot$value11 = _refRoot$value11.style) === null || _refRoot$value11 === void 0 || _refRoot$value11.setProperty('--translate-x', '0px');
|
20982
|
+
(_refRoot$value12 = refRoot.value) === null || _refRoot$value12 === void 0 || (_refRoot$value12 = _refRoot$value12.style) === null || _refRoot$value12 === void 0 || _refRoot$value12.setProperty('--translate-x-1', '0px');
|
20883
20983
|
};
|
20884
20984
|
var setDragOffsetX = function setDragOffsetX(val) {
|
20885
20985
|
dragOffsetX.value = val;
|
@@ -20906,20 +21006,6 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20906
21006
|
height: 0,
|
20907
21007
|
display: 'none'
|
20908
21008
|
};
|
20909
|
-
var dragOffsetXStyle = {
|
20910
|
-
position: 'absolute',
|
20911
|
-
top: 0,
|
20912
|
-
bottom: 0,
|
20913
|
-
left: 0,
|
20914
|
-
width: '1px',
|
20915
|
-
backgroundColor: '#3785FF',
|
20916
|
-
transform: 'translateX(-50%)'
|
20917
|
-
};
|
20918
|
-
var resizeColumnStyle = (0,external_vue_namespaceObject.computed)(function () {
|
20919
|
-
return use_layout_objectSpread(use_layout_objectSpread({}, dragOffsetXStyle), {}, {
|
20920
|
-
transform: "translate3d(var(--drag-offset-x), var(--translate-y), 0)"
|
20921
|
-
});
|
20922
|
-
});
|
20923
21009
|
var renderContainer = function renderContainer(childrend) {
|
20924
21010
|
var _ctx$slots$default, _ctx$slots;
|
20925
21011
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
@@ -20961,12 +21047,13 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20961
21047
|
var bodyMaxHeight = (0,external_vue_namespaceObject.computed)(function () {
|
20962
21048
|
if (/^\d+\.?\d*(px|%)$/.test("".concat(tableStyle.value.maxHeight))) {
|
20963
21049
|
var headerHeight = props.showHead ? headHeight.value : 0;
|
20964
|
-
|
21050
|
+
var delHeight = footHeight.value + headerHeight + fixedBottomHeight.value;
|
21051
|
+
return "calc(".concat(tableStyle.value.maxHeight, " - ").concat(delHeight, "px)");
|
20965
21052
|
}
|
20966
21053
|
return null;
|
20967
21054
|
});
|
20968
21055
|
var setBodyHeight = function setBodyHeight(height) {
|
20969
|
-
bodyHeight.value = height;
|
21056
|
+
bodyHeight.value = height - fixedBottomHeight.value;
|
20970
21057
|
};
|
20971
21058
|
var footHeight = (0,external_vue_namespaceObject.ref)(0);
|
20972
21059
|
var footerStyle = (0,external_vue_namespaceObject.computed)(function () {
|
@@ -21018,20 +21105,34 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21018
21105
|
};
|
21019
21106
|
var resizeColumnClass = {
|
21020
21107
|
column_drag_line: true,
|
21021
|
-
'offset-x': true
|
21108
|
+
'offset-x': true,
|
21109
|
+
'resize-column': true
|
21022
21110
|
};
|
21023
21111
|
var fixedWrapperClass = resolveClassName('table-fixed');
|
21024
21112
|
var fixedBottomRow = resolveClassName('table-fixed-bottom');
|
21025
21113
|
var fixedBottomLoadingStyle = (0,external_vue_namespaceObject.computed)(function () {
|
21114
|
+
var _props$fixedBottom$po, _props$fixedBottom4, _props$fixedBottom$he3, _props$fixedBottom5;
|
21026
21115
|
return {
|
21027
|
-
minHeight: "".concat(lineHeight.value, "px")
|
21116
|
+
minHeight: "".concat(lineHeight.value, "px"),
|
21117
|
+
position: (_props$fixedBottom$po = (_props$fixedBottom4 = props.fixedBottom) === null || _props$fixedBottom4 === void 0 ? void 0 : _props$fixedBottom4.position) !== null && _props$fixedBottom$po !== void 0 ? _props$fixedBottom$po : 'absolute',
|
21118
|
+
height: (_props$fixedBottom$he3 = (_props$fixedBottom5 = props.fixedBottom) === null || _props$fixedBottom5 === void 0 ? void 0 : _props$fixedBottom5.height) !== null && _props$fixedBottom$he3 !== void 0 ? _props$fixedBottom$he3 : null
|
21028
21119
|
};
|
21029
21120
|
});
|
21030
21121
|
(0,external_vue_namespaceObject.onMounted)(function () {
|
21031
21122
|
setOffsetRight();
|
21032
21123
|
initRootStyleVars();
|
21033
21124
|
});
|
21034
|
-
var
|
21125
|
+
var getFixedBottomRender = function getFixedBottomRender() {
|
21126
|
+
var result = renderScrollLoading === null || renderScrollLoading === void 0 ? void 0 : renderScrollLoading();
|
21127
|
+
if (result) {
|
21128
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
21129
|
+
"style": fixedBottomLoadingStyle.value,
|
21130
|
+
"class": fixedBottomRow
|
21131
|
+
}, [result]);
|
21132
|
+
}
|
21133
|
+
return null;
|
21134
|
+
};
|
21135
|
+
var renderBody = function renderBody(list, childrend, fixedRows) {
|
21035
21136
|
return (0,external_vue_namespaceObject.createVNode)(virtual_render_namespaceObject["default"], {
|
21036
21137
|
"ref": refBody,
|
21037
21138
|
"height": bodyHeight.value,
|
@@ -21052,21 +21153,15 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21052
21153
|
return renderPrepend();
|
21053
21154
|
},
|
21054
21155
|
"default": function _default(scope) {
|
21055
|
-
|
21156
|
+
var _scope$data;
|
21157
|
+
return childrend === null || childrend === void 0 ? void 0 : childrend((_scope$data = scope === null || scope === void 0 ? void 0 : scope.data) !== null && _scope$data !== void 0 ? _scope$data : []);
|
21056
21158
|
},
|
21057
21159
|
afterSection: function afterSection() {
|
21058
|
-
var _ctx$slots$appendBott, _ctx$slots2;
|
21059
21160
|
return [(0,external_vue_namespaceObject.createVNode)("div", {
|
21060
|
-
"style": resizeColumnStyle.value,
|
21061
21161
|
"class": resizeColumnClass
|
21062
21162
|
}, null), (0,external_vue_namespaceObject.createVNode)("div", {
|
21063
21163
|
"class": fixedWrapperClass
|
21064
|
-
}, [fixedRows === null || fixedRows === void 0 ? void 0 : fixedRows()])
|
21065
|
-
"class": fixedBottomRow
|
21066
|
-
}, [(_ctx$slots$appendBott = (_ctx$slots2 = ctx.slots).appendBottom) === null || _ctx$slots$appendBott === void 0 ? void 0 : _ctx$slots$appendBott.call(_ctx$slots2)]), (0,external_vue_namespaceObject.createVNode)("div", {
|
21067
|
-
"style": fixedBottomLoadingStyle.value,
|
21068
|
-
"class": fixedBottomRow
|
21069
|
-
}, [loadingRow === null || loadingRow === void 0 ? void 0 : loadingRow()])];
|
21164
|
+
}, [fixedRows === null || fixedRows === void 0 ? void 0 : fixedRows()])];
|
21070
21165
|
}
|
21071
21166
|
});
|
21072
21167
|
};
|
@@ -21081,11 +21176,15 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21081
21176
|
fixedColumns.length = 0;
|
21082
21177
|
fixedColumns.push.apply(fixedColumns, _toConsumableArray(values));
|
21083
21178
|
};
|
21179
|
+
var renderFixedBottom = function renderFixedBottom() {
|
21180
|
+
return getFixedBottomRender();
|
21181
|
+
};
|
21084
21182
|
return {
|
21085
21183
|
renderContainer: renderContainer,
|
21086
21184
|
renderHeader: renderHeader,
|
21087
21185
|
renderBody: renderBody,
|
21088
21186
|
renderFooter: renderFooter,
|
21187
|
+
renderFixedBottom: renderFixedBottom,
|
21089
21188
|
setBodyHeight: setBodyHeight,
|
21090
21189
|
setFootHeight: setFootHeight,
|
21091
21190
|
setTranslateX: setTranslateX,
|
@@ -21201,6 +21300,9 @@ var usePagination = function usePagination(props) {
|
|
21201
21300
|
* 如果手动禁用分页,则禁用前端分页,否则启用前端分页
|
21202
21301
|
*/
|
21203
21302
|
var isEnabled = (0,external_vue_namespaceObject.ref)(true);
|
21303
|
+
var totalPage = (0,external_vue_namespaceObject.computed)(function () {
|
21304
|
+
return Math.ceil(pagination.count / pagination.limit);
|
21305
|
+
});
|
21204
21306
|
var setPagination = function setPagination(option) {
|
21205
21307
|
Object.assign(pagination, {
|
21206
21308
|
enabled: !!props.pagination
|
@@ -21208,7 +21310,7 @@ var usePagination = function usePagination(props) {
|
|
21208
21310
|
/**
|
21209
21311
|
* 如果分页组件启用了前端分页,则重置分页组件数据
|
21210
21312
|
*/
|
21211
|
-
if (pagination.current
|
21313
|
+
if (pagination.current > totalPage.value) {
|
21212
21314
|
pagination.current = 1;
|
21213
21315
|
}
|
21214
21316
|
};
|
@@ -21220,7 +21322,7 @@ var usePagination = function usePagination(props) {
|
|
21220
21322
|
return [props.pagination];
|
21221
21323
|
}, function () {
|
21222
21324
|
if (typeof_typeof(props.pagination) === 'object') {
|
21223
|
-
setPagination(props.pagination);
|
21325
|
+
setPagination((0,external_vue_namespaceObject.toRaw)(props.pagination));
|
21224
21326
|
}
|
21225
21327
|
/**
|
21226
21328
|
* 分页组件是否启用
|
@@ -21630,11 +21732,36 @@ const checkbox_namespaceObject = checkbox_x({ ["BkCheckboxGroup"]: () => __WEBPA
|
|
21630
21732
|
var checkbox_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21631
21733
|
var checkbox_less_y = x => () => x
|
21632
21734
|
const checkbox_less_namespaceObject = checkbox_less_x({ });
|
21735
|
+
;// CONCATENATED MODULE: external "../button"
|
21736
|
+
var button_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21737
|
+
var button_y = x => () => x
|
21738
|
+
const button_namespaceObject = button_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_button_a2ea7c9a__["default"] });
|
21739
|
+
;// CONCATENATED MODULE: external "../button/button.less"
|
21740
|
+
var button_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21741
|
+
var button_less_y = x => () => x
|
21742
|
+
const button_less_namespaceObject = button_less_x({ });
|
21633
21743
|
;// CONCATENATED MODULE: external "../icon"
|
21634
21744
|
var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21635
21745
|
var icon_y = x => () => x
|
21636
21746
|
const icon_namespaceObject = icon_x({ ["DownShape"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.DownShape, ["Funnel"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Funnel, ["GragFill"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.GragFill, ["RightShape"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.RightShape });
|
21637
|
-
;// CONCATENATED MODULE:
|
21747
|
+
;// CONCATENATED MODULE: external "../input"
|
21748
|
+
var input_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21749
|
+
var input_y = x => () => x
|
21750
|
+
const input_namespaceObject = input_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e__["default"] });
|
21751
|
+
;// CONCATENATED MODULE: external "../input/input.less"
|
21752
|
+
var input_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21753
|
+
var input_less_y = x => () => x
|
21754
|
+
const input_less_namespaceObject = input_less_x({ });
|
21755
|
+
;// CONCATENATED MODULE: external "../popover"
|
21756
|
+
var popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21757
|
+
var popover_y = x => () => x
|
21758
|
+
const popover_namespaceObject = popover_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__["default"] });
|
21759
|
+
;// CONCATENATED MODULE: external "../popover/popover.less"
|
21760
|
+
var popover_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21761
|
+
var popover_less_y = x => () => x
|
21762
|
+
const popover_less_namespaceObject = popover_less_x({ });
|
21763
|
+
;// CONCATENATED MODULE: ../../packages/table/src/plugins/head-filter.tsx
|
21764
|
+
|
21638
21765
|
|
21639
21766
|
|
21640
21767
|
/*
|
@@ -21669,334 +21796,65 @@ const icon_namespaceObject = icon_x({ ["DownShape"]: () => __WEBPACK_EXTERNAL_MO
|
|
21669
21796
|
|
21670
21797
|
|
21671
21798
|
|
21672
|
-
|
21673
|
-
|
21674
|
-
|
21675
|
-
|
21676
|
-
|
21677
|
-
|
21678
|
-
|
21679
|
-
|
21680
|
-
|
21681
|
-
|
21682
|
-
|
21683
|
-
|
21684
|
-
|
21685
|
-
|
21686
|
-
|
21687
|
-
|
21688
|
-
|
21689
|
-
|
21690
|
-
|
21691
|
-
|
21692
|
-
|
21693
|
-
|
21694
|
-
|
21695
|
-
|
21696
|
-
|
21697
|
-
|
21698
|
-
|
21699
|
-
|
21700
|
-
|
21701
|
-
|
21702
|
-
|
21703
|
-
|
21704
|
-
|
21705
|
-
|
21706
|
-
|
21707
|
-
|
21708
|
-
|
21709
|
-
|
21710
|
-
|
21711
|
-
|
21712
|
-
|
21713
|
-
|
21799
|
+
|
21800
|
+
|
21801
|
+
|
21802
|
+
|
21803
|
+
|
21804
|
+
|
21805
|
+
|
21806
|
+
|
21807
|
+
|
21808
|
+
function _isSlot(s) {
|
21809
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
|
21810
|
+
}
|
21811
|
+
var ROW_HEIGHT = 32;
|
21812
|
+
/* harmony default export */ const head_filter = ((0,external_vue_namespaceObject.defineComponent)({
|
21813
|
+
name: 'HeadFilter',
|
21814
|
+
props: {
|
21815
|
+
column: IColumnType,
|
21816
|
+
height: shared_namespaceObject.PropTypes.number.def(ROW_HEIGHT)
|
21817
|
+
},
|
21818
|
+
emits: ['change', 'filterSave', 'reset'],
|
21819
|
+
setup: function setup(props, _ref) {
|
21820
|
+
var emit = _ref.emit;
|
21821
|
+
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
21822
|
+
resolveClassName = _usePrefix.resolveClassName;
|
21823
|
+
var t = (0,config_provider_namespaceObject.useLocale)('table');
|
21824
|
+
var filter = (0,external_vue_namespaceObject.computed)(function () {
|
21825
|
+
var _props$column;
|
21826
|
+
return (_props$column = props.column) === null || _props$column === void 0 ? void 0 : _props$column.filter;
|
21827
|
+
});
|
21828
|
+
var checked = (0,external_vue_namespaceObject.computed)(function () {
|
21829
|
+
var _filter$value$checked, _filter$value;
|
21830
|
+
return (_filter$value$checked = (_filter$value = filter.value) === null || _filter$value === void 0 ? void 0 : _filter$value.checked) !== null && _filter$value$checked !== void 0 ? _filter$value$checked : [];
|
21831
|
+
});
|
21832
|
+
var searchValue = (0,external_vue_namespaceObject.ref)('');
|
21833
|
+
var state = (0,external_vue_namespaceObject.reactive)({
|
21834
|
+
isOpen: false,
|
21835
|
+
checked: checked.value
|
21836
|
+
});
|
21837
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
21838
|
+
return filter.value;
|
21839
|
+
}, function () {
|
21840
|
+
state.checked = checked.value;
|
21841
|
+
}, {
|
21842
|
+
immediate: true,
|
21843
|
+
deep: true
|
21844
|
+
});
|
21845
|
+
var headClass = (0,external_vue_namespaceObject.computed)(function () {
|
21846
|
+
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-head-action'), true), 'column-filter', true), '--row-height', "".concat(props.height, "px")), "active", state.checked.length), "opened", state.isOpen));
|
21847
|
+
});
|
21848
|
+
var headFilterContentClass = (0,shared_namespaceObject.classes)(defineProperty_defineProperty({}, resolveClassName('table-head-filter'), true));
|
21849
|
+
var refVirtualRender = (0,external_vue_namespaceObject.ref)(null);
|
21850
|
+
var handlePopShow = function handlePopShow(isOpen) {
|
21851
|
+
state.isOpen = isOpen;
|
21852
|
+
isOpen && setTimeout(function () {
|
21853
|
+
refVirtualRender.value.reset();
|
21714
21854
|
});
|
21715
|
-
|
21716
|
-
|
21717
|
-
|
21718
|
-
var result = setStore(row, index);
|
21719
|
-
if (result) {
|
21720
|
-
var _rows$pageRowList$sli;
|
21721
|
-
var _getStore = getStore(),
|
21722
|
-
start = _getStore.start,
|
21723
|
-
end = _getStore.end;
|
21724
|
-
var startIndex = start.index < end.index ? start.index : end.index;
|
21725
|
-
var endIndex = start.index < end.index ? end.index : start.index;
|
21726
|
-
((_rows$pageRowList$sli = rows.pageRowList.slice(startIndex, endIndex + 1)) !== null && _rows$pageRowList$sli !== void 0 ? _rows$pageRowList$sli : []).forEach(function (item) {
|
21727
|
-
var isRowEnabled = isRowSelectEnable(props, {
|
21728
|
-
row: row,
|
21729
|
-
index: index,
|
21730
|
-
isCheckAll: false
|
21731
|
-
});
|
21732
|
-
isRowEnabled && rows.setRowSelection(item, true);
|
21733
|
-
});
|
21734
|
-
}
|
21735
|
-
ctx.emit(EMIT_EVENTS.ROW_SELECT, {
|
21736
|
-
row: row,
|
21737
|
-
index: index,
|
21738
|
-
checked: true,
|
21739
|
-
data: props.data,
|
21740
|
-
isShiftKeyDown: true
|
21741
|
-
});
|
21742
|
-
ctx.emit(EMIT_EVENTS.ROW_SELECT_CHANGE, {
|
21743
|
-
row: row,
|
21744
|
-
index: index,
|
21745
|
-
checked: true,
|
21746
|
-
data: props.data,
|
21747
|
-
isShiftKeyDown: true
|
21748
|
-
});
|
21749
|
-
return Promise.resolve(!result);
|
21750
|
-
}
|
21751
|
-
return Promise.resolve(true);
|
21752
|
-
};
|
21753
|
-
var indeterminate = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION_INDETERMINATE);
|
21754
|
-
var isChecked = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION);
|
21755
|
-
var isEnable = isRowSelectEnable(props, {
|
21756
|
-
row: row,
|
21757
|
-
index: index,
|
21758
|
-
isCheckAll: false
|
21759
|
-
});
|
21760
|
-
return (0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject["default"], {
|
21761
|
-
"beforeChange": beforeRowChange,
|
21762
|
-
"disabled": !isEnable,
|
21763
|
-
"indeterminate": indeterminate,
|
21764
|
-
"modelValue": isChecked,
|
21765
|
-
"onChange": handleChecked
|
21766
|
-
}, null);
|
21767
|
-
};
|
21768
|
-
/**
|
21769
|
-
* 渲染表格Cell内容
|
21770
|
-
* @param row 当前行
|
21771
|
-
* @param column 当前列
|
21772
|
-
* @param index 当前列
|
21773
|
-
* @param rows 当前列
|
21774
|
-
* @returns
|
21775
|
-
*/
|
21776
|
-
var renderCell = function renderCell() {
|
21777
|
-
var _renderFn$column$type, _renderFn$column$type2;
|
21778
|
-
var defaultFn = function defaultFn() {
|
21779
|
-
var type = resolvePropVal(column, 'type', [column, row]);
|
21780
|
-
if (type === 'index') {
|
21781
|
-
return rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_INDEX);
|
21782
|
-
}
|
21783
|
-
var key = resolvePropVal(column, 'field', [column, row]);
|
21784
|
-
var cell = getRowText(row, key);
|
21785
|
-
if (typeof column.render === 'function') {
|
21786
|
-
return renderCellCallbackFn();
|
21787
|
-
}
|
21788
|
-
if (typeof cell === 'boolean') {
|
21789
|
-
return String(cell);
|
21790
|
-
}
|
21791
|
-
if (!cell && typeof cell !== 'number') {
|
21792
|
-
var emptyCellText = props.emptyCellText;
|
21793
|
-
if (emptyCellText) {
|
21794
|
-
if (typeof emptyCellText === 'function') {
|
21795
|
-
return emptyCellText(row, column, index, rows.tableRowList.value);
|
21796
|
-
}
|
21797
|
-
return emptyCellText;
|
21798
|
-
}
|
21799
|
-
}
|
21800
|
-
if (typeof_typeof(cell) === 'object') {
|
21801
|
-
return JSON.stringify((0,external_vue_namespaceObject.unref)(cell));
|
21802
|
-
}
|
21803
|
-
return cell;
|
21804
|
-
};
|
21805
|
-
var renderFn = {
|
21806
|
-
expand: function expand() {
|
21807
|
-
return isChild ? '' : renderExpandColumn();
|
21808
|
-
},
|
21809
|
-
selection: function selection() {
|
21810
|
-
return renderCheckboxColumn();
|
21811
|
-
},
|
21812
|
-
drag: renderDraggableCell
|
21813
|
-
};
|
21814
|
-
return (_renderFn$column$type = (_renderFn$column$type2 = renderFn[column.type]) === null || _renderFn$column$type2 === void 0 ? void 0 : _renderFn$column$type2.call(renderFn, row, column, index, rows)) !== null && _renderFn$column$type !== void 0 ? _renderFn$column$type : defaultFn();
|
21815
|
-
};
|
21816
|
-
var renderCellCallbackFn = function renderCellCallbackFn() {
|
21817
|
-
var cell = getRowText(row, resolvePropVal(column, 'field', [column, row]));
|
21818
|
-
var data = row;
|
21819
|
-
return column.render({
|
21820
|
-
cell: cell,
|
21821
|
-
data: data,
|
21822
|
-
row: row,
|
21823
|
-
column: column,
|
21824
|
-
index: index,
|
21825
|
-
rows: rows.tableRowList.value
|
21826
|
-
});
|
21827
|
-
};
|
21828
|
-
var getExpandCell = function getExpandCell() {
|
21829
|
-
var _ctx$slots$expandCont, _ctx$slots$expandCont2, _ctx$slots;
|
21830
|
-
var isExpand = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND);
|
21831
|
-
var icon = isExpand ? (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.DownShape, null, null) : (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.RightShape, null, null);
|
21832
|
-
return (0,external_vue_namespaceObject.createVNode)("span", null, [[icon, (_ctx$slots$expandCont = (_ctx$slots$expandCont2 = (_ctx$slots = ctx.slots).expandContent) === null || _ctx$slots$expandCont2 === void 0 ? void 0 : _ctx$slots$expandCont2.call(_ctx$slots, row)) !== null && _ctx$slots$expandCont !== void 0 ? _ctx$slots$expandCont : '']]);
|
21833
|
-
};
|
21834
|
-
var handleRowExpandClick = function handleRowExpandClick(e) {
|
21835
|
-
rows.setRowExpand(row, !rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND));
|
21836
|
-
ctx.emit(EMIT_EVENTS.ROW_EXPAND_CLICK, {
|
21837
|
-
row: row,
|
21838
|
-
column: column,
|
21839
|
-
index: index,
|
21840
|
-
rows: rows.tableRowList.value,
|
21841
|
-
e: e
|
21842
|
-
});
|
21843
|
-
};
|
21844
|
-
var renderExpandColumn = function renderExpandColumn() {
|
21845
|
-
var renderExpandSlot = function renderExpandSlot() {
|
21846
|
-
var _ctx$slots$expandCell, _ctx$slots$expandCell2, _ctx$slots2;
|
21847
|
-
if (typeof column.render === 'function') {
|
21848
|
-
return renderCellCallbackFn();
|
21849
|
-
}
|
21850
|
-
return (_ctx$slots$expandCell = (_ctx$slots$expandCell2 = (_ctx$slots2 = ctx.slots).expandCell) === null || _ctx$slots$expandCell2 === void 0 ? void 0 : _ctx$slots$expandCell2.call(_ctx$slots2, {
|
21851
|
-
row: row,
|
21852
|
-
column: column,
|
21853
|
-
index: index,
|
21854
|
-
rows: rows
|
21855
|
-
})) !== null && _ctx$slots$expandCell !== void 0 ? _ctx$slots$expandCell : getExpandCell();
|
21856
|
-
};
|
21857
|
-
return (0,external_vue_namespaceObject.createVNode)("span", {
|
21858
|
-
"class": "expand-btn-action",
|
21859
|
-
"onClick": function onClick(e) {
|
21860
|
-
return handleRowExpandClick(e);
|
21861
|
-
}
|
21862
|
-
}, [renderExpandSlot()]);
|
21863
|
-
};
|
21864
|
-
var renderDraggableCell = function renderDraggableCell() {
|
21865
|
-
var _props$rowDraggable$r, _props$rowDraggable, _props$rowDraggable$f, _props$rowDraggable2, _props$rowDraggable$i, _props$rowDraggable3;
|
21866
|
-
var renderFn = (_props$rowDraggable$r = (_props$rowDraggable = props.rowDraggable) === null || _props$rowDraggable === void 0 ? void 0 : _props$rowDraggable.render) !== null && _props$rowDraggable$r !== void 0 ? _props$rowDraggable$r : props.rowDraggable;
|
21867
|
-
if (typeof renderFn === 'function') {
|
21868
|
-
return renderFn(row, column, index, rows.tableRowList.value);
|
21869
|
-
}
|
21870
|
-
var fontSize = (_props$rowDraggable$f = (_props$rowDraggable2 = props.rowDraggable) === null || _props$rowDraggable2 === void 0 ? void 0 : _props$rowDraggable2.fontSize) !== null && _props$rowDraggable$f !== void 0 ? _props$rowDraggable$f : '14px';
|
21871
|
-
var fontIcon = (_props$rowDraggable$i = (_props$rowDraggable3 = props.rowDraggable) === null || _props$rowDraggable3 === void 0 ? void 0 : _props$rowDraggable3.icon) !== null && _props$rowDraggable$i !== void 0 ? _props$rowDraggable$i : (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.GragFill, {
|
21872
|
-
"style": "'--font-size: ".concat(fontSize, ";'"),
|
21873
|
-
"class": "drag-cell"
|
21874
|
-
}, null);
|
21875
|
-
return fontIcon;
|
21876
|
-
};
|
21877
|
-
return {
|
21878
|
-
renderCell: renderCell
|
21879
|
-
};
|
21880
|
-
});
|
21881
|
-
;// CONCATENATED MODULE: external "../button"
|
21882
|
-
var button_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21883
|
-
var button_y = x => () => x
|
21884
|
-
const button_namespaceObject = button_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_button_a2ea7c9a__["default"] });
|
21885
|
-
;// CONCATENATED MODULE: external "../button/button.less"
|
21886
|
-
var button_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21887
|
-
var button_less_y = x => () => x
|
21888
|
-
const button_less_namespaceObject = button_less_x({ });
|
21889
|
-
;// CONCATENATED MODULE: external "../input"
|
21890
|
-
var input_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21891
|
-
var input_y = x => () => x
|
21892
|
-
const input_namespaceObject = input_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e__["default"] });
|
21893
|
-
;// CONCATENATED MODULE: external "../input/input.less"
|
21894
|
-
var input_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21895
|
-
var input_less_y = x => () => x
|
21896
|
-
const input_less_namespaceObject = input_less_x({ });
|
21897
|
-
;// CONCATENATED MODULE: external "../popover"
|
21898
|
-
var popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21899
|
-
var popover_y = x => () => x
|
21900
|
-
const popover_namespaceObject = popover_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__["default"] });
|
21901
|
-
;// CONCATENATED MODULE: external "../popover/popover.less"
|
21902
|
-
var popover_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21903
|
-
var popover_less_y = x => () => x
|
21904
|
-
const popover_less_namespaceObject = popover_less_x({ });
|
21905
|
-
;// CONCATENATED MODULE: ../../packages/table/src/plugins/head-filter.tsx
|
21906
|
-
|
21907
|
-
|
21908
|
-
|
21909
|
-
/*
|
21910
|
-
* Tencent is pleased to support the open source community by making
|
21911
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
21912
|
-
*
|
21913
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
21914
|
-
*
|
21915
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
21916
|
-
*
|
21917
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
21918
|
-
*
|
21919
|
-
* ---------------------------------------------------
|
21920
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
21921
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
21922
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
21923
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
21924
|
-
*
|
21925
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
21926
|
-
* the Software.
|
21927
|
-
*
|
21928
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
21929
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21930
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
21931
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
21932
|
-
* IN THE SOFTWARE.
|
21933
|
-
*/
|
21934
|
-
|
21935
|
-
|
21936
|
-
|
21937
|
-
|
21938
|
-
|
21939
|
-
|
21940
|
-
|
21941
|
-
|
21942
|
-
|
21943
|
-
|
21944
|
-
|
21945
|
-
|
21946
|
-
|
21947
|
-
|
21948
|
-
|
21949
|
-
|
21950
|
-
function _isSlot(s) {
|
21951
|
-
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
|
21952
|
-
}
|
21953
|
-
var ROW_HEIGHT = 32;
|
21954
|
-
/* harmony default export */ const head_filter = ((0,external_vue_namespaceObject.defineComponent)({
|
21955
|
-
name: 'HeadFilter',
|
21956
|
-
props: {
|
21957
|
-
column: IColumnType,
|
21958
|
-
height: shared_namespaceObject.PropTypes.number.def(ROW_HEIGHT)
|
21959
|
-
},
|
21960
|
-
emits: ['change', 'filterSave', 'reset'],
|
21961
|
-
setup: function setup(props, _ref) {
|
21962
|
-
var emit = _ref.emit;
|
21963
|
-
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
21964
|
-
resolveClassName = _usePrefix.resolveClassName;
|
21965
|
-
var t = (0,config_provider_namespaceObject.useLocale)('table');
|
21966
|
-
var filter = (0,external_vue_namespaceObject.computed)(function () {
|
21967
|
-
var _props$column;
|
21968
|
-
return (_props$column = props.column) === null || _props$column === void 0 ? void 0 : _props$column.filter;
|
21969
|
-
});
|
21970
|
-
var checked = (0,external_vue_namespaceObject.computed)(function () {
|
21971
|
-
var _filter$value$checked, _filter$value;
|
21972
|
-
return (_filter$value$checked = (_filter$value = filter.value) === null || _filter$value === void 0 ? void 0 : _filter$value.checked) !== null && _filter$value$checked !== void 0 ? _filter$value$checked : [];
|
21973
|
-
});
|
21974
|
-
var searchValue = (0,external_vue_namespaceObject.ref)('');
|
21975
|
-
var state = (0,external_vue_namespaceObject.reactive)({
|
21976
|
-
isOpen: false,
|
21977
|
-
checked: checked.value
|
21978
|
-
});
|
21979
|
-
(0,external_vue_namespaceObject.watch)(function () {
|
21980
|
-
return filter.value;
|
21981
|
-
}, function () {
|
21982
|
-
state.checked = checked.value;
|
21983
|
-
}, {
|
21984
|
-
immediate: true,
|
21985
|
-
deep: true
|
21986
|
-
});
|
21987
|
-
var headClass = (0,external_vue_namespaceObject.computed)(function () {
|
21988
|
-
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-head-action'), true), 'column-filter', true), '--row-height', "".concat(props.height, "px")), "active", state.checked.length), "opened", state.isOpen));
|
21989
|
-
});
|
21990
|
-
var headFilterContentClass = (0,shared_namespaceObject.classes)(defineProperty_defineProperty({}, resolveClassName('table-head-filter'), true));
|
21991
|
-
var refVirtualRender = (0,external_vue_namespaceObject.ref)(null);
|
21992
|
-
var handlePopShow = function handlePopShow(isOpen) {
|
21993
|
-
state.isOpen = isOpen;
|
21994
|
-
isOpen && setTimeout(function () {
|
21995
|
-
refVirtualRender.value.reset();
|
21996
|
-
});
|
21997
|
-
if (!isOpen) {
|
21998
|
-
searchValue.value = '';
|
21999
|
-
}
|
21855
|
+
if (!isOpen) {
|
21856
|
+
searchValue.value = '';
|
21857
|
+
}
|
22000
21858
|
};
|
22001
21859
|
var theme = "light ".concat(resolveClassName('table-head-filter'));
|
22002
21860
|
var localData = (0,external_vue_namespaceObject.computed)(function () {
|
@@ -22515,77 +22373,321 @@ function use_head_isSlot(s) {
|
|
22515
22373
|
var isChecked = columns.getColumnAttribute(column, COLUMN_ATTRIBUTE.SELECTION_VAL);
|
22516
22374
|
var indeterminate = columns.getColumnAttribute(column, COLUMN_ATTRIBUTE.SELECTION_INDETERMINATE);
|
22517
22375
|
return (0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject["default"], {
|
22518
|
-
"disabled": isDisabled,
|
22376
|
+
"disabled": isDisabled,
|
22377
|
+
"indeterminate": indeterminate,
|
22378
|
+
"modelValue": isChecked,
|
22379
|
+
"onChange": handleChecked
|
22380
|
+
}, null);
|
22381
|
+
};
|
22382
|
+
/**
|
22383
|
+
* table head cell render
|
22384
|
+
* @param column
|
22385
|
+
* @param index
|
22386
|
+
* @returns
|
22387
|
+
*/
|
22388
|
+
var renderHeadCell = function renderHeadCell() {
|
22389
|
+
if (column.type === 'selection') {
|
22390
|
+
return [renderHeadCheckboxColumn()];
|
22391
|
+
}
|
22392
|
+
var _getHeadCellRender = getHeadCellRender(),
|
22393
|
+
headClass = _getHeadCellRender.headClass,
|
22394
|
+
showTitle = _getHeadCellRender.showTitle,
|
22395
|
+
cells = _getHeadCellRender.cells;
|
22396
|
+
return (0,external_vue_namespaceObject.createVNode)(table_cell, {
|
22397
|
+
"class": headClass,
|
22398
|
+
"column": column,
|
22399
|
+
"headExplain": resolvePropVal(column.explain, 'head', [column]),
|
22400
|
+
"isHead": true,
|
22401
|
+
"observerResize": props.observerResize,
|
22402
|
+
"parentSetting": props.showOverflowTooltip,
|
22403
|
+
"resizerWay": props.resizerWay,
|
22404
|
+
"title": showTitle
|
22405
|
+
}, use_head_isSlot(cells) ? cells : {
|
22406
|
+
"default": function _default() {
|
22407
|
+
return [cells];
|
22408
|
+
}
|
22409
|
+
});
|
22410
|
+
};
|
22411
|
+
/**
|
22412
|
+
* 点击选中一列事件
|
22413
|
+
* @param index 当前选中列Index
|
22414
|
+
* @param column 当前选中列
|
22415
|
+
*/
|
22416
|
+
var handleColumnHeadClick = function handleColumnHeadClick() {
|
22417
|
+
if (columns.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_IS_DRAG)) {
|
22418
|
+
return;
|
22419
|
+
}
|
22420
|
+
if (column.sort && !column.filter) {
|
22421
|
+
var nextType = getNextSortType(columns.getColumnRefAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_TYPE));
|
22422
|
+
var args = {
|
22423
|
+
isCancel: false,
|
22424
|
+
type: nextType
|
22425
|
+
};
|
22426
|
+
handleSortClick(args);
|
22427
|
+
}
|
22428
|
+
};
|
22429
|
+
var headStyle = Object.assign(columns.getFixedStlye(column), {
|
22430
|
+
'--background-color': DEF_COLOR[(_props$thead$color = (_props$thead = props.thead) === null || _props$thead === void 0 ? void 0 : _props$thead.color) !== null && _props$thead$color !== void 0 ? _props$thead$color : IHeadColor.DEF1]
|
22431
|
+
});
|
22432
|
+
var classList = [columns.getHeadColumnClass(column, index), columns.getColumnCustomClass(column), column.align || props.headerAlign || props.align];
|
22433
|
+
var getTH = function getTH() {
|
22434
|
+
return (0,external_vue_namespaceObject.createVNode)("th", (0,external_vue_namespaceObject.mergeProps)({
|
22435
|
+
"style": headStyle,
|
22436
|
+
"class": classList,
|
22437
|
+
"colspan": 1,
|
22438
|
+
"data-id": columns.getColumnId(column),
|
22439
|
+
"rowspan": 1,
|
22440
|
+
"onClick": function onClick() {
|
22441
|
+
return handleColumnHeadClick();
|
22442
|
+
}
|
22443
|
+
}, columns.resolveEventListener(column)), [renderHeadCell()]);
|
22444
|
+
};
|
22445
|
+
return {
|
22446
|
+
getTH: getTH
|
22447
|
+
};
|
22448
|
+
});
|
22449
|
+
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-cell.tsx
|
22450
|
+
|
22451
|
+
|
22452
|
+
/*
|
22453
|
+
* Tencent is pleased to support the open source community by making
|
22454
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
22455
|
+
*
|
22456
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
22457
|
+
*
|
22458
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
22459
|
+
*
|
22460
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
22461
|
+
*
|
22462
|
+
* ---------------------------------------------------
|
22463
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
22464
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
22465
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
22466
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
22467
|
+
*
|
22468
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
22469
|
+
* the Software.
|
22470
|
+
*
|
22471
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
22472
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22473
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
22474
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
22475
|
+
* IN THE SOFTWARE.
|
22476
|
+
*/
|
22477
|
+
|
22478
|
+
|
22479
|
+
|
22480
|
+
|
22481
|
+
|
22482
|
+
|
22483
|
+
|
22484
|
+
/* harmony default export */ const use_cell = (function (_ref) {
|
22485
|
+
var props = _ref.props,
|
22486
|
+
rows = _ref.rows,
|
22487
|
+
ctx = _ref.ctx,
|
22488
|
+
columns = _ref.columns,
|
22489
|
+
row = _ref.row,
|
22490
|
+
index = _ref.index,
|
22491
|
+
column = _ref.column,
|
22492
|
+
_ref$isChild = _ref.isChild,
|
22493
|
+
isChild = _ref$isChild === void 0 ? false : _ref$isChild,
|
22494
|
+
multiShiftKey = _ref.multiShiftKey;
|
22495
|
+
var isShiftKeyDown = multiShiftKey.isShiftKeyDown,
|
22496
|
+
getStore = multiShiftKey.getStore,
|
22497
|
+
setStore = multiShiftKey.setStore,
|
22498
|
+
setStoreStart = multiShiftKey.setStoreStart,
|
22499
|
+
clearStoreStart = multiShiftKey.clearStoreStart;
|
22500
|
+
var renderCheckboxColumn = function renderCheckboxColumn() {
|
22501
|
+
var handleChecked = function handleChecked(value, event) {
|
22502
|
+
event.stopImmediatePropagation();
|
22503
|
+
event.preventDefault();
|
22504
|
+
event.stopPropagation();
|
22505
|
+
if (!isShiftKeyDown.value) {
|
22506
|
+
if (value) {
|
22507
|
+
setStoreStart(row, index);
|
22508
|
+
} else {
|
22509
|
+
clearStoreStart();
|
22510
|
+
}
|
22511
|
+
}
|
22512
|
+
rows.setRowSelection(row, value);
|
22513
|
+
columns.setColumnAttribute(column, COLUMN_ATTRIBUTE.SELECTION_INDETERMINATE, rows.getRowIndeterminate());
|
22514
|
+
columns.setColumnAttribute(column, COLUMN_ATTRIBUTE.SELECTION_VAL, rows.getRowCheckedAllValue());
|
22515
|
+
ctx.emit(EMIT_EVENTS.ROW_SELECT, {
|
22516
|
+
row: row,
|
22517
|
+
index: index,
|
22518
|
+
checked: value,
|
22519
|
+
data: props.data
|
22520
|
+
});
|
22521
|
+
ctx.emit(EMIT_EVENTS.ROW_SELECT_CHANGE, {
|
22522
|
+
row: row,
|
22523
|
+
index: index,
|
22524
|
+
checked: value,
|
22525
|
+
data: props.data
|
22526
|
+
});
|
22527
|
+
};
|
22528
|
+
var beforeRowChange = function beforeRowChange() {
|
22529
|
+
if (isShiftKeyDown.value) {
|
22530
|
+
var result = setStore(row, index);
|
22531
|
+
if (result) {
|
22532
|
+
var _rows$pageRowList$sli;
|
22533
|
+
var _getStore = getStore(),
|
22534
|
+
start = _getStore.start,
|
22535
|
+
end = _getStore.end;
|
22536
|
+
var startIndex = start.index < end.index ? start.index : end.index;
|
22537
|
+
var endIndex = start.index < end.index ? end.index : start.index;
|
22538
|
+
((_rows$pageRowList$sli = rows.pageRowList.slice(startIndex, endIndex + 1)) !== null && _rows$pageRowList$sli !== void 0 ? _rows$pageRowList$sli : []).forEach(function (item) {
|
22539
|
+
var isRowEnabled = isRowSelectEnable(props, {
|
22540
|
+
row: row,
|
22541
|
+
index: index,
|
22542
|
+
isCheckAll: false
|
22543
|
+
});
|
22544
|
+
isRowEnabled && rows.setRowSelection(item, true);
|
22545
|
+
});
|
22546
|
+
}
|
22547
|
+
ctx.emit(EMIT_EVENTS.ROW_SELECT, {
|
22548
|
+
row: row,
|
22549
|
+
index: index,
|
22550
|
+
checked: true,
|
22551
|
+
data: props.data,
|
22552
|
+
isShiftKeyDown: true
|
22553
|
+
});
|
22554
|
+
ctx.emit(EMIT_EVENTS.ROW_SELECT_CHANGE, {
|
22555
|
+
row: row,
|
22556
|
+
index: index,
|
22557
|
+
checked: true,
|
22558
|
+
data: props.data,
|
22559
|
+
isShiftKeyDown: true
|
22560
|
+
});
|
22561
|
+
return Promise.resolve(!result);
|
22562
|
+
}
|
22563
|
+
return Promise.resolve(true);
|
22564
|
+
};
|
22565
|
+
var indeterminate = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION_INDETERMINATE);
|
22566
|
+
var isChecked = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION);
|
22567
|
+
var isEnable = isRowSelectEnable(props, {
|
22568
|
+
row: row,
|
22569
|
+
index: index,
|
22570
|
+
isCheckAll: false
|
22571
|
+
});
|
22572
|
+
return (0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject["default"], {
|
22573
|
+
"beforeChange": beforeRowChange,
|
22574
|
+
"disabled": !isEnable,
|
22519
22575
|
"indeterminate": indeterminate,
|
22520
22576
|
"modelValue": isChecked,
|
22521
22577
|
"onChange": handleChecked
|
22522
22578
|
}, null);
|
22523
22579
|
};
|
22524
22580
|
/**
|
22525
|
-
*
|
22526
|
-
* @param
|
22527
|
-
* @param
|
22581
|
+
* 渲染表格Cell内容
|
22582
|
+
* @param row 当前行
|
22583
|
+
* @param column 当前列
|
22584
|
+
* @param index 当前列
|
22585
|
+
* @param rows 当前列
|
22528
22586
|
* @returns
|
22529
22587
|
*/
|
22530
|
-
var
|
22531
|
-
|
22532
|
-
|
22533
|
-
|
22534
|
-
|
22535
|
-
|
22536
|
-
|
22537
|
-
|
22538
|
-
|
22539
|
-
|
22540
|
-
|
22541
|
-
|
22542
|
-
|
22543
|
-
|
22544
|
-
|
22545
|
-
|
22546
|
-
|
22547
|
-
|
22548
|
-
|
22549
|
-
|
22588
|
+
var renderCell = function renderCell() {
|
22589
|
+
var _renderFn$column$type, _renderFn$column$type2;
|
22590
|
+
var defaultFn = function defaultFn() {
|
22591
|
+
var type = resolvePropVal(column, 'type', [column, row]);
|
22592
|
+
if (type === 'index') {
|
22593
|
+
return rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_INDEX);
|
22594
|
+
}
|
22595
|
+
var key = resolvePropVal(column, 'field', [column, row]);
|
22596
|
+
var cell = getRowText(row, key);
|
22597
|
+
if (typeof column.render === 'function') {
|
22598
|
+
return renderCellCallbackFn();
|
22599
|
+
}
|
22600
|
+
if (typeof cell === 'boolean') {
|
22601
|
+
return String(cell);
|
22602
|
+
}
|
22603
|
+
if (!cell && typeof cell !== 'number') {
|
22604
|
+
var emptyCellText = props.emptyCellText;
|
22605
|
+
if (emptyCellText) {
|
22606
|
+
if (typeof emptyCellText === 'function') {
|
22607
|
+
return emptyCellText(row, column, index, rows.tableRowList.value);
|
22608
|
+
}
|
22609
|
+
return emptyCellText;
|
22610
|
+
}
|
22611
|
+
}
|
22612
|
+
if (typeof_typeof(cell) === 'object') {
|
22613
|
+
return JSON.stringify((0,external_vue_namespaceObject.unref)(cell));
|
22550
22614
|
}
|
22615
|
+
return cell;
|
22616
|
+
};
|
22617
|
+
var renderFn = {
|
22618
|
+
expand: function expand() {
|
22619
|
+
return isChild ? '' : renderExpandColumn();
|
22620
|
+
},
|
22621
|
+
selection: function selection() {
|
22622
|
+
return renderCheckboxColumn();
|
22623
|
+
},
|
22624
|
+
drag: renderDraggableCell
|
22625
|
+
};
|
22626
|
+
return (_renderFn$column$type = (_renderFn$column$type2 = renderFn[column.type]) === null || _renderFn$column$type2 === void 0 ? void 0 : _renderFn$column$type2.call(renderFn, row, column, index, rows)) !== null && _renderFn$column$type !== void 0 ? _renderFn$column$type : defaultFn();
|
22627
|
+
};
|
22628
|
+
var renderCellCallbackFn = function renderCellCallbackFn() {
|
22629
|
+
var cell = getRowText(row, resolvePropVal(column, 'field', [column, row]));
|
22630
|
+
var data = row;
|
22631
|
+
return column.render({
|
22632
|
+
cell: cell,
|
22633
|
+
data: data,
|
22634
|
+
row: row,
|
22635
|
+
column: column,
|
22636
|
+
index: index,
|
22637
|
+
rows: rows.tableRowList.value
|
22551
22638
|
});
|
22552
22639
|
};
|
22553
|
-
|
22554
|
-
|
22555
|
-
|
22556
|
-
|
22557
|
-
|
22558
|
-
var handleColumnHeadClick = function handleColumnHeadClick() {
|
22559
|
-
if (columns.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_IS_DRAG)) {
|
22560
|
-
return;
|
22561
|
-
}
|
22562
|
-
if (column.sort && !column.filter) {
|
22563
|
-
var nextType = getNextSortType(columns.getColumnRefAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_TYPE));
|
22564
|
-
var args = {
|
22565
|
-
isCancel: false,
|
22566
|
-
type: nextType
|
22567
|
-
};
|
22568
|
-
handleSortClick(args);
|
22569
|
-
}
|
22640
|
+
var getExpandCell = function getExpandCell() {
|
22641
|
+
var _ctx$slots$expandCont, _ctx$slots$expandCont2, _ctx$slots;
|
22642
|
+
var isExpand = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND);
|
22643
|
+
var icon = isExpand ? (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.DownShape, null, null) : (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.RightShape, null, null);
|
22644
|
+
return (0,external_vue_namespaceObject.createVNode)("span", null, [[icon, (_ctx$slots$expandCont = (_ctx$slots$expandCont2 = (_ctx$slots = ctx.slots).expandContent) === null || _ctx$slots$expandCont2 === void 0 ? void 0 : _ctx$slots$expandCont2.call(_ctx$slots, row)) !== null && _ctx$slots$expandCont !== void 0 ? _ctx$slots$expandCont : '']]);
|
22570
22645
|
};
|
22571
|
-
var
|
22572
|
-
|
22573
|
-
|
22574
|
-
|
22575
|
-
|
22576
|
-
|
22577
|
-
|
22578
|
-
|
22579
|
-
|
22580
|
-
|
22581
|
-
|
22582
|
-
|
22583
|
-
|
22646
|
+
var handleRowExpandClick = function handleRowExpandClick(e) {
|
22647
|
+
rows.setRowExpand(row, !rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND));
|
22648
|
+
ctx.emit(EMIT_EVENTS.ROW_EXPAND_CLICK, {
|
22649
|
+
row: row,
|
22650
|
+
column: column,
|
22651
|
+
index: index,
|
22652
|
+
rows: rows.tableRowList.value,
|
22653
|
+
e: e
|
22654
|
+
});
|
22655
|
+
};
|
22656
|
+
var renderExpandColumn = function renderExpandColumn() {
|
22657
|
+
var renderExpandSlot = function renderExpandSlot() {
|
22658
|
+
var _ctx$slots$expandCell, _ctx$slots$expandCell2, _ctx$slots2;
|
22659
|
+
if (typeof column.render === 'function') {
|
22660
|
+
return renderCellCallbackFn();
|
22584
22661
|
}
|
22585
|
-
|
22662
|
+
return (_ctx$slots$expandCell = (_ctx$slots$expandCell2 = (_ctx$slots2 = ctx.slots).expandCell) === null || _ctx$slots$expandCell2 === void 0 ? void 0 : _ctx$slots$expandCell2.call(_ctx$slots2, {
|
22663
|
+
row: row,
|
22664
|
+
column: column,
|
22665
|
+
index: index,
|
22666
|
+
rows: rows
|
22667
|
+
})) !== null && _ctx$slots$expandCell !== void 0 ? _ctx$slots$expandCell : getExpandCell();
|
22668
|
+
};
|
22669
|
+
return (0,external_vue_namespaceObject.createVNode)("span", {
|
22670
|
+
"class": "expand-btn-action",
|
22671
|
+
"onClick": function onClick(e) {
|
22672
|
+
return handleRowExpandClick(e);
|
22673
|
+
}
|
22674
|
+
}, [renderExpandSlot()]);
|
22675
|
+
};
|
22676
|
+
var renderDraggableCell = function renderDraggableCell() {
|
22677
|
+
var _props$rowDraggable$r, _props$rowDraggable, _props$rowDraggable$f, _props$rowDraggable2, _props$rowDraggable$i, _props$rowDraggable3;
|
22678
|
+
var renderFn = (_props$rowDraggable$r = (_props$rowDraggable = props.rowDraggable) === null || _props$rowDraggable === void 0 ? void 0 : _props$rowDraggable.render) !== null && _props$rowDraggable$r !== void 0 ? _props$rowDraggable$r : props.rowDraggable;
|
22679
|
+
if (typeof renderFn === 'function') {
|
22680
|
+
return renderFn(row, column, index, rows.tableRowList.value);
|
22681
|
+
}
|
22682
|
+
var fontSize = (_props$rowDraggable$f = (_props$rowDraggable2 = props.rowDraggable) === null || _props$rowDraggable2 === void 0 ? void 0 : _props$rowDraggable2.fontSize) !== null && _props$rowDraggable$f !== void 0 ? _props$rowDraggable$f : '14px';
|
22683
|
+
var fontIcon = (_props$rowDraggable$i = (_props$rowDraggable3 = props.rowDraggable) === null || _props$rowDraggable3 === void 0 ? void 0 : _props$rowDraggable3.icon) !== null && _props$rowDraggable$i !== void 0 ? _props$rowDraggable$i : (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.GragFill, {
|
22684
|
+
"style": "'--font-size: ".concat(fontSize, ";'"),
|
22685
|
+
"class": "drag-cell"
|
22686
|
+
}, null);
|
22687
|
+
return fontIcon;
|
22586
22688
|
};
|
22587
22689
|
return {
|
22588
|
-
|
22690
|
+
renderCell: renderCell
|
22589
22691
|
};
|
22590
22692
|
});
|
22591
22693
|
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-shift-key.tsx
|
@@ -22993,8 +23095,8 @@ function use_render_isSlot(s) {
|
|
22993
23095
|
"style": cellStyle,
|
22994
23096
|
"class": cellClass,
|
22995
23097
|
"colspan": colspan,
|
22996
|
-
"data-id": columnKey,
|
22997
23098
|
"rowspan": rowspan,
|
23099
|
+
"data-id": columnKey,
|
22998
23100
|
"onClick": function onClick(event) {
|
22999
23101
|
return handleEmit(event, EMIT_EVENTS.CELL_CLICK);
|
23000
23102
|
},
|
@@ -23003,9 +23105,9 @@ function use_render_isSlot(s) {
|
|
23003
23105
|
}
|
23004
23106
|
}, [(0,external_vue_namespaceObject.createVNode)(table_cell, {
|
23005
23107
|
"key": cellKey,
|
23108
|
+
"data-id": cellKey,
|
23006
23109
|
"class": tdCtxClass,
|
23007
23110
|
"column": column,
|
23008
|
-
"data-id": cellKey,
|
23009
23111
|
"observerResize": props.observerResize,
|
23010
23112
|
"parentSetting": props.showOverflowTooltip,
|
23011
23113
|
"row": row
|
@@ -23389,90 +23491,6 @@ var useRows = function useRows(props) {
|
|
23389
23491
|
};
|
23390
23492
|
};
|
23391
23493
|
/* harmony default export */ const use_rows = (useRows);
|
23392
|
-
;// CONCATENATED MODULE: external "../loading"
|
23393
|
-
var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
23394
|
-
var loading_y = x => () => x
|
23395
|
-
const loading_namespaceObject = loading_x({ ["BkLoadingMode"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingMode, ["BkLoadingSize"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingSize, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__["default"] });
|
23396
|
-
;// CONCATENATED MODULE: external "../loading/loading.less"
|
23397
|
-
var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
23398
|
-
var loading_less_y = x => () => x
|
23399
|
-
const loading_less_namespaceObject = loading_less_x({ });
|
23400
|
-
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-scroll-loading.tsx
|
23401
|
-
|
23402
|
-
|
23403
|
-
/*
|
23404
|
-
* Tencent is pleased to support the open source community by making
|
23405
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
23406
|
-
*
|
23407
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
23408
|
-
*
|
23409
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
23410
|
-
*
|
23411
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
23412
|
-
*
|
23413
|
-
* ---------------------------------------------------
|
23414
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
23415
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
23416
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
23417
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
23418
|
-
*
|
23419
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
23420
|
-
* the Software.
|
23421
|
-
*
|
23422
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
23423
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23424
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
23425
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
23426
|
-
* IN THE SOFTWARE.
|
23427
|
-
*/
|
23428
|
-
|
23429
|
-
|
23430
|
-
|
23431
|
-
|
23432
|
-
/* harmony default export */ const use_scroll_loading = (function (props, ctx) {
|
23433
|
-
var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
|
23434
|
-
var getLoadingOption = function getLoadingOption() {
|
23435
|
-
if (typeof refScrollLoading.value === 'boolean') {
|
23436
|
-
return {
|
23437
|
-
loading: !!refScrollLoading.value,
|
23438
|
-
inline: true,
|
23439
|
-
title: '',
|
23440
|
-
size: loading_namespaceObject.BkLoadingSize.Normal,
|
23441
|
-
mode: loading_namespaceObject.BkLoadingMode.Default,
|
23442
|
-
indicator: null
|
23443
|
-
};
|
23444
|
-
}
|
23445
|
-
return refScrollLoading.value;
|
23446
|
-
};
|
23447
|
-
var isRender = (0,external_vue_namespaceObject.computed)(function () {
|
23448
|
-
return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
|
23449
|
-
});
|
23450
|
-
var renderScrollLoading = function renderScrollLoading() {
|
23451
|
-
var _ctx$slots$fixedBotto3, _ctx$slots$fixedBotto4, _ctx$slots2;
|
23452
|
-
if (isRender.value) {
|
23453
|
-
var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
|
23454
|
-
var _getLoadingOption = getLoadingOption(),
|
23455
|
-
loading = _getLoadingOption.loading,
|
23456
|
-
size = _getLoadingOption.size,
|
23457
|
-
mode = _getLoadingOption.mode,
|
23458
|
-
title = _getLoadingOption.title,
|
23459
|
-
inline = _getLoadingOption.inline,
|
23460
|
-
indicator = _getLoadingOption.indicator;
|
23461
|
-
return (_ctx$slots$fixedBotto = (_ctx$slots$fixedBotto2 = (_ctx$slots = ctx.slots).fixedBottom) === null || _ctx$slots$fixedBotto2 === void 0 ? void 0 : _ctx$slots$fixedBotto2.call(_ctx$slots)) !== null && _ctx$slots$fixedBotto !== void 0 ? _ctx$slots$fixedBotto : (0,external_vue_namespaceObject.createVNode)(loading_namespaceObject["default"], {
|
23462
|
-
loading: loading,
|
23463
|
-
size: size,
|
23464
|
-
mode: mode,
|
23465
|
-
title: title,
|
23466
|
-
inline: inline,
|
23467
|
-
indicator: indicator
|
23468
|
-
}, null);
|
23469
|
-
}
|
23470
|
-
return (_ctx$slots$fixedBotto3 = (_ctx$slots$fixedBotto4 = (_ctx$slots2 = ctx.slots).fixedBottom) === null || _ctx$slots$fixedBotto4 === void 0 ? void 0 : _ctx$slots$fixedBotto4.call(_ctx$slots2)) !== null && _ctx$slots$fixedBotto3 !== void 0 ? _ctx$slots$fixedBotto3 : null;
|
23471
|
-
};
|
23472
|
-
return {
|
23473
|
-
renderScrollLoading: renderScrollLoading
|
23474
|
-
};
|
23475
|
-
});
|
23476
23494
|
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-settings.tsx
|
23477
23495
|
|
23478
23496
|
|
@@ -23847,7 +23865,6 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
23847
23865
|
|
23848
23866
|
|
23849
23867
|
|
23850
|
-
|
23851
23868
|
/* harmony default export */ const table = ((0,external_vue_namespaceObject.defineComponent)({
|
23852
23869
|
name: 'Table',
|
23853
23870
|
props: tableProps,
|
@@ -23858,6 +23875,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
23858
23875
|
var pagination = use_pagination(props);
|
23859
23876
|
var _useLayout = use_layout(props, ctx),
|
23860
23877
|
renderContainer = _useLayout.renderContainer,
|
23878
|
+
renderFixedBottom = _useLayout.renderFixedBottom,
|
23861
23879
|
renderBody = _useLayout.renderBody,
|
23862
23880
|
renderHeader = _useLayout.renderHeader,
|
23863
23881
|
renderFooter = _useLayout.renderFooter,
|
@@ -23874,7 +23892,8 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
23874
23892
|
*/
|
23875
23893
|
var afterSetting = function afterSetting(fields) {
|
23876
23894
|
if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
|
23877
|
-
|
23895
|
+
var _refBody$value;
|
23896
|
+
(_refBody$value = refBody.value) === null || _refBody$value === void 0 || _refBody$value.scrollTo(0, 0);
|
23878
23897
|
}
|
23879
23898
|
};
|
23880
23899
|
var settings = use_settings(props, ctx, columns, afterSetting);
|
@@ -23896,14 +23915,14 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
23896
23915
|
resolveColumns = _useColumnTemplate.resolveColumns;
|
23897
23916
|
var instance = (0,external_vue_namespaceObject.getCurrentInstance)();
|
23898
23917
|
var initTableColumns = function initTableColumns() {
|
23899
|
-
|
23918
|
+
var _instance$subTree$chi, _instance$subTree;
|
23919
|
+
var children = (_instance$subTree$chi = (_instance$subTree = instance.subTree) === null || _instance$subTree === void 0 ? void 0 : _instance$subTree.children) !== null && _instance$subTree$chi !== void 0 ? _instance$subTree$chi : [];
|
23920
|
+
columns.debounceUpdateColumns(resolveColumns(children));
|
23900
23921
|
};
|
23901
23922
|
(0,external_vue_namespaceObject.provide)(PROVIDE_KEY_INIT_COL, initTableColumns);
|
23902
23923
|
var _useFixedColumn = use_fixed_column(props, columns),
|
23903
23924
|
renderFixedRows = _useFixedColumn.renderFixedRows,
|
23904
23925
|
resolveFixedColumnStyle = _useFixedColumn.resolveFixedColumnStyle;
|
23905
|
-
var _useScrollLoading = use_scroll_loading(props, ctx),
|
23906
|
-
renderScrollLoading = _useScrollLoading.renderScrollLoading;
|
23907
23926
|
/**
|
23908
23927
|
* Column配置改变或者容器Resize之后,根据Columns配置
|
23909
23928
|
* 计算每一列的实际宽度
|
@@ -23975,6 +23994,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
23975
23994
|
});
|
23976
23995
|
};
|
23977
23996
|
use_observer_resize(refRoot, function () {
|
23997
|
+
var _refBody$value2;
|
23978
23998
|
if ((props.height === '100%' || props.virtualEnabled) && (0,lodash.isElement)(refRoot.value)) {
|
23979
23999
|
if (isResizeBodyHeight.value) {
|
23980
24000
|
setTimeout(function () {
|
@@ -23989,7 +24009,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
23989
24009
|
setOffsetRight();
|
23990
24010
|
}
|
23991
24011
|
computedColumnRect();
|
23992
|
-
refBody.value.scrollTo(0, 0);
|
24012
|
+
(_refBody$value2 = refBody.value) === null || _refBody$value2 === void 0 || _refBody$value2.scrollTo(0, 0);
|
23993
24013
|
setOffsetRight();
|
23994
24014
|
});
|
23995
24015
|
(0,external_vue_namespaceObject.watch)(function () {
|
@@ -24026,7 +24046,9 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24026
24046
|
(0,external_vue_namespaceObject.watch)(function () {
|
24027
24047
|
return [pagination.options.count, pagination.options.limit, pagination.options.current, props.data];
|
24028
24048
|
}, function () {
|
24049
|
+
var _refBody$value3;
|
24029
24050
|
setTableData();
|
24051
|
+
(_refBody$value3 = refBody.value) === null || _refBody$value3 === void 0 || _refBody$value3.scrollTo(0, 0);
|
24030
24052
|
}, {
|
24031
24053
|
immediate: true
|
24032
24054
|
});
|
@@ -24044,7 +24066,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24044
24066
|
}
|
24045
24067
|
});
|
24046
24068
|
return function () {
|
24047
|
-
return renderContainer([renderHeader(renderColumns, settings.renderSettings, renderFixedRows), renderBody(rows.pageRowList, renderTBody, renderFixedRows,
|
24069
|
+
return renderContainer([renderHeader(renderColumns, settings.renderSettings, renderFixedRows), renderBody(rows.pageRowList, renderTBody, renderFixedRows), renderFixedBottom(), renderFooter(renderTFoot())]);
|
24048
24070
|
};
|
24049
24071
|
}
|
24050
24072
|
}));
|