@aloudata/aloudata-design 0.4.8-beta.12 → 0.4.8-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar/component/Avatar/index.js +5 -16
- package/dist/Breadcrumb/index.js +6 -16
- package/dist/Button/index.js +15 -32
- package/dist/Checkbox/component/CheckboxGroup/index.js +4 -10
- package/dist/Checkbox/index.js +1 -8
- package/dist/Checkbox/type.js +0 -1
- package/dist/ConfigProvider/defaultRenderEmpty.js +0 -5
- package/dist/ConfigProvider/sizeContext.js +1 -1
- package/dist/Divider/index.js +0 -3
- package/dist/DoubleCircleIcon/index.d.ts +1 -1
- package/dist/DoubleCircleIcon/index.js +7 -9
- package/dist/Dropdown/Button.js +7 -11
- package/dist/Dropdown/index.js +3 -9
- package/dist/Empty/image/Data.js +0 -2
- package/dist/Empty/image/Search.js +0 -2
- package/dist/Empty/image/SearchSmall.js +0 -2
- package/dist/Empty/image/User.js +0 -2
- package/dist/Empty/image/WorkBook.js +0 -2
- package/dist/Empty/index.js +13 -23
- package/dist/Icon/components/Icon.js +9 -13
- package/dist/Icon/components/createFromScripts.js +2 -8
- package/dist/Input/components/Group/index.js +4 -9
- package/dist/Input/components/Input/index.js +3 -9
- package/dist/Input/components/Password/index.js +5 -10
- package/dist/Input/components/TextArea/index.js +6 -11
- package/dist/Input/style/index.less +9 -2
- package/dist/InputNumber/index.js +7 -12
- package/dist/InputNumber/style/index.less +9 -4
- package/dist/Menu/SubMenu.js +1 -6
- package/dist/Menu/index.js +2 -7
- package/dist/Modal/index.js +107 -129
- package/dist/Modal/locale.js +4 -6
- package/dist/Navigator/components/Header/index.js +0 -2
- package/dist/Navigator/components/Menu/index.js +8 -19
- package/dist/Navigator/components/MenuItem/index.js +6 -9
- package/dist/Navigator/index.js +5 -7
- package/dist/Popconfirm/index.js +19 -27
- package/dist/Popover/index.js +2 -9
- package/dist/Radio/components/Group/index.js +26 -34
- package/dist/Radio/components/Radio/index.js +10 -18
- package/dist/Radio/style/index.less +0 -1
- package/dist/Select/components/MultipleOption.js +4 -6
- package/dist/Select/components/SingleOption.js +5 -7
- package/dist/Select/index.js +40 -90
- package/dist/Spin/CustomIcon/index.js +0 -2
- package/dist/Spin/index.js +1 -10
- package/dist/Steps/components/ProcessIcon/index.js +0 -2
- package/dist/Steps/components/Step/index.js +2 -8
- package/dist/Steps/index.js +8 -10
- package/dist/Switch/index.js +18 -30
- package/dist/Table/Table.js +86 -129
- package/dist/Table/components/Empty/index.js +0 -2
- package/dist/Table/components/Loading/index.js +0 -2
- package/dist/Table/components/TableBodyRowList/index.js +19 -39
- package/dist/Table/components/TableHead/index.js +55 -86
- package/dist/Table/hooks/useFrame.js +9 -24
- package/dist/Table/style/index.less +4 -0
- package/dist/Table/utils.js +8 -27
- package/dist/Tabs/index.js +26 -32
- package/dist/Tabs/style/index.less +8 -4
- package/dist/Tooltip/index.js +12 -12
- package/dist/Tree/index.js +2 -4
- package/dist/_utils/hooks/useControlledState.js +9 -21
- package/dist/_utils/hooks/useId.js +4 -5
- package/dist/_utils/hooks/usePrefixCls.js +2 -5
- package/dist/index.js +2 -1
- package/dist/locale-provider/index.js +8 -33
- package/dist/message/index.js +3 -7
- package/dist/notification/demo/index.js +0 -1
- package/dist/notification/index.js +39 -48
- package/dist/style/themes/default/themeColor.module.less +9 -9
- package/package.json +1 -1
|
@@ -1,63 +1,55 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(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); }
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
-
|
|
8
|
+
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; }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
11
|
import classNames from 'classnames';
|
|
16
12
|
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
|
17
13
|
import React, { createContext, useRef } from 'react';
|
|
18
14
|
export var RadioGroupContext = /*#__PURE__*/createContext({});
|
|
19
15
|
export default function RadioGroup(props) {
|
|
20
16
|
var children = props.children,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var sliderRef = useRef(null);
|
|
32
|
-
|
|
17
|
+
_props$radioGroupStyl = props.radioGroupStyle,
|
|
18
|
+
radioGroupStyle = _props$radioGroupStyl === void 0 ? 'border' : _props$radioGroupStyl,
|
|
19
|
+
_props$size = props.size,
|
|
20
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
21
|
+
_props$type = props.type,
|
|
22
|
+
type = _props$type === void 0 ? 'radio' : _props$type,
|
|
23
|
+
className = props.className,
|
|
24
|
+
_props$disabled = props.disabled,
|
|
25
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
26
|
+
// 滑块的ref
|
|
27
|
+
var sliderRef = useRef(null);
|
|
28
|
+
// 该hooks与useState相同,但是当props中有value值时,优先使用value的值
|
|
33
29
|
var _useMergedState = useMergedState(props.defaultValue, {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
value: props === null || props === void 0 ? void 0 : props.value
|
|
31
|
+
}),
|
|
32
|
+
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
33
|
+
value = _useMergedState2[0],
|
|
34
|
+
setValue = _useMergedState2[1];
|
|
40
35
|
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
37
|
var onRadioChange = function onRadioChange(selectedValue) {
|
|
42
|
-
var lastValue = value;
|
|
38
|
+
var lastValue = value;
|
|
39
|
+
// const val = ev.target.value;
|
|
43
40
|
// console.log(selectValue);
|
|
44
|
-
|
|
45
41
|
setValue(selectedValue);
|
|
46
42
|
var onChange = props.onChange;
|
|
47
|
-
|
|
48
43
|
if (onChange && selectedValue !== lastValue) {
|
|
49
44
|
onChange(selectedValue);
|
|
50
45
|
}
|
|
51
46
|
};
|
|
52
|
-
|
|
53
47
|
var getWrapperClass = function getWrapperClass() {
|
|
54
48
|
var _classNames;
|
|
55
|
-
|
|
56
49
|
var isButton = ['button', 'iconButton'].includes(type);
|
|
57
50
|
var tempType = type === 'iconButton' ? 'icon-button' : type;
|
|
58
51
|
return classNames('ald-radio-group', className, "ald-radio-group-".concat(tempType), (_classNames = {}, _defineProperty(_classNames, "ald-radio-group-".concat(radioGroupStyle), isButton), _defineProperty(_classNames, "ald-radio-group-".concat(size), isButton), _classNames));
|
|
59
52
|
};
|
|
60
|
-
|
|
61
53
|
return /*#__PURE__*/React.createElement(RadioGroupContext.Provider, {
|
|
62
54
|
value: {
|
|
63
55
|
onChange: onRadioChange,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import _ from 'lodash';
|
|
9
9
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
@@ -13,25 +13,21 @@ export default function Radio(props) {
|
|
|
13
13
|
var groupContext = useContext(RadioGroupContext);
|
|
14
14
|
var labelRef = useRef(null);
|
|
15
15
|
var id = getUUID().toString();
|
|
16
|
-
|
|
17
16
|
var radioProps = _objectSpread({}, props);
|
|
18
|
-
|
|
19
17
|
if (!_.isEmpty(groupContext)) {
|
|
20
18
|
radioProps.disabled = groupContext.disabled || props.disabled;
|
|
21
19
|
radioProps.checked = !props.disabled && groupContext.value === props.value;
|
|
22
20
|
} else {
|
|
23
21
|
radioProps.checked = !('checked' in props) ? props.defaultChecked : radioProps.checked;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
}
|
|
23
|
+
// 设置input外层盒子的class
|
|
27
24
|
var aldRadioClass = classNames('ald-radio', {
|
|
28
25
|
'ald-radio-checked': radioProps.checked,
|
|
29
26
|
'ald-radio-disabled': radioProps.disabled
|
|
30
|
-
});
|
|
31
|
-
|
|
27
|
+
});
|
|
28
|
+
// 根据属性设置最外层的class
|
|
32
29
|
var getWrapperClass = function getWrapperClass() {
|
|
33
30
|
var otherClass = '';
|
|
34
|
-
|
|
35
31
|
if (groupContext.type === 'button') {
|
|
36
32
|
if (groupContext.radioGroupStyle === 'filled') {
|
|
37
33
|
otherClass = 'ald-radio-button-wrapper-filled';
|
|
@@ -56,30 +52,26 @@ export default function Radio(props) {
|
|
|
56
52
|
// 当type未设置或者是radio时
|
|
57
53
|
otherClass = 'ald-radio-wrapper';
|
|
58
54
|
}
|
|
59
|
-
|
|
60
55
|
return classNames('ald-radio-label', otherClass, {
|
|
61
56
|
'ald-radio-wrapper-checked': radioProps.checked,
|
|
62
57
|
'ald-radio-wrapper-disabled': radioProps.disabled
|
|
63
58
|
});
|
|
64
|
-
};
|
|
65
|
-
|
|
59
|
+
};
|
|
66
60
|
|
|
61
|
+
// filled button模式下,更改滑块的位置
|
|
67
62
|
useEffect(function () {
|
|
68
63
|
var _groupContext$sliderR;
|
|
69
|
-
|
|
70
64
|
if (radioProps.checked && groupContext !== null && groupContext !== void 0 && (_groupContext$sliderR = groupContext.sliderRef) !== null && _groupContext$sliderR !== void 0 && _groupContext$sliderR.current && labelRef !== null && labelRef !== void 0 && labelRef.current) {
|
|
71
65
|
groupContext.sliderRef.current.style.left = "".concat(labelRef.current.offsetLeft, "px");
|
|
72
66
|
groupContext.sliderRef.current.style.width = "".concat(labelRef.current.offsetWidth, "px");
|
|
73
67
|
}
|
|
74
68
|
}, [groupContext.sliderRef, radioProps.checked]);
|
|
75
|
-
|
|
76
69
|
var onChange = function onChange() {
|
|
77
70
|
if (groupContext !== null && groupContext !== void 0 && groupContext.onChange) {
|
|
78
71
|
// input事件的value会被toString,所以此处进行一个覆盖
|
|
79
72
|
groupContext.onChange(props.value);
|
|
80
73
|
}
|
|
81
74
|
};
|
|
82
|
-
|
|
83
75
|
return /*#__PURE__*/React.createElement("label", {
|
|
84
76
|
className: getWrapperClass(),
|
|
85
77
|
htmlFor: id,
|
|
@@ -3,16 +3,14 @@ import classnames from 'classnames';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
export default function MultipleList(params) {
|
|
5
5
|
var disabled = params.disabled,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
option = params.option,
|
|
7
|
+
selected = params.selected,
|
|
8
|
+
onChange = params.onChange,
|
|
9
|
+
className = params.className;
|
|
11
10
|
var onClick = function onClick() {
|
|
12
11
|
if (disabled) return;
|
|
13
12
|
onChange === null || onChange === void 0 ? void 0 : onChange(!selected);
|
|
14
13
|
};
|
|
15
|
-
|
|
16
14
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
15
|
className: classnames('ald-multiple-option', className, {
|
|
18
16
|
'ald-multiple-option-disabled': disabled
|
|
@@ -4,17 +4,15 @@ import React from 'react';
|
|
|
4
4
|
import colors from "../../style/themes/default/themeColor.module.less";
|
|
5
5
|
export default function SingleOption(params) {
|
|
6
6
|
var disabled = params.disabled,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
selected = params.selected,
|
|
8
|
+
option = params.option,
|
|
9
|
+
_params$onChange = params.onChange,
|
|
10
|
+
onChange = _params$onChange === void 0 ? function () {} : _params$onChange,
|
|
11
|
+
className = params.className;
|
|
13
12
|
var onClick = function onClick() {
|
|
14
13
|
if (disabled) return;
|
|
15
14
|
onChange(!selected);
|
|
16
15
|
};
|
|
17
|
-
|
|
18
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
19
17
|
className: classnames('ald-single-option', className, {
|
|
20
18
|
'ald-single-option-disabled': disabled
|
package/dist/Select/index.js
CHANGED
|
@@ -1,33 +1,21 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
var _excluded = ["mode", "options", "dropdownRender", "onDropdownVisibleChange", "defaultValue", "onChange", "open", "defaultOpen", "prefix", "className", "popupClassName", "listHeight", "listItemHeight", "notFoundContent", "value", "style"];
|
|
2
|
-
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
-
|
|
9
8
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
|
|
11
9
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
-
|
|
13
10
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
|
-
|
|
15
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
-
|
|
17
12
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
|
|
19
13
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(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); }
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
24
|
-
|
|
14
|
+
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; }
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
25
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
-
|
|
27
17
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
|
-
|
|
29
18
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
30
|
-
|
|
31
19
|
import { FoldDownFill } from '@aloudata/icons-react';
|
|
32
20
|
import { Select as AntdSelect } from 'antd';
|
|
33
21
|
import classNames from 'classnames';
|
|
@@ -42,7 +30,6 @@ var suffixIconSizeMap = {
|
|
|
42
30
|
middle: 16,
|
|
43
31
|
small: 14
|
|
44
32
|
};
|
|
45
|
-
|
|
46
33
|
var getSelectedOptionsFromValue = function getSelectedOptionsFromValue(isMultiple, options, value, defaultValue) {
|
|
47
34
|
if (typeof value !== 'undefined') {
|
|
48
35
|
if (isMultiple) {
|
|
@@ -56,121 +43,97 @@ var getSelectedOptionsFromValue = function getSelectedOptionsFromValue(isMultipl
|
|
|
56
43
|
var _newOptions = options === null || options === void 0 ? void 0 : options.filter(function (option) {
|
|
57
44
|
return option.value === value;
|
|
58
45
|
});
|
|
59
|
-
|
|
60
46
|
return _newOptions || [];
|
|
61
47
|
}
|
|
62
|
-
|
|
63
48
|
return [];
|
|
64
49
|
}
|
|
65
|
-
|
|
66
50
|
if (typeof defaultValue !== 'undefined') {
|
|
67
51
|
if (isMultiple) {
|
|
68
52
|
if (Array.isArray(defaultValue)) {
|
|
69
53
|
var _newOptions2 = options === null || options === void 0 ? void 0 : options.filter(function (option) {
|
|
70
54
|
return defaultValue.includes(option.value);
|
|
71
55
|
});
|
|
72
|
-
|
|
73
56
|
return _newOptions2 || [];
|
|
74
57
|
}
|
|
75
58
|
} else {
|
|
76
59
|
var _newOptions3 = options === null || options === void 0 ? void 0 : options.filter(function (option) {
|
|
77
60
|
return option.value === defaultValue;
|
|
78
61
|
});
|
|
79
|
-
|
|
80
62
|
return _newOptions3 || [];
|
|
81
63
|
}
|
|
82
|
-
|
|
83
64
|
return [];
|
|
84
65
|
}
|
|
85
|
-
|
|
86
66
|
return [];
|
|
87
67
|
};
|
|
88
|
-
|
|
89
68
|
var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
90
69
|
var mode = props.mode,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
70
|
+
options = props.options,
|
|
71
|
+
dropdownRender = props.dropdownRender,
|
|
72
|
+
_onDropdownVisibleChange = props.onDropdownVisibleChange,
|
|
73
|
+
defaultValue = props.defaultValue,
|
|
74
|
+
onChange = props.onChange,
|
|
75
|
+
open = props.open,
|
|
76
|
+
defaultOpen = props.defaultOpen,
|
|
77
|
+
prefix = props.prefix,
|
|
78
|
+
className = props.className,
|
|
79
|
+
popupClassName = props.popupClassName,
|
|
80
|
+
listHeight = props.listHeight,
|
|
81
|
+
_props$listItemHeight = props.listItemHeight,
|
|
82
|
+
listItemHeight = _props$listItemHeight === void 0 ? 36 : _props$listItemHeight,
|
|
83
|
+
_props$notFoundConten = props.notFoundContent,
|
|
84
|
+
notFoundContent = _props$notFoundConten === void 0 ? /*#__PURE__*/React.createElement(Empty, {
|
|
85
|
+
image: Empty.PRESENTED_IMAGE_SEARCH_SMALL,
|
|
86
|
+
size: "small",
|
|
87
|
+
title: "No data"
|
|
88
|
+
}) : _props$notFoundConten,
|
|
89
|
+
value = props.value,
|
|
90
|
+
_props$style = props.style,
|
|
91
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
92
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
115
93
|
var isMultiple = mode === 'multiple';
|
|
116
|
-
|
|
117
94
|
var _React$useState = React.useState(getSelectedOptionsFromValue(isMultiple, options, value, defaultValue)),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
95
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
96
|
+
selectedOptions = _React$useState2[0],
|
|
97
|
+
setSelectedOptions = _React$useState2[1];
|
|
122
98
|
var dropDownTimeRef = React.useRef(0);
|
|
123
|
-
|
|
124
99
|
var _React$useState3 = React.useState(typeof open === 'boolean' ? open : defaultOpen),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
100
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
101
|
+
isOpen = _React$useState4[0],
|
|
102
|
+
setIsOpen = _React$useState4[1];
|
|
129
103
|
var prefixRef = React.useRef(null);
|
|
130
|
-
|
|
131
104
|
var _React$useState5 = React.useState(0),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
105
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
106
|
+
prefixWidth = _React$useState6[0],
|
|
107
|
+
setPrefixWidth = _React$useState6[1];
|
|
136
108
|
var updatedRef = useRef(false);
|
|
137
|
-
|
|
138
109
|
var onMultipleOptionChange = function onMultipleOptionChange(option, selected) {
|
|
139
110
|
var newOptions = [];
|
|
140
|
-
|
|
141
111
|
if (selected) {
|
|
142
112
|
var _props$onSelect;
|
|
143
|
-
|
|
144
113
|
newOptions = [].concat(_toConsumableArray(selectedOptions), [option]);
|
|
145
114
|
(_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 ? void 0 : _props$onSelect.call(props, option.value, option);
|
|
146
115
|
} else {
|
|
147
116
|
var _props$onDeselect;
|
|
148
|
-
|
|
149
117
|
(_props$onDeselect = props.onDeselect) === null || _props$onDeselect === void 0 ? void 0 : _props$onDeselect.call(props, option.value, option);
|
|
150
118
|
newOptions = selectedOptions.filter(function (item) {
|
|
151
119
|
return item.value !== option.value;
|
|
152
120
|
});
|
|
153
121
|
}
|
|
154
|
-
|
|
155
122
|
if (typeof value === 'undefined') {
|
|
156
123
|
setSelectedOptions(newOptions);
|
|
157
124
|
}
|
|
158
|
-
|
|
159
125
|
onChange === null || onChange === void 0 ? void 0 : onChange(newOptions.map(function (item) {
|
|
160
126
|
return item.value;
|
|
161
127
|
}), newOptions);
|
|
162
128
|
};
|
|
163
|
-
|
|
164
129
|
var getListHeight = function getListHeight() {
|
|
165
130
|
if (typeof listHeight === 'number' && options !== null && options !== void 0 && options.length) {
|
|
166
131
|
if (listHeight <= options.length * listItemHeight) {
|
|
167
132
|
return listHeight;
|
|
168
133
|
}
|
|
169
134
|
}
|
|
170
|
-
|
|
171
135
|
return 0;
|
|
172
136
|
};
|
|
173
|
-
|
|
174
137
|
var multipleRender = function multipleRender() {
|
|
175
138
|
return /*#__PURE__*/React.createElement("div", {
|
|
176
139
|
className: "ald-multiple-option-list"
|
|
@@ -196,19 +159,15 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
196
159
|
});
|
|
197
160
|
}));
|
|
198
161
|
};
|
|
199
|
-
|
|
200
162
|
var onSingleOptionChange = function onSingleOptionChange(option) {
|
|
201
163
|
var _props$onSelect2;
|
|
202
|
-
|
|
203
164
|
if (typeof value === 'undefined') {
|
|
204
165
|
setSelectedOptions([option]);
|
|
205
166
|
}
|
|
206
|
-
|
|
207
167
|
onChange === null || onChange === void 0 ? void 0 : onChange(option.value, option);
|
|
208
168
|
(_props$onSelect2 = props.onSelect) === null || _props$onSelect2 === void 0 ? void 0 : _props$onSelect2.call(props, option.value, option);
|
|
209
169
|
setIsOpen(false);
|
|
210
170
|
};
|
|
211
|
-
|
|
212
171
|
var singleRender = function singleRender() {
|
|
213
172
|
return /*#__PURE__*/React.createElement("div", {
|
|
214
173
|
className: "ald-single-option-list"
|
|
@@ -234,7 +193,6 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
234
193
|
});
|
|
235
194
|
}));
|
|
236
195
|
};
|
|
237
|
-
|
|
238
196
|
var getDropdownRender = function getDropdownRender() {
|
|
239
197
|
if (dropdownRender) {
|
|
240
198
|
if (isMultiple) {
|
|
@@ -244,7 +202,6 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
244
202
|
};
|
|
245
203
|
} else {
|
|
246
204
|
var _menu = singleRender();
|
|
247
|
-
|
|
248
205
|
return function () {
|
|
249
206
|
return dropdownRender(_menu);
|
|
250
207
|
};
|
|
@@ -260,11 +217,10 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
260
217
|
return /*#__PURE__*/React.createElement(React.Fragment, null, notFoundContent);
|
|
261
218
|
};
|
|
262
219
|
}
|
|
263
|
-
};
|
|
220
|
+
};
|
|
221
|
+
// todo: tagRender
|
|
264
222
|
// todo: 隐藏已选择项
|
|
265
223
|
// todo: 分组
|
|
266
|
-
|
|
267
|
-
|
|
268
224
|
var currentValue = useMemo(function () {
|
|
269
225
|
if (isMultiple) {
|
|
270
226
|
return selectedOptions.map(function (option) {
|
|
@@ -272,7 +228,6 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
272
228
|
});
|
|
273
229
|
} else {
|
|
274
230
|
var _selectedOptions$;
|
|
275
|
-
|
|
276
231
|
return (_selectedOptions$ = selectedOptions[0]) === null || _selectedOptions$ === void 0 ? void 0 : _selectedOptions$.value;
|
|
277
232
|
}
|
|
278
233
|
}, [selectedOptions]);
|
|
@@ -284,18 +239,15 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
284
239
|
var styleVar = {
|
|
285
240
|
'--ald-select-prefix-width': "".concat(prefixWidth, "px")
|
|
286
241
|
};
|
|
287
|
-
|
|
288
242
|
var tagRender = function tagRender(props) {
|
|
289
243
|
var label = props.label;
|
|
290
244
|
return /*#__PURE__*/React.createElement("span", {
|
|
291
245
|
className: "ald-select-multiple-tag-default"
|
|
292
246
|
}, label);
|
|
293
247
|
};
|
|
294
|
-
|
|
295
248
|
var maxTagPlaceholder = function maxTagPlaceholder(omittedValues) {
|
|
296
249
|
return /*#__PURE__*/React.createElement(React.Fragment, null, "\u7B49", omittedValues.length, "\u9879");
|
|
297
250
|
};
|
|
298
|
-
|
|
299
251
|
useEffect(function () {
|
|
300
252
|
if (updatedRef.current) {
|
|
301
253
|
setSelectedOptions(getSelectedOptionsFromValue(isMultiple, options, value));
|
|
@@ -348,11 +300,9 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
348
300
|
}),
|
|
349
301
|
onDropdownVisibleChange: function onDropdownVisibleChange(open) {
|
|
350
302
|
setIsOpen(open);
|
|
351
|
-
|
|
352
303
|
if (!open) {
|
|
353
304
|
dropDownTimeRef.current = Date.now();
|
|
354
305
|
}
|
|
355
|
-
|
|
356
306
|
_onDropdownVisibleChange === null || _onDropdownVisibleChange === void 0 ? void 0 : _onDropdownVisibleChange(open);
|
|
357
307
|
},
|
|
358
308
|
value: value !== null && value !== void 0 ? value : currentValue,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import "./index.less";
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
|
|
5
4
|
var Icon = function Icon(props) {
|
|
6
5
|
var size = props.size;
|
|
7
6
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -22,5 +21,4 @@ var Icon = function Icon(props) {
|
|
|
22
21
|
className: "icon-bar"
|
|
23
22
|
})));
|
|
24
23
|
};
|
|
25
|
-
|
|
26
24
|
export default Icon;
|
package/dist/Spin/index.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
var _excluded = ["size"];
|
|
2
|
-
|
|
3
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
5
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
-
|
|
7
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
-
|
|
9
5
|
import { Spin } from 'antd';
|
|
10
6
|
import React from 'react';
|
|
11
7
|
import CustomIcon from "./CustomIcon";
|
|
12
|
-
|
|
13
8
|
function CustomSpin(props) {
|
|
14
9
|
var size = props.size,
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
17
11
|
var spinSize = 'default';
|
|
18
|
-
|
|
19
12
|
if (size === 'middle') {
|
|
20
13
|
spinSize = 'default';
|
|
21
14
|
}
|
|
22
|
-
|
|
23
15
|
return /*#__PURE__*/React.createElement(Spin, _extends({
|
|
24
16
|
indicator: /*#__PURE__*/React.createElement(CustomIcon, {
|
|
25
17
|
size: props.size
|
|
@@ -28,5 +20,4 @@ function CustomSpin(props) {
|
|
|
28
20
|
size: spinSize
|
|
29
21
|
}));
|
|
30
22
|
}
|
|
31
|
-
|
|
32
23
|
export default CustomSpin;
|
|
@@ -7,7 +7,6 @@ export function ProcessIcon(_ref) {
|
|
|
7
7
|
}, /*#__PURE__*/React.createElement("img", {
|
|
8
8
|
src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTEiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDExIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0zLjc1IDcuOTQzMjVMMCA0LjE5MzI1TDEuMTkzMjUgM0wzLjc1IDUuNTU2NzVMOS4zMDc1IDBMMTAuNTAzNyAxLjE4ODc1TDMuNzUgNy45NDMyNVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo="
|
|
9
9
|
}));
|
|
10
|
-
|
|
11
10
|
if (type === 'error') {
|
|
12
11
|
return /*#__PURE__*/React.createElement("span", {
|
|
13
12
|
className: classNames("".concat(type, "-icon-box"), 'icon-box')
|
|
@@ -15,7 +14,6 @@ export function ProcessIcon(_ref) {
|
|
|
15
14
|
src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMyIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDMgMTAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0wLjI4MTI1MSAwSDEuOTY4NzVWNi41SDAuMjgxMjUxVjBaTTEuMTI1IDEwQzAuOTAyNDk3IDEwIDAuNjg0OTkgOS45MzQwMiAwLjQ5OTk4NSA5LjgxMDRDMC4zMTQ5NzkgOS42ODY3OSAwLjE3MDc4NSA5LjUxMTA4IDAuMDg1NjM2MSA5LjMwNTUyQzAuMDAwNDg3NDQ3IDkuMDk5OTUgLTAuMDIxNzkxMyA4Ljg3Mzc1IDAuMDIxNjE3MSA4LjY1NTUyQzAuMDY1MDI1NSA4LjQzNzI5IDAuMTcyMTcxIDguMjM2ODQgMC4zMjk1MDUgOC4wNzk1MUMwLjQ4Njg0IDcuOTIyMTcgMC42ODcyOTUgNy44MTUwMiAwLjkwNTUyNCA3Ljc3MTYyQzEuMTIzNzUgNy43MjgyMSAxLjM0OTk1IDcuNzUwNDkgMS41NTU1MiA3LjgzNTY0QzEuNzYxMDkgNy45MjA3OCAxLjkzNjc5IDguMDY0OTggMi4wNjA0IDguMjQ5OThDMi4xODQwMiA4LjQzNDk5IDIuMjUgOC42NTI1IDIuMjUgOC44NzVDMi4yNSA5LjE3MzM3IDIuMTMxNDcgOS40NTk1MiAxLjkyMDUgOS42NzA0OUMxLjcwOTUyIDkuODgxNDcgMS40MjMzNyAxMCAxLjEyNSAxMFoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo="
|
|
16
15
|
}));
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
return /*#__PURE__*/React.createElement("span", {
|
|
20
18
|
className: classNames("".concat(type, "-icon-box"), 'icon-box')
|
|
21
19
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { CheckCircleDuotone, AlertTriangleDuotone } from '@aloudata/icons-react';
|
|
5
4
|
import { ProcessIcon } from "../ProcessIcon";
|
|
@@ -7,7 +6,6 @@ import { Steps as AntdSteps } from 'antd';
|
|
|
7
6
|
var AntdStep = AntdSteps.Step;
|
|
8
7
|
export function Step(props) {
|
|
9
8
|
var status = props.status;
|
|
10
|
-
|
|
11
9
|
var getIcon = function getIcon(stepStatus) {
|
|
12
10
|
if (stepStatus === 'error') {
|
|
13
11
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -18,7 +16,6 @@ export function Step(props) {
|
|
|
18
16
|
fill: ['#D92D20', 'fff']
|
|
19
17
|
}));
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
if (stepStatus === 'finish') {
|
|
23
20
|
return /*#__PURE__*/React.createElement("span", {
|
|
24
21
|
className: "check-icon-box icon-box"
|
|
@@ -28,19 +25,16 @@ export function Step(props) {
|
|
|
28
25
|
fill: ['#D92D20', 'fff']
|
|
29
26
|
}));
|
|
30
27
|
}
|
|
31
|
-
|
|
32
28
|
if (stepStatus === 'process') {
|
|
33
29
|
return /*#__PURE__*/React.createElement(ProcessIcon, {
|
|
34
30
|
type: "process"
|
|
35
31
|
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
}
|
|
33
|
+
// wait
|
|
39
34
|
return /*#__PURE__*/React.createElement(ProcessIcon, {
|
|
40
35
|
type: "wait"
|
|
41
36
|
});
|
|
42
37
|
};
|
|
43
|
-
|
|
44
38
|
return /*#__PURE__*/React.createElement(AntdStep, _extends({}, props, {
|
|
45
39
|
icon: getIcon(status)
|
|
46
40
|
}));
|