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
|
@@ -6,9 +6,6 @@ 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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
11
|
var _dtableUtils = require("dtable-utils");
|
|
@@ -20,47 +17,34 @@ var _cellComparer = require("../utils/cell-comparer");
|
|
|
20
17
|
var _MobileFullScreenPage = _interopRequireDefault(require("../MobileFullScreenPage"));
|
|
21
18
|
require("./index.css");
|
|
22
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
MobileFullScreenPageBody
|
|
20
|
+
const {
|
|
21
|
+
Header,
|
|
22
|
+
Body: MobileFullScreenPageBody
|
|
23
|
+
} = _MobileFullScreenPage.default;
|
|
26
24
|
const RowExpandView = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
27
|
-
let
|
|
28
|
-
saveImmediately =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
isLoading = _useState2[0],
|
|
51
|
-
setLoading = _useState2[1];
|
|
52
|
-
const _useState3 = (0, _react.useState)(false),
|
|
53
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
54
|
-
isSaving = _useState4[0],
|
|
55
|
-
setSaving = _useState4[1];
|
|
56
|
-
const _useState5 = (0, _react.useState)({}),
|
|
57
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
58
|
-
row = _useState6[0],
|
|
59
|
-
setRow = _useState6[1];
|
|
60
|
-
const _useState7 = (0, _react.useState)([]),
|
|
61
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
62
|
-
columns = _useState8[0],
|
|
63
|
-
setColumns = _useState8[1];
|
|
25
|
+
let {
|
|
26
|
+
saveImmediately = true,
|
|
27
|
+
readonly = false,
|
|
28
|
+
isInsertingRow = false,
|
|
29
|
+
zIndex,
|
|
30
|
+
title,
|
|
31
|
+
className,
|
|
32
|
+
valueKey = 'name',
|
|
33
|
+
// name or key
|
|
34
|
+
row: defaultRow,
|
|
35
|
+
columns: defaultColumns,
|
|
36
|
+
commit,
|
|
37
|
+
onToggle,
|
|
38
|
+
uploadFile,
|
|
39
|
+
copyURL,
|
|
40
|
+
children = [],
|
|
41
|
+
historyCallback,
|
|
42
|
+
...otherProps
|
|
43
|
+
} = _ref;
|
|
44
|
+
const [isLoading, setLoading] = (0, _react.useState)(true);
|
|
45
|
+
const [isSaving, setSaving] = (0, _react.useState)(false);
|
|
46
|
+
const [row, setRow] = (0, _react.useState)({});
|
|
47
|
+
const [columns, setColumns] = (0, _react.useState)([]);
|
|
64
48
|
const isChangedRef = (0, _react.useRef)(false);
|
|
65
49
|
const update = (0, _react.useRef)({});
|
|
66
50
|
const checkEditable = (0, _react.useCallback)(column => {
|
|
@@ -72,7 +56,8 @@ const RowExpandView = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
72
56
|
const initRowData = (0, _react.useCallback)(() => {
|
|
73
57
|
setLoading(true);
|
|
74
58
|
setRow(defaultRow);
|
|
75
|
-
let validColumns = defaultColumns.map(c => (
|
|
59
|
+
let validColumns = defaultColumns.map(c => ({
|
|
60
|
+
...c,
|
|
76
61
|
editable: checkEditable(c, defaultRow),
|
|
77
62
|
width: 320
|
|
78
63
|
}));
|
|
@@ -88,9 +73,10 @@ const RowExpandView = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
88
73
|
onToggle();
|
|
89
74
|
}, [isSaving, onToggle]);
|
|
90
75
|
const onSave = (0, _react.useCallback)(function (updated) {
|
|
91
|
-
let
|
|
92
|
-
successCallback
|
|
93
|
-
failCallback
|
|
76
|
+
let {
|
|
77
|
+
successCallback,
|
|
78
|
+
failCallback
|
|
79
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
94
80
|
commit(updated, columns, {
|
|
95
81
|
successCallback,
|
|
96
82
|
failCallback
|
|
@@ -105,15 +91,24 @@ const RowExpandView = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
105
91
|
if (!(0, _cellComparer.isCellValueChanged)(oldValue, value, column.type)) return;
|
|
106
92
|
if (!saveImmediately || isInsertingRow) {
|
|
107
93
|
isChangedRef.current = true;
|
|
108
|
-
update.current =
|
|
109
|
-
|
|
94
|
+
update.current = {
|
|
95
|
+
...update.current,
|
|
96
|
+
...updated
|
|
97
|
+
};
|
|
98
|
+
setRow({
|
|
99
|
+
...row,
|
|
100
|
+
...updated
|
|
101
|
+
});
|
|
110
102
|
return;
|
|
111
103
|
}
|
|
112
104
|
onSave(updated, {
|
|
113
105
|
successCallback: () => {
|
|
114
106
|
isChangedRef.current = false;
|
|
115
107
|
update.current = {};
|
|
116
|
-
setRow(
|
|
108
|
+
setRow({
|
|
109
|
+
...row,
|
|
110
|
+
...updated
|
|
111
|
+
});
|
|
117
112
|
},
|
|
118
113
|
failCallback: () => {
|
|
119
114
|
_toaster.default.danger((0, _lang.getLocale)('Save_failed'));
|
|
@@ -131,7 +126,10 @@ const RowExpandView = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
131
126
|
setSaving(false);
|
|
132
127
|
_toaster.default.danger((0, _lang.getLocale)('Save_failed'));
|
|
133
128
|
};
|
|
134
|
-
const newRow = isInsertingRow ?
|
|
129
|
+
const newRow = isInsertingRow ? {
|
|
130
|
+
...row,
|
|
131
|
+
...update.current
|
|
132
|
+
} : update.current;
|
|
135
133
|
onSave(newRow, {
|
|
136
134
|
successCallback,
|
|
137
135
|
failCallback
|
|
@@ -176,13 +174,14 @@ const RowExpandView = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
176
174
|
children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
177
175
|
className: "w-100 -h-100 d-flex align-items-center justify-content-center",
|
|
178
176
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.default, {})
|
|
179
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_body.default,
|
|
177
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_body.default, {
|
|
178
|
+
...otherProps,
|
|
180
179
|
row: row,
|
|
181
180
|
columns: columns,
|
|
182
181
|
valueKey: valueKey,
|
|
183
182
|
onChange: onChange,
|
|
184
183
|
uploadFile: uploadFile
|
|
185
|
-
})
|
|
184
|
+
})
|
|
186
185
|
})]
|
|
187
186
|
});
|
|
188
187
|
});
|
package/lib/SelectItem/index.js
CHANGED
|
@@ -11,11 +11,13 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
11
11
|
require("./index.css");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
const SelectItem = _ref => {
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
let {
|
|
15
|
+
option,
|
|
16
|
+
fontSize,
|
|
17
|
+
className,
|
|
18
|
+
isShowRemove,
|
|
19
|
+
onRemove
|
|
20
|
+
} = _ref;
|
|
19
21
|
const selectItemStyle = (0, _react.useMemo)(() => {
|
|
20
22
|
return {
|
|
21
23
|
fontSize: fontSize || 13,
|
|
@@ -19,12 +19,14 @@ class SelectOptionGroup extends _react.Component {
|
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props);
|
|
21
21
|
this.resetMenuStyle = () => {
|
|
22
|
-
const
|
|
23
|
-
isInModal
|
|
24
|
-
position
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
const {
|
|
23
|
+
isInModal,
|
|
24
|
+
position
|
|
25
|
+
} = this.props;
|
|
26
|
+
const {
|
|
27
|
+
top,
|
|
28
|
+
height
|
|
29
|
+
} = this.optionGroupRef.getBoundingClientRect();
|
|
28
30
|
if (isInModal) {
|
|
29
31
|
if (position.y + position.height + height > window.innerHeight) {
|
|
30
32
|
this.optionGroupRef.style.top = position.y - height + 'px';
|
|
@@ -75,7 +77,9 @@ class SelectOptionGroup extends _react.Component {
|
|
|
75
77
|
}
|
|
76
78
|
};
|
|
77
79
|
this.onMouseDown = e => {
|
|
78
|
-
const
|
|
80
|
+
const {
|
|
81
|
+
isInModal
|
|
82
|
+
} = this.props;
|
|
79
83
|
// prevent event propagation when click option or search input
|
|
80
84
|
if (isInModal) {
|
|
81
85
|
e.stopPropagation();
|
|
@@ -87,9 +91,10 @@ class SelectOptionGroup extends _react.Component {
|
|
|
87
91
|
}
|
|
88
92
|
};
|
|
89
93
|
this.scrollContent = () => {
|
|
90
|
-
const
|
|
91
|
-
offsetHeight
|
|
92
|
-
scrollTop
|
|
94
|
+
const {
|
|
95
|
+
offsetHeight,
|
|
96
|
+
scrollTop
|
|
97
|
+
} = this.optionGroupContentRef;
|
|
93
98
|
this.setState({
|
|
94
99
|
disableHover: true
|
|
95
100
|
});
|
|
@@ -129,10 +134,11 @@ class SelectOptionGroup extends _react.Component {
|
|
|
129
134
|
});
|
|
130
135
|
};
|
|
131
136
|
this.renderOptGroup = searchVal => {
|
|
132
|
-
let
|
|
133
|
-
noOptionsPlaceholder
|
|
134
|
-
onSelectOption
|
|
135
|
-
value
|
|
137
|
+
let {
|
|
138
|
+
noOptionsPlaceholder,
|
|
139
|
+
onSelectOption,
|
|
140
|
+
value
|
|
141
|
+
} = this.props;
|
|
136
142
|
this.filterOptions = this.props.getFilterOptions(searchVal);
|
|
137
143
|
if (this.filterOptions.length === 0) {
|
|
138
144
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -190,22 +196,26 @@ class SelectOptionGroup extends _react.Component {
|
|
|
190
196
|
window.removeEventListener('keydown', this.onHotKey);
|
|
191
197
|
}
|
|
192
198
|
render() {
|
|
193
|
-
const
|
|
194
|
-
searchable
|
|
195
|
-
searchPlaceholder
|
|
196
|
-
top
|
|
197
|
-
left
|
|
198
|
-
minWidth
|
|
199
|
-
value
|
|
200
|
-
isShowSelected
|
|
201
|
-
isInModal
|
|
202
|
-
position
|
|
203
|
-
className
|
|
204
|
-
addOptionAble
|
|
205
|
-
component
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
199
|
+
const {
|
|
200
|
+
searchable,
|
|
201
|
+
searchPlaceholder,
|
|
202
|
+
top,
|
|
203
|
+
left,
|
|
204
|
+
minWidth,
|
|
205
|
+
value,
|
|
206
|
+
isShowSelected,
|
|
207
|
+
isInModal,
|
|
208
|
+
position,
|
|
209
|
+
className,
|
|
210
|
+
addOptionAble,
|
|
211
|
+
component
|
|
212
|
+
} = this.props;
|
|
213
|
+
const {
|
|
214
|
+
AddOption
|
|
215
|
+
} = component || {};
|
|
216
|
+
let {
|
|
217
|
+
searchVal
|
|
218
|
+
} = this.state;
|
|
209
219
|
let style = {
|
|
210
220
|
top: top || 0,
|
|
211
221
|
left: left || 0
|
|
@@ -12,12 +12,12 @@ var _lang = require("../lang");
|
|
|
12
12
|
require("./index.css");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
function SelectedDepartments(_ref) {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
isShowRemoveIcon =
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
let {
|
|
16
|
+
value,
|
|
17
|
+
removeDepartment,
|
|
18
|
+
isShowRemoveIcon = false,
|
|
19
|
+
departments = []
|
|
20
|
+
} = _ref;
|
|
21
21
|
const idDepartmentMap = (0, _react.useMemo)(() => {
|
|
22
22
|
let idDepartmentMap = {};
|
|
23
23
|
departments.forEach(department => {
|
|
@@ -36,11 +36,13 @@ function SelectedDepartments(_ref) {
|
|
|
36
36
|
"aria-label": name,
|
|
37
37
|
children: name
|
|
38
38
|
})
|
|
39
|
-
},
|
|
39
|
+
}, `department-${index}`);
|
|
40
40
|
}
|
|
41
41
|
const department = idDepartmentMap[content];
|
|
42
42
|
if (department) {
|
|
43
|
-
const
|
|
43
|
+
const {
|
|
44
|
+
name
|
|
45
|
+
} = department;
|
|
44
46
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
45
47
|
className: "department mr-1",
|
|
46
48
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -63,7 +65,7 @@ function SelectedDepartments(_ref) {
|
|
|
63
65
|
})
|
|
64
66
|
})
|
|
65
67
|
})]
|
|
66
|
-
},
|
|
68
|
+
}, `department-${index}`);
|
|
67
69
|
}
|
|
68
70
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
69
71
|
className: "department empty-department mr-1",
|
|
@@ -85,7 +87,7 @@ function SelectedDepartments(_ref) {
|
|
|
85
87
|
})
|
|
86
88
|
})
|
|
87
89
|
})]
|
|
88
|
-
},
|
|
90
|
+
}, `department-${index}`);
|
|
89
91
|
}) : null;
|
|
90
92
|
return dom;
|
|
91
93
|
}
|
|
@@ -31,8 +31,8 @@ class SimpleLongTextFormatter extends _react.default.Component {
|
|
|
31
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
32
32
|
className: "long-text-check-list",
|
|
33
33
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
34
|
-
className:
|
|
35
|
-
}),
|
|
34
|
+
className: `dtable-font dtable-icon-check-square-solid ${checkList.completed === checkList.total ? 'long-text-check-list-completed' : ''}`
|
|
35
|
+
}), `${checkList.completed}/${checkList.total}`]
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
this.renderImages = value => {
|
|
@@ -56,17 +56,20 @@ class SimpleLongTextFormatter extends _react.default.Component {
|
|
|
56
56
|
});
|
|
57
57
|
};
|
|
58
58
|
this.translateValue = () => {
|
|
59
|
-
const
|
|
59
|
+
const {
|
|
60
|
+
value
|
|
61
|
+
} = this.props;
|
|
60
62
|
if (!value) return {};
|
|
61
63
|
const valueType = Object.prototype.toString.call(value);
|
|
62
64
|
if (valueType === '[object String]') {
|
|
63
65
|
const isMarkdown = true;
|
|
64
66
|
const previewTextNeedSlice = false;
|
|
65
|
-
const
|
|
66
|
-
previewText
|
|
67
|
-
images
|
|
68
|
-
links
|
|
69
|
-
checklist
|
|
67
|
+
const {
|
|
68
|
+
previewText,
|
|
69
|
+
images,
|
|
70
|
+
links,
|
|
71
|
+
checklist
|
|
72
|
+
} = (0, _seafileEditor.getPreviewContent)(value, isMarkdown, previewTextNeedSlice);
|
|
70
73
|
const newValue = Object.assign({}, {
|
|
71
74
|
text: value,
|
|
72
75
|
preview: previewText,
|
|
@@ -139,10 +142,13 @@ class SimpleLongTextFormatter extends _react.default.Component {
|
|
|
139
142
|
this.clearClosePreviewTimer();
|
|
140
143
|
}
|
|
141
144
|
render() {
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
const {
|
|
146
|
+
isPreview
|
|
147
|
+
} = this.state;
|
|
148
|
+
const {
|
|
149
|
+
containerClassName,
|
|
150
|
+
previewClassName
|
|
151
|
+
} = this.props;
|
|
146
152
|
const className = (0, _classnames.default)('dtable-ui cell-formatter-container long-text-formatter', containerClassName);
|
|
147
153
|
const value = this.translateValue();
|
|
148
154
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -46,9 +46,10 @@ const getPreviewContent = markdownContent => {
|
|
|
46
46
|
}
|
|
47
47
|
const hrefList = markdownContent.match(hrefReg);
|
|
48
48
|
if (hrefList) {
|
|
49
|
-
const
|
|
50
|
-
images
|
|
51
|
-
links
|
|
49
|
+
const {
|
|
50
|
+
images,
|
|
51
|
+
links
|
|
52
|
+
} = getLinks(hrefList);
|
|
52
53
|
return {
|
|
53
54
|
preview,
|
|
54
55
|
images,
|
|
@@ -14,12 +14,17 @@ class LongTextPreview extends _react.default.PureComponent {
|
|
|
14
14
|
constructor(props) {
|
|
15
15
|
super(props);
|
|
16
16
|
this.getStyle = () => {
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
let {
|
|
18
|
+
formatterStyle
|
|
19
|
+
} = this.props;
|
|
20
|
+
let {
|
|
21
|
+
left,
|
|
22
|
+
top
|
|
23
|
+
} = formatterStyle;
|
|
24
|
+
const {
|
|
25
|
+
height,
|
|
26
|
+
opacity
|
|
27
|
+
} = this.state;
|
|
23
28
|
const width = 520;
|
|
24
29
|
const padding = 6;
|
|
25
30
|
left = left - width > 0 ? left - width - 12 : 0;
|
|
@@ -48,12 +53,15 @@ class LongTextPreview extends _react.default.PureComponent {
|
|
|
48
53
|
setTimeout(() => {
|
|
49
54
|
var _value$images;
|
|
50
55
|
if (!this.ref) return;
|
|
51
|
-
const
|
|
56
|
+
const {
|
|
57
|
+
value
|
|
58
|
+
} = this.props;
|
|
52
59
|
|
|
53
60
|
// If image is included, sets the preview height to the maximum height
|
|
54
61
|
const hasImage = (value === null || value === void 0 ? void 0 : (_value$images = value.images) === null || _value$images === void 0 ? void 0 : _value$images.length) >= 2 ? true : false;
|
|
55
|
-
let
|
|
56
|
-
domHeight
|
|
62
|
+
let {
|
|
63
|
+
height: domHeight
|
|
64
|
+
} = this.ref.getBoundingClientRect();
|
|
57
65
|
domHeight = hasImage ? 450 : domHeight;
|
|
58
66
|
this.setState({
|
|
59
67
|
height: Math.min(domHeight, 450),
|
|
@@ -62,9 +70,10 @@ class LongTextPreview extends _react.default.PureComponent {
|
|
|
62
70
|
}, 10);
|
|
63
71
|
}
|
|
64
72
|
render() {
|
|
65
|
-
const
|
|
66
|
-
className
|
|
67
|
-
value
|
|
73
|
+
const {
|
|
74
|
+
className,
|
|
75
|
+
value
|
|
76
|
+
} = this.props;
|
|
68
77
|
const markdownContent = value ? value.text : '';
|
|
69
78
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
70
79
|
className: (0, _classnames.default)('longtext-modal-dialog longtext-preview', className),
|
|
@@ -51,9 +51,10 @@ class DtableMarkdownViewer extends _react.default.PureComponent {
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
showTOC
|
|
56
|
-
markdownContent
|
|
54
|
+
const {
|
|
55
|
+
showTOC,
|
|
56
|
+
markdownContent
|
|
57
|
+
} = this.props;
|
|
57
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_seafileEditor.MarkdownViewer, {
|
|
58
59
|
value: markdownContent,
|
|
59
60
|
isShowOutline: showTOC
|
|
@@ -6,19 +6,19 @@ 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 _selectEditor = _interopRequireDefault(require("../select-editor"));
|
|
13
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
const _excluded = ["value"];
|
|
15
12
|
const SingleSelectEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
16
|
-
let
|
|
17
|
-
|
|
13
|
+
let {
|
|
14
|
+
value: oldValue,
|
|
15
|
+
...props
|
|
16
|
+
} = _ref;
|
|
18
17
|
const value = oldValue ? [oldValue] : [];
|
|
19
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_selectEditor.default,
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_selectEditor.default, {
|
|
19
|
+
...props,
|
|
20
20
|
value: value,
|
|
21
21
|
ref: ref
|
|
22
|
-
})
|
|
22
|
+
});
|
|
23
23
|
});
|
|
24
24
|
var _default = exports.default = SingleSelectEditor;
|
|
@@ -14,11 +14,11 @@ class SingleSelectFormatter extends _react.default.PureComponent {
|
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.getOption = () => {
|
|
17
|
-
let
|
|
18
|
-
value
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
let {
|
|
18
|
+
value,
|
|
19
|
+
options = [],
|
|
20
|
+
fontSize
|
|
21
|
+
} = this.props;
|
|
22
22
|
let option = options.find(item => item.id === value || item.name === value);
|
|
23
23
|
if (option) {
|
|
24
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectItem.default, {
|
|
@@ -29,9 +29,10 @@ class SingleSelectFormatter extends _react.default.PureComponent {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
const
|
|
33
|
-
containerClassName
|
|
34
|
-
value
|
|
32
|
+
const {
|
|
33
|
+
containerClassName,
|
|
34
|
+
value
|
|
35
|
+
} = this.props;
|
|
35
36
|
let classname = (0, _classnames.default)('dtable-ui cell-formatter-container single-select-formatter', containerClassName);
|
|
36
37
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
37
38
|
className: classname,
|
package/lib/TabBar/Tab.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 = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var React = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _Badge = _interopRequireDefault(require("../Badge"));
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -14,31 +13,32 @@ class Tab extends React.PureComponent {
|
|
|
14
13
|
constructor() {
|
|
15
14
|
super(...arguments);
|
|
16
15
|
this.renderIcon = () => {
|
|
17
|
-
const
|
|
18
|
-
dot
|
|
19
|
-
badge
|
|
20
|
-
selected
|
|
21
|
-
selectedIcon
|
|
22
|
-
icon
|
|
23
|
-
title
|
|
24
|
-
prefixCls
|
|
16
|
+
const {
|
|
17
|
+
dot,
|
|
18
|
+
badge,
|
|
19
|
+
selected,
|
|
20
|
+
selectedIcon,
|
|
21
|
+
icon,
|
|
22
|
+
title,
|
|
23
|
+
prefixCls
|
|
24
|
+
} = this.props;
|
|
25
25
|
const iconRes = selected ? selectedIcon : icon;
|
|
26
26
|
const iconDom = /*#__PURE__*/React.isValidElement(iconRes) ? iconRes : /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
27
|
-
className:
|
|
27
|
+
className: `${prefixCls}-image`,
|
|
28
28
|
src: iconRes ? iconRes.uri : iconRes,
|
|
29
29
|
alt: title
|
|
30
30
|
});
|
|
31
31
|
if (badge) {
|
|
32
32
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Badge.default, {
|
|
33
33
|
text: badge,
|
|
34
|
-
className:
|
|
34
|
+
className: `${prefixCls}-badge tab-badge`,
|
|
35
35
|
children: [' ', iconDom, ' ']
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
if (dot) {
|
|
39
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default, {
|
|
40
40
|
dot: true,
|
|
41
|
-
className:
|
|
41
|
+
className: `${prefixCls}-badge tab-dot`,
|
|
42
42
|
children: iconDom
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -52,30 +52,32 @@ class Tab extends React.PureComponent {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
render() {
|
|
55
|
-
const
|
|
56
|
-
title
|
|
57
|
-
prefixCls
|
|
58
|
-
selected
|
|
59
|
-
unselectedTintColor
|
|
60
|
-
tintColor
|
|
55
|
+
const {
|
|
56
|
+
title,
|
|
57
|
+
prefixCls,
|
|
58
|
+
selected,
|
|
59
|
+
unselectedTintColor,
|
|
60
|
+
tintColor
|
|
61
|
+
} = this.props;
|
|
61
62
|
const iconColor = selected ? tintColor : unselectedTintColor;
|
|
62
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div",
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
64
|
+
...this.props.dataAttrs,
|
|
63
65
|
onClick: this.onClick,
|
|
64
|
-
className:
|
|
66
|
+
className: `${prefixCls}`,
|
|
65
67
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
66
|
-
className:
|
|
68
|
+
className: `${prefixCls}-icon`,
|
|
67
69
|
style: {
|
|
68
70
|
color: iconColor
|
|
69
71
|
},
|
|
70
72
|
children: this.renderIcon()
|
|
71
73
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
72
|
-
className:
|
|
74
|
+
className: `${prefixCls}-title`,
|
|
73
75
|
style: {
|
|
74
76
|
color: selected ? tintColor : unselectedTintColor
|
|
75
77
|
},
|
|
76
78
|
children: title
|
|
77
79
|
})]
|
|
78
|
-
})
|
|
80
|
+
});
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
var _default = exports.default = Tab;
|