@aloudata/aloudata-design 0.3.2 → 0.3.3

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.
Files changed (89) hide show
  1. package/es/Button/index.js +3 -2
  2. package/es/Button/style/index.less +135 -126
  3. package/es/Button/style/variables.less +53 -53
  4. package/es/Dropdown/Button.js +3 -2
  5. package/es/Icon/icons.json +410 -0
  6. package/es/Input/components/Group/index.d.ts +2 -1
  7. package/es/Input/components/Group/index.js +6 -12
  8. package/es/Input/components/Input/index.d.ts +3 -2
  9. package/es/Input/components/Input/index.js +11 -22
  10. package/es/Input/components/Password/index.js +11 -16
  11. package/es/Input/style/index.less +102 -102
  12. package/es/InputNumber/style/index.less +69 -69
  13. package/es/Modal/index.js +4 -7
  14. package/es/Modal/style/index.less +45 -45
  15. package/es/PageHeader/index.d.ts +3 -0
  16. package/es/PageHeader/index.js +3 -0
  17. package/es/PageHeader/style/index.d.ts +2 -0
  18. package/es/PageHeader/style/index.js +2 -0
  19. package/es/PageHeader/style/index.less +1 -0
  20. package/es/Select/rc-select/OptionList.js +3 -2
  21. package/es/Select/rc-select/hooks/useOptions.d.ts +1 -1
  22. package/es/Select/style/index.less +49 -49
  23. package/es/Select/style/variables.less +45 -45
  24. package/es/Select/utils/iconUtil.d.ts +2 -2
  25. package/es/Select/utils/iconUtil.js +6 -4
  26. package/es/Steps/components/ProcessIcon/index.d.ts +5 -0
  27. package/es/Steps/components/ProcessIcon/index.js +8 -0
  28. package/es/Steps/components/Step/index.d.ts +20 -0
  29. package/es/Steps/components/Step/index.js +45 -0
  30. package/es/Steps/index.d.ts +36 -2
  31. package/es/Steps/index.js +30 -1
  32. package/es/Steps/matchMedia.mock.d.ts +1 -0
  33. package/es/Steps/matchMedia.mock.js +17 -0
  34. package/es/Steps/style/index.less +251 -0
  35. package/es/Switch/index.d.ts +46 -2
  36. package/es/Switch/index.js +71 -1
  37. package/es/Switch/style/index.less +129 -0
  38. package/es/Table/style/index.less +1 -1
  39. package/es/Tabs/index.js +3 -2
  40. package/es/Tabs/style/index.less +25 -25
  41. package/es/index.d.ts +6 -4
  42. package/es/index.js +2 -1
  43. package/es/style/index.less +1 -1
  44. package/es/style/themes/default/index.less +30 -30
  45. package/lib/Button/index.js +5 -3
  46. package/lib/Button/style/index.less +135 -126
  47. package/lib/Button/style/variables.less +53 -53
  48. package/lib/Dropdown/Button.js +7 -5
  49. package/lib/Icon/icons.json +410 -0
  50. package/lib/Input/components/Group/index.d.ts +2 -1
  51. package/lib/Input/components/Group/index.js +7 -12
  52. package/lib/Input/components/Input/index.d.ts +3 -2
  53. package/lib/Input/components/Input/index.js +13 -22
  54. package/lib/Input/components/Password/index.js +13 -17
  55. package/lib/Input/style/index.less +102 -102
  56. package/lib/InputNumber/style/index.less +69 -69
  57. package/lib/Modal/index.js +8 -10
  58. package/lib/Modal/style/index.less +45 -45
  59. package/lib/PageHeader/index.d.ts +3 -0
  60. package/lib/PageHeader/index.js +15 -0
  61. package/lib/PageHeader/style/index.d.ts +2 -0
  62. package/lib/PageHeader/style/index.js +5 -0
  63. package/lib/PageHeader/style/index.less +1 -0
  64. package/lib/Select/rc-select/OptionList.js +7 -5
  65. package/lib/Select/rc-select/hooks/useOptions.d.ts +1 -1
  66. package/lib/Select/style/index.less +49 -49
  67. package/lib/Select/style/variables.less +45 -45
  68. package/lib/Select/utils/iconUtil.d.ts +2 -2
  69. package/lib/Select/utils/iconUtil.js +10 -8
  70. package/lib/Steps/components/ProcessIcon/index.d.ts +5 -0
  71. package/lib/Steps/components/ProcessIcon/index.js +19 -0
  72. package/lib/Steps/components/Step/index.d.ts +20 -0
  73. package/lib/Steps/components/Step/index.js +61 -0
  74. package/lib/Steps/index.d.ts +36 -2
  75. package/lib/Steps/index.js +34 -1
  76. package/lib/Steps/matchMedia.mock.d.ts +1 -0
  77. package/lib/Steps/matchMedia.mock.js +17 -0
  78. package/lib/Steps/style/index.less +251 -0
  79. package/lib/Switch/index.d.ts +46 -2
  80. package/lib/Switch/index.js +78 -1
  81. package/lib/Switch/style/index.less +129 -0
  82. package/lib/Table/style/index.less +1 -1
  83. package/lib/Tabs/index.js +5 -3
  84. package/lib/Tabs/style/index.less +25 -25
  85. package/lib/index.d.ts +6 -4
  86. package/lib/index.js +8 -0
  87. package/lib/style/index.less +1 -1
  88. package/lib/style/themes/default/index.less +30 -30
  89. package/package.json +2 -1
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from 'react';
2
+ export declare type TStatus = 'wait' | 'process' | 'finish' | 'error';
3
+ export interface IStepProps {
4
+ /**
5
+ * @description 当前步骤的描述信息
6
+ * @default -
7
+ */
8
+ description?: ReactNode;
9
+ /**
10
+ * @description 当前步骤的状态,可选`wait`、`process`、`finish`、`error`
11
+ * @default wait
12
+ */
13
+ status?: TStatus;
14
+ /**
15
+ * @description 标题
16
+ * @default -
17
+ */
18
+ title?: ReactNode;
19
+ }
20
+ export declare function Step(props: IStepProps): JSX.Element;
@@ -0,0 +1,45 @@
1
+ import "@aloudata/icons-react/styles/index.less";
2
+ import _CheckFill from "@aloudata/icons-react/es/icons/CheckFill";
3
+ import "@aloudata/icons-react/styles/index.less";
4
+ import _ErrorFill from "@aloudata/icons-react/es/icons/ErrorFill";
5
+ import "antd/es/steps/style";
6
+ import _Steps from "antd/es/steps";
7
+ import React from 'react';
8
+ import { ProcessIcon } from '../ProcessIcon';
9
+ var AntdStep = _Steps.Step;
10
+ export function Step(props) {
11
+ var status = props.status;
12
+
13
+ var getIcon = function getIcon(stepStatus) {
14
+ if (stepStatus === 'error') {
15
+ return /*#__PURE__*/React.createElement("span", {
16
+ className: "error-icon-box icon-box"
17
+ }, /*#__PURE__*/React.createElement(_ErrorFill, {
18
+ size: 16
19
+ }));
20
+ }
21
+
22
+ if (stepStatus === 'finish') {
23
+ return /*#__PURE__*/React.createElement("span", {
24
+ className: "check-icon-box icon-box"
25
+ }, /*#__PURE__*/React.createElement(_CheckFill, {
26
+ size: 16
27
+ }));
28
+ }
29
+
30
+ if (stepStatus === 'process') {
31
+ return /*#__PURE__*/React.createElement(ProcessIcon, {
32
+ type: "process"
33
+ });
34
+ } // wait
35
+
36
+
37
+ return /*#__PURE__*/React.createElement(ProcessIcon, {
38
+ type: "wait"
39
+ });
40
+ };
41
+
42
+ return /*#__PURE__*/React.createElement(AntdStep, Object.assign({}, props, {
43
+ icon: getIcon(status)
44
+ }));
45
+ }
@@ -1,3 +1,37 @@
1
- import Steps, { StepsProps, StepProps } from 'antd/es/steps';
2
- export { StepsProps, StepProps };
1
+ import { ReactElement } from 'react';
2
+ import { IStepProps } from './components/Step';
3
+ export type { IStepProps };
4
+ export declare type TStatus = 'wait' | 'process' | 'finish' | 'error';
5
+ export interface IStepsProps {
6
+ /**
7
+ * @description Steps最外层类名
8
+ * @default -
9
+ */
10
+ className?: string;
11
+ /**
12
+ * @description 当前步骤,从0开始计数,可以通过在子Step中的设置status字段覆盖状态
13
+ * @default 0
14
+ */
15
+ current?: number;
16
+ /**
17
+ * @description 指定步骤条方向,水平:`horizontal`和竖直:`vertical`
18
+ * @default horizontal
19
+ */
20
+ direction?: 'horizontal' | 'vertical';
21
+ /**
22
+ * @description 默认开始步骤,从0开始计数
23
+ * @default 0
24
+ */
25
+ defaultCurrent?: number;
26
+ /**
27
+ * @description current属性指向步骤的状态,可选`wait`、`process`、`finish`、‘error
28
+ * @default process
29
+ */
30
+ status?: TStatus;
31
+ children?: ReactElement<IStepProps>[];
32
+ }
33
+ declare function Steps({ className, current, direction, defaultCurrent, status, children, }: IStepsProps): JSX.Element;
34
+ declare namespace Steps {
35
+ var Step: typeof import("./components/Step").Step;
36
+ }
3
37
  export default Steps;
