@kdcloudjs/table 1.2.2-canary.11 → 1.2.2-canary.13
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 +3628 -3483
- 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/BlankComponent.d.ts +11 -0
- package/es/table/base/BlankComponent.js +61 -0
- 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/FastScrollManager.d.ts +96 -0
- package/es/table/base/helpers/FastScrollManager.js +167 -0
- 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 +14 -0
- package/es/table/base/table.js +163 -98
- 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/BlankComponent.d.ts +11 -0
- package/lib/table/base/BlankComponent.js +75 -0
- 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/FastScrollManager.d.ts +96 -0
- package/lib/table/base/helpers/FastScrollManager.js +175 -0
- 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 +14 -0
- package/lib/table/base/table.js +173 -109
- 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
|
@@ -23,8 +23,8 @@ var _utils = require("../../../utils");
|
|
|
23
23
|
var _utils2 = require("../../../base/utils");
|
|
24
24
|
var _keyCode = _interopRequireDefault(require("../../../utils/keyCode"));
|
|
25
25
|
var _templateObject;
|
|
26
|
-
function _getRequireWildcardCache(
|
|
27
|
-
function _interopRequireWildcard(
|
|
26
|
+
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); }
|
|
27
|
+
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; }
|
|
28
28
|
var HEADER_ICON_OFFSET_Y = 8 + 1; // padding-top + border
|
|
29
29
|
var HEADER_ICON_OFFSET_X = 16 + 1; // padding-left+ border
|
|
30
30
|
var FilterIconSpanStyle = _styledComponents.default.span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n // position: absolute;\n // right: 4px;\n // cursor: pointer;\n // transform: translateY(-50%);\n // top: 50%;\n // height: 12px; \n > .", " {\n display: flex\n }\n"])), _styles.Classes.filterIcon);
|
|
@@ -34,9 +34,10 @@ function Panel(_ref) {
|
|
|
34
34
|
hidePanel = _ref.hidePanel,
|
|
35
35
|
renderPanelContent = _ref.renderPanelContent,
|
|
36
36
|
hideFilterPopupHeader = _ref.hideFilterPopupHeader,
|
|
37
|
-
popupParent = _ref.popupParent
|
|
37
|
+
popupParent = _ref.popupParent,
|
|
38
|
+
direction = _ref.direction;
|
|
38
39
|
var filterPanelRef = _react.default.useRef(null);
|
|
39
|
-
var _React$useState = _react.default.useState((0, _utils.calculatePopupRelative)(ele, popupParent, _getPanelOffset(ele, hideFilterPopupHeader))),
|
|
40
|
+
var _React$useState = _react.default.useState((0, _utils.calculatePopupRelative)(ele, popupParent, _getPanelOffset(ele, hideFilterPopupHeader), direction)),
|
|
40
41
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
41
42
|
position = _React$useState2[0],
|
|
42
43
|
setPosition = _React$useState2[1];
|
|
@@ -45,7 +46,7 @@ function Panel(_ref) {
|
|
|
45
46
|
zIndex: 1050
|
|
46
47
|
};
|
|
47
48
|
var handleFilterPanelResize = function handleFilterPanelResize(resize) {
|
|
48
|
-
setPosition((0, _utils.calculatePopupRelative)(ele, popupParent, _getPanelOffset(ele, hideFilterPopupHeader)));
|
|
49
|
+
setPosition((0, _utils.calculatePopupRelative)(ele, popupParent, _getPanelOffset(ele, hideFilterPopupHeader), direction));
|
|
49
50
|
};
|
|
50
51
|
(0, _react.useEffect)(function () {
|
|
51
52
|
var resizeObserver = (0, _utils2.addResizeObserver)(filterPanelRef.current.children[0], handleFilterPanelResize);
|
|
@@ -60,10 +61,12 @@ function Panel(_ref) {
|
|
|
60
61
|
onClose: hidePanel,
|
|
61
62
|
position: position,
|
|
62
63
|
filterIcon: filterIcon,
|
|
63
|
-
hideFilterPopupHeader: hideFilterPopupHeader
|
|
64
|
+
hideFilterPopupHeader: hideFilterPopupHeader,
|
|
65
|
+
direction: direction
|
|
64
66
|
}, renderPanelContent()));
|
|
65
67
|
}
|
|
66
68
|
function Filter(_ref2) {
|
|
69
|
+
var _cx;
|
|
67
70
|
var _ref2$size = _ref2.size,
|
|
68
71
|
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
69
72
|
style = _ref2.style,
|
|
@@ -78,7 +81,8 @@ function Filter(_ref2) {
|
|
|
78
81
|
stopESCKeyDownEventPropagation = _ref2.stopESCKeyDownEventPropagation,
|
|
79
82
|
hideFilterPopupHeader = _ref2.hideFilterPopupHeader,
|
|
80
83
|
getPopupParent = _ref2.getPopupParent,
|
|
81
|
-
localeText = _ref2.localeText
|
|
84
|
+
localeText = _ref2.localeText,
|
|
85
|
+
direction = _ref2.direction;
|
|
82
86
|
var _React$useState3 = _react.default.useState(false),
|
|
83
87
|
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
84
88
|
showPanel = _React$useState4[0],
|
|
@@ -126,7 +130,7 @@ function Filter(_ref2) {
|
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
132
|
};
|
|
129
|
-
var iconClassName = (0, _classnames.default)((
|
|
133
|
+
var iconClassName = (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, className, true), (0, _defineProperty2.default)(_cx, 'filter-panel-open', showPanel), _cx));
|
|
130
134
|
var displayFilterIcon = typeof filterIcon === 'function' ? filterIcon(isFilterActive) : filterIcon;
|
|
131
135
|
var popupParent = (getPopupParent === null || getPopupParent === void 0 ? void 0 : getPopupParent(iconWrapRef.current)) || document.body;
|
|
132
136
|
return /*#__PURE__*/_react.default.createElement(FilterIconSpanStyle, {
|
|
@@ -142,13 +146,14 @@ function Filter(_ref2) {
|
|
|
142
146
|
}, displayFilterIcon || /*#__PURE__*/_react.default.createElement(_DefaultFilterIcon.default, {
|
|
143
147
|
width: size,
|
|
144
148
|
height: size
|
|
145
|
-
})), showPanel && /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement(Panel, {
|
|
149
|
+
})), showPanel && /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(Panel, {
|
|
146
150
|
ele: hideFilterPopupHeader ? iconWrapRef.current : iconRef.current,
|
|
147
151
|
filterIcon: displayFilterIcon,
|
|
148
152
|
hidePanel: hidePanel,
|
|
149
153
|
renderPanelContent: renderPanelContent,
|
|
150
154
|
hideFilterPopupHeader: hideFilterPopupHeader,
|
|
151
|
-
popupParent: popupParent
|
|
155
|
+
popupParent: popupParent,
|
|
156
|
+
direction: direction
|
|
152
157
|
}), popupParent));
|
|
153
158
|
}
|
|
154
159
|
function _getPanelOffset(ele, hideFilterPopupHeader) {
|
|
@@ -163,4 +168,5 @@ function _getPanelOffset(ele, hideFilterPopupHeader) {
|
|
|
163
168
|
y: HEADER_ICON_OFFSET_Y
|
|
164
169
|
};
|
|
165
170
|
}
|
|
166
|
-
var _default =
|
|
171
|
+
var _default = Filter;
|
|
172
|
+
exports.default = _default;
|
|
@@ -9,13 +9,15 @@ export interface FilterPanel {
|
|
|
9
9
|
style?: CSSProperties;
|
|
10
10
|
filterIcon: ReactNode;
|
|
11
11
|
children?: ReactNode;
|
|
12
|
+
direction?: string;
|
|
12
13
|
}
|
|
13
|
-
declare function FilterPanel({ style, children, position, filterIcon, onClose, hideFilterPopupHeader }: {
|
|
14
|
+
declare function FilterPanel({ style, children, position, filterIcon, onClose, hideFilterPopupHeader, direction }: {
|
|
14
15
|
style: any;
|
|
15
16
|
children: any;
|
|
16
17
|
position: any;
|
|
17
18
|
filterIcon: any;
|
|
18
19
|
onClose: any;
|
|
19
20
|
hideFilterPopupHeader: any;
|
|
21
|
+
direction: any;
|
|
20
22
|
}): JSX.Element;
|
|
21
23
|
export default FilterPanel;
|
|
@@ -18,8 +18,8 @@ var _DefaultFilterIcon = _interopRequireDefault(require("./DefaultFilterIcon"));
|
|
|
18
18
|
var _styles = require("../../../base/styles");
|
|
19
19
|
var _keyCode = _interopRequireDefault(require("../../../utils/keyCode"));
|
|
20
20
|
var _templateObject;
|
|
21
|
-
function _getRequireWildcardCache(
|
|
22
|
-
function _interopRequireWildcard(
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
23
|
var FilterPanelStyle = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n max-height: 450px;\n min-width: 160px;\n border-radius: 2px;\n background-color: #fff;\n box-shadow: 0 0 5px 0 rgba(154,154,154,.5);\n cursor: default;\n\n .", " {\n display: flex;\n background-color: #ebedf1;\n\n .", " {\n display: flex;\n color:#666;\n background-color: #fff;\n padding: 8px 16px 8px 16px;\n border-right: 1px solid transparent;\n border-left: 1px solid transparent;\n border-top: 1px solid transparent;\n border-top-right-radius: 2px;\n border-top-left-radius: 2px;\n }\n }\n\n .", " {\n display: flex;\n }\n"])), _styles.Classes.popupHeader, _styles.Classes.filterIcon, _styles.Classes.popupBody);
|
|
24
24
|
var useWindowEvents = function useWindowEvents(func, evens) {
|
|
25
25
|
_react.default.useEffect(function () {
|
|
@@ -39,7 +39,8 @@ function FilterPanel(_ref) {
|
|
|
39
39
|
position = _ref.position,
|
|
40
40
|
filterIcon = _ref.filterIcon,
|
|
41
41
|
onClose = _ref.onClose,
|
|
42
|
-
hideFilterPopupHeader = _ref.hideFilterPopupHeader
|
|
42
|
+
hideFilterPopupHeader = _ref.hideFilterPopupHeader,
|
|
43
|
+
direction = _ref.direction;
|
|
43
44
|
var _useState = (0, _react.useState)(position),
|
|
44
45
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
45
46
|
perfectPosition = _useState2[0],
|
|
@@ -53,9 +54,16 @@ function FilterPanel(_ref) {
|
|
|
53
54
|
return (0, _utils.isElementInEventPath)(ref.current, e);
|
|
54
55
|
};
|
|
55
56
|
(0, _react.useEffect)(function () {
|
|
56
|
-
|
|
57
|
+
var _a;
|
|
58
|
+
var isRTL = direction === 'rtl';
|
|
59
|
+
var x = position.x,
|
|
60
|
+
y = position.y;
|
|
61
|
+
if (isRTL) {
|
|
62
|
+
x -= (_a = ref.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
|
|
63
|
+
}
|
|
64
|
+
setPerfectPosition((0, _utils.keepWithinBounds)(document.body, ref.current, x, y, true));
|
|
57
65
|
setVisible(true);
|
|
58
|
-
}, [position]);
|
|
66
|
+
}, [position, direction]);
|
|
59
67
|
var hasPopupMouseEvent = (0, _react.useRef)(false);
|
|
60
68
|
var handleMouseEvent = function handleMouseEvent() {
|
|
61
69
|
// 当弹出的过滤面板内部发生鼠标按下、抬起事件时,标记当前事件,并在click捕获期清除标记,用来确定鼠标按下、抬起发生在过滤面板内部
|
|
@@ -77,13 +85,15 @@ function FilterPanel(_ref) {
|
|
|
77
85
|
style: (0, _extends2.default)((0, _extends2.default)({}, style), {
|
|
78
86
|
left: visible ? perfectPosition.x : 0,
|
|
79
87
|
top: visible ? perfectPosition.y : 0,
|
|
80
|
-
opacity: visible ? 1 : 0
|
|
88
|
+
opacity: visible ? 1 : 0,
|
|
89
|
+
direction: direction
|
|
81
90
|
}),
|
|
82
91
|
onMouseDown: handleMouseEvent,
|
|
83
92
|
onMouseUp: handleMouseEvent,
|
|
84
93
|
onKeyDown: handleKeyDown,
|
|
85
94
|
ref: ref,
|
|
86
|
-
tabIndex: -1
|
|
95
|
+
tabIndex: -1,
|
|
96
|
+
direction: direction
|
|
87
97
|
}, !hideFilterPopupHeader ? /*#__PURE__*/_react.default.createElement("div", {
|
|
88
98
|
className: _styles.Classes.popupHeader
|
|
89
99
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -95,4 +105,5 @@ function FilterPanel(_ref) {
|
|
|
95
105
|
className: _styles.Classes.popupBody
|
|
96
106
|
}, children));
|
|
97
107
|
}
|
|
98
|
-
var _default =
|
|
108
|
+
var _default = FilterPanel;
|
|
109
|
+
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.DEFAULT_FILTER_OPTIONS = void 0;
|
|
8
8
|
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
9
|
-
var DEFAULT_FILTER_OPTIONS =
|
|
9
|
+
var DEFAULT_FILTER_OPTIONS = [{
|
|
10
10
|
title: '包含',
|
|
11
11
|
key: 'contain',
|
|
12
12
|
filter: function filter(value) {
|
|
@@ -66,4 +66,5 @@ var DEFAULT_FILTER_OPTIONS = exports.DEFAULT_FILTER_OPTIONS = [{
|
|
|
66
66
|
return !!data;
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
}];
|
|
69
|
+
}];
|
|
70
|
+
exports.DEFAULT_FILTER_OPTIONS = DEFAULT_FILTER_OPTIONS;
|
|
@@ -10,7 +10,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/he
|
|
|
10
10
|
var _extends3 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
11
11
|
var _symbol = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/symbol"));
|
|
12
12
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
13
|
-
var footerRowMetaSymbol =
|
|
13
|
+
var footerRowMetaSymbol = (0, _symbol.default)('footer-row');
|
|
14
|
+
exports.footerRowMetaSymbol = footerRowMetaSymbol;
|
|
14
15
|
function footerDataSource() {
|
|
15
16
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
17
|
return function footerDataSourceStep(pipeline) {
|
|
@@ -14,6 +14,7 @@ var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-
|
|
|
14
14
|
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
15
15
|
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
17
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
17
18
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
18
19
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
|
|
19
20
|
var _utils = require("../../utils");
|
|
@@ -22,8 +23,10 @@ var _rxjs = require("rxjs");
|
|
|
22
23
|
var _operators = require("rxjs/operators");
|
|
23
24
|
var _styles = require("../../base/styles");
|
|
24
25
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
|
-
var rangeSelectionKey =
|
|
26
|
-
|
|
26
|
+
var rangeSelectionKey = 'rangeSelection';
|
|
27
|
+
exports.rangeSelectionKey = rangeSelectionKey;
|
|
28
|
+
var lastClickCellKey = 'lastClickCell';
|
|
29
|
+
exports.lastClickCellKey = lastClickCellKey;
|
|
27
30
|
var startSelectedCellRangesKey = 'startSelectedCellRanges';
|
|
28
31
|
var SCROLL_OFFSET = 30;
|
|
29
32
|
function rangeSelection(opts) {
|
|
@@ -220,8 +223,9 @@ function rangeSelection(opts) {
|
|
|
220
223
|
};
|
|
221
224
|
}
|
|
222
225
|
function getTargetCell(target, columns) {
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
while (target) {
|
|
227
|
+
if (target.getAttribute('data-role') === 'table-cell') {
|
|
228
|
+
var _ret = function () {
|
|
225
229
|
var columnCode = target.getAttribute('data-code');
|
|
226
230
|
var column = (0, _others.findByTree)(columns, function (item, index) {
|
|
227
231
|
return item.code === columnCode;
|
|
@@ -238,13 +242,10 @@ function getTargetCell(target, columns) {
|
|
|
238
242
|
isFooterCell: isEleInFooter(target)
|
|
239
243
|
}
|
|
240
244
|
};
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
while (target) {
|
|
246
|
-
_ret = _loop();
|
|
247
|
-
if (_ret) return _ret.v;
|
|
245
|
+
}();
|
|
246
|
+
if ((0, _typeof2.default)(_ret) === "object") return _ret.v;
|
|
247
|
+
}
|
|
248
|
+
target = target.parentElement;
|
|
248
249
|
}
|
|
249
250
|
return null;
|
|
250
251
|
}
|
|
@@ -433,6 +434,7 @@ function getCellRangeId(cellRange) {
|
|
|
433
434
|
* @returns
|
|
434
435
|
*/
|
|
435
436
|
function getCellRangesClassName(cellRanges, _ref2) {
|
|
437
|
+
var _cx;
|
|
436
438
|
var isFooterCell = _ref2.isFooterCell,
|
|
437
439
|
rowIndex = _ref2.rowIndex,
|
|
438
440
|
col = _ref2.col,
|
|
@@ -448,7 +450,7 @@ function getCellRangesClassName(cellRanges, _ref2) {
|
|
|
448
450
|
matchCellRangeBottom = _getMatchBorderStyle.matchCellRangeBottom,
|
|
449
451
|
matchCellRangeRight = _getMatchBorderStyle.matchCellRangeRight;
|
|
450
452
|
var isSingleCell = isCellRangeSingleCell(cellRanges);
|
|
451
|
-
var className = (0, _classnames.default)((
|
|
453
|
+
var className = (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, _styles.Classes.tableCellRangeSingleCell, isSingleCell), (0, _defineProperty2.default)(_cx, _styles.Classes.tableCellRangeSelected, !isSingleCell), (0, _defineProperty2.default)(_cx, _styles.Classes.tableCellRangeTop, !isSingleCell && matchCellRangeTop), (0, _defineProperty2.default)(_cx, _styles.Classes.tableCellRangeLeft, !isSingleCell && matchCellRangeLeft), (0, _defineProperty2.default)(_cx, _styles.Classes.tableCellRangeBottom, !isSingleCell && matchCellRangeBottom), (0, _defineProperty2.default)(_cx, _styles.Classes.tableCellRangeRight, !isSingleCell && matchCellRangeRight), _cx));
|
|
452
454
|
return className;
|
|
453
455
|
}
|
|
454
456
|
function getMatchBorderStyle(cellRanges, _ref3) {
|
|
@@ -220,12 +220,12 @@ function rowDetail() {
|
|
|
220
220
|
}
|
|
221
221
|
});
|
|
222
222
|
tableColumns[expandColumnIndex] = (0, _extends4.default)((0, _extends4.default)({}, expandCol), {
|
|
223
|
-
title:
|
|
223
|
+
title: /*#__PURE__*/_react.default.createElement("div", {
|
|
224
224
|
style: {
|
|
225
225
|
display: 'inline-block',
|
|
226
226
|
marginLeft: textOffset
|
|
227
227
|
}
|
|
228
|
-
}, _internals.internals.safeRenderHeader(expandCol))
|
|
228
|
+
}, _internals.internals.safeRenderHeader(expandCol)),
|
|
229
229
|
render: render,
|
|
230
230
|
getCellProps: clickArea === 'cell' ? getCellProps : expandCol.getCellProps,
|
|
231
231
|
getSpanRect: function getSpanRect(value, row, rowIndex) {
|
|
@@ -21,9 +21,12 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
21
21
|
var _styles = require("../../base/styles");
|
|
22
22
|
var _const = require("../const");
|
|
23
23
|
var _internals = require("../../internals");
|
|
24
|
-
var ROW_DRAG_COLUMN_CODE =
|
|
25
|
-
|
|
26
|
-
var
|
|
24
|
+
var ROW_DRAG_COLUMN_CODE = '$_row_drag_column_&';
|
|
25
|
+
exports.ROW_DRAG_COLUMN_CODE = ROW_DRAG_COLUMN_CODE;
|
|
26
|
+
var rowDragKey = 'rowDragKey';
|
|
27
|
+
exports.rowDragKey = rowDragKey;
|
|
28
|
+
var rowDragOptionsKey = 'rowDragOptions';
|
|
29
|
+
exports.rowDragOptionsKey = rowDragOptionsKey;
|
|
27
30
|
var SCROLL_OFFSET = 30;
|
|
28
31
|
var SCROLL_START_OFFSET = 20;
|
|
29
32
|
var defaultRowDragColumn = {
|
|
@@ -213,7 +216,8 @@ function rowDrag(opt) {
|
|
|
213
216
|
};
|
|
214
217
|
var handleDragMove = function handleDragMove(mouseMoveEvent) {
|
|
215
218
|
var _a;
|
|
216
|
-
|
|
219
|
+
var isRTL = pipeline.ctx.direction === 'rtl';
|
|
220
|
+
positionDragElemment(dragElement, mouseMoveEvent, isRTL); // 更新拖拽悬浮框位置
|
|
217
221
|
rowDragApi.setDragStatus('dragging');
|
|
218
222
|
setDragElementIcon(dragElement, 'move');
|
|
219
223
|
var rowDropZones = rowDragApi.getRowDropZone();
|
|
@@ -261,7 +265,8 @@ function rowDrag(opt) {
|
|
|
261
265
|
positionDragLine({
|
|
262
266
|
lineElement: dragLine,
|
|
263
267
|
dragZone: dropTarget,
|
|
264
|
-
event: mouseMoveEvent
|
|
268
|
+
event: mouseMoveEvent,
|
|
269
|
+
isRTL: isRTL
|
|
265
270
|
});
|
|
266
271
|
}
|
|
267
272
|
// 树形表格悬停1s展开对应行节点
|
|
@@ -363,6 +368,7 @@ function rowDrag(opt) {
|
|
|
363
368
|
onMouseDown: onMouseDown
|
|
364
369
|
});
|
|
365
370
|
pipeline.appendRowPropsGetter(function (row, rowIndex) {
|
|
371
|
+
var _cx;
|
|
366
372
|
var rowDragEvent = pipeline.getStateAtKey(rowDragKey) || {};
|
|
367
373
|
var dragStatus = rowDragApi.getDragStatus();
|
|
368
374
|
var startRowIndex = rowDragEvent.startRowIndex,
|
|
@@ -384,7 +390,7 @@ function rowDrag(opt) {
|
|
|
384
390
|
return _internals.internals.safeGetRowKey(primaryKey, row, -1) === parentRowKey;
|
|
385
391
|
});
|
|
386
392
|
}
|
|
387
|
-
var className = (0, _classnames.default)((
|
|
393
|
+
var className = (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, _styles.Classes.rowDragStart, rowIndex === startRowIndex && dragStatus !== 'finished'), (0, _defineProperty2.default)(_cx, _styles.Classes.rowDragEnd, rowIndex === endRowIndex), (0, _defineProperty2.default)(_cx, _styles.Classes.rowDragEndParent, isTreeTable && rowIndex === parentRowKeyIndex && dragPosition !== 'into'), (0, _defineProperty2.default)(_cx, _styles.Classes.rowDragEndInto, rowIndex === endRowIndex && dragPosition === 'into'), (0, _defineProperty2.default)(_cx, _styles.Classes.rowDragEndToTop, rowIndex === endRowIndex && dragPosition === 'top'), (0, _defineProperty2.default)(_cx, _styles.Classes.rowDragEndToBottom, rowIndex === endRowIndex && dragPosition === 'bottom'), _cx));
|
|
388
394
|
return {
|
|
389
395
|
className: className
|
|
390
396
|
};
|
|
@@ -458,7 +464,8 @@ function positionDragLine(_ref) {
|
|
|
458
464
|
var _context7;
|
|
459
465
|
var lineElement = _ref.lineElement,
|
|
460
466
|
dragZone = _ref.dragZone,
|
|
461
|
-
event = _ref.event
|
|
467
|
+
event = _ref.event,
|
|
468
|
+
isRTL = _ref.isRTL;
|
|
462
469
|
var tableContainer = dragZone.getContainer();
|
|
463
470
|
var _dragZone$tableParams = dragZone.tableParams,
|
|
464
471
|
getDataSource = _dragZone$tableParams.getDataSource,
|
|
@@ -494,14 +501,15 @@ function positionDragLine(_ref) {
|
|
|
494
501
|
row: _row,
|
|
495
502
|
direction: _direction,
|
|
496
503
|
offsetParentSize: offsetParentSize,
|
|
497
|
-
bodyRect: bodyRect
|
|
504
|
+
bodyRect: bodyRect,
|
|
505
|
+
isRTL: isRTL
|
|
498
506
|
}),
|
|
499
507
|
_top = _getLinePosition.top,
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
lineElement.style.left = "".concat(
|
|
508
|
+
_left2 = _getLinePosition.left,
|
|
509
|
+
_width2 = _getLinePosition.width;
|
|
510
|
+
lineElement.style.left = "".concat(_left2, "px");
|
|
503
511
|
lineElement.style.top = "".concat(_top, "px");
|
|
504
|
-
lineElement.style.width = "".concat(
|
|
512
|
+
lineElement.style.width = "".concat(_width2, "px");
|
|
505
513
|
}
|
|
506
514
|
return;
|
|
507
515
|
}
|
|
@@ -518,7 +526,8 @@ function positionDragLine(_ref) {
|
|
|
518
526
|
row: row,
|
|
519
527
|
direction: direction,
|
|
520
528
|
offsetParentSize: offsetParentSize,
|
|
521
|
-
bodyRect: bodyRect
|
|
529
|
+
bodyRect: bodyRect,
|
|
530
|
+
isRTL: isRTL
|
|
522
531
|
}),
|
|
523
532
|
top = _getLinePosition2.top,
|
|
524
533
|
left = _getLinePosition2.left,
|
|
@@ -538,7 +547,7 @@ function showDragLine(lineElement) {
|
|
|
538
547
|
function hiddenDragLine(lineElement) {
|
|
539
548
|
lineElement.style.display = 'none';
|
|
540
549
|
}
|
|
541
|
-
function positionDragElemment(element, event) {
|
|
550
|
+
function positionDragElemment(element, event, isRTL) {
|
|
542
551
|
var _a, _b, _c, _d, _e, _f;
|
|
543
552
|
if (!element) return;
|
|
544
553
|
var elementRect = element.getBoundingClientRect();
|
|
@@ -550,14 +559,23 @@ function positionDragElemment(element, event) {
|
|
|
550
559
|
clientY = event.clientY;
|
|
551
560
|
var top = clientY - offsetParentSize.top - eleHeight / 2;
|
|
552
561
|
var left = clientX - offsetParentSize.left;
|
|
553
|
-
var
|
|
554
|
-
var
|
|
562
|
+
var right = Math.max(browserWidth - clientX, 0);
|
|
563
|
+
var windowScrollX = window.pageXOffset || window.scrollX;
|
|
564
|
+
var windowScrollY = window.pageYOffset || window.scrollY;
|
|
555
565
|
if (browserWidth > 0 && left + element.clientWidth > browserWidth + windowScrollX) {
|
|
556
566
|
left = Math.max(browserWidth + windowScrollX - element.clientWidth, 0);
|
|
557
567
|
}
|
|
558
568
|
if (browserHeight > 0 && top + element.clientHeight > browserHeight + windowScrollY) {
|
|
559
569
|
top = Math.max(browserHeight + windowScrollY - element.clientHeight, 0);
|
|
560
570
|
}
|
|
571
|
+
if (browserWidth > 0 && right + element.clientWidth > browserWidth + windowScrollX) {
|
|
572
|
+
right = Math.max(browserWidth + windowScrollX - element.clientWidth, 0);
|
|
573
|
+
}
|
|
574
|
+
if (isRTL) {
|
|
575
|
+
var _context8;
|
|
576
|
+
element.style.cssText += (0, _concat.default)(_context8 = ";right: ".concat(right, "px; top: ")).call(_context8, top, "px;");
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
561
579
|
element.style.left = "".concat(left, "px");
|
|
562
580
|
element.style.top = "".concat(top, "px");
|
|
563
581
|
}
|
|
@@ -700,7 +718,8 @@ var getLinePosition = function getLinePosition(_ref2) {
|
|
|
700
718
|
row = _ref2.row,
|
|
701
719
|
direction = _ref2.direction,
|
|
702
720
|
offsetParentSize = _ref2.offsetParentSize,
|
|
703
|
-
bodyRect = _ref2.bodyRect
|
|
721
|
+
bodyRect = _ref2.bodyRect,
|
|
722
|
+
isRTL = _ref2.isRTL;
|
|
704
723
|
var isTreeTable = !!treeModeOptions;
|
|
705
724
|
if (isTreeTable) {
|
|
706
725
|
var iconWidth = treeModeOptions.iconWidth,
|
|
@@ -709,7 +728,8 @@ var getLinePosition = function getLinePosition(_ref2) {
|
|
|
709
728
|
indentSize = treeModeOptions.indentSize,
|
|
710
729
|
treeMetaKey = treeModeOptions.treeMetaKey;
|
|
711
730
|
var _getElementSize3 = _getElementSize(cell),
|
|
712
|
-
paddingLeft = _getElementSize3.paddingLeft
|
|
731
|
+
paddingLeft = _getElementSize3.paddingLeft,
|
|
732
|
+
paddingRight = _getElementSize3.paddingRight;
|
|
713
733
|
var expandCellRect = cell.getBoundingClientRect();
|
|
714
734
|
var _row$treeMetaKey2 = row[treeMetaKey],
|
|
715
735
|
rowKey = _row$treeMetaKey2.rowKey,
|
|
@@ -723,12 +743,23 @@ var getLinePosition = function getLinePosition(_ref2) {
|
|
|
723
743
|
_height = expandCellRect.height;
|
|
724
744
|
var _top2 = direction === 'bottom' ? _y + _height - offsetParentSize.top : _y - offsetParentSize.top;
|
|
725
745
|
var offsetX = Math.max(x + paddingLeft + indent - bodyRect.x, 0);
|
|
726
|
-
var
|
|
727
|
-
var
|
|
746
|
+
var _left3 = bodyRect.x + offsetX - offsetParentSize.left;
|
|
747
|
+
var _width3 = bodyRect.width - offsetX;
|
|
748
|
+
if (isRTL) {
|
|
749
|
+
var expandCellOffsetRight = bodyRect.right - expandCellRect.right; // 展示收起单元格相较于表格右边的距离
|
|
750
|
+
var _left = bodyRect.x - offsetParentSize.left;
|
|
751
|
+
// 表格的宽度 - expandCellOffsetRight - 表格的paddingRight - 计算得出的缩进
|
|
752
|
+
var _width = bodyRect.width - expandCellOffsetRight - paddingRight - indent;
|
|
753
|
+
return {
|
|
754
|
+
top: _top2,
|
|
755
|
+
left: _left,
|
|
756
|
+
width: _width
|
|
757
|
+
};
|
|
758
|
+
}
|
|
728
759
|
return {
|
|
729
760
|
top: _top2,
|
|
730
|
-
left:
|
|
731
|
-
width:
|
|
761
|
+
left: _left3,
|
|
762
|
+
width: _width3
|
|
732
763
|
};
|
|
733
764
|
}
|
|
734
765
|
// 根据鼠标悬停位置所在单元格和显示位置计算拖拽线的位置
|
|
@@ -152,12 +152,12 @@ function rowGrouping() {
|
|
|
152
152
|
});
|
|
153
153
|
};
|
|
154
154
|
return (0, _concat.default)(_context3 = [(0, _extends3.default)((0, _extends3.default)({}, firstCol), {
|
|
155
|
-
title:
|
|
155
|
+
title: /*#__PURE__*/_react.default.createElement("div", {
|
|
156
156
|
style: {
|
|
157
157
|
display: 'inline-block',
|
|
158
158
|
marginLeft: textOffset
|
|
159
159
|
}
|
|
160
|
-
}, _internals.internals.safeRenderHeader(firstCol))
|
|
160
|
+
}, _internals.internals.safeRenderHeader(firstCol)),
|
|
161
161
|
render: render,
|
|
162
162
|
getCellProps: getCellProps,
|
|
163
163
|
getSpanRect: function getSpanRect(value, row, rowIndex) {
|
|
@@ -25,9 +25,9 @@ var _internals = require("../../internals");
|
|
|
25
25
|
var _utils = require("../../utils");
|
|
26
26
|
var _styles = require("../../base/styles");
|
|
27
27
|
var _templateObject;
|
|
28
|
-
function _createForOfIteratorHelper(
|
|
29
|
-
function _unsupportedIterableToArray(
|
|
30
|
-
function _arrayLikeToArray(
|
|
28
|
+
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; } } }; }
|
|
29
|
+
function _unsupportedIterableToArray(o, minLen) { var _context4; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty2(_context4 = Object.prototype.toString.call(o)).call(_context4, 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); }
|
|
30
|
+
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; }
|
|
31
31
|
function SortIcon(_ref) {
|
|
32
32
|
var _ref$size = _ref.size,
|
|
33
33
|
size = _ref$size === void 0 ? 32 : _ref$size,
|
|
@@ -55,6 +55,7 @@ function SortIcon(_ref) {
|
|
|
55
55
|
}));
|
|
56
56
|
}
|
|
57
57
|
function DefaultSortHeaderCell(_ref2) {
|
|
58
|
+
var _cx;
|
|
58
59
|
var children = _ref2.children,
|
|
59
60
|
column = _ref2.column,
|
|
60
61
|
onToggle = _ref2.onToggle,
|
|
@@ -74,10 +75,10 @@ function DefaultSortHeaderCell(_ref2) {
|
|
|
74
75
|
marginLeft: 2,
|
|
75
76
|
flexShrink: 0
|
|
76
77
|
},
|
|
77
|
-
className: (0, _classnames.default)((
|
|
78
|
+
className: (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, _styles.Classes.tableSortIcon, true), (0, _defineProperty2.default)(_cx, "active", sortOrder === 'desc' || sortOrder === 'asc'), _cx)),
|
|
78
79
|
size: 16,
|
|
79
80
|
order: sortOrder
|
|
80
|
-
}), sortOptions.mode === 'multiple' && sortIndex !== -1 &&
|
|
81
|
+
}), sortOptions.mode === 'multiple' && sortIndex !== -1 && /*#__PURE__*/_react.default.createElement("div", {
|
|
81
82
|
style: {
|
|
82
83
|
userSelect: 'none',
|
|
83
84
|
marginLeft: 2,
|
|
@@ -86,7 +87,7 @@ function DefaultSortHeaderCell(_ref2) {
|
|
|
86
87
|
fontSize: 10,
|
|
87
88
|
fontFamily: 'monospace'
|
|
88
89
|
}
|
|
89
|
-
}, sortIndex + 1))
|
|
90
|
+
}, sortIndex + 1));
|
|
90
91
|
}
|
|
91
92
|
function hasAnySortableColumns(cols) {
|
|
92
93
|
return cols.some(function (col) {
|
|
@@ -12,8 +12,11 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
12
12
|
var _commonViews = require("../../common-views");
|
|
13
13
|
var _internals = require("../../internals");
|
|
14
14
|
var _utils = require("../../utils");
|
|
15
|
+
var _utils2 = require("../../base/utils");
|
|
15
16
|
var _templateObject;
|
|
16
|
-
var HeaderCellWithTips = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n\n .tip-icon-wrapper {\n margin-
|
|
17
|
+
var HeaderCellWithTips = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n\n .tip-icon-wrapper {\n margin-", ": 2px;\n }\n\n .tip-icon {\n display: flex;\n fill: currentColor;\n }\n"])), function (props) {
|
|
18
|
+
return (0, _utils2.swapRTLDirection)(props.direction, 'left');
|
|
19
|
+
});
|
|
17
20
|
function tips() {
|
|
18
21
|
return function tipsSteap(pipeline) {
|
|
19
22
|
var Balloon = pipeline.ctx.components.Balloon;
|
|
@@ -28,11 +31,12 @@ function tips() {
|
|
|
28
31
|
}
|
|
29
32
|
var justifyContent = col.align === 'right' ? 'flex-end' : col.align === 'center' ? 'center' : 'flex-start';
|
|
30
33
|
return (0, _extends2.default)((0, _extends2.default)({}, col), {
|
|
31
|
-
title:
|
|
34
|
+
title: /*#__PURE__*/_react.default.createElement(HeaderCellWithTips, {
|
|
32
35
|
style: {
|
|
33
36
|
justifyContent: justifyContent
|
|
34
|
-
}
|
|
35
|
-
|
|
37
|
+
},
|
|
38
|
+
direction: pipeline.ctx.direction
|
|
39
|
+
}, _internals.internals.safeRenderHeader(col), Balloon ?
|
|
36
40
|
/*#__PURE__*/
|
|
37
41
|
// fusion/hippo
|
|
38
42
|
_react.default.createElement(Balloon, {
|
|
@@ -42,7 +46,7 @@ function tips() {
|
|
|
42
46
|
}, /*#__PURE__*/_react.default.createElement(_commonViews.icons.Info, {
|
|
43
47
|
className: "tip-icon"
|
|
44
48
|
}))
|
|
45
|
-
}, col.features.tips)
|
|
49
|
+
}, col.features.tips) :
|
|
46
50
|
/*#__PURE__*/
|
|
47
51
|
// antd
|
|
48
52
|
_react.default.createElement(Tooltip, {
|
|
@@ -51,7 +55,7 @@ function tips() {
|
|
|
51
55
|
className: "tip-icon-wrapper"
|
|
52
56
|
}, /*#__PURE__*/_react.default.createElement(_commonViews.icons.Info, {
|
|
53
57
|
className: "tip-icon"
|
|
54
|
-
}))))
|
|
58
|
+
}))))
|
|
55
59
|
});
|
|
56
60
|
}));
|
|
57
61
|
};
|
|
@@ -25,11 +25,13 @@ var _commonViews = require("../../common-views");
|
|
|
25
25
|
var _internals = require("../../internals");
|
|
26
26
|
var _utils = require("../../utils");
|
|
27
27
|
var _styles = require("../../base/styles");
|
|
28
|
-
function _createForOfIteratorHelper(
|
|
29
|
-
function _unsupportedIterableToArray(
|
|
30
|
-
function _arrayLikeToArray(
|
|
31
|
-
var treeMetaSymbol =
|
|
32
|
-
|
|
28
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol2 !== "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; } } }; }
|
|
29
|
+
function _unsupportedIterableToArray(o, minLen) { var _context3; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context3 = Object.prototype.toString.call(o)).call(_context3, 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); }
|
|
30
|
+
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; }
|
|
31
|
+
var treeMetaSymbol = (0, _symbol.default)('treeMetaSymbol');
|
|
32
|
+
exports.treeMetaSymbol = treeMetaSymbol;
|
|
33
|
+
var treeModeOptionsKey = 'treeModeOptions';
|
|
34
|
+
exports.treeModeOptionsKey = treeModeOptionsKey;
|
|
33
35
|
function treeMode() {
|
|
34
36
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35
37
|
return function treeModeStep(pipeline) {
|
|
@@ -229,12 +231,12 @@ function treeMode() {
|
|
|
229
231
|
});
|
|
230
232
|
};
|
|
231
233
|
columns[expandColIndex] = (0, _extends3.default)((0, _extends3.default)({}, expandCol), {
|
|
232
|
-
title:
|
|
234
|
+
title: /*#__PURE__*/_react.default.createElement("span", {
|
|
233
235
|
style: {
|
|
234
236
|
marginLeft: iconIndent + iconWidth + iconGap,
|
|
235
237
|
display: 'flex'
|
|
236
238
|
}
|
|
237
|
-
}, _internals.internals.safeRenderHeader(expandCol))
|
|
239
|
+
}, _internals.internals.safeRenderHeader(expandCol)),
|
|
238
240
|
render: render,
|
|
239
241
|
getCellProps: getCellProps
|
|
240
242
|
});
|