assui 2.0.103 → 2.0.104

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.
@@ -46,7 +46,7 @@ import useControllableValue from 'ahooks/lib/useControllableValue';
46
46
  import Select from 'antd/es/select';
47
47
  import classNames from 'classnames';
48
48
  import ArrowDropDownFilled from 'a-icons/lib/ArrowDropDownFilled';
49
- import { omit } from 'lodash';
49
+ import omit from 'lodash/omit';
50
50
  var Option = Select.Option;
51
51
  export { Option };
52
52
 
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { TreeSelectProps } from 'antd/es/tree-select';
3
+ export interface LabelSelectProps extends TreeSelectProps<string> {
4
+ label: React.ReactNode;
5
+ }
6
+ declare const LabelSelect: {
7
+ (props: LabelSelectProps): JSX.Element;
8
+ Option: new (text?: string | undefined, value?: string | undefined, defaultSelected?: boolean | undefined, selected?: boolean | undefined) => HTMLOptionElement;
9
+ };
10
+ export default LabelSelect;
@@ -0,0 +1,103 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+
6
+ for (var p in s) {
7
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
+ }
9
+ }
10
+
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ };
16
+
17
+ var __read = this && this.__read || function (o, n) {
18
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
19
+ if (!m) return o;
20
+ var i = m.call(o),
21
+ r,
22
+ ar = [],
23
+ e;
24
+
25
+ try {
26
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
27
+ ar.push(r.value);
28
+ }
29
+ } catch (error) {
30
+ e = {
31
+ error: error
32
+ };
33
+ } finally {
34
+ try {
35
+ if (r && !r.done && (m = i["return"])) m.call(i);
36
+ } finally {
37
+ if (e) throw e.error;
38
+ }
39
+ }
40
+
41
+ return ar;
42
+ };
43
+
44
+ import React from 'react';
45
+ import useControllableValue from 'ahooks/lib/useControllableValue';
46
+ import TreeSelect from 'antd/es/tree-select';
47
+ import classNames from 'classnames';
48
+ import omit from 'lodash/omit';
49
+
50
+ var LabelSelect = function LabelSelect(props) {
51
+ var className = props.className,
52
+ label = props.label;
53
+ var selectRef = React.useRef(null);
54
+
55
+ var _a = __read(useControllableValue(props, {
56
+ valuePropName: 'open',
57
+ trigger: 'setOpen'
58
+ }), 2),
59
+ open = _a[0],
60
+ setOpen = _a[1];
61
+
62
+ var _b = __read(useControllableValue(props), 2),
63
+ value = _b[0],
64
+ setValue = _b[1];
65
+
66
+ var handleChange = function handleChange(nextValue) {
67
+ setValue(nextValue);
68
+ };
69
+
70
+ var handleLabelClick = function handleLabelClick() {
71
+ var _a;
72
+
73
+ if (!open) {
74
+ setOpen(!open);
75
+ }
76
+
77
+ (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
78
+ };
79
+
80
+ var onDropdownVisibleChange = function onDropdownVisibleChange(nextOpen) {
81
+ setOpen(nextOpen);
82
+ };
83
+
84
+ return /*#__PURE__*/React.createElement("div", {
85
+ className: classNames({
86
+ 'label-select': true,
87
+ 'label-select-label-scale': open || value
88
+ }, className)
89
+ }, /*#__PURE__*/React.createElement(TreeSelect, __assign({}, omit(props, ['open', 'onChange', 'className', 'label']), {
90
+ open: open,
91
+ ref: selectRef,
92
+ size: "large",
93
+ className: "label-select-selector",
94
+ onChange: handleChange,
95
+ onDropdownVisibleChange: onDropdownVisibleChange
96
+ })), /*#__PURE__*/React.createElement("label", {
97
+ className: "label-select-text",
98
+ onClick: handleLabelClick
99
+ }, label));
100
+ };
101
+
102
+ export default LabelSelect;
103
+ LabelSelect.Option = Option;
@@ -0,0 +1,56 @@
1
+ /* stylelint-disable indentation */
2
+ /* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
3
+ /* stylelint-disable no-duplicate-selectors */
4
+ /* stylelint-disable */
5
+ /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
6
+ .label-select {
7
+ position: relative;
8
+ width: 100%;
9
+ height: 100%;
10
+ }
11
+ .label-select .ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector {
12
+ height: 52px;
13
+ border: 1px solid #e5e5e5;
14
+ border-radius: 12px;
15
+ outline: none;
16
+ }
17
+ .label-select .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector {
18
+ border-color: #ff6b00;
19
+ box-shadow: none;
20
+ }
21
+ .label-select .ant-select-single.ant-select-show-arrow .ant-select-selection-item {
22
+ padding-top: 14px;
23
+ padding-left: 4px;
24
+ }
25
+ .label-select .ant-select-selection-search {
26
+ padding-top: 14px;
27
+ padding-left: 2px;
28
+ }
29
+ .label-select .ant-select-arrow {
30
+ top: 44%;
31
+ width: 22px;
32
+ height: 22px;
33
+ color: #7d7d7d;
34
+ }
35
+ .label-select .ant-select-arrow .spotecicon {
36
+ width: 22px;
37
+ height: 22px;
38
+ }
39
+ .label-select-text {
40
+ position: absolute;
41
+ top: 18px;
42
+ left: 16px;
43
+ z-index: 2;
44
+ height: 20px;
45
+ color: #9aa5b5;
46
+ font-size: 14px;
47
+ line-height: 20px;
48
+ transform-origin: top left;
49
+ cursor: pointer;
50
+ transition: all 0.2s ease-out;
51
+ }
52
+ .label-select-label-scale .label-select-text {
53
+ transform: translateY(-10px) scale(0.86);
54
+ cursor: text;
55
+ pointer-events: none;
56
+ }
@@ -0,0 +1,2 @@
1
+ import 'antd/es/select/style';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import 'antd/es/select/style';
2
+ import './index.less';
@@ -0,0 +1,70 @@
1
+ /* stylelint-disable indentation */
2
+ @import '~antd/es/style/themes/index';
3
+
4
+ @color_9aa5b5: #9aa5b5;
5
+ @font-size-base: 14px;
6
+
7
+ .label-select {
8
+ position: relative;
9
+ width: 100%;
10
+ height: 100%;
11
+
12
+ .@{ant-prefix}-select-single.@{ant-prefix}-select-lg:not(.@{ant-prefix}-select-customize-input)
13
+ .@{ant-prefix}-select-selector {
14
+ height: 52px;
15
+ border: 1px solid #e5e5e5;
16
+ border-radius: 12px;
17
+ outline: none;
18
+ }
19
+
20
+ .@{ant-prefix}-select-focused:not(.@{ant-prefix}-select-disabled).@{ant-prefix}-select:not(.@{ant-prefix}-select-customize-input)
21
+ .@{ant-prefix}-select-selector {
22
+ border-color: #ff6b00;
23
+ box-shadow: none;
24
+ }
25
+
26
+ .@{ant-prefix}-select-single.@{ant-prefix}-select-show-arrow
27
+ .@{ant-prefix}-select-selection-item {
28
+ padding-top: 14px;
29
+ padding-left: 4px;
30
+ }
31
+
32
+ .@{ant-prefix}-select-selection-search {
33
+ padding-top: 14px;
34
+ padding-left: 2px;
35
+ }
36
+
37
+ .@{ant-prefix}-select-arrow {
38
+ top: 44%;
39
+ width: 22px;
40
+ height: 22px;
41
+ color: #7d7d7d;
42
+
43
+ .spotecicon {
44
+ width: 22px;
45
+ height: 22px;
46
+ }
47
+ }
48
+
49
+ &-text {
50
+ position: absolute;
51
+ top: 18px;
52
+ left: 16px;
53
+ z-index: 2;
54
+ height: 20px;
55
+ color: @color_9aa5b5;
56
+ font-size: @font-size-base;
57
+ line-height: 20px;
58
+ transform-origin: top left;
59
+ cursor: pointer;
60
+ transition: all 0.2s ease-out;
61
+ }
62
+
63
+ &-label-scale {
64
+ .label-select-text {
65
+ transform: translateY(-10px) scale(0.86);
66
+ cursor: text;
67
+ pointer-events: none;
68
+ }
69
+ }
70
+ }
@@ -64,7 +64,7 @@ var classnames_1 = __importDefault(require("classnames"));
64
64
 
65
65
  var ArrowDropDownFilled_1 = __importDefault(require("a-icons/lib/ArrowDropDownFilled"));
66
66
 
67
- var lodash_1 = require("lodash");
67
+ var omit_1 = __importDefault(require("lodash/omit"));
68
68
 
69
69
  var Option = select_1["default"].Option;
70
70
  exports.Option = Option;
@@ -108,7 +108,7 @@ var LabelSelect = function LabelSelect(props) {
108
108
  'label-select': true,
109
109
  'label-select-label-scale': open || value
110
110
  }, className)
