dtable-ui-component 6.0.126 → 7.0.0-xia.1
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 +16 -14
- package/lib/ActivityIndicator/index.js +8 -7
- package/lib/AsyncUserSelect/index.js +19 -40
- package/lib/AsyncUserSelect/user-item.js +6 -5
- package/lib/AutoNumberFormatter/index.js +4 -3
- package/lib/Badge/index.js +11 -9
- package/lib/ButtonFormatter/index.js +8 -6
- package/lib/CTimeFormatter/index.js +4 -3
- package/lib/CheckboxEditor/index.js +3 -1
- 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 +4 -2
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
- package/lib/CollaboratorEditor/pc-editor/index.js +34 -25
- package/lib/CollaboratorFormatter/index.js +10 -8
- package/lib/CollaboratorItem/index.js +5 -4
- package/lib/CollapsibleSettingLayout/index.js +7 -9
- package/lib/Comment/body/comment.js +18 -10
- package/lib/Comment/body/index.js +4 -2
- package/lib/Comment/footer/btns/index.js +7 -4
- package/lib/Comment/footer/index.js +20 -9
- package/lib/Comment/footer/input/index.js +50 -29
- package/lib/Comment/footer/input/participant/index.js +5 -4
- 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 +24 -8
- package/lib/Comment/index.js +57 -39
- package/lib/Comment/utils/utilities.js +21 -15
- package/lib/CreatorFormatter/index.js +8 -6
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +18 -22
- package/lib/DTableColorPicker/index.js +40 -55
- package/lib/DTableColorPicker/utils.js +6 -4
- package/lib/DTableColumnIcon/index.js +7 -6
- package/lib/DTableCommonAddTool/index.js +8 -6
- package/lib/DTableCustomFooter/index.js +3 -1
- package/lib/DTableCustomizeCollaboratorSelect/index.js +20 -17
- package/lib/DTableCustomizeSelect/index.js +24 -19
- package/lib/DTableDropdownItem/index.js +18 -16
- package/lib/DTableDropdownMenu/index.js +10 -8
- package/lib/DTableEmptyTip/index.js +5 -4
- package/lib/DTableFiltersPopover/index.js +50 -34
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
- package/lib/DTableFiltersPopover/utils/index.js +113 -63
- 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 +56 -35
- package/lib/DTableFiltersPopover/widgets/filter-item.js +171 -108
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +161 -136
- package/lib/DTableFiltersPopover/widgets/rate-item.js +20 -15
- package/lib/DTableGroupSelect/index.js +15 -11
- package/lib/DTableGroupSelect/select-option-group.js +32 -23
- package/lib/DTableIcon/index.js +7 -6
- package/lib/DTableIcon/svg-icon.js +7 -5
- package/lib/DTableModalHeader/index.css +3 -20
- package/lib/DTableModalHeader/index.js +3 -1
- package/lib/DTablePopover/index.js +15 -11
- package/lib/DTableRadio/index.js +9 -10
- package/lib/DTableRadioGroup/index.js +17 -8
- package/lib/DTableSearchInput/index.js +29 -19
- package/lib/DTableSelect/dtable-select-label.js +5 -6
- package/lib/DTableSelect/index.js +22 -21
- package/lib/DTableSelect/utils.js +15 -7
- package/lib/DTableSubDropdownMenu/index.js +10 -8
- package/lib/DTableSubDropdownToggle/index.js +12 -12
- package/lib/DTableSwitch/index.js +11 -12
- package/lib/DTableToolTip/index.js +8 -7
- package/lib/DateEditor/index.js +15 -20
- package/lib/DateEditor/mb-editor/index.js +31 -18
- package/lib/DateEditor/pc-editor.js +45 -26
- package/lib/DateFormatter/index.js +5 -4
- package/lib/DatePicker/index.js +15 -9
- package/lib/DatePicker/utils.js +3 -1
- package/lib/DeleteTip/index.js +6 -5
- package/lib/DepartmentMultipleSelectEditor/index.js +23 -25
- package/lib/DepartmentSelectFilter/index.js +8 -6
- package/lib/DepartmentSingleSelectEditor/index.js +3 -1
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +47 -48
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +58 -36
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
- package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
- package/lib/DigitalSignEditor/index.js +3 -1
- package/lib/DigitalSignEditor/mb-editor/index.js +20 -12
- package/lib/DigitalSignEditor/pc-editor/index.js +24 -17
- package/lib/DigitalSignEditor/service.js +4 -2
- package/lib/DigitalSignEditor/signature-board/index.js +8 -5
- package/lib/DigitalSignEditor/utils.js +4 -2
- package/lib/DigitalSignFormatter/index.js +15 -12
- package/lib/DigitalSignFormatter/utils.js +5 -4
- 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 +12 -12
- package/lib/FieldDisplaySetting/index.js +10 -12
- package/lib/FileEditor/files-previewer/index.js +3 -1
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +18 -10
- 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 +21 -14
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
- package/lib/FileEditor/index.js +3 -1
- package/lib/FileEditor/mb-editor/index.js +20 -28
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +3 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +25 -11
- package/lib/FileEditor/pc-editor/index.js +27 -19
- package/lib/FileFormatter/index.js +19 -26
- package/lib/FileItemFormatter/index.js +9 -6
- package/lib/FileUploader/index.js +45 -28
- package/lib/FormulaFormatter/index.js +29 -15
- package/lib/GeolocationEditor/index.js +12 -11
- package/lib/GeolocationEditor/map-editor-utils.js +15 -17
- package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/index.js +6 -4
- package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +68 -41
- 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 +23 -10
- package/lib/GeolocationEditor/pc-editor/index.js +20 -12
- package/lib/GeolocationEditor/pc-editor/location-editor.js +31 -26
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +54 -34
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +60 -36
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +62 -35
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +65 -36
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +25 -19
- package/lib/GeolocationEditor/pc-editor/province-editor.js +13 -6
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +7 -6
- package/lib/GeolocationFormatter/index.js +5 -4
- package/lib/HtmlLongTextFormatter/index.js +12 -4
- package/lib/Icon/index.js +5 -3
- package/lib/IconButton/index.js +6 -4
- package/lib/ImageEditor/images-previewer/image-preview/index.js +21 -12
- package/lib/ImageEditor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/index.js +3 -1
- 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 +3 -1
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +21 -7
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/pc-editor/index.js +16 -11
- package/lib/ImageFormatter/images-lazy-load.js +11 -19
- package/lib/ImageFormatter/index.js +13 -11
- package/lib/ImagePreviewerLightbox/index.js +13 -15
- package/lib/ImageThumbnail/index.js +13 -10
- package/lib/InputItem/custom-input.js +46 -26
- package/lib/InputItem/custom-keyboard.js +18 -15
- package/lib/InputItem/index.js +50 -34
- package/lib/InputItem/input.js +4 -2
- 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 +10 -5
- package/lib/LinkFormatter/index.js +37 -21
- package/lib/List/index.js +8 -6
- package/lib/List/list-item.js +28 -22
- package/lib/LongTextFormatter/index.js +5 -4
- package/lib/MBEditorHeader/index.js +8 -7
- package/lib/MTimeFormatter/index.js +4 -3
- package/lib/MobileFullScreenPage/body/index.js +5 -3
- package/lib/MobileFullScreenPage/header/index.js +6 -4
- package/lib/MobileFullScreenPage/index.js +11 -13
- package/lib/MobileModal/index.js +3 -1
- 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.js +3 -1
- package/lib/MobileSelector/search/index.js +5 -3
- package/lib/MobileUpload/index.js +5 -4
- package/lib/Modal/modal.js +15 -14
- package/lib/Modal/prompt.js +4 -4
- package/lib/MultipleSelectEditor/index.js +3 -1
- package/lib/MultipleSelectFormatter/index.js +8 -6
- 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 +4 -2
- package/lib/Picker/AbstractPicker.js +27 -23
- package/lib/Popover/index.js +4 -3
- package/lib/Popover/item.js +9 -7
- package/lib/Progress/index.js +8 -9
- package/lib/Radio/Radio.js +8 -4
- package/lib/Radio/RadioItem.js +12 -8
- package/lib/RateFormatter/index.js +13 -13
- package/lib/RoleStatusEditor/index.js +17 -18
- package/lib/RowExpandDialog/body/index.js +49 -32
- package/lib/RowExpandDialog/column-content/index.js +9 -5
- package/lib/RowExpandDialog/header/index.js +8 -6
- package/lib/RowExpandDialog/index.js +34 -49
- 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/mb-editor/index.js +33 -22
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
- 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/mb-editor.js +11 -16
- package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +34 -20
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +35 -21
- 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/mb-editor/index.js +19 -9
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +24 -13
- 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/mb-editor/index.js +29 -17
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +25 -15
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +23 -13
- package/lib/RowExpandEditor/index.js +8 -4
- 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/mb-editor/index.js +19 -11
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +33 -22
- 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/mb-editor.js +25 -12
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +36 -20
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +28 -17
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +34 -22
- 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/mb-editor/index.js +13 -5
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +18 -9
- 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 +7 -4
- package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +12 -10
- package/lib/RowExpandFormatter/formula-formatter/index.js +34 -19
- package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +8 -7
- package/lib/RowExpandFormatter/index.js +41 -27
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +14 -8
- package/lib/RowExpandFormatter/link-formatter/index.js +19 -11
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
- package/lib/RowExpandFormatter/rate-formatter/index.js +12 -11
- package/lib/RowExpandFormatter/text/index.js +5 -4
- package/lib/RowExpandFormatter/url-formatter/index.js +7 -4
- package/lib/RowExpandView/body/index.js +35 -22
- package/lib/RowExpandView/column-content/index.js +7 -3
- package/lib/RowExpandView/index.js +30 -42
- package/lib/SelectItem/index.js +8 -6
- package/lib/SelectOptionGroup/index.js +40 -30
- package/lib/SelectedDepartments/index.js +9 -7
- package/lib/SimpleLongTextFormatter/index.js +16 -10
- 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 +3 -1
- package/lib/SingleSelectFormatter/index.js +9 -8
- package/lib/TabBar/Tab.js +16 -14
- package/lib/TabBar/index.js +21 -18
- package/lib/Tabs/index.js +3 -1
- package/lib/TextEditor/index.js +23 -14
- package/lib/TextFormatter/index.js +4 -3
- package/lib/TextareaItem/index.js +26 -19
- package/lib/Toast/index.js +4 -3
- package/lib/UrlFormatter/index.js +4 -3
- package/lib/common/editor-base.js +12 -7
- package/lib/hooks/common-hooks.js +4 -2
- package/lib/select-editor/index.js +3 -1
- package/lib/select-editor/mb-editor/index.js +28 -17
- package/lib/select-editor/pc-editor/index.js +42 -27
- package/lib/toaster/alert.js +7 -6
- package/lib/toaster/toast.js +3 -2
- package/lib/toaster/toastManager.js +4 -2
- package/lib/utils/cell.js +11 -8
- package/lib/utils/column-utils.js +14 -8
- package/lib/utils/departments.js +3 -1
- package/lib/utils/url.js +31 -24
- package/lib/utils/utils.js +6 -2
- package/package.json +1 -1
|
@@ -50,7 +50,9 @@ class TextareaItem extends React.Component {
|
|
|
50
50
|
value
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const {
|
|
54
|
+
onChange
|
|
55
|
+
} = this.props;
|
|
54
56
|
if (onChange) {
|
|
55
57
|
onChange(value);
|
|
56
58
|
}
|
|
@@ -134,25 +136,30 @@ class TextareaItem extends React.Component {
|
|
|
134
136
|
}
|
|
135
137
|
render() {
|
|
136
138
|
const _this$props = this.props,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
139
|
+
{
|
|
140
|
+
prefixCls,
|
|
141
|
+
prefixListCls,
|
|
142
|
+
editable,
|
|
143
|
+
style,
|
|
144
|
+
clear,
|
|
145
|
+
children,
|
|
146
|
+
error,
|
|
147
|
+
className,
|
|
148
|
+
count,
|
|
149
|
+
labelNumber,
|
|
150
|
+
title,
|
|
151
|
+
onErrorClick,
|
|
152
|
+
autoHeight,
|
|
153
|
+
defaultValue
|
|
154
|
+
} = _this$props,
|
|
151
155
|
otherProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
const {
|
|
157
|
+
disabled
|
|
158
|
+
} = otherProps;
|
|
159
|
+
const {
|
|
160
|
+
value,
|
|
161
|
+
focus
|
|
162
|
+
} = this.state;
|
|
156
163
|
const hasCount = count > 0 && this.props.rows > 1;
|
|
157
164
|
const wrapCls = (0, _classnames.default)(className, "".concat(prefixListCls, "-item"), "".concat(prefixCls, "-item"), {
|
|
158
165
|
["".concat(prefixCls, "-disabled")]: disabled,
|
package/lib/Toast/index.js
CHANGED
|
@@ -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
|
}
|
|
@@ -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)) {
|
|
@@ -15,7 +15,9 @@ var _mbEditor = _interopRequireDefault(require("./mb-editor"));
|
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
const _excluded = ["isMobile"];
|
|
17
17
|
const SelectEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
18
|
-
let
|
|
18
|
+
let {
|
|
19
|
+
isMobile
|
|
20
|
+
} = _ref,
|
|
19
21
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
20
22
|
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
21
23
|
ref: ref
|
|
@@ -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, {
|
|
@@ -38,7 +38,9 @@ class PCSelectEditor extends _react.default.Component {
|
|
|
38
38
|
this.onEnter = e => {
|
|
39
39
|
e.preventDefault();
|
|
40
40
|
let option;
|
|
41
|
-
const
|
|
41
|
+
const {
|
|
42
|
+
isSupportNewOption
|
|
43
|
+
} = this.props;
|
|
42
44
|
if (this.filteredOptions.length === 1) {
|
|
43
45
|
option = this.filteredOptions[0];
|
|
44
46
|
} else if (this.state.highlightIndex > -1) {
|
|
@@ -47,7 +49,9 @@ class PCSelectEditor extends _react.default.Component {
|
|
|
47
49
|
if (option) {
|
|
48
50
|
this.onChange(option);
|
|
49
51
|
} else {
|
|
50
|
-
const
|
|
52
|
+
const {
|
|
53
|
+
searchValue
|
|
54
|
+
} = this.state;
|
|
51
55
|
if (searchValue && isSupportNewOption && this.filteredOptions.length === 0) {
|
|
52
56
|
e.stopPropagation();
|
|
53
57
|
this.onAddNewOption();
|
|
@@ -57,10 +61,11 @@ class PCSelectEditor extends _react.default.Component {
|
|
|
57
61
|
this.onUpArrow = e => {
|
|
58
62
|
e.preventDefault();
|
|
59
63
|
e.stopPropagation();
|
|
60
|
-
let
|
|
61
|
-
highlightIndex
|
|
62
|
-
maxItemNum
|
|
63
|
-
itemHeight
|
|
64
|
+
let {
|
|
65
|
+
highlightIndex,
|
|
66
|
+
maxItemNum,
|
|
67
|
+
itemHeight
|
|
68
|
+
} = this.state;
|
|
64
69
|
if (highlightIndex > 0) {
|
|
65
70
|
this.setState({
|
|
66
71
|
highlightIndex: highlightIndex - 1
|
|
@@ -74,10 +79,11 @@ class PCSelectEditor extends _react.default.Component {
|
|
|
74
79
|
this.onDownArrow = e => {
|
|
75
80
|
e.preventDefault();
|
|
76
81
|
e.stopPropagation();
|
|
77
|
-
let
|
|
78
|
-
highlightIndex
|
|
79
|
-
maxItemNum
|
|
80
|
-
itemHeight
|
|
82
|
+
let {
|
|
83
|
+
highlightIndex,
|
|
84
|
+
maxItemNum,
|
|
85
|
+
itemHeight
|
|
86
|
+
} = this.state;
|
|
81
87
|
if (highlightIndex < this.filteredOptions.length - 1) {
|
|
82
88
|
this.setState({
|
|
83
89
|
highlightIndex: highlightIndex + 1
|
|
@@ -89,8 +95,12 @@ class PCSelectEditor extends _react.default.Component {
|
|
|
89
95
|
}
|
|
90
96
|
};
|
|
91
97
|
this.onValueChanged = searchValue => {
|
|
92
|
-
const
|
|
93
|
-
|
|
98
|
+
const {
|
|
99
|
+
searchValue: oldSearchVal
|
|
100
|
+
} = this.state;
|
|
101
|
+
const {
|
|
102
|
+
options
|
|
103
|
+
} = this.props;
|
|
94
104
|
if (oldSearchVal === searchValue) return;
|
|
95
105
|
this.setState({
|
|
96
106
|
searchValue
|
|
@@ -123,7 +133,9 @@ class PCSelectEditor extends _react.default.Component {
|
|
|
123
133
|
}, 300);
|
|
124
134
|
};
|
|
125
135
|
this.getOptionStyle = option => {
|
|
126
|
-
const
|
|
136
|
+
const {
|
|
137
|
+
optionWidth
|
|
138
|
+
} = this.props;
|
|
127
139
|
const textColor = option.textColor || null;
|
|
128
140
|
return {
|
|
129
141
|
display: 'inline-block',
|
|
@@ -167,8 +179,9 @@ class PCSelectEditor extends _react.default.Component {
|
|
|
167
179
|
this.ref.style.top = '-200px';
|
|
168
180
|
}
|
|
169
181
|
}
|
|
170
|
-
const
|
|
171
|
-
bottom
|
|
182
|
+
const {
|
|
183
|
+
bottom
|
|
184
|
+
} = this.ref.getBoundingClientRect();
|
|
172
185
|
if (bottom > window.innerHeight) {
|
|
173
186
|
this.ref.style.top = parseInt(this.ref.style.top) - bottom + window.innerHeight + 'px';
|
|
174
187
|
}
|
|
@@ -188,18 +201,20 @@ class PCSelectEditor extends _react.default.Component {
|
|
|
188
201
|
}
|
|
189
202
|
}
|
|
190
203
|
render() {
|
|
191
|
-
const
|
|
192
|
-
isInModal
|
|
193
|
-
className
|
|
194
|
-
value
|
|
195
|
-
column
|
|
196
|
-
valueKey
|
|
197
|
-
isSupportNewOption
|
|
198
|
-
target
|
|
199
|
-
classNamePrefix
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
const {
|
|
205
|
+
isInModal,
|
|
206
|
+
className,
|
|
207
|
+
value,
|
|
208
|
+
column,
|
|
209
|
+
valueKey,
|
|
210
|
+
isSupportNewOption,
|
|
211
|
+
target,
|
|
212
|
+
classNamePrefix
|
|
213
|
+
} = this.props;
|
|
214
|
+
const {
|
|
215
|
+
searchValue,
|
|
216
|
+
highlightIndex
|
|
217
|
+
} = this.state;
|
|
203
218
|
|
|
204
219
|
// maxWidth = single-selects-container's width - single-selects-container's padding-left and padding-right - single-select-container's padding-left - single-select-check-icon's width - The gap between the single-select-check-icon and single-select-name or scroll's width
|
|
205
220
|
// maxWidth = column.width > 200 ? column.width - 20 - 12 - 20 - 10 : 200 - 20 - 12 - 20 - 10
|
package/lib/toaster/alert.js
CHANGED
|
@@ -23,12 +23,13 @@ class Alert extends _react.default.PureComponent {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
const
|
|
27
|
-
intent
|
|
28
|
-
title
|
|
29
|
-
children
|
|
30
|
-
isRemovable
|
|
31
|
-
onRemove
|
|
26
|
+
const {
|
|
27
|
+
intent,
|
|
28
|
+
title,
|
|
29
|
+
children,
|
|
30
|
+
isRemovable,
|
|
31
|
+
onRemove
|
|
32
|
+
} = this.props;
|
|
32
33
|
const iconClass = this.getIconClass(intent);
|
|
33
34
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
34
35
|
className: "dtable-toast-alert-container ".concat(intent || 'success'),
|
package/lib/toaster/toast.js
CHANGED
|
@@ -52,8 +52,9 @@ class Toast extends _react.default.PureComponent {
|
|
|
52
52
|
this.onRef = ref => {
|
|
53
53
|
if (ref === null) return;
|
|
54
54
|
setTimeout(() => {
|
|
55
|
-
const
|
|
56
|
-
height
|
|
55
|
+
const {
|
|
56
|
+
height
|
|
57
|
+
} = ref.getBoundingClientRect();
|
|
57
58
|
this.containerRef.current.style.height = height + 'px';
|
|
58
59
|
}, 1);
|
|
59
60
|
};
|
|
@@ -97,8 +97,10 @@ class ToastManager extends _react.default.PureComponent {
|
|
|
97
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
98
98
|
className: "dtable-toast-manager",
|
|
99
99
|
children: this.state.toasts.map(_ref => {
|
|
100
|
-
let
|
|
101
|
-
|
|
100
|
+
let {
|
|
101
|
+
id,
|
|
102
|
+
description
|
|
103
|
+
} = _ref,
|
|
102
104
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
103
105
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_toast.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
104
106
|
onRemove: () => this.removeToast(id)
|
package/lib/utils/cell.js
CHANGED
|
@@ -7,9 +7,10 @@ exports.isValidPosition = exports.isLongTextValueExceedLimit = exports.checkValu
|
|
|
7
7
|
var _constants = require("../constants");
|
|
8
8
|
var _utils = require("./utils");
|
|
9
9
|
const checkValueConformityFormat = (columnData, value) => {
|
|
10
|
-
const
|
|
11
|
-
format_specification_value
|
|
12
|
-
format_check_type
|
|
10
|
+
const {
|
|
11
|
+
format_specification_value,
|
|
12
|
+
format_check_type
|
|
13
|
+
} = columnData || {};
|
|
13
14
|
let isMatched = false;
|
|
14
15
|
if (format_check_type !== 'custom_format') {
|
|
15
16
|
const reg = _constants.FORMAT_REG_EXP_LIST[format_check_type];
|
|
@@ -22,9 +23,10 @@ const checkValueConformityFormat = (columnData, value) => {
|
|
|
22
23
|
};
|
|
23
24
|
exports.checkValueConformityFormat = checkValueConformityFormat;
|
|
24
25
|
const checkNumberValidation = (columnData, value) => {
|
|
25
|
-
const
|
|
26
|
-
format_max_value
|
|
27
|
-
format_min_value
|
|
26
|
+
const {
|
|
27
|
+
format_max_value,
|
|
28
|
+
format_min_value
|
|
29
|
+
} = columnData || {};
|
|
28
30
|
const num = parseFloat(value);
|
|
29
31
|
if (isNaN(num) || !num && num !== 0) {
|
|
30
32
|
return false;
|
|
@@ -41,8 +43,9 @@ exports.checkNumberValidation = checkNumberValidation;
|
|
|
41
43
|
const isLongTextValueExceedLimit = value => {
|
|
42
44
|
if (!value) return false;
|
|
43
45
|
if (typeof value === 'string') return value.length >= _constants.LONG_TEXT_LENGTH_LIMIT;
|
|
44
|
-
const
|
|
45
|
-
text
|
|
46
|
+
const {
|
|
47
|
+
text
|
|
48
|
+
} = value || {};
|
|
46
49
|
return text ? text.length >= _constants.LONG_TEXT_LENGTH_LIMIT : false;
|
|
47
50
|
};
|
|
48
51
|
exports.isLongTextValueExceedLimit = isLongTextValueExceedLimit;
|
|
@@ -9,9 +9,12 @@ exports.isEnableCheckFormat = void 0;
|
|
|
9
9
|
var _dtableUtils = require("dtable-utils");
|
|
10
10
|
const isEnableCheckFormat = column => {
|
|
11
11
|
if (!column) return false;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const {
|
|
13
|
+
data
|
|
14
|
+
} = column;
|
|
15
|
+
const {
|
|
16
|
+
enable_check_format
|
|
17
|
+
} = data || {};
|
|
15
18
|
if (enable_check_format) return true;
|
|
16
19
|
return false;
|
|
17
20
|
};
|
|
@@ -23,12 +26,15 @@ const getDateColumnFormat = column => {
|
|
|
23
26
|
};
|
|
24
27
|
exports.getDateColumnFormat = getDateColumnFormat;
|
|
25
28
|
function isCheckboxColumn(column) {
|
|
26
|
-
let
|
|
27
|
-
|
|
29
|
+
let {
|
|
30
|
+
type,
|
|
31
|
+
data
|
|
32
|
+
} = column;
|
|
28
33
|
if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type]) {
|
|
29
|
-
const
|
|
30
|
-
result_type
|
|
31
|
-
array_type
|
|
34
|
+
const {
|
|
35
|
+
result_type,
|
|
36
|
+
array_type
|
|
37
|
+
} = data || {};
|
|
32
38
|
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY) {
|
|
33
39
|
return array_type === _dtableUtils.CellType.CHECKBOX;
|
|
34
40
|
}
|
package/lib/utils/departments.js
CHANGED
|
@@ -11,7 +11,9 @@ const searchDepartments = (departments, searchValue) => {
|
|
|
11
11
|
const validDepartments = Array.isArray(departments) ? departments : [];
|
|
12
12
|
if (!validSearchValue) return validDepartments;
|
|
13
13
|
return validDepartments.filter(department => {
|
|
14
|
-
const
|
|
14
|
+
const {
|
|
15
|
+
name
|
|
16
|
+
} = department;
|
|
15
17
|
if (!name) return false;
|
|
16
18
|
return name.toString().toLowerCase().indexOf(validSearchValue) > -1;
|
|
17
19
|
});
|
package/lib/utils/url.js
CHANGED
|
@@ -71,11 +71,13 @@ const needUseThumbnailImage = url => {
|
|
|
71
71
|
exports.needUseThumbnailImage = needUseThumbnailImage;
|
|
72
72
|
const generateCurrentBaseImageThumbnailUrl = _ref => {
|
|
73
73
|
var _window2;
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
let {
|
|
75
|
+
server,
|
|
76
|
+
workspaceID,
|
|
77
|
+
dtableUuid,
|
|
78
|
+
partUrl,
|
|
79
|
+
size
|
|
80
|
+
} = _ref;
|
|
79
81
|
const validServer = server || ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.dtable) && window.dtable.server || '';
|
|
80
82
|
if (!partUrl || typeof partUrl !== 'string') return '';
|
|
81
83
|
let url = "".concat(validServer, "/thumbnail/workspace/").concat(workspaceID, "/asset/").concat(dtableUuid).concat(partUrl);
|
|
@@ -85,10 +87,12 @@ const generateCurrentBaseImageThumbnailUrl = _ref => {
|
|
|
85
87
|
exports.generateCurrentBaseImageThumbnailUrl = generateCurrentBaseImageThumbnailUrl;
|
|
86
88
|
const generateCurrentBaseImageUrl = _ref2 => {
|
|
87
89
|
var _window3;
|
|
88
|
-
let
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
let {
|
|
91
|
+
server,
|
|
92
|
+
workspaceID,
|
|
93
|
+
dtableUuid,
|
|
94
|
+
partUrl
|
|
95
|
+
} = _ref2;
|
|
92
96
|
if (!partUrl || typeof partUrl !== 'string') return '';
|
|
93
97
|
if (partUrl.startsWith('http')) return partUrl;
|
|
94
98
|
const validServer = server || ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.dtable) && window.dtable.server || '';
|
|
@@ -96,12 +100,12 @@ const generateCurrentBaseImageUrl = _ref2 => {
|
|
|
96
100
|
};
|
|
97
101
|
exports.generateCurrentBaseImageUrl = generateCurrentBaseImageUrl;
|
|
98
102
|
const getImageThumbnailUrl = function (url) {
|
|
99
|
-
let
|
|
100
|
-
server
|
|
101
|
-
dtableUuid
|
|
102
|
-
workspaceID
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
let {
|
|
104
|
+
server,
|
|
105
|
+
dtableUuid,
|
|
106
|
+
workspaceID,
|
|
107
|
+
size = 256
|
|
108
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
105
109
|
if (!url || typeof url !== 'string') return '';
|
|
106
110
|
if (server && dtableUuid && isCustomAssetUrl(url)) {
|
|
107
111
|
const assetUuid = url.slice(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));
|
|
@@ -145,9 +149,9 @@ const imageCheck = filename => {
|
|
|
145
149
|
};
|
|
146
150
|
exports.imageCheck = imageCheck;
|
|
147
151
|
const isInternalURL = function (url) {
|
|
148
|
-
let
|
|
149
|
-
|
|
150
|
-
|
|
152
|
+
let {
|
|
153
|
+
server = ''
|
|
154
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
151
155
|
if (!url || typeof url !== 'string') return false;
|
|
152
156
|
return server && url.indexOf(server) > -1;
|
|
153
157
|
};
|
|
@@ -156,8 +160,10 @@ const getValidFileImageUrls = files => {
|
|
|
156
160
|
if (!Array.isArray(files)) return [];
|
|
157
161
|
return files.map(file => {
|
|
158
162
|
if (typeof file !== 'object') return null;
|
|
159
|
-
const
|
|
160
|
-
|
|
163
|
+
const {
|
|
164
|
+
url,
|
|
165
|
+
name
|
|
166
|
+
} = file;
|
|
161
167
|
if (!url || url.indexOf('/asset') < 0) return null;
|
|
162
168
|
return imageCheck(name) ? url : null;
|
|
163
169
|
}).filter(Boolean);
|
|
@@ -182,10 +188,11 @@ const getFileIconUrl = (filename, direntType) => {
|
|
|
182
188
|
};
|
|
183
189
|
exports.getFileIconUrl = getFileIconUrl;
|
|
184
190
|
const getFileThumbnailInfo = function (file) {
|
|
185
|
-
let
|
|
186
|
-
server
|
|
187
|
-
dtableUuid
|
|
188
|
-
workspaceID
|
|
191
|
+
let {
|
|
192
|
+
server,
|
|
193
|
+
dtableUuid,
|
|
194
|
+
workspaceID
|
|
195
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
189
196
|
const defaultIcon = _file.FILEEXT_ICON_MAP['default'];
|
|
190
197
|
const defaultIconUrl = _file.FILEEXT_ICON_URL_MAP[defaultIcon];
|
|
191
198
|
if (!file || !file.name) return {
|
package/lib/utils/utils.js
CHANGED
|
@@ -163,12 +163,16 @@ const getFormulaArrayValue = value => {
|
|
|
163
163
|
return item;
|
|
164
164
|
}
|
|
165
165
|
if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
|
|
166
|
-
const
|
|
166
|
+
const {
|
|
167
|
+
display_value
|
|
168
|
+
} = item;
|
|
167
169
|
if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
|
|
168
170
|
return display_value.map(i => {
|
|
169
171
|
if (Object.prototype.toString.call(i) === '[object Object]') {
|
|
170
172
|
if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
|
|
171
|
-
const
|
|
173
|
+
const {
|
|
174
|
+
display_value
|
|
175
|
+
} = i;
|
|
172
176
|
return display_value;
|
|
173
177
|
}
|
|
174
178
|
return i;
|