dtable-ui-component 6.0.110-hap.1 → 6.0.110-hum.3
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 +35 -42
- package/lib/ActivityIndicator/index.js +9 -9
- package/lib/AsyncUserSelect/index.js +3 -3
- package/lib/Badge/index.js +31 -27
- package/lib/CheckboxEditor/index.js +14 -15
- package/lib/CollaboratorEditor/index.js +15 -16
- 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/body/index.js +9 -7
- 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 +6 -8
- package/lib/DTableColorPicker/index.js +12 -13
- package/lib/DTableColorPicker/utils.js +1 -1
- package/lib/DTableCommonAddTool/index.js +2 -2
- package/lib/DTableCustomizeSelect/index.css +30 -59
- package/lib/DTableCustomizeSelect/index.js +11 -10
- package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +109 -0
- package/lib/DTableCustomizeSelect/select-option-group/index.css +129 -0
- package/lib/DTableCustomizeSelect/select-option-group/index.js +250 -0
- package/lib/DTableCustomizeSelect/select-option-group/option.js +48 -0
- package/lib/DTableCustomizeSelect/select-option-group/search-input.js +135 -0
- package/lib/DTableCustomizeSelect/util.js +12 -0
- package/lib/DTableFiltersPopover/index.js +1 -1
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +2 -2
- package/lib/DTableFiltersPopover/utils/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-group.js +2 -2
- package/lib/DTableFiltersPopover/widgets/filter-item.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +3 -3
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/rate-item.js +5 -5
- package/lib/DTableGroupSelect/index.css +3 -16
- package/lib/DTableGroupSelect/select-option-group.css +3 -3
- package/lib/DTableGroupSelect/select-option-group.js +10 -11
- package/lib/DTableIcon/index.js +4 -4
- package/lib/DTableIcon/svg-icon.js +4 -4
- package/lib/DTableModalHeader/index.js +8 -6
- package/lib/DTableRadioGroup/index.js +3 -3
- package/lib/DTableSelect/dtable-select-label.js +1 -1
- package/lib/DTableSelect/index.js +145 -44
- package/lib/DTableSelect/select-dropdown-indicator/index.css +12 -0
- package/lib/DTableSelect/select-dropdown-indicator/index.js +20 -0
- package/lib/DTableSelect/select-style.js +134 -0
- package/lib/DTableSelect/user-select.css +3 -50
- package/lib/DateEditor/index.js +10 -13
- package/lib/DateEditor/pc-editor.js +1 -1
- package/lib/DatePicker/utils.js +4 -4
- package/lib/DepartmentMultipleSelectEditor/index.js +3 -3
- package/lib/DepartmentSelectFilter/index.js +2 -5
- package/lib/DepartmentSingleSelectEditor/index.js +14 -15
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +2 -2
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +6 -6
- package/lib/DigitalSignEditor/index.js +14 -15
- package/lib/DigitalSignEditor/mb-editor/index.js +4 -4
- package/lib/DigitalSignEditor/pc-editor/index.js +6 -7
- 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/Drawer/index.js +2 -3
- package/lib/FieldDisplaySetting/field-item.js +1 -1
- package/lib/FieldDisplaySetting/index.js +9 -11
- package/lib/FileEditor/files-previewer/index.js +14 -15
- 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/index.js +14 -15
- 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/FileEditor/pc-editor/index.js +3 -3
- 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 +9 -15
- package/lib/GeolocationEditor/index.js +19 -23
- package/lib/GeolocationEditor/map-editor-utils.js +6 -10
- package/lib/GeolocationEditor/mb-editor/index.js +23 -27
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +6 -9
- package/lib/GeolocationEditor/pc-editor/country-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/index.js +15 -21
- package/lib/GeolocationEditor/pc-editor/location-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +9 -13
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +6 -9
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +7 -24
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +3 -20
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +1 -1
- package/lib/GeolocationEditor/pc-editor/province-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/selector-list.js +1 -1
- package/lib/HtmlLongTextFormatter/index.js +1 -1
- package/lib/Icon/index.js +17 -13
- package/lib/Icon/load-sprite.js +2 -13
- package/lib/IconButton/index.js +14 -11
- package/lib/ImageEditor/images-previewer/image-preview/index.js +1 -1
- package/lib/ImageEditor/index.js +14 -15
- 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 +37 -34
- package/lib/InputItem/index.js +49 -52
- package/lib/InputItem/input.js +13 -9
- package/lib/LinkEditor/pc-popover/index.js +2 -3
- package/lib/List/index.js +21 -17
- package/lib/List/list-item.js +52 -50
- 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/MobileModal/index.js +10 -7
- package/lib/Modal/alert.js +2 -2
- package/lib/Modal/modal.js +31 -28
- package/lib/Modal/prompt.js +10 -10
- package/lib/MultipleSelectEditor/index.js +8 -6
- package/lib/MultipleSelectFormatter/index.js +1 -1
- package/lib/PhoneNumberLink/index.js +1 -1
- package/lib/Picker/AbstractPicker.js +28 -26
- package/lib/Popover/index.js +12 -9
- package/lib/Popover/item.js +26 -22
- package/lib/Progress/index.js +8 -10
- package/lib/Radio/Radio.js +15 -13
- package/lib/Radio/RadioItem.js +18 -18
- package/lib/RateFormatter/index.js +2 -2
- package/lib/RoleStatusEditor/index.js +1 -1
- package/lib/RowExpand/index.js +6 -7
- package/lib/RowExpandDialog/body/index.js +14 -14
- package/lib/RowExpandDialog/column-content/index.js +1 -1
- package/lib/RowExpandDialog/header/index.js +3 -4
- package/lib/RowExpandDialog/index.js +32 -43
- package/lib/RowExpandEditor/add-btn/index.js +6 -7
- package/lib/RowExpandEditor/checkbox-editor/index.js +6 -7
- package/lib/RowExpandEditor/collaborator-editor/index.js +6 -7
- package/lib/RowExpandEditor/date-editor/index.js +6 -7
- package/lib/RowExpandEditor/department-editor/index.js +6 -7
- package/lib/RowExpandEditor/digital-sign-editor/index.js +6 -7
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +4 -4
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +4 -4
- package/lib/RowExpandEditor/duration-editor/index.js +6 -7
- package/lib/RowExpandEditor/email-editor/index.js +6 -7
- 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/file-editor/index.js +6 -7
- package/lib/RowExpandEditor/geolocation-editor/index.js +6 -7
- package/lib/RowExpandEditor/image-editor/index.js +6 -7
- 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/index.js +10 -11
- package/lib/RowExpandEditor/long-text-editor/index.js +6 -7
- package/lib/RowExpandEditor/multiple-select-editor/index.js +6 -7
- 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/number-editor/index.js +6 -7
- package/lib/RowExpandEditor/rate-editor/index.js +6 -7
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +1 -1
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +5 -5
- package/lib/RowExpandEditor/single-select-editor/index.js +6 -7
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +4 -4
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +3 -3
- package/lib/RowExpandEditor/text-editor/index.js +6 -7
- package/lib/RowExpandEditor/url-editor/index.js +6 -7
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +2 -2
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +2 -2
- package/lib/RowExpandFormatter/department-formatter/index.js +3 -6
- package/lib/RowExpandFormatter/email-formatter/index.js +1 -1
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +2 -2
- package/lib/RowExpandFormatter/formula-formatter/index.js +11 -17
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +2 -2
- package/lib/RowExpandFormatter/index.js +7 -11
- 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 +2 -2
- package/lib/RowExpandFormatter/url-formatter/index.js +2 -2
- package/lib/RowExpandView/body/index.js +15 -13
- package/lib/RowExpandView/index.js +28 -39
- package/lib/SelectOptionGroup/index.css +35 -17
- package/lib/SelectOptionGroup/index.js +44 -6
- package/lib/SelectedDepartments/index.js +3 -3
- package/lib/SimpleLongTextFormatter/index.js +2 -2
- package/lib/SingleSelectEditor/index.js +8 -6
- package/lib/TabBar/Tab.js +10 -10
- package/lib/TabBar/index.js +6 -7
- package/lib/Tabs/index.js +9 -10
- package/lib/TextareaItem/index.js +45 -43
- package/lib/Toast/index.js +5 -5
- package/lib/assets/icons/close.svg +1 -0
- package/lib/formatterConfig/index.js +3 -3
- package/lib/select-editor/index.js +14 -15
- package/lib/select-editor/pc-editor/index.js +5 -5
- package/lib/toaster/alert.js +1 -1
- package/lib/toaster/toast.js +1 -1
- package/lib/toaster/toastManager.js +14 -12
- package/lib/toaster/toaster.js +9 -12
- package/lib/utils/class.js +3 -3
- package/lib/utils/departments.js +4 -3
- package/lib/utils/getLocale.js +5 -11
- package/lib/utils/object-utils.js +4 -5
- package/lib/utils/url.js +4 -4
- package/package.json +2 -2
- package/lib/DTableSelect/utils.js +0 -227
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _ClickOutside = _interopRequireDefault(require("../../ClickOutside"));
|
|
12
|
+
var _searchInput = _interopRequireDefault(require("./search-input"));
|
|
13
|
+
var _option = _interopRequireDefault(require("./option"));
|
|
14
|
+
var _KeyCodes = _interopRequireDefault(require("./KeyCodes"));
|
|
15
|
+
require("./index.css");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const OPTION_HEIGHT = 32;
|
|
18
|
+
class SelectOptionGroup extends _react.Component {
|
|
19
|
+
constructor(props) {
|
|
20
|
+
super(props);
|
|
21
|
+
this.resetMenuStyle = () => {
|
|
22
|
+
const {
|
|
23
|
+
isInModal,
|
|
24
|
+
position
|
|
25
|
+
} = this.props;
|
|
26
|
+
const {
|
|
27
|
+
top,
|
|
28
|
+
height
|
|
29
|
+
} = this.optionGroupRef.getBoundingClientRect();
|
|
30
|
+
if (isInModal) {
|
|
31
|
+
if (position.y + position.height + height > window.innerHeight) {
|
|
32
|
+
this.optionGroupRef.style.top = position.y - height + 'px';
|
|
33
|
+
}
|
|
34
|
+
this.optionGroupRef.style.opacity = 1;
|
|
35
|
+
} else {
|
|
36
|
+
if (height + top > window.innerHeight) {
|
|
37
|
+
const borderWidth = 2;
|
|
38
|
+
this.optionGroupRef.style.top = -1 * (height + borderWidth) + 'px';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
this.onHotKey = event => {
|
|
43
|
+
const keyCode = event.keyCode;
|
|
44
|
+
if (keyCode === _KeyCodes.default.UpArrow) {
|
|
45
|
+
this.onPressUp();
|
|
46
|
+
} else if (keyCode === _KeyCodes.default.DownArrow) {
|
|
47
|
+
this.onPressDown();
|
|
48
|
+
} else if (keyCode === _KeyCodes.default.Enter) {
|
|
49
|
+
let option = this.filterOptions && this.filterOptions[this.state.activeIndex];
|
|
50
|
+
if (option) {
|
|
51
|
+
this.props.onSelectOption(option.value);
|
|
52
|
+
if (!this.props.supportMultipleSelect) {
|
|
53
|
+
this.props.closeSelect();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} else if (keyCode === _KeyCodes.default.Tab || keyCode === _KeyCodes.default.Escape) {
|
|
57
|
+
this.props.closeSelect();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
this.onPressUp = () => {
|
|
61
|
+
if (this.state.activeIndex > 0) {
|
|
62
|
+
this.setState({
|
|
63
|
+
activeIndex: this.state.activeIndex - 1
|
|
64
|
+
}, () => {
|
|
65
|
+
this.scrollContent();
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
this.onPressDown = () => {
|
|
70
|
+
if (this.filterOptions && this.state.activeIndex < this.filterOptions.length - 1) {
|
|
71
|
+
this.setState({
|
|
72
|
+
activeIndex: this.state.activeIndex + 1
|
|
73
|
+
}, () => {
|
|
74
|
+
this.scrollContent();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
this.onMouseDown = e => {
|
|
79
|
+
const {
|
|
80
|
+
isInModal
|
|
81
|
+
} = this.props;
|
|
82
|
+
// prevent event propagation when click option or search input
|
|
83
|
+
if (isInModal) {
|
|
84
|
+
e.stopPropagation();
|
|
85
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
this.scrollContent = () => {
|
|
89
|
+
const {
|
|
90
|
+
offsetHeight,
|
|
91
|
+
scrollTop
|
|
92
|
+
} = this.optionGroupContentRef;
|
|
93
|
+
this.setState({
|
|
94
|
+
disableHover: true
|
|
95
|
+
});
|
|
96
|
+
this.timer = setTimeout(() => {
|
|
97
|
+
this.setState({
|
|
98
|
+
disableHover: false
|
|
99
|
+
});
|
|
100
|
+
}, 500);
|
|
101
|
+
if (this.state.activeIndex * OPTION_HEIGHT === 0) {
|
|
102
|
+
this.optionGroupContentRef.scrollTop = 0;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (this.state.activeIndex * OPTION_HEIGHT < scrollTop) {
|
|
106
|
+
this.optionGroupContentRef.scrollTop = scrollTop - OPTION_HEIGHT;
|
|
107
|
+
} else if (this.state.activeIndex * OPTION_HEIGHT > offsetHeight + scrollTop) {
|
|
108
|
+
this.optionGroupContentRef.scrollTop = scrollTop + OPTION_HEIGHT;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
this.changeIndex = index => {
|
|
112
|
+
this.setState({
|
|
113
|
+
activeIndex: index
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
this.onChangeSearch = searchVal => {
|
|
117
|
+
let value = searchVal || '';
|
|
118
|
+
if (value !== this.state.searchVal) {
|
|
119
|
+
this.setState({
|
|
120
|
+
searchVal: value,
|
|
121
|
+
activeIndex: -1
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
this.clearSearch = () => {
|
|
126
|
+
this.setState({
|
|
127
|
+
searchVal: '',
|
|
128
|
+
activeIndex: -1
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
this.renderOptGroup = searchVal => {
|
|
132
|
+
let {
|
|
133
|
+
noOptionsPlaceholder,
|
|
134
|
+
onSelectOption,
|
|
135
|
+
value
|
|
136
|
+
} = this.props;
|
|
137
|
+
this.filterOptions = this.props.getFilterOptions(searchVal);
|
|
138
|
+
if (this.filterOptions.length === 0) {
|
|
139
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
140
|
+
className: "none-search-result",
|
|
141
|
+
children: noOptionsPlaceholder
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return this.filterOptions.map((opt, i) => {
|
|
145
|
+
let key = opt.value.column ? opt.value.column.key : i;
|
|
146
|
+
let isActive = this.state.activeIndex === i;
|
|
147
|
+
const isSelected = value && (opt.value === value.value || JSON.stringify(opt.value) === JSON.stringify(value.value));
|
|
148
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_option.default, {
|
|
149
|
+
index: i,
|
|
150
|
+
isActive: isActive,
|
|
151
|
+
value: opt.value,
|
|
152
|
+
onSelectOption: onSelectOption,
|
|
153
|
+
changeIndex: this.changeIndex,
|
|
154
|
+
supportMultipleSelect: this.props.supportMultipleSelect,
|
|
155
|
+
disableHover: this.state.disableHover,
|
|
156
|
+
children: [opt.label, isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
157
|
+
className: "dtable-font dtable-icon-check"
|
|
158
|
+
})]
|
|
159
|
+
}, key);
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
this.state = {
|
|
163
|
+
searchVal: '',
|
|
164
|
+
activeIndex: -1,
|
|
165
|
+
disableHover: false
|
|
166
|
+
};
|
|
167
|
+
this.filterOptions = null;
|
|
168
|
+
this.timer = null;
|
|
169
|
+
}
|
|
170
|
+
componentDidMount() {
|
|
171
|
+
window.addEventListener('keydown', this.onHotKey);
|
|
172
|
+
setTimeout(() => {
|
|
173
|
+
this.resetMenuStyle();
|
|
174
|
+
}, 1);
|
|
175
|
+
}
|
|
176
|
+
componentWillUnmount() {
|
|
177
|
+
this.filterOptions = null;
|
|
178
|
+
this.timer && clearTimeout(this.timer);
|
|
179
|
+
window.removeEventListener('keydown', this.onHotKey);
|
|
180
|
+
}
|
|
181
|
+
render() {
|
|
182
|
+
const {
|
|
183
|
+
searchable,
|
|
184
|
+
searchPlaceholder,
|
|
185
|
+
top,
|
|
186
|
+
left,
|
|
187
|
+
minWidth,
|
|
188
|
+
value,
|
|
189
|
+
isShowSelected,
|
|
190
|
+
isInModal,
|
|
191
|
+
position,
|
|
192
|
+
className
|
|
193
|
+
} = this.props;
|
|
194
|
+
let {
|
|
195
|
+
searchVal
|
|
196
|
+
} = this.state;
|
|
197
|
+
let style = {
|
|
198
|
+
top: top || 0,
|
|
199
|
+
left: left || 0
|
|
200
|
+
};
|
|
201
|
+
if (minWidth) {
|
|
202
|
+
style = {
|
|
203
|
+
top: top || 0,
|
|
204
|
+
left: left || 0,
|
|
205
|
+
minWidth
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
if (isInModal) {
|
|
209
|
+
style = {
|
|
210
|
+
position: 'fixed',
|
|
211
|
+
left: position.x,
|
|
212
|
+
top: position.y + position.height,
|
|
213
|
+
minWidth: position.width,
|
|
214
|
+
opacity: 0
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
style.top = style.top + 4;
|
|
218
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
|
|
219
|
+
onClickOutside: this.props.onClickOutside,
|
|
220
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
221
|
+
className: (0, _classnames.default)('seatable-option-group', className ? 'seatable-option-group-' + className : '', {
|
|
222
|
+
'pt-0': isShowSelected
|
|
223
|
+
}),
|
|
224
|
+
ref: ref => this.optionGroupRef = ref,
|
|
225
|
+
style: style,
|
|
226
|
+
onMouseDown: this.onMouseDown,
|
|
227
|
+
children: [isShowSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
228
|
+
className: "editor-list-delete mb-2",
|
|
229
|
+
onClick: e => e.stopPropagation(),
|
|
230
|
+
children: value.label || ''
|
|
231
|
+
}), searchable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
232
|
+
className: "seatable-option-group-search",
|
|
233
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_searchInput.default, {
|
|
234
|
+
className: "option-search-control",
|
|
235
|
+
placeholder: searchPlaceholder,
|
|
236
|
+
onChange: this.onChangeSearch,
|
|
237
|
+
clearValue: this.clearSearch,
|
|
238
|
+
autoFocus: true,
|
|
239
|
+
isClearable: true
|
|
240
|
+
})
|
|
241
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
242
|
+
className: "seatable-option-group-content",
|
|
243
|
+
ref: ref => this.optionGroupContentRef = ref,
|
|
244
|
+
children: this.renderOptGroup(searchVal)
|
|
245
|
+
})]
|
|
246
|
+
})
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
var _default = exports.default = SelectOptionGroup;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _util = require("../util");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
class Option extends _react.Component {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.onSelectOption = event => {
|
|
17
|
+
if (this.props.supportMultipleSelect) {
|
|
18
|
+
event.stopPropagation();
|
|
19
|
+
}
|
|
20
|
+
this.props.onSelectOption(this.props.value, event);
|
|
21
|
+
};
|
|
22
|
+
this.onMouseEnter = () => {
|
|
23
|
+
if (!this.props.disableHover) {
|
|
24
|
+
this.props.changeIndex(this.props.index);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
this.onMouseLeave = () => {
|
|
28
|
+
if (!this.props.disableHover) {
|
|
29
|
+
this.props.changeIndex(-1);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
35
|
+
className: (0, _classnames.default)('seatable-select-option', {
|
|
36
|
+
'seatable-select-option-active': this.props.isActive
|
|
37
|
+
}),
|
|
38
|
+
tabIndex: "0",
|
|
39
|
+
role: "menuitem",
|
|
40
|
+
onClick: this.onSelectOption,
|
|
41
|
+
onKeyDown: _util.onKeyDown,
|
|
42
|
+
onMouseEnter: this.onMouseEnter,
|
|
43
|
+
onMouseLeave: this.onMouseLeave,
|
|
44
|
+
children: this.props.children
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
var _default = exports.default = Option;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _DTableIcon = _interopRequireDefault(require("../../DTableIcon"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
class SearchInput extends _react.Component {
|
|
14
|
+
constructor(props) {
|
|
15
|
+
super(props);
|
|
16
|
+
this.onCompositionStart = () => {
|
|
17
|
+
this.isInputtingChinese = true;
|
|
18
|
+
};
|
|
19
|
+
this.onChange = e => {
|
|
20
|
+
this.timer && clearTimeout(this.timer);
|
|
21
|
+
const {
|
|
22
|
+
onChange,
|
|
23
|
+
wait = 100
|
|
24
|
+
} = this.props;
|
|
25
|
+
let text = e.target.value;
|
|
26
|
+
this.setState({
|
|
27
|
+
searchValue: text || ''
|
|
28
|
+
}, () => {
|
|
29
|
+
if (this.isInputtingChinese) return;
|
|
30
|
+
this.timer = setTimeout(() => {
|
|
31
|
+
onChange && onChange(this.state.searchValue.trim());
|
|
32
|
+
}, wait);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
this.onCompositionEnd = e => {
|
|
36
|
+
this.isInputtingChinese = false;
|
|
37
|
+
this.onChange(e);
|
|
38
|
+
};
|
|
39
|
+
this.clearSearch = e => {
|
|
40
|
+
e && e.stopPropagation && e.stopPropagation();
|
|
41
|
+
const {
|
|
42
|
+
clearValue
|
|
43
|
+
} = this.props;
|
|
44
|
+
this.setState({
|
|
45
|
+
searchValue: ''
|
|
46
|
+
}, () => {
|
|
47
|
+
clearValue && clearValue();
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
this.setFocus = isSelectAllText => {
|
|
51
|
+
if (this.inputRef === document.activeElement) return;
|
|
52
|
+
this.inputRef.focus();
|
|
53
|
+
if (isSelectAllText) {
|
|
54
|
+
const txtLength = this.state.searchValue.length;
|
|
55
|
+
this.inputRef.setSelectionRange(0, txtLength);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
this.renderClear = () => {
|
|
59
|
+
const {
|
|
60
|
+
isClearable,
|
|
61
|
+
clearClassName
|
|
62
|
+
} = this.props;
|
|
63
|
+
const {
|
|
64
|
+
searchValue
|
|
65
|
+
} = this.state;
|
|
66
|
+
if (!isClearable || !searchValue) return null;
|
|
67
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
68
|
+
className: (0, _classnames.default)('search-text-clear input-icon-addon', clearClassName),
|
|
69
|
+
onClick: this.clearSearch,
|
|
70
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
|
|
71
|
+
symbol: "close"
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
this.state = {
|
|
76
|
+
searchValue: props.value || ''
|
|
77
|
+
};
|
|
78
|
+
this.isInputtingChinese = false;
|
|
79
|
+
this.timer = null;
|
|
80
|
+
this.inputRef = null;
|
|
81
|
+
}
|
|
82
|
+
componentDidMount() {
|
|
83
|
+
if (this.props.autoFocus && this.inputRef && this.inputRef !== document.activeElement) {
|
|
84
|
+
setTimeout(() => {
|
|
85
|
+
this.inputRef.focus();
|
|
86
|
+
}, 0);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
90
|
+
if (nextProps.value !== this.props.value) {
|
|
91
|
+
this.setState({
|
|
92
|
+
searchValue: nextProps.value
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
componentWillUnmount() {
|
|
97
|
+
this.timer && clearTimeout(this.timer);
|
|
98
|
+
this.timer = null;
|
|
99
|
+
this.inputRef = null;
|
|
100
|
+
}
|
|
101
|
+
render() {
|
|
102
|
+
const {
|
|
103
|
+
placeholder,
|
|
104
|
+
autoFocus,
|
|
105
|
+
className,
|
|
106
|
+
onKeyDown,
|
|
107
|
+
disabled = false,
|
|
108
|
+
style = {},
|
|
109
|
+
isClearable
|
|
110
|
+
} = this.props;
|
|
111
|
+
const {
|
|
112
|
+
searchValue
|
|
113
|
+
} = this.state;
|
|
114
|
+
const inputWidth = isClearable && searchValue ? 'calc(100% - 40px)' : '100%';
|
|
115
|
+
style.width = inputWidth;
|
|
116
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
117
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
118
|
+
type: "text",
|
|
119
|
+
name: "search-input",
|
|
120
|
+
value: searchValue,
|
|
121
|
+
className: (0, _classnames.default)('form-control', className),
|
|
122
|
+
onChange: this.onChange,
|
|
123
|
+
autoFocus: autoFocus,
|
|
124
|
+
placeholder: placeholder,
|
|
125
|
+
onCompositionStart: this.onCompositionStart,
|
|
126
|
+
onCompositionEnd: this.onCompositionEnd,
|
|
127
|
+
onKeyDown: onKeyDown,
|
|
128
|
+
disabled: disabled,
|
|
129
|
+
style: style,
|
|
130
|
+
ref: ref => this.inputRef = ref
|
|
131
|
+
}), this.renderClear()]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
var _default = exports.default = SearchInput;
|
|
@@ -156,7 +156,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
156
156
|
firstDayOfWeek: firstDayOfWeek,
|
|
157
157
|
updateFilters: this.updateFilters
|
|
158
158
|
}), !isSupportAdvanced && !readOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCommonAddTool.default, {
|
|
159
|
-
className:
|
|
159
|
+
className: "popover-add-tool ".concat(canAddFilter ? '' : 'disabled'),
|
|
160
160
|
callBack: canAddFilter ? () => this.addFilter() : () => {},
|
|
161
161
|
footerName: (0, _lang.getLocale)('Add_filter'),
|
|
162
162
|
addIconClassName: "popover-add-icon"
|
|
@@ -107,7 +107,7 @@ class FilterItemUtils {
|
|
|
107
107
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
108
108
|
className: "single-select-check-icon",
|
|
109
109
|
children: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.id) === option.id && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
110
|
-
className: "option-edit dtable-font dtable-icon-check
|
|
110
|
+
className: "option-edit dtable-font dtable-icon-check"
|
|
111
111
|
})
|
|
112
112
|
})]
|
|
113
113
|
})
|
|
@@ -132,7 +132,7 @@ class FilterItemUtils {
|
|
|
132
132
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
133
133
|
className: "multiple-check-icon",
|
|
134
134
|
children: filterTerm.indexOf(option.id) > -1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
135
|
-
className: "option-edit dtable-font dtable-icon-check
|
|
135
|
+
className: "option-edit dtable-font dtable-icon-check"
|
|
136
136
|
})
|
|
137
137
|
})]
|
|
138
138
|
})
|
|
@@ -407,7 +407,7 @@ const getMediaUrl = () => {
|
|
|
407
407
|
};
|
|
408
408
|
const generateDefaultUser = name => {
|
|
409
409
|
const mediaUrl = getMediaUrl();
|
|
410
|
-
const defaultAvatarUrl =
|
|
410
|
+
const defaultAvatarUrl = "".concat(mediaUrl, "avatars/default.png");
|
|
411
411
|
return {
|
|
412
412
|
name,
|
|
413
413
|
email: name,
|
|
@@ -49,7 +49,7 @@ class CollaboratorFilter extends _react.Component {
|
|
|
49
49
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
50
50
|
className: "collaborator-check-icon",
|
|
51
51
|
children: isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
52
|
-
className: "option-edit dtable-font dtable-icon-check
|
|
52
|
+
className: "option-edit dtable-font dtable-icon-check"
|
|
53
53
|
})
|
|
54
54
|
})]
|
|
55
55
|
})
|
|
@@ -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-".concat(groupIndex, "-").concat(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-".concat(level)),
|
|
161
161
|
children: [!readOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
162
162
|
className: "delete-filter",
|
|
163
163
|
onClick: this.deleteFilterGroup,
|
|
@@ -790,7 +790,7 @@ class FilterItem extends _react.default.Component {
|
|
|
790
790
|
isLocked: readOnly
|
|
791
791
|
})
|
|
792
792
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
793
|
-
className:
|
|
793
|
+
className: "filter-predicate ml-2 ".concat(_isCheckboxColumn ? 'filter-checkbox-predicate' : ''),
|
|
794
794
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSelect.default, {
|
|
795
795
|
value: activePredicate,
|
|
796
796
|
options: filterPredicateOptions,
|
|
@@ -412,20 +412,20 @@
|
|
|
412
412
|
|
|
413
413
|
.filter-header-icon {
|
|
414
414
|
display: inline-block;
|
|
415
|
-
padding: 0
|
|
415
|
+
padding-right: 0.5rem;
|
|
416
416
|
margin-left: -0.3125rem;
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
.filter-header-icon .dtable-font,
|
|
420
420
|
.filter-header-icon .multicolor-icon {
|
|
421
421
|
font-size: 14px;
|
|
422
|
-
color: #
|
|
422
|
+
color: #999;
|
|
423
423
|
cursor: default;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
.option.option-active .filter-header-icon .dtable-font,
|
|
427
427
|
.option.option-active .filter-header-icon .multicolor-icon {
|
|
428
|
-
color: #
|
|
428
|
+
color: #999;
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
.dtable-ui-filters-list .single-select-option,
|
|
@@ -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-".concat(index));
|
|
265
265
|
}
|
|
266
266
|
const {
|
|
267
267
|
error_message
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _reactstrap = require("reactstrap");
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -56,20 +57,19 @@ class RateItem extends _react.default.Component {
|
|
|
56
57
|
};
|
|
57
58
|
let style = itemStyle;
|
|
58
59
|
if (enterRateItemIndex >= rateItemIndex) {
|
|
59
|
-
style = {
|
|
60
|
-
...itemStyle,
|
|
60
|
+
style = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, itemStyle), {}, {
|
|
61
61
|
color: rate_style_color,
|
|
62
62
|
opacity: 0.4
|
|
63
|
-
};
|
|
63
|
+
});
|
|
64
64
|
}
|
|
65
65
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
66
66
|
onMouseEnter: this.onMouseEnterRateItem,
|
|
67
67
|
onMouseLeave: this.onMouseLeaveRateItem,
|
|
68
68
|
style: style,
|
|
69
69
|
onClick: this.onChangeRateNumber,
|
|
70
|
-
className:
|
|
70
|
+
className: "rate-item ".concat(value >= rateItemIndex ? 'rate-item-active' : ''),
|
|
71
71
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
72
|
-
className:
|
|
72
|
+
className: "dtable-font ".concat(rateShowType),
|
|
73
73
|
ref: this.tooltipRef
|
|
74
74
|
}), editable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.UncontrolledTooltip, {
|
|
75
75
|
placement: "bottom",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
border: none;
|
|
109
109
|
border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
|
|
110
110
|
border-radius: 4px 4px 0 0;
|
|
111
|
-
padding: .375rem
|
|
111
|
+
padding: .375rem 1rem !important;
|
|
112
112
|
height: 32px;
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -118,21 +118,8 @@
|
|
|
118
118
|
box-shadow: none !important;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
.
|
|
121
|
+
.option-group-content .dtable-icon-check {
|
|
122
122
|
color: #666666;
|
|
123
123
|
font-size: 14px;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
.seatable-group-select .clear-search-text {
|
|
127
|
-
position: absolute;
|
|
128
|
-
display: inline-block;
|
|
129
|
-
height: 12px;
|
|
130
|
-
width: 12px;
|
|
131
|
-
line-height: 12px;
|
|
132
|
-
top: 4px;
|
|
133
|
-
right: 22px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.seatable-group-select .seatable-icon-btn:not(.disabled):hover {
|
|
137
|
-
background-color:#FFFFFF;
|
|
124
|
+
margin-left: 16px;
|
|
138
125
|
}
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
padding: 0.25rem 8px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.group-selector .option .dtable-icon-check
|
|
20
|
-
font-size:
|
|
19
|
+
.group-selector .option .dtable-icon-check{
|
|
20
|
+
font-size: 14px;
|
|
21
21
|
color: #666666;
|
|
22
|
-
height:
|
|
22
|
+
height: 14px !important;
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
25
|
justify-content: center;
|