dtable-ui-component 6.0.54 → 6.0.55-beta.2
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 +21 -21
- package/lib/ActivityIndicator/index.js +9 -9
- package/lib/AsyncUserSelect/index.js +3 -3
- package/lib/Badge/index.js +10 -10
- package/lib/CheckboxEditor/mb-editor.js +2 -10
- package/lib/CheckboxEditor/pc-editor.js +2 -10
- package/lib/CheckboxFormatter/index.js +4 -13
- package/lib/CollaboratorEditor/pc-editor/index.js +1 -1
- package/lib/CollapsibleSettingLayout/index.js +1 -1
- package/lib/Comment/body/comment.js +1 -1
- package/lib/Comment/footer/index.js +1 -1
- package/lib/Comment/footer/input/index.js +5 -5
- package/lib/Comment/footer/input/participant/index.js +1 -1
- package/lib/Comment/footer/participants/participant-select/index.js +2 -2
- package/lib/Comment/utils/utilities.js +1 -1
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +4 -4
- package/lib/DTableColorPicker/index.js +6 -6
- package/lib/DTableColorPicker/utils.js +1 -1
- package/lib/DTableColumnIcon/index.js +71 -0
- package/lib/DTableCommonAddTool/index.js +2 -2
- package/lib/DTableFiltersPopover/index.js +1 -1
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +7 -4
- package/lib/DTableFiltersPopover/utils/index.js +92 -27
- package/lib/DTableFiltersPopover/widgets/filter-group.js +2 -2
- package/lib/DTableFiltersPopover/widgets/filter-item.js +2 -2
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +4 -2
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/rate-item.js +2 -2
- package/lib/DTableGroupSelect/select-option-group.js +1 -1
- package/lib/{SvgIcon → DTableIcon}/index.css +2 -2
- package/lib/DTableIcon/index.js +44 -0
- package/lib/DTableIcon/svg-icon.js +56 -0
- package/lib/DTableRadioGroup/index.js +3 -3
- package/lib/DTableSearchInput/index.js +1 -1
- package/lib/DTableSelect/dtable-select-label.js +1 -1
- package/lib/DTableSelect/utils.js +3 -0
- package/lib/DTableSwitch/index.css +2 -1
- package/lib/DateEditor/pc-editor.js +1 -1
- package/lib/DatePicker/utils.js +4 -4
- package/lib/DepartmentMultipleSelectEditor/index.js +3 -3
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +2 -2
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +2 -2
- package/lib/DigitalSignEditor/service.js +1 -1
- package/lib/DigitalSignEditor/signature-board/index.js +2 -2
- package/lib/DigitalSignFormatter/utils.js +1 -1
- package/lib/FieldDisplaySetting/field-item.js +9 -4
- package/lib/FieldDisplaySetting/index.js +6 -6
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +2 -2
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +3 -3
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +6 -6
- package/lib/FileFormatter/index.js +1 -1
- package/lib/FileItemFormatter/index.js +1 -1
- package/lib/FileUploader/index.js +1 -1
- package/lib/FormulaFormatter/index.js +4 -4
- package/lib/GeolocationEditor/index.js +3 -3
- package/lib/GeolocationEditor/map-editor-utils.js +2 -2
- package/lib/GeolocationEditor/pc-editor/country-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/location-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +20 -3
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +20 -3
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +1 -1
- package/lib/GeolocationEditor/pc-editor/province-editor.js +3 -3
- package/lib/GeolocationEditor/pc-editor/selector-list.js +1 -1
- package/lib/HtmlLongTextFormatter/index.js +1 -1
- package/lib/Icon/index.js +2 -2
- package/lib/Icon/load-sprite.js +13 -2
- package/lib/IconButton/index.js +1 -1
- package/lib/ImageEditor/images-previewer/image-preview/index.js +1 -1
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +2 -2
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +5 -5
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +1 -1
- package/lib/ImageFormatter/index.js +1 -1
- package/lib/ImageThumbnail/index.js +2 -2
- package/lib/InputItem/custom-input.js +9 -9
- package/lib/InputItem/custom-keyboard.js +5 -5
- package/lib/InputItem/index.js +21 -21
- package/lib/List/index.js +3 -3
- package/lib/List/list-item.js +23 -23
- package/lib/MBEditorHeader/index.js +1 -1
- package/lib/MobileFullScreenPage/body/index.js +1 -1
- package/lib/MobileFullScreenPage/header/index.js +4 -4
- package/lib/MobileFullScreenPage/index.js +1 -1
- package/lib/Modal/alert.js +3 -3
- package/lib/Modal/modal.js +8 -8
- package/lib/Modal/operation.js +1 -1
- package/lib/Modal/prompt.js +11 -11
- package/lib/MultipleSelectFormatter/index.js +1 -1
- package/lib/PhoneNumberLink/index.js +29 -0
- package/lib/Popover/index.js +1 -1
- package/lib/Popover/item.js +7 -7
- package/lib/Progress/index.js +6 -6
- package/lib/Radio/Radio.js +1 -1
- package/lib/Radio/RadioItem.js +2 -2
- package/lib/RateFormatter/index.js +3 -3
- package/lib/RoleStatusEditor/index.js +1 -1
- package/lib/RowExpandDialog/body/index.js +1 -1
- package/lib/RowExpandDialog/column-content/index.css +4 -2
- package/lib/RowExpandDialog/column-content/index.js +7 -4
- package/lib/RowExpandDialog/header/index.js +1 -1
- package/lib/RowExpandDialog/index.js +3 -3
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +1 -1
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +1 -1
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +1 -1
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +5 -5
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +1 -1
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +2 -2
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +3 -3
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +1 -1
- package/lib/RowExpandFormatter/constants.js +2 -2
- package/lib/RowExpandFormatter/email-formatter/index.css +1 -29
- package/lib/RowExpandFormatter/email-formatter/index.js +4 -4
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +2 -2
- package/lib/RowExpandFormatter/formula-formatter/index.css +2 -0
- package/lib/RowExpandFormatter/formula-formatter/index.js +22 -19
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +2 -2
- package/lib/RowExpandFormatter/index.css +2 -0
- package/lib/RowExpandFormatter/index.js +2 -1
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +1 -1
- package/lib/RowExpandFormatter/link-formatter/index.js +6 -6
- package/lib/RowExpandFormatter/rate-formatter/index.js +3 -3
- package/lib/RowExpandFormatter/text/index.css +2 -0
- package/lib/RowExpandFormatter/text/index.js +49 -0
- package/lib/RowExpandFormatter/url-formatter/index.css +1 -0
- package/lib/RowExpandFormatter/url-formatter/index.js +4 -4
- package/lib/RowExpandView/body/index.css +4 -0
- package/lib/RowExpandView/body/index.js +1 -1
- package/lib/SelectOptionGroup/index.css +5 -2
- package/lib/SelectOptionGroup/index.js +1 -1
- package/lib/SelectedDepartments/index.js +3 -3
- package/lib/SimpleLongTextFormatter/index.js +2 -2
- package/lib/TabBar/Tab.js +6 -6
- package/lib/TabBar/index.js +3 -3
- package/lib/TextareaItem/index.js +19 -19
- package/lib/Toast/index.js +5 -5
- package/lib/assets/icons/telephone.svg +14 -0
- package/lib/css/row-expand.css +27 -0
- package/lib/index.js +21 -7
- package/lib/select-editor/pc-editor/index.js +2 -2
- package/lib/toaster/alert.js +1 -1
- package/lib/toaster/toast.js +1 -1
- package/lib/toaster/toastManager.js +1 -1
- package/lib/toaster/toaster.js +1 -1
- 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 +14 -30
- package/lib/SvgIcon/index.js +0 -38
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var
|
|
10
|
+
var _DTableColumnIcon = _interopRequireDefault(require("../../DTableColumnIcon"));
|
|
10
11
|
var _lang = require("../../lang");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
class FilterItemUtils {
|
|
@@ -14,7 +15,8 @@ class FilterItemUtils {
|
|
|
14
15
|
if (!column) return null;
|
|
15
16
|
const {
|
|
16
17
|
type,
|
|
17
|
-
name
|
|
18
|
+
name,
|
|
19
|
+
data
|
|
18
20
|
} = column;
|
|
19
21
|
return {
|
|
20
22
|
value: {
|
|
@@ -23,8 +25,9 @@ class FilterItemUtils {
|
|
|
23
25
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
24
26
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
25
27
|
className: "filter-header-icon",
|
|
26
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
27
|
-
|
|
28
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableColumnIcon.default, {
|
|
29
|
+
columnType: type,
|
|
30
|
+
columnDisplayType: data === null || data === void 0 ? void 0 : data.display_type
|
|
28
31
|
})
|
|
29
32
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
30
33
|
className: "select-option-name",
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "FilterItemUtils", {
|
|
|
10
10
|
return _filterItemUtils.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
exports.isFilterTermArray = exports.getUpdatedFilterBySelectSingle = exports.getUpdatedFilterBySelectMultiple = exports.getUpdatedFilterByRate = exports.getUpdatedFilterByPredicate = exports.getUpdatedFilterByCreator = exports.getUpdatedFilterByColumn = exports.getUpdatedFilterByCollaborator = exports.getSingleSelectUpdatedFilterTerm = exports.getMultipleSelectUpdatedFilterTerm = exports.getFormulaColumnFilter = exports.getFormulaAndLinkFilters = exports.getFilterConfigOptions = exports.getFilterColumns = exports.getFilterByColumn = exports.getDefaultFilterGroup = exports.getDefaultFilter = exports.getCreatorUpdatedFilterTerm = exports.getColumnOptions = exports.getColumnByKey = exports.getCollaboratorUpdatedFilterTerm = exports.generateDefaultUser = exports.applyFilterOperation = void 0;
|
|
13
|
+
exports.isFilterTermArray = exports.getUpdatedFilterBySelectSingle = exports.getUpdatedFilterBySelectMultiple = exports.getUpdatedFilterByRate = exports.getUpdatedFilterByPredicate = exports.getUpdatedFilterByCreator = exports.getUpdatedFilterByColumn = exports.getUpdatedFilterByCollaborator = exports.getSingleSelectUpdatedFilterTerm = exports.getMultipleSelectUpdatedFilterTerm = exports.getFormulaColumnFilter = exports.getFormulaAndLinkFilters = exports.getFilterConfigOptions = exports.getFilterColumns = exports.getFilterByColumn = exports.getDefaultFilterGroup = exports.getDefaultFilter = exports.getCreatorUpdatedFilterTerm = exports.getColumnOptions = exports.getColumnByKey = exports.getCollaboratorUpdatedFilterTerm = exports.generateDefaultUser = exports.checkColumnHasFilterOptions = exports.applyFilterOperation = void 0;
|
|
14
14
|
var _dtableUtils = require("dtable-utils");
|
|
15
15
|
var _filterItemUtils = _interopRequireDefault(require("./filter-item-utils"));
|
|
16
16
|
var _constants = require("../constants");
|
|
@@ -133,17 +133,25 @@ const getColumnOptions = column => {
|
|
|
133
133
|
}
|
|
134
134
|
if (type === _dtableUtils.CellType.LINK) {
|
|
135
135
|
const {
|
|
136
|
-
array_type
|
|
136
|
+
array_type,
|
|
137
|
+
array_data
|
|
137
138
|
} = data || {};
|
|
138
139
|
if (array_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
139
|
-
return _dtableUtils.
|
|
140
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
141
|
+
columnType: _dtableUtils.CellType.CHECKBOX
|
|
142
|
+
});
|
|
140
143
|
}
|
|
141
144
|
if (array_type === _dtableUtils.FORMULA_RESULT_TYPE.STRING) {
|
|
142
|
-
return _dtableUtils.
|
|
145
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
146
|
+
columnType: _dtableUtils.CellType.TEXT
|
|
147
|
+
});
|
|
143
148
|
}
|
|
144
|
-
return getFilterOptionsByArrayType(array_type);
|
|
149
|
+
return getFilterOptionsByArrayType(array_type, array_data);
|
|
145
150
|
}
|
|
146
|
-
return _dtableUtils.
|
|
151
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
152
|
+
columnType: type,
|
|
153
|
+
columnDisplayType: data === null || data === void 0 ? void 0 : data.display_type
|
|
154
|
+
});
|
|
147
155
|
};
|
|
148
156
|
exports.getColumnOptions = getColumnOptions;
|
|
149
157
|
const getFormulaColumnFilterOptions = column => {
|
|
@@ -152,23 +160,32 @@ const getFormulaColumnFilterOptions = column => {
|
|
|
152
160
|
} = column;
|
|
153
161
|
const {
|
|
154
162
|
result_type,
|
|
155
|
-
array_type
|
|
163
|
+
array_type,
|
|
164
|
+
array_data
|
|
156
165
|
} = data || {};
|
|
157
166
|
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
158
|
-
return _dtableUtils.
|
|
167
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
168
|
+
columnType: _dtableUtils.CellType.CHECKBOX
|
|
169
|
+
});
|
|
159
170
|
}
|
|
160
171
|
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.STRING) {
|
|
161
|
-
return _dtableUtils.
|
|
172
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
173
|
+
columnType: _dtableUtils.CellType.TEXT
|
|
174
|
+
});
|
|
162
175
|
}
|
|
163
176
|
if ([_dtableUtils.FORMULA_RESULT_TYPE.NUMBER, _dtableUtils.FORMULA_RESULT_TYPE.DATE].includes(result_type)) {
|
|
164
|
-
return _dtableUtils.
|
|
177
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
178
|
+
columnType: result_type
|
|
179
|
+
});
|
|
165
180
|
}
|
|
166
181
|
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY) {
|
|
167
|
-
return getFilterOptionsByArrayType(array_type);
|
|
182
|
+
return getFilterOptionsByArrayType(array_type, array_data);
|
|
168
183
|
}
|
|
169
|
-
return _dtableUtils.
|
|
184
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
185
|
+
columnType: _dtableUtils.CellType.TEXT
|
|
186
|
+
});
|
|
170
187
|
};
|
|
171
|
-
const getFilterOptionsByArrayType = array_type => {
|
|
188
|
+
const getFilterOptionsByArrayType = (array_type, array_data) => {
|
|
172
189
|
if (!array_type) {
|
|
173
190
|
return {};
|
|
174
191
|
}
|
|
@@ -187,10 +204,21 @@ const getFilterOptionsByArrayType = array_type => {
|
|
|
187
204
|
|
|
188
205
|
// only support: is
|
|
189
206
|
if (checkType === _dtableUtils.CellType.CHECKBOX || checkType === _dtableUtils.CellType.BOOL) {
|
|
190
|
-
return _dtableUtils.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
207
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
208
|
+
columnType: _dtableUtils.CellType.CHECKBOX
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
const filterOptions = checkColumnHasFilterOptions({
|
|
212
|
+
columnType: checkType,
|
|
213
|
+
columnDisplayType: array_data === null || array_data === void 0 ? void 0 : array_data.display_type
|
|
214
|
+
}) ? (0, _dtableUtils.getColumnFilterOptions)({
|
|
215
|
+
columnType: checkType,
|
|
216
|
+
columnDisplayType: array_data === null || array_data === void 0 ? void 0 : array_data.display_type
|
|
217
|
+
}) : (0, _dtableUtils.getColumnFilterOptions)({
|
|
218
|
+
columnType: _dtableUtils.CellType.TEXT,
|
|
219
|
+
columnDisplayType: array_data === null || array_data === void 0 ? void 0 : array_data.display_type
|
|
220
|
+
});
|
|
221
|
+
const {
|
|
194
222
|
filterPredicateList
|
|
195
223
|
} = filterOptions;
|
|
196
224
|
if (filterPredicateList && !filterPredicateList.includes(_dtableUtils.FILTER_PREDICATE_TYPE.EMPTY)) {
|
|
@@ -382,7 +410,7 @@ const getMediaUrl = () => {
|
|
|
382
410
|
};
|
|
383
411
|
const generateDefaultUser = name => {
|
|
384
412
|
const mediaUrl = getMediaUrl();
|
|
385
|
-
const defaultAvatarUrl =
|
|
413
|
+
const defaultAvatarUrl = `${mediaUrl}avatars/default.png`;
|
|
386
414
|
return {
|
|
387
415
|
name,
|
|
388
416
|
email: name,
|
|
@@ -390,11 +418,33 @@ const generateDefaultUser = name => {
|
|
|
390
418
|
};
|
|
391
419
|
};
|
|
392
420
|
exports.generateDefaultUser = generateDefaultUser;
|
|
421
|
+
const checkColumnHasFilterOptions = _ref => {
|
|
422
|
+
let {
|
|
423
|
+
columnType,
|
|
424
|
+
columnDisplayType
|
|
425
|
+
} = _ref;
|
|
426
|
+
const filterOptions = (0, _dtableUtils.getColumnFilterOptions)({
|
|
427
|
+
columnType,
|
|
428
|
+
columnDisplayType
|
|
429
|
+
});
|
|
430
|
+
return filterOptions ? Object.keys(filterOptions).length > 0 : false;
|
|
431
|
+
};
|
|
432
|
+
exports.checkColumnHasFilterOptions = checkColumnHasFilterOptions;
|
|
393
433
|
const getDefaultFilter = columns => {
|
|
434
|
+
var _defaultColumn$data;
|
|
394
435
|
if (!columns) return null;
|
|
395
436
|
let defaultColumn = columns[0];
|
|
396
|
-
if (!
|
|
397
|
-
defaultColumn
|
|
437
|
+
if (!checkColumnHasFilterOptions({
|
|
438
|
+
columnType: defaultColumn.type,
|
|
439
|
+
columnDisplayType: (_defaultColumn$data = defaultColumn.data) === null || _defaultColumn$data === void 0 ? void 0 : _defaultColumn$data.display_type
|
|
440
|
+
})) {
|
|
441
|
+
defaultColumn = columns.find(c => {
|
|
442
|
+
var _c$data;
|
|
443
|
+
return checkColumnHasFilterOptions({
|
|
444
|
+
columnType: c.type,
|
|
445
|
+
columnDisplayType: (_c$data = c.data) === null || _c$data === void 0 ? void 0 : _c$data.display_type
|
|
446
|
+
});
|
|
447
|
+
});
|
|
398
448
|
}
|
|
399
449
|
if (!defaultColumn) return null;
|
|
400
450
|
return getFilterByColumn(defaultColumn);
|
|
@@ -433,9 +483,16 @@ const getFilterColumns = columns => {
|
|
|
433
483
|
type
|
|
434
484
|
} = column;
|
|
435
485
|
if (data && (type === _dtableUtils.CellType.LINK || _dtableUtils.FORMULA_COLUMN_TYPES_MAP[type] && data.result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY)) {
|
|
436
|
-
|
|
486
|
+
var _data$array_data;
|
|
487
|
+
return checkColumnHasFilterOptions({
|
|
488
|
+
columnType: data.array_type,
|
|
489
|
+
columnDisplayType: (_data$array_data = data.array_data) === null || _data$array_data === void 0 ? void 0 : _data$array_data.display_type
|
|
490
|
+
});
|
|
437
491
|
}
|
|
438
|
-
return
|
|
492
|
+
return checkColumnHasFilterOptions({
|
|
493
|
+
columnType: type,
|
|
494
|
+
columnDisplayType: data === null || data === void 0 ? void 0 : data.display_type
|
|
495
|
+
});
|
|
439
496
|
});
|
|
440
497
|
};
|
|
441
498
|
exports.getFilterColumns = getFilterColumns;
|
|
@@ -702,17 +759,25 @@ const getFilterConfigOptions = column => {
|
|
|
702
759
|
}
|
|
703
760
|
if (type === _dtableUtils.CellType.LINK) {
|
|
704
761
|
const {
|
|
705
|
-
array_type
|
|
762
|
+
array_type,
|
|
763
|
+
array_data
|
|
706
764
|
} = data || {};
|
|
707
765
|
if (array_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
708
|
-
return _dtableUtils.
|
|
766
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
767
|
+
columnType: _dtableUtils.CellType.CHECKBOX
|
|
768
|
+
});
|
|
709
769
|
}
|
|
710
770
|
if (array_type === _dtableUtils.FORMULA_RESULT_TYPE.STRING) {
|
|
711
|
-
return _dtableUtils.
|
|
771
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
772
|
+
columnType: _dtableUtils.CellType.TEXT
|
|
773
|
+
});
|
|
712
774
|
}
|
|
713
|
-
return getFilterOptionsByArrayType(array_type);
|
|
775
|
+
return getFilterOptionsByArrayType(array_type, array_data);
|
|
714
776
|
}
|
|
715
|
-
return _dtableUtils.
|
|
777
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
778
|
+
columnType: type,
|
|
779
|
+
columnDisplayType: data === null || data === void 0 ? void 0 : data.display_type
|
|
780
|
+
}) || {};
|
|
716
781
|
};
|
|
717
782
|
exports.getFilterConfigOptions = getFilterConfigOptions;
|
|
718
783
|
const getMultipleSelectUpdatedFilterTerm = (filterTerm, option) => {
|
|
@@ -146,7 +146,7 @@ class FilterGroup extends _react.Component {
|
|
|
146
146
|
updateConjunction: this.modifyConjunctionInGroup,
|
|
147
147
|
deleteFilter: this.deleteFilterInGroup,
|
|
148
148
|
updateFilter: this.updateFilterInGroup
|
|
149
|
-
},
|
|
149
|
+
}, `filter-in-group-${groupIndex}-${subFilterIndex}`);
|
|
150
150
|
});
|
|
151
151
|
};
|
|
152
152
|
}
|
|
@@ -157,7 +157,7 @@ class FilterGroup extends _react.Component {
|
|
|
157
157
|
readOnly
|
|
158
158
|
} = this.props;
|
|
159
159
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
160
|
-
className: (0, _classnames.default)('filter-item', 'filter-group',
|
|
160
|
+
className: (0, _classnames.default)('filter-item', 'filter-group', `level-${level}`),
|
|
161
161
|
children: [!readOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
162
162
|
className: "delete-filter",
|
|
163
163
|
onClick: this.deleteFilterGroup,
|
|
@@ -351,7 +351,7 @@ class FilterItem extends _react.default.Component {
|
|
|
351
351
|
optionStyle.background = _constants.DELETED_OPTION_BACKGROUND_COLOR;
|
|
352
352
|
optionName = (0, _lang.getLocale)(_constants.DELETED_OPTION_TIPS);
|
|
353
353
|
}
|
|
354
|
-
labelArray.push(
|
|
354
|
+
labelArray.push(/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
355
355
|
className: className,
|
|
356
356
|
style: optionStyle,
|
|
357
357
|
title: optionName,
|
|
@@ -792,7 +792,7 @@ class FilterItem extends _react.default.Component {
|
|
|
792
792
|
isLocked: readOnly
|
|
793
793
|
})
|
|
794
794
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
795
|
-
className:
|
|
795
|
+
className: `filter-predicate ml-2 ${_isCheckboxColumn ? 'filter-checkbox-predicate' : ''}`,
|
|
796
796
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSelect.default, {
|
|
797
797
|
value: activePredicate,
|
|
798
798
|
options: filterPredicateOptions,
|
|
@@ -420,13 +420,15 @@
|
|
|
420
420
|
margin-left: -0.3125rem;
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
-
.filter-header-icon .dtable-font
|
|
423
|
+
.filter-header-icon .dtable-font,
|
|
424
|
+
.filter-header-icon .multicolor-icon {
|
|
424
425
|
font-size: 14px;
|
|
425
426
|
color: #aaa;
|
|
426
427
|
cursor: default;
|
|
427
428
|
}
|
|
428
429
|
|
|
429
|
-
.option.option-active .filter-header-icon .dtable-font
|
|
430
|
+
.option.option-active .filter-header-icon .dtable-font,
|
|
431
|
+
.option.option-active .filter-header-icon .multicolor-icon {
|
|
430
432
|
color: #fff;
|
|
431
433
|
}
|
|
432
434
|
|
|
@@ -261,7 +261,7 @@ class FiltersList extends _react.Component {
|
|
|
261
261
|
modifyConjunctionInGroup: this.modifyConjunctionInGroup,
|
|
262
262
|
deleteFilterInGroup: this.deleteFilterInGroup,
|
|
263
263
|
updateFilterInGroup: this.updateFilterInGroup
|
|
264
|
-
},
|
|
264
|
+
}, `filter-group-${index}`);
|
|
265
265
|
}
|
|
266
266
|
const {
|
|
267
267
|
error_message
|
|
@@ -67,9 +67,9 @@ class RateItem extends _react.default.Component {
|
|
|
67
67
|
onMouseLeave: this.onMouseLeaveRateItem,
|
|
68
68
|
style: style,
|
|
69
69
|
onClick: this.onChangeRateNumber,
|
|
70
|
-
className:
|
|
70
|
+
className: `rate-item ${value >= rateItemIndex ? 'rate-item-active' : ''}`,
|
|
71
71
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
72
|
-
className:
|
|
72
|
+
className: `dtable-font ${rateShowType}`,
|
|
73
73
|
ref: this.tooltipRef
|
|
74
74
|
}), editable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.UncontrolledTooltip, {
|
|
75
75
|
placement: "bottom",
|
|
@@ -154,7 +154,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
154
154
|
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
155
155
|
className: "dtable-font dtable-icon-check-mark"
|
|
156
156
|
})]
|
|
157
|
-
},
|
|
157
|
+
}, `${option.id}-${index}`);
|
|
158
158
|
});
|
|
159
159
|
};
|
|
160
160
|
this.state = {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _svgIcon = _interopRequireDefault(require("./svg-icon"));
|
|
10
|
+
require("./index.css");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
const DTableIcon = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
className,
|
|
15
|
+
symbol,
|
|
16
|
+
color,
|
|
17
|
+
ariaHidden = false,
|
|
18
|
+
getSvg
|
|
19
|
+
} = _ref;
|
|
20
|
+
if (!symbol) return null;
|
|
21
|
+
if (symbol.includes('dtable-icon')) {
|
|
22
|
+
let customProps = {};
|
|
23
|
+
if (ariaHidden) {
|
|
24
|
+
customProps['aria-hidden'] = ariaHidden;
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
27
|
+
className: (0, _classnames.default)(symbol, className, {
|
|
28
|
+
'dtable-font': !symbol.includes('dtable-font')
|
|
29
|
+
}),
|
|
30
|
+
style: {
|
|
31
|
+
color
|
|
32
|
+
},
|
|
33
|
+
...customProps
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_svgIcon.default, {
|
|
37
|
+
symbol: symbol,
|
|
38
|
+
color: color,
|
|
39
|
+
className: className,
|
|
40
|
+
ariaHidden: ariaHidden,
|
|
41
|
+
getSvg: getSvg
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var _default = exports.default = DTableIcon;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
let svgIconComponents = null;
|
|
11
|
+
const loadSvgIconComponents = () => {
|
|
12
|
+
// load svg icons from ui-components
|
|
13
|
+
const requireContext = require.context('../assets/icons', false, /\.svg$/);
|
|
14
|
+
let iconComponents = {};
|
|
15
|
+
requireContext.keys().forEach(path => {
|
|
16
|
+
const iconName = path.replace(/^\.\/(.*?)\.svg$/, '$1').toLowerCase();
|
|
17
|
+
iconComponents[iconName] = requireContext(path).default;
|
|
18
|
+
});
|
|
19
|
+
return iconComponents;
|
|
20
|
+
};
|
|
21
|
+
const getSvgIconComponents = () => {
|
|
22
|
+
if (!svgIconComponents) {
|
|
23
|
+
svgIconComponents = loadSvgIconComponents();
|
|
24
|
+
}
|
|
25
|
+
return svgIconComponents;
|
|
26
|
+
};
|
|
27
|
+
const SvgIcon = _ref => {
|
|
28
|
+
let {
|
|
29
|
+
className,
|
|
30
|
+
symbol,
|
|
31
|
+
color,
|
|
32
|
+
ariaHidden,
|
|
33
|
+
getSvg
|
|
34
|
+
} = _ref;
|
|
35
|
+
if (!symbol) return null;
|
|
36
|
+
let props = {
|
|
37
|
+
style: {
|
|
38
|
+
fill: color
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
if (ariaHidden) {
|
|
42
|
+
props['aria-hidden'] = ariaHidden;
|
|
43
|
+
}
|
|
44
|
+
const iconComponents = getSvgIconComponents();
|
|
45
|
+
let IconComponent = iconComponents[symbol];
|
|
46
|
+
if (!IconComponent && getSvg) {
|
|
47
|
+
// try to get svg icon from other modules
|
|
48
|
+
IconComponent = getSvg(symbol);
|
|
49
|
+
}
|
|
50
|
+
if (!IconComponent) return null;
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
52
|
+
className: (0, _classnames.default)('multicolor-icon', className, `multicolor-icon-${symbol}`),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
var _default = exports.default = SvgIcon;
|
|
@@ -49,7 +49,7 @@ class DTableRadioGroup extends _react.default.Component {
|
|
|
49
49
|
options
|
|
50
50
|
} = this.props;
|
|
51
51
|
if (!this.btn || !this.slider || !Array.isArray(options)) return;
|
|
52
|
-
this.slider.style.width =
|
|
52
|
+
this.slider.style.width = `${100 / options.length}%`;
|
|
53
53
|
this.setSliderTransition();
|
|
54
54
|
}
|
|
55
55
|
componentDidUpdate(prevProps) {
|
|
@@ -77,13 +77,13 @@ class DTableRadioGroup extends _react.default.Component {
|
|
|
77
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
78
78
|
className: "radio-group-wrapper",
|
|
79
79
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
80
|
-
className:
|
|
80
|
+
className: `radio-group-options ${readOnly ? 'read-only' : ''}`,
|
|
81
81
|
children: [options.map(option => {
|
|
82
82
|
const isActive = activeOption === option ? true : false;
|
|
83
83
|
const displayOption = optionsDisplay && optionsDisplay[option] || '';
|
|
84
84
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
85
85
|
ref: ref => this.btn = ref,
|
|
86
|
-
className:
|
|
86
|
+
className: `radio-group-button ${isActive ? 'active' : ''}`,
|
|
87
87
|
"data-option": option,
|
|
88
88
|
onClick: this.onSelectChanged,
|
|
89
89
|
children: displayOption
|
|
@@ -67,7 +67,7 @@ class DtableSearchInput extends _react.Component {
|
|
|
67
67
|
const {
|
|
68
68
|
ClearIndicator
|
|
69
69
|
} = components;
|
|
70
|
-
if (
|
|
70
|
+
if (/*#__PURE__*/_react.default.isValidElement(ClearIndicator)) {
|
|
71
71
|
return /*#__PURE__*/_react.default.cloneElement(ClearIndicator, {
|
|
72
72
|
clearValue: this.clearSearch
|
|
73
73
|
});
|
|
@@ -15,7 +15,7 @@ function DTableSelectLabel(_ref) {
|
|
|
15
15
|
isSelect = false
|
|
16
16
|
} = _ref;
|
|
17
17
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
18
|
-
className:
|
|
18
|
+
className: `${classname} w-100 d-flex justify-content-between`,
|
|
19
19
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
20
20
|
children: name
|
|
21
21
|
}), isSelect && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
color: #212529;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.dtable-switch.sm .custom-switch .dtable-font
|
|
29
|
+
.dtable-switch.sm .custom-switch .dtable-font,
|
|
30
|
+
.dtable-switch.sm .custom-switch .multicolor-icon {
|
|
30
31
|
-webkit-transform: scale(.8);
|
|
31
32
|
transform: scale(.8);
|
|
32
33
|
display: inline-block;
|
|
@@ -224,7 +224,7 @@ class PCDateEditor extends _react.default.Component {
|
|
|
224
224
|
} = this.state;
|
|
225
225
|
const calendar = this.getCalender();
|
|
226
226
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
227
|
-
className:
|
|
227
|
+
className: `date-picker-container ${isInModal ? 'modal-date-picker-container' : ''}`,
|
|
228
228
|
ref: ref => this.datePickerRef = ref,
|
|
229
229
|
onKeyDown: this.handleKeyDown,
|
|
230
230
|
onClick: this.onClick,
|
package/lib/DatePicker/utils.js
CHANGED
|
@@ -5,16 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.formatFn = formatFn;
|
|
7
7
|
function formatIt(date, form) {
|
|
8
|
-
const pad = n => n < 10 ?
|
|
9
|
-
const dateStr =
|
|
10
|
-
const timeStr =
|
|
8
|
+
const pad = n => n < 10 ? `0${n}` : n;
|
|
9
|
+
const dateStr = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
10
|
+
const timeStr = `${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
11
11
|
if (form === 'YYYY-MM-DD') {
|
|
12
12
|
return dateStr;
|
|
13
13
|
}
|
|
14
14
|
if (form === 'HH:mm') {
|
|
15
15
|
return timeStr;
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return `${dateStr} ${timeStr}`;
|
|
18
18
|
}
|
|
19
19
|
function formatFn(instance, value) {
|
|
20
20
|
const formatsEnum = {
|
|
@@ -110,7 +110,7 @@ function DepartmentMultipleSelect(props) {
|
|
|
110
110
|
className: "vam department-select-input",
|
|
111
111
|
checked: inputChecked,
|
|
112
112
|
style: {
|
|
113
|
-
marginRight:
|
|
113
|
+
marginRight: `${newLevel * 15 + 5}px`
|
|
114
114
|
},
|
|
115
115
|
onChange: () => {}
|
|
116
116
|
}), hasChild && !searchVal && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -118,7 +118,7 @@ function DepartmentMultipleSelect(props) {
|
|
|
118
118
|
role: "button",
|
|
119
119
|
className: "department-item-fold-btn",
|
|
120
120
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
121
|
-
className:
|
|
121
|
+
className: `dtable-font expand dtable-icon-down3 ${isExpanded ? '' : 'rotate-270'}`
|
|
122
122
|
})
|
|
123
123
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
124
124
|
style: searchVal ? {} : {
|
|
@@ -146,7 +146,7 @@ function DepartmentMultipleSelect(props) {
|
|
|
146
146
|
style: getStyle(),
|
|
147
147
|
onClick: onStopPropagation,
|
|
148
148
|
onMouseDown: onStopPropagation,
|
|
149
|
-
className:
|
|
149
|
+
className: `departments-container dtable-ui ${classNamePrefix}`,
|
|
150
150
|
children: [isShowSelectedDepartments && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
151
151
|
className: "selected-departments dtable-ui",
|
|
152
152
|
onClick: onClick,
|
|
@@ -158,7 +158,7 @@ const MBDepartmentSingleSelectEditor = _ref => {
|
|
|
158
158
|
label: (0, _lang.getLocale)(name)
|
|
159
159
|
})
|
|
160
160
|
})
|
|
161
|
-
},
|
|
161
|
+
}, `department-range-item-${index}`);
|
|
162
162
|
})
|
|
163
163
|
}), currentDepartments.map((department, index) => {
|
|
164
164
|
const {
|
|
@@ -180,7 +180,7 @@ const MBDepartmentSingleSelectEditor = _ref => {
|
|
|
180
180
|
label: name
|
|
181
181
|
})
|
|
182
182
|
})
|
|
183
|
-
},
|
|
183
|
+
}, `department-item-${index}`);
|
|
184
184
|
})]
|
|
185
185
|
});
|
|
186
186
|
}, [initColumnData, parentId, isFilterEditor, isSupportMultiple, departments, value, topParentIds, onParentDepartmentClick, onDepartmentClick]);
|
|
@@ -142,7 +142,7 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
142
142
|
className: "department-item",
|
|
143
143
|
onClick: event => this.onSelectDepartment(event, id),
|
|
144
144
|
style: {
|
|
145
|
-
paddingLeft:
|
|
145
|
+
paddingLeft: `${newLevel * 15 + 10}px`
|
|
146
146
|
},
|
|
147
147
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
148
148
|
className: "department-item-left-content d-flex align-items-center",
|
|
@@ -151,7 +151,7 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
151
151
|
role: "button",
|
|
152
152
|
className: "department-item-fold-btn",
|
|
153
153
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
154
|
-
className:
|
|
154
|
+
className: `dtable-font expand dtable-icon-down3 ${isExpanded ? '' : 'rotate-270'}`
|
|
155
155
|
})
|
|
156
156
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
157
157
|
style: {
|
|
@@ -21,7 +21,7 @@ class DigitalService {
|
|
|
21
21
|
failedCallback
|
|
22
22
|
} = _ref;
|
|
23
23
|
if (!this.uploadFile) return;
|
|
24
|
-
const name =
|
|
24
|
+
const name = `${this.username}-${Date.now().toString()}.png`;
|
|
25
25
|
const file = new File([signBlob], name, {
|
|
26
26
|
type: 'image/png'
|
|
27
27
|
});
|
|
@@ -18,8 +18,8 @@ class SignatureBoard extends _react.Component {
|
|
|
18
18
|
this.initSignTool = () => {
|
|
19
19
|
let signatureBoardCanvas = document.querySelector('#signature_board_canvas');
|
|
20
20
|
if (!this.signatureBoard || !signatureBoardCanvas) return;
|
|
21
|
-
signatureBoardCanvas.style.width =
|
|
22
|
-
signatureBoardCanvas.style.height =
|
|
21
|
+
signatureBoardCanvas.style.width = `${this.signatureBoard.offsetWidth}px`;
|
|
22
|
+
signatureBoardCanvas.style.height = `${this.signatureBoard.offsetHeight}px`;
|
|
23
23
|
this.signatureTool = new _signatureTool.default(signatureBoardCanvas, {
|
|
24
24
|
minLineWidth: 2,
|
|
25
25
|
maxLineWidth: 4,
|
|
@@ -15,7 +15,7 @@ const getDigitalSignImageUrl = (cellValue, config) => {
|
|
|
15
15
|
dtableUuid
|
|
16
16
|
} = config || {};
|
|
17
17
|
if (server && (workspaceID || workspaceID === 0) && dtableUuid) {
|
|
18
|
-
return
|
|
18
|
+
return `${server}/workspace/${workspaceID}/asset/${dtableUuid}${url}`;
|
|
19
19
|
}
|
|
20
20
|
return url;
|
|
21
21
|
};
|