assui 2.0.78 → 2.0.82

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 (61) hide show
  1. package/es/index.d.ts +3 -1
  2. package/es/index.js +1 -0
  3. package/es/keep-tab/index.js +1 -3
  4. package/es/label-desc-item/demo/index.less +9 -0
  5. package/es/label-desc-item/index.d.ts +13 -0
  6. package/es/label-desc-item/index.js +22 -0
  7. package/es/label-desc-item/style/index.css +23 -0
  8. package/es/label-desc-item/style/index.d.ts +1 -0
  9. package/es/label-desc-item/style/index.js +1 -0
  10. package/es/label-desc-item/style/index.less +26 -0
  11. package/es/label-input/index.d.ts +23 -0
  12. package/es/label-input/index.js +104 -0
  13. package/es/label-input/style/index.css +72 -0
  14. package/es/label-input/style/index.d.ts +1 -0
  15. package/es/label-input/style/index.js +1 -0
  16. package/es/label-input/style/index.less +95 -0
  17. package/es/label-select/index.d.ts +12 -0
  18. package/es/label-select/index.js +107 -0
  19. package/es/label-select/style/index.css +55 -0
  20. package/es/label-select/style/index.d.ts +2 -0
  21. package/es/label-select/style/index.js +2 -0
  22. package/es/label-select/style/index.less +69 -0
  23. package/es/label-text-area/index.d.ts +2 -0
  24. package/es/label-text-area/index.js +7 -0
  25. package/es/label-text-area/style/index.d.ts +1 -0
  26. package/es/label-text-area/style/index.js +0 -0
  27. package/es/rc-qrcode/index.d.ts +6 -6
  28. package/es/rc-qrcode/index.js +4 -4
  29. package/es/rc-qrcode/useQrcode.d.ts +1 -1
  30. package/es/rc-qrcode/useQrcode.js +4 -0
  31. package/lib/index.d.ts +3 -1
  32. package/lib/index.js +9 -0
  33. package/lib/keep-tab/index.js +1 -3
  34. package/lib/label-desc-item/demo/index.less +9 -0
  35. package/lib/label-desc-item/index.d.ts +13 -0
  36. package/lib/label-desc-item/index.js +35 -0
  37. package/lib/label-desc-item/style/index.css +23 -0
  38. package/lib/label-desc-item/style/index.d.ts +1 -0
  39. package/lib/label-desc-item/style/index.js +7 -0
  40. package/lib/label-desc-item/style/index.less +26 -0
  41. package/lib/label-input/index.d.ts +23 -0
  42. package/lib/label-input/index.js +119 -0
  43. package/lib/label-input/style/index.css +72 -0
  44. package/lib/label-input/style/index.d.ts +1 -0
  45. package/lib/label-input/style/index.js +7 -0
  46. package/lib/label-input/style/index.less +95 -0
  47. package/lib/label-select/index.d.ts +12 -0
  48. package/lib/label-select/index.js +126 -0
  49. package/lib/label-select/style/index.css +55 -0
  50. package/lib/label-select/style/index.d.ts +2 -0
  51. package/lib/label-select/style/index.js +9 -0
  52. package/lib/label-select/style/index.less +69 -0
  53. package/lib/label-text-area/index.d.ts +2 -0
  54. package/lib/label-text-area/index.js +19 -0
  55. package/lib/label-text-area/style/index.d.ts +1 -0
  56. package/lib/label-text-area/style/index.js +0 -0
  57. package/lib/rc-qrcode/index.d.ts +6 -6
  58. package/lib/rc-qrcode/index.js +4 -4
  59. package/lib/rc-qrcode/useQrcode.d.ts +1 -1
  60. package/lib/rc-qrcode/useQrcode.js +4 -0
  61. package/package.json +3 -3
