dtable-ui-component 6.0.89 → 6.0.92
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 +96 -70
- package/lib/ActivityIndicator/index.js +41 -33
- package/lib/AsyncUserSelect/index.css +122 -0
- package/lib/AsyncUserSelect/index.js +260 -0
- package/lib/AsyncUserSelect/user-item.js +55 -0
- package/lib/AutoNumberFormatter/index.js +5 -3
- package/lib/Badge/index.js +22 -18
- package/lib/ButtonFormatter/index.js +15 -10
- package/lib/CTimeFormatter/index.js +5 -3
- package/lib/CheckboxEditor/index.js +22 -13
- package/lib/CheckboxEditor/mb-editor.js +8 -6
- package/lib/CheckboxEditor/pc-editor.js +8 -6
- package/lib/CheckboxFormatter/index.js +8 -6
- package/lib/CollaboratorEditor/index.js +24 -15
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -13
- package/lib/CollaboratorEditor/pc-editor/index.js +51 -43
- package/lib/CollaboratorFormatter/index.js +8 -7
- package/lib/CollaboratorItem/index.js +21 -16
- package/lib/CollapsibleSettingLayout/index.css +0 -5
- package/lib/CollapsibleSettingLayout/index.js +17 -12
- package/lib/Comment/body/comment.js +79 -63
- package/lib/Comment/body/index.js +14 -11
- package/lib/Comment/footer/btns/index.js +68 -53
- package/lib/Comment/footer/index.js +30 -28
- package/lib/Comment/footer/input/index.js +49 -44
- package/lib/Comment/footer/input/participant/index.js +19 -14
- package/lib/Comment/footer/participants/index.js +31 -28
- package/lib/Comment/footer/participants/participant/index.js +18 -15
- package/lib/Comment/footer/participants/participant-select/index.js +68 -57
- package/lib/Comment/index.js +33 -28
- package/lib/Comment/utils/utilities.js +1 -1
- package/lib/CreatorFormatter/index.js +8 -7
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +60 -35
- package/lib/DTableColorPicker/index.js +135 -99
- package/lib/DTableColorPicker/utils.js +1 -1
- package/lib/DTableCommonAddTool/index.js +11 -8
- package/lib/DTableCustomFooter/index.js +5 -3
- package/lib/DTableCustomizeCollaboratorSelect/index.css +1 -39
- package/lib/DTableCustomizeCollaboratorSelect/index.js +38 -32
- package/lib/DTableCustomizeSelect/index.js +51 -44
- package/lib/DTableEmptyTip/index.js +20 -16
- package/lib/DTableFiltersPopover/index.js +71 -61
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +74 -57
- package/lib/DTableFiltersPopover/utils/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +64 -49
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +49 -41
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +57 -47
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +35 -31
- package/lib/DTableFiltersPopover/widgets/filter-group.js +38 -32
- package/lib/DTableFiltersPopover/widgets/filter-item.js +125 -106
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +1 -5
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +18 -17
- package/lib/DTableFiltersPopover/widgets/rate-item.js +12 -9
- package/lib/DTableGroupSelect/index.js +52 -44
- package/lib/DTableGroupSelect/option.js +5 -3
- package/lib/DTableGroupSelect/select-option-group.css +0 -37
- package/lib/DTableGroupSelect/select-option-group.js +31 -25
- package/lib/DTableModalHeader/index.js +13 -9
- package/lib/DTablePopover/index.js +9 -6
- package/lib/DTableRadio/index.js +20 -17
- package/lib/DTableRadioGroup/index.js +22 -19
- package/lib/DTableSearchInput/index.js +23 -19
- package/lib/DTableSelect/dtable-select-label.js +12 -7
- package/lib/DTableSelect/index.js +2 -1
- package/lib/DTableSelect/utils.js +34 -20
- package/lib/DTableSwitch/index.css +1 -2
- package/lib/DTableSwitch/index.js +30 -18
- package/lib/DateEditor/index.js +25 -16
- package/lib/DateEditor/mb-editor/index.js +90 -68
- package/lib/DateEditor/pc-editor.js +39 -35
- package/lib/DateFormatter/index.js +5 -3
- package/lib/DatePicker/utils.js +4 -4
- package/lib/DeleteTip/index.js +29 -20
- package/lib/DepartmentMultipleSelectEditor/index.js +57 -49
- package/lib/DepartmentSelectFilter/index.js +8 -1
- package/lib/DepartmentSingleSelectEditor/index.js +22 -13
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +75 -55
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +78 -61
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +14 -11
- package/lib/DepartmentSingleSelectFormatter/index.js +13 -10
- package/lib/DigitalSignEditor/index.js +22 -13
- package/lib/DigitalSignEditor/mb-editor/index.js +39 -24
- package/lib/DigitalSignEditor/pc-editor/index.js +44 -30
- package/lib/DigitalSignEditor/service.js +1 -1
- package/lib/DigitalSignEditor/signature-board/index.js +21 -17
- package/lib/DigitalSignFormatter/index.js +23 -19
- package/lib/DigitalSignFormatter/utils.js +1 -1
- package/lib/Drawer/index.js +4 -1
- package/lib/DurationEditor/index.js +2 -1
- package/lib/DurationFormatter/index.js +5 -3
- package/lib/EditEditorButton/index.js +5 -3
- package/lib/EmailEditor/index.js +2 -1
- package/lib/EmailFormatter/index.js +5 -3
- package/lib/FieldDisplaySetting/field-item.js +26 -20
- package/lib/FieldDisplaySetting/index.css +0 -6
- package/lib/FieldDisplaySetting/index.js +50 -41
- package/lib/FileEditor/files-previewer/index.js +22 -13
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +43 -28
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +24 -21
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +30 -24
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +13 -11
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +82 -64
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +81 -65
- package/lib/FileEditor/index.js +22 -13
- package/lib/FileEditor/mb-editor/index.js +43 -31
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +27 -20
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +108 -82
- package/lib/FileEditor/pc-editor/index.js +46 -36
- package/lib/FileFormatter/index.js +40 -36
- package/lib/FileItemFormatter/index.js +3 -2
- package/lib/FileUploader/index.js +23 -21
- package/lib/FormulaFormatter/index.js +24 -17
- package/lib/GeolocationEditor/index.js +31 -22
- package/lib/GeolocationEditor/map-editor-utils.js +2 -2
- package/lib/GeolocationEditor/mb-editor/country-editor.js +42 -27
- package/lib/GeolocationEditor/mb-editor/index.js +22 -14
- package/lib/GeolocationEditor/mb-editor/location-editor.js +54 -34
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +102 -74
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +144 -110
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +42 -27
- package/lib/GeolocationEditor/mb-editor/province-editor.js +42 -27
- package/lib/GeolocationEditor/pc-editor/country-editor.js +38 -31
- package/lib/GeolocationEditor/pc-editor/index.js +26 -17
- package/lib/GeolocationEditor/pc-editor/location-editor.js +122 -96
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +99 -74
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +99 -76
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +139 -94
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +122 -85
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +89 -69
- package/lib/GeolocationEditor/pc-editor/province-editor.js +31 -26
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +9 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +15 -13
- package/lib/GeolocationFormatter/index.js +5 -3
- package/lib/HtmlLongTextFormatter/index.js +3 -2
- package/lib/Icon/index.js +9 -6
- package/lib/Icon/load-sprite.js +13 -2
- package/lib/IconButton/index.js +9 -6
- package/lib/ImageEditor/images-previewer/image-preview/index.js +53 -45
- package/lib/ImageEditor/images-previewer/index.js +35 -32
- package/lib/ImageEditor/index.js +22 -13
- package/lib/ImageEditor/mb-editor/index.js +43 -31
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +19 -15
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +32 -24
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +102 -77
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +33 -30
- package/lib/ImageEditor/pc-editor/index.js +44 -32
- package/lib/ImageFormatter/images-lazy-load.js +12 -10
- package/lib/ImageFormatter/index.js +40 -34
- package/lib/ImagePreviewerLightbox/index.js +12 -8
- package/lib/ImageThumbnail/index.js +47 -39
- package/lib/InputItem/custom-input.js +32 -27
- package/lib/InputItem/custom-keyboard.js +68 -47
- package/lib/InputItem/index.js +81 -71
- package/lib/InputItem/input.js +5 -3
- package/lib/LastModifierFormatter/index.js +8 -7
- package/lib/LinkEditor/index.js +38 -32
- package/lib/LinkEditor/link-editor-option.js +25 -20
- package/lib/LinkEditor/mb-popover/index.js +53 -41
- package/lib/LinkEditor/pc-popover/index.js +41 -33
- package/lib/LinkFormatter/index.js +13 -10
- package/lib/List/index.js +15 -9
- package/lib/List/list-item.js +51 -42
- package/lib/Loading/index.js +2 -1
- package/lib/LongTextFormatter/index.js +3 -2
- package/lib/MBEditorHeader/index.js +19 -14
- package/lib/MTimeFormatter/index.js +5 -3
- package/lib/MobileFullScreenPage/body/index.js +6 -4
- package/lib/MobileFullScreenPage/header/index.js +22 -17
- package/lib/MobileFullScreenPage/index.js +11 -8
- package/lib/MobileModal/index.js +6 -3
- package/lib/MobileOperationSheet/index.js +28 -18
- package/lib/MobileSelector/empty/index.js +5 -3
- package/lib/MobileSelector/index.js +18 -12
- package/lib/MobileSelector/option/index.js +17 -12
- package/lib/MobileSelector/options/index.js +5 -3
- package/lib/MobileSelector/search/index.js +10 -8
- package/lib/MobileUpload/index.js +87 -67
- package/lib/Modal/alert.js +9 -6
- package/lib/Modal/modal.js +26 -22
- package/lib/Modal/operation.js +2 -1
- package/lib/Modal/prompt.js +76 -56
- package/lib/MultipleSelectEditor/index.js +4 -2
- package/lib/MultipleSelectFormatter/index.js +8 -7
- package/lib/NotificationPopover/index.js +43 -32
- package/lib/NumberEditor/index.js +2 -1
- package/lib/NumberFormatter/index.js +5 -3
- package/lib/Picker/AbstractPicker.js +26 -22
- package/lib/Picker/index.js +2 -1
- package/lib/Popover/index.js +8 -5
- package/lib/Popover/item.js +26 -19
- package/lib/Progress/index.js +17 -15
- package/lib/Radio/Radio.js +12 -8
- package/lib/Radio/RadioItem.js +11 -5
- package/lib/RateFormatter/index.js +8 -7
- package/lib/RoleStatusEditor/index.js +36 -31
- package/lib/RowExpand/index.js +16 -9
- package/lib/RowExpandDialog/body/index.js +53 -42
- package/lib/RowExpandDialog/column-content/index.js +34 -25
- package/lib/RowExpandDialog/header/index.js +29 -22
- package/lib/RowExpandDialog/index.js +43 -30
- package/lib/RowExpandEditor/add-btn/index.js +16 -9
- package/lib/RowExpandEditor/add-btn/mb-add-btn/index.js +5 -3
- package/lib/RowExpandEditor/add-btn/pc-add-btn/index.js +8 -5
- package/lib/RowExpandEditor/checkbox-editor/index.js +16 -9
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +10 -8
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +2 -1
- package/lib/RowExpandEditor/collaborator-editor/index.js +16 -9
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +19 -17
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +52 -47
- package/lib/RowExpandEditor/date-editor/index.js +16 -9
- package/lib/RowExpandEditor/date-editor/mb-editor.js +20 -15
- package/lib/RowExpandEditor/date-editor/pc-editor.js +24 -21
- package/lib/RowExpandEditor/department-editor/index.js +16 -9
- package/lib/RowExpandEditor/department-editor/mb-editor.js +27 -22
- package/lib/RowExpandEditor/department-editor/pc-editor.js +35 -29
- package/lib/RowExpandEditor/digital-sign-editor/index.js +16 -9
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +19 -16
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +34 -32
- package/lib/RowExpandEditor/duration-editor/index.js +16 -9
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +15 -12
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +17 -13
- package/lib/RowExpandEditor/email-editor/index.js +16 -9
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +20 -18
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +21 -19
- package/lib/RowExpandEditor/file-editor/index.js +16 -9
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +21 -16
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +22 -20
- package/lib/RowExpandEditor/geolocation-editor/index.js +16 -9
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +12 -9
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +20 -17
- package/lib/RowExpandEditor/image-editor/index.js +16 -9
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +21 -16
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +29 -25
- package/lib/RowExpandEditor/index.js +4 -2
- package/lib/RowExpandEditor/long-text-editor/index.js +16 -9
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +27 -16
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +19 -16
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +22 -18
- package/lib/RowExpandEditor/multiple-select-editor/index.js +16 -9
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +26 -23
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +82 -68
- package/lib/RowExpandEditor/number-editor/index.js +16 -9
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +10 -7
- package/lib/RowExpandEditor/number-editor/pc-editor.js +6 -4
- package/lib/RowExpandEditor/rate-editor/index.js +16 -9
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +10 -8
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +12 -10
- package/lib/RowExpandEditor/right-angle/index.js +8 -6
- package/lib/RowExpandEditor/single-select-editor/index.js +16 -9
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +30 -23
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +43 -35
- package/lib/RowExpandEditor/text-editor/index.js +16 -9
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +11 -9
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +16 -12
- package/lib/RowExpandEditor/url-editor/index.js +16 -9
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +20 -18
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +21 -19
- package/lib/RowExpandFormatter/department-formatter/index.js +14 -5
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +2 -1
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +15 -11
- package/lib/RowExpandFormatter/email-formatter/index.js +12 -9
- package/lib/RowExpandFormatter/file-formatter/index.js +15 -14
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +43 -36
- package/lib/RowExpandFormatter/formula-formatter/index.js +53 -42
- package/lib/RowExpandFormatter/image-formatter/index.js +30 -27
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +47 -39
- package/lib/RowExpandFormatter/index.js +134 -116
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +3 -2
- package/lib/RowExpandFormatter/link-formatter/index.js +70 -67
- package/lib/RowExpandFormatter/rate-formatter/index.js +8 -7
- package/lib/RowExpandFormatter/url-formatter/index.js +12 -9
- package/lib/RowExpandView/body/index.js +39 -33
- package/lib/RowExpandView/column-content/index.js +10 -5
- package/lib/RowExpandView/index.js +27 -16
- package/lib/SelectItem/index.js +16 -12
- package/lib/SelectOptionGroup/index.css +4 -2
- package/lib/SelectOptionGroup/index.js +39 -32
- package/lib/SelectOptionGroup/option.js +5 -3
- package/lib/SelectedDepartments/index.js +54 -44
- package/lib/SimpleLongTextFormatter/index.js +39 -30
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +11 -8
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -2
- package/lib/SingleSelectEditor/index.js +4 -2
- package/lib/SingleSelectFormatter/index.js +6 -4
- package/lib/SvgIcon/index.js +5 -2
- package/lib/TabBar/Tab.js +28 -21
- package/lib/TabBar/index.js +28 -24
- package/lib/Tabs/index.js +8 -5
- package/lib/TextEditor/index.js +21 -18
- package/lib/TextFormatter/index.js +5 -3
- package/lib/TextareaItem/index.js +49 -40
- package/lib/Toast/index.js +20 -14
- package/lib/UploadProgress/index.js +2 -1
- package/lib/UrlEditor/index.js +2 -1
- package/lib/UrlFormatter/index.js +5 -3
- package/lib/formatterConfig/base-formatter-config.js +24 -23
- package/lib/formatterConfig/index.js +3 -2
- package/lib/index.js +7 -0
- package/lib/locales/de.json +5 -1
- package/lib/locales/en.json +5 -1
- package/lib/locales/es.json +6 -2
- package/lib/locales/fr.json +5 -1
- package/lib/locales/pt.json +5 -1
- package/lib/locales/ru.json +5 -1
- package/lib/locales/zh-CN.json +5 -1
- package/lib/select-editor/index.js +22 -13
- package/lib/select-editor/mb-editor/index.js +22 -16
- package/lib/select-editor/pc-editor/index.js +75 -61
- package/lib/toaster/alert.js +25 -16
- package/lib/toaster/toast.js +27 -23
- package/lib/toaster/toastManager.js +17 -14
- package/lib/toaster/toaster.js +8 -4
- package/lib/utils/class.js +3 -3
- package/lib/utils/object-utils.js +1 -1
- package/lib/utils/url.js +4 -4
- package/package.json +13 -29
|
@@ -11,43 +11,49 @@ var _seafileEditor = require("@seafile/seafile-editor");
|
|
|
11
11
|
var _LongTextPreview = _interopRequireDefault(require("./widgets/LongTextPreview"));
|
|
12
12
|
var _ModalPortal = _interopRequireDefault(require("../ModalPortal"));
|
|
13
13
|
require("./index.css");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
class SimpleLongTextFormatter extends _react.default.Component {
|
|
15
16
|
constructor(props) {
|
|
16
17
|
super(props);
|
|
17
18
|
this.renderLinks = value => {
|
|
18
19
|
const links = value.links;
|
|
19
20
|
if (!Array.isArray(links) || links.length === 0) return null;
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
-
className: "long-text-links"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
22
|
+
className: "long-text-links",
|
|
23
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
24
|
+
className: "dtable-font dtable-icon-url"
|
|
25
|
+
}), links.length]
|
|
26
|
+
});
|
|
25
27
|
};
|
|
26
28
|
this.renderCheckList = value => {
|
|
27
29
|
const checkList = value.checklist;
|
|
28
30
|
if (!checkList || checkList.total === 0) return null;
|
|
29
|
-
return /*#__PURE__*/
|
|
30
|
-
className: "long-text-check-list"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
32
|
+
className: "long-text-check-list",
|
|
33
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
34
|
+
className: `dtable-font dtable-icon-check-square-solid ${checkList.completed === checkList.total ? 'long-text-check-list-completed' : ''}`
|
|
35
|
+
}), `${checkList.completed}/${checkList.total}`]
|
|
36
|
+
});
|
|
34
37
|
};
|
|
35
38
|
this.renderImages = value => {
|
|
36
39
|
const images = value.images;
|
|
37
40
|
if (!Array.isArray(images) || images.length === 0) return null;
|
|
38
|
-
return /*#__PURE__*/
|
|
39
|
-
className: "long-text-images"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
42
|
+
className: "long-text-images",
|
|
43
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
44
|
+
src: images[0],
|
|
45
|
+
alt: ""
|
|
46
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
47
|
+
className: "image-number",
|
|
48
|
+
children: images.length > 1 ? '+' + images.length : null
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
46
51
|
};
|
|
47
52
|
this.renderContent = value => {
|
|
48
|
-
return /*#__PURE__*/
|
|
49
|
-
className: "long-text-content"
|
|
50
|
-
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
54
|
+
className: "long-text-content",
|
|
55
|
+
children: value.preview
|
|
56
|
+
});
|
|
51
57
|
};
|
|
52
58
|
this.translateValue = () => {
|
|
53
59
|
const {
|
|
@@ -145,18 +151,21 @@ class SimpleLongTextFormatter extends _react.default.Component {
|
|
|
145
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
|
-
return /*#__PURE__*/
|
|
154
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
149
155
|
className: className,
|
|
150
156
|
onMouseEnter: this.onMouseEnter,
|
|
151
157
|
onMouseLeave: this.onMouseLeave,
|
|
152
|
-
ref: ref => this.ref = ref
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
ref: ref => this.ref = ref,
|
|
159
|
+
children: [this.renderLinks(value), this.renderCheckList(value), this.renderImages(value), this.renderContent(value), isPreview && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalPortal.default, {
|
|
160
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LongTextPreview.default, {
|
|
161
|
+
className: previewClassName,
|
|
162
|
+
value: value,
|
|
163
|
+
formatterStyle: this.formatterStyle,
|
|
164
|
+
onMouseEnter: this.onPreviewMouseEnter,
|
|
165
|
+
onMouseLeave: this.onPreviewMouseLeave
|
|
166
|
+
})
|
|
167
|
+
})]
|
|
168
|
+
});
|
|
160
169
|
}
|
|
161
170
|
}
|
|
162
171
|
SimpleLongTextFormatter.defaultProps = {
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _dtableMarkdownViewer = _interopRequireDefault(require("./dtable-markdown-viewer"));
|
|
11
11
|
require("./longTextEditor.css");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
class LongTextPreview extends _react.default.PureComponent {
|
|
13
14
|
constructor(props) {
|
|
14
15
|
super(props);
|
|
@@ -74,18 +75,20 @@ class LongTextPreview extends _react.default.PureComponent {
|
|
|
74
75
|
value
|
|
75
76
|
} = this.props;
|
|
76
77
|
const markdownContent = value ? value.text : '';
|
|
77
|
-
return /*#__PURE__*/
|
|
78
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
78
79
|
className: (0, _classnames.default)('longtext-modal-dialog longtext-preview', className),
|
|
79
80
|
style: this.getStyle(),
|
|
80
81
|
ref: ref => this.ref = ref,
|
|
81
82
|
onMouseEnter: this.onMouseEnter,
|
|
82
|
-
onMouseLeave: this.onMouseLeave
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
onMouseLeave: this.onMouseLeave,
|
|
84
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
85
|
+
className: "longtext-container longtext-container-scroll",
|
|
86
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_dtableMarkdownViewer.default, {
|
|
87
|
+
markdownContent: markdownContent,
|
|
88
|
+
showTOC: false
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
});
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
var _default = exports.default = LongTextPreview;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _seafileEditor = require("@seafile/seafile-editor");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
// Windows old Wechat (3.0 or earlier) inner core is chrome 53 and don't support ECMA6, can't use seafile-editor markdownViewer
|
|
11
12
|
// Windows new Wechat (lastest version 3.3.5) support seafile-editor markdownViewer
|
|
12
13
|
// so use dangerouslySetInnerHTML to preview
|
|
@@ -43,7 +44,7 @@ class DtableMarkdownViewer extends _react.default.PureComponent {
|
|
|
43
44
|
}
|
|
44
45
|
render() {
|
|
45
46
|
if (this.isWindowsWechat) {
|
|
46
|
-
return /*#__PURE__*/
|
|
47
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
47
48
|
className: "long-text-container article",
|
|
48
49
|
dangerouslySetInnerHTML: {
|
|
49
50
|
__html: this.state.innerHtml
|
|
@@ -54,7 +55,7 @@ class DtableMarkdownViewer extends _react.default.PureComponent {
|
|
|
54
55
|
showTOC,
|
|
55
56
|
markdownContent
|
|
56
57
|
} = this.props;
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_seafileEditor.MarkdownViewer, {
|
|
58
59
|
value: markdownContent,
|
|
59
60
|
isShowOutline: showTOC
|
|
60
61
|
});
|
|
@@ -8,15 +8,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _selectEditor = _interopRequireDefault(require("../select-editor"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
const SingleSelectEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
12
13
|
let {
|
|
13
14
|
value: oldValue,
|
|
14
15
|
...props
|
|
15
16
|
} = _ref;
|
|
16
17
|
const value = oldValue ? [oldValue] : [];
|
|
17
|
-
return /*#__PURE__*/
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_selectEditor.default, {
|
|
19
|
+
...props,
|
|
18
20
|
value: value,
|
|
19
21
|
ref: ref
|
|
20
|
-
})
|
|
22
|
+
});
|
|
21
23
|
});
|
|
22
24
|
var _default = exports.default = SingleSelectEditor;
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _SelectItem = _interopRequireDefault(require("../SelectItem"));
|
|
11
11
|
require("./index.css");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
class SingleSelectFormatter extends _react.default.PureComponent {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
@@ -20,7 +21,7 @@ class SingleSelectFormatter extends _react.default.PureComponent {
|
|
|
20
21
|
} = this.props;
|
|
21
22
|
let option = options.find(item => item.id === value || item.name === value);
|
|
22
23
|
if (option) {
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectItem.default, {
|
|
24
25
|
option: option,
|
|
25
26
|
fontSize: fontSize
|
|
26
27
|
});
|
|
@@ -33,9 +34,10 @@ class SingleSelectFormatter extends _react.default.PureComponent {
|
|
|
33
34
|
value
|
|
34
35
|
} = this.props;
|
|
35
36
|
let classname = (0, _classnames.default)('dtable-ui cell-formatter-container single-select-formatter', containerClassName);
|
|
36
|
-
return /*#__PURE__*/
|
|
37
|
-
className: classname
|
|
38
|
-
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
38
|
+
className: classname,
|
|
39
|
+
children: value ? this.getOption() : ''
|
|
40
|
+
});
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
var _default = exports.default = SingleSelectFormatter;
|
package/lib/SvgIcon/index.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
require("./index.css");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
const iconComponents = {};
|
|
11
12
|
const requireContext = require.context('../assets/icons', false, /\.svg$/);
|
|
12
13
|
requireContext.keys().forEach(path => {
|
|
@@ -20,7 +21,7 @@ const SvgIcon = _ref => {
|
|
|
20
21
|
color
|
|
21
22
|
} = _ref;
|
|
22
23
|
if (!symbol) return null;
|
|
23
|
-
const iconClass =
|
|
24
|
+
const iconClass = `dtable-ui-multicolor-icon multicolor-icon-${symbol} ${className || ''}`;
|
|
24
25
|
const props = {
|
|
25
26
|
className: iconClass,
|
|
26
27
|
style: {
|
|
@@ -30,6 +31,8 @@ const SvgIcon = _ref => {
|
|
|
30
31
|
};
|
|
31
32
|
const IconComponent = iconComponents[symbol];
|
|
32
33
|
if (!IconComponent) return null;
|
|
33
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
34
37
|
};
|
|
35
38
|
var _default = exports.default = SvgIcon;
|
package/lib/TabBar/Tab.js
CHANGED
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _Badge = _interopRequireDefault(require("../Badge"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
class Tab extends React.PureComponent {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
@@ -22,22 +23,24 @@ class Tab extends React.PureComponent {
|
|
|
22
23
|
prefixCls
|
|
23
24
|
} = this.props;
|
|
24
25
|
const iconRes = selected ? selectedIcon : icon;
|
|
25
|
-
const iconDom = /*#__PURE__*/React.isValidElement(iconRes) ? iconRes : /*#__PURE__*/
|
|
26
|
-
className:
|
|
26
|
+
const iconDom = /*#__PURE__*/React.isValidElement(iconRes) ? iconRes : /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
27
|
+
className: `${prefixCls}-image`,
|
|
27
28
|
src: iconRes ? iconRes.uri : iconRes,
|
|
28
29
|
alt: title
|
|
29
30
|
});
|
|
30
31
|
if (badge) {
|
|
31
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Badge.default, {
|
|
32
33
|
text: badge,
|
|
33
|
-
className:
|
|
34
|
-
|
|
34
|
+
className: `${prefixCls}-badge tab-badge`,
|
|
35
|
+
children: [' ', iconDom, ' ']
|
|
36
|
+
});
|
|
35
37
|
}
|
|
36
38
|
if (dot) {
|
|
37
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default, {
|
|
38
40
|
dot: true,
|
|
39
|
-
className:
|
|
40
|
-
|
|
41
|
+
className: `${prefixCls}-badge tab-dot`,
|
|
42
|
+
children: iconDom
|
|
43
|
+
});
|
|
41
44
|
}
|
|
42
45
|
return iconDom;
|
|
43
46
|
};
|
|
@@ -57,20 +60,24 @@ class Tab extends React.PureComponent {
|
|
|
57
60
|
tintColor
|
|
58
61
|
} = this.props;
|
|
59
62
|
const iconColor = selected ? tintColor : unselectedTintColor;
|
|
60
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
64
|
+
...this.props.dataAttrs,
|
|
61
65
|
onClick: this.onClick,
|
|
62
|
-
className:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
className: `${prefixCls}`,
|
|
67
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
68
|
+
className: `${prefixCls}-icon`,
|
|
69
|
+
style: {
|
|
70
|
+
color: iconColor
|
|
71
|
+
},
|
|
72
|
+
children: this.renderIcon()
|
|
73
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
74
|
+
className: `${prefixCls}-title`,
|
|
75
|
+
style: {
|
|
76
|
+
color: selected ? tintColor : unselectedTintColor
|
|
77
|
+
},
|
|
78
|
+
children: title
|
|
79
|
+
})]
|
|
80
|
+
});
|
|
74
81
|
}
|
|
75
82
|
}
|
|
76
83
|
var _default = exports.default = Tab;
|
package/lib/TabBar/index.js
CHANGED
|
@@ -11,16 +11,18 @@ var _getDataAttr = _interopRequireDefault(require("../utils/getDataAttr"));
|
|
|
11
11
|
var _Tabs = _interopRequireDefault(require("../Tabs"));
|
|
12
12
|
var _Tab = _interopRequireDefault(require("./Tab"));
|
|
13
13
|
require("./index.css");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
class Item extends React.Component {
|
|
15
16
|
render() {
|
|
16
17
|
const {
|
|
17
18
|
prefixCls,
|
|
18
19
|
style
|
|
19
20
|
} = this.props;
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
21
22
|
className: prefixCls,
|
|
22
|
-
style: style
|
|
23
|
-
|
|
23
|
+
style: style,
|
|
24
|
+
children: this.props.children
|
|
25
|
+
});
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
exports.Item = Item;
|
|
@@ -53,9 +55,8 @@ class AntTabBar extends React.Component {
|
|
|
53
55
|
} = this.props;
|
|
54
56
|
const tabsData = this.getTabs();
|
|
55
57
|
const content = Array.isArray(tabsData) ? tabsData.map((cProps, index) => {
|
|
56
|
-
return /*#__PURE__*/
|
|
57
|
-
|
|
58
|
-
prefixCls: "".concat(this.props.prefixCls, "-tab"),
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
|
|
59
|
+
prefixCls: `${this.props.prefixCls}-tab`,
|
|
59
60
|
badge: cProps.badge,
|
|
60
61
|
dot: cProps.dot,
|
|
61
62
|
selected: cProps.selected,
|
|
@@ -66,18 +67,19 @@ class AntTabBar extends React.Component {
|
|
|
66
67
|
unselectedTintColor: unselectedTintColor,
|
|
67
68
|
dataAttrs: (0, _getDataAttr.default)(cProps),
|
|
68
69
|
onClick: () => cProps.onPress && cProps.onPress()
|
|
69
|
-
});
|
|
70
|
+
}, index);
|
|
70
71
|
}) : null;
|
|
71
|
-
let cls =
|
|
72
|
+
let cls = `${prefixCls}-bar`;
|
|
72
73
|
if (hidden) {
|
|
73
|
-
cls +=
|
|
74
|
+
cls += ` ${prefixCls}-bar-hidden-${tabBarPosition}`;
|
|
74
75
|
}
|
|
75
|
-
return /*#__PURE__*/
|
|
76
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
76
77
|
className: cls,
|
|
77
78
|
style: {
|
|
78
79
|
backgroundColor: barTintColor
|
|
79
|
-
}
|
|
80
|
-
|
|
80
|
+
},
|
|
81
|
+
children: content
|
|
82
|
+
});
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
85
|
render() {
|
|
@@ -99,18 +101,20 @@ class AntTabBar extends React.Component {
|
|
|
99
101
|
}
|
|
100
102
|
});
|
|
101
103
|
}
|
|
102
|
-
return /*#__PURE__*/
|
|
103
|
-
className: prefixCls
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
105
|
+
className: prefixCls,
|
|
106
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tabs.default, {
|
|
107
|
+
tabs: tabs,
|
|
108
|
+
renderTabBar: this.renderTabBar,
|
|
109
|
+
tabBarPosition: tabBarPosition,
|
|
110
|
+
page: activeIndex < 0 ? undefined : activeIndex,
|
|
111
|
+
animated: animated,
|
|
112
|
+
swipeable: swipeable,
|
|
113
|
+
noRenderContent: noRenderContent,
|
|
114
|
+
prerenderingSiblingsNumber: prerenderingSiblingsNumber,
|
|
115
|
+
children: children
|
|
116
|
+
})
|
|
117
|
+
});
|
|
114
118
|
}
|
|
115
119
|
}
|
|
116
120
|
AntTabBar.defaultProps = {
|
package/lib/Tabs/index.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.default = exports.DefaultTabBar = void 0;
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _rmcTabs = require("rmc-tabs");
|
|
10
10
|
require("./index.css");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
class DefaultTabBar extends _rmcTabs.DefaultTabBar {}
|
|
12
13
|
exports.DefaultTabBar = DefaultTabBar;
|
|
13
14
|
DefaultTabBar.defaultProps = {
|
|
@@ -21,15 +22,17 @@ class Tabs extends React.PureComponent {
|
|
|
21
22
|
const {
|
|
22
23
|
renderTab
|
|
23
24
|
} = this.props;
|
|
24
|
-
return /*#__PURE__*/
|
|
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__*/
|
|
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
|
@@ -11,6 +11,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
11
11
|
var _utils = require("../utils/utils");
|
|
12
12
|
var _constants = require("../constants");
|
|
13
13
|
var _cellComparer = require("../utils/cell-comparer");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
class TextEditor extends _react.Component {
|
|
15
16
|
constructor(props) {
|
|
16
17
|
super(props);
|
|
@@ -128,24 +129,26 @@ class TextEditor extends _react.Component {
|
|
|
128
129
|
const {
|
|
129
130
|
value
|
|
130
131
|
} = this.state;
|
|
131
|
-
return /*#__PURE__*/
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
132
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
133
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
134
|
+
type: "text",
|
|
135
|
+
className: (0, _classnames.default)('form-control', className),
|
|
136
|
+
ref: this.setInputRef,
|
|
137
|
+
placeholder: placeholder || '',
|
|
138
|
+
onBlur: this.onBlur,
|
|
139
|
+
onCut: this.onCut,
|
|
140
|
+
onPaste: this.onPaste,
|
|
141
|
+
value: value,
|
|
142
|
+
name: column.name,
|
|
143
|
+
title: column.name,
|
|
144
|
+
"aria-label": column.name,
|
|
145
|
+
onChange: this.onChange,
|
|
146
|
+
onKeyDown: this.onInputKeyDown,
|
|
147
|
+
onClick: this.onClick,
|
|
148
|
+
onCompositionStart: this.onCompositionStart,
|
|
149
|
+
onCompositionEnd: this.onCompositionEnd
|
|
150
|
+
})
|
|
151
|
+
});
|
|
149
152
|
}
|
|
150
153
|
}
|
|
151
154
|
var _default = exports.default = TextEditor;
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
require("./index.css");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
class TextFormatter extends _react.default.Component {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
@@ -28,10 +29,11 @@ class TextFormatter extends _react.default.Component {
|
|
|
28
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
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
32
33
|
className: classname,
|
|
33
|
-
title: formattedValue
|
|
34
|
-
|
|
34
|
+
title: formattedValue,
|
|
35
|
+
children: formattedValue
|
|
36
|
+
});
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
var _default = exports.default = TextFormatter;
|
|
@@ -11,6 +11,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _rmcFeedback = _interopRequireDefault(require("rmc-feedback"));
|
|
12
12
|
var _exenv = require("../utils/exenv");
|
|
13
13
|
require("./index.css");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
/* tslint:disable:jsx-no-multiline-js */
|
|
15
16
|
|
|
16
17
|
function noop() {}
|
|
@@ -34,7 +35,7 @@ class TextareaItem extends React.Component {
|
|
|
34
35
|
this.reAlignHeight = () => {
|
|
35
36
|
const textareaDom = this.textareaRef;
|
|
36
37
|
textareaDom.style.height = ''; // 字数减少时能自动减小高度
|
|
37
|
-
textareaDom.style.height =
|
|
38
|
+
textareaDom.style.height = `${textareaDom.scrollHeight}px`;
|
|
38
39
|
};
|
|
39
40
|
this.onChange = e => {
|
|
40
41
|
const value = e.target.value;
|
|
@@ -157,20 +158,20 @@ class TextareaItem extends React.Component {
|
|
|
157
158
|
focus
|
|
158
159
|
} = this.state;
|
|
159
160
|
const hasCount = count > 0 && this.props.rows > 1;
|
|
160
|
-
const wrapCls = (0, _classnames.default)(className,
|
|
161
|
-
[
|
|
162
|
-
[
|
|
163
|
-
[
|
|
164
|
-
[
|
|
165
|
-
[
|
|
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
|
|
166
167
|
});
|
|
167
|
-
const labelCls = (0, _classnames.default)(
|
|
168
|
-
[
|
|
169
|
-
[
|
|
170
|
-
[
|
|
171
|
-
[
|
|
172
|
-
[
|
|
173
|
-
[
|
|
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
|
|
174
175
|
});
|
|
175
176
|
const characterLength = countSymbols(value);
|
|
176
177
|
const lengthCtrlProps = {};
|
|
@@ -184,32 +185,40 @@ class TextareaItem extends React.Component {
|
|
|
184
185
|
lengthCtrlProps.maxLength = count - characterLength + (value ? value.length : 0);
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
|
-
return /*#__PURE__*/
|
|
188
|
-
className: wrapCls
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
188
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
189
|
+
className: wrapCls,
|
|
190
|
+
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
191
|
+
className: labelCls,
|
|
192
|
+
children: title
|
|
193
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
194
|
+
className: `${prefixCls}-control`,
|
|
195
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
|
|
196
|
+
ref: el => this.textareaRef = el,
|
|
197
|
+
...lengthCtrlProps,
|
|
198
|
+
...otherProps,
|
|
199
|
+
value: value,
|
|
200
|
+
onChange: this.onChange,
|
|
201
|
+
onBlur: this.onBlur,
|
|
202
|
+
onFocus: this.onFocus,
|
|
203
|
+
readOnly: !editable,
|
|
204
|
+
style: style
|
|
205
|
+
})
|
|
206
|
+
}), clear && editable && value && characterLength > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
|
|
207
|
+
activeClassName: `${prefixCls}-clear-active`,
|
|
208
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
209
|
+
className: `${prefixCls}-clear`,
|
|
210
|
+
onClick: this.clearInput
|
|
211
|
+
})
|
|
212
|
+
}), error && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
213
|
+
className: `${prefixCls}-error-extra`,
|
|
214
|
+
onClick: this.onErrorClick
|
|
215
|
+
}), hasCount && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
216
|
+
className: `${prefixCls}-count`,
|
|
217
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
218
|
+
children: value ? characterLength : 0
|
|
219
|
+
}), "/", count]
|
|
220
|
+
})]
|
|
221
|
+
});
|
|
213
222
|
}
|
|
214
223
|
}
|
|
215
224
|
exports.default = TextareaItem;
|