assui 2.0.99 → 2.0.102

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/index.d.ts CHANGED
@@ -38,10 +38,14 @@ export type { LabelInputProps } from './label-input';
38
38
  export { default as LabelInput } from './label-input';
39
39
  export type { LabelSelectProps } from './label-select';
40
40
  export { default as LabelSelect } from './label-select';
41
+ export type { LabelTextAreaProps } from './label-text-area';
42
+ export { default as LabelTextArea } from './label-text-area';
41
43
  export type { LabelRangePickerProps } from './label-range-picker';
42
44
  export { default as LabelRangePicker } from './label-range-picker';
43
45
  export type { LabelDatePickerProps } from './label-date-picker';
44
46
  export { default as LabelDatePicker } from './label-date-picker';
47
+ export type { LabelCustomizeRangePickerProps } from './label-customize-range-picker';
48
+ export { default as LabelCustomizeRangePicker } from './label-customize-range-picker';
45
49
  export type { LabelDescItemProps } from './label-desc-item';
46
50
  export { default as LabelDescItem } from './label-desc-item';
47
51
  export type { RichTextEditorProps } from './rich-text-editor';
package/es/index.js CHANGED
@@ -19,8 +19,10 @@ export { default as TextArea } from './text-area';
19
19
  export { default as TextInput } from './text-input';
20
20
  export { default as LabelInput } from './label-input';
21
21
  export { default as LabelSelect } from './label-select';
22
+ export { default as LabelTextArea } from './label-text-area';
22
23
  export { default as LabelRangePicker } from './label-range-picker';
23
24
  export { default as LabelDatePicker } from './label-date-picker';
25
+ export { default as LabelCustomizeRangePicker } from './label-customize-range-picker';
24
26
  export { default as LabelDescItem } from './label-desc-item';
25
27
  export { default as RichTextEditor } from './rich-text-editor';
26
28
  export { default as beautifulDnd } from './beautiful-dnd';