@@ -0,0 +1,126 @@
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
+ exports.Option = void 0;
56
+
57
+ var react_1 = __importDefault(require("react"));
58
+
59
+ var ahooks_1 = require("ahooks");
60
+
61
+ var select_1 = __importDefault(require("antd/es/select"));
62
+
63
+ var classnames_1 = __importDefault(require("classnames"));
64
+
65
+ var ArrowDropDownFilled_1 = __importDefault(require("a-icons/lib/ArrowDropDownFilled"));
66
+
67
+ var lodash_1 = require("lodash");
68
+
69
+ var Option = select_1["default"].Option;
70
+ exports.Option = Option;
71
+
72
+ var LabelSelect = function LabelSelect(props) {
73
+ var className = props.className,
74
+ label = props.label;
75
+ var selectRef = react_1["default"].useRef(null);
76
+
77
+ var _a = __read(ahooks_1.useControllableValue(props, {
78
+ valuePropName: 'open',
79
+ trigger: 'setOpen'
80
+ }), 2),
81
+ open = _a[0],
82
+ setOpen = _a[1];
83
+
84
+ var _b = __read(ahooks_1.useControllableValue(props), 2),
85
+ value = _b[0],
86
+ setValue = _b[1];
87
+
88
+ var handleChange = function handleChange(nextValue) {
89
+ setValue(nextValue);
90
+ };
91
+
92
+ var handleLabelClick = function handleLabelClick() {
93
+ var _a;
94
+
95
+ if (!open) {
96
+ setOpen(!open);
97
+ }
98
+
99
+ (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
100
+ };
101
+
102
+ var onDropdownVisibleChange = function onDropdownVisibleChange(nextOpen) {
103
+ setOpen(nextOpen);
104
+ };
105
+
106
+ return react_1["default"].createElement("div", {
107
+ className: classnames_1["default"]({
108
+ 'label-select': true,
109
+ 'label-select-label-scale': open || value
110
+ }, className)
111
+ }, react_1["default"].createElement(select_1["default"], __assign({}, lodash_1.omit(props, ['open', 'onChange', 'className', 'label']), {
112
+ open: open,
113
+ ref: selectRef,
114
+ size: "large",
115
+ className: "label-select-selector",
116
+ onChange: handleChange,
117
+ onDropdownVisibleChange: onDropdownVisibleChange,
118
+ suffixIcon: react_1["default"].createElement(ArrowDropDownFilled_1["default"], null)
119
+ })), react_1["default"].createElement("label", {
120
+ className: "label-select-text",
121
+ onClick: handleLabelClick
122
+ }, label));
123
+ };
124
+
125
+ exports["default"] = LabelSelect;
126
+ LabelSelect.Option = Option;
@@ -0,0 +1,55 @@
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-select {
6
+ position: relative;
7
+ width: 100%;
8
+ height: 100%;
9
+ }
10
+ .label-select .ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector {
11
+ height: 52px;
12
+ border: 1px solid #e5e5e5;
13
+ border-radius: 12px;
14
+ outline: none;
15
+ }
16
+ .label-select .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector {
17
+ border-color: #ff6b00;
18
+ box-shadow: none;
19
+ }
20
+ .label-select .ant-select-single.ant-select-show-arrow .ant-select-selection-item {
21
+ padding-top: 14px;
22
+ padding-left: 4px;
23
+ }
24
+ .label-select .ant-select-selection-search {
25
+ padding-top: 14px;
26
+ padding-left: 2px;
27
+ }
28
+ .label-select .ant-select-arrow {
29
+ top: 44%;
30
+ width: 22px;
31
+ height: 22px;
32
+ color: #7d7d7d;
33
+ }
34
+ .label-select .ant-select-arrow .spotecicon {
35
+ width: 22px;
36
+ height: 22px;
37
+ }
38
+ .label-select-text {
39
+ position: absolute;
40
+ top: 18px;
41
+ left: 16px;
42
+ z-index: 2;
43
+ height: 20px;
44
+ color: #9aa5b5;
45
+ font-size: 14px;
46
+ line-height: 20px;
47
+ transform-origin: top left;
48
+ cursor: pointer;
49
+ transition: all 0.2s ease-out;
50
+ }
51
+ .label-select-label-scale .label-select-text {
52
+ transform: translateY(-10px) scale(0.86);
53
+ cursor: text;
54
+ pointer-events: none;
55
+ }
@@ -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,69 @@
1
+ @import '~antd/es/style/themes/index';
2
+
3
+ @color_9aa5b5: #9aa5b5;
4
+ @font-size-base: 14px;
5
+
6
+ .label-select {
7
+ position: relative;
8
+ width: 100%;
9
+ height: 100%;
10
+
11
+ .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
+
18
+ .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input)
19
+ .ant-select-selector {
20
+ border-color: #ff6b00;
21
+ box-shadow: none;
22
+ }
23
+
24
+ .ant-select-single.ant-select-show-arrow .ant-select-selection-item {
25
+ padding-top: 14px;
26
+ padding-left: 4px;
27
+ }
28
+
29
+ .ant-select-selection-search {
30
+ padding-top: 14px;
31
+ padding-left: 2px;
32
+ }
33
+
34
+ .ant-select-arrow {
35
+ top: 44%;
36
+ // position: relative;
37
+ // top: -2px;
38
+ width: 22px;
39
+ height: 22px;
40
+ color: #7d7d7d;
41
+
42
+ .spotecicon {
43
+ width: 22px;
44
+ height: 22px;
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
+ .label-select-text {
64
+ transform: translateY(-10px) scale(0.86);
65
+ cursor: text;
66
+ pointer-events: none;
67
+ }
68
+ }
69
+ }
@@ -0,0 +1,2 @@
1
+ declare const LabelTextArea: () => JSX.Element;
2
+ export default LabelTextArea;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ var __importDefault = this && this.__importDefault || function (mod) {
4
+ return mod && mod.__esModule ? mod : {
5
+ "default": mod
6
+ };
7
+ };
8
+
9
+ Object.defineProperty(exports, "__esModule", {
10
+ value: true
11
+ });
12
+
13
+ var react_1 = __importDefault(require("react"));
14
+
15
+ var LabelTextArea = function LabelTextArea() {
16
+ return react_1["default"].createElement("div", null, react_1["default"].createElement("textarea", null));
17
+ };
18
+
19
+ exports["default"] = LabelTextArea;
File without changes
@@ -1,21 +1,21 @@
1
1
  import type { QRCodeRenderersOptions, QRCodeSegment } from 'qrcode';
2
2
  import QRCode from 'qrcode';
3
3
  import useQrcode from './useQrcode';
4
- export interface RcQRcodeProps {
4
+ export interface RcQrcodeProps {
5
5
  /** 生成二维码的值 */
6
- value: QRCodeSegment[];
6
+ value: QRCodeSegment[] | string;
7
7
  /** qrcode的QRCodeRenderersOptions */
8
8
  options: QRCodeRenderersOptions;
9
9
  /** 获取HTMLCanvasElement */
10
10
  getCanvasInstance: (result: HTMLCanvasElement) => void;
11
11
  }
12
- declare const RcQRcode: {
13
- (props: RcQRcodeProps): JSX.Element;
12
+ declare const RcQrcode: {
13
+ (props: RcQrcodeProps): JSX.Element;
14
14
  defaultProps: {
15
15
  value: string;
16
16
  options: {};
17
17
  };
18
- useQrcode: (value: string | QRCodeSegment[], options: QRCode.QRCodeToDataURLOptions) => string;
18
+ useQrcode: (value: string | QRCodeSegment[], options?: QRCode.QRCodeToDataURLOptions) => string;
19
19
  };
20
- export default RcQRcode;
20
+ export default RcQrcode;
21
21
  export { useQrcode };
@@ -71,7 +71,7 @@ var useQrcode_1 = __importDefault(require("./useQrcode"));
71
71
 
72
72
  exports.useQrcode = useQrcode_1["default"];
73
73
 
74
- var RcQRcode = function RcQRcode(props) {
74
+ var RcQrcode = function RcQrcode(props) {
75
75
  var value = props.value,
76
76
  options = props.options;
77
77
  var domElRef = React.useRef(null);
@@ -100,9 +100,9 @@ var RcQRcode = function RcQRcode(props) {
100
100
  });
101
101
  };
102
102
 
103
- RcQRcode.defaultProps = {
103
+ RcQrcode.defaultProps = {
104
104
  value: '',
105
105
  options: {}
106
106
  };
107
- RcQRcode.useQrcode = useQrcode_1["default"];
108
- exports["default"] = RcQRcode;
107
+ RcQrcode.useQrcode = useQrcode_1["default"];
108
+ exports["default"] = RcQrcode;
@@ -1,4 +1,4 @@
1
1
  import type { QRCodeToDataURLOptions, QRCodeSegment } from 'qrcode';
2
2
  declare type ValueTypes = string | QRCodeSegment[];
3
- export declare const useQRCode: (value: ValueTypes, options: QRCodeToDataURLOptions) => string;
3
+ export declare const useQRCode: (value: ValueTypes, options?: QRCodeToDataURLOptions) => string;
4
4
  export default useQRCode;
@@ -43,6 +43,10 @@ var qrcode_1 = __importDefault(require("qrcode"));
43
43
  var react_1 = require("react");
44
44
 
45
45
  exports.useQRCode = function (value, options) {
46
+ if (options === void 0) {
47
+ options = {};
48
+ }
49
+
46
50
  var _a = __read(react_1.useState(''), 2),
47
51
  dataURL = _a[0],
48
52
  setDataURL = _a[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "2.0.78",
3
+ "version": "2.0.82",
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.43",
36
+ "a-icons": "^1.0.44",
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": "b2c664a6401c4e18e4d5ce6ddf01f565f8e85777"
72
+ "gitHead": "29449b7d1c74e1e8b9e32f38ac5a57aba3119418"
73
73
  }