package/es/Steps/index.js CHANGED
@@ -1,2 +1,31 @@
1
- import Steps from 'antd/es/steps';
1
+ import "antd/es/steps/style";
2
+ import _Steps from "antd/es/steps";
3
+ import React from 'react';
4
+ import classNames from 'classnames';
5
+ import { Step } from './components/Step';
6
+ var INITIAL = 0;
7
+
8
+ function Steps(_ref) {
9
+ var className = _ref.className,
10
+ current = _ref.current,
11
+ _ref$direction = _ref.direction,
12
+ direction = _ref$direction === void 0 ? 'horizontal' : _ref$direction,
13
+ _ref$defaultCurrent = _ref.defaultCurrent,
14
+ defaultCurrent = _ref$defaultCurrent === void 0 ? INITIAL : _ref$defaultCurrent,
15
+ status = _ref.status,
16
+ children = _ref.children;
17
+ return /*#__PURE__*/React.createElement(_Steps, {
18
+ className: classNames('ald-steps', className),
19
+ current: current,
20
+ direction: direction,
21
+ initial: defaultCurrent,
22
+ status: status,
23
+ labelPlacement: "vertical",
24
+ responsive: false,
25
+ size: "default",
26
+ type: "default"
27
+ }, children);
28
+ }
29
+
30
+ Steps.Step = Step;
2
31
  export default Steps;
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(window, 'matchMedia', {
4
+ writable: true,
5
+ value: jest.fn().mockImplementation(function (query) {
6
+ return {
7
+ matches: false,
8
+ media: query,
9
+ onchange: null,
10
+ addListener: jest.fn(),
11
+ removeListener: jest.fn(),
12
+ addEventListener: jest.fn(),
13
+ removeEventListener: jest.fn(),
14
+ dispatchEvent: jest.fn()
15
+ };
16
+ })
17
+ });
@@ -1 +1,252 @@
1
1
  @import '../../style/index.less';