@@ -0,0 +1,9 @@
1
+ .form {
2
+ :global {
3
+ .ant-form-item-has-error {
4
+ .label-input-field {
5
+ border-color: #ff6b00;
6
+ }
7
+ }
8
+ }
9
+ }
@@ -27,10 +27,11 @@ var __read = this && this.__read || function (o, n) {
27
27
 
28
28
  import React from 'react';
29
29
  import classNames from 'classnames';
30
- import { useControllableValue } from 'ahooks';
31
30
  import { trimStart } from 'lodash';
32
31
  import EyeFilled from 'a-icons/lib/EyeFilled';
33
32
  import EyeOutlined from 'a-icons/lib/EyeOutlined';
33
+ import useControllableValue from 'ahooks/lib/useControllableValue';
34
+ import useSize from 'ahooks/lib/useSize';
34
35
  var PasswordSuffix = /*#__PURE__*/React.memo(function (_a) {
35
36
  var inputType = _a.inputType,
36
37
  onChangeInputType = _a.onChangeInputType;
@@ -39,6 +40,7 @@ var PasswordSuffix = /*#__PURE__*/React.memo(function (_a) {
39
40
  onChangeInputType('text');
40
41
  }
41
42
  }) : /*#__PURE__*/React.createElement(EyeFilled, {
43
+ className: "label-input-open-eye",
42
44
  onClick: function onClick() {
43
45
  onChangeInputType('password');
44
46
  }
@@ -57,6 +59,8 @@ var LabelInput = function LabelInput(props) {
57
59
  _a = props.type,
58
60
  type = _a === void 0 ? 'text' : _a,
59
61
  maxLength = props.maxLength;
62
+ var labelDomRef = React.useRef(null);
63
+ var labelSize = useSize(labelDomRef);
60
64
 
61
65
  var _b = __read(React.useState(false), 2),
62
66
  focused = _b[0],
@@ -99,9 +103,13 @@ var LabelInput = function LabelInput(props) {
99
103
  var onChangeInputType = React.useCallback(function (nextInputType) {
100
104
  setInputType(nextInputType);
101
105
  }, []);
106
+ var controlMinWidth = (labelSize === null || labelSize === void 0 ? void 0 : labelSize.width) ? labelSize.width + 28 : undefined;
102
107
  return /*#__PURE__*/React.createElement("div", {
103
108
  className: classNames('label-input-control', className),
104
- id: id
109
+ id: id,
110
+ style: {
111
+ minWidth: controlMinWidth
112
+ }
105
113
  }, /*#__PURE__*/React.createElement("div", {
106
114
  className: classNames('label-input-field', {
107
115
  'label-input-affix': prefix || suffix || isPasswordInput,
@@ -125,7 +133,8 @@ var LabelInput = function LabelInput(props) {
125
133
  maxLength: maxLength
126
134
  }), /*#__PURE__*/React.createElement("label", {
127
135
  className: "label-input-text",
128
- onClick: handleLabelClick
136
+ onClick: handleLabelClick,
137
+ ref: labelDomRef
129
138
  }, label)), (suffix || isPasswordInput) && /*#__PURE__*/React.createElement("div", {
130
139
  className: "label-input-suffix"
131
140
  }, suffix || /*#__PURE__*/React.createElement(PasswordSuffix, {
@@ -6,13 +6,8 @@
6
6
  color: #263241;
7
7
  font-size: 16px;
8
8
  line-height: 16px;
9
- border: 1px solid #e5e5e5;
10
- border-radius: 12px;
9
+ border: 0;
11
10
  outline: 0;
12
- transition: border 0.3s;
13
- }
14
- .label-input:focus {
15
- border-color: #ff6b00;
16
11
  }
17
12
  .label-input:focus + label,
18
13
  .label-input:not([data-value='0']) + label {
@@ -26,18 +21,13 @@
26
21
  .label-input-field {
27
22
  height: 52px;
28
23
  overflow: hidden;
24
+ border: 1px solid #e5e5e5;
25
+ border-radius: 12px;
26
+ transition: border 0.3s;
29
27
  }
30
28
  .label-input-affix {
31
29
  display: flex;
32
30
  align-items: center;
33
- border: 1px solid #dfe2e7;
34
- border-radius: 6px;
35
- }
36
- .label-input-affix .label-input {
37
- border: 0;
38
- }
39
- .label-input-affix .label-input:focus {
40
- border: 0;
41
31
  }
42
32
  .label-input-focused {
43
33
  border-color: #ff6b00;
@@ -47,7 +37,9 @@
47
37
  padding-left: 15px;
48
38
  }
49
39
  .label-input-suffix {
40
+ display: flex;
50
41
  flex-shrink: 0;
42
+ align-items: center;
51
43
  padding-right: 15px;
52
44
  color: #b3b3b3;
53
45
  font-weight: 500;
@@ -70,3 +62,6 @@
70
62
  cursor: text;
71
63
  transition: all 0.2s ease-out;
72
64
  }
65
+ .label-input-open-eye {
66
+ color: #ff6b00;
67
+ }
@@ -1,5 +1,5 @@
1
1
  @primary-color: #ff6b00;
2
- @color_dfe2e7: #dfe2e7;
2
+ @color_263241: #263241;
3
3
  @color_9aa5b5: #9aa5b5;
4
4
  @color_b3b3b3: #b3b3b3;
5
5
  @color_e5e5e5: #e5e5e5;
@@ -14,17 +14,11 @@
14
14
  width: 100%;
15
15
  height: 100%;
16
16
  padding: 24px 15px 8px 15px;
17
- color: #263241;
17
+ color: @color_263241;
18
18
  font-size: @font-size-lg;
19
19
  line-height: 16px;
20
- border: 1px solid @color_e5e5e5;
21
- border-radius: 12px;
20
+ border: 0;
22
21
  outline: 0;
23
- transition: border 0.3s;
24
-
25
- &:focus {
26
- border-color: @primary-color;
27
- }
28
22
 
29
23
  &:focus + label,
30
24
  &:not([data-value='0']) + label {
@@ -40,21 +34,14 @@
40
34
  &-field {
41
35
  height: 52px;
42
36
  overflow: hidden;
37
+ border: 1px solid @color_e5e5e5;
38
+ border-radius: 12px;
39
+ transition: border 0.3s;
43
40
  }
44
41
 
45
42
  &-affix {
46
43
  display: flex;
47
44
  align-items: center;
48
- border: 1px solid @color_dfe2e7;
49
- border-radius: 6px;
50
-
51
- .label-input {
52
- border: 0;
53
-
54
- &:focus {
55
- border: 0;
56
- }
57
- }
58
45
  }
59
46
 
60
47
  &-focused {
@@ -67,7 +54,9 @@
67
54
  }
68
55
 
69
56
  &-suffix {
57
+ display: flex;
70
58
  flex-shrink: 0;
59
+ align-items: center;
71
60
  padding-right: 15px;
72
61
  color: @color_b3b3b3;
73
62
  font-weight: @font-weight-500;
@@ -92,4 +81,8 @@
92
81
  cursor: text;
93
82
  transition: all 0.2s ease-out;
94
83
  }
84
+
85
+ &-open-eye {
86
+ color: @primary-color;
87
+ }
95
88
  }
package/lib/index.d.ts CHANGED
@@ -38,10 +38,14 @@ export type { LabelInputProps } from './label-input';
38
38
  export { default as LabelInput } from './label-input';
39
39
  export type { LabelSelectProps } from './label-select';
40
40
  export { default as LabelSelect } from './label-select';
41
+ export type { LabelTextAreaProps } from './label-text-area';
42
+ export { default as LabelTextArea } from './label-text-area';
41
43
  export type { LabelRangePickerProps } from './label-range-picker';
42
44
  export { default as LabelRangePicker } from './label-range-picker';
43
45
  export type { LabelDatePickerProps } from './label-date-picker';
44
46
  export { default as LabelDatePicker } from './label-date-picker';
47
+ export type { LabelCustomizeRangePickerProps } from './label-customize-range-picker';
48
+ export { default as LabelCustomizeRangePicker } from './label-customize-range-picker';
45
49
  export type { LabelDescItemProps } from './label-desc-item';
46
50
  export { default as LabelDescItem } from './label-desc-item';
47
51
  export type { RichTextEditorProps } from './rich-text-editor';
package/lib/index.js CHANGED
@@ -193,6 +193,15 @@ Object.defineProperty(exports, "LabelSelect", {
193
193
  }
194
194
  });
195
195
 
196
+ var label_text_area_1 = require("./label-text-area");
197
+
198
+ Object.defineProperty(exports, "LabelTextArea", {
199
+ enumerable: true,
200
+ get: function get() {
201
+ return label_text_area_1["default"];
202
+ }
203
+ });
204
+
196
205
  var label_range_picker_1 = require("./label-range-picker");
197
206
 
198
207
  Object.defineProperty(exports, "LabelRangePicker", {
@@ -211,6 +220,15 @@ Object.defineProperty(exports, "LabelDatePicker", {
211
220
  }
212
221
  });
213
222
 
223
+ var label_customize_range_picker_1 = require("./label-customize-range-picker");
224
+
225
+ Object.defineProperty(exports, "LabelCustomizeRangePicker", {
226
+ enumerable: true,
227
+ get: function get() {
228
+ return label_customize_range_picker_1["default"];
229
+ }
230
+ });
231
+
214
232
  var label_desc_item_1 = require("./label-desc-item");
215
233
 
216
234
  Object.defineProperty(exports, "LabelDescItem", {
@@ -0,0 +1,9 @@
1
+ .form {
2
+ :global {
3
+ .ant-form-item-has-error {
4
+ .label-input-field {
5
+ border-color: #ff6b00;
6
+ }
7
+ }
8
+ }
9
+ }
@@ -41,14 +41,16 @@ var react_1 = __importDefault(require("react"));
41
41
 
42
42
  var classnames_1 = __importDefault(require("classnames"));
43
43
 
44
- var ahooks_1 = require("ahooks");
45
-
46
44
  var lodash_1 = require("lodash");
47
45
 
48
46
  var EyeFilled_1 = __importDefault(require("a-icons/lib/EyeFilled"));
49
47
 
50
48
  var EyeOutlined_1 = __importDefault(require("a-icons/lib/EyeOutlined"));
51
49
 
50
+ var useControllableValue_1 = __importDefault(require("ahooks/lib/useControllableValue"));
51
+
52
+ var useSize_1 = __importDefault(require("ahooks/lib/useSize"));
53
+
52
54
  var PasswordSuffix = react_1["default"].memo(function (_a) {
53
55
  var inputType = _a.inputType,
54
56
  onChangeInputType = _a.onChangeInputType;
@@ -57,6 +59,7 @@ var PasswordSuffix = react_1["default"].memo(function (_a) {
57
59
  onChangeInputType('text');
58
60
  }
59
61
  }) : react_1["default"].createElement(EyeFilled_1["default"], {
62
+ className: "label-input-open-eye",
60
63
  onClick: function onClick() {
61
64
  onChangeInputType('password');
62
65
  }
@@ -75,12 +78,14 @@ var LabelInput = function LabelInput(props) {
75
78
  _a = props.type,
76
79
  type = _a === void 0 ? 'text' : _a,
77
80
  maxLength = props.maxLength;
81
+ var labelDomRef = react_1["default"].useRef(null);
82
+ var labelSize = useSize_1["default"](labelDomRef);
78
83
 
79
84
  var _b = __read(react_1["default"].useState(false), 2),
80
85
  focused = _b[0],
81
86
  setFocused = _b[1];
82
87
 
83
- var _c = __read(ahooks_1.useControllableValue(props, {
88
+ var _c = __read(useControllableValue_1["default"](props, {
84
89
  defaultValue: ''
85
90
  }), 2),
86
91
  value = _c[0],
@@ -117,9 +122,13 @@ var LabelInput = function LabelInput(props) {
117
122
  var onChangeInputType = react_1["default"].useCallback(function (nextInputType) {
118
123
  setInputType(nextInputType);
119
124
  }, []);
125
+ var controlMinWidth = (labelSize === null || labelSize === void 0 ? void 0 : labelSize.width) ? labelSize.width + 28 : undefined;
120
126
  return react_1["default"].createElement("div", {
121
127
  className: classnames_1["default"]('label-input-control', className),
122
- id: id
128
+ id: id,
129
+ style: {
130
+ minWidth: controlMinWidth
131
+ }
123
132
  }, react_1["default"].createElement("div", {
124
133
  className: classnames_1["default"]('label-input-field', {
125
134
  'label-input-affix': prefix || suffix || isPasswordInput,
@@ -143,7 +152,8 @@ var LabelInput = function LabelInput(props) {
143
152
  maxLength: maxLength
144
153
  }), react_1["default"].createElement("label", {
145
154
  className: "label-input-text",
146
- onClick: handleLabelClick
155
+ onClick: handleLabelClick,
156
+ ref: labelDomRef
147
157
  }, label)), (suffix || isPasswordInput) && react_1["default"].createElement("div", {
148
158
  className: "label-input-suffix"
149
159
  }, suffix || react_1["default"].createElement(PasswordSuffix, {
@@ -6,13 +6,8 @@
6
6
  color: #263241;
7
7
  font-size: 16px;
8
8
  line-height: 16px;
9
- border: 1px solid #e5e5e5;
10
- border-radius: 12px;
9
+ border: 0;
11
10
  outline: 0;
12
- transition: border 0.3s;
13
- }
14
- .label-input:focus {
15
- border-color: #ff6b00;
16
11
  }
17
12
  .label-input:focus + label,
18
13
  .label-input:not([data-value='0']) + label {
@@ -26,18 +21,13 @@
26
21
  .label-input-field {
27
22
  height: 52px;
28
23
  overflow: hidden;
24
+ border: 1px solid #e5e5e5;
25
+ border-radius: 12px;
26
+ transition: border 0.3s;
29
27
  }
30
28
  .label-input-affix {
31
29
  display: flex;
32
30
  align-items: center;
33
- border: 1px solid #dfe2e7;
34
- border-radius: 6px;
35
- }
36
- .label-input-affix .label-input {
37
- border: 0;
38
- }
39
- .label-input-affix .label-input:focus {
40
- border: 0;
41
31
  }
42
32
  .label-input-focused {
43
33
  border-color: #ff6b00;
@@ -47,7 +37,9 @@
47
37
  padding-left: 15px;
48
38
  }
49
39
  .label-input-suffix {
40
+ display: flex;
50
41
  flex-shrink: 0;
42
+ align-items: center;
51
43
  padding-right: 15px;
52
44
  color: #b3b3b3;
53
45
  font-weight: 500;
@@ -70,3 +62,6 @@
70
62
  cursor: text;
71
63
  transition: all 0.2s ease-out;
72
64
  }
65
+ .label-input-open-eye {
66
+ color: #ff6b00;
67
+ }
@@ -1,5 +1,5 @@
1
1
  @primary-color: #ff6b00;
2
- @color_dfe2e7: #dfe2e7;
2
+ @color_263241: #263241;
3
3
  @color_9aa5b5: #9aa5b5;
4
4
  @color_b3b3b3: #b3b3b3;
5
5
  @color_e5e5e5: #e5e5e5;
@@ -14,17 +14,11 @@
14
14
  width: 100%;
15
15
  height: 100%;
16
16
  padding: 24px 15px 8px 15px;
17
- color: #263241;
17
+ color: @color_263241;
18
18
  font-size: @font-size-lg;
19
19
  line-height: 16px;
20
- border: 1px solid @color_e5e5e5;
21
- border-radius: 12px;
20
+ border: 0;
22
21
  outline: 0;
23
- transition: border 0.3s;
24
-
25
- &:focus {
26
- border-color: @primary-color;
27
- }
28
22
 
29
23
  &:focus + label,
30
24
  &:not([data-value='0']) + label {
@@ -40,21 +34,14 @@
40
34
  &-field {
41
35
  height: 52px;
42
36
  overflow: hidden;
37
+ border: 1px solid @color_e5e5e5;
38
+ border-radius: 12px;
39
+ transition: border 0.3s;
43
40
  }
44
41
 
45
42
  &-affix {
46
43
  display: flex;
47
44
  align-items: center;
48
- border: 1px solid @color_dfe2e7;
49
- border-radius: 6px;
50
-
51
- .label-input {
52
- border: 0;
53
-
54
- &:focus {
55
- border: 0;
56
- }
57
- }
58
45
  }
59
46
 
60
47
  &-focused {
@@ -67,7 +54,9 @@
67
54
  }
68
55
 
69
56
  &-suffix {
57
+ display: flex;
70
58
  flex-shrink: 0;
59
+ align-items: center;
71
60
  padding-right: 15px;
72
61
  color: @color_b3b3b3;
73
62
  font-weight: @font-weight-500;
@@ -92,4 +81,8 @@
92
81
  cursor: text;
93
82
  transition: all 0.2s ease-out;
94
83
  }
84
+
85
+ &-open-eye {
86
+ color: @primary-color;
87
+ }
95
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "2.0.99",
3
+ "version": "2.0.102",
4
4
  "description": "react ui library",
5
5
  "author": "jason <usochen@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -33,7 +33,7 @@
33
33
  "@ahooksjs/use-url-state": "^2.5.8",
34
34
  "@tinymce/tinymce-react": "^3.13.0",
35
35
  "@types/react-beautiful-dnd": "^13.1.2",
36
- "a-icons": "^1.0.52",
36
+ "a-icons": "^1.0.53",
37
37
  "ahooks": "^3.0.8",
38
38
  "bignumber.js": "^9.0.1",
39
39
  "copy-to-clipboard": "^3.3.1",
@@ -69,5 +69,5 @@
69
69
  "node": ">=10.0.0"
70
70
  },
71
71
  "license": "MIT",
72
- "gitHead": "9ee38fdd30280a63f2ddb0ed95a9e8e2dcf09ce3"
72
+ "gitHead": "f4d12b46c9bb1353d9f155a97cc1f59bd2764f2d"
73
73
  }