@kdcloudjs/table 1.2.2-canary.10 → 1.2.2-canary.12
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/LICENSE +568 -568
- package/README.md +111 -111
- package/dist/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.js +3169 -3413
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +11 -13
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/dist/kd-ui-complete.less +777 -777
- package/es/_utils/formatUtil.js +5 -1
- package/es/_utils/hooks.js +3 -3
- package/es/_utils/usePopper.js +13 -13
- package/es/locale/locale.js +7 -6
- package/es/style/color/colors.less +1 -1
- package/es/style/core/index.less +1 -1
- package/es/style/core/motion/other.less +27 -27
- package/es/style/core/motion/slide.less +53 -53
- package/es/style/core/motion.less +1 -1
- package/es/style/core/reset.less +185 -185
- package/es/style/index.less +1 -1
- package/es/style/mixins/index.less +18 -18
- package/es/style/mixins/overlay.less +21 -21
- package/es/style/mixins/reset.less +12 -12
- package/es/style/themes/default.less +445 -445
- package/es/table/base/calculations.js +3 -3
- package/es/table/base/empty.js +2 -2
- package/es/table/base/globalStyleComponent.d.ts +5 -1
- package/es/table/base/globalStyleComponent.js +11 -7
- package/es/table/base/header.js +19 -8
- package/es/table/base/helpers/SpanManager.js +2 -1
- package/es/table/base/helpers/TableDOMUtils.js +6 -5
- package/es/table/base/html-table.d.ts +1 -1
- package/es/table/base/html-table.js +16 -5
- package/es/table/base/interfaces.d.ts +2 -0
- package/es/table/base/loading.js +2 -2
- package/es/table/base/renderTemplates.js +16 -16
- package/es/table/base/styles.d.ts +2 -2
- package/es/table/base/styles.js +59 -4
- package/es/table/base/table.d.ts +1 -0
- package/es/table/base/table.js +42 -30
- package/es/table/base/utils.d.ts +1 -0
- package/es/table/base/utils.js +9 -3
- package/es/table/pipeline/features/colGroupExtendable.d.ts +1 -1
- package/es/table/pipeline/features/colGroupExtendable.js +7 -3
- package/es/table/pipeline/features/columnDrag.js +21 -12
- package/es/table/pipeline/features/columnFilter.js +5 -2
- package/es/table/pipeline/features/columnResizeWidth.js +11 -4
- package/es/table/pipeline/features/contextMenu.js +15 -8
- package/es/table/pipeline/features/featureApi/RowDragApi.js +2 -1
- package/es/table/pipeline/features/filter/DefaultFilterContent.js +5 -4
- package/es/table/pipeline/features/filter/Filter.d.ts +2 -1
- package/es/table/pipeline/features/filter/Filter.js +13 -8
- package/es/table/pipeline/features/filter/FilterPanel.d.ts +3 -1
- package/es/table/pipeline/features/filter/FilterPanel.js +15 -5
- package/es/table/pipeline/features/rangeSelection.js +10 -10
- package/es/table/pipeline/features/rowDetail.js +2 -2
- package/es/table/pipeline/features/rowDrag.js +47 -19
- package/es/table/pipeline/features/rowGrouping.js +2 -2
- package/es/table/pipeline/features/sort.js +7 -6
- package/es/table/pipeline/features/tips.js +10 -6
- package/es/table/pipeline/features/treeMode.js +5 -5
- package/es/table/pipeline/features/treeSelect.js +2 -2
- package/es/table/pipeline/pipeline.js +2 -1
- package/es/table/pivot/cross-table/buildCrossTable.js +8 -6
- package/es/table/pivot/cross-table/cross-table.js +3 -1
- package/es/table/pivot/cross-table/interfaces.d.ts +1 -1
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.js +10 -8
- package/es/table/pivot/cross-tree-table/cross-tree-table.js +11 -8
- package/es/table/pivot/pivot-utils/builders.js +3 -3
- package/es/table/pivot/pivot-utils/convert-utils.js +3 -3
- package/es/table/style/index.less +1 -1
- package/es/table/transforms/autoWidth.js +3 -3
- package/es/table/transforms/columnResize.js +5 -3
- package/es/table/transforms/sort.js +8 -6
- package/es/table/transforms/tips.js +4 -4
- package/es/table/transforms/treeMode.js +8 -6
- package/es/table/utils/buildTree.js +3 -3
- package/es/table/utils/collectNodes.js +3 -3
- package/es/table/utils/element.d.ts +1 -1
- package/es/table/utils/element.js +5 -3
- package/es/table/utils/exportTableAsExcel.js +3 -3
- package/es/table/utils/getTreeDepth.js +3 -3
- package/es/table/utils/groupBy.js +3 -3
- package/es/table/utils/makeRecursiveMapper.js +3 -3
- package/es/table/utils/mergeCellProps.js +1 -0
- package/es/table/utils/others.js +3 -3
- package/es/table/utils/traverseColumn.js +3 -3
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.js +8 -7
- package/es/table/utils/tree-data-helpers/TreeDataHelper.js +5 -4
- package/lib/_utils/arrayUtil.js +3 -2
- package/lib/_utils/formatUtil.js +5 -1
- package/lib/_utils/hooks.js +3 -3
- package/lib/_utils/index.js +3 -2
- package/lib/_utils/type.js +5 -3
- package/lib/_utils/usePopper.js +21 -18
- package/lib/config-provider/ConfigContext.js +2 -1
- package/lib/config-provider/compDefaultProps.js +2 -1
- package/lib/config-provider/configProvider.js +4 -3
- package/lib/config-provider/defaultConfig.js +2 -1
- package/lib/config-provider/index.js +2 -1
- package/lib/locale/index.js +4 -3
- package/lib/locale/locale.js +14 -10
- package/lib/locale/zh-CN.js +2 -1
- package/lib/style/color/colors.less +1 -1
- package/lib/style/components.less +1 -1
- package/lib/style/core/index.less +1 -1
- package/lib/style/core/motion/other.less +27 -27
- package/lib/style/core/motion/slide.less +53 -53
- package/lib/style/core/motion.less +1 -1
- package/lib/style/core/reset.less +185 -185
- package/lib/style/index.less +1 -1
- package/lib/style/mixins/index.less +18 -18
- package/lib/style/mixins/overlay.less +21 -21
- package/lib/style/mixins/reset.less +12 -12
- package/lib/style/themes/default.less +445 -445
- package/lib/table/base/calculations.js +3 -3
- package/lib/table/base/empty.js +4 -4
- package/lib/table/base/globalStyleComponent.d.ts +5 -1
- package/lib/table/base/globalStyleComponent.js +16 -11
- package/lib/table/base/header.js +19 -8
- package/lib/table/base/helpers/SpanManager.js +5 -3
- package/lib/table/base/helpers/TableDOMUtils.js +9 -7
- package/lib/table/base/helpers/getRichVisibleRectsStream.js +2 -2
- package/lib/table/base/html-table.d.ts +1 -1
- package/lib/table/base/html-table.js +16 -5
- package/lib/table/base/interfaces.d.ts +2 -0
- package/lib/table/base/loading.js +2 -2
- package/lib/table/base/renderTemplates.js +18 -18
- package/lib/table/base/styles.d.ts +2 -2
- package/lib/table/base/styles.js +74 -11
- package/lib/table/base/table.d.ts +1 -0
- package/lib/table/base/table.js +52 -41
- package/lib/table/base/utils.d.ts +1 -0
- package/lib/table/base/utils.js +28 -13
- package/lib/table/common-views.js +8 -4
- package/lib/table/internals.js +3 -2
- package/lib/table/pipeline/const.js +3 -2
- package/lib/table/pipeline/features/autoFill.js +6 -3
- package/lib/table/pipeline/features/colGroupExtendable.d.ts +1 -1
- package/lib/table/pipeline/features/colGroupExtendable.js +10 -5
- package/lib/table/pipeline/features/columnDrag.js +21 -12
- package/lib/table/pipeline/features/columnFilter.js +5 -2
- package/lib/table/pipeline/features/columnResizeWidth.js +19 -9
- package/lib/table/pipeline/features/contextMenu.js +16 -9
- package/lib/table/pipeline/features/featureApi/RowDragApi.js +5 -3
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +9 -7
- package/lib/table/pipeline/features/filter/Filter.d.ts +2 -1
- package/lib/table/pipeline/features/filter/Filter.js +17 -11
- package/lib/table/pipeline/features/filter/FilterPanel.d.ts +3 -1
- package/lib/table/pipeline/features/filter/FilterPanel.js +19 -8
- package/lib/table/pipeline/features/filter/util.js +3 -2
- package/lib/table/pipeline/features/footerDataSource.js +2 -1
- package/lib/table/pipeline/features/rangeSelection.js +14 -12
- package/lib/table/pipeline/features/rowDetail.js +2 -2
- package/lib/table/pipeline/features/rowDrag.js +53 -22
- package/lib/table/pipeline/features/rowGrouping.js +2 -2
- package/lib/table/pipeline/features/sort.js +7 -6
- package/lib/table/pipeline/features/tips.js +10 -6
- package/lib/table/pipeline/features/treeMode.js +9 -7
- package/lib/table/pipeline/features/treeSelect.js +2 -2
- package/lib/table/pipeline/index.js +2 -2
- package/lib/table/pipeline/pipeline.js +4 -2
- package/lib/table/pivot/cross-table/buildCrossTable.js +8 -6
- package/lib/table/pivot/cross-table/constants.js +2 -1
- package/lib/table/pivot/cross-table/cross-table.js +6 -3
- package/lib/table/pivot/cross-table/interfaces.d.ts +1 -1
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.js +10 -8
- package/lib/table/pivot/cross-tree-table/cross-tree-table.js +13 -9
- package/lib/table/pivot/pivot-utils/builders.js +3 -3
- package/lib/table/pivot/pivot-utils/convert-utils.js +3 -3
- package/lib/table/style/index.less +1 -1
- package/lib/table/transforms/autoWidth.js +5 -5
- package/lib/table/transforms/columnResize.js +7 -5
- package/lib/table/transforms/sort.js +10 -8
- package/lib/table/transforms/tips.js +4 -4
- package/lib/table/transforms/treeMode.js +10 -8
- package/lib/table/use/useResizeObserver.js +2 -1
- package/lib/table/utils/browserType.js +4 -2
- package/lib/table/utils/buildTree.js +3 -3
- package/lib/table/utils/collectNodes.js +3 -3
- package/lib/table/utils/console.js +3 -2
- package/lib/table/utils/copyToClipboard.js +2 -1
- package/lib/table/utils/element.d.ts +1 -1
- package/lib/table/utils/element.js +5 -3
- package/lib/table/utils/exportTableAsExcel.js +3 -3
- package/lib/table/utils/getTreeDepth.js +3 -3
- package/lib/table/utils/groupBy.js +3 -3
- package/lib/table/utils/keyCode.js +2 -1
- package/lib/table/utils/makeRecursiveMapper.js +3 -3
- package/lib/table/utils/mergeCellProps.js +1 -0
- package/lib/table/utils/others.js +5 -4
- package/lib/table/utils/proto.js +2 -1
- package/lib/table/utils/selectColumn.js +4 -2
- package/lib/table/utils/traverseColumn.js +3 -3
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.js +11 -9
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.js +8 -6
- package/package.json +218 -218
package/lib/table/base/styles.js
CHANGED
|
@@ -12,12 +12,14 @@ var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stabl
|
|
|
12
12
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
13
13
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/taggedTemplateLiteral"));
|
|
14
14
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
+
var _utils = require("./utils");
|
|
15
16
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
18
|
-
var LOCK_SHADOW_PADDING =
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
var LOCK_SHADOW_PADDING = 20;
|
|
20
|
+
exports.LOCK_SHADOW_PADDING = LOCK_SHADOW_PADDING;
|
|
19
21
|
var prefix = 'kd-';
|
|
20
|
-
var Classes =
|
|
22
|
+
var Classes = {
|
|
21
23
|
/** BaseTable 表格组件的外层包裹 div */
|
|
22
24
|
artTableWrapper: "".concat(prefix, "table-wrapper"),
|
|
23
25
|
artTableBordered: "".concat(prefix, "table-bordered"),
|
|
@@ -106,7 +108,8 @@ var Classes = exports.Classes = {
|
|
|
106
108
|
iconMove: "".concat(prefix, "icon-move"),
|
|
107
109
|
rowDragCell: "".concat(prefix, "row-drag-cell")
|
|
108
110
|
};
|
|
109
|
-
|
|
111
|
+
exports.Classes = Classes;
|
|
112
|
+
var MenuClasses = {
|
|
110
113
|
menu: "".concat(prefix, "table-menu"),
|
|
111
114
|
menuList: "".concat(prefix, "table-menu-list"),
|
|
112
115
|
menuOption: "".concat(prefix, "table-menu-option"),
|
|
@@ -114,6 +117,7 @@ var MenuClasses = exports.MenuClasses = {
|
|
|
114
117
|
menuOptionDisable: "".concat(prefix, "table-menu-option-disable"),
|
|
115
118
|
menuOptionText: "".concat(prefix, "table-menu-option-text")
|
|
116
119
|
};
|
|
120
|
+
exports.MenuClasses = MenuClasses;
|
|
117
121
|
var Z = {
|
|
118
122
|
lock: 5,
|
|
119
123
|
header: 15,
|
|
@@ -123,9 +127,20 @@ var Z = {
|
|
|
123
127
|
scrollItem: 30,
|
|
124
128
|
loadingIndicator: 40
|
|
125
129
|
};
|
|
126
|
-
var GlobalStyle =
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", "{\n position: absolute;\n top:0;\n ", ":0;\n z-index: 9999;\n pointer-events:none;\n user-select: none;\n\n display:flex;\n opacity: 0.9;\n align-items:center;\n min-width:80px;\n padding: 0px 8px;\n border: 1px solid #d9d9d9;\n box-shadow: 0px 6px 16px 3px rgba(0,0,0,0.08);\n border-radius: 2px;\n background: #fff;\n max-height:48px;\n\n .", "{\n font-size:12px;\n overflow:hidden;\n text-overflow: ellipsis;\n white-space:nowrap;\n }\n \n }\n\n .", "{\n position: absolute;\n top:0;\n left:0;\n z-index: 9998;\n pointer-events:none;\n user-select: none;\n height: 2px;\n background: var(--primary-color);\n }\n .", ":before{\n content: \" \";\n position: absolute;\n width: 8px;\n height: 8px;\n top:-4px;\n border: 2px solid var(--primary-color);\n border-radius: 50%;\n background:#fff;\n }\n"])), Classes.rowDragElement, function (props) {
|
|
131
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
132
|
+
}, Classes.rowDragElementLabel, Classes.rowDragLine, Classes.treeTableRowDragLine);
|
|
133
|
+
exports.GlobalStyle = GlobalStyle;
|
|
134
|
+
var outerBorderStyleMixin = (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border-top: 1px solid #cccccc;\n border-right: 1px solid #cccccc;\n border-bottom: 1px solid #cccccc;\n border-left: 1px solid #cccccc;\n\n td.", ",\n th.", " {\n border-", ": none;\n }\n td.", ",\n th.", " {\n border-", ": none;\n }\n\n thead tr.", " th,\n tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tfoot tr.", " td {\n border-bottom: none;\n }\n &:not(.has-footer) tbody tr.", " td {\n border-bottom: none;\n }\n td.", ":not(.", "){\n border-", ": var(---cell-border-vertical);\n }\n td.", ":not(.", "){\n border-", ": var(---cell-border-vertical);\n }\n"])), Classes.first, Classes.first, function (props) {
|
|
135
|
+
return props.direction === 'rtl' ? 'right' : 'left';
|
|
136
|
+
}, Classes.last, Classes.last, function (props) {
|
|
137
|
+
return props.direction === 'rtl' ? 'left' : 'right';
|
|
138
|
+
}, Classes.first, Classes.first, Classes.last, Classes.last, Classes.rowSpan, Classes.first, function (props) {
|
|
139
|
+
return props.direction === 'rtl' ? 'right' : 'left';
|
|
140
|
+
}, Classes.rowSpan, Classes.last, function (props) {
|
|
141
|
+
return props.direction === 'rtl' ? 'left' : 'right';
|
|
142
|
+
});
|
|
143
|
+
var defaultCSSVariables = {
|
|
129
144
|
'--row-height': '48px',
|
|
130
145
|
'--color': '#333',
|
|
131
146
|
'--bgcolor': 'white',
|
|
@@ -154,11 +169,59 @@ var defaultCSSVariables = exports.defaultCSSVariables = {
|
|
|
154
169
|
'--header-cell-border-horizontal': '1px solid #dfe3e8',
|
|
155
170
|
'--header-cell-border-vertical': '1px solid #dfe3e8'
|
|
156
171
|
};
|
|
157
|
-
|
|
172
|
+
exports.defaultCSSVariables = defaultCSSVariables;
|
|
173
|
+
var variableConst = getCssVariableText(defaultCSSVariables);
|
|
174
|
+
exports.variableConst = variableConst;
|
|
158
175
|
var notBorderedStyleMixin = (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n --cell-border-vertical: none;\n --header-cell-border-vertical: none;\n"])));
|
|
159
176
|
var borderedStyleMixin = (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n //th\u9690\u85CF\u5217\u5BBD\u62D6\u62FD\u7684\u80CC\u666F\u8272\uFF0C\u4F7F\u7528th\u7684\u53F3\u8FB9\u6846\u4EE3\u66FF\n .", "::after{\n background-color: inherit;\n }\n"])), Classes.tableHeaderCellResize);
|
|
160
|
-
var StyledArtTableWrapper = exports.StyledArtTableWrapper = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n :root {\n ", "\n }\n ", "\n\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n cursor: default;\n color: var(--color);\n font-size: var(--font-size);\n line-height: var(--line-height);\n position: relative;\n\n // \u8868\u683C\u5916\u8FB9\u6846\u7531 art-table-wrapper \u63D0\u4F9B\uFF0C\u800C\u4E0D\u662F\u7531\u5355\u5143\u683C\u63D0\u4F9B\n &.use-outer-border {\n ", ";\n }\n\n // \u8868\u683C\u4E0D\u542F\u7528\u8FB9\u6846\u7EBF\uFF0C\u9690\u85CFth\u3001td\u7684\u5355\u5143\u683C\u5DE6\u53F3\u8FB9\u6846\u7EBF\n &:not(.", ") {\n ", "\n }\n &.", "{\n ", "\n }\n\n .no-scrollbar {\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n .", " {\n overflow: auto;\n flex-shrink: 1;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n }\n\n .", " {\n overflow: hidden;\n background: var(--header-bgcolor);\n display: flex;\n flex-shrink: 0;\n border-bottom: var(--header-cell-border-horizontal);\n }\n\n .", " {\n display: flex;\n // justify-content: flex-start;\n align-items: center;\n height: inherit;\n }\n\n .", " {\n overflow-x:auto;\n flex-shrink: 0;\n flex-grow: 0;\n scrollbar-width: none; // \u517C\u5BB9\u706B\u72D0\n & {\n ::-webkit-scrollbar {\n display:none;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: none;\n }\n .", "{\n flex-grow:1;\n }\n .", ", .", " {\n background: var(--bgcolor);\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n position:relative;\n &.empty {\n position: relative;\n }\n }\n\n .", " {\n position: relative;\n }\n .", ", .", " {\n .", "{\n background-color: #e6effb !important;\n }\n .", "{\n border-top: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-left: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-bottom: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-right: 1px solid #0E5FD8 !important;\n }\n }\n\n .", " {\n user-select:none;\n }\n\n .", " {\n user-select:none;\n // .", " .", " >td{\n // cursor:move;\n // }\n\n // .", " .", " >td{\n // cursor:no-drop;\n // }\n \n }\n\n .", "{\n opacity: 0.5;\n }\n .", "{\n border: 1px solid var(--primary-color)\n }\n\n .", " td{\n border-top: 1px solid var(--primary-color) !important;\n border-bottom: 1px solid var(--primary-color) !important;\n \n }\n .", " td:first-child{\n border-left: 1px solid var(--primary-color) !important;\n \n }\n .", " td:last-child{\n border-right: 1px solid var(--primary-color) !important;\n \n }\n\n\n // .", " td{\n // border-top: 1px solid var(--primary-color) !important;\n // }\n\n .", " td{\n border-top: 1px solid var(--primary-color) !important;\n border-bottom: 1px solid var(--primary-color) !important;\n }\n\n .", " td:first-child{\n border-left: 1px solid var(--primary-color) !important;\n }\n\n .", " td:last-child{\n border-right: 1px solid var(--primary-color) !important;\n }\n\n // .", " td{\n // border-bottom: 1px solid var(--primary-color) !important;\n // }\n\n .", " {\n cursor:pointer;\n }\n\n\n &.sticky-header .", " {\n position: sticky;\n top: 0;\n z-index: ", ";\n }\n\n &.sticky-footer .", " {\n position: sticky;\n bottom: 0;\n z-index: ", ";\n }\n\n table {\n width: 0;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n display: table;\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n flex-grow: 0;\n position:relative;\n }\n\n // \u5728 tr \u4E0A\u8BBE\u7F6E .no-hover \u53EF\u4EE5\u7981\u7528\u9F20\u6807\u60AC\u505C\u6548\u679C\n tr:not(.no-hover):hover > td {\n background: var(--hover-bgcolor);\n }\n // \u4F7F\u7528 js \u6DFB\u52A0\u60AC\u6D6E\u6548\u679C\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n // \u5728 tr \u8BBE\u7F6E highlight \u53EF\u4EE5\u4E3A\u5E95\u4E0B\u7684 td \u8BBE\u7F6E\u4E3A\u9AD8\u4EAE\u8272\n // \u800C\u8BBE\u7F6E .no-highlight \u7684\u8BDD\u5219\u53EF\u4EE5\u7981\u7528\u9AD8\u4EAE\u6548\u679C\uFF1B\n tr:not(.no-highlight).highlight > td {\n background: var(--highlight-bgcolor);\n }\n\n th {\n font-weight: normal;\n text-align: left;\n padding: var(--cell-padding);\n height: var(--header-row-height);\n color: var(--header-color);\n background: var(--header-bgcolor);\n border:1px solid transparent;\n border-right: var(--header-cell-border-vertical);\n border-bottom: var(--header-cell-border-horizontal);\n position: relative;\n }\n\n th.resizeable{\n border-right: var(--header-cell-border-vertical)\n }\n\n th.", " {\n border-right: var(--header-cell-border-vertical);\n border-bottom: none;\n }\n\n tr.", " th {\n border-top: var(--header-cell-border-horizontal);\n }\n th.", " {\n border-left: var(--header-cell-border-vertical);\n }\n\n td {\n padding: var(--cell-padding);\n background: var(--bgcolor);\n height: var(--row-height);\n border:1px solid transparent;\n border-right: var(--cell-border-vertical);\n border-bottom: var(--cell-border-horizontal);\n word-break: break-all;\n }\n td.", " {\n border-left: var(--cell-border-vertical);\n }\n tr.", " td {\n border-top: var(--cell-border-horizontal);\n }\n &.has-header tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tbody tr.", " td {\n border-bottom: none;\n }\n\n .", ",\n .", " {\n z-index: ", ";\n }\n\n //#region \u9501\u5217\u9634\u5F71\n .", " {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: ", ";\n pointer-events: none;\n overflow: hidden;\n\n .", " {\n height: 100%;\n }\n\n .", " {\n margin-right: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-right: var(--cell-border-vertical);\n }\n }\n\n .", " {\n margin-left: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-left: var(--cell-border-vertical);\n }\n }\n }\n //#endregion\n\n //#region \u7A7A\u8868\u683C\u5C55\u73B0\n .", " {\n pointer-events: none;\n color: #99a3b3;\n font-size: 12px;\n text-align: center;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n\n .empty-image {\n width: 50px;\n height: 50px;\n }\n\n .empty-tips {\n margin-top: 16px;\n line-height: 1.5;\n }\n }\n //#endregion\n\n //#region sticky\u517C\u5BB9\n &.sticky-polyfill-wrapper{\n //\u9501\u5B9A\u5217\u517C\u5BB9 \u4EC5\u5728\u9501\u5B9A\u5217\u7684\u60C5\u51B5\u4E0B\u751F\u6548\n .", " {\n overflow-x: hidden;\n }\n .", ", .", " {\n position:relative;\n }\n .", " {\n overflow: hidden;\n display: flex;\n }\n .", " {\n position: relative;\n }\n\n .", " {\n display: flex;\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n }\n\n .", ", .", "{\n position: absolute;\n z-index: ", ";\n top: 0;\n }\n .", "{\n left:0;\n }\n .", "{\n right:0;\n }\n\n .", "{\n .", "{\n position: absolute;\n top: 0;\n width: 100%;\n z-index: ", ";\n }\n }\n\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n }\n //#endregion sticky\u517C\u5BB9\n\n //#region \u7C98\u6027\u6EDA\u52A8\u6761\n .", "{\n display:flex;\n background: var(--bgcolor);\n }\n .", "{\n height: 1px;\n flex-shrink: 0;\n border-top: 1px solid var(--border-color);\n }\n\n .", "{\n height: 1px;\n flex-shrink: 0;\n border-top: 1px solid var(--border-color);\n }\n .", " {\n overflow-y: hidden;\n overflow-x: auto;\n z-index: ", ";\n flex-shrink: 1;\n flex-grow: 0;\n border-top: 1px solid var(--border-color);\n }\n\n .", " {\n // \u5FC5\u987B\u6709\u9AD8\u5EA6\u624D\u80FD\u51FA\u73B0\u6EDA\u52A8\u6761\n height: 1px;\n visibility: hidden;\n }\n //#endregion\n\n //#region \u52A0\u8F7D\u6837\u5F0F\n .", " {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: auto;\n\n .", " {\n filter: none;\n width: 100%;\n height: 100%;\n overflow: hidden;//\u5217\u5168\u90E8\u56FA\u5B9A\u65F6\uFF0C\u5B58\u5728\u53CC\u6A2A\u5411\u6EDA\u52A8\u6761\n display: flex;\n position: relative;\n flex-direction: column;\n }\n\n .", " {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .", " {\n position: sticky;\n z-index: ", ";\n transform: translateY(-50%);\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u8FC7\u6EE4\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n padding: 6px 4px;\n &:hover{\n background-color: #e5e5e5;\n }\n &:focus {\n outline: none\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u6392\u5E8F\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u6EDA\u52A8\u6761\u5360\u4F4D\n .", " {\n // visibility: hidden;\n background: var(--header-bgcolor);\n position:sticky;\n right:0px;\n flex-shrink: 0;\n }\n .", " .", " {\n border-top: var(--cell-border-horizontal);\n }\n //#endregion\n\n //#region \u62D6\u62FD\u5217\u5BBD\u5927\u5C0F\n .", "::after{\n background-color: var(--border-color);\n }\n //\u89E3\u51B3\u90E8\u5206\u6D4F\u89C8\u5668(chrome109)\u6700\u540E\u4E00\u4E2A\u5355\u5143\u683C\u7684\u5217\u5BBD\u62D6\u62FD\u533A\u57DF\u7EDD\u5BF9\u5B9A\u4F4D\u8D85\u51FA\u8868\u683C\uFF0C\u5BFC\u81F4\u8868\u683C\u7AD6\u5206\u5272\u7EBF\u65E0\u6CD5\u5BF9\u9F50\n .", " th.", " .", "{\n right: 0;\n width: 5px;\n &::after{\n left: 4px;\n }\n }\n //#endregion\n\n "])), variableConst, variableConst, outerBorderStyleMixin, Classes.artTableBordered, notBorderedStyleMixin, Classes.artTableBordered, borderedStyleMixin, Classes.artTable, Classes.tableHeader, Classes.tableHeaderCellContent, Classes.virtual, Classes.tableFooter, Classes.tableBody, Classes.tableBody, Classes.tableFooter, Classes.tableRow, Classes.tableBody, Classes.tableFooter, Classes.tableCellRangeSelected, Classes.tableCellRangeTop, Classes.tableCellRangeLeft, Classes.tableCellRangeBottom, Classes.tableCellRangeRight, Classes.rangeSelection, Classes.rowDragging, Classes.tableBody, Classes.tableRow, Classes.tableFooter, Classes.tableRow, Classes.rowDragStart, Classes.rowDragNoData, Classes.rowDragEndParent, Classes.rowDragEndParent, Classes.rowDragEndParent, Classes.rowDragEndToTop, Classes.rowDragEndInto, Classes.rowDragEndInto, Classes.rowDragEndInto, Classes.rowDragEndToBottom, Classes.rowDragCell, Classes.tableHeader, Z.header, Classes.tableFooter, Z.footer, Classes.leaf, Classes.first, Classes.first, Classes.first, Classes.first, Classes.first, Classes.last, Classes.lockLeft, Classes.lockRight, Z.lock, Classes.lockShadowMask, Z.lockShadow, Classes.lockShadow, Classes.leftLockShadow, LOCK_SHADOW_PADDING, Classes.rightLockShadow, LOCK_SHADOW_PADDING, Classes.emptyWrapper, Classes.virtual, Classes.tableBody, Classes.tableFooter, Classes.tableHeaderMain, Classes.tableHeader, Classes.tableFooterMain, Classes.fixedLeft, Classes.fixedRight, Z.lock, Classes.fixedLeft, Classes.fixedRight, Classes.rowDetailContainer, Classes.rowDetailItem, Z.rowDetail, Classes.horizontalStickyScrollContainer, Classes.horizontalScrollLeftSpacer, Classes.horizontalScrollRightSpacer, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingContentWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator, Classes.tableFilterTrigger, Classes.tableSortIcon, Classes.tableExtendIcon, Classes.verticalScrollPlaceholder, Classes.tableFooter, Classes.verticalScrollPlaceholder, Classes.tableHeaderCellResize, Classes.tableHeaderRow, Classes.last, Classes.tableHeaderCellResize);
|
|
161
|
-
|
|
177
|
+
var StyledArtTableWrapper = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n :root {\n ", "\n }\n ", "\n\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n cursor: default;\n color: var(--color);\n font-size: var(--font-size);\n line-height: var(--line-height);\n position: relative;\n\n // \u8868\u683C\u5916\u8FB9\u6846\u7531 art-table-wrapper \u63D0\u4F9B\uFF0C\u800C\u4E0D\u662F\u7531\u5355\u5143\u683C\u63D0\u4F9B\n &.use-outer-border {\n ", ";\n }\n\n // \u8868\u683C\u4E0D\u542F\u7528\u8FB9\u6846\u7EBF\uFF0C\u9690\u85CFth\u3001td\u7684\u5355\u5143\u683C\u5DE6\u53F3\u8FB9\u6846\u7EBF\n &:not(.", ") {\n ", "\n }\n &.", "{\n ", "\n }\n\n .no-scrollbar {\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n .", " {\n overflow: auto;\n flex-shrink: 1;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n }\n\n .", " {\n overflow: hidden;\n background: var(--header-bgcolor);\n display: flex;\n flex-shrink: 0;\n border-bottom: var(--header-cell-border-horizontal);\n }\n\n .", " {\n display: flex;\n // justify-content: flex-start;\n align-items: center;\n height: inherit;\n }\n\n .", " {\n overflow-x:auto;\n flex-shrink: 0;\n flex-grow: 0;\n scrollbar-width: none; // \u517C\u5BB9\u706B\u72D0\n & {\n ::-webkit-scrollbar {\n display:none;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: none;\n }\n .", "{\n flex-grow:1;\n }\n .", ", .", " {\n background: var(--bgcolor);\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n position:relative;\n &.empty {\n position: relative;\n }\n }\n\n .", " {\n position: relative;\n }\n .", ", .", " {\n .", "{\n background-color: #e6effb !important;\n }\n .", "{\n border-top: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-", ": 1px solid #0E5FD8 !important;\n }\n .", "{\n border-bottom: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-", ": 1px solid #0E5FD8 !important;\n }\n }\n\n .", " {\n user-select:none;\n }\n\n .", " {\n user-select:none;\n // .", " .", " >td{\n // cursor:move;\n // }\n\n // .", " .", " >td{\n // cursor:no-drop;\n // }\n \n }\n\n .", "{\n opacity: 0.5;\n }\n .", "{\n border: 1px solid var(--primary-color)\n }\n\n .", " td{\n border-top: 1px solid var(--primary-color) !important;\n border-bottom: 1px solid var(--primary-color) !important;\n \n }\n .", " td:first-child{\n border-", ": 1px solid var(--primary-color) !important;\n \n }\n .", " td:last-child{\n border-", ": 1px solid var(--primary-color) !important;\n \n }\n\n\n // .", " td{\n // border-top: 1px solid var(--primary-color) !important;\n // }\n\n .", " td{\n border-top: 1px solid var(--primary-color) !important;\n border-bottom: 1px solid var(--primary-color) !important;\n }\n\n .", " td:first-child{\n border-", ": 1px solid var(--primary-color) !important;\n }\n\n .", " td:last-child{\n border-", ": 1px solid var(--primary-color) !important;\n }\n\n // .", " td{\n // border-bottom: 1px solid var(--primary-color) !important;\n // }\n\n .", " {\n cursor:pointer;\n }\n\n\n &.sticky-header .", " {\n position: sticky;\n top: 0;\n z-index: ", ";\n }\n\n &.sticky-footer .", " {\n position: sticky;\n bottom: 0;\n z-index: ", ";\n }\n\n table {\n width: 0;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n display: table;\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n flex-grow: 0;\n position:relative;\n }\n\n // \u5728 tr \u4E0A\u8BBE\u7F6E .no-hover \u53EF\u4EE5\u7981\u7528\u9F20\u6807\u60AC\u505C\u6548\u679C\n tr:not(.no-hover):hover > td {\n background: var(--hover-bgcolor);\n }\n // \u4F7F\u7528 js \u6DFB\u52A0\u60AC\u6D6E\u6548\u679C\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n // \u5728 tr \u8BBE\u7F6E highlight \u53EF\u4EE5\u4E3A\u5E95\u4E0B\u7684 td \u8BBE\u7F6E\u4E3A\u9AD8\u4EAE\u8272\n // \u800C\u8BBE\u7F6E .no-highlight \u7684\u8BDD\u5219\u53EF\u4EE5\u7981\u7528\u9AD8\u4EAE\u6548\u679C\uFF1B\n tr:not(.no-highlight).highlight > td {\n background: var(--highlight-bgcolor);\n }\n\n th {\n font-weight: normal;\n text-align: ", ";\n padding: var(--cell-padding);\n height: var(--header-row-height);\n color: var(--header-color);\n background: var(--header-bgcolor);\n border:1px solid transparent;\n border-", ": var(--header-cell-border-vertical);\n border-bottom: var(--header-cell-border-horizontal);\n position: relative;\n }\n\n th.resizeable{\n border-", ": var(--header-cell-border-vertical)\n }\n\n th.", " {\n border-", ": var(--header-cell-border-vertical);\n border-bottom: none;\n }\n\n tr.", " th {\n border-top: var(--header-cell-border-horizontal);\n }\n th.", " {\n border-", ": var(--header-cell-border-vertical);\n }\n\n td {\n padding: var(--cell-padding);\n background: var(--bgcolor);\n height: var(--row-height);\n border:1px solid transparent;\n border-", ": var(--cell-border-vertical);\n border-bottom: var(--cell-border-horizontal);\n word-break: break-all;\n }\n td.", " {\n border-", ": var(--cell-border-vertical);\n }\n tr.", " td {\n border-top: var(--cell-border-horizontal);\n }\n &.has-header tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tbody tr.", " td {\n border-bottom: none;\n }\n\n .", ",\n .", " {\n z-index: ", ";\n }\n\n //#region \u9501\u5217\u9634\u5F71\n .", " {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: ", ";\n pointer-events: none;\n overflow: hidden;\n\n .", " {\n height: 100%;\n }\n\n .", " {\n margin-", ": ", "px;\n \n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-", ": var(--cell-border-vertical);\n }\n }\n\n .", " {\n margin-", ": ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-", ": var(--cell-border-vertical);\n }\n }\n }\n //#endregion\n\n //#region \u7A7A\u8868\u683C\u5C55\u73B0\n .", " {\n pointer-events: none;\n color: #99a3b3;\n font-size: 12px;\n text-align: center;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n\n .empty-image {\n width: 50px;\n height: 50px;\n }\n\n .empty-tips {\n margin-top: 16px;\n line-height: 1.5;\n }\n }\n //#endregion\n\n //#region sticky\u517C\u5BB9\n &.sticky-polyfill-wrapper{\n //\u9501\u5B9A\u5217\u517C\u5BB9 \u4EC5\u5728\u9501\u5B9A\u5217\u7684\u60C5\u51B5\u4E0B\u751F\u6548\n .", " {\n overflow-x: hidden;\n }\n .", ", .", " {\n position:relative;\n }\n .", " {\n overflow: hidden;\n display: flex;\n }\n .", " {\n position: relative;\n }\n\n .", " {\n display: flex;\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n }\n\n .", ", .", "{\n position: absolute;\n z-index: ", ";\n top: 0;\n }\n .", "{\n ", ":0;\n }\n .", "{\n rig", "ht:0;\n }\n\n .", "{\n .", "{\n position: absolute;\n top: 0;\n width: 100%;\n z-index: ", ";\n }\n }\n\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n }\n //#endregion sticky\u517C\u5BB9\n\n //#region \u7C98\u6027\u6EDA\u52A8\u6761\n .", "{\n display:flex;\n background: var(--bgcolor);\n }\n .", "{\n height: 1px;\n flex-shrink: 0;\n border-top: 1px solid var(--border-color);\n }\n\n .", "{\n height: 1px;\n flex-shrink: 0;\n border-top: 1px solid var(--border-color);\n }\n .", " {\n overflow-y: hidden;\n overflow-x: auto;\n z-index: ", ";\n flex-shrink: 1;\n flex-grow: 0;\n border-top: 1px solid var(--border-color);\n }\n\n .", " {\n // \u5FC5\u987B\u6709\u9AD8\u5EA6\u624D\u80FD\u51FA\u73B0\u6EDA\u52A8\u6761\n height: 1px;\n visibility: hidden;\n }\n //#endregion\n\n //#region \u52A0\u8F7D\u6837\u5F0F\n .", " {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: auto;\n\n .", " {\n filter: none;\n width: 100%;\n height: 100%;\n overflow: hidden;//\u5217\u5168\u90E8\u56FA\u5B9A\u65F6\uFF0C\u5B58\u5728\u53CC\u6A2A\u5411\u6EDA\u52A8\u6761\n display: flex;\n position: relative;\n flex-direction: column;\n }\n\n .", " {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .", " {\n position: sticky;\n z-index: ", ";\n transform: translateY(-50%);\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u8FC7\u6EE4\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n padding: 6px 4px;\n &:hover{\n background-color: #e5e5e5;\n }\n &:focus {\n outline: none\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u6392\u5E8F\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u6EDA\u52A8\u6761\u5360\u4F4D\n .", " {\n // visibility: hidden;\n background: var(--header-bgcolor);\n position:sticky;\n z-index:5;\n ", ":0px;\n flex-shrink: 0;\n }\n .", " .", " {\n border-top: var(--cell-border-horizontal);\n }\n //#endregion\n\n //#region \u62D6\u62FD\u5217\u5BBD\u5927\u5C0F\n .", "::after{\n background-color: var(--border-color);\n }\n //\u89E3\u51B3\u90E8\u5206\u6D4F\u89C8\u5668(chrome109)\u6700\u540E\u4E00\u4E2A\u5355\u5143\u683C\u7684\u5217\u5BBD\u62D6\u62FD\u533A\u57DF\u7EDD\u5BF9\u5B9A\u4F4D\u8D85\u51FA\u8868\u683C\uFF0C\u5BFC\u81F4\u8868\u683C\u7AD6\u5206\u5272\u7EBF\u65E0\u6CD5\u5BF9\u9F50\n .", " th.", " .", "{\n ", ": 0;\n width: 5px;\n &::after{\n ", ": 4px;\n }\n }\n"])), variableConst, variableConst, outerBorderStyleMixin, Classes.artTableBordered, notBorderedStyleMixin, Classes.artTableBordered, borderedStyleMixin, Classes.artTable, Classes.tableHeader, Classes.tableHeaderCellContent, Classes.virtual, Classes.tableFooter, Classes.tableBody, Classes.tableBody, Classes.tableFooter, Classes.tableRow, Classes.tableBody, Classes.tableFooter, Classes.tableCellRangeSelected, Classes.tableCellRangeTop, Classes.tableCellRangeLeft, function (props) {
|
|
178
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
179
|
+
}, Classes.tableCellRangeBottom, Classes.tableCellRangeRight, function (props) {
|
|
180
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
181
|
+
}, Classes.rangeSelection, Classes.rowDragging, Classes.tableBody, Classes.tableRow, Classes.tableFooter, Classes.tableRow, Classes.rowDragStart, Classes.rowDragNoData, Classes.rowDragEndParent, Classes.rowDragEndParent, function (props) {
|
|
182
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
183
|
+
}, Classes.rowDragEndParent, function (props) {
|
|
184
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
185
|
+
}, Classes.rowDragEndToTop, Classes.rowDragEndInto, Classes.rowDragEndInto, function (props) {
|
|
186
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
187
|
+
}, Classes.rowDragEndInto, function (props) {
|
|
188
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
189
|
+
}, Classes.rowDragEndToBottom, Classes.rowDragCell, Classes.tableHeader, Z.header, Classes.tableFooter, Z.footer, function (props) {
|
|
190
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
191
|
+
}, function (props) {
|
|
192
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
193
|
+
}, function (props) {
|
|
194
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
195
|
+
}, Classes.leaf, function (props) {
|
|
196
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
197
|
+
}, Classes.first, Classes.first, function (props) {
|
|
198
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
199
|
+
}, function (props) {
|
|
200
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
201
|
+
}, Classes.first, function (props) {
|
|
202
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
203
|
+
}, Classes.first, Classes.first, Classes.last, Classes.lockLeft, Classes.lockRight, Z.lock, Classes.lockShadowMask, Z.lockShadow, Classes.lockShadow, Classes.leftLockShadow, function (props) {
|
|
204
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
205
|
+
}, LOCK_SHADOW_PADDING, function (props) {
|
|
206
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
207
|
+
}, Classes.rightLockShadow, function (props) {
|
|
208
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
209
|
+
}, LOCK_SHADOW_PADDING, function (props) {
|
|
210
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
211
|
+
}, Classes.emptyWrapper, Classes.virtual, Classes.tableBody, Classes.tableFooter, Classes.tableHeaderMain, Classes.tableHeader, Classes.tableFooterMain, Classes.fixedLeft, Classes.fixedRight, Z.lock, Classes.fixedLeft, function (props) {
|
|
212
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
213
|
+
}, Classes.fixedRight, function (props) {
|
|
214
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
215
|
+
}, Classes.rowDetailContainer, Classes.rowDetailItem, Z.rowDetail, Classes.horizontalStickyScrollContainer, Classes.horizontalScrollLeftSpacer, Classes.horizontalScrollRightSpacer, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingContentWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator, Classes.tableFilterTrigger, Classes.tableSortIcon, Classes.tableExtendIcon, Classes.verticalScrollPlaceholder, function (props) {
|
|
216
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
217
|
+
}, Classes.tableFooter, Classes.verticalScrollPlaceholder, Classes.tableHeaderCellResize, Classes.tableHeaderRow, Classes.last, Classes.tableHeaderCellResize, function (props) {
|
|
218
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'right');
|
|
219
|
+
}, function (props) {
|
|
220
|
+
return (0, _utils.swapRTLDirection)(props.direction, 'left');
|
|
221
|
+
});
|
|
222
|
+
exports.StyledArtTableWrapper = StyledArtTableWrapper;
|
|
223
|
+
var ButtonCSS = (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n .", "{\n color: var(--color);\n background:#ffffff;\n border:1px solid var(--strong-border-color);\n border-radius: 2px;\n cursor: pointer;\n &:hover{\n color: var(--primary-color);\n border:1px solid var(--primary-color);\n }\n }\n .", " {\n color:#ffffff;\n background-color: var(--primary-color);\n border:none;\n &:hover{\n color:#ffffff;\n background-color: var(--primary-color-level2);\n border:none;\n }\n }\n"])), variableConst, Classes.button, Classes.buttonPrimary);
|
|
224
|
+
exports.ButtonCSS = ButtonCSS;
|
|
162
225
|
function getCssVariableText(obj) {
|
|
163
226
|
return (0, _keys.default)(obj).reduce(function (acc, key) {
|
|
164
227
|
var _context;
|
package/lib/table/base/table.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
4
|
-
var _mapInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/map");
|
|
5
|
-
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
6
4
|
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
7
5
|
var _sliceInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
8
6
|
var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from");
|
|
@@ -23,9 +21,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
|
|
|
23
21
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
24
22
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
25
23
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
24
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
26
25
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
27
26
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
28
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
29
27
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
30
28
|
var _react = _interopRequireDefault(require("react"));
|
|
31
29
|
var _rxjs = require("rxjs");
|
|
@@ -43,13 +41,13 @@ var _globalStyleComponent = _interopRequireDefault(require("./globalStyleCompone
|
|
|
43
41
|
var _utils = require("./utils");
|
|
44
42
|
var _utils2 = require("../utils");
|
|
45
43
|
var _renderTemplates = _interopRequireDefault(require("./renderTemplates"));
|
|
46
|
-
function _getRequireWildcardCache(
|
|
47
|
-
function _interopRequireWildcard(
|
|
48
|
-
function _createForOfIteratorHelper(
|
|
49
|
-
function _unsupportedIterableToArray(
|
|
50
|
-
function _arrayLikeToArray(
|
|
51
|
-
function
|
|
52
|
-
function _isNativeReflectConstruct() {
|
|
44
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
45
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
46
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
47
|
+
function _unsupportedIterableToArray(o, minLen) { var _context2; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty2(_context2 = Object.prototype.toString.call(o)).call(_context2, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
48
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
49
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
50
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
53
51
|
var propsDotEmptyContentDeprecatedWarned = false;
|
|
54
52
|
function warnPropsDotEmptyContentIsDeprecated() {
|
|
55
53
|
if (!propsDotEmptyContentDeprecatedWarned) {
|
|
@@ -57,11 +55,13 @@ function warnPropsDotEmptyContentIsDeprecated() {
|
|
|
57
55
|
_utils2.console.warn('BaseTable props.emptyContent 已经过时,请使用 props.components.EmptyContent 来自定义数据为空时的表格表现');
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
|
-
var BaseTable =
|
|
58
|
+
var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
59
|
+
(0, _inherits2.default)(BaseTable, _React$Component);
|
|
60
|
+
var _super = _createSuper(BaseTable);
|
|
61
61
|
function BaseTable(props) {
|
|
62
62
|
var _this;
|
|
63
63
|
(0, _classCallCheck2.default)(this, BaseTable);
|
|
64
|
-
_this =
|
|
64
|
+
_this = _super.call(this, props);
|
|
65
65
|
_this.rowHeightManager = (0, _rowHeightManager.makeRowHeightManager)(_this.props.dataSource.length, _this.props.estimatedRowHeight);
|
|
66
66
|
_this.artTableWrapperRef = /*#__PURE__*/_react.default.createRef();
|
|
67
67
|
_this.hasScrollY = false;
|
|
@@ -136,13 +136,13 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
136
136
|
className: _styles.Classes.virtual,
|
|
137
137
|
tabIndex: -1,
|
|
138
138
|
style: virtualStyle
|
|
139
|
-
}, topBlank > 0 &&
|
|
139
|
+
}, topBlank > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
140
140
|
key: "top-blank",
|
|
141
141
|
className: (0, _classnames.default)(_styles.Classes.virtualBlank, 'top'),
|
|
142
142
|
style: {
|
|
143
143
|
height: topBlank
|
|
144
144
|
}
|
|
145
|
-
})
|
|
145
|
+
}), /*#__PURE__*/_react.default.createElement(_htmlTable.HtmlTable, {
|
|
146
146
|
tbodyHtmlTag: "tbody",
|
|
147
147
|
getRowProps: getRowProps,
|
|
148
148
|
primaryKey: primaryKey,
|
|
@@ -154,13 +154,13 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
154
154
|
limit: bottomIndex,
|
|
155
155
|
last: dataSource.length - 1
|
|
156
156
|
}
|
|
157
|
-
}), bottomBlank > 0 &&
|
|
157
|
+
}), bottomBlank > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
158
158
|
key: "bottom-blank",
|
|
159
159
|
className: (0, _classnames.default)(_styles.Classes.virtualBlank, 'bottom'),
|
|
160
160
|
style: {
|
|
161
161
|
height: bottomBlank
|
|
162
162
|
}
|
|
163
|
-
})))
|
|
163
|
+
})));
|
|
164
164
|
};
|
|
165
165
|
_this.state = {
|
|
166
166
|
hasScroll: true,
|
|
@@ -177,8 +177,7 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
177
177
|
return _this;
|
|
178
178
|
}
|
|
179
179
|
/** @deprecated BaseTable.getDoms() 已经过时,请勿调用 */
|
|
180
|
-
(0,
|
|
181
|
-
return (0, _createClass2.default)(BaseTable, [{
|
|
180
|
+
(0, _createClass2.default)(BaseTable, [{
|
|
182
181
|
key: "getDoms",
|
|
183
182
|
value: function getDoms() {
|
|
184
183
|
_utils2.console.warn('[kd-table] BaseTable.getDoms() 已经过时');
|
|
@@ -296,11 +295,15 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
296
295
|
}, {
|
|
297
296
|
key: "syncHorizontalScroll",
|
|
298
297
|
value: function syncHorizontalScroll(x) {
|
|
299
|
-
this.
|
|
298
|
+
var direction = this.props.direction;
|
|
299
|
+
var _x = Math.abs(x);
|
|
300
|
+
this.updateOffsetX(_x);
|
|
300
301
|
var flat = (0, _flat.default)(this.lastInfo);
|
|
302
|
+
var shouldShowLeftByScroll = _x > 0;
|
|
303
|
+
var shouldShowRighByScroll = _x < this.domHelper.virtual.scrollWidth - this.domHelper.virtual.clientWidth;
|
|
301
304
|
var leftLockShadow = this.domHelper.getLeftLockShadow();
|
|
302
305
|
if (leftLockShadow) {
|
|
303
|
-
var shouldShowLeftLockShadow = flat.left.length > 0 && this.state.needRenderLock &&
|
|
306
|
+
var shouldShowLeftLockShadow = flat.left.length > 0 && this.state.needRenderLock && shouldShowLeftByScroll;
|
|
304
307
|
if (shouldShowLeftLockShadow) {
|
|
305
308
|
leftLockShadow.classList.add('show-shadow');
|
|
306
309
|
} else {
|
|
@@ -309,7 +312,7 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
309
312
|
}
|
|
310
313
|
var rightLockShadow = this.domHelper.getRightLockShadow();
|
|
311
314
|
if (rightLockShadow) {
|
|
312
|
-
var shouldShowRightLockShadow = flat.right.length > 0 && this.state.needRenderLock &&
|
|
315
|
+
var shouldShowRightLockShadow = flat.right.length > 0 && this.state.needRenderLock && shouldShowRighByScroll;
|
|
313
316
|
if (shouldShowRightLockShadow) {
|
|
314
317
|
rightLockShadow.classList.add('show-shadow');
|
|
315
318
|
} else {
|
|
@@ -381,22 +384,19 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
381
384
|
}, {
|
|
382
385
|
key: "renderLockShadows",
|
|
383
386
|
value: function renderLockShadows(info) {
|
|
387
|
+
var _style, _style2;
|
|
384
388
|
var stickyRightOffset = this.hasScrollY ? this.getScrollBarWidth() : 0;
|
|
385
389
|
// console.log('render LockShadows')
|
|
390
|
+
var leftLockShadowWidth = info.leftLockTotalWidth + _styles.LOCK_SHADOW_PADDING;
|
|
391
|
+
var rightLockShadownWidth = info.rightLockTotalWidth + _styles.LOCK_SHADOW_PADDING + stickyRightOffset;
|
|
386
392
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
387
393
|
className: _styles.Classes.lockShadowMask,
|
|
388
|
-
style: {
|
|
389
|
-
left: 0,
|
|
390
|
-
width: info.leftLockTotalWidth + _styles.LOCK_SHADOW_PADDING
|
|
391
|
-
}
|
|
394
|
+
style: (_style = {}, (0, _defineProperty2.default)(_style, (0, _utils.swapRTLDirection)(info.direction, 'left'), 0), (0, _defineProperty2.default)(_style, "width", leftLockShadowWidth), _style)
|
|
392
395
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
393
396
|
className: (0, _classnames.default)(_styles.Classes.lockShadow, _styles.Classes.leftLockShadow)
|
|
394
397
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
395
398
|
className: _styles.Classes.lockShadowMask,
|
|
396
|
-
style: {
|
|
397
|
-
right: 0,
|
|
398
|
-
width: info.rightLockTotalWidth + _styles.LOCK_SHADOW_PADDING + stickyRightOffset
|
|
399
|
-
}
|
|
399
|
+
style: (_style2 = {}, (0, _defineProperty2.default)(_style2, (0, _utils.swapRTLDirection)(info.direction, 'right'), 0), (0, _defineProperty2.default)(_style2, "width", rightLockShadownWidth), _style2)
|
|
400
400
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
401
401
|
className: (0, _classnames.default)(_styles.Classes.lockShadow, _styles.Classes.rightLockShadow)
|
|
402
402
|
})));
|
|
@@ -460,6 +460,7 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
460
460
|
}, {
|
|
461
461
|
key: "render",
|
|
462
462
|
value: function render() {
|
|
463
|
+
var _cx;
|
|
463
464
|
// console.log('render table')
|
|
464
465
|
var info = (0, _calculations.calculateRenderInfo)(this);
|
|
465
466
|
this.lastInfo = info;
|
|
@@ -476,8 +477,10 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
476
477
|
getTableProps = _this$props7.getTableProps,
|
|
477
478
|
footerDataSource = _this$props7.footerDataSource,
|
|
478
479
|
components = _this$props7.components,
|
|
479
|
-
bordered = _this$props7.bordered
|
|
480
|
-
|
|
480
|
+
bordered = _this$props7.bordered,
|
|
481
|
+
direction = _this$props7.direction;
|
|
482
|
+
info.direction = direction;
|
|
483
|
+
var artTableWrapperClassName = (0, _classnames.default)(_styles.Classes.artTableWrapper, (_cx = {
|
|
481
484
|
'use-outer-border': useOuterBorder,
|
|
482
485
|
empty: dataSource.length === 0,
|
|
483
486
|
lock: info.hasLockColumn,
|
|
@@ -485,13 +488,19 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
485
488
|
'sticky-header': isStickyHeader !== null && isStickyHeader !== void 0 ? isStickyHeader : isStickyHead,
|
|
486
489
|
'has-footer': footerDataSource.length > 0,
|
|
487
490
|
'sticky-footer': isStickyFooter
|
|
488
|
-
}, _styles.Classes.artTableBordered, bordered), 'ie-polyfill-wrapper', _utils2.browserType.isIE), 'sticky-polyfill-wrapper', (0, _utils2.isStickyUIDegrade)()), className);
|
|
491
|
+
}, (0, _defineProperty2.default)(_cx, _styles.Classes.artTableBordered, bordered), (0, _defineProperty2.default)(_cx, 'ie-polyfill-wrapper', _utils2.browserType.isIE), (0, _defineProperty2.default)(_cx, 'sticky-polyfill-wrapper', (0, _utils2.isStickyUIDegrade)()), _cx), className);
|
|
489
492
|
var artTableWrapperProps = (0, _defineProperty2.default)({
|
|
490
493
|
className: artTableWrapperClassName,
|
|
491
|
-
style: style
|
|
494
|
+
style: (0, _extends2.default)((0, _extends2.default)({}, style), {
|
|
495
|
+
direction: direction
|
|
496
|
+
})
|
|
492
497
|
}, _utils.STYLED_REF_PROP, this.artTableWrapperRef);
|
|
493
498
|
var tableProps = getTableProps() || {};
|
|
494
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_globalStyleComponent.default,
|
|
499
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_globalStyleComponent.default, {
|
|
500
|
+
direction: info.direction
|
|
501
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.StyledArtTableWrapper, (0, _extends2.default)({}, artTableWrapperProps, {
|
|
502
|
+
direction: info.direction
|
|
503
|
+
}), /*#__PURE__*/_react.default.createElement(_loading.default, {
|
|
495
504
|
visible: isLoading,
|
|
496
505
|
LoadingIcon: components.LoadingIcon,
|
|
497
506
|
LoadingContentWrapper: components.LoadingContentWrapper
|
|
@@ -594,9 +603,9 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
594
603
|
}));
|
|
595
604
|
var richVisibleRects$ = (0, _getRichVisibleRectsStream.getRichVisibleRectsStream)(this.domHelper.virtual, this.props$.pipe(op.skip(1), op.mapTo('structure-may-change')), this.props.virtualDebugLabel).pipe(op.shareReplay());
|
|
596
605
|
// 每当可见部分发生变化的时候,调整 loading icon 的未知(如果 loading icon 存在的话)
|
|
597
|
-
this.rootSubscription.add((0, _rxjs.combineLatest)([richVisibleRects$.pipe(
|
|
606
|
+
this.rootSubscription.add((0, _rxjs.combineLatest)([richVisibleRects$.pipe(op.map(function (p) {
|
|
598
607
|
return p.clipRect;
|
|
599
|
-
}), op.distinctUntilChanged(_utils.shallowEqual)), this.props$.pipe(op.startWith(null), op.pairwise(),
|
|
608
|
+
}), op.distinctUntilChanged(_utils.shallowEqual)), this.props$.pipe(op.startWith(null), op.pairwise(), op.filter(function (_ref) {
|
|
600
609
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
601
610
|
prevProps = _ref2[0],
|
|
602
611
|
props = _ref2[1];
|
|
@@ -614,12 +623,12 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
614
623
|
loadingIndicator.style.marginTop = "".concat(height / 2, "px");
|
|
615
624
|
}));
|
|
616
625
|
// 每当可见部分发生变化的时候,如果开启了虚拟滚动,则重新触发 render
|
|
617
|
-
this.rootSubscription.add(richVisibleRects$.pipe(
|
|
626
|
+
this.rootSubscription.add(richVisibleRects$.pipe(op.filter(function () {
|
|
618
627
|
var _this2$lastInfo$useVi = _this2.lastInfo.useVirtual,
|
|
619
628
|
horizontal = _this2$lastInfo$useVi.horizontal,
|
|
620
629
|
vertical = _this2$lastInfo$useVi.vertical;
|
|
621
630
|
return horizontal || vertical;
|
|
622
|
-
}),
|
|
631
|
+
}), op.map(function (_ref5) {
|
|
623
632
|
var clipRect = _ref5.clipRect,
|
|
624
633
|
offsetY = _ref5.offsetY;
|
|
625
634
|
return {
|
|
@@ -637,7 +646,7 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
637
646
|
})).subscribe(function (sizeAndOffset) {
|
|
638
647
|
_this2.setState(sizeAndOffset);
|
|
639
648
|
}));
|
|
640
|
-
this.rootSubscription.add(richVisibleRects$.pipe(
|
|
649
|
+
this.rootSubscription.add(richVisibleRects$.pipe(op.map(function (_ref6) {
|
|
641
650
|
var clipRect = _ref6.clipRect,
|
|
642
651
|
offsetY = _ref6.offsetY;
|
|
643
652
|
return {
|
|
@@ -649,7 +658,7 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
649
658
|
return x.offsetY - y.offsetY === 0;
|
|
650
659
|
}),
|
|
651
660
|
// 计算得到当前行索引对应的数据块,blocks改成数组的形式,兼容快速拖动可视区域出现两个数据块的情况
|
|
652
|
-
|
|
661
|
+
op.map(function (sizeAndOffset) {
|
|
653
662
|
var _a;
|
|
654
663
|
var offsetY = sizeAndOffset.offsetY,
|
|
655
664
|
maxRenderHeight = sizeAndOffset.maxRenderHeight;
|
|
@@ -667,7 +676,7 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
667
676
|
return x[0] === y[0] && x[1] === y[1];
|
|
668
677
|
}), op.switchMap(function (startIndexs) {
|
|
669
678
|
var event$ = (0, _rxjs.from)(startIndexs);
|
|
670
|
-
return event$.pipe(
|
|
679
|
+
return event$.pipe(op.map(function (startIndex) {
|
|
671
680
|
return startIndex;
|
|
672
681
|
}));
|
|
673
682
|
}),
|
|
@@ -765,7 +774,9 @@ var BaseTable = exports.BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
765
774
|
}
|
|
766
775
|
}
|
|
767
776
|
}]);
|
|
777
|
+
return BaseTable;
|
|
768
778
|
}(_react.default.Component);
|
|
779
|
+
exports.BaseTable = BaseTable;
|
|
769
780
|
BaseTable.defaultProps = {
|
|
770
781
|
hasHeader: true,
|
|
771
782
|
isStickyHeader: true,
|
|
@@ -43,4 +43,5 @@ export declare const cssPolifill: ({ variables, enableCSSVariables, bordered }:
|
|
|
43
43
|
enableCSSVariables?: boolean;
|
|
44
44
|
bordered?: boolean;
|
|
45
45
|
}) => void;
|
|
46
|
+
export declare const swapRTLDirection: (direction: string, directionKey: 'left' | 'right') => 'left' | 'right';
|
|
46
47
|
export {};
|
package/lib/table/base/utils.js
CHANGED
|
@@ -20,6 +20,7 @@ exports.getTableScrollFooterDOM = getTableScrollFooterDOM;
|
|
|
20
20
|
exports.getTableScrollHeaderDOM = getTableScrollHeaderDOM;
|
|
21
21
|
exports.shallowEqual = shallowEqual;
|
|
22
22
|
exports.sum = sum;
|
|
23
|
+
exports.swapRTLDirection = void 0;
|
|
23
24
|
exports.syncScrollLeft = syncScrollLeft;
|
|
24
25
|
exports.throttledWindowResize$ = void 0;
|
|
25
26
|
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
@@ -36,16 +37,20 @@ var _mergeCellProps = _interopRequireDefault(require("../utils/mergeCellProps"))
|
|
|
36
37
|
var _utils = require("../utils");
|
|
37
38
|
var _styles = require("./styles");
|
|
38
39
|
var _element = require("../utils/element");
|
|
39
|
-
function _getRequireWildcardCache(
|
|
40
|
-
function _interopRequireWildcard(
|
|
41
|
-
function _createForOfIteratorHelper(
|
|
42
|
-
function _unsupportedIterableToArray(
|
|
43
|
-
function _arrayLikeToArray(
|
|
40
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
41
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
42
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
43
|
+
function _unsupportedIterableToArray(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
44
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
44
45
|
/** styled-components 类库的版本,ali-react-table 同时支持 v3 和 v5 */
|
|
45
|
-
var STYLED_VERSION =
|
|
46
|
-
|
|
47
|
-
var
|
|
48
|
-
|
|
46
|
+
var STYLED_VERSION = styledComponents.createGlobalStyle != null ? 'v5' : 'v3';
|
|
47
|
+
exports.STYLED_VERSION = STYLED_VERSION;
|
|
48
|
+
var STYLED_REF_PROP = STYLED_VERSION === 'v3' ? 'innerRef' : 'ref';
|
|
49
|
+
exports.STYLED_REF_PROP = STYLED_REF_PROP;
|
|
50
|
+
var OVERSCAN_SIZE = 100;
|
|
51
|
+
exports.OVERSCAN_SIZE = OVERSCAN_SIZE;
|
|
52
|
+
var AUTO_VIRTUAL_THRESHOLD = 100;
|
|
53
|
+
exports.AUTO_VIRTUAL_THRESHOLD = AUTO_VIRTUAL_THRESHOLD;
|
|
49
54
|
function sum(arr) {
|
|
50
55
|
var result = 0;
|
|
51
56
|
arr.forEach(function (x) {
|
|
@@ -54,7 +59,7 @@ function sum(arr) {
|
|
|
54
59
|
return result;
|
|
55
60
|
}
|
|
56
61
|
// 使用 defer 避免过早引用 window,导致在 SSR 场景下报错
|
|
57
|
-
var throttledWindowResize$ =
|
|
62
|
+
var throttledWindowResize$ = (0, _rxjs.defer)(function () {
|
|
58
63
|
return (0, _rxjs.fromEvent)(window, 'resize', {
|
|
59
64
|
passive: true
|
|
60
65
|
}).pipe((0, _operators.throttleTime)(150, _rxjs.asyncScheduler, {
|
|
@@ -62,7 +67,8 @@ var throttledWindowResize$ = exports.throttledWindowResize$ = (0, _rxjs.defer)(f
|
|
|
62
67
|
trailing: true
|
|
63
68
|
}));
|
|
64
69
|
});
|
|
65
|
-
|
|
70
|
+
exports.throttledWindowResize$ = throttledWindowResize$;
|
|
71
|
+
var addResizeObserver = function addResizeObserver(element, handler) {
|
|
66
72
|
var measure = function measure(entries) {
|
|
67
73
|
if (!entries[0] || !entries[0].contentRect) {
|
|
68
74
|
return;
|
|
@@ -79,6 +85,7 @@ var addResizeObserver = exports.addResizeObserver = function addResizeObserver(e
|
|
|
79
85
|
return resizeObserver;
|
|
80
86
|
};
|
|
81
87
|
/** 获取默认的滚动条大小 */
|
|
88
|
+
exports.addResizeObserver = addResizeObserver;
|
|
82
89
|
function getScrollbarSizeImpl() {
|
|
83
90
|
var scrollDiv = document.createElement('div');
|
|
84
91
|
scrollDiv.style.position = 'absolute';
|
|
@@ -205,7 +212,7 @@ function getTableScrollHeaderDOM(domHelper) {
|
|
|
205
212
|
function getTableScrollFooterDOM(domHelper) {
|
|
206
213
|
return (0, _utils.isStickyUIDegrade)() ? domHelper.tableFooterMain : domHelper.tableFooter;
|
|
207
214
|
}
|
|
208
|
-
var cssPolifill =
|
|
215
|
+
var cssPolifill = function cssPolifill(_ref) {
|
|
209
216
|
var variables = _ref.variables,
|
|
210
217
|
enableCSSVariables = _ref.enableCSSVariables,
|
|
211
218
|
bordered = _ref.bordered;
|
|
@@ -227,4 +234,12 @@ var cssPolifill = exports.cssPolifill = function cssPolifill(_ref) {
|
|
|
227
234
|
watch: true,
|
|
228
235
|
silent: true
|
|
229
236
|
});
|
|
230
|
-
};
|
|
237
|
+
};
|
|
238
|
+
exports.cssPolifill = cssPolifill;
|
|
239
|
+
var swapRTLDirection = function swapRTLDirection(direction, directionKey) {
|
|
240
|
+
var isRTL = direction === 'rtl';
|
|
241
|
+
if (directionKey === 'left' && isRTL) return 'right';
|
|
242
|
+
if (directionKey === 'right' && isRTL) return 'left';
|
|
243
|
+
return directionKey;
|
|
244
|
+
};
|
|
245
|
+
exports.swapRTLDirection = swapRTLDirection;
|