dtable-ui-component 6.0.29-beta11 → 6.0.29-beta2
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/CheckboxEditor/index.js +118 -24
- package/lib/CheckboxFormatter/index.css +1 -1
- package/lib/CheckboxFormatter/index.js +25 -10
- package/lib/CollaboratorEditor/index.js +11 -23
- package/lib/CollaboratorEditor/mb-collaborator-editor/index.css +85 -0
- package/lib/CollaboratorEditor/mb-collaborator-editor/index.js +148 -0
- package/lib/DTableCommonAddTool/index.js +3 -1
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +6 -6
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +6 -6
- package/lib/DateEditor/index.js +95 -69
- package/lib/DateEditor/mb-date-editor-popover/custom-rc-calendar.css +118 -0
- package/lib/DateEditor/mb-date-editor-popover/index.css +45 -0
- package/lib/DateEditor/mb-date-editor-popover/index.js +226 -0
- package/lib/DateEditor/{pc-editor.js → pc-date-editor-popover.js} +9 -9
- package/lib/{DepartmentMultipleSelectEditor → Department-editor/department-multiple-select}/index.js +6 -6
- package/lib/{DepartmentSingleSelectEditor/pc-editor → Department-editor}/department-single-select.js +7 -7
- package/lib/{DepartmentSingleSelectEditor/pc-editor → Department-editor}/index.css +3 -10
- package/lib/{DepartmentSingleSelectEditor/pc-editor → Department-editor}/index.js +25 -8
- package/lib/{SelectedDepartments → Department-editor/selected-departments}/index.css +1 -0
- package/lib/{SelectedDepartments → Department-editor/selected-departments}/index.js +3 -3
- package/lib/DigitalSignEditor/index.js +171 -24
- package/lib/FileEditor/addition-previewer/index.css +1 -0
- package/lib/FileEditor/{pc-editor/addition-previewer → addition-previewer}/index.js +1 -1
- package/lib/FileEditor/addition-previewer/local-file-addition/index.css +1 -0
- package/lib/FileEditor/{pc-editor/addition-previewer → addition-previewer}/local-file-addition/index.js +4 -4
- package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/dropdown-menu.js +1 -1
- package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/file-name-editor/index.js +1 -1
- package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/index.css +2 -0
- package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/index.js +2 -2
- package/lib/FileEditor/files-previewer/index.js +268 -26
- package/lib/FileEditor/index.css +5 -0
- package/lib/FileEditor/index.js +265 -26
- package/lib/FormulaFormatter/index.css +5 -5
- package/lib/GeolocationEditor/{pc-editor/country-editor.js → country-editor.js} +50 -5
- package/lib/GeolocationEditor/{pc-editor/index.css → index.css} +4 -3
- package/lib/GeolocationEditor/index.js +230 -90
- package/lib/GeolocationEditor/{pc-editor/location-editor.js → location-editor.js} +41 -8
- package/lib/GeolocationEditor/{pc-editor/map-editor → map-editor}/index.js +6 -6
- package/lib/GeolocationEditor/{pc-editor/map-editor → map-editor}/large-editor/index.js +7 -7
- package/lib/GeolocationEditor/map-editor-utils.js +2 -6
- package/lib/GeolocationEditor/{pc-editor/map-selection-editor → map-selection-editor}/index.js +7 -7
- package/lib/GeolocationEditor/{pc-editor/map-selection-editor → map-selection-editor}/large-editor/index.js +7 -7
- package/lib/GeolocationEditor/{pc-editor/province-city-editor.js → province-city-editor.js} +38 -7
- package/lib/GeolocationEditor/{pc-editor/province-editor.js → province-editor.js} +31 -7
- package/lib/GeolocationEditor/{pc-editor/selector-header-item.js → selector-header-item.js} +1 -1
- package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/image-link/index.js +1 -1
- package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/index.js +1 -1
- package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/local-image-addition/index.js +4 -4
- package/lib/ImageEditor/images-previewer/image-preview/index.js +3 -3
- package/lib/ImageEditor/images-previewer/index.js +4 -9
- package/lib/ImageEditor/index.css +16 -17
- package/lib/ImageEditor/index.js +185 -26
- package/lib/ImageThumbnail/index.js +1 -2
- package/lib/LinkEditor/index.js +5 -5
- package/lib/LinkEditor/{mb-popover → mb-link-editor-popover}/index.css +1 -1
- package/lib/MultipleSelectEditor/index.js +14 -9
- package/lib/RowExpandDialog/column-content/index.js +2 -2
- package/lib/RowExpandDialog/index.js +0 -2
- package/lib/RowExpandEditor/{add-btn/pc-add-btn → RowExpandAddBtn}/index.js +4 -6
- package/lib/RowExpandEditor/{checkbox-editor/pc-editor.js → RowExpandCheckboxEditor/index.js} +13 -9
- package/lib/RowExpandEditor/{collaborator-editor/pc-editor → RowExpandCollaboratorEditor}/index.css +1 -1
- package/lib/RowExpandEditor/{collaborator-editor/pc-editor → RowExpandCollaboratorEditor}/index.js +7 -6
- package/lib/RowExpandEditor/{date-editor/pc-editor.js → RowExpandDateEditor/index.js} +2 -2
- package/lib/RowExpandEditor/{department-editor/pc-editor.js → RowExpandDepartmentEditor/index.js} +49 -44
- package/lib/RowExpandEditor/{digital-sign-editor/pc-editor → RowExpandDigitalSignEditor}/index.css +1 -1
- package/lib/RowExpandEditor/{digital-sign-editor/pc-editor → RowExpandDigitalSignEditor}/index.js +11 -11
- package/lib/RowExpandEditor/{duration-editor/pc-editor.js → RowExpandDurationEditor/index.js} +2 -2
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +2 -0
- package/lib/RowExpandEditor/{email-editor/pc-editor → RowExpandEmailEditor}/index.js +3 -3
- package/lib/RowExpandEditor/RowExpandFileEditor/index.css +1 -0
- package/lib/RowExpandEditor/{file-editor/pc-editor → RowExpandFileEditor}/index.js +9 -9
- package/lib/RowExpandEditor/{geolocation-editor/pc-editor → RowExpandGeolocationEditor}/index.js +11 -10
- package/lib/RowExpandEditor/{image-editor/pc-editor → RowExpandImageEditor}/index.js +9 -9
- package/lib/RowExpandEditor/{long-text-editor/pc-editor → RowExpandLongTextEditor}/index.js +7 -7
- package/lib/RowExpandEditor/{multiple-select-editor/pc-editor → RowExpandMultipleSelectEditor}/index.css +1 -1
- package/lib/RowExpandEditor/{multiple-select-editor/pc-editor → RowExpandMultipleSelectEditor}/index.js +6 -6
- package/lib/RowExpandEditor/{number-editor/pc-editor.js → RowExpandNumberEditor/index.js} +2 -2
- package/lib/RowExpandEditor/RowExpandRateEditor/index.css +13 -0
- package/lib/RowExpandEditor/{rate-editor/pc-editor.js → RowExpandRateEditor/index.js} +3 -2
- package/lib/RowExpandEditor/{single-select-editor/pc-editor → RowExpandSingleSelectorEditor}/index.js +17 -17
- package/lib/RowExpandEditor/{text-editor/pc-editor → RowExpandTextEditor}/index.js +7 -7
- package/lib/RowExpandEditor/{url-editor/pc-editor → RowExpandUrlEditor}/index.js +6 -6
- package/lib/RowExpandEditor/constants.js +34 -34
- package/lib/RowExpandFormatter/{department-formatter/pc-formatter.js → RowExpandDepartmentFormatter/index.js} +2 -2
- package/lib/RowExpandFormatter/{email-formatter → RowExpandEmailFormatter}/index.css +4 -4
- package/lib/RowExpandFormatter/RowExpandRateFormatter/index.css +5 -0
- package/lib/RowExpandFormatter/constants.js +17 -17
- package/lib/RowExpandFormatter/index.css +18 -33
- package/lib/RowExpandFormatter/index.js +1 -1
- package/lib/SelectItem/index.js +33 -57
- package/lib/SingleSelectEditor/index.js +14 -9
- package/lib/SvgIcon/index.js +20 -15
- package/lib/assets/icons/check.svg +12 -0
- package/lib/assets/icons/cross.svg +13 -0
- package/lib/assets/icons/dot.svg +9 -0
- package/lib/constants/index.js +2 -3
- package/lib/css/mb-cell-editor.css +1 -1
- package/lib/index.js +6 -69
- package/lib/locales/de.json +1 -3
- package/lib/locales/en.json +1 -3
- package/lib/locales/es.json +1 -3
- package/lib/locales/fr.json +1 -3
- package/lib/locales/pt.json +1 -3
- package/lib/locales/ru.json +1 -3
- package/lib/locales/zh-CN.json +1 -3
- package/lib/select-editor/index.js +20 -27
- package/lib/select-editor/mb-select-editor/index.css +127 -0
- package/lib/select-editor/mb-select-editor/index.js +197 -0
- package/lib/select-editor/{pc-editor → pc-select-editor}/index.css +1 -1
- package/lib/select-editor/{pc-editor → pc-select-editor}/index.js +7 -7
- package/lib/select-editor/select-editor-option.js +84 -0
- package/lib/utils/editor-utils.js +2 -6
- package/lib/utils/get-event-transfer.js +1 -2
- package/lib/utils/utils.js +2 -11
- package/package.json +2 -2
- package/lib/BodyPortal/index.js +0 -29
- package/lib/CheckboxEditor/mb-editor.js +0 -99
- package/lib/CheckboxEditor/pc-editor.js +0 -118
- package/lib/CollaboratorEditor/mb-editor/index.css +0 -41
- package/lib/CollaboratorEditor/mb-editor/index.js +0 -88
- package/lib/DateEditor/mb-editor/custom-rc-calendar.css +0 -118
- package/lib/DateEditor/mb-editor/index.css +0 -39
- package/lib/DateEditor/mb-editor/index.js +0 -215
- package/lib/DepartmentSingleSelectEditor/index.js +0 -34
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.css +0 -4
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +0 -227
- package/lib/DigitalSignEditor/mb-editor/index.css +0 -35
- package/lib/DigitalSignEditor/mb-editor/index.js +0 -144
- package/lib/DigitalSignEditor/pc-editor/index.js +0 -181
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +0 -122
- package/lib/FileEditor/files-previewer/mb-previewer/index.css +0 -39
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +0 -64
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +0 -276
- package/lib/FileEditor/mb-editor/index.css +0 -10
- package/lib/FileEditor/mb-editor/index.js +0 -136
- package/lib/FileEditor/pc-editor/addition-previewer/index.css +0 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.css +0 -1
- package/lib/FileEditor/pc-editor/index.css +0 -5
- package/lib/FileEditor/pc-editor/index.js +0 -274
- package/lib/GeolocationEditor/mb-editor/country-editor.js +0 -79
- package/lib/GeolocationEditor/mb-editor/index.css +0 -11
- package/lib/GeolocationEditor/mb-editor/index.js +0 -125
- package/lib/GeolocationEditor/mb-editor/location-editor.js +0 -101
- package/lib/GeolocationEditor/mb-editor/map-editor/index.css +0 -11
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +0 -474
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.css +0 -158
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +0 -530
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +0 -77
- package/lib/GeolocationEditor/mb-editor/province-editor.js +0 -76
- package/lib/GeolocationEditor/pc-editor/index.js +0 -247
- package/lib/ImageEditor/mb-editor/index.css +0 -29
- package/lib/ImageEditor/mb-editor/index.js +0 -136
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +0 -140
- package/lib/ImageEditor/pc-editor/index.css +0 -24
- package/lib/ImageEditor/pc-editor/index.js +0 -194
- package/lib/MobileFullScreenPage/body/index.css +0 -9
- package/lib/MobileFullScreenPage/body/index.js +0 -23
- package/lib/MobileFullScreenPage/header/index.css +0 -39
- package/lib/MobileFullScreenPage/header/index.js +0 -38
- package/lib/MobileFullScreenPage/index.css +0 -13
- package/lib/MobileFullScreenPage/index.js +0 -73
- package/lib/MobileModal/index.js +0 -41
- package/lib/MobileOperationSheet/index.css +0 -27
- package/lib/MobileOperationSheet/index.js +0 -92
- package/lib/MobileSelector/empty/index.css +0 -3
- package/lib/MobileSelector/empty/index.js +0 -23
- package/lib/MobileSelector/index.css +0 -32
- package/lib/MobileSelector/index.js +0 -57
- package/lib/MobileSelector/option/index.css +0 -28
- package/lib/MobileSelector/option/index.js +0 -36
- package/lib/MobileSelector/options/index.css +0 -8
- package/lib/MobileSelector/options/index.js +0 -18
- package/lib/MobileSelector/search/index.css +0 -7
- package/lib/MobileSelector/search/index.js +0 -26
- package/lib/MobileUpload/index.css +0 -1
- package/lib/MobileUpload/index.js +0 -160
- package/lib/RowExpand/index.js +0 -24
- package/lib/RowExpandEditor/add-btn/index.js +0 -24
- package/lib/RowExpandEditor/add-btn/mb-add-btn/index.css +0 -3
- package/lib/RowExpandEditor/add-btn/mb-add-btn/index.js +0 -19
- package/lib/RowExpandEditor/checkbox-editor/index.js +0 -25
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.css +0 -6
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +0 -36
- package/lib/RowExpandEditor/collaborator-editor/index.js +0 -24
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.css +0 -9
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +0 -163
- package/lib/RowExpandEditor/date-editor/index.js +0 -24
- package/lib/RowExpandEditor/date-editor/mb-editor.js +0 -82
- package/lib/RowExpandEditor/department-editor/index.js +0 -24
- package/lib/RowExpandEditor/department-editor/mb-editor.js +0 -65
- package/lib/RowExpandEditor/digital-sign-editor/index.js +0 -24
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.css +0 -1
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +0 -130
- package/lib/RowExpandEditor/duration-editor/index.js +0 -24
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +0 -71
- package/lib/RowExpandEditor/email-editor/index.js +0 -24
- package/lib/RowExpandEditor/email-editor/mb-editor/index.css +0 -1
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +0 -84
- package/lib/RowExpandEditor/email-editor/pc-editor/index.css +0 -1
- package/lib/RowExpandEditor/file-editor/index.js +0 -24
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +0 -114
- package/lib/RowExpandEditor/file-editor/pc-editor/index.css +0 -1
- package/lib/RowExpandEditor/geolocation-editor/index.js +0 -24
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +0 -100
- package/lib/RowExpandEditor/image-editor/index.js +0 -24
- package/lib/RowExpandEditor/image-editor/mb-editor/index.css +0 -30
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +0 -109
- package/lib/RowExpandEditor/long-text-editor/index.js +0 -24
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.css +0 -10
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +0 -80
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.css +0 -3
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +0 -91
- package/lib/RowExpandEditor/multiple-select-editor/index.js +0 -24
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +0 -154
- package/lib/RowExpandEditor/number-editor/index.js +0 -24
- package/lib/RowExpandEditor/number-editor/mb-editor/index.css +0 -3
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +0 -76
- package/lib/RowExpandEditor/rate-editor/index.css +0 -34
- package/lib/RowExpandEditor/rate-editor/index.js +0 -25
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +0 -92
- package/lib/RowExpandEditor/right-angle/index.css +0 -6
- package/lib/RowExpandEditor/right-angle/index.js +0 -17
- package/lib/RowExpandEditor/single-select-editor/index.js +0 -24
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.css +0 -8
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +0 -134
- package/lib/RowExpandEditor/text-editor/index.js +0 -24
- package/lib/RowExpandEditor/text-editor/mb-editor/index.css +0 -14
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +0 -37
- package/lib/RowExpandEditor/url-editor/index.js +0 -24
- package/lib/RowExpandEditor/url-editor/mb-editor/index.css +0 -17
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +0 -87
- package/lib/RowExpandFormatter/department-formatter/index.js +0 -19
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +0 -20
- package/lib/RowExpandFormatter/rate-formatter/index.css +0 -5
- package/lib/RowExpandView/body/index.css +0 -173
- package/lib/RowExpandView/body/index.js +0 -111
- package/lib/RowExpandView/column-content/index.css +0 -27
- package/lib/RowExpandView/column-content/index.js +0 -25
- package/lib/RowExpandView/index.css +0 -3
- package/lib/RowExpandView/index.js +0 -178
- package/lib/select-editor/mb-editor/index.css +0 -1
- package/lib/select-editor/mb-editor/index.js +0 -105
- /package/lib/CollaboratorEditor/{pc-editor → pc-collaborator-editor}/index.css +0 -0
- /package/lib/CollaboratorEditor/{pc-editor → pc-collaborator-editor}/index.js +0 -0
- /package/lib/{constants/departments.js → Department-editor/constants.js} +0 -0
- /package/lib/{DepartmentMultipleSelectEditor → Department-editor/department-multiple-select}/index.css +0 -0
- /package/lib/{utils/departments.js → Department-editor/utils.js} +0 -0
- /package/lib/DigitalSignEditor/{pc-editor/index.css → index.css} +0 -0
- /package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/file-name-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{pc-editor/map-editor → map-editor}/large-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{pc-editor/map-selection-editor → map-selection-editor}/large-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{pc-editor/parse-geolocation.js → parse-geolocation.js} +0 -0
- /package/lib/GeolocationEditor/{pc-editor/selector-list.js → selector-list.js} +0 -0
- /package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/image-link/index.css +0 -0
- /package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/index.css +0 -0
- /package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/local-image-addition/index.css +0 -0
- /package/lib/LinkEditor/{mb-popover → mb-link-editor-popover}/index.js +0 -0
- /package/lib/LinkEditor/{pc-popover → pc-link-editor-popover}/index.css +0 -0
- /package/lib/LinkEditor/{pc-popover → pc-link-editor-popover}/index.js +0 -0
- /package/lib/RowExpandEditor/{add-btn/pc-add-btn → RowExpandAddBtn}/index.css +0 -0
- /package/lib/RowExpandEditor/{checkbox-editor → RowExpandCheckboxEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{geolocation-editor/pc-editor → RowExpandGeolocationEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{image-editor/pc-editor → RowExpandImageEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{long-text-editor/pc-editor → RowExpandLongTextEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{single-select-editor/pc-editor → RowExpandSingleSelectorEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{text-editor/pc-editor → RowExpandTextEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{url-editor/pc-editor → RowExpandUrlEditor}/index.css +0 -0
- /package/lib/RowExpandFormatter/{email-formatter → RowExpandEmailFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{file-formatter → RowExpandFileFormatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{file-formatter → RowExpandFileFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{file-formatter → RowExpandFileFormatter}/row-expand-file-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{formula-formatter → RowExpandFormulaFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{image-formatter → RowExpandImageFormatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{image-formatter → RowExpandImageFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{image-formatter → RowExpandImageFormatter}/row-expand-image-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/collaborator-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/value-display-utils.js +0 -0
- /package/lib/RowExpandFormatter/{rate-formatter → RowExpandRateFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{url-formatter → RowExpandUrlFormatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{url-formatter → RowExpandUrlFormatter}/index.js +0 -0
package/lib/DateEditor/index.js
CHANGED
|
@@ -1,83 +1,109 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
11
|
-
var _dtableUtils = require("dtable-utils");
|
|
12
10
|
var _dayjs = _interopRequireDefault(require("../utils/dayjs"));
|
|
13
|
-
var
|
|
14
|
-
var
|
|
11
|
+
var _pcDateEditorPopover = _interopRequireDefault(require("./pc-date-editor-popover"));
|
|
12
|
+
var _mbDateEditorPopover = _interopRequireDefault(require("./mb-date-editor-popover"));
|
|
15
13
|
require("dayjs/locale/zh-cn");
|
|
16
14
|
require("dayjs/locale/en-gb");
|
|
17
15
|
require("./index.css");
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
16
|
+
class DateEditor extends _react.default.Component {
|
|
17
|
+
constructor(props) {
|
|
18
|
+
super(props);
|
|
19
|
+
this.getDateFormat = () => {
|
|
20
|
+
let {
|
|
21
|
+
column
|
|
22
|
+
} = this.props;
|
|
23
|
+
let defaultDateFormat = 'YYYY-MM-DD';
|
|
24
|
+
let dateFormat = column.data && column.data.format;
|
|
25
|
+
return dateFormat || defaultDateFormat;
|
|
26
|
+
};
|
|
27
|
+
this.onValueChanged = value => {
|
|
28
|
+
if (value !== this.state.newValue) {
|
|
29
|
+
this.setState({
|
|
30
|
+
newValue: value
|
|
31
|
+
});
|
|
32
|
+
this.onCommit(value);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
this.onCommit = newValue => {
|
|
36
|
+
this.props.onCommit(newValue);
|
|
37
|
+
};
|
|
38
|
+
this.state = {
|
|
39
|
+
isDateInit: false,
|
|
40
|
+
newValue: '',
|
|
41
|
+
dateFormat: '',
|
|
42
|
+
showHourAndMinute: false,
|
|
43
|
+
defaultCalendarValue: null
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
componentDidMount() {
|
|
47
|
+
const {
|
|
48
|
+
value,
|
|
49
|
+
lang
|
|
50
|
+
} = this.props;
|
|
46
51
|
_dayjs.default.locale(lang);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
52
|
+
let dateFormat = this.getDateFormat();
|
|
53
|
+
this.setState({
|
|
54
|
+
isDateInit: true,
|
|
55
|
+
newValue: value,
|
|
56
|
+
dateFormat,
|
|
57
|
+
showHourAndMinute: dateFormat.indexOf('HH:mm') > -1
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
if (!this.state.isDateInit) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
let {
|
|
65
|
+
lang,
|
|
66
|
+
column,
|
|
67
|
+
className,
|
|
68
|
+
isInModal,
|
|
69
|
+
firstDayOfWeek
|
|
70
|
+
} = this.props;
|
|
71
|
+
let {
|
|
72
|
+
newValue,
|
|
73
|
+
dateFormat,
|
|
74
|
+
showHourAndMinute
|
|
75
|
+
} = this.state;
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
77
|
+
query: '(min-width: 768px)'
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_pcDateEditorPopover.default, {
|
|
79
|
+
className: className,
|
|
80
|
+
lang: lang,
|
|
81
|
+
isInModal: isInModal,
|
|
82
|
+
value: newValue,
|
|
83
|
+
dateFormat: dateFormat,
|
|
84
|
+
showHourAndMinute: showHourAndMinute,
|
|
85
|
+
onValueChanged: this.onValueChanged,
|
|
86
|
+
hideCalendar: this.props.hideCalendar,
|
|
87
|
+
firstDayOfWeek: firstDayOfWeek
|
|
88
|
+
})), /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
89
|
+
query: '(max-width: 767.8px)'
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement(_mbDateEditorPopover.default, {
|
|
91
|
+
className: className,
|
|
92
|
+
isReadOnly: this.props.isReadOnly,
|
|
93
|
+
lang: lang,
|
|
94
|
+
value: newValue,
|
|
95
|
+
dateFormat: dateFormat,
|
|
96
|
+
showHourAndMinute: showHourAndMinute,
|
|
97
|
+
column: column,
|
|
98
|
+
onValueChanged: this.onValueChanged,
|
|
99
|
+
onClosePopover: this.props.hideCalendar,
|
|
100
|
+
firstDayOfWeek: firstDayOfWeek
|
|
101
|
+
})));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
DateEditor.defaultProps = {
|
|
105
|
+
isReadOnly: false,
|
|
106
|
+
value: '',
|
|
107
|
+
lang: 'en'
|
|
108
|
+
};
|
|
83
109
|
var _default = exports.default = DateEditor;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-date {
|
|
2
|
+
width: 28px;
|
|
3
|
+
height: 30px;
|
|
4
|
+
border-radius: 50%;
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
line-height: 30px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-date-panel {
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-selected-day .rc-calendar-date {
|
|
14
|
+
background-color: #FcEcD9;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-date:hover,
|
|
18
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-year-panel-year:hover,
|
|
19
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-month-panel-cell .rc-calendar-month-panel-month:hover {
|
|
20
|
+
background-color: #FcEcD9;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-selected-date .rc-calendar-date,
|
|
24
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-selected-date .rc-calendar-date:hover,
|
|
25
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-year-panel-selected-cell .rc-calendar-year-panel-year,
|
|
26
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-month-panel-selected-cell .rc-calendar-month-panel-month {
|
|
27
|
+
background-color: #f09f3f;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-next-year-btn:not([href]):not([tabindex]),
|
|
31
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-prev-year-btn:not([href]):not([tabindex]),
|
|
32
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-next-month-btn:not([href]):not([tabindex]),
|
|
33
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-prev-month-btn:not([href]):not([tabindex]) {
|
|
34
|
+
color: #999;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-next-year-btn:not([href]):not([tabindex]):hover,
|
|
38
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-prev-year-btn:not([href]):not([tabindex]):hover,
|
|
39
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-next-month-btn:not([href]):not([tabindex]):hover,
|
|
40
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-prev-month-btn:not([href]):not([tabindex]):hover {
|
|
41
|
+
color: #666;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-today .rc-calendar-date {
|
|
45
|
+
border: none;
|
|
46
|
+
position: relative;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rc-calendar-today .rc-calendar-date::after {
|
|
50
|
+
content: '';
|
|
51
|
+
background: #f09f3f;
|
|
52
|
+
position: absolute;
|
|
53
|
+
width: 4px;
|
|
54
|
+
height: 4px;
|
|
55
|
+
border-radius: 50%;
|
|
56
|
+
left: 45%;
|
|
57
|
+
bottom: 0%;
|
|
58
|
+
display: inline-block;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar .rdg-editor-container input.editor-main[readonly] {
|
|
62
|
+
background-color: #fff;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-time-picker {
|
|
66
|
+
z-index: 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-right-panel-body ul li.highlight {
|
|
70
|
+
margin: 0;
|
|
71
|
+
border: none;
|
|
72
|
+
background-color: #fff;
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar {
|
|
77
|
+
box-shadow: none;
|
|
78
|
+
border-radius: 0px;
|
|
79
|
+
border: 1px solid #e9e9e9;
|
|
80
|
+
border-left: none;
|
|
81
|
+
border-right: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-date {
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-date-panel {
|
|
89
|
+
width: 100%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-body {
|
|
93
|
+
height: 22rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-table tr {
|
|
97
|
+
height: 3rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-prev-month-btn,
|
|
101
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-next-month-btn,
|
|
102
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-prev-year-btn,
|
|
103
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-next-year-btn {
|
|
104
|
+
font-size: 30px;
|
|
105
|
+
width: 50px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-header {
|
|
109
|
+
border-bottom: none;
|
|
110
|
+
margin-top: 0.5rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-year-select,
|
|
114
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-month-select,
|
|
115
|
+
.dtable-ui.mb-date-editor-picker .rc-calendar-day-select {
|
|
116
|
+
font-size: 16px;
|
|
117
|
+
padding: 5px;
|
|
118
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@import url('./custom-rc-calendar.css');
|
|
2
|
+
@import url('../../css/mb-cell-editor.css');
|
|
3
|
+
|
|
4
|
+
@media screen and (max-width: 767.8px) {
|
|
5
|
+
.dtable-ui-mb-date-editor-body .mb-date-editor-input {
|
|
6
|
+
display: flex;
|
|
7
|
+
border-top: 1px solid #e9e9e9;
|
|
8
|
+
border-bottom: 1px solid #e9e9e9;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dtable-ui-mb-date-editor-body .mb-date-editor-input .date-input {
|
|
12
|
+
flex: 1;
|
|
13
|
+
background-color: #fff;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dtable-ui-mb-date-editor-body .mb-date-editor-input .date-input .date-input-day {
|
|
17
|
+
background-color: #f5f5f5;
|
|
18
|
+
border: 1px solid #e9e9e9;
|
|
19
|
+
margin: 10px;
|
|
20
|
+
padding: 3px 5px;
|
|
21
|
+
border-radius: 3px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.dtable-ui-mb-date-editor-body .dtable-ui.mb-date-editor-picker {
|
|
25
|
+
display: block;
|
|
26
|
+
position: relative;
|
|
27
|
+
margin-top: 20px;
|
|
28
|
+
line-height: 1.5;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.dtable-ui-mb-date-editor-body .mb-date-editor-clear {
|
|
33
|
+
padding: 10px 0;
|
|
34
|
+
margin-top: 20px;
|
|
35
|
+
border-bottom: 1px solid #e9e9e9;
|
|
36
|
+
border-top: 1px solid #e9e9e9;
|
|
37
|
+
text-align: center;
|
|
38
|
+
color: #d27053;
|
|
39
|
+
background-color: #fff;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.dtable-ui .am-picker-popup-header .am-picker-popup-item {
|
|
43
|
+
color: #E5A252;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _datePicker = _interopRequireDefault(require("antd-mobile/lib/date-picker"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
13
|
+
var _seafileCalendar = _interopRequireDefault(require("@seafile/seafile-calendar"));
|
|
14
|
+
var SeaDatePicker = _interopRequireWildcard(require("@seafile/seafile-calendar/lib/Picker"));
|
|
15
|
+
var _lang = require("../../lang");
|
|
16
|
+
var _editorUtils = require("../../utils/editor-utils");
|
|
17
|
+
var _MBEditorHeader = _interopRequireDefault(require("../../MBEditorHeader"));
|
|
18
|
+
require("@seafile/seafile-calendar/assets/index.css");
|
|
19
|
+
require("./index.css");
|
|
20
|
+
class DateEditorPopover extends _react.default.PureComponent {
|
|
21
|
+
constructor(props) {
|
|
22
|
+
super(props);
|
|
23
|
+
this.handleHistaryBack = e => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
this.closePopover();
|
|
26
|
+
};
|
|
27
|
+
this.handleDateChange = date => {
|
|
28
|
+
let {
|
|
29
|
+
dateFormat,
|
|
30
|
+
showHourAndMinute
|
|
31
|
+
} = this.props;
|
|
32
|
+
let newValue = (0, _dayjs.default)(date);
|
|
33
|
+
if (showHourAndMinute) {
|
|
34
|
+
const {
|
|
35
|
+
datePickerValue
|
|
36
|
+
} = this.state;
|
|
37
|
+
const HM = datePickerValue.format('HH:mm');
|
|
38
|
+
const format = dateFormat.split(' ')[0]; // 'YYYY-MM-DD HH:mm'
|
|
39
|
+
const newDate = (0, _dayjs.default)(date).format(format) + ' ' + HM;
|
|
40
|
+
newValue = (0, _dayjs.default)(newDate);
|
|
41
|
+
}
|
|
42
|
+
this.setState({
|
|
43
|
+
datePickerValue: (0, _dayjs.default)(date)
|
|
44
|
+
});
|
|
45
|
+
this.props.onValueChanged(newValue.format(dateFormat));
|
|
46
|
+
};
|
|
47
|
+
this.handleTimeChange = time => {
|
|
48
|
+
const {
|
|
49
|
+
datePickerValue
|
|
50
|
+
} = this.state;
|
|
51
|
+
const {
|
|
52
|
+
dateFormat
|
|
53
|
+
} = this.props;
|
|
54
|
+
const format = dateFormat.split(' ')[0]; // 'YYYY-MM-DD HH:mm'
|
|
55
|
+
const YMD = datePickerValue.format(format);
|
|
56
|
+
const newDate = YMD + ' ' + (0, _dayjs.default)(time).format('HH:mm');
|
|
57
|
+
const newValue = (0, _dayjs.default)(newDate);
|
|
58
|
+
this.setState({
|
|
59
|
+
datePickerValue: newValue
|
|
60
|
+
});
|
|
61
|
+
this.props.onValueChanged(datePickerValue.format(dateFormat));
|
|
62
|
+
};
|
|
63
|
+
this.closePopover = () => {
|
|
64
|
+
this.props.onClosePopover();
|
|
65
|
+
};
|
|
66
|
+
this.deleteDate = () => {
|
|
67
|
+
this.props.onValueChanged('');
|
|
68
|
+
this.closePopover();
|
|
69
|
+
};
|
|
70
|
+
this.onChange = value => {
|
|
71
|
+
if (!value) return;
|
|
72
|
+
let {
|
|
73
|
+
dateFormat
|
|
74
|
+
} = this.props;
|
|
75
|
+
this.setState({
|
|
76
|
+
datePickerValue: value
|
|
77
|
+
});
|
|
78
|
+
this.props.onValueChanged(value.format(dateFormat));
|
|
79
|
+
};
|
|
80
|
+
this.onContainerClick = event => {
|
|
81
|
+
if (this.editorPopover && this.editorPopover.contains(event.target)) {
|
|
82
|
+
event.stopPropagation();
|
|
83
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
this.setEditorPopover = editorPopover => {
|
|
88
|
+
this.editorPopover = editorPopover;
|
|
89
|
+
};
|
|
90
|
+
this.getCalendarContainer = () => {
|
|
91
|
+
return this.calendarContainerRef.current;
|
|
92
|
+
};
|
|
93
|
+
this.getCalender = () => {
|
|
94
|
+
let {
|
|
95
|
+
dateFormat,
|
|
96
|
+
lang,
|
|
97
|
+
className,
|
|
98
|
+
firstDayOfWeek
|
|
99
|
+
} = this.props;
|
|
100
|
+
let defaultValue = (0, _dayjs.default)().clone();
|
|
101
|
+
return /*#__PURE__*/_react.default.createElement(_seafileCalendar.default, {
|
|
102
|
+
className: (0, _classnames.default)('dtable-rc-calendar', className),
|
|
103
|
+
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
104
|
+
format: dateFormat,
|
|
105
|
+
defaultValue: defaultValue,
|
|
106
|
+
dateInputPlaceholder: (0, _lang.getLocale)('Please_input'),
|
|
107
|
+
showDateInput: false,
|
|
108
|
+
focusablePanel: false,
|
|
109
|
+
showToday: false,
|
|
110
|
+
showTime: false,
|
|
111
|
+
style: {
|
|
112
|
+
width: '100%',
|
|
113
|
+
fontSize: '14px'
|
|
114
|
+
},
|
|
115
|
+
firstDayOfWeek: firstDayOfWeek
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
this.renderDataPicker = () => {
|
|
119
|
+
let {
|
|
120
|
+
dateFormat
|
|
121
|
+
} = this.props;
|
|
122
|
+
let {
|
|
123
|
+
datePickerValue
|
|
124
|
+
} = this.state;
|
|
125
|
+
let calendar = this.getCalender();
|
|
126
|
+
return /*#__PURE__*/_react.default.createElement(SeaDatePicker, {
|
|
127
|
+
open: true,
|
|
128
|
+
style: {
|
|
129
|
+
width: '100%'
|
|
130
|
+
},
|
|
131
|
+
calendar: calendar,
|
|
132
|
+
value: datePickerValue,
|
|
133
|
+
getCalendarContainer: this.getCalendarContainer,
|
|
134
|
+
onChange: this.onChange
|
|
135
|
+
}, _ref => {
|
|
136
|
+
let {
|
|
137
|
+
value
|
|
138
|
+
} = _ref;
|
|
139
|
+
value = value && value.format(dateFormat);
|
|
140
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
141
|
+
tabIndex: "0",
|
|
142
|
+
onFocus: this.onReadOnlyFocus
|
|
143
|
+
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
144
|
+
placeholder: (0, _lang.getLocale)('Please_select'),
|
|
145
|
+
readOnly: true,
|
|
146
|
+
tabIndex: "-1",
|
|
147
|
+
className: "form-control",
|
|
148
|
+
value: value || ''
|
|
149
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
150
|
+
ref: this.calendarContainerRef,
|
|
151
|
+
style: {
|
|
152
|
+
height: '22rem'
|
|
153
|
+
}
|
|
154
|
+
}));
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
this.state = {
|
|
158
|
+
open: true,
|
|
159
|
+
datePickerValue: props.value ? (0, _dayjs.default)(props.value) : (0, _dayjs.default)().clone()
|
|
160
|
+
};
|
|
161
|
+
this.calendarContainerRef = /*#__PURE__*/_react.default.createRef();
|
|
162
|
+
}
|
|
163
|
+
componentDidMount() {
|
|
164
|
+
history.pushState(null, null, '#'); // eslint-disable-line
|
|
165
|
+
window.addEventListener('popstate', this.handleHistaryBack, false);
|
|
166
|
+
}
|
|
167
|
+
componentWillUnmount() {
|
|
168
|
+
window.removeEventListener('popstate', this.handleHistaryBack, false);
|
|
169
|
+
}
|
|
170
|
+
render() {
|
|
171
|
+
const {
|
|
172
|
+
lang,
|
|
173
|
+
column,
|
|
174
|
+
dateFormat,
|
|
175
|
+
showHourAndMinute
|
|
176
|
+
} = this.props;
|
|
177
|
+
const leftFormat = dateFormat.split(' ')[0];
|
|
178
|
+
const rightFormat = dateFormat.split(' ')[1];
|
|
179
|
+
const {
|
|
180
|
+
datePickerValue
|
|
181
|
+
} = this.state;
|
|
182
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
183
|
+
ref: this.setEditorPopover,
|
|
184
|
+
className: "dtable-ui-mb-editor-popover mb-date-editor-popover",
|
|
185
|
+
onClick: this.onContainerClick
|
|
186
|
+
}, /*#__PURE__*/_react.default.createElement(_MBEditorHeader.default, {
|
|
187
|
+
title: column.name,
|
|
188
|
+
leftContent: /*#__PURE__*/_react.default.createElement("i", {
|
|
189
|
+
className: "dtable-font dtable-icon-return"
|
|
190
|
+
}),
|
|
191
|
+
rightContent: /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Done')),
|
|
192
|
+
onLeftClick: this.props.onClosePopover,
|
|
193
|
+
onRightClick: this.props.onClosePopover
|
|
194
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
195
|
+
className: "dtable-ui-mb-editor-body dtable-ui-mb-date-editor-body"
|
|
196
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
197
|
+
className: "mb-date-editor-input"
|
|
198
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
199
|
+
className: "date-input"
|
|
200
|
+
}, /*#__PURE__*/_react.default.createElement(_datePicker.default, {
|
|
201
|
+
mode: "date",
|
|
202
|
+
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
203
|
+
value: this.state.value,
|
|
204
|
+
onChange: this.handleDateChange
|
|
205
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
206
|
+
className: "date-input-day"
|
|
207
|
+
}, datePickerValue && datePickerValue.format(leftFormat)))), showHourAndMinute && /*#__PURE__*/_react.default.createElement("div", {
|
|
208
|
+
className: "date-input"
|
|
209
|
+
}, /*#__PURE__*/_react.default.createElement(_datePicker.default, {
|
|
210
|
+
mode: "time",
|
|
211
|
+
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
212
|
+
value: this.state.value,
|
|
213
|
+
onChange: this.handleTimeChange
|
|
214
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
215
|
+
className: "date-input-day"
|
|
216
|
+
}, datePickerValue && datePickerValue.format(rightFormat))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
217
|
+
className: "dtable-ui mb-date-editor-picker"
|
|
218
|
+
}, this.renderDataPicker()), /*#__PURE__*/_react.default.createElement("div", {
|
|
219
|
+
className: "mb-date-editor-clear"
|
|
220
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
221
|
+
onClick: this.deleteDate,
|
|
222
|
+
className: "clear-date"
|
|
223
|
+
}, (0, _lang.getLocale)('Clear')))));
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
var _default = exports.default = DateEditorPopover;
|
|
@@ -12,10 +12,10 @@ var _Picker = _interopRequireDefault(require("@seafile/seafile-calendar/lib/Pick
|
|
|
12
12
|
var _seafileCalendar = _interopRequireDefault(require("@seafile/seafile-calendar"));
|
|
13
13
|
var _editorUtils = require("../utils/editor-utils");
|
|
14
14
|
var _constants = require("../constants");
|
|
15
|
-
var _lang = require("../lang");
|
|
16
15
|
require("@seafile/seafile-calendar/assets/index.css");
|
|
16
|
+
var _lang = require("../lang");
|
|
17
17
|
let now = (0, _dayjs.default)();
|
|
18
|
-
class
|
|
18
|
+
class PCDateEditorPopover extends _react.default.Component {
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props);
|
|
21
21
|
// event trigger sequence: onOpenChange --> onChange
|
|
@@ -28,10 +28,10 @@ class PCDateEditor extends _react.default.Component {
|
|
|
28
28
|
value: value,
|
|
29
29
|
open: true // if value changed, don't close datePicker
|
|
30
30
|
});
|
|
31
|
-
this.props.
|
|
31
|
+
this.props.onValueChanged(value.format(dateFormat));
|
|
32
32
|
};
|
|
33
33
|
this.onBlur = () => {
|
|
34
|
-
this.props.
|
|
34
|
+
this.props.onValueChanged(this.getValue());
|
|
35
35
|
};
|
|
36
36
|
this.getValue = () => {
|
|
37
37
|
let {
|
|
@@ -55,7 +55,7 @@ class PCDateEditor extends _react.default.Component {
|
|
|
55
55
|
this.toggleCalendar(open);
|
|
56
56
|
}
|
|
57
57
|
if (isInModal && !open) {
|
|
58
|
-
this.props.
|
|
58
|
+
this.props.hideCalendar && this.props.hideCalendar();
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
this.toggleCalendar = open => {
|
|
@@ -67,7 +67,7 @@ class PCDateEditor extends _react.default.Component {
|
|
|
67
67
|
this.setState({
|
|
68
68
|
value: null
|
|
69
69
|
});
|
|
70
|
-
this.props.
|
|
70
|
+
this.props.onValueChanged(null);
|
|
71
71
|
};
|
|
72
72
|
this.onFocusDatePicker = () => {
|
|
73
73
|
this.setState({
|
|
@@ -112,7 +112,7 @@ class PCDateEditor extends _react.default.Component {
|
|
|
112
112
|
const {
|
|
113
113
|
isInModal
|
|
114
114
|
} = this.props;
|
|
115
|
-
let onClickRightPanelTime = isInModal ? this.props.
|
|
115
|
+
let onClickRightPanelTime = isInModal ? this.props.hideCalendar : this.closeEditor;
|
|
116
116
|
// we should change value and save it(async function), then close Editor.
|
|
117
117
|
setTimeout(() => {
|
|
118
118
|
onClickRightPanelTime && onClickRightPanelTime();
|
|
@@ -122,7 +122,7 @@ class PCDateEditor extends _react.default.Component {
|
|
|
122
122
|
if (e.keyCode === _constants.KeyCodes.Escape) {
|
|
123
123
|
if (this.props.isInModal) {
|
|
124
124
|
e.stopPropagation();
|
|
125
|
-
this.props.
|
|
125
|
+
this.props.hideCalendar && this.props.hideCalendar();
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
};
|
|
@@ -261,4 +261,4 @@ class PCDateEditor extends _react.default.Component {
|
|
|
261
261
|
}));
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
var _default = exports.default =
|
|
264
|
+
var _default = exports.default = PCDateEditorPopover;
|
package/lib/{DepartmentMultipleSelectEditor → Department-editor/department-multiple-select}/index.js
RENAMED
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var _lang = require("
|
|
10
|
+
var _utils = require("../utils");
|
|
11
|
+
var _selectedDepartments = _interopRequireDefault(require("../selected-departments"));
|
|
12
|
+
var _lang = require("../../lang");
|
|
13
13
|
require("./index.css");
|
|
14
14
|
function DepartmentMultipleSelect(props) {
|
|
15
15
|
const {
|
|
@@ -21,7 +21,7 @@ function DepartmentMultipleSelect(props) {
|
|
|
21
21
|
departments: initialDepartments
|
|
22
22
|
} = props;
|
|
23
23
|
const [searchVal, setSearchVal] = (0, _react.useState)('');
|
|
24
|
-
const [departments, setDepartments] = (0, _react.useState)((0,
|
|
24
|
+
const [departments, setDepartments] = (0, _react.useState)((0, _utils.getNormalizedDepartments)(initialDepartments));
|
|
25
25
|
const departmentContainerRef = (0, _react.useRef)(null);
|
|
26
26
|
const validDepartmentsRef = (0, _react.useRef)([]);
|
|
27
27
|
(0, _react.useEffect)(() => {
|
|
@@ -51,7 +51,7 @@ function DepartmentMultipleSelect(props) {
|
|
|
51
51
|
function onChangeSearch(event) {
|
|
52
52
|
const newSearchValue = event.target.value;
|
|
53
53
|
if (searchVal === newSearchValue) return;
|
|
54
|
-
validDepartmentsRef.current = (0,
|
|
54
|
+
validDepartmentsRef.current = (0, _utils.searchDepartments)(departments, newSearchValue);
|
|
55
55
|
setSearchVal(newSearchValue);
|
|
56
56
|
}
|
|
57
57
|
function onClick(e) {
|
|
@@ -130,7 +130,7 @@ function DepartmentMultipleSelect(props) {
|
|
|
130
130
|
}, isShowSelectedDepartments && /*#__PURE__*/_react.default.createElement("div", {
|
|
131
131
|
className: "selected-departments dtable-ui",
|
|
132
132
|
onClick: onClick
|
|
133
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement(_selectedDepartments.default, {
|
|
134
134
|
value: value,
|
|
135
135
|
removeDepartment: onCommit,
|
|
136
136
|
isShowRemoveIcon: true,
|