assui 2.0.82 → 2.0.86

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 (53) hide show
  1. package/es/copy-to-clipboard/index.d.ts +1 -1
  2. package/es/index.d.ts +8 -0
  3. package/es/index.js +4 -0
  4. package/es/label-date-picker/index.d.ts +7 -0
  5. package/es/label-date-picker/index.js +107 -0
  6. package/es/label-date-picker/style/index.css +44 -0
  7. package/es/label-date-picker/style/index.d.ts +2 -0
  8. package/es/label-date-picker/style/index.js +2 -0
  9. package/es/label-date-picker/style/index.less +53 -0
  10. package/es/label-desc-item/index.d.ts +3 -3
  11. package/es/label-desc-item/index.js +2 -2
  12. package/es/label-range-picker/index.d.ts +7 -0
  13. package/es/label-range-picker/index.js +111 -0
  14. package/es/label-range-picker/style/index.css +61 -0
  15. package/es/label-range-picker/style/index.d.ts +2 -0
  16. package/es/label-range-picker/style/index.js +2 -0
  17. package/es/label-range-picker/style/index.less +74 -0
  18. package/es/label-select/index.js +1 -1
  19. package/es/label-select/style/index.css +1 -0
  20. package/es/label-select/style/index.less +9 -8
  21. package/es/label-text-area/index.d.ts +20 -1
  22. package/es/label-text-area/index.js +95 -2
  23. package/es/label-text-area/style/index.css +44 -0
  24. package/es/label-text-area/style/index.d.ts +1 -1
  25. package/es/label-text-area/style/index.js +1 -0
  26. package/es/label-text-area/style/index.less +59 -0
  27. package/lib/copy-to-clipboard/index.d.ts +1 -1
  28. package/lib/index.d.ts +8 -0
  29. package/lib/index.js +36 -0
  30. package/lib/label-date-picker/index.d.ts +7 -0
  31. package/lib/label-date-picker/index.js +123 -0
  32. package/lib/label-date-picker/style/index.css +44 -0
  33. package/lib/label-date-picker/style/index.d.ts +2 -0
  34. package/lib/label-date-picker/style/index.js +9 -0
  35. package/lib/label-date-picker/style/index.less +53 -0
  36. package/lib/label-desc-item/index.d.ts +3 -3
  37. package/lib/label-desc-item/index.js +2 -2
  38. package/lib/label-range-picker/index.d.ts +7 -0
  39. package/lib/label-range-picker/index.js +128 -0
  40. package/lib/label-range-picker/style/index.css +61 -0
  41. package/lib/label-range-picker/style/index.d.ts +2 -0
  42. package/lib/label-range-picker/style/index.js +9 -0
  43. package/lib/label-range-picker/style/index.less +74 -0
  44. package/lib/label-select/index.js +3 -3
  45. package/lib/label-select/style/index.css +1 -0
  46. package/lib/label-select/style/index.less +9 -8
  47. package/lib/label-text-area/index.d.ts +20 -1
  48. package/lib/label-text-area/index.js +98 -2
  49. package/lib/label-text-area/style/index.css +44 -0
  50. package/lib/label-text-area/style/index.d.ts +1 -1
  51. package/lib/label-text-area/style/index.js +7 -0
  52. package/lib/label-text-area/style/index.less +59 -0
  53. package/package.json +3 -3
