@aloudata/aloudata-design 0.3.1 → 0.3.4
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/README.md +15 -5
- package/es/Breadcrumb/index.d.ts +1 -0
- package/es/Button/index.js +3 -2
- package/es/Button/style/index.less +135 -126
- package/es/Button/style/variables.less +53 -53
- package/es/Card/index.d.ts +3 -0
- package/es/Card/index.js +3 -0
- package/es/Card/style/index.d.ts +2 -0
- package/es/Card/style/index.js +2 -0
- package/es/Card/style/index.less +1 -0
- package/es/Checkbox/index.d.ts +1 -0
- package/es/ConfigProvider/defaultRenderEmpty.d.ts +4 -0
- package/es/ConfigProvider/defaultRenderEmpty.js +37 -0
- package/es/ConfigProvider/sizeContext.d.ts +9 -0
- package/es/ConfigProvider/sizeContext.js +12 -0
- package/es/Dropdown/Button.js +4 -3
- package/es/Empty/image/Authority.d.ts +1 -0
- package/es/Empty/image/Dataspace.d.ts +1 -0
- package/es/Empty/image/Search.d.ts +1 -0
- package/es/Empty/image/Simple.d.ts +1 -0
- package/es/Empty/image/Worksheet.d.ts +1 -0
- package/es/Empty/image/empty.d.ts +1 -0
- package/es/Icon/icons/CheckLine.d.ts +13 -0
- package/es/Icon/icons/CheckLine.js +73 -0
- package/es/Icon/icons.json +410 -0
- package/es/Input/components/Group/index.d.ts +3 -1
- package/es/Input/components/Group/index.js +6 -12
- package/es/Input/components/Input/index.d.ts +3 -2
- package/es/Input/components/Input/index.js +11 -23
- package/es/Input/components/Password/index.js +11 -16
- package/es/Input/components/TextArea/index.d.ts +8 -1
- package/es/Input/components/TextArea/index.js +8 -1
- package/es/Input/style/index.less +180 -102
- package/es/InputNumber/index.d.ts +1 -0
- package/es/InputNumber/style/index.less +69 -69
- package/es/Menu/Divider.d.ts +1 -0
- package/es/Modal/index.js +20 -16
- package/es/Modal/locale.d.ts +7 -0
- package/es/Modal/locale.js +20 -0
- package/es/Modal/style/index.less +48 -45
- package/es/Navigator/components/Header/index.d.ts +1 -0
- package/es/Navigator/components/Menu/index.d.ts +1 -0
- package/es/Navigator/components/MenuItem/index.d.ts +1 -1
- package/es/Navigator/index.d.ts +1 -1
- package/es/PageHeader/index.d.ts +3 -0
- package/es/PageHeader/index.js +3 -0
- package/es/PageHeader/style/index.d.ts +2 -0
- package/es/PageHeader/style/index.js +2 -0
- package/es/PageHeader/style/index.less +1 -0
- package/es/Popover/index.d.ts +1 -0
- package/es/Radio/components/Group/index.d.ts +6 -0
- package/es/Radio/components/Group/index.js +72 -0
- package/es/Radio/components/Radio/index.d.ts +3 -0
- package/es/Radio/components/Radio/index.js +95 -0
- package/es/Radio/index.d.ts +9 -2
- package/es/Radio/index.js +5 -3
- package/es/Radio/interface/radio.d.ts +24 -0
- package/es/Radio/interface/radio.js +1 -0
- package/es/Radio/interface/radioGroup.d.ts +42 -0
- package/es/Radio/interface/radioGroup.js +1 -0
- package/es/Radio/style/index.less +348 -0
- package/es/Select/index.js +1 -1
- package/es/Select/rc-select/OptionList.js +4 -4
- package/es/Select/rc-select/Selector/MultipleSelector.js +11 -1
- package/es/Select/rc-select/hooks/useOptions.d.ts +1 -1
- package/es/Select/style/index.less +70 -45
- package/es/Select/style/variables.less +45 -45
- package/es/Select/utils/iconUtil.d.ts +2 -2
- package/es/Select/utils/iconUtil.js +9 -5
- package/es/Steps/components/ProcessIcon/index.d.ts +6 -0
- package/es/Steps/components/ProcessIcon/index.js +8 -0
- package/es/Steps/components/Step/index.d.ts +20 -0
- package/es/Steps/components/Step/index.js +45 -0
- package/es/Steps/index.d.ts +36 -2
- package/es/Steps/index.js +30 -1
- package/es/Steps/matchMedia.mock.d.ts +1 -0
- package/es/Steps/matchMedia.mock.js +17 -0
- package/es/Steps/style/index.less +251 -0
- package/es/Switch/index.d.ts +46 -2
- package/es/Switch/index.js +71 -1
- package/es/Switch/style/index.less +129 -0
- package/es/Table/Table.d.ts +2 -1
- package/es/Table/Table.js +223 -330
- package/es/Table/components/Empty/index.d.ts +3 -0
- package/es/Table/components/Empty/index.js +17 -0
- package/es/Table/components/Loading/index.d.ts +3 -0
- package/es/Table/components/Loading/index.js +19 -0
- package/es/Table/components/TableBodyRowList/index.d.ts +13 -0
- package/es/Table/components/TableBodyRowList/index.js +89 -0
- package/es/Table/components/TableHead/index.d.ts +23 -0
- package/es/Table/components/TableHead/index.js +262 -0
- package/es/Table/constant.d.ts +1 -0
- package/es/Table/constant.js +1 -0
- package/es/Table/hooks/useFrame.d.ts +7 -0
- package/es/Table/hooks/useFrame.js +90 -0
- package/es/Table/hooks/useTableColumn.d.ts +28 -0
- package/es/Table/hooks/useTableColumn.js +53 -0
- package/es/Table/interface.d.ts +3 -2
- package/es/Table/style/index.less +33 -30
- package/es/Table/utils.d.ts +15 -0
- package/es/Table/utils.js +131 -0
- package/es/Tabs/index.js +7 -9
- package/es/Tabs/style/index.less +57 -25
- package/es/_utils/hooks/useId.d.ts +4 -0
- package/es/_utils/hooks/useId.js +23 -0
- package/es/index.d.ts +9 -5
- package/es/index.js +3 -1
- package/es/locale/default.d.ts +2 -0
- package/es/locale/default.js +2 -0
- package/es/locale/en_US.d.ts +3 -0
- package/es/locale/en_US.js +132 -0
- package/es/locale/zh_CN.d.ts +3 -2
- package/es/locale/zh_CN.js +131 -2
- package/es/locale-provider/LocaleReceiver.d.ts +4 -0
- package/es/locale-provider/LocaleReceiver.js +3 -0
- package/es/locale-provider/context.d.ts +7 -0
- package/es/locale-provider/context.js +3 -0
- package/es/locale-provider/default.d.ts +2 -0
- package/es/locale-provider/default.js +2 -0
- package/es/locale-provider/en_US.d.ts +2 -0
- package/es/locale-provider/en_US.js +2 -0
- package/es/locale-provider/index.d.ts +65 -0
- package/es/locale-provider/index.js +102 -0
- package/es/locale-provider/style/index.d.ts +1 -0
- package/es/locale-provider/style/index.js +1 -0
- package/es/locale-provider/style/index.less +2 -0
- package/es/locale-provider/zh_CN.d.ts +2 -0
- package/es/locale-provider/zh_CN.js +2 -0
- package/es/style/index.d.ts +0 -1
- package/es/style/index.js +0 -1
- package/es/style/index.less +2 -2
- package/es/style/themes/default/index.less +30 -30
- package/lib/Breadcrumb/index.d.ts +1 -0
- package/lib/Button/index.js +5 -3
- package/lib/Button/style/index.less +135 -126
- package/lib/Button/style/variables.less +53 -53
- package/lib/Card/index.d.ts +3 -0
- package/lib/Card/index.js +15 -0
- package/lib/Card/style/index.d.ts +2 -0
- package/lib/Card/style/index.js +5 -0
- package/lib/Card/style/index.less +1 -0
- package/lib/Checkbox/index.d.ts +1 -0
- package/lib/ConfigProvider/defaultRenderEmpty.d.ts +4 -0
- package/lib/ConfigProvider/defaultRenderEmpty.js +55 -0
- package/lib/ConfigProvider/sizeContext.d.ts +9 -0
- package/lib/ConfigProvider/sizeContext.js +30 -0
- package/lib/Dropdown/Button.js +8 -6
- package/lib/Empty/image/Authority.d.ts +1 -0
- package/lib/Empty/image/Dataspace.d.ts +1 -0
- package/lib/Empty/image/Search.d.ts +1 -0
- package/lib/Empty/image/Simple.d.ts +1 -0
- package/lib/Empty/image/Worksheet.d.ts +1 -0
- package/lib/Empty/image/empty.d.ts +1 -0
- package/lib/Icon/icons/CheckLine.d.ts +13 -0
- package/lib/Icon/icons/CheckLine.js +90 -0
- package/lib/Icon/icons.json +410 -0
- package/lib/Input/components/Group/index.d.ts +3 -1
- package/lib/Input/components/Group/index.js +7 -12
- package/lib/Input/components/Input/index.d.ts +3 -2
- package/lib/Input/components/Input/index.js +13 -23
- package/lib/Input/components/Password/index.js +13 -17
- package/lib/Input/components/TextArea/index.d.ts +8 -1
- package/lib/Input/components/TextArea/index.js +10 -1
- package/lib/Input/style/index.less +180 -102
- package/lib/InputNumber/index.d.ts +1 -0
- package/lib/InputNumber/style/index.less +69 -69
- package/lib/Menu/Divider.d.ts +1 -0
- package/lib/Modal/index.js +25 -18
- package/lib/Modal/locale.d.ts +7 -0
- package/lib/Modal/locale.js +31 -0
- package/lib/Modal/style/index.less +48 -45
- package/lib/Navigator/components/Header/index.d.ts +1 -0
- package/lib/Navigator/components/Menu/index.d.ts +1 -0
- package/lib/Navigator/components/MenuItem/index.d.ts +1 -1
- package/lib/Navigator/index.d.ts +1 -1
- package/lib/PageHeader/index.d.ts +3 -0
- package/lib/PageHeader/index.js +15 -0
- package/lib/PageHeader/style/index.d.ts +2 -0
- package/lib/PageHeader/style/index.js +5 -0
- package/lib/PageHeader/style/index.less +1 -0
- package/lib/Popover/index.d.ts +1 -0
- package/lib/Radio/components/Group/index.d.ts +6 -0
- package/lib/Radio/components/Group/index.js +93 -0
- package/lib/Radio/components/Radio/index.d.ts +3 -0
- package/lib/Radio/components/Radio/index.js +115 -0
- package/lib/Radio/index.d.ts +9 -2
- package/lib/Radio/index.js +5 -3
- package/lib/Radio/interface/radio.d.ts +24 -0
- package/lib/Radio/interface/radio.js +5 -0
- package/lib/Radio/interface/radioGroup.d.ts +42 -0
- package/lib/Radio/interface/radioGroup.js +5 -0
- package/lib/Radio/style/index.less +348 -0
- package/lib/Select/index.js +1 -1
- package/lib/Select/rc-select/OptionList.js +8 -7
- package/lib/Select/rc-select/Selector/MultipleSelector.js +11 -1
- package/lib/Select/rc-select/hooks/useOptions.d.ts +1 -1
- package/lib/Select/style/index.less +70 -45
- package/lib/Select/style/variables.less +45 -45
- package/lib/Select/utils/iconUtil.d.ts +2 -2
- package/lib/Select/utils/iconUtil.js +13 -7
- package/lib/Steps/components/ProcessIcon/index.d.ts +6 -0
- package/lib/Steps/components/ProcessIcon/index.js +19 -0
- package/lib/Steps/components/Step/index.d.ts +20 -0
- package/lib/Steps/components/Step/index.js +61 -0
- package/lib/Steps/index.d.ts +36 -2
- package/lib/Steps/index.js +34 -1
- package/lib/Steps/matchMedia.mock.d.ts +1 -0
- package/lib/Steps/matchMedia.mock.js +17 -0
- package/lib/Steps/style/index.less +251 -0
- package/lib/Switch/index.d.ts +46 -2
- package/lib/Switch/index.js +78 -1
- package/lib/Switch/style/index.less +129 -0
- package/lib/Table/Table.d.ts +2 -1
- package/lib/Table/Table.js +228 -332
- package/lib/Table/components/Empty/index.d.ts +3 -0
- package/lib/Table/components/Empty/index.js +30 -0
- package/lib/Table/components/Loading/index.d.ts +3 -0
- package/lib/Table/components/Loading/index.js +33 -0
- package/lib/Table/components/TableBodyRowList/index.d.ts +13 -0
- package/lib/Table/components/TableBodyRowList/index.js +108 -0
- package/lib/Table/components/TableHead/index.d.ts +23 -0
- package/lib/Table/components/TableHead/index.js +286 -0
- package/lib/Table/constant.d.ts +1 -0
- package/lib/Table/constant.js +1 -0
- package/lib/Table/hooks/useFrame.d.ts +7 -0
- package/lib/Table/hooks/useFrame.js +98 -0
- package/lib/Table/hooks/useTableColumn.d.ts +28 -0
- package/lib/Table/hooks/useTableColumn.js +66 -0
- package/lib/Table/interface.d.ts +3 -2
- package/lib/Table/style/index.less +33 -30
- package/lib/Table/utils.d.ts +15 -0
- package/lib/Table/utils.js +147 -0
- package/lib/Tabs/index.js +9 -11
- package/lib/Tabs/style/index.less +57 -25
- package/lib/_utils/hooks/useId.d.ts +4 -0
- package/lib/_utils/hooks/useId.js +36 -0
- package/lib/index.d.ts +9 -5
- package/lib/index.js +16 -0
- package/lib/locale/default.d.ts +2 -0
- package/lib/locale/default.js +13 -0
- package/lib/locale/en_US.d.ts +3 -0
- package/lib/locale/en_US.js +146 -0
- package/lib/locale/zh_CN.d.ts +3 -2
- package/lib/locale/zh_CN.js +134 -2
- package/lib/locale-provider/LocaleReceiver.d.ts +4 -0
- package/lib/locale-provider/LocaleReceiver.js +23 -0
- package/lib/locale-provider/context.d.ts +7 -0
- package/lib/locale-provider/context.js +12 -0
- package/lib/locale-provider/default.d.ts +2 -0
- package/lib/locale-provider/default.js +13 -0
- package/lib/locale-provider/en_US.d.ts +2 -0
- package/lib/locale-provider/en_US.js +13 -0
- package/lib/locale-provider/index.d.ts +65 -0
- package/lib/locale-provider/index.js +116 -0
- package/lib/locale-provider/style/index.d.ts +1 -0
- package/lib/locale-provider/style/index.js +3 -0
- package/lib/locale-provider/style/index.less +2 -0
- package/lib/locale-provider/zh_CN.d.ts +2 -0
- package/lib/locale-provider/zh_CN.js +13 -0
- package/lib/style/index.d.ts +0 -1
- package/lib/style/index.js +0 -2
- package/lib/style/index.less +2 -2
- package/lib/style/themes/default/index.less +30 -30
- package/package.json +11 -8
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
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
|
+
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
import { RadioGroupContext } from '../Group';
|
|
11
|
+
import { getUUID } from '../../../_utils/hooks/useId';
|
|
12
|
+
export default function Radio(props) {
|
|
13
|
+
var _props$value;
|
|
14
|
+
|
|
15
|
+
var groupContext = useContext(RadioGroupContext);
|
|
16
|
+
var labelRef = useRef(null);
|
|
17
|
+
var id = getUUID().toString();
|
|
18
|
+
|
|
19
|
+
var radioProps = _objectSpread({}, props);
|
|
20
|
+
|
|
21
|
+
if (!_.isEmpty(groupContext)) {
|
|
22
|
+
radioProps.disabled = props.disabled;
|
|
23
|
+
radioProps.checked = !props.disabled && groupContext.value === props.value;
|
|
24
|
+
} else {
|
|
25
|
+
radioProps.checked = !('checked' in props) ? props.defaultChecked : radioProps.checked;
|
|
26
|
+
} // 设置input外层盒子的class
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
var aldRadioClass = classNames('ald-radio', {
|
|
30
|
+
'ald-radio-checked': radioProps.checked,
|
|
31
|
+
'ald-radio-disabled': radioProps.disabled
|
|
32
|
+
}); // 根据属性设置最外层的class
|
|
33
|
+
|
|
34
|
+
var getWrapperClass = function getWrapperClass() {
|
|
35
|
+
var otherClass = '';
|
|
36
|
+
|
|
37
|
+
if (groupContext.type === 'button') {
|
|
38
|
+
if (groupContext.radioGroupStyle === 'filled') {
|
|
39
|
+
otherClass = 'ald-radio-button-wrapper-filled';
|
|
40
|
+
} else {
|
|
41
|
+
otherClass = 'ald-radio-button-wrapper-border';
|
|
42
|
+
}
|
|
43
|
+
} else if (groupContext.type === 'iconButton') {
|
|
44
|
+
if (groupContext.radioGroupStyle === 'filled') {
|
|
45
|
+
otherClass = 'ald-radio-icon-button-wrapper-filled';
|
|
46
|
+
} else {
|
|
47
|
+
otherClass = 'ald-radio-icon-button-wrapper-border';
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
// 当type未设置或者是radio时
|
|
51
|
+
otherClass = 'ald-radio-wrapper';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return classNames('ald-radio-label', otherClass, {
|
|
55
|
+
'ald-radio-wrapper-checked': radioProps.checked,
|
|
56
|
+
'ald-radio-wrapper-disabled': radioProps.disabled
|
|
57
|
+
});
|
|
58
|
+
}; // filled button模式下,更改滑块的位置
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
useEffect(function () {
|
|
62
|
+
var _groupContext$sliderR;
|
|
63
|
+
|
|
64
|
+
if (radioProps.checked && (groupContext === null || groupContext === void 0 ? void 0 : (_groupContext$sliderR = groupContext.sliderRef) === null || _groupContext$sliderR === void 0 ? void 0 : _groupContext$sliderR.current) && (labelRef === null || labelRef === void 0 ? void 0 : labelRef.current)) {
|
|
65
|
+
groupContext.sliderRef.current.style.left = "".concat(labelRef.current.offsetLeft, "px");
|
|
66
|
+
groupContext.sliderRef.current.style.width = "".concat(labelRef.current.offsetWidth, "px");
|
|
67
|
+
}
|
|
68
|
+
}, [groupContext.sliderRef, radioProps.checked]);
|
|
69
|
+
|
|
70
|
+
var onChange = function onChange(e) {
|
|
71
|
+
if (groupContext === null || groupContext === void 0 ? void 0 : groupContext.onChange) {
|
|
72
|
+
groupContext.onChange(e);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return /*#__PURE__*/React.createElement("label", {
|
|
77
|
+
className: getWrapperClass(),
|
|
78
|
+
htmlFor: id,
|
|
79
|
+
ref: labelRef
|
|
80
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
81
|
+
className: aldRadioClass
|
|
82
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
83
|
+
id: id,
|
|
84
|
+
type: "radio",
|
|
85
|
+
className: "ald-radio-input",
|
|
86
|
+
checked: radioProps.checked,
|
|
87
|
+
disabled: radioProps.disabled,
|
|
88
|
+
value: (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.toString(),
|
|
89
|
+
onChange: onChange
|
|
90
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
91
|
+
className: "ald-radio-inner"
|
|
92
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
93
|
+
className: "ald-radio-desc"
|
|
94
|
+
}, props.children));
|
|
95
|
+
}
|
package/es/Radio/index.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import RadioGroup from './components/Group';
|
|
3
|
+
import { IRadioProps } from './interface/radio';
|
|
4
|
+
export type { IRadioProps as RadioProps } from './interface/radio';
|
|
5
|
+
export type { IRadioGroupProps as RadioGroupProps } from './interface/radioGroup';
|
|
6
|
+
interface IRadioType extends React.FC<IRadioProps> {
|
|
7
|
+
Group: typeof RadioGroup;
|
|
8
|
+
}
|
|
9
|
+
declare const Radio: IRadioType;
|
|
3
10
|
export default Radio;
|
package/es/Radio/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import InternalRadio from './components/Radio';
|
|
2
|
+
import RadioGroup from './components/Group';
|
|
3
|
+
var Radio = InternalRadio;
|
|
4
|
+
Radio.Group = RadioGroup;
|
|
5
|
+
export default Radio;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface IRadioProps {
|
|
3
|
+
/**
|
|
4
|
+
* @description 当前元素是否选中
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @description 当前元素是否默认选中
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
defaultChecked?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @description 当前元素是否禁用
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @description 当前元素的value值,与Group中的value匹配
|
|
20
|
+
* @default -
|
|
21
|
+
*/
|
|
22
|
+
value?: string | number | boolean;
|
|
23
|
+
children?: ReactNode[] | ReactNode;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type TRadioGroupStyle = 'border' | 'filled';
|
|
3
|
+
export declare type TRadioSize = 'large' | 'middle' | 'small' | 'default';
|
|
4
|
+
export declare type TRadioType = 'radio' | 'button' | 'iconButton';
|
|
5
|
+
export interface IRadioGroupProps {
|
|
6
|
+
/**
|
|
7
|
+
* @description 按钮组的样式 'border' | 'filled'
|
|
8
|
+
* @default 'border'
|
|
9
|
+
*/
|
|
10
|
+
radioGroupStyle?: TRadioGroupStyle;
|
|
11
|
+
/**
|
|
12
|
+
* @description 按钮组的默认选项,按钮组为非受控组件请勿使用value设置默认值
|
|
13
|
+
* @default -
|
|
14
|
+
*/
|
|
15
|
+
defaultValue?: string | number | boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @description 设置按钮组的大小,有'large' | 'middle'('default') | 'small
|
|
18
|
+
* @default 'middle'
|
|
19
|
+
*/
|
|
20
|
+
size?: TRadioSize;
|
|
21
|
+
/**
|
|
22
|
+
* @description 当按钮组为受控组件时,设置按钮组的当前选中的值
|
|
23
|
+
* @default -
|
|
24
|
+
*/
|
|
25
|
+
value?: string | number | boolean;
|
|
26
|
+
/**
|
|
27
|
+
* @description 当按钮组选中值变化时的回调函数
|
|
28
|
+
* @default -
|
|
29
|
+
*/
|
|
30
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
31
|
+
/**
|
|
32
|
+
* @description 设置按钮组的类型 'radio' | 'button' | 'iconButton'
|
|
33
|
+
* @default 'radio'
|
|
34
|
+
*/
|
|
35
|
+
type?: TRadioType;
|
|
36
|
+
/**
|
|
37
|
+
* @description 按钮组最外层盒子的类名
|
|
38
|
+
* @default -
|
|
39
|
+
*/
|
|
40
|
+
className?: string;
|
|
41
|
+
children?: ReactNode[] | ReactNode;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1,349 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
|
+
|
|
3
|
+
@radio-icon-button-padding-large: 10px;
|
|
4
|
+
@radio-icon-button-padding-middle: 9px;
|
|
5
|
+
@radio-icon-button-padding-small: 8px;
|
|
6
|
+
@radio-group-height-large: 36px;
|
|
7
|
+
@radio-group-height-middle: 32px;
|
|
8
|
+
@radio-group-height-small: 28px;
|
|
9
|
+
@radio-button-padding: 12px;
|
|
10
|
+
|
|
11
|
+
// Radio组件基础样式
|
|
12
|
+
.ald-radio-wrapper {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
gap: 8px;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: start;
|
|
17
|
+
height: 20px;
|
|
18
|
+
padding: 0;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ald-radio {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
width: 20px;
|
|
28
|
+
height: 20px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ald-radio-input {
|
|
32
|
+
position: absolute;
|
|
33
|
+
z-index: 1;
|
|
34
|
+
width: 1px;
|
|
35
|
+
height: 1px;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
opacity: 0;
|
|
38
|
+
inset: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ald-radio-inner {
|
|
42
|
+
position: relative;
|
|
43
|
+
display: inline-block;
|
|
44
|
+
width: 17px;
|
|
45
|
+
height: 17px;
|
|
46
|
+
border: 1px solid @NL90;
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ald-radio-desc {
|
|
51
|
+
z-index: 2;
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
color: @NL0;
|
|
56
|
+
font-weight: 400;
|
|
57
|
+
}
|
|
58
|
+
// 绘制选中时的圆圈样式
|
|
59
|
+
.ald-radio-checked > .ald-radio-inner {
|
|
60
|
+
background-color: @B60;
|
|
61
|
+
border: 0;
|
|
62
|
+
transform: background 0.5s ease;
|
|
63
|
+
|
|
64
|
+
&::after {
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 50%;
|
|
67
|
+
left: 50%;
|
|
68
|
+
width: 6px;
|
|
69
|
+
height: 6px;
|
|
70
|
+
background-color: @ND0;
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
transform: translate(-50%, -50%);
|
|
73
|
+
content: '';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// 禁用状态下的样式
|
|
77
|
+
.ald-radio-disabled > .ald-radio-inner {
|
|
78
|
+
background-color: @NL90;
|
|
79
|
+
border: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ald-radio-disabled.ald-radio-checked > .ald-radio-inner::after {
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: 50%;
|
|
85
|
+
left: 50%;
|
|
86
|
+
width: 6px;
|
|
87
|
+
height: 6px;
|
|
88
|
+
background: @NL90;
|
|
89
|
+
border-radius: 50%;
|
|
90
|
+
transform: translate(-50%, -50%);
|
|
91
|
+
content: '';
|
|
92
|
+
}
|
|
93
|
+
// 禁用的样式
|
|
94
|
+
.ald-radio-label.ald-radio-wrapper-disabled {
|
|
95
|
+
cursor: default;
|
|
96
|
+
|
|
97
|
+
.ald-radio-desc {
|
|
98
|
+
color: @NL60;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// RadioGroup基础样式
|
|
102
|
+
.ald-radio-group {
|
|
103
|
+
position: relative;
|
|
104
|
+
|
|
105
|
+
.ald-radio-label .ald-radio-desc {
|
|
106
|
+
color: @NL30;
|
|
107
|
+
font-weight: 500;
|
|
108
|
+
font-size: @font-size-middle;
|
|
109
|
+
font-style: normal;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&.ald-radio-group-radio {
|
|
113
|
+
.ald-radio-desc {
|
|
114
|
+
color: @NL0;
|
|
115
|
+
font-weight: 400;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.ald-radio-wrapper:not(:first-child) {
|
|
120
|
+
margin-left: 16px;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// filled填充样式下的滑块样式
|
|
125
|
+
.ald-radio-filled-slider {
|
|
126
|
+
position: absolute;
|
|
127
|
+
top: 0;
|
|
128
|
+
left: 0;
|
|
129
|
+
z-index: 1;
|
|
130
|
+
width: 0;
|
|
131
|
+
height: 100%;
|
|
132
|
+
background: @BG100;
|
|
133
|
+
border: 1px solid @NL90;
|
|
134
|
+
border-radius: @border-radius-middle;
|
|
135
|
+
transition: width, left, height 0.3s, 0.3s, 0.3s ease;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// button状态下的样式
|
|
139
|
+
.ald-radio-group-button,
|
|
140
|
+
.ald-radio-group-icon-button {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: flex-start;
|
|
143
|
+
box-sizing: border-box;
|
|
144
|
+
width: min-content;
|
|
145
|
+
width: auto;
|
|
146
|
+
padding: 0;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
|
|
149
|
+
.ald-radio-label {
|
|
150
|
+
color: @NL30;
|
|
151
|
+
font-size: @font-size-middle;
|
|
152
|
+
}
|
|
153
|
+
// 按钮样式禁用的文字颜色
|
|
154
|
+
.ald-radio-wrapper-disabled {
|
|
155
|
+
.ald-radio-desc {
|
|
156
|
+
color: @NL80;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// border的样式
|
|
160
|
+
.ald-radio-button-wrapper-border {
|
|
161
|
+
padding: 0 @radio-button-padding - 1;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.ald-radio-button-wrapper-border,
|
|
165
|
+
.ald-radio-icon-button-wrapper-border {
|
|
166
|
+
position: relative;
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
height: 100%;
|
|
171
|
+
background: @BG100;
|
|
172
|
+
border: 1px solid @NL90;
|
|
173
|
+
border-right: 1px solid transparent;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
|
|
176
|
+
&:first-child {
|
|
177
|
+
border-radius: 6px 0 0 6px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&:last-child {
|
|
181
|
+
border-right: 1px solid @NL90;
|
|
182
|
+
border-radius: 0 6px 6px 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.ald-radio {
|
|
186
|
+
width: 0;
|
|
187
|
+
|
|
188
|
+
.ald-radio-input,
|
|
189
|
+
.ald-radio-inner {
|
|
190
|
+
width: 0;
|
|
191
|
+
border: 0;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.ald-radio-checked > .ald-radio-inner::after {
|
|
196
|
+
width: 0;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// button选中状态下的样式
|
|
201
|
+
.ald-radio-wrapper-checked.ald-radio-button-wrapper-border,
|
|
202
|
+
.ald-radio-wrapper-checked.ald-radio-icon-button-wrapper-border {
|
|
203
|
+
background: @B98;
|
|
204
|
+
transition: background 0.5s ease;
|
|
205
|
+
|
|
206
|
+
.ald-radio-desc {
|
|
207
|
+
position: relative;
|
|
208
|
+
color: @NL0;
|
|
209
|
+
transition: text-shadow 0.5s ease;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// filled样式的button
|
|
214
|
+
.ald-radio-button-wrapper-filled {
|
|
215
|
+
padding: 0 @radio-button-padding;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.ald-radio-button-wrapper-filled,
|
|
219
|
+
.ald-radio-icon-button-wrapper-filled {
|
|
220
|
+
position: relative;
|
|
221
|
+
display: flex;
|
|
222
|
+
align-items: center;
|
|
223
|
+
justify-content: center;
|
|
224
|
+
height: 100%;
|
|
225
|
+
background-color: @BG90;
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
|
|
228
|
+
&:first-of-type {
|
|
229
|
+
border-radius: @border-radius-middle 0 0 @border-radius-middle;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&:last-of-type {
|
|
233
|
+
border-radius: 0 @border-radius-middle @border-radius-middle 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.ald-radio {
|
|
237
|
+
width: 0;
|
|
238
|
+
|
|
239
|
+
.ald-radio-input,
|
|
240
|
+
.ald-radio-inner {
|
|
241
|
+
width: 0;
|
|
242
|
+
border: 0;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.ald-radio-checked > .ald-radio-inner::after {
|
|
247
|
+
width: 0;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.ald-radio-wrapper-checked.ald-radio-button-wrapper-filled,
|
|
252
|
+
.ald-radio-wrapper-checked.ald-radio-icon-button-wrapper-filled {
|
|
253
|
+
position: relative;
|
|
254
|
+
|
|
255
|
+
.ald-radio-desc {
|
|
256
|
+
position: relative;
|
|
257
|
+
z-index: 2;
|
|
258
|
+
color: @NL0;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// 各种大小
|
|
262
|
+
&.ald-radio-group-middle {
|
|
263
|
+
height: @radio-group-height-middle;
|
|
264
|
+
|
|
265
|
+
.ald-radio-icon-button-wrapper-filled {
|
|
266
|
+
padding: 0 @radio-icon-button-padding-middle;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.ald-radio-icon-button-wrapper-border {
|
|
270
|
+
padding: 0 @radio-icon-button-padding-middle - 1;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.ald-radio-label {
|
|
274
|
+
.ald-radio-desc {
|
|
275
|
+
font-size: @font-size-middle;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
&.ald-radio-group-small {
|
|
281
|
+
height: @radio-group-height-small;
|
|
282
|
+
|
|
283
|
+
.ald-radio-icon-button-wrapper-filled {
|
|
284
|
+
padding: 0 @radio-icon-button-padding-small;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.ald-radio-icon-button-wrapper-border {
|
|
288
|
+
padding: 0 @radio-icon-button-padding-small - 1;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.ald-radio-label {
|
|
292
|
+
.ald-radio-desc {
|
|
293
|
+
font-size: @font-size-small;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.ald-radio-button-wrapper-border,
|
|
298
|
+
.ald-radio-icon-button-wrapper-border,
|
|
299
|
+
.ald-radio-button-wrapper-filled,
|
|
300
|
+
.ald-radio-icon-button-wrapper-filled {
|
|
301
|
+
&:first-of-type {
|
|
302
|
+
border-radius: @border-radius-small 0 0 @border-radius-small;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
&:last-of-type {
|
|
306
|
+
border-radius: 0 @border-radius-small 0 @border-radius-small 0;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.ald-radio-filled-slider {
|
|
311
|
+
border-radius: @border-radius-small;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
&.ald-radio-group.ald-radio-group-large {
|
|
316
|
+
height: @radio-group-height-large;
|
|
317
|
+
|
|
318
|
+
.ald-radio-icon-button-wrapper-filled {
|
|
319
|
+
padding: 0 @radio-icon-button-padding-large;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.ald-radio-icon-button-wrapper-border {
|
|
323
|
+
padding: 0 @radio-icon-button-padding-large - 1;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.ald-radio-label {
|
|
327
|
+
.ald-radio-desc {
|
|
328
|
+
font-size: @font-size-large;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.ald-radio-button-wrapper-border,
|
|
333
|
+
.ald-radio-icon-button-wrapper-border,
|
|
334
|
+
.ald-radio-button-wrapper-filled,
|
|
335
|
+
.ald-radio-icon-button-wrapper-filled {
|
|
336
|
+
&:first-of-type {
|
|
337
|
+
border-radius: @border-radius-large 0 0 @border-radius-large;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
&:last-of-type {
|
|
341
|
+
border-radius: 0 @border-radius-large @border-radius-large 0;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.ald-radio-filled-slider {
|
|
346
|
+
border-radius: @border-radius-large;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
package/es/Select/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import DisabledContext from 'antd/lib/config-provider/DisabledContext';
|
|
|
23
23
|
import { FormItemInputContext } from 'antd/lib/form/context';
|
|
24
24
|
import { getTransitionDirection, getTransitionName } from 'antd/lib/_util/motion';
|
|
25
25
|
import { getMergedStatus, getStatusClassNames } from 'antd/lib/_util/statusUtils';
|
|
26
|
-
import defaultRenderEmpty from '
|
|
26
|
+
import defaultRenderEmpty from '../ConfigProvider/defaultRenderEmpty';
|
|
27
27
|
import getIcons from './utils/iconUtil';
|
|
28
28
|
var SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
|
|
29
29
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "@aloudata/icons-react/styles/index.less";
|
|
2
|
+
import _CheckLine from "@aloudata/icons-react/es/icons/CheckLine";
|
|
1
3
|
var _excluded = ["disabled", "title", "children", "style", "className"];
|
|
2
4
|
|
|
3
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -39,7 +41,6 @@ import { isPlatformMac } from './utils/platformUtil';
|
|
|
39
41
|
import useBaseProps from './hooks/useBaseProps';
|
|
40
42
|
import SelectContext from './SelectContext';
|
|
41
43
|
import Checkbox from '../../Checkbox';
|
|
42
|
-
import Icon from '../../Icon';
|
|
43
44
|
import colors from '../../style/themes/default/themeColor.module.less';
|
|
44
45
|
|
|
45
46
|
function isTitleType(content) {
|
|
@@ -382,10 +383,9 @@ var OptionList = function OptionList(_, ref) {
|
|
|
382
383
|
style: style
|
|
383
384
|
}), !multiple && /*#__PURE__*/React.createElement("div", {
|
|
384
385
|
className: 'ald-select-single-check'
|
|
385
|
-
}, selected && /*#__PURE__*/React.createElement(
|
|
386
|
+
}, selected && /*#__PURE__*/React.createElement(_CheckLine, {
|
|
386
387
|
color: colors.B60,
|
|
387
|
-
size: '1em'
|
|
388
|
-
type: "check"
|
|
388
|
+
size: '1em'
|
|
389
389
|
})), multiple && /*#__PURE__*/React.createElement(Checkbox, {
|
|
390
390
|
className: 'ald-select-multiple-checkbox',
|
|
391
391
|
checked: selected,
|
|
@@ -48,7 +48,8 @@ var SelectSelector = function SelectSelector(props) {
|
|
|
48
48
|
removeIcon = props.removeIcon,
|
|
49
49
|
_props$maxTagCount = props.maxTagCount,
|
|
50
50
|
maxTagCount = _props$maxTagCount === void 0 ? "responsive" : _props$maxTagCount,
|
|
51
|
-
|
|
51
|
+
_props$maxTagTextLeng = props.maxTagTextLength,
|
|
52
|
+
maxTagTextLength = _props$maxTagTextLeng === void 0 ? 10 : _props$maxTagTextLeng,
|
|
52
53
|
_props$maxTagPlacehol = props.maxTagPlaceholder,
|
|
53
54
|
maxTagPlaceholder = _props$maxTagPlacehol === void 0 ? function (omittedValues) {
|
|
54
55
|
return "\u7B49".concat(omittedValues.length, "\u9879");
|
|
@@ -160,6 +161,15 @@ var SelectSelector = function SelectSelector(props) {
|
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
function renderRest(omittedValues) {
|
|
164
|
+
if (omittedValues.length === values.length && omittedValues.length) {
|
|
165
|
+
var length = values.length;
|
|
166
|
+
|
|
167
|
+
var _content = "\u5DF2\u9009".concat(length, "\u9879");
|
|
168
|
+
|
|
169
|
+
return defaultRenderSelector(_content, _content, false);
|
|
170
|
+
;
|
|
171
|
+
}
|
|
172
|
+
|
|
163
173
|
var content = typeof maxTagPlaceholder === 'function' ? maxTagPlaceholder(omittedValues) : maxTagPlaceholder;
|
|
164
174
|
return defaultRenderSelector(content, content, false);
|
|
165
175
|
} // >>> Input Node
|
|
@@ -6,6 +6,6 @@ import type { FieldNames } from '../Select';
|
|
|
6
6
|
*/
|
|
7
7
|
export default function useOptions<OptionType>(options: OptionType[], children: React.ReactNode, fieldNames: FieldNames, optionFilterProp: string, optionLabelProp: string): {
|
|
8
8
|
options: OptionType[];
|
|
9
|
-
valueOptions: Map<
|
|
9
|
+
valueOptions: Map<React.Key, OptionType>;
|
|
10
10
|
labelOptions: Map<React.ReactNode, OptionType>;
|
|
11
11
|
};
|