@kne/super-select 0.1.47 → 0.1.49
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/README.md +57 -2
- package/dist/index.js +129 -66
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +228 -162
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, forwardRef, useState, useCallback, useLayoutEffect, useEffect, useImperativeHandle, useRef } from 'react';
|
|
1
|
+
import React$1, { useMemo, forwardRef, useState, useCallback, useLayoutEffect, useEffect, useImperativeHandle, useRef } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { createContext } from '@kne/global-context';
|
|
4
4
|
import useResize from '@kne/use-resize';
|
|
@@ -6,7 +6,7 @@ import useControlValue from '@kne/use-control-value';
|
|
|
6
6
|
import classnames from 'classnames';
|
|
7
7
|
import isEqual from 'lodash/isEqual';
|
|
8
8
|
import last from 'lodash/last';
|
|
9
|
-
import { Tag, Modal, App, Dropdown, Flex, Checkbox, List, Empty, Row, Col, Button, Popover, Tree, Space, Badge, Spin } from 'antd';
|
|
9
|
+
import { Tag, Modal, App, Dropdown, Flex, Checkbox, List, Empty, Pagination, Row, Col, Button, Popover, Tree, Space, Badge, Spin } from 'antd';
|
|
10
10
|
import { CloseCircleFilled, DownOutlined, CheckOutlined, RightOutlined } from '@ant-design/icons';
|
|
11
11
|
import { isNotEmpty } from '@kne/is-empty';
|
|
12
12
|
import { usePopupContainer, useScrollElement, useMobilePopupMount, MOBILE_POPUP_MODE } from '@kne/responsive-utils';
|
|
@@ -19,14 +19,14 @@ import SearchInput from '@kne/search-input';
|
|
|
19
19
|
import { FetchScrollLoader } from '@kne/scroll-loader';
|
|
20
20
|
import '@kne/scroll-loader/dist/index.css';
|
|
21
21
|
import merge from 'lodash/merge';
|
|
22
|
-
import
|
|
23
|
-
export { mergeTreeChildren } from '@kne/table-
|
|
24
|
-
import '@kne/table-
|
|
22
|
+
import { Table, hasColumnWidth, isTreeDataType, normalizeTreeData, flattenAllTree } from '@kne/table-view';
|
|
23
|
+
export { mergeTreeChildren } from '@kne/table-view';
|
|
24
|
+
import '@kne/table-view/dist/index.css';
|
|
25
|
+
import Fetch, { withFetch } from '@kne/react-fetch';
|
|
25
26
|
import { CentralContent } from '@kne/info-page';
|
|
26
27
|
import '@kne/info-page/dist/index.css';
|
|
27
28
|
import memoize from 'lodash/memoize';
|
|
28
29
|
import isNil from 'lodash/isNil';
|
|
29
|
-
import Fetch from '@kne/react-fetch';
|
|
30
30
|
|
|
31
31
|
function _extends() {
|
|
32
32
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -121,24 +121,24 @@ const TagOverflowInner = ({
|
|
|
121
121
|
const displayCount = ready ? visibleCount : list.length;
|
|
122
122
|
const displayTags = list.slice(0, displayCount);
|
|
123
123
|
const showOverflow = ready && hiddenCount > 0;
|
|
124
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
124
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
125
125
|
ref: setContainerRef,
|
|
126
126
|
className: style$6['tag-overflow'],
|
|
127
127
|
style: {
|
|
128
128
|
width: availableWidth || '100%',
|
|
129
129
|
maxWidth: '100%'
|
|
130
130
|
}
|
|
131
|
-
}, shouldMeasure ? /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
}, shouldMeasure ? /*#__PURE__*/React$1.createElement("div", {
|
|
132
132
|
ref: setMeasureRef,
|
|
133
133
|
className: style$6['measure-layer'],
|
|
134
134
|
"aria-hidden": true,
|
|
135
135
|
style: {
|
|
136
136
|
gap: TAG_GAP
|
|
137
137
|
}
|
|
138
|
-
}, list.map(item => /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
}, list.map(item => /*#__PURE__*/React$1.createElement("div", {
|
|
139
139
|
key: item[valueKey],
|
|
140
140
|
"data-tag-measure": true
|
|
141
|
-
}, /*#__PURE__*/React.createElement(Tag, {
|
|
141
|
+
}, /*#__PURE__*/React$1.createElement(Tag, {
|
|
142
142
|
closable: true,
|
|
143
143
|
bordered: false,
|
|
144
144
|
className: style$6['tag-item'],
|
|
@@ -146,21 +146,21 @@ const TagOverflowInner = ({
|
|
|
146
146
|
'--max-tag-width': `${maxTagWidth}px`,
|
|
147
147
|
margin: 0
|
|
148
148
|
}
|
|
149
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
149
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
150
150
|
className: style$6['tag-label']
|
|
151
|
-
}, item[labelKey])))), /*#__PURE__*/React.createElement("div", {
|
|
151
|
+
}, item[labelKey])))), /*#__PURE__*/React$1.createElement("div", {
|
|
152
152
|
ref: setMoreMeasureRef
|
|
153
|
-
}, /*#__PURE__*/React.createElement(Tag, {
|
|
153
|
+
}, /*#__PURE__*/React$1.createElement(Tag, {
|
|
154
154
|
className: style$6['overflow-tag'],
|
|
155
155
|
style: {
|
|
156
156
|
margin: 0
|
|
157
157
|
}
|
|
158
|
-
}, "+99"))) : null, /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
}, "+99"))) : null, /*#__PURE__*/React$1.createElement("div", {
|
|
159
159
|
className: style$6['tag-overflow-content'],
|
|
160
160
|
style: {
|
|
161
161
|
gap: TAG_GAP
|
|
162
162
|
}
|
|
163
|
-
}, displayTags.map(item => /*#__PURE__*/React.createElement(Tag, {
|
|
163
|
+
}, displayTags.map(item => /*#__PURE__*/React$1.createElement(Tag, {
|
|
164
164
|
key: item[valueKey],
|
|
165
165
|
closable: true,
|
|
166
166
|
bordered: false,
|
|
@@ -173,15 +173,15 @@ const TagOverflowInner = ({
|
|
|
173
173
|
e.preventDefault();
|
|
174
174
|
onRemove(item);
|
|
175
175
|
}
|
|
176
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
176
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
177
177
|
className: style$6['tag-label'],
|
|
178
178
|
title: item[labelKey]
|
|
179
|
-
}, item[labelKey]))), showOverflow ? /*#__PURE__*/React.createElement(Tag, {
|
|
179
|
+
}, item[labelKey]))), showOverflow ? /*#__PURE__*/React$1.createElement(Tag, {
|
|
180
180
|
className: style$6['overflow-tag']
|
|
181
181
|
}, "+", hiddenCount) : null));
|
|
182
182
|
};
|
|
183
183
|
|
|
184
|
-
const _excluded$
|
|
184
|
+
const _excluded$4 = ["children"];
|
|
185
185
|
const MOBILE_SHEET_MAX_HEIGHT = '80%';
|
|
186
186
|
const MOBILE_SHEET_MIN_HEIGHT = '30%';
|
|
187
187
|
const MOBILE_MASK_Z_INDEX = 1000;
|
|
@@ -259,7 +259,7 @@ const ModalContent = _ref => {
|
|
|
259
259
|
let {
|
|
260
260
|
children: renderContent
|
|
261
261
|
} = _ref,
|
|
262
|
-
others = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
262
|
+
others = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
263
263
|
const {
|
|
264
264
|
open,
|
|
265
265
|
value: propsValue
|
|
@@ -286,7 +286,7 @@ const ModalContent = _ref => {
|
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
});
|
|
289
|
-
return /*#__PURE__*/React.createElement(Provider, {
|
|
289
|
+
return /*#__PURE__*/React$1.createElement(Provider, {
|
|
290
290
|
value: contextProps
|
|
291
291
|
}, renderContent(contextProps));
|
|
292
292
|
};
|
|
@@ -317,7 +317,7 @@ const MobileSheetMask = ({
|
|
|
317
317
|
if (!renderMask || !mountNode) {
|
|
318
318
|
return null;
|
|
319
319
|
}
|
|
320
|
-
return createPortal(/*#__PURE__*/React.createElement("div", {
|
|
320
|
+
return createPortal(/*#__PURE__*/React$1.createElement("div", {
|
|
321
321
|
className: classnames(style$6['mobile-sheet-mask'], maskClosing && style$6['mobile-sheet-mask-leave'], fixedModeClass),
|
|
322
322
|
style: {
|
|
323
323
|
zIndex: MOBILE_MASK_Z_INDEX
|
|
@@ -335,16 +335,16 @@ const MobileSheetHeader = ({
|
|
|
335
335
|
onCancel,
|
|
336
336
|
onConfirm
|
|
337
337
|
}) => {
|
|
338
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
338
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
339
339
|
className: style$6['mobile-sheet-header']
|
|
340
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
340
|
+
}, /*#__PURE__*/React$1.createElement("button", {
|
|
341
341
|
type: "button",
|
|
342
342
|
className: style$6['mobile-sheet-action'],
|
|
343
343
|
onClick: onCancel
|
|
344
|
-
}, cancelText), /*#__PURE__*/React.createElement("div", {
|
|
344
|
+
}, cancelText), /*#__PURE__*/React$1.createElement("div", {
|
|
345
345
|
className: style$6['mobile-sheet-title'],
|
|
346
346
|
title: title
|
|
347
|
-
}, title), /*#__PURE__*/React.createElement("button", {
|
|
347
|
+
}, title), /*#__PURE__*/React$1.createElement("button", {
|
|
348
348
|
type: "button",
|
|
349
349
|
className: classnames(style$6['mobile-sheet-action'], style$6['mobile-sheet-confirm']),
|
|
350
350
|
onClick: onConfirm
|
|
@@ -365,7 +365,7 @@ const MobileSheetPanel = ({
|
|
|
365
365
|
if (!open || !mountNode) {
|
|
366
366
|
return null;
|
|
367
367
|
}
|
|
368
|
-
return createPortal(/*#__PURE__*/React.createElement("div", {
|
|
368
|
+
return createPortal(/*#__PURE__*/React$1.createElement("div", {
|
|
369
369
|
className: classnames(style$6['mobile-sheet-popup'], style$6['mobile-sheet-portal'], fixedModeClass, overlayClassName),
|
|
370
370
|
style: {
|
|
371
371
|
zIndex: MOBILE_POPUP_Z_INDEX,
|
|
@@ -379,13 +379,13 @@ const MobileSheetPanel = ({
|
|
|
379
379
|
e.preventDefault();
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
}, /*#__PURE__*/React.createElement(MobileSheetHeader, {
|
|
382
|
+
}, /*#__PURE__*/React$1.createElement(MobileSheetHeader, {
|
|
383
383
|
title: title,
|
|
384
384
|
cancelText: cancelText,
|
|
385
385
|
confirmText: confirmText,
|
|
386
386
|
onCancel: onCancel,
|
|
387
387
|
onConfirm: onConfirm
|
|
388
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
388
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
389
389
|
className: classnames(style$6['mobile-sheet-body'], style$6['overlay-content'], 'over-content'),
|
|
390
390
|
onClick: e => {
|
|
391
391
|
e.stopPropagation();
|
|
@@ -458,12 +458,12 @@ const SelectInput = createWithIntlProvider({
|
|
|
458
458
|
if (isMobile && !disableMobileSheet) {
|
|
459
459
|
const mountNode = typeof getPopupContainer === 'function' ? getPopupContainer() : null;
|
|
460
460
|
const closeWithoutCommit = () => onOpenChange(false);
|
|
461
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MobileSheetMask, {
|
|
461
|
+
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(MobileSheetMask, {
|
|
462
462
|
open: open,
|
|
463
463
|
mountNode: mountNode,
|
|
464
464
|
fixedModeClass: fixedModeClass,
|
|
465
465
|
onClose: closeWithoutCommit
|
|
466
|
-
}), /*#__PURE__*/React.createElement(MobileSheetPanel, {
|
|
466
|
+
}), /*#__PURE__*/React$1.createElement(MobileSheetPanel, {
|
|
467
467
|
open: open,
|
|
468
468
|
mountNode: mountNode,
|
|
469
469
|
fixedModeClass: fixedModeClass,
|
|
@@ -482,7 +482,7 @@ const SelectInput = createWithIntlProvider({
|
|
|
482
482
|
}
|
|
483
483
|
}, open ? children(contextProps) : null));
|
|
484
484
|
}
|
|
485
|
-
return /*#__PURE__*/React.createElement(Modal, {
|
|
485
|
+
return /*#__PURE__*/React$1.createElement(Modal, {
|
|
486
486
|
className: overlayClassName,
|
|
487
487
|
width: 1000,
|
|
488
488
|
open: open,
|
|
@@ -730,7 +730,7 @@ const SelectInput = createWithIntlProvider({
|
|
|
730
730
|
if (typeof contextProps.props.inputRender === 'function') {
|
|
731
731
|
return contextProps.props.inputRender(props, contextProps);
|
|
732
732
|
}
|
|
733
|
-
return /*#__PURE__*/React.createElement(Flex, _extends({}, props, {
|
|
733
|
+
return /*#__PURE__*/React$1.createElement(Flex, _extends({}, props, {
|
|
734
734
|
ref: setContainerRef,
|
|
735
735
|
className: classnames(className, style$6['select-input'], 'select-input', {
|
|
736
736
|
[style$6['wrap']]: labelWrap,
|
|
@@ -748,35 +748,35 @@ const SelectInput = createWithIntlProvider({
|
|
|
748
748
|
}
|
|
749
749
|
}), (() => {
|
|
750
750
|
const current = typeof prefix === 'function' ? prefix(contextProps) : prefix;
|
|
751
|
-
return current && /*#__PURE__*/React.createElement("span", {
|
|
751
|
+
return current && /*#__PURE__*/React$1.createElement("span", {
|
|
752
752
|
className: classnames(style$6['select-input-prefix'], 'select-input-prefix'),
|
|
753
753
|
onClick: e => {
|
|
754
754
|
e.stopPropagation();
|
|
755
755
|
}
|
|
756
756
|
}, current);
|
|
757
|
-
})(), /*#__PURE__*/React.createElement("div", {
|
|
757
|
+
})(), /*#__PURE__*/React$1.createElement("div", {
|
|
758
758
|
className: classnames(style$6['select-input-inner'], 'select-input-inner')
|
|
759
|
-
}, value.length > 0 ? single || value[0][valueKey] === selectedAllValue[valueKey] ? /*#__PURE__*/React.createElement("span", {
|
|
759
|
+
}, value.length > 0 ? single || value[0][valueKey] === selectedAllValue[valueKey] ? /*#__PURE__*/React$1.createElement("span", {
|
|
760
760
|
className: classnames(style$6['single-label'], 'select-input-single-label'),
|
|
761
761
|
title: value[0][labelKey]
|
|
762
|
-
}, value[0][labelKey]) : /*#__PURE__*/React.createElement(TagOverflowInner, {
|
|
762
|
+
}, value[0][labelKey]) : /*#__PURE__*/React$1.createElement(TagOverflowInner, {
|
|
763
763
|
value: value,
|
|
764
764
|
innerWidth: innerWidth,
|
|
765
765
|
labelKey: labelKey,
|
|
766
766
|
valueKey: valueKey,
|
|
767
767
|
onRemove: onRemove
|
|
768
|
-
}) : /*#__PURE__*/React.createElement("span", {
|
|
768
|
+
}) : /*#__PURE__*/React$1.createElement("span", {
|
|
769
769
|
className: classnames(style$6['placeholder'], 'select-input-placeholder')
|
|
770
|
-
}, placeholder)), /*#__PURE__*/React.createElement("div", {
|
|
770
|
+
}, placeholder)), /*#__PURE__*/React$1.createElement("div", {
|
|
771
771
|
className: classnames(style$6['select-input-icon'], 'select-input-icon')
|
|
772
|
-
}, !disabled && allowClear && hover && value.length > 0 ? /*#__PURE__*/React.createElement(CloseCircleFilled, {
|
|
772
|
+
}, !disabled && allowClear && hover && value.length > 0 ? /*#__PURE__*/React$1.createElement(CloseCircleFilled, {
|
|
773
773
|
onClick: e => {
|
|
774
774
|
e.stopPropagation();
|
|
775
775
|
setValue([]);
|
|
776
776
|
}
|
|
777
|
-
}) : /*#__PURE__*/React.createElement(DownOutlined, null)), (() => {
|
|
777
|
+
}) : /*#__PURE__*/React$1.createElement(DownOutlined, null)), (() => {
|
|
778
778
|
const current = typeof suffix === 'function' ? suffix(contextProps) : suffix;
|
|
779
|
-
return current && /*#__PURE__*/React.createElement("span", {
|
|
779
|
+
return current && /*#__PURE__*/React$1.createElement("span", {
|
|
780
780
|
className: classnames(style$6['select-input-suffix'], 'select-input-suffix'),
|
|
781
781
|
onClick: e => {
|
|
782
782
|
e.stopPropagation();
|
|
@@ -799,7 +799,7 @@ const SelectInput = createWithIntlProvider({
|
|
|
799
799
|
// 移动端半屏:与 Modal 一致,临时选中 + 取消/确认
|
|
800
800
|
if (useMobileSheet) {
|
|
801
801
|
const closeWithoutCommit = () => setOpen(false);
|
|
802
|
-
return /*#__PURE__*/React.createElement(Provider, {
|
|
802
|
+
return /*#__PURE__*/React$1.createElement(Provider, {
|
|
803
803
|
value: contextProps
|
|
804
804
|
}, inputInnerRender({
|
|
805
805
|
onClick: () => {
|
|
@@ -807,16 +807,16 @@ const SelectInput = createWithIntlProvider({
|
|
|
807
807
|
setOpen(true);
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
|
-
}), /*#__PURE__*/React.createElement(ModalContent, contextProps, sheetContextProps => {
|
|
810
|
+
}), /*#__PURE__*/React$1.createElement(ModalContent, contextProps, sheetContextProps => {
|
|
811
811
|
const {
|
|
812
812
|
onComplete
|
|
813
813
|
} = sheetContextProps;
|
|
814
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MobileSheetMask, {
|
|
814
|
+
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(MobileSheetMask, {
|
|
815
815
|
open: sheetOpen,
|
|
816
816
|
mountNode: popupMountNode,
|
|
817
817
|
fixedModeClass: fixedModeClass,
|
|
818
818
|
onClose: closeWithoutCommit
|
|
819
|
-
}), /*#__PURE__*/React.createElement(MobileSheetPanel, {
|
|
819
|
+
}), /*#__PURE__*/React$1.createElement(MobileSheetPanel, {
|
|
820
820
|
open: sheetOpen,
|
|
821
821
|
mountNode: popupMountNode,
|
|
822
822
|
fixedModeClass: fixedModeClass,
|
|
@@ -836,7 +836,7 @@ const SelectInput = createWithIntlProvider({
|
|
|
836
836
|
}, sheetOpen ? children(sheetContextProps) : null));
|
|
837
837
|
}));
|
|
838
838
|
}
|
|
839
|
-
const overlayContent = /*#__PURE__*/React.createElement("div", {
|
|
839
|
+
const overlayContent = /*#__PURE__*/React$1.createElement("div", {
|
|
840
840
|
style: {
|
|
841
841
|
'--overlay-width': popupOverlayWidth
|
|
842
842
|
},
|
|
@@ -845,9 +845,9 @@ const SelectInput = createWithIntlProvider({
|
|
|
845
845
|
e.stopPropagation();
|
|
846
846
|
}
|
|
847
847
|
}, isOverlayOpen ? children(contextProps) : null);
|
|
848
|
-
return /*#__PURE__*/React.createElement(Provider, {
|
|
848
|
+
return /*#__PURE__*/React$1.createElement(Provider, {
|
|
849
849
|
value: contextProps
|
|
850
|
-
}, isPopup ? /*#__PURE__*/React.createElement(Dropdown, {
|
|
850
|
+
}, isPopup ? /*#__PURE__*/React$1.createElement(Dropdown, {
|
|
851
851
|
open: isOverlayOpen,
|
|
852
852
|
onOpenChange: handleOpenChange,
|
|
853
853
|
placement: placement,
|
|
@@ -863,11 +863,11 @@ const SelectInput = createWithIntlProvider({
|
|
|
863
863
|
destroyOnHidden: true,
|
|
864
864
|
popupRender: () => overlayContent,
|
|
865
865
|
dropdownRender: () => overlayContent
|
|
866
|
-
}, /*#__PURE__*/React.createElement("span", null, inputInnerRender())) : /*#__PURE__*/React.createElement(React.Fragment, null, inputInnerRender({
|
|
866
|
+
}, /*#__PURE__*/React$1.createElement("span", null, inputInnerRender())) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, inputInnerRender({
|
|
867
867
|
onClick: () => {
|
|
868
868
|
setOpen(true);
|
|
869
869
|
}
|
|
870
|
-
}), /*#__PURE__*/React.createElement(ModalContent, contextProps, renderModal)));
|
|
870
|
+
}), /*#__PURE__*/React$1.createElement(ModalContent, contextProps, renderModal)));
|
|
871
871
|
}));
|
|
872
872
|
|
|
873
873
|
var style$5 = {"selected-all":"kne-super-select_prlgN"};
|
|
@@ -893,14 +893,14 @@ const SelectedAll = createWithIntlProvider('zh-CN', locale$1, 'super-select')(()
|
|
|
893
893
|
})
|
|
894
894
|
}, props);
|
|
895
895
|
const isSelectedAll = computedIsSelectAll(value, selectedAllValue, valueKey);
|
|
896
|
-
return /*#__PURE__*/React.createElement(Flex, {
|
|
896
|
+
return /*#__PURE__*/React$1.createElement(Flex, {
|
|
897
897
|
justify: "space-between",
|
|
898
898
|
className: classnames(style$5['selected-all'], 'selected-all')
|
|
899
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
899
|
+
}, /*#__PURE__*/React$1.createElement(Flex, {
|
|
900
900
|
gap: 8
|
|
901
|
-
}, /*#__PURE__*/React.createElement("span", null, formatMessage({
|
|
901
|
+
}, /*#__PURE__*/React$1.createElement("span", null, formatMessage({
|
|
902
902
|
id: 'selected'
|
|
903
|
-
}), ":"), /*#__PURE__*/React.createElement("span", null, isSelectedAll ? selectedAllValue.label : typeof unit === 'function' ? unit(value.length) : value.length)), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
903
|
+
}), ":"), /*#__PURE__*/React$1.createElement("span", null, isSelectedAll ? selectedAllValue.label : typeof unit === 'function' ? unit(value.length) : value.length)), /*#__PURE__*/React$1.createElement("span", null, /*#__PURE__*/React$1.createElement(Checkbox, {
|
|
904
904
|
checked: isSelectedAll,
|
|
905
905
|
onChange: e => {
|
|
906
906
|
const checked = e.target.checked;
|
|
@@ -935,21 +935,21 @@ const SelectedTagList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
935
935
|
labelKey,
|
|
936
936
|
valueKey
|
|
937
937
|
} = Object.assign({}, props);
|
|
938
|
-
return /*#__PURE__*/React.createElement(Flex, {
|
|
938
|
+
return /*#__PURE__*/React$1.createElement(Flex, {
|
|
939
939
|
className: classnames(style$4['tag-list'], 'selected-tag-list'),
|
|
940
940
|
gap: 8
|
|
941
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
941
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
942
942
|
className: style$4['label']
|
|
943
943
|
}, formatMessage({
|
|
944
944
|
id: 'selected'
|
|
945
|
-
}), !single && value.length > 0 && `(${value.length}${Number.isInteger(maxLength) ? `/${maxLength}` : ''})`, ":"), /*#__PURE__*/React.createElement(SimpleBar, {
|
|
945
|
+
}), !single && value.length > 0 && `(${value.length}${Number.isInteger(maxLength) ? `/${maxLength}` : ''})`, ":"), /*#__PURE__*/React$1.createElement(SimpleBar, {
|
|
946
946
|
className: style$4['tag-container']
|
|
947
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
947
|
+
}, /*#__PURE__*/React$1.createElement(Flex, {
|
|
948
948
|
gap: 8,
|
|
949
949
|
wrap: true,
|
|
950
950
|
className: style$4['tag-container-inner']
|
|
951
951
|
}, value.map(item => {
|
|
952
|
-
return /*#__PURE__*/React.createElement(Tag, {
|
|
952
|
+
return /*#__PURE__*/React$1.createElement(Tag, {
|
|
953
953
|
className: style$4['tag'],
|
|
954
954
|
key: item[valueKey],
|
|
955
955
|
closable: true,
|
|
@@ -958,7 +958,7 @@ const SelectedTagList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
958
958
|
e.preventDefault();
|
|
959
959
|
onRemove(item);
|
|
960
960
|
}
|
|
961
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
961
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
962
962
|
className: style$4['tag-inner']
|
|
963
963
|
}, item[labelKey]));
|
|
964
964
|
}))));
|
|
@@ -966,12 +966,12 @@ const SelectedTagList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
966
966
|
|
|
967
967
|
var style$3 = {"kne-responsive-boundary":"kne-super-select_Nc-y4","kne-responsive-scroll":"kne-super-select_RlrDm","list":"kne-super-select_IsXdU","empty":"kne-super-select_SQZ8k","default-list":"kne-super-select_QD1Mz","is-selected-all":"kne-super-select_M-mOy","default-list-item":"kne-super-select_KtOsz","is-selected":"kne-super-select_TQhBB","single-checked":"kne-super-select_2rUrh","is-disabled":"kne-super-select_NbwX5","selected-all":"kne-super-select_vN2Fx","selected-tag":"kne-super-select_6oITk","select-search":"kne-super-select_iAH9D","select-list-item-description":"kne-super-select_TCkeJ","footer":"kne-super-select_v3f23","is-mobile":"kne-super-select_w-WB8"};
|
|
968
968
|
|
|
969
|
-
const _excluded$
|
|
969
|
+
const _excluded$3 = ["children"];
|
|
970
970
|
const SelectList = forwardRef((_ref, ref) => {
|
|
971
971
|
let {
|
|
972
972
|
children
|
|
973
973
|
} = _ref,
|
|
974
|
-
p = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
974
|
+
p = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
975
975
|
const fetchListRef = useRef(null);
|
|
976
976
|
const props = Object.assign({}, {
|
|
977
977
|
renderItemContent: ({
|
|
@@ -981,9 +981,9 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
981
981
|
const {
|
|
982
982
|
labelKey
|
|
983
983
|
} = props;
|
|
984
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
984
|
+
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
|
|
985
985
|
className: 'select-list-item-label'
|
|
986
|
-
}, item[labelKey]), item.description && /*#__PURE__*/React.createElement("div", {
|
|
986
|
+
}, item[labelKey]), item.description && /*#__PURE__*/React$1.createElement("div", {
|
|
987
987
|
className: classnames(style$3['select-list-item-description'], 'select-list-item-description')
|
|
988
988
|
}, item.description));
|
|
989
989
|
},
|
|
@@ -1004,7 +1004,7 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
1004
1004
|
valueKey
|
|
1005
1005
|
} = props;
|
|
1006
1006
|
const isChecked = value.some(target => target[valueKey] === item[valueKey]);
|
|
1007
|
-
return /*#__PURE__*/React.createElement(List.Item, {
|
|
1007
|
+
return /*#__PURE__*/React$1.createElement(List.Item, {
|
|
1008
1008
|
className: classnames(style$3['default-list-item'], 'select-list-item', {
|
|
1009
1009
|
[style$3['is-selected']]: isChecked,
|
|
1010
1010
|
[style$3['is-disabled']]: item.disabled
|
|
@@ -1027,17 +1027,17 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
1027
1027
|
onOpenChange(false);
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
|
-
}, !single && /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
1030
|
+
}, !single && /*#__PURE__*/React$1.createElement(Flex, null, /*#__PURE__*/React$1.createElement(Checkbox, {
|
|
1031
1031
|
checked: isSelectedAll || isChecked,
|
|
1032
1032
|
disabled: isSelectedAll || item.disabled
|
|
1033
|
-
})), /*#__PURE__*/React.createElement(Flex, {
|
|
1033
|
+
})), /*#__PURE__*/React$1.createElement(Flex, {
|
|
1034
1034
|
vertical: true,
|
|
1035
1035
|
gag: 8,
|
|
1036
1036
|
flex: 1,
|
|
1037
1037
|
className: 'select-list-item-content'
|
|
1038
|
-
}, renderItemContent(contextProps)), single && /*#__PURE__*/React.createElement("div", {
|
|
1038
|
+
}, renderItemContent(contextProps)), single && /*#__PURE__*/React$1.createElement("div", {
|
|
1039
1039
|
className: style$3['single-checked']
|
|
1040
|
-
}, isChecked && /*#__PURE__*/React.createElement(CheckOutlined, null)));
|
|
1040
|
+
}, isChecked && /*#__PURE__*/React$1.createElement(CheckOutlined, null)));
|
|
1041
1041
|
},
|
|
1042
1042
|
renderList: contextProps => {
|
|
1043
1043
|
const {
|
|
@@ -1049,11 +1049,11 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
1049
1049
|
renderItem
|
|
1050
1050
|
} = props;
|
|
1051
1051
|
if (!(list && list.length > 0)) {
|
|
1052
|
-
return props.empty || /*#__PURE__*/React.createElement(Empty, {
|
|
1052
|
+
return props.empty || /*#__PURE__*/React$1.createElement(Empty, {
|
|
1053
1053
|
className: style$3['empty']
|
|
1054
1054
|
});
|
|
1055
1055
|
}
|
|
1056
|
-
return /*#__PURE__*/React.createElement(List, {
|
|
1056
|
+
return /*#__PURE__*/React$1.createElement(List, {
|
|
1057
1057
|
className: classnames(style$3['default-list'], {
|
|
1058
1058
|
[style$3['is-selected-all']]: isSelectedAll
|
|
1059
1059
|
}),
|
|
@@ -1065,7 +1065,7 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
}, p);
|
|
1068
|
-
return /*#__PURE__*/React.createElement(SelectInput, _extends({}, props, {
|
|
1068
|
+
return /*#__PURE__*/React$1.createElement(SelectInput, _extends({}, props, {
|
|
1069
1069
|
ref: ref
|
|
1070
1070
|
}), targetProps => {
|
|
1071
1071
|
const {
|
|
@@ -1093,7 +1093,7 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
1093
1093
|
selectedAllValue
|
|
1094
1094
|
} = props;
|
|
1095
1095
|
const components = {
|
|
1096
|
-
search: (api && typeof getSearchProps === 'function' || options && typeof getSearchCallback === 'function') && /*#__PURE__*/React.createElement(SearchInput, {
|
|
1096
|
+
search: (api && typeof getSearchProps === 'function' || options && typeof getSearchCallback === 'function') && /*#__PURE__*/React$1.createElement(SearchInput, {
|
|
1097
1097
|
className: classnames(style$3['select-search'], 'select-list-search', {
|
|
1098
1098
|
'is-popup': isPopup
|
|
1099
1099
|
}),
|
|
@@ -1107,12 +1107,12 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
1107
1107
|
simple: isPopup,
|
|
1108
1108
|
showSearchButton: !isPopup
|
|
1109
1109
|
}),
|
|
1110
|
-
selectedAll: !single && allowSelectedAll && /*#__PURE__*/React.createElement("div", {
|
|
1110
|
+
selectedAll: !single && allowSelectedAll && /*#__PURE__*/React$1.createElement("div", {
|
|
1111
1111
|
className: classnames(style$3['selected-all'], 'select-list-selected-all', {
|
|
1112
1112
|
'is-popup': isPopup
|
|
1113
1113
|
})
|
|
1114
|
-
}, /*#__PURE__*/React.createElement(SelectedAll, null)),
|
|
1115
|
-
fetchList: open ? /*#__PURE__*/React.createElement(FetchScrollLoader, _extends({}, props, {
|
|
1114
|
+
}, /*#__PURE__*/React$1.createElement(SelectedAll, null)),
|
|
1115
|
+
fetchList: open ? /*#__PURE__*/React$1.createElement(FetchScrollLoader, _extends({}, props, {
|
|
1116
1116
|
className: classnames(style$3['list'], 'select-list-scroll-list', {
|
|
1117
1117
|
'is-popup': isPopup
|
|
1118
1118
|
}),
|
|
@@ -1149,12 +1149,12 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
1149
1149
|
isSelectedAll
|
|
1150
1150
|
}));
|
|
1151
1151
|
}) : null,
|
|
1152
|
-
selectedTag: showSelectedTag && /*#__PURE__*/React.createElement("div", {
|
|
1152
|
+
selectedTag: showSelectedTag && /*#__PURE__*/React$1.createElement("div", {
|
|
1153
1153
|
className: classnames(style$3['selected-tag'], 'select-list-selected-tag', {
|
|
1154
1154
|
'is-popup': isPopup
|
|
1155
1155
|
})
|
|
1156
|
-
}, /*#__PURE__*/React.createElement(SelectedTagList, null)),
|
|
1157
|
-
footer: footer && /*#__PURE__*/React.createElement("div", {
|
|
1156
|
+
}, /*#__PURE__*/React$1.createElement(SelectedTagList, null)),
|
|
1157
|
+
footer: footer && /*#__PURE__*/React$1.createElement("div", {
|
|
1158
1158
|
className: classnames(style$3['footer'], 'select-list-footer')
|
|
1159
1159
|
}, typeof footer === 'function' ? footer({
|
|
1160
1160
|
reload: () => {
|
|
@@ -1170,7 +1170,7 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
1170
1170
|
components
|
|
1171
1171
|
}));
|
|
1172
1172
|
}
|
|
1173
|
-
return /*#__PURE__*/React.createElement(Flex, {
|
|
1173
|
+
return /*#__PURE__*/React$1.createElement(Flex, {
|
|
1174
1174
|
vertical: true,
|
|
1175
1175
|
className: classnames({
|
|
1176
1176
|
[style$3['is-mobile']]: isMobile
|
|
@@ -1181,6 +1181,70 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
1181
1181
|
|
|
1182
1182
|
var style$2 = {"body":"kne-super-select_704J1","is-mobile":"kne-super-select_HYGUN","table-panel-wrap":"kne-super-select_Boo1a","selected-panel-wrap":"kne-super-select_q-BjK","table-panel":"kne-super-select_UAejp","filter-wrap":"kne-super-select_gmlBv","table":"kne-super-select_zE-14","list":"kne-super-select_DrEYJ","is-fit-columns":"kne-super-select_QqZxW","empty":"kne-super-select_5Tyrt","right-options-col":"kne-super-select_sNBrJ","right-options":"kne-super-select_UXi-g","no-padding-btn":"kne-super-select_iaCir","selected-tags-scroll":"kne-super-select_b-3Xk","tag":"kne-super-select_JkYqS","tag-inner":"kne-super-select_VZlBL","single-checked":"kne-super-select_Eiz-u","select-search":"kne-super-select_temy6","tags-search":"kne-super-select_7phL2","descriptions":"kne-super-select_ttNK9","footer":"kne-super-select_lISfA"};
|
|
1183
1183
|
|
|
1184
|
+
const _excluded$2 = ["data", "reload", "refresh", "requestParams", "fetchProps", "dataFormat", "pagination", "columns", "columnRenderProps"];
|
|
1185
|
+
const defaultDataFormat = data => ({
|
|
1186
|
+
list: data == null ? void 0 : data.pageData,
|
|
1187
|
+
total: data == null ? void 0 : data.totalCount,
|
|
1188
|
+
data
|
|
1189
|
+
});
|
|
1190
|
+
const FetchTableContent = _ref => {
|
|
1191
|
+
let {
|
|
1192
|
+
data,
|
|
1193
|
+
reload,
|
|
1194
|
+
refresh,
|
|
1195
|
+
requestParams,
|
|
1196
|
+
fetchProps,
|
|
1197
|
+
dataFormat = defaultDataFormat,
|
|
1198
|
+
pagination,
|
|
1199
|
+
columns,
|
|
1200
|
+
columnRenderProps
|
|
1201
|
+
} = _ref,
|
|
1202
|
+
tableProps = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
1203
|
+
const paginationMerged = Object.assign({
|
|
1204
|
+
open: false,
|
|
1205
|
+
paramsType: 'data',
|
|
1206
|
+
requestType: 'reload',
|
|
1207
|
+
currentName: 'currentPage',
|
|
1208
|
+
pageSizeName: 'perPage',
|
|
1209
|
+
pageSize: 20,
|
|
1210
|
+
showSizeChanger: false,
|
|
1211
|
+
showQuickJumper: false,
|
|
1212
|
+
hideOnSinglePage: true
|
|
1213
|
+
}, pagination);
|
|
1214
|
+
const formatData = dataFormat(data);
|
|
1215
|
+
const tableContext = Object.assign({}, columnRenderProps, {
|
|
1216
|
+
data,
|
|
1217
|
+
requestParams,
|
|
1218
|
+
fetchProps
|
|
1219
|
+
});
|
|
1220
|
+
const showPagination = paginationMerged.open && formatData.total > 0;
|
|
1221
|
+
const currentPage = get(requestParams, [paginationMerged.paramsType, paginationMerged.currentName], 1);
|
|
1222
|
+
const currentPageSize = Number(get(requestParams, [paginationMerged.paramsType, paginationMerged.pageSizeName], paginationMerged.pageSize)) || paginationMerged.pageSize || 20;
|
|
1223
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Table, _extends({}, tableProps, {
|
|
1224
|
+
dataSource: formatData.list || [],
|
|
1225
|
+
pagination: false,
|
|
1226
|
+
columns: columns,
|
|
1227
|
+
context: tableContext,
|
|
1228
|
+
columnRenderProps: tableContext
|
|
1229
|
+
})), showPagination ? /*#__PURE__*/React.createElement(Pagination, {
|
|
1230
|
+
total: formatData.total,
|
|
1231
|
+
current: currentPage,
|
|
1232
|
+
pageSize: currentPageSize,
|
|
1233
|
+
showSizeChanger: paginationMerged.showSizeChanger,
|
|
1234
|
+
showQuickJumper: paginationMerged.showQuickJumper,
|
|
1235
|
+
hideOnSinglePage: paginationMerged.hideOnSinglePage,
|
|
1236
|
+
onChange: (page, size) => {
|
|
1237
|
+
(paginationMerged.requestType === 'refresh' ? refresh : reload)({
|
|
1238
|
+
[paginationMerged.paramsType]: Object.assign({}, get(requestParams, paginationMerged.paramsType), {
|
|
1239
|
+
[paginationMerged.currentName]: page,
|
|
1240
|
+
[paginationMerged.pageSizeName]: size
|
|
1241
|
+
})
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
}) : null);
|
|
1245
|
+
};
|
|
1246
|
+
const FetchTable = withFetch(FetchTableContent);
|
|
1247
|
+
|
|
1184
1248
|
const isEmptyParentKey = value => value == null || value === '';
|
|
1185
1249
|
const flattenSelectList = (list, {
|
|
1186
1250
|
dataType,
|
|
@@ -1291,7 +1355,7 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1291
1355
|
if (!(api && typeof getSearchProps === 'function' || options && typeof getSearchCallback === 'function')) {
|
|
1292
1356
|
return null;
|
|
1293
1357
|
}
|
|
1294
|
-
return /*#__PURE__*/React.createElement(SearchInput, {
|
|
1358
|
+
return /*#__PURE__*/React$1.createElement(SearchInput, {
|
|
1295
1359
|
className: classnames(style$2['select-search'], 'select-table-search', {
|
|
1296
1360
|
'is-popup': isPopup
|
|
1297
1361
|
}),
|
|
@@ -1320,7 +1384,7 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1320
1384
|
}
|
|
1321
1385
|
}, p);
|
|
1322
1386
|
const bodyRef = useRef(null);
|
|
1323
|
-
return /*#__PURE__*/React.createElement(SelectInput, _extends({}, props, {
|
|
1387
|
+
return /*#__PURE__*/React$1.createElement(SelectInput, _extends({}, props, {
|
|
1324
1388
|
ref: ref
|
|
1325
1389
|
}), targetProps => {
|
|
1326
1390
|
const {
|
|
@@ -1367,7 +1431,7 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1367
1431
|
} = props;
|
|
1368
1432
|
const isSelectedAll = computedIsSelectAll(value, selectedAllValue, valueKey);
|
|
1369
1433
|
const resolvedTreeTitleKey = treeTitleKey || labelKey;
|
|
1370
|
-
const footerEl = footer && /*#__PURE__*/React.createElement("div", {
|
|
1434
|
+
const footerEl = footer && /*#__PURE__*/React$1.createElement("div", {
|
|
1371
1435
|
className: classnames(style$2['footer'], 'select-table-footer')
|
|
1372
1436
|
}, typeof footer === 'function' ? footer({
|
|
1373
1437
|
reload: () => {
|
|
@@ -1378,6 +1442,10 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1378
1442
|
onOpenChange(false);
|
|
1379
1443
|
}
|
|
1380
1444
|
}) : footer);
|
|
1445
|
+
const paginationParamsType = (paginationProp == null ? void 0 : paginationProp.paramsType) || 'data';
|
|
1446
|
+
const searchRequestProps = typeof getSearchProps === 'function' && isNotEmpty(searchProps) ? {
|
|
1447
|
+
[paginationParamsType]: getSearchProps(searchProps) || {}
|
|
1448
|
+
} : {};
|
|
1381
1449
|
const tablePageFetchConfig = options ? {
|
|
1382
1450
|
data: {
|
|
1383
1451
|
options,
|
|
@@ -1401,9 +1469,7 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1401
1469
|
totalCount: pageData.length
|
|
1402
1470
|
};
|
|
1403
1471
|
}
|
|
1404
|
-
} : merge({}, api,
|
|
1405
|
-
data: getSearchProps(searchProps) || {}
|
|
1406
|
-
} : {});
|
|
1472
|
+
} : merge({}, api, searchRequestProps);
|
|
1407
1473
|
const allColumnsHaveWidth = Array.isArray(columns) && columns.length > 0 && columns.every(hasColumnWidth);
|
|
1408
1474
|
const tableSelection = {
|
|
1409
1475
|
allowSelectedAll,
|
|
@@ -1431,12 +1497,12 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1431
1497
|
}
|
|
1432
1498
|
}
|
|
1433
1499
|
};
|
|
1434
|
-
const selectedPanel = !single && /*#__PURE__*/React.createElement("div", {
|
|
1500
|
+
const selectedPanel = !single && /*#__PURE__*/React$1.createElement("div", {
|
|
1435
1501
|
className: classnames(style$2['right-options'], {
|
|
1436
1502
|
'is-popup': isPopup,
|
|
1437
1503
|
[style$2['is-mobile']]: isMobile
|
|
1438
1504
|
})
|
|
1439
|
-
}, /*#__PURE__*/React.createElement(SearchInput, {
|
|
1505
|
+
}, /*#__PURE__*/React$1.createElement(SearchInput, {
|
|
1440
1506
|
className: style$2['tags-search'],
|
|
1441
1507
|
placeholder: searchPlaceholder,
|
|
1442
1508
|
value: tagSearchText,
|
|
@@ -1444,13 +1510,13 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1444
1510
|
setTagSearchText(value);
|
|
1445
1511
|
},
|
|
1446
1512
|
showSearchButton: false
|
|
1447
|
-
}), /*#__PURE__*/React.createElement(Row, {
|
|
1513
|
+
}), /*#__PURE__*/React$1.createElement(Row, {
|
|
1448
1514
|
wrap: false,
|
|
1449
1515
|
justify: 'space-between',
|
|
1450
1516
|
align: 'middle'
|
|
1451
|
-
}, /*#__PURE__*/React.createElement(Col, null, formatMessage({
|
|
1517
|
+
}, /*#__PURE__*/React$1.createElement(Col, null, formatMessage({
|
|
1452
1518
|
id: 'selected'
|
|
1453
|
-
}), value.length > 0 && `(${value.length}${Number.isInteger(maxLength) ? `/${maxLength}` : ''})`, ":"), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(Button, {
|
|
1519
|
+
}), value.length > 0 && `(${value.length}${Number.isInteger(maxLength) ? `/${maxLength}` : ''})`, ":"), /*#__PURE__*/React$1.createElement(Col, null, /*#__PURE__*/React$1.createElement(Button, {
|
|
1454
1520
|
className: style$2['no-padding-btn'],
|
|
1455
1521
|
type: "link",
|
|
1456
1522
|
onClick: () => {
|
|
@@ -1459,12 +1525,12 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1459
1525
|
}, formatMessage({
|
|
1460
1526
|
id: 'removeAll'
|
|
1461
1527
|
})))), (() => {
|
|
1462
|
-
const selectedTags = /*#__PURE__*/React.createElement(Flex, {
|
|
1528
|
+
const selectedTags = /*#__PURE__*/React$1.createElement(Flex, {
|
|
1463
1529
|
wrap: true,
|
|
1464
1530
|
gap: 8
|
|
1465
1531
|
}, value.filter(item => getTagSearchCallback(tagSearchText, item, targetProps)).map(item => {
|
|
1466
1532
|
var _tablePageRef$current3;
|
|
1467
|
-
return /*#__PURE__*/React.createElement(Tag, {
|
|
1533
|
+
return /*#__PURE__*/React$1.createElement(Tag, {
|
|
1468
1534
|
className: style$2['tag'],
|
|
1469
1535
|
key: item[valueKey],
|
|
1470
1536
|
closable: true,
|
|
@@ -1473,9 +1539,9 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1473
1539
|
e.preventDefault();
|
|
1474
1540
|
onRemove(item);
|
|
1475
1541
|
}
|
|
1476
|
-
}, /*#__PURE__*/React.createElement(Popover, {
|
|
1542
|
+
}, /*#__PURE__*/React$1.createElement(Popover, {
|
|
1477
1543
|
getPopupContainer: () => bodyRef.current,
|
|
1478
|
-
content: /*#__PURE__*/React.createElement(CentralContent, {
|
|
1544
|
+
content: /*#__PURE__*/React$1.createElement(CentralContent, {
|
|
1479
1545
|
className: style$2['descriptions'],
|
|
1480
1546
|
columns: columns.filter(item => {
|
|
1481
1547
|
if (Object.hasOwn(item, 'previewHidden')) {
|
|
@@ -1491,35 +1557,35 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1491
1557
|
list: getListFromPageData((_tablePageRef$current3 = tablePageRef.current) == null ? void 0 : _tablePageRef$current3.data)
|
|
1492
1558
|
})
|
|
1493
1559
|
})
|
|
1494
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
1560
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
1495
1561
|
className: style$2['tag-inner']
|
|
1496
1562
|
}, item[labelKey])));
|
|
1497
1563
|
}));
|
|
1498
1564
|
// 移动端弹窗内不用 SimpleBar,改原生滚动
|
|
1499
1565
|
if (isMobile) {
|
|
1500
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1566
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1501
1567
|
className: style$2['selected-tags-scroll']
|
|
1502
1568
|
}, selectedTags);
|
|
1503
1569
|
}
|
|
1504
|
-
return /*#__PURE__*/React.createElement(SimpleBar, {
|
|
1570
|
+
return /*#__PURE__*/React$1.createElement(SimpleBar, {
|
|
1505
1571
|
className: style$2['selected-tags-scroll']
|
|
1506
1572
|
}, selectedTags);
|
|
1507
1573
|
})(), footerEl);
|
|
1508
|
-
const tablePanel = /*#__PURE__*/React.createElement("div", {
|
|
1574
|
+
const tablePanel = /*#__PURE__*/React$1.createElement("div", {
|
|
1509
1575
|
className: classnames(style$2['table-panel'], {
|
|
1510
1576
|
[style$2['single-body']]: single
|
|
1511
1577
|
})
|
|
1512
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1578
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
1513
1579
|
className: style$2['filter-wrap']
|
|
1514
|
-
}, filterRender(Object.assign({}, targetProps))), /*#__PURE__*/React.createElement("div", {
|
|
1580
|
+
}, filterRender(Object.assign({}, targetProps))), /*#__PURE__*/React$1.createElement("div", {
|
|
1515
1581
|
className: classnames(style$2['table'], 'select-table')
|
|
1516
|
-
}, open ? /*#__PURE__*/React.createElement("div", {
|
|
1582
|
+
}, open ? /*#__PURE__*/React$1.createElement("div", {
|
|
1517
1583
|
ref: listScrollRef,
|
|
1518
1584
|
className: classnames(style$2['list'], 'select-table-list-scroll-list', {
|
|
1519
1585
|
'is-popup': isPopup,
|
|
1520
1586
|
[style$2['is-fit-columns']]: !allColumnsHaveWidth
|
|
1521
1587
|
})
|
|
1522
|
-
}, /*#__PURE__*/React.createElement(
|
|
1588
|
+
}, /*#__PURE__*/React$1.createElement(FetchTable, _extends({}, tablePageFetchConfig, {
|
|
1523
1589
|
ref: tablePageRef
|
|
1524
1590
|
}, dataFormat ? {
|
|
1525
1591
|
dataFormat
|
|
@@ -1542,7 +1608,7 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1542
1608
|
columnRenderProps: Object.assign({}, targetProps, {
|
|
1543
1609
|
isSelectedAll
|
|
1544
1610
|
}),
|
|
1545
|
-
empty: props.empty || /*#__PURE__*/React.createElement(Empty, {
|
|
1611
|
+
empty: props.empty || /*#__PURE__*/React$1.createElement(Empty, {
|
|
1546
1612
|
className: classnames(style$2['empty'])
|
|
1547
1613
|
}),
|
|
1548
1614
|
dataType: dataType,
|
|
@@ -1566,31 +1632,31 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1566
1632
|
expandedKeys
|
|
1567
1633
|
} : null, Object.prototype.hasOwnProperty.call(p, 'defaultExpandedKeys') ? {
|
|
1568
1634
|
defaultExpandedKeys
|
|
1569
|
-
} : null))) : null), single && footerEl || !isMobile && /*#__PURE__*/React.createElement("div", {
|
|
1635
|
+
} : null))) : null), single && footerEl || !isMobile && /*#__PURE__*/React$1.createElement("div", {
|
|
1570
1636
|
className: classnames(style$2['footer'], 'select-table-footer')
|
|
1571
1637
|
}));
|
|
1572
1638
|
|
|
1573
1639
|
// 移动端:表格在上、已选在下(上下布局)
|
|
1574
1640
|
if (isMobile) {
|
|
1575
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1641
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1576
1642
|
ref: bodyRef,
|
|
1577
1643
|
className: classnames(style$2['body'], style$2['is-mobile'], 'select-table-list-body')
|
|
1578
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1644
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
1579
1645
|
className: style$2['table-panel-wrap']
|
|
1580
|
-
}, tablePanel), selectedPanel ? /*#__PURE__*/React.createElement("div", {
|
|
1646
|
+
}, tablePanel), selectedPanel ? /*#__PURE__*/React$1.createElement("div", {
|
|
1581
1647
|
className: style$2['selected-panel-wrap']
|
|
1582
1648
|
}, selectedPanel) : null);
|
|
1583
1649
|
}
|
|
1584
|
-
return /*#__PURE__*/React.createElement(Row, {
|
|
1650
|
+
return /*#__PURE__*/React$1.createElement(Row, {
|
|
1585
1651
|
wrap: false,
|
|
1586
1652
|
ref: bodyRef,
|
|
1587
1653
|
className: classnames(style$2['body'], 'select-table-list-body')
|
|
1588
|
-
}, /*#__PURE__*/React.createElement(Col, {
|
|
1654
|
+
}, /*#__PURE__*/React$1.createElement(Col, {
|
|
1589
1655
|
className: classnames({
|
|
1590
1656
|
[style$2['single-body']]: single
|
|
1591
1657
|
}),
|
|
1592
1658
|
span: single ? 24 : 16
|
|
1593
|
-
}, tablePanel), !single && /*#__PURE__*/React.createElement(Col, {
|
|
1659
|
+
}, tablePanel), !single && /*#__PURE__*/React$1.createElement(Col, {
|
|
1594
1660
|
span: 8,
|
|
1595
1661
|
className: style$2['right-options-col']
|
|
1596
1662
|
}, selectedPanel));
|
|
@@ -1638,7 +1704,7 @@ const SelectTree = forwardRef((_ref, ref) => {
|
|
|
1638
1704
|
const {
|
|
1639
1705
|
labelKey
|
|
1640
1706
|
} = props;
|
|
1641
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
1707
|
+
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
|
|
1642
1708
|
className: 'select-tree-item-label'
|
|
1643
1709
|
}, item[labelKey]));
|
|
1644
1710
|
},
|
|
@@ -1659,7 +1725,7 @@ const SelectTree = forwardRef((_ref, ref) => {
|
|
|
1659
1725
|
valueKey
|
|
1660
1726
|
} = props;
|
|
1661
1727
|
const isChecked = value.some(target => target[valueKey] === item[valueKey]);
|
|
1662
|
-
return /*#__PURE__*/React.createElement(Flex, {
|
|
1728
|
+
return /*#__PURE__*/React$1.createElement(Flex, {
|
|
1663
1729
|
className: classnames(style$1['default-list-item'], 'select-tree-item', {
|
|
1664
1730
|
[style$1['is-selected']]: isChecked,
|
|
1665
1731
|
[style$1['is-disabled']]: item.disabled
|
|
@@ -1682,17 +1748,17 @@ const SelectTree = forwardRef((_ref, ref) => {
|
|
|
1682
1748
|
onOpenChange(false);
|
|
1683
1749
|
}
|
|
1684
1750
|
}
|
|
1685
|
-
}, !single && /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
1751
|
+
}, !single && /*#__PURE__*/React$1.createElement(Flex, null, /*#__PURE__*/React$1.createElement(Checkbox, {
|
|
1686
1752
|
checked: isSelectedAll || isChecked,
|
|
1687
1753
|
disabled: isSelectedAll || item.disabled
|
|
1688
|
-
})), /*#__PURE__*/React.createElement(Flex, {
|
|
1754
|
+
})), /*#__PURE__*/React$1.createElement(Flex, {
|
|
1689
1755
|
vertical: true,
|
|
1690
1756
|
gag: 8,
|
|
1691
1757
|
flex: 1,
|
|
1692
1758
|
className: 'select-tree-item-content'
|
|
1693
|
-
}, renderItemContent(contextProps)), single && /*#__PURE__*/React.createElement("div", {
|
|
1759
|
+
}, renderItemContent(contextProps)), single && /*#__PURE__*/React$1.createElement("div", {
|
|
1694
1760
|
className: style$1['single-checked']
|
|
1695
|
-
}, isChecked && /*#__PURE__*/React.createElement(CheckOutlined, null)));
|
|
1761
|
+
}, isChecked && /*#__PURE__*/React$1.createElement(CheckOutlined, null)));
|
|
1696
1762
|
},
|
|
1697
1763
|
renderTree: contextProps => {
|
|
1698
1764
|
const {
|
|
@@ -1716,9 +1782,9 @@ const SelectTree = forwardRef((_ref, ref) => {
|
|
|
1716
1782
|
childrenKey
|
|
1717
1783
|
});
|
|
1718
1784
|
if (!(treeData && treeData.length > 0)) {
|
|
1719
|
-
return props.empty || /*#__PURE__*/React.createElement(Empty, null);
|
|
1785
|
+
return props.empty || /*#__PURE__*/React$1.createElement(Empty, null);
|
|
1720
1786
|
}
|
|
1721
|
-
return /*#__PURE__*/React.createElement(Tree, {
|
|
1787
|
+
return /*#__PURE__*/React$1.createElement(Tree, {
|
|
1722
1788
|
className: classnames(style$1['default-list'], {
|
|
1723
1789
|
[style$1['is-selected-all']]: isSelectedAll
|
|
1724
1790
|
}),
|
|
@@ -1742,7 +1808,7 @@ const SelectTree = forwardRef((_ref, ref) => {
|
|
|
1742
1808
|
});
|
|
1743
1809
|
}
|
|
1744
1810
|
}, p);
|
|
1745
|
-
return /*#__PURE__*/React.createElement(SelectInput, _extends({}, props, {
|
|
1811
|
+
return /*#__PURE__*/React$1.createElement(SelectInput, _extends({}, props, {
|
|
1746
1812
|
ref: ref
|
|
1747
1813
|
}), targetProps => {
|
|
1748
1814
|
const {
|
|
@@ -1765,12 +1831,12 @@ const SelectTree = forwardRef((_ref, ref) => {
|
|
|
1765
1831
|
selectedAllValue
|
|
1766
1832
|
} = props;
|
|
1767
1833
|
const components = {
|
|
1768
|
-
selectedAll: !single && allowSelectedAll && /*#__PURE__*/React.createElement("div", {
|
|
1834
|
+
selectedAll: !single && allowSelectedAll && /*#__PURE__*/React$1.createElement("div", {
|
|
1769
1835
|
className: classnames(style$1['selected-all'], 'select-tree-selected-all', {
|
|
1770
1836
|
'is-popup': isPopup
|
|
1771
1837
|
})
|
|
1772
|
-
}, /*#__PURE__*/React.createElement(SelectedAll, null)),
|
|
1773
|
-
treeList: open ? /*#__PURE__*/React.createElement(Fetch, _extends({}, Object.assign({}, options ? {
|
|
1838
|
+
}, /*#__PURE__*/React$1.createElement(SelectedAll, null)),
|
|
1839
|
+
treeList: open ? /*#__PURE__*/React$1.createElement(Fetch, _extends({}, Object.assign({}, options ? {
|
|
1774
1840
|
data: {
|
|
1775
1841
|
options
|
|
1776
1842
|
},
|
|
@@ -1794,22 +1860,22 @@ const SelectTree = forwardRef((_ref, ref) => {
|
|
|
1794
1860
|
});
|
|
1795
1861
|
// 移动端弹窗内不用 SimpleBar,改原生滚动
|
|
1796
1862
|
if (isMobile) {
|
|
1797
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1863
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1798
1864
|
className: scrollClassName
|
|
1799
1865
|
}, treeContent);
|
|
1800
1866
|
}
|
|
1801
|
-
return /*#__PURE__*/React.createElement(SimpleBar, {
|
|
1867
|
+
return /*#__PURE__*/React$1.createElement(SimpleBar, {
|
|
1802
1868
|
className: scrollClassName,
|
|
1803
1869
|
autoHide: false
|
|
1804
1870
|
}, treeContent);
|
|
1805
1871
|
}
|
|
1806
1872
|
})) : null,
|
|
1807
|
-
selectedTag: showSelectedTag && /*#__PURE__*/React.createElement("div", {
|
|
1873
|
+
selectedTag: showSelectedTag && /*#__PURE__*/React$1.createElement("div", {
|
|
1808
1874
|
className: classnames(style$1['selected-tag'], 'select-tree-selected-tag', {
|
|
1809
1875
|
'is-popup': isPopup
|
|
1810
1876
|
})
|
|
1811
|
-
}, /*#__PURE__*/React.createElement(SelectedTagList, null)),
|
|
1812
|
-
footer: footer && /*#__PURE__*/React.createElement("div", {
|
|
1877
|
+
}, /*#__PURE__*/React$1.createElement(SelectedTagList, null)),
|
|
1878
|
+
footer: footer && /*#__PURE__*/React$1.createElement("div", {
|
|
1813
1879
|
className: classnames(style$1['footer'], 'select-list-footer')
|
|
1814
1880
|
}, typeof footer === 'function' ? footer({
|
|
1815
1881
|
reload: () => {
|
|
@@ -1825,7 +1891,7 @@ const SelectTree = forwardRef((_ref, ref) => {
|
|
|
1825
1891
|
components
|
|
1826
1892
|
}));
|
|
1827
1893
|
}
|
|
1828
|
-
return /*#__PURE__*/React.createElement(Flex, {
|
|
1894
|
+
return /*#__PURE__*/React$1.createElement(Flex, {
|
|
1829
1895
|
vertical: true,
|
|
1830
1896
|
className: classnames({
|
|
1831
1897
|
[style$1['is-mobile']]: isMobile
|
|
@@ -2053,12 +2119,12 @@ const CustomMenu = ({
|
|
|
2053
2119
|
domEvent: e
|
|
2054
2120
|
});
|
|
2055
2121
|
};
|
|
2056
|
-
return /*#__PURE__*/React.createElement(List, {
|
|
2122
|
+
return /*#__PURE__*/React$1.createElement(List, {
|
|
2057
2123
|
className: classnames(style['custom-menu'], className),
|
|
2058
2124
|
dataSource: items,
|
|
2059
2125
|
renderItem: item => {
|
|
2060
2126
|
const isSelected = selectedKeys == null ? void 0 : selectedKeys.includes(item.key);
|
|
2061
|
-
return /*#__PURE__*/React.createElement(List.Item, {
|
|
2127
|
+
return /*#__PURE__*/React$1.createElement(List.Item, {
|
|
2062
2128
|
className: classnames(style['custom-menu-item'], {
|
|
2063
2129
|
[style['selected']]: isSelected,
|
|
2064
2130
|
selected: isSelected
|
|
@@ -2277,12 +2343,12 @@ const CascaderInner = ({
|
|
|
2277
2343
|
// 渲染搜索内容
|
|
2278
2344
|
if (searchText && searchResults) {
|
|
2279
2345
|
const _currentIds3 = value.map(v => typeof v === 'object' ? v[valueKey] : v);
|
|
2280
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
2346
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
2281
2347
|
className: classnames(style['content'], 'select-cascader-content', {
|
|
2282
2348
|
[style['is-popup']]: isPopup,
|
|
2283
2349
|
[style['is-mobile']]: isMobile
|
|
2284
2350
|
})
|
|
2285
|
-
}, /*#__PURE__*/React.createElement(SearchInput, {
|
|
2351
|
+
}, /*#__PURE__*/React$1.createElement(SearchInput, {
|
|
2286
2352
|
className: classnames(style['search-input'], {
|
|
2287
2353
|
'is-popup': isPopup
|
|
2288
2354
|
}),
|
|
@@ -2291,23 +2357,23 @@ const CascaderInner = ({
|
|
|
2291
2357
|
onSearch: setSearchText,
|
|
2292
2358
|
simple: isPopup,
|
|
2293
2359
|
showSearchButton: !isPopup
|
|
2294
|
-
}), /*#__PURE__*/React.createElement(ScrollBox, {
|
|
2360
|
+
}), /*#__PURE__*/React$1.createElement(ScrollBox, {
|
|
2295
2361
|
className: style['scroll-plus-box']
|
|
2296
|
-
}, searchResults.length === 0 ? /*#__PURE__*/React.createElement(Empty, {
|
|
2362
|
+
}, searchResults.length === 0 ? /*#__PURE__*/React$1.createElement(Empty, {
|
|
2297
2363
|
description: "\u6682\u65E0\u6570\u636E"
|
|
2298
|
-
}) : /*#__PURE__*/React.createElement(List, {
|
|
2364
|
+
}) : /*#__PURE__*/React$1.createElement(List, {
|
|
2299
2365
|
className: style['list'],
|
|
2300
2366
|
size: "small",
|
|
2301
2367
|
dataSource: searchResults,
|
|
2302
2368
|
rowKey: "id",
|
|
2303
2369
|
renderItem: item => {
|
|
2304
2370
|
const checked = _currentIds3.includes(item.id);
|
|
2305
|
-
return /*#__PURE__*/React.createElement(List.Item, {
|
|
2371
|
+
return /*#__PURE__*/React$1.createElement(List.Item, {
|
|
2306
2372
|
className: classnames({
|
|
2307
2373
|
[style['is-selected']]: checked
|
|
2308
2374
|
}),
|
|
2309
2375
|
onClick: () => onSearchSelect(item)
|
|
2310
|
-
}, /*#__PURE__*/React.createElement("span", null, item.label), checked && /*#__PURE__*/React.createElement("span", {
|
|
2376
|
+
}, /*#__PURE__*/React$1.createElement("span", null, item.label), checked && /*#__PURE__*/React$1.createElement("span", {
|
|
2311
2377
|
style: {
|
|
2312
2378
|
marginLeft: 8,
|
|
2313
2379
|
color: '#1677ff'
|
|
@@ -2319,7 +2385,7 @@ const CascaderInner = ({
|
|
|
2319
2385
|
|
|
2320
2386
|
// 渲染级联列
|
|
2321
2387
|
const currentIds = value.map(v => typeof v === 'object' ? v[valueKey] : v);
|
|
2322
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
2388
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
2323
2389
|
className: classnames(style['content'], 'select-cascader-content', {
|
|
2324
2390
|
[style['is-popup']]: isPopup,
|
|
2325
2391
|
[style['has-search']]: !!onSearch,
|
|
@@ -2328,7 +2394,7 @@ const CascaderInner = ({
|
|
|
2328
2394
|
style: {
|
|
2329
2395
|
'--menu-item-width': numberToPx(menuItemWidth)
|
|
2330
2396
|
}
|
|
2331
|
-
}, onSearch && /*#__PURE__*/React.createElement(SearchInput, {
|
|
2397
|
+
}, onSearch && /*#__PURE__*/React$1.createElement(SearchInput, {
|
|
2332
2398
|
className: classnames(style['search-input'], {
|
|
2333
2399
|
'is-popup': isPopup
|
|
2334
2400
|
}),
|
|
@@ -2337,13 +2403,13 @@ const CascaderInner = ({
|
|
|
2337
2403
|
onSearch: setSearchText,
|
|
2338
2404
|
simple: isPopup,
|
|
2339
2405
|
showSearchButton: !isPopup
|
|
2340
|
-
}), /*#__PURE__*/React.createElement(ScrollBox, _extends({
|
|
2406
|
+
}), /*#__PURE__*/React$1.createElement(ScrollBox, _extends({
|
|
2341
2407
|
className: classnames(style['scroller'], 'select-cascader-scroller')
|
|
2342
2408
|
}, isMobile ? {} : {
|
|
2343
2409
|
options: {
|
|
2344
2410
|
autoHide: false
|
|
2345
2411
|
}
|
|
2346
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
2412
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
2347
2413
|
className: classnames(style['columns'], {
|
|
2348
2414
|
[style['is-mobile']]: isMobile
|
|
2349
2415
|
})
|
|
@@ -2351,12 +2417,12 @@ const CascaderInner = ({
|
|
|
2351
2417
|
const selectNode = mapping.get(selectedId);
|
|
2352
2418
|
const siblingNodes = treeUtils.getSiblingNode(selectedId);
|
|
2353
2419
|
const isLastLevel = !isNotLastNode(selectNode == null ? void 0 : selectNode.id) && index > 0;
|
|
2354
|
-
return /*#__PURE__*/React.createElement(ScrollBox, {
|
|
2420
|
+
return /*#__PURE__*/React$1.createElement(ScrollBox, {
|
|
2355
2421
|
key: selectedId || index,
|
|
2356
2422
|
className: classnames(style['content-item'], {
|
|
2357
2423
|
[style['last-level-area']]: isLastLevel
|
|
2358
2424
|
})
|
|
2359
|
-
}, isLastLevel ? isMobile ? /*#__PURE__*/React.createElement(CustomMenu, {
|
|
2425
|
+
}, isLastLevel ? isMobile ? /*#__PURE__*/React$1.createElement(CustomMenu, {
|
|
2360
2426
|
className: style['menu'],
|
|
2361
2427
|
selectedKeys: currentIds,
|
|
2362
2428
|
onSelect: ({
|
|
@@ -2376,11 +2442,11 @@ const CascaderInner = ({
|
|
|
2376
2442
|
} = treeUtils.computedCheckboxStatus(node.id, currentIds);
|
|
2377
2443
|
return {
|
|
2378
2444
|
key: node.id,
|
|
2379
|
-
label: /*#__PURE__*/React.createElement(Space, {
|
|
2445
|
+
label: /*#__PURE__*/React$1.createElement(Space, {
|
|
2380
2446
|
className: classnames(style['menu-item'], {
|
|
2381
2447
|
[style['single-mode']]: single
|
|
2382
2448
|
})
|
|
2383
|
-
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
2449
|
+
}, /*#__PURE__*/React$1.createElement(Checkbox, {
|
|
2384
2450
|
checked: checked,
|
|
2385
2451
|
indeterminate: indeterminate,
|
|
2386
2452
|
onClick: e => e.stopPropagation(),
|
|
@@ -2388,14 +2454,14 @@ const CascaderInner = ({
|
|
|
2388
2454
|
e.stopPropagation();
|
|
2389
2455
|
onCheckedChange(e.target.checked, node.id);
|
|
2390
2456
|
}
|
|
2391
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
2457
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
2392
2458
|
className: style['menu-label']
|
|
2393
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
2459
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
2394
2460
|
className: style['menu-label-text']
|
|
2395
2461
|
}, node.label)))
|
|
2396
2462
|
};
|
|
2397
2463
|
})
|
|
2398
|
-
}) : /*#__PURE__*/React.createElement(Space, {
|
|
2464
|
+
}) : /*#__PURE__*/React$1.createElement(Space, {
|
|
2399
2465
|
wrap: true,
|
|
2400
2466
|
style: {
|
|
2401
2467
|
padding: 12
|
|
@@ -2408,13 +2474,13 @@ const CascaderInner = ({
|
|
|
2408
2474
|
checked,
|
|
2409
2475
|
indeterminate
|
|
2410
2476
|
} = treeUtils.computedCheckboxStatus(node.id, currentIds);
|
|
2411
|
-
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
2477
|
+
return /*#__PURE__*/React$1.createElement(Checkbox, {
|
|
2412
2478
|
key: node.id,
|
|
2413
2479
|
checked: checked,
|
|
2414
2480
|
indeterminate: indeterminate,
|
|
2415
2481
|
onChange: e => onCheckedChange(e.target.checked, node.id)
|
|
2416
2482
|
}, node.label);
|
|
2417
|
-
})) : /*#__PURE__*/React.createElement(CustomMenu, {
|
|
2483
|
+
})) : /*#__PURE__*/React$1.createElement(CustomMenu, {
|
|
2418
2484
|
className: style['menu'],
|
|
2419
2485
|
selectedKeys: index === selectedIds.length - 1 ? [] : selectedIds,
|
|
2420
2486
|
onSelect: ({
|
|
@@ -2442,12 +2508,12 @@ const CascaderInner = ({
|
|
|
2442
2508
|
const childrenSelectedCount = hasChildren ? treeUtils.getAllChildren(node.id).filter(child => currentIds.includes(child.id)).length : 0;
|
|
2443
2509
|
return {
|
|
2444
2510
|
key: node.id,
|
|
2445
|
-
label: /*#__PURE__*/React.createElement(Space, {
|
|
2511
|
+
label: /*#__PURE__*/React$1.createElement(Space, {
|
|
2446
2512
|
className: classnames(style['menu-item'], {
|
|
2447
2513
|
[style['checkbox-hidden']]: onlyAllowLastLevel && hasChildren,
|
|
2448
2514
|
[style['single-mode']]: single
|
|
2449
2515
|
})
|
|
2450
|
-
}, (!onlyAllowLastLevel || !hasChildren) && /*#__PURE__*/React.createElement(Checkbox, {
|
|
2516
|
+
}, (!onlyAllowLastLevel || !hasChildren) && /*#__PURE__*/React$1.createElement(Checkbox, {
|
|
2451
2517
|
checked: checked,
|
|
2452
2518
|
indeterminate: indeterminate,
|
|
2453
2519
|
onClick: e => e.stopPropagation(),
|
|
@@ -2455,24 +2521,24 @@ const CascaderInner = ({
|
|
|
2455
2521
|
e.stopPropagation();
|
|
2456
2522
|
onCheckedChange(e.target.checked, node.id);
|
|
2457
2523
|
}
|
|
2458
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
2524
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
2459
2525
|
className: style['menu-label']
|
|
2460
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
2526
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
2461
2527
|
className: style['menu-label-text']
|
|
2462
|
-
}, node.label), hasChildren && childrenSelectedCount > 0 && /*#__PURE__*/React.createElement(Badge, {
|
|
2528
|
+
}, node.label), hasChildren && childrenSelectedCount > 0 && /*#__PURE__*/React$1.createElement(Badge, {
|
|
2463
2529
|
count: childrenSelectedCount,
|
|
2464
2530
|
size: "small"
|
|
2465
|
-
})), hasChildren ? /*#__PURE__*/React.createElement(RightOutlined, {
|
|
2531
|
+
})), hasChildren ? /*#__PURE__*/React$1.createElement(RightOutlined, {
|
|
2466
2532
|
className: style['menu-item-icon']
|
|
2467
|
-
}) : /*#__PURE__*/React.createElement("span", {
|
|
2533
|
+
}) : /*#__PURE__*/React$1.createElement("span", {
|
|
2468
2534
|
className: style['menu-item-placeholder']
|
|
2469
2535
|
}))
|
|
2470
2536
|
};
|
|
2471
2537
|
})
|
|
2472
2538
|
}));
|
|
2473
|
-
}), loading && /*#__PURE__*/React.createElement("div", {
|
|
2539
|
+
}), loading && /*#__PURE__*/React$1.createElement("div", {
|
|
2474
2540
|
className: style['loading']
|
|
2475
|
-
}, /*#__PURE__*/React.createElement(Spin, {
|
|
2541
|
+
}, /*#__PURE__*/React$1.createElement(Spin, {
|
|
2476
2542
|
size: "small"
|
|
2477
2543
|
})))));
|
|
2478
2544
|
};
|
|
@@ -2586,7 +2652,7 @@ const SelectCascader = _ref => {
|
|
|
2586
2652
|
};
|
|
2587
2653
|
}).filter(Boolean);
|
|
2588
2654
|
}, [currentValue, options, valueKey, labelKey]);
|
|
2589
|
-
return /*#__PURE__*/React.createElement(SelectInput, _extends({}, props, {
|
|
2655
|
+
return /*#__PURE__*/React$1.createElement(SelectInput, _extends({}, props, {
|
|
2590
2656
|
value: selectInputValue,
|
|
2591
2657
|
onChange: setValue,
|
|
2592
2658
|
single: single,
|
|
@@ -2634,7 +2700,7 @@ const SelectCascader = _ref => {
|
|
|
2634
2700
|
[labelKey]: String(item)
|
|
2635
2701
|
};
|
|
2636
2702
|
}).filter(Boolean);
|
|
2637
|
-
return contextProps.open ? /*#__PURE__*/React.createElement(CascaderInner, {
|
|
2703
|
+
return contextProps.open ? /*#__PURE__*/React$1.createElement(CascaderInner, {
|
|
2638
2704
|
options: options,
|
|
2639
2705
|
value: currentDisplayValue,
|
|
2640
2706
|
setValue: contextSetValue,
|