@para-ui/core 4.0.69 → 4.0.70
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/Form/index.js +1 -1
- package/FormItem/index.js +1 -1
- package/README.md +6 -1
- package/Selector/index.js +280 -222
- package/SingleBox/index.js +2 -2
- package/Stepper/index.js +1 -1
- package/Table/index.js +8 -1
- package/Table/interface.d.ts +4 -0
- package/Tabs/index.js +2 -2
- package/TextEditor/index.js +3 -3
- package/index.js +1 -1
- package/package.json +1 -1
- package/umd/ComboSelect.js +1 -1
- package/umd/DynamicMultiBox.js +1 -1
- package/umd/Form.js +1 -1
- package/umd/FormItem.js +1 -1
- package/umd/Table.js +1 -1
- /package/_verture/{index-c9e5b1a0.js → index-d73a7bf3.js} +0 -0
package/Selector/index.js
CHANGED
|
@@ -66,8 +66,8 @@ var zh = {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
var localeJson = {
|
|
69
|
-
zh,
|
|
70
|
-
en
|
|
69
|
+
zh: zh,
|
|
70
|
+
en: en
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
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-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}";
|
|
@@ -330,57 +330,63 @@ var SelectorNode = function SelectorNode(props) {
|
|
|
330
330
|
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-header {\n margin-bottom: 10px;\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}";
|
|
331
331
|
styleInject(css_248z$2);
|
|
332
332
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
nodeMode = 'branch',
|
|
339
|
-
selectMode,
|
|
340
|
-
loadMore =
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
333
|
+
var SelectorMainContent = function SelectorMainContent(props) {
|
|
334
|
+
var className = props.className,
|
|
335
|
+
value = props.value;
|
|
336
|
+
props.rowKey;
|
|
337
|
+
var _props$nodeMode = props.nodeMode,
|
|
338
|
+
nodeMode = _props$nodeMode === void 0 ? 'branch' : _props$nodeMode,
|
|
339
|
+
selectMode = props.selectMode,
|
|
340
|
+
_props$loadMore = props.loadMore,
|
|
341
|
+
loadMore = _props$loadMore === void 0 ? false : _props$loadMore,
|
|
342
|
+
_props$isAllCheck = props.isAllCheck,
|
|
343
|
+
isAllCheck = _props$isAllCheck === void 0 ? false : _props$isAllCheck,
|
|
344
|
+
detail = props.detail,
|
|
345
|
+
detailRender = props.detailRender,
|
|
346
|
+
isLazy = props.isLazy,
|
|
347
|
+
list = props.list,
|
|
348
|
+
groupType = props.groupType,
|
|
349
|
+
breadcrumbs = props.breadcrumbs,
|
|
350
|
+
_props$breadcrumbsSep = props.breadcrumbsSeparator,
|
|
351
|
+
breadcrumbsSeparator = _props$breadcrumbsSep === void 0 ? '-' : _props$breadcrumbsSep,
|
|
352
|
+
_props$breadcrumbsLis = props.breadcrumbsList,
|
|
353
|
+
breadcrumbsList = _props$breadcrumbsLis === void 0 ? [] : _props$breadcrumbsLis,
|
|
354
|
+
fieldConfig = props.fieldConfig,
|
|
355
|
+
disabled = props.disabled,
|
|
356
|
+
disabledChild = props.disabledChild,
|
|
357
|
+
emptyProps = props.emptyProps,
|
|
358
|
+
loading = props.loading,
|
|
359
|
+
onClickBreadcrumbs = props.onClickBreadcrumbs,
|
|
360
|
+
_onLevel = props.onLevel,
|
|
361
|
+
_onSelect = props.onSelect,
|
|
362
|
+
onLoad = props.onLoad,
|
|
363
|
+
onAllCheck = props.onAllCheck;
|
|
364
|
+
var intl = useFormatMessage('Selector', localeJson);
|
|
365
|
+
var _useState = useState({}),
|
|
366
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
367
|
+
listCom = _useState2[0],
|
|
368
|
+
setListCom = _useState2[1];
|
|
369
|
+
var constData = useRef({
|
|
364
370
|
listTypeJson: {},
|
|
365
371
|
fieldConfig: {},
|
|
366
372
|
resizeTimer: null
|
|
367
373
|
});
|
|
368
|
-
|
|
369
|
-
|
|
374
|
+
var scrolltRef = useRef(null);
|
|
375
|
+
var contentRef = useRef(null);
|
|
370
376
|
constData.current.listTypeJson = ArrayToObject('value', groupType);
|
|
371
377
|
constData.current.fieldConfig = fieldConfig || {};
|
|
372
|
-
useEffect(()
|
|
378
|
+
useEffect(function () {
|
|
373
379
|
changeResize();
|
|
374
|
-
return ()
|
|
380
|
+
return function () {
|
|
375
381
|
clearTimeout(constData.current.resizeTimer);
|
|
376
382
|
};
|
|
377
383
|
}, []);
|
|
378
|
-
useEffect(()
|
|
384
|
+
useEffect(function () {
|
|
379
385
|
if (list && groupType && groupType.length > 0) {
|
|
380
|
-
|
|
381
|
-
for (
|
|
382
|
-
|
|
383
|
-
|
|
386
|
+
var json = {};
|
|
387
|
+
for (var i = 0, l = list.length; i < l; i++) {
|
|
388
|
+
var item = list[i];
|
|
389
|
+
var type = item.type;
|
|
384
390
|
if (!json[type]) json[type] = [];
|
|
385
391
|
json[type].push(item);
|
|
386
392
|
}
|
|
@@ -388,17 +394,17 @@ const SelectorMainContent = props => {
|
|
|
388
394
|
}
|
|
389
395
|
}, [list]);
|
|
390
396
|
/** 屏幕发生改变 */
|
|
391
|
-
|
|
397
|
+
var changeResize = function changeResize() {
|
|
392
398
|
clearTimeout(constData.current.resizeTimer);
|
|
393
|
-
constData.current.resizeTimer = setTimeout(()
|
|
399
|
+
constData.current.resizeTimer = setTimeout(function () {
|
|
394
400
|
onScroll();
|
|
395
401
|
}, 100);
|
|
396
402
|
};
|
|
397
403
|
/** 滚动 */
|
|
398
|
-
|
|
404
|
+
var onScroll = function onScroll() {
|
|
399
405
|
if (!contentRef.current || !scrolltRef.current) return;
|
|
400
|
-
|
|
401
|
-
|
|
406
|
+
var scrollBox = scrolltRef.current;
|
|
407
|
+
var contentBox = contentRef.current;
|
|
402
408
|
contentBox.classList.remove('selector-main-list-scroll-top', 'selector-main-list-scroll-bottom', 'selector-main-list-scroll-middle');
|
|
403
409
|
if (scrollBox.scrollHeight <= scrollBox.clientHeight) return;
|
|
404
410
|
// 滚动条初始化
|
|
@@ -415,17 +421,17 @@ const SelectorMainContent = props => {
|
|
|
415
421
|
contentBox.classList.add('selector-main-list-scroll-middle');
|
|
416
422
|
};
|
|
417
423
|
/** 判断是否全选,半选 */
|
|
418
|
-
|
|
419
|
-
|
|
424
|
+
var handAllCheckFunc = function handAllCheckFunc() {
|
|
425
|
+
var json = {
|
|
420
426
|
checked: false,
|
|
421
427
|
indeterminate: false
|
|
422
428
|
};
|
|
423
429
|
// 不存在value, 没有数据, 全选没转态
|
|
424
430
|
if (!value || !list || list.length === 0) return json;
|
|
425
|
-
for (
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
431
|
+
for (var i = 0, l = list.length; i < l; i++) {
|
|
432
|
+
var item = list[i];
|
|
433
|
+
var key = item.key;
|
|
434
|
+
var disabledItem = handDisabled(item);
|
|
429
435
|
if (disabledItem) {
|
|
430
436
|
if (value[key]) json.checked = true;
|
|
431
437
|
continue;
|
|
@@ -449,7 +455,7 @@ const SelectorMainContent = props => {
|
|
|
449
455
|
return json;
|
|
450
456
|
};
|
|
451
457
|
/** 处理禁用状态 */
|
|
452
|
-
|
|
458
|
+
var handDisabled = function handDisabled(item) {
|
|
453
459
|
if (disabled) {
|
|
454
460
|
if (disabled === true) return true;
|
|
455
461
|
if (disabled instanceof Array) {
|
|
@@ -462,7 +468,7 @@ const SelectorMainContent = props => {
|
|
|
462
468
|
return false;
|
|
463
469
|
};
|
|
464
470
|
/** 处理禁用下级状态 */
|
|
465
|
-
|
|
471
|
+
var handDisabledChild = function handDisabledChild(item) {
|
|
466
472
|
if (disabledChild) {
|
|
467
473
|
if (disabledChild === true) return true;
|
|
468
474
|
if (disabledChild instanceof Array) {
|
|
@@ -475,12 +481,12 @@ const SelectorMainContent = props => {
|
|
|
475
481
|
return false;
|
|
476
482
|
};
|
|
477
483
|
/** 全选 */
|
|
478
|
-
|
|
484
|
+
var handAllCheck = function handAllCheck() {
|
|
479
485
|
// 只存在复选框模式
|
|
480
486
|
if (!isAllCheck || selectMode !== 'check') return null;
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
487
|
+
var checkJson = handAllCheckFunc();
|
|
488
|
+
var onAllCheckCom = function onAllCheckCom() {
|
|
489
|
+
var bol = true;
|
|
484
490
|
if (checkJson.checked) bol = false;
|
|
485
491
|
onAllCheck && onAllCheck(bol);
|
|
486
492
|
};
|
|
@@ -497,11 +503,11 @@ const SelectorMainContent = props => {
|
|
|
497
503
|
}));
|
|
498
504
|
};
|
|
499
505
|
/** 点击查看更多 */
|
|
500
|
-
|
|
506
|
+
var clickLoad = function clickLoad() {
|
|
501
507
|
onLoad && onLoad();
|
|
502
508
|
};
|
|
503
509
|
/** 查看更多 */
|
|
504
|
-
|
|
510
|
+
var handLoadMore = function handLoadMore() {
|
|
505
511
|
if (!loadMore) return null;
|
|
506
512
|
return jsx("div", Object.assign({
|
|
507
513
|
className: "selector-main-list-more",
|
|
@@ -517,29 +523,33 @@ const SelectorMainContent = props => {
|
|
|
517
523
|
}));
|
|
518
524
|
};
|
|
519
525
|
/** 判断是否选中 */
|
|
520
|
-
|
|
521
|
-
|
|
526
|
+
var handCheck = function handCheck(item) {
|
|
527
|
+
var bol = false;
|
|
522
528
|
if (value && value[item.key]) bol = true;
|
|
523
529
|
return bol;
|
|
524
530
|
};
|
|
525
531
|
/** 处理每个节点的配置 */
|
|
526
|
-
|
|
527
|
-
|
|
532
|
+
var handNodeConfig = function handNodeConfig(item) {
|
|
533
|
+
var json = {
|
|
528
534
|
useCase: 'view',
|
|
529
|
-
detail,
|
|
530
|
-
nodeMode,
|
|
535
|
+
detail: detail,
|
|
536
|
+
nodeMode: nodeMode,
|
|
531
537
|
disabled: handDisabled(item),
|
|
532
538
|
disabledChild: handDisabledChild(item),
|
|
533
|
-
onLevel:
|
|
534
|
-
|
|
539
|
+
onLevel: function onLevel() {
|
|
540
|
+
return _onLevel && _onLevel(item);
|
|
541
|
+
},
|
|
542
|
+
onSelect: function onSelect() {
|
|
543
|
+
return _onSelect && _onSelect(item);
|
|
544
|
+
},
|
|
535
545
|
checked: handCheck(item)
|
|
536
546
|
};
|
|
537
547
|
/** 节点类型 */
|
|
538
548
|
if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
|
|
539
549
|
/** 渲染字段 */
|
|
540
|
-
|
|
541
|
-
for (
|
|
542
|
-
|
|
550
|
+
var arr = ['img', 'mainTitle', 'subTitle', 'tag', 'tagStyle'];
|
|
551
|
+
for (var i = 0, l = arr.length; i < l; i++) {
|
|
552
|
+
var key = arr[i];
|
|
543
553
|
json[key] = item[key];
|
|
544
554
|
}
|
|
545
555
|
/** 判断是否具有选择 */
|
|
@@ -553,7 +563,7 @@ const SelectorMainContent = props => {
|
|
|
553
563
|
json.child = item.child;
|
|
554
564
|
} else {
|
|
555
565
|
// 全量数据
|
|
556
|
-
|
|
566
|
+
var children = item.children || [];
|
|
557
567
|
if (children && children.length > 0) {
|
|
558
568
|
json.child = true;
|
|
559
569
|
}
|
|
@@ -562,29 +572,43 @@ const SelectorMainContent = props => {
|
|
|
562
572
|
}
|
|
563
573
|
/** 详情render */
|
|
564
574
|
if (detailRender) {
|
|
565
|
-
json.detailRender =
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
575
|
+
json.detailRender = function () {
|
|
576
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
577
|
+
var Dom;
|
|
578
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
579
|
+
while (1) switch (_context.prev = _context.next) {
|
|
580
|
+
case 0:
|
|
581
|
+
_context.next = 2;
|
|
582
|
+
return detailRender(item, true);
|
|
583
|
+
case 2:
|
|
584
|
+
Dom = _context.sent;
|
|
585
|
+
return _context.abrupt("return", Dom);
|
|
586
|
+
case 4:
|
|
587
|
+
case "end":
|
|
588
|
+
return _context.stop();
|
|
589
|
+
}
|
|
590
|
+
}, _callee);
|
|
591
|
+
}));
|
|
592
|
+
};
|
|
569
593
|
}
|
|
570
594
|
if (item.detail !== undefined) json.detail = item.detail;
|
|
571
595
|
return json;
|
|
572
596
|
};
|
|
573
597
|
/** 渲染list节点 */
|
|
574
|
-
|
|
575
|
-
return arr === null || arr === void 0 ? void 0 : arr.map((item, index)
|
|
598
|
+
var handListNode = function handListNode(arr) {
|
|
599
|
+
return arr === null || arr === void 0 ? void 0 : arr.map(function (item, index) {
|
|
576
600
|
return jsx(SelectorNode, Object.assign({}, handNodeConfig(item)), index);
|
|
577
601
|
});
|
|
578
602
|
};
|
|
579
603
|
/** 处理节点dom */
|
|
580
|
-
|
|
604
|
+
var handNode = function handNode() {
|
|
581
605
|
// 分组渲染
|
|
582
606
|
if (groupType && groupType.length > 0) {
|
|
583
607
|
return jsx(Fragment, {
|
|
584
|
-
children: groupType.map((item, index)
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
608
|
+
children: groupType.map(function (item, index) {
|
|
609
|
+
var type = item.value;
|
|
610
|
+
var listData = listCom[type] || [];
|
|
611
|
+
var str = 'selector-group-title';
|
|
588
612
|
if (index === 0) str += ' selector-group-title-first';
|
|
589
613
|
return jsxs(Fragment$1, {
|
|
590
614
|
children: [listData.length > 0 && jsx("div", Object.assign({
|
|
@@ -599,11 +623,11 @@ const SelectorMainContent = props => {
|
|
|
599
623
|
return handListNode(list || []);
|
|
600
624
|
};
|
|
601
625
|
/** 点击面包屑 */
|
|
602
|
-
|
|
626
|
+
var onClickBreadcrums = function onClickBreadcrums(item) {
|
|
603
627
|
onClickBreadcrumbs && onClickBreadcrumbs(item);
|
|
604
628
|
};
|
|
605
629
|
/** 面包屑dom */
|
|
606
|
-
|
|
630
|
+
var handBreadcrumbs = function handBreadcrumbs() {
|
|
607
631
|
if (!breadcrumbs || breadcrumbsList.length === 0) return null;
|
|
608
632
|
return jsx("div", Object.assign({
|
|
609
633
|
className: "nav-box"
|
|
@@ -617,7 +641,7 @@ const SelectorMainContent = props => {
|
|
|
617
641
|
}));
|
|
618
642
|
};
|
|
619
643
|
/** 处理内容 */
|
|
620
|
-
|
|
644
|
+
var handContent = function handContent() {
|
|
621
645
|
if ((list === null || list === void 0 ? void 0 : list.length) === 0 && !loading) {
|
|
622
646
|
// 空状态
|
|
623
647
|
return jsx("div", Object.assign({
|
|
@@ -645,8 +669,8 @@ const SelectorMainContent = props => {
|
|
|
645
669
|
})), handLoadMore()]
|
|
646
670
|
}));
|
|
647
671
|
};
|
|
648
|
-
|
|
649
|
-
|
|
672
|
+
var handClass = function handClass() {
|
|
673
|
+
var str = 'selector-main-content';
|
|
650
674
|
if (className) str += " ".concat(className);
|
|
651
675
|
if (disabled) str += ' selector-main-content-disabled';
|
|
652
676
|
if (isAllCheck && selectMode === 'check') str += ' selector-main-content-all-check';
|
|
@@ -660,88 +684,100 @@ const SelectorMainContent = props => {
|
|
|
660
684
|
children: [handBreadcrumbs(), handContent()]
|
|
661
685
|
}));
|
|
662
686
|
};
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
rowKey = 'key',
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
687
|
+
var SelectorMain = function SelectorMain(props) {
|
|
688
|
+
var className = props.className,
|
|
689
|
+
style = props.style,
|
|
690
|
+
url = props.url,
|
|
691
|
+
value = props.value,
|
|
692
|
+
_props$rowKey2 = props.rowKey,
|
|
693
|
+
rowKey = _props$rowKey2 === void 0 ? 'key' : _props$rowKey2,
|
|
694
|
+
_props$nodeMode2 = props.nodeMode,
|
|
695
|
+
nodeMode = _props$nodeMode2 === void 0 ? 'branch' : _props$nodeMode2,
|
|
696
|
+
selectMode = props.selectMode,
|
|
697
|
+
_props$loadMore2 = props.loadMore,
|
|
698
|
+
loadMore = _props$loadMore2 === void 0 ? false : _props$loadMore2,
|
|
699
|
+
_props$searchLoadMore = props.searchLoadMore,
|
|
700
|
+
searchLoadMore = _props$searchLoadMore === void 0 ? false : _props$searchLoadMore,
|
|
701
|
+
_props$isAllCheck2 = props.isAllCheck,
|
|
702
|
+
isAllCheck = _props$isAllCheck2 === void 0 ? false : _props$isAllCheck2,
|
|
703
|
+
disabled = props.disabled,
|
|
704
|
+
disabledChild = props.disabledChild,
|
|
705
|
+
detail = props.detail,
|
|
706
|
+
detailRender = props.detailRender,
|
|
707
|
+
isLazy = props.isLazy,
|
|
708
|
+
list = props.list,
|
|
709
|
+
groupType = props.groupType,
|
|
710
|
+
groupRange = props.groupRange,
|
|
711
|
+
search = props.search,
|
|
712
|
+
_props$searchVal = props.searchVal,
|
|
713
|
+
searchVal = _props$searchVal === void 0 ? '' : _props$searchVal,
|
|
714
|
+
searchPlaceholder = props.searchPlaceholder,
|
|
715
|
+
searchTrigger = props.searchTrigger,
|
|
716
|
+
searchLoading = props.searchLoading,
|
|
717
|
+
searchList = props.searchList,
|
|
718
|
+
loading = props.loading,
|
|
719
|
+
mainHeader = props.mainHeader,
|
|
720
|
+
breadcrumbs = props.breadcrumbs,
|
|
721
|
+
_props$breadcrumbsSep2 = props.breadcrumbsSeparator,
|
|
722
|
+
breadcrumbsSeparator = _props$breadcrumbsSep2 === void 0 ? '-' : _props$breadcrumbsSep2,
|
|
723
|
+
_props$breadcrumbsLis2 = props.breadcrumbsList,
|
|
724
|
+
breadcrumbsList = _props$breadcrumbsLis2 === void 0 ? [] : _props$breadcrumbsLis2,
|
|
725
|
+
fieldConfig = props.fieldConfig,
|
|
726
|
+
onClickBreadcrumbs = props.onClickBreadcrumbs,
|
|
727
|
+
onLevel = props.onLevel,
|
|
728
|
+
onSelect = props.onSelect,
|
|
729
|
+
onLoad = props.onLoad,
|
|
730
|
+
onAllCheck = props.onAllCheck,
|
|
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({
|
|
707
743
|
searchTimer: null,
|
|
708
744
|
searchStr: ''
|
|
709
745
|
});
|
|
710
|
-
useEffect(()
|
|
746
|
+
useEffect(function () {
|
|
711
747
|
if (!searchVal) return;
|
|
712
748
|
constData.current.searchStr = searchVal.val;
|
|
713
749
|
setSearchStr(searchVal.val);
|
|
714
750
|
if (searchVal.val !== '') setShowSearch(true);
|
|
715
751
|
}, [searchVal]);
|
|
716
752
|
/** 改变搜索框 */
|
|
717
|
-
|
|
753
|
+
var changeSearch = function changeSearch(val) {
|
|
718
754
|
setSearchStr(val);
|
|
719
755
|
constData.current.searchStr = val;
|
|
720
756
|
if (searchTrigger !== 'onEnter') onSearchCom();
|
|
721
757
|
};
|
|
722
758
|
/** 搜索框回车事件 */
|
|
723
|
-
|
|
759
|
+
var onEnterSearch = function onEnterSearch() {
|
|
724
760
|
onSearchCom(true);
|
|
725
761
|
};
|
|
726
762
|
/** 点击搜索按钮 */
|
|
727
|
-
|
|
763
|
+
var onClickRightIcon = function onClickRightIcon() {
|
|
728
764
|
onSearchCom(true);
|
|
729
765
|
};
|
|
730
766
|
/** 点击清除按钮 */
|
|
731
|
-
|
|
767
|
+
var onClear = function onClear() {
|
|
732
768
|
onSearchCom();
|
|
733
769
|
};
|
|
734
770
|
/** 向外抛出搜索事件 */
|
|
735
|
-
|
|
771
|
+
var onSearchCom = function onSearchCom(bol) {
|
|
736
772
|
clearTimeout(constData.current.searchTimer);
|
|
737
|
-
constData.current.searchTimer = setTimeout(()
|
|
773
|
+
constData.current.searchTimer = setTimeout(function () {
|
|
738
774
|
setShowSearch(!!constData.current.searchStr);
|
|
739
775
|
onSearch && onSearch(constData.current.searchStr, !!bol);
|
|
740
776
|
}, 300);
|
|
741
777
|
};
|
|
742
778
|
/** 搜索dom */
|
|
743
|
-
|
|
744
|
-
|
|
779
|
+
var handSearchDom = function handSearchDom() {
|
|
780
|
+
var handSearchIcon = function handSearchIcon() {
|
|
745
781
|
if (!searchStr) {
|
|
746
782
|
// 本地数据且没有自定义刷新事件
|
|
747
783
|
if (!url && !onRefresh) {
|
|
@@ -772,23 +808,27 @@ const SelectorMain = props => {
|
|
|
772
808
|
/** 点击下级
|
|
773
809
|
* @param isSearch {boolean}
|
|
774
810
|
* */
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
811
|
+
var onLevelCom = function onLevelCom(isSearch) {
|
|
812
|
+
return function (item) {
|
|
813
|
+
if (isSearch) {
|
|
814
|
+
constData.current.searchStr = '';
|
|
815
|
+
setSearchStr('');
|
|
816
|
+
setShowSearch(false);
|
|
817
|
+
}
|
|
818
|
+
onLevel && onLevel(item, isSearch);
|
|
819
|
+
};
|
|
782
820
|
};
|
|
783
821
|
/**
|
|
784
822
|
* 加载更多
|
|
785
823
|
* @param isSearch {boolean} 是否搜索
|
|
786
824
|
* */
|
|
787
|
-
|
|
788
|
-
|
|
825
|
+
var onLoadCom = function onLoadCom(isSearch) {
|
|
826
|
+
return function () {
|
|
827
|
+
onLoad && onLoad(isSearch);
|
|
828
|
+
};
|
|
789
829
|
};
|
|
790
830
|
/** 渲染列表 */
|
|
791
|
-
|
|
831
|
+
var handListDom = function handListDom() {
|
|
792
832
|
return jsx(SelectorMainContent, {
|
|
793
833
|
className: "selector-main-list-box",
|
|
794
834
|
value: value,
|
|
@@ -817,7 +857,7 @@ const SelectorMain = props => {
|
|
|
817
857
|
}, "list");
|
|
818
858
|
};
|
|
819
859
|
/** 渲染搜索列表 */
|
|
820
|
-
|
|
860
|
+
var handSearchList = function handSearchList() {
|
|
821
861
|
if (!showSearch) return;
|
|
822
862
|
return jsx(SelectorMainContent, {
|
|
823
863
|
className: 'selector-main-search-content',
|
|
@@ -842,14 +882,14 @@ const SelectorMain = props => {
|
|
|
842
882
|
}, "search");
|
|
843
883
|
};
|
|
844
884
|
/** 处理loading */
|
|
845
|
-
|
|
885
|
+
var handLoading = function handLoading() {
|
|
846
886
|
if (searchLoading || loading) {
|
|
847
887
|
return jsx(Loading, {});
|
|
848
888
|
}
|
|
849
889
|
};
|
|
850
890
|
// 处理class
|
|
851
|
-
|
|
852
|
-
|
|
891
|
+
var handClass = function handClass() {
|
|
892
|
+
var str = "".concat($prefixCls, "-selector-main");
|
|
853
893
|
if (className) str += " ".concat(className);
|
|
854
894
|
if (selectMode === 'check') str += " ".concat($prefixCls, "-selector-main-select");
|
|
855
895
|
if (showSearch) str += " ".concat($prefixCls, "-selector-main-show-search");
|
|
@@ -876,38 +916,40 @@ const SelectorMain = props => {
|
|
|
876
916
|
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}";
|
|
877
917
|
styleInject(css_248z$1);
|
|
878
918
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
layout = 'node',
|
|
883
|
-
style,
|
|
884
|
-
list,
|
|
885
|
-
groupType,
|
|
886
|
-
nodeMode,
|
|
887
|
-
backDataFieldConfig,
|
|
888
|
-
detail,
|
|
889
|
-
detailRender,
|
|
890
|
-
disabled,
|
|
891
|
-
handSelectorNodeInfo,
|
|
892
|
-
selectDataTitleRender,
|
|
893
|
-
selectRenderItem,
|
|
894
|
-
selectRender,
|
|
895
|
-
onClose
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
919
|
+
var SelectorData = function SelectorData(props) {
|
|
920
|
+
var className = props.className,
|
|
921
|
+
_props$layout = props.layout,
|
|
922
|
+
layout = _props$layout === void 0 ? 'node' : _props$layout,
|
|
923
|
+
style = props.style,
|
|
924
|
+
list = props.list,
|
|
925
|
+
groupType = props.groupType,
|
|
926
|
+
nodeMode = props.nodeMode,
|
|
927
|
+
backDataFieldConfig = props.backDataFieldConfig,
|
|
928
|
+
detail = props.detail,
|
|
929
|
+
detailRender = props.detailRender,
|
|
930
|
+
disabled = props.disabled,
|
|
931
|
+
handSelectorNodeInfo = props.handSelectorNodeInfo,
|
|
932
|
+
selectDataTitleRender = props.selectDataTitleRender,
|
|
933
|
+
selectRenderItem = props.selectRenderItem,
|
|
934
|
+
selectRender = props.selectRender,
|
|
935
|
+
_onClose = props.onClose;
|
|
936
|
+
var intl = useFormatMessage('Selector', localeJson);
|
|
937
|
+
var _useState = useState({}),
|
|
938
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
939
|
+
listCom = _useState2[0],
|
|
940
|
+
setListCom = _useState2[1];
|
|
941
|
+
var constData = useRef({
|
|
900
942
|
listTypeJson: {},
|
|
901
943
|
backDataFieldConfig: {}
|
|
902
944
|
});
|
|
903
945
|
constData.current.listTypeJson = ArrayToObject('value', groupType);
|
|
904
946
|
constData.current.backDataFieldConfig = backDataFieldConfig || {};
|
|
905
|
-
useEffect(()
|
|
947
|
+
useEffect(function () {
|
|
906
948
|
if (list && groupType && groupType.length > 0) {
|
|
907
|
-
|
|
908
|
-
for (
|
|
909
|
-
|
|
910
|
-
|
|
949
|
+
var json = {};
|
|
950
|
+
for (var i = 0, l = list.length; i < l; i++) {
|
|
951
|
+
var item = list[i];
|
|
952
|
+
var type = item[constData.current.backDataFieldConfig.type || ''];
|
|
911
953
|
if (!json[type]) json[type] = [];
|
|
912
954
|
json[type].push(item);
|
|
913
955
|
}
|
|
@@ -915,12 +957,12 @@ const SelectorData = props => {
|
|
|
915
957
|
}
|
|
916
958
|
}, [list]);
|
|
917
959
|
/** 处理禁用 */
|
|
918
|
-
|
|
960
|
+
var handDisabled = function handDisabled(itemConfig) {
|
|
919
961
|
if (disabled) {
|
|
920
962
|
if (disabled === true) return true;
|
|
921
963
|
if (disabled instanceof Array) {
|
|
922
|
-
|
|
923
|
-
|
|
964
|
+
var keyStr = (backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '';
|
|
965
|
+
var val = itemConfig[keyStr];
|
|
924
966
|
if (disabled.indexOf(val) !== -1) {
|
|
925
967
|
return true;
|
|
926
968
|
}
|
|
@@ -929,40 +971,56 @@ const SelectorData = props => {
|
|
|
929
971
|
return false;
|
|
930
972
|
};
|
|
931
973
|
/** 处理每个节点的配置 */
|
|
932
|
-
|
|
933
|
-
|
|
974
|
+
var handNodeConfig = function handNodeConfig(itemConfig, index) {
|
|
975
|
+
var item = itemConfig;
|
|
934
976
|
if (handSelectorNodeInfo) item = handSelectorNodeInfo(itemConfig);
|
|
935
|
-
|
|
936
|
-
|
|
977
|
+
var disabledItem = handDisabled(itemConfig);
|
|
978
|
+
var json = {
|
|
937
979
|
useCase: 'edit',
|
|
938
980
|
close: !disabledItem,
|
|
939
|
-
detail,
|
|
981
|
+
detail: detail,
|
|
940
982
|
data: item,
|
|
941
|
-
nodeMode,
|
|
942
|
-
onClose:
|
|
983
|
+
nodeMode: nodeMode,
|
|
984
|
+
onClose: function onClose() {
|
|
985
|
+
return _onClose && _onClose(item, index);
|
|
986
|
+
},
|
|
943
987
|
disabled: handDisabled(itemConfig),
|
|
944
988
|
tagStyle: item.tagStyle
|
|
945
989
|
};
|
|
946
990
|
if (selectRenderItem) {
|
|
947
|
-
json.leftRender = ()
|
|
991
|
+
json.leftRender = function () {
|
|
948
992
|
return selectRenderItem(itemConfig);
|
|
949
993
|
};
|
|
950
994
|
}
|
|
951
995
|
/** 节点类型 */
|
|
952
996
|
if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
|
|
953
997
|
/** 渲染字段 */
|
|
954
|
-
|
|
955
|
-
for (
|
|
956
|
-
|
|
957
|
-
|
|
998
|
+
var arr = ['img', 'mainTitle', 'subTitle', 'tag'];
|
|
999
|
+
for (var i = 0, l = arr.length; i < l; i++) {
|
|
1000
|
+
var key = arr[i] || '';
|
|
1001
|
+
var backName = backDataFieldConfig && backDataFieldConfig[key] || '';
|
|
958
1002
|
json[key] = item[backName];
|
|
959
1003
|
}
|
|
960
1004
|
/** 详情render */
|
|
961
1005
|
if (detailRender) {
|
|
962
|
-
json.detailRender =
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
1006
|
+
json.detailRender = function () {
|
|
1007
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
1008
|
+
var Dom;
|
|
1009
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
1010
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1011
|
+
case 0:
|
|
1012
|
+
_context.next = 2;
|
|
1013
|
+
return detailRender(item, false);
|
|
1014
|
+
case 2:
|
|
1015
|
+
Dom = _context.sent;
|
|
1016
|
+
return _context.abrupt("return", Dom);
|
|
1017
|
+
case 4:
|
|
1018
|
+
case "end":
|
|
1019
|
+
return _context.stop();
|
|
1020
|
+
}
|
|
1021
|
+
}, _callee);
|
|
1022
|
+
}));
|
|
1023
|
+
};
|
|
966
1024
|
}
|
|
967
1025
|
if (item.detail !== undefined) json.detail = item.detail;
|
|
968
1026
|
/** 是否具有删除 */
|
|
@@ -970,23 +1028,23 @@ const SelectorData = props => {
|
|
|
970
1028
|
return json;
|
|
971
1029
|
};
|
|
972
1030
|
/** 处理节点 */
|
|
973
|
-
|
|
1031
|
+
var handNode = function handNode() {
|
|
974
1032
|
if (selectRender) {
|
|
975
1033
|
return selectRender(list || []);
|
|
976
1034
|
}
|
|
977
|
-
return list === null || list === void 0 ? void 0 : list.map((item, index)
|
|
1035
|
+
return list === null || list === void 0 ? void 0 : list.map(function (item, index) {
|
|
978
1036
|
return jsx(SelectorNode, Object.assign({}, handNodeConfig(item, index)), index);
|
|
979
1037
|
});
|
|
980
1038
|
};
|
|
981
1039
|
/** 处理标题 */
|
|
982
|
-
|
|
983
|
-
|
|
1040
|
+
var handTitle = function handTitle() {
|
|
1041
|
+
var handTitleTag = function handTitleTag() {
|
|
984
1042
|
if (selectDataTitleRender) return selectDataTitleRender(list);
|
|
985
1043
|
if (groupType) {
|
|
986
1044
|
return jsx(Fragment, {
|
|
987
|
-
children: groupType.map((item, index)
|
|
988
|
-
|
|
989
|
-
|
|
1045
|
+
children: groupType.map(function (item, index) {
|
|
1046
|
+
var num = 0;
|
|
1047
|
+
var val = item.value;
|
|
990
1048
|
if (listCom[val]) num = listCom[val].length;
|
|
991
1049
|
if (num === 0) return;
|
|
992
1050
|
return jsxs("span", Object.assign({
|
|
@@ -1011,7 +1069,7 @@ const SelectorData = props => {
|
|
|
1011
1069
|
}));
|
|
1012
1070
|
};
|
|
1013
1071
|
// 处理节点内容
|
|
1014
|
-
|
|
1072
|
+
var handContentNode = function handContentNode() {
|
|
1015
1073
|
return jsxs("div", Object.assign({
|
|
1016
1074
|
className: "selector-data-node-box"
|
|
1017
1075
|
}, {
|
|
@@ -1023,13 +1081,13 @@ const SelectorData = props => {
|
|
|
1023
1081
|
}));
|
|
1024
1082
|
};
|
|
1025
1083
|
// 处理内容
|
|
1026
|
-
|
|
1084
|
+
var handDetailTagContent = function handDetailTagContent() {
|
|
1027
1085
|
if (selectRender) {
|
|
1028
1086
|
return selectRender(list || []);
|
|
1029
1087
|
}
|
|
1030
1088
|
return jsx(Fragment, {
|
|
1031
|
-
children: list === null || list === void 0 ? void 0 : list.map((item, index)
|
|
1032
|
-
|
|
1089
|
+
children: list === null || list === void 0 ? void 0 : list.map(function (item, index) {
|
|
1090
|
+
var disabledItem = handDisabled(item);
|
|
1033
1091
|
return jsxs("span", Object.assign({
|
|
1034
1092
|
className: "content-tag"
|
|
1035
1093
|
}, {
|
|
@@ -1038,14 +1096,16 @@ const SelectorData = props => {
|
|
|
1038
1096
|
children: item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.mainTitle) || ''] || item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '']
|
|
1039
1097
|
})
|
|
1040
1098
|
}), !disabledItem && jsx(Close, {
|
|
1041
|
-
onClick: ()
|
|
1099
|
+
onClick: function onClick() {
|
|
1100
|
+
return _onClose && _onClose(item, index);
|
|
1101
|
+
}
|
|
1042
1102
|
})]
|
|
1043
1103
|
}), index);
|
|
1044
1104
|
})
|
|
1045
1105
|
});
|
|
1046
1106
|
};
|
|
1047
1107
|
// 处理tag内容
|
|
1048
|
-
|
|
1108
|
+
var handContentTag = function handContentTag() {
|
|
1049
1109
|
return jsxs("div", Object.assign({
|
|
1050
1110
|
className: "selector-data-tag-box"
|
|
1051
1111
|
}, {
|
|
@@ -1056,8 +1116,8 @@ const SelectorData = props => {
|
|
|
1056
1116
|
}))]
|
|
1057
1117
|
}));
|
|
1058
1118
|
};
|
|
1059
|
-
|
|
1060
|
-
|
|
1119
|
+
var handClass = function handClass() {
|
|
1120
|
+
var str = "".concat($prefixCls, "-selector-data");
|
|
1061
1121
|
if (layout) str += " ".concat($prefixCls, "-selector-data-").concat(layout);
|
|
1062
1122
|
if (disabled === true) str += " ".concat($prefixCls, "-selector-data-disabled");
|
|
1063
1123
|
if (className) str += " ".concat(className);
|
|
@@ -1075,11 +1135,9 @@ const SelectorData = props => {
|
|
|
1075
1135
|
* 发送请求
|
|
1076
1136
|
* @param obj {ReqFuncProps} 请求信息
|
|
1077
1137
|
*/
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
data
|
|
1082
|
-
} = obj,
|
|
1138
|
+
var reqFunc = function reqFunc(obj) {
|
|
1139
|
+
var method = obj.method,
|
|
1140
|
+
data = obj.data,
|
|
1083
1141
|
otherProps = __rest(obj, ["method", "data"]);
|
|
1084
1142
|
if (method === 'Get') {
|
|
1085
1143
|
return Get(Object.assign({
|
|
@@ -1088,7 +1146,7 @@ const reqFunc = obj => {
|
|
|
1088
1146
|
}
|
|
1089
1147
|
if (method === 'Post') {
|
|
1090
1148
|
return Post(Object.assign({
|
|
1091
|
-
data
|
|
1149
|
+
data: data
|
|
1092
1150
|
}, otherProps));
|
|
1093
1151
|
}
|
|
1094
1152
|
};
|