dtable-ui-component 6.0.126-beta.s1 → 6.0.126
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 +14 -16
- package/lib/ActivityIndicator/index.js +7 -8
- package/lib/AsyncUserSelect/index.css +19 -46
- package/lib/AsyncUserSelect/index.js +58 -41
- package/lib/AsyncUserSelect/user-item.js +5 -6
- package/lib/AutoNumberFormatter/index.js +3 -4
- package/lib/Badge/index.js +9 -11
- package/lib/ButtonFormatter/index.js +6 -8
- package/lib/CTimeFormatter/index.js +3 -4
- package/lib/CheckboxEditor/index.js +1 -3
- package/lib/CheckboxEditor/mb-editor.js +9 -20
- package/lib/CheckboxEditor/pc-editor.js +12 -24
- package/lib/CheckboxFormatter/index.js +4 -5
- package/lib/CollaboratorEditor/index.js +2 -4
- package/lib/CollaboratorEditor/mb-editor/index.js +11 -19
- package/lib/CollaboratorEditor/pc-editor/index.js +25 -34
- package/lib/CollaboratorFormatter/index.js +8 -10
- package/lib/CollaboratorItem/index.js +4 -5
- package/lib/CollapsibleSettingLayout/index.js +9 -7
- package/lib/Comment/body/comment.js +10 -18
- package/lib/Comment/body/index.js +2 -4
- package/lib/Comment/footer/btns/index.js +4 -7
- package/lib/Comment/footer/index.js +9 -20
- package/lib/Comment/footer/input/index.js +29 -50
- package/lib/Comment/footer/input/participant/index.js +4 -5
- package/lib/Comment/footer/participants/index.js +4 -5
- package/lib/Comment/footer/participants/participant/index.js +1 -3
- package/lib/Comment/footer/participants/participant-select/index.js +8 -24
- package/lib/Comment/index.js +39 -57
- package/lib/Comment/utils/utilities.js +15 -21
- package/lib/CreatorFormatter/index.js +6 -8
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +23 -19
- package/lib/DTableColorPicker/index.css +0 -2
- package/lib/DTableColorPicker/index.js +56 -41
- package/lib/DTableColorPicker/utils.js +4 -6
- package/lib/DTableColumnIcon/index.js +6 -7
- package/lib/DTableCommonAddTool/index.css +1 -3
- package/lib/DTableCommonAddTool/index.js +6 -8
- package/lib/DTableCustomFooter/index.css +1 -3
- package/lib/DTableCustomFooter/index.js +1 -3
- package/lib/DTableCustomizeCollaboratorSelect/index.js +17 -20
- package/lib/DTableCustomizeSelect/index.css +43 -67
- package/lib/DTableCustomizeSelect/index.js +29 -40
- package/lib/DTableDropdownItem/index.js +16 -18
- package/lib/DTableDropdownMenu/index.js +8 -10
- package/lib/DTableEmptyTip/index.js +4 -5
- package/lib/DTableFiltersPopover/index.css +0 -2
- package/lib/DTableFiltersPopover/index.js +26 -41
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -5
- package/lib/DTableFiltersPopover/utils/index.js +63 -113
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -10
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +16 -13
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +18 -15
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +8 -14
- package/lib/DTableFiltersPopover/widgets/filter-group.js +34 -55
- package/lib/DTableFiltersPopover/widgets/filter-item.js +107 -170
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +136 -161
- package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -20
- package/lib/DTableGroupSelect/index.css +5 -31
- package/lib/DTableGroupSelect/index.js +13 -17
- package/lib/DTableGroupSelect/select-option-group.css +15 -11
- package/lib/DTableGroupSelect/select-option-group.js +31 -43
- package/lib/DTableIcon/index.js +6 -7
- package/lib/DTableIcon/svg-icon.js +5 -7
- package/lib/DTableModalHeader/index.js +1 -3
- package/lib/DTablePopover/index.js +13 -16
- package/lib/DTableRadio/index.js +10 -9
- package/lib/DTableRadioGroup/index.js +8 -17
- package/lib/DTableSearchInput/index.js +19 -29
- package/lib/DTableSelect/dtable-select-label.css +4 -4
- package/lib/DTableSelect/dtable-select-label.js +7 -6
- package/lib/DTableSelect/index.js +24 -25
- package/lib/DTableSelect/user-select.css +46 -7
- package/lib/DTableSelect/utils.js +82 -179
- package/lib/DTableSubDropdownMenu/index.js +8 -10
- package/lib/DTableSubDropdownToggle/index.js +12 -12
- package/lib/DTableSwitch/index.css +0 -1
- package/lib/DTableSwitch/index.js +12 -11
- package/lib/DTableToolTip/index.js +7 -8
- package/lib/DateEditor/index.js +20 -15
- package/lib/DateEditor/mb-editor/index.js +18 -31
- package/lib/DateEditor/pc-editor.js +26 -45
- package/lib/DateFormatter/index.js +4 -5
- package/lib/DatePicker/index.js +9 -15
- package/lib/DatePicker/utils.js +1 -3
- package/lib/DeleteTip/index.js +5 -6
- package/lib/DepartmentMultipleSelectEditor/index.js +25 -23
- package/lib/DepartmentSelectFilter/index.js +6 -8
- package/lib/DepartmentSingleSelectEditor/index.js +1 -3
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +48 -47
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +36 -58
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +13 -19
- package/lib/DepartmentSingleSelectFormatter/index.js +4 -6
- package/lib/DigitalSignEditor/index.js +1 -3
- package/lib/DigitalSignEditor/mb-editor/index.js +12 -20
- package/lib/DigitalSignEditor/pc-editor/index.js +17 -24
- package/lib/DigitalSignEditor/service.js +2 -4
- package/lib/DigitalSignEditor/signature-board/index.js +5 -8
- package/lib/DigitalSignEditor/utils.js +2 -4
- package/lib/DigitalSignFormatter/index.js +12 -15
- package/lib/DigitalSignFormatter/utils.js +4 -5
- package/lib/DurationEditor/index.js +21 -31
- package/lib/DurationFormatter/index.js +4 -5
- package/lib/EditEditorButton/index.js +1 -3
- package/lib/EmailFormatter/index.js +3 -4
- package/lib/FieldDisplaySetting/field-item.js +12 -12
- package/lib/FieldDisplaySetting/index.js +11 -9
- package/lib/FileEditor/files-previewer/index.js +1 -3
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +10 -18
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +7 -8
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +3 -4
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +5 -6
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +14 -21
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +29 -57
- package/lib/FileEditor/index.js +1 -3
- package/lib/FileEditor/mb-editor/index.js +28 -20
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -3
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +11 -25
- package/lib/FileEditor/pc-editor/index.js +19 -27
- package/lib/FileFormatter/index.js +26 -19
- package/lib/FileItemFormatter/index.js +6 -9
- package/lib/FileUploader/index.js +28 -45
- package/lib/FormulaFormatter/index.js +15 -29
- package/lib/GeolocationEditor/index.js +11 -12
- package/lib/GeolocationEditor/map-editor-utils.js +17 -15
- package/lib/GeolocationEditor/mb-editor/country-editor.js +17 -14
- package/lib/GeolocationEditor/mb-editor/index.js +4 -6
- package/lib/GeolocationEditor/mb-editor/location-editor.js +18 -15
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +41 -68
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +50 -89
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +17 -14
- package/lib/GeolocationEditor/mb-editor/province-editor.js +17 -14
- package/lib/GeolocationEditor/pc-editor/country-editor.js +10 -23
- package/lib/GeolocationEditor/pc-editor/index.js +12 -20
- package/lib/GeolocationEditor/pc-editor/location-editor.js +26 -31
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +34 -54
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +36 -60
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +35 -62
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +36 -65
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +19 -25
- package/lib/GeolocationEditor/pc-editor/province-editor.js +6 -13
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +5 -6
- package/lib/GeolocationEditor/pc-editor/selector-list.js +6 -7
- package/lib/GeolocationFormatter/index.js +4 -5
- package/lib/HtmlLongTextFormatter/index.js +4 -12
- package/lib/Icon/index.js +3 -5
- package/lib/IconButton/index.js +4 -6
- package/lib/ImageEditor/images-previewer/image-preview/index.js +12 -21
- package/lib/ImageEditor/images-previewer/index.js +3 -9
- package/lib/ImageEditor/index.js +1 -3
- package/lib/ImageEditor/mb-editor/index.js +28 -20
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +2 -6
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +1 -3
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +7 -21
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +3 -9
- package/lib/ImageEditor/pc-editor/index.js +11 -16
- package/lib/ImageFormatter/images-lazy-load.js +19 -11
- package/lib/ImageFormatter/index.js +11 -13
- package/lib/ImagePreviewerLightbox/index.js +15 -13
- package/lib/ImageThumbnail/index.js +10 -13
- package/lib/InputItem/custom-input.js +26 -46
- package/lib/InputItem/custom-keyboard.js +15 -18
- package/lib/InputItem/index.js +34 -50
- package/lib/InputItem/input.js +2 -4
- package/lib/LastModifierFormatter/index.js +6 -8
- package/lib/LinkEditor/index.js +33 -53
- package/lib/LinkEditor/link-editor-option.js +3 -4
- package/lib/LinkEditor/mb-popover/index.js +9 -22
- package/lib/LinkEditor/pc-popover/index.js +5 -10
- package/lib/LinkFormatter/index.js +21 -37
- package/lib/List/index.js +6 -8
- package/lib/List/list-item.js +22 -28
- package/lib/LongTextFormatter/index.js +4 -5
- package/lib/MBEditorHeader/index.js +7 -8
- package/lib/MTimeFormatter/index.js +3 -4
- package/lib/MobileFullScreenPage/body/index.js +3 -5
- package/lib/MobileFullScreenPage/header/index.js +4 -6
- package/lib/MobileFullScreenPage/index.js +13 -11
- package/lib/MobileModal/index.js +1 -3
- package/lib/MobileOperationSheet/index.js +7 -8
- package/lib/MobileSelector/empty/index.js +1 -3
- package/lib/MobileSelector/index.js +5 -7
- package/lib/MobileSelector/option/index.js +3 -5
- package/lib/MobileSelector/options/index.js +1 -3
- package/lib/MobileSelector/search/index.js +3 -5
- package/lib/MobileUpload/index.js +4 -5
- package/lib/Modal/modal.js +14 -15
- package/lib/Modal/prompt.js +4 -4
- package/lib/MultipleSelectEditor/index.js +1 -3
- package/lib/MultipleSelectFormatter/index.js +6 -8
- package/lib/NotificationPopover/index.css +1 -6
- package/lib/NotificationPopover/index.js +6 -7
- package/lib/NumberEditor/index.js +12 -21
- package/lib/NumberFormatter/index.js +4 -5
- package/lib/PhoneNumberLink/index.js +2 -4
- package/lib/Picker/AbstractPicker.js +23 -27
- package/lib/Popover/index.js +3 -4
- package/lib/Popover/item.js +7 -9
- package/lib/Progress/index.js +9 -8
- package/lib/Radio/Radio.js +4 -8
- package/lib/Radio/RadioItem.js +8 -12
- package/lib/RateFormatter/index.js +13 -13
- package/lib/RoleStatusEditor/index.js +18 -17
- package/lib/RowExpandDialog/body/index.js +32 -49
- package/lib/RowExpandDialog/column-content/index.js +5 -9
- package/lib/RowExpandDialog/header/index.js +6 -8
- package/lib/RowExpandDialog/index.js +49 -34
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +4 -5
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +8 -10
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +22 -33
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +26 -40
- package/lib/RowExpandEditor/date-editor/mb-editor.js +12 -18
- package/lib/RowExpandEditor/date-editor/pc-editor.js +15 -20
- package/lib/RowExpandEditor/department-editor/mb-editor.js +16 -11
- package/lib/RowExpandEditor/department-editor/pc-editor.js +19 -14
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +20 -34
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +21 -35
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +10 -17
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +13 -19
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +9 -19
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +13 -24
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +18 -31
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +16 -23
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +17 -29
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +13 -26
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +15 -25
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +13 -23
- package/lib/RowExpandEditor/index.js +4 -8
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +17 -18
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +10 -16
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +16 -23
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +11 -19
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +22 -33
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +8 -14
- package/lib/RowExpandEditor/number-editor/pc-editor.js +13 -20
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +12 -25
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +20 -36
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +17 -28
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +22 -34
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +4 -5
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +15 -26
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +5 -13
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +9 -18
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +2 -4
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +2 -4
- package/lib/RowExpandFormatter/email-formatter/index.js +4 -7
- package/lib/RowExpandFormatter/file-formatter/index.js +8 -9
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +10 -12
- package/lib/RowExpandFormatter/formula-formatter/index.js +19 -34
- package/lib/RowExpandFormatter/image-formatter/index.js +9 -11
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +7 -8
- package/lib/RowExpandFormatter/index.js +27 -41
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +8 -14
- package/lib/RowExpandFormatter/link-formatter/index.js +11 -19
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +3 -5
- package/lib/RowExpandFormatter/rate-formatter/index.js +11 -12
- package/lib/RowExpandFormatter/text/index.js +4 -5
- package/lib/RowExpandFormatter/url-formatter/index.js +4 -7
- package/lib/RowExpandView/body/index.js +22 -35
- package/lib/RowExpandView/column-content/index.js +3 -7
- package/lib/RowExpandView/index.js +42 -30
- package/lib/SelectItem/index.js +5 -7
- package/lib/SelectOptionGroup/index.css +25 -53
- package/lib/SelectOptionGroup/index.js +36 -84
- package/lib/SelectedDepartments/index.js +7 -9
- package/lib/SimpleLongTextFormatter/index.js +10 -16
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +3 -4
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +12 -21
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -4
- package/lib/SingleSelectEditor/index.js +1 -3
- package/lib/SingleSelectFormatter/index.js +8 -9
- package/lib/TabBar/Tab.js +14 -16
- package/lib/TabBar/index.js +18 -21
- package/lib/Tabs/index.js +1 -3
- package/lib/TextEditor/index.js +14 -23
- package/lib/TextFormatter/index.js +3 -4
- package/lib/TextareaItem/index.js +19 -26
- package/lib/Toast/index.js +3 -4
- package/lib/UrlFormatter/index.js +3 -4
- package/lib/common/editor-base.js +7 -12
- package/lib/hooks/common-hooks.js +2 -4
- package/lib/index.js +0 -7
- package/lib/select-editor/index.js +1 -3
- package/lib/select-editor/mb-editor/index.js +17 -28
- package/lib/select-editor/pc-editor/index.js +27 -42
- package/lib/toaster/alert.js +6 -7
- package/lib/toaster/toast.js +2 -3
- package/lib/toaster/toastManager.js +2 -4
- package/lib/utils/cell.js +8 -11
- package/lib/utils/column-utils.js +8 -14
- package/lib/utils/departments.js +1 -3
- package/lib/utils/url.js +24 -31
- package/lib/utils/utils.js +2 -6
- package/package.json +8 -8
- package/lib/DTableCustomizeSearchInput/index.css +0 -81
- package/lib/DTableCustomizeSearchInput/index.js +0 -141
- package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +0 -109
- package/lib/DTableCustomizeSelect/select-option-group/index.css +0 -134
- package/lib/DTableCustomizeSelect/select-option-group/index.js +0 -260
- package/lib/DTableCustomizeSelect/select-option-group/option.js +0 -48
- package/lib/DTableCustomizeSelect/util.js +0 -12
- package/lib/DTableSelect/select-dropdown-indicator/index.css +0 -16
- package/lib/DTableSelect/select-dropdown-indicator/index.js +0 -26
- package/lib/DTableSelect/select-style.js +0 -133
- package/lib/assets/icons/close.svg +0 -1
- package/lib/assets/icons/down.svg +0 -3
|
@@ -1,260 +0,0 @@
|
|
|
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 _DTableCustomizeSearchInput = _interopRequireDefault(require("../../DTableCustomizeSearchInput"));
|
|
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
|
-
let isSelected = false;
|
|
148
|
-
if (value) {
|
|
149
|
-
// Handle both single value and array of values
|
|
150
|
-
if (Array.isArray(value.value)) {
|
|
151
|
-
isSelected = value.value.includes(opt.value);
|
|
152
|
-
} else {
|
|
153
|
-
isSelected = opt.value === value.value || JSON.stringify(opt.value) === JSON.stringify(value.value);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_option.default, {
|
|
157
|
-
index: i,
|
|
158
|
-
isActive: isActive,
|
|
159
|
-
value: opt.value,
|
|
160
|
-
onSelectOption: onSelectOption,
|
|
161
|
-
changeIndex: this.changeIndex,
|
|
162
|
-
supportMultipleSelect: this.props.supportMultipleSelect,
|
|
163
|
-
disableHover: this.state.disableHover,
|
|
164
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
165
|
-
className: "select-label",
|
|
166
|
-
children: opt.label
|
|
167
|
-
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
168
|
-
className: "dtable-font dtable-icon-check seatable-check-color"
|
|
169
|
-
})]
|
|
170
|
-
}, key);
|
|
171
|
-
});
|
|
172
|
-
};
|
|
173
|
-
this.state = {
|
|
174
|
-
searchVal: '',
|
|
175
|
-
activeIndex: -1,
|
|
176
|
-
disableHover: false
|
|
177
|
-
};
|
|
178
|
-
this.filterOptions = null;
|
|
179
|
-
this.timer = null;
|
|
180
|
-
}
|
|
181
|
-
componentDidMount() {
|
|
182
|
-
window.addEventListener('keydown', this.onHotKey);
|
|
183
|
-
setTimeout(() => {
|
|
184
|
-
this.resetMenuStyle();
|
|
185
|
-
}, 1);
|
|
186
|
-
}
|
|
187
|
-
componentWillUnmount() {
|
|
188
|
-
this.filterOptions = null;
|
|
189
|
-
this.timer && clearTimeout(this.timer);
|
|
190
|
-
window.removeEventListener('keydown', this.onHotKey);
|
|
191
|
-
}
|
|
192
|
-
render() {
|
|
193
|
-
const {
|
|
194
|
-
searchable,
|
|
195
|
-
searchPlaceholder,
|
|
196
|
-
top,
|
|
197
|
-
left,
|
|
198
|
-
minWidth,
|
|
199
|
-
value,
|
|
200
|
-
isShowSelected,
|
|
201
|
-
isInModal,
|
|
202
|
-
position,
|
|
203
|
-
className
|
|
204
|
-
} = this.props;
|
|
205
|
-
let {
|
|
206
|
-
searchVal
|
|
207
|
-
} = this.state;
|
|
208
|
-
let style = {
|
|
209
|
-
top: top || 0,
|
|
210
|
-
left: left || 0
|
|
211
|
-
};
|
|
212
|
-
if (minWidth) {
|
|
213
|
-
style = {
|
|
214
|
-
top: top || 0,
|
|
215
|
-
left: left || 0,
|
|
216
|
-
minWidth
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
if (isInModal) {
|
|
220
|
-
style = {
|
|
221
|
-
position: 'fixed',
|
|
222
|
-
left: position.x,
|
|
223
|
-
top: position.y + position.height,
|
|
224
|
-
minWidth: position.width,
|
|
225
|
-
opacity: 0
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
|
|
229
|
-
onClickOutside: this.props.onClickOutside,
|
|
230
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
231
|
-
className: (0, _classnames.default)('seatable-option-group', className ? 'seatable-option-group-' + className : '', {
|
|
232
|
-
'pt-0': isShowSelected
|
|
233
|
-
}),
|
|
234
|
-
ref: ref => this.optionGroupRef = ref,
|
|
235
|
-
style: style,
|
|
236
|
-
onMouseDown: this.onMouseDown,
|
|
237
|
-
children: [isShowSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
238
|
-
className: "editor-list-delete mb-2",
|
|
239
|
-
onClick: e => e.stopPropagation(),
|
|
240
|
-
children: value.label || ''
|
|
241
|
-
}), searchable && this.props.options && this.props.options.length > 10 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
242
|
-
className: "seatable-option-group-search",
|
|
243
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
|
|
244
|
-
className: "option-search-control",
|
|
245
|
-
placeholder: searchPlaceholder,
|
|
246
|
-
onChange: this.onChangeSearch,
|
|
247
|
-
clearValue: this.clearSearch,
|
|
248
|
-
autoFocus: true,
|
|
249
|
-
isClearable: true
|
|
250
|
-
})
|
|
251
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
252
|
-
className: "seatable-option-group-content",
|
|
253
|
-
ref: ref => this.optionGroupContentRef = ref,
|
|
254
|
-
children: this.renderOptGroup(searchVal)
|
|
255
|
-
})]
|
|
256
|
-
})
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
var _default = exports.default = SelectOptionGroup;
|
|
@@ -1,48 +0,0 @@
|
|
|
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;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
.select-dropdown-indicator {
|
|
2
|
-
position: absolute;
|
|
3
|
-
top: 50%;
|
|
4
|
-
right: 18px;
|
|
5
|
-
transform: translateY(-50%);
|
|
6
|
-
margin-left: -2px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.select-dropdown-indicator svg {
|
|
10
|
-
width: 12px;
|
|
11
|
-
height: 12px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.dis-multicolor-icon-down {
|
|
15
|
-
opacity: 0.65 !important;
|
|
16
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _DTableIcon = _interopRequireDefault(require("../../DTableIcon"));
|
|
10
|
-
require("./index.css");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
const SelectDropdownIndicator = _ref => {
|
|
13
|
-
let {
|
|
14
|
-
isDisabled
|
|
15
|
-
} = _ref;
|
|
16
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
17
|
-
className: "select-dropdown-indicator d-flex align-items-center",
|
|
18
|
-
"aria-hidden": "true",
|
|
19
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
|
|
20
|
-
symbol: "down",
|
|
21
|
-
color: "var(--bs-icon-color)",
|
|
22
|
-
className: isDisabled ? 'dis-multicolor-icon-down' : ''
|
|
23
|
-
})
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var _default = exports.default = SelectDropdownIndicator;
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.MenuSelectStyle = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
-
const DEFAULT_CONTROL_STYLE = {
|
|
10
|
-
fontSize: '14px',
|
|
11
|
-
padding: '0 1rem 0 .5rem',
|
|
12
|
-
border: '1px solid var(--bs-border-color) !important',
|
|
13
|
-
boxShadow: 'none',
|
|
14
|
-
backgroundColor: 'var(--bs-popover-bg)',
|
|
15
|
-
borderRadius: '4px',
|
|
16
|
-
outline: '0'
|
|
17
|
-
};
|
|
18
|
-
const FOCUS_CONTROL_STYLE = {
|
|
19
|
-
fontSize: '14px',
|
|
20
|
-
padding: '0 1rem 0 .5rem',
|
|
21
|
-
border: '1px solid #3e84f7',
|
|
22
|
-
boxShadow: 'none',
|
|
23
|
-
backgroundColor: 'var(--bs-popover-bg)',
|
|
24
|
-
borderRadius: '4px',
|
|
25
|
-
outline: '0'
|
|
26
|
-
};
|
|
27
|
-
const controlCallback = (provided, state) => {
|
|
28
|
-
const {
|
|
29
|
-
isDisabled,
|
|
30
|
-
isFocused
|
|
31
|
-
} = state;
|
|
32
|
-
if (isDisabled) {
|
|
33
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), DEFAULT_CONTROL_STYLE), {}, {
|
|
34
|
-
cursor: 'default',
|
|
35
|
-
backgroundColor: '#f5f5f5',
|
|
36
|
-
opacity: 0.65
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
if (isFocused) {
|
|
40
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE), {}, {
|
|
41
|
-
'&:hover': (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE)
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
45
|
-
fontSize: '14px',
|
|
46
|
-
lineHeight: '1.5',
|
|
47
|
-
cursor: 'pointer'
|
|
48
|
-
}, DEFAULT_CONTROL_STYLE), {}, {
|
|
49
|
-
'&:hover': (0, _objectSpread2.default)({}, DEFAULT_CONTROL_STYLE)
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
53
|
-
// .react-select__menu / react-select-2-listbox
|
|
54
|
-
menu: base => {
|
|
55
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
56
|
-
padding: '8px',
|
|
57
|
-
backgroundColor: 'var(--bs-popover-bg)',
|
|
58
|
-
border: '1px solid var(--bs-border-secondary-color)',
|
|
59
|
-
borderRadius: '4px',
|
|
60
|
-
boxShadow: '0px 6px 14px rgba(0, 0, 0, 0.1)',
|
|
61
|
-
marginTop: '4px',
|
|
62
|
-
marginBottom: 0
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
option: (provided, state) => {
|
|
66
|
-
const {
|
|
67
|
-
isDisabled,
|
|
68
|
-
isFocused,
|
|
69
|
-
isActive,
|
|
70
|
-
isVisited
|
|
71
|
-
} = state;
|
|
72
|
-
let bgColor;
|
|
73
|
-
if (isActive || isVisited) {
|
|
74
|
-
bgColor = 'rgba(0, 0, 0, 0.06)';
|
|
75
|
-
} else if (isFocused) {
|
|
76
|
-
bgColor = 'rgba(0, 0, 0, .04)';
|
|
77
|
-
} else {
|
|
78
|
-
bgColor = 'var(--bs-popover-bg)';
|
|
79
|
-
}
|
|
80
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
81
|
-
color: 'var(--bs-body-color)',
|
|
82
|
-
borderRadius: '4px',
|
|
83
|
-
minHeight: '32px',
|
|
84
|
-
padding: '6px 8px 6px 8px',
|
|
85
|
-
cursor: isDisabled ? 'default' : 'pointer',
|
|
86
|
-
backgroundColor: "".concat(bgColor, " !important")
|
|
87
|
-
});
|
|
88
|
-
},
|
|
89
|
-
control: controlCallback,
|
|
90
|
-
menuPortal: base => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
91
|
-
zIndex: 9999,
|
|
92
|
-
backgroundColor: 'var(--bs-popover-bg)',
|
|
93
|
-
color: 'var(--bs-body-color)',
|
|
94
|
-
borderColor: 'var(--bs-border-secondary-color)'
|
|
95
|
-
}),
|
|
96
|
-
singleValue: provided => {
|
|
97
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
98
|
-
color: 'var(--bs-body-color)'
|
|
99
|
-
});
|
|
100
|
-
},
|
|
101
|
-
multiValue: provided => {
|
|
102
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
103
|
-
color: 'var(--bs-body-color)'
|
|
104
|
-
});
|
|
105
|
-
},
|
|
106
|
-
multiValueRemove: styles => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
|
107
|
-
color: '#909090',
|
|
108
|
-
':hover': {
|
|
109
|
-
backgroundColor: 'transparent',
|
|
110
|
-
color: 'var(--bs-icon-color)'
|
|
111
|
-
}
|
|
112
|
-
}),
|
|
113
|
-
input: styles => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
|
114
|
-
color: 'var(--bs-body-color)'
|
|
115
|
-
}),
|
|
116
|
-
placeholder: (provided, state) => {
|
|
117
|
-
const {
|
|
118
|
-
isDisabled
|
|
119
|
-
} = state;
|
|
120
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
121
|
-
color: '#868e96',
|
|
122
|
-
opacity: isDisabled ? 0.65 : 1
|
|
123
|
-
});
|
|
124
|
-
},
|
|
125
|
-
indicatorSeparator: (styles, state) => {
|
|
126
|
-
return {
|
|
127
|
-
'display': 'none'
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
indicatorContainer: (provided, state) => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
131
|
-
padding: 0
|
|
132
|
-
})
|
|
133
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1718937171668" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18368" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M489.6 444.8l294.4-294.4 67.2 67.2-294.4 294.4 294.4 294.4-67.2 67.2-294.4-294.4-272 272-67.2-67.2 272-272-272-272 67.2-67.2z" p-id="18369" fill="currentColor"></path></svg>
|