dtable-ui-component 7.0.13 → 7.0.15
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/lib/ActionSheet/index.js +58 -49
- package/lib/ActivityIndicator/index.js +17 -16
- package/lib/AsyncUserSelect/index.js +20 -46
- package/lib/AsyncUserSelect/user-item.js +6 -5
- package/lib/AutoNumberFormatter/index.js +4 -3
- package/lib/Badge/index.js +27 -29
- package/lib/ButtonFormatter/index.js +8 -6
- package/lib/CTimeFormatter/index.js +4 -3
- package/lib/CheckboxEditor/index.js +16 -13
- package/lib/CheckboxEditor/mb-editor.js +20 -9
- package/lib/CheckboxEditor/pc-editor.js +24 -12
- package/lib/CheckboxFormatter/index.js +5 -4
- package/lib/CollaboratorEditor/index.js +17 -14
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
- package/lib/CollaboratorEditor/pc-editor/index.js +35 -26
- package/lib/CollaboratorFormatter/index.js +10 -8
- package/lib/CollaboratorItem/index.js +5 -4
- package/lib/CollapsibleSettingLayout/index.js +8 -10
- package/lib/Comment/body/comment.js +19 -11
- package/lib/Comment/body/index.js +8 -8
- package/lib/Comment/footer/btns/index.js +7 -4
- package/lib/Comment/footer/index.js +21 -10
- package/lib/Comment/footer/input/index.js +55 -34
- package/lib/Comment/footer/input/participant/index.js +6 -5
- package/lib/Comment/footer/participants/index.js +5 -4
- package/lib/Comment/footer/participants/participant/index.js +3 -1
- package/lib/Comment/footer/participants/participant-select/index.js +26 -10
- package/lib/Comment/index.js +57 -39
- package/lib/Comment/utils/utilities.js +22 -16
- package/lib/CreatorFormatter/index.js +8 -6
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +26 -28
- package/lib/DTableColorPicker/index.js +53 -67
- package/lib/DTableColorPicker/utils.js +7 -5
- package/lib/DTableColumnIcon/index.js +7 -6
- package/lib/DTableCommonAddTool/index.js +10 -8
- package/lib/DTableCustomFooter/index.js +3 -1
- package/lib/DTableCustomizeSearchInput/index.js +41 -26
- package/lib/DTableCustomizeSelect/index.js +24 -19
- package/lib/DTableDropdownItem/index.js +28 -24
- package/lib/DTableDropdownMenu/index.js +17 -14
- package/lib/DTableEmptyTip/index.js +5 -4
- package/lib/DTableFiltersPopover/index.js +42 -27
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
- package/lib/DTableFiltersPopover/utils/index.js +114 -64
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
- package/lib/DTableFiltersPopover/widgets/filter-group.js +57 -36
- package/lib/DTableFiltersPopover/widgets/filter-item.js +165 -106
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +162 -137
- package/lib/DTableFiltersPopover/widgets/rate-item.js +25 -20
- package/lib/DTableIcon/index.js +11 -10
- package/lib/DTableIcon/svg-icon.js +11 -9
- package/lib/DTableModalHeader/index.js +7 -7
- package/lib/DTablePopover/index.js +16 -12
- package/lib/DTableRadio/index.js +9 -10
- package/lib/DTableRadioGroup/index.js +20 -11
- package/lib/DTableSearchInput/index.js +29 -19
- package/lib/DTableSelect/dtable-select-label.js +6 -7
- package/lib/DTableSelect/index.js +26 -25
- package/lib/DTableSelect/select-dropdown-indicator/index.js +3 -1
- package/lib/DTableSelect/utils.js +83 -47
- package/lib/DTableSubDropdownMenu/index.js +16 -12
- package/lib/DTableSubDropdownToggle/index.js +16 -17
- package/lib/DTableSwitch/index.js +11 -12
- package/lib/DTableToolTip/index.js +12 -11
- package/lib/DateEditor/index.js +28 -30
- package/lib/DateEditor/mb-editor/index.js +31 -18
- package/lib/DateEditor/pc-editor.js +46 -27
- package/lib/DateFormatter/index.js +5 -4
- package/lib/DatePicker/index.js +15 -9
- package/lib/DatePicker/utils.js +7 -5
- package/lib/DeleteTip/index.js +6 -5
- package/lib/DepartmentMultipleSelectEditor/index.js +26 -28
- package/lib/DepartmentSelectFilter/index.js +13 -8
- package/lib/DepartmentSingleSelectEditor/index.js +16 -13
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +49 -50
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +64 -42
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
- package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
- package/lib/DigitalSignEditor/index.js +16 -13
- package/lib/DigitalSignEditor/mb-editor/index.js +24 -16
- package/lib/DigitalSignEditor/pc-editor/index.js +31 -23
- package/lib/DigitalSignEditor/service.js +5 -3
- package/lib/DigitalSignEditor/signature-board/index.js +10 -7
- package/lib/DigitalSignEditor/utils.js +4 -2
- package/lib/DigitalSignFormatter/index.js +15 -12
- package/lib/DigitalSignFormatter/utils.js +6 -5
- package/lib/Drawer/index.js +3 -2
- package/lib/DurationEditor/index.js +31 -21
- package/lib/DurationFormatter/index.js +5 -4
- package/lib/EditEditorButton/index.js +3 -1
- package/lib/EmailFormatter/index.js +4 -3
- package/lib/FieldDisplaySetting/field-item.js +13 -13
- package/lib/FieldDisplaySetting/index.js +20 -20
- package/lib/FileEditor/files-previewer/index.js +16 -13
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +20 -12
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +24 -17
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
- package/lib/FileEditor/index.js +16 -13
- package/lib/FileEditor/mb-editor/index.js +20 -28
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +4 -2
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +31 -17
- package/lib/FileEditor/pc-editor/index.js +30 -22
- package/lib/FileFormatter/index.js +20 -27
- package/lib/FileItemFormatter/index.js +10 -7
- package/lib/FileUploader/index.js +46 -29
- package/lib/FormulaFormatter/index.js +44 -24
- package/lib/GeolocationEditor/index.js +32 -27
- package/lib/GeolocationEditor/map-editor-utils.js +23 -21
- package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/index.js +28 -22
- package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +77 -47
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
- package/lib/GeolocationEditor/pc-editor/country-editor.js +25 -12
- package/lib/GeolocationEditor/pc-editor/index.js +41 -27
- package/lib/GeolocationEditor/pc-editor/location-editor.js +33 -28
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +67 -43
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +69 -42
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +86 -42
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +85 -39
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +26 -20
- package/lib/GeolocationEditor/pc-editor/province-editor.js +15 -8
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +8 -7
- package/lib/GeolocationFormatter/index.js +5 -4
- package/lib/HtmlLongTextFormatter/index.js +13 -5
- package/lib/Icon/index.js +13 -15
- package/lib/Icon/load-sprite.js +13 -2
- package/lib/IconButton/index.js +12 -13
- package/lib/ImageEditor/images-previewer/image-preview/index.js +22 -13
- package/lib/ImageEditor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/index.js +16 -13
- package/lib/ImageEditor/mb-editor/index.js +20 -28
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +5 -3
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +26 -12
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +10 -4
- package/lib/ImageEditor/pc-editor/index.js +16 -11
- package/lib/ImageFormatter/images-lazy-load.js +11 -19
- package/lib/ImageFormatter/index.js +14 -12
- package/lib/ImagePreviewerLightbox/index.js +15 -19
- package/lib/ImageThumbnail/index.js +15 -12
- package/lib/InputItem/custom-input.js +55 -35
- package/lib/InputItem/custom-keyboard.js +42 -42
- package/lib/InputItem/index.js +82 -63
- package/lib/InputItem/input.js +9 -11
- package/lib/LastModifierFormatter/index.js +8 -6
- package/lib/LinkEditor/index.js +53 -33
- package/lib/LinkEditor/link-editor-option.js +4 -3
- package/lib/LinkEditor/mb-popover/index.js +22 -9
- package/lib/LinkEditor/pc-popover/index.js +13 -7
- package/lib/LinkFormatter/index.js +37 -21
- package/lib/List/index.js +17 -19
- package/lib/List/list-item.js +59 -55
- package/lib/LongTextFormatter/index.js +5 -4
- package/lib/MBEditorHeader/index.js +9 -8
- package/lib/MTimeFormatter/index.js +4 -3
- package/lib/MobileFullScreenPage/body/index.js +6 -4
- package/lib/MobileFullScreenPage/header/index.js +10 -8
- package/lib/MobileFullScreenPage/index.js +12 -14
- package/lib/MobileModal/index.js +7 -8
- package/lib/MobileOperationSheet/index.js +8 -7
- package/lib/MobileSelector/empty/index.js +3 -1
- package/lib/MobileSelector/index.js +7 -5
- package/lib/MobileSelector/option/index.js +5 -3
- package/lib/MobileSelector/options/index.css +0 -4
- package/lib/MobileSelector/options/index.js +3 -1
- package/lib/MobileSelector/search/index.js +5 -3
- package/lib/MobileUpload/index.js +5 -4
- package/lib/Modal/alert.js +2 -2
- package/lib/Modal/modal.js +28 -30
- package/lib/Modal/prompt.js +14 -14
- package/lib/MultipleSelectEditor/index.js +7 -7
- package/lib/MultipleSelectFormatter/index.js +9 -7
- package/lib/NotificationPopover/index.js +5 -4
- package/lib/NumberEditor/index.js +21 -12
- package/lib/NumberFormatter/index.js +5 -4
- package/lib/PhoneNumberLink/index.js +5 -3
- package/lib/Picker/AbstractPicker.js +35 -33
- package/lib/Popover/index.js +9 -11
- package/lib/Popover/item.js +22 -24
- package/lib/Progress/index.js +18 -17
- package/lib/Radio/Radio.js +17 -15
- package/lib/Radio/RadioItem.js +23 -19
- package/lib/RateFormatter/index.js +15 -15
- package/lib/RoleStatusEditor/index.js +18 -19
- package/lib/RowExpand/index.js +7 -6
- package/lib/RowExpandDialog/body/index.js +57 -40
- package/lib/RowExpandDialog/column-content/index.js +10 -6
- package/lib/RowExpandDialog/header/index.js +12 -9
- package/lib/RowExpandDialog/index.js +59 -63
- package/lib/RowExpandEditor/add-btn/index.js +7 -6
- package/lib/RowExpandEditor/checkbox-editor/index.js +7 -6
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
- package/lib/RowExpandEditor/collaborator-editor/index.js +7 -6
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
- package/lib/RowExpandEditor/date-editor/index.js +7 -6
- package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
- package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
- package/lib/RowExpandEditor/department-editor/index.js +7 -6
- package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
- package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
- package/lib/RowExpandEditor/digital-sign-editor/index.js +7 -6
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +38 -24
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +39 -25
- package/lib/RowExpandEditor/duration-editor/index.js +7 -6
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
- package/lib/RowExpandEditor/email-editor/index.js +7 -6
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +20 -10
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +25 -14
- package/lib/RowExpandEditor/file-editor/index.js +7 -6
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/geolocation-editor/index.js +7 -6
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
- package/lib/RowExpandEditor/image-editor/index.js +7 -6
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +26 -16
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +24 -14
- package/lib/RowExpandEditor/index.js +16 -11
- package/lib/RowExpandEditor/long-text-editor/index.js +7 -6
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/multiple-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +20 -12
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +38 -27
- package/lib/RowExpandEditor/number-editor/index.js +7 -6
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
- package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
- package/lib/RowExpandEditor/rate-editor/index.js +7 -6
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +26 -13
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +41 -25
- package/lib/RowExpandEditor/single-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +32 -21
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +37 -25
- package/lib/RowExpandEditor/text-editor/index.js +7 -6
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
- package/lib/RowExpandEditor/url-editor/index.js +7 -6
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +15 -7
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +20 -11
- package/lib/RowExpandFormatter/department-formatter/index.js +6 -3
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
- package/lib/RowExpandFormatter/email-formatter/index.js +8 -5
- package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +14 -12
- package/lib/RowExpandFormatter/formula-formatter/index.js +51 -30
- package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +10 -9
- package/lib/RowExpandFormatter/index.js +52 -34
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +15 -9
- package/lib/RowExpandFormatter/link-formatter/index.js +25 -17
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
- package/lib/RowExpandFormatter/rate-formatter/index.js +14 -13
- package/lib/RowExpandFormatter/text/index.js +5 -4
- package/lib/RowExpandFormatter/url-formatter/index.js +9 -6
- package/lib/RowExpandView/body/index.js +43 -32
- package/lib/RowExpandView/column-content/index.js +7 -3
- package/lib/RowExpandView/index.js +52 -53
- package/lib/SelectItem/index.js +7 -5
- package/lib/SelectOptionGroup/index.js +40 -30
- package/lib/SelectedDepartments/index.js +12 -10
- package/lib/SimpleLongTextFormatter/index.js +18 -12
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
- package/lib/SingleSelectEditor/index.js +7 -7
- package/lib/SingleSelectFormatter/index.js +9 -8
- package/lib/TabBar/Tab.js +26 -24
- package/lib/TabBar/index.js +28 -24
- package/lib/Tabs/index.js +13 -10
- package/lib/TextEditor/index.js +23 -14
- package/lib/TextFormatter/index.js +4 -3
- package/lib/TextareaItem/index.js +53 -48
- package/lib/Toast/index.js +9 -8
- package/lib/UrlFormatter/index.js +4 -3
- package/lib/common/editor-base.js +12 -7
- package/lib/formatterConfig/index.js +3 -3
- package/lib/hooks/common-hooks.js +4 -2
- package/lib/select-editor/index.js +16 -13
- package/lib/select-editor/mb-editor/index.js +28 -17
- package/lib/select-editor/pc-editor/index.js +47 -32
- package/lib/toaster/alert.js +8 -7
- package/lib/toaster/toast.js +4 -3
- package/lib/toaster/toastManager.js +13 -13
- package/lib/toaster/toaster.js +12 -9
- package/lib/utils/cell.js +11 -8
- package/lib/utils/class.js +3 -3
- package/lib/utils/column-utils.js +14 -8
- package/lib/utils/departments.js +6 -5
- package/lib/utils/getLocale.js +11 -5
- package/lib/utils/object-utils.js +5 -4
- package/lib/utils/url.js +29 -22
- package/lib/utils/utils.js +6 -2
- package/package.json +2 -2
package/lib/TabBar/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.Item = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var React = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _getDataAttr = _interopRequireDefault(require("../utils/getDataAttr"));
|
|
12
11
|
var _Tabs = _interopRequireDefault(require("../Tabs"));
|
|
@@ -15,9 +14,10 @@ require("./index.css");
|
|
|
15
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
15
|
class Item extends React.Component {
|
|
17
16
|
render() {
|
|
18
|
-
const
|
|
19
|
-
prefixCls
|
|
20
|
-
style
|
|
17
|
+
const {
|
|
18
|
+
prefixCls,
|
|
19
|
+
style
|
|
20
|
+
} = this.props;
|
|
21
21
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
22
|
className: prefixCls,
|
|
23
23
|
style: style,
|
|
@@ -37,23 +37,26 @@ class AntTabBar extends React.Component {
|
|
|
37
37
|
const tabs = [];
|
|
38
38
|
React.Children.forEach(this.props.children, c => {
|
|
39
39
|
if (c) {
|
|
40
|
-
tabs.push(
|
|
40
|
+
tabs.push({
|
|
41
|
+
...c.props
|
|
42
|
+
});
|
|
41
43
|
}
|
|
42
44
|
});
|
|
43
45
|
return tabs;
|
|
44
46
|
};
|
|
45
47
|
this.renderTabBar = () => {
|
|
46
|
-
const
|
|
47
|
-
barTintColor
|
|
48
|
-
prefixCls
|
|
49
|
-
tintColor
|
|
50
|
-
unselectedTintColor
|
|
51
|
-
hidden
|
|
52
|
-
tabBarPosition
|
|
48
|
+
const {
|
|
49
|
+
barTintColor,
|
|
50
|
+
prefixCls,
|
|
51
|
+
tintColor,
|
|
52
|
+
unselectedTintColor,
|
|
53
|
+
hidden,
|
|
54
|
+
tabBarPosition
|
|
55
|
+
} = this.props;
|
|
53
56
|
const tabsData = this.getTabs();
|
|
54
57
|
const content = Array.isArray(tabsData) ? tabsData.map((cProps, index) => {
|
|
55
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
|
|
56
|
-
prefixCls:
|
|
59
|
+
prefixCls: `${this.props.prefixCls}-tab`,
|
|
57
60
|
badge: cProps.badge,
|
|
58
61
|
dot: cProps.dot,
|
|
59
62
|
selected: cProps.selected,
|
|
@@ -66,9 +69,9 @@ class AntTabBar extends React.Component {
|
|
|
66
69
|
onClick: () => cProps.onPress && cProps.onPress()
|
|
67
70
|
}, index);
|
|
68
71
|
}) : null;
|
|
69
|
-
let cls =
|
|
72
|
+
let cls = `${prefixCls}-bar`;
|
|
70
73
|
if (hidden) {
|
|
71
|
-
cls +=
|
|
74
|
+
cls += ` ${prefixCls}-bar-hidden-${tabBarPosition}`;
|
|
72
75
|
}
|
|
73
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
74
77
|
className: cls,
|
|
@@ -80,14 +83,15 @@ class AntTabBar extends React.Component {
|
|
|
80
83
|
};
|
|
81
84
|
}
|
|
82
85
|
render() {
|
|
83
|
-
const
|
|
84
|
-
prefixCls
|
|
85
|
-
children
|
|
86
|
-
animated
|
|
87
|
-
swipeable
|
|
88
|
-
noRenderContent
|
|
89
|
-
prerenderingSiblingsNumber
|
|
90
|
-
tabBarPosition
|
|
86
|
+
const {
|
|
87
|
+
prefixCls,
|
|
88
|
+
children,
|
|
89
|
+
animated,
|
|
90
|
+
swipeable,
|
|
91
|
+
noRenderContent,
|
|
92
|
+
prerenderingSiblingsNumber,
|
|
93
|
+
tabBarPosition
|
|
94
|
+
} = this.props;
|
|
91
95
|
const tabs = this.getTabs();
|
|
92
96
|
let activeIndex = 0;
|
|
93
97
|
if (Array.isArray(tabs)) {
|
package/lib/Tabs/index.js
CHANGED
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = exports.DefaultTabBar = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
9
|
var _rmcTabs = require("rmc-tabs");
|
|
12
10
|
require("./index.css");
|
|
13
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
12
|
class DefaultTabBar extends _rmcTabs.DefaultTabBar {}
|
|
15
13
|
exports.DefaultTabBar = DefaultTabBar;
|
|
16
|
-
DefaultTabBar.defaultProps =
|
|
14
|
+
DefaultTabBar.defaultProps = {
|
|
15
|
+
..._rmcTabs.DefaultTabBar.defaultProps,
|
|
17
16
|
prefixCls: 'am-tabs-default-bar'
|
|
18
|
-
}
|
|
17
|
+
};
|
|
19
18
|
class Tabs extends React.PureComponent {
|
|
20
19
|
constructor() {
|
|
21
20
|
super(...arguments);
|
|
22
21
|
this.renderTabBar = props => {
|
|
23
|
-
const
|
|
24
|
-
|
|
22
|
+
const {
|
|
23
|
+
renderTab
|
|
24
|
+
} = this.props;
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(DefaultTabBar, {
|
|
26
|
+
...props,
|
|
25
27
|
renderTab: renderTab
|
|
26
|
-
})
|
|
28
|
+
});
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
render() {
|
|
30
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcTabs.Tabs,
|
|
31
|
-
renderTabBar: this.renderTabBar
|
|
32
|
-
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcTabs.Tabs, {
|
|
33
|
+
renderTabBar: this.renderTabBar,
|
|
34
|
+
...this.props
|
|
35
|
+
});
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
exports.default = Tabs;
|
package/lib/TextEditor/index.js
CHANGED
|
@@ -16,7 +16,9 @@ class TextEditor extends _react.Component {
|
|
|
16
16
|
constructor(props) {
|
|
17
17
|
super(props);
|
|
18
18
|
this.getValue = () => {
|
|
19
|
-
const
|
|
19
|
+
const {
|
|
20
|
+
value
|
|
21
|
+
} = this.state;
|
|
20
22
|
const text = (0, _utils.getTrimmedString)(value) || null;
|
|
21
23
|
return text;
|
|
22
24
|
};
|
|
@@ -57,10 +59,11 @@ class TextEditor extends _react.Component {
|
|
|
57
59
|
});
|
|
58
60
|
};
|
|
59
61
|
this.onInputKeyDown = e => {
|
|
60
|
-
const
|
|
61
|
-
selectionStart
|
|
62
|
-
selectionEnd
|
|
63
|
-
value
|
|
62
|
+
const {
|
|
63
|
+
selectionStart,
|
|
64
|
+
selectionEnd,
|
|
65
|
+
value
|
|
66
|
+
} = e.currentTarget;
|
|
64
67
|
if (e.keyCode === _constants.KeyCodes.Enter) {
|
|
65
68
|
e.preventDefault();
|
|
66
69
|
this.onBlur();
|
|
@@ -104,10 +107,13 @@ class TextEditor extends _react.Component {
|
|
|
104
107
|
};
|
|
105
108
|
}
|
|
106
109
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
107
|
-
const
|
|
108
|
-
oldValue
|
|
109
|
-
column
|
|
110
|
-
|
|
110
|
+
const {
|
|
111
|
+
value: oldValue,
|
|
112
|
+
column
|
|
113
|
+
} = this.props;
|
|
114
|
+
const {
|
|
115
|
+
value: newValue
|
|
116
|
+
} = nextProps;
|
|
111
117
|
if ((0, _cellComparer.isCellValueChanged)(oldValue, newValue, column.type)) {
|
|
112
118
|
this.setState({
|
|
113
119
|
value: newValue || ''
|
|
@@ -115,11 +121,14 @@ class TextEditor extends _react.Component {
|
|
|
115
121
|
}
|
|
116
122
|
}
|
|
117
123
|
render() {
|
|
118
|
-
const
|
|
119
|
-
column
|
|
120
|
-
className
|
|
121
|
-
placeholder
|
|
122
|
-
|
|
124
|
+
const {
|
|
125
|
+
column,
|
|
126
|
+
className,
|
|
127
|
+
placeholder
|
|
128
|
+
} = this.props;
|
|
129
|
+
const {
|
|
130
|
+
value
|
|
131
|
+
} = this.state;
|
|
123
132
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
124
133
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
125
134
|
type: "text",
|
|
@@ -23,9 +23,10 @@ class TextFormatter extends _react.default.Component {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
const
|
|
27
|
-
containerClassName
|
|
28
|
-
value
|
|
26
|
+
const {
|
|
27
|
+
containerClassName,
|
|
28
|
+
value
|
|
29
|
+
} = this.props;
|
|
29
30
|
const classname = (0, _classnames.default)('dtable-ui cell-formatter-container text-formatter', containerClassName);
|
|
30
31
|
const formattedValue = this.getFormattedValue(value);
|
|
31
32
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
10
|
var React = _interopRequireWildcard(require("react"));
|
|
13
11
|
var _rmcFeedback = _interopRequireDefault(require("rmc-feedback"));
|
|
14
12
|
var _exenv = require("../utils/exenv");
|
|
15
13
|
require("./index.css");
|
|
16
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["prefixCls", "prefixListCls", "editable", "style", "clear", "children", "error", "className", "count", "labelNumber", "title", "onErrorClick", "autoHeight", "defaultValue"];
|
|
18
15
|
/* tslint:disable:jsx-no-multiline-js */
|
|
16
|
+
|
|
19
17
|
function noop() {}
|
|
20
18
|
function fixControlledValue(value) {
|
|
21
19
|
if (typeof value === 'undefined' || value === null) {
|
|
@@ -37,7 +35,7 @@ class TextareaItem extends React.Component {
|
|
|
37
35
|
this.reAlignHeight = () => {
|
|
38
36
|
const textareaDom = this.textareaRef;
|
|
39
37
|
textareaDom.style.height = ''; // 字数减少时能自动减小高度
|
|
40
|
-
textareaDom.style.height =
|
|
38
|
+
textareaDom.style.height = `${textareaDom.scrollHeight}px`;
|
|
41
39
|
};
|
|
42
40
|
this.onChange = e => {
|
|
43
41
|
const value = e.target.value;
|
|
@@ -50,7 +48,9 @@ class TextareaItem extends React.Component {
|
|
|
50
48
|
value
|
|
51
49
|
});
|
|
52
50
|
}
|
|
53
|
-
const
|
|
51
|
+
const {
|
|
52
|
+
onChange
|
|
53
|
+
} = this.props;
|
|
54
54
|
if (onChange) {
|
|
55
55
|
onChange(value);
|
|
56
56
|
}
|
|
@@ -133,41 +133,45 @@ class TextareaItem extends React.Component {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
render() {
|
|
136
|
-
const
|
|
137
|
-
prefixCls
|
|
138
|
-
prefixListCls
|
|
139
|
-
editable
|
|
140
|
-
style
|
|
141
|
-
clear
|
|
142
|
-
children
|
|
143
|
-
error
|
|
144
|
-
className
|
|
145
|
-
count
|
|
146
|
-
labelNumber
|
|
147
|
-
title
|
|
148
|
-
onErrorClick
|
|
149
|
-
autoHeight
|
|
150
|
-
defaultValue
|
|
151
|
-
otherProps
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
136
|
+
const {
|
|
137
|
+
prefixCls,
|
|
138
|
+
prefixListCls,
|
|
139
|
+
editable,
|
|
140
|
+
style,
|
|
141
|
+
clear,
|
|
142
|
+
children,
|
|
143
|
+
error,
|
|
144
|
+
className,
|
|
145
|
+
count,
|
|
146
|
+
labelNumber,
|
|
147
|
+
title,
|
|
148
|
+
onErrorClick,
|
|
149
|
+
autoHeight,
|
|
150
|
+
defaultValue,
|
|
151
|
+
...otherProps
|
|
152
|
+
} = this.props;
|
|
153
|
+
const {
|
|
154
|
+
disabled
|
|
155
|
+
} = otherProps;
|
|
156
|
+
const {
|
|
157
|
+
value,
|
|
158
|
+
focus
|
|
159
|
+
} = this.state;
|
|
156
160
|
const hasCount = count > 0 && this.props.rows > 1;
|
|
157
|
-
const wrapCls = (0, _classnames.default)(className,
|
|
158
|
-
[
|
|
159
|
-
[
|
|
160
|
-
[
|
|
161
|
-
[
|
|
162
|
-
[
|
|
161
|
+
const wrapCls = (0, _classnames.default)(className, `${prefixListCls}-item`, `${prefixCls}-item`, {
|
|
162
|
+
[`${prefixCls}-disabled`]: disabled,
|
|
163
|
+
[`${prefixCls}-item-single-line`]: this.props.rows === 1 && !autoHeight,
|
|
164
|
+
[`${prefixCls}-error`]: error,
|
|
165
|
+
[`${prefixCls}-focus`]: focus,
|
|
166
|
+
[`${prefixCls}-has-count`]: hasCount
|
|
163
167
|
});
|
|
164
|
-
const labelCls = (0, _classnames.default)(
|
|
165
|
-
[
|
|
166
|
-
[
|
|
167
|
-
[
|
|
168
|
-
[
|
|
169
|
-
[
|
|
170
|
-
[
|
|
168
|
+
const labelCls = (0, _classnames.default)(`${prefixCls}-label`, {
|
|
169
|
+
[`${prefixCls}-label-2`]: labelNumber === 2,
|
|
170
|
+
[`${prefixCls}-label-3`]: labelNumber === 3,
|
|
171
|
+
[`${prefixCls}-label-4`]: labelNumber === 4,
|
|
172
|
+
[`${prefixCls}-label-5`]: labelNumber === 5,
|
|
173
|
+
[`${prefixCls}-label-6`]: labelNumber === 6,
|
|
174
|
+
[`${prefixCls}-label-7`]: labelNumber === 7
|
|
171
175
|
});
|
|
172
176
|
const characterLength = countSymbols(value);
|
|
173
177
|
const lengthCtrlProps = {};
|
|
@@ -187,28 +191,29 @@ class TextareaItem extends React.Component {
|
|
|
187
191
|
className: labelCls,
|
|
188
192
|
children: title
|
|
189
193
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
190
|
-
className:
|
|
191
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea",
|
|
192
|
-
ref: el => this.textareaRef = el
|
|
193
|
-
|
|
194
|
+
className: `${prefixCls}-control`,
|
|
195
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
|
|
196
|
+
ref: el => this.textareaRef = el,
|
|
197
|
+
...lengthCtrlProps,
|
|
198
|
+
...otherProps,
|
|
194
199
|
value: value,
|
|
195
200
|
onChange: this.onChange,
|
|
196
201
|
onBlur: this.onBlur,
|
|
197
202
|
onFocus: this.onFocus,
|
|
198
203
|
readOnly: !editable,
|
|
199
204
|
style: style
|
|
200
|
-
})
|
|
205
|
+
})
|
|
201
206
|
}), clear && editable && value && characterLength > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
|
|
202
|
-
activeClassName:
|
|
207
|
+
activeClassName: `${prefixCls}-clear-active`,
|
|
203
208
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
204
|
-
className:
|
|
209
|
+
className: `${prefixCls}-clear`,
|
|
205
210
|
onClick: this.clearInput
|
|
206
211
|
})
|
|
207
212
|
}), error && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
208
|
-
className:
|
|
213
|
+
className: `${prefixCls}-error-extra`,
|
|
209
214
|
onClick: this.onErrorClick
|
|
210
215
|
}), hasCount && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
211
|
-
className:
|
|
216
|
+
className: `${prefixCls}-count`,
|
|
212
217
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
213
218
|
children: value ? characterLength : 0
|
|
214
219
|
}), "/", count]
|
package/lib/Toast/index.js
CHANGED
|
@@ -27,8 +27,8 @@ function getMessageInstance(mask, callback) {
|
|
|
27
27
|
// clear rmc-notification default style
|
|
28
28
|
transitionName: 'am-fade',
|
|
29
29
|
className: (0, _classnames.default)({
|
|
30
|
-
[
|
|
31
|
-
[
|
|
30
|
+
[`${prefixCls}-mask`]: mask,
|
|
31
|
+
[`${prefixCls}-nomask`]: !mask
|
|
32
32
|
})
|
|
33
33
|
}, notification => callback && callback(notification));
|
|
34
34
|
}
|
|
@@ -63,18 +63,18 @@ function notice(content, type) {
|
|
|
63
63
|
duration,
|
|
64
64
|
style: {},
|
|
65
65
|
content: iconType ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
66
|
-
className:
|
|
66
|
+
className: `${prefixCls}-text ${prefixCls}-text-icon`,
|
|
67
67
|
role: "alert",
|
|
68
68
|
"aria-live": "assertive",
|
|
69
69
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
70
70
|
type: iconType,
|
|
71
71
|
size: "lg"
|
|
72
72
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
73
|
-
className:
|
|
73
|
+
className: `${prefixCls}-text-info`,
|
|
74
74
|
children: content
|
|
75
75
|
})]
|
|
76
76
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
77
|
-
className:
|
|
77
|
+
className: `${prefixCls}-text`,
|
|
78
78
|
role: "alert",
|
|
79
79
|
"aria-live": "assertive",
|
|
80
80
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -124,9 +124,10 @@ const Toast = {
|
|
|
124
124
|
},
|
|
125
125
|
config() {
|
|
126
126
|
let conf = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
127
|
-
const
|
|
128
|
-
duration =
|
|
129
|
-
mask
|
|
127
|
+
const {
|
|
128
|
+
duration = SHORT,
|
|
129
|
+
mask
|
|
130
|
+
} = conf;
|
|
130
131
|
config.duration = duration;
|
|
131
132
|
if (mask === false) {
|
|
132
133
|
config.mask = false;
|
|
@@ -11,9 +11,10 @@ require("./index.css");
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
class UrlFormatter extends _react.default.Component {
|
|
13
13
|
render() {
|
|
14
|
-
const
|
|
15
|
-
containerClassName
|
|
16
|
-
value
|
|
14
|
+
const {
|
|
15
|
+
containerClassName,
|
|
16
|
+
value
|
|
17
|
+
} = this.props;
|
|
17
18
|
let classname = (0, _classnames.default)('dtable-ui cell-formatter-container url-formatter', containerClassName);
|
|
18
19
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
19
20
|
title: value,
|
|
@@ -15,17 +15,22 @@ class EditorBase extends _react.default.Component {
|
|
|
15
15
|
}
|
|
16
16
|
getValue() {
|
|
17
17
|
const updated = {};
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
const {
|
|
19
|
+
column
|
|
20
|
+
} = this.props;
|
|
21
|
+
const {
|
|
22
|
+
type,
|
|
23
|
+
key,
|
|
24
|
+
data
|
|
25
|
+
} = column;
|
|
22
26
|
let value = this.getInputNode().value;
|
|
23
27
|
if (type === _dtableUtils.CellType.TEXT) {
|
|
24
28
|
value = value ? value.trim() : '';
|
|
25
29
|
} else if (type === _dtableUtils.CellType.NUMBER) {
|
|
26
|
-
let
|
|
27
|
-
precision
|
|
28
|
-
enable_precision
|
|
30
|
+
let {
|
|
31
|
+
precision,
|
|
32
|
+
enable_precision
|
|
33
|
+
} = data || {};
|
|
29
34
|
if (enable_precision && (0, _dtableUtils.isNumber)(value)) {
|
|
30
35
|
value = Number(value.toFixed(precision));
|
|
31
36
|
}
|
|
@@ -5,15 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _dtableUtils = require("dtable-utils");
|
|
11
10
|
var _baseFormatterConfig = _interopRequireDefault(require("./base-formatter-config"));
|
|
12
11
|
var _LinkFormatter = _interopRequireDefault(require("../LinkFormatter"));
|
|
13
12
|
var _FormulaFormatter = _interopRequireDefault(require("../FormulaFormatter"));
|
|
14
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const FormatterConfig =
|
|
14
|
+
const FormatterConfig = {
|
|
15
|
+
..._baseFormatterConfig.default,
|
|
16
16
|
[_dtableUtils.CellType.FORMULA]: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormulaFormatter.default, {}),
|
|
17
17
|
[_dtableUtils.CellType.LINK]: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkFormatter.default, {})
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
var _default = exports.default = FormatterConfig;
|
|
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useClickOutside = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
const useClickOutside = (_ref, deps) => {
|
|
9
|
-
let
|
|
10
|
-
|
|
9
|
+
let {
|
|
10
|
+
currDOM,
|
|
11
|
+
onClickOutside
|
|
12
|
+
} = _ref;
|
|
11
13
|
(0, _react.useEffect)(() => {
|
|
12
14
|
const onMousedown = event => {
|
|
13
15
|
if (currDOM && event && currDOM.contains(event.target)) {
|
|
@@ -6,34 +6,37 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
13
11
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
14
12
|
var _mbEditor = _interopRequireDefault(require("./mb-editor"));
|
|
15
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const _excluded = ["isMobile"];
|
|
17
14
|
const SelectEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
let {
|
|
16
|
+
isMobile,
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
19
|
+
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
20
|
+
...props,
|
|
21
21
|
ref: ref
|
|
22
|
-
})
|
|
23
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
22
|
+
});
|
|
23
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
24
|
+
...props,
|
|
24
25
|
ref: ref
|
|
25
|
-
})
|
|
26
|
+
});
|
|
26
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
27
28
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
28
29
|
query: "(min-width: 768px)",
|
|
29
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
30
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
31
|
+
...props,
|
|
30
32
|
ref: ref
|
|
31
|
-
})
|
|
33
|
+
})
|
|
32
34
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
33
35
|
query: "(max-width: 768px)",
|
|
34
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
36
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
37
|
+
...props,
|
|
35
38
|
ref: ref
|
|
36
|
-
})
|
|
39
|
+
})
|
|
37
40
|
})]
|
|
38
41
|
});
|
|
39
42
|
});
|
|
@@ -12,23 +12,31 @@ var _MobileSelector = _interopRequireDefault(require("../../MobileSelector"));
|
|
|
12
12
|
var _DTableCommonAddTool = _interopRequireDefault(require("../../DTableCommonAddTool"));
|
|
13
13
|
require("./index.css");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const {
|
|
16
|
+
Search,
|
|
17
|
+
Option,
|
|
18
|
+
Options,
|
|
19
|
+
Empty
|
|
20
|
+
} = _MobileSelector.default;
|
|
19
21
|
class MBSelectEditor extends _react.default.Component {
|
|
20
22
|
constructor(props) {
|
|
21
23
|
super(props);
|
|
22
24
|
this.onChangeSearch = newValue => {
|
|
23
|
-
const
|
|
25
|
+
const {
|
|
26
|
+
searchVal
|
|
27
|
+
} = this.state;
|
|
24
28
|
if (searchVal === newValue) return;
|
|
25
29
|
this.setState({
|
|
26
30
|
searchVal: newValue
|
|
27
31
|
});
|
|
28
32
|
};
|
|
29
33
|
this.getDisplayOptions = () => {
|
|
30
|
-
const
|
|
31
|
-
|
|
34
|
+
const {
|
|
35
|
+
options
|
|
36
|
+
} = this.props;
|
|
37
|
+
const {
|
|
38
|
+
searchVal
|
|
39
|
+
} = this.state;
|
|
32
40
|
return searchVal ? options.filter(item => item.name.indexOf(searchVal) > -1) : options;
|
|
33
41
|
};
|
|
34
42
|
this.onChange = option => {
|
|
@@ -44,10 +52,10 @@ class MBSelectEditor extends _react.default.Component {
|
|
|
44
52
|
}
|
|
45
53
|
};
|
|
46
54
|
this.renderOptions = options => {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
const {
|
|
56
|
+
value = [],
|
|
57
|
+
valueKey
|
|
58
|
+
} = this.props;
|
|
51
59
|
return options.map(option => {
|
|
52
60
|
const isSelected = value.includes(option[valueKey]);
|
|
53
61
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Option, {
|
|
@@ -64,12 +72,15 @@ class MBSelectEditor extends _react.default.Component {
|
|
|
64
72
|
};
|
|
65
73
|
}
|
|
66
74
|
render() {
|
|
67
|
-
const
|
|
68
|
-
column
|
|
69
|
-
isSupportNewOption
|
|
70
|
-
options
|
|
71
|
-
onAddNewOption
|
|
72
|
-
|
|
75
|
+
const {
|
|
76
|
+
column,
|
|
77
|
+
isSupportNewOption,
|
|
78
|
+
options,
|
|
79
|
+
onAddNewOption
|
|
80
|
+
} = this.props;
|
|
81
|
+
const {
|
|
82
|
+
searchVal
|
|
83
|
+
} = this.state;
|
|
73
84
|
const displayOptions = this.getDisplayOptions();
|
|
74
85
|
const isShowCreateBtn = isSupportNewOption && onAddNewOption && !!searchVal && !options.find(item => item.name !== searchVal);
|
|
75
86
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MobileSelector.default, {
|