@para-ui/core 4.0.41 → 4.0.42
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/Cascader/index.js +4 -4
- package/ComboSelect/index.js +10 -10
- package/CycleSelector/index.js +4 -4
- package/DragVerify/index.js +2 -2
- package/DynamicMultiBox/index.js +7 -7
- package/Form/index.js +8 -8
- package/FormItem/index.js +8 -8
- package/FunctionModal/index.js +2 -2
- package/Image/index.js +1 -1
- package/Message/index.js +2 -2
- package/Modal/index.js +3 -3
- package/Notification/index.js +3 -3
- package/Pagination/index.js +2 -2
- package/Progress/index.js +2 -2
- package/Prompt/index.js +2 -2
- package/QuickReply/index.js +1 -1
- package/README.md +4 -1
- package/Result/index.d.ts +25 -0
- package/Result/index.js +94 -0
- package/Select/index.js +3 -3
- package/Selector/index.js +284 -226
- package/SelectorPicker/index.js +7 -7
- package/SingleBox/index.js +2 -2
- package/SortBox/index.js +1 -1
- package/Stepper/index.js +4 -4
- package/Switch/index.js +2 -2
- package/Table/index.js +488 -423
- package/Tabs/index.js +6 -6
- package/Tag/index.js +2 -2
- package/TextEditor/index.js +3 -3
- package/Timeline/index.js +14 -20
- package/Tree/index.js +4 -4
- package/Upload/index.js +5 -5
- package/_verture/{index-6016a7ed.js → index-2824e7a7.js} +2 -2
- package/_verture/{index-8a431cd6.js → index-67fe714a.js} +56 -54
- package/_verture/{index-5b4ff3b2.js → index-77fff5bd.js} +1 -1
- package/_verture/{index-8ac46bd9.js → index-94e24006.js} +1 -1
- package/index.d.ts +2 -0
- package/index.js +10 -9
- package/package.json +2 -3
- package/umd/Result.js +43 -0
- /package/_verture/{Portal-f9bedb3a.js → Portal-edd94cac.js} +0 -0
- /package/_verture/{index-0f5ee6f7.js → index-c8cb6751.js} +0 -0
- /package/_verture/{modalContext-efa83b5c.js → modalContext-369509dd.js} +0 -0
- /package/_verture/{typeof-6ec38efd.js → typeof-4646b22c.js} +0 -0
package/Selector/index.js
CHANGED
|
@@ -2,13 +2,13 @@ import { _ as __awaiter, a as __rest } from '../_verture/tslib.es6-f43aa41d.js';
|
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useRef, useEffect, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import { _ as _slicedToArray } from '../_verture/slicedToArray-75fa4188.js';
|
|
5
|
-
import { r as regenerator } from '../_verture/index-
|
|
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';
|
|
9
9
|
import AutoTips from '../AutoTips/index.js';
|
|
10
10
|
import { Loading } from '../Loading/index.js';
|
|
11
|
-
import
|
|
11
|
+
import Close from '@para-ui/icons/Close';
|
|
12
12
|
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
13
13
|
import { u as useFormatMessage } from '../_verture/useFormatMessage-1fc7c957.js';
|
|
14
14
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
@@ -20,7 +20,7 @@ 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
22
|
import HelperText from '../HelperText/index.js';
|
|
23
|
-
import '../_verture/typeof-
|
|
23
|
+
import '../_verture/typeof-4646b22c.js';
|
|
24
24
|
import '../Label/index.js';
|
|
25
25
|
import '../Help/index.js';
|
|
26
26
|
import '../Tooltip/index.js';
|
|
@@ -65,8 +65,8 @@ var zh = {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
var localeJson = {
|
|
68
|
-
zh,
|
|
69
|
-
en
|
|
68
|
+
zh: zh,
|
|
69
|
+
en: en
|
|
70
70
|
};
|
|
71
71
|
|
|
72
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}";
|
|
@@ -320,7 +320,7 @@ var SelectorNode = function SelectorNode(props) {
|
|
|
320
320
|
className: "close",
|
|
321
321
|
onClick: onCloseCom
|
|
322
322
|
}, {
|
|
323
|
-
children: jsx(
|
|
323
|
+
children: jsx(Close, {})
|
|
324
324
|
}))]
|
|
325
325
|
}))]
|
|
326
326
|
}));
|
|
@@ -329,57 +329,63 @@ var SelectorNode = function SelectorNode(props) {
|
|
|
329
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}";
|
|
330
330
|
styleInject(css_248z$2);
|
|
331
331
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
nodeMode = 'branch',
|
|
338
|
-
selectMode,
|
|
339
|
-
loadMore =
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
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({
|
|
363
369
|
listTypeJson: {},
|
|
364
370
|
fieldConfig: {},
|
|
365
371
|
resizeTimer: null
|
|
366
372
|
});
|
|
367
|
-
|
|
368
|
-
|
|
373
|
+
var scrolltRef = useRef(null);
|
|
374
|
+
var contentRef = useRef(null);
|
|
369
375
|
constData.current.listTypeJson = ArrayToObject('value', groupType);
|
|
370
376
|
constData.current.fieldConfig = fieldConfig || {};
|
|
371
|
-
useEffect(()
|
|
377
|
+
useEffect(function () {
|
|
372
378
|
changeResize();
|
|
373
|
-
return ()
|
|
379
|
+
return function () {
|
|
374
380
|
clearTimeout(constData.current.resizeTimer);
|
|
375
381
|
};
|
|
376
382
|
}, []);
|
|
377
|
-
useEffect(()
|
|
383
|
+
useEffect(function () {
|
|
378
384
|
if (list && groupType && groupType.length > 0) {
|
|
379
|
-
|
|
380
|
-
for (
|
|
381
|
-
|
|
382
|
-
|
|
385
|
+
var json = {};
|
|
386
|
+
for (var i = 0, l = list.length; i < l; i++) {
|
|
387
|
+
var item = list[i];
|
|
388
|
+
var type = item.type;
|
|
383
389
|
if (!json[type]) json[type] = [];
|
|
384
390
|
json[type].push(item);
|
|
385
391
|
}
|
|
@@ -387,17 +393,17 @@ const SelectorMainContent = props => {
|
|
|
387
393
|
}
|
|
388
394
|
}, [list]);
|
|
389
395
|
/** 屏幕发生改变 */
|
|
390
|
-
|
|
396
|
+
var changeResize = function changeResize() {
|
|
391
397
|
clearTimeout(constData.current.resizeTimer);
|
|
392
|
-
constData.current.resizeTimer = setTimeout(()
|
|
398
|
+
constData.current.resizeTimer = setTimeout(function () {
|
|
393
399
|
onScroll();
|
|
394
400
|
}, 100);
|
|
395
401
|
};
|
|
396
402
|
/** 滚动 */
|
|
397
|
-
|
|
403
|
+
var onScroll = function onScroll() {
|
|
398
404
|
if (!contentRef.current || !scrolltRef.current) return;
|
|
399
|
-
|
|
400
|
-
|
|
405
|
+
var scrollBox = scrolltRef.current;
|
|
406
|
+
var contentBox = contentRef.current;
|
|
401
407
|
contentBox.classList.remove('selector-main-list-scroll-top', 'selector-main-list-scroll-bottom', 'selector-main-list-scroll-middle');
|
|
402
408
|
if (scrollBox.scrollHeight <= scrollBox.clientHeight) return;
|
|
403
409
|
// 滚动条初始化
|
|
@@ -414,17 +420,17 @@ const SelectorMainContent = props => {
|
|
|
414
420
|
contentBox.classList.add('selector-main-list-scroll-middle');
|
|
415
421
|
};
|
|
416
422
|
/** 判断是否全选,半选 */
|
|
417
|
-
|
|
418
|
-
|
|
423
|
+
var handAllCheckFunc = function handAllCheckFunc() {
|
|
424
|
+
var json = {
|
|
419
425
|
checked: false,
|
|
420
426
|
indeterminate: false
|
|
421
427
|
};
|
|
422
428
|
// 不存在value, 没有数据, 全选没转态
|
|
423
429
|
if (!value || !list || list.length === 0) return json;
|
|
424
|
-
for (
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
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);
|
|
428
434
|
if (disabledItem) {
|
|
429
435
|
if (value[key]) json.checked = true;
|
|
430
436
|
continue;
|
|
@@ -448,7 +454,7 @@ const SelectorMainContent = props => {
|
|
|
448
454
|
return json;
|
|
449
455
|
};
|
|
450
456
|
/** 处理禁用状态 */
|
|
451
|
-
|
|
457
|
+
var handDisabled = function handDisabled(item) {
|
|
452
458
|
if (disabled) {
|
|
453
459
|
if (disabled === true) return true;
|
|
454
460
|
if (disabled instanceof Array) {
|
|
@@ -461,7 +467,7 @@ const SelectorMainContent = props => {
|
|
|
461
467
|
return false;
|
|
462
468
|
};
|
|
463
469
|
/** 处理禁用下级状态 */
|
|
464
|
-
|
|
470
|
+
var handDisabledChild = function handDisabledChild(item) {
|
|
465
471
|
if (disabledChild) {
|
|
466
472
|
if (disabledChild === true) return true;
|
|
467
473
|
if (disabledChild instanceof Array) {
|
|
@@ -474,12 +480,12 @@ const SelectorMainContent = props => {
|
|
|
474
480
|
return false;
|
|
475
481
|
};
|
|
476
482
|
/** 全选 */
|
|
477
|
-
|
|
483
|
+
var handAllCheck = function handAllCheck() {
|
|
478
484
|
// 只存在复选框模式
|
|
479
485
|
if (!isAllCheck || selectMode !== 'check') return null;
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
486
|
+
var checkJson = handAllCheckFunc();
|
|
487
|
+
var onAllCheckCom = function onAllCheckCom() {
|
|
488
|
+
var bol = true;
|
|
483
489
|
if (checkJson.checked) bol = false;
|
|
484
490
|
onAllCheck && onAllCheck(bol);
|
|
485
491
|
};
|
|
@@ -496,11 +502,11 @@ const SelectorMainContent = props => {
|
|
|
496
502
|
}));
|
|
497
503
|
};
|
|
498
504
|
/** 点击查看更多 */
|
|
499
|
-
|
|
505
|
+
var clickLoad = function clickLoad() {
|
|
500
506
|
onLoad && onLoad();
|
|
501
507
|
};
|
|
502
508
|
/** 查看更多 */
|
|
503
|
-
|
|
509
|
+
var handLoadMore = function handLoadMore() {
|
|
504
510
|
if (!loadMore) return null;
|
|
505
511
|
return jsx("div", Object.assign({
|
|
506
512
|
className: "selector-main-list-more",
|
|
@@ -516,29 +522,33 @@ const SelectorMainContent = props => {
|
|
|
516
522
|
}));
|
|
517
523
|
};
|
|
518
524
|
/** 判断是否选中 */
|
|
519
|
-
|
|
520
|
-
|
|
525
|
+
var handCheck = function handCheck(item) {
|
|
526
|
+
var bol = false;
|
|
521
527
|
if (value && value[item.key]) bol = true;
|
|
522
528
|
return bol;
|
|
523
529
|
};
|
|
524
530
|
/** 处理每个节点的配置 */
|
|
525
|
-
|
|
526
|
-
|
|
531
|
+
var handNodeConfig = function handNodeConfig(item) {
|
|
532
|
+
var json = {
|
|
527
533
|
useCase: 'view',
|
|
528
|
-
detail,
|
|
529
|
-
nodeMode,
|
|
534
|
+
detail: detail,
|
|
535
|
+
nodeMode: nodeMode,
|
|
530
536
|
disabled: handDisabled(item),
|
|
531
537
|
disabledChild: handDisabledChild(item),
|
|
532
|
-
onLevel:
|
|
533
|
-
|
|
538
|
+
onLevel: function onLevel() {
|
|
539
|
+
return _onLevel && _onLevel(item);
|
|
540
|
+
},
|
|
541
|
+
onSelect: function onSelect() {
|
|
542
|
+
return _onSelect && _onSelect(item);
|
|
543
|
+
},
|
|
534
544
|
checked: handCheck(item)
|
|
535
545
|
};
|
|
536
546
|
/** 节点类型 */
|
|
537
547
|
if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
|
|
538
548
|
/** 渲染字段 */
|
|
539
|
-
|
|
540
|
-
for (
|
|
541
|
-
|
|
549
|
+
var arr = ['img', 'mainTitle', 'subTitle', 'tag', 'tagStyle'];
|
|
550
|
+
for (var i = 0, l = arr.length; i < l; i++) {
|
|
551
|
+
var key = arr[i];
|
|
542
552
|
json[key] = item[key];
|
|
543
553
|
}
|
|
544
554
|
/** 判断是否具有选择 */
|
|
@@ -552,7 +562,7 @@ const SelectorMainContent = props => {
|
|
|
552
562
|
json.child = item.child;
|
|
553
563
|
} else {
|
|
554
564
|
// 全量数据
|
|
555
|
-
|
|
565
|
+
var children = item.children || [];
|
|
556
566
|
if (children && children.length > 0) {
|
|
557
567
|
json.child = true;
|
|
558
568
|
}
|
|
@@ -561,29 +571,43 @@ const SelectorMainContent = props => {
|
|
|
561
571
|
}
|
|
562
572
|
/** 详情render */
|
|
563
573
|
if (detailRender) {
|
|
564
|
-
json.detailRender =
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
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
|
+
};
|
|
568
592
|
}
|
|
569
593
|
if (item.detail !== undefined) json.detail = item.detail;
|
|
570
594
|
return json;
|
|
571
595
|
};
|
|
572
596
|
/** 渲染list节点 */
|
|
573
|
-
|
|
574
|
-
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) {
|
|
575
599
|
return jsx(SelectorNode, Object.assign({}, handNodeConfig(item)), index);
|
|
576
600
|
});
|
|
577
601
|
};
|
|
578
602
|
/** 处理节点dom */
|
|
579
|
-
|
|
603
|
+
var handNode = function handNode() {
|
|
580
604
|
// 分组渲染
|
|
581
605
|
if (groupType && groupType.length > 0) {
|
|
582
606
|
return jsx(Fragment, {
|
|
583
|
-
children: groupType.map((item, index)
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
607
|
+
children: groupType.map(function (item, index) {
|
|
608
|
+
var type = item.value;
|
|
609
|
+
var listData = listCom[type] || [];
|
|
610
|
+
var str = 'selector-group-title';
|
|
587
611
|
if (index === 0) str += ' selector-group-title-first';
|
|
588
612
|
return jsxs(Fragment$1, {
|
|
589
613
|
children: [listData.length > 0 && jsx("div", Object.assign({
|
|
@@ -598,11 +622,11 @@ const SelectorMainContent = props => {
|
|
|
598
622
|
return handListNode(list || []);
|
|
599
623
|
};
|
|
600
624
|
/** 点击面包屑 */
|
|
601
|
-
|
|
625
|
+
var onClickBreadcrums = function onClickBreadcrums(item) {
|
|
602
626
|
onClickBreadcrumbs && onClickBreadcrumbs(item);
|
|
603
627
|
};
|
|
604
628
|
/** 面包屑dom */
|
|
605
|
-
|
|
629
|
+
var handBreadcrumbs = function handBreadcrumbs() {
|
|
606
630
|
if (!breadcrumbs || breadcrumbsList.length === 0) return null;
|
|
607
631
|
return jsx("div", Object.assign({
|
|
608
632
|
className: "nav-box"
|
|
@@ -615,7 +639,7 @@ const SelectorMainContent = props => {
|
|
|
615
639
|
}));
|
|
616
640
|
};
|
|
617
641
|
/** 处理内容 */
|
|
618
|
-
|
|
642
|
+
var handContent = function handContent() {
|
|
619
643
|
if ((list === null || list === void 0 ? void 0 : list.length) === 0 && !loading) {
|
|
620
644
|
// 空状态
|
|
621
645
|
return jsx("div", Object.assign({
|
|
@@ -643,8 +667,8 @@ const SelectorMainContent = props => {
|
|
|
643
667
|
})), handLoadMore()]
|
|
644
668
|
}));
|
|
645
669
|
};
|
|
646
|
-
|
|
647
|
-
|
|
670
|
+
var handClass = function handClass() {
|
|
671
|
+
var str = 'selector-main-content';
|
|
648
672
|
if (className) str += " ".concat(className);
|
|
649
673
|
if (disabled) str += ' selector-main-content-disabled';
|
|
650
674
|
if (isAllCheck && selectMode === 'check') str += ' selector-main-content-all-check';
|
|
@@ -658,87 +682,99 @@ const SelectorMainContent = props => {
|
|
|
658
682
|
children: [handBreadcrumbs(), handContent()]
|
|
659
683
|
}));
|
|
660
684
|
};
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
rowKey = 'key',
|
|
668
|
-
|
|
669
|
-
|
|
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
|
-
|
|
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({
|
|
704
740
|
searchTimer: null,
|
|
705
741
|
searchStr: ''
|
|
706
742
|
});
|
|
707
|
-
useEffect(()
|
|
743
|
+
useEffect(function () {
|
|
708
744
|
if (!searchVal) return;
|
|
709
745
|
constData.current.searchStr = searchVal.val;
|
|
710
746
|
setSearchStr(searchVal.val);
|
|
711
747
|
if (searchVal.val !== '') setShowSearch(true);
|
|
712
748
|
}, [searchVal]);
|
|
713
749
|
/** 改变搜索框 */
|
|
714
|
-
|
|
750
|
+
var changeSearch = function changeSearch(val) {
|
|
715
751
|
setSearchStr(val);
|
|
716
752
|
constData.current.searchStr = val;
|
|
717
753
|
if (searchTrigger !== 'onEnter') onSearchCom();
|
|
718
754
|
};
|
|
719
755
|
/** 搜索框回车事件 */
|
|
720
|
-
|
|
756
|
+
var onEnterSearch = function onEnterSearch() {
|
|
721
757
|
onSearchCom(true);
|
|
722
758
|
};
|
|
723
759
|
/** 点击搜索按钮 */
|
|
724
|
-
|
|
760
|
+
var onClickRightIcon = function onClickRightIcon() {
|
|
725
761
|
onSearchCom(true);
|
|
726
762
|
};
|
|
727
763
|
/** 点击清除按钮 */
|
|
728
|
-
|
|
764
|
+
var onClear = function onClear() {
|
|
729
765
|
onSearchCom();
|
|
730
766
|
};
|
|
731
767
|
/** 向外抛出搜索事件 */
|
|
732
|
-
|
|
768
|
+
var onSearchCom = function onSearchCom(bol) {
|
|
733
769
|
clearTimeout(constData.current.searchTimer);
|
|
734
|
-
constData.current.searchTimer = setTimeout(()
|
|
770
|
+
constData.current.searchTimer = setTimeout(function () {
|
|
735
771
|
setShowSearch(!!constData.current.searchStr);
|
|
736
772
|
onSearch && onSearch(constData.current.searchStr, !!bol);
|
|
737
773
|
}, 300);
|
|
738
774
|
};
|
|
739
775
|
/** 搜索dom */
|
|
740
|
-
|
|
741
|
-
|
|
776
|
+
var handSearchDom = function handSearchDom() {
|
|
777
|
+
var handSearchIcon = function handSearchIcon() {
|
|
742
778
|
if (!searchStr) {
|
|
743
779
|
// 本地数据且没有自定义刷新事件
|
|
744
780
|
if (!url && !onRefresh) {
|
|
@@ -769,23 +805,27 @@ const SelectorMain = props => {
|
|
|
769
805
|
/** 点击下级
|
|
770
806
|
* @param isSearch {boolean}
|
|
771
807
|
* */
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
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
|
+
};
|
|
779
817
|
};
|
|
780
818
|
/**
|
|
781
819
|
* 加载更多
|
|
782
820
|
* @param isSearch {boolean} 是否搜索
|
|
783
821
|
* */
|
|
784
|
-
|
|
785
|
-
|
|
822
|
+
var onLoadCom = function onLoadCom(isSearch) {
|
|
823
|
+
return function () {
|
|
824
|
+
onLoad && onLoad(isSearch);
|
|
825
|
+
};
|
|
786
826
|
};
|
|
787
827
|
/** 渲染列表 */
|
|
788
|
-
|
|
828
|
+
var handListDom = function handListDom() {
|
|
789
829
|
return jsx(SelectorMainContent, {
|
|
790
830
|
className: "selector-main-list-box",
|
|
791
831
|
value: value,
|
|
@@ -814,7 +854,7 @@ const SelectorMain = props => {
|
|
|
814
854
|
}, "list");
|
|
815
855
|
};
|
|
816
856
|
/** 渲染搜索列表 */
|
|
817
|
-
|
|
857
|
+
var handSearchList = function handSearchList() {
|
|
818
858
|
if (!showSearch) return;
|
|
819
859
|
return jsx(SelectorMainContent, {
|
|
820
860
|
className: 'selector-main-search-content',
|
|
@@ -839,14 +879,14 @@ const SelectorMain = props => {
|
|
|
839
879
|
}, "search");
|
|
840
880
|
};
|
|
841
881
|
/** 处理loading */
|
|
842
|
-
|
|
882
|
+
var handLoading = function handLoading() {
|
|
843
883
|
if (searchLoading || loading) {
|
|
844
884
|
return jsx(Loading, {});
|
|
845
885
|
}
|
|
846
886
|
};
|
|
847
887
|
// 处理class
|
|
848
|
-
|
|
849
|
-
|
|
888
|
+
var handClass = function handClass() {
|
|
889
|
+
var str = "".concat($prefixCls, "-selector-main");
|
|
850
890
|
if (className) str += " ".concat(className);
|
|
851
891
|
if (selectMode === 'check') str += " ".concat($prefixCls, "-selector-main-select");
|
|
852
892
|
if (showSearch) str += " ".concat($prefixCls, "-selector-main-show-search");
|
|
@@ -869,38 +909,40 @@ const SelectorMain = props => {
|
|
|
869
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}";
|
|
870
910
|
styleInject(css_248z$1);
|
|
871
911
|
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
layout = 'node',
|
|
876
|
-
style,
|
|
877
|
-
list,
|
|
878
|
-
groupType,
|
|
879
|
-
nodeMode,
|
|
880
|
-
backDataFieldConfig,
|
|
881
|
-
detail,
|
|
882
|
-
detailRender,
|
|
883
|
-
disabled,
|
|
884
|
-
handSelectorNodeInfo,
|
|
885
|
-
selectDataTitleRender,
|
|
886
|
-
selectRenderItem,
|
|
887
|
-
selectRender,
|
|
888
|
-
onClose
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
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({
|
|
893
935
|
listTypeJson: {},
|
|
894
936
|
backDataFieldConfig: {}
|
|
895
937
|
});
|
|
896
938
|
constData.current.listTypeJson = ArrayToObject('value', groupType);
|
|
897
939
|
constData.current.backDataFieldConfig = backDataFieldConfig || {};
|
|
898
|
-
useEffect(()
|
|
940
|
+
useEffect(function () {
|
|
899
941
|
if (list && groupType && groupType.length > 0) {
|
|
900
|
-
|
|
901
|
-
for (
|
|
902
|
-
|
|
903
|
-
|
|
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 || ''];
|
|
904
946
|
if (!json[type]) json[type] = [];
|
|
905
947
|
json[type].push(item);
|
|
906
948
|
}
|
|
@@ -908,12 +950,12 @@ const SelectorData = props => {
|
|
|
908
950
|
}
|
|
909
951
|
}, [list]);
|
|
910
952
|
/** 处理禁用 */
|
|
911
|
-
|
|
953
|
+
var handDisabled = function handDisabled(itemConfig) {
|
|
912
954
|
if (disabled) {
|
|
913
955
|
if (disabled === true) return true;
|
|
914
956
|
if (disabled instanceof Array) {
|
|
915
|
-
|
|
916
|
-
|
|
957
|
+
var keyStr = (backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '';
|
|
958
|
+
var val = itemConfig[keyStr];
|
|
917
959
|
if (disabled.indexOf(val) !== -1) {
|
|
918
960
|
return true;
|
|
919
961
|
}
|
|
@@ -922,40 +964,56 @@ const SelectorData = props => {
|
|
|
922
964
|
return false;
|
|
923
965
|
};
|
|
924
966
|
/** 处理每个节点的配置 */
|
|
925
|
-
|
|
926
|
-
|
|
967
|
+
var handNodeConfig = function handNodeConfig(itemConfig, index) {
|
|
968
|
+
var item = itemConfig;
|
|
927
969
|
if (handSelectorNodeInfo) item = handSelectorNodeInfo(itemConfig);
|
|
928
|
-
|
|
929
|
-
|
|
970
|
+
var disabledItem = handDisabled(itemConfig);
|
|
971
|
+
var json = {
|
|
930
972
|
useCase: 'edit',
|
|
931
973
|
close: !disabledItem,
|
|
932
|
-
detail,
|
|
974
|
+
detail: detail,
|
|
933
975
|
data: item,
|
|
934
|
-
nodeMode,
|
|
935
|
-
onClose:
|
|
976
|
+
nodeMode: nodeMode,
|
|
977
|
+
onClose: function onClose() {
|
|
978
|
+
return _onClose && _onClose(item, index);
|
|
979
|
+
},
|
|
936
980
|
disabled: handDisabled(itemConfig),
|
|
937
981
|
tagStyle: item.tagStyle
|
|
938
982
|
};
|
|
939
983
|
if (selectRenderItem) {
|
|
940
|
-
json.leftRender = ()
|
|
984
|
+
json.leftRender = function () {
|
|
941
985
|
return selectRenderItem(itemConfig);
|
|
942
986
|
};
|
|
943
987
|
}
|
|
944
988
|
/** 节点类型 */
|
|
945
989
|
if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
|
|
946
990
|
/** 渲染字段 */
|
|
947
|
-
|
|
948
|
-
for (
|
|
949
|
-
|
|
950
|
-
|
|
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] || '';
|
|
951
995
|
json[key] = item[backName];
|
|
952
996
|
}
|
|
953
997
|
/** 详情render */
|
|
954
998
|
if (detailRender) {
|
|
955
|
-
json.detailRender =
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
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
|
+
};
|
|
959
1017
|
}
|
|
960
1018
|
if (item.detail !== undefined) json.detail = item.detail;
|
|
961
1019
|
/** 是否具有删除 */
|
|
@@ -963,23 +1021,23 @@ const SelectorData = props => {
|
|
|
963
1021
|
return json;
|
|
964
1022
|
};
|
|
965
1023
|
/** 处理节点 */
|
|
966
|
-
|
|
1024
|
+
var handNode = function handNode() {
|
|
967
1025
|
if (selectRender) {
|
|
968
1026
|
return selectRender(list || []);
|
|
969
1027
|
}
|
|
970
|
-
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) {
|
|
971
1029
|
return jsx(SelectorNode, Object.assign({}, handNodeConfig(item, index)), index);
|
|
972
1030
|
});
|
|
973
1031
|
};
|
|
974
1032
|
/** 处理标题 */
|
|
975
|
-
|
|
976
|
-
|
|
1033
|
+
var handTitle = function handTitle() {
|
|
1034
|
+
var handTitleTag = function handTitleTag() {
|
|
977
1035
|
if (selectDataTitleRender) return selectDataTitleRender(list);
|
|
978
1036
|
if (groupType) {
|
|
979
1037
|
return jsx(Fragment, {
|
|
980
|
-
children: groupType.map((item, index)
|
|
981
|
-
|
|
982
|
-
|
|
1038
|
+
children: groupType.map(function (item, index) {
|
|
1039
|
+
var num = 0;
|
|
1040
|
+
var val = item.value;
|
|
983
1041
|
if (listCom[val]) num = listCom[val].length;
|
|
984
1042
|
if (num === 0) return;
|
|
985
1043
|
return jsxs("span", Object.assign({
|
|
@@ -1004,7 +1062,7 @@ const SelectorData = props => {
|
|
|
1004
1062
|
}));
|
|
1005
1063
|
};
|
|
1006
1064
|
// 处理节点内容
|
|
1007
|
-
|
|
1065
|
+
var handContentNode = function handContentNode() {
|
|
1008
1066
|
return jsxs("div", Object.assign({
|
|
1009
1067
|
className: "selector-data-node-box"
|
|
1010
1068
|
}, {
|
|
@@ -1016,13 +1074,13 @@ const SelectorData = props => {
|
|
|
1016
1074
|
}));
|
|
1017
1075
|
};
|
|
1018
1076
|
// 处理内容
|
|
1019
|
-
|
|
1077
|
+
var handDetailTagContent = function handDetailTagContent() {
|
|
1020
1078
|
if (selectRender) {
|
|
1021
1079
|
return selectRender(list || []);
|
|
1022
1080
|
}
|
|
1023
1081
|
return jsx(Fragment, {
|
|
1024
|
-
children: list === null || list === void 0 ? void 0 : list.map((item, index)
|
|
1025
|
-
|
|
1082
|
+
children: list === null || list === void 0 ? void 0 : list.map(function (item, index) {
|
|
1083
|
+
var disabledItem = handDisabled(item);
|
|
1026
1084
|
return jsxs("span", Object.assign({
|
|
1027
1085
|
className: "content-tag"
|
|
1028
1086
|
}, {
|
|
@@ -1030,15 +1088,17 @@ const SelectorData = props => {
|
|
|
1030
1088
|
children: selectRenderItem ? selectRenderItem(item) : jsx(AutoTips, {
|
|
1031
1089
|
children: item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.mainTitle) || ''] || item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '']
|
|
1032
1090
|
})
|
|
1033
|
-
}), !disabledItem && jsx(
|
|
1034
|
-
onClick: ()
|
|
1091
|
+
}), !disabledItem && jsx(Close, {
|
|
1092
|
+
onClick: function onClick() {
|
|
1093
|
+
return _onClose && _onClose(item, index);
|
|
1094
|
+
}
|
|
1035
1095
|
})]
|
|
1036
1096
|
}), index);
|
|
1037
1097
|
})
|
|
1038
1098
|
});
|
|
1039
1099
|
};
|
|
1040
1100
|
// 处理tag内容
|
|
1041
|
-
|
|
1101
|
+
var handContentTag = function handContentTag() {
|
|
1042
1102
|
return jsxs("div", Object.assign({
|
|
1043
1103
|
className: "selector-data-tag-box"
|
|
1044
1104
|
}, {
|
|
@@ -1049,8 +1109,8 @@ const SelectorData = props => {
|
|
|
1049
1109
|
}))]
|
|
1050
1110
|
}));
|
|
1051
1111
|
};
|
|
1052
|
-
|
|
1053
|
-
|
|
1112
|
+
var handClass = function handClass() {
|
|
1113
|
+
var str = "".concat($prefixCls, "-selector-data");
|
|
1054
1114
|
if (layout) str += " ".concat($prefixCls, "-selector-data-").concat(layout);
|
|
1055
1115
|
if (disabled === true) str += " ".concat($prefixCls, "-selector-data-disabled");
|
|
1056
1116
|
if (className) str += " ".concat(className);
|
|
@@ -1068,11 +1128,9 @@ const SelectorData = props => {
|
|
|
1068
1128
|
* 发送请求
|
|
1069
1129
|
* @param obj {ReqFuncProps} 请求信息
|
|
1070
1130
|
*/
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
data
|
|
1075
|
-
} = obj,
|
|
1131
|
+
var reqFunc = function reqFunc(obj) {
|
|
1132
|
+
var method = obj.method,
|
|
1133
|
+
data = obj.data,
|
|
1076
1134
|
otherProps = __rest(obj, ["method", "data"]);
|
|
1077
1135
|
if (method === 'Get') {
|
|
1078
1136
|
return Get(Object.assign({
|
|
@@ -1081,7 +1139,7 @@ const reqFunc = obj => {
|
|
|
1081
1139
|
}
|
|
1082
1140
|
if (method === 'Post') {
|
|
1083
1141
|
return Post(Object.assign({
|
|
1084
|
-
data
|
|
1142
|
+
data: data
|
|
1085
1143
|
}, otherProps));
|
|
1086
1144
|
}
|
|
1087
1145
|
};
|