2
+
3
+ .ant-steps-item-icon {
4
+ width: 24px;
5
+ height: 24px;
6
+ margin: 6px 8px -2px 0;
7
+ font-size: 12px;
8
+ line-height: 24px;
9
+ text-align: center;
10
+ border-radius: 24px;
11
+ transition: background-color 0.3s, border-color 0.3s;
12
+ }
13
+
14
+ // 水平状态下
15
+ .ant-steps.ald-steps {
16
+ padding: 24px;
17
+
18
+ .ant-steps-item-content {
19
+ display: flex;
20
+ flex-direction: column;
21
+ align-items: center;
22
+ margin: 0 -4px;
23
+ }
24
+
25
+ .ant-steps-item-custom > .ant-steps-item-container > .ant-steps-item-icon > .ant-steps-icon {
26
+ top: 2px;
27
+ left: 0.5px;
28
+ width: 16px;
29
+ height: 16px;
30
+ font-size: 16px;
31
+ line-height: 16px;
32
+ }
33
+
34
+ // 常规step
35
+ .ant-steps-item {
36
+ .ant-steps-item-tail {
37
+ margin-left: 50px;
38
+ padding: 3.5px 7px;
39
+
40
+ &::after {
41
+ height: 2px;
42
+ background-color: @NL90;
43
+ }
44
+ }
45
+
46
+ .ant-steps-item-title {
47
+ height: 20px;
48
+ font-weight: 400;
49
+ font-size: 14px;
50
+ font-style: normal;
51
+ line-height: 20px;
52
+ }
53
+
54
+ .ant-steps-item-description {
55
+ max-width: 264px;
56
+ max-height: 32px;
57
+ margin-top: 3px;
58
+ overflow: hidden;
59
+ color: @NL50;
60
+ font-weight: 400;
61
+ font-size: 12px;
62
+ font-style: normal;
63
+ line-height: 16px;
64
+ word-break: break-all;
65
+ }
66
+ }
67
+ // 已完成的step
68
+ .ant-steps-item-finish {
69
+ .ant-steps-item-tail::after {
70
+ height: 2px;
71
+ background-color: @B60;
72
+ }
73
+
74
+ .ant-steps-item-title {
75
+ color: @NL50;
76
+ }
77
+ }
78
+ // 正在进行中的step
79
+ .ant-steps-item-active {
80
+ .ant-steps-item-title {
81
+ color: @B60;
82
+ font-weight: 500;
83
+ }
84
+ }
85
+ // 等待中step
86
+ .ant-steps-item-wait {
87
+ .ant-steps-item-title {
88
+ color: @NL0;
89
+ }
90
+ }
91
+ // 错误状态下的step
92
+ .ant-steps-item-error {
93
+ .ant-steps-item-title {
94
+ color: @SC60;
95
+ }
96
+ }
97
+ }
98
+ // 竖直状态下
99
+ .ant-steps.ald-steps.ant-steps-vertical {
100
+ height: 100%;
101
+
102
+ .ant-steps-item-container {
103
+ display: flex;
104
+ align-items: center;
105
+
106
+ .ant-steps-item-content {
107
+ display: flex;
108
+ flex-direction: column;
109
+ align-items: flex-start;
110
+ justify-content: center;
111
+ margin-left: 5px;
112
+
113
+ .ant-steps-item-title {
114
+ height: 20px;
115
+ margin-top: 1px;
116
+ font-size: 14px;
117
+ line-height: 20px;
118
+ }
119
+
120
+ .ant-steps-item-description {
121
+ max-width: 264px;
122
+ // height: 16px;
123
+ max-height: 32px;
124
+ margin-top: 4px;
125
+ padding: 0;
126
+ overflow: hidden;
127
+ font-size: 12px;
128
+ line-height: 16px;
129
+ text-overflow: ellipsis;
130
+ word-wrap: break-word;
131
+ -webkit-line-clamp: 2;
132
+ }
133
+ }
134
+
135
+ .ant-steps-item-icon {
136
+ width: 16px;
137
+ height: 16px;
138
+ margin-top: 0;
139
+ margin-right: 0;
140
+
141
+ & .ant-steps-icon {
142
+ top: 0;
143
+ left: 0.5px;
144
+ width: 16px;
145
+ height: 16px;
146
+ font-size: 16px;
147
+ line-height: 16px;
148
+ }
149
+ }
150
+ }
151
+
152
+ // 常规step
153
+ .ant-steps-item {
154
+ &:last-child {
155
+ flex: 0 0 auto;
156
+ }
157
+
158
+ .ant-steps-item-tail {
159
+ position: absolute;
160
+ top: 18px;
161
+ left: 8px;
162
+ width: 2px;
163
+ height: 100%;
164
+ margin: 0;
165
+ padding: 14px 0 0;
166
+
167
+ &::after {
168
+ width: 2px;
169
+ height: 100%;
170
+ background-color: @NL90;
171
+ }
172
+ }
173
+ }
174
+ // 已完成的step
175
+ .ant-steps-item-finish {
176
+ .ant-steps-item-tail::after {
177
+ width: 2px;
178
+ height: 100%;
179
+ background-color: @B60;
180
+ }
181
+
182
+ &.ant-steps-item-title {
183
+ color: @NL50;
184
+ }
185
+ }
186
+ }
187
+
188
+ .ant-steps.ald-steps
189
+ .ant-steps-item:not(.ant-steps-item-active)
190
+ > .ant-steps-item-container[role='button'] {
191
+ cursor: pointer;
192
+
193
+ &:hover {
194
+ .ant-steps-item-title,
195
+ .ant-steps-item-description {
196
+ color: #0f62fe;
197
+ }
198
+ }
199
+ }
200
+ // 自定义Icon的样式
201
+ .icon-box {
202
+ display: flex;
203
+ align-items: center;
204
+ justify-content: center;
205
+ width: 16px;
206
+ height: 16px;
207
+ margin-bottom: 9px;
208
+ background-color: #fff;
209
+ border-radius: 50%;
210
+ }
211
+
212
+ .error-icon-box {
213
+ color: @SC60;
214
+ }
215
+
216
+ .check-icon-box {
217
+ color: @B60;
218
+ }
219
+ // 提升该类名的优先级,不然会被.iconBox覆盖掉
220
+ .ald-steps .process-icon-box {
221
+ position: relative;
222
+ background-color: @B60;
223
+
224
+ &::after {
225
+ position: absolute;
226
+ top: 50%;
227
+ left: 50%;
228
+ width: 6px;
229
+ height: 6px;
230
+ background-color: @ND0;
231
+ border-radius: 50%;
232
+ transform: translate(-50%, -50%);
233
+ content: '';
234
+ }
235
+ }
236
+
237
+ .ald-steps .wait-icon-box {
238
+ position: relative;
239
+ background-color: @BG90;
240
+
241
+ &::after {
242
+ position: absolute;
243
+ top: 50%;
244
+ left: 50%;
245
+ width: 6px;
246
+ height: 6px;
247
+ background-color: @BG80;
248
+ border-radius: 50%;
249
+ transform: translate(-50%, -50%);
250
+ content: '';
251
+ }
252
+ }
@@ -1,4 +1,48 @@
1
- import Switch, { SwitchProps } from 'antd/es/switch';
1
+ import { SwitchChangeEventHandler } from 'antd/es/switch';
2
+ import React from 'react';
2
3
  export type { SwitchSize, SwitchChangeEventHandler, SwitchClickEventHandler } from 'antd/es/switch';
