dtable-ui-component 5.0.9-beta.1 → 5.0.9-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/AutoNumberFormatter/index.js +5 -3
- package/lib/ButtonFormatter/index.js +9 -5
- package/lib/CTimeFormatter/index.js +5 -3
- package/lib/CheckboxEditor/index.js +15 -12
- package/lib/CheckboxFormatter/index.js +7 -5
- package/lib/CollaboratorEditor/index.js +46 -37
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +60 -47
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +37 -31
- package/lib/CollaboratorFormatter/index.js +8 -7
- package/lib/CollaboratorItem/index.js +21 -16
- package/lib/CollapsibleSettingLayout/index.js +17 -12
- package/lib/CreatorFormatter/index.js +8 -7
- package/lib/DTableCommonAddTool/index.js +10 -7
- package/lib/DTableCustomizeCollaboratorSelect/index.js +38 -32
- package/lib/DTableCustomizeSelect/index.js +51 -44
- package/lib/DTableFiltersPopover/index.js +46 -41
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +67 -51
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +64 -49
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +38 -32
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +42 -34
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +35 -31
- package/lib/DTableFiltersPopover/widgets/filter-item.js +92 -76
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +19 -17
- package/lib/DTableFiltersPopover/widgets/rate-item.js +12 -9
- package/lib/DTablePopover/index.js +9 -6
- package/lib/DTableRadio/index.js +20 -17
- package/lib/DTableSearchInput/index.js +22 -18
- package/lib/DTableSelect/dtable-select-label.js +12 -7
- package/lib/DTableSelect/index.js +2 -1
- package/lib/DTableSelect/utils.js +26 -13
- package/lib/DTableSwitch/index.js +20 -16
- package/lib/DateEditor/index.js +46 -36
- package/lib/DateEditor/mb-date-editor-popover/index.js +80 -63
- package/lib/DateEditor/pc-date-editor-popover.js +25 -22
- package/lib/DateFormatter/index.js +5 -3
- package/lib/Department-editor/department-multiple-select/index.js +49 -42
- package/lib/Department-editor/department-single-select.js +70 -54
- package/lib/Department-editor/index.js +18 -14
- package/lib/Department-editor/selected-departments/index.js +54 -44
- package/lib/DepartmentSelectFilter/index.js +8 -1
- package/lib/DepartmentSingleSelectFormatter/index.js +13 -9
- package/lib/DigitalSignFormatter/index.js +21 -17
- package/lib/DurationFormatter/index.js +7 -5
- package/lib/EditEditorButton/index.js +5 -3
- package/lib/EmailFormatter/index.js +5 -3
- package/lib/FieldDisplaySetting/field-item.js +25 -19
- package/lib/FieldDisplaySetting/index.js +47 -38
- package/lib/FileEditor/index.js +10 -7
- package/lib/FileFormatter/index.js +18 -15
- package/lib/FileItemFormatter/index.js +2 -1
- package/lib/FileUploader/index.js +2 -1
- package/lib/FormulaFormatter/index.js +21 -14
- package/lib/GeolocationFormatter/index.js +8 -6
- package/lib/HtmlLongTextFormatter/index.js +2 -1
- package/lib/ImageFormatter/images-lazy-load.js +7 -6
- package/lib/ImageFormatter/index.js +35 -29
- package/lib/ImagePreviewerLightbox/index.js +12 -8
- 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-link-editor-popover/index.js +53 -41
- package/lib/LinkEditor/pc-link-editor-popover/index.js +41 -33
- package/lib/LinkFormatter/index.js +13 -10
- 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/MultipleSelectEditor/index.js +43 -37
- package/lib/MultipleSelectFormatter/index.js +8 -7
- package/lib/NotificationPopover/index.js +43 -32
- package/lib/NumberEditor/index.js +24 -20
- package/lib/NumberFormatter/index.js +5 -3
- package/lib/RateFormatter/index.js +7 -6
- package/lib/RoleStatusEditor/index.js +35 -30
- package/lib/RowExpandEmailFormatter/index.js +11 -8
- package/lib/RowExpandFileFormatter/index.js +14 -13
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +43 -36
- package/lib/RowExpandFormatter/index.js +129 -112
- package/lib/RowExpandFormulaFormatter/index.js +37 -29
- package/lib/RowExpandImageFormatter/index.js +29 -26
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +47 -39
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +2 -1
- package/lib/RowExpandLinkFormatter/index.js +70 -67
- package/lib/RowExpandRateFormatter/index.js +7 -6
- package/lib/RowExpandUrlFormatter/index.js +11 -8
- package/lib/SelectItem/index.js +5 -3
- package/lib/SelectOptionGroup/index.js +38 -31
- package/lib/SelectOptionGroup/option.js +5 -3
- 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 +42 -34
- package/lib/SingleSelectFormatter/index.js +6 -4
- package/lib/TextEditor/index.js +2 -1
- package/lib/TextFormatter/index.js +5 -3
- package/lib/UrlFormatter/index.js +5 -3
- package/lib/common/delete-tip.js +27 -19
- package/lib/formatterConfig/base-formatter-config.js +23 -22
- package/lib/formatterConfig/index.js +3 -2
- package/lib/select-editor/mb-select-editor-popover/index.js +84 -64
- package/lib/select-editor/pc-select-editor-popover/index.js +50 -39
- package/lib/select-editor/select-editor-option.js +24 -19
- package/lib/toaster/alert.js +25 -16
- package/lib/toaster/toast.js +28 -24
- package/lib/toaster/toastManager.js +16 -13
- package/lib/toaster/toaster.js +2 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
10
10
|
var _CollaboratorItem = _interopRequireDefault(require("../CollaboratorItem"));
|
|
11
11
|
var _default_avatar = _interopRequireDefault(require("../assets/images/avatar/default_avatar.png"));
|
|
12
12
|
require("./index.css");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
// there will be there conditions
|
|
14
15
|
// 1 value is not exist, typeof value is array, but it's length is 0
|
|
15
16
|
// 2 value is exist, but can't find in collaborators
|
|
@@ -35,10 +36,9 @@ class CreatorFormatter extends _react.default.PureComponent {
|
|
|
35
36
|
avatar_url: _default_avatar.default
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
return /*#__PURE__*/
|
|
39
|
-
key: index,
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CollaboratorItem.default, {
|
|
40
40
|
collaborator: collaborator
|
|
41
|
-
});
|
|
41
|
+
}, index);
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
}
|
|
@@ -49,14 +49,15 @@ class CreatorFormatter extends _react.default.PureComponent {
|
|
|
49
49
|
} = this.props;
|
|
50
50
|
const classname = (0, _classnames.default)('dtable-ui cell-formatter-container creator-formatter', containerClassName);
|
|
51
51
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
52
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
53
53
|
className: classname
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
const collaborators = this.getCollaborators();
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
-
className: classname
|
|
59
|
-
|
|
57
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
58
|
+
className: classname,
|
|
59
|
+
children: collaborators
|
|
60
|
+
});
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
CreatorFormatter.defaultProps = {
|
|
@@ -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
|
function DTableCommonAddTool(_ref) {
|
|
11
12
|
let {
|
|
12
13
|
callBack,
|
|
@@ -16,16 +17,18 @@ function DTableCommonAddTool(_ref) {
|
|
|
16
17
|
hideIcon,
|
|
17
18
|
style
|
|
18
19
|
} = _ref;
|
|
19
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
20
21
|
className: "dtable-ui add-item-btn ".concat(className ? className : ''),
|
|
21
22
|
style: style,
|
|
22
23
|
onClick: e => {
|
|
23
24
|
callBack(e);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
},
|
|
26
|
+
children: [!hideIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
27
|
+
className: "dtable-font dtable-icon-add-table ".concat(addIconClassName || '')
|
|
28
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
29
|
+
className: "text-truncate",
|
|
30
|
+
children: footerName
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
30
33
|
}
|
|
31
34
|
var _default = exports.default = DTableCommonAddTool;
|
|
@@ -12,6 +12,7 @@ var _reactstrap = require("reactstrap");
|
|
|
12
12
|
var _dtableUtils = require("dtable-utils");
|
|
13
13
|
var _SelectOptionGroup = _interopRequireDefault(require("../SelectOptionGroup"));
|
|
14
14
|
require("./index.css");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
class CollaboratorSelect extends _react.Component {
|
|
16
17
|
constructor(props) {
|
|
17
18
|
super(props);
|
|
@@ -65,7 +66,7 @@ class CollaboratorSelect extends _react.Component {
|
|
|
65
66
|
isUsePopover
|
|
66
67
|
} = this.props;
|
|
67
68
|
if (!isUsePopover) {
|
|
68
|
-
return /*#__PURE__*/
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOptionGroup.default, {
|
|
69
70
|
value: value,
|
|
70
71
|
top: top,
|
|
71
72
|
left: left,
|
|
@@ -83,30 +84,31 @@ class CollaboratorSelect extends _react.Component {
|
|
|
83
84
|
isShowSelected: true
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
|
-
return /*#__PURE__*/
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Popover, {
|
|
87
88
|
placement: "bottom",
|
|
88
89
|
isOpen: true,
|
|
89
90
|
target: this.id,
|
|
90
91
|
fade: false,
|
|
91
92
|
hideArrow: true,
|
|
92
|
-
className: "dtable-customize-collaborator-select dtable-select"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
93
|
+
className: "dtable-customize-collaborator-select dtable-select",
|
|
94
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOptionGroup.default, {
|
|
95
|
+
value: value,
|
|
96
|
+
top: top,
|
|
97
|
+
left: left,
|
|
98
|
+
minWidth: this.btnWidth + 8 // 8px is padding
|
|
99
|
+
,
|
|
100
|
+
options: options,
|
|
101
|
+
onSelectOption: this.props.onSelectOption,
|
|
102
|
+
searchable: searchable,
|
|
103
|
+
searchPlaceholder: searchPlaceholder,
|
|
104
|
+
noOptionsPlaceholder: noOptionsPlaceholder,
|
|
105
|
+
closeSelect: this.closeSelect,
|
|
106
|
+
getFilterOptions: this.getFilterOptions,
|
|
107
|
+
supportMultipleSelect: this.props.supportMultipleSelect,
|
|
108
|
+
stopClickEvent: true,
|
|
109
|
+
isShowSelected: true
|
|
110
|
+
})
|
|
111
|
+
});
|
|
110
112
|
};
|
|
111
113
|
this.state = {
|
|
112
114
|
isShowSelectOptions: false
|
|
@@ -127,7 +129,7 @@ class CollaboratorSelect extends _react.Component {
|
|
|
127
129
|
placeholder,
|
|
128
130
|
isLocked
|
|
129
131
|
} = this.props;
|
|
130
|
-
return /*#__PURE__*/
|
|
132
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
131
133
|
ref: node => this.selector = node,
|
|
132
134
|
className: (0, _classnames.default)('dtable-select custom-select collaborator-select', {
|
|
133
135
|
'focus': this.state.isShowSelectOptions
|
|
@@ -135,17 +137,21 @@ class CollaboratorSelect extends _react.Component {
|
|
|
135
137
|
'disabled': isLocked
|
|
136
138
|
}, className),
|
|
137
139
|
id: this.id,
|
|
138
|
-
onClick: this.onSelectToggle
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
140
|
+
onClick: this.onSelectToggle,
|
|
141
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
142
|
+
className: "selected-option",
|
|
143
|
+
ref: node => this.selectedOptionRef = node,
|
|
144
|
+
children: [value.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
145
|
+
className: "selected-option-show",
|
|
146
|
+
children: value.label
|
|
147
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
148
|
+
className: "select-placeholder",
|
|
149
|
+
children: placeholder
|
|
150
|
+
}), !isLocked && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
151
|
+
className: "dtable-font dtable-icon-drop-down"
|
|
152
|
+
})]
|
|
153
|
+
}), this.state.isShowSelectOptions && this.renderOptionGroup()]
|
|
154
|
+
});
|
|
149
155
|
}
|
|
150
156
|
}
|
|
151
157
|
CollaboratorSelect.defaultProps = {
|
|
@@ -11,6 +11,7 @@ var _SelectOptionGroup = _interopRequireDefault(require("../SelectOptionGroup"))
|
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _modalPortal = _interopRequireDefault(require("../common/modal-portal"));
|
|
13
13
|
require("./index.css");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
class DTableCustomizeSelect extends _react.Component {
|
|
15
16
|
constructor(props) {
|
|
16
17
|
super(props);
|
|
@@ -95,56 +96,62 @@ class DTableCustomizeSelect extends _react.Component {
|
|
|
95
96
|
addOptionAble,
|
|
96
97
|
component
|
|
97
98
|
} = this.props;
|
|
98
|
-
return /*#__PURE__*/
|
|
99
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
99
100
|
ref: node => this.selector = node,
|
|
100
101
|
className: (0, _classnames.default)('dtable-select custom-select', {
|
|
101
102
|
'focus': this.state.isShowSelectOptions
|
|
102
103
|
}, {
|
|
103
104
|
'disabled': isLocked
|
|
104
105
|
}, className),
|
|
105
|
-
onClick: this.onSelectToggle
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
106
|
+
onClick: this.onSelectToggle,
|
|
107
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
108
|
+
className: "selected-option",
|
|
109
|
+
children: [value && value.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
110
|
+
className: "selected-option-show",
|
|
111
|
+
children: value.label
|
|
112
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
113
|
+
className: "select-placeholder",
|
|
114
|
+
children: placeholder
|
|
115
|
+
}), !isLocked && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
116
|
+
className: "dtable-font dtable-icon-drop-down"
|
|
117
|
+
})]
|
|
118
|
+
}), this.state.isShowSelectOptions && !isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOptionGroup.default, {
|
|
119
|
+
value: value,
|
|
120
|
+
addOptionAble: addOptionAble,
|
|
121
|
+
component: component,
|
|
122
|
+
isShowSelected: this.props.isShowSelected,
|
|
123
|
+
top: this.getSelectedOptionTop(),
|
|
124
|
+
options: options,
|
|
125
|
+
onSelectOption: this.props.onSelectOption,
|
|
126
|
+
searchable: searchable,
|
|
127
|
+
searchPlaceholder: searchPlaceholder,
|
|
128
|
+
noOptionsPlaceholder: noOptionsPlaceholder,
|
|
129
|
+
onClickOutside: this.onClick,
|
|
130
|
+
closeSelect: this.closeSelect,
|
|
131
|
+
getFilterOptions: this.getFilterOptions,
|
|
132
|
+
supportMultipleSelect: this.props.supportMultipleSelect
|
|
133
|
+
}), this.state.isShowSelectOptions && isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_modalPortal.default, {
|
|
134
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOptionGroup.default, {
|
|
135
|
+
className: className,
|
|
136
|
+
value: value,
|
|
137
|
+
addOptionAble: addOptionAble,
|
|
138
|
+
component: component,
|
|
139
|
+
isShowSelected: this.props.isShowSelected,
|
|
140
|
+
position: this.selector.getBoundingClientRect(),
|
|
141
|
+
isInModal: isInModal,
|
|
142
|
+
top: this.getSelectedOptionTop(),
|
|
143
|
+
options: options,
|
|
144
|
+
onSelectOption: this.props.onSelectOption,
|
|
145
|
+
searchable: searchable,
|
|
146
|
+
searchPlaceholder: searchPlaceholder,
|
|
147
|
+
noOptionsPlaceholder: noOptionsPlaceholder,
|
|
148
|
+
onClickOutside: this.onClick,
|
|
149
|
+
closeSelect: this.closeSelect,
|
|
150
|
+
getFilterOptions: this.getFilterOptions,
|
|
151
|
+
supportMultipleSelect: this.props.supportMultipleSelect
|
|
152
|
+
})
|
|
153
|
+
})]
|
|
154
|
+
});
|
|
148
155
|
}
|
|
149
156
|
}
|
|
150
157
|
var _default = exports.default = DTableCustomizeSelect;
|
|
@@ -18,6 +18,7 @@ var _eventBus = _interopRequireDefault(require("../utils/event-bus"));
|
|
|
18
18
|
var _constants = require("../constants");
|
|
19
19
|
var _lang = require("../lang");
|
|
20
20
|
require("./index.css");
|
|
21
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
22
|
/**
|
|
22
23
|
* filter = {
|
|
23
24
|
* column_key: '',
|
|
@@ -25,8 +26,7 @@ require("./index.css");
|
|
|
25
26
|
* filter_term: '',
|
|
26
27
|
* filter_term_modifier: '',
|
|
27
28
|
* }
|
|
28
|
-
*/
|
|
29
|
-
class DTableFiltersPopover extends _react.Component {
|
|
29
|
+
*/class DTableFiltersPopover extends _react.Component {
|
|
30
30
|
constructor(props) {
|
|
31
31
|
super(props);
|
|
32
32
|
this.onHotKey = e => {
|
|
@@ -166,51 +166,56 @@ class DTableFiltersPopover extends _react.Component {
|
|
|
166
166
|
filterConjunction
|
|
167
167
|
} = this.state;
|
|
168
168
|
const canAddFilter = columns.length > 0;
|
|
169
|
-
return /*#__PURE__*/
|
|
169
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.UncontrolledPopover, {
|
|
170
170
|
placement: "auto-start",
|
|
171
171
|
isOpen: true,
|
|
172
172
|
target: target,
|
|
173
173
|
fade: false,
|
|
174
174
|
hideArrow: true,
|
|
175
175
|
className: "dtable-filter-popover",
|
|
176
|
-
boundariesElement: document.body
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
176
|
+
boundariesElement: document.body,
|
|
177
|
+
children: _ref => {
|
|
178
|
+
let {
|
|
179
|
+
scheduleUpdate
|
|
180
|
+
} = _ref;
|
|
181
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
182
|
+
ref: ref => this.dtablePopoverRef = ref,
|
|
183
|
+
onClick: this.onPopoverInsideClick,
|
|
184
|
+
className: className,
|
|
185
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_filterList.default, {
|
|
186
|
+
filterConjunction: filterConjunction,
|
|
187
|
+
filters: filters,
|
|
188
|
+
columns: columns,
|
|
189
|
+
emptyPlaceholder: (0, _lang.getLocale)('No_filters'),
|
|
190
|
+
collaborators: this.props.collaborators,
|
|
191
|
+
readOnly: readOnly,
|
|
192
|
+
scheduleUpdate: scheduleUpdate,
|
|
193
|
+
userDepartmentIdsMap: userDepartmentIdsMap,
|
|
194
|
+
departments: departments,
|
|
195
|
+
lang: lang,
|
|
196
|
+
updateFilter: this.updateFilter,
|
|
197
|
+
deleteFilter: this.deleteFilter,
|
|
198
|
+
updateFilterConjunction: this.updateFilterConjunction
|
|
199
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCommonAddTool.default, {
|
|
200
|
+
className: "popover-add-tool ".concat(canAddFilter ? '' : 'disabled'),
|
|
201
|
+
callBack: canAddFilter ? () => this.addFilter(scheduleUpdate) : () => {},
|
|
202
|
+
footerName: (0, _lang.getLocale)('Add_filter'),
|
|
203
|
+
addIconClassName: "popover-add-icon"
|
|
204
|
+
}), this.isNeedSubmit() && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
205
|
+
className: "dtable-filter-popover-footer",
|
|
206
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
|
|
207
|
+
className: "mr-2",
|
|
208
|
+
onClick: this.onClosePopover,
|
|
209
|
+
children: (0, _lang.getLocale)('Cancel')
|
|
210
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
|
|
211
|
+
color: "primary",
|
|
212
|
+
disabled: this.state.isSubmitDisabled,
|
|
213
|
+
onClick: this.onSubmitFilters,
|
|
214
|
+
children: (0, _lang.getLocale)('Submit')
|
|
215
|
+
})]
|
|
216
|
+
})]
|
|
217
|
+
});
|
|
218
|
+
}
|
|
214
219
|
});
|
|
215
220
|
}
|
|
216
221
|
}
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _dtableUtils = require("dtable-utils");
|
|
10
10
|
var _lang = require("../../lang");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
class FilterItemUtils {
|
|
12
13
|
static generatorColumnOption(column) {
|
|
13
14
|
if (!column) return null;
|
|
@@ -19,13 +20,17 @@ class FilterItemUtils {
|
|
|
19
20
|
value: {
|
|
20
21
|
column
|
|
21
22
|
},
|
|
22
|
-
label: /*#__PURE__*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
24
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
25
|
+
className: "filter-header-icon",
|
|
26
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
27
|
+
className: _dtableUtils.COLUMNS_ICON_CONFIG[type]
|
|
28
|
+
})
|
|
29
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
30
|
+
className: "select-option-name",
|
|
31
|
+
children: name
|
|
32
|
+
})]
|
|
33
|
+
})
|
|
29
34
|
};
|
|
30
35
|
}
|
|
31
36
|
static generatorPredicateOption(filterPredicate) {
|
|
@@ -33,9 +38,10 @@ class FilterItemUtils {
|
|
|
33
38
|
value: {
|
|
34
39
|
filterPredicate
|
|
35
40
|
},
|
|
36
|
-
label: /*#__PURE__*/
|
|
37
|
-
className: "select-option-name"
|
|
38
|
-
|
|
41
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
42
|
+
className: "select-option-name",
|
|
43
|
+
children: (0, _lang.getLocale)(filterPredicate)
|
|
44
|
+
})
|
|
39
45
|
};
|
|
40
46
|
}
|
|
41
47
|
static generatorTermModifierOption(filterTermModifier) {
|
|
@@ -66,9 +72,10 @@ class FilterItemUtils {
|
|
|
66
72
|
value: {
|
|
67
73
|
filterTermModifier
|
|
68
74
|
},
|
|
69
|
-
label: /*#__PURE__*/
|
|
70
|
-
className: "select-option-name"
|
|
71
|
-
|
|
75
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
76
|
+
className: "select-option-name",
|
|
77
|
+
children: FILTER_TERM_MODIFIER_SHOW[filterTermModifier]
|
|
78
|
+
})
|
|
72
79
|
};
|
|
73
80
|
}
|
|
74
81
|
static generatorSingleSelectOption(option) {
|
|
@@ -76,17 +83,19 @@ class FilterItemUtils {
|
|
|
76
83
|
value: {
|
|
77
84
|
columnOption: option
|
|
78
85
|
},
|
|
79
|
-
label: /*#__PURE__*/
|
|
80
|
-
className: "select-option-name"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
87
|
+
className: "select-option-name",
|
|
88
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
89
|
+
className: "single-select-option",
|
|
90
|
+
style: {
|
|
91
|
+
background: option.color,
|
|
92
|
+
color: option.textColor || null
|
|
93
|
+
},
|
|
94
|
+
title: option.name,
|
|
95
|
+
"aria-label": option.name,
|
|
96
|
+
children: option.name
|
|
97
|
+
})
|
|
98
|
+
})
|
|
90
99
|
};
|
|
91
100
|
}
|
|
92
101
|
static generatorMultipleSelectOption(option, filterTerm) {
|
|
@@ -94,21 +103,24 @@ class FilterItemUtils {
|
|
|
94
103
|
value: {
|
|
95
104
|
columnOption: option
|
|
96
105
|
},
|
|
97
|
-
label: /*#__PURE__*/
|
|
98
|
-
className: "select-option-name multiple-option-name"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
107
|
+
className: "select-option-name multiple-option-name",
|
|
108
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
109
|
+
className: "multiple-select-option",
|
|
110
|
+
style: {
|
|
111
|
+
background: option.color,
|
|
112
|
+
color: option.textColor
|
|
113
|
+
},
|
|
114
|
+
title: option.name,
|
|
115
|
+
"aria-label": option.name,
|
|
116
|
+
children: option.name
|
|
117
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
118
|
+
className: "multiple-check-icon",
|
|
119
|
+
children: filterTerm.indexOf(option.id) > -1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
120
|
+
className: "option-edit dtable-font dtable-icon-check-mark"
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
})
|
|
112
124
|
};
|
|
113
125
|
}
|
|
114
126
|
static generatorConjunctionOptions() {
|
|
@@ -116,16 +128,18 @@ class FilterItemUtils {
|
|
|
116
128
|
value: {
|
|
117
129
|
filterConjunction: 'And'
|
|
118
130
|
},
|
|
119
|
-
label: /*#__PURE__*/
|
|
120
|
-
className: "select-option-name"
|
|
121
|
-
|
|
131
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
132
|
+
className: "select-option-name",
|
|
133
|
+
children: (0, _lang.getLocale)('And')
|
|
134
|
+
})
|
|
122
135
|
}, {
|
|
123
136
|
value: {
|
|
124
137
|
filterConjunction: 'Or'
|
|
125
138
|
},
|
|
126
|
-
label: /*#__PURE__*/
|
|
127
|
-
className: "select-option-name"
|
|
128
|
-
|
|
139
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
140
|
+
className: "select-option-name",
|
|
141
|
+
children: (0, _lang.getLocale)('Or')
|
|
142
|
+
})
|
|
129
143
|
}];
|
|
130
144
|
}
|
|
131
145
|
static getActiveConjunctionOption(conjunction) {
|
|
@@ -134,18 +148,20 @@ class FilterItemUtils {
|
|
|
134
148
|
value: {
|
|
135
149
|
filterConjunction: 'And'
|
|
136
150
|
},
|
|
137
|
-
label: /*#__PURE__*/
|
|
138
|
-
className: "select-option-name"
|
|
139
|
-
|
|
151
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
152
|
+
className: "select-option-name",
|
|
153
|
+
children: (0, _lang.getLocale)('And')
|
|
154
|
+
})
|
|
140
155
|
};
|
|
141
156
|
}
|
|
142
157
|
return {
|
|
143
158
|
value: {
|
|
144
159
|
filterConjunction: 'Or'
|
|
145
160
|
},
|
|
146
|
-
label: /*#__PURE__*/
|
|
147
|
-
className: "select-option-name"
|
|
148
|
-
|
|
161
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
162
|
+
className: "select-option-name",
|
|
163
|
+
children: (0, _lang.getLocale)('Or')
|
|
164
|
+
})
|
|
149
165
|
};
|
|
150
166
|
}
|
|
151
167
|
}
|