bkui-vue 2.0.1-beta.15.table.1 → 2.0.1-beta.15.table.10
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 +53 -53
- package/dist/index.esm.js +13000 -12896
- package/dist/index.umd.js +39 -39
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/index.js +1 -1
- package/lib/scrollbar/index.js +36 -13
- package/lib/scrollbar/scrollbar-core/index.d.ts +2 -1
- package/lib/shared/frame-throttle.d.ts +15 -0
- package/lib/shared/index.d.ts +1 -0
- package/lib/shared/index.js +72 -1
- package/lib/steps/index.d.ts +3 -3
- package/lib/steps/steps.d.ts +1 -1
- package/lib/table/components/table-column.d.ts +1 -0
- package/lib/table/hooks/use-cell.d.ts +20 -0
- package/lib/table/hooks/use-column-resize.d.ts +3 -1
- package/lib/table/hooks/use-column-template.d.ts +2 -2
- package/lib/table/hooks/use-columns.d.ts +3 -2
- package/lib/table/hooks/use-layout.d.ts +7 -5
- package/lib/table/hooks/use-settings.d.ts +1 -1
- package/lib/table/hooks/use-shift-key.d.ts +4 -2
- package/lib/table/index.d.ts +16 -0
- package/lib/table/index.js +810 -609
- package/lib/table/props.d.ts +13 -1
- package/lib/table/table.css +35 -47
- package/lib/table/table.d.ts +7 -0
- package/lib/table/table.less +40 -60
- package/lib/table/table.variable.css +35 -47
- package/lib/table/utils.d.ts +7 -5
- package/lib/table-column/index.d.ts +3 -0
- package/lib/table-column/index.js +20 -9
- package/lib/virtual-render/index.d.ts +4 -15
- package/lib/virtual-render/index.js +1 -1
- package/lib/virtual-render/props.d.ts +1 -3
- package/lib/virtual-render/virtual-render.d.ts +2 -7
- package/package.json +1 -1
package/lib/table/index.js
CHANGED
@@ -4,29 +4,28 @@ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../sh
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_isElement_e6b2a6ce__ from "lodash/isElement";
|
7
|
-
import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
|
8
7
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
|
9
8
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__ from "lodash/debounce";
|
10
9
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_get_9427f899__ from "lodash/get";
|
11
10
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_virtual_render_927587a8__ from "../virtual-render";
|
12
11
|
import "../virtual-render/virtual-render.less";
|
13
|
-
import * as
|
14
|
-
import "../
|
15
|
-
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
|
12
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__ from "../loading";
|
13
|
+
import "../loading/loading.less";
|
16
14
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_pagination_95c6c47e__ from "../pagination";
|
17
15
|
import "../pagination/pagination.less";
|
18
16
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_exception_7490d0fd__ from "../exception";
|
19
17
|
import "../exception/exception.less";
|
20
18
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_directives_45d4776f__ from "../directives";
|
19
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__ from "../checkbox";
|
20
|
+
import "../checkbox/checkbox.less";
|
21
21
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_button_a2ea7c9a__ from "../button";
|
22
22
|
import "../button/button.less";
|
23
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
|
23
24
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e__ from "../input";
|
24
25
|
import "../input/input.less";
|
25
26
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__ from "../popover";
|
26
27
|
import "../popover/popover.less";
|
27
28
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon__3efece53__ from "../icon/";
|
28
|
-
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__ from "../loading";
|
29
|
-
import "../loading/loading.less";
|
30
29
|
/******/ var __webpack_modules__ = ({
|
31
30
|
|
32
31
|
/***/ 6635:
|
@@ -17321,11 +17320,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
17321
17320
|
;// CONCATENATED MODULE: external "../shared"
|
17322
17321
|
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
17323
17322
|
var y = x => () => x
|
17324
|
-
const shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["RenderType"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.RenderType, ["classes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.classes, ["hasOverflowEllipsis"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.hasOverflowEllipsis, ["isElement"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.isElement, ["withInstallProps"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstallProps });
|
17323
|
+
const shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["RenderType"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.RenderType, ["classes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.classes, ["hasOverflowEllipsis"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.hasOverflowEllipsis, ["isElement"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.isElement, ["throttle"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.throttle, ["withInstallProps"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstallProps });
|
17325
17324
|
;// CONCATENATED MODULE: external "vue"
|
17326
17325
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
17327
17326
|
var external_vue_y = x => () => x
|
17328
|
-
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isRef, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["
|
17327
|
+
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isRef, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
|
17329
17328
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
17330
17329
|
function typeof_typeof(o) {
|
17331
17330
|
"@babel/helpers - typeof";
|
@@ -17686,16 +17685,16 @@ var tableProps = {
|
|
17686
17685
|
* 默认:auto 根据行数自动填充高度
|
17687
17686
|
* 100%,依赖初始化时父级容器高度
|
17688
17687
|
*/
|
17689
|
-
height: StringNumberType('
|
17688
|
+
height: StringNumberType('auto'),
|
17690
17689
|
/**
|
17691
17690
|
* 是否为斑马纹 Table
|
17692
17691
|
*/
|
17693
17692
|
stripe: shared_namespaceObject.PropTypes.bool.def(false),
|
17694
17693
|
/**
|
17695
17694
|
* 设置表格最小高度
|
17696
|
-
* 默认:
|
17695
|
+
* 默认:LINE_HEIGHT * 4
|
17697
17696
|
*/
|
17698
|
-
minHeight: StringNumberType(LINE_HEIGHT *
|
17697
|
+
minHeight: StringNumberType(LINE_HEIGHT * 4),
|
17699
17698
|
/**
|
17700
17699
|
* 设置表格最d大高度
|
17701
17700
|
* 默认:auto,依赖外层高度
|
@@ -17903,7 +17902,16 @@ var tableProps = {
|
|
17903
17902
|
/**
|
17904
17903
|
* 启用Scrollbar
|
17905
17904
|
*/
|
17906
|
-
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)
|
17907
17915
|
};
|
17908
17916
|
;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
|
17909
17917
|
|
@@ -17964,11 +17972,13 @@ var TableColumnProp = {
|
|
17964
17972
|
var column = (0,external_vue_namespaceObject.reactive)(Object.assign({}, props, {
|
17965
17973
|
field: props.prop || props.field
|
17966
17974
|
}));
|
17967
|
-
(0,external_vue_namespaceObject.
|
17968
|
-
|
17969
|
-
})
|
17970
|
-
(0,external_vue_namespaceObject.onUpdated)(function () {
|
17975
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
17976
|
+
return [props];
|
17977
|
+
}, function () {
|
17971
17978
|
initTableColumns();
|
17979
|
+
}, {
|
17980
|
+
immediate: true,
|
17981
|
+
deep: true
|
17972
17982
|
});
|
17973
17983
|
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
17974
17984
|
initTableColumns();
|
@@ -18086,10 +18096,6 @@ var CELL_EVENT_TYPES = defineProperty_defineProperty(defineProperty_defineProper
|
|
18086
18096
|
var isElement_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
18087
18097
|
var isElement_y = x => () => x
|
18088
18098
|
const isElement_namespaceObject = isElement_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_isElement_e6b2a6ce__["default"] });
|
18089
|
-
;// CONCATENATED MODULE: external "lodash/throttle"
|
18090
|
-
var throttle_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
18091
|
-
var throttle_y = x => () => x
|
18092
|
-
const throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__["default"] });
|
18093
18099
|
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-column-resize.tsx
|
18094
18100
|
|
18095
18101
|
/*
|
@@ -18121,7 +18127,8 @@ const throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTER
|
|
18121
18127
|
|
18122
18128
|
|
18123
18129
|
|
18124
|
-
/* harmony default export */ const use_column_resize = (function (columns) {
|
18130
|
+
/* harmony default export */ const use_column_resize = (function (columns, _ref) {
|
18131
|
+
var afterResize = _ref.afterResize;
|
18125
18132
|
var getColumnAttribute = columns.getColumnAttribute,
|
18126
18133
|
getColumnOrderWidth = columns.getColumnOrderWidth,
|
18127
18134
|
setColumnAttribute = columns.setColumnAttribute;
|
@@ -18157,22 +18164,25 @@ const throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTER
|
|
18157
18164
|
var diff = e.clientX - startX;
|
18158
18165
|
var resolveWidth = getColumnOrderWidth(dragColumn, ORDER_LIST) + diff;
|
18159
18166
|
var minWidth = getColumnOrderWidth(dragColumn, [COLUMN_ATTRIBUTE.COL_MIN_WIDTH]);
|
18160
|
-
|
18167
|
+
var calcWidth = resolveWidth > minWidth ? resolveWidth : minWidth;
|
18168
|
+
setColumnAttribute(dragColumn, COLUMN_ATTRIBUTE.RESIZE_WIDTH, calcWidth);
|
18169
|
+
setColumnAttribute(dragColumn, COLUMN_ATTRIBUTE.CALC_WIDTH, calcWidth);
|
18161
18170
|
document.removeEventListener('mouseup', handleMouseUp);
|
18162
18171
|
document.removeEventListener('mousemove', handleMouseMove);
|
18163
18172
|
startX = 0;
|
18164
18173
|
dragOffsetX.value = -1000;
|
18165
18174
|
dragColumn = null;
|
18175
|
+
afterResize === null || afterResize === void 0 || afterResize();
|
18166
18176
|
};
|
18167
18177
|
var updateOffsetX = function updateOffsetX(e) {
|
18168
|
-
return (0,
|
18178
|
+
return (0,shared_namespaceObject.throttle)(function () {
|
18169
18179
|
var diff = e.clientX - startX;
|
18170
18180
|
var resolveWidth = getColumnOrderWidth(dragColumn, ORDER_LIST) + diff;
|
18171
18181
|
var minWidth = getColumnOrderWidth(dragColumn, [COLUMN_ATTRIBUTE.COL_MIN_WIDTH]);
|
18172
18182
|
if (minWidth < resolveWidth) {
|
18173
18183
|
dragOffsetX.value = e.clientX - startX + dragStartOffsetX;
|
18174
18184
|
}
|
18175
|
-
}
|
18185
|
+
});
|
18176
18186
|
};
|
18177
18187
|
var handleMouseMove = function handleMouseMove(e) {
|
18178
18188
|
stopDefaultEvent(e);
|
@@ -18182,13 +18192,8 @@ const throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTER
|
|
18182
18192
|
};
|
18183
18193
|
var setChildrenNodeCursor = function setChildrenNodeCursor(root, cursor) {
|
18184
18194
|
if ((0,isElement_namespaceObject["default"])(root)) {
|
18185
|
-
var _root$style
|
18195
|
+
var _root$style;
|
18186
18196
|
(_root$style = root.style) === null || _root$style === void 0 || _root$style.setProperty('cursor', cursor);
|
18187
|
-
if (((_root$childNodes = root.childNodes) === null || _root$childNodes === void 0 ? void 0 : _root$childNodes.length) > 0) {
|
18188
|
-
root.childNodes.forEach(function (node) {
|
18189
|
-
return setChildrenNodeCursor(node, cursor);
|
18190
|
-
});
|
18191
|
-
}
|
18192
18197
|
}
|
18193
18198
|
};
|
18194
18199
|
var handler = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, EVENTS.MOUSE_DOWN, function (e, column) {
|
@@ -18461,12 +18466,9 @@ function v4(options, buf, offset) {
|
|
18461
18466
|
});
|
18462
18467
|
}
|
18463
18468
|
};
|
18464
|
-
var resolveColumns = function resolveColumns(
|
18465
|
-
var _instance$slots$defau, _instance$slots, _instance$slots$defau2;
|
18466
|
-
var instance = target !== null && target !== void 0 ? target : (0,external_vue_namespaceObject.getCurrentInstance)();
|
18469
|
+
var resolveColumns = function resolveColumns(children) {
|
18467
18470
|
columns.length = 0;
|
18468
18471
|
columnIndex = 0;
|
18469
|
-
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 : [];
|
18470
18472
|
children.forEach(resolveChildNode);
|
18471
18473
|
columns.sort(function (col1, col2) {
|
18472
18474
|
return col1.index - col2.index;
|
@@ -19631,7 +19633,7 @@ var observerResize = function observerResize(root, callbackFn) {
|
|
19631
19633
|
callbackFn();
|
19632
19634
|
}
|
19633
19635
|
};
|
19634
|
-
var execFn = resizerWay === 'debounce' ? (0,debounce_namespaceObject["default"])(resolveCallbackFn, delay) : (0,
|
19636
|
+
var execFn = resizerWay === 'debounce' ? (0,debounce_namespaceObject["default"])(resolveCallbackFn, delay) : (0,shared_namespaceObject.throttle)(resolveCallbackFn);
|
19635
19637
|
var callFn = function callFn() {
|
19636
19638
|
return Reflect.apply(execFn, _this, []);
|
19637
19639
|
};
|
@@ -19967,6 +19969,21 @@ var getRawData = function getRawData(data) {
|
|
19967
19969
|
}
|
19968
19970
|
return data;
|
19969
19971
|
};
|
19972
|
+
/**
|
19973
|
+
* 转换 px | % 为实际数值
|
19974
|
+
* @param val
|
19975
|
+
* @param parentVal
|
19976
|
+
* @returns
|
19977
|
+
*/
|
19978
|
+
var getNumberOrPercentValue = function getNumberOrPercentValue(val, parentVal) {
|
19979
|
+
if (/^\d+\.?\d+(px)?$/.test("".concat(val))) {
|
19980
|
+
return Number("".concat(val).replace(/px/, ''));
|
19981
|
+
}
|
19982
|
+
if (/^\d+\.?\d+%$/.test("".concat(val))) {
|
19983
|
+
return Number("".concat(val).replace(/%/, '')) / 100 * (parentVal !== null && parentVal !== void 0 ? parentVal : 1);
|
19984
|
+
}
|
19985
|
+
return null;
|
19986
|
+
};
|
19970
19987
|
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-columns.tsx
|
19971
19988
|
|
19972
19989
|
|
@@ -20038,6 +20055,63 @@ var useColumns = function useColumns(props) {
|
|
20038
20055
|
active: true
|
20039
20056
|
}));
|
20040
20057
|
};
|
20058
|
+
var setColumnCalcWidth = function setColumnCalcWidth(col, attrName, width) {
|
20059
|
+
var colWidth = 0;
|
20060
|
+
if (/^\d+\.?\d*(px)?$/.test("".concat(col[attrName]))) {
|
20061
|
+
colWidth = Number("".concat(col[attrName]).replace(/px/, ''));
|
20062
|
+
setColumnAttribute(col, COLUMN_ATTRIBUTE.CALC_WIDTH, colWidth);
|
20063
|
+
setColumnRect(col, {
|
20064
|
+
width: colWidth,
|
20065
|
+
left: null,
|
20066
|
+
right: null
|
20067
|
+
});
|
20068
|
+
}
|
20069
|
+
if (/^\d+\.?\d*%$/.test("".concat(col[attrName]))) {
|
20070
|
+
colWidth = Number("".concat(col[attrName]).replace(/%/, '')) / 100 * width;
|
20071
|
+
setColumnAttribute(col, COLUMN_ATTRIBUTE.CALC_WIDTH, colWidth);
|
20072
|
+
setColumnRect(col, {
|
20073
|
+
width: colWidth,
|
20074
|
+
left: null,
|
20075
|
+
right: null
|
20076
|
+
});
|
20077
|
+
}
|
20078
|
+
return colWidth;
|
20079
|
+
};
|
20080
|
+
/**
|
20081
|
+
* 根据表格外层宽度和表格列配置
|
20082
|
+
* 计算每一列的宽度
|
20083
|
+
* @param width
|
20084
|
+
*/
|
20085
|
+
var resolveColsCalcWidth = function resolveColsCalcWidth(width) {
|
20086
|
+
var diffWidth = width;
|
20087
|
+
var minColWidth = COL_MIN_WIDTH;
|
20088
|
+
var resolveColWidth = function resolveColWidth(colList) {
|
20089
|
+
var attrName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'width';
|
20090
|
+
var filterList = [];
|
20091
|
+
colList.forEach(function (col) {
|
20092
|
+
var calcWidth = setColumnCalcWidth(col, attrName, width);
|
20093
|
+
diffWidth = diffWidth - calcWidth;
|
20094
|
+
if ([undefined, null, 'auto', 'undefined', 'null', ''].includes(col[attrName])) {
|
20095
|
+
filterList.push(col);
|
20096
|
+
}
|
20097
|
+
});
|
20098
|
+
if (diffWidth > 0 && filterList.length) {
|
20099
|
+
minColWidth = diffWidth / filterList.length;
|
20100
|
+
}
|
20101
|
+
return filterList;
|
20102
|
+
};
|
20103
|
+
var minWidthList = resolveColWidth(visibleColumns);
|
20104
|
+
var autoWidthList = resolveColWidth(minWidthList, 'minWidth');
|
20105
|
+
autoWidthList.forEach(function (col) {
|
20106
|
+
var calcWidth = minColWidth > COL_MIN_WIDTH ? minColWidth : COL_MIN_WIDTH;
|
20107
|
+
setColumnAttribute(col, COLUMN_ATTRIBUTE.CALC_WIDTH, calcWidth);
|
20108
|
+
setColumnRect(col, {
|
20109
|
+
width: calcWidth,
|
20110
|
+
left: null,
|
20111
|
+
right: null
|
20112
|
+
});
|
20113
|
+
});
|
20114
|
+
};
|
20041
20115
|
/**
|
20042
20116
|
* 用来记录列的过滤状态
|
20043
20117
|
* @param col
|
@@ -20064,12 +20138,6 @@ var useColumns = function useColumns(props) {
|
|
20064
20138
|
return !isHiddenColumn(col);
|
20065
20139
|
})));
|
20066
20140
|
};
|
20067
|
-
var headHeight = (0,external_vue_namespaceObject.computed)(function () {
|
20068
|
-
if (props.showHead) {
|
20069
|
-
return props.headHeight;
|
20070
|
-
}
|
20071
|
-
return 0;
|
20072
|
-
});
|
20073
20141
|
var resolveDraggableColumn = function resolveDraggableColumn() {
|
20074
20142
|
if (props.rowDraggable) {
|
20075
20143
|
var _props$rowDraggable$w, _props$rowDraggable, _props$rowDraggable$l, _props$rowDraggable2;
|
@@ -20233,6 +20301,9 @@ var useColumns = function useColumns(props) {
|
|
20233
20301
|
var getColumnRect = function getColumnRect(column) {
|
20234
20302
|
return getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_RECT);
|
20235
20303
|
};
|
20304
|
+
var getColumnCalcWidth = function getColumnCalcWidth(column) {
|
20305
|
+
return getColumnAttribute(column, COLUMN_ATTRIBUTE.CALC_WIDTH);
|
20306
|
+
};
|
20236
20307
|
var setColumnRect = function setColumnRect(col, _ref2) {
|
20237
20308
|
var left = _ref2.left,
|
20238
20309
|
right = _ref2.right,
|
@@ -20415,7 +20486,6 @@ var useColumns = function useColumns(props) {
|
|
20415
20486
|
return {
|
20416
20487
|
needColSpan: needColSpan,
|
20417
20488
|
needRowSpan: needRowSpan,
|
20418
|
-
headHeight: headHeight,
|
20419
20489
|
tableColumnSchema: tableColumnSchema,
|
20420
20490
|
tableColumnList: tableColumnList,
|
20421
20491
|
visibleColumns: visibleColumns,
|
@@ -20434,6 +20504,7 @@ var useColumns = function useColumns(props) {
|
|
20434
20504
|
getColumnRect: getColumnRect,
|
20435
20505
|
getColumnCustomClass: getColumnCustomClass,
|
20436
20506
|
getColumnRefAttribute: getColumnRefAttribute,
|
20507
|
+
getColumnCalcWidth: getColumnCalcWidth,
|
20437
20508
|
resolveEventListener: resolveEventListener,
|
20438
20509
|
setColumnIsHidden: setColumnIsHidden,
|
20439
20510
|
setColumnResizeWidth: setColumnResizeWidth,
|
@@ -20444,7 +20515,8 @@ var useColumns = function useColumns(props) {
|
|
20444
20515
|
setColumnSortActive: setColumnSortActive,
|
20445
20516
|
setFixedStyle: setFixedStyle,
|
20446
20517
|
setColumnRect: setColumnRect,
|
20447
|
-
setVisibleColumns: setVisibleColumns
|
20518
|
+
setVisibleColumns: setVisibleColumns,
|
20519
|
+
resolveColsCalcWidth: resolveColsCalcWidth
|
20448
20520
|
};
|
20449
20521
|
};
|
20450
20522
|
/* harmony default export */ const use_columns = (useColumns);
|
@@ -20652,10 +20724,10 @@ var useColumns = function useColumns(props) {
|
|
20652
20724
|
var length = fixedRightColumns.value.length;
|
20653
20725
|
for (var i = length - 1; i >= 0; i--) {
|
20654
20726
|
var col = fixedRightColumns.value[i];
|
20655
|
-
var
|
20656
|
-
width = _columns$getColumnRec.width;
|
20727
|
+
var width = columns.getColumnCalcWidth(col);
|
20657
20728
|
columns.setColumnRect(col, {
|
20658
|
-
right: right
|
20729
|
+
right: right,
|
20730
|
+
width: width
|
20659
20731
|
});
|
20660
20732
|
columns.setFixedStyle(col, {
|
20661
20733
|
right: "".concat(right, "px")
|
@@ -20664,10 +20736,10 @@ var useColumns = function useColumns(props) {
|
|
20664
20736
|
}
|
20665
20737
|
var left = 0;
|
20666
20738
|
fixedLeftColumns.value.forEach(function (col) {
|
20667
|
-
var
|
20668
|
-
width = _columns$getColumnRec2.width;
|
20739
|
+
var width = columns.getColumnCalcWidth(col);
|
20669
20740
|
columns.setColumnRect(col, {
|
20670
|
-
left: left
|
20741
|
+
left: left,
|
20742
|
+
width: width
|
20671
20743
|
});
|
20672
20744
|
columns.setFixedStyle(col, {
|
20673
20745
|
left: "".concat(left, "px")
|
@@ -20710,6 +20782,90 @@ const virtual_render_namespaceObject = virtual_render_x({ ["default"]: () => __W
|
|
20710
20782
|
var virtual_render_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
20711
20783
|
var virtual_render_less_y = x => () => x
|
20712
20784
|
const virtual_render_less_namespaceObject = virtual_render_less_x({ });
|
20785
|
+
;// CONCATENATED MODULE: external "../loading"
|
20786
|
+
var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
20787
|
+
var loading_y = x => () => x
|
20788
|
+
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"] });
|
20789
|
+
;// CONCATENATED MODULE: external "../loading/loading.less"
|
20790
|
+
var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
20791
|
+
var loading_less_y = x => () => x
|
20792
|
+
const loading_less_namespaceObject = loading_less_x({ });
|
20793
|
+
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-scroll-loading.tsx
|
20794
|
+
|
20795
|
+
|
20796
|
+
/*
|
20797
|
+
* Tencent is pleased to support the open source community by making
|
20798
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
20799
|
+
*
|
20800
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
20801
|
+
*
|
20802
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
20803
|
+
*
|
20804
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
20805
|
+
*
|
20806
|
+
* ---------------------------------------------------
|
20807
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
20808
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
20809
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
20810
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
20811
|
+
*
|
20812
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
20813
|
+
* the Software.
|
20814
|
+
*
|
20815
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
20816
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20817
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
20818
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
20819
|
+
* IN THE SOFTWARE.
|
20820
|
+
*/
|
20821
|
+
|
20822
|
+
|
20823
|
+
|
20824
|
+
|
20825
|
+
/* harmony default export */ const use_scroll_loading = (function (props, ctx) {
|
20826
|
+
var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
|
20827
|
+
var getLoadingOption = function getLoadingOption() {
|
20828
|
+
if (typeof refScrollLoading.value === 'boolean') {
|
20829
|
+
return {
|
20830
|
+
loading: !!refScrollLoading.value,
|
20831
|
+
inline: true,
|
20832
|
+
title: '',
|
20833
|
+
size: loading_namespaceObject.BkLoadingSize.Normal,
|
20834
|
+
mode: loading_namespaceObject.BkLoadingMode.Default,
|
20835
|
+
indicator: null
|
20836
|
+
};
|
20837
|
+
}
|
20838
|
+
return refScrollLoading.value;
|
20839
|
+
};
|
20840
|
+
var isRender = (0,external_vue_namespaceObject.computed)(function () {
|
20841
|
+
return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
|
20842
|
+
});
|
20843
|
+
var renderScrollLoading = function renderScrollLoading() {
|
20844
|
+
var _ctx$slots$fixedBotto3, _ctx$slots$fixedBotto4, _ctx$slots2;
|
20845
|
+
if (isRender.value) {
|
20846
|
+
var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
|
20847
|
+
var _getLoadingOption = getLoadingOption(),
|
20848
|
+
loading = _getLoadingOption.loading,
|
20849
|
+
size = _getLoadingOption.size,
|
20850
|
+
mode = _getLoadingOption.mode,
|
20851
|
+
title = _getLoadingOption.title,
|
20852
|
+
inline = _getLoadingOption.inline,
|
20853
|
+
indicator = _getLoadingOption.indicator;
|
20854
|
+
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"], {
|
20855
|
+
loading: loading,
|
20856
|
+
size: size,
|
20857
|
+
mode: mode,
|
20858
|
+
title: title,
|
20859
|
+
inline: inline,
|
20860
|
+
indicator: indicator
|
20861
|
+
}, null);
|
20862
|
+
}
|
20863
|
+
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;
|
20864
|
+
};
|
20865
|
+
return {
|
20866
|
+
renderScrollLoading: renderScrollLoading
|
20867
|
+
};
|
20868
|
+
});
|
20713
20869
|
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-layout.tsx
|
20714
20870
|
|
20715
20871
|
|
@@ -20750,6 +20906,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20750
20906
|
|
20751
20907
|
|
20752
20908
|
|
20909
|
+
|
20753
20910
|
/* harmony default export */ const use_layout = (function (props, ctx) {
|
20754
20911
|
var _props$rowHeight;
|
20755
20912
|
var refRoot = (0,external_vue_namespaceObject.ref)(null);
|
@@ -20759,40 +20916,76 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20759
20916
|
var translateX = (0,external_vue_namespaceObject.ref)(0);
|
20760
20917
|
var translateY = (0,external_vue_namespaceObject.ref)(0);
|
20761
20918
|
var preBottom = (0,external_vue_namespaceObject.ref)(0);
|
20762
|
-
var dragOffsetX = (0,external_vue_namespaceObject.ref)(-
|
20919
|
+
var dragOffsetX = (0,external_vue_namespaceObject.ref)(-10000);
|
20763
20920
|
var offsetRight = (0,external_vue_namespaceObject.ref)(0);
|
20764
20921
|
var layout = (0,external_vue_namespaceObject.reactive)({});
|
20765
20922
|
var fixedColumns = (0,external_vue_namespaceObject.reactive)([]);
|
20766
20923
|
var lineHeight = (0,external_vue_namespaceObject.ref)((_props$rowHeight = props.rowHeight) !== null && _props$rowHeight !== void 0 ? _props$rowHeight : LINE_HEIGHT);
|
20924
|
+
var fixedBottomHeight = (0,external_vue_namespaceObject.computed)(function () {
|
20925
|
+
var _props$fixedBottom, _props$fixedBottom$he, _props$fixedBottom2, _props$fixedBottom$he2, _props$fixedBottom3;
|
20926
|
+
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;
|
20927
|
+
});
|
20767
20928
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
20768
20929
|
resolveClassName = _usePrefix.resolveClassName;
|
20930
|
+
var _useScrollLoading = use_scroll_loading(props, ctx),
|
20931
|
+
renderScrollLoading = _useScrollLoading.renderScrollLoading;
|
20769
20932
|
var tableClass = (0,external_vue_namespaceObject.computed)(function () {
|
20770
20933
|
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty({}, resolveClassName('table'), true), resolvePropBorderToClassStr(props.border));
|
20771
20934
|
});
|
20772
20935
|
var tableStyle = (0,external_vue_namespaceObject.computed)(function () {
|
20773
20936
|
return {
|
20774
|
-
height: resolveNumberOrStringToPix(props.height,
|
20937
|
+
height: resolveNumberOrStringToPix(props.height),
|
20938
|
+
maxHeight: resolveNumberOrStringToPix(props.maxHeight),
|
20939
|
+
minHeight: resolveNumberOrStringToPix(props.minHeight)
|
20775
20940
|
};
|
20776
20941
|
});
|
20777
20942
|
var headClass = (0,external_vue_namespaceObject.computed)(function () {
|
20778
20943
|
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-head'), true), 'has-settings', !!props.settings));
|
20779
20944
|
});
|
20945
|
+
var setFixedColumnShawdow = function setFixedColumnShawdow() {
|
20946
|
+
var _refRoot$value, _refRoot$value2;
|
20947
|
+
var rightShawdow = offsetRight.value > 0 ? '0 0 10px rgb(0 0 0 / 12%)' : null;
|
20948
|
+
var leftShawdow = translateX.value > 0 ? '0 0 10px rgb(0 0 0 / 12%)' : null;
|
20949
|
+
(_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);
|
20950
|
+
(_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);
|
20951
|
+
};
|
20952
|
+
var setRootStyleVars = (0,shared_namespaceObject.throttle)(function () {
|
20953
|
+
var _refRoot$value3, _refRoot$value4, _refRoot$value5, _refRoot$value6, _refRoot$value7;
|
20954
|
+
(_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"));
|
20955
|
+
(_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"));
|
20956
|
+
(_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"));
|
20957
|
+
(_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"));
|
20958
|
+
(_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"));
|
20959
|
+
setFixedColumnShawdow();
|
20960
|
+
});
|
20780
20961
|
var setTranslateX = function setTranslateX(val) {
|
20781
20962
|
translateX.value = val;
|
20963
|
+
setRootStyleVars();
|
20782
20964
|
};
|
20783
20965
|
var setTranslateY = function setTranslateY(val) {
|
20784
20966
|
translateY.value = val;
|
20967
|
+
setRootStyleVars();
|
20968
|
+
};
|
20969
|
+
var initRootStyleVars = function initRootStyleVars() {
|
20970
|
+
var _refRoot$value8, _refRoot$value9, _refRoot$value10, _refRoot$value11, _refRoot$value12;
|
20971
|
+
(_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');
|
20972
|
+
(_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');
|
20973
|
+
(_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');
|
20974
|
+
(_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');
|
20975
|
+
(_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');
|
20785
20976
|
};
|
20786
20977
|
var setDragOffsetX = function setDragOffsetX(val) {
|
20787
20978
|
dragOffsetX.value = val;
|
20979
|
+
setRootStyleVars();
|
20788
20980
|
};
|
20789
20981
|
var config = resolveHeadConfig(props);
|
20982
|
+
var headHeight = (0,external_vue_namespaceObject.computed)(function () {
|
20983
|
+
return resolvePropVal(config, 'height', ['thead']);
|
20984
|
+
});
|
20790
20985
|
var headStyle = (0,external_vue_namespaceObject.computed)(function () {
|
20791
20986
|
var _props$thead$color, _props$thead;
|
20792
20987
|
return {
|
20793
|
-
'--row-height': "".concat(
|
20794
|
-
'--scroll-head-left': "-".concat(translateX.value, "px"),
|
20795
|
-
'--scroll-left': "".concat(translateX.value, "px"),
|
20988
|
+
'--row-height': "".concat(headHeight.value, "px"),
|
20796
20989
|
'--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]
|
20797
20990
|
};
|
20798
20991
|
});
|
@@ -20806,26 +20999,6 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20806
20999
|
height: 0,
|
20807
21000
|
display: 'none'
|
20808
21001
|
};
|
20809
|
-
var dragOffsetXStyle = {
|
20810
|
-
position: 'absolute',
|
20811
|
-
top: 0,
|
20812
|
-
bottom: 0,
|
20813
|
-
left: 0,
|
20814
|
-
width: '1px',
|
20815
|
-
backgroundColor: '#3785FF',
|
20816
|
-
transform: 'translateX(-50%)'
|
20817
|
-
};
|
20818
|
-
var resizeColumnStyle = (0,external_vue_namespaceObject.computed)(function () {
|
20819
|
-
return use_layout_objectSpread(use_layout_objectSpread({}, dragOffsetXStyle), {}, {
|
20820
|
-
transform: "translate3d(".concat(dragOffsetX.value + 3, "px, ").concat(translateY.value, "px, 0)")
|
20821
|
-
});
|
20822
|
-
});
|
20823
|
-
var resizeHeadColStyle = (0,external_vue_namespaceObject.computed)(function () {
|
20824
|
-
return use_layout_objectSpread(use_layout_objectSpread({}, dragOffsetXStyle), {}, {
|
20825
|
-
width: '6px',
|
20826
|
-
transform: "translateX(".concat(dragOffsetX.value, "px)")
|
20827
|
-
});
|
20828
|
-
});
|
20829
21002
|
var renderContainer = function renderContainer(childrend) {
|
20830
21003
|
var _ctx$slots$default, _ctx$slots;
|
20831
21004
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
@@ -20836,15 +21009,16 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20836
21009
|
"style": columnGhostStyle
|
20837
21010
|
}, [(_ctx$slots$default = (_ctx$slots = ctx.slots)["default"]) === null || _ctx$slots$default === void 0 ? void 0 : _ctx$slots$default.call(_ctx$slots)])]);
|
20838
21011
|
};
|
20839
|
-
var renderHeader = function renderHeader(childrend, settings) {
|
21012
|
+
var renderHeader = function renderHeader(childrend, settings, fixedRows) {
|
20840
21013
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
20841
21014
|
"ref": refHead,
|
20842
21015
|
"style": headStyle.value,
|
20843
21016
|
"class": headClass.value
|
20844
21017
|
}, [childrend === null || childrend === void 0 ? void 0 : childrend(), (0,external_vue_namespaceObject.createVNode)("div", {
|
20845
|
-
"style": resizeHeadColStyle.value,
|
20846
21018
|
"class": "col-resize-drag"
|
20847
|
-
}, null),
|
21019
|
+
}, null), (0,external_vue_namespaceObject.createVNode)("div", {
|
21020
|
+
"class": fixedWrapperClass
|
21021
|
+
}, [fixedRows === null || fixedRows === void 0 ? void 0 : fixedRows()]), settings === null || settings === void 0 ? void 0 : settings()]);
|
20848
21022
|
};
|
20849
21023
|
var prependStyle = (0,external_vue_namespaceObject.computed)(function () {
|
20850
21024
|
return use_layout_objectSpread({
|
@@ -20863,8 +21037,16 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20863
21037
|
return null;
|
20864
21038
|
};
|
20865
21039
|
var bodyHeight = (0,external_vue_namespaceObject.ref)('auto');
|
21040
|
+
var bodyMaxHeight = (0,external_vue_namespaceObject.computed)(function () {
|
21041
|
+
if (/^\d+\.?\d*(px|%)$/.test("".concat(tableStyle.value.maxHeight))) {
|
21042
|
+
var headerHeight = props.showHead ? headHeight.value : 0;
|
21043
|
+
var delHeight = footHeight.value + headerHeight + fixedBottomHeight.value;
|
21044
|
+
return "calc(".concat(tableStyle.value.maxHeight, " - ").concat(delHeight, "px)");
|
21045
|
+
}
|
21046
|
+
return null;
|
21047
|
+
});
|
20866
21048
|
var setBodyHeight = function setBodyHeight(height) {
|
20867
|
-
bodyHeight.value = height;
|
21049
|
+
bodyHeight.value = height - headHeight.value - fixedBottomHeight.value - footHeight.value;
|
20868
21050
|
};
|
20869
21051
|
var footHeight = (0,external_vue_namespaceObject.ref)(0);
|
20870
21052
|
var footerStyle = (0,external_vue_namespaceObject.computed)(function () {
|
@@ -20881,6 +21063,10 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20881
21063
|
}
|
20882
21064
|
ctx.emit(EMIT_EVENTS.SCROLL_BOTTOM, use_layout_objectSpread({}, args));
|
20883
21065
|
});
|
21066
|
+
/**
|
21067
|
+
* 设置横向滚动条距离右侧距离
|
21068
|
+
* 用于判定fix column的显示样式
|
21069
|
+
*/
|
20884
21070
|
var setOffsetRight = function setOffsetRight() {
|
20885
21071
|
var _refBody$value$refRoo, _refBody$value, _refBody$value$refRoo2, _refBody$value2, _ref;
|
20886
21072
|
var scrollWidth = (_refBody$value$refRoo = (_refBody$value = refBody.value) === null || _refBody$value === void 0 || (_refBody$value = _refBody$value.refRoot) === null || _refBody$value === void 0 ? void 0 : _refBody$value.scrollWidth) !== null && _refBody$value$refRoo !== void 0 ? _refBody$value$refRoo : 0;
|
@@ -20912,24 +21098,34 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20912
21098
|
};
|
20913
21099
|
var resizeColumnClass = {
|
20914
21100
|
column_drag_line: true,
|
20915
|
-
'offset-x': true
|
21101
|
+
'offset-x': true,
|
21102
|
+
'resize-column': true
|
20916
21103
|
};
|
20917
|
-
var fixedWrapperClass = (
|
20918
|
-
return [resolveClassName('table-fixed'), {
|
20919
|
-
'shadow-right': offsetRight.value > 0,
|
20920
|
-
'shadow-left': translateX.value > 0
|
20921
|
-
}];
|
20922
|
-
});
|
21104
|
+
var fixedWrapperClass = resolveClassName('table-fixed');
|
20923
21105
|
var fixedBottomRow = resolveClassName('table-fixed-bottom');
|
20924
|
-
var
|
21106
|
+
var fixedBottomLoadingStyle = (0,external_vue_namespaceObject.computed)(function () {
|
21107
|
+
var _props$fixedBottom$po, _props$fixedBottom4, _props$fixedBottom$he3, _props$fixedBottom5;
|
20925
21108
|
return {
|
20926
|
-
|
21109
|
+
minHeight: "".concat(lineHeight.value, "px"),
|
21110
|
+
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',
|
21111
|
+
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
|
20927
21112
|
};
|
20928
21113
|
});
|
20929
21114
|
(0,external_vue_namespaceObject.onMounted)(function () {
|
20930
21115
|
setOffsetRight();
|
21116
|
+
initRootStyleVars();
|
20931
21117
|
});
|
20932
|
-
var
|
21118
|
+
var getFixedBottomRender = function getFixedBottomRender() {
|
21119
|
+
var result = renderScrollLoading === null || renderScrollLoading === void 0 ? void 0 : renderScrollLoading();
|
21120
|
+
if (result) {
|
21121
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
21122
|
+
"style": fixedBottomLoadingStyle.value,
|
21123
|
+
"class": fixedBottomRow
|
21124
|
+
}, [result]);
|
21125
|
+
}
|
21126
|
+
return null;
|
21127
|
+
};
|
21128
|
+
var renderBody = function renderBody(list, childrend, fixedRows) {
|
20933
21129
|
return (0,external_vue_namespaceObject.createVNode)(virtual_render_namespaceObject["default"], {
|
20934
21130
|
"ref": refBody,
|
20935
21131
|
"height": bodyHeight.value,
|
@@ -20942,6 +21138,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20942
21138
|
"scrollbar": {
|
20943
21139
|
enabled: props.scrollbar
|
20944
21140
|
},
|
21141
|
+
"maxHeight": bodyMaxHeight.value,
|
20945
21142
|
"throttleDelay": 120,
|
20946
21143
|
"onContentScroll": handleScrollChanged
|
20947
21144
|
}, {
|
@@ -20949,20 +21146,15 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20949
21146
|
return renderPrepend();
|
20950
21147
|
},
|
20951
21148
|
"default": function _default(scope) {
|
20952
|
-
|
21149
|
+
var _scope$data;
|
21150
|
+
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 : []);
|
20953
21151
|
},
|
20954
21152
|
afterSection: function afterSection() {
|
20955
|
-
var _ctx$slots$appendBott, _ctx$slots2;
|
20956
21153
|
return [(0,external_vue_namespaceObject.createVNode)("div", {
|
20957
|
-
"style": resizeColumnStyle.value,
|
20958
21154
|
"class": resizeColumnClass
|
20959
21155
|
}, null), (0,external_vue_namespaceObject.createVNode)("div", {
|
20960
|
-
"
|
20961
|
-
|
20962
|
-
}, [fixedRows === null || fixedRows === void 0 ? void 0 : fixedRows()]), (0,external_vue_namespaceObject.createVNode)("div", null, [(_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", {
|
20963
|
-
"style": fixedWrapperStyle.value,
|
20964
|
-
"class": fixedBottomRow
|
20965
|
-
}, [loadingRow === null || loadingRow === void 0 ? void 0 : loadingRow()])];
|
21156
|
+
"class": fixedWrapperClass
|
21157
|
+
}, [fixedRows === null || fixedRows === void 0 ? void 0 : fixedRows()])];
|
20966
21158
|
}
|
20967
21159
|
});
|
20968
21160
|
};
|
@@ -20977,11 +21169,15 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20977
21169
|
fixedColumns.length = 0;
|
20978
21170
|
fixedColumns.push.apply(fixedColumns, _toConsumableArray(values));
|
20979
21171
|
};
|
21172
|
+
var renderFixedBottom = function renderFixedBottom() {
|
21173
|
+
return getFixedBottomRender();
|
21174
|
+
};
|
20980
21175
|
return {
|
20981
21176
|
renderContainer: renderContainer,
|
20982
21177
|
renderHeader: renderHeader,
|
20983
21178
|
renderBody: renderBody,
|
20984
21179
|
renderFooter: renderFooter,
|
21180
|
+
renderFixedBottom: renderFixedBottom,
|
20985
21181
|
setBodyHeight: setBodyHeight,
|
20986
21182
|
setFootHeight: setFootHeight,
|
20987
21183
|
setTranslateX: setTranslateX,
|
@@ -20989,6 +21185,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20989
21185
|
setFixedColumns: setFixedColumns,
|
20990
21186
|
setOffsetRight: setOffsetRight,
|
20991
21187
|
setLineHeight: setLineHeight,
|
21188
|
+
initRootStyleVars: initRootStyleVars,
|
20992
21189
|
refRoot: refRoot,
|
20993
21190
|
refHead: refHead,
|
20994
21191
|
refBody: refBody,
|
@@ -21096,6 +21293,9 @@ var usePagination = function usePagination(props) {
|
|
21096
21293
|
* 如果手动禁用分页,则禁用前端分页,否则启用前端分页
|
21097
21294
|
*/
|
21098
21295
|
var isEnabled = (0,external_vue_namespaceObject.ref)(true);
|
21296
|
+
var totalPage = (0,external_vue_namespaceObject.computed)(function () {
|
21297
|
+
return Math.ceil(pagination.count / pagination.limit);
|
21298
|
+
});
|
21099
21299
|
var setPagination = function setPagination(option) {
|
21100
21300
|
Object.assign(pagination, {
|
21101
21301
|
enabled: !!props.pagination
|
@@ -21103,7 +21303,7 @@ var usePagination = function usePagination(props) {
|
|
21103
21303
|
/**
|
21104
21304
|
* 如果分页组件启用了前端分页,则重置分页组件数据
|
21105
21305
|
*/
|
21106
|
-
if (pagination.current
|
21306
|
+
if (pagination.current > totalPage.value) {
|
21107
21307
|
pagination.current = 1;
|
21108
21308
|
}
|
21109
21309
|
};
|
@@ -21115,7 +21315,7 @@ var usePagination = function usePagination(props) {
|
|
21115
21315
|
return [props.pagination];
|
21116
21316
|
}, function () {
|
21117
21317
|
if (typeof_typeof(props.pagination) === 'object') {
|
21118
|
-
setPagination(props.pagination);
|
21318
|
+
setPagination((0,external_vue_namespaceObject.toRaw)(props.pagination));
|
21119
21319
|
}
|
21120
21320
|
/**
|
21121
21321
|
* 分页组件是否启用
|
@@ -21123,7 +21323,8 @@ var usePagination = function usePagination(props) {
|
|
21123
21323
|
*/
|
21124
21324
|
pagination.enabled = isEnabled.value && !!props.pagination;
|
21125
21325
|
}, {
|
21126
|
-
immediate: true
|
21326
|
+
immediate: true,
|
21327
|
+
deep: true
|
21127
21328
|
});
|
21128
21329
|
(0,external_vue_namespaceObject.watch)(function () {
|
21129
21330
|
return [props.data];
|
@@ -21154,18 +21355,6 @@ var usePagination = function usePagination(props) {
|
|
21154
21355
|
};
|
21155
21356
|
};
|
21156
21357
|
/* harmony default export */ const use_pagination = (usePagination);
|
21157
|
-
;// CONCATENATED MODULE: external "../checkbox"
|
21158
|
-
var checkbox_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21159
|
-
var checkbox_y = x => () => x
|
21160
|
-
const checkbox_namespaceObject = checkbox_x({ ["BkCheckboxGroup"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__.BkCheckboxGroup, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__["default"] });
|
21161
|
-
;// CONCATENATED MODULE: external "../checkbox/checkbox.less"
|
21162
|
-
var checkbox_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21163
|
-
var checkbox_less_y = x => () => x
|
21164
|
-
const checkbox_less_namespaceObject = checkbox_less_x({ });
|
21165
|
-
;// CONCATENATED MODULE: external "../icon"
|
21166
|
-
var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21167
|
-
var icon_y = x => () => x
|
21168
|
-
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 });
|
21169
21358
|
;// CONCATENATED MODULE: external "../pagination"
|
21170
21359
|
var pagination_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21171
21360
|
var pagination_y = x => () => x
|
@@ -21302,7 +21491,8 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
|
|
21302
21491
|
var isTipsEnabled = (0,external_vue_namespaceObject.ref)(false);
|
21303
21492
|
var cellStyle = (0,external_vue_namespaceObject.computed)(function () {
|
21304
21493
|
return {
|
21305
|
-
textAlign: props.column.textAlign
|
21494
|
+
textAlign: props.column.textAlign,
|
21495
|
+
minWidth: resolveNumberOrStringToPix(props.column.minWidth, null)
|
21306
21496
|
};
|
21307
21497
|
});
|
21308
21498
|
var resolveSetting = function resolveSetting() {
|
@@ -21321,12 +21511,12 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
|
|
21321
21511
|
mode: mode,
|
21322
21512
|
resizerWay: undefined,
|
21323
21513
|
watchCellResize: undefined,
|
21324
|
-
popoverOption: popoverOption
|
21514
|
+
popoverOption: popoverOption,
|
21515
|
+
allowHtml: false
|
21325
21516
|
}
|
21326
21517
|
};
|
21327
21518
|
if (props.parentSetting !== null && typeof_typeof(props.parentSetting) === 'object') {
|
21328
|
-
Object.assign(result.showOverflowTooltip, props.parentSetting
|
21329
|
-
Object.assign(result.showOverflowTooltip, {
|
21519
|
+
Object.assign(result.showOverflowTooltip, props.parentSetting, {
|
21330
21520
|
disabled: !props.column.showOverflowTooltip
|
21331
21521
|
});
|
21332
21522
|
if (typeof_typeof(props.column.showOverflowTooltip) === 'object') {
|
@@ -21340,14 +21530,23 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
|
|
21340
21530
|
};
|
21341
21531
|
};
|
21342
21532
|
var bkEllipsisIns = null;
|
21533
|
+
var getContentValue = function getContentValue() {
|
21534
|
+
var _target$innerText;
|
21535
|
+
var allowHtml = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
21536
|
+
var target = getEllipsisTarget();
|
21537
|
+
if (allowHtml) {
|
21538
|
+
var _target$cloneNode, _target$cloneNode2;
|
21539
|
+
return (_target$cloneNode = target === null || target === void 0 || (_target$cloneNode2 = target.cloneNode) === null || _target$cloneNode2 === void 0 ? void 0 : _target$cloneNode2.call(target, true)) !== null && _target$cloneNode !== void 0 ? _target$cloneNode : '';
|
21540
|
+
}
|
21541
|
+
return (_target$innerText = target === null || target === void 0 ? void 0 : target.innerText) !== null && _target$innerText !== void 0 ? _target$innerText : '';
|
21542
|
+
};
|
21343
21543
|
var resolveTooltipOption = function resolveTooltipOption() {
|
21344
|
-
var _getEllipsisTarget$cl, _getEllipsisTarget, _getEllipsisTarget$cl2;
|
21345
21544
|
var _resolveSetting = resolveSetting(),
|
21346
21545
|
_resolveSetting$showO = _resolveSetting.showOverflowTooltip,
|
21347
21546
|
showOverflowTooltip = _resolveSetting$showO === void 0 ? false : _resolveSetting$showO;
|
21348
21547
|
var disabled = true;
|
21349
21548
|
var resizerWay = props.resizerWay;
|
21350
|
-
var defaultContent = (
|
21549
|
+
var defaultContent = getContentValue(showOverflowTooltip.allowHtml);
|
21351
21550
|
var content = function content() {
|
21352
21551
|
return defaultContent;
|
21353
21552
|
};
|
@@ -21392,8 +21591,8 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
|
|
21392
21591
|
disabled = !((_props$column$showOve5 = (_props$column = props.column) === null || _props$column === void 0 || (_props$column = _props$column.showOverflowTooltip) === null || _props$column === void 0 ? void 0 : _props$column.showHead) !== null && _props$column$showOve5 !== void 0 ? _props$column$showOve5 : true);
|
21393
21592
|
mode = 'auto';
|
21394
21593
|
content = function content() {
|
21395
|
-
var _getEllipsisTarget$
|
21396
|
-
return (_getEllipsisTarget$
|
21594
|
+
var _getEllipsisTarget$cl, _getEllipsisTarget, _getEllipsisTarget$cl2;
|
21595
|
+
return (_getEllipsisTarget$cl = (_getEllipsisTarget = getEllipsisTarget()) === null || _getEllipsisTarget === void 0 || (_getEllipsisTarget$cl2 = _getEllipsisTarget.cloneNode) === null || _getEllipsisTarget$cl2 === void 0 ? void 0 : _getEllipsisTarget$cl2.call(_getEllipsisTarget, true)) !== null && _getEllipsisTarget$cl !== void 0 ? _getEllipsisTarget$cl : '';
|
21397
21596
|
};
|
21398
21597
|
if (props.headExplain) {
|
21399
21598
|
mode = 'static';
|
@@ -21518,6 +21717,14 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
|
|
21518
21717
|
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)]);
|
21519
21718
|
}
|
21520
21719
|
}));
|
21720
|
+
;// CONCATENATED MODULE: external "../checkbox"
|
21721
|
+
var checkbox_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21722
|
+
var checkbox_y = x => () => x
|
21723
|
+
const checkbox_namespaceObject = checkbox_x({ ["BkCheckboxGroup"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__.BkCheckboxGroup, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__["default"] });
|
21724
|
+
;// CONCATENATED MODULE: external "../checkbox/checkbox.less"
|
21725
|
+
var checkbox_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21726
|
+
var checkbox_less_y = x => () => x
|
21727
|
+
const checkbox_less_namespaceObject = checkbox_less_x({ });
|
21521
21728
|
;// CONCATENATED MODULE: external "../button"
|
21522
21729
|
var button_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21523
21730
|
var button_y = x => () => x
|
@@ -21526,6 +21733,10 @@ const button_namespaceObject = button_x({ ["default"]: () => __WEBPACK_EXTERNAL_
|
|
21526
21733
|
var button_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21527
21734
|
var button_less_y = x => () => x
|
21528
21735
|
const button_less_namespaceObject = button_less_x({ });
|
21736
|
+
;// CONCATENATED MODULE: external "../icon"
|
21737
|
+
var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21738
|
+
var icon_y = x => () => x
|
21739
|
+
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 });
|
21529
21740
|
;// CONCATENATED MODULE: external "../input"
|
21530
21741
|
var input_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
21531
21742
|
var input_y = x => () => x
|
@@ -21616,14 +21827,6 @@ var ROW_HEIGHT = 32;
|
|
21616
21827
|
isOpen: false,
|
21617
21828
|
checked: checked.value
|
21618
21829
|
});
|
21619
|
-
(0,external_vue_namespaceObject.watch)(function () {
|
21620
|
-
return filter.value;
|
21621
|
-
}, function () {
|
21622
|
-
state.checked = checked.value;
|
21623
|
-
}, {
|
21624
|
-
immediate: true,
|
21625
|
-
deep: true
|
21626
|
-
});
|
21627
21830
|
var headClass = (0,external_vue_namespaceObject.computed)(function () {
|
21628
21831
|
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));
|
21629
21832
|
});
|
@@ -21643,7 +21846,8 @@ var ROW_HEIGHT = 32;
|
|
21643
21846
|
var _filter$value$list = filter.value.list,
|
21644
21847
|
list = _filter$value$list === void 0 ? [] : _filter$value$list;
|
21645
21848
|
var filterList = list.filter(function (l) {
|
21646
|
-
|
21849
|
+
var reg = getRegExp(searchValue.value);
|
21850
|
+
return reg.test(l.label) || reg.test(l.value);
|
21647
21851
|
});
|
21648
21852
|
return filterList;
|
21649
21853
|
});
|
@@ -22227,7 +22431,9 @@ function use_head_isSlot(s) {
|
|
22227
22431
|
getTH: getTH
|
22228
22432
|
};
|
22229
22433
|
});
|
22230
|
-
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-
|
22434
|
+
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-cell.tsx
|
22435
|
+
|
22436
|
+
|
22231
22437
|
/*
|
22232
22438
|
* Tencent is pleased to support the open source community by making
|
22233
22439
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
@@ -22254,72 +22460,316 @@ function use_head_isSlot(s) {
|
|
22254
22460
|
* IN THE SOFTWARE.
|
22255
22461
|
*/
|
22256
22462
|
|
22257
|
-
|
22258
|
-
|
22259
|
-
|
22260
|
-
|
22261
|
-
|
22262
|
-
|
22263
|
-
|
22264
|
-
|
22265
|
-
|
22266
|
-
|
22267
|
-
|
22268
|
-
|
22269
|
-
|
22270
|
-
|
22271
|
-
|
22272
|
-
|
22273
|
-
|
22274
|
-
var
|
22275
|
-
|
22276
|
-
|
22277
|
-
|
22278
|
-
|
22279
|
-
|
22280
|
-
|
22281
|
-
|
22282
|
-
|
22283
|
-
|
22284
|
-
|
22285
|
-
|
22286
|
-
|
22287
|
-
|
22288
|
-
|
22289
|
-
|
22290
|
-
|
22291
|
-
|
22292
|
-
|
22293
|
-
|
22294
|
-
|
22295
|
-
|
22296
|
-
|
22297
|
-
|
22298
|
-
|
22299
|
-
|
22300
|
-
|
22301
|
-
|
22302
|
-
|
22303
|
-
|
22304
|
-
|
22305
|
-
|
22306
|
-
|
22307
|
-
|
22308
|
-
|
22309
|
-
|
22310
|
-
|
22311
|
-
|
22463
|
+
|
22464
|
+
|
22465
|
+
|
22466
|
+
|
22467
|
+
|
22468
|
+
|
22469
|
+
/* harmony default export */ const use_cell = (function (_ref) {
|
22470
|
+
var props = _ref.props,
|
22471
|
+
rows = _ref.rows,
|
22472
|
+
ctx = _ref.ctx,
|
22473
|
+
columns = _ref.columns,
|
22474
|
+
row = _ref.row,
|
22475
|
+
index = _ref.index,
|
22476
|
+
column = _ref.column,
|
22477
|
+
_ref$isChild = _ref.isChild,
|
22478
|
+
isChild = _ref$isChild === void 0 ? false : _ref$isChild,
|
22479
|
+
multiShiftKey = _ref.multiShiftKey;
|
22480
|
+
var isShiftKeyDown = multiShiftKey.isShiftKeyDown,
|
22481
|
+
getStore = multiShiftKey.getStore,
|
22482
|
+
setStore = multiShiftKey.setStore,
|
22483
|
+
setStoreStart = multiShiftKey.setStoreStart,
|
22484
|
+
clearStoreStart = multiShiftKey.clearStoreStart;
|
22485
|
+
var renderCheckboxColumn = function renderCheckboxColumn() {
|
22486
|
+
var handleChecked = function handleChecked(value, event) {
|
22487
|
+
event.stopImmediatePropagation();
|
22488
|
+
event.preventDefault();
|
22489
|
+
event.stopPropagation();
|
22490
|
+
if (!isShiftKeyDown.value) {
|
22491
|
+
if (value) {
|
22492
|
+
setStoreStart(row, index);
|
22493
|
+
} else {
|
22494
|
+
clearStoreStart();
|
22495
|
+
}
|
22496
|
+
}
|
22497
|
+
rows.setRowSelection(row, value);
|
22498
|
+
columns.setColumnAttribute(column, COLUMN_ATTRIBUTE.SELECTION_INDETERMINATE, rows.getRowIndeterminate());
|
22499
|
+
columns.setColumnAttribute(column, COLUMN_ATTRIBUTE.SELECTION_VAL, rows.getRowCheckedAllValue());
|
22500
|
+
ctx.emit(EMIT_EVENTS.ROW_SELECT, {
|
22501
|
+
row: row,
|
22502
|
+
index: index,
|
22503
|
+
checked: value,
|
22504
|
+
data: props.data
|
22505
|
+
});
|
22506
|
+
ctx.emit(EMIT_EVENTS.ROW_SELECT_CHANGE, {
|
22507
|
+
row: row,
|
22508
|
+
index: index,
|
22509
|
+
checked: value,
|
22510
|
+
data: props.data
|
22511
|
+
});
|
22512
|
+
};
|
22513
|
+
var beforeRowChange = function beforeRowChange() {
|
22514
|
+
if (isShiftKeyDown.value) {
|
22515
|
+
var result = setStore(row, index);
|
22516
|
+
if (result) {
|
22517
|
+
var _rows$pageRowList$sli;
|
22518
|
+
var _getStore = getStore(),
|
22519
|
+
start = _getStore.start,
|
22520
|
+
end = _getStore.end;
|
22521
|
+
var startIndex = start.index < end.index ? start.index : end.index;
|
22522
|
+
var endIndex = start.index < end.index ? end.index : start.index;
|
22523
|
+
((_rows$pageRowList$sli = rows.pageRowList.slice(startIndex, endIndex + 1)) !== null && _rows$pageRowList$sli !== void 0 ? _rows$pageRowList$sli : []).forEach(function (item) {
|
22524
|
+
var isRowEnabled = isRowSelectEnable(props, {
|
22525
|
+
row: row,
|
22526
|
+
index: index,
|
22527
|
+
isCheckAll: false
|
22528
|
+
});
|
22529
|
+
isRowEnabled && rows.setRowSelection(item, true);
|
22530
|
+
});
|
22531
|
+
}
|
22532
|
+
ctx.emit(EMIT_EVENTS.ROW_SELECT, {
|
22533
|
+
row: row,
|
22534
|
+
index: index,
|
22535
|
+
checked: true,
|
22536
|
+
data: props.data,
|
22537
|
+
isShiftKeyDown: true
|
22538
|
+
});
|
22539
|
+
ctx.emit(EMIT_EVENTS.ROW_SELECT_CHANGE, {
|
22540
|
+
row: row,
|
22541
|
+
index: index,
|
22542
|
+
checked: true,
|
22543
|
+
data: props.data,
|
22544
|
+
isShiftKeyDown: true
|
22545
|
+
});
|
22546
|
+
return Promise.resolve(!result);
|
22547
|
+
}
|
22548
|
+
return Promise.resolve(true);
|
22549
|
+
};
|
22550
|
+
var indeterminate = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION_INDETERMINATE);
|
22551
|
+
var isChecked = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION);
|
22552
|
+
var isEnable = isRowSelectEnable(props, {
|
22553
|
+
row: row,
|
22554
|
+
index: index,
|
22555
|
+
isCheckAll: false
|
22556
|
+
});
|
22557
|
+
return (0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject["default"], {
|
22558
|
+
"beforeChange": beforeRowChange,
|
22559
|
+
"disabled": !isEnable,
|
22560
|
+
"indeterminate": indeterminate,
|
22561
|
+
"modelValue": isChecked,
|
22562
|
+
"onChange": handleChecked
|
22563
|
+
}, null);
|
22564
|
+
};
|
22565
|
+
/**
|
22566
|
+
* 渲染表格Cell内容
|
22567
|
+
* @param row 当前行
|
22568
|
+
* @param column 当前列
|
22569
|
+
* @param index 当前列
|
22570
|
+
* @param rows 当前列
|
22571
|
+
* @returns
|
22572
|
+
*/
|
22573
|
+
var renderCell = function renderCell() {
|
22574
|
+
var _renderFn$column$type, _renderFn$column$type2;
|
22575
|
+
var defaultFn = function defaultFn() {
|
22576
|
+
var type = resolvePropVal(column, 'type', [column, row]);
|
22577
|
+
if (type === 'index') {
|
22578
|
+
return rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_INDEX);
|
22579
|
+
}
|
22580
|
+
var key = resolvePropVal(column, 'field', [column, row]);
|
22581
|
+
var cell = getRowText(row, key);
|
22582
|
+
if (typeof column.render === 'function') {
|
22583
|
+
return renderCellCallbackFn();
|
22584
|
+
}
|
22585
|
+
if (typeof cell === 'boolean') {
|
22586
|
+
return String(cell);
|
22587
|
+
}
|
22588
|
+
if (!cell && typeof cell !== 'number') {
|
22589
|
+
var emptyCellText = props.emptyCellText;
|
22590
|
+
if (emptyCellText) {
|
22591
|
+
if (typeof emptyCellText === 'function') {
|
22592
|
+
return emptyCellText(row, column, index, rows.tableRowList.value);
|
22593
|
+
}
|
22594
|
+
return emptyCellText;
|
22595
|
+
}
|
22596
|
+
}
|
22597
|
+
if (typeof_typeof(cell) === 'object') {
|
22598
|
+
return JSON.stringify((0,external_vue_namespaceObject.unref)(cell));
|
22599
|
+
}
|
22600
|
+
return cell;
|
22601
|
+
};
|
22602
|
+
var renderFn = {
|
22603
|
+
expand: function expand() {
|
22604
|
+
return isChild ? '' : renderExpandColumn();
|
22605
|
+
},
|
22606
|
+
selection: function selection() {
|
22607
|
+
return renderCheckboxColumn();
|
22608
|
+
},
|
22609
|
+
drag: renderDraggableCell
|
22610
|
+
};
|
22611
|
+
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();
|
22612
|
+
};
|
22613
|
+
var renderCellCallbackFn = function renderCellCallbackFn() {
|
22614
|
+
var cell = getRowText(row, resolvePropVal(column, 'field', [column, row]));
|
22615
|
+
var data = row;
|
22616
|
+
return column.render({
|
22617
|
+
cell: cell,
|
22618
|
+
data: data,
|
22619
|
+
row: row,
|
22620
|
+
column: column,
|
22621
|
+
index: index,
|
22622
|
+
rows: rows.tableRowList.value
|
22623
|
+
});
|
22624
|
+
};
|
22625
|
+
var getExpandCell = function getExpandCell() {
|
22626
|
+
var _ctx$slots$expandCont, _ctx$slots$expandCont2, _ctx$slots;
|
22627
|
+
var isExpand = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND);
|
22628
|
+
var icon = isExpand ? (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.DownShape, null, null) : (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.RightShape, null, null);
|
22629
|
+
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 : '']]);
|
22630
|
+
};
|
22631
|
+
var handleRowExpandClick = function handleRowExpandClick(e) {
|
22632
|
+
rows.setRowExpand(row, !rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND));
|
22633
|
+
ctx.emit(EMIT_EVENTS.ROW_EXPAND_CLICK, {
|
22634
|
+
row: row,
|
22635
|
+
column: column,
|
22636
|
+
index: index,
|
22637
|
+
rows: rows.tableRowList.value,
|
22638
|
+
e: e
|
22639
|
+
});
|
22640
|
+
};
|
22641
|
+
var renderExpandColumn = function renderExpandColumn() {
|
22642
|
+
var renderExpandSlot = function renderExpandSlot() {
|
22643
|
+
var _ctx$slots$expandCell, _ctx$slots$expandCell2, _ctx$slots2;
|
22644
|
+
if (typeof column.render === 'function') {
|
22645
|
+
return renderCellCallbackFn();
|
22646
|
+
}
|
22647
|
+
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, {
|
22648
|
+
row: row,
|
22649
|
+
column: column,
|
22650
|
+
index: index,
|
22651
|
+
rows: rows
|
22652
|
+
})) !== null && _ctx$slots$expandCell !== void 0 ? _ctx$slots$expandCell : getExpandCell();
|
22653
|
+
};
|
22654
|
+
return (0,external_vue_namespaceObject.createVNode)("span", {
|
22655
|
+
"class": "expand-btn-action",
|
22656
|
+
"onClick": function onClick(e) {
|
22657
|
+
return handleRowExpandClick(e);
|
22658
|
+
}
|
22659
|
+
}, [renderExpandSlot()]);
|
22660
|
+
};
|
22661
|
+
var renderDraggableCell = function renderDraggableCell() {
|
22662
|
+
var _props$rowDraggable$r, _props$rowDraggable, _props$rowDraggable$f, _props$rowDraggable2, _props$rowDraggable$i, _props$rowDraggable3;
|
22663
|
+
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;
|
22664
|
+
if (typeof renderFn === 'function') {
|
22665
|
+
return renderFn(row, column, index, rows.tableRowList.value);
|
22312
22666
|
}
|
22313
|
-
|
22667
|
+
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';
|
22668
|
+
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, {
|
22669
|
+
"style": "'--font-size: ".concat(fontSize, ";'"),
|
22670
|
+
"class": "drag-cell"
|
22671
|
+
}, null);
|
22672
|
+
return fontIcon;
|
22673
|
+
};
|
22674
|
+
return {
|
22675
|
+
renderCell: renderCell
|
22676
|
+
};
|
22677
|
+
});
|
22678
|
+
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-shift-key.tsx
|
22679
|
+
/*
|
22680
|
+
* Tencent is pleased to support the open source community by making
|
22681
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
22682
|
+
*
|
22683
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
22684
|
+
*
|
22685
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
22686
|
+
*
|
22687
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
22688
|
+
*
|
22689
|
+
* ---------------------------------------------------
|
22690
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
22691
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
22692
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
22693
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
22694
|
+
*
|
22695
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
22696
|
+
* the Software.
|
22697
|
+
*
|
22698
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
22699
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22700
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
22701
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
22702
|
+
* IN THE SOFTWARE.
|
22703
|
+
*/
|
22704
|
+
|
22705
|
+
var multiShiftKey = function multiShiftKey(props) {
|
22706
|
+
var isShiftKeyDown = (0,external_vue_namespaceObject.ref)(false);
|
22707
|
+
var store = {
|
22708
|
+
start: null,
|
22709
|
+
end: null
|
22710
|
+
};
|
22711
|
+
var handleKeyDown = function handleKeyDown(e) {
|
22712
|
+
if (e.key === 'Shift') {
|
22713
|
+
isShiftKeyDown.value = true;
|
22714
|
+
}
|
22715
|
+
};
|
22716
|
+
var handleKeyUp = function handleKeyUp(e) {
|
22717
|
+
if (e.key === 'Shift') {
|
22718
|
+
isShiftKeyDown.value = false;
|
22719
|
+
clearStore();
|
22720
|
+
}
|
22721
|
+
};
|
22722
|
+
var setStoreStart = function setStoreStart(row, index) {
|
22723
|
+
store.start = {
|
22724
|
+
index: index !== null && index !== void 0 ? index : null,
|
22725
|
+
row: row !== null && row !== void 0 ? row : null
|
22726
|
+
};
|
22727
|
+
};
|
22728
|
+
var clearStoreStart = function clearStoreStart() {
|
22729
|
+
setStoreStart();
|
22730
|
+
};
|
22731
|
+
var setStore = function setStore(row, index) {
|
22732
|
+
if (store.start === null && store.end === null) {
|
22733
|
+
store.start = {
|
22734
|
+
index: index,
|
22735
|
+
row: row
|
22736
|
+
};
|
22737
|
+
return false;
|
22738
|
+
}
|
22739
|
+
store.end = {
|
22740
|
+
index: index,
|
22741
|
+
row: row
|
22742
|
+
};
|
22743
|
+
return true;
|
22744
|
+
};
|
22745
|
+
var clearStore = function clearStore() {
|
22746
|
+
store.start = null;
|
22747
|
+
store.end = null;
|
22748
|
+
};
|
22749
|
+
if (props.shiftMultiChecked) {
|
22750
|
+
window.addEventListener('keydown', handleKeyDown);
|
22751
|
+
window.addEventListener('keyup', handleKeyUp);
|
22752
|
+
}
|
22753
|
+
var getStore = function getStore() {
|
22754
|
+
return store;
|
22755
|
+
};
|
22756
|
+
var removeMultiCheckedEvents = function removeMultiCheckedEvents() {
|
22757
|
+
if (props.shiftMultiChecked) {
|
22758
|
+
window.removeEventListener('keydown', handleKeyDown);
|
22759
|
+
window.removeEventListener('keyup', handleKeyUp);
|
22760
|
+
}
|
22761
|
+
};
|
22314
22762
|
return {
|
22315
22763
|
isShiftKeyDown: isShiftKeyDown,
|
22316
22764
|
setStore: setStore,
|
22317
22765
|
getStore: getStore,
|
22318
22766
|
clearStore: clearStore,
|
22319
22767
|
setStoreStart: setStoreStart,
|
22320
|
-
clearStoreStart: clearStoreStart
|
22768
|
+
clearStoreStart: clearStoreStart,
|
22769
|
+
removeMultiCheckedEvents: removeMultiCheckedEvents
|
22321
22770
|
};
|
22322
|
-
}
|
22771
|
+
};
|
22772
|
+
/* harmony default export */ const use_shift_key = (multiShiftKey);
|
22323
22773
|
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-render.tsx
|
22324
22774
|
|
22325
22775
|
|
@@ -22363,8 +22813,6 @@ function use_head_isSlot(s) {
|
|
22363
22813
|
|
22364
22814
|
|
22365
22815
|
|
22366
|
-
|
22367
|
-
|
22368
22816
|
function use_render_isSlot(s) {
|
22369
22817
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
|
22370
22818
|
}
|
@@ -22378,6 +22826,7 @@ function use_render_isSlot(s) {
|
|
22378
22826
|
var t = (0,config_provider_namespaceObject.useLocale)('table');
|
22379
22827
|
var uuid = esm_browser_v4();
|
22380
22828
|
var dragEvents = {};
|
22829
|
+
var multiShiftKey = use_shift_key(props);
|
22381
22830
|
/**
|
22382
22831
|
* 渲染table colgroup
|
22383
22832
|
* @returns
|
@@ -22388,9 +22837,9 @@ function use_render_isSlot(s) {
|
|
22388
22837
|
var minWidth = columns.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_MIN_WIDTH);
|
22389
22838
|
return (0,external_vue_namespaceObject.createVNode)("col", {
|
22390
22839
|
"style": {
|
22840
|
+
width: resolveNumberOrStringToPix(width, 'auto'),
|
22391
22841
|
minWidth: resolveNumberOrStringToPix(minWidth, 'auto')
|
22392
|
-
}
|
22393
|
-
"width": width
|
22842
|
+
}
|
22394
22843
|
}, null);
|
22395
22844
|
})]);
|
22396
22845
|
};
|
@@ -22420,294 +22869,98 @@ function use_render_isSlot(s) {
|
|
22420
22869
|
}),
|
22421
22870
|
getTH = _useHead.getTH;
|
22422
22871
|
return getTH();
|
22423
|
-
})])];
|
22424
|
-
}
|
22425
|
-
})])]);
|
22426
|
-
};
|
22427
|
-
var renderColumns = function renderColumns() {
|
22428
|
-
if (!props.showHead) {
|
22429
|
-
return null;
|
22430
|
-
}
|
22431
|
-
return (0,external_vue_namespaceObject.createVNode)("table", {
|
22432
|
-
"cellpadding": 0,
|
22433
|
-
"cellspacing": 0
|
22434
|
-
}, [renderColgroup(), renderHeader()]);
|
22435
|
-
};
|
22436
|
-
/** **************************************** Rows Render ******************************* **/
|
22437
|
-
/**
|
22438
|
-
* 渲染Table Body
|
22439
|
-
* @returns
|
22440
|
-
*/
|
22441
|
-
var renderRows = function renderRows(dataList) {
|
22442
|
-
var preRow = {};
|
22443
|
-
var rowSpanMap = new WeakMap();
|
22444
|
-
var needRowSpan = columns.needRowSpan.value;
|
22445
|
-
return (0,external_vue_namespaceObject.createVNode)("tbody", null, [dataList.map(function (row, rowIndex) {
|
22446
|
-
var result = getRowRender(row, rowIndex, preRow, dataList, rowSpanMap, needRowSpan);
|
22447
|
-
preRow = row;
|
22448
|
-
return result;
|
22449
|
-
})]);
|
22450
|
-
};
|
22451
|
-
var getRowHeight = function getRowHeight(row, rowIndex) {
|
22452
|
-
var _settings$options = settings.options,
|
22453
|
-
size = _settings$options.size,
|
22454
|
-
height = _settings$options.height;
|
22455
|
-
if (height !== null && height !== undefined) {
|
22456
|
-
return resolvePropVal(settings.options, 'height', ['tbody', row, rowIndex, size]);
|
22457
|
-
}
|
22458
|
-
return resolvePropVal(props, 'rowHeight', ['tbody', row, rowIndex]);
|
22459
|
-
};
|
22460
|
-
var setDragEvents = function setDragEvents(events) {
|
22461
|
-
dragEvents = events;
|
22462
|
-
};
|
22463
|
-
/**
|
22464
|
-
* 渲染Table主体
|
22465
|
-
* @param rows 表格数据
|
22466
|
-
* @returns
|
22467
|
-
*/
|
22468
|
-
var renderTBody = function renderTBody(list) {
|
22469
|
-
var dataList = list !== null && list !== void 0 ? list : rows.pageRowList;
|
22470
|
-
var localEmptyText = (0,external_vue_namespaceObject.computed)(function () {
|
22471
|
-
if (props.emptyText === undefined) {
|
22472
|
-
return t.value.emptyText;
|
22473
|
-
}
|
22474
|
-
return props.emptyText;
|
22475
|
-
});
|
22476
|
-
if (!dataList.length) {
|
22477
|
-
var _ctx$slots$empty, _ctx$slots$empty2, _ctx$slots;
|
22478
|
-
return (_ctx$slots$empty = (_ctx$slots$empty2 = (_ctx$slots = ctx.slots).empty) === null || _ctx$slots$empty2 === void 0 ? void 0 : _ctx$slots$empty2.call(_ctx$slots)) !== null && _ctx$slots$empty !== void 0 ? _ctx$slots$empty : (0,external_vue_namespaceObject.createVNode)(body_empty, {
|
22479
|
-
"emptyText": localEmptyText.value,
|
22480
|
-
"filterList": dataList,
|
22481
|
-
"list": props.data
|
22482
|
-
}, null);
|
22483
|
-
}
|
22484
|
-
return (0,external_vue_namespaceObject.createVNode)("table", {
|
22485
|
-
"cellpadding": 0,
|
22486
|
-
"cellspacing": 0,
|
22487
|
-
"data-table-uuid": uuid
|
22488
|
-
}, [renderColgroup(), renderRows(dataList)]);
|
22489
|
-
};
|
22490
|
-
/**
|
22491
|
-
* table row click handle
|
22492
|
-
* @param e
|
22493
|
-
* @param row
|
22494
|
-
* @param index
|
22495
|
-
* @param rows
|
22496
|
-
*/
|
22497
|
-
var handleRowClick = function handleRowClick(e, row, index, rows) {
|
22498
|
-
ctx.emit(EMIT_EVENTS.ROW_CLICK, e, row, index, rows);
|
22499
|
-
};
|
22500
|
-
/**
|
22501
|
-
* table row click handle
|
22502
|
-
* @param e
|
22503
|
-
* @param row
|
22504
|
-
* @param index
|
22505
|
-
* @param rows
|
22506
|
-
*/
|
22507
|
-
var handleRowDblClick = function handleRowDblClick(e, row, index, rows) {
|
22508
|
-
ctx.emit(EMIT_EVENTS.ROW_DBL_CLICK, e, row, index, rows);
|
22509
|
-
};
|
22510
|
-
var handleRowEnter = function handleRowEnter(e, row, index, rows) {
|
22511
|
-
ctx.emit(EMIT_EVENTS.ROW_MOUSE_ENTER, e, row, index, rows);
|
22512
|
-
};
|
22513
|
-
var handleRowLeave = function handleRowLeave(e, row, index, rows) {
|
22514
|
-
ctx.emit(EMIT_EVENTS.ROW_MOUSE_LEAVE, e, row, index, rows);
|
22515
|
-
};
|
22516
|
-
var renderCellCallbackFn = function renderCellCallbackFn(row, column, index, rows) {
|
22517
|
-
var cell = getRowText(row, resolvePropVal(column, 'field', [column, row]));
|
22518
|
-
var data = row;
|
22519
|
-
return column.render({
|
22520
|
-
cell: cell,
|
22521
|
-
data: data,
|
22522
|
-
row: row,
|
22523
|
-
column: column,
|
22524
|
-
index: index,
|
22525
|
-
rows: rows
|
22526
|
-
});
|
22527
|
-
};
|
22528
|
-
var getExpandCell = function getExpandCell(row) {
|
22529
|
-
var _ctx$slots$expandCont, _ctx$slots$expandCont2, _ctx$slots2;
|
22530
|
-
var isExpand = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND);
|
22531
|
-
var icon = isExpand ? (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.DownShape, null, null) : (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.RightShape, null, null);
|
22532
|
-
return (0,external_vue_namespaceObject.createVNode)("span", null, [[icon, (_ctx$slots$expandCont = (_ctx$slots$expandCont2 = (_ctx$slots2 = ctx.slots).expandContent) === null || _ctx$slots$expandCont2 === void 0 ? void 0 : _ctx$slots$expandCont2.call(_ctx$slots2, row)) !== null && _ctx$slots$expandCont !== void 0 ? _ctx$slots$expandCont : '']]);
|
22533
|
-
};
|
22534
|
-
var handleRowExpandClick = function handleRowExpandClick(row, column, index, rowList, e) {
|
22535
|
-
rows.setRowExpand(row, !rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND));
|
22536
|
-
ctx.emit(EMIT_EVENTS.ROW_EXPAND_CLICK, {
|
22537
|
-
row: row,
|
22538
|
-
column: column,
|
22539
|
-
index: index,
|
22540
|
-
rows: rowList,
|
22541
|
-
e: e
|
22542
|
-
});
|
22543
|
-
};
|
22544
|
-
var renderExpandColumn = function renderExpandColumn(row, column, index, rows) {
|
22545
|
-
var renderExpandSlot = function renderExpandSlot() {
|
22546
|
-
var _ctx$slots$expandCell, _ctx$slots$expandCell2, _ctx$slots3;
|
22547
|
-
if (typeof column.render === 'function') {
|
22548
|
-
return renderCellCallbackFn(row, column, index, rows);
|
22549
|
-
}
|
22550
|
-
return (_ctx$slots$expandCell = (_ctx$slots$expandCell2 = (_ctx$slots3 = ctx.slots).expandCell) === null || _ctx$slots$expandCell2 === void 0 ? void 0 : _ctx$slots$expandCell2.call(_ctx$slots3, {
|
22551
|
-
row: row,
|
22552
|
-
column: column,
|
22553
|
-
index: index,
|
22554
|
-
rows: rows
|
22555
|
-
})) !== null && _ctx$slots$expandCell !== void 0 ? _ctx$slots$expandCell : getExpandCell(row);
|
22556
|
-
};
|
22557
|
-
return (0,external_vue_namespaceObject.createVNode)("span", {
|
22558
|
-
"class": "expand-btn-action",
|
22559
|
-
"onClick": function onClick(e) {
|
22560
|
-
return handleRowExpandClick(row, column, index, rows, e);
|
22561
|
-
}
|
22562
|
-
}, [renderExpandSlot()]);
|
22563
|
-
};
|
22564
|
-
var renderDraggableCell = function renderDraggableCell(row, column, index, rows) {
|
22565
|
-
var _props$rowDraggable$r, _props$rowDraggable, _props$rowDraggable$f, _props$rowDraggable2, _props$rowDraggable$i, _props$rowDraggable3;
|
22566
|
-
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;
|
22567
|
-
if (typeof renderFn === 'function') {
|
22568
|
-
return renderFn(row, column, index, rows);
|
22569
|
-
}
|
22570
|
-
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';
|
22571
|
-
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, {
|
22572
|
-
"style": "'--font-size: ".concat(fontSize, ";'"),
|
22573
|
-
"class": "drag-cell"
|
22574
|
-
}, null);
|
22575
|
-
return fontIcon;
|
22576
|
-
};
|
22577
|
-
var _useShiftKey = use_shift_key(props),
|
22578
|
-
isShiftKeyDown = _useShiftKey.isShiftKeyDown,
|
22579
|
-
getStore = _useShiftKey.getStore,
|
22580
|
-
setStore = _useShiftKey.setStore,
|
22581
|
-
setStoreStart = _useShiftKey.setStoreStart,
|
22582
|
-
clearStoreStart = _useShiftKey.clearStoreStart;
|
22583
|
-
var renderCheckboxColumn = function renderCheckboxColumn(row, index, column) {
|
22584
|
-
var handleChecked = function handleChecked(value, event) {
|
22585
|
-
event.stopImmediatePropagation();
|
22586
|
-
event.preventDefault();
|
22587
|
-
event.stopPropagation();
|
22588
|
-
if (!isShiftKeyDown.value) {
|
22589
|
-
if (value) {
|
22590
|
-
setStoreStart(row, index);
|
22591
|
-
} else {
|
22592
|
-
clearStoreStart();
|
22593
|
-
}
|
22594
|
-
}
|
22595
|
-
rows.setRowSelection(row, value);
|
22596
|
-
columns.setColumnAttribute(column, COLUMN_ATTRIBUTE.SELECTION_INDETERMINATE, rows.getRowIndeterminate());
|
22597
|
-
columns.setColumnAttribute(column, COLUMN_ATTRIBUTE.SELECTION_VAL, rows.getRowCheckedAllValue());
|
22598
|
-
ctx.emit(EMIT_EVENTS.ROW_SELECT, {
|
22599
|
-
row: row,
|
22600
|
-
index: index,
|
22601
|
-
checked: value,
|
22602
|
-
data: props.data
|
22603
|
-
});
|
22604
|
-
ctx.emit(EMIT_EVENTS.ROW_SELECT_CHANGE, {
|
22605
|
-
row: row,
|
22606
|
-
index: index,
|
22607
|
-
checked: value,
|
22608
|
-
data: props.data
|
22609
|
-
});
|
22610
|
-
};
|
22611
|
-
var beforeRowChange = function beforeRowChange() {
|
22612
|
-
if (isShiftKeyDown.value) {
|
22613
|
-
var result = setStore(row, index);
|
22614
|
-
if (result) {
|
22615
|
-
var _rows$pageRowList$sli;
|
22616
|
-
var _getStore = getStore(),
|
22617
|
-
start = _getStore.start,
|
22618
|
-
end = _getStore.end;
|
22619
|
-
var startIndex = start.index < end.index ? start.index : end.index;
|
22620
|
-
var endIndex = start.index < end.index ? end.index : start.index;
|
22621
|
-
((_rows$pageRowList$sli = rows.pageRowList.slice(startIndex, endIndex + 1)) !== null && _rows$pageRowList$sli !== void 0 ? _rows$pageRowList$sli : []).forEach(function (item) {
|
22622
|
-
var isRowEnabled = isRowSelectEnable(props, {
|
22623
|
-
row: row,
|
22624
|
-
index: index,
|
22625
|
-
isCheckAll: false
|
22626
|
-
});
|
22627
|
-
isRowEnabled && rows.setRowSelection(item, true);
|
22628
|
-
});
|
22629
|
-
}
|
22630
|
-
ctx.emit(EMIT_EVENTS.ROW_SELECT, {
|
22631
|
-
row: row,
|
22632
|
-
index: index,
|
22633
|
-
checked: true,
|
22634
|
-
data: props.data,
|
22635
|
-
isShiftKeyDown: true
|
22636
|
-
});
|
22637
|
-
ctx.emit(EMIT_EVENTS.ROW_SELECT_CHANGE, {
|
22638
|
-
row: row,
|
22639
|
-
index: index,
|
22640
|
-
checked: true,
|
22641
|
-
data: props.data,
|
22642
|
-
isShiftKeyDown: true
|
22643
|
-
});
|
22644
|
-
return Promise.resolve(!result);
|
22645
|
-
}
|
22646
|
-
return Promise.resolve(true);
|
22647
|
-
};
|
22648
|
-
var indeterminate = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION_INDETERMINATE);
|
22649
|
-
var isChecked = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION);
|
22650
|
-
var isEnable = isRowSelectEnable(props, {
|
22651
|
-
row: row,
|
22652
|
-
index: index,
|
22653
|
-
isCheckAll: false
|
22654
|
-
});
|
22655
|
-
return (0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject["default"], {
|
22656
|
-
"beforeChange": beforeRowChange,
|
22657
|
-
"disabled": !isEnable,
|
22658
|
-
"indeterminate": indeterminate,
|
22659
|
-
"modelValue": isChecked,
|
22660
|
-
"onChange": handleChecked
|
22661
|
-
}, null);
|
22872
|
+
})])];
|
22873
|
+
}
|
22874
|
+
})])]);
|
22875
|
+
};
|
22876
|
+
var renderColumns = function renderColumns() {
|
22877
|
+
if (!props.showHead) {
|
22878
|
+
return null;
|
22879
|
+
}
|
22880
|
+
return (0,external_vue_namespaceObject.createVNode)("table", {
|
22881
|
+
"cellpadding": 0,
|
22882
|
+
"cellspacing": 0
|
22883
|
+
}, [renderColgroup(), renderHeader()]);
|
22662
22884
|
};
|
22885
|
+
/** **************************************** Rows Render ******************************* **/
|
22663
22886
|
/**
|
22664
|
-
*
|
22665
|
-
* @param row 当前行
|
22666
|
-
* @param column 当前列
|
22667
|
-
* @param index 当前列
|
22668
|
-
* @param rows 当前列
|
22887
|
+
* 渲染Table Body
|
22669
22888
|
* @returns
|
22670
22889
|
*/
|
22671
|
-
var
|
22672
|
-
var
|
22673
|
-
var
|
22674
|
-
var
|
22675
|
-
|
22676
|
-
|
22677
|
-
|
22678
|
-
|
22679
|
-
|
22680
|
-
|
22681
|
-
|
22682
|
-
|
22683
|
-
|
22684
|
-
|
22685
|
-
|
22686
|
-
|
22687
|
-
|
22688
|
-
|
22689
|
-
|
22690
|
-
|
22691
|
-
|
22692
|
-
|
22693
|
-
|
22694
|
-
|
22695
|
-
|
22696
|
-
|
22697
|
-
|
22890
|
+
var renderRows = function renderRows(dataList) {
|
22891
|
+
var preRow = {};
|
22892
|
+
var rowSpanMap = new WeakMap();
|
22893
|
+
var needRowSpan = columns.needRowSpan.value;
|
22894
|
+
return (0,external_vue_namespaceObject.createVNode)("tbody", null, [dataList.map(function (row, rowIndex) {
|
22895
|
+
var result = getRowRender(row, rowIndex, preRow, dataList, rowSpanMap, needRowSpan);
|
22896
|
+
preRow = row;
|
22897
|
+
return result;
|
22898
|
+
})]);
|
22899
|
+
};
|
22900
|
+
var getRowHeight = function getRowHeight(row, rowIndex) {
|
22901
|
+
var _settings$options = settings.options,
|
22902
|
+
size = _settings$options.size,
|
22903
|
+
height = _settings$options.height;
|
22904
|
+
if (height !== null && height !== undefined) {
|
22905
|
+
return resolvePropVal(settings.options, 'height', ['tbody', row, rowIndex, size]);
|
22906
|
+
}
|
22907
|
+
return resolvePropVal(props, 'rowHeight', ['tbody', row, rowIndex]);
|
22908
|
+
};
|
22909
|
+
var setDragEvents = function setDragEvents(events) {
|
22910
|
+
dragEvents = events;
|
22911
|
+
};
|
22912
|
+
/**
|
22913
|
+
* 渲染Table主体
|
22914
|
+
* @param rows 表格数据
|
22915
|
+
* @returns
|
22916
|
+
*/
|
22917
|
+
var renderTBody = function renderTBody(list) {
|
22918
|
+
var dataList = list !== null && list !== void 0 ? list : rows.pageRowList;
|
22919
|
+
var localEmptyText = (0,external_vue_namespaceObject.computed)(function () {
|
22920
|
+
if (props.emptyText === undefined) {
|
22921
|
+
return t.value.emptyText;
|
22698
22922
|
}
|
22699
|
-
return
|
22700
|
-
};
|
22701
|
-
|
22702
|
-
|
22703
|
-
|
22704
|
-
|
22705
|
-
|
22706
|
-
|
22707
|
-
},
|
22708
|
-
|
22709
|
-
|
22710
|
-
|
22923
|
+
return props.emptyText;
|
22924
|
+
});
|
22925
|
+
if (!dataList.length) {
|
22926
|
+
var _ctx$slots$empty, _ctx$slots$empty2, _ctx$slots;
|
22927
|
+
return (_ctx$slots$empty = (_ctx$slots$empty2 = (_ctx$slots = ctx.slots).empty) === null || _ctx$slots$empty2 === void 0 ? void 0 : _ctx$slots$empty2.call(_ctx$slots)) !== null && _ctx$slots$empty !== void 0 ? _ctx$slots$empty : (0,external_vue_namespaceObject.createVNode)(body_empty, {
|
22928
|
+
"emptyText": localEmptyText.value,
|
22929
|
+
"filterList": dataList,
|
22930
|
+
"list": props.data
|
22931
|
+
}, null);
|
22932
|
+
}
|
22933
|
+
return (0,external_vue_namespaceObject.createVNode)("table", {
|
22934
|
+
"cellpadding": 0,
|
22935
|
+
"cellspacing": 0,
|
22936
|
+
"data-table-uuid": uuid
|
22937
|
+
}, [renderColgroup(), renderRows(dataList)]);
|
22938
|
+
};
|
22939
|
+
/**
|
22940
|
+
* table row click handle
|
22941
|
+
* @param e
|
22942
|
+
* @param row
|
22943
|
+
* @param index
|
22944
|
+
* @param rows
|
22945
|
+
*/
|
22946
|
+
var handleRowClick = function handleRowClick(e, row, index, rows) {
|
22947
|
+
ctx.emit(EMIT_EVENTS.ROW_CLICK, e, row, index, rows);
|
22948
|
+
};
|
22949
|
+
/**
|
22950
|
+
* table row click handle
|
22951
|
+
* @param e
|
22952
|
+
* @param row
|
22953
|
+
* @param index
|
22954
|
+
* @param rows
|
22955
|
+
*/
|
22956
|
+
var handleRowDblClick = function handleRowDblClick(e, row, index, rows) {
|
22957
|
+
ctx.emit(EMIT_EVENTS.ROW_DBL_CLICK, e, row, index, rows);
|
22958
|
+
};
|
22959
|
+
var handleRowEnter = function handleRowEnter(e, row, index, rows) {
|
22960
|
+
ctx.emit(EMIT_EVENTS.ROW_MOUSE_ENTER, e, row, index, rows);
|
22961
|
+
};
|
22962
|
+
var handleRowLeave = function handleRowLeave(e, row, index, rows) {
|
22963
|
+
ctx.emit(EMIT_EVENTS.ROW_MOUSE_LEAVE, e, row, index, rows);
|
22711
22964
|
};
|
22712
22965
|
var getRowSpanConfig = function getRowSpanConfig(row, rowIndex, preRow, col, store) {
|
22713
22966
|
var _store$get$get, _store$get;
|
@@ -22793,6 +23046,20 @@ function use_render_isSlot(s) {
|
|
22793
23046
|
'expand-row': rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND),
|
22794
23047
|
'is-last': rowIndex + rowspan >= rowLength
|
22795
23048
|
}]);
|
23049
|
+
var columnKey = "".concat(rowId, "_").concat(index);
|
23050
|
+
var cellKey = "".concat(rowId, "_").concat(index, "_cell");
|
23051
|
+
var _useCell = use_cell({
|
23052
|
+
props: props,
|
23053
|
+
rows: rows,
|
23054
|
+
ctx: ctx,
|
23055
|
+
columns: columns,
|
23056
|
+
row: row,
|
23057
|
+
index: index,
|
23058
|
+
column: column,
|
23059
|
+
isChild: isChild,
|
23060
|
+
multiShiftKey: multiShiftKey
|
23061
|
+
}),
|
23062
|
+
renderCell = _useCell.renderCell;
|
22796
23063
|
var handleEmit = function handleEmit(event, type) {
|
22797
23064
|
var args = {
|
22798
23065
|
event: event,
|
@@ -22800,7 +23067,7 @@ function use_render_isSlot(s) {
|
|
22800
23067
|
column: column,
|
22801
23068
|
cell: {
|
22802
23069
|
getValue: function getValue() {
|
22803
|
-
return renderCell(
|
23070
|
+
return renderCell();
|
22804
23071
|
}
|
22805
23072
|
},
|
22806
23073
|
rowIndex: rowIndex,
|
@@ -22808,14 +23075,13 @@ function use_render_isSlot(s) {
|
|
22808
23075
|
};
|
22809
23076
|
ctx.emit(type, args);
|
22810
23077
|
};
|
22811
|
-
var columnKey = "".concat(rowId, "_").concat(index);
|
22812
|
-
var cellKey = "".concat(rowId, "_").concat(index, "_cell");
|
22813
23078
|
return (0,external_vue_namespaceObject.createVNode)("td", {
|
22814
23079
|
"key": columnKey,
|
22815
23080
|
"style": cellStyle,
|
22816
23081
|
"class": cellClass,
|
22817
23082
|
"colspan": colspan,
|
22818
23083
|
"rowspan": rowspan,
|
23084
|
+
"data-id": columnKey,
|
22819
23085
|
"onClick": function onClick(event) {
|
22820
23086
|
return handleEmit(event, EMIT_EVENTS.CELL_CLICK);
|
22821
23087
|
},
|
@@ -22824,12 +23090,13 @@ function use_render_isSlot(s) {
|
|
22824
23090
|
}
|
22825
23091
|
}, [(0,external_vue_namespaceObject.createVNode)(table_cell, {
|
22826
23092
|
"key": cellKey,
|
23093
|
+
"data-id": cellKey,
|
22827
23094
|
"class": tdCtxClass,
|
22828
23095
|
"column": column,
|
22829
23096
|
"observerResize": props.observerResize,
|
22830
23097
|
"parentSetting": props.showOverflowTooltip,
|
22831
23098
|
"row": row
|
22832
|
-
}, use_render_isSlot(_slot = renderCell(
|
23099
|
+
}, use_render_isSlot(_slot = renderCell()) ? _slot : {
|
22833
23100
|
"default": function _default() {
|
22834
23101
|
return [_slot];
|
22835
23102
|
}
|
@@ -22843,7 +23110,7 @@ function use_render_isSlot(s) {
|
|
22843
23110
|
var renderExpandRow = function renderExpandRow(row, rowClass, _rowIndex) {
|
22844
23111
|
var isExpand = rows.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND);
|
22845
23112
|
if (isExpand) {
|
22846
|
-
var _ctx$slots$expandRow, _ctx$slots$expandRow2, _ctx$
|
23113
|
+
var _ctx$slots$expandRow, _ctx$slots$expandRow2, _ctx$slots2;
|
22847
23114
|
var resovledClass = [].concat(_toConsumableArray(rowClass), [{
|
22848
23115
|
row_expend: true
|
22849
23116
|
}]);
|
@@ -22863,7 +23130,7 @@ function use_render_isSlot(s) {
|
|
22863
23130
|
}, [(0,external_vue_namespaceObject.createVNode)("td", {
|
22864
23131
|
"colspan": columns.visibleColumns.length,
|
22865
23132
|
"rowspan": 1
|
22866
|
-
}, [(_ctx$slots$expandRow = (_ctx$slots$expandRow2 = (_ctx$
|
23133
|
+
}, [(_ctx$slots$expandRow = (_ctx$slots$expandRow2 = (_ctx$slots2 = ctx.slots).expandRow) === null || _ctx$slots$expandRow2 === void 0 ? void 0 : _ctx$slots$expandRow2.call(_ctx$slots2, row)) !== null && _ctx$slots$expandRow !== void 0 ? _ctx$slots$expandRow : (0,external_vue_namespaceObject.createVNode)("div", {
|
22867
23134
|
"class": "expand-cell-ctx"
|
22868
23135
|
}, [(0,external_vue_namespaceObject.createTextVNode)("Expand Row")])])])];
|
22869
23136
|
}
|
@@ -22904,6 +23171,9 @@ function use_render_isSlot(s) {
|
|
22904
23171
|
}), null);
|
22905
23172
|
}
|
22906
23173
|
};
|
23174
|
+
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
23175
|
+
multiShiftKey.removeMultiCheckedEvents();
|
23176
|
+
});
|
22907
23177
|
return {
|
22908
23178
|
renderColumns: renderColumns,
|
22909
23179
|
renderTBody: renderTBody,
|
@@ -23206,90 +23476,6 @@ var useRows = function useRows(props) {
|
|
23206
23476
|
};
|
23207
23477
|
};
|
23208
23478
|
/* harmony default export */ const use_rows = (useRows);
|
23209
|
-
;// CONCATENATED MODULE: external "../loading"
|
23210
|
-
var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
23211
|
-
var loading_y = x => () => x
|
23212
|
-
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"] });
|
23213
|
-
;// CONCATENATED MODULE: external "../loading/loading.less"
|
23214
|
-
var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
23215
|
-
var loading_less_y = x => () => x
|
23216
|
-
const loading_less_namespaceObject = loading_less_x({ });
|
23217
|
-
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-scroll-loading.tsx
|
23218
|
-
|
23219
|
-
|
23220
|
-
/*
|
23221
|
-
* Tencent is pleased to support the open source community by making
|
23222
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
23223
|
-
*
|
23224
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
23225
|
-
*
|
23226
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
23227
|
-
*
|
23228
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
23229
|
-
*
|
23230
|
-
* ---------------------------------------------------
|
23231
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
23232
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
23233
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
23234
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
23235
|
-
*
|
23236
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
23237
|
-
* the Software.
|
23238
|
-
*
|
23239
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
23240
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23241
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
23242
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
23243
|
-
* IN THE SOFTWARE.
|
23244
|
-
*/
|
23245
|
-
|
23246
|
-
|
23247
|
-
|
23248
|
-
|
23249
|
-
/* harmony default export */ const use_scroll_loading = (function (props, ctx) {
|
23250
|
-
var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
|
23251
|
-
var getLoadingOption = function getLoadingOption() {
|
23252
|
-
if (typeof refScrollLoading.value === 'boolean') {
|
23253
|
-
return {
|
23254
|
-
loading: !!refScrollLoading.value,
|
23255
|
-
inline: true,
|
23256
|
-
title: '',
|
23257
|
-
size: loading_namespaceObject.BkLoadingSize.Normal,
|
23258
|
-
mode: loading_namespaceObject.BkLoadingMode.Default,
|
23259
|
-
indicator: null
|
23260
|
-
};
|
23261
|
-
}
|
23262
|
-
return refScrollLoading.value;
|
23263
|
-
};
|
23264
|
-
var isRender = (0,external_vue_namespaceObject.computed)(function () {
|
23265
|
-
return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
|
23266
|
-
});
|
23267
|
-
var renderScrollLoading = function renderScrollLoading() {
|
23268
|
-
var _ctx$slots$fixedBotto3, _ctx$slots$fixedBotto4, _ctx$slots2;
|
23269
|
-
if (isRender.value) {
|
23270
|
-
var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
|
23271
|
-
var _getLoadingOption = getLoadingOption(),
|
23272
|
-
loading = _getLoadingOption.loading,
|
23273
|
-
size = _getLoadingOption.size,
|
23274
|
-
mode = _getLoadingOption.mode,
|
23275
|
-
title = _getLoadingOption.title,
|
23276
|
-
inline = _getLoadingOption.inline,
|
23277
|
-
indicator = _getLoadingOption.indicator;
|
23278
|
-
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"], {
|
23279
|
-
loading: loading,
|
23280
|
-
size: size,
|
23281
|
-
mode: mode,
|
23282
|
-
title: title,
|
23283
|
-
inline: inline,
|
23284
|
-
indicator: indicator
|
23285
|
-
}, null);
|
23286
|
-
}
|
23287
|
-
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;
|
23288
|
-
};
|
23289
|
-
return {
|
23290
|
-
renderScrollLoading: renderScrollLoading
|
23291
|
-
};
|
23292
|
-
});
|
23293
23479
|
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-settings.tsx
|
23294
23480
|
|
23295
23481
|
|
@@ -23334,7 +23520,7 @@ const loading_less_namespaceObject = loading_less_x({ });
|
|
23334
23520
|
function use_settings_isSlot(s) {
|
23335
23521
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
|
23336
23522
|
}
|
23337
|
-
var useSettings = function useSettings(props, ctx, columns) {
|
23523
|
+
var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
23338
23524
|
var t = (0,config_provider_namespaceObject.useLocale)('table');
|
23339
23525
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
23340
23526
|
resolveClassName = _usePrefix.resolveClassName;
|
@@ -23410,6 +23596,7 @@ var useSettings = function useSettings(props, ctx, columns) {
|
|
23410
23596
|
Object.assign(options, result);
|
23411
23597
|
columns.setColumnAttributeBySettings(options, result.checked);
|
23412
23598
|
columns.setVisibleColumns();
|
23599
|
+
afterSetting === null || afterSetting === void 0 || afterSetting(result.checked);
|
23413
23600
|
(_refSetting$value = refSetting.value) === null || _refSetting$value === void 0 || _refSetting$value.hide();
|
23414
23601
|
ctx.emit(EMIT_EVENTS.SETTING_CHANGE, result);
|
23415
23602
|
};
|
@@ -23663,7 +23850,6 @@ var useSettings = function useSettings(props, ctx, columns) {
|
|
23663
23850
|
|
23664
23851
|
|
23665
23852
|
|
23666
|
-
|
23667
23853
|
/* harmony default export */ const table = ((0,external_vue_namespaceObject.defineComponent)({
|
23668
23854
|
name: 'Table',
|
23669
23855
|
props: tableProps,
|
@@ -23672,7 +23858,30 @@ var useSettings = function useSettings(props, ctx, columns) {
|
|
23672
23858
|
var columns = use_columns(props);
|
23673
23859
|
var rows = use_rows(props);
|
23674
23860
|
var pagination = use_pagination(props);
|
23675
|
-
var
|
23861
|
+
var _useLayout = use_layout(props, ctx),
|
23862
|
+
renderContainer = _useLayout.renderContainer,
|
23863
|
+
renderFixedBottom = _useLayout.renderFixedBottom,
|
23864
|
+
renderBody = _useLayout.renderBody,
|
23865
|
+
renderHeader = _useLayout.renderHeader,
|
23866
|
+
renderFooter = _useLayout.renderFooter,
|
23867
|
+
setBodyHeight = _useLayout.setBodyHeight,
|
23868
|
+
setFootHeight = _useLayout.setFootHeight,
|
23869
|
+
setDragOffsetX = _useLayout.setDragOffsetX,
|
23870
|
+
setOffsetRight = _useLayout.setOffsetRight,
|
23871
|
+
refBody = _useLayout.refBody,
|
23872
|
+
refRoot = _useLayout.refRoot;
|
23873
|
+
/**
|
23874
|
+
* 设置字段结束,展示字段改变,设置表格偏移量为0
|
23875
|
+
* 避免太长横向滚动导致数据不可见
|
23876
|
+
* @param fields
|
23877
|
+
*/
|
23878
|
+
var afterSetting = function afterSetting(fields) {
|
23879
|
+
if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
|
23880
|
+
var _refBody$value;
|
23881
|
+
(_refBody$value = refBody.value) === null || _refBody$value === void 0 || _refBody$value.scrollTo(0, 0);
|
23882
|
+
}
|
23883
|
+
};
|
23884
|
+
var settings = use_settings(props, ctx, columns, afterSetting);
|
23676
23885
|
var dragEvents = use_draggable(props, rows, ctx);
|
23677
23886
|
var _useRender = use_render({
|
23678
23887
|
props: props,
|
@@ -23687,52 +23896,33 @@ var useSettings = function useSettings(props, ctx, columns) {
|
|
23687
23896
|
renderTFoot = _useRender.renderTFoot,
|
23688
23897
|
setDragEvents = _useRender.setDragEvents;
|
23689
23898
|
setDragEvents(dragEvents);
|
23690
|
-
var _useColumnResize = use_column_resize(columns),
|
23691
|
-
dragOffsetX = _useColumnResize.dragOffsetX;
|
23692
23899
|
var _useColumnTemplate = use_column_template(),
|
23693
23900
|
resolveColumns = _useColumnTemplate.resolveColumns;
|
23694
23901
|
var instance = (0,external_vue_namespaceObject.getCurrentInstance)();
|
23695
23902
|
var initTableColumns = function initTableColumns() {
|
23696
|
-
|
23903
|
+
var _instance$subTree$chi, _instance$subTree;
|
23904
|
+
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 : [];
|
23905
|
+
columns.debounceUpdateColumns(resolveColumns(children));
|
23697
23906
|
};
|
23698
23907
|
(0,external_vue_namespaceObject.provide)(PROVIDE_KEY_INIT_COL, initTableColumns);
|
23699
|
-
var _useLayout = use_layout(props, ctx),
|
23700
|
-
renderContainer = _useLayout.renderContainer,
|
23701
|
-
renderBody = _useLayout.renderBody,
|
23702
|
-
renderHeader = _useLayout.renderHeader,
|
23703
|
-
renderFooter = _useLayout.renderFooter,
|
23704
|
-
setBodyHeight = _useLayout.setBodyHeight,
|
23705
|
-
setFootHeight = _useLayout.setFootHeight,
|
23706
|
-
setDragOffsetX = _useLayout.setDragOffsetX,
|
23707
|
-
setOffsetRight = _useLayout.setOffsetRight,
|
23708
|
-
refRoot = _useLayout.refRoot,
|
23709
|
-
refHead = _useLayout.refHead;
|
23710
23908
|
var _useFixedColumn = use_fixed_column(props, columns),
|
23711
23909
|
renderFixedRows = _useFixedColumn.renderFixedRows,
|
23712
23910
|
resolveFixedColumnStyle = _useFixedColumn.resolveFixedColumnStyle;
|
23713
|
-
|
23714
|
-
|
23715
|
-
|
23911
|
+
/**
|
23912
|
+
* Column配置改变或者容器Resize之后,根据Columns配置
|
23913
|
+
* 计算每一列的实际宽度
|
23914
|
+
*/
|
23716
23915
|
var computedColumnRect = function computedColumnRect() {
|
23717
|
-
var
|
23718
|
-
|
23719
|
-
|
23720
|
-
|
23721
|
-
var id = columns.getColumnId(col);
|
23722
|
-
var query = "[data-id=\"".concat(id, "\"]");
|
23723
|
-
var target = refHead === null || refHead === void 0 || (_refHead$value2 = refHead.value) === null || _refHead$value2 === void 0 ? void 0 : _refHead$value2.querySelector(query);
|
23724
|
-
if ((0,lodash.isElement)(target)) {
|
23725
|
-
columns.setColumnRect(col, {
|
23726
|
-
width: target.offsetWidth,
|
23727
|
-
height: target.offsetHeight,
|
23728
|
-
left: null,
|
23729
|
-
right: null
|
23730
|
-
});
|
23731
|
-
}
|
23732
|
-
});
|
23733
|
-
resolveFixedColumnStyle();
|
23734
|
-
}
|
23916
|
+
var _refRoot$value$offset, _refRoot$value;
|
23917
|
+
var width = (_refRoot$value$offset = (_refRoot$value = refRoot.value) === null || _refRoot$value === void 0 ? void 0 : _refRoot$value.offsetWidth) !== null && _refRoot$value$offset !== void 0 ? _refRoot$value$offset : 0;
|
23918
|
+
columns.resolveColsCalcWidth(width);
|
23919
|
+
resolveFixedColumnStyle();
|
23735
23920
|
};
|
23921
|
+
var _useColumnResize = use_column_resize(columns, {
|
23922
|
+
afterResize: resolveFixedColumnStyle
|
23923
|
+
}),
|
23924
|
+
dragOffsetX = _useColumnResize.dragOffsetX;
|
23925
|
+
var isResizeBodyHeight = (0,external_vue_namespaceObject.ref)(false);
|
23736
23926
|
/**
|
23737
23927
|
* table 渲染行
|
23738
23928
|
*/
|
@@ -23774,12 +23964,17 @@ var useSettings = function useSettings(props, ctx, columns) {
|
|
23774
23964
|
});
|
23775
23965
|
var setTableFootHeight = function setTableFootHeight() {
|
23776
23966
|
setFootHeight(footHeight.value);
|
23967
|
+
if (/^\d+\.?\d*(px)?$/.test("".concat(props.height))) {
|
23968
|
+
setBodyHeight(Number("".concat(props.height).replace('px', '')));
|
23969
|
+
}
|
23777
23970
|
};
|
23778
23971
|
var setTableData = function setTableData() {
|
23779
23972
|
var filterOrderList = getFilterAndSortList();
|
23780
|
-
|
23781
|
-
|
23782
|
-
|
23973
|
+
if (!props.remotePagination) {
|
23974
|
+
pagination.setPagination({
|
23975
|
+
count: filterOrderList.length
|
23976
|
+
});
|
23977
|
+
}
|
23783
23978
|
var renderList = getRenderRowList(filterOrderList);
|
23784
23979
|
rows.setPageRowList(renderList);
|
23785
23980
|
(0,external_vue_namespaceObject.nextTick)(function () {
|
@@ -23787,6 +23982,7 @@ var useSettings = function useSettings(props, ctx, columns) {
|
|
23787
23982
|
});
|
23788
23983
|
};
|
23789
23984
|
use_observer_resize(refRoot, function () {
|
23985
|
+
var _refBody$value2;
|
23790
23986
|
if ((props.height === '100%' || props.virtualEnabled) && (0,lodash.isElement)(refRoot.value)) {
|
23791
23987
|
if (isResizeBodyHeight.value) {
|
23792
23988
|
setTimeout(function () {
|
@@ -23795,12 +23991,13 @@ var useSettings = function useSettings(props, ctx, columns) {
|
|
23795
23991
|
return;
|
23796
23992
|
}
|
23797
23993
|
var tableHeight = refRoot.value.offsetHeight;
|
23798
|
-
var bodyHeight = tableHeight - columns.headHeight.value - footHeight.value;
|
23799
23994
|
isResizeBodyHeight.value = true;
|
23800
|
-
setBodyHeight(
|
23995
|
+
setBodyHeight(tableHeight);
|
23801
23996
|
setOffsetRight();
|
23802
23997
|
}
|
23803
23998
|
computedColumnRect();
|
23999
|
+
(_refBody$value2 = refBody.value) === null || _refBody$value2 === void 0 || _refBody$value2.scrollTo(0, 0);
|
24000
|
+
setOffsetRight();
|
23804
24001
|
});
|
23805
24002
|
(0,external_vue_namespaceObject.watch)(function () {
|
23806
24003
|
return [dragOffsetX.value];
|
@@ -23837,6 +24034,10 @@ var useSettings = function useSettings(props, ctx, columns) {
|
|
23837
24034
|
return [pagination.options.count, pagination.options.limit, pagination.options.current, props.data];
|
23838
24035
|
}, function () {
|
23839
24036
|
setTableData();
|
24037
|
+
(0,external_vue_namespaceObject.nextTick)(function () {
|
24038
|
+
var _refBody$value3;
|
24039
|
+
(_refBody$value3 = refBody.value) === null || _refBody$value3 === void 0 || _refBody$value3.scrollTo(0, 1);
|
24040
|
+
});
|
23840
24041
|
}, {
|
23841
24042
|
immediate: true
|
23842
24043
|
});
|
@@ -23854,7 +24055,7 @@ var useSettings = function useSettings(props, ctx, columns) {
|
|
23854
24055
|
}
|
23855
24056
|
});
|
23856
24057
|
return function () {
|
23857
|
-
return renderContainer([renderHeader(renderColumns, settings.renderSettings), renderBody(rows.pageRowList, renderTBody, renderFixedRows,
|
24058
|
+
return renderContainer([renderHeader(renderColumns, settings.renderSettings, renderFixedRows), renderBody(rows.pageRowList, renderTBody, renderFixedRows), renderFixedBottom(), renderFooter(renderTFoot())]);
|
23858
24059
|
};
|
23859
24060
|
}
|
23860
24061
|
}));
|