@para-ui/core 4.0.29 → 4.0.31
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/AutoButton/index.d.ts +41 -0
- package/AutoButton/index.js +213 -0
- package/AutoButton/lang/en_US.d.ts +4 -0
- package/AutoButton/lang/index.d.ts +9 -0
- package/AutoButton/lang/zh_CN.d.ts +4 -0
- package/Badge/index.d.ts +3 -1
- package/Badge/index.js +15 -5
- package/Card/index.d.ts +53 -0
- package/Card/index.js +218 -0
- package/Card/lang/en_US.d.ts +5 -0
- package/Card/lang/index.d.ts +11 -0
- package/Card/lang/zh_CN.d.ts +5 -0
- package/Cascader/index.js +6 -7
- package/ComboSelect/index.js +7 -4
- package/CycleSelector/index.js +3 -1
- package/DatePicker/index.js +3 -1
- package/DragVerify/index.js +7 -2
- package/DynamicMultiBox/index.js +8 -6
- package/Form/index.js +8 -5
- package/FormItem/index.js +8 -5
- package/Image/index.js +3 -4
- package/PopConfirm/index.js +2 -2
- package/PopMenu/index.js +16 -5
- package/QuickReply/index.js +1 -1
- package/README.md +14 -0
- package/RangeInput/index.d.ts +59 -0
- package/RangeInput/index.js +193 -0
- package/Select/index.js +2 -2
- package/Selector/index.js +282 -548
- package/SelectorPicker/index.js +5 -5
- package/SingleBox/index.js +2 -2
- package/SortBox/index.d.ts +27 -0
- package/SortBox/index.js +64 -0
- package/Stepper/index.js +1 -1
- package/Switch/index.js +2 -2
- package/Table/index.js +471 -409
- package/Tabs/index.js +2 -2
- package/Tag/index.js +82 -53
- package/TextEditor/index.js +3 -3
- package/TimePicker/index.js +3 -1
- package/Timeline/index.js +14 -20
- package/ToggleButton/index.js +25 -26
- package/Transfer/index.js +48 -43
- package/Tree/index.js +8 -5
- package/Upload/ImageUpload/index.d.ts +2 -7
- package/Upload/index.js +848 -495
- package/Upload/interface.d.ts +18 -0
- package/_verture/{Portal-5bd49559.js → Portal-edd94cac.js} +2 -2
- package/_verture/{index-15a0b6a6.js → index-3795d730.js} +1 -1
- package/_verture/{index-e9405e35.js → index-567b5779.js} +395 -313
- package/_verture/{index-68f0506c.js → index-8752ccab.js} +4 -5
- package/_verture/index-94e24006.js +327 -0
- package/_verture/{slicedToArray-a8206399.js → slicedToArray-75fa4188.js} +15 -2
- package/_verture/{toConsumableArray-8f4c9589.js → toConsumableArray-c7a8028f.js} +1 -1
- package/index.d.ts +8 -0
- package/index.js +16 -11
- package/locale/en-US.d.ts +7 -0
- package/locale/index.d.ts +14 -0
- package/locale/index.js +14 -0
- package/locale/zh-CN.d.ts +7 -0
- package/package.json +2 -4
- package/umd/AutoButton.js +43 -0
- package/umd/Badge.js +1 -1
- package/umd/Card.js +1 -0
- package/umd/DragVerify.js +1 -1
- package/umd/FunctionModal.js +3 -3
- package/umd/Modal.js +2 -2
- package/umd/PopMenu.js +2 -2
- package/umd/RangeInput.js +43 -0
- package/umd/SortBox.js +41 -0
- package/umd/Upload.js +4 -4
- package/umd/locale.js +1 -1
- package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
- /package/_verture/{index-0f5ee6f7.js → index-c8cb6751.js} +0 -0
- /package/_verture/{typeof-6ec38efd.js → typeof-4646b22c.js} +0 -0
package/Selector/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as __awaiter, _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useRef, useEffect, Fragment as Fragment$1 } from 'react';
|
|
4
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
5
|
-
import {
|
|
4
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-75fa4188.js';
|
|
5
|
+
import { r as regenerator } from '../_verture/index-94e24006.js';
|
|
6
6
|
import { Radio } from '../Radio/index.js';
|
|
7
7
|
import { Checkbox } from '../Checkbox/index.js';
|
|
8
8
|
import { Popover } from '../Popover/index.js';
|
|
@@ -19,7 +19,7 @@ import SearchIcon from '@para-ui/icons/Search';
|
|
|
19
19
|
import Refresh from '@para-ui/icons/Refresh';
|
|
20
20
|
import { ArrayToObject, Get, Post, Cancel } from '@paraview/lib';
|
|
21
21
|
import { u as useGlobalProps } from '../_verture/useGlobalProps-4ae1a007.js';
|
|
22
|
-
import '../_verture/
|
|
22
|
+
import '../_verture/typeof-4646b22c.js';
|
|
23
23
|
import '../Label/index.js';
|
|
24
24
|
import '../Help/index.js';
|
|
25
25
|
import '../Tooltip/index.js';
|
|
@@ -42,330 +42,6 @@ import 'dayjs';
|
|
|
42
42
|
import '@para-ui/icons/More';
|
|
43
43
|
import '@para-ui/icons/Return';
|
|
44
44
|
|
|
45
|
-
var regeneratorRuntime$1 = {exports: {}};
|
|
46
|
-
|
|
47
|
-
(function (module) {
|
|
48
|
-
var _typeof$1 = _typeof.exports["default"];
|
|
49
|
-
function _regeneratorRuntime() {
|
|
50
|
-
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
51
|
-
return e;
|
|
52
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
53
|
-
var t,
|
|
54
|
-
e = {},
|
|
55
|
-
r = Object.prototype,
|
|
56
|
-
n = r.hasOwnProperty,
|
|
57
|
-
o = Object.defineProperty || function (t, e, r) {
|
|
58
|
-
t[e] = r.value;
|
|
59
|
-
},
|
|
60
|
-
i = "function" == typeof Symbol ? Symbol : {},
|
|
61
|
-
a = i.iterator || "@@iterator",
|
|
62
|
-
c = i.asyncIterator || "@@asyncIterator",
|
|
63
|
-
u = i.toStringTag || "@@toStringTag";
|
|
64
|
-
function define(t, e, r) {
|
|
65
|
-
return Object.defineProperty(t, e, {
|
|
66
|
-
value: r,
|
|
67
|
-
enumerable: !0,
|
|
68
|
-
configurable: !0,
|
|
69
|
-
writable: !0
|
|
70
|
-
}), t[e];
|
|
71
|
-
}
|
|
72
|
-
try {
|
|
73
|
-
define({}, "");
|
|
74
|
-
} catch (t) {
|
|
75
|
-
define = function define(t, e, r) {
|
|
76
|
-
return t[e] = r;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function wrap(t, e, r, n) {
|
|
80
|
-
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
81
|
-
a = Object.create(i.prototype),
|
|
82
|
-
c = new Context(n || []);
|
|
83
|
-
return o(a, "_invoke", {
|
|
84
|
-
value: makeInvokeMethod(t, r, c)
|
|
85
|
-
}), a;
|
|
86
|
-
}
|
|
87
|
-
function tryCatch(t, e, r) {
|
|
88
|
-
try {
|
|
89
|
-
return {
|
|
90
|
-
type: "normal",
|
|
91
|
-
arg: t.call(e, r)
|
|
92
|
-
};
|
|
93
|
-
} catch (t) {
|
|
94
|
-
return {
|
|
95
|
-
type: "throw",
|
|
96
|
-
arg: t
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
e.wrap = wrap;
|
|
101
|
-
var h = "suspendedStart",
|
|
102
|
-
l = "suspendedYield",
|
|
103
|
-
f = "executing",
|
|
104
|
-
s = "completed",
|
|
105
|
-
y = {};
|
|
106
|
-
function Generator() {}
|
|
107
|
-
function GeneratorFunction() {}
|
|
108
|
-
function GeneratorFunctionPrototype() {}
|
|
109
|
-
var p = {};
|
|
110
|
-
define(p, a, function () {
|
|
111
|
-
return this;
|
|
112
|
-
});
|
|
113
|
-
var d = Object.getPrototypeOf,
|
|
114
|
-
v = d && d(d(values([])));
|
|
115
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
116
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
117
|
-
function defineIteratorMethods(t) {
|
|
118
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
119
|
-
define(t, e, function (t) {
|
|
120
|
-
return this._invoke(e, t);
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
function AsyncIterator(t, e) {
|
|
125
|
-
function invoke(r, o, i, a) {
|
|
126
|
-
var c = tryCatch(t[r], t, o);
|
|
127
|
-
if ("throw" !== c.type) {
|
|
128
|
-
var u = c.arg,
|
|
129
|
-
h = u.value;
|
|
130
|
-
return h && "object" == _typeof$1(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
131
|
-
invoke("next", t, i, a);
|
|
132
|
-
}, function (t) {
|
|
133
|
-
invoke("throw", t, i, a);
|
|
134
|
-
}) : e.resolve(h).then(function (t) {
|
|
135
|
-
u.value = t, i(u);
|
|
136
|
-
}, function (t) {
|
|
137
|
-
return invoke("throw", t, i, a);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
a(c.arg);
|
|
141
|
-
}
|
|
142
|
-
var r;
|
|
143
|
-
o(this, "_invoke", {
|
|
144
|
-
value: function value(t, n) {
|
|
145
|
-
function callInvokeWithMethodAndArg() {
|
|
146
|
-
return new e(function (e, r) {
|
|
147
|
-
invoke(t, n, e, r);
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
function makeInvokeMethod(e, r, n) {
|
|
155
|
-
var o = h;
|
|
156
|
-
return function (i, a) {
|
|
157
|
-
if (o === f) throw Error("Generator is already running");
|
|
158
|
-
if (o === s) {
|
|
159
|
-
if ("throw" === i) throw a;
|
|
160
|
-
return {
|
|
161
|
-
value: t,
|
|
162
|
-
done: !0
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
for (n.method = i, n.arg = a;;) {
|
|
166
|
-
var c = n.delegate;
|
|
167
|
-
if (c) {
|
|
168
|
-
var u = maybeInvokeDelegate(c, n);
|
|
169
|
-
if (u) {
|
|
170
|
-
if (u === y) continue;
|
|
171
|
-
return u;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
175
|
-
if (o === h) throw o = s, n.arg;
|
|
176
|
-
n.dispatchException(n.arg);
|
|
177
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
178
|
-
o = f;
|
|
179
|
-
var p = tryCatch(e, r, n);
|
|
180
|
-
if ("normal" === p.type) {
|
|
181
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
182
|
-
return {
|
|
183
|
-
value: p.arg,
|
|
184
|
-
done: n.done
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
function maybeInvokeDelegate(e, r) {
|
|
192
|
-
var n = r.method,
|
|
193
|
-
o = e.iterator[n];
|
|
194
|
-
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;
|
|
195
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
196
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
197
|
-
var a = i.arg;
|
|
198
|
-
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);
|
|
199
|
-
}
|
|
200
|
-
function pushTryEntry(t) {
|
|
201
|
-
var e = {
|
|
202
|
-
tryLoc: t[0]
|
|
203
|
-
};
|
|
204
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
205
|
-
}
|
|
206
|
-
function resetTryEntry(t) {
|
|
207
|
-
var e = t.completion || {};
|
|
208
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
209
|
-
}
|
|
210
|
-
function Context(t) {
|
|
211
|
-
this.tryEntries = [{
|
|
212
|
-
tryLoc: "root"
|
|
213
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
214
|
-
}
|
|
215
|
-
function values(e) {
|
|
216
|
-
if (e || "" === e) {
|
|
217
|
-
var r = e[a];
|
|
218
|
-
if (r) return r.call(e);
|
|
219
|
-
if ("function" == typeof e.next) return e;
|
|
220
|
-
if (!isNaN(e.length)) {
|
|
221
|
-
var o = -1,
|
|
222
|
-
i = function next() {
|
|
223
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
224
|
-
return next.value = t, next.done = !0, next;
|
|
225
|
-
};
|
|
226
|
-
return i.next = i;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
throw new TypeError(_typeof$1(e) + " is not iterable");
|
|
230
|
-
}
|
|
231
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
232
|
-
value: GeneratorFunctionPrototype,
|
|
233
|
-
configurable: !0
|
|
234
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
235
|
-
value: GeneratorFunction,
|
|
236
|
-
configurable: !0
|
|
237
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
238
|
-
var e = "function" == typeof t && t.constructor;
|
|
239
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
240
|
-
}, e.mark = function (t) {
|
|
241
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
242
|
-
}, e.awrap = function (t) {
|
|
243
|
-
return {
|
|
244
|
-
__await: t
|
|
245
|
-
};
|
|
246
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
247
|
-
return this;
|
|
248
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
249
|
-
void 0 === i && (i = Promise);
|
|
250
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
251
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
252
|
-
return t.done ? t.value : a.next();
|
|
253
|
-
});
|
|
254
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
255
|
-
return this;
|
|
256
|
-
}), define(g, "toString", function () {
|
|
257
|
-
return "[object Generator]";
|
|
258
|
-
}), e.keys = function (t) {
|
|
259
|
-
var e = Object(t),
|
|
260
|
-
r = [];
|
|
261
|
-
for (var n in e) r.push(n);
|
|
262
|
-
return r.reverse(), function next() {
|
|
263
|
-
for (; r.length;) {
|
|
264
|
-
var t = r.pop();
|
|
265
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
266
|
-
}
|
|
267
|
-
return next.done = !0, next;
|
|
268
|
-
};
|
|
269
|
-
}, e.values = values, Context.prototype = {
|
|
270
|
-
constructor: Context,
|
|
271
|
-
reset: function reset(e) {
|
|
272
|
-
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);
|
|
273
|
-
},
|
|
274
|
-
stop: function stop() {
|
|
275
|
-
this.done = !0;
|
|
276
|
-
var t = this.tryEntries[0].completion;
|
|
277
|
-
if ("throw" === t.type) throw t.arg;
|
|
278
|
-
return this.rval;
|
|
279
|
-
},
|
|
280
|
-
dispatchException: function dispatchException(e) {
|
|
281
|
-
if (this.done) throw e;
|
|
282
|
-
var r = this;
|
|
283
|
-
function handle(n, o) {
|
|
284
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
285
|
-
}
|
|
286
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
287
|
-
var i = this.tryEntries[o],
|
|
288
|
-
a = i.completion;
|
|
289
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
290
|
-
if (i.tryLoc <= this.prev) {
|
|
291
|
-
var c = n.call(i, "catchLoc"),
|
|
292
|
-
u = n.call(i, "finallyLoc");
|
|
293
|
-
if (c && u) {
|
|
294
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
295
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
296
|
-
} else if (c) {
|
|
297
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
298
|
-
} else {
|
|
299
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
300
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
abrupt: function abrupt(t, e) {
|
|
306
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
307
|
-
var o = this.tryEntries[r];
|
|
308
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
309
|
-
var i = o;
|
|
310
|
-
break;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
314
|
-
var a = i ? i.completion : {};
|
|
315
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
316
|
-
},
|
|
317
|
-
complete: function complete(t, e) {
|
|
318
|
-
if ("throw" === t.type) throw t.arg;
|
|
319
|
-
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;
|
|
320
|
-
},
|
|
321
|
-
finish: function finish(t) {
|
|
322
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
323
|
-
var r = this.tryEntries[e];
|
|
324
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
"catch": function _catch(t) {
|
|
328
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
329
|
-
var r = this.tryEntries[e];
|
|
330
|
-
if (r.tryLoc === t) {
|
|
331
|
-
var n = r.completion;
|
|
332
|
-
if ("throw" === n.type) {
|
|
333
|
-
var o = n.arg;
|
|
334
|
-
resetTryEntry(r);
|
|
335
|
-
}
|
|
336
|
-
return o;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
throw Error("illegal catch attempt");
|
|
340
|
-
},
|
|
341
|
-
delegateYield: function delegateYield(e, r, n) {
|
|
342
|
-
return this.delegate = {
|
|
343
|
-
iterator: values(e),
|
|
344
|
-
resultName: r,
|
|
345
|
-
nextLoc: n
|
|
346
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
347
|
-
}
|
|
348
|
-
}, e;
|
|
349
|
-
}
|
|
350
|
-
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
351
|
-
} (regeneratorRuntime$1));
|
|
352
|
-
|
|
353
|
-
// TODO(Babel 8): Remove this file.
|
|
354
|
-
|
|
355
|
-
var runtime = regeneratorRuntime$1.exports();
|
|
356
|
-
var regenerator = runtime;
|
|
357
|
-
|
|
358
|
-
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
359
|
-
try {
|
|
360
|
-
regeneratorRuntime = runtime;
|
|
361
|
-
} catch (accidentalStrictMode) {
|
|
362
|
-
if (typeof globalThis === "object") {
|
|
363
|
-
globalThis.regeneratorRuntime = runtime;
|
|
364
|
-
} else {
|
|
365
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
|
|
369
45
|
var en = {
|
|
370
46
|
root: 'root',
|
|
371
47
|
selectAll: 'Select all',
|
|
@@ -389,8 +65,8 @@ var zh = {
|
|
|
389
65
|
};
|
|
390
66
|
|
|
391
67
|
var localeJson = {
|
|
392
|
-
zh,
|
|
393
|
-
en
|
|
68
|
+
zh: zh,
|
|
69
|
+
en: en
|
|
394
70
|
};
|
|
395
71
|
|
|
396
72
|
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}";
|
|
@@ -653,57 +329,63 @@ var SelectorNode = function SelectorNode(props) {
|
|
|
653
329
|
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}";
|
|
654
330
|
styleInject(css_248z$2);
|
|
655
331
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
nodeMode = 'branch',
|
|
662
|
-
selectMode,
|
|
663
|
-
loadMore =
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
332
|
+
var SelectorMainContent = function SelectorMainContent(props) {
|
|
333
|
+
var className = props.className,
|
|
334
|
+
value = props.value;
|
|
335
|
+
props.rowKey;
|
|
336
|
+
var _props$nodeMode = props.nodeMode,
|
|
337
|
+
nodeMode = _props$nodeMode === void 0 ? 'branch' : _props$nodeMode,
|
|
338
|
+
selectMode = props.selectMode,
|
|
339
|
+
_props$loadMore = props.loadMore,
|
|
340
|
+
loadMore = _props$loadMore === void 0 ? false : _props$loadMore,
|
|
341
|
+
_props$isAllCheck = props.isAllCheck,
|
|
342
|
+
isAllCheck = _props$isAllCheck === void 0 ? false : _props$isAllCheck,
|
|
343
|
+
detail = props.detail,
|
|
344
|
+
detailRender = props.detailRender,
|
|
345
|
+
isLazy = props.isLazy,
|
|
346
|
+
list = props.list,
|
|
347
|
+
groupType = props.groupType,
|
|
348
|
+
breadcrumbs = props.breadcrumbs,
|
|
349
|
+
_props$breadcrumbsSep = props.breadcrumbsSeparator,
|
|
350
|
+
breadcrumbsSeparator = _props$breadcrumbsSep === void 0 ? '-' : _props$breadcrumbsSep,
|
|
351
|
+
_props$breadcrumbsLis = props.breadcrumbsList,
|
|
352
|
+
breadcrumbsList = _props$breadcrumbsLis === void 0 ? [] : _props$breadcrumbsLis,
|
|
353
|
+
fieldConfig = props.fieldConfig,
|
|
354
|
+
disabled = props.disabled,
|
|
355
|
+
disabledChild = props.disabledChild,
|
|
356
|
+
emptyProps = props.emptyProps,
|
|
357
|
+
loading = props.loading,
|
|
358
|
+
onClickBreadcrumbs = props.onClickBreadcrumbs,
|
|
359
|
+
_onLevel = props.onLevel,
|
|
360
|
+
_onSelect = props.onSelect,
|
|
361
|
+
onLoad = props.onLoad,
|
|
362
|
+
onAllCheck = props.onAllCheck;
|
|
363
|
+
var intl = useFormatMessage('Selector', localeJson);
|
|
364
|
+
var _useState = useState({}),
|
|
365
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
366
|
+
listCom = _useState2[0],
|
|
367
|
+
setListCom = _useState2[1];
|
|
368
|
+
var constData = useRef({
|
|
687
369
|
listTypeJson: {},
|
|
688
370
|
fieldConfig: {},
|
|
689
371
|
resizeTimer: null
|
|
690
372
|
});
|
|
691
|
-
|
|
692
|
-
|
|
373
|
+
var scrolltRef = useRef(null);
|
|
374
|
+
var contentRef = useRef(null);
|
|
693
375
|
constData.current.listTypeJson = ArrayToObject('value', groupType);
|
|
694
376
|
constData.current.fieldConfig = fieldConfig || {};
|
|
695
|
-
useEffect(()
|
|
377
|
+
useEffect(function () {
|
|
696
378
|
changeResize();
|
|
697
|
-
return ()
|
|
379
|
+
return function () {
|
|
698
380
|
clearTimeout(constData.current.resizeTimer);
|
|
699
381
|
};
|
|
700
382
|
}, []);
|
|
701
|
-
useEffect(()
|
|
383
|
+
useEffect(function () {
|
|
702
384
|
if (list && groupType && groupType.length > 0) {
|
|
703
|
-
|
|
704
|
-
for (
|
|
705
|
-
|
|
706
|
-
|
|
385
|
+
var json = {};
|
|
386
|
+
for (var i = 0, l = list.length; i < l; i++) {
|
|
387
|
+
var item = list[i];
|
|
388
|
+
var type = item.type;
|
|
707
389
|
if (!json[type]) json[type] = [];
|
|
708
390
|
json[type].push(item);
|
|
709
391
|
}
|
|
@@ -711,17 +393,17 @@ const SelectorMainContent = props => {
|
|
|
711
393
|
}
|
|
712
394
|
}, [list]);
|
|
713
395
|
/** 屏幕发生改变 */
|
|
714
|
-
|
|
396
|
+
var changeResize = function changeResize() {
|
|
715
397
|
clearTimeout(constData.current.resizeTimer);
|
|
716
|
-
constData.current.resizeTimer = setTimeout(()
|
|
398
|
+
constData.current.resizeTimer = setTimeout(function () {
|
|
717
399
|
onScroll();
|
|
718
400
|
}, 100);
|
|
719
401
|
};
|
|
720
402
|
/** 滚动 */
|
|
721
|
-
|
|
403
|
+
var onScroll = function onScroll() {
|
|
722
404
|
if (!contentRef.current || !scrolltRef.current) return;
|
|
723
|
-
|
|
724
|
-
|
|
405
|
+
var scrollBox = scrolltRef.current;
|
|
406
|
+
var contentBox = contentRef.current;
|
|
725
407
|
contentBox.classList.remove('selector-main-list-scroll-top', 'selector-main-list-scroll-bottom', 'selector-main-list-scroll-middle');
|
|
726
408
|
if (scrollBox.scrollHeight <= scrollBox.clientHeight) return;
|
|
727
409
|
// 滚动条初始化
|
|
@@ -738,17 +420,17 @@ const SelectorMainContent = props => {
|
|
|
738
420
|
contentBox.classList.add('selector-main-list-scroll-middle');
|
|
739
421
|
};
|
|
740
422
|
/** 判断是否全选,半选 */
|
|
741
|
-
|
|
742
|
-
|
|
423
|
+
var handAllCheckFunc = function handAllCheckFunc() {
|
|
424
|
+
var json = {
|
|
743
425
|
checked: false,
|
|
744
426
|
indeterminate: false
|
|
745
427
|
};
|
|
746
428
|
// 不存在value, 没有数据, 全选没转态
|
|
747
429
|
if (!value || !list || list.length === 0) return json;
|
|
748
|
-
for (
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
430
|
+
for (var i = 0, l = list.length; i < l; i++) {
|
|
431
|
+
var item = list[i];
|
|
432
|
+
var key = item.key;
|
|
433
|
+
var disabledItem = handDisabled(item);
|
|
752
434
|
if (disabledItem) {
|
|
753
435
|
if (value[key]) json.checked = true;
|
|
754
436
|
continue;
|
|
@@ -772,7 +454,7 @@ const SelectorMainContent = props => {
|
|
|
772
454
|
return json;
|
|
773
455
|
};
|
|
774
456
|
/** 处理禁用状态 */
|
|
775
|
-
|
|
457
|
+
var handDisabled = function handDisabled(item) {
|
|
776
458
|
if (disabled) {
|
|
777
459
|
if (disabled === true) return true;
|
|
778
460
|
if (disabled instanceof Array) {
|
|
@@ -785,7 +467,7 @@ const SelectorMainContent = props => {
|
|
|
785
467
|
return false;
|
|
786
468
|
};
|
|
787
469
|
/** 处理禁用下级状态 */
|
|
788
|
-
|
|
470
|
+
var handDisabledChild = function handDisabledChild(item) {
|
|
789
471
|
if (disabledChild) {
|
|
790
472
|
if (disabledChild === true) return true;
|
|
791
473
|
if (disabledChild instanceof Array) {
|
|
@@ -798,12 +480,12 @@ const SelectorMainContent = props => {
|
|
|
798
480
|
return false;
|
|
799
481
|
};
|
|
800
482
|
/** 全选 */
|
|
801
|
-
|
|
483
|
+
var handAllCheck = function handAllCheck() {
|
|
802
484
|
// 只存在复选框模式
|
|
803
485
|
if (!isAllCheck || selectMode !== 'check') return null;
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
486
|
+
var checkJson = handAllCheckFunc();
|
|
487
|
+
var onAllCheckCom = function onAllCheckCom() {
|
|
488
|
+
var bol = true;
|
|
807
489
|
if (checkJson.checked) bol = false;
|
|
808
490
|
onAllCheck && onAllCheck(bol);
|
|
809
491
|
};
|
|
@@ -820,11 +502,11 @@ const SelectorMainContent = props => {
|
|
|
820
502
|
}));
|
|
821
503
|
};
|
|
822
504
|
/** 点击查看更多 */
|
|
823
|
-
|
|
505
|
+
var clickLoad = function clickLoad() {
|
|
824
506
|
onLoad && onLoad();
|
|
825
507
|
};
|
|
826
508
|
/** 查看更多 */
|
|
827
|
-
|
|
509
|
+
var handLoadMore = function handLoadMore() {
|
|
828
510
|
if (!loadMore) return null;
|
|
829
511
|
return jsx("div", Object.assign({
|
|
830
512
|
className: "selector-main-list-more",
|
|
@@ -840,29 +522,33 @@ const SelectorMainContent = props => {
|
|
|
840
522
|
}));
|
|
841
523
|
};
|
|
842
524
|
/** 判断是否选中 */
|
|
843
|
-
|
|
844
|
-
|
|
525
|
+
var handCheck = function handCheck(item) {
|
|
526
|
+
var bol = false;
|
|
845
527
|
if (value && value[item.key]) bol = true;
|
|
846
528
|
return bol;
|
|
847
529
|
};
|
|
848
530
|
/** 处理每个节点的配置 */
|
|
849
|
-
|
|
850
|
-
|
|
531
|
+
var handNodeConfig = function handNodeConfig(item) {
|
|
532
|
+
var json = {
|
|
851
533
|
useCase: 'view',
|
|
852
|
-
detail,
|
|
853
|
-
nodeMode,
|
|
534
|
+
detail: detail,
|
|
535
|
+
nodeMode: nodeMode,
|
|
854
536
|
disabled: handDisabled(item),
|
|
855
537
|
disabledChild: handDisabledChild(item),
|
|
856
|
-
onLevel:
|
|
857
|
-
|
|
538
|
+
onLevel: function onLevel() {
|
|
539
|
+
return _onLevel && _onLevel(item);
|
|
540
|
+
},
|
|
541
|
+
onSelect: function onSelect() {
|
|
542
|
+
return _onSelect && _onSelect(item);
|
|
543
|
+
},
|
|
858
544
|
checked: handCheck(item)
|
|
859
545
|
};
|
|
860
546
|
/** 节点类型 */
|
|
861
547
|
if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
|
|
862
548
|
/** 渲染字段 */
|
|
863
|
-
|
|
864
|
-
for (
|
|
865
|
-
|
|
549
|
+
var arr = ['img', 'mainTitle', 'subTitle', 'tag', 'tagStyle'];
|
|
550
|
+
for (var i = 0, l = arr.length; i < l; i++) {
|
|
551
|
+
var key = arr[i];
|
|
866
552
|
json[key] = item[key];
|
|
867
553
|
}
|
|
868
554
|
/** 判断是否具有选择 */
|
|
@@ -876,7 +562,7 @@ const SelectorMainContent = props => {
|
|
|
876
562
|
json.child = item.child;
|
|
877
563
|
} else {
|
|
878
564
|
// 全量数据
|
|
879
|
-
|
|
565
|
+
var children = item.children || [];
|
|
880
566
|
if (children && children.length > 0) {
|
|
881
567
|
json.child = true;
|
|
882
568
|
}
|
|
@@ -885,29 +571,43 @@ const SelectorMainContent = props => {
|
|
|
885
571
|
}
|
|
886
572
|
/** 详情render */
|
|
887
573
|
if (detailRender) {
|
|
888
|
-
json.detailRender =
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
574
|
+
json.detailRender = function () {
|
|
575
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
576
|
+
var Dom;
|
|
577
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
578
|
+
while (1) switch (_context.prev = _context.next) {
|
|
579
|
+
case 0:
|
|
580
|
+
_context.next = 2;
|
|
581
|
+
return detailRender(item, true);
|
|
582
|
+
case 2:
|
|
583
|
+
Dom = _context.sent;
|
|
584
|
+
return _context.abrupt("return", Dom);
|
|
585
|
+
case 4:
|
|
586
|
+
case "end":
|
|
587
|
+
return _context.stop();
|
|
588
|
+
}
|
|
589
|
+
}, _callee);
|
|
590
|
+
}));
|
|
591
|
+
};
|
|
892
592
|
}
|
|
893
593
|
if (item.detail !== undefined) json.detail = item.detail;
|
|
894
594
|
return json;
|
|
895
595
|
};
|
|
896
596
|
/** 渲染list节点 */
|
|
897
|
-
|
|
898
|
-
return arr === null || arr === void 0 ? void 0 : arr.map((item, index)
|
|
597
|
+
var handListNode = function handListNode(arr) {
|
|
598
|
+
return arr === null || arr === void 0 ? void 0 : arr.map(function (item, index) {
|
|
899
599
|
return jsx(SelectorNode, Object.assign({}, handNodeConfig(item)), index);
|
|
900
600
|
});
|
|
901
601
|
};
|
|
902
602
|
/** 处理节点dom */
|
|
903
|
-
|
|
603
|
+
var handNode = function handNode() {
|
|
904
604
|
// 分组渲染
|
|
905
605
|
if (groupType && groupType.length > 0) {
|
|
906
606
|
return jsx(Fragment, {
|
|
907
|
-
children: groupType.map((item, index)
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
607
|
+
children: groupType.map(function (item, index) {
|
|
608
|
+
var type = item.value;
|
|
609
|
+
var listData = listCom[type] || [];
|
|
610
|
+
var str = 'selector-group-title';
|
|
911
611
|
if (index === 0) str += ' selector-group-title-first';
|
|
912
612
|
return jsxs(Fragment$1, {
|
|
913
613
|
children: [listData.length > 0 && jsx("div", Object.assign({
|
|
@@ -922,11 +622,11 @@ const SelectorMainContent = props => {
|
|
|
922
622
|
return handListNode(list || []);
|
|
923
623
|
};
|
|
924
624
|
/** 点击面包屑 */
|
|
925
|
-
|
|
625
|
+
var onClickBreadcrums = function onClickBreadcrums(item) {
|
|
926
626
|
onClickBreadcrumbs && onClickBreadcrumbs(item);
|
|
927
627
|
};
|
|
928
628
|
/** 面包屑dom */
|
|
929
|
-
|
|
629
|
+
var handBreadcrumbs = function handBreadcrumbs() {
|
|
930
630
|
if (!breadcrumbs || breadcrumbsList.length === 0) return null;
|
|
931
631
|
return jsx("div", Object.assign({
|
|
932
632
|
className: "nav-box"
|
|
@@ -939,7 +639,7 @@ const SelectorMainContent = props => {
|
|
|
939
639
|
}));
|
|
940
640
|
};
|
|
941
641
|
/** 处理内容 */
|
|
942
|
-
|
|
642
|
+
var handContent = function handContent() {
|
|
943
643
|
if ((list === null || list === void 0 ? void 0 : list.length) === 0 && !loading) {
|
|
944
644
|
// 空状态
|
|
945
645
|
return jsx("div", Object.assign({
|
|
@@ -967,8 +667,8 @@ const SelectorMainContent = props => {
|
|
|
967
667
|
})), handLoadMore()]
|
|
968
668
|
}));
|
|
969
669
|
};
|
|
970
|
-
|
|
971
|
-
|
|
670
|
+
var handClass = function handClass() {
|
|
671
|
+
var str = 'selector-main-content';
|
|
972
672
|
if (className) str += " ".concat(className);
|
|
973
673
|
if (disabled) str += ' selector-main-content-disabled';
|
|
974
674
|
if (isAllCheck && selectMode === 'check') str += ' selector-main-content-all-check';
|
|
@@ -982,87 +682,99 @@ const SelectorMainContent = props => {
|
|
|
982
682
|
children: [handBreadcrumbs(), handContent()]
|
|
983
683
|
}));
|
|
984
684
|
};
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
rowKey = 'key',
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
685
|
+
var SelectorMain = function SelectorMain(props) {
|
|
686
|
+
var className = props.className,
|
|
687
|
+
style = props.style,
|
|
688
|
+
url = props.url,
|
|
689
|
+
value = props.value,
|
|
690
|
+
_props$rowKey2 = props.rowKey,
|
|
691
|
+
rowKey = _props$rowKey2 === void 0 ? 'key' : _props$rowKey2,
|
|
692
|
+
_props$nodeMode2 = props.nodeMode,
|
|
693
|
+
nodeMode = _props$nodeMode2 === void 0 ? 'branch' : _props$nodeMode2,
|
|
694
|
+
selectMode = props.selectMode,
|
|
695
|
+
_props$loadMore2 = props.loadMore,
|
|
696
|
+
loadMore = _props$loadMore2 === void 0 ? false : _props$loadMore2,
|
|
697
|
+
_props$searchLoadMore = props.searchLoadMore,
|
|
698
|
+
searchLoadMore = _props$searchLoadMore === void 0 ? false : _props$searchLoadMore,
|
|
699
|
+
_props$isAllCheck2 = props.isAllCheck,
|
|
700
|
+
isAllCheck = _props$isAllCheck2 === void 0 ? false : _props$isAllCheck2,
|
|
701
|
+
disabled = props.disabled,
|
|
702
|
+
disabledChild = props.disabledChild,
|
|
703
|
+
detail = props.detail,
|
|
704
|
+
detailRender = props.detailRender,
|
|
705
|
+
isLazy = props.isLazy,
|
|
706
|
+
list = props.list,
|
|
707
|
+
groupType = props.groupType,
|
|
708
|
+
groupRange = props.groupRange,
|
|
709
|
+
search = props.search,
|
|
710
|
+
_props$searchVal = props.searchVal,
|
|
711
|
+
searchVal = _props$searchVal === void 0 ? '' : _props$searchVal,
|
|
712
|
+
searchPlaceholder = props.searchPlaceholder,
|
|
713
|
+
searchTrigger = props.searchTrigger,
|
|
714
|
+
searchLoading = props.searchLoading,
|
|
715
|
+
searchList = props.searchList,
|
|
716
|
+
loading = props.loading,
|
|
717
|
+
breadcrumbs = props.breadcrumbs,
|
|
718
|
+
_props$breadcrumbsSep2 = props.breadcrumbsSeparator,
|
|
719
|
+
breadcrumbsSeparator = _props$breadcrumbsSep2 === void 0 ? '-' : _props$breadcrumbsSep2,
|
|
720
|
+
_props$breadcrumbsLis2 = props.breadcrumbsList,
|
|
721
|
+
breadcrumbsList = _props$breadcrumbsLis2 === void 0 ? [] : _props$breadcrumbsLis2,
|
|
722
|
+
fieldConfig = props.fieldConfig,
|
|
723
|
+
onClickBreadcrumbs = props.onClickBreadcrumbs,
|
|
724
|
+
onLevel = props.onLevel,
|
|
725
|
+
onSelect = props.onSelect,
|
|
726
|
+
onLoad = props.onLoad,
|
|
727
|
+
onAllCheck = props.onAllCheck,
|
|
728
|
+
onSearch = props.onSearch,
|
|
729
|
+
onRefresh = props.onRefresh;
|
|
730
|
+
var intl = useFormatMessage('Selector', localeJson);
|
|
731
|
+
var _useState3 = useState(false),
|
|
732
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
733
|
+
showSearch = _useState4[0],
|
|
734
|
+
setShowSearch = _useState4[1]; // 显示搜索/
|
|
735
|
+
var _useState5 = useState(''),
|
|
736
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
737
|
+
searchStr = _useState6[0],
|
|
738
|
+
setSearchStr = _useState6[1];
|
|
739
|
+
var constData = useRef({
|
|
1028
740
|
searchTimer: null,
|
|
1029
741
|
searchStr: ''
|
|
1030
742
|
});
|
|
1031
|
-
useEffect(()
|
|
743
|
+
useEffect(function () {
|
|
1032
744
|
if (!searchVal) return;
|
|
1033
745
|
constData.current.searchStr = searchVal.val;
|
|
1034
746
|
setSearchStr(searchVal.val);
|
|
1035
747
|
if (searchVal.val !== '') setShowSearch(true);
|
|
1036
748
|
}, [searchVal]);
|
|
1037
749
|
/** 改变搜索框 */
|
|
1038
|
-
|
|
750
|
+
var changeSearch = function changeSearch(val) {
|
|
1039
751
|
setSearchStr(val);
|
|
1040
752
|
constData.current.searchStr = val;
|
|
1041
753
|
if (searchTrigger !== 'onEnter') onSearchCom();
|
|
1042
754
|
};
|
|
1043
755
|
/** 搜索框回车事件 */
|
|
1044
|
-
|
|
756
|
+
var onEnterSearch = function onEnterSearch() {
|
|
1045
757
|
onSearchCom(true);
|
|
1046
758
|
};
|
|
1047
759
|
/** 点击搜索按钮 */
|
|
1048
|
-
|
|
760
|
+
var onClickRightIcon = function onClickRightIcon() {
|
|
1049
761
|
onSearchCom(true);
|
|
1050
762
|
};
|
|
1051
763
|
/** 点击清除按钮 */
|
|
1052
|
-
|
|
764
|
+
var onClear = function onClear() {
|
|
1053
765
|
onSearchCom();
|
|
1054
766
|
};
|
|
1055
767
|
/** 向外抛出搜索事件 */
|
|
1056
|
-
|
|
768
|
+
var onSearchCom = function onSearchCom(bol) {
|
|
1057
769
|
clearTimeout(constData.current.searchTimer);
|
|
1058
|
-
constData.current.searchTimer = setTimeout(()
|
|
770
|
+
constData.current.searchTimer = setTimeout(function () {
|
|
1059
771
|
setShowSearch(!!constData.current.searchStr);
|
|
1060
772
|
onSearch && onSearch(constData.current.searchStr, !!bol);
|
|
1061
773
|
}, 300);
|
|
1062
774
|
};
|
|
1063
775
|
/** 搜索dom */
|
|
1064
|
-
|
|
1065
|
-
|
|
776
|
+
var handSearchDom = function handSearchDom() {
|
|
777
|
+
var handSearchIcon = function handSearchIcon() {
|
|
1066
778
|
if (!searchStr) {
|
|
1067
779
|
// 本地数据且没有自定义刷新事件
|
|
1068
780
|
if (!url && !onRefresh) {
|
|
@@ -1093,23 +805,27 @@ const SelectorMain = props => {
|
|
|
1093
805
|
/** 点击下级
|
|
1094
806
|
* @param isSearch {boolean}
|
|
1095
807
|
* */
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
808
|
+
var onLevelCom = function onLevelCom(isSearch) {
|
|
809
|
+
return function (item) {
|
|
810
|
+
if (isSearch) {
|
|
811
|
+
constData.current.searchStr = '';
|
|
812
|
+
setSearchStr('');
|
|
813
|
+
setShowSearch(false);
|
|
814
|
+
}
|
|
815
|
+
onLevel && onLevel(item, isSearch);
|
|
816
|
+
};
|
|
1103
817
|
};
|
|
1104
818
|
/**
|
|
1105
819
|
* 加载更多
|
|
1106
820
|
* @param isSearch {boolean} 是否搜索
|
|
1107
821
|
* */
|
|
1108
|
-
|
|
1109
|
-
|
|
822
|
+
var onLoadCom = function onLoadCom(isSearch) {
|
|
823
|
+
return function () {
|
|
824
|
+
onLoad && onLoad(isSearch);
|
|
825
|
+
};
|
|
1110
826
|
};
|
|
1111
827
|
/** 渲染列表 */
|
|
1112
|
-
|
|
828
|
+
var handListDom = function handListDom() {
|
|
1113
829
|
return jsx(SelectorMainContent, {
|
|
1114
830
|
className: "selector-main-list-box",
|
|
1115
831
|
value: value,
|
|
@@ -1138,7 +854,7 @@ const SelectorMain = props => {
|
|
|
1138
854
|
}, "list");
|
|
1139
855
|
};
|
|
1140
856
|
/** 渲染搜索列表 */
|
|
1141
|
-
|
|
857
|
+
var handSearchList = function handSearchList() {
|
|
1142
858
|
if (!showSearch) return;
|
|
1143
859
|
return jsx(SelectorMainContent, {
|
|
1144
860
|
className: 'selector-main-search-content',
|
|
@@ -1163,14 +879,14 @@ const SelectorMain = props => {
|
|
|
1163
879
|
}, "search");
|
|
1164
880
|
};
|
|
1165
881
|
/** 处理loading */
|
|
1166
|
-
|
|
882
|
+
var handLoading = function handLoading() {
|
|
1167
883
|
if (searchLoading || loading) {
|
|
1168
884
|
return jsx(Loading, {});
|
|
1169
885
|
}
|
|
1170
886
|
};
|
|
1171
887
|
// 处理class
|
|
1172
|
-
|
|
1173
|
-
|
|
888
|
+
var handClass = function handClass() {
|
|
889
|
+
var str = "".concat($prefixCls, "-selector-main");
|
|
1174
890
|
if (className) str += " ".concat(className);
|
|
1175
891
|
if (selectMode === 'check') str += " ".concat($prefixCls, "-selector-main-select");
|
|
1176
892
|
if (showSearch) str += " ".concat($prefixCls, "-selector-main-show-search");
|
|
@@ -1193,38 +909,40 @@ const SelectorMain = props => {
|
|
|
1193
909
|
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}";
|
|
1194
910
|
styleInject(css_248z$1);
|
|
1195
911
|
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
layout = 'node',
|
|
1200
|
-
style,
|
|
1201
|
-
list,
|
|
1202
|
-
groupType,
|
|
1203
|
-
nodeMode,
|
|
1204
|
-
backDataFieldConfig,
|
|
1205
|
-
detail,
|
|
1206
|
-
detailRender,
|
|
1207
|
-
disabled,
|
|
1208
|
-
handSelectorNodeInfo,
|
|
1209
|
-
selectDataTitleRender,
|
|
1210
|
-
selectRenderItem,
|
|
1211
|
-
selectRender,
|
|
1212
|
-
onClose
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
912
|
+
var SelectorData = function SelectorData(props) {
|
|
913
|
+
var className = props.className,
|
|
914
|
+
_props$layout = props.layout,
|
|
915
|
+
layout = _props$layout === void 0 ? 'node' : _props$layout,
|
|
916
|
+
style = props.style,
|
|
917
|
+
list = props.list,
|
|
918
|
+
groupType = props.groupType,
|
|
919
|
+
nodeMode = props.nodeMode,
|
|
920
|
+
backDataFieldConfig = props.backDataFieldConfig,
|
|
921
|
+
detail = props.detail,
|
|
922
|
+
detailRender = props.detailRender,
|
|
923
|
+
disabled = props.disabled,
|
|
924
|
+
handSelectorNodeInfo = props.handSelectorNodeInfo,
|
|
925
|
+
selectDataTitleRender = props.selectDataTitleRender,
|
|
926
|
+
selectRenderItem = props.selectRenderItem,
|
|
927
|
+
selectRender = props.selectRender,
|
|
928
|
+
_onClose = props.onClose;
|
|
929
|
+
var intl = useFormatMessage('Selector', localeJson);
|
|
930
|
+
var _useState = useState({}),
|
|
931
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
932
|
+
listCom = _useState2[0],
|
|
933
|
+
setListCom = _useState2[1];
|
|
934
|
+
var constData = useRef({
|
|
1217
935
|
listTypeJson: {},
|
|
1218
936
|
backDataFieldConfig: {}
|
|
1219
937
|
});
|
|
1220
938
|
constData.current.listTypeJson = ArrayToObject('value', groupType);
|
|
1221
939
|
constData.current.backDataFieldConfig = backDataFieldConfig || {};
|
|
1222
|
-
useEffect(()
|
|
940
|
+
useEffect(function () {
|
|
1223
941
|
if (list && groupType && groupType.length > 0) {
|
|
1224
|
-
|
|
1225
|
-
for (
|
|
1226
|
-
|
|
1227
|
-
|
|
942
|
+
var json = {};
|
|
943
|
+
for (var i = 0, l = list.length; i < l; i++) {
|
|
944
|
+
var item = list[i];
|
|
945
|
+
var type = item[constData.current.backDataFieldConfig.type || ''];
|
|
1228
946
|
if (!json[type]) json[type] = [];
|
|
1229
947
|
json[type].push(item);
|
|
1230
948
|
}
|
|
@@ -1232,12 +950,12 @@ const SelectorData = props => {
|
|
|
1232
950
|
}
|
|
1233
951
|
}, [list]);
|
|
1234
952
|
/** 处理禁用 */
|
|
1235
|
-
|
|
953
|
+
var handDisabled = function handDisabled(itemConfig) {
|
|
1236
954
|
if (disabled) {
|
|
1237
955
|
if (disabled === true) return true;
|
|
1238
956
|
if (disabled instanceof Array) {
|
|
1239
|
-
|
|
1240
|
-
|
|
957
|
+
var keyStr = (backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '';
|
|
958
|
+
var val = itemConfig[keyStr];
|
|
1241
959
|
if (disabled.indexOf(val) !== -1) {
|
|
1242
960
|
return true;
|
|
1243
961
|
}
|
|
@@ -1246,40 +964,56 @@ const SelectorData = props => {
|
|
|
1246
964
|
return false;
|
|
1247
965
|
};
|
|
1248
966
|
/** 处理每个节点的配置 */
|
|
1249
|
-
|
|
1250
|
-
|
|
967
|
+
var handNodeConfig = function handNodeConfig(itemConfig, index) {
|
|
968
|
+
var item = itemConfig;
|
|
1251
969
|
if (handSelectorNodeInfo) item = handSelectorNodeInfo(itemConfig);
|
|
1252
|
-
|
|
1253
|
-
|
|
970
|
+
var disabledItem = handDisabled(itemConfig);
|
|
971
|
+
var json = {
|
|
1254
972
|
useCase: 'edit',
|
|
1255
973
|
close: !disabledItem,
|
|
1256
|
-
detail,
|
|
974
|
+
detail: detail,
|
|
1257
975
|
data: item,
|
|
1258
|
-
nodeMode,
|
|
1259
|
-
onClose:
|
|
976
|
+
nodeMode: nodeMode,
|
|
977
|
+
onClose: function onClose() {
|
|
978
|
+
return _onClose && _onClose(item, index);
|
|
979
|
+
},
|
|
1260
980
|
disabled: handDisabled(itemConfig),
|
|
1261
981
|
tagStyle: item.tagStyle
|
|
1262
982
|
};
|
|
1263
983
|
if (selectRenderItem) {
|
|
1264
|
-
json.leftRender = ()
|
|
984
|
+
json.leftRender = function () {
|
|
1265
985
|
return selectRenderItem(itemConfig);
|
|
1266
986
|
};
|
|
1267
987
|
}
|
|
1268
988
|
/** 节点类型 */
|
|
1269
989
|
if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
|
|
1270
990
|
/** 渲染字段 */
|
|
1271
|
-
|
|
1272
|
-
for (
|
|
1273
|
-
|
|
1274
|
-
|
|
991
|
+
var arr = ['img', 'mainTitle', 'subTitle', 'tag'];
|
|
992
|
+
for (var i = 0, l = arr.length; i < l; i++) {
|
|
993
|
+
var key = arr[i] || '';
|
|
994
|
+
var backName = backDataFieldConfig && backDataFieldConfig[key] || '';
|
|
1275
995
|
json[key] = item[backName];
|
|
1276
996
|
}
|
|
1277
997
|
/** 详情render */
|
|
1278
998
|
if (detailRender) {
|
|
1279
|
-
json.detailRender =
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
999
|
+
json.detailRender = function () {
|
|
1000
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
1001
|
+
var Dom;
|
|
1002
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
1003
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1004
|
+
case 0:
|
|
1005
|
+
_context.next = 2;
|
|
1006
|
+
return detailRender(item, false);
|
|
1007
|
+
case 2:
|
|
1008
|
+
Dom = _context.sent;
|
|
1009
|
+
return _context.abrupt("return", Dom);
|
|
1010
|
+
case 4:
|
|
1011
|
+
case "end":
|
|
1012
|
+
return _context.stop();
|
|
1013
|
+
}
|
|
1014
|
+
}, _callee);
|
|
1015
|
+
}));
|
|
1016
|
+
};
|
|
1283
1017
|
}
|
|
1284
1018
|
if (item.detail !== undefined) json.detail = item.detail;
|
|
1285
1019
|
/** 是否具有删除 */
|
|
@@ -1287,23 +1021,23 @@ const SelectorData = props => {
|
|
|
1287
1021
|
return json;
|
|
1288
1022
|
};
|
|
1289
1023
|
/** 处理节点 */
|
|
1290
|
-
|
|
1024
|
+
var handNode = function handNode() {
|
|
1291
1025
|
if (selectRender) {
|
|
1292
1026
|
return selectRender(list || []);
|
|
1293
1027
|
}
|
|
1294
|
-
return list === null || list === void 0 ? void 0 : list.map((item, index)
|
|
1028
|
+
return list === null || list === void 0 ? void 0 : list.map(function (item, index) {
|
|
1295
1029
|
return jsx(SelectorNode, Object.assign({}, handNodeConfig(item, index)), index);
|
|
1296
1030
|
});
|
|
1297
1031
|
};
|
|
1298
1032
|
/** 处理标题 */
|
|
1299
|
-
|
|
1300
|
-
|
|
1033
|
+
var handTitle = function handTitle() {
|
|
1034
|
+
var handTitleTag = function handTitleTag() {
|
|
1301
1035
|
if (selectDataTitleRender) return selectDataTitleRender(list);
|
|
1302
1036
|
if (groupType) {
|
|
1303
1037
|
return jsx(Fragment, {
|
|
1304
|
-
children: groupType.map((item, index)
|
|
1305
|
-
|
|
1306
|
-
|
|
1038
|
+
children: groupType.map(function (item, index) {
|
|
1039
|
+
var num = 0;
|
|
1040
|
+
var val = item.value;
|
|
1307
1041
|
if (listCom[val]) num = listCom[val].length;
|
|
1308
1042
|
if (num === 0) return;
|
|
1309
1043
|
return jsxs("span", Object.assign({
|
|
@@ -1328,7 +1062,7 @@ const SelectorData = props => {
|
|
|
1328
1062
|
}));
|
|
1329
1063
|
};
|
|
1330
1064
|
// 处理节点内容
|
|
1331
|
-
|
|
1065
|
+
var handContentNode = function handContentNode() {
|
|
1332
1066
|
return jsxs("div", Object.assign({
|
|
1333
1067
|
className: "selector-data-node-box"
|
|
1334
1068
|
}, {
|
|
@@ -1340,13 +1074,13 @@ const SelectorData = props => {
|
|
|
1340
1074
|
}));
|
|
1341
1075
|
};
|
|
1342
1076
|
// 处理内容
|
|
1343
|
-
|
|
1077
|
+
var handDetailTagContent = function handDetailTagContent() {
|
|
1344
1078
|
if (selectRender) {
|
|
1345
1079
|
return selectRender(list || []);
|
|
1346
1080
|
}
|
|
1347
1081
|
return jsx(Fragment, {
|
|
1348
|
-
children: list === null || list === void 0 ? void 0 : list.map((item, index)
|
|
1349
|
-
|
|
1082
|
+
children: list === null || list === void 0 ? void 0 : list.map(function (item, index) {
|
|
1083
|
+
var disabledItem = handDisabled(item);
|
|
1350
1084
|
return jsxs("span", Object.assign({
|
|
1351
1085
|
className: "content-tag"
|
|
1352
1086
|
}, {
|
|
@@ -1355,14 +1089,16 @@ const SelectorData = props => {
|
|
|
1355
1089
|
children: item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.mainTitle) || ''] || item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '']
|
|
1356
1090
|
})
|
|
1357
1091
|
}), !disabledItem && jsx(CloseIcon, {
|
|
1358
|
-
onClick: ()
|
|
1092
|
+
onClick: function onClick() {
|
|
1093
|
+
return _onClose && _onClose(item, index);
|
|
1094
|
+
}
|
|
1359
1095
|
})]
|
|
1360
1096
|
}), index);
|
|
1361
1097
|
})
|
|
1362
1098
|
});
|
|
1363
1099
|
};
|
|
1364
1100
|
// 处理tag内容
|
|
1365
|
-
|
|
1101
|
+
var handContentTag = function handContentTag() {
|
|
1366
1102
|
return jsxs("div", Object.assign({
|
|
1367
1103
|
className: "selector-data-tag-box"
|
|
1368
1104
|
}, {
|
|
@@ -1373,8 +1109,8 @@ const SelectorData = props => {
|
|
|
1373
1109
|
}))]
|
|
1374
1110
|
}));
|
|
1375
1111
|
};
|
|
1376
|
-
|
|
1377
|
-
|
|
1112
|
+
var handClass = function handClass() {
|
|
1113
|
+
var str = "".concat($prefixCls, "-selector-data");
|
|
1378
1114
|
if (layout) str += " ".concat($prefixCls, "-selector-data-").concat(layout);
|
|
1379
1115
|
if (disabled === true) str += " ".concat($prefixCls, "-selector-data-disabled");
|
|
1380
1116
|
if (className) str += " ".concat(className);
|
|
@@ -1392,11 +1128,9 @@ const SelectorData = props => {
|
|
|
1392
1128
|
* 发送请求
|
|
1393
1129
|
* @param obj {ReqFuncProps} 请求信息
|
|
1394
1130
|
*/
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
data
|
|
1399
|
-
} = obj,
|
|
1131
|
+
var reqFunc = function reqFunc(obj) {
|
|
1132
|
+
var method = obj.method,
|
|
1133
|
+
data = obj.data,
|
|
1400
1134
|
otherProps = __rest(obj, ["method", "data"]);
|
|
1401
1135
|
if (method === 'Get') {
|
|
1402
1136
|
return Get(Object.assign({
|
|
@@ -1405,7 +1139,7 @@ const reqFunc = obj => {
|
|
|
1405
1139
|
}
|
|
1406
1140
|
if (method === 'Post') {
|
|
1407
1141
|
return Post(Object.assign({
|
|
1408
|
-
data
|
|
1142
|
+
data: data
|
|
1409
1143
|
}, otherProps));
|
|
1410
1144
|
}
|
|
1411
1145
|
};
|