dtable-ui-component 4.4.4 → 4.4.6
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/AutoNumberFormatter/index.js +14 -7
- package/lib/ButtonFormatter/index.js +16 -9
- package/lib/CTimeFormatter/index.js +16 -9
- package/lib/CheckboxEditor/index.js +15 -8
- package/lib/CheckboxFormatter/index.js +15 -8
- package/lib/CollaboratorEditor/index.js +29 -21
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +32 -25
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +25 -18
- package/lib/CollaboratorFormatter/index.js +19 -12
- package/lib/CollaboratorItem/index.js +17 -10
- package/lib/CreatorFormatter/index.js +19 -12
- package/lib/DTableCommonAddTool/index.js +13 -6
- package/lib/DTableCustomizeCollaboratorSelect/index.js +26 -18
- package/lib/DTableCustomizeSelect/index.js +23 -15
- package/lib/DTableFiltersPopover/constants/index.js +38 -33
- package/lib/DTableFiltersPopover/index.js +38 -31
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +53 -46
- package/lib/DTableFiltersPopover/utils/index.js +128 -99
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +34 -26
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +33 -25
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +34 -26
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +34 -26
- package/lib/DTableFiltersPopover/widgets/filter-item.js +128 -120
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +26 -18
- package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -8
- package/lib/DTablePopover/index.js +15 -8
- package/lib/DTablePopover/utils.js +9 -2
- package/lib/DTableRadio/index.js +17 -10
- package/lib/DTableSearchInput/index.js +21 -13
- package/lib/DTableSearchInput/utils.js +9 -2
- package/lib/DTableSelect/dtable-select-label.js +13 -6
- package/lib/DTableSelect/index.js +18 -10
- package/lib/DTableSelect/utils.js +20 -10
- package/lib/DTableSwitch/index.js +14 -7
- package/lib/DateEditor/index.js +30 -22
- package/lib/DateEditor/mb-date-editor-popover/index.js +55 -47
- package/lib/DateEditor/pc-date-editor-popover.js +27 -20
- package/lib/DateFormatter/index.js +16 -9
- package/lib/Department-editor/constants.js +7 -1
- package/lib/Department-editor/department-multiple-select/index.js +32 -24
- package/lib/Department-editor/department-single-select.js +41 -33
- package/lib/Department-editor/index.js +22 -14
- package/lib/Department-editor/selected-departments/index.js +32 -25
- package/lib/Department-editor/utils.js +11 -3
- package/lib/DepartmentSingleSelectFormatter/index.js +16 -9
- package/lib/DigitalSignFormatter/index.js +23 -15
- package/lib/DigitalSignFormatter/utils.js +11 -3
- package/lib/DurationFormatter/index.js +16 -9
- package/lib/EditEditorButton/index.js +12 -5
- package/lib/EmailFormatter/index.js +14 -7
- package/lib/FieldDisplaySetting/field-item.js +21 -14
- package/lib/FieldDisplaySetting/index.js +27 -19
- package/lib/FileEditor/index.js +15 -8
- package/lib/FileEditor/pc-files-addition/index.js +1 -0
- package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +1 -0
- package/lib/FileEditor/pc-files-preview/index.js +1 -0
- package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +1 -0
- package/lib/FileFormatter/index.js +19 -11
- package/lib/FileItemFormatter/index.js +14 -6
- package/lib/FileItemFormatter/utils.js +9 -2
- package/lib/FileUploader/index.js +11 -4
- package/lib/FormulaFormatter/cell-value-validator.js +24 -18
- package/lib/FormulaFormatter/index.js +39 -32
- package/lib/FormulaFormatter/utils.js +29 -13
- package/lib/GeolocationFormatter/index.js +16 -9
- package/lib/HtmlLongTextFormatter/index.js +17 -9
- package/lib/ImageFormatter/images-lazy-load.js +16 -9
- package/lib/ImageFormatter/index.js +24 -16
- package/lib/ImageFormatter/utils.js +9 -2
- package/lib/ImagePreviewerLightbox/index.js +19 -12
- package/lib/ImagePreviewerLightbox/utils.js +11 -3
- package/lib/LastModifierFormatter/index.js +19 -12
- package/lib/LinkEditor/index.js +33 -25
- package/lib/LinkEditor/link-editor-option.js +15 -8
- package/lib/LinkEditor/mb-link-editor-popover/index.js +30 -23
- package/lib/LinkEditor/pc-link-editor-popover/index.js +24 -17
- package/lib/LinkFormatter/index.js +20 -13
- package/lib/Loading/index.js +11 -4
- package/lib/LongTextFormatter/index.js +13 -6
- package/lib/MBEditorHeader/index.js +14 -7
- package/lib/MTimeFormatter/index.js +16 -9
- package/lib/ModalPortal/index.js +12 -5
- package/lib/MultipleSelectEditor/index.js +25 -17
- package/lib/MultipleSelectFormatter/index.js +17 -10
- package/lib/NotificationPopover/index.js +24 -16
- package/lib/NumberEditor/index.js +25 -18
- package/lib/NumberFormatter/index.js +16 -9
- package/lib/RateFormatter/index.js +15 -8
- package/lib/RoleStatusEditor/index.js +22 -14
- package/lib/RowExpandEmailFormatter/index.js +17 -10
- package/lib/RowExpandFileFormatter/index.js +16 -8
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +27 -18
- package/lib/RowExpandFormatter/index.js +86 -78
- package/lib/RowExpandFormulaFormatter/index.js +42 -34
- package/lib/RowExpandImageFormatter/index.js +19 -10
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +27 -18
- package/lib/RowExpandImageFormatter/utils.js +9 -2
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +16 -7
- package/lib/RowExpandLinkFormatter/index.js +46 -37
- package/lib/RowExpandLinkFormatter/utils.js +17 -6
- package/lib/RowExpandLinkFormatter/value-display-utils.js +12 -5
- package/lib/RowExpandRateFormatter/index.js +15 -8
- package/lib/RowExpandUrlFormatter/index.js +21 -14
- package/lib/SelectItem/index.js +12 -4
- package/lib/SelectOptionGroup/KeyCodes.js +7 -1
- package/lib/SelectOptionGroup/index.js +28 -20
- package/lib/SelectOptionGroup/option.js +11 -4
- package/lib/SimpleLongTextFormatter/index.js +27 -20
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +7 -1
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +15 -8
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +14 -7
- package/lib/SingleSelectEditor/index.js +26 -18
- package/lib/SingleSelectFormatter/index.js +16 -9
- package/lib/TextEditor/index.js +14 -7
- package/lib/TextFormatter/index.js +14 -7
- package/lib/UrlFormatter/index.js +14 -7
- package/lib/cellFormatterFactory/index.js +11 -4
- package/lib/common/ClickOutside.js +12 -4
- package/lib/common/delete-tip.js +20 -12
- package/lib/common/modal-portal.js +13 -5
- package/lib/constants/index.js +28 -9
- package/lib/css/mb-cell-editor.css +1 -1
- package/lib/data/dtable-value.js +11 -6
- package/lib/formatterConfig/base-formatter-config.js +53 -46
- package/lib/formatterConfig/index.js +16 -9
- package/lib/hooks/common-hooks.js +11 -4
- package/lib/index.js +432 -75
- package/lib/lang/index.js +24 -13
- package/lib/locals/de.js +7 -1
- package/lib/locals/en.js +7 -1
- package/lib/locals/fr.js +7 -1
- package/lib/locals/zh-CN.js +7 -1
- package/lib/select-editor/index.js +27 -4
- package/lib/select-editor/mb-select-editor-popover/index.js +41 -33
- package/lib/select-editor/pc-select-editor-popover/index.js +26 -19
- package/lib/select-editor/select-editor-option.js +15 -8
- package/lib/toaster/alert.js +18 -11
- package/lib/toaster/index.js +10 -3
- package/lib/toaster/toast.js +16 -8
- package/lib/toaster/toastManager.js +13 -5
- package/lib/toaster/toaster.js +15 -7
- package/lib/utils/dayjs.js +11 -4
- package/lib/utils/editor-utils.js +15 -5
- package/lib/utils/event-bus.js +7 -1
- package/lib/utils/utils.js +17 -6
- package/package.json +80 -68
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _dtableUtils = require("dtable-utils");
|
|
10
|
+
var _lang = require("../../lang");
|
|
4
11
|
class FilterItemUtils {
|
|
5
12
|
static generatorColumnOption(column) {
|
|
6
13
|
if (!column) return null;
|
|
@@ -12,11 +19,11 @@ class FilterItemUtils {
|
|
|
12
19
|
value: {
|
|
13
20
|
column
|
|
14
21
|
},
|
|
15
|
-
label: /*#__PURE__*/
|
|
22
|
+
label: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
16
23
|
className: "filter-header-icon"
|
|
17
|
-
}, /*#__PURE__*/
|
|
18
|
-
className: COLUMNS_ICON_CONFIG[type]
|
|
19
|
-
})), /*#__PURE__*/
|
|
24
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
25
|
+
className: _dtableUtils.COLUMNS_ICON_CONFIG[type]
|
|
26
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
20
27
|
className: "select-option-name"
|
|
21
28
|
}, name))
|
|
22
29
|
};
|
|
@@ -26,40 +33,40 @@ class FilterItemUtils {
|
|
|
26
33
|
value: {
|
|
27
34
|
filterPredicate
|
|
28
35
|
},
|
|
29
|
-
label: /*#__PURE__*/
|
|
36
|
+
label: /*#__PURE__*/_react.default.createElement("span", {
|
|
30
37
|
className: "select-option-name"
|
|
31
|
-
}, getLocale(filterPredicate))
|
|
38
|
+
}, (0, _lang.getLocale)(filterPredicate))
|
|
32
39
|
};
|
|
33
40
|
}
|
|
34
41
|
static generatorTermModifierOption(filterTermModifier) {
|
|
35
42
|
const FILTER_TERM_MODIFIER_SHOW = {
|
|
36
|
-
'today': getLocale('today'),
|
|
37
|
-
'tomorrow': getLocale('tomorrow'),
|
|
38
|
-
'yesterday': getLocale('yesterday'),
|
|
39
|
-
'one_week_ago': getLocale('one_week_ago'),
|
|
40
|
-
'one_week_from_now': getLocale('one_week_from_now'),
|
|
41
|
-
'one_month_ago': getLocale('one_month_ago'),
|
|
42
|
-
'one_month_from_now': getLocale('one_month_from_now'),
|
|
43
|
-
'number_of_days_ago': getLocale('number_of_days_ago'),
|
|
44
|
-
'number_of_days_from_now': getLocale('number_of_days_from_now'),
|
|
45
|
-
'exact_date': getLocale('exact_date'),
|
|
46
|
-
'the_past_week': getLocale('last_week'),
|
|
47
|
-
'the_past_month': getLocale('last_month'),
|
|
48
|
-
'the_past_year': getLocale('last_year'),
|
|
49
|
-
'the_next_week': getLocale('the_next_week'),
|
|
50
|
-
'the_next_month': getLocale('the_next_month'),
|
|
51
|
-
'the_next_year': getLocale('the_next_year'),
|
|
52
|
-
'the_next_numbers_of_days': getLocale('the_next_numbers_of_days'),
|
|
53
|
-
'the_past_numbers_of_days': getLocale('the_past_numbers_of_days'),
|
|
54
|
-
'this_week': getLocale('this_week'),
|
|
55
|
-
'this_month': getLocale('this_month'),
|
|
56
|
-
'this_year': getLocale('this_year')
|
|
43
|
+
'today': (0, _lang.getLocale)('today'),
|
|
44
|
+
'tomorrow': (0, _lang.getLocale)('tomorrow'),
|
|
45
|
+
'yesterday': (0, _lang.getLocale)('yesterday'),
|
|
46
|
+
'one_week_ago': (0, _lang.getLocale)('one_week_ago'),
|
|
47
|
+
'one_week_from_now': (0, _lang.getLocale)('one_week_from_now'),
|
|
48
|
+
'one_month_ago': (0, _lang.getLocale)('one_month_ago'),
|
|
49
|
+
'one_month_from_now': (0, _lang.getLocale)('one_month_from_now'),
|
|
50
|
+
'number_of_days_ago': (0, _lang.getLocale)('number_of_days_ago'),
|
|
51
|
+
'number_of_days_from_now': (0, _lang.getLocale)('number_of_days_from_now'),
|
|
52
|
+
'exact_date': (0, _lang.getLocale)('exact_date'),
|
|
53
|
+
'the_past_week': (0, _lang.getLocale)('last_week'),
|
|
54
|
+
'the_past_month': (0, _lang.getLocale)('last_month'),
|
|
55
|
+
'the_past_year': (0, _lang.getLocale)('last_year'),
|
|
56
|
+
'the_next_week': (0, _lang.getLocale)('the_next_week'),
|
|
57
|
+
'the_next_month': (0, _lang.getLocale)('the_next_month'),
|
|
58
|
+
'the_next_year': (0, _lang.getLocale)('the_next_year'),
|
|
59
|
+
'the_next_numbers_of_days': (0, _lang.getLocale)('the_next_numbers_of_days'),
|
|
60
|
+
'the_past_numbers_of_days': (0, _lang.getLocale)('the_past_numbers_of_days'),
|
|
61
|
+
'this_week': (0, _lang.getLocale)('this_week'),
|
|
62
|
+
'this_month': (0, _lang.getLocale)('this_month'),
|
|
63
|
+
'this_year': (0, _lang.getLocale)('this_year')
|
|
57
64
|
};
|
|
58
65
|
return {
|
|
59
66
|
value: {
|
|
60
67
|
filterTermModifier
|
|
61
68
|
},
|
|
62
|
-
label: /*#__PURE__*/
|
|
69
|
+
label: /*#__PURE__*/_react.default.createElement("span", {
|
|
63
70
|
className: "select-option-name"
|
|
64
71
|
}, FILTER_TERM_MODIFIER_SHOW[filterTermModifier])
|
|
65
72
|
};
|
|
@@ -69,9 +76,9 @@ class FilterItemUtils {
|
|
|
69
76
|
value: {
|
|
70
77
|
columnOption: option
|
|
71
78
|
},
|
|
72
|
-
label: /*#__PURE__*/
|
|
79
|
+
label: /*#__PURE__*/_react.default.createElement("div", {
|
|
73
80
|
className: "select-option-name"
|
|
74
|
-
}, /*#__PURE__*/
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
75
82
|
className: "single-select-option",
|
|
76
83
|
style: {
|
|
77
84
|
background: option.color,
|
|
@@ -87,9 +94,9 @@ class FilterItemUtils {
|
|
|
87
94
|
value: {
|
|
88
95
|
columnOption: option
|
|
89
96
|
},
|
|
90
|
-
label: /*#__PURE__*/
|
|
97
|
+
label: /*#__PURE__*/_react.default.createElement("div", {
|
|
91
98
|
className: "select-option-name multiple-option-name"
|
|
92
|
-
}, /*#__PURE__*/
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
93
100
|
className: "multiple-select-option",
|
|
94
101
|
style: {
|
|
95
102
|
background: option.color,
|
|
@@ -97,9 +104,9 @@ class FilterItemUtils {
|
|
|
97
104
|
},
|
|
98
105
|
title: option.name,
|
|
99
106
|
"aria-label": option.name
|
|
100
|
-
}, option.name), /*#__PURE__*/
|
|
107
|
+
}, option.name), /*#__PURE__*/_react.default.createElement("div", {
|
|
101
108
|
className: "multiple-check-icon"
|
|
102
|
-
}, filterTerm.indexOf(option.id) > -1 && /*#__PURE__*/
|
|
109
|
+
}, filterTerm.indexOf(option.id) > -1 && /*#__PURE__*/_react.default.createElement("i", {
|
|
103
110
|
className: "option-edit dtable-font dtable-icon-check-mark"
|
|
104
111
|
})))
|
|
105
112
|
};
|
|
@@ -109,16 +116,16 @@ class FilterItemUtils {
|
|
|
109
116
|
value: {
|
|
110
117
|
filterConjunction: 'And'
|
|
111
118
|
},
|
|
112
|
-
label: /*#__PURE__*/
|
|
119
|
+
label: /*#__PURE__*/_react.default.createElement("span", {
|
|
113
120
|
className: "select-option-name"
|
|
114
|
-
}, getLocale('And'))
|
|
121
|
+
}, (0, _lang.getLocale)('And'))
|
|
115
122
|
}, {
|
|
116
123
|
value: {
|
|
117
124
|
filterConjunction: 'Or'
|
|
118
125
|
},
|
|
119
|
-
label: /*#__PURE__*/
|
|
126
|
+
label: /*#__PURE__*/_react.default.createElement("span", {
|
|
120
127
|
className: "select-option-name"
|
|
121
|
-
}, getLocale('Or'))
|
|
128
|
+
}, (0, _lang.getLocale)('Or'))
|
|
122
129
|
}];
|
|
123
130
|
}
|
|
124
131
|
static getActiveConjunctionOption(conjunction) {
|
|
@@ -127,19 +134,19 @@ class FilterItemUtils {
|
|
|
127
134
|
value: {
|
|
128
135
|
filterConjunction: 'And'
|
|
129
136
|
},
|
|
130
|
-
label: /*#__PURE__*/
|
|
137
|
+
label: /*#__PURE__*/_react.default.createElement("span", {
|
|
131
138
|
className: "select-option-name"
|
|
132
|
-
}, getLocale('And'))
|
|
139
|
+
}, (0, _lang.getLocale)('And'))
|
|
133
140
|
};
|
|
134
141
|
}
|
|
135
142
|
return {
|
|
136
143
|
value: {
|
|
137
144
|
filterConjunction: 'Or'
|
|
138
145
|
},
|
|
139
|
-
label: /*#__PURE__*/
|
|
146
|
+
label: /*#__PURE__*/_react.default.createElement("span", {
|
|
140
147
|
className: "select-option-name"
|
|
141
|
-
}, getLocale('Or'))
|
|
148
|
+
}, (0, _lang.getLocale)('Or'))
|
|
142
149
|
};
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
|
-
|
|
152
|
+
var _default = exports.default = FilterItemUtils;
|