@@ -0,0 +1,61 @@
1
+ /* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
2
+ /* stylelint-disable no-duplicate-selectors */
3
+ /* stylelint-disable */
4
+ /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
5
+ .label-range-picker {
6
+ position: relative;
7
+ height: 100%;
8
+ }
9
+ .label-range-picker .ant-picker {
10
+ height: 52px;
11
+ border: 1px solid #e5e5e5;
12
+ border-radius: 12px;
13
+ outline: none;
14
+ }
15
+ .label-range-picker .ant-picker-input input {
16
+ width: 85px;
17
+ padding-top: 16px;
18
+ padding-left: 4px;
19
+ }
20
+ .label-range-picker .ant-picker-focused {
21
+ border-color: #ff6b00;
22
+ box-shadow: none;
23
+ }
24
+ .label-range-picker .ant-picker-range-separator {
25
+ position: relative;
26
+ top: 8px;
27
+ padding: 0;
28
+ }
29
+ .label-range-picker .ant-picker-range-separator,
30
+ .label-range-picker .ant-picker-input {
31
+ opacity: 0;
32
+ }
33
+ .label-range-picker .ant-picker-active-bar {
34
+ display: none;
35
+ }
36
+ .label-range-picker .ant-picker-suffix .spotecicon {
37
+ width: 14px;
38
+ color: #323232;
39
+ }
40
+ .label-range-picker-text {
41
+ position: absolute;
42
+ top: 18px;
43
+ left: 16px;
44
+ z-index: 2;
45
+ height: 20px;
46
+ color: #9aa5b5;
47
+ font-size: 14px;
48
+ line-height: 20px;
49
+ transform-origin: top left;
50
+ cursor: pointer;
51
+ transition: all 0.2s ease-out;
52
+ }
53
+ .label-range-picker-label-scale .ant-picker-range-separator,
54
+ .label-range-picker-label-scale .ant-picker-input {
55
+ opacity: 1;
56
+ }
57
+ .label-range-picker-label-scale .label-range-picker-text {
58
+ transform: translateY(-11px) scale(0.86);
59
+ cursor: text;
60
+ pointer-events: none;
61
+ }
@@ -0,0 +1,2 @@
1
+ import 'antd/es/date-picker/style';
2
+ import './index.less';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ require("antd/es/date-picker/style");
8
+
9
+ require("./index.less");
@@ -0,0 +1,74 @@
1
+ @import '~antd/es/style/themes/index';
2
+
3
+ @color_9aa5b5: #9aa5b5;
4
+ @font-size-base: 14px;
5
+
6
+ .label-range-picker {
7
+ position: relative;
8
+ height: 100%;
9
+
10
+ .@{ant-prefix}-picker {
11
+ height: 52px;
12
+ border: 1px solid #e5e5e5;
13
+ border-radius: 12px;
14
+ outline: none;
15
+
16
+ &-input input {
17
+ width: 85px;
18
+ padding-top: 16px;
19
+ padding-left: 4px;
20
+ }
21
+
22
+ &-focused {
23
+ border-color: #ff6b00;
24
+ box-shadow: none;
25
+ }
26
+
27
+ &-range-separator {
28
+ position: relative;
29
+ top: 8px;
30
+ padding: 0;
31
+ }
32
+
33
+ &-range-separator,
34
+ &-input {
35
+ opacity: 0;
36
+ }
37
+
38
+ &-active-bar {
39
+ display: none;
40
+ }
41
+
42
+ &-suffix .spotecicon {
43
+ width: 14px;
44
+ color: #323232;
45
+ }
46
+ }
47
+
48
+ &-text {
49
+ position: absolute;
50
+ top: 18px;
51
+ left: 16px;
52
+ z-index: 2;
53
+ height: 20px;
54
+ color: @color_9aa5b5;
55
+ font-size: @font-size-base;
56
+ line-height: 20px;
57
+ transform-origin: top left;
58
+ cursor: pointer;
59
+ transition: all 0.2s ease-out;
60
+ }
61
+
62
+ &-label-scale {
63
+ .@{ant-prefix}-picker-range-separator,
64
+ .@{ant-prefix}-picker-input {
65
+ opacity: 1;
66
+ }
67
+
68
+ .label-range-picker-text {
69
+ transform: translateY(-11px) scale(0.86);
70
+ cursor: text;
71
+ pointer-events: none;
72
+ }
73
+ }
74
+ }
@@ -56,7 +56,7 @@ exports.Option = void 0;
56
56
 
57
57
  var react_1 = __importDefault(require("react"));
58
58
 