111
- }, react_1["default"].createElement(select_1["default"], __assign({}, lodash_1.omit(props, ['open', 'onChange', 'className', 'label']), {
111
+ }, react_1["default"].createElement(select_1["default"], __assign({}, omit_1["default"](props, ['open', 'onChange', 'className', 'label']), {
112
112
  open: open,
113
113
  ref: selectRef,
114
114
  size: "large",
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { TreeSelectProps } from 'antd/es/tree-select';
3
+ export interface LabelSelectProps extends TreeSelectProps<string> {
4
+ label: React.ReactNode;
5
+ }
6
+ declare const LabelSelect: {
7
+ (props: LabelSelectProps): JSX.Element;
8
+ Option: new (text?: string | undefined, value?: string | undefined, defaultSelected?: boolean | undefined, selected?: boolean | undefined) => HTMLOptionElement;
9
+ };
10
+ export default LabelSelect;
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+
3
+ var __assign = this && this.__assign || function () {
4
+ __assign = Object.assign || function (t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+
8
+ for (var p in s) {
9
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
10
+ }
11
+ }
12
+
13
+ return t;
14
+ };
15
+
16
+ return __assign.apply(this, arguments);
17
+ };
18
+
19
+ var __read = this && this.__read || function (o, n) {
20
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
21
+ if (!m) return o;
22
+ var i = m.call(o),
23
+ r,
24
+ ar = [],
25
+ e;
26
+
27
+ try {
28
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
29
+ ar.push(r.value);
30
+ }
31
+ } catch (error) {
32
+ e = {
33
+ error: error
34
+ };
35
+ } finally {
36
+ try {
37
+ if (r && !r.done && (m = i["return"])) m.call(i);
38
+ } finally {
39
+ if (e) throw e.error;
40
+ }
41
+ }
42
+
43
+ return ar;
44
+ };
45
+
46
+ var __importDefault = this && this.__importDefault || function (mod) {
47
+ return mod && mod.__esModule ? mod : {
48
+ "default": mod
49
+ };
50
+ };
51
+
52
+ Object.defineProperty(exports, "__esModule", {
53
+ value: true
54
+ });
55
+
56
+ var react_1 = __importDefault(require("react"));
57
+
58
+ var useControllableValue_1 = __importDefault(require("ahooks/lib/useControllableValue"));
59
+
60
+ var tree_select_1 = __importDefault(require("antd/es/tree-select"));
61
+
62
+ var classnames_1 = __importDefault(require("classnames"));
63
+
64
+ var omit_1 = __importDefault(require("lodash/omit"));
65
+
66
+ var LabelSelect = function LabelSelect(props) {
67
+ var className = props.className,
68
+ label = props.label;
69
+ var selectRef = react_1["default"].useRef(null);
70
+
71
+ var _a = __read(useControllableValue_1["default"](props, {
72
+ valuePropName: 'open',
73
+ trigger: 'setOpen'
74
+ }), 2),
75
+ open = _a[0],
76
+ setOpen = _a[1];
77
+
78
+ var _b = __read(useControllableValue_1["default"](props), 2),
79
+ value = _b[0],
80
+ setValue = _b[1];
81
+
82
+ var handleChange = function handleChange(nextValue) {
83
+ setValue(nextValue);
84
+ };
85
+
86
+ var handleLabelClick = function handleLabelClick() {
87
+ var _a;
88
+
89
+ if (!open) {
90
+ setOpen(!open);
91
+ }
92
+
93
+ (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
94
+ };
95
+
96
+ var onDropdownVisibleChange = function onDropdownVisibleChange(nextOpen) {
97
+ setOpen(nextOpen);
98
+ };
99
+
100
+ return react_1["default"].createElement("div", {
101
+ className: classnames_1["default"]({
102
+ 'label-select': true,
103
+ 'label-select-label-scale': open || value
104
+ }, className)
105
+ }, react_1["default"].createElement(tree_select_1["default"], __assign({}, omit_1["default"](props, ['open', 'onChange', 'className', 'label']), {
106
+ open: open,
107
+ ref: selectRef,
108
+ size: "large",
109
+ className: "label-select-selector",
110
+ onChange: handleChange,
111
+ onDropdownVisibleChange: onDropdownVisibleChange
112
+ })), react_1["default"].createElement("label", {
113
+ className: "label-select-text",
114
+ onClick: handleLabelClick
115
+ }, label));
116
+ };
117
+
118
+ exports["default"] = LabelSelect;
119
+ LabelSelect.Option = Option;
@@ -0,0 +1,56 @@
1
+ /* stylelint-disable indentation */
2
+ /* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
3
+ /* stylelint-disable no-duplicate-selectors */
4
+ /* stylelint-disable */
5
+ /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
6
+ .label-select {
7
+ position: relative;
8
+ width: 100%;
9
+ height: 100%;
10
+ }
11
+ .label-select .ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector {
12
+ height: 52px;
13
+ border: 1px solid #e5e5e5;
14
+ border-radius: 12px;
15
+ outline: none;
16
+ }
17
+ .label-select .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector {
18
+ border-color: #ff6b00;
19
+ box-shadow: none;
20
+ }
21
+ .label-select .ant-select-single.ant-select-show-arrow .ant-select-selection-item {
22
+ padding-top: 14px;
23
+ padding-left: 4px;
24
+ }
25
+ .label-select .ant-select-selection-search {
26
+ padding-top: 14px;
27
+ padding-left: 2px;
28
+ }
29
+ .label-select .ant-select-arrow {
30
+ top: 44%;
31
+ width: 22px;
32
+ height: 22px;
33
+ color: #7d7d7d;
34
+ }
35
+ .label-select .ant-select-arrow .spotecicon {
36
+ width: 22px;
37
+ height: 22px;
38
+ }
39
+ .label-select-text {
40
+ position: absolute;
41
+ top: 18px;
42
+ left: 16px;
43
+ z-index: 2;
44
+ height: 20px;
45
+ color: #9aa5b5;
46
+ font-size: 14px;
47
+ line-height: 20px;
48
+ transform-origin: top left;
49
+ cursor: pointer;
50
+ transition: all 0.2s ease-out;
51
+ }
52
+ .label-select-label-scale .label-select-text {
53
+ transform: translateY(-10px) scale(0.86);
54
+ cursor: text;
55
+ pointer-events: none;
56
+ }
@@ -0,0 +1,2 @@
1
+ import 'antd/es/select/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/select/style");
8
+
9
+ require("./index.less");
@@ -0,0 +1,70 @@
1
+ /* stylelint-disable indentation */
2
+ @import '~antd/es/style/themes/index';
3
+
4
+ @color_9aa5b5: #9aa5b5;
5
+ @font-size-base: 14px;
6
+
7
+ .label-select {
8
+ position: relative;
9
+ width: 100%;
10
+ height: 100%;
11
+
12
+ .@{ant-prefix}-select-single.@{ant-prefix}-select-lg:not(.@{ant-prefix}-select-customize-input)
13
+ .@{ant-prefix}-select-selector {
14
+ height: 52px;
15
+ border: 1px solid #e5e5e5;
16
+ border-radius: 12px;
17
+ outline: none;
18
+ }
19
+
20
+ .@{ant-prefix}-select-focused:not(.@{ant-prefix}-select-disabled).@{ant-prefix}-select:not(.@{ant-prefix}-select-customize-input)
21
+ .@{ant-prefix}-select-selector {
22
+ border-color: #ff6b00;
23
+ box-shadow: none;
24
+ }
25
+
26
+ .@{ant-prefix}-select-single.@{ant-prefix}-select-show-arrow
27
+ .@{ant-prefix}-select-selection-item {
28
+ padding-top: 14px;
29
+ padding-left: 4px;
30
+ }
31
+
32
+ .@{ant-prefix}-select-selection-search {
33
+ padding-top: 14px;
34
+ padding-left: 2px;
35
+ }
36
+
37
+ .@{ant-prefix}-select-arrow {
38
+ top: 44%;
39
+ width: 22px;
40
+ height: 22px;
41
+ color: #7d7d7d;
42
+
43
+ .spotecicon {
44
+ width: 22px;
45
+ height: 22px;
46
+ }
47
+ }
48
+
49
+ &-text {
50
+ position: absolute;
51
+ top: 18px;
52
+ left: 16px;
53
+ z-index: 2;
54
+ height: 20px;
55
+ color: @color_9aa5b5;
56
+ font-size: @font-size-base;
57
+ line-height: 20px;
58
+ transform-origin: top left;
59
+ cursor: pointer;
60
+ transition: all 0.2s ease-out;
61
+ }
62
+
63
+ &-label-scale {
64
+ .label-select-text {
65
+ transform: translateY(-10px) scale(0.86);
66
+ cursor: text;
67
+ pointer-events: none;
68
+ }
69
+ }
70
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "2.0.103",
3
+ "version": "2.0.104",
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.53",
36
+ "a-icons": "^1.0.54",
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": "ab500961aaa3150c3f63455bf44e5e1e877dd407"
72
+ "gitHead": "1ff7b7b77d0e7f6e6f2cae223067ec1de498e5ef"
73
73
  }