dtable-ui-component 7.0.13 → 7.0.15
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 +58 -49
- package/lib/ActivityIndicator/index.js +17 -16
- package/lib/AsyncUserSelect/index.js +20 -46
- package/lib/AsyncUserSelect/user-item.js +6 -5
- package/lib/AutoNumberFormatter/index.js +4 -3
- package/lib/Badge/index.js +27 -29
- package/lib/ButtonFormatter/index.js +8 -6
- package/lib/CTimeFormatter/index.js +4 -3
- package/lib/CheckboxEditor/index.js +16 -13
- package/lib/CheckboxEditor/mb-editor.js +20 -9
- package/lib/CheckboxEditor/pc-editor.js +24 -12
- package/lib/CheckboxFormatter/index.js +5 -4
- package/lib/CollaboratorEditor/index.js +17 -14
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
- package/lib/CollaboratorEditor/pc-editor/index.js +35 -26
- package/lib/CollaboratorFormatter/index.js +10 -8
- package/lib/CollaboratorItem/index.js +5 -4
- package/lib/CollapsibleSettingLayout/index.js +8 -10
- package/lib/Comment/body/comment.js +19 -11
- package/lib/Comment/body/index.js +8 -8
- package/lib/Comment/footer/btns/index.js +7 -4
- package/lib/Comment/footer/index.js +21 -10
- package/lib/Comment/footer/input/index.js +55 -34
- package/lib/Comment/footer/input/participant/index.js +6 -5
- package/lib/Comment/footer/participants/index.js +5 -4
- package/lib/Comment/footer/participants/participant/index.js +3 -1
- package/lib/Comment/footer/participants/participant-select/index.js +26 -10
- package/lib/Comment/index.js +57 -39
- package/lib/Comment/utils/utilities.js +22 -16
- package/lib/CreatorFormatter/index.js +8 -6
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +26 -28
- package/lib/DTableColorPicker/index.js +53 -67
- package/lib/DTableColorPicker/utils.js +7 -5
- package/lib/DTableColumnIcon/index.js +7 -6
- package/lib/DTableCommonAddTool/index.js +10 -8
- package/lib/DTableCustomFooter/index.js +3 -1
- package/lib/DTableCustomizeSearchInput/index.js +41 -26
- package/lib/DTableCustomizeSelect/index.js +24 -19
- package/lib/DTableDropdownItem/index.js +28 -24
- package/lib/DTableDropdownMenu/index.js +17 -14
- package/lib/DTableEmptyTip/index.js +5 -4
- package/lib/DTableFiltersPopover/index.js +42 -27
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
- package/lib/DTableFiltersPopover/utils/index.js +114 -64
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
- package/lib/DTableFiltersPopover/widgets/filter-group.js +57 -36
- package/lib/DTableFiltersPopover/widgets/filter-item.js +165 -106
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +162 -137
- package/lib/DTableFiltersPopover/widgets/rate-item.js +25 -20
- package/lib/DTableIcon/index.js +11 -10
- package/lib/DTableIcon/svg-icon.js +11 -9
- package/lib/DTableModalHeader/index.js +7 -7
- package/lib/DTablePopover/index.js +16 -12
- package/lib/DTableRadio/index.js +9 -10
- package/lib/DTableRadioGroup/index.js +20 -11
- package/lib/DTableSearchInput/index.js +29 -19
- package/lib/DTableSelect/dtable-select-label.js +6 -7
- package/lib/DTableSelect/index.js +26 -25
- package/lib/DTableSelect/select-dropdown-indicator/index.js +3 -1
- package/lib/DTableSelect/utils.js +83 -47
- package/lib/DTableSubDropdownMenu/index.js +16 -12
- package/lib/DTableSubDropdownToggle/index.js +16 -17
- package/lib/DTableSwitch/index.js +11 -12
- package/lib/DTableToolTip/index.js +12 -11
- package/lib/DateEditor/index.js +28 -30
- package/lib/DateEditor/mb-editor/index.js +31 -18
- package/lib/DateEditor/pc-editor.js +46 -27
- package/lib/DateFormatter/index.js +5 -4
- package/lib/DatePicker/index.js +15 -9
- package/lib/DatePicker/utils.js +7 -5
- package/lib/DeleteTip/index.js +6 -5
- package/lib/DepartmentMultipleSelectEditor/index.js +26 -28
- package/lib/DepartmentSelectFilter/index.js +13 -8
- package/lib/DepartmentSingleSelectEditor/index.js +16 -13
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +49 -50
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +64 -42
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
- package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
- package/lib/DigitalSignEditor/index.js +16 -13
- package/lib/DigitalSignEditor/mb-editor/index.js +24 -16
- package/lib/DigitalSignEditor/pc-editor/index.js +31 -23
- package/lib/DigitalSignEditor/service.js +5 -3
- package/lib/DigitalSignEditor/signature-board/index.js +10 -7
- package/lib/DigitalSignEditor/utils.js +4 -2
- package/lib/DigitalSignFormatter/index.js +15 -12
- package/lib/DigitalSignFormatter/utils.js +6 -5
- package/lib/Drawer/index.js +3 -2
- package/lib/DurationEditor/index.js +31 -21
- package/lib/DurationFormatter/index.js +5 -4
- package/lib/EditEditorButton/index.js +3 -1
- package/lib/EmailFormatter/index.js +4 -3
- package/lib/FieldDisplaySetting/field-item.js +13 -13
- package/lib/FieldDisplaySetting/index.js +20 -20
- package/lib/FileEditor/files-previewer/index.js +16 -13
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +20 -12
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +24 -17
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
- package/lib/FileEditor/index.js +16 -13
- package/lib/FileEditor/mb-editor/index.js +20 -28
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +4 -2
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +31 -17
- package/lib/FileEditor/pc-editor/index.js +30 -22
- package/lib/FileFormatter/index.js +20 -27
- package/lib/FileItemFormatter/index.js +10 -7
- package/lib/FileUploader/index.js +46 -29
- package/lib/FormulaFormatter/index.js +44 -24
- package/lib/GeolocationEditor/index.js +32 -27
- package/lib/GeolocationEditor/map-editor-utils.js +23 -21
- package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/index.js +28 -22
- package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +77 -47
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
- package/lib/GeolocationEditor/pc-editor/country-editor.js +25 -12
- package/lib/GeolocationEditor/pc-editor/index.js +41 -27
- package/lib/GeolocationEditor/pc-editor/location-editor.js +33 -28
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +67 -43
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +69 -42
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +86 -42
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +85 -39
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +26 -20
- package/lib/GeolocationEditor/pc-editor/province-editor.js +15 -8
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +8 -7
- package/lib/GeolocationFormatter/index.js +5 -4
- package/lib/HtmlLongTextFormatter/index.js +13 -5
- package/lib/Icon/index.js +13 -15
- package/lib/Icon/load-sprite.js +13 -2
- package/lib/IconButton/index.js +12 -13
- package/lib/ImageEditor/images-previewer/image-preview/index.js +22 -13
- package/lib/ImageEditor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/index.js +16 -13
- package/lib/ImageEditor/mb-editor/index.js +20 -28
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +5 -3
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +26 -12
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +10 -4
- package/lib/ImageEditor/pc-editor/index.js +16 -11
- package/lib/ImageFormatter/images-lazy-load.js +11 -19
- package/lib/ImageFormatter/index.js +14 -12
- package/lib/ImagePreviewerLightbox/index.js +15 -19
- package/lib/ImageThumbnail/index.js +15 -12
- package/lib/InputItem/custom-input.js +55 -35
- package/lib/InputItem/custom-keyboard.js +42 -42
- package/lib/InputItem/index.js +82 -63
- package/lib/InputItem/input.js +9 -11
- package/lib/LastModifierFormatter/index.js +8 -6
- package/lib/LinkEditor/index.js +53 -33
- package/lib/LinkEditor/link-editor-option.js +4 -3
- package/lib/LinkEditor/mb-popover/index.js +22 -9
- package/lib/LinkEditor/pc-popover/index.js +13 -7
- package/lib/LinkFormatter/index.js +37 -21
- package/lib/List/index.js +17 -19
- package/lib/List/list-item.js +59 -55
- package/lib/LongTextFormatter/index.js +5 -4
- package/lib/MBEditorHeader/index.js +9 -8
- package/lib/MTimeFormatter/index.js +4 -3
- package/lib/MobileFullScreenPage/body/index.js +6 -4
- package/lib/MobileFullScreenPage/header/index.js +10 -8
- package/lib/MobileFullScreenPage/index.js +12 -14
- package/lib/MobileModal/index.js +7 -8
- package/lib/MobileOperationSheet/index.js +8 -7
- package/lib/MobileSelector/empty/index.js +3 -1
- package/lib/MobileSelector/index.js +7 -5
- package/lib/MobileSelector/option/index.js +5 -3
- package/lib/MobileSelector/options/index.css +0 -4
- package/lib/MobileSelector/options/index.js +3 -1
- package/lib/MobileSelector/search/index.js +5 -3
- package/lib/MobileUpload/index.js +5 -4
- package/lib/Modal/alert.js +2 -2
- package/lib/Modal/modal.js +28 -30
- package/lib/Modal/prompt.js +14 -14
- package/lib/MultipleSelectEditor/index.js +7 -7
- package/lib/MultipleSelectFormatter/index.js +9 -7
- package/lib/NotificationPopover/index.js +5 -4
- package/lib/NumberEditor/index.js +21 -12
- package/lib/NumberFormatter/index.js +5 -4
- package/lib/PhoneNumberLink/index.js +5 -3
- package/lib/Picker/AbstractPicker.js +35 -33
- package/lib/Popover/index.js +9 -11
- package/lib/Popover/item.js +22 -24
- package/lib/Progress/index.js +18 -17
- package/lib/Radio/Radio.js +17 -15
- package/lib/Radio/RadioItem.js +23 -19
- package/lib/RateFormatter/index.js +15 -15
- package/lib/RoleStatusEditor/index.js +18 -19
- package/lib/RowExpand/index.js +7 -6
- package/lib/RowExpandDialog/body/index.js +57 -40
- package/lib/RowExpandDialog/column-content/index.js +10 -6
- package/lib/RowExpandDialog/header/index.js +12 -9
- package/lib/RowExpandDialog/index.js +59 -63
- package/lib/RowExpandEditor/add-btn/index.js +7 -6
- package/lib/RowExpandEditor/checkbox-editor/index.js +7 -6
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
- package/lib/RowExpandEditor/collaborator-editor/index.js +7 -6
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
- package/lib/RowExpandEditor/date-editor/index.js +7 -6
- package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
- package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
- package/lib/RowExpandEditor/department-editor/index.js +7 -6
- package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
- package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
- package/lib/RowExpandEditor/digital-sign-editor/index.js +7 -6
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +38 -24
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +39 -25
- package/lib/RowExpandEditor/duration-editor/index.js +7 -6
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
- package/lib/RowExpandEditor/email-editor/index.js +7 -6
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +20 -10
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +25 -14
- package/lib/RowExpandEditor/file-editor/index.js +7 -6
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/geolocation-editor/index.js +7 -6
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
- package/lib/RowExpandEditor/image-editor/index.js +7 -6
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +26 -16
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +24 -14
- package/lib/RowExpandEditor/index.js +16 -11
- package/lib/RowExpandEditor/long-text-editor/index.js +7 -6
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/multiple-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +20 -12
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +38 -27
- package/lib/RowExpandEditor/number-editor/index.js +7 -6
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
- package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
- package/lib/RowExpandEditor/rate-editor/index.js +7 -6
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +26 -13
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +41 -25
- package/lib/RowExpandEditor/single-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +32 -21
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +37 -25
- package/lib/RowExpandEditor/text-editor/index.js +7 -6
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
- package/lib/RowExpandEditor/url-editor/index.js +7 -6
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +15 -7
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +20 -11
- package/lib/RowExpandFormatter/department-formatter/index.js +6 -3
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
- package/lib/RowExpandFormatter/email-formatter/index.js +8 -5
- package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +14 -12
- package/lib/RowExpandFormatter/formula-formatter/index.js +51 -30
- package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +10 -9
- package/lib/RowExpandFormatter/index.js +52 -34
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +15 -9
- package/lib/RowExpandFormatter/link-formatter/index.js +25 -17
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
- package/lib/RowExpandFormatter/rate-formatter/index.js +14 -13
- package/lib/RowExpandFormatter/text/index.js +5 -4
- package/lib/RowExpandFormatter/url-formatter/index.js +9 -6
- package/lib/RowExpandView/body/index.js +43 -32
- package/lib/RowExpandView/column-content/index.js +7 -3
- package/lib/RowExpandView/index.js +52 -53
- package/lib/SelectItem/index.js +7 -5
- package/lib/SelectOptionGroup/index.js +40 -30
- package/lib/SelectedDepartments/index.js +12 -10
- package/lib/SimpleLongTextFormatter/index.js +18 -12
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
- package/lib/SingleSelectEditor/index.js +7 -7
- package/lib/SingleSelectFormatter/index.js +9 -8
- package/lib/TabBar/Tab.js +26 -24
- package/lib/TabBar/index.js +28 -24
- package/lib/Tabs/index.js +13 -10
- package/lib/TextEditor/index.js +23 -14
- package/lib/TextFormatter/index.js +4 -3
- package/lib/TextareaItem/index.js +53 -48
- package/lib/Toast/index.js +9 -8
- package/lib/UrlFormatter/index.js +4 -3
- package/lib/common/editor-base.js +12 -7
- package/lib/formatterConfig/index.js +3 -3
- package/lib/hooks/common-hooks.js +4 -2
- package/lib/select-editor/index.js +16 -13
- package/lib/select-editor/mb-editor/index.js +28 -17
- package/lib/select-editor/pc-editor/index.js +47 -32
- package/lib/toaster/alert.js +8 -7
- package/lib/toaster/toast.js +4 -3
- package/lib/toaster/toastManager.js +13 -13
- package/lib/toaster/toaster.js +12 -9
- package/lib/utils/cell.js +11 -8
- package/lib/utils/class.js +3 -3
- package/lib/utils/column-utils.js +14 -8
- package/lib/utils/departments.js +6 -5
- package/lib/utils/getLocale.js +11 -5
- package/lib/utils/object-utils.js +5 -4
- package/lib/utils/url.js +29 -22
- package/lib/utils/utils.js +6 -2
- package/package.json +2 -2
|
@@ -11,18 +11,17 @@ var _dtableUtils = require("dtable-utils");
|
|
|
11
11
|
require("./index.css");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function DTableSwitch(_ref) {
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
checked =
|
|
17
|
-
placeholder
|
|
18
|
-
disabled
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
inputId = _ref.inputId;
|
|
14
|
+
let {
|
|
15
|
+
onChange,
|
|
16
|
+
checked = false,
|
|
17
|
+
placeholder,
|
|
18
|
+
disabled,
|
|
19
|
+
size = 'sm',
|
|
20
|
+
switchPosition = 'right',
|
|
21
|
+
switchClassName,
|
|
22
|
+
innerClassName,
|
|
23
|
+
inputId
|
|
24
|
+
} = _ref;
|
|
26
25
|
const switchNode = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
27
26
|
className: "custom-switch-indicator"
|
|
28
27
|
});
|
|
@@ -5,19 +5,19 @@ 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"));
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _reactstrap = require("reactstrap");
|
|
11
10
|
require("./index.css");
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
12
|
const DTableToolTip = _ref => {
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
placement =
|
|
17
|
-
className
|
|
18
|
-
children
|
|
19
|
-
shortcut
|
|
20
|
-
modifiers
|
|
13
|
+
let {
|
|
14
|
+
target,
|
|
15
|
+
placement = 'bottom',
|
|
16
|
+
className,
|
|
17
|
+
children,
|
|
18
|
+
shortcut,
|
|
19
|
+
modifiers
|
|
20
|
+
} = _ref;
|
|
21
21
|
const hasShortcut = Boolean(shortcut);
|
|
22
22
|
const renderContent = () => {
|
|
23
23
|
if (hasShortcut) {
|
|
@@ -40,7 +40,7 @@ const DTableToolTip = _ref => {
|
|
|
40
40
|
const tooltipProps = {
|
|
41
41
|
target,
|
|
42
42
|
placement,
|
|
43
|
-
className:
|
|
43
|
+
className: `dtable-tooltip ${className ? className : ''}`,
|
|
44
44
|
innerClassName: hasShortcut ? 'dtable-tooltip-shortcut-inner' : '',
|
|
45
45
|
delay: {
|
|
46
46
|
show: 0,
|
|
@@ -60,8 +60,9 @@ const DTableToolTip = _ref => {
|
|
|
60
60
|
}
|
|
61
61
|
}, ...(modifiers || [])]
|
|
62
62
|
};
|
|
63
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.UncontrolledTooltip,
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.UncontrolledTooltip, {
|
|
64
|
+
...tooltipProps,
|
|
64
65
|
children: renderContent()
|
|
65
|
-
})
|
|
66
|
+
});
|
|
66
67
|
};
|
|
67
68
|
var _default = exports.default = DTableToolTip;
|
package/lib/DateEditor/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
13
11
|
var _dtableUtils = require("dtable-utils");
|
|
@@ -19,25 +17,21 @@ require("dayjs/locale/en-gb");
|
|
|
19
17
|
require("./index.css");
|
|
20
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
19
|
const DateEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const _useState3 = (0, _react.useState)(oldValue || ''),
|
|
38
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
39
|
-
value = _useState4[0],
|
|
40
|
-
setValue = _useState4[1];
|
|
20
|
+
let {
|
|
21
|
+
isMobile,
|
|
22
|
+
lang,
|
|
23
|
+
isReadOnly,
|
|
24
|
+
column,
|
|
25
|
+
className,
|
|
26
|
+
isInModal,
|
|
27
|
+
firstDayOfWeek,
|
|
28
|
+
size,
|
|
29
|
+
value: oldValue,
|
|
30
|
+
hideCalendar,
|
|
31
|
+
onCommit
|
|
32
|
+
} = _ref;
|
|
33
|
+
const [isDateInit, setDateInit] = (0, _react.useState)(false);
|
|
34
|
+
const [value, setValue] = (0, _react.useState)(oldValue || '');
|
|
41
35
|
const format = (0, _react.useMemo)(() => {
|
|
42
36
|
var _column$data;
|
|
43
37
|
return (column === null || column === void 0 ? void 0 : column.data) && (column === null || column === void 0 ? void 0 : (_column$data = column.data) === null || _column$data === void 0 ? void 0 : _column$data.format) || _dtableUtils.DEFAULT_DATE_FORMAT;
|
|
@@ -65,29 +59,33 @@ const DateEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
65
59
|
onCommit: handelCommit,
|
|
66
60
|
onClose: hideCalendar
|
|
67
61
|
};
|
|
68
|
-
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
62
|
+
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
63
|
+
...props,
|
|
69
64
|
isInModal: isInModal,
|
|
70
65
|
ref: ref
|
|
71
|
-
})
|
|
72
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
66
|
+
});
|
|
67
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
68
|
+
...props,
|
|
73
69
|
isReadOnly: isReadOnly,
|
|
74
70
|
column: column,
|
|
75
71
|
ref: ref
|
|
76
|
-
})
|
|
72
|
+
});
|
|
77
73
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
78
74
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
79
75
|
query: '(min-width: 768px)',
|
|
80
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
76
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
77
|
+
...props,
|
|
81
78
|
isInModal: isInModal,
|
|
82
79
|
ref: ref
|
|
83
|
-
})
|
|
80
|
+
})
|
|
84
81
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
85
82
|
query: '(max-width: 768px)',
|
|
86
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
83
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
84
|
+
...props,
|
|
87
85
|
isReadOnly: isReadOnly,
|
|
88
86
|
column: column,
|
|
89
87
|
ref: ref
|
|
90
|
-
})
|
|
88
|
+
})
|
|
91
89
|
})]
|
|
92
90
|
});
|
|
93
91
|
});
|
|
@@ -20,8 +20,10 @@ require("@seafile/seafile-calendar/assets/index.css");
|
|
|
20
20
|
require("./index.css");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
22
|
let now = (0, _dayjs.default)();
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const {
|
|
24
|
+
Header,
|
|
25
|
+
Body
|
|
26
|
+
} = _MobileFullScreenPage.default;
|
|
25
27
|
class MBDateEditor extends _react.default.PureComponent {
|
|
26
28
|
constructor(props) {
|
|
27
29
|
super(props);
|
|
@@ -67,11 +69,14 @@ class MBDateEditor extends _react.default.PureComponent {
|
|
|
67
69
|
});
|
|
68
70
|
};
|
|
69
71
|
this.renderCalender = () => {
|
|
70
|
-
const
|
|
71
|
-
lang
|
|
72
|
-
className
|
|
73
|
-
firstDayOfWeek
|
|
74
|
-
|
|
72
|
+
const {
|
|
73
|
+
lang,
|
|
74
|
+
className,
|
|
75
|
+
firstDayOfWeek
|
|
76
|
+
} = this.props;
|
|
77
|
+
const {
|
|
78
|
+
time
|
|
79
|
+
} = this.state;
|
|
75
80
|
const calendar = /*#__PURE__*/(0, _jsxRuntime.jsx)(_seafileCalendar.default, {
|
|
76
81
|
className: (0, _classnames.default)('dtable-rc-calendar', className),
|
|
77
82
|
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
@@ -97,7 +102,9 @@ class MBDateEditor extends _react.default.PureComponent {
|
|
|
97
102
|
width: '100%'
|
|
98
103
|
},
|
|
99
104
|
children: _ref => {
|
|
100
|
-
let
|
|
105
|
+
let {
|
|
106
|
+
time
|
|
107
|
+
} = _ref;
|
|
101
108
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
102
109
|
tabIndex: "0",
|
|
103
110
|
onFocus: this.onReadOnlyFocus,
|
|
@@ -117,8 +124,10 @@ class MBDateEditor extends _react.default.PureComponent {
|
|
|
117
124
|
}
|
|
118
125
|
});
|
|
119
126
|
};
|
|
120
|
-
const
|
|
121
|
-
|
|
127
|
+
const {
|
|
128
|
+
dateFormat,
|
|
129
|
+
showHourAndMinute
|
|
130
|
+
} = props;
|
|
122
131
|
this.state = {
|
|
123
132
|
time: null
|
|
124
133
|
};
|
|
@@ -128,9 +137,10 @@ class MBDateEditor extends _react.default.PureComponent {
|
|
|
128
137
|
this.format = showHourAndMinute ? 'YYYY-MM-DD HH:mm' : 'YYYY-MM-DD';
|
|
129
138
|
}
|
|
130
139
|
componentDidMount() {
|
|
131
|
-
let
|
|
132
|
-
value
|
|
133
|
-
lang
|
|
140
|
+
let {
|
|
141
|
+
value,
|
|
142
|
+
lang
|
|
143
|
+
} = this.props;
|
|
134
144
|
const iszhcn = lang === 'zh-cn';
|
|
135
145
|
if (iszhcn) {
|
|
136
146
|
now = now.locale('zh-cn');
|
|
@@ -146,11 +156,14 @@ class MBDateEditor extends _react.default.PureComponent {
|
|
|
146
156
|
});
|
|
147
157
|
}
|
|
148
158
|
render() {
|
|
149
|
-
const
|
|
150
|
-
lang
|
|
151
|
-
column
|
|
152
|
-
showHourAndMinute
|
|
153
|
-
|
|
159
|
+
const {
|
|
160
|
+
lang,
|
|
161
|
+
column,
|
|
162
|
+
showHourAndMinute
|
|
163
|
+
} = this.props;
|
|
164
|
+
const {
|
|
165
|
+
time
|
|
166
|
+
} = this.state;
|
|
154
167
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MobileFullScreenPage.default, {
|
|
155
168
|
className: "dtable-ui-mobile-date-editor",
|
|
156
169
|
onClose: this.props.onClose,
|
|
@@ -22,7 +22,9 @@ class PCDateEditor extends _react.default.Component {
|
|
|
22
22
|
// event trigger sequence: onOpenChange --> onChange
|
|
23
23
|
this.onChange = value => {
|
|
24
24
|
if (!value) return;
|
|
25
|
-
let
|
|
25
|
+
let {
|
|
26
|
+
dateFormat
|
|
27
|
+
} = this.props;
|
|
26
28
|
this.setState({
|
|
27
29
|
value: value,
|
|
28
30
|
open: true // if value changed, don't close datePicker
|
|
@@ -33,7 +35,9 @@ class PCDateEditor extends _react.default.Component {
|
|
|
33
35
|
this.props.onCommit(this.getValue());
|
|
34
36
|
};
|
|
35
37
|
this.getValue = () => {
|
|
36
|
-
let
|
|
38
|
+
let {
|
|
39
|
+
dateFormat
|
|
40
|
+
} = this.props;
|
|
37
41
|
let value = this.state.value ? this.state.value.format(dateFormat) : null;
|
|
38
42
|
return value;
|
|
39
43
|
};
|
|
@@ -45,7 +49,9 @@ class PCDateEditor extends _react.default.Component {
|
|
|
45
49
|
return this.datePickerRef.querySelector('input:not([type=hidden])');
|
|
46
50
|
};
|
|
47
51
|
this.onOpenChange = open => {
|
|
48
|
-
const
|
|
52
|
+
const {
|
|
53
|
+
isInModal
|
|
54
|
+
} = this.props;
|
|
49
55
|
if (open) {
|
|
50
56
|
this.toggleCalendar(open);
|
|
51
57
|
}
|
|
@@ -74,7 +80,9 @@ class PCDateEditor extends _react.default.Component {
|
|
|
74
80
|
event.stopPropagation();
|
|
75
81
|
};
|
|
76
82
|
this.getCalendarContainer = () => {
|
|
77
|
-
const
|
|
83
|
+
const {
|
|
84
|
+
isInModal
|
|
85
|
+
} = this.props;
|
|
78
86
|
return isInModal ? this.calendarContainerRef.current : document.body;
|
|
79
87
|
};
|
|
80
88
|
this.handleKeyDown = e => {
|
|
@@ -102,7 +110,9 @@ class PCDateEditor extends _react.default.Component {
|
|
|
102
110
|
this.toggleCalendar(true);
|
|
103
111
|
};
|
|
104
112
|
this.onClickRightPanelTime = () => {
|
|
105
|
-
const
|
|
113
|
+
const {
|
|
114
|
+
isInModal
|
|
115
|
+
} = this.props;
|
|
106
116
|
let onClickRightPanelTime = isInModal ? this.props.onClose : this.closeEditor;
|
|
107
117
|
// we should change value and save it(async function), then close Editor.
|
|
108
118
|
setTimeout(() => {
|
|
@@ -118,17 +128,20 @@ class PCDateEditor extends _react.default.Component {
|
|
|
118
128
|
}
|
|
119
129
|
};
|
|
120
130
|
this.getDefaultTime = () => {
|
|
121
|
-
const
|
|
131
|
+
const {
|
|
132
|
+
value
|
|
133
|
+
} = this.props;
|
|
122
134
|
if (value) return (0, _dayjs.default)(value).format('HH:mm');
|
|
123
135
|
return '';
|
|
124
136
|
};
|
|
125
137
|
this.getCalender = () => {
|
|
126
|
-
let
|
|
127
|
-
dateFormat
|
|
128
|
-
showHourAndMinute
|
|
129
|
-
lang
|
|
130
|
-
className
|
|
131
|
-
firstDayOfWeek
|
|
138
|
+
let {
|
|
139
|
+
dateFormat,
|
|
140
|
+
showHourAndMinute,
|
|
141
|
+
lang,
|
|
142
|
+
className,
|
|
143
|
+
firstDayOfWeek
|
|
144
|
+
} = this.props;
|
|
132
145
|
let defaultValue = (0, _dayjs.default)().clone();
|
|
133
146
|
const defaultTime = this.getDefaultTime();
|
|
134
147
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_seafileCalendar.default, {
|
|
@@ -147,9 +160,10 @@ class PCDateEditor extends _react.default.Component {
|
|
|
147
160
|
firstDayOfWeek: firstDayOfWeek
|
|
148
161
|
});
|
|
149
162
|
};
|
|
150
|
-
const
|
|
151
|
-
_dateFormat
|
|
152
|
-
_value
|
|
163
|
+
const {
|
|
164
|
+
dateFormat: _dateFormat,
|
|
165
|
+
value: _value
|
|
166
|
+
} = this.props;
|
|
153
167
|
this.state = {
|
|
154
168
|
value: _value ? (0, _dayjs.default)(_value) : null,
|
|
155
169
|
open: false
|
|
@@ -159,10 +173,11 @@ class PCDateEditor extends _react.default.Component {
|
|
|
159
173
|
this.showHourAndMinute = !!(_dateFormat.indexOf('HH:mm') > -1);
|
|
160
174
|
}
|
|
161
175
|
componentDidMount() {
|
|
162
|
-
const
|
|
163
|
-
value
|
|
164
|
-
lang
|
|
165
|
-
isInModal
|
|
176
|
+
const {
|
|
177
|
+
value,
|
|
178
|
+
lang,
|
|
179
|
+
isInModal
|
|
180
|
+
} = this.props;
|
|
166
181
|
const iszhcn = lang === 'zh-cn';
|
|
167
182
|
if (iszhcn) {
|
|
168
183
|
now = now.locale('zh-cn');
|
|
@@ -199,15 +214,17 @@ class PCDateEditor extends _react.default.Component {
|
|
|
199
214
|
}
|
|
200
215
|
}
|
|
201
216
|
render() {
|
|
202
|
-
let
|
|
203
|
-
dateFormat
|
|
204
|
-
isInModal
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
217
|
+
let {
|
|
218
|
+
dateFormat,
|
|
219
|
+
isInModal
|
|
220
|
+
} = this.props;
|
|
221
|
+
let {
|
|
222
|
+
open,
|
|
223
|
+
value
|
|
224
|
+
} = this.state;
|
|
208
225
|
const calendar = this.getCalender();
|
|
209
226
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
210
|
-
className:
|
|
227
|
+
className: `date-picker-container ${isInModal ? 'modal-date-picker-container' : ''}`,
|
|
211
228
|
ref: ref => this.datePickerRef = ref,
|
|
212
229
|
onKeyDown: this.handleKeyDown,
|
|
213
230
|
onClick: this.onClick,
|
|
@@ -223,7 +240,9 @@ class PCDateEditor extends _react.default.Component {
|
|
|
223
240
|
onChange: this.onChange,
|
|
224
241
|
onOpenChange: this.onOpenChange,
|
|
225
242
|
children: _ref => {
|
|
226
|
-
let
|
|
243
|
+
let {
|
|
244
|
+
value
|
|
245
|
+
} = _ref;
|
|
227
246
|
value = value && value.format(dateFormat);
|
|
228
247
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
229
248
|
className: "dtable-ui-date-editor-container",
|
|
@@ -12,10 +12,11 @@ require("./index.css");
|
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
class DateFormatter extends _react.default.Component {
|
|
14
14
|
render() {
|
|
15
|
-
let
|
|
16
|
-
date
|
|
17
|
-
format
|
|
18
|
-
containerClassName
|
|
15
|
+
let {
|
|
16
|
+
value: date,
|
|
17
|
+
format,
|
|
18
|
+
containerClassName
|
|
19
|
+
} = this.props;
|
|
19
20
|
let classname = (0, _classnames.default)('dtable-ui cell-formatter-container date-formatter', containerClassName);
|
|
20
21
|
if (date !== '') {
|
|
21
22
|
date = (0, _dtableUtils.getDateDisplayString)(date, format);
|
package/lib/DatePicker/index.js
CHANGED
|
@@ -46,16 +46,22 @@ class DatePicker extends React.Component {
|
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
48
|
// tslint:disable-next-line:no-this-assignment
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
const {
|
|
50
|
+
props,
|
|
51
|
+
context
|
|
52
|
+
} = this;
|
|
53
|
+
const {
|
|
54
|
+
children,
|
|
55
|
+
value,
|
|
56
|
+
popupPrefixCls
|
|
57
|
+
} = props;
|
|
54
58
|
const locale = (0, _getLocale.getComponentLocale)(props, context, 'DatePicker', () => require('./locale/zh_CN'));
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
const {
|
|
60
|
+
okText,
|
|
61
|
+
dismissText,
|
|
62
|
+
extra,
|
|
63
|
+
DatePickerLocale
|
|
64
|
+
} = locale;
|
|
59
65
|
/**
|
|
60
66
|
* 注意:
|
|
61
67
|
* 受控 表示 通过设置 value 属性、组件的最终状态跟 value 设置值一致。
|
package/lib/DatePicker/utils.js
CHANGED
|
@@ -5,16 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.formatFn = formatFn;
|
|
7
7
|
function formatIt(date, form) {
|
|
8
|
-
const pad = n => n < 10 ?
|
|
9
|
-
const dateStr =
|
|
10
|
-
const timeStr =
|
|
8
|
+
const pad = n => n < 10 ? `0${n}` : n;
|
|
9
|
+
const dateStr = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
10
|
+
const timeStr = `${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
11
11
|
if (form === 'YYYY-MM-DD') {
|
|
12
12
|
return dateStr;
|
|
13
13
|
}
|
|
14
14
|
if (form === 'HH:mm') {
|
|
15
15
|
return timeStr;
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return `${dateStr} ${timeStr}`;
|
|
18
18
|
}
|
|
19
19
|
function formatFn(instance, value) {
|
|
20
20
|
const formatsEnum = {
|
|
@@ -22,7 +22,9 @@ function formatFn(instance, value) {
|
|
|
22
22
|
time: 'HH:mm',
|
|
23
23
|
datetime: 'YYYY-MM-DD HH:mm'
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const {
|
|
26
|
+
format
|
|
27
|
+
} = instance.props;
|
|
26
28
|
const type = typeof format;
|
|
27
29
|
if (type === 'string') {
|
|
28
30
|
return formatIt(value, format);
|
package/lib/DeleteTip/index.js
CHANGED
|
@@ -21,11 +21,12 @@ class DeleteTip extends _react.default.Component {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
const
|
|
25
|
-
toggle
|
|
26
|
-
handleDelete
|
|
27
|
-
position
|
|
28
|
-
deleteTip
|
|
24
|
+
const {
|
|
25
|
+
toggle,
|
|
26
|
+
handleDelete,
|
|
27
|
+
position,
|
|
28
|
+
deleteTip
|
|
29
|
+
} = this.props;
|
|
29
30
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalPortal.default, {
|
|
30
31
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
|
|
31
32
|
onClickOutside: this.handleOutsideClick,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _departments = require("../utils/departments");
|
|
12
11
|
var _SelectedDepartments = _interopRequireDefault(require("../SelectedDepartments"));
|
|
@@ -14,22 +13,18 @@ var _lang = require("../lang");
|
|
|
14
13
|
require("./index.css");
|
|
15
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
15
|
function DepartmentMultipleSelect(props) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const _useState3 = (0, _react.useState)((0, _departments.getNormalizedDepartments)(initialDepartments)),
|
|
30
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
31
|
-
departments = _useState4[0],
|
|
32
|
-
setDepartments = _useState4[1];
|
|
16
|
+
const {
|
|
17
|
+
value,
|
|
18
|
+
onCommit,
|
|
19
|
+
classNamePrefix,
|
|
20
|
+
isShowSelectedDepartments,
|
|
21
|
+
renderUserDepartmentOptions,
|
|
22
|
+
departments: initialDepartments,
|
|
23
|
+
isInModal,
|
|
24
|
+
position
|
|
25
|
+
} = props;
|
|
26
|
+
const [searchVal, setSearchVal] = (0, _react.useState)('');
|
|
27
|
+
const [departments, setDepartments] = (0, _react.useState)((0, _departments.getNormalizedDepartments)(initialDepartments));
|
|
33
28
|
const departmentContainerRef = (0, _react.useRef)(null);
|
|
34
29
|
const validDepartmentsRef = (0, _react.useRef)([]);
|
|
35
30
|
(0, _react.useEffect)(() => {
|
|
@@ -39,9 +34,10 @@ function DepartmentMultipleSelect(props) {
|
|
|
39
34
|
// eslint-disable-next-line
|
|
40
35
|
}, []);
|
|
41
36
|
function resetContainerPosition() {
|
|
42
|
-
const
|
|
43
|
-
top
|
|
44
|
-
height
|
|
37
|
+
const {
|
|
38
|
+
top,
|
|
39
|
+
height
|
|
40
|
+
} = departmentContainerRef.current.getBoundingClientRect();
|
|
45
41
|
if (isInModal) {
|
|
46
42
|
if (position.y + position.height + height > window.innerHeight) {
|
|
47
43
|
departmentContainerRef.current.style.top = position.y - height + 'px';
|
|
@@ -97,10 +93,12 @@ function DepartmentMultipleSelect(props) {
|
|
|
97
93
|
e.nativeEvent.stopImmediatePropagation();
|
|
98
94
|
}
|
|
99
95
|
function renderDepartment(department, subDepartments, level) {
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
const {
|
|
97
|
+
hasChild,
|
|
98
|
+
isExpanded,
|
|
99
|
+
name,
|
|
100
|
+
id
|
|
101
|
+
} = department;
|
|
104
102
|
const newLevel = level + 1;
|
|
105
103
|
const inputChecked = value.includes(id);
|
|
106
104
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
@@ -112,7 +110,7 @@ function DepartmentMultipleSelect(props) {
|
|
|
112
110
|
className: "vam department-select-input",
|
|
113
111
|
checked: inputChecked,
|
|
114
112
|
style: {
|
|
115
|
-
marginRight:
|
|
113
|
+
marginRight: `${newLevel * 15 + 5}px`
|
|
116
114
|
},
|
|
117
115
|
onChange: () => {}
|
|
118
116
|
}), hasChild && !searchVal && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -120,7 +118,7 @@ function DepartmentMultipleSelect(props) {
|
|
|
120
118
|
role: "button",
|
|
121
119
|
className: "department-item-fold-btn",
|
|
122
120
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
123
|
-
className:
|
|
121
|
+
className: `dtable-font expand dtable-icon-down3 ${isExpanded ? '' : 'rotate-270'}`
|
|
124
122
|
})
|
|
125
123
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
126
124
|
style: searchVal ? {} : {
|
|
@@ -148,7 +146,7 @@ function DepartmentMultipleSelect(props) {
|
|
|
148
146
|
style: getStyle(),
|
|
149
147
|
onClick: onStopPropagation,
|
|
150
148
|
onMouseDown: onStopPropagation,
|
|
151
|
-
className:
|
|
149
|
+
className: `departments-container dtable-ui ${classNamePrefix}`,
|
|
152
150
|
children: [isShowSelectedDepartments && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
153
151
|
className: "selected-departments dtable-ui",
|
|
154
152
|
onClick: onClick,
|
|
@@ -5,18 +5,19 @@ 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"));
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _departmentSingleSelectFilter = _interopRequireDefault(require("../DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter"));
|
|
11
10
|
var _departmentMultipleSelectFilter = _interopRequireDefault(require("../DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter"));
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
12
|
function DepartmentSelectFilter(props) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const {
|
|
14
|
+
isMultiple,
|
|
15
|
+
value,
|
|
16
|
+
column,
|
|
17
|
+
userDepartmentIdsMap,
|
|
18
|
+
departments,
|
|
19
|
+
onCommit
|
|
20
|
+
} = props;
|
|
20
21
|
const filterProps = {
|
|
21
22
|
column,
|
|
22
23
|
value,
|
|
@@ -25,7 +26,11 @@ function DepartmentSelectFilter(props) {
|
|
|
25
26
|
onCommit
|
|
26
27
|
};
|
|
27
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
28
|
-
children: isMultiple ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_departmentMultipleSelectFilter.default,
|
|
29
|
+
children: isMultiple ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_departmentMultipleSelectFilter.default, {
|
|
30
|
+
...filterProps
|
|
31
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_departmentSingleSelectFilter.default, {
|
|
32
|
+
...filterProps
|
|
33
|
+
})
|
|
29
34
|
});
|
|
30
35
|
}
|
|
31
36
|
var _default = exports.default = DepartmentSelectFilter;
|