59
- var ahooks_1 = require("ahooks");
59
+ var useControllableValue_1 = __importDefault(require("ahooks/lib/useControllableValue"));
60
60
 
61
61
  var select_1 = __importDefault(require("antd/es/select"));
62
62
 
@@ -74,14 +74,14 @@ var LabelSelect = function LabelSelect(props) {
74
74
  label = props.label;
75
75
  var selectRef = react_1["default"].useRef(null);
76
76
 
77
- var _a = __read(ahooks_1.useControllableValue(props, {
77
+ var _a = __read(useControllableValue_1["default"](props, {
78
78
  valuePropName: 'open',
79
79
  trigger: 'setOpen'
80
80
  }), 2),
81
81
  open = _a[0],
82
82
  setOpen = _a[1];
83
83
 
84
- var _b = __read(ahooks_1.useControllableValue(props), 2),
84
+ var _b = __read(useControllableValue_1["default"](props), 2),
85
85
  value = _b[0],
86
86
  setValue = _b[1];
87
87
 
@@ -1,3 +1,4 @@
1
+ /* stylelint-disable indentation */
1
2
  /* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
2
3
  /* stylelint-disable no-duplicate-selectors */
3
4
  /* stylelint-disable */
@@ -1,3 +1,4 @@
1
+ /* stylelint-disable indentation */
1
2
  @import '~antd/es/style/themes/index';
2
3
 
3
4
  @color_9aa5b5: #9aa5b5;
@@ -8,33 +9,33 @@
8
9
  width: 100%;
9
10
  height: 100%;
10
11
 
11
- .ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector {
12
+ .@{ant-prefix}-select-single.@{ant-prefix}-select-lg:not(.@{ant-prefix}-select-customize-input)
13
+ .@{ant-prefix}-select-selector {
12
14
  height: 52px;
13
15
  border: 1px solid #e5e5e5;
14
16
  border-radius: 12px;
15
17
  outline: none;
16
18
  }
17
19
 
18
- .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input)
19
- .ant-select-selector {
20
+ .@{ant-prefix}-select-focused:not(.@{ant-prefix}-select-disabled).@{ant-prefix}-select:not(.@{ant-prefix}-select-customize-input)
21
+ .@{ant-prefix}-select-selector {
20
22
  border-color: #ff6b00;
21
23
  box-shadow: none;
22
24
  }
23
25
 
24
- .ant-select-single.ant-select-show-arrow .ant-select-selection-item {
26
+ .@{ant-prefix}-select-single.@{ant-prefix}-select-show-arrow
27
+ .@{ant-prefix}-select-selection-item {
25
28
  padding-top: 14px;
26
29
  padding-left: 4px;
27
30
  }
28
31
 
29
- .ant-select-selection-search {
32
+ .@{ant-prefix}-select-selection-search {
30
33
  padding-top: 14px;
31
34
  padding-left: 2px;
32
35
  }
33
36
 
34
- .ant-select-arrow {
37
+ .@{ant-prefix}-select-arrow {
35
38
  top: 44%;
36
- // position: relative;
37
- // top: -2px;
38
39
  width: 22px;
39
40
  height: 22px;
40
41
  color: #7d7d7d;
@@ -1,2 +1,21 @@
1
- declare const LabelTextArea: () => JSX.Element;
1
+ import React from 'react';
2
+ export interface LabelTextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size' | 'type' | 'onChange' | 'onFocus' | 'onBlur'> {
3
+ /** 自定义class */
4
+ className?: string;
5
+ /** label 标签的文本 */
6
+ label?: React.ReactNode;
7
+ /** 输入框内容 */
8
+ value?: string;
9
+ /** 指定输入框展示值的格式 */
10
+ formatter?: (value: string) => string;
11
+ /** 输入框内容变化时的回调 */
12
+ onChange?: (value: string) => void;
13
+ /** 输入框失去焦点的回调 */
14
+ onBlur?: (value: string) => void;
15
+ /** 输入框获取焦点的回调 */
16
+ onFocus?: (value: string) => void;
17
+ /** 组件dom id */
18
+ id?: string;
19
+ }
20
+ declare const LabelTextArea: React.FC<LabelTextAreaProps>;
2
21
  export default LabelTextArea;
@@ -1,5 +1,32 @@
1
1
  "use strict";
2
2
 
3
+ var __read = this && this.__read || function (o, n) {
4
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
5
+ if (!m) return o;
6
+ var i = m.call(o),
7
+ r,
8
+ ar = [],
9
+ e;
10
+
11
+ try {
12
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
13
+ ar.push(r.value);
14
+ }
15
+ } catch (error) {
16
+ e = {
17
+ error: error
18
+ };
19
+ } finally {
20
+ try {
21
+ if (r && !r.done && (m = i["return"])) m.call(i);
22
+ } finally {
23
+ if (e) throw e.error;
24
+ }
25
+ }
26
+
27
+ return ar;
28
+ };
29
+
3
30
  var __importDefault = this && this.__importDefault || function (mod) {
4
31
  return mod && mod.__esModule ? mod : {
5
32
  "default": mod
@@ -12,8 +39,77 @@ Object.defineProperty(exports, "__esModule", {
12
39
 
13
40
  var react_1 = __importDefault(require("react"));
14
41
 
15
- var LabelTextArea = function LabelTextArea() {
16
- return react_1["default"].createElement("div", null, react_1["default"].createElement("textarea", null));
42
+ var classnames_1 = __importDefault(require("classnames"));
43
+
44
+ var ahooks_1 = require("ahooks");
45
+
46
+ var lodash_1 = require("lodash");
47
+
48
+ var LabelTextArea = function LabelTextArea(props) {
49
+ var className = props.className,
50
+ label = props.label,
51
+ id = props.id,
52
+ formatter = props.formatter,
53
+ onFocus = props.onFocus,
54
+ onBlur = props.onBlur;
55
+
56
+ var _a = __read(react_1["default"].useState(false), 2),
57
+ focused = _a[0],
58
+ setFocused = _a[1];
59
+
60
+ var _b = __read(ahooks_1.useControllableValue(props), 2),
61
+ value = _b[0],
62
+ setValue = _b[1];
63
+
64
+ var TextAreaDomRef = react_1["default"].useRef(null);
65
+
66
+ var handleFocus = function handleFocus() {
67
+ setFocused(true);
68
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(value);
69
+ };
70
+
71
+ var handleBlur = function handleBlur() {
72
+ setFocused(false);
73
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(value);
74
+ };
75
+
76
+ var handleLabelClick = function handleLabelClick() {
77
+ var _a;
78
+
79
+ (_a = TextAreaDomRef.current) === null || _a === void 0 ? void 0 : _a.focus();
80
+ };
81
+
82
+ var handleChange = function handleChange(e) {
83
+ var finallyValue = lodash_1.trimStart(e.target.value);
84
+
85
+ if (formatter) {
86
+ finallyValue = formatter(finallyValue);
87
+ }
88
+
89
+ setValue(finallyValue);
90
+ };
91
+
92
+ return react_1["default"].createElement("div", {
93
+ className: classnames_1["default"]('label-input-control', className),
94
+ id: id
95
+ }, react_1["default"].createElement("div", {
96
+ className: classnames_1["default"]('label-textarea-warper', {
97
+ 'textarea-warper-focused': focused
98
+ }),
99
+ onClick: handleLabelClick
100
+ }, react_1["default"].createElement("textarea", {
101
+ ref: function ref(el) {
102
+ return TextAreaDomRef.current = el;
103
+ },
104
+ "data-value": value ? value.length : 0,
105
+ className: "label-textarea",
106
+ value: value,
107
+ onFocus: handleFocus,
108
+ onChange: handleChange,
109
+ onBlur: handleBlur
110
+ }), react_1["default"].createElement("label", {
111
+ className: "label-textarea-text"
112
+ }, label)));
17
113
  };
18
114
 
19
115
  exports["default"] = LabelTextArea;
@@ -0,0 +1,44 @@
1
+ .label-textarea {
2
+ z-index: 1;
3
+ width: 100%;
4
+ height: 100%;
5
+ min-height: 28px;
6
+ margin-bottom: -4px;
7
+ padding: 0 15px 0 15px;
8
+ color: #263241;
9
+ font-size: 16px;
10
+ border: 0;
11
+ border-radius: 12px;
12
+ outline: 0;
13
+ transition: border 0.3s;
14
+ }
15
+ .label-textarea:focus + label,
16
+ .label-textarea:not([data-value='0']) + label {
17
+ transform: translateY(-10px) scale(0.86);
18
+ }
19
+ .label-textarea-warper {
20
+ position: relative;
21
+ width: 100%;
22
+ height: 100%;
23
+ padding-top: 24px;
24
+ border: 1px solid #e5e5e5;
25
+ border-radius: 12px;
26
+ outline: 0;
27
+ cursor: text;
28
+ }
29
+ .label-textarea-text {
30
+ position: absolute;
31
+ top: 16px;
32
+ left: 16px;
33
+ z-index: 2;
34
+ height: 20px;
35
+ color: #9aa5b5;
36
+ font-size: 14px;
37
+ line-height: 20px;
38
+ transform-origin: top left;
39
+ cursor: text;
40
+ transition: all 0.2s ease-out;
41
+ }
42
+ .textarea-warper-focused {
43
+ border-color: #ff6b00;
44
+ }
@@ -1 +1 @@
1
-
1
+ import './index.less';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ require("./index.less");
@@ -0,0 +1,59 @@
1
+ @primary-color: #ff6b00;
2
+ @color_dfe2e7: #dfe2e7;
3
+ @color_9aa5b5: #9aa5b5;
4
+ @color_b3b3b3: #b3b3b3;
5
+ @color_e5e5e5: #e5e5e5;
6
+
7
+ @font-size-base: 14px;
8
+ @font-size-lg: @font-size-base + 2px;
9
+
10
+ @font-weight-500: 500;
11
+
12
+ .label-textarea {
13
+ z-index: 1;
14
+ width: 100%;
15
+ height: 100%;
16
+ min-height: 28px;
17
+ margin-bottom: -4px;
18
+ padding: 0 15px 0 15px;
19
+ color: #263241;
20
+ font-size: @font-size-lg;
21
+ border: 0;
22
+ border-radius: 12px;
23
+ outline: 0;
24
+ transition: border 0.3s;
25
+
26
+ &:focus + label,
27
+ &:not([data-value='0']) + label {
28
+ transform: translateY(-10px) scale(0.86);
29
+ }
30
+
31
+ &-warper {
32
+ position: relative;
33
+ width: 100%;
34
+ height: 100%;
35
+ padding-top: 24px;
36
+ border: 1px solid @color_e5e5e5;
37
+ border-radius: 12px;
38
+ outline: 0;
39
+ cursor: text;
40
+ }
41
+
42
+ &-text {
43
+ position: absolute;
44
+ top: 16px;
45
+ left: 16px;
46
+ z-index: 2;
47
+ height: 20px;
48
+ color: @color_9aa5b5;
49
+ font-size: @font-size-base;
50
+ line-height: 20px;
51
+ transform-origin: top left;
52
+ cursor: text;
53
+ transition: all 0.2s ease-out;
54
+ }
55
+ }
56
+
57
+ .textarea-warper-focused {
58
+ border-color: @primary-color;
59
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "2.0.82",
3
+ "version": "2.0.86",
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.44",
36
+ "a-icons": "^1.0.47",
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": "29449b7d1c74e1e8b9e32f38ac5a57aba3119418"
72
+ "gitHead": "0211aa5444d6112bace74e4dcc90a3917bfb46c6"
73
73
  }