@ucloud-fe/react-components 1.3.26 → 1.4.1
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/CHANGELOG.md +19 -0
- package/dist/icon.min.js +1 -1
- package/dist/main.min.js +4 -4
- package/lib/components/AutoComplete/AutoComplete.js +7 -4
- package/lib/components/Badge/Bubble.d.ts +2 -0
- package/lib/components/Box/Box.d.ts +1 -0
- package/lib/components/Calendar/Calendar.d.ts +6 -1
- package/lib/components/Calendar/Calendar.js +12 -4
- package/lib/components/Calendar/Cell.d.ts +8 -0
- package/lib/components/Calendar/Cell.js +55 -0
- package/lib/components/Calendar/HeaderButton.d.ts +8 -0
- package/lib/components/Calendar/HeaderButton.js +75 -0
- package/lib/components/Calendar/HeaderSwitcher.d.ts +2 -1
- package/lib/components/Calendar/Month.js +10 -4
- package/lib/components/Calendar/TwoSide.d.ts +4 -0
- package/lib/components/Calendar/TwoSide.js +155 -0
- package/lib/components/Calendar/index.d.ts +3 -0
- package/lib/components/Calendar/index.js +9 -0
- package/lib/components/Calendar/locale/en_US.js +2 -1
- package/lib/components/Calendar/locale/zh_CN.d.ts +1 -0
- package/lib/components/Calendar/locale/zh_CN.js +3 -2
- package/lib/components/Calendar/style/index.d.ts +13 -0
- package/lib/components/Calendar/style/index.js +29 -7
- package/lib/components/Calendar/utils.d.ts +1 -1
- package/lib/components/Calendar/utils.js +5 -5
- package/lib/components/DatePicker/DatePicker.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.js +5 -7
- package/lib/components/DatePicker/Footer.d.ts +5 -2
- package/lib/components/DatePicker/Footer.js +31 -55
- package/lib/components/DatePicker/Month.js +4 -6
- package/lib/components/DatePicker/Range.d.ts +2 -2
- package/lib/components/DatePicker/Range.js +179 -71
- package/lib/components/DatePicker/locale/en_US.js +2 -1
- package/lib/components/DatePicker/locale/zh_CN.d.ts +1 -0
- package/lib/components/DatePicker/locale/zh_CN.js +2 -1
- package/lib/components/DatePicker/style/index.d.ts +24 -5
- package/lib/components/DatePicker/style/index.js +102 -34
- package/lib/components/DatePicker/usePicker.js +90 -31
- package/lib/components/DatePicker/useRangePicker.d.ts +16 -0
- package/lib/components/DatePicker/{RangePicker.js → useRangePicker.js} +44 -80
- package/lib/components/DatePicker/utils.d.ts +1 -1
- package/lib/components/Form/ControllerContext.d.ts +1 -1
- package/lib/components/Input/Input.js +4 -2
- package/lib/components/Input/Search.js +1 -1
- package/lib/components/Input/style/index.d.ts +2 -1
- package/lib/components/Input/style/index.js +6 -4
- package/lib/components/Loading/Loading.d.ts +1 -0
- package/lib/components/NumberInput/NumberInput.d.ts +12 -0
- package/lib/components/NumberInput/NumberInput.js +1 -1
- package/lib/components/Pagination/Options.js +1 -1
- package/lib/components/Popover/Popover.d.ts +17 -13
- package/lib/components/Popover/Popover.js +1 -3
- package/lib/components/Popover/style/index.d.ts +1 -0
- package/lib/components/Popover/style/index.js +1 -1
- package/lib/components/Select/style/index.d.ts +6 -6
- package/lib/components/SvgIcon/SvgIcon.d.ts +1 -0
- package/lib/components/SvgIcon/SvgIcon.js +6 -0
- package/lib/components/SvgIcon/SvgIconWrap.d.ts +1 -0
- package/lib/components/SvgIcon/icons/DoubleArrowLeft.d.ts +3 -0
- package/lib/components/SvgIcon/icons/DoubleArrowLeft.js +27 -0
- package/lib/components/SvgIcon/icons/DoubleArrowRight.d.ts +3 -0
- package/lib/components/SvgIcon/icons/DoubleArrowRight.js +26 -0
- package/lib/components/Switch/style/index.js +2 -2
- package/lib/components/Tabs/Tabs.js +1 -1
- package/lib/components/Tabs/style/index.d.ts +1 -1
- package/lib/components/Tag/Group.d.ts +1 -0
- package/lib/components/Tag/Icon.d.ts +1 -0
- package/lib/components/Tag/Tag.d.ts +1 -0
- package/lib/components/Textarea/Textarea.d.ts +1 -0
- package/lib/components/ThemeProvider/ThemeProvider.d.ts +6 -0
- package/lib/components/ThemeProvider/dark.js +6 -249
- package/lib/components/ThemeProvider/designTokens.d.ts +267 -258
- package/lib/components/ThemeProvider/designTokens.js +460 -185
- package/lib/components/ThemeProvider/designTokensDark.d.ts +267 -0
- package/lib/components/ThemeProvider/designTokensDark.js +540 -0
- package/lib/components/ThemeProvider/theme.d.ts +1 -1
- package/lib/components/ThemeProvider/theme.js +3 -3
- package/lib/components/TimePicker/TimePicker.d.ts +1 -1
- package/lib/components/TimePicker/TimePicker.js +11 -13
- package/lib/components/TimePicker/style/index.d.ts +3 -1
- package/lib/components/TimePicker/style/index.js +11 -21
- package/lib/hooks/usePopoverConfig.d.ts +4 -4
- package/lib/libs/dom-align/adjustForViewport.js +55 -0
- package/lib/libs/dom-align/align/align.js +244 -0
- package/lib/libs/dom-align/align/alignElement.js +34 -0
- package/lib/libs/dom-align/align/alignPoint.js +67 -0
- package/lib/libs/dom-align/getAlignOffset.js +38 -0
- package/lib/libs/dom-align/getElFuturePos.js +23 -0
- package/lib/libs/dom-align/getOffsetParent.js +63 -0
- package/lib/libs/dom-align/getRegion.js +38 -0
- package/lib/libs/dom-align/getVisibleRectForElement.js +118 -0
- package/lib/libs/dom-align/index.js +27 -0
- package/lib/libs/dom-align/isAncestorFixed.js +34 -0
- package/lib/libs/dom-align/propertyUtils.js +138 -0
- package/lib/libs/dom-align/utils.js +657 -0
- package/lib/libs/rc-align/index.d.ts +4 -0
- package/lib/libs/rc-align/index.js +15 -3
- package/lib/libs/rc-table/Table.d.ts +5 -0
- package/lib/libs/rc-table/TableCell.d.ts +1 -0
- package/lib/libs/rc-trigger/index.js +14 -0
- package/lib/libs/rc-trigger/src/LazyRenderBox.js +82 -0
- package/lib/libs/rc-trigger/src/Popup.js +383 -0
- package/lib/libs/rc-trigger/src/PopupInner.js +85 -0
- package/lib/libs/rc-trigger/src/index.js +867 -0
- package/lib/libs/rc-trigger/src/mock.js +33 -0
- package/lib/libs/rc-trigger/src/utils.js +48 -0
- package/lib/utils/KeyCode.d.ts +15 -0
- package/lib/{interfaces → utils}/KeyCode.js +0 -0
- package/package.json +4 -6
- package/lib/components/DatePicker/RangePicker.d.ts +0 -17
- package/lib/interfaces/KeyCode.d.ts +0 -15
- package/lib/style/color.js +0 -23
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _Portal = _interopRequireDefault(require("rc-util/lib/Portal"));
|
|
11
|
+
|
|
12
|
+
var _index = _interopRequireDefault(require("./index"));
|
|
13
|
+
|
|
14
|
+
_Portal.default.prototype.render = function () {
|
|
15
|
+
// eslint-disable-line
|
|
16
|
+
return this.props.children;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var render = _index.default.prototype.render;
|
|
20
|
+
|
|
21
|
+
_index.default.prototype.render = function () {
|
|
22
|
+
// eslint-disable-line
|
|
23
|
+
var tree = render.call(this);
|
|
24
|
+
|
|
25
|
+
if (this.state.popupVisible || this._component) {
|
|
26
|
+
return tree;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return tree[0];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var _default = _index.default;
|
|
33
|
+
exports.default = _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.getAlignFromPlacement = getAlignFromPlacement;
|
|
9
|
+
exports.getAlignPopupClassName = getAlignPopupClassName;
|
|
10
|
+
exports.saveRef = saveRef;
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
+
|
|
18
|
+
function isPointsEq(a1, a2, isAlignPoint) {
|
|
19
|
+
if (isAlignPoint) {
|
|
20
|
+
return a1[0] === a2[0];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return a1[0] === a2[0] && a1[1] === a2[1];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function getAlignFromPlacement(builtinPlacements, placementStr, align) {
|
|
27
|
+
var baseAlign = builtinPlacements[placementStr] || {};
|
|
28
|
+
return _objectSpread(_objectSpread({}, baseAlign), align);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
|
|
32
|
+
var points = align.points;
|
|
33
|
+
|
|
34
|
+
for (var placement in builtinPlacements) {
|
|
35
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
36
|
+
if (builtinPlacements.hasOwnProperty(placement)) {
|
|
37
|
+
if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) {
|
|
38
|
+
return "".concat(prefixCls, "-placement-").concat(placement);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function saveRef(name, component) {
|
|
47
|
+
this[name] = component;
|
|
48
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
ZERO: number;
|
|
3
|
+
NINE: number;
|
|
4
|
+
NUMPAD_ZERO: number;
|
|
5
|
+
NUMPAD_NINE: number;
|
|
6
|
+
BACKSPACE: number;
|
|
7
|
+
TAB: number;
|
|
8
|
+
ENTER: number;
|
|
9
|
+
DELETE: number;
|
|
10
|
+
ARROW_UP: number;
|
|
11
|
+
ARROW_DOWN: number;
|
|
12
|
+
ARROW_LEFT: number;
|
|
13
|
+
ARROW_RIGHT: number;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ucloud-fe/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"title": "UCloud react components",
|
|
5
5
|
"description": "UCloud react components",
|
|
6
6
|
"keywords": [
|
|
@@ -58,12 +58,10 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@emotion/core": "^10.0.35",
|
|
60
60
|
"@emotion/styled": "^10.0.27",
|
|
61
|
-
"@z-r/calendar": "0.
|
|
61
|
+
"@z-r/calendar": "0.5.2",
|
|
62
62
|
"classnames": "^2.2.5",
|
|
63
|
-
"color": "^3.0.0",
|
|
64
63
|
"component-classes": "^1.2.6",
|
|
65
64
|
"create-react-context": "^0.2.3",
|
|
66
|
-
"dom-align": "^1.12.0",
|
|
67
65
|
"emotion": "^10.0.27",
|
|
68
66
|
"emotion-theming": "^10.0.27",
|
|
69
67
|
"file-bytes-formatter": "^1.0.4",
|
|
@@ -72,10 +70,10 @@
|
|
|
72
70
|
"mini-store": "^1.0.2",
|
|
73
71
|
"moment": "^2.22.2",
|
|
74
72
|
"prop-types": "^15.7.2",
|
|
73
|
+
"rc-animate": "2",
|
|
75
74
|
"rc-dialog": "7.7.0",
|
|
76
75
|
"rc-form": "2.4.12",
|
|
77
76
|
"rc-slider": "8.6.13",
|
|
78
|
-
"rc-trigger": "2.5.3",
|
|
79
77
|
"rc-util": "4.21.1",
|
|
80
78
|
"react-lifecycles-compat": "^3.0.4",
|
|
81
79
|
"react-resizable": "^2.0.0",
|
|
@@ -152,7 +150,7 @@
|
|
|
152
150
|
"stylelint-config-styled-components": "^0.1.1",
|
|
153
151
|
"stylelint-processor-styled-components": "^1.10.0",
|
|
154
152
|
"tsc-alias": "^1.2.10",
|
|
155
|
-
"typescript": "^4.
|
|
153
|
+
"typescript": "^4.6.4",
|
|
156
154
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
157
155
|
"url-loader": "^1.0.1",
|
|
158
156
|
"webpack": "^4.44.1",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DatePickerProps } from './DatePicker';
|
|
3
|
-
export declare type RangePickerRef = {
|
|
4
|
-
focus: () => void;
|
|
5
|
-
} | undefined;
|
|
6
|
-
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<DatePickerProps & {
|
|
7
|
-
prefix?: boolean | undefined;
|
|
8
|
-
onActiveChange: (active: boolean) => void;
|
|
9
|
-
type?: "date" | "month" | undefined;
|
|
10
|
-
readonly?: boolean | undefined;
|
|
11
|
-
tip?: React.ReactNode;
|
|
12
|
-
error?: React.ReactNode;
|
|
13
|
-
footerTip?: React.ReactNode;
|
|
14
|
-
} & React.RefAttributes<{
|
|
15
|
-
focus: () => void;
|
|
16
|
-
} | undefined>>>;
|
|
17
|
-
export default _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
const ZERO: number;
|
|
3
|
-
const NINE: number;
|
|
4
|
-
const NUMPAD_ZERO: number;
|
|
5
|
-
const NUMPAD_NINE: number;
|
|
6
|
-
const BACKSPACE: number;
|
|
7
|
-
const TAB: number;
|
|
8
|
-
const ENTER: number;
|
|
9
|
-
const DELETE: number;
|
|
10
|
-
const ARROW_UP: number;
|
|
11
|
-
const ARROW_DOWN: number;
|
|
12
|
-
const ARROW_LEFT: number;
|
|
13
|
-
const ARROW_RIGHT: number;
|
|
14
|
-
}
|
|
15
|
-
export default _default;
|
package/lib/style/color.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.tint = void 0;
|
|
9
|
-
|
|
10
|
-
var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/newArrowCheck"));
|
|
11
|
-
|
|
12
|
-
var _color = _interopRequireDefault(require("color"));
|
|
13
|
-
|
|
14
|
-
var _this = void 0;
|
|
15
|
-
|
|
16
|
-
global.Color = _color.default;
|
|
17
|
-
|
|
18
|
-
var tint = function tint(color, weight) {
|
|
19
|
-
(0, _newArrowCheck2.default)(this, _this);
|
|
20
|
-
return (0, _color.default)(color).mix((0, _color.default)('#fff'), weight).string();
|
|
21
|
-
}.bind(void 0);
|
|
22
|
-
|
|
23
|
-
exports.tint = tint;
|