3
- export { SwitchProps };
4
+ export interface ISwitchProps {
5
+ /**
6
+ * @description class类名
7
+ * @default -
8
+ */
9
+ className?: string;
10
+ /**
11
+ * @description 指定当前是否选中
12
+ * @default false
13
+ */
14
+ checked?: boolean;
15
+ /**
16
+ * @description 初始是否选中
17
+ * @default false
18
+ */
19
+ defaultChecked?: boolean;
20
+ /**
21
+ * @description 是否禁用
22
+ * @default false
23
+ */
24
+ disabled?: boolean;
25
+ /**
26
+ * @description 加载中的开关
27
+ * @default false
28
+ */
29
+ loading?: boolean;
30
+ /**
31
+ * @description 尺寸大小
32
+ * @default middle
33
+ */
34
+ size?: 'middle' | 'small';
35
+ /**
36
+ * @description 点击时的回调
37
+ * @type (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
38
+ */
39
+ onClick?: SwitchChangeEventHandler;
40
+ /**
41
+ * @description 变时的回调
42
+ * @type (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
43
+ */
44
+ onChange?: SwitchChangeEventHandler;
45
+ children?: React.ReactNode;
46
+ }
47
+ declare const Switch: React.FC<ISwitchProps>;
4
48
  export default Switch;
