bkui-vue 1.0.3-beta.66 → 1.0.3-beta.66.dialog.2
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 +69 -69
- package/dist/index.esm.js +19955 -19133
- package/dist/index.umd.js +69 -69
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/dialog/dialog.css +135 -84
- package/lib/dialog/dialog.d.ts +32 -133
- package/lib/dialog/dialog.less +9 -76
- package/lib/dialog/dialog.variable.css +135 -84
- package/lib/dialog/index.d.ts +84 -314
- package/lib/dialog/index.js +206 -221
- package/lib/dialog/props.d.ts +8 -48
- package/lib/info-box/index.d.ts +2 -2
- package/lib/info-box/index.js +318 -173
- package/lib/info-box/info-box.css +63 -7
- package/lib/info-box/info-box.d.ts +17 -16
- package/lib/info-box/info-box.less +76 -14
- package/lib/info-box/info-box.variable.css +63 -7
- package/lib/info-box/render-component.d.ts +4 -0
- package/lib/modal/hooks.d.ts +1 -1
- package/lib/modal/index.d.ts +16 -350
- package/lib/modal/index.js +183 -675
- package/lib/modal/mask.d.ts +6 -0
- package/lib/modal/modal.css +131 -32
- package/lib/modal/modal.d.ts +6 -134
- package/lib/modal/modal.less +84 -29
- package/lib/modal/modal.variable.css +131 -32
- package/lib/modal/props.mixin.d.ts +2 -53
- package/lib/scrollbar/index.d.ts +15 -0
- package/lib/scrollbar/index.js +18756 -0
- package/lib/scrollbar/scrollbar-core/can-use-dom.d.ts +2 -0
- package/lib/scrollbar/scrollbar-core/helpers.d.ts +5 -0
- package/lib/scrollbar/scrollbar-core/index.d.ts +240 -0
- package/lib/scrollbar/scrollbar-core/mouse-wheel.d.ts +5 -0
- package/lib/scrollbar/scrollbar-core/scrollbar-width.d.ts +1 -0
- package/lib/scrollbar/scrollbar.css +74 -0
- package/lib/scrollbar/scrollbar.less +93 -0
- package/lib/scrollbar/scrollbar.variable.css +203 -0
- package/lib/shared/index.d.ts +0 -1
- package/lib/shared/index.js +1 -48
- package/lib/sideslider/index.d.ts +31 -222
- package/lib/sideslider/index.js +64 -40
- package/lib/sideslider/sideslider.css +17 -86
- package/lib/sideslider/sideslider.d.ts +14 -105
- package/lib/sideslider/sideslider.less +27 -107
- package/lib/sideslider/sideslider.variable.css +17 -86
- package/lib/table/const.d.ts +1 -1
- package/lib/table/index.d.ts +23 -0
- package/lib/table/index.js +195 -52
- package/lib/table/plugins/use-fixed-column.d.ts +1 -1
- package/lib/table/plugins/use-pagination.d.ts +3 -1
- package/lib/table/plugins/use-shift-key.d.ts +11 -0
- package/lib/table/props.d.ts +8 -0
- package/lib/table/table.css +97 -42
- package/lib/table/table.d.ts +11 -0
- package/lib/table/table.less +43 -58
- package/lib/table/table.variable.css +97 -42
- package/lib/table/use-attributes.d.ts +1 -0
- package/lib/table/use-render.d.ts +1 -1
- package/lib/table-column/index.js +6 -2
- package/lib/tree/index.d.ts +23 -0
- package/lib/tree/index.js +9 -3
- package/lib/tree/props.d.ts +8 -0
- package/lib/tree/tree.css +75 -2
- package/lib/tree/tree.d.ts +11 -0
- package/lib/tree/tree.variable.css +75 -2
- package/lib/virtual-render/index.d.ts +27 -0
- package/lib/virtual-render/index.js +283 -74
- package/lib/virtual-render/props.d.ts +16 -0
- package/lib/virtual-render/use-fix-top.d.ts +2 -7
- package/lib/virtual-render/use-scrollbar.d.ts +24 -0
- package/lib/virtual-render/v-virtual-render.d.ts +2 -1
- package/lib/virtual-render/virtual-render.css +75 -2
- package/lib/virtual-render/virtual-render.d.ts +13 -0
- package/lib/virtual-render/virtual-render.less +3 -3
- package/lib/virtual-render/virtual-render.variable.css +75 -2
- package/package.json +1 -1
- package/lib/shared/mask.d.ts +0 -11
package/lib/table/index.js
CHANGED
@@ -122,7 +122,7 @@ function defineProperty_defineProperty(obj, key, value) {
|
|
122
122
|
;// CONCATENATED MODULE: external "vue"
|
123
123
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
124
124
|
var external_vue_y = x => () => x
|
125
|
-
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, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["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, ["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, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect });
|
125
|
+
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, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["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, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect });
|
126
126
|
;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
|
127
127
|
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
128
128
|
/* harmony default export */ const esm_browser_native = ({
|
@@ -295,7 +295,7 @@ var COLUMN_ATTRIBUTE = {
|
|
295
295
|
/**
|
296
296
|
* Y 轴滚动条宽度
|
297
297
|
*/
|
298
|
-
var SCROLLY_WIDTH =
|
298
|
+
var SCROLLY_WIDTH = 0;
|
299
299
|
/**
|
300
300
|
* 默认行高
|
301
301
|
*/
|
@@ -723,7 +723,11 @@ var tableProps = {
|
|
723
723
|
/**
|
724
724
|
* 是否支持行拖拽排序
|
725
725
|
*/
|
726
|
-
rowDraggable: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.func, shared_namespaceObject.PropTypes.bool, shared_namespaceObject.PropTypes.object]).def(false)
|
726
|
+
rowDraggable: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.func, shared_namespaceObject.PropTypes.bool, shared_namespaceObject.PropTypes.object]).def(false),
|
727
|
+
/**
|
728
|
+
* 是否支持shift键多行选择
|
729
|
+
*/
|
730
|
+
shiftMultiChecked: shared_namespaceObject.PropTypes.bool.def(false)
|
727
731
|
};
|
728
732
|
;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
|
729
733
|
|
@@ -1496,7 +1500,6 @@ function _toConsumableArray(arr) {
|
|
1496
1500
|
*/
|
1497
1501
|
|
1498
1502
|
|
1499
|
-
|
1500
1503
|
/**
|
1501
1504
|
* 固定列Hooks
|
1502
1505
|
*/
|
@@ -1583,13 +1586,12 @@ function _toConsumableArray(arr) {
|
|
1583
1586
|
* @returns
|
1584
1587
|
*/
|
1585
1588
|
var resolveFixedColumnStyle = function resolveFixedColumnStyle(column) {
|
1586
|
-
var hasScrollY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
1587
1589
|
if (!column.fixed || isHiddenColumn(column)) {
|
1588
1590
|
return {};
|
1589
1591
|
}
|
1590
1592
|
var fixedOffset = {
|
1591
1593
|
left: 0,
|
1592
|
-
right:
|
1594
|
+
right: -1
|
1593
1595
|
};
|
1594
1596
|
var fixedPos = resolveFixColPos(column);
|
1595
1597
|
fixedOffset[fixedPos] = getPreColumnOffset(fixedPos, column, fixedOffset[fixedPos]);
|
@@ -3199,6 +3201,7 @@ const loading_less_namespaceObject = loading_less_x({ });
|
|
3199
3201
|
return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
|
3200
3202
|
});
|
3201
3203
|
var renderScrollLoading = function renderScrollLoading() {
|
3204
|
+
var _ctx$slots$fixedBotto3, _ctx$slots$fixedBotto4, _ctx$slots2;
|
3202
3205
|
if (isRender.value) {
|
3203
3206
|
var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
|
3204
3207
|
var _getLoadingOption = getLoadingOption(),
|
@@ -3217,6 +3220,7 @@ const loading_less_namespaceObject = loading_less_x({ });
|
|
3217
3220
|
indicator: indicator
|
3218
3221
|
}, null);
|
3219
3222
|
}
|
3223
|
+
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;
|
3220
3224
|
};
|
3221
3225
|
return {
|
3222
3226
|
renderScrollLoading: renderScrollLoading
|
@@ -3304,9 +3308,9 @@ var resolvePaginationOption = function resolvePaginationOption(propPagination, d
|
|
3304
3308
|
if (!props.pagination) {
|
3305
3309
|
return;
|
3306
3310
|
}
|
3307
|
-
localPagination.value = props.remotePagination ? pagination : use_pagination_objectSpread(
|
3311
|
+
localPagination.value = props.remotePagination ? pagination : use_pagination_objectSpread({
|
3308
3312
|
count: indexData.length
|
3309
|
-
});
|
3313
|
+
}, pagination);
|
3310
3314
|
};
|
3311
3315
|
/**
|
3312
3316
|
* 重置当前分页开始位置 & 结束位置
|
@@ -3371,35 +3375,35 @@ var resolvePaginationOption = function resolvePaginationOption(propPagination, d
|
|
3371
3375
|
}
|
3372
3376
|
pageData.length = 0;
|
3373
3377
|
pageData.push.apply(pageData, _toConsumableArray(sourceData.slice(startIndex.value, endIndex.value)));
|
3374
|
-
|
3378
|
+
if (Array.isArray(filterFn)) {
|
3379
|
+
multiFilter(filterFn, pageData);
|
3380
|
+
} else {
|
3381
|
+
filter(pageData, filterFn);
|
3382
|
+
}
|
3375
3383
|
sort(pageData, sortFn, column, type, sortScope);
|
3376
3384
|
resolveLocalPagination();
|
3377
3385
|
};
|
3378
3386
|
var resolvePageDataBySortList = function resolvePageDataBySortList(multiCol) {
|
3379
3387
|
resolvePageData(null, null, null, null, null, multiCol);
|
3380
3388
|
};
|
3381
|
-
var
|
3382
|
-
|
3389
|
+
var getCurrentPageData = function getCurrentPageData() {
|
3390
|
+
return indexData.slice(startIndex.value, endIndex.value);
|
3391
|
+
};
|
3392
|
+
var multiFilter = function multiFilter(filterFnList, origin) {
|
3393
|
+
var sourceData = (origin !== null && origin !== void 0 ? origin : indexData).slice();
|
3383
3394
|
var target = filterFnList.reduce(function (result, fn) {
|
3384
3395
|
return filter(result, fn);
|
3385
3396
|
}, sourceData);
|
3386
3397
|
pageData.length = 0;
|
3387
3398
|
pageData.push.apply(pageData, _toConsumableArray(getRawData(target)));
|
3388
3399
|
};
|
3389
|
-
var handlePaginationChange = function handlePaginationChange() {
|
3400
|
+
var handlePaginationChange = function handlePaginationChange(filterFn, sortFn) {
|
3390
3401
|
pagination = resolvePaginationOption(props.pagination, pagination);
|
3391
3402
|
resolveLocalPagination();
|
3392
3403
|
resetStartEndIndex();
|
3393
|
-
resolvePageData();
|
3404
|
+
resolvePageData(filterFn, sortFn);
|
3394
3405
|
};
|
3395
3406
|
handlePaginationChange();
|
3396
|
-
(0,external_vue_namespaceObject.watch)(function () {
|
3397
|
-
return [props.pagination];
|
3398
|
-
}, function () {
|
3399
|
-
handlePaginationChange();
|
3400
|
-
}, {
|
3401
|
-
deep: true
|
3402
|
-
});
|
3403
3407
|
return {
|
3404
3408
|
pageData: pageData,
|
3405
3409
|
indexData: indexData,
|
@@ -3407,7 +3411,9 @@ var resolvePaginationOption = function resolvePaginationOption(propPagination, d
|
|
3407
3411
|
resolvePageData: resolvePageData,
|
3408
3412
|
resolveIndexData: resolveIndexData,
|
3409
3413
|
resolvePageDataBySortList: resolvePageDataBySortList,
|
3414
|
+
handlePaginationChange: handlePaginationChange,
|
3410
3415
|
resetStartEndIndex: resetStartEndIndex,
|
3416
|
+
getCurrentPageData: getCurrentPageData,
|
3411
3417
|
multiFilter: multiFilter,
|
3412
3418
|
sort: sort
|
3413
3419
|
};
|
@@ -3486,6 +3492,8 @@ var tableSchemaResponse = function tableSchemaResponse(props) {
|
|
3486
3492
|
localPagination = _usePagination.localPagination,
|
3487
3493
|
resolvePageData = _usePagination.resolvePageData,
|
3488
3494
|
resolvePageDataBySortList = _usePagination.resolvePageDataBySortList,
|
3495
|
+
handlePaginationChange = _usePagination.handlePaginationChange,
|
3496
|
+
getCurrentPageData = _usePagination.getCurrentPageData,
|
3489
3497
|
multiFilter = _usePagination.multiFilter,
|
3490
3498
|
sort = _usePagination.sort,
|
3491
3499
|
resetStartEndIndex = _usePagination.resetStartEndIndex,
|
@@ -3608,13 +3616,15 @@ var tableSchemaResponse = function tableSchemaResponse(props) {
|
|
3608
3616
|
var getColumnFilterFn = function getColumnFilterFn(col) {
|
3609
3617
|
return getColumnAttribute(col, COLUMN_ATTRIBUTE.COL_FILTER_FN);
|
3610
3618
|
};
|
3611
|
-
var
|
3612
|
-
|
3619
|
+
var getFilterFnList = function getFilterFnList() {
|
3620
|
+
return formatData.columns.filter(function (col) {
|
3613
3621
|
return !isHiddenColumn(col) && typeof getColumnFilterFn(col) === 'function';
|
3614
3622
|
}).map(function (col) {
|
3615
3623
|
return getColumnFilterFn(col);
|
3616
3624
|
});
|
3617
|
-
|
3625
|
+
};
|
3626
|
+
var filter = function filter() {
|
3627
|
+
multiFilter(getFilterFnList(), getCurrentPageData());
|
3618
3628
|
};
|
3619
3629
|
/**
|
3620
3630
|
* 按照指定列排序
|
@@ -4075,6 +4085,13 @@ var tableSchemaResponse = function tableSchemaResponse(props) {
|
|
4075
4085
|
var setIndexData = function setIndexData() {
|
4076
4086
|
return resolveIndexData();
|
4077
4087
|
};
|
4088
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
4089
|
+
return [props.pagination];
|
4090
|
+
}, function () {
|
4091
|
+
handlePaginationChange(getFilterFnList());
|
4092
|
+
}, {
|
4093
|
+
deep: true
|
4094
|
+
});
|
4078
4095
|
return {
|
4079
4096
|
formatColumns: formatColumns,
|
4080
4097
|
formatDataSchema: formatDataSchema,
|
@@ -4112,7 +4129,8 @@ var tableSchemaResponse = function tableSchemaResponse(props) {
|
|
4112
4129
|
pageData: pageData,
|
4113
4130
|
localPagination: localPagination,
|
4114
4131
|
formatData: formatData,
|
4115
|
-
setIndexData: setIndexData
|
4132
|
+
setIndexData: setIndexData,
|
4133
|
+
getFilterFnList: getFilterFnList
|
4116
4134
|
};
|
4117
4135
|
};
|
4118
4136
|
/* harmony default export */ const use_attributes = (tableSchemaResponse);
|
@@ -5604,10 +5622,10 @@ function head_filter_isSlot(s) {
|
|
5604
5622
|
if (scope.data.length) {
|
5605
5623
|
return scope.data.map(function (item) {
|
5606
5624
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
5607
|
-
"class": "list-item"
|
5625
|
+
"class": "list-item",
|
5626
|
+
"key": item.value
|
5608
5627
|
}, [(0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject["default"], {
|
5609
5628
|
"label": item.value,
|
5610
|
-
"key": item.$index,
|
5611
5629
|
"immediateEmitChange": false,
|
5612
5630
|
"checked": state.checked.includes(item.value),
|
5613
5631
|
"modelValue": state.checked.includes(item.value),
|
@@ -6112,6 +6130,88 @@ function use_head_cell_isSlot(s) {
|
|
6112
6130
|
getTH: getTH
|
6113
6131
|
};
|
6114
6132
|
});
|
6133
|
+
;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-shift-key.tsx
|
6134
|
+
/*
|
6135
|
+
* Tencent is pleased to support the open source community by making
|
6136
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
6137
|
+
*
|
6138
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
6139
|
+
*
|
6140
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
6141
|
+
*
|
6142
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
6143
|
+
*
|
6144
|
+
* ---------------------------------------------------
|
6145
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
6146
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
6147
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
6148
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6149
|
+
*
|
6150
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
6151
|
+
* the Software.
|
6152
|
+
*
|
6153
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
6154
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
6155
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
6156
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
6157
|
+
* IN THE SOFTWARE.
|
6158
|
+
*/
|
6159
|
+
|
6160
|
+
/* harmony default export */ const use_shift_key = (function (props) {
|
6161
|
+
var isShiftKeyDown = (0,external_vue_namespaceObject.ref)(false);
|
6162
|
+
var store = {
|
6163
|
+
start: null,
|
6164
|
+
end: null
|
6165
|
+
};
|
6166
|
+
var handleKeyDown = function handleKeyDown(e) {
|
6167
|
+
if (e.key === 'Shift') {
|
6168
|
+
isShiftKeyDown.value = true;
|
6169
|
+
}
|
6170
|
+
};
|
6171
|
+
var handleKeyUp = function handleKeyUp(e) {
|
6172
|
+
if (e.key === 'Shift') {
|
6173
|
+
isShiftKeyDown.value = false;
|
6174
|
+
clearStore();
|
6175
|
+
}
|
6176
|
+
};
|
6177
|
+
var setStore = function setStore(row, index) {
|
6178
|
+
if (store.start === null && store.end === null) {
|
6179
|
+
store.start = {
|
6180
|
+
index: index,
|
6181
|
+
row: row
|
6182
|
+
};
|
6183
|
+
return false;
|
6184
|
+
}
|
6185
|
+
store.end = {
|
6186
|
+
index: index,
|
6187
|
+
row: row
|
6188
|
+
};
|
6189
|
+
return true;
|
6190
|
+
};
|
6191
|
+
var clearStore = function clearStore() {
|
6192
|
+
store.start = null;
|
6193
|
+
store.end = null;
|
6194
|
+
};
|
6195
|
+
if (props.shiftMultiChecked) {
|
6196
|
+
window.addEventListener('keydown', handleKeyDown);
|
6197
|
+
window.addEventListener('keyup', handleKeyUp);
|
6198
|
+
}
|
6199
|
+
var getStore = function getStore() {
|
6200
|
+
return store;
|
6201
|
+
};
|
6202
|
+
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
6203
|
+
if (props.shiftMultiChecked) {
|
6204
|
+
window.removeEventListener('keydown', handleKeyDown);
|
6205
|
+
window.removeEventListener('keyup', handleKeyUp);
|
6206
|
+
}
|
6207
|
+
});
|
6208
|
+
return {
|
6209
|
+
isShiftKeyDown: isShiftKeyDown,
|
6210
|
+
setStore: setStore,
|
6211
|
+
getStore: getStore,
|
6212
|
+
clearStore: clearStore
|
6213
|
+
};
|
6214
|
+
});
|
6115
6215
|
;// CONCATENATED MODULE: ../../packages/table/src/use-render.tsx
|
6116
6216
|
|
6117
6217
|
|
@@ -6163,10 +6263,11 @@ function use_render_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
6163
6263
|
|
6164
6264
|
|
6165
6265
|
|
6266
|
+
|
6166
6267
|
function use_render_isSlot(s) {
|
6167
6268
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
|
6168
6269
|
}
|
6169
|
-
/* harmony default export */ const use_render = (function (props, context, tableResp,
|
6270
|
+
/* harmony default export */ const use_render = (function (props, context, tableResp, head, root, resetTableHeight) {
|
6170
6271
|
var t = (0,config_provider_namespaceObject.useLocale)('table');
|
6171
6272
|
var uuid = esm_browser_v4();
|
6172
6273
|
var formatData = (0,external_vue_namespaceObject.computed)(function () {
|
@@ -6178,6 +6279,10 @@ function use_render_isSlot(s) {
|
|
6178
6279
|
var settings = (0,external_vue_namespaceObject.computed)(function () {
|
6179
6280
|
return formatData.value.settings;
|
6180
6281
|
});
|
6282
|
+
var _useShiftKey = use_shift_key(props),
|
6283
|
+
isShiftKeyDown = _useShiftKey.isShiftKeyDown,
|
6284
|
+
getStore = _useShiftKey.getStore,
|
6285
|
+
setStore = _useShiftKey.setStore;
|
6181
6286
|
// const activeSortIndex = ref(null);
|
6182
6287
|
/**
|
6183
6288
|
* 过滤当前可渲染的列
|
@@ -6287,11 +6392,17 @@ function use_render_isSlot(s) {
|
|
6287
6392
|
context.emit(EMIT_EVENTS.PAGE_LIMIT_CHANGE, limit);
|
6288
6393
|
};
|
6289
6394
|
var handlePageChange = function handlePageChange(current) {
|
6290
|
-
|
6291
|
-
|
6292
|
-
|
6293
|
-
|
6294
|
-
|
6395
|
+
if (typeof_typeof(props.pagination) === 'object' && current !== props.pagination.current) {
|
6396
|
+
Object.assign(props.pagination, {
|
6397
|
+
current: current,
|
6398
|
+
value: current
|
6399
|
+
});
|
6400
|
+
context.emit(EMIT_EVENTS.PAGE_VALUE_CHANGE, current);
|
6401
|
+
return;
|
6402
|
+
}
|
6403
|
+
if (typeof props.pagination === 'boolean' && props.pagination !== false) {
|
6404
|
+
context.emit(EMIT_EVENTS.PAGE_VALUE_CHANGE, current);
|
6405
|
+
}
|
6295
6406
|
};
|
6296
6407
|
/**
|
6297
6408
|
* 渲染Table Header
|
@@ -6304,8 +6415,7 @@ function use_render_isSlot(s) {
|
|
6304
6415
|
'--row-height': "".concat(resolvePropVal(config, 'height', ['thead']), "px"),
|
6305
6416
|
backgroundColor: props.thead.color
|
6306
6417
|
};
|
6307
|
-
|
6308
|
-
resolveFixedColumnStyle = _useFixedColumn.resolveFixedColumnStyle;
|
6418
|
+
// const { resolveFixedColumnStyle } = useFixedColumn(props, tableResp, head);
|
6309
6419
|
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)("thead", {
|
6310
6420
|
"style": rowStyle
|
6311
6421
|
}, [(0,external_vue_namespaceObject.createVNode)(table_row, null, {
|
@@ -6314,7 +6424,7 @@ function use_render_isSlot(s) {
|
|
6314
6424
|
var _props$thead$color, _props$thead;
|
6315
6425
|
var _useHeadCell = use_head_cell(props, context, column, tableResp),
|
6316
6426
|
getTH = _useHeadCell.getTH;
|
6317
|
-
var headStyle = Object.assign({}, resolveFixedColumnStyle(column
|
6427
|
+
var headStyle = Object.assign({}, resolveFixedColumnStyle(column), {
|
6318
6428
|
'--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]
|
6319
6429
|
});
|
6320
6430
|
var classList = [getHeadColumnClass(column, index), getColumnCustomClass(column), column.align || props.headerAlign || props.align];
|
@@ -6390,13 +6500,14 @@ function use_render_isSlot(s) {
|
|
6390
6500
|
return result;
|
6391
6501
|
})]);
|
6392
6502
|
};
|
6393
|
-
var
|
6394
|
-
resolveFixedColumnStyle =
|
6503
|
+
var _useFixedColumn = use_fixed_column(props, tableResp, head),
|
6504
|
+
resolveFixedColumnStyle = _useFixedColumn.resolveFixedColumnStyle;
|
6395
6505
|
var getRowRender = function getRowRender(row, rowIndex, preRow, rows, rowSpanMap, needRowSpan) {
|
6396
6506
|
var isChild = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
6397
6507
|
var rowLength = rows.length;
|
6398
6508
|
var rowStyle = [].concat(_toConsumableArray(formatPropAsArray(props.rowStyle, [row, rowIndex])), [{
|
6399
|
-
'--row-height': "".concat(getRowHeight(row, rowIndex), "px")
|
6509
|
+
'--row-height': "".concat(getRowHeight(row, rowIndex), "px"),
|
6510
|
+
'--scroll-x': "".concat(tableResp.formatData.layout.translateX, "px")
|
6400
6511
|
}]);
|
6401
6512
|
var rowClass = [].concat(_toConsumableArray(formatPropAsArray(props.rowClass, [row, rowIndex])), ["hover-".concat(props.rowHover), rowIndex % 2 === 1 && props.stripe ? 'stripe-row' : '']);
|
6402
6513
|
var rowId = tableResp.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_UID);
|
@@ -6407,7 +6518,6 @@ function use_render_isSlot(s) {
|
|
6407
6518
|
return [(0,external_vue_namespaceObject.createVNode)("tr", (0,external_vue_namespaceObject.mergeProps)({
|
6408
6519
|
"style": rowStyle,
|
6409
6520
|
"class": rowClass,
|
6410
|
-
"data-row-id": rowId,
|
6411
6521
|
"key": rowId,
|
6412
6522
|
"data-row-index": rowIndex,
|
6413
6523
|
"onClick": function onClick(e) {
|
@@ -6458,11 +6568,14 @@ function use_render_isSlot(s) {
|
|
6458
6568
|
};
|
6459
6569
|
context.emit(type, args);
|
6460
6570
|
};
|
6571
|
+
var columnKey = "".concat(rowId, "_").concat(index);
|
6572
|
+
var cellKey = "".concat(rowId, "_").concat(index, "_cell");
|
6461
6573
|
return (0,external_vue_namespaceObject.createVNode)("td", {
|
6462
6574
|
"class": cellClass,
|
6463
6575
|
"style": cellStyle,
|
6464
6576
|
"colspan": colspan,
|
6465
6577
|
"rowspan": rowspan,
|
6578
|
+
"key": columnKey,
|
6466
6579
|
"onClick": function onClick(event) {
|
6467
6580
|
return handleEmit(event, EMIT_EVENTS.CELL_CLICK);
|
6468
6581
|
},
|
@@ -6470,6 +6583,7 @@ function use_render_isSlot(s) {
|
|
6470
6583
|
return handleEmit(event, EMIT_EVENTS.CELL_DBL_CLICK);
|
6471
6584
|
}
|
6472
6585
|
}, [(0,external_vue_namespaceObject.createVNode)(table_cell, {
|
6586
|
+
"key": cellKey,
|
6473
6587
|
"class": tdCtxClass,
|
6474
6588
|
"column": column,
|
6475
6589
|
"row": row,
|
@@ -6601,6 +6715,38 @@ function use_render_isSlot(s) {
|
|
6601
6715
|
data: props.data
|
6602
6716
|
});
|
6603
6717
|
};
|
6718
|
+
var beforeRowChange = function beforeRowChange() {
|
6719
|
+
if (isShiftKeyDown.value && !isAll) {
|
6720
|
+
var result = setStore(row, index);
|
6721
|
+
if (result) {
|
6722
|
+
var _tableResp$pageData$s;
|
6723
|
+
var _getStore = getStore(),
|
6724
|
+
start = _getStore.start,
|
6725
|
+
end = _getStore.end;
|
6726
|
+
var startIndex = start.index < end.index ? start.index : end.index;
|
6727
|
+
var endIndex = start.index < end.index ? end.index : start.index;
|
6728
|
+
((_tableResp$pageData$s = tableResp.pageData.slice(startIndex, endIndex + 1)) !== null && _tableResp$pageData$s !== void 0 ? _tableResp$pageData$s : []).forEach(function (item) {
|
6729
|
+
tableResp.setRowSelection(item, true);
|
6730
|
+
});
|
6731
|
+
}
|
6732
|
+
context.emit(EMIT_EVENTS.ROW_SELECT, {
|
6733
|
+
row: row,
|
6734
|
+
index: index,
|
6735
|
+
checked: true,
|
6736
|
+
data: props.data,
|
6737
|
+
isShiftKeyDown: true
|
6738
|
+
});
|
6739
|
+
context.emit(EMIT_EVENTS.ROW_SELECT_CHANGE, {
|
6740
|
+
row: row,
|
6741
|
+
index: index,
|
6742
|
+
checked: true,
|
6743
|
+
data: props.data,
|
6744
|
+
isShiftKeyDown: true
|
6745
|
+
});
|
6746
|
+
return Promise.resolve(!result);
|
6747
|
+
}
|
6748
|
+
return Promise.resolve(true);
|
6749
|
+
};
|
6604
6750
|
var indeterminate = tableResp.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION_INDETERMINATE);
|
6605
6751
|
var isChecked = tableResp.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION);
|
6606
6752
|
var isEnable = isRowSelectEnable(props, {
|
@@ -6612,7 +6758,8 @@ function use_render_isSlot(s) {
|
|
6612
6758
|
"onChange": handleChecked,
|
6613
6759
|
"disabled": !isEnable,
|
6614
6760
|
"modelValue": isChecked,
|
6615
|
-
"indeterminate": indeterminate
|
6761
|
+
"indeterminate": indeterminate,
|
6762
|
+
"beforeChange": beforeRowChange
|
6616
6763
|
}, null);
|
6617
6764
|
};
|
6618
6765
|
var renderExpandColumn = function renderExpandColumn(row, column, index, rows) {
|
@@ -6811,7 +6958,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
6811
6958
|
wrapperStyle = _useClass.wrapperStyle,
|
6812
6959
|
contentStyle = _useClass.contentStyle,
|
6813
6960
|
headStyle = _useClass.headStyle,
|
6814
|
-
hasScrollYRef = _useClass.hasScrollYRef,
|
6815
6961
|
hasFooter = _useClass.hasFooter,
|
6816
6962
|
footerStyle = _useClass.footerStyle,
|
6817
6963
|
tableBodyClass = _useClass.tableBodyClass,
|
@@ -6832,17 +6978,12 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
6832
6978
|
updateFixClass = _useFixedColumn.updateFixClass;
|
6833
6979
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
6834
6980
|
resolveClassName = _usePrefix.resolveClassName;
|
6835
|
-
var styleRef = (0,external_vue_namespaceObject.computed)(function () {
|
6836
|
-
return {
|
6837
|
-
hasScrollY: hasScrollYRef.value
|
6838
|
-
};
|
6839
|
-
});
|
6840
6981
|
use_observer_resize(root, function () {
|
6841
6982
|
(0,external_vue_namespaceObject.nextTick)(function () {
|
6842
6983
|
resolveFixedColumns(tableOffsetRight.value);
|
6843
6984
|
});
|
6844
6985
|
});
|
6845
|
-
var _useRender = use_render(props, ctx, tableSchema,
|
6986
|
+
var _useRender = use_render(props, ctx, tableSchema, head, root, resetTableHeight),
|
6846
6987
|
renderTableBodySchema = _useRender.renderTableBodySchema,
|
6847
6988
|
renderTableFooter = _useRender.renderTableFooter,
|
6848
6989
|
renderTableHeadSchema = _useRender.renderTableHeadSchema;
|
@@ -6864,13 +7005,12 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
6864
7005
|
tableSchema.formatColumns(columns);
|
6865
7006
|
resolveFixedColumns(tableOffsetRight.value);
|
6866
7007
|
tableSchema.setIndexData().then(function () {
|
6867
|
-
// tableSchema.formatDataSchema(props.data);
|
6868
7008
|
tableSchema.resetStartEndIndex();
|
6869
7009
|
if (isFirstLoad.value) {
|
6870
7010
|
tableSchema.resolveByDefColumns();
|
6871
7011
|
isFirstLoad.value = false;
|
6872
7012
|
} else {
|
6873
|
-
tableSchema.resolvePageData();
|
7013
|
+
tableSchema.resolvePageData(tableSchema.getFilterFnList());
|
6874
7014
|
}
|
6875
7015
|
registerResizeEvent();
|
6876
7016
|
(0,external_vue_namespaceObject.nextTick)(function () {
|
@@ -6984,8 +7124,12 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
6984
7124
|
"throttleDelay": 120,
|
6985
7125
|
"scrollEvent": true,
|
6986
7126
|
"rowKey": props.rowKey,
|
7127
|
+
"scrollbar": {
|
7128
|
+
enabled: true
|
7129
|
+
},
|
6987
7130
|
"enabled": props.virtualEnabled,
|
6988
|
-
"keepAlive": true
|
7131
|
+
"keepAlive": true,
|
7132
|
+
"autoIndex": false
|
6989
7133
|
}), {
|
6990
7134
|
beforeContent: function beforeContent() {
|
6991
7135
|
return renderPrepend();
|
@@ -6994,8 +7138,7 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
6994
7138
|
return renderTableBodySchema(scope.data);
|
6995
7139
|
},
|
6996
7140
|
afterSection: function afterSection() {
|
6997
|
-
return [
|
6998
|
-
(0,external_vue_namespaceObject.createVNode)("div", {
|
7141
|
+
return [(0,external_vue_namespaceObject.createVNode)("div", {
|
6999
7142
|
"class": resizeColumnClass,
|
7000
7143
|
"style": resizeColumnStyle.value
|
7001
7144
|
}, null)];
|
@@ -6,7 +6,7 @@ import { ITableResponse } from '../use-attributes';
|
|
6
6
|
*/
|
7
7
|
declare const _default: (props: TablePropTypes, tableResp: ITableResponse, head?: Ref<HTMLElement>) => {
|
8
8
|
fixedWrapperClass: string;
|
9
|
-
resolveFixedColumnStyle: (column: Column
|
9
|
+
resolveFixedColumnStyle: (column: Column) => {
|
10
10
|
[x: string]: string;
|
11
11
|
};
|
12
12
|
resolveFixedColumns: (tableOffsetRight: any) => void;
|
@@ -14,8 +14,10 @@ declare const _default: (props: TablePropTypes) => {
|
|
14
14
|
resolvePageData: (filterFn?: any, sortFn?: any, column?: Column, type?: string, sortScope?: any, multiCol?: any) => void;
|
15
15
|
resolveIndexData: () => Promise<void>;
|
16
16
|
resolvePageDataBySortList: (multiCol?: any) => void;
|
17
|
+
handlePaginationChange: (filterFn?: any, sortFn?: any) => void;
|
17
18
|
resetStartEndIndex: () => void;
|
18
|
-
|
19
|
+
getCurrentPageData: () => any[];
|
20
|
+
multiFilter: (filterFnList: ((row: any, index: any, data: any) => void)[], origin?: any) => void;
|
19
21
|
sort: (sourceData: any[], sortFn: any, column: Column, type: string, sortScope: SortScope) => void;
|
20
22
|
};
|
21
23
|
export default _default;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { TablePropTypes } from '../props';
|
2
|
+
declare const _default: (props: TablePropTypes) => {
|
3
|
+
isShiftKeyDown: import("vue").Ref<boolean>;
|
4
|
+
setStore: (row: any, index: number) => boolean;
|
5
|
+
getStore: () => {
|
6
|
+
start: any;
|
7
|
+
end: any;
|
8
|
+
};
|
9
|
+
clearStore: () => void;
|
10
|
+
};
|
11
|
+
export default _default;
|
package/lib/table/props.d.ts
CHANGED
@@ -560,5 +560,13 @@ export declare const tableProps: {
|
|
560
560
|
rowDraggable: import("vue-types").VueTypeDef<any> & {
|
561
561
|
default: any;
|
562
562
|
};
|
563
|
+
/**
|
564
|
+
* 是否支持shift键多行选择
|
565
|
+
*/
|
566
|
+
shiftMultiChecked: import("vue-types").VueTypeValidableDef<boolean> & {
|
567
|
+
default: boolean;
|
568
|
+
} & {
|
569
|
+
default: boolean;
|
570
|
+
};
|
563
571
|
};
|
564
572
|
export {};
|