assui 2.1.46 → 2.1.47

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.
@@ -0,0 +1,2 @@
1
+ import 'antd/lib/select/style';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import "antd/es/select/style";
2
+ import './index.less';
@@ -0,0 +1,16 @@
1
+ @import '~antd/lib/style/index.less';
2
+
3
+ .a-select-wrap {
4
+ position: relative;
5
+
6
+ .@{ant-prefix}-select-selection-item {
7
+ display: none;
8
+ }
9
+
10
+ .a-select-value-wrap {
11
+ position: absolute;
12
+ top: 0;
13
+ bottom: 0;
14
+ z-index: 2;
15
+ }
16
+ }
@@ -0,0 +1,11 @@
1
+ .a-select-value-wrap {
2
+ display: flex;
3
+ align-items: center;
4
+ padding-left: 5px;
5
+
6
+ .spotecicon {
7
+ width: 18px;
8
+ height: 18px;
9
+ margin-right: 10px;
10
+ }
11
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { SelectProps } from 'antd/lib/select';
3
+ interface ASelectProps extends SelectProps {
4
+ valueRender?: (value: any) => React.ReactNode;
5
+ }
6
+ declare const ASelect: {
7
+ (props: ASelectProps): JSX.Element;
8
+ Option: import("rc-select/lib/Option").OptionFC;
9
+ };
10
+ export default ASelect;
@@ -0,0 +1,87 @@
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 select_1 = __importDefault(require("antd/lib/select"));
59
+
60
+ var useControllableValue_1 = __importDefault(require("ahooks/lib/useControllableValue"));
61
+
62
+ var ASelect = function ASelect(props) {
63
+ var valueRender = props.valueRender;
64
+
65
+ var _a = __read((0, useControllableValue_1["default"])(props), 2),
66
+ value = _a[0],
67
+ onChange = _a[1];
68
+
69
+ if (!valueRender) {
70
+ return react_1["default"].createElement(select_1["default"], __assign({}, props, {
71
+ value: value,
72
+ onChange: onChange
73
+ }));
74
+ }
75
+
76
+ return react_1["default"].createElement("div", {
77
+ className: "a-select-wrap"
78
+ }, react_1["default"].createElement("div", {
79
+ className: "a-select-value-wrap"
80
+ }, valueRender(value)), react_1["default"].createElement(select_1["default"], __assign({}, props, {
81
+ value: value,
82
+ onChange: onChange
83
+ })));
84
+ };
85
+
86
+ exports["default"] = ASelect;
87
+ ASelect.Option = select_1["default"].Option;