@@ -1,2 +1,72 @@
1
- import Switch from 'antd/es/switch';
1
+ import "antd/es/switch/style";
2
+ import _Switch from "antd/es/switch";
3
+
4
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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."); }
7
+
8
+ 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); }
9
+
10
+ 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; }
11
+
12
+ 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; }
13
+
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+
16
+ import React, { useState, useEffect } from 'react';
17
+ import classnames from 'classnames';
18
+
19
+ var Switch = function Switch(_ref) {
20
+ var _ref$className = _ref.className,
21
+ className = _ref$className === void 0 ? '' : _ref$className,
22
+ _ref$disabled = _ref.disabled,
23
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
24
+ _ref$loading = _ref.loading,
25
+ loading = _ref$loading === void 0 ? false : _ref$loading,
26
+ _ref$size = _ref.size,
27
+ size = _ref$size === void 0 ? 'middle' : _ref$size,
28
+ checked = _ref.checked,
29
+ _ref$defaultChecked = _ref.defaultChecked,
30
+ defaultChecked = _ref$defaultChecked === void 0 ? false : _ref$defaultChecked,
31
+ onChange = _ref.onChange,
32
+ onClick = _ref.onClick,
33
+ children = _ref.children;
34
+
35
+ var _useState = useState(typeof checked === 'undefined' ? defaultChecked : checked),
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ userChecked = _useState2[0],
38
+ setUserChecked = _useState2[1];
39
+
40
+ var onChangeCB = function onChangeCB(isChecked, event) {
41
+ setUserChecked(isChecked);
42
+
43
+ if (typeof onChange === 'function') {
44
+ onChange(isChecked, event);
45
+ }
46
+ };
47
+
48
+ var currentDisabled = loading ? true : disabled;
49
+ useEffect(function () {
50
+ if (typeof checked === 'boolean') {
51
+ setUserChecked(checked);
52
+ }
53
+ }, [checked]);
54
+ return /*#__PURE__*/React.createElement("span", {
55
+ className: classnames(className, 'ald-switch', "ald-switch-".concat(size), {
56
+ 'ald-switch-disabled': currentDisabled,
57
+ 'ald-switch-checked': userChecked
58
+ })
59
+ }, /*#__PURE__*/React.createElement(_Switch, {
60
+ disabled: currentDisabled,
61
+ loading: loading,
62
+ onChange: onChangeCB,
63
+ onClick: onClick,
64
+ checked: userChecked,
65
+ className: "ald-switch-btn",
66
+ defaultChecked: defaultChecked
67
+ }), children && /*#__PURE__*/React.createElement("span", {
68
+ className: "ald-switch-text"
69
+ }, children));
70
+ };
71
+
2
72
  export default Switch;
