assui 3.1.54 → 3.1.56

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 assui
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -4,6 +4,7 @@ declare const Option: import("rc-select/lib/Option").OptionFC;
4
4
  export { Option };
5
5
  export interface LabelSelectProps extends SelectProps {
6
6
  label?: React.ReactNode;
7
+ onBlur?: (value: SelectProps['value']) => void;
7
8
  }
8
9
  declare const ForwardRefLabelSelect: React.ForwardRefExoticComponent<LabelSelectProps & React.RefAttributes<unknown>>;
9
10
  export default ForwardRefLabelSelect;
@@ -37,7 +37,9 @@ var __read = this && this.__read || function (o, n) {
37
37
  import React from 'react';
38
38
  import useControllableValue from "ahooks/es/useControllableValue";
39
39
  import Select from "antd/es/select";
40
- import { isUndefined, isNull } from 'lodash';
40
+ import isArray from 'lodash/isArray';
41
+ import isUndefined from 'lodash/isUndefined';
42
+ import isNull from 'lodash/isNull';
41
43
  import classNames from 'classnames';
42
44
  import ArrowDropDownFilled from "a-icons/es/ArrowDropDownFilled";
43
45
  import omit from 'lodash/omit';
@@ -74,7 +76,7 @@ var LabelSelect = function LabelSelect(props, ref) {
74
76
  return /*#__PURE__*/React.createElement("div", {
75
77
  className: classNames({
76
78
  'label-select': true,
77
- 'label-select-label-scale': open || !isUndefined(value) && !isNull(value)
79
+ 'label-select-label-scale': open || !isArray(value) && !isUndefined(value) && !isNull(value) || isArray(value) && value.length
78
80
  }, className)
79
81
  }, /*#__PURE__*/React.createElement(Select, __assign({
80
82
  maxTagCount: 3,
@@ -85,6 +87,10 @@ var LabelSelect = function LabelSelect(props, ref) {
85
87
  size: "large",
86
88
  className: "label-select-selector",
87
89
  onChange: handleChange,
90
+ onDeselect: function onDeselect() {
91
+ var _a;
92
+ (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
93
+ },
88
94
  onDropdownVisibleChange: onDropdownVisibleChange,
89
95
  suffixIcon: /*#__PURE__*/React.createElement(ArrowDropDownFilled, null)
90
96
  })), /*#__PURE__*/React.createElement("label", {
@@ -1,9 +1,6 @@
1
- /// <reference types="react" />
2
- import SplitPane, { SplitPaneProps, Size, Split, SplitPaneState, PaneProps, Pane } from 'react-split-pane';
3
- export { SplitPaneProps, Size, Split, SplitPaneState, PaneProps, Pane };
4
- export default SplitPane;
1
+ import React from 'react';
5
2
  /** 只做描述 */
6
- export declare type SplitPaneDescProps = {
3
+ export declare type SplitPaneProps = {
7
4
  /**
8
5
  * 是否允许拖动
9
6
  * @default true
@@ -56,4 +53,7 @@ export declare type SplitPaneDescProps = {
56
53
  resizerClassName?: string;
57
54
  /** 拖动固定步进值 */
58
55
  step?: number;
56
+ children: React.ReactNode;
59
57
  };
58
+ declare const SplitPane: React.FC<SplitPaneProps>;
59
+ export default SplitPane;
@@ -1,3 +1,18 @@
1
- import SplitPane, { Pane } from 'react-split-pane';
2
- export { Pane };
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
+ for (var p in s) {
6
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
7
+ }
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ import React from 'react';
14
+ import RcSplitPane from 'react-split-pane';
15
+ var SplitPane = function SplitPane(props) {
16
+ return /*#__PURE__*/React.createElement(RcSplitPane, __assign({}, props));
17
+ };
3
18
  export default SplitPane;
@@ -4,6 +4,7 @@ declare const Option: import("rc-select/lib/Option").OptionFC;
4
4
  export { Option };
5
5
  export interface LabelSelectProps extends SelectProps {
6
6
  label?: React.ReactNode;
7
+ onBlur?: (value: SelectProps['value']) => void;
7
8
  }
8
9
  declare const ForwardRefLabelSelect: React.ForwardRefExoticComponent<LabelSelectProps & React.RefAttributes<unknown>>;
9
10
  export default ForwardRefLabelSelect;
@@ -48,7 +48,9 @@ exports.Option = void 0;
48
48
  var react_1 = __importDefault(require("react"));
49
49
  var useControllableValue_1 = __importDefault(require("ahooks/lib/useControllableValue"));
50
50
  var select_1 = __importDefault(require("antd/lib/select"));
51
- var lodash_1 = require("lodash");
51
+ var isArray_1 = __importDefault(require("lodash/isArray"));
52
+ var isUndefined_1 = __importDefault(require("lodash/isUndefined"));
53
+ var isNull_1 = __importDefault(require("lodash/isNull"));
52
54
  var classnames_1 = __importDefault(require("classnames"));
53
55
  var ArrowDropDownFilled_1 = __importDefault(require("a-icons/lib/ArrowDropDownFilled"));
54
56
  var omit_1 = __importDefault(require("lodash/omit"));
@@ -85,7 +87,7 @@ var LabelSelect = function LabelSelect(props, ref) {
85
87
  return react_1["default"].createElement("div", {
86
88
  className: (0, classnames_1["default"])({
87
89
  'label-select': true,
88
- 'label-select-label-scale': open || !(0, lodash_1.isUndefined)(value) && !(0, lodash_1.isNull)(value)
90
+ 'label-select-label-scale': open || !(0, isArray_1["default"])(value) && !(0, isUndefined_1["default"])(value) && !(0, isNull_1["default"])(value) || (0, isArray_1["default"])(value) && value.length
89
91
  }, className)
90
92
  }, react_1["default"].createElement(select_1["default"], __assign({
91
93
  maxTagCount: 3,
@@ -96,6 +98,10 @@ var LabelSelect = function LabelSelect(props, ref) {
96
98
  size: "large",
97
99
  className: "label-select-selector",
98
100
  onChange: handleChange,
101
+ onDeselect: function onDeselect() {
102
+ var _a;
103
+ (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
104
+ },
99
105
  onDropdownVisibleChange: onDropdownVisibleChange,
100
106
  suffixIcon: react_1["default"].createElement(ArrowDropDownFilled_1["default"], null)
101
107
  })), react_1["default"].createElement("label", {
@@ -1,9 +1,6 @@
1
- /// <reference types="react" />
2
- import SplitPane, { SplitPaneProps, Size, Split, SplitPaneState, PaneProps, Pane } from 'react-split-pane';
3
- export { SplitPaneProps, Size, Split, SplitPaneState, PaneProps, Pane };
4
- export default SplitPane;
1
+ import React from 'react';
5
2
  /** 只做描述 */
6
- export declare type SplitPaneDescProps = {
3
+ export declare type SplitPaneProps = {
7
4
  /**
8
5
  * 是否允许拖动
9
6
  * @default true
@@ -56,4 +53,7 @@ export declare type SplitPaneDescProps = {
56
53
  resizerClassName?: string;
57
54
  /** 拖动固定步进值 */
58
55
  step?: number;
56
+ children: React.ReactNode;
59
57
  };
58
+ declare const SplitPane: React.FC<SplitPaneProps>;
59
+ export default SplitPane;
@@ -1,47 +1,28 @@
1
1
  "use strict";
2
2
 
3
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = {
8
- enumerable: true,
9
- get: function get() {
10
- return m[k];
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
+ for (var p in s) {
8
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
11
9
  }
12
- };
13
- }
14
- Object.defineProperty(o, k2, desc);
15
- } : function (o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- o[k2] = m[k];
18
- });
19
- var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
20
- Object.defineProperty(o, "default", {
21
- enumerable: true,
22
- value: v
23
- });
24
- } : function (o, v) {
25
- o["default"] = v;
26
- });
27
- var __importStar = this && this.__importStar || function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k in mod) {
31
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
32
- }
33
- __setModuleDefault(result, mod);
34
- return result;
10
+ }
11
+ return t;
12
+ };
13
+ return __assign.apply(this, arguments);
14
+ };
15
+ var __importDefault = this && this.__importDefault || function (mod) {
16
+ return mod && mod.__esModule ? mod : {
17
+ "default": mod
18
+ };
35
19
  };
36
20
  Object.defineProperty(exports, "__esModule", {
37
21
  value: true
38
22
  });
39
- exports.Pane = void 0;
40
- var react_split_pane_1 = __importStar(require("react-split-pane"));
41
- Object.defineProperty(exports, "Pane", {
42
- enumerable: true,
43
- get: function get() {
44
- return react_split_pane_1.Pane;
45
- }
46
- });
47
- exports["default"] = react_split_pane_1["default"];
23
+ var react_1 = __importDefault(require("react"));
24
+ var react_split_pane_1 = __importDefault(require("react-split-pane"));
25
+ var SplitPane = function SplitPane(props) {
26
+ return react_1["default"].createElement(react_split_pane_1["default"], __assign({}, props));
27
+ };
28
+ exports["default"] = SplitPane;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "3.1.54",
3
+ "version": "3.1.56",
4
4
  "description": "react ui library",
5
5
  "author": "jason <usochen@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -79,5 +79,6 @@
79
79
  "engines": {
80
80
  "node": ">=10.0.0"
81
81
  },
82
- "license": "MIT"
82
+ "license": "MIT",
83
+ "gitHead": "98bbe97e5631319765af90865680730898aee668"
83
84
  }