assui 2.0.144 → 2.0.145
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/es/button-drawer/index.d.ts +5 -5
- package/es/button-drawer/index.js +2 -1
- package/es/label-number-input/style/index.css +11 -11
- package/es/label-number-input/style/index.less +40 -40
- package/lib/button-drawer/index.d.ts +5 -5
- package/lib/button-drawer/index.js +3 -1
- package/lib/label-number-input/style/index.css +11 -11
- package/lib/label-number-input/style/index.less +40 -40
- package/package.json +2 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DrawerProps } from 'antd/lib/drawer';
|
|
3
|
+
export declare type DrawerAction = {
|
|
4
|
+
close: () => void;
|
|
5
|
+
open: () => void;
|
|
6
|
+
};
|
|
3
7
|
export interface ButtonDrawerProps extends DrawerProps {
|
|
4
8
|
onClose?: () => void;
|
|
5
9
|
onOpen?: () => void;
|
|
6
10
|
trigger: React.ReactElement;
|
|
7
|
-
children: React.ReactElement;
|
|
11
|
+
children: ((v: DrawerAction) => React.ReactElement) | React.ReactElement;
|
|
8
12
|
}
|
|
9
|
-
export declare type DrawerAction = {
|
|
10
|
-
close: () => void;
|
|
11
|
-
open: () => void;
|
|
12
|
-
};
|
|
13
13
|
declare const ForwardRefButtonDrawer: React.ForwardRefExoticComponent<ButtonDrawerProps & React.RefAttributes<unknown>>;
|
|
14
14
|
export default ForwardRefButtonDrawer;
|
|
@@ -56,6 +56,7 @@ var __read = this && this.__read || function (o, n) {
|
|
|
56
56
|
|
|
57
57
|
import React, { useState, useRef, useImperativeHandle } from 'react';
|
|
58
58
|
import Drawer from 'antd/lib/drawer';
|
|
59
|
+
import isFunction from 'lodash/isFunction';
|
|
59
60
|
import classNames from 'classnames';
|
|
60
61
|
|
|
61
62
|
var ButtonDrawer = function ButtonDrawer(props, ref) {
|
|
@@ -107,7 +108,7 @@ var ButtonDrawer = function ButtonDrawer(props, ref) {
|
|
|
107
108
|
title: title,
|
|
108
109
|
onClose: closeDrawer,
|
|
109
110
|
visible: drawerVisible
|
|
110
|
-
}, restProps), /*#__PURE__*/React.cloneElement(children, {
|
|
111
|
+
}, restProps), isFunction(children) ? children(actionRef.current) : /*#__PURE__*/React.cloneElement(children, {
|
|
111
112
|
drawerAction: actionRef.current
|
|
112
113
|
})));
|
|
113
114
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
.label-number-input {
|
|
1
|
+
.label-number-input-warper {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
}
|
|
6
|
+
.label-number-input-warper .label-number-input {
|
|
2
7
|
z-index: 1;
|
|
3
8
|
width: 100%;
|
|
4
9
|
height: 100%;
|
|
@@ -9,26 +14,21 @@
|
|
|
9
14
|
border: 0;
|
|
10
15
|
outline: 0;
|
|
11
16
|
}
|
|
12
|
-
.label-number-input:focus + label,
|
|
13
|
-
.label-number-input:not([data-value='0']) + label {
|
|
17
|
+
.label-number-input-warper .label-number-input:focus + label,
|
|
18
|
+
.label-number-input-warper .label-number-input:not([data-value='0']) + label {
|
|
14
19
|
transform: translateY(-8px) scale(0.8);
|
|
15
20
|
}
|
|
16
|
-
.label-number-input-field {
|
|
21
|
+
.label-number-input-warper .label-number-input-field {
|
|
17
22
|
height: 45px;
|
|
18
23
|
overflow: hidden;
|
|
19
24
|
border: 1px solid #e5e5e5;
|
|
20
25
|
border-radius: 8px;
|
|
21
26
|
transition: border 0.3s;
|
|
22
27
|
}
|
|
23
|
-
.label-number-input-focused {
|
|
28
|
+
.label-number-input-warper .label-number-input-focused {
|
|
24
29
|
border-color: #000;
|
|
25
30
|
}
|
|
26
|
-
.label-number-input-warper {
|
|
27
|
-
position: relative;
|
|
28
|
-
width: 100%;
|
|
29
|
-
height: 100%;
|
|
30
|
-
}
|
|
31
|
-
.label-number-input-text {
|
|
31
|
+
.label-number-input-warper .label-number-input-text {
|
|
32
32
|
position: absolute;
|
|
33
33
|
top: 12px;
|
|
34
34
|
left: 15px;
|
|
@@ -9,51 +9,51 @@
|
|
|
9
9
|
|
|
10
10
|
@font-weight-500: 500;
|
|
11
11
|
|
|
12
|
-
.label-number-input {
|
|
13
|
-
|
|
12
|
+
.label-number-input-warper {
|
|
13
|
+
position: relative;
|
|
14
14
|
width: 100%;
|
|
15
15
|
height: 100%;
|
|
16
|
-
padding: 19px 15px 2px 15px;
|
|
17
|
-
color: @color_263241;
|
|
18
|
-
font-size: @font-size-base;
|
|
19
|
-
line-height: 16px;
|
|
20
|
-
border: 0;
|
|
21
|
-
outline: 0;
|
|
22
|
-
|
|
23
|
-
&:focus + label,
|
|
24
|
-
&:not([data-value='0']) + label {
|
|
25
|
-
transform: translateY(@labelTextLabeltranslateY) scale(@labelTextLabelScale);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&-field {
|
|
29
|
-
height: 45px;
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
border: 1px solid @color_e5e5e5;
|
|
32
|
-
border-radius: 8px;
|
|
33
|
-
transition: border 0.3s;
|
|
34
|
-
}
|
|
35
16
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&-warper {
|
|
41
|
-
position: relative;
|
|
17
|
+
.label-number-input {
|
|
18
|
+
z-index: 1;
|
|
42
19
|
width: 100%;
|
|
43
20
|
height: 100%;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
&-text {
|
|
47
|
-
position: absolute;
|
|
48
|
-
top: 12px;
|
|
49
|
-
left: 15px;
|
|
50
|
-
z-index: 2;
|
|
51
|
-
height: 20px;
|
|
52
|
-
color: @color_9aa5b5;
|
|
21
|
+
padding: 19px 15px 2px 15px;
|
|
22
|
+
color: @color_263241;
|
|
53
23
|
font-size: @font-size-base;
|
|
54
|
-
line-height:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
24
|
+
line-height: 16px;
|
|
25
|
+
border: 0;
|
|
26
|
+
outline: 0;
|
|
27
|
+
|
|
28
|
+
&:focus + label,
|
|
29
|
+
&:not([data-value='0']) + label {
|
|
30
|
+
transform: translateY(@labelTextLabeltranslateY) scale(@labelTextLabelScale);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&-field {
|
|
34
|
+
height: 45px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
border: 1px solid @color_e5e5e5;
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
transition: border 0.3s;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-focused {
|
|
42
|
+
border-color: @labelFocusBorderColor;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&-text {
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 12px;
|
|
48
|
+
left: 15px;
|
|
49
|
+
z-index: 2;
|
|
50
|
+
height: 20px;
|
|
51
|
+
color: @color_9aa5b5;
|
|
52
|
+
font-size: @font-size-base;
|
|
53
|
+
line-height: 20px;
|
|
54
|
+
transform-origin: top left;
|
|
55
|
+
cursor: text;
|
|
56
|
+
transition: all 0.2s ease-out;
|
|
57
|
+
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DrawerProps } from 'antd/lib/drawer';
|
|
3
|
+
export declare type DrawerAction = {
|
|
4
|
+
close: () => void;
|
|
5
|
+
open: () => void;
|
|
6
|
+
};
|
|
3
7
|
export interface ButtonDrawerProps extends DrawerProps {
|
|
4
8
|
onClose?: () => void;
|
|
5
9
|
onOpen?: () => void;
|
|
6
10
|
trigger: React.ReactElement;
|
|
7
|
-
children: React.ReactElement;
|
|
11
|
+
children: ((v: DrawerAction) => React.ReactElement) | React.ReactElement;
|
|
8
12
|
}
|
|
9
|
-
export declare type DrawerAction = {
|
|
10
|
-
close: () => void;
|
|
11
|
-
open: () => void;
|
|
12
|
-
};
|
|
13
13
|
declare const ForwardRefButtonDrawer: React.ForwardRefExoticComponent<ButtonDrawerProps & React.RefAttributes<unknown>>;
|
|
14
14
|
export default ForwardRefButtonDrawer;
|
|
@@ -104,6 +104,8 @@ var react_1 = __importStar(require("react"));
|
|
|
104
104
|
|
|
105
105
|
var drawer_1 = __importDefault(require("antd/lib/drawer"));
|
|
106
106
|
|
|
107
|
+
var isFunction_1 = __importDefault(require("lodash/isFunction"));
|
|
108
|
+
|
|
107
109
|
var classnames_1 = __importDefault(require("classnames"));
|
|
108
110
|
|
|
109
111
|
var ButtonDrawer = function ButtonDrawer(props, ref) {
|
|
@@ -155,7 +157,7 @@ var ButtonDrawer = function ButtonDrawer(props, ref) {
|
|
|
155
157
|
title: title,
|
|
156
158
|
onClose: closeDrawer,
|
|
157
159
|
visible: drawerVisible
|
|
158
|
-
}, restProps), react_1["default"].cloneElement(children, {
|
|
160
|
+
}, restProps), isFunction_1["default"](children) ? children(actionRef.current) : react_1["default"].cloneElement(children, {
|
|
159
161
|
drawerAction: actionRef.current
|
|
160
162
|
})));
|
|
161
163
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
.label-number-input {
|
|
1
|
+
.label-number-input-warper {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
}
|
|
6
|
+
.label-number-input-warper .label-number-input {
|
|
2
7
|
z-index: 1;
|
|
3
8
|
width: 100%;
|
|
4
9
|
height: 100%;
|
|
@@ -9,26 +14,21 @@
|
|
|
9
14
|
border: 0;
|
|
10
15
|
outline: 0;
|
|
11
16
|
}
|
|
12
|
-
.label-number-input:focus + label,
|
|
13
|
-
.label-number-input:not([data-value='0']) + label {
|
|
17
|
+
.label-number-input-warper .label-number-input:focus + label,
|
|
18
|
+
.label-number-input-warper .label-number-input:not([data-value='0']) + label {
|
|
14
19
|
transform: translateY(-8px) scale(0.8);
|
|
15
20
|
}
|
|
16
|
-
.label-number-input-field {
|
|
21
|
+
.label-number-input-warper .label-number-input-field {
|
|
17
22
|
height: 45px;
|
|
18
23
|
overflow: hidden;
|
|
19
24
|
border: 1px solid #e5e5e5;
|
|
20
25
|
border-radius: 8px;
|
|
21
26
|
transition: border 0.3s;
|
|
22
27
|
}
|
|
23
|
-
.label-number-input-focused {
|
|
28
|
+
.label-number-input-warper .label-number-input-focused {
|
|
24
29
|
border-color: #000;
|
|
25
30
|
}
|
|
26
|
-
.label-number-input-warper {
|
|
27
|
-
position: relative;
|
|
28
|
-
width: 100%;
|
|
29
|
-
height: 100%;
|
|
30
|
-
}
|
|
31
|
-
.label-number-input-text {
|
|
31
|
+
.label-number-input-warper .label-number-input-text {
|
|
32
32
|
position: absolute;
|
|
33
33
|
top: 12px;
|
|
34
34
|
left: 15px;
|
|
@@ -9,51 +9,51 @@
|
|
|
9
9
|
|
|
10
10
|
@font-weight-500: 500;
|
|
11
11
|
|
|
12
|
-
.label-number-input {
|
|
13
|
-
|
|
12
|
+
.label-number-input-warper {
|
|
13
|
+
position: relative;
|
|
14
14
|
width: 100%;
|
|
15
15
|
height: 100%;
|
|
16
|
-
padding: 19px 15px 2px 15px;
|
|
17
|
-
color: @color_263241;
|
|
18
|
-
font-size: @font-size-base;
|
|
19
|
-
line-height: 16px;
|
|
20
|
-
border: 0;
|
|
21
|
-
outline: 0;
|
|
22
|
-
|
|
23
|
-
&:focus + label,
|
|
24
|
-
&:not([data-value='0']) + label {
|
|
25
|
-
transform: translateY(@labelTextLabeltranslateY) scale(@labelTextLabelScale);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&-field {
|
|
29
|
-
height: 45px;
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
border: 1px solid @color_e5e5e5;
|
|
32
|
-
border-radius: 8px;
|
|
33
|
-
transition: border 0.3s;
|
|
34
|
-
}
|
|
35
16
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&-warper {
|
|
41
|
-
position: relative;
|
|
17
|
+
.label-number-input {
|
|
18
|
+
z-index: 1;
|
|
42
19
|
width: 100%;
|
|
43
20
|
height: 100%;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
&-text {
|
|
47
|
-
position: absolute;
|
|
48
|
-
top: 12px;
|
|
49
|
-
left: 15px;
|
|
50
|
-
z-index: 2;
|
|
51
|
-
height: 20px;
|
|
52
|
-
color: @color_9aa5b5;
|
|
21
|
+
padding: 19px 15px 2px 15px;
|
|
22
|
+
color: @color_263241;
|
|
53
23
|
font-size: @font-size-base;
|
|
54
|
-
line-height:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
24
|
+
line-height: 16px;
|
|
25
|
+
border: 0;
|
|
26
|
+
outline: 0;
|
|
27
|
+
|
|
28
|
+
&:focus + label,
|
|
29
|
+
&:not([data-value='0']) + label {
|
|
30
|
+
transform: translateY(@labelTextLabeltranslateY) scale(@labelTextLabelScale);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&-field {
|
|
34
|
+
height: 45px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
border: 1px solid @color_e5e5e5;
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
transition: border 0.3s;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-focused {
|
|
42
|
+
border-color: @labelFocusBorderColor;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&-text {
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 12px;
|
|
48
|
+
left: 15px;
|
|
49
|
+
z-index: 2;
|
|
50
|
+
height: 20px;
|
|
51
|
+
color: @color_9aa5b5;
|
|
52
|
+
font-size: @font-size-base;
|
|
53
|
+
line-height: 20px;
|
|
54
|
+
transform-origin: top left;
|
|
55
|
+
cursor: text;
|
|
56
|
+
transition: all 0.2s ease-out;
|
|
57
|
+
}
|
|
58
58
|
}
|
|
59
59
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.145",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"node": ">=10.0.0"
|
|
70
70
|
},
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "650d26e8bd8467abe88cc0a6b5cab915fa9cec17"
|
|
73
73
|
}
|