@@ -1 +1,130 @@
1
1
  @import '../../style/index.less';
2
+
3
+ @switch-handle-middle: @font-size-middle;
4
+ @switch-handle-height-middle: @line-height-middle;
5
+ @switch-handle-small: @font-size-small;
6
+ @switch-handle-height-small: @line-height-small;
7
+ @switch-handle-gap-middle: 3px;
8
+ @switch-handle-gap-small: 2px;
9
+ @switch-text-margin-left: 8px;
10
+ @switch-aspect-ratio: 2; //宽高比
11
+ @switch-height-radius-ratio: 2; //高度和边框圆角比
12
+
13
+ .ald-switch {
14
+ display: inline-block;
15
+ font-size: 0;
16
+
17
+ .ald-switch-btn {
18
+ background: @NL90;
19
+
20
+ &:focus {
21
+ box-shadow: none;
22
+ }
23
+ }
24
+
25
+ .ald-switch-text {
26
+ display: inline-flex;
27
+ align-items: center;
28
+ margin-left: @switch-text-margin-left;
29
+ color: @NL0;
30
+ vertical-align: middle;
31
+ }
32
+
33
+ &.ald-switch-checked {
34
+ .ald-switch-btn {
35
+ background-color: @B60;
36
+ }
37
+ }
38
+
39
+ &.ald-switch-disabled {
40
+ cursor: initial;
41
+
42
+ .ald-switch-btn {
43
+ cursor: initial;
44
+ opacity: 0.5;
45
+
46
+ * {
47
+ cursor: initial;
48
+ }
49
+ }
50
+
51
+ .ald-switch-text {
52
+ color: @NL60;
53
+ }
54
+ }
55
+
56
+ &.ald-switch-middle {
57
+ .ald-switch-btn {
58
+ width: @switch-handle-height-middle * @switch-aspect-ratio;
59
+ min-width: @switch-handle-height-middle * @switch-aspect-ratio;
60
+ height: @switch-handle-height-middle;
61
+ line-height: @switch-handle-height-middle;
62
+ border-radius: @switch-handle-height-middle / @switch-height-radius-ratio;
63
+
64
+ .ant-switch-handle {
65
+ top: @switch-handle-gap-middle;
66
+ left: @switch-handle-gap-middle;
67
+ width: @switch-handle-middle;
68
+ height: @switch-handle-middle;
69
+
70
+ .ant-switch-loading-icon {
71
+ width: @switch-handle-middle - 4px;
72
+ height: @switch-handle-middle - 4px;
73
+ font-size: @switch-handle-middle - 4px;
74
+ }
75
+ }
76
+ }
77
+
78
+ .ald-switch-text {
79
+ height: @switch-handle-height-middle;
80
+ font-size: @font-size-middle;
81
+ line-height: @switch-handle-height-middle;
82
+ }
83
+
84
+ &.ald-switch-checked {
85
+ .ant-switch-handle {
86
+ top: 3px;
87
+ left: calc(100% - @switch-handle-middle - @switch-handle-gap-middle);
88
+ width: @switch-handle-middle;
89
+ height: @switch-handle-middle;
90
+ }
91
+ }
92
+ }
93
+
94
+ &.ald-switch-small {
95
+ .ald-switch-btn {
96
+ width: @switch-handle-height-small * @switch-aspect-ratio;
97
+ min-width: @switch-handle-height-small * @switch-aspect-ratio;
98
+ height: @switch-handle-height-small;
99
+ line-height: @switch-handle-height-small;
100
+ border-radius: @switch-handle-height-small / @switch-height-radius-ratio;
101
+
102
+ .ant-switch-handle {
103
+ top: @switch-handle-gap-small;
104
+ left: @switch-handle-gap-small;
105
+ width: @switch-handle-small;
106
+ height: @switch-handle-small;
107
+
108
+ .ant-switch-loading-icon {
109
+ width: @switch-handle-small - 4px;
110
+ height: @switch-handle-small - 4px;
111
+ font-size: @switch-handle-small - 4px;
112
+ }
113
+ }
114
+ }
115
+
116
+ .ald-switch-text {
117
+ height: @switch-handle-height-small;
118
+ font-size: @font-size-small;
119
+ line-height: @switch-handle-height-small;
120
+ }
121
+
122
+ &.ald-switch-checked {
123
+ .ant-switch-handle {
124
+ left: calc(100% - @switch-handle-small - @switch-handle-gap-small);
125
+ width: @switch-handle-small;
126
+ height: @switch-handle-small;
127
+ }
128
+ }
129
+ }
130
+ }
@@ -1,5 +1,5 @@
1
1
  @import '../../style/index.less';
