@para-ui/core 4.0.0-rc.4 → 4.0.0-rc.5
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/AutoBox/index.js +72 -85
- package/AutoTips/index.js +72 -95
- package/Badge/index.js +17 -16
- package/Breadcrumbs/index.js +57 -73
- package/Button/index.js +89 -117
- package/ButtonGroup/index.js +30 -33
- package/Carousel/index.js +29 -33
- package/Cascader/index.js +7 -9
- package/Checkbox/index.js +28 -35
- package/CheckboxGroup/index.js +43 -58
- package/Collapse/index.js +52 -49
- package/CollapseBox/index.js +65 -70
- package/CollapseLayout/index.js +106 -101
- package/ColorPicker/index.js +3 -3
- package/ComboSelect/index.js +242 -330
- package/Container/index.js +17 -21
- package/CopyText/index.js +50 -83
- package/DatePicker/index.js +22 -27
- package/Descriptions/index.js +50 -59
- package/Desktop/index.js +161 -180
- package/DragVerify/index.js +77 -113
- package/Drawer/index.js +80 -95
- package/Dropdown/index.js +3 -3
- package/DynamicMultiBox/index.js +219 -224
- package/DynamicMultiBox/interface.d.ts +7 -0
- package/Empty/index.js +26 -28
- package/Form/index.js +66 -74
- package/FormItem/index.js +14 -15
- package/FunctionModal/index.js +7 -14
- package/GlobalContext/index.js +17 -20
- package/Help/index.js +9 -12
- package/HelperText/index.js +11 -11
- package/InputLang/index.js +104 -124
- package/InputNumber/index.js +62 -81
- package/Label/index.js +19 -21
- package/Loading/index.js +11 -10
- package/Menu/index.js +302 -371
- package/Message/index.js +104 -113
- package/Modal/index.js +122 -148
- package/MultiBox/index.d.ts +5 -0
- package/MultiBox/index.js +111 -115
- package/Notification/index.js +105 -103
- package/OperateBtn/index.d.ts +3 -0
- package/OperateBtn/index.js +77 -107
- package/PageHeader/index.js +327 -406
- package/Pagination/index.js +107 -137
- package/ParauiProvider/index.js +20 -22
- package/PasswordRules/index.js +36 -40
- package/PopConfirm/index.js +60 -77
- package/Popover/index.js +12 -12
- package/Progress/index.js +72 -74
- package/Querying/index.js +22 -23
- package/README.md +2 -0
- package/Radio/index.js +27 -34
- package/RadioGroup/index.js +38 -52
- package/Search/index.js +34 -43
- package/Select/index.js +281 -345
- package/SelectInput/index.js +8 -13
- package/Selector/index.js +905 -796
- package/SelectorPicker/index.js +111 -133
- package/SingleBox/index.d.ts +5 -0
- package/SingleBox/index.js +92 -88
- package/Slider/index.js +46 -57
- package/Status/index.js +14 -13
- package/Stepper/index.js +25 -26
- package/Styles/theme.scss +9 -9
- package/Switch/index.js +32 -35
- package/Table/index.js +767 -963
- package/Tabs/index.js +102 -102
- package/Tag/index.js +115 -162
- package/TextEditor/index.js +81 -103
- package/TextField/index.js +142 -183
- package/TimePicker/index.js +27 -28
- package/Timeline/index.js +67 -58
- package/Title/index.js +32 -34
- package/ToggleButton/index.js +53 -52
- package/Tooltip/index.js +79 -82
- package/Transfer/index.js +159 -201
- package/Tree/index.js +7 -12
- package/Upload/index.js +523 -758
- package/Upload/interface.d.ts +2 -0
- package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
- package/_verture/{index-5a7e2438.js → index-0ced30f7.js} +1127 -1079
- package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
- package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
- package/_verture/index-da9097d3.js +239 -0
- package/_verture/{index-9331b116.js → index-ef1235fb.js} +125 -134
- package/_verture/{index-b1f80962.js → index-f186b5e8.js} +314 -398
- package/_verture/intl-f2f27722.js +69 -0
- package/_verture/{modalContext-736ff215.js → modalContext-5df08980.js} +36 -64
- package/_verture/{slicedToArray-a8206399.js → slicedToArray-8223a2ef.js} +15 -2
- package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
- package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
- package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
- package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
- package/_verture/{utils-418da0a4.js → utils-46e99c9a.js} +34 -25
- package/index.js +21 -22
- package/locale/index.js +6 -6
- package/package.json +1 -1
- package/umd/AutoBox.js +9 -8
- package/umd/AutoTips.js +9 -8
- package/umd/Badge.js +1 -1
- package/umd/Breadcrumbs.js +9 -8
- package/umd/Button.js +9 -8
- package/umd/ButtonGroup.js +9 -8
- package/umd/Carousel.js +5 -5
- package/umd/Cascader.js +9 -8
- package/umd/Checkbox.js +9 -8
- package/umd/CheckboxGroup.js +9 -8
- package/umd/Collapse.js +8 -7
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ColorPicker.js +1 -1
- package/umd/ComboSelect.js +9 -8
- package/umd/Container.js +1 -1
- package/umd/CopyText.js +9 -8
- package/umd/DatePicker.js +9 -8
- package/umd/Descriptions.js +9 -8
- package/umd/Desktop.js +9 -8
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +9 -8
- package/umd/Dropdown.js +6 -5
- package/umd/DynamicMultiBox.js +11 -10
- package/umd/Empty.js +1 -1
- package/umd/Form.js +9 -8
- package/umd/FormItem.js +9 -8
- package/umd/FunctionModal.js +9 -8
- package/umd/GlobalContext.js +1 -1
- package/umd/Help.js +9 -8
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +9 -8
- package/umd/InputNumber.js +9 -8
- package/umd/Label.js +9 -8
- package/umd/Loading.js +4 -4
- package/umd/Menu.js +4 -4
- package/umd/Message.js +4 -4
- package/umd/Modal.js +9 -8
- package/umd/MultiBox.js +9 -8
- package/umd/Notification.js +8 -7
- package/umd/OperateBtn.js +9 -8
- package/umd/PageHeader.js +9 -8
- package/umd/Pagination.js +9 -8
- package/umd/ParauiProvider.js +1 -1
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +9 -8
- package/umd/Popover.js +9 -8
- package/umd/Progress.js +5 -5
- package/umd/Querying.js +1 -1
- package/umd/Radio.js +9 -8
- package/umd/RadioGroup.js +9 -8
- package/umd/Search.js +9 -8
- package/umd/Select.js +9 -8
- package/umd/SelectInput.js +9 -8
- package/umd/Selector.js +9 -8
- package/umd/SelectorPicker.js +9 -8
- package/umd/SingleBox.js +9 -8
- package/umd/Slider.js +6 -5
- package/umd/Status.js +4 -4
- package/umd/Stepper.js +9 -8
- package/umd/Switch.js +9 -8
- package/umd/Table.js +9 -8
- package/umd/Tabs.js +9 -8
- package/umd/Tag.js +9 -8
- package/umd/TextEditor.js +22 -21
- package/umd/TextField.js +9 -8
- package/umd/TimePicker.js +9 -8
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +9 -8
- package/umd/ToggleButton.js +9 -8
- package/umd/Tooltip.js +9 -8
- package/umd/Transfer.js +10 -9
- package/umd/Tree.js +9 -8
- package/umd/Upload.js +10 -9
- package/umd/locale.js +1 -1
- package/_verture/index-232d890b.js +0 -327
- package/_verture/index-e9007d6a.js +0 -236
- package/_verture/intl-5c1ec055.js +0 -81
- package/_verture/toConsumableArray-8f4c9589.js +0 -19
- package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
package/Selector/index.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-8f4c9589.js';
|
|
2
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
3
|
-
import { r as regenerator } from '../_verture/index-232d890b.js';
|
|
4
1
|
import { a as __awaiter, _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
5
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
3
|
import { useState, useRef, useEffect, Fragment as Fragment$1 } from 'react';
|
|
4
|
+
import { b as _slicedToArray } from '../_verture/slicedToArray-8223a2ef.js';
|
|
5
|
+
import { _ as _typeof } from '../_verture/typeof-c310ee4a.js';
|
|
7
6
|
import { Radio } from '../Radio/index.js';
|
|
8
7
|
import { Checkbox } from '../Checkbox/index.js';
|
|
9
8
|
import { Popover } from '../Popover/index.js';
|
|
10
9
|
import AutoTips from '../AutoTips/index.js';
|
|
11
10
|
import { Loading } from '../Loading/index.js';
|
|
12
11
|
import CloseIcon from '@para-ui/icons/Close';
|
|
13
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
14
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
12
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
13
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
15
14
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
16
15
|
import { Search } from '../Search/index.js';
|
|
17
16
|
import { Breadcrumbs } from '../Breadcrumbs/index.js';
|
|
@@ -19,9 +18,7 @@ import Empty from '../Empty/index.js';
|
|
|
19
18
|
import SearchIcon from '@para-ui/icons/Search';
|
|
20
19
|
import Refresh from '@para-ui/icons/Refresh';
|
|
21
20
|
import { ArrayToObject, Get, Post, Cancel } from '@paraview/lib';
|
|
22
|
-
import { u as useGlobalProps } from '../_verture/useGlobalProps-
|
|
23
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
24
|
-
import '../_verture/typeof-c310ee4a.js';
|
|
21
|
+
import { u as useGlobalProps } from '../_verture/useGlobalProps-1e416658.js';
|
|
25
22
|
import '../Label/index.js';
|
|
26
23
|
import '../Help/index.js';
|
|
27
24
|
import '../Tooltip/index.js';
|
|
@@ -30,21 +27,344 @@ import 'rc-tooltip/lib/placements';
|
|
|
30
27
|
import 'clsx';
|
|
31
28
|
import '@para-ui/icons/Forbid';
|
|
32
29
|
import '@para-ui/icons/Help';
|
|
33
|
-
import '../_verture/usePopupContainer-
|
|
30
|
+
import '../_verture/usePopupContainer-635f66f4.js';
|
|
34
31
|
import '@para-ui/icons/LoadingF';
|
|
35
32
|
import '@para-ui/core/GlobalContext';
|
|
36
33
|
import '../TextField/index.js';
|
|
37
|
-
import '../_verture/typeof-adeedc13.js';
|
|
38
34
|
import '@para-ui/icons/PreviewClose';
|
|
39
35
|
import '@para-ui/icons/PreviewOpen';
|
|
40
36
|
import '@para-ui/icons/CloseCircleF';
|
|
41
37
|
import '../HelperText/index.js';
|
|
42
|
-
import '../_verture/index-
|
|
38
|
+
import '../_verture/index-da9097d3.js';
|
|
43
39
|
import 'rc-dropdown';
|
|
44
40
|
import 'dayjs';
|
|
45
41
|
import '@para-ui/icons/More';
|
|
46
42
|
import '@para-ui/icons/Return';
|
|
47
43
|
|
|
44
|
+
var regeneratorRuntime$1 = {exports: {}};
|
|
45
|
+
|
|
46
|
+
(function (module) {
|
|
47
|
+
var _typeof$1 = _typeof.exports["default"];
|
|
48
|
+
function _regeneratorRuntime() {
|
|
49
|
+
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
50
|
+
return e;
|
|
51
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
52
|
+
var t,
|
|
53
|
+
e = {},
|
|
54
|
+
r = Object.prototype,
|
|
55
|
+
n = r.hasOwnProperty,
|
|
56
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
57
|
+
t[e] = r.value;
|
|
58
|
+
},
|
|
59
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
60
|
+
a = i.iterator || "@@iterator",
|
|
61
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
62
|
+
u = i.toStringTag || "@@toStringTag";
|
|
63
|
+
function define(t, e, r) {
|
|
64
|
+
return Object.defineProperty(t, e, {
|
|
65
|
+
value: r,
|
|
66
|
+
enumerable: !0,
|
|
67
|
+
configurable: !0,
|
|
68
|
+
writable: !0
|
|
69
|
+
}), t[e];
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
define({}, "");
|
|
73
|
+
} catch (t) {
|
|
74
|
+
define = function define(t, e, r) {
|
|
75
|
+
return t[e] = r;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function wrap(t, e, r, n) {
|
|
79
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
80
|
+
a = Object.create(i.prototype),
|
|
81
|
+
c = new Context(n || []);
|
|
82
|
+
return o(a, "_invoke", {
|
|
83
|
+
value: makeInvokeMethod(t, r, c)
|
|
84
|
+
}), a;
|
|
85
|
+
}
|
|
86
|
+
function tryCatch(t, e, r) {
|
|
87
|
+
try {
|
|
88
|
+
return {
|
|
89
|
+
type: "normal",
|
|
90
|
+
arg: t.call(e, r)
|
|
91
|
+
};
|
|
92
|
+
} catch (t) {
|
|
93
|
+
return {
|
|
94
|
+
type: "throw",
|
|
95
|
+
arg: t
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
e.wrap = wrap;
|
|
100
|
+
var h = "suspendedStart",
|
|
101
|
+
l = "suspendedYield",
|
|
102
|
+
f = "executing",
|
|
103
|
+
s = "completed",
|
|
104
|
+
y = {};
|
|
105
|
+
function Generator() {}
|
|
106
|
+
function GeneratorFunction() {}
|
|
107
|
+
function GeneratorFunctionPrototype() {}
|
|
108
|
+
var p = {};
|
|
109
|
+
define(p, a, function () {
|
|
110
|
+
return this;
|
|
111
|
+
});
|
|
112
|
+
var d = Object.getPrototypeOf,
|
|
113
|
+
v = d && d(d(values([])));
|
|
114
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
115
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
116
|
+
function defineIteratorMethods(t) {
|
|
117
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
118
|
+
define(t, e, function (t) {
|
|
119
|
+
return this._invoke(e, t);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function AsyncIterator(t, e) {
|
|
124
|
+
function invoke(r, o, i, a) {
|
|
125
|
+
var c = tryCatch(t[r], t, o);
|
|
126
|
+
if ("throw" !== c.type) {
|
|
127
|
+
var u = c.arg,
|
|
128
|
+
h = u.value;
|
|
129
|
+
return h && "object" == _typeof$1(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
130
|
+
invoke("next", t, i, a);
|
|
131
|
+
}, function (t) {
|
|
132
|
+
invoke("throw", t, i, a);
|
|
133
|
+
}) : e.resolve(h).then(function (t) {
|
|
134
|
+
u.value = t, i(u);
|
|
135
|
+
}, function (t) {
|
|
136
|
+
return invoke("throw", t, i, a);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
a(c.arg);
|
|
140
|
+
}
|
|
141
|
+
var r;
|
|
142
|
+
o(this, "_invoke", {
|
|
143
|
+
value: function value(t, n) {
|
|
144
|
+
function callInvokeWithMethodAndArg() {
|
|
145
|
+
return new e(function (e, r) {
|
|
146
|
+
invoke(t, n, e, r);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function makeInvokeMethod(e, r, n) {
|
|
154
|
+
var o = h;
|
|
155
|
+
return function (i, a) {
|
|
156
|
+
if (o === f) throw new Error("Generator is already running");
|
|
157
|
+
if (o === s) {
|
|
158
|
+
if ("throw" === i) throw a;
|
|
159
|
+
return {
|
|
160
|
+
value: t,
|
|
161
|
+
done: !0
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
for (n.method = i, n.arg = a;;) {
|
|
165
|
+
var c = n.delegate;
|
|
166
|
+
if (c) {
|
|
167
|
+
var u = maybeInvokeDelegate(c, n);
|
|
168
|
+
if (u) {
|
|
169
|
+
if (u === y) continue;
|
|
170
|
+
return u;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
174
|
+
if (o === h) throw o = s, n.arg;
|
|
175
|
+
n.dispatchException(n.arg);
|
|
176
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
177
|
+
o = f;
|
|
178
|
+
var p = tryCatch(e, r, n);
|
|
179
|
+
if ("normal" === p.type) {
|
|
180
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
181
|
+
return {
|
|
182
|
+
value: p.arg,
|
|
183
|
+
done: n.done
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function maybeInvokeDelegate(e, r) {
|
|
191
|
+
var n = r.method,
|
|
192
|
+
o = e.iterator[n];
|
|
193
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
194
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
195
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
196
|
+
var a = i.arg;
|
|
197
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
198
|
+
}
|
|
199
|
+
function pushTryEntry(t) {
|
|
200
|
+
var e = {
|
|
201
|
+
tryLoc: t[0]
|
|
202
|
+
};
|
|
203
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
204
|
+
}
|
|
205
|
+
function resetTryEntry(t) {
|
|
206
|
+
var e = t.completion || {};
|
|
207
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
208
|
+
}
|
|
209
|
+
function Context(t) {
|
|
210
|
+
this.tryEntries = [{
|
|
211
|
+
tryLoc: "root"
|
|
212
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
213
|
+
}
|
|
214
|
+
function values(e) {
|
|
215
|
+
if (e || "" === e) {
|
|
216
|
+
var r = e[a];
|
|
217
|
+
if (r) return r.call(e);
|
|
218
|
+
if ("function" == typeof e.next) return e;
|
|
219
|
+
if (!isNaN(e.length)) {
|
|
220
|
+
var o = -1,
|
|
221
|
+
i = function next() {
|
|
222
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
223
|
+
return next.value = t, next.done = !0, next;
|
|
224
|
+
};
|
|
225
|
+
return i.next = i;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
throw new TypeError(_typeof$1(e) + " is not iterable");
|
|
229
|
+
}
|
|
230
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
231
|
+
value: GeneratorFunctionPrototype,
|
|
232
|
+
configurable: !0
|
|
233
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
234
|
+
value: GeneratorFunction,
|
|
235
|
+
configurable: !0
|
|
236
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
237
|
+
var e = "function" == typeof t && t.constructor;
|
|
238
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
239
|
+
}, e.mark = function (t) {
|
|
240
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
241
|
+
}, e.awrap = function (t) {
|
|
242
|
+
return {
|
|
243
|
+
__await: t
|
|
244
|
+
};
|
|
245
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
246
|
+
return this;
|
|
247
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
248
|
+
void 0 === i && (i = Promise);
|
|
249
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
250
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
251
|
+
return t.done ? t.value : a.next();
|
|
252
|
+
});
|
|
253
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
254
|
+
return this;
|
|
255
|
+
}), define(g, "toString", function () {
|
|
256
|
+
return "[object Generator]";
|
|
257
|
+
}), e.keys = function (t) {
|
|
258
|
+
var e = Object(t),
|
|
259
|
+
r = [];
|
|
260
|
+
for (var n in e) r.push(n);
|
|
261
|
+
return r.reverse(), function next() {
|
|
262
|
+
for (; r.length;) {
|
|
263
|
+
var t = r.pop();
|
|
264
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
265
|
+
}
|
|
266
|
+
return next.done = !0, next;
|
|
267
|
+
};
|
|
268
|
+
}, e.values = values, Context.prototype = {
|
|
269
|
+
constructor: Context,
|
|
270
|
+
reset: function reset(e) {
|
|
271
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
272
|
+
},
|
|
273
|
+
stop: function stop() {
|
|
274
|
+
this.done = !0;
|
|
275
|
+
var t = this.tryEntries[0].completion;
|
|
276
|
+
if ("throw" === t.type) throw t.arg;
|
|
277
|
+
return this.rval;
|
|
278
|
+
},
|
|
279
|
+
dispatchException: function dispatchException(e) {
|
|
280
|
+
if (this.done) throw e;
|
|
281
|
+
var r = this;
|
|
282
|
+
function handle(n, o) {
|
|
283
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
284
|
+
}
|
|
285
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
286
|
+
var i = this.tryEntries[o],
|
|
287
|
+
a = i.completion;
|
|
288
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
289
|
+
if (i.tryLoc <= this.prev) {
|
|
290
|
+
var c = n.call(i, "catchLoc"),
|
|
291
|
+
u = n.call(i, "finallyLoc");
|
|
292
|
+
if (c && u) {
|
|
293
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
294
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
295
|
+
} else if (c) {
|
|
296
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
297
|
+
} else {
|
|
298
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
299
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
abrupt: function abrupt(t, e) {
|
|
305
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
306
|
+
var o = this.tryEntries[r];
|
|
307
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
308
|
+
var i = o;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
313
|
+
var a = i ? i.completion : {};
|
|
314
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
315
|
+
},
|
|
316
|
+
complete: function complete(t, e) {
|
|
317
|
+
if ("throw" === t.type) throw t.arg;
|
|
318
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
319
|
+
},
|
|
320
|
+
finish: function finish(t) {
|
|
321
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
322
|
+
var r = this.tryEntries[e];
|
|
323
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"catch": function _catch(t) {
|
|
327
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
328
|
+
var r = this.tryEntries[e];
|
|
329
|
+
if (r.tryLoc === t) {
|
|
330
|
+
var n = r.completion;
|
|
331
|
+
if ("throw" === n.type) {
|
|
332
|
+
var o = n.arg;
|
|
333
|
+
resetTryEntry(r);
|
|
334
|
+
}
|
|
335
|
+
return o;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
throw new Error("illegal catch attempt");
|
|
339
|
+
},
|
|
340
|
+
delegateYield: function delegateYield(e, r, n) {
|
|
341
|
+
return this.delegate = {
|
|
342
|
+
iterator: values(e),
|
|
343
|
+
resultName: r,
|
|
344
|
+
nextLoc: n
|
|
345
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
346
|
+
}
|
|
347
|
+
}, e;
|
|
348
|
+
}
|
|
349
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
350
|
+
} (regeneratorRuntime$1));
|
|
351
|
+
|
|
352
|
+
// TODO(Babel 8): Remove this file.
|
|
353
|
+
|
|
354
|
+
var runtime = regeneratorRuntime$1.exports();
|
|
355
|
+
var regenerator = runtime;
|
|
356
|
+
|
|
357
|
+
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
358
|
+
try {
|
|
359
|
+
regeneratorRuntime = runtime;
|
|
360
|
+
} catch (accidentalStrictMode) {
|
|
361
|
+
if (typeof globalThis === "object") {
|
|
362
|
+
globalThis.regeneratorRuntime = runtime;
|
|
363
|
+
} else {
|
|
364
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
48
368
|
var en = {
|
|
49
369
|
root: 'root',
|
|
50
370
|
selectAll: 'Select all',
|
|
@@ -68,8 +388,8 @@ var zh = {
|
|
|
68
388
|
};
|
|
69
389
|
|
|
70
390
|
var localeJson = {
|
|
71
|
-
zh
|
|
72
|
-
en
|
|
391
|
+
zh,
|
|
392
|
+
en
|
|
73
393
|
};
|
|
74
394
|
|
|
75
395
|
var css_248z$3 = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-selector-node {\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n}\n.paraui-v4-selector-node:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-selector-node > .selector-node-left {\n display: flex;\n align-items: center;\n flex: 1;\n overflow: hidden;\n padding-right: 10px;\n}\n.paraui-v4-selector-node > .selector-node-left > .selector-node-radio {\n margin-right: 8px;\n display: flex;\n align-items: center;\n padding: 0;\n}\n.paraui-v4-selector-node > .selector-node-left > .selector-node-radio .radio-box {\n top: 0;\n}\n.paraui-v4-selector-node > .selector-node-left > .selector-node-check {\n margin-right: 8px;\n display: flex;\n align-items: center;\n padding: 0;\n}\n.paraui-v4-selector-node > .selector-node-left > .selector-node-check .checkbox-box {\n top: 0;\n}\n.paraui-v4-selector-node > .selector-node-left > .node-img {\n display: inline-block;\n width: 30px;\n height: 30px;\n margin-right: 8px;\n}\n.paraui-v4-selector-node > .selector-node-left > .node-img img {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-branch {\n height: 30px;\n padding: 0 10px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-branch.paraui-v4-selector-node-img {\n height: 44px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-branch > .selector-node-left > .main-title {\n font-size: 14px;\n color: rgb(29, 33, 38);\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-branch > .selector-node-left > .sub-title {\n margin-left: 8px;\n font-size: 14px;\n color: rgb(161, 168, 179);\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 30px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-branch > .selector-node-left > .tag {\n margin-left: 8px;\n background-color: rgba(46, 101, 230, 0.1);\n color: rgb(46, 101, 230);\n border-radius: 2px;\n font-size: 12px;\n padding: 0px 6px;\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf {\n padding: 0px 10px;\n height: 44px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf > .selector-node-left > .title-box {\n flex: 1;\n overflow: hidden;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf > .selector-node-left > .title-box > .main-title-box {\n display: flex;\n align-items: center;\n white-space: nowrap;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .main-title {\n font-size: 14px;\n color: rgb(29, 33, 38);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .tag {\n margin-left: 8px;\n background-color: rgba(46, 101, 230, 0.1);\n color: rgb(46, 101, 230);\n border-radius: 2px;\n font-size: 12px;\n padding: 0px 6px;\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf > .selector-node-left > .title-box > .sub-title {\n font-size: 12px;\n color: rgb(161, 168, 179);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v4-selector-node > .selector-node-right {\n display: flex;\n align-items: center;\n height: 100%;\n}\n.paraui-v4-selector-node > .selector-node-right > .detail {\n font-size: 14px;\n color: rgb(46, 101, 230);\n white-space: nowrap;\n padding: 0 4px;\n cursor: pointer;\n height: 24px;\n line-height: 24px;\n border-radius: 2px;\n}\n.paraui-v4-selector-node > .selector-node-right > .detail:hover {\n background-color: rgba(212, 218, 227, 0.4);\n}\n.paraui-v4-selector-node > .selector-node-right > .line {\n border-left: 1px solid rgb(213, 224, 250);\n margin: 0 8px;\n content: \"\";\n display: inline-block;\n height: 12px;\n}\n.paraui-v4-selector-node > .selector-node-right > .lower-child {\n font-size: 14px;\n color: rgb(46, 101, 230);\n white-space: nowrap;\n padding: 0 4px;\n cursor: pointer;\n height: 24px;\n line-height: 24px;\n border-radius: 2px;\n}\n.paraui-v4-selector-node > .selector-node-right > .lower-child:hover {\n background-color: rgb(234, 236, 241);\n}\n.paraui-v4-selector-node > .selector-node-right > .close {\n display: flex;\n align-items: center;\n color: rgb(46, 101, 230);\n white-space: nowrap;\n padding: 0 4px;\n cursor: pointer;\n height: 24px;\n line-height: 24px;\n border-radius: 2px;\n}\n.paraui-v4-selector-node > .selector-node-right > .close:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-selector-node > .selector-node-right > .close > svg {\n font-size: 16px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-edit > .selector-node-right > .detail, .paraui-v4-selector-node.paraui-v4-selector-node-edit > .selector-node-right > .lower-child {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-edit > .selector-node-right > .detail:hover, .paraui-v4-selector-node.paraui-v4-selector-node-edit > .selector-node-right > .lower-child:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-disabled {\n cursor: not-allowed;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-disabled.paraui-v4-selector-node-branch > .selector-node-left > .main-title {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-disabled.paraui-v4-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .main-title {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-disabled > .selector-node-right > .lower-child {\n cursor: not-allowed;\n color: rgb(161, 168, 179);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-disabled-child > .selector-node-right > .lower-child {\n cursor: not-allowed;\n color: rgb(161, 168, 179);\n}\n\n.paraui-v4-selector-detail .selector-detail-popover-content.selector-detail-popover-content-loading {\n min-width: 100px;\n min-height: 50px;\n}";
|
|
@@ -332,63 +652,57 @@ var SelectorNode = function SelectorNode(props) {
|
|
|
332
652
|
var css_248z$2 = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-selector-main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n.paraui-v4-selector-main > .selectot-main-search {\n margin-bottom: 16px;\n border-bottom: 1px solid rgb(234, 236, 241);\n}\n.paraui-v4-selector-main > .selectot-main-search .text-field-content {\n border: none;\n height: 32px;\n}\n.paraui-v4-selector-main > .selectot-main-search .text-field-content .text-field-content-within-input {\n height: 32px !important;\n}\n.paraui-v4-selector-main > .selectot-main-search .text-field-content .text-field-content-within-input .text-field-label-placeholder {\n line-height: 32px !important;\n}\n.paraui-v4-selector-main > .selector-main-box {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .nav-box {\n padding: 0 6px;\n margin-bottom: 4px;\n margin-top: 10px;\n line-height: 0;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list-no-data {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-bottom: 16px;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list {\n overflow-y: hidden;\n display: flex;\n flex-direction: column;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-all-check {\n position: relative;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-all-check + .selector-group-title.selector-group-title-first {\n margin-top: 4px;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content {\n overflow-y: hidden;\n position: relative;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content:before {\n content: \"\";\n position: absolute;\n height: 30px;\n width: 100%;\n pointer-events: none;\n top: 0;\n left: 0;\n z-index: 1;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content:after {\n content: \"\";\n position: absolute;\n height: 30px;\n width: 100%;\n pointer-events: none;\n bottom: 0;\n left: 0;\n z-index: 1;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content.selector-main-list-scroll-top:after {\n box-shadow: inset 0px -10px 10px -8px rgba(0, 0, 0, 0.05);\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content.selector-main-list-scroll-middle:before {\n box-shadow: inset 0px 10px 10px -8px rgba(0, 0, 0, 0.05);\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content.selector-main-list-scroll-middle:after {\n box-shadow: inset 0px -10px 10px -8px rgba(0, 0, 0, 0.05);\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content.selector-main-list-scroll-bottom:before {\n box-shadow: inset 0px 10px 10px -8px rgba(0, 0, 0, 0.05);\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content > .selector-main-list-content-box {\n height: 100%;\n overflow-y: auto;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content > .selector-main-list-content-box > .selector-group-title {\n padding: 0 12px;\n margin-top: 16px;\n margin-bottom: 4px;\n font-size: 14px;\n color: rgb(161, 168, 179);\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content > .selector-main-list-content-box > .selector-group-title.selector-group-title-first {\n margin-top: 0;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-more {\n padding: 0 10px;\n cursor: pointer;\n font-size: 14px;\n color: rgb(46, 101, 230);\n line-height: 30px;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-more:hover {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content.selector-main-search-content {\n /*position: absolute;\n left: 0;\n top: 0;*/\n width: 100%;\n height: 100%;\n background-color: white;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content.selector-main-content-all-check > .selector-main-list > .selector-main-list-content {\n max-height: calc(100% - 30px);\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content.selector-main-content-load-more > .selector-main-list > .selector-main-list-content {\n max-height: calc(100% - 30px);\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content.selector-main-content-all-check.selector-main-content-load-more > .selector-main-list > .selector-main-list-content {\n max-height: calc(100% - 30px - 30px);\n}\n.paraui-v4-selector-main.paraui-v4-selector-main-show-search > .selector-main-box {\n height: calc(100% - 49px);\n}\n.paraui-v4-selector-main.paraui-v4-selector-main-show-search > .selector-main-box > .selector-main-content.selector-main-list-box {\n display: none;\n}\n.paraui-v4-selector-main.paraui-v4-selector-main-search > .selector-main-box {\n height: calc(100% - 49px);\n}\n.paraui-v4-selector-main.paraui-v4-selector-main-search > .selector-main-box .selector-main-content .nav-box {\n margin-top: 0;\n}";
|
|
333
653
|
styleInject(css_248z$2);
|
|
334
654
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
nodeMode =
|
|
341
|
-
selectMode
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
var intl = useFormatMessage('Selector', localeJson);
|
|
367
|
-
var _useState = useState({}),
|
|
368
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
369
|
-
listCom = _useState2[0],
|
|
370
|
-
setListCom = _useState2[1];
|
|
371
|
-
var constData = useRef({
|
|
655
|
+
const SelectorMainContent = props => {
|
|
656
|
+
const {
|
|
657
|
+
className,
|
|
658
|
+
value,
|
|
659
|
+
rowKey = 'key',
|
|
660
|
+
nodeMode = 'branch',
|
|
661
|
+
selectMode,
|
|
662
|
+
loadMore = false,
|
|
663
|
+
isAllCheck = false,
|
|
664
|
+
detail,
|
|
665
|
+
detailRender,
|
|
666
|
+
isLazy,
|
|
667
|
+
list,
|
|
668
|
+
groupType,
|
|
669
|
+
breadcrumbs,
|
|
670
|
+
breadcrumbsSeparator = '-',
|
|
671
|
+
breadcrumbsList = [],
|
|
672
|
+
fieldConfig,
|
|
673
|
+
disabled,
|
|
674
|
+
disabledChild,
|
|
675
|
+
emptyProps,
|
|
676
|
+
loading,
|
|
677
|
+
onClickBreadcrumbs,
|
|
678
|
+
onLevel,
|
|
679
|
+
onSelect,
|
|
680
|
+
onLoad,
|
|
681
|
+
onAllCheck
|
|
682
|
+
} = props;
|
|
683
|
+
const intl = useFormatMessage('Selector', localeJson);
|
|
684
|
+
const [listCom, setListCom] = useState({});
|
|
685
|
+
const constData = useRef({
|
|
372
686
|
listTypeJson: {},
|
|
373
687
|
fieldConfig: {},
|
|
374
688
|
resizeTimer: null
|
|
375
689
|
});
|
|
376
|
-
|
|
377
|
-
|
|
690
|
+
const scrolltRef = useRef(null);
|
|
691
|
+
const contentRef = useRef(null);
|
|
378
692
|
constData.current.listTypeJson = ArrayToObject('value', groupType);
|
|
379
693
|
constData.current.fieldConfig = fieldConfig || {};
|
|
380
|
-
useEffect(
|
|
694
|
+
useEffect(() => {
|
|
381
695
|
changeResize();
|
|
382
|
-
return
|
|
696
|
+
return () => {
|
|
383
697
|
clearTimeout(constData.current.resizeTimer);
|
|
384
698
|
};
|
|
385
699
|
}, []);
|
|
386
|
-
useEffect(
|
|
700
|
+
useEffect(() => {
|
|
387
701
|
if (list && groupType && groupType.length > 0) {
|
|
388
|
-
|
|
389
|
-
for (
|
|
390
|
-
|
|
391
|
-
|
|
702
|
+
const json = {};
|
|
703
|
+
for (let i = 0, l = list.length; i < l; i++) {
|
|
704
|
+
const item = list[i];
|
|
705
|
+
const type = item.type;
|
|
392
706
|
if (!json[type]) json[type] = [];
|
|
393
707
|
json[type].push(item);
|
|
394
708
|
}
|
|
@@ -396,17 +710,17 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
396
710
|
}
|
|
397
711
|
}, [list]);
|
|
398
712
|
/** 屏幕发生改变 */
|
|
399
|
-
|
|
713
|
+
const changeResize = () => {
|
|
400
714
|
clearTimeout(constData.current.resizeTimer);
|
|
401
|
-
constData.current.resizeTimer = setTimeout(
|
|
715
|
+
constData.current.resizeTimer = setTimeout(() => {
|
|
402
716
|
onScroll();
|
|
403
717
|
}, 100);
|
|
404
718
|
};
|
|
405
719
|
/** 滚动 */
|
|
406
|
-
|
|
720
|
+
const onScroll = () => {
|
|
407
721
|
if (!contentRef.current || !scrolltRef.current) return;
|
|
408
|
-
|
|
409
|
-
|
|
722
|
+
const scrollBox = scrolltRef.current;
|
|
723
|
+
const contentBox = contentRef.current;
|
|
410
724
|
contentBox.classList.remove('selector-main-list-scroll-top', 'selector-main-list-scroll-bottom', 'selector-main-list-scroll-middle');
|
|
411
725
|
if (scrollBox.scrollHeight <= scrollBox.clientHeight) return;
|
|
412
726
|
// 滚动条初始化
|
|
@@ -423,17 +737,17 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
423
737
|
contentBox.classList.add('selector-main-list-scroll-middle');
|
|
424
738
|
};
|
|
425
739
|
/** 判断是否全选,半选 */
|
|
426
|
-
|
|
427
|
-
|
|
740
|
+
const handAllCheckFunc = () => {
|
|
741
|
+
const json = {
|
|
428
742
|
checked: false,
|
|
429
743
|
indeterminate: false
|
|
430
744
|
};
|
|
431
745
|
// 不存在value, 没有数据, 全选没转态
|
|
432
746
|
if (!value || !list || list.length === 0) return json;
|
|
433
|
-
for (
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
747
|
+
for (let i = 0, l = list.length; i < l; i++) {
|
|
748
|
+
const item = list[i];
|
|
749
|
+
const key = item.key;
|
|
750
|
+
const disabledItem = handDisabled(item);
|
|
437
751
|
if (disabledItem) {
|
|
438
752
|
if (value[key]) json.checked = true;
|
|
439
753
|
continue;
|
|
@@ -457,7 +771,7 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
457
771
|
return json;
|
|
458
772
|
};
|
|
459
773
|
/** 处理禁用状态 */
|
|
460
|
-
|
|
774
|
+
const handDisabled = item => {
|
|
461
775
|
if (disabled) {
|
|
462
776
|
if (disabled === true) return true;
|
|
463
777
|
if (disabled instanceof Array) {
|
|
@@ -470,7 +784,7 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
470
784
|
return false;
|
|
471
785
|
};
|
|
472
786
|
/** 处理禁用下级状态 */
|
|
473
|
-
|
|
787
|
+
const handDisabledChild = item => {
|
|
474
788
|
if (disabledChild) {
|
|
475
789
|
if (disabledChild === true) return true;
|
|
476
790
|
if (disabledChild instanceof Array) {
|
|
@@ -483,12 +797,12 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
483
797
|
return false;
|
|
484
798
|
};
|
|
485
799
|
/** 全选 */
|
|
486
|
-
|
|
800
|
+
const handAllCheck = () => {
|
|
487
801
|
// 只存在复选框模式
|
|
488
802
|
if (!isAllCheck || selectMode !== 'check') return null;
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
803
|
+
const checkJson = handAllCheckFunc();
|
|
804
|
+
const onAllCheckCom = () => {
|
|
805
|
+
let bol = true;
|
|
492
806
|
if (checkJson.checked) bol = false;
|
|
493
807
|
onAllCheck && onAllCheck(bol);
|
|
494
808
|
};
|
|
@@ -505,11 +819,11 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
505
819
|
}));
|
|
506
820
|
};
|
|
507
821
|
/** 点击查看更多 */
|
|
508
|
-
|
|
822
|
+
const clickLoad = () => {
|
|
509
823
|
onLoad && onLoad();
|
|
510
824
|
};
|
|
511
825
|
/** 查看更多 */
|
|
512
|
-
|
|
826
|
+
const handLoadMore = () => {
|
|
513
827
|
if (!loadMore) return null;
|
|
514
828
|
return jsx("div", Object.assign({
|
|
515
829
|
className: "selector-main-list-more",
|
|
@@ -525,33 +839,29 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
525
839
|
}));
|
|
526
840
|
};
|
|
527
841
|
/** 判断是否选中 */
|
|
528
|
-
|
|
529
|
-
|
|
842
|
+
const handCheck = item => {
|
|
843
|
+
let bol = false;
|
|
530
844
|
if (value && value[item.key]) bol = true;
|
|
531
845
|
return bol;
|
|
532
846
|
};
|
|
533
847
|
/** 处理每个节点的配置 */
|
|
534
|
-
|
|
535
|
-
|
|
848
|
+
const handNodeConfig = item => {
|
|
849
|
+
const json = {
|
|
536
850
|
useCase: 'view',
|
|
537
|
-
detail
|
|
538
|
-
nodeMode
|
|
851
|
+
detail,
|
|
852
|
+
nodeMode,
|
|
539
853
|
disabled: handDisabled(item),
|
|
540
854
|
disabledChild: handDisabledChild(item),
|
|
541
|
-
onLevel:
|
|
542
|
-
|
|
543
|
-
},
|
|
544
|
-
onSelect: function onSelect() {
|
|
545
|
-
return _onSelect && _onSelect(item);
|
|
546
|
-
},
|
|
855
|
+
onLevel: () => onLevel && onLevel(item),
|
|
856
|
+
onSelect: () => onSelect && onSelect(item),
|
|
547
857
|
checked: handCheck(item)
|
|
548
858
|
};
|
|
549
859
|
/** 节点类型 */
|
|
550
860
|
if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
|
|
551
861
|
/** 渲染字段 */
|
|
552
|
-
|
|
553
|
-
for (
|
|
554
|
-
|
|
862
|
+
const arr = ['img', 'mainTitle', 'subTitle', 'tag', 'tagStyle'];
|
|
863
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
864
|
+
const key = arr[i];
|
|
555
865
|
json[key] = item[key];
|
|
556
866
|
}
|
|
557
867
|
/** 判断是否具有选择 */
|
|
@@ -565,7 +875,7 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
565
875
|
json.child = item.child;
|
|
566
876
|
} else {
|
|
567
877
|
// 全量数据
|
|
568
|
-
|
|
878
|
+
const children = item.children || [];
|
|
569
879
|
if (children && children.length > 0) {
|
|
570
880
|
json.child = true;
|
|
571
881
|
}
|
|
@@ -574,43 +884,29 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
574
884
|
}
|
|
575
885
|
/** 详情render */
|
|
576
886
|
if (detailRender) {
|
|
577
|
-
json.detailRender = function () {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
while (1) switch (_context.prev = _context.next) {
|
|
582
|
-
case 0:
|
|
583
|
-
_context.next = 2;
|
|
584
|
-
return detailRender(item, true);
|
|
585
|
-
case 2:
|
|
586
|
-
Dom = _context.sent;
|
|
587
|
-
return _context.abrupt("return", Dom);
|
|
588
|
-
case 4:
|
|
589
|
-
case "end":
|
|
590
|
-
return _context.stop();
|
|
591
|
-
}
|
|
592
|
-
}, _callee);
|
|
593
|
-
}));
|
|
594
|
-
};
|
|
887
|
+
json.detailRender = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
888
|
+
const Dom = yield detailRender(item, true);
|
|
889
|
+
return Dom;
|
|
890
|
+
});
|
|
595
891
|
}
|
|
596
892
|
if (item.detail !== undefined) json.detail = item.detail;
|
|
597
893
|
return json;
|
|
598
894
|
};
|
|
599
895
|
/** 渲染list节点 */
|
|
600
|
-
|
|
601
|
-
return arr === null || arr === void 0 ? void 0 : arr.map(
|
|
896
|
+
const handListNode = arr => {
|
|
897
|
+
return arr === null || arr === void 0 ? void 0 : arr.map((item, index) => {
|
|
602
898
|
return jsx(SelectorNode, Object.assign({}, handNodeConfig(item)), index);
|
|
603
899
|
});
|
|
604
900
|
};
|
|
605
901
|
/** 处理节点dom */
|
|
606
|
-
|
|
902
|
+
const handNode = () => {
|
|
607
903
|
// 分组渲染
|
|
608
904
|
if (groupType && groupType.length > 0) {
|
|
609
905
|
return jsx(Fragment, {
|
|
610
|
-
children: groupType.map(
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
906
|
+
children: groupType.map((item, index) => {
|
|
907
|
+
const type = item.value;
|
|
908
|
+
const listData = listCom[type] || [];
|
|
909
|
+
let str = 'selector-group-title';
|
|
614
910
|
if (index === 0) str += ' selector-group-title-first';
|
|
615
911
|
return jsxs(Fragment$1, {
|
|
616
912
|
children: [listData.length > 0 && jsx("div", Object.assign({
|
|
@@ -625,11 +921,11 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
625
921
|
return handListNode(list || []);
|
|
626
922
|
};
|
|
627
923
|
/** 点击面包屑 */
|
|
628
|
-
|
|
924
|
+
const onClickBreadcrums = item => {
|
|
629
925
|
onClickBreadcrumbs && onClickBreadcrumbs(item);
|
|
630
926
|
};
|
|
631
927
|
/** 面包屑dom */
|
|
632
|
-
|
|
928
|
+
const handBreadcrumbs = () => {
|
|
633
929
|
if (!breadcrumbs || breadcrumbsList.length === 0) return null;
|
|
634
930
|
return jsx("div", Object.assign({
|
|
635
931
|
className: "nav-box"
|
|
@@ -642,7 +938,7 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
642
938
|
}));
|
|
643
939
|
};
|
|
644
940
|
/** 处理内容 */
|
|
645
|
-
|
|
941
|
+
const handContent = () => {
|
|
646
942
|
if ((list === null || list === void 0 ? void 0 : list.length) === 0 && !loading) {
|
|
647
943
|
// 空状态
|
|
648
944
|
return jsx("div", Object.assign({
|
|
@@ -670,8 +966,8 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
670
966
|
})), handLoadMore()]
|
|
671
967
|
}));
|
|
672
968
|
};
|
|
673
|
-
|
|
674
|
-
|
|
969
|
+
const handClass = () => {
|
|
970
|
+
let str = 'selector-main-content';
|
|
675
971
|
if (className) str += " ".concat(className);
|
|
676
972
|
if (disabled) str += ' selector-main-content-disabled';
|
|
677
973
|
if (isAllCheck && selectMode === 'check') str += ' selector-main-content-all-check';
|
|
@@ -685,99 +981,87 @@ var SelectorMainContent = function SelectorMainContent(props) {
|
|
|
685
981
|
children: [handBreadcrumbs(), handContent()]
|
|
686
982
|
}));
|
|
687
983
|
};
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
rowKey =
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
onSearch = props.onSearch,
|
|
732
|
-
onRefresh = props.onRefresh;
|
|
733
|
-
var intl = useFormatMessage('Selector', localeJson);
|
|
734
|
-
var _useState3 = useState(false),
|
|
735
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
736
|
-
showSearch = _useState4[0],
|
|
737
|
-
setShowSearch = _useState4[1]; // 显示搜索/
|
|
738
|
-
var _useState5 = useState(''),
|
|
739
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
740
|
-
searchStr = _useState6[0],
|
|
741
|
-
setSearchStr = _useState6[1];
|
|
742
|
-
var constData = useRef({
|
|
984
|
+
const SelectorMain = props => {
|
|
985
|
+
const {
|
|
986
|
+
className,
|
|
987
|
+
style,
|
|
988
|
+
url,
|
|
989
|
+
value,
|
|
990
|
+
rowKey = 'key',
|
|
991
|
+
nodeMode = 'branch',
|
|
992
|
+
selectMode,
|
|
993
|
+
loadMore = false,
|
|
994
|
+
searchLoadMore = false,
|
|
995
|
+
isAllCheck = false,
|
|
996
|
+
disabled,
|
|
997
|
+
disabledChild,
|
|
998
|
+
detail,
|
|
999
|
+
detailRender,
|
|
1000
|
+
isLazy,
|
|
1001
|
+
list,
|
|
1002
|
+
groupType,
|
|
1003
|
+
groupRange,
|
|
1004
|
+
search,
|
|
1005
|
+
searchVal = '',
|
|
1006
|
+
searchPlaceholder,
|
|
1007
|
+
searchTrigger,
|
|
1008
|
+
searchLoading,
|
|
1009
|
+
searchList,
|
|
1010
|
+
loading,
|
|
1011
|
+
breadcrumbs,
|
|
1012
|
+
breadcrumbsSeparator = '-',
|
|
1013
|
+
breadcrumbsList = [],
|
|
1014
|
+
fieldConfig,
|
|
1015
|
+
onClickBreadcrumbs,
|
|
1016
|
+
onLevel,
|
|
1017
|
+
onSelect,
|
|
1018
|
+
onLoad,
|
|
1019
|
+
onAllCheck,
|
|
1020
|
+
onSearch,
|
|
1021
|
+
onRefresh
|
|
1022
|
+
} = props;
|
|
1023
|
+
const intl = useFormatMessage('Selector', localeJson);
|
|
1024
|
+
const [showSearch, setShowSearch] = useState(false); // 显示搜索/
|
|
1025
|
+
const [searchStr, setSearchStr] = useState('');
|
|
1026
|
+
const constData = useRef({
|
|
743
1027
|
searchTimer: null,
|
|
744
1028
|
searchStr: ''
|
|
745
1029
|
});
|
|
746
|
-
useEffect(
|
|
1030
|
+
useEffect(() => {
|
|
747
1031
|
if (!searchVal) return;
|
|
748
1032
|
constData.current.searchStr = searchVal.val;
|
|
749
1033
|
setSearchStr(searchVal.val);
|
|
750
1034
|
if (searchVal.val !== '') setShowSearch(true);
|
|
751
1035
|
}, [searchVal]);
|
|
752
1036
|
/** 改变搜索框 */
|
|
753
|
-
|
|
1037
|
+
const changeSearch = val => {
|
|
754
1038
|
setSearchStr(val);
|
|
755
1039
|
constData.current.searchStr = val;
|
|
756
1040
|
if (searchTrigger !== 'onEnter') onSearchCom();
|
|
757
1041
|
};
|
|
758
1042
|
/** 搜索框回车事件 */
|
|
759
|
-
|
|
1043
|
+
const onEnterSearch = () => {
|
|
760
1044
|
onSearchCom(true);
|
|
761
1045
|
};
|
|
762
1046
|
/** 点击搜索按钮 */
|
|
763
|
-
|
|
1047
|
+
const onClickRightIcon = () => {
|
|
764
1048
|
onSearchCom(true);
|
|
765
1049
|
};
|
|
766
1050
|
/** 点击清除按钮 */
|
|
767
|
-
|
|
1051
|
+
const onClear = () => {
|
|
768
1052
|
onSearchCom();
|
|
769
1053
|
};
|
|
770
1054
|
/** 向外抛出搜索事件 */
|
|
771
|
-
|
|
1055
|
+
const onSearchCom = bol => {
|
|
772
1056
|
clearTimeout(constData.current.searchTimer);
|
|
773
|
-
constData.current.searchTimer = setTimeout(
|
|
1057
|
+
constData.current.searchTimer = setTimeout(() => {
|
|
774
1058
|
setShowSearch(!!constData.current.searchStr);
|
|
775
1059
|
onSearch && onSearch(constData.current.searchStr, !!bol);
|
|
776
1060
|
}, 300);
|
|
777
1061
|
};
|
|
778
1062
|
/** 搜索dom */
|
|
779
|
-
|
|
780
|
-
|
|
1063
|
+
const handSearchDom = () => {
|
|
1064
|
+
const handSearchIcon = () => {
|
|
781
1065
|
if (!searchStr) {
|
|
782
1066
|
// 本地数据且没有自定义刷新事件
|
|
783
1067
|
if (!url && !onRefresh) {
|
|
@@ -808,27 +1092,23 @@ var SelectorMain = function SelectorMain(props) {
|
|
|
808
1092
|
/** 点击下级
|
|
809
1093
|
* @param isSearch {boolean}
|
|
810
1094
|
* */
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
onLevel && onLevel(item, isSearch);
|
|
819
|
-
};
|
|
1095
|
+
const onLevelCom = isSearch => item => {
|
|
1096
|
+
if (isSearch) {
|
|
1097
|
+
constData.current.searchStr = '';
|
|
1098
|
+
setSearchStr('');
|
|
1099
|
+
setShowSearch(false);
|
|
1100
|
+
}
|
|
1101
|
+
onLevel && onLevel(item, isSearch);
|
|
820
1102
|
};
|
|
821
1103
|
/**
|
|
822
1104
|
* 加载更多
|
|
823
1105
|
* @param isSearch {boolean} 是否搜索
|
|
824
1106
|
* */
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
onLoad && onLoad(isSearch);
|
|
828
|
-
};
|
|
1107
|
+
const onLoadCom = isSearch => () => {
|
|
1108
|
+
onLoad && onLoad(isSearch);
|
|
829
1109
|
};
|
|
830
1110
|
/** 渲染列表 */
|
|
831
|
-
|
|
1111
|
+
const handListDom = () => {
|
|
832
1112
|
return jsx(SelectorMainContent, {
|
|
833
1113
|
className: "selector-main-list-box",
|
|
834
1114
|
value: value,
|
|
@@ -857,7 +1137,7 @@ var SelectorMain = function SelectorMain(props) {
|
|
|
857
1137
|
}, "list");
|
|
858
1138
|
};
|
|
859
1139
|
/** 渲染搜索列表 */
|
|
860
|
-
|
|
1140
|
+
const handSearchList = () => {
|
|
861
1141
|
if (!showSearch) return;
|
|
862
1142
|
return jsx(SelectorMainContent, {
|
|
863
1143
|
className: 'selector-main-search-content',
|
|
@@ -882,14 +1162,14 @@ var SelectorMain = function SelectorMain(props) {
|
|
|
882
1162
|
}, "search");
|
|
883
1163
|
};
|
|
884
1164
|
/** 处理loading */
|
|
885
|
-
|
|
1165
|
+
const handLoading = () => {
|
|
886
1166
|
if (searchLoading || loading) {
|
|
887
1167
|
return jsx(Loading, {});
|
|
888
1168
|
}
|
|
889
1169
|
};
|
|
890
1170
|
// 处理class
|
|
891
|
-
|
|
892
|
-
|
|
1171
|
+
const handClass = () => {
|
|
1172
|
+
let str = "".concat($prefixCls, "-selector-main");
|
|
893
1173
|
if (className) str += " ".concat(className);
|
|
894
1174
|
if (selectMode === 'check') str += " ".concat($prefixCls, "-selector-main-select");
|
|
895
1175
|
if (showSearch) str += " ".concat($prefixCls, "-selector-main-show-search");
|
|
@@ -912,40 +1192,38 @@ var SelectorMain = function SelectorMain(props) {
|
|
|
912
1192
|
var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-selector-data.paraui-v4-selector-data-node > .selector-data-node-box {\n padding: 10px 0 10px 0;\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-node > .selector-data-node-box > .title {\n font-size: 14px;\n color: rgb(29, 33, 38);\n padding: 0 10px;\n margin-bottom: 10px;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-node > .selector-data-node-box > .title > .title-content {\n margin-left: 8px;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-node > .selector-data-node-box > .content {\n overflow-y: auto;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box {\n padding-top: 10px;\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .title {\n font-size: 14px;\n color: rgb(29, 33, 38);\n padding: 0 10px;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .content {\n padding: 0 10px 10px 10px;\n overflow: auto;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .content > .content-tag {\n display: inline-flex;\n height: 24px;\n align-items: center;\n padding: 0 10px;\n border-radius: 4px;\n background-color: rgb(234, 236, 241);\n margin-right: 4px;\n margin-top: 4px;\n max-width: calc(100% - 8px);\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .content > .content-tag > span {\n font-size: 14px;\n color: rgb(29, 33, 38);\n overflow: hidden;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .content > .content-tag > svg {\n font-size: 16px;\n margin-left: 4px;\n color: rgb(29, 33, 38);\n cursor: pointer;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .content > .content-tag > svg:hover {\n color: rgb(46, 101, 230);\n}";
|
|
913
1193
|
styleInject(css_248z$1);
|
|
914
1194
|
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
layout =
|
|
919
|
-
style
|
|
920
|
-
list
|
|
921
|
-
groupType
|
|
922
|
-
nodeMode
|
|
923
|
-
backDataFieldConfig
|
|
924
|
-
detail
|
|
925
|
-
detailRender
|
|
926
|
-
disabled
|
|
927
|
-
handSelectorNodeInfo
|
|
928
|
-
selectDataTitleRender
|
|
929
|
-
selectRenderItem
|
|
930
|
-
selectRender
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
setListCom = _useState2[1];
|
|
937
|
-
var constData = useRef({
|
|
1195
|
+
const SelectorData = props => {
|
|
1196
|
+
const {
|
|
1197
|
+
className,
|
|
1198
|
+
layout = 'node',
|
|
1199
|
+
style,
|
|
1200
|
+
list,
|
|
1201
|
+
groupType,
|
|
1202
|
+
nodeMode,
|
|
1203
|
+
backDataFieldConfig,
|
|
1204
|
+
detail,
|
|
1205
|
+
detailRender,
|
|
1206
|
+
disabled,
|
|
1207
|
+
handSelectorNodeInfo,
|
|
1208
|
+
selectDataTitleRender,
|
|
1209
|
+
selectRenderItem,
|
|
1210
|
+
selectRender,
|
|
1211
|
+
onClose
|
|
1212
|
+
} = props;
|
|
1213
|
+
const intl = useFormatMessage('Selector', localeJson);
|
|
1214
|
+
const [listCom, setListCom] = useState({});
|
|
1215
|
+
const constData = useRef({
|
|
938
1216
|
listTypeJson: {},
|
|
939
1217
|
backDataFieldConfig: {}
|
|
940
1218
|
});
|
|
941
1219
|
constData.current.listTypeJson = ArrayToObject('value', groupType);
|
|
942
1220
|
constData.current.backDataFieldConfig = backDataFieldConfig || {};
|
|
943
|
-
useEffect(
|
|
1221
|
+
useEffect(() => {
|
|
944
1222
|
if (list && groupType && groupType.length > 0) {
|
|
945
|
-
|
|
946
|
-
for (
|
|
947
|
-
|
|
948
|
-
|
|
1223
|
+
const json = {};
|
|
1224
|
+
for (let i = 0, l = list.length; i < l; i++) {
|
|
1225
|
+
const item = list[i];
|
|
1226
|
+
const type = item[constData.current.backDataFieldConfig.type || ''];
|
|
949
1227
|
if (!json[type]) json[type] = [];
|
|
950
1228
|
json[type].push(item);
|
|
951
1229
|
}
|
|
@@ -953,12 +1231,12 @@ var SelectorData = function SelectorData(props) {
|
|
|
953
1231
|
}
|
|
954
1232
|
}, [list]);
|
|
955
1233
|
/** 处理禁用 */
|
|
956
|
-
|
|
1234
|
+
const handDisabled = itemConfig => {
|
|
957
1235
|
if (disabled) {
|
|
958
1236
|
if (disabled === true) return true;
|
|
959
1237
|
if (disabled instanceof Array) {
|
|
960
|
-
|
|
961
|
-
|
|
1238
|
+
const keyStr = (backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '';
|
|
1239
|
+
const val = itemConfig[keyStr];
|
|
962
1240
|
if (disabled.indexOf(val) !== -1) {
|
|
963
1241
|
return true;
|
|
964
1242
|
}
|
|
@@ -967,56 +1245,40 @@ var SelectorData = function SelectorData(props) {
|
|
|
967
1245
|
return false;
|
|
968
1246
|
};
|
|
969
1247
|
/** 处理每个节点的配置 */
|
|
970
|
-
|
|
971
|
-
|
|
1248
|
+
const handNodeConfig = (itemConfig, index) => {
|
|
1249
|
+
let item = itemConfig;
|
|
972
1250
|
if (handSelectorNodeInfo) item = handSelectorNodeInfo(itemConfig);
|
|
973
|
-
|
|
974
|
-
|
|
1251
|
+
const disabledItem = handDisabled(itemConfig);
|
|
1252
|
+
const json = {
|
|
975
1253
|
useCase: 'edit',
|
|
976
1254
|
close: !disabledItem,
|
|
977
|
-
detail
|
|
1255
|
+
detail,
|
|
978
1256
|
data: item,
|
|
979
|
-
nodeMode
|
|
980
|
-
onClose:
|
|
981
|
-
return _onClose && _onClose(item, index);
|
|
982
|
-
},
|
|
1257
|
+
nodeMode,
|
|
1258
|
+
onClose: () => onClose && onClose(item, index),
|
|
983
1259
|
disabled: handDisabled(itemConfig),
|
|
984
1260
|
tagStyle: item.tagStyle
|
|
985
1261
|
};
|
|
986
1262
|
if (selectRenderItem) {
|
|
987
|
-
json.leftRender =
|
|
1263
|
+
json.leftRender = () => {
|
|
988
1264
|
return selectRenderItem(itemConfig);
|
|
989
1265
|
};
|
|
990
1266
|
}
|
|
991
1267
|
/** 节点类型 */
|
|
992
1268
|
if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
|
|
993
1269
|
/** 渲染字段 */
|
|
994
|
-
|
|
995
|
-
for (
|
|
996
|
-
|
|
997
|
-
|
|
1270
|
+
const arr = ['img', 'mainTitle', 'subTitle', 'tag'];
|
|
1271
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
1272
|
+
const key = arr[i] || '';
|
|
1273
|
+
const backName = backDataFieldConfig && backDataFieldConfig[key] || '';
|
|
998
1274
|
json[key] = item[backName];
|
|
999
1275
|
}
|
|
1000
1276
|
/** 详情render */
|
|
1001
1277
|
if (detailRender) {
|
|
1002
|
-
json.detailRender = function () {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
while (1) switch (_context.prev = _context.next) {
|
|
1007
|
-
case 0:
|
|
1008
|
-
_context.next = 2;
|
|
1009
|
-
return detailRender(item, false);
|
|
1010
|
-
case 2:
|
|
1011
|
-
Dom = _context.sent;
|
|
1012
|
-
return _context.abrupt("return", Dom);
|
|
1013
|
-
case 4:
|
|
1014
|
-
case "end":
|
|
1015
|
-
return _context.stop();
|
|
1016
|
-
}
|
|
1017
|
-
}, _callee);
|
|
1018
|
-
}));
|
|
1019
|
-
};
|
|
1278
|
+
json.detailRender = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1279
|
+
const Dom = yield detailRender(item, false);
|
|
1280
|
+
return Dom;
|
|
1281
|
+
});
|
|
1020
1282
|
}
|
|
1021
1283
|
if (item.detail !== undefined) json.detail = item.detail;
|
|
1022
1284
|
/** 是否具有删除 */
|
|
@@ -1024,23 +1286,23 @@ var SelectorData = function SelectorData(props) {
|
|
|
1024
1286
|
return json;
|
|
1025
1287
|
};
|
|
1026
1288
|
/** 处理节点 */
|
|
1027
|
-
|
|
1289
|
+
const handNode = () => {
|
|
1028
1290
|
if (selectRender) {
|
|
1029
1291
|
return selectRender(list || []);
|
|
1030
1292
|
}
|
|
1031
|
-
return list === null || list === void 0 ? void 0 : list.map(
|
|
1293
|
+
return list === null || list === void 0 ? void 0 : list.map((item, index) => {
|
|
1032
1294
|
return jsx(SelectorNode, Object.assign({}, handNodeConfig(item, index)), index);
|
|
1033
1295
|
});
|
|
1034
1296
|
};
|
|
1035
1297
|
/** 处理标题 */
|
|
1036
|
-
|
|
1037
|
-
|
|
1298
|
+
const handTitle = () => {
|
|
1299
|
+
const handTitleTag = () => {
|
|
1038
1300
|
if (selectDataTitleRender) return selectDataTitleRender(list);
|
|
1039
1301
|
if (groupType) {
|
|
1040
1302
|
return jsx(Fragment, {
|
|
1041
|
-
children: groupType.map(
|
|
1042
|
-
|
|
1043
|
-
|
|
1303
|
+
children: groupType.map((item, index) => {
|
|
1304
|
+
let num = 0;
|
|
1305
|
+
const val = item.value;
|
|
1044
1306
|
if (listCom[val]) num = listCom[val].length;
|
|
1045
1307
|
if (num === 0) return;
|
|
1046
1308
|
return jsxs("span", Object.assign({
|
|
@@ -1065,7 +1327,7 @@ var SelectorData = function SelectorData(props) {
|
|
|
1065
1327
|
}));
|
|
1066
1328
|
};
|
|
1067
1329
|
// 处理节点内容
|
|
1068
|
-
|
|
1330
|
+
const handContentNode = () => {
|
|
1069
1331
|
return jsxs("div", Object.assign({
|
|
1070
1332
|
className: "selector-data-node-box"
|
|
1071
1333
|
}, {
|
|
@@ -1077,13 +1339,13 @@ var SelectorData = function SelectorData(props) {
|
|
|
1077
1339
|
}));
|
|
1078
1340
|
};
|
|
1079
1341
|
// 处理内容
|
|
1080
|
-
|
|
1342
|
+
const handDetailTagContent = () => {
|
|
1081
1343
|
if (selectRender) {
|
|
1082
1344
|
return selectRender(list || []);
|
|
1083
1345
|
}
|
|
1084
1346
|
return jsx(Fragment, {
|
|
1085
|
-
children: list === null || list === void 0 ? void 0 : list.map(
|
|
1086
|
-
|
|
1347
|
+
children: list === null || list === void 0 ? void 0 : list.map((item, index) => {
|
|
1348
|
+
const disabledItem = handDisabled(item);
|
|
1087
1349
|
return jsxs("span", Object.assign({
|
|
1088
1350
|
className: "content-tag"
|
|
1089
1351
|
}, {
|
|
@@ -1092,16 +1354,14 @@ var SelectorData = function SelectorData(props) {
|
|
|
1092
1354
|
children: item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.mainTitle) || ''] || item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '']
|
|
1093
1355
|
})
|
|
1094
1356
|
}), !disabledItem && jsx(CloseIcon, {
|
|
1095
|
-
onClick:
|
|
1096
|
-
return _onClose && _onClose(item, index);
|
|
1097
|
-
}
|
|
1357
|
+
onClick: () => onClose && onClose(item, index)
|
|
1098
1358
|
})]
|
|
1099
1359
|
}), index);
|
|
1100
1360
|
})
|
|
1101
1361
|
});
|
|
1102
1362
|
};
|
|
1103
1363
|
// 处理tag内容
|
|
1104
|
-
|
|
1364
|
+
const handContentTag = () => {
|
|
1105
1365
|
return jsxs("div", Object.assign({
|
|
1106
1366
|
className: "selector-data-tag-box"
|
|
1107
1367
|
}, {
|
|
@@ -1112,8 +1372,8 @@ var SelectorData = function SelectorData(props) {
|
|
|
1112
1372
|
}))]
|
|
1113
1373
|
}));
|
|
1114
1374
|
};
|
|
1115
|
-
|
|
1116
|
-
|
|
1375
|
+
const handClass = () => {
|
|
1376
|
+
let str = "".concat($prefixCls, "-selector-data");
|
|
1117
1377
|
if (layout) str += " ".concat($prefixCls, "-selector-data-").concat(layout);
|
|
1118
1378
|
if (disabled === true) str += " ".concat($prefixCls, "-selector-data-disabled");
|
|
1119
1379
|
if (className) str += " ".concat(className);
|
|
@@ -1131,9 +1391,11 @@ var SelectorData = function SelectorData(props) {
|
|
|
1131
1391
|
* 发送请求
|
|
1132
1392
|
* @param obj {ReqFuncProps} 请求信息
|
|
1133
1393
|
*/
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1394
|
+
const reqFunc = obj => {
|
|
1395
|
+
const {
|
|
1396
|
+
method,
|
|
1397
|
+
data
|
|
1398
|
+
} = obj,
|
|
1137
1399
|
otherProps = __rest(obj, ["method", "data"]);
|
|
1138
1400
|
if (method === 'Get') {
|
|
1139
1401
|
return Get(Object.assign({
|
|
@@ -1142,7 +1404,7 @@ var reqFunc = function reqFunc(obj) {
|
|
|
1142
1404
|
}
|
|
1143
1405
|
if (method === 'Post') {
|
|
1144
1406
|
return Post(Object.assign({
|
|
1145
|
-
data
|
|
1407
|
+
data
|
|
1146
1408
|
}, otherProps));
|
|
1147
1409
|
}
|
|
1148
1410
|
};
|
|
@@ -1150,8 +1412,8 @@ var reqFunc = function reqFunc(obj) {
|
|
|
1150
1412
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-selector {\n border: 1px solid rgb(212, 218, 227);\n border-radius: 4px;\n display: flex;\n height: 100%;\n width: 100%;\n overflow: hidden;\n}\n.paraui-v4-selector svg {\n overflow: hidden;\n}\n.paraui-v4-selector.paraui-v4-selector-lr > .paraui-v4-selector-main {\n width: 50%;\n}\n.paraui-v4-selector.paraui-v4-selector-lr > .paraui-v4-selector-data {\n width: 50%;\n border-left: 1px solid rgb(234, 236, 241);\n}\n.paraui-v4-selector.paraui-v4-selector-tb {\n flex-direction: column;\n}\n.paraui-v4-selector.paraui-v4-selector-tb > .paraui-v4-selector-data {\n border-bottom: 1px solid rgb(212, 218, 227);\n max-height: 100px;\n}\n.paraui-v4-selector.paraui-v4-selector-tb > .paraui-v4-selector-main {\n overflow-y: auto;\n height: auto;\n flex: 1;\n}";
|
|
1151
1413
|
styleInject(css_248z);
|
|
1152
1414
|
|
|
1153
|
-
|
|
1154
|
-
|
|
1415
|
+
const handFieldConfig = (fieldConfig, rowKey) => {
|
|
1416
|
+
const json = Object.assign({
|
|
1155
1417
|
mainTitle: 'label',
|
|
1156
1418
|
children: 'children',
|
|
1157
1419
|
parentId: 'parentId',
|
|
@@ -1160,108 +1422,64 @@ var handFieldConfig = function handFieldConfig(fieldConfig, rowKey) {
|
|
|
1160
1422
|
}, fieldConfig);
|
|
1161
1423
|
return json;
|
|
1162
1424
|
};
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
className
|
|
1166
|
-
style
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
setCurrentData = _useState2[1]; // 当前展示的数据
|
|
1222
|
-
var _useState3 = useState(false),
|
|
1223
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1224
|
-
loadMore = _useState4[0],
|
|
1225
|
-
setLoadMore = _useState4[1]; // 加载更多
|
|
1226
|
-
var _useState5 = useState([]),
|
|
1227
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
1228
|
-
valueCom = _useState6[0],
|
|
1229
|
-
setValueCom = _useState6[1]; // 绑定的值
|
|
1230
|
-
var _useState7 = useState({}),
|
|
1231
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
1232
|
-
valueJsonCom = _useState8[0],
|
|
1233
|
-
setValueJsonCom = _useState8[1]; // 绑定的值,json
|
|
1234
|
-
var _useState9 = useState([]),
|
|
1235
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
1236
|
-
breadcrumbsList = _useState10[0],
|
|
1237
|
-
setBreadcrumbsList = _useState10[1]; // 面包屑
|
|
1238
|
-
var _useState11 = useState(false),
|
|
1239
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
1240
|
-
searchLoading = _useState12[0],
|
|
1241
|
-
setSearchLoading = _useState12[1]; // 搜索loading
|
|
1242
|
-
var _useState13 = useState({
|
|
1243
|
-
val: ''
|
|
1244
|
-
}),
|
|
1245
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
1246
|
-
searchVal = _useState14[0],
|
|
1247
|
-
setSearchVal = _useState14[1]; // 搜索值
|
|
1248
|
-
var _useState15 = useState([]),
|
|
1249
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
1250
|
-
searchList = _useState16[0],
|
|
1251
|
-
setSearchList = _useState16[1]; // 搜索数据
|
|
1252
|
-
var _useState17 = useState(false),
|
|
1253
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
1254
|
-
searchLoadMore = _useState18[0],
|
|
1255
|
-
setSearchLoadMore = _useState18[1]; // 是否显示搜索的加载更多按钮
|
|
1256
|
-
var _useState19 = useState(true),
|
|
1257
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
1258
|
-
loadingCom = _useState20[0],
|
|
1259
|
-
setLoadingCom = _useState20[1];
|
|
1260
|
-
var _useState21 = useState(),
|
|
1261
|
-
_useState22 = _slicedToArray(_useState21, 2),
|
|
1262
|
-
refreshCom = _useState22[0],
|
|
1263
|
-
setRefreshCom = _useState22[1];
|
|
1264
|
-
var constData = useRef({
|
|
1425
|
+
const Selector = props => {
|
|
1426
|
+
const {
|
|
1427
|
+
className,
|
|
1428
|
+
style,
|
|
1429
|
+
rowKey = 'key',
|
|
1430
|
+
layout = 'lr',
|
|
1431
|
+
nodeMode = 'branch',
|
|
1432
|
+
selectMode,
|
|
1433
|
+
refresh,
|
|
1434
|
+
ctx,
|
|
1435
|
+
url,
|
|
1436
|
+
method = 'Get',
|
|
1437
|
+
value,
|
|
1438
|
+
defaultValue,
|
|
1439
|
+
data,
|
|
1440
|
+
pagination = false,
|
|
1441
|
+
size = 10,
|
|
1442
|
+
isLazy = false,
|
|
1443
|
+
isAllCheck = true,
|
|
1444
|
+
disabled,
|
|
1445
|
+
disabledChild,
|
|
1446
|
+
detail,
|
|
1447
|
+
detailRender,
|
|
1448
|
+
backDataFieldConfig,
|
|
1449
|
+
search,
|
|
1450
|
+
searchPlaceholder,
|
|
1451
|
+
searchTrigger = 'onChange',
|
|
1452
|
+
breadcrumbs = true,
|
|
1453
|
+
breadcrumbsSeparator,
|
|
1454
|
+
breadcrumbsHead,
|
|
1455
|
+
showbreadcrumbsHead = true,
|
|
1456
|
+
groupType,
|
|
1457
|
+
groupRange = 'search',
|
|
1458
|
+
emptyProps,
|
|
1459
|
+
selectRenderItem,
|
|
1460
|
+
selectRender,
|
|
1461
|
+
onChange,
|
|
1462
|
+
onSelect,
|
|
1463
|
+
onSearch,
|
|
1464
|
+
onRefresh
|
|
1465
|
+
} = useGlobalProps(props, 'Selector');
|
|
1466
|
+
const intl = useFormatMessage('Selector', localeJson);
|
|
1467
|
+
const fieldConfigHand = handFieldConfig(props.fieldConfig, rowKey); // 字段配置,对应数据字段
|
|
1468
|
+
const selectorFieldConfigHand = Object.assign(Object.assign({}, fieldConfigHand), backDataFieldConfig); // 选中值字段配置,对应数据字段
|
|
1469
|
+
const [currentData, setCurrentData] = useState([]); // 当前展示的数据
|
|
1470
|
+
const [loadMore, setLoadMore] = useState(false); // 加载更多
|
|
1471
|
+
const [valueCom, setValueCom] = useState([]); // 绑定的值
|
|
1472
|
+
const [valueJsonCom, setValueJsonCom] = useState({}); // 绑定的值,json
|
|
1473
|
+
const [breadcrumbsList, setBreadcrumbsList] = useState([]); // 面包屑
|
|
1474
|
+
const [searchLoading, setSearchLoading] = useState(false); // 搜索loading
|
|
1475
|
+
const [searchVal, setSearchVal] = useState({
|
|
1476
|
+
val: ''
|
|
1477
|
+
}); // 搜索值
|
|
1478
|
+
const [searchList, setSearchList] = useState([]); // 搜索数据
|
|
1479
|
+
const [searchLoadMore, setSearchLoadMore] = useState(false); // 是否显示搜索的加载更多按钮
|
|
1480
|
+
const [loadingCom, setLoadingCom] = useState(true);
|
|
1481
|
+
const [refreshCom, setRefreshCom] = useState();
|
|
1482
|
+
const constData = useRef({
|
|
1265
1483
|
/** 对象集合 所有的 */
|
|
1266
1484
|
jsonData: {},
|
|
1267
1485
|
/** 浅拷贝对象 所有的 */
|
|
@@ -1305,43 +1523,43 @@ var Selector = function Selector(props) {
|
|
|
1305
1523
|
constData.current.reqParams.pagination = pagination;
|
|
1306
1524
|
constData.current.reqParams.isLazy = isLazy;
|
|
1307
1525
|
// 本地数据 有接口的全量数据 -> 走本地数据逻辑
|
|
1308
|
-
|
|
1309
|
-
useEffect(
|
|
1526
|
+
const isReqLocalData = props.data || !constData.current.reqParams.isLazy && constData.current.noLazyReq;
|
|
1527
|
+
useEffect(() => {
|
|
1310
1528
|
if (defaultValue !== undefined) handValue(defaultValue);
|
|
1311
|
-
return
|
|
1529
|
+
return () => {
|
|
1312
1530
|
clearTimeout(constData.current.reqTimer);
|
|
1313
1531
|
};
|
|
1314
1532
|
}, []);
|
|
1315
|
-
useEffect(
|
|
1533
|
+
useEffect(() => {
|
|
1316
1534
|
if (value !== undefined) handValue(value);
|
|
1317
1535
|
}, [value]);
|
|
1318
1536
|
// 处理源数据
|
|
1319
|
-
useEffect(
|
|
1537
|
+
useEffect(() => {
|
|
1320
1538
|
if (data) {
|
|
1321
|
-
|
|
1539
|
+
const treeData = convertTree(data, false);
|
|
1322
1540
|
constData.current.oneDataList = treeData;
|
|
1323
1541
|
constData.current.currentSourceData = treeData;
|
|
1324
1542
|
setBreadcrumbsList([]);
|
|
1325
1543
|
handInitCurrent();
|
|
1326
1544
|
}
|
|
1327
1545
|
}, [data]);
|
|
1328
|
-
useEffect(
|
|
1546
|
+
useEffect(() => {
|
|
1329
1547
|
if (url) {
|
|
1330
1548
|
setBreadcrumbsList([]);
|
|
1331
1549
|
handInitCurrent();
|
|
1332
1550
|
}
|
|
1333
1551
|
}, [url]);
|
|
1334
1552
|
// 请求数据
|
|
1335
|
-
useEffect(
|
|
1553
|
+
useEffect(() => {
|
|
1336
1554
|
clearTimeout(constData.current.reqTimer);
|
|
1337
1555
|
if (props.url) Cancel(constData.current.reqId);
|
|
1338
|
-
constData.current.reqTimer = setTimeout(
|
|
1556
|
+
constData.current.reqTimer = setTimeout(() => {
|
|
1339
1557
|
// 本地数据 不是懒加载的全量接口数据
|
|
1340
1558
|
if (isReqLocalData) {
|
|
1341
|
-
|
|
1559
|
+
const currentSourceData = constData.current.currentSourceData;
|
|
1342
1560
|
if (constData.current.reqParams.pagination) {
|
|
1343
1561
|
// 分页
|
|
1344
|
-
|
|
1562
|
+
const sliceData = currentSourceData.slice(0, constData.current.page * constData.current.reqParams.size);
|
|
1345
1563
|
setCurrentData(sliceData);
|
|
1346
1564
|
// 没有加载更多
|
|
1347
1565
|
if (constData.current.page * constData.current.reqParams.size >= currentSourceData.length) {
|
|
@@ -1357,10 +1575,10 @@ var Selector = function Selector(props) {
|
|
|
1357
1575
|
}
|
|
1358
1576
|
// 远程数据
|
|
1359
1577
|
if (props.url) {
|
|
1360
|
-
|
|
1361
|
-
method
|
|
1578
|
+
const obj = {
|
|
1579
|
+
method,
|
|
1362
1580
|
url: props.url,
|
|
1363
|
-
ctx
|
|
1581
|
+
ctx,
|
|
1364
1582
|
uuid: constData.current.reqId,
|
|
1365
1583
|
data: Object.assign({
|
|
1366
1584
|
parentId: handParentId()
|
|
@@ -1381,11 +1599,11 @@ var Selector = function Selector(props) {
|
|
|
1381
1599
|
}
|
|
1382
1600
|
}, 50);
|
|
1383
1601
|
}, [refreshCom]);
|
|
1384
|
-
useEffect(
|
|
1602
|
+
useEffect(() => {
|
|
1385
1603
|
if (refresh) refreshFunc();
|
|
1386
1604
|
}, [refresh]);
|
|
1387
1605
|
/** 刷新 */
|
|
1388
|
-
|
|
1606
|
+
const refreshFunc = () => {
|
|
1389
1607
|
if (!isReqLocalData) {
|
|
1390
1608
|
constData.current.currentSourceData = [];
|
|
1391
1609
|
}
|
|
@@ -1396,8 +1614,8 @@ var Selector = function Selector(props) {
|
|
|
1396
1614
|
* @param item 节点数据
|
|
1397
1615
|
* @param bol 是否是搜索
|
|
1398
1616
|
* */
|
|
1399
|
-
|
|
1400
|
-
|
|
1617
|
+
const handNodeData = (item, bol) => {
|
|
1618
|
+
let itemData = {
|
|
1401
1619
|
key: item[rowKey],
|
|
1402
1620
|
parentId: item[fieldConfigHand.parentId],
|
|
1403
1621
|
type: item[fieldConfigHand.type],
|
|
@@ -1424,17 +1642,17 @@ var Selector = function Selector(props) {
|
|
|
1424
1642
|
* @param notTree true不生成树
|
|
1425
1643
|
* @param isSearch 是否搜索
|
|
1426
1644
|
* */
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1645
|
+
const convertTree = (arr, notTree, isSearch) => {
|
|
1646
|
+
const handArr = [];
|
|
1647
|
+
const json = {};
|
|
1430
1648
|
// 生成mappingd对象
|
|
1431
|
-
|
|
1432
|
-
for (
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1649
|
+
const recurrence = list => {
|
|
1650
|
+
for (let i = 0, l = list.length; i < l; i++) {
|
|
1651
|
+
const item = list[i];
|
|
1652
|
+
const keyStr = item[rowKey];
|
|
1653
|
+
const itemData = handNodeData(item, !!isSearch);
|
|
1436
1654
|
json[keyStr] = itemData;
|
|
1437
|
-
|
|
1655
|
+
const childrenName = fieldConfigHand.children;
|
|
1438
1656
|
constData.current.jsonDataCopy[keyStr] = item; // 原始数据
|
|
1439
1657
|
constData.current.jsonData[keyStr] = itemData; // 处理过的数据
|
|
1440
1658
|
if (item[childrenName]) {
|
|
@@ -1444,11 +1662,11 @@ var Selector = function Selector(props) {
|
|
|
1444
1662
|
};
|
|
1445
1663
|
recurrence(arr);
|
|
1446
1664
|
// 生成tree数据
|
|
1447
|
-
|
|
1448
|
-
for (
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1665
|
+
const arrKey = Object.keys(json);
|
|
1666
|
+
for (let i = 0, l = arrKey.length; i < l; i++) {
|
|
1667
|
+
const keyStr = arrKey[i];
|
|
1668
|
+
const item = json[keyStr];
|
|
1669
|
+
const parentId = item.parentId || '';
|
|
1452
1670
|
if (notTree) {
|
|
1453
1671
|
handArr.push(item);
|
|
1454
1672
|
continue;
|
|
@@ -1463,12 +1681,12 @@ var Selector = function Selector(props) {
|
|
|
1463
1681
|
return handArr;
|
|
1464
1682
|
};
|
|
1465
1683
|
/** 处理parentId */
|
|
1466
|
-
|
|
1467
|
-
|
|
1684
|
+
const handParentId = () => {
|
|
1685
|
+
let parentId;
|
|
1468
1686
|
// 面包屑最后一项做parent
|
|
1469
1687
|
if (constData.current.breadcrumbsList.length > 0) {
|
|
1470
1688
|
// 包含了根,所以要多加1
|
|
1471
|
-
|
|
1689
|
+
const item = constData.current.breadcrumbsList[constData.current.breadcrumbsList.length - 1];
|
|
1472
1690
|
parentId = item.value;
|
|
1473
1691
|
} else {
|
|
1474
1692
|
if (props.breadcrumbsHead) parentId = props.breadcrumbsHead.value; // 根
|
|
@@ -1478,67 +1696,47 @@ var Selector = function Selector(props) {
|
|
|
1478
1696
|
parentId = undefined;
|
|
1479
1697
|
if (props.breadcrumbsHead) parentId = props.breadcrumbsHead.value; // 根
|
|
1480
1698
|
}
|
|
1481
|
-
|
|
1482
1699
|
return parentId;
|
|
1483
1700
|
};
|
|
1484
1701
|
/** 请求 */
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
if (!err) {
|
|
1499
|
-
_context.next = 10;
|
|
1500
|
-
break;
|
|
1501
|
-
}
|
|
1502
|
-
setLoadingCom(false);
|
|
1503
|
-
if (constData.current.reqParams.isLazy) {
|
|
1504
|
-
// 懒加载
|
|
1505
|
-
if (constData.current.reqParams.pagination) {
|
|
1506
|
-
// 分页 第一页不处理
|
|
1507
|
-
if (constData.current.page !== 1) constData.current.page = constData.current.page - 1;
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
return _context.abrupt("return");
|
|
1511
|
-
case 10:
|
|
1512
|
-
if (!props.requestCallback) {
|
|
1513
|
-
_context.next = 13;
|
|
1514
|
-
break;
|
|
1515
|
-
}
|
|
1516
|
-
props.requestCallback(data, function (handData) {
|
|
1517
|
-
setLoadingCom(false);
|
|
1518
|
-
handReqData(handData);
|
|
1519
|
-
});
|
|
1520
|
-
return _context.abrupt("return");
|
|
1521
|
-
case 13:
|
|
1522
|
-
setLoadingCom(false);
|
|
1523
|
-
handReqData(data);
|
|
1524
|
-
case 15:
|
|
1525
|
-
case "end":
|
|
1526
|
-
return _context.stop();
|
|
1702
|
+
const handReq = obj => __awaiter(void 0, void 0, void 0, function* () {
|
|
1703
|
+
setLoadingCom(true);
|
|
1704
|
+
const {
|
|
1705
|
+
data,
|
|
1706
|
+
err
|
|
1707
|
+
} = yield reqFunc(obj);
|
|
1708
|
+
if (err) {
|
|
1709
|
+
setLoadingCom(false);
|
|
1710
|
+
if (constData.current.reqParams.isLazy) {
|
|
1711
|
+
// 懒加载
|
|
1712
|
+
if (constData.current.reqParams.pagination) {
|
|
1713
|
+
// 分页 第一页不处理
|
|
1714
|
+
if (constData.current.page !== 1) constData.current.page = constData.current.page - 1;
|
|
1527
1715
|
}
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
|
|
1716
|
+
}
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
if (props.requestCallback) {
|
|
1720
|
+
props.requestCallback(data, handData => {
|
|
1721
|
+
setLoadingCom(false);
|
|
1722
|
+
handReqData(handData);
|
|
1723
|
+
});
|
|
1724
|
+
return;
|
|
1725
|
+
}
|
|
1726
|
+
setLoadingCom(false);
|
|
1727
|
+
handReqData(data);
|
|
1728
|
+
});
|
|
1531
1729
|
/** 接口回来处理数据 */
|
|
1532
|
-
|
|
1730
|
+
const handReqData = resultData => {
|
|
1533
1731
|
if (constData.current.reqParams.isLazy) {
|
|
1534
1732
|
// 懒加载
|
|
1535
1733
|
if (constData.current.reqParams.pagination) {
|
|
1536
1734
|
// 分页
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1735
|
+
const result = resultData.data || {};
|
|
1736
|
+
const arr = result.list || [];
|
|
1737
|
+
const total = result.total;
|
|
1738
|
+
const arrHand = convertTree(arr, true);
|
|
1739
|
+
const currentD = [...constData.current.currentSourceData, ...arrHand];
|
|
1542
1740
|
constData.current.currentSourceData = currentD;
|
|
1543
1741
|
setCurrentData(currentD);
|
|
1544
1742
|
if (constData.current.page * constData.current.reqParams.size >= total) {
|
|
@@ -1548,45 +1746,45 @@ var Selector = function Selector(props) {
|
|
|
1548
1746
|
}
|
|
1549
1747
|
} else {
|
|
1550
1748
|
// 不分页 必须返回平铺的数组
|
|
1551
|
-
|
|
1552
|
-
|
|
1749
|
+
const arr = resultData.data || [];
|
|
1750
|
+
const treeData = convertTree(arr, true);
|
|
1553
1751
|
constData.current.currentSourceData = treeData;
|
|
1554
1752
|
setCurrentData(treeData);
|
|
1555
1753
|
}
|
|
1556
1754
|
} else {
|
|
1557
1755
|
// 不是懒加载 只请求一次
|
|
1558
1756
|
constData.current.noLazyReq = true;
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
constData.current.oneDataList =
|
|
1562
|
-
constData.current.currentSourceData =
|
|
1757
|
+
const arr = resultData.data || [];
|
|
1758
|
+
const treeData = convertTree(arr, false);
|
|
1759
|
+
constData.current.oneDataList = treeData; // 第一层数据
|
|
1760
|
+
constData.current.currentSourceData = treeData;
|
|
1563
1761
|
handInitCurrent();
|
|
1564
1762
|
}
|
|
1565
1763
|
};
|
|
1566
1764
|
/** 当前页初始更新 */
|
|
1567
|
-
|
|
1765
|
+
const handInitCurrent = () => {
|
|
1568
1766
|
constData.current.page = 1;
|
|
1569
1767
|
setRefreshCom(Math.random());
|
|
1570
1768
|
};
|
|
1571
1769
|
/** 处理value */
|
|
1572
|
-
|
|
1573
|
-
|
|
1770
|
+
const handValue = val => {
|
|
1771
|
+
let handVal = !val ? [] : [val];
|
|
1574
1772
|
if (val instanceof Array) {
|
|
1575
|
-
handVal =
|
|
1773
|
+
handVal = [...val];
|
|
1576
1774
|
}
|
|
1577
|
-
|
|
1775
|
+
const json = ArrayToObject(selectorFieldConfigHand.key, handVal);
|
|
1578
1776
|
constData.current.selectValueJson = json;
|
|
1579
1777
|
setValueJsonCom(json);
|
|
1580
|
-
setValueCom(
|
|
1778
|
+
setValueCom([...handVal]);
|
|
1581
1779
|
};
|
|
1582
1780
|
/** 点击下级,添加面包屑 */
|
|
1583
|
-
|
|
1584
|
-
|
|
1781
|
+
const onLevelAddBreadcrumbs = (item, isSearch) => {
|
|
1782
|
+
let arr = [...breadcrumbsList];
|
|
1585
1783
|
if (isSearch) {
|
|
1586
1784
|
arr = [];
|
|
1587
1785
|
if (constData.current.beforeSearchBreadcrumbs === null) {
|
|
1588
1786
|
// 记录搜索之前的面包屑
|
|
1589
|
-
constData.current.beforeSearchBreadcrumbs =
|
|
1787
|
+
constData.current.beforeSearchBreadcrumbs = [...breadcrumbsList];
|
|
1590
1788
|
}
|
|
1591
1789
|
}
|
|
1592
1790
|
arr.push({
|
|
@@ -1596,7 +1794,7 @@ var Selector = function Selector(props) {
|
|
|
1596
1794
|
setBreadcrumbsList(arr);
|
|
1597
1795
|
};
|
|
1598
1796
|
/** 点击下级 */
|
|
1599
|
-
|
|
1797
|
+
const onLevelCom = (item, isSearch) => {
|
|
1600
1798
|
onLevelAddBreadcrumbs(item, isSearch);
|
|
1601
1799
|
if (isReqLocalData) {
|
|
1602
1800
|
// 本地数据
|
|
@@ -1615,15 +1813,15 @@ var Selector = function Selector(props) {
|
|
|
1615
1813
|
}
|
|
1616
1814
|
};
|
|
1617
1815
|
/** 处理抛出去的数据 */
|
|
1618
|
-
|
|
1619
|
-
|
|
1816
|
+
const handEmitValue = item => {
|
|
1817
|
+
const arr = ['key', 'img', 'mainTitle', 'subTitle', 'tag'];
|
|
1620
1818
|
if (props.groupType && props.groupType.length > 0) {
|
|
1621
1819
|
arr.push('type');
|
|
1622
1820
|
}
|
|
1623
|
-
|
|
1624
|
-
for (
|
|
1625
|
-
|
|
1626
|
-
|
|
1821
|
+
const json = {};
|
|
1822
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
1823
|
+
const arrItem = arr[i];
|
|
1824
|
+
const name = selectorFieldConfigHand[arrItem];
|
|
1627
1825
|
if (name) json[name] = item[arrItem];
|
|
1628
1826
|
}
|
|
1629
1827
|
return json;
|
|
@@ -1635,81 +1833,57 @@ var Selector = function Selector(props) {
|
|
|
1635
1833
|
* @param node 处理过的节点数据
|
|
1636
1834
|
* @param rowData 原始数据节点
|
|
1637
1835
|
* */
|
|
1638
|
-
|
|
1836
|
+
const onChangeEmit = (val, valCom, node, rowData) => {
|
|
1639
1837
|
onChange && onChange(val, node, rowData);
|
|
1640
1838
|
if (value == undefined) {
|
|
1641
1839
|
handValue(!val ? [] : val);
|
|
1642
1840
|
}
|
|
1643
1841
|
};
|
|
1644
1842
|
/** 选择数据 */
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
if (selectMode === 'radio') {
|
|
1676
|
-
json = handEmitValue(item);
|
|
1677
|
-
onChangeEmit(json, [json], constData.current.jsonData[keyStr], constData.current.jsonDataCopy[keyStr]);
|
|
1678
|
-
}
|
|
1679
|
-
// 多选
|
|
1680
|
-
if (selectMode === 'check') {
|
|
1681
|
-
arr = [];
|
|
1682
|
-
node = {}; // 处理过得数据
|
|
1683
|
-
rowData = {}; // 原始数据
|
|
1684
|
-
// 把即将不选中的值,从valueCom里面拿掉
|
|
1685
|
-
for (i = 0, l = valueCom.length; i < l; i++) {
|
|
1686
|
-
valueComItem = valueCom[i]; // 选中valueCom都保留
|
|
1687
|
-
// 不选中 保留valueCom里面的key不等于当前的key
|
|
1688
|
-
if (!selectVal || item.key !== valueComItem[selectorFieldConfigHand.key]) {
|
|
1689
|
-
valueComItemId = valueComItem[selectorFieldConfigHand.key];
|
|
1690
|
-
node[valueComItemId] = constData.current.jsonData[valueComItemId];
|
|
1691
|
-
rowData[valueComItemId] = constData.current.jsonDataCopy[valueComItemId];
|
|
1692
|
-
arr.push(valueComItem);
|
|
1693
|
-
}
|
|
1694
|
-
}
|
|
1695
|
-
// 不选中 -> 选中
|
|
1696
|
-
if (!selectVal) {
|
|
1697
|
-
_json = handEmitValue(item);
|
|
1698
|
-
node[keyStr] = constData.current.jsonData[keyStr];
|
|
1699
|
-
rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
|
|
1700
|
-
arr.push(_json);
|
|
1701
|
-
}
|
|
1702
|
-
onChangeEmit(arr, arr, node, rowData);
|
|
1703
|
-
}
|
|
1704
|
-
case 12:
|
|
1705
|
-
case "end":
|
|
1706
|
-
return _context2.stop();
|
|
1843
|
+
const onSelectCom = item => __awaiter(void 0, void 0, void 0, function* () {
|
|
1844
|
+
const keyStr = item.key || ''; // key
|
|
1845
|
+
// 单选且选中,点击不触发
|
|
1846
|
+
if (selectMode === 'radio' && valueJsonCom[keyStr]) return;
|
|
1847
|
+
const selectVal = constData.current.selectValueJson[keyStr]; // 存在选中值当中 -> 选中变不选中
|
|
1848
|
+
if (onSelect) {
|
|
1849
|
+
// 有外部选择事件, 且返回true,不触发onChange事件
|
|
1850
|
+
const bol = yield onSelect(item, selectMode === 'radio' ? true : !selectVal, false);
|
|
1851
|
+
if (bol) return;
|
|
1852
|
+
}
|
|
1853
|
+
// 单选
|
|
1854
|
+
if (selectMode === 'radio') {
|
|
1855
|
+
const json = handEmitValue(item);
|
|
1856
|
+
onChangeEmit(json, [json], constData.current.jsonData[keyStr], constData.current.jsonDataCopy[keyStr]);
|
|
1857
|
+
}
|
|
1858
|
+
// 多选
|
|
1859
|
+
if (selectMode === 'check') {
|
|
1860
|
+
const arr = [];
|
|
1861
|
+
const node = {}; // 处理过得数据
|
|
1862
|
+
const rowData = {}; // 原始数据
|
|
1863
|
+
// 把即将不选中的值,从valueCom里面拿掉
|
|
1864
|
+
for (let i = 0, l = valueCom.length; i < l; i++) {
|
|
1865
|
+
const valueComItem = valueCom[i];
|
|
1866
|
+
// 选中valueCom都保留
|
|
1867
|
+
// 不选中 保留valueCom里面的key不等于当前的key
|
|
1868
|
+
if (!selectVal || item.key !== valueComItem[selectorFieldConfigHand.key]) {
|
|
1869
|
+
const valueComItemId = valueComItem[selectorFieldConfigHand.key];
|
|
1870
|
+
node[valueComItemId] = constData.current.jsonData[valueComItemId];
|
|
1871
|
+
rowData[valueComItemId] = constData.current.jsonDataCopy[valueComItemId];
|
|
1872
|
+
arr.push(valueComItem);
|
|
1707
1873
|
}
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
|
-
|
|
1874
|
+
}
|
|
1875
|
+
// 不选中 -> 选中
|
|
1876
|
+
if (!selectVal) {
|
|
1877
|
+
const json = handEmitValue(item);
|
|
1878
|
+
node[keyStr] = constData.current.jsonData[keyStr];
|
|
1879
|
+
rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
|
|
1880
|
+
arr.push(json);
|
|
1881
|
+
}
|
|
1882
|
+
onChangeEmit(arr, arr, node, rowData);
|
|
1883
|
+
}
|
|
1884
|
+
});
|
|
1711
1885
|
/** 处理禁用状态 */
|
|
1712
|
-
|
|
1886
|
+
const handDisabled = item => {
|
|
1713
1887
|
if (disabled) {
|
|
1714
1888
|
if (disabled === true) return true;
|
|
1715
1889
|
if (disabled instanceof Array) {
|
|
@@ -1725,97 +1899,63 @@ var Selector = function Selector(props) {
|
|
|
1725
1899
|
* 点击全选
|
|
1726
1900
|
* @param bol true全选
|
|
1727
1901
|
* */
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
item = arrList[i];
|
|
1749
|
-
keyStr = item.key || '';
|
|
1750
|
-
disabledItem = handDisabled(item);
|
|
1751
|
-
if (!disabledItem) {
|
|
1752
|
-
_context3.next = 14;
|
|
1753
|
-
break;
|
|
1754
|
-
}
|
|
1755
|
-
return _context3.abrupt("continue", 15);
|
|
1756
|
-
case 14:
|
|
1757
|
-
if (bol) {
|
|
1758
|
-
// 全选
|
|
1759
|
-
if (!constData.current.selectValueJson[keyStr]) {
|
|
1760
|
-
// 不存在选中值中
|
|
1761
|
-
arrVal.push(handEmitValue(item));
|
|
1762
|
-
selectEmitData.push(item);
|
|
1763
|
-
}
|
|
1764
|
-
} else {
|
|
1765
|
-
// 全不选
|
|
1766
|
-
if (constData.current.selectValueJson[keyStr]) {
|
|
1767
|
-
// 存在选中值中,拿掉
|
|
1768
|
-
selectArr.push(keyStr);
|
|
1769
|
-
selectEmitData.push(item);
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
case 15:
|
|
1773
|
-
i++;
|
|
1774
|
-
_context3.next = 8;
|
|
1775
|
-
break;
|
|
1776
|
-
case 18:
|
|
1777
|
-
for (_i = 0, _l = arrVal.length; _i < _l; _i++) {
|
|
1778
|
-
_item = arrVal[_i];
|
|
1779
|
-
_keyStr = _item[selectorFieldConfigHand.key];
|
|
1780
|
-
if (bol) {
|
|
1781
|
-
// 全选
|
|
1782
|
-
node[_keyStr] = constData.current.jsonData[_keyStr];
|
|
1783
|
-
rowData[_keyStr] = constData.current.jsonDataCopy[_keyStr];
|
|
1784
|
-
} else {
|
|
1785
|
-
// 全不选
|
|
1786
|
-
if (selectArr.indexOf(_keyStr) === -1) {
|
|
1787
|
-
// 不存在 全不选 - 当前列选中值
|
|
1788
|
-
node[_keyStr] = constData.current.jsonData[_keyStr];
|
|
1789
|
-
rowData[_keyStr] = constData.current.jsonDataCopy[_keyStr];
|
|
1790
|
-
arrval1.push(_item);
|
|
1791
|
-
}
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
emitArr = bol ? arrVal : arrval1;
|
|
1795
|
-
if (!onSelect) {
|
|
1796
|
-
_context3.next = 26;
|
|
1797
|
-
break;
|
|
1798
|
-
}
|
|
1799
|
-
_context3.next = 23;
|
|
1800
|
-
return onSelect(selectEmitData, !!bol, false);
|
|
1801
|
-
case 23:
|
|
1802
|
-
flag = _context3.sent;
|
|
1803
|
-
if (!flag) {
|
|
1804
|
-
_context3.next = 26;
|
|
1805
|
-
break;
|
|
1806
|
-
}
|
|
1807
|
-
return _context3.abrupt("return");
|
|
1808
|
-
case 26:
|
|
1809
|
-
onChangeEmit(emitArr, emitArr, node, rowData);
|
|
1810
|
-
case 27:
|
|
1811
|
-
case "end":
|
|
1812
|
-
return _context3.stop();
|
|
1902
|
+
const onAllCheckCom = bol => __awaiter(void 0, void 0, void 0, function* () {
|
|
1903
|
+
const arrList = [...currentData]; // 当前列的数据
|
|
1904
|
+
const arrVal = [...valueCom]; // 全选 绑定的值
|
|
1905
|
+
const arrval1 = []; // 全不选 绑定的值
|
|
1906
|
+
const node = {}; // 处理过得数据
|
|
1907
|
+
const rowData = {}; // 原始数据
|
|
1908
|
+
const selectArr = []; // 全不选 - 当前列选中值
|
|
1909
|
+
const selectEmitData = []; // 选择事件抛出去的值
|
|
1910
|
+
// 循环当前列数据
|
|
1911
|
+
for (let i = 0, l = arrList.length; i < l; i++) {
|
|
1912
|
+
const item = arrList[i];
|
|
1913
|
+
const keyStr = item.key || '';
|
|
1914
|
+
const disabledItem = handDisabled(item);
|
|
1915
|
+
if (disabledItem) continue;
|
|
1916
|
+
if (bol) {
|
|
1917
|
+
// 全选
|
|
1918
|
+
if (!constData.current.selectValueJson[keyStr]) {
|
|
1919
|
+
// 不存在选中值中
|
|
1920
|
+
arrVal.push(handEmitValue(item));
|
|
1921
|
+
selectEmitData.push(item);
|
|
1813
1922
|
}
|
|
1814
|
-
}
|
|
1815
|
-
|
|
1816
|
-
|
|
1923
|
+
} else {
|
|
1924
|
+
// 全不选
|
|
1925
|
+
if (constData.current.selectValueJson[keyStr]) {
|
|
1926
|
+
// 存在选中值中,拿掉
|
|
1927
|
+
selectArr.push(keyStr);
|
|
1928
|
+
selectEmitData.push(item);
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
for (let i = 0, l = arrVal.length; i < l; i++) {
|
|
1933
|
+
const item = arrVal[i];
|
|
1934
|
+
const keyStr = item[selectorFieldConfigHand.key];
|
|
1935
|
+
if (bol) {
|
|
1936
|
+
// 全选
|
|
1937
|
+
node[keyStr] = constData.current.jsonData[keyStr];
|
|
1938
|
+
rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
|
|
1939
|
+
} else {
|
|
1940
|
+
// 全不选
|
|
1941
|
+
if (selectArr.indexOf(keyStr) === -1) {
|
|
1942
|
+
// 不存在 全不选 - 当前列选中值
|
|
1943
|
+
node[keyStr] = constData.current.jsonData[keyStr];
|
|
1944
|
+
rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
|
|
1945
|
+
arrval1.push(item);
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
const emitArr = bol ? arrVal : arrval1;
|
|
1950
|
+
if (onSelect) {
|
|
1951
|
+
// 有外部选择事件, 且返回true,不触发onChange事件
|
|
1952
|
+
const flag = yield onSelect(selectEmitData, !!bol, false);
|
|
1953
|
+
if (flag) return;
|
|
1954
|
+
}
|
|
1955
|
+
onChangeEmit(emitArr, emitArr, node, rowData);
|
|
1956
|
+
});
|
|
1817
1957
|
/** 点击查看更多 */
|
|
1818
|
-
|
|
1958
|
+
const onLoadCom = isSearch => {
|
|
1819
1959
|
if (isSearch) {
|
|
1820
1960
|
// 搜索
|
|
1821
1961
|
constData.current.searchConfig.page = constData.current.searchConfig.page + 1;
|
|
@@ -1826,10 +1966,10 @@ var Selector = function Selector(props) {
|
|
|
1826
1966
|
setRefreshCom(Math.random());
|
|
1827
1967
|
};
|
|
1828
1968
|
/** 处理面包屑数组 */
|
|
1829
|
-
|
|
1830
|
-
|
|
1969
|
+
const handBreadcrumbsList = () => {
|
|
1970
|
+
const arr = [...breadcrumbsList];
|
|
1831
1971
|
// 根路径
|
|
1832
|
-
|
|
1972
|
+
const oneItem = breadcrumbsHead || {
|
|
1833
1973
|
label: intl({
|
|
1834
1974
|
id: 'root'
|
|
1835
1975
|
}),
|
|
@@ -1849,10 +1989,10 @@ var Selector = function Selector(props) {
|
|
|
1849
1989
|
return arr;
|
|
1850
1990
|
};
|
|
1851
1991
|
/** 截取面包屑数据 */
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
for (
|
|
1855
|
-
|
|
1992
|
+
const spliceBreadcrumbs = item => {
|
|
1993
|
+
const arr = [];
|
|
1994
|
+
for (let i = 0, l = breadcrumbsList.length; i < l; i++) {
|
|
1995
|
+
const itemB = breadcrumbsList[i];
|
|
1856
1996
|
arr.push(itemB);
|
|
1857
1997
|
if (itemB.value === item.value) {
|
|
1858
1998
|
break;
|
|
@@ -1861,20 +2001,20 @@ var Selector = function Selector(props) {
|
|
|
1861
2001
|
return arr;
|
|
1862
2002
|
};
|
|
1863
2003
|
/** 点击面包屑 */
|
|
1864
|
-
|
|
1865
|
-
|
|
2004
|
+
const onClickBreadcrumbsCom = item => {
|
|
2005
|
+
const list = constData.current.breadcrumbsList;
|
|
1866
2006
|
// 点击最后一层,不触发数据变更
|
|
1867
2007
|
if (list.length === 0 || item.value === list[list.length - 1].value) {
|
|
1868
2008
|
return;
|
|
1869
2009
|
}
|
|
1870
|
-
|
|
1871
|
-
|
|
2010
|
+
const keyStr = item.value || '';
|
|
2011
|
+
const oneValue = breadcrumbsHead ? breadcrumbsHead.value : '_paraui_first_floor';
|
|
1872
2012
|
// 点击搜索结果,显示上一次的搜索
|
|
1873
2013
|
if (item.value === '_paraui_search') {
|
|
1874
2014
|
setSearchVal({
|
|
1875
2015
|
val: constData.current.searchVal
|
|
1876
2016
|
});
|
|
1877
|
-
setBreadcrumbsList(
|
|
2017
|
+
setBreadcrumbsList([...(constData.current.beforeSearchBreadcrumbs || [])]);
|
|
1878
2018
|
return;
|
|
1879
2019
|
}
|
|
1880
2020
|
// 点击根路径且具有搜索面包屑
|
|
@@ -1898,10 +2038,10 @@ var Selector = function Selector(props) {
|
|
|
1898
2038
|
if (isReqLocalData) {
|
|
1899
2039
|
if (keyStr === oneValue) {
|
|
1900
2040
|
// 第一层
|
|
1901
|
-
constData.current.currentSourceData =
|
|
2041
|
+
constData.current.currentSourceData = [...constData.current.oneDataList];
|
|
1902
2042
|
} else {
|
|
1903
2043
|
// 除了第一级,最后一级
|
|
1904
|
-
|
|
2044
|
+
const itemData = constData.current.jsonData[keyStr];
|
|
1905
2045
|
constData.current.currentSourceData = itemData[fieldConfigHand.children];
|
|
1906
2046
|
}
|
|
1907
2047
|
} else {
|
|
@@ -1917,15 +2057,15 @@ var Selector = function Selector(props) {
|
|
|
1917
2057
|
handInitCurrent();
|
|
1918
2058
|
};
|
|
1919
2059
|
/** 处理搜索的请求 */
|
|
1920
|
-
|
|
1921
|
-
|
|
2060
|
+
const handSearchData = resultData => {
|
|
2061
|
+
const isTree = resultData.isTree;
|
|
1922
2062
|
if (constData.current.reqParams.pagination) {
|
|
1923
2063
|
// 分页
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2064
|
+
const result = resultData.data || {};
|
|
2065
|
+
const arr = result.list || [];
|
|
2066
|
+
const total = result.total;
|
|
2067
|
+
const arrHand = convertTree(arr, !isTree, true); // 搜索默认不生成树
|
|
2068
|
+
const currentD = [...constData.current.searchConfig.currentSourceData, ...arrHand];
|
|
1929
2069
|
constData.current.searchConfig.currentSourceData = currentD;
|
|
1930
2070
|
setSearchList(currentD);
|
|
1931
2071
|
if (constData.current.searchConfig.page * constData.current.searchConfig.size >= total) {
|
|
@@ -1935,16 +2075,18 @@ var Selector = function Selector(props) {
|
|
|
1935
2075
|
}
|
|
1936
2076
|
} else {
|
|
1937
2077
|
// 不分页 必须返回平铺的数组
|
|
1938
|
-
|
|
1939
|
-
|
|
2078
|
+
const arr = resultData.data || [];
|
|
2079
|
+
const treeData = convertTree(arr, !isTree, true); // 搜索默认不生成树
|
|
1940
2080
|
constData.current.searchConfig.currentSourceData = treeData;
|
|
1941
2081
|
setSearchList(treeData);
|
|
1942
2082
|
}
|
|
1943
2083
|
};
|
|
1944
2084
|
/** 处理搜索接口 */
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
2085
|
+
const handReqSearchResult = result => {
|
|
2086
|
+
const {
|
|
2087
|
+
data,
|
|
2088
|
+
err
|
|
2089
|
+
} = result;
|
|
1948
2090
|
if (err) {
|
|
1949
2091
|
setSearchLoading(false);
|
|
1950
2092
|
if (constData.current.reqParams.pagination) {
|
|
@@ -1954,7 +2096,7 @@ var Selector = function Selector(props) {
|
|
|
1954
2096
|
return;
|
|
1955
2097
|
}
|
|
1956
2098
|
if (props.requestCallback) {
|
|
1957
|
-
props.requestCallback(data,
|
|
2099
|
+
props.requestCallback(data, handData => {
|
|
1958
2100
|
setSearchLoading(false);
|
|
1959
2101
|
handSearchData(handData);
|
|
1960
2102
|
}, true);
|
|
@@ -1964,64 +2106,45 @@ var Selector = function Selector(props) {
|
|
|
1964
2106
|
handSearchData(data);
|
|
1965
2107
|
};
|
|
1966
2108
|
/** 搜索请求 */
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
}, props.params)
|
|
1997
|
-
};
|
|
1998
|
-
if (constData.current.reqParams.pagination) {
|
|
1999
|
-
obj.data.size = constData.current.searchConfig.size;
|
|
2000
|
-
obj.data.page = constData.current.searchConfig.page;
|
|
2001
|
-
}
|
|
2002
|
-
obj = props.paramsCallback ? props.paramsCallback(obj, true) : obj;
|
|
2003
|
-
_context4.next = 13;
|
|
2004
|
-
return reqFunc(obj);
|
|
2005
|
-
case 13:
|
|
2006
|
-
result = _context4.sent;
|
|
2007
|
-
handReqSearchResult(result);
|
|
2008
|
-
case 15:
|
|
2009
|
-
case "end":
|
|
2010
|
-
return _context4.stop();
|
|
2011
|
-
}
|
|
2012
|
-
}, _callee4);
|
|
2013
|
-
}));
|
|
2014
|
-
};
|
|
2109
|
+
const reqSearch = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
2110
|
+
var _a;
|
|
2111
|
+
if (onSearch) {
|
|
2112
|
+
const reqParams = {};
|
|
2113
|
+
if (constData.current.reqParams.pagination) {
|
|
2114
|
+
reqParams.size = constData.current.searchConfig.size;
|
|
2115
|
+
reqParams.page = constData.current.searchConfig.page;
|
|
2116
|
+
}
|
|
2117
|
+
const result = yield onSearch(constData.current.searchVal, reqParams);
|
|
2118
|
+
handReqSearchResult(result);
|
|
2119
|
+
return;
|
|
2120
|
+
}
|
|
2121
|
+
let obj = {
|
|
2122
|
+
method,
|
|
2123
|
+
url: props.url || '',
|
|
2124
|
+
ctx,
|
|
2125
|
+
uuid: constData.current.reqId,
|
|
2126
|
+
data: Object.assign({
|
|
2127
|
+
searchKey: (_a = constData.current.searchVal) === null || _a === void 0 ? void 0 : _a.trim()
|
|
2128
|
+
}, props.params)
|
|
2129
|
+
};
|
|
2130
|
+
if (constData.current.reqParams.pagination) {
|
|
2131
|
+
obj.data.size = constData.current.searchConfig.size;
|
|
2132
|
+
obj.data.page = constData.current.searchConfig.page;
|
|
2133
|
+
}
|
|
2134
|
+
obj = props.paramsCallback ? props.paramsCallback(obj, true) : obj;
|
|
2135
|
+
const result = yield reqFunc(obj);
|
|
2136
|
+
handReqSearchResult(result);
|
|
2137
|
+
});
|
|
2015
2138
|
/**
|
|
2016
2139
|
* 递归寻找子级
|
|
2017
2140
|
* */
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
for (
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2141
|
+
const convertChild = (id, arr) => {
|
|
2142
|
+
let arrHnad = arr;
|
|
2143
|
+
const recurrence = arrItem => {
|
|
2144
|
+
for (let i = 0, l = arrItem.length; i < l; i++) {
|
|
2145
|
+
const item = arrItem[i];
|
|
2146
|
+
const rowId = item[rowKey];
|
|
2147
|
+
const arrChild = item.children || [];
|
|
2025
2148
|
if (rowId === id) {
|
|
2026
2149
|
arrHnad = arrChild;
|
|
2027
2150
|
return;
|
|
@@ -2035,65 +2158,51 @@ var Selector = function Selector(props) {
|
|
|
2035
2158
|
/** 搜索回调
|
|
2036
2159
|
* @param bol 搜索框为空的情况下,触发搜索
|
|
2037
2160
|
* */
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
constData.current.beforeSearchBreadcrumbs = null;
|
|
2057
|
-
if (isReqLocalData) {
|
|
2058
|
-
// 本地全量数据
|
|
2059
|
-
// 搜索点过下级,修改了当前显示的数据
|
|
2060
|
-
// 从搜索恢复到正常列表, 需要从原始数据,取出当前层级对应的数据
|
|
2061
|
-
parentId = handParentId();
|
|
2062
|
-
arr = convertChild(parentId, constData.current.oneDataList);
|
|
2063
|
-
constData.current.currentSourceData = arr;
|
|
2064
|
-
}
|
|
2065
|
-
refreshFunc();
|
|
2066
|
-
}
|
|
2067
|
-
if (bol) {
|
|
2068
|
-
// 当前页刷新
|
|
2069
|
-
refreshFunc();
|
|
2070
|
-
onRefresh && onRefresh();
|
|
2071
|
-
}
|
|
2072
|
-
return _context5.abrupt("return");
|
|
2073
|
-
case 8:
|
|
2074
|
-
constData.current.searchConfig.page = 1;
|
|
2075
|
-
constData.current.searchConfig.currentSourceData = [];
|
|
2076
|
-
reqSearch();
|
|
2077
|
-
case 11:
|
|
2078
|
-
case "end":
|
|
2079
|
-
return _context5.stop();
|
|
2161
|
+
const onSearchCom = (val, bol) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2162
|
+
setSearchLoading(true);
|
|
2163
|
+
constData.current.searchVal = val;
|
|
2164
|
+
if (val === '') {
|
|
2165
|
+
setSearchList([]);
|
|
2166
|
+
setSearchLoading(false);
|
|
2167
|
+
if (constData.current.beforeSearchBreadcrumbs) {
|
|
2168
|
+
// 从搜索恢复到正常列表
|
|
2169
|
+
constData.current.breadcrumbsList = [...constData.current.beforeSearchBreadcrumbs];
|
|
2170
|
+
setBreadcrumbsList([...constData.current.beforeSearchBreadcrumbs]);
|
|
2171
|
+
constData.current.beforeSearchBreadcrumbs = null;
|
|
2172
|
+
if (isReqLocalData) {
|
|
2173
|
+
// 本地全量数据
|
|
2174
|
+
// 搜索点过下级,修改了当前显示的数据
|
|
2175
|
+
// 从搜索恢复到正常列表, 需要从原始数据,取出当前层级对应的数据
|
|
2176
|
+
const parentId = handParentId();
|
|
2177
|
+
const arr = convertChild(parentId, constData.current.oneDataList);
|
|
2178
|
+
constData.current.currentSourceData = arr;
|
|
2080
2179
|
}
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2180
|
+
refreshFunc();
|
|
2181
|
+
}
|
|
2182
|
+
if (bol) {
|
|
2183
|
+
// 当前页刷新
|
|
2184
|
+
refreshFunc();
|
|
2185
|
+
onRefresh && onRefresh();
|
|
2186
|
+
}
|
|
2187
|
+
return;
|
|
2188
|
+
}
|
|
2189
|
+
constData.current.searchConfig.page = 1;
|
|
2190
|
+
constData.current.searchConfig.currentSourceData = [];
|
|
2191
|
+
reqSearch();
|
|
2192
|
+
});
|
|
2084
2193
|
/** 删除数据 */
|
|
2085
|
-
|
|
2194
|
+
const onCloseCom = (item, index) => {
|
|
2086
2195
|
if (selectMode === 'radio') {
|
|
2087
2196
|
onChangeEmit(null, [], {}, {});
|
|
2088
2197
|
}
|
|
2089
2198
|
if (selectMode === 'check') {
|
|
2090
|
-
|
|
2199
|
+
const arr = [...valueCom];
|
|
2091
2200
|
arr.splice(index, 1);
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
for (
|
|
2095
|
-
|
|
2096
|
-
|
|
2201
|
+
const node = {}; // 处理过得数据
|
|
2202
|
+
const rowData = {}; // 原始数据
|
|
2203
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
2204
|
+
const item = arr[i];
|
|
2205
|
+
const keyStr = item[selectorFieldConfigHand.key];
|
|
2097
2206
|
node[keyStr] = constData.current.jsonData[keyStr];
|
|
2098
2207
|
rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
|
|
2099
2208
|
}
|
|
@@ -2101,7 +2210,7 @@ var Selector = function Selector(props) {
|
|
|
2101
2210
|
}
|
|
2102
2211
|
};
|
|
2103
2212
|
/** 处理返回数据dom配置 */
|
|
2104
|
-
|
|
2213
|
+
const handSelectorData = () => {
|
|
2105
2214
|
return jsx(SelectorData, {
|
|
2106
2215
|
layout: layout === 'tb' ? 'tag' : 'node',
|
|
2107
2216
|
backDataFieldConfig: selectorFieldConfigHand,
|
|
@@ -2120,8 +2229,8 @@ var Selector = function Selector(props) {
|
|
|
2120
2229
|
});
|
|
2121
2230
|
};
|
|
2122
2231
|
// 处理className
|
|
2123
|
-
|
|
2124
|
-
|
|
2232
|
+
const handClass = () => {
|
|
2233
|
+
let str = "".concat($prefixCls, "-selector");
|
|
2125
2234
|
if (className) str += " ".concat(className);
|
|
2126
2235
|
if (layout) str += " ".concat($prefixCls, "-selector-").concat(layout);
|
|
2127
2236
|
if (selectMode) str += " ".concat($prefixCls, "-selector-").concat(selectMode);
|