@kdcloudjs/table 1.2.2-canary.18 → 1.2.2-canary.20
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 +3908 -3253
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/kd-ui-complete.less +777 -777
- package/es/_utils/formatUtil.js +1 -5
- package/es/_utils/hooks.js +3 -3
- package/es/_utils/usePopper.d.ts +1 -1
- package/es/_utils/usePopper.js +26 -26
- package/es/locale/locale.js +6 -7
- 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/colgroup.d.ts +2 -2
- package/es/table/base/empty.d.ts +1 -1
- package/es/table/base/empty.js +2 -2
- package/es/table/base/globalStyleComponent.d.ts +2 -2
- package/es/table/base/globalStyleComponent.js +6 -8
- package/es/table/base/header.d.ts +2 -2
- package/es/table/base/header.js +5 -7
- package/es/table/base/helpers/FastScrollManager.js +1 -2
- package/es/table/base/helpers/SpanManager.js +1 -2
- package/es/table/base/helpers/TableDOMUtils.js +5 -6
- package/es/table/base/helpers/__test__/TableDOMUtils.test.js +2 -2
- package/es/table/base/html-table.d.ts +2 -2
- package/es/table/base/html-table.js +16 -8
- package/es/table/base/loading.d.ts +1 -1
- package/es/table/base/loading.js +2 -2
- package/es/table/base/renderTemplates.js +16 -16
- package/es/table/base/table.d.ts +1 -1
- package/es/table/base/table.js +17 -21
- package/es/table/base/utils.js +3 -3
- package/es/table/common-views.d.ts +4 -4
- package/es/table/pipeline/features/colGroupExtendable.js +17 -4
- package/es/table/pipeline/features/columnDrag.js +21 -2
- package/es/table/pipeline/features/columnFilter.js +1 -3
- package/es/table/pipeline/features/columnHover.js +16 -11
- package/es/table/pipeline/features/columnRangeHover.js +18 -17
- package/es/table/pipeline/features/columnResizeWidth.js +2 -2
- package/es/table/pipeline/features/contextMenu.js +4 -6
- package/es/table/pipeline/features/featureApi/RowDragApi.js +1 -2
- package/es/table/pipeline/features/filter/DefaultFilterContent.d.ts +2 -2
- package/es/table/pipeline/features/filter/DefaultFilterContent.js +4 -5
- package/es/table/pipeline/features/filter/DefaultFilterIcon.d.ts +2 -2
- package/es/table/pipeline/features/filter/Filter.d.ts +1 -1
- package/es/table/pipeline/features/filter/Filter.js +2 -3
- package/es/table/pipeline/features/filter/FilterPanel.d.ts +2 -2
- package/es/table/pipeline/features/mergeCellHover.js +21 -15
- package/es/table/pipeline/features/rangeSelection.js +12 -10
- package/es/table/pipeline/features/rowDetail.js +5 -3
- package/es/table/pipeline/features/rowDrag.js +2 -3
- package/es/table/pipeline/features/rowGrouping.js +9 -8
- package/es/table/pipeline/features/sort.js +6 -7
- package/es/table/pipeline/features/tips.js +4 -4
- package/es/table/pipeline/features/treeMode.js +5 -5
- package/es/table/pipeline/features/treeSelect.js +2 -2
- package/es/table/pipeline/pipeline.js +1 -2
- package/es/table/pivot/cross-table/buildCrossTable.js +6 -8
- package/es/table/pivot/cross-table/cross-table.d.ts +1 -1
- package/es/table/pivot/cross-table/cross-table.js +1 -3
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.js +8 -10
- package/es/table/pivot/cross-tree-table/cross-tree-table.d.ts +1 -1
- package/es/table/pivot/cross-tree-table/cross-tree-table.js +8 -11
- 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 +3 -5
- package/es/table/transforms/sort.js +6 -8
- package/es/table/transforms/tips.js +4 -4
- package/es/table/transforms/treeMode.js +10 -12
- package/es/table/utils/buildTree.js +3 -3
- package/es/table/utils/collectNodes.js +3 -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 +0 -1
- 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 +7 -8
- package/es/table/utils/tree-data-helpers/TreeDataHelper.js +4 -5
- package/lib/_utils/arrayUtil.js +2 -3
- package/lib/_utils/formatUtil.js +1 -5
- package/lib/_utils/hooks.js +3 -3
- package/lib/_utils/index.js +2 -3
- package/lib/_utils/type.js +3 -5
- package/lib/_utils/usePopper.d.ts +1 -1
- package/lib/_utils/usePopper.js +30 -34
- package/lib/config-provider/ConfigContext.js +1 -2
- package/lib/config-provider/compDefaultProps.js +1 -2
- package/lib/config-provider/configProvider.js +2 -4
- package/lib/config-provider/defaultConfig.js +1 -2
- package/lib/config-provider/index.js +1 -2
- package/lib/locale/index.js +2 -4
- package/lib/locale/locale.js +10 -14
- package/lib/locale/zh-CN.js +1 -2
- 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.js +4 -7
- package/lib/table/base/calculations.js +3 -3
- package/lib/table/base/colgroup.d.ts +2 -2
- package/lib/table/base/empty.d.ts +1 -1
- package/lib/table/base/empty.js +3 -4
- package/lib/table/base/globalStyleComponent.d.ts +2 -2
- package/lib/table/base/globalStyleComponent.js +9 -13
- package/lib/table/base/header.d.ts +2 -2
- package/lib/table/base/header.js +5 -7
- package/lib/table/base/helpers/FastScrollManager.js +3 -5
- package/lib/table/base/helpers/SpanManager.js +3 -5
- package/lib/table/base/helpers/TableDOMUtils.js +7 -9
- package/lib/table/base/helpers/__test__/TableDOMUtils.test.js +2 -2
- package/lib/table/base/helpers/getRichVisibleRectsStream.js +1 -2
- package/lib/table/base/html-table.d.ts +2 -2
- package/lib/table/base/html-table.js +16 -8
- package/lib/table/base/loading.d.ts +1 -1
- package/lib/table/base/loading.js +2 -2
- package/lib/table/base/renderTemplates.js +17 -18
- package/lib/table/base/styles.js +9 -18
- package/lib/table/base/table.d.ts +1 -1
- package/lib/table/base/table.js +28 -32
- package/lib/table/base/utils.js +13 -22
- package/lib/table/common-views.d.ts +4 -4
- package/lib/table/common-views.js +4 -8
- package/lib/table/internals.js +2 -3
- package/lib/table/pipeline/const.js +2 -3
- package/lib/table/pipeline/features/autoFill.js +3 -6
- package/lib/table/pipeline/features/colGroupExtendable.js +19 -7
- package/lib/table/pipeline/features/columnDrag.js +21 -2
- package/lib/table/pipeline/features/columnFilter.js +1 -3
- package/lib/table/pipeline/features/columnHover.js +16 -11
- package/lib/table/pipeline/features/columnRangeHover.js +18 -17
- package/lib/table/pipeline/features/columnResizeWidth.js +6 -10
- package/lib/table/pipeline/features/contextMenu.js +5 -8
- package/lib/table/pipeline/features/featureApi/RowDragApi.js +3 -5
- package/lib/table/pipeline/features/filter/DefaultFilterContent.d.ts +2 -2
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +6 -9
- package/lib/table/pipeline/features/filter/DefaultFilterIcon.d.ts +2 -2
- package/lib/table/pipeline/features/filter/Filter.d.ts +1 -1
- package/lib/table/pipeline/features/filter/Filter.js +4 -7
- package/lib/table/pipeline/features/filter/FilterPanel.d.ts +2 -2
- package/lib/table/pipeline/features/filter/FilterPanel.js +2 -4
- package/lib/table/pipeline/features/filter/util.js +2 -3
- package/lib/table/pipeline/features/footerDataSource.js +1 -2
- package/lib/table/pipeline/features/mergeCellHover.js +21 -15
- package/lib/table/pipeline/features/rangeSelection.js +14 -14
- package/lib/table/pipeline/features/rowDetail.js +5 -3
- package/lib/table/pipeline/features/rowDrag.js +5 -9
- package/lib/table/pipeline/features/rowGrouping.js +9 -8
- package/lib/table/pipeline/features/sort.js +6 -7
- package/lib/table/pipeline/features/tips.js +4 -4
- package/lib/table/pipeline/features/treeMode.js +7 -9
- package/lib/table/pipeline/features/treeSelect.js +2 -2
- package/lib/table/pipeline/index.js +1 -2
- package/lib/table/pipeline/pipeline.js +2 -4
- package/lib/table/pivot/cross-table/buildCrossTable.js +6 -8
- package/lib/table/pivot/cross-table/constants.js +1 -2
- package/lib/table/pivot/cross-table/cross-table.d.ts +1 -1
- package/lib/table/pivot/cross-table/cross-table.js +3 -6
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.js +8 -10
- package/lib/table/pivot/cross-tree-table/cross-tree-table.d.ts +1 -1
- package/lib/table/pivot/cross-tree-table/cross-tree-table.js +9 -13
- 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 +4 -5
- package/lib/table/transforms/columnResize.js +4 -7
- package/lib/table/transforms/sort.js +7 -10
- package/lib/table/transforms/tips.js +4 -4
- package/lib/table/transforms/treeMode.js +11 -14
- package/lib/table/use/useResizeObserver.js +1 -2
- package/lib/table/utils/browserType.js +2 -4
- package/lib/table/utils/buildTree.js +3 -3
- package/lib/table/utils/collectNodes.js +3 -3
- package/lib/table/utils/console.js +2 -3
- package/lib/table/utils/copyToClipboard.js +1 -2
- 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 +1 -2
- package/lib/table/utils/makeRecursiveMapper.js +3 -3
- package/lib/table/utils/mergeCellProps.js +0 -1
- package/lib/table/utils/others.js +4 -5
- package/lib/table/utils/proto.js +1 -2
- package/lib/table/utils/selectColumn.js +2 -4
- package/lib/table/utils/traverseColumn.js +3 -3
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.js +9 -11
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.js +6 -8
- package/package.json +219 -219
- package/dist/@kdcloudjs/table.min.css +0 -9
- package/dist/@kdcloudjs/table.min.js +0 -217
- package/dist/@kdcloudjs/table.min.js.map +0 -1
package/lib/_utils/index.js
CHANGED
|
@@ -14,9 +14,8 @@ var _compDefaultProps = _interopRequireDefault(require("../config-provider/compD
|
|
|
14
14
|
* @param {any} userDefaultProps 用户自定义组件默认属性
|
|
15
15
|
* @param {any} compProps 组件接收到的属性
|
|
16
16
|
*/
|
|
17
|
-
var getCompProps = function getCompProps(compName, userDefaultProps, compProps) {
|
|
17
|
+
var getCompProps = exports.getCompProps = function getCompProps(compName, userDefaultProps, compProps) {
|
|
18
18
|
var defaultProps = _compDefaultProps.default[compName];
|
|
19
19
|
var userProps = userDefaultProps && userDefaultProps[compName] || {};
|
|
20
20
|
return (0, _extends2.default)({}, defaultProps, userProps, compProps || {});
|
|
21
|
-
};
|
|
22
|
-
exports.getCompProps = getCompProps;
|
|
21
|
+
};
|
package/lib/_utils/type.js
CHANGED
|
@@ -5,17 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.tupleNum = exports.tuple = void 0;
|
|
7
7
|
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
|
|
8
|
-
var tuple = function tuple() {
|
|
8
|
+
var tuple = exports.tuple = function tuple() {
|
|
9
9
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10
10
|
args[_key] = arguments[_key];
|
|
11
11
|
}
|
|
12
12
|
return args;
|
|
13
13
|
};
|
|
14
|
-
exports.
|
|
15
|
-
var tupleNum = function tupleNum() {
|
|
14
|
+
var tupleNum = exports.tupleNum = function tupleNum() {
|
|
16
15
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
17
16
|
args[_key2] = arguments[_key2];
|
|
18
17
|
}
|
|
19
18
|
return args;
|
|
20
|
-
};
|
|
21
|
-
exports.tupleNum = tupleNum;
|
|
19
|
+
};
|
|
@@ -25,5 +25,5 @@ export interface PopperProps {
|
|
|
25
25
|
getTriggerElement?: (locatorNode: HTMLElement) => HTMLElement;
|
|
26
26
|
getPopupContainer?: (locatorNode: HTMLElement) => HTMLElement;
|
|
27
27
|
}
|
|
28
|
-
declare function usePopper(locatorElement: React.ReactElement, popperElement: React.ReactElement, props: PopperProps): JSX.Element;
|
|
28
|
+
declare function usePopper(locatorElement: React.ReactElement, popperElement: React.ReactElement, props: PopperProps): React.JSX.Element;
|
|
29
29
|
export default usePopper;
|
package/lib/_utils/usePopper.js
CHANGED
|
@@ -21,31 +21,28 @@ var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
|
21
21
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
22
22
|
var _devwarning = _interopRequireDefault(require("../_utils/devwarning"));
|
|
23
23
|
var _hooks = require("../_utils/hooks");
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
var Triggers = (0, _type.tuple)('hover', 'focus', 'click', 'contextMenu');
|
|
29
|
-
exports.Triggers = Triggers;
|
|
30
|
-
var getOffsetPos = function getOffsetPos(el) {
|
|
24
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
25
|
+
var Placements = exports.Placements = (0, _type.tuple)('top', 'left', 'right', 'bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'leftTop', 'leftBottom', 'rightTop', 'rightBottom');
|
|
26
|
+
var Triggers = exports.Triggers = (0, _type.tuple)('hover', 'focus', 'click', 'contextMenu');
|
|
27
|
+
var _getOffsetPos = function getOffsetPos(el) {
|
|
31
28
|
var elPos = {
|
|
32
29
|
top: el.offsetTop,
|
|
33
30
|
left: el.offsetLeft
|
|
34
31
|
};
|
|
35
32
|
if (el.offsetParent) {
|
|
36
|
-
var parentPos =
|
|
33
|
+
var parentPos = _getOffsetPos(el.offsetParent);
|
|
37
34
|
elPos.top += parentPos.top;
|
|
38
35
|
elPos.left += parentPos.left;
|
|
39
36
|
}
|
|
40
37
|
return elPos;
|
|
41
38
|
};
|
|
42
|
-
var
|
|
39
|
+
var _getScrollDist = function getScrollDist(el) {
|
|
43
40
|
var elScroll = {
|
|
44
41
|
top: el.scrollTop,
|
|
45
42
|
left: el.scrollLeft
|
|
46
43
|
};
|
|
47
44
|
if (el.parentElement && el.parentElement !== document.body) {
|
|
48
|
-
var parentScroll =
|
|
45
|
+
var parentScroll = _getScrollDist(el.parentElement);
|
|
49
46
|
elScroll.top += parentScroll.top;
|
|
50
47
|
elScroll.left += parentScroll.left;
|
|
51
48
|
}
|
|
@@ -142,21 +139,21 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
142
139
|
setVisible(!!props.visible);
|
|
143
140
|
}, [props.visible]);
|
|
144
141
|
var _useState9 = (0, _react.useState)(''),
|
|
145
|
-
|
|
146
|
-
evType =
|
|
147
|
-
setEvType =
|
|
148
|
-
var
|
|
142
|
+
_useState0 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
143
|
+
evType = _useState0[0],
|
|
144
|
+
setEvType = _useState0[1];
|
|
145
|
+
var _useState1 = (0, _react.useState)(!!props.visible || defaultVisible),
|
|
146
|
+
_useState10 = (0, _slicedToArray2.default)(_useState1, 2),
|
|
147
|
+
canAlign = _useState10[0],
|
|
148
|
+
setCanAlign = _useState10[1];
|
|
149
|
+
var _useState11 = (0, _react.useState)(initAlign),
|
|
149
150
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
var _useState13 = (0, _react.useState)(
|
|
151
|
+
align = _useState12[0],
|
|
152
|
+
setAlign = _useState12[1];
|
|
153
|
+
var _useState13 = (0, _react.useState)(placement),
|
|
153
154
|
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
var _useState15 = (0, _react.useState)(placement),
|
|
157
|
-
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
158
|
-
currentPlacement = _useState16[0],
|
|
159
|
-
setCurrentPlacement = _useState16[1];
|
|
155
|
+
currentPlacement = _useState14[0],
|
|
156
|
+
setCurrentPlacement = _useState14[1];
|
|
160
157
|
var alignPopper = (0, _react.useCallback)(function () {
|
|
161
158
|
if ((locatorRef === null || locatorRef === void 0 ? void 0 : locatorRef.current) && (popperRef === null || popperRef === void 0 ? void 0 : popperRef.current) && evType) {
|
|
162
159
|
var _popperRef$current$ge = popperRef.current.getBoundingClientRect(),
|
|
@@ -169,15 +166,15 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
169
166
|
right = _locatorRef$current$g.right,
|
|
170
167
|
height = _locatorRef$current$g.height,
|
|
171
168
|
width = _locatorRef$current$g.width;
|
|
172
|
-
var
|
|
173
|
-
containerTop =
|
|
174
|
-
containerLeft =
|
|
175
|
-
var
|
|
176
|
-
locatorTop =
|
|
177
|
-
locatorLeft =
|
|
178
|
-
var
|
|
179
|
-
scrollTop =
|
|
180
|
-
scrollLeft =
|
|
169
|
+
var _getOffsetPos2 = _getOffsetPos(container),
|
|
170
|
+
containerTop = _getOffsetPos2.top,
|
|
171
|
+
containerLeft = _getOffsetPos2.left;
|
|
172
|
+
var _getOffsetPos3 = _getOffsetPos(locatorRef.current),
|
|
173
|
+
locatorTop = _getOffsetPos3.top,
|
|
174
|
+
locatorLeft = _getOffsetPos3.left;
|
|
175
|
+
var _getScrollDist2 = _getScrollDist(locatorRef.current),
|
|
176
|
+
scrollTop = _getScrollDist2.top,
|
|
177
|
+
scrollLeft = _getScrollDist2.left;
|
|
181
178
|
var locatorPos = {
|
|
182
179
|
width: width,
|
|
183
180
|
height: height,
|
|
@@ -494,5 +491,4 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
494
491
|
var Popper = /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, popperProps), popperElement);
|
|
495
492
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, Locate, exist && container && /*#__PURE__*/_reactDom.default.createPortal(Popper, container));
|
|
496
493
|
}
|
|
497
|
-
var _default = usePopper;
|
|
498
|
-
exports.default = _default;
|
|
494
|
+
var _default = exports.default = usePopper;
|
|
@@ -12,5 +12,4 @@ var _defaultConfig = _interopRequireDefault(require("./defaultConfig"));
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
var ConfigContext = /*#__PURE__*/(0, _react.createContext)(_defaultConfig.default);
|
|
15
|
-
var _default = ConfigContext;
|
|
16
|
-
exports.default = _default;
|
|
15
|
+
var _default = exports.default = ConfigContext;
|
|
@@ -13,8 +13,7 @@ var _assign = _interopRequireDefault(require("lodash/assign"));
|
|
|
13
13
|
var _ConfigContext = _interopRequireDefault(require("./ConfigContext"));
|
|
14
14
|
var _defaultConfig = _interopRequireDefault(require("./defaultConfig"));
|
|
15
15
|
var _index = _interopRequireWildcard(require("../locale/index"));
|
|
16
|
-
function
|
|
17
|
-
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; }
|
|
16
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
17
|
/**
|
|
19
18
|
* 对外暴露用于注入全局配置属性的Context.Provider
|
|
20
19
|
*/
|
|
@@ -45,5 +44,4 @@ var ConfigProvider = function ConfigProvider(props) {
|
|
|
45
44
|
value: providerValue
|
|
46
45
|
}, props.children);
|
|
47
46
|
};
|
|
48
|
-
var _default = ConfigProvider;
|
|
49
|
-
exports.default = _default;
|
|
47
|
+
var _default = exports.default = ConfigProvider;
|
|
@@ -27,5 +27,4 @@ var _configProvider = _interopRequireDefault(require("./configProvider"));
|
|
|
27
27
|
var _compDefaultProps = _interopRequireDefault(require("./compDefaultProps"));
|
|
28
28
|
var _ConfigContext = _interopRequireDefault(require("./ConfigContext"));
|
|
29
29
|
var _defaultConfig = _interopRequireDefault(require("./defaultConfig"));
|
|
30
|
-
var _default = _configProvider.default;
|
|
31
|
-
exports.default = _default;
|
|
30
|
+
var _default = exports.default = _configProvider.default;
|
package/lib/locale/index.js
CHANGED
|
@@ -20,7 +20,5 @@ Object.defineProperty(exports, "getLangMsg", {
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
var _locale = _interopRequireWildcard(require("./locale"));
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
var _default = _locale.default;
|
|
26
|
-
exports.default = _default;
|
|
23
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
24
|
+
var _default = exports.default = _locale.default;
|
package/lib/locale/locale.js
CHANGED
|
@@ -17,9 +17,9 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/he
|
|
|
17
17
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
18
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
19
|
var _zhCN = _interopRequireDefault(require("./zh-CN"));
|
|
20
|
-
function _createForOfIteratorHelper(
|
|
21
|
-
function _unsupportedIterableToArray(
|
|
22
|
-
function _arrayLikeToArray(
|
|
20
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
21
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context2; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty2(_context2 = {}.toString.call(r)).call(_context2, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
22
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
23
23
|
var LocaleCache = /*#__PURE__*/function () {
|
|
24
24
|
function LocaleCache(localesData, locale) {
|
|
25
25
|
(0, _classCallCheck2.default)(this, LocaleCache);
|
|
@@ -31,7 +31,7 @@ var LocaleCache = /*#__PURE__*/function () {
|
|
|
31
31
|
* @param {LocaleDataType | string} localeData 语言数据集合 | 语言类型
|
|
32
32
|
* @returns 设置后的语言对应的语言包
|
|
33
33
|
*/
|
|
34
|
-
(0, _createClass2.default)(LocaleCache, [{
|
|
34
|
+
return (0, _createClass2.default)(LocaleCache, [{
|
|
35
35
|
key: "setLocalesData",
|
|
36
36
|
value: function setLocalesData(locale, localeData) {
|
|
37
37
|
var newLocaleData = localeData || this.localesData[locale];
|
|
@@ -68,12 +68,10 @@ var LocaleCache = /*#__PURE__*/function () {
|
|
|
68
68
|
return this.localesData;
|
|
69
69
|
}
|
|
70
70
|
}]);
|
|
71
|
-
return LocaleCache;
|
|
72
71
|
}();
|
|
73
72
|
var localeCacher = new LocaleCache((0, _defineProperty2.default)({}, _zhCN.default.locale, _zhCN.default));
|
|
74
|
-
var _default = localeCacher;
|
|
75
|
-
exports.
|
|
76
|
-
var getLangMsg = function getLangMsg(componentName, labelName, params) {
|
|
73
|
+
var _default = exports.default = localeCacher;
|
|
74
|
+
var getLangMsg = exports.getLangMsg = function getLangMsg(componentName, labelName, params) {
|
|
77
75
|
var _context;
|
|
78
76
|
var localData = localeCacher.getLocalData();
|
|
79
77
|
var msg = localData[(0, _concat.default)(_context = "".concat(componentName, ".")).call(_context, labelName)] || localData["global.".concat(labelName)] || '';
|
|
@@ -84,7 +82,6 @@ var getLangMsg = function getLangMsg(componentName, labelName, params) {
|
|
|
84
82
|
* @param {*} msg
|
|
85
83
|
* @param {*} variables
|
|
86
84
|
*/
|
|
87
|
-
exports.getLangMsg = getLangMsg;
|
|
88
85
|
function analysVariables(msg, variables) {
|
|
89
86
|
var reg = /{[\w\W]*?}/g;
|
|
90
87
|
var matchArr = msg.match(reg) || [];
|
|
@@ -184,18 +181,18 @@ function formatElement(msg, variables) {
|
|
|
184
181
|
var t = item.t,
|
|
185
182
|
v = item.v;
|
|
186
183
|
if (t === 0 && v !== '') {
|
|
187
|
-
elements.push(
|
|
184
|
+
elements.push(/*#__PURE__*/_react.default.createElement("span", {
|
|
188
185
|
key: index
|
|
189
186
|
}, v));
|
|
190
187
|
} else if (t === 1) {
|
|
191
|
-
elements.push(
|
|
188
|
+
elements.push(/*#__PURE__*/_react.default.cloneElement(variables[v], {
|
|
192
189
|
key: index
|
|
193
190
|
}));
|
|
194
191
|
}
|
|
195
192
|
});
|
|
196
193
|
return elements;
|
|
197
194
|
}
|
|
198
|
-
var getCompLangMsg = function getCompLangMsg(compLangMsgParams, customGetLangMsg, localeDate) {
|
|
195
|
+
var getCompLangMsg = exports.getCompLangMsg = function getCompLangMsg(compLangMsgParams, customGetLangMsg, localeDate) {
|
|
199
196
|
var componentName = compLangMsgParams.componentName,
|
|
200
197
|
labels = compLangMsgParams.labels,
|
|
201
198
|
labelParams = compLangMsgParams.labelParams;
|
|
@@ -219,5 +216,4 @@ var getCompLangMsg = function getCompLangMsg(compLangMsgParams, customGetLangMsg
|
|
|
219
216
|
}
|
|
220
217
|
});
|
|
221
218
|
return componentLangMsg;
|
|
222
|
-
};
|
|
223
|
-
exports.getCompLangMsg = getCompLangMsg;
|
|
219
|
+
};
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// color palettes
|
|
1
|
+
// color palettes
|
|
2
2
|
@blue-base: #1890ff;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "../table
|
|
1
|
+
@import "../table\style\index.less";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import 'motion';
|
|
1
|
+
@import 'motion';
|
|
2
2
|
@import 'reset';
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
@keyframes loadingcircle {
|
|
2
|
-
100% {
|
|
3
|
-
transform: rotate(360deg);
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@keyframes waveEffect {
|
|
8
|
-
100% {
|
|
9
|
-
box-shadow: 0 0 0 6px @theme-color;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@keyframes fadeEffect {
|
|
14
|
-
100% {
|
|
15
|
-
opacity: 0;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@keyframes kdRadioEffect {
|
|
20
|
-
0% {
|
|
21
|
-
transform: translateY(-50%) scale(0.5);
|
|
22
|
-
opacity: 0;
|
|
23
|
-
}
|
|
24
|
-
100% {
|
|
25
|
-
transform: translateY(-50%) scale(1);
|
|
26
|
-
opacity: 1;
|
|
27
|
-
}
|
|
1
|
+
@keyframes loadingcircle {
|
|
2
|
+
100% {
|
|
3
|
+
transform: rotate(360deg);
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@keyframes waveEffect {
|
|
8
|
+
100% {
|
|
9
|
+
box-shadow: 0 0 0 6px @theme-color;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes fadeEffect {
|
|
14
|
+
100% {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes kdRadioEffect {
|
|
20
|
+
0% {
|
|
21
|
+
transform: translateY(-50%) scale(0.5);
|
|
22
|
+
opacity: 0;
|
|
23
|
+
}
|
|
24
|
+
100% {
|
|
25
|
+
transform: translateY(-50%) scale(1);
|
|
26
|
+
opacity: 1;
|
|
27
|
+
}
|
|
28
28
|
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
@keyframes kdSlideDownIn {
|
|
2
|
-
0% {
|
|
3
|
-
transform: scaleY(0.8);
|
|
4
|
-
transform-origin: 50% 0%;
|
|
5
|
-
opacity: 0;
|
|
6
|
-
}
|
|
7
|
-
100% {
|
|
8
|
-
transform: scaleY(1);
|
|
9
|
-
transform-origin: 50% 0%;
|
|
10
|
-
opacity: 1;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@keyframes kdSlideDownOut {
|
|
15
|
-
0% {
|
|
16
|
-
transform: scaleY(1);
|
|
17
|
-
transform-origin: 50% 0%;
|
|
18
|
-
opacity: 1;
|
|
19
|
-
}
|
|
20
|
-
100% {
|
|
21
|
-
transform: scaleY(0.9);
|
|
22
|
-
transform-origin: 50% 0%;
|
|
23
|
-
opacity: 0;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@keyframes kdSlideUpIn {
|
|
28
|
-
0% {
|
|
29
|
-
transform-origin: 50% 100%;
|
|
30
|
-
opacity: 0;
|
|
31
|
-
}
|
|
32
|
-
5% {
|
|
33
|
-
transform: scaleY(0.8);
|
|
34
|
-
}
|
|
35
|
-
100% {
|
|
36
|
-
transform: scaleY(1);
|
|
37
|
-
transform-origin: 50% 100%;
|
|
38
|
-
opacity: 1;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@keyframes kdSlideUpOut {
|
|
43
|
-
0% {
|
|
44
|
-
transform: scaleY(1);
|
|
45
|
-
transform-origin: 50% 100%;
|
|
46
|
-
opacity: 1;
|
|
47
|
-
}
|
|
48
|
-
100% {
|
|
49
|
-
transform: scaleY(0.9);
|
|
50
|
-
transform-origin: 50% 100%;
|
|
51
|
-
opacity: 0;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
@keyframes kdSlideDownIn {
|
|
2
|
+
0% {
|
|
3
|
+
transform: scaleY(0.8);
|
|
4
|
+
transform-origin: 50% 0%;
|
|
5
|
+
opacity: 0;
|
|
6
|
+
}
|
|
7
|
+
100% {
|
|
8
|
+
transform: scaleY(1);
|
|
9
|
+
transform-origin: 50% 0%;
|
|
10
|
+
opacity: 1;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@keyframes kdSlideDownOut {
|
|
15
|
+
0% {
|
|
16
|
+
transform: scaleY(1);
|
|
17
|
+
transform-origin: 50% 0%;
|
|
18
|
+
opacity: 1;
|
|
19
|
+
}
|
|
20
|
+
100% {
|
|
21
|
+
transform: scaleY(0.9);
|
|
22
|
+
transform-origin: 50% 0%;
|
|
23
|
+
opacity: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@keyframes kdSlideUpIn {
|
|
28
|
+
0% {
|
|
29
|
+
transform-origin: 50% 100%;
|
|
30
|
+
opacity: 0;
|
|
31
|
+
}
|
|
32
|
+
5% {
|
|
33
|
+
transform: scaleY(0.8);
|
|
34
|
+
}
|
|
35
|
+
100% {
|
|
36
|
+
transform: scaleY(1);
|
|
37
|
+
transform-origin: 50% 100%;
|
|
38
|
+
opacity: 1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@keyframes kdSlideUpOut {
|
|
43
|
+
0% {
|
|
44
|
+
transform: scaleY(1);
|
|
45
|
+
transform-origin: 50% 100%;
|
|
46
|
+
opacity: 1;
|
|
47
|
+
}
|
|
48
|
+
100% {
|
|
49
|
+
transform: scaleY(0.9);
|
|
50
|
+
transform-origin: 50% 100%;
|
|
51
|
+
opacity: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import 'motion/other';
|
|
1
|
+
@import 'motion/other';
|
|
2
2
|
@import 'motion/slide';
|