2
-
2
+ @import '../../Empty/style/index.less';
3
3
  @ald-iconfont-css-prefix: anticon;
4
4
  @table-row-height: 48px;
5
5
 
package/es/Tabs/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import "@aloudata/icons-react/styles/index.less";
2
+ import _More from "@aloudata/icons-react/es/icons/More";
1
3
  import "antd/es/tabs/style";
2
4
  import _Tabs from "antd/es/tabs";
3
5
  var _excluded = ["size", "className", "popupClassName", "adaptHeight"];
@@ -14,7 +16,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
14
16
 
15
17
  import React from 'react'; // import AntdTabs, { TabsProps } from 'antd/lib/tabs';
16
18
 
17
- import More from '../Icon/icons/More';
18
19
  import TabPane from './TabPane';
19
20
  import classNames from 'classnames';
20
21
  export default function Tabs(props) {
@@ -33,7 +34,7 @@ export default function Tabs(props) {
33
34
  return /*#__PURE__*/React.createElement(_Tabs, Object.assign({
34
35
  moreIcon: /*#__PURE__*/React.createElement("div", {
35
36
  className: "ald-tabs-moreIcon"
36
- }, /*#__PURE__*/React.createElement(More, {
37
+ }, /*#__PURE__*/React.createElement(_More, {
37
38
  color: "currentColor"
38
39
  })),
39
40
  tabBarGutter: 24,