@titaui/pc 1.11.4-1 → 1.11.4-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/date-picker/BodyItem.js +3 -3
- package/lib/components/date-picker/CalendarHeader.js +3 -3
- package/lib/components/delete-confirm-pop/ConfirmPop.js +3 -3
- package/lib/components/dynamic/constant.js +31 -30
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +21 -6
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +4 -4
- package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +19 -7
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
- package/{es/pages/group-management/page-view/loading → lib/components/dynamic/dynamic-item/dynamic-interview-share}/index.js +33 -11
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
- package/lib/components/dynamic/dynamic-item/index.js +41 -32
- package/lib/components/eReport/eReportLists/reportList.js +3 -3
- package/lib/components/emotions-selector/selector-pop.js +3 -3
- package/lib/components/ereport-list/index.js +3 -3
- package/lib/components/mblog/components/MblogAction.js +3 -3
- package/lib/components/menus/export-modules/interview-menus/constant.js +12 -12
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
- package/lib/components/okr-review/components/ReviewItem/index.js +3 -3
- package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +3 -3
- package/lib/components/range-selector-pop/RangeSelectorPop.js +3 -3
- package/lib/components/rich-editor/models/schema.js +6 -6
- package/lib/components/rich-editor/plugins/block/block-quote/index.js +8 -8
- package/lib/components/rich-editor/plugins/block/heading/index.js +8 -8
- package/lib/components/rich-editor/plugins/block/lists/index.js +14 -14
- package/lib/components/rich-editor/plugins/block/paragraph/index.js +5 -5
- package/lib/components/rich-editor/plugins/core/index.js +4 -4
- package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -5
- package/lib/components/rich-editor/plugins/extension/placeholder/index.js +4 -4
- package/lib/components/rich-editor/plugins/inline/color/index.js +11 -11
- package/lib/components/rich-editor/plugins/inline/delete-line/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/em/index.js +5 -5
- package/lib/components/rich-editor/plugins/inline/link/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/strong/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/under-line/index.js +8 -8
- package/lib/components/rich-editor/react/uiProvider.js +3 -3
- package/lib/components/rich-editor/ui/Popup/index.js +3 -3
- package/lib/components/select/Option.js +3 -3
- package/lib/components/task-tree/helper.js +61 -0
- package/lib/components/task-tree/images/P1.svg +15 -0
- package/lib/components/task-tree/images/P2.svg +15 -0
- package/lib/components/task-tree/images/P3.svg +15 -0
- package/lib/components/task-tree/images/P4.svg +15 -0
- package/lib/components/task-tree/images/P5.svg +15 -0
- package/lib/components/task-tree/images/arrow.svg +9 -0
- package/lib/components/task-tree/images/empty-131.png +0 -0
- package/lib/components/task-tree/images/followed.svg +33 -0
- package/lib/components/task-tree/images/nice.svg +108 -0
- package/lib/components/task-tree/images/struc12.png +0 -0
- package/lib/components/task-tree/images/struc2.png +0 -0
- package/lib/components/task-tree/images/xialat-s.svg +13 -0
- package/lib/components/task-tree/index.js +27 -0
- package/lib/components/task-tree/mock.js +944 -0
- package/{es/components/okr-detail/components/okr-tree → lib/components/task-tree}/precls.js +1 -1
- package/lib/components/task-tree/request-apis.js +88 -0
- package/lib/components/task-tree/task-item-node/constant.js +45 -0
- package/{es/components/okr-detail/components/okr-tree/tree-node/default-node.js → lib/components/task-tree/task-item-node/e-empty.js} +13 -6
- package/{es/components/okr-detail/components/okr-tree/tree-node/e-node → lib/components/task-tree/task-item-node}/e-project.js +29 -34
- package/{es/components/e-status-dropdown/index.js → lib/components/task-tree/task-item-node/e-status-dropdown.js} +3 -3
- package/{es/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js → lib/components/task-tree/task-item-node/e-task.js} +140 -121
- package/{es/components/okr-detail/components/okr-tree/tree-node → lib/components/task-tree/task-item-node}/get-process-color.js +3 -3
- package/lib/components/task-tree/task-item-node/index.css +290 -0
- package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
- package/lib/components/task-tree/task-tree.css +8 -0
- package/{es/components/okr-detail/components/okr-tree/index.js → lib/components/task-tree/task-tree.js} +17 -16
- package/lib/components/tita-chart/errorBoundary/index.js +3 -3
- package/lib/components-v1/animate/AnimateChild.js +3 -3
- package/lib/components-v1/avatar/index.js +3 -3
- package/lib/components-v1/dropDownSelector/StatelessDropdown.js +3 -3
- package/lib/components-v1/progress/CircleProgress.js +3 -3
- package/lib/components-v1/select/Option.js +3 -3
- package/lib/components-v1/userSelector/UserSelectorPop.js +3 -3
- package/lib/components-v1/userSelector/components/MultiMode/index.js +3 -3
- package/lib/components-v1/userSelector/components/UserItem.js +3 -3
- package/lib/index.js +8 -0
- package/package.json +1 -1
- package/yarn-error.log +6356 -5424
- package/es/components/cascader/time.js +0 -31
- package/es/components/common-share/request-apis.js +0 -56
- package/es/components/confidence/heart.js +0 -66
- package/es/components/create-okr-modal/fields/index.js +0 -17
- package/es/components/create-okr-modal/utils/getCreateOkrSurpassPercent.js +0 -154
- package/es/components/date-picker/BodyItem.js +0 -121
- package/es/components/date-picker/CalendarBody.js +0 -157
- package/es/components/date-picker/CalendarHeader.js +0 -187
- package/es/components/date-picker/index.js +0 -157
- package/es/components/date-range-picker/index.js +0 -210
- package/es/components/dialog/index.js +0 -119
- package/es/components/dialog-confirm/index.js +0 -154
- package/es/components/drop-selector/icon-item.js +0 -40
- package/es/components/drop-selector/index.js +0 -179
- package/es/components/dynamic/dynamic-like-ranking/mock.js +0 -84
- package/es/components/dynamic/dynamic-liking/mock.js +0 -83
- package/es/components/dynamic/dynamic-topping/request-api.js +0 -36
- package/es/components/e-priority/index.js +0 -88
- package/es/components/grid-layout/commen-components/index.js +0 -73
- package/es/components/grid-layout/image/could.js +0 -8
- package/es/components/grid-layout/image/lv.js +0 -8
- package/es/components/grid-layout/image/tita-mask.js +0 -8
- package/es/components/help-card/request-api.js +0 -35
- package/es/components/icon-button-list/index.js +0 -65
- package/es/components/menus/context.js +0 -18
- package/es/components/menus/precls.js +0 -8
- package/es/components/okr-detail/auth.js +0 -197
- package/es/components/okr-detail/components/ao-nice/index.js +0 -245
- package/es/components/okr-detail/components/block-line/index.js +0 -20
- package/es/components/okr-detail/components/header/index.js +0 -211
- package/es/components/okr-detail/components/icon-text/index.js +0 -116
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +0 -88
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-status-dropdown.js +0 -98
- package/es/components/okr-detail/components/okr-tree/tree-node/index.js +0 -90
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/get-process-color.js +0 -46
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +0 -421
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/index.js +0 -54
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/style.js +0 -62
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +0 -94
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +0 -273
- package/es/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +0 -207
- package/es/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +0 -236
- package/es/components/okr-detail/components/padding-layout.js +0 -22
- package/es/components/okr-detail/components/tab-panel-content/index.js +0 -27
- package/es/components/okr-detail/context.js +0 -30
- package/es/components/okr-detail/e-list/index.js +0 -243
- package/es/components/okr-detail/e-list/precls.js +0 -8
- package/es/components/okr-detail/e-list/search-form/fields/e-order.js +0 -172
- package/es/components/okr-detail/e-list/search-form/fields/e-status.js +0 -99
- package/es/components/okr-detail/e-list/search-form/fields/e-user.js +0 -49
- package/es/components/okr-detail/e-list/search-form/index.js +0 -143
- package/es/components/okr-detail/error-page/index.js +0 -33
- package/es/components/okr-detail/index.js +0 -428
- package/es/components/okr-detail/loading/index.js +0 -28
- package/es/components/okr-detail/okr-list/add-parent-okr.js +0 -37
- package/es/components/okr-detail/okr-list/create-kr-item/heart.js +0 -38
- package/es/components/okr-detail/okr-list/drag-order-kr.js +0 -62
- package/es/components/okr-detail/okr-list/empty/index.js +0 -48
- package/es/components/okr-detail/okr-list/index.js +0 -524
- package/es/components/okr-detail/okr-list/warp-parent-okr.js +0 -21
- package/es/components/okr-detail/store.js +0 -1
- package/es/components/okr-flow/child-node/fields/creator.js +0 -175
- package/es/components/okr-flow/child-node/fields/okrClassify.js +0 -31
- package/es/components/okr-flow/child-node/fields/okrType.js +0 -21
- package/es/components/okr-flow/child-node/helper.js +0 -35
- package/es/components/okr-flow/child-node/index.js +0 -110
- package/es/components/okr-flow/child-node/kr-node.js +0 -75
- package/es/components/okr-flow/child-node/work-node.js +0 -242
- package/es/components/okr-flow/context.js +0 -14
- package/es/components/okr-flow/empty/index.js +0 -29
- package/es/components/okr-flow/export-modules/okr-search-panel/index.js +0 -394
- package/es/components/okr-flow/index.js +0 -24
- package/es/components/okr-flow/mini-map/index.js +0 -112
- package/es/components/okr-flow/mini-map/map.js +0 -145
- package/es/components/okr-flow/mini-map/mini-node.js +0 -57
- package/es/components/okr-flow/mini-map/utils.js +0 -79
- package/es/components/okr-flow/okr-map/index.js +0 -192
- package/es/components/okr-flow/open-data/index.js +0 -115
- package/es/components/okr-flow/precls.js +0 -8
- package/es/components/okr-flow/request-apis.js +0 -118
- package/es/components/okr-flow/root-node/index.js +0 -229
- package/es/components/okr-flow/utils/config.js +0 -18
- package/es/components/okr-flow/utils/helper.js +0 -36
- package/es/components/okr-flow/utils/index.js +0 -66
- package/es/components/okr-flow/utils/tree-handler.js +0 -323
- package/es/components/okr-progress-modal/helper.js +0 -156
- package/es/components/okr-progress-modal/request-apis.js +0 -34
- package/es/components/okr-share/request-apis.js +0 -56
- package/es/components/okrcase-library/server/network.js +0 -407
- package/es/components/pagination/locale/en_US.js +0 -22
- package/es/components/pagination/locale/zh_CN.js +0 -22
- package/es/components/point-demo/drop-down-box/index.js +0 -159
- package/es/components/point-demo/index.js +0 -533
- package/es/components/point-demo/input/index.js +0 -176
- package/es/components/point-demo/point-demo.js +0 -75
- package/es/components/point-demo/popup/index.js +0 -113
- package/es/components/point-demo/popup/placement.js +0 -44
- package/es/components/range-picker-pop/index.js +0 -273
- package/es/components/scrollbar/simplebar/helpers.js +0 -59
- package/es/components/scrollbar/simplebar/index.js +0 -91
- package/es/components/scrollbar/simplebar/scrollbar-width.js +0 -47
- package/es/components/scrollbar/simplebar/simplebar.js +0 -852
- package/es/components/scrollbar/simplebar-react.js +0 -163
- package/es/components/search-dropdown/index.js +0 -40
- package/es/components/search-input/index.js +0 -126
- package/es/components/select/Option.js +0 -94
- package/es/components/select/index.js +0 -330
- package/es/components/selector-input/debounce.js +0 -36
- package/es/components/selector-input/index.js +0 -109
- package/es/components/slider-input/index.js +0 -119
- package/es/components/switch/index.js +0 -39
- package/es/components/table/index.js +0 -275
- package/es/components/tabs/index.js +0 -63
- package/es/components/task-relation-modal/tree-node/index.js +0 -58
- package/es/components/tita-chart/charts/img/could.js +0 -8
- package/es/components/tooltip/error-tip.js +0 -24
- package/es/components/tooltip/index.js +0 -21
- package/es/components/tree/index.js +0 -79
- package/es/components/tree/precls.js +0 -8
- package/es/components/upvote/request-apis.js +0 -45
- package/es/components/user-selector/action-btns/btn-cancel.js +0 -21
- package/es/components/user-selector/action-btns/btn-ok.js +0 -21
- package/es/components/user-selector/action-btns/index.js +0 -27
- package/es/components/user-selector/context.js +0 -18
- package/es/components/user-selector/empty/group.js +0 -55
- package/es/components/user-selector/empty/index.js +0 -28
- package/es/components/user-selector/export-modules/depart-search-selector/result-part.js +0 -41
- package/es/components/user-selector/export-modules/group-selector/index.js +0 -170
- package/es/components/user-selector/export-modules/group-selector/searched-panel.js +0 -68
- package/es/components/user-selector/export-modules/multiple-user-selector--bak/index.js +0 -246
- package/es/components/user-selector/index.js +0 -25
- package/es/components/user-selector/layout/index.js +0 -25
- package/es/components/user-selector/loading/index.js +0 -18
- package/es/components/user-selector/request-apis.js +0 -180
- package/es/components/user-selector/searched-panel/index.js +0 -139
- package/es/components/user-selector/searched-panel/result-part.js +0 -43
- package/es/components/user-selector/select-tree/selected-tree/index.js +0 -91
- package/es/components/user-selector/select-tree/tree-nodes/tree-depart-node/index.js +0 -48
- package/es/components/user-selector/select-tree/tree-nodes/tree-duties-node/index.js +0 -27
- package/es/components/user-selector/select-tree/tree-nodes/tree-group-node/index.js +0 -57
- package/es/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +0 -93
- package/es/components/user-selector/utils.js +0 -139
- package/es/components/viewer/ImageListRender.js +0 -143
- package/es/components/viewer/index.js +0 -168
- package/es/components/word-cloud/index.js +0 -109
- package/es/components/word-cloud/request-apis.js +0 -26
- package/es/components-v1/animate/AnimateChild.js +0 -76
- package/es/components-v1/animate/animate.js +0 -148
- package/es/components-v1/animate/index.js +0 -13
- package/es/components-v1/dom/index.js +0 -30
- package/es/components-v1/placement/index.js +0 -13
- package/es/components-v1/placement/placement.js +0 -111
- package/es/components-v1/placement/placementInner.js +0 -139
- package/es/components-v1/pop/Pop.js +0 -246
- package/es/components-v1/pop/PopInner.js +0 -163
- package/es/components-v1/pop/index.js +0 -13
- package/es/components-v1/progress/CircleProgress.js +0 -152
- package/es/components-v1/progress/LineProgress.js +0 -83
- package/es/components-v1/progress/index.js +0 -80
- package/es/components-v1/select/Option.js +0 -94
- package/es/components-v1/select/index.js +0 -330
- package/es/components-v1/utils/animate/animate.js +0 -103
- package/es/components-v1/utils/animate/event.js +0 -79
- package/es/components-v1/utils/dom/index.js +0 -30
- package/es/components-v1/utils/placement/autoAdjustPlacement.js +0 -93
- package/es/components-v1/utils/placement/getContainerVisibleArea.js +0 -22
- package/es/components-v1/utils/placement/getExpectPlacement.js +0 -49
- package/es/components-v1/utils/placement/getPlacementInContainer.js +0 -26
- package/es/components-v1/utils/placement/placement.js +0 -76
- package/es/index.js +0 -777
- package/es/pages/appointment-demo/drop-down-box/index.js +0 -159
- package/es/pages/appointment-demo/index.js +0 -649
- package/es/pages/appointment-demo/input/index.js +0 -176
- package/es/pages/appointment-demo/popup/index.js +0 -113
- package/es/pages/appointment-demo/popup/placement.js +0 -44
- package/es/pages/group-management/components/checkbox/index.js +0 -28
- package/es/pages/group-management/components/input-form/index.js +0 -174
- package/es/pages/group-management/components/radio/index.js +0 -21
- package/es/pages/group-management/components/table/index.js +0 -174
- package/es/pages/group-management/groupInterface.js +0 -293
- package/es/pages/group-management/index.js +0 -13
- package/es/pages/group-management/page-view/empty.js +0 -111
- package/es/pages/group-management/page-view/group-empty.js +0 -66
- package/es/pages/group-management/page-view/importGroupStaff/index.js +0 -208
- package/es/pages/group-management/page-view/index.js +0 -412
- package/es/pages/group-management/table/index.js +0 -104
- package/es/pages/group-management/tree/add-group-dialog/index.js +0 -153
- package/es/pages/group-management/tree/delete-group-dialog/index.js +0 -82
- package/es/pages/group-management/tree/edit-group-dialog/index.js +0 -155
- package/es/pages/group-management/tree/group-form/index.js +0 -207
- package/es/pages/group-management/tree/index.js +0 -168
- package/es/pages/group-management/tree/operation-panel.js +0 -41
- package/es/pages/group-management/tree/trigger-render.js +0 -99
- package/es/pages/like-ranking/mock.js +0 -366
- package/es/pages/okr-map/export-modules/index.js +0 -1
- package/es/pages/okr-map/export-modules/okr-map/header/index.js +0 -182
- package/es/pages/okr-map/export-modules/okr-map/header/show-kr-confirm.js +0 -47
- package/es/pages/okr-map/export-modules/okr-map/okr-map.js +0 -497
- package/es/pages/okr-map/export-modules/share-okr-page/header/index.js +0 -69
- package/es/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +0 -168
- package/es/pages/okr-map/hooks/useStorage.js +0 -96
- package/es/pages/okr-map/index.js +0 -18
- package/es/pages/okr-map/level2-search/depart.js +0 -53
- package/es/pages/okr-map/level2-search/group.js +0 -69
- package/es/pages/okr-map/level2-search/index.js +0 -51
- package/es/pages/okr-map/level2-search/level2-input.js +0 -46
- package/es/pages/okr-map/level2-search/user.js +0 -54
- package/es/pages/okr-map/no-okr/index.js +0 -24
- package/es/pages/okr-map/number-select/index.js +0 -81
- package/es/pages/okr-map/open-data/index.js +0 -115
- package/es/pages/okr-map/precls.js +0 -8
- package/es/pages/okr-map/request-apis.js +0 -76
- package/es/pages/okr-map/share-dialog/index.js +0 -122
- package/es/pages/okr-map/unsupport-ie/index.js +0 -83
- package/es/pages/okr-map/utils.js +0 -51
- package/es/utils/auth.js +0 -294
- package/es/utils/bs-global.js +0 -114
- package/es/utils/local-storage.js +0 -42
- package/es/utils/mblog.js +0 -33
- package/es/utils/mock-bsglobal.js +0 -1837
- package/es/utils/open-data.js +0 -341
- package/es/utils/request-v1.js +0 -115
- package/es/utils/request.js +0 -183
- package/es/utils/tools.js +0 -286
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
-
|
|
14
|
-
var _select = _interopRequireDefault(require("../select"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
-
|
|
24
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
-
|
|
26
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
-
|
|
28
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
29
|
-
|
|
30
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
-
|
|
32
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
-
|
|
34
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
-
|
|
36
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
37
|
-
|
|
38
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
|
-
|
|
40
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
-
|
|
42
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
43
|
-
|
|
44
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
-
|
|
46
|
-
var months = [{
|
|
47
|
-
text: 1,
|
|
48
|
-
value: 0
|
|
49
|
-
}, {
|
|
50
|
-
text: 2,
|
|
51
|
-
value: 1
|
|
52
|
-
}, {
|
|
53
|
-
text: 3,
|
|
54
|
-
value: 2
|
|
55
|
-
}, {
|
|
56
|
-
text: 4,
|
|
57
|
-
value: 3
|
|
58
|
-
}, {
|
|
59
|
-
text: 5,
|
|
60
|
-
value: 4
|
|
61
|
-
}, {
|
|
62
|
-
text: 6,
|
|
63
|
-
value: 5
|
|
64
|
-
}, {
|
|
65
|
-
text: 7,
|
|
66
|
-
value: 6
|
|
67
|
-
}, {
|
|
68
|
-
text: 8,
|
|
69
|
-
value: 7
|
|
70
|
-
}, {
|
|
71
|
-
text: 9,
|
|
72
|
-
value: 8
|
|
73
|
-
}, {
|
|
74
|
-
text: 10,
|
|
75
|
-
value: 9
|
|
76
|
-
}, {
|
|
77
|
-
text: 11,
|
|
78
|
-
value: 10
|
|
79
|
-
}, {
|
|
80
|
-
text: 12,
|
|
81
|
-
value: 11
|
|
82
|
-
}];
|
|
83
|
-
|
|
84
|
-
var CalendarHeader = /*#__PURE__*/function (_Component) {
|
|
85
|
-
_inherits(CalendarHeader, _Component);
|
|
86
|
-
|
|
87
|
-
var _super = _createSuper(CalendarHeader);
|
|
88
|
-
|
|
89
|
-
function CalendarHeader() {
|
|
90
|
-
var _temp, _this;
|
|
91
|
-
|
|
92
|
-
_classCallCheck(this, CalendarHeader);
|
|
93
|
-
|
|
94
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
95
|
-
args[_key] = arguments[_key];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.setDate = function (func) {
|
|
99
|
-
var date = (0, _moment["default"])(_this.props.date);
|
|
100
|
-
|
|
101
|
-
for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
102
|
-
rest[_key2 - 1] = arguments[_key2];
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
date[func].apply(date, rest);
|
|
106
|
-
|
|
107
|
-
_this.props.onChangeDate(date);
|
|
108
|
-
}, _this.getYears = function () {
|
|
109
|
-
var years = [];
|
|
110
|
-
|
|
111
|
-
for (var i = 0; i < 11; i++) {
|
|
112
|
-
years.push(_this.props.date.year() - 5 + i);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return years;
|
|
116
|
-
}, _temp));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
_createClass(CalendarHeader, [{
|
|
120
|
-
key: "render",
|
|
121
|
-
value: function render() {
|
|
122
|
-
var _this$props = this.props,
|
|
123
|
-
triggerMethod = _this$props.triggerMethod,
|
|
124
|
-
container = _this$props.container;
|
|
125
|
-
|
|
126
|
-
var subtracty = _defineProperty({}, triggerMethod, this.setDate.bind(this, "subtract", 1, "y"));
|
|
127
|
-
|
|
128
|
-
var subtractm = _defineProperty({}, triggerMethod, this.setDate.bind(this, "subtract", 1, "M"));
|
|
129
|
-
|
|
130
|
-
var addy = _defineProperty({}, triggerMethod, this.setDate.bind(this, "add", 1, "y"));
|
|
131
|
-
|
|
132
|
-
var addm = _defineProperty({}, triggerMethod, this.setDate.bind(this, "add", 1, "M"));
|
|
133
|
-
|
|
134
|
-
var trigger = {
|
|
135
|
-
onClick: "click",
|
|
136
|
-
onMouseDown: "mousedonwn",
|
|
137
|
-
onMouseUp: "mouseup"
|
|
138
|
-
};
|
|
139
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
140
|
-
className: "tita-common-calendar-header"
|
|
141
|
-
}, /*#__PURE__*/_react["default"].createElement("a", _extends({
|
|
142
|
-
className: "header-prev-year tu-icon-angles-left"
|
|
143
|
-
}, subtracty)), /*#__PURE__*/_react["default"].createElement("a", _extends({
|
|
144
|
-
className: "header-prev-month tu-icon-angle-left"
|
|
145
|
-
}, subtractm)), /*#__PURE__*/_react["default"].createElement(_select["default"], {
|
|
146
|
-
className: "tita-common-calendar-header-select-wrapper",
|
|
147
|
-
wrapperHeight: 160,
|
|
148
|
-
adjustHeight: 84,
|
|
149
|
-
style: {
|
|
150
|
-
width: "70px",
|
|
151
|
-
height: "20px"
|
|
152
|
-
},
|
|
153
|
-
data: this.getYears(),
|
|
154
|
-
value: this.props.date.year(),
|
|
155
|
-
onSelect: this.setDate.bind(this, "year"),
|
|
156
|
-
toggle: trigger[triggerMethod],
|
|
157
|
-
container: container
|
|
158
|
-
}), /*#__PURE__*/_react["default"].createElement(_select["default"], {
|
|
159
|
-
className: "tita-common-calendar-header-select-wrapper",
|
|
160
|
-
wrapperHeight: 160,
|
|
161
|
-
adjustHeight: 84,
|
|
162
|
-
style: {
|
|
163
|
-
width: "50px",
|
|
164
|
-
height: "20px"
|
|
165
|
-
},
|
|
166
|
-
textField: "text",
|
|
167
|
-
valueField: "value",
|
|
168
|
-
data: months,
|
|
169
|
-
value: this.props.date.month(),
|
|
170
|
-
onSelect: this.setDate.bind(this, "month"),
|
|
171
|
-
toggle: trigger[triggerMethod],
|
|
172
|
-
container: container
|
|
173
|
-
}), /*#__PURE__*/_react["default"].createElement("a", _extends({
|
|
174
|
-
className: "header-next-year tu-icon-angles-right"
|
|
175
|
-
}, addy)), /*#__PURE__*/_react["default"].createElement("a", _extends({
|
|
176
|
-
className: "header-next-month tu-icon-angle-right"
|
|
177
|
-
}, addm)));
|
|
178
|
-
}
|
|
179
|
-
}]);
|
|
180
|
-
|
|
181
|
-
return CalendarHeader;
|
|
182
|
-
}(_react.Component);
|
|
183
|
-
|
|
184
|
-
exports["default"] = CalendarHeader;
|
|
185
|
-
CalendarHeader.defaultProps = {
|
|
186
|
-
triggerMethod: "onClick"
|
|
187
|
-
};
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
-
|
|
14
|
-
var _CalendarHeader = _interopRequireDefault(require("./CalendarHeader"));
|
|
15
|
-
|
|
16
|
-
var _CalendarBody = _interopRequireDefault(require("./CalendarBody"));
|
|
17
|
-
|
|
18
|
-
require("./index.scss");
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
-
|
|
28
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
29
|
-
|
|
30
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
-
|
|
32
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
-
|
|
34
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
-
|
|
36
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
37
|
-
|
|
38
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
|
-
|
|
40
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
-
|
|
42
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
43
|
-
|
|
44
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
-
|
|
46
|
-
var DatePicker = /*#__PURE__*/function (_Component) {
|
|
47
|
-
_inherits(DatePicker, _Component);
|
|
48
|
-
|
|
49
|
-
var _super = _createSuper(DatePicker);
|
|
50
|
-
|
|
51
|
-
function DatePicker(p) {
|
|
52
|
-
var _this;
|
|
53
|
-
|
|
54
|
-
_classCallCheck(this, DatePicker);
|
|
55
|
-
|
|
56
|
-
_this = _super.call(this, p);
|
|
57
|
-
|
|
58
|
-
_this.handleChangeDate = function (date) {
|
|
59
|
-
_this.setState({
|
|
60
|
-
date: date
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
_this.handleSelect = function (date) {
|
|
65
|
-
var onSelect = _this.props.onSelect;
|
|
66
|
-
|
|
67
|
-
if (!_this.controlled) {
|
|
68
|
-
_this.setState({
|
|
69
|
-
date: date
|
|
70
|
-
});
|
|
71
|
-
} else {
|
|
72
|
-
_this.setState({
|
|
73
|
-
date: date,
|
|
74
|
-
selected: (0, _moment["default"])(date)
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
onSelect && onSelect(date);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
_this.getSelectDate = function () {
|
|
82
|
-
return _this.controlled ? (0, _moment["default"])(_this.props.selected) : (0, _moment["default"])(_this.state.selected).format(_this.props.format);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
_this.goTo = function (date) {
|
|
86
|
-
_this.state({
|
|
87
|
-
date: (0, _moment["default"])(date)
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
_this.setSelectDate = function (date) {
|
|
92
|
-
if (_this.controlled) return;
|
|
93
|
-
var isAllowSelect = _this.props.isAllowSelect;
|
|
94
|
-
var selected = (0, _moment["default"])(date);
|
|
95
|
-
|
|
96
|
-
if (isAllowSelect && !isAllowSelect(selected)) {
|
|
97
|
-
_this.setState({
|
|
98
|
-
date: (0, _moment["default"])(date)
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
_this.setState({
|
|
105
|
-
date: (0, _moment["default"])(date),
|
|
106
|
-
selected: selected
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
if (p.selected) {
|
|
111
|
-
_this.controlled = true;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
_this.state = {
|
|
115
|
-
date: p.selected || p.defaultSelected || (0, _moment["default"])(),
|
|
116
|
-
selected: p.isAllowSelect ? null : p.selected || p.defaultSelected || (0, _moment["default"])()
|
|
117
|
-
};
|
|
118
|
-
return _this;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
_createClass(DatePicker, [{
|
|
122
|
-
key: "componentWillReceiveProps",
|
|
123
|
-
value: function componentWillReceiveProps(nextProps) {// if(this.controlled) {
|
|
124
|
-
// if(!nextProps.selected.isSame(this.state.date,'month')){
|
|
125
|
-
// this.setState({
|
|
126
|
-
// date: moment(nextProps.selected)
|
|
127
|
-
// })
|
|
128
|
-
// }
|
|
129
|
-
// }
|
|
130
|
-
}
|
|
131
|
-
}, {
|
|
132
|
-
key: "render",
|
|
133
|
-
value: function render() {
|
|
134
|
-
var container = this.props.container;
|
|
135
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
136
|
-
ref: "datePopRef",
|
|
137
|
-
className: "tita-common-calendar ".concat(this.props.className)
|
|
138
|
-
}, /*#__PURE__*/_react["default"].createElement(_CalendarHeader["default"], {
|
|
139
|
-
date: this.state.date,
|
|
140
|
-
onChangeDate: this.handleChangeDate,
|
|
141
|
-
triggerMethod: this.props.triggerMethod,
|
|
142
|
-
container: document.body
|
|
143
|
-
}), /*#__PURE__*/_react["default"].createElement(_CalendarBody["default"], {
|
|
144
|
-
date: this.state.date,
|
|
145
|
-
highlightRange: this.props.highlightRange,
|
|
146
|
-
selectedDate: this.getSelectDate(),
|
|
147
|
-
onSelect: this.handleSelect,
|
|
148
|
-
isAllowSelect: this.props.isAllowSelect,
|
|
149
|
-
triggerMethod: this.props.triggerMethod
|
|
150
|
-
}));
|
|
151
|
-
}
|
|
152
|
-
}]);
|
|
153
|
-
|
|
154
|
-
return DatePicker;
|
|
155
|
-
}(_react.Component);
|
|
156
|
-
|
|
157
|
-
exports["default"] = DatePicker;
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
-
|
|
14
|
-
var _datePicker = _interopRequireDefault(require("../date-picker"));
|
|
15
|
-
|
|
16
|
-
require("./index.scss");
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
-
|
|
26
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
|
-
|
|
28
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
29
|
-
|
|
30
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
31
|
-
|
|
32
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
33
|
-
|
|
34
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
|
-
|
|
36
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
|
-
|
|
38
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
39
|
-
|
|
40
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
41
|
-
|
|
42
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
43
|
-
|
|
44
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
-
|
|
46
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
47
|
-
|
|
48
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
49
|
-
|
|
50
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
-
|
|
52
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
53
|
-
|
|
54
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
-
|
|
56
|
-
var DateRangePicker = /*#__PURE__*/function (_Component) {
|
|
57
|
-
_inherits(DateRangePicker, _Component);
|
|
58
|
-
|
|
59
|
-
var _super = _createSuper(DateRangePicker);
|
|
60
|
-
|
|
61
|
-
function DateRangePicker(p) {
|
|
62
|
-
var _this;
|
|
63
|
-
|
|
64
|
-
_classCallCheck(this, DateRangePicker);
|
|
65
|
-
|
|
66
|
-
_this = _super.call(this, p);
|
|
67
|
-
|
|
68
|
-
_this.getHighLightRange = function (start, end) {
|
|
69
|
-
if (start && end && !start.isSame(end, "day")) {
|
|
70
|
-
_this.startHighlightRange = [(0, _moment["default"])(start).add(1, "d"), end];
|
|
71
|
-
_this.endHighlightRange = [start, (0, _moment["default"])(end).subtract(1, "d")];
|
|
72
|
-
} else {
|
|
73
|
-
_this.startHighlightRange = null;
|
|
74
|
-
_this.endHighlightRange = null;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
_this.clearRange = function () {
|
|
79
|
-
_this.startHighlightRange = null;
|
|
80
|
-
_this.endHighlightRange = null;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
_this.handleSelectStart = function (date) {
|
|
84
|
-
var _this$props = _this.props,
|
|
85
|
-
onSelect = _this$props.onSelect,
|
|
86
|
-
requireRangeCorrect = _this$props.requireRangeCorrect;
|
|
87
|
-
|
|
88
|
-
_this.getHighLightRange(date, _this.state.endDate);
|
|
89
|
-
|
|
90
|
-
var state;
|
|
91
|
-
|
|
92
|
-
if (!date.isAfter(_this.state.endDate)) {
|
|
93
|
-
state = {
|
|
94
|
-
startDate: date
|
|
95
|
-
};
|
|
96
|
-
} else if (requireRangeCorrect) {
|
|
97
|
-
state = {
|
|
98
|
-
startDate: (0, _moment["default"])(date),
|
|
99
|
-
endDate: date
|
|
100
|
-
};
|
|
101
|
-
} else {
|
|
102
|
-
state = {
|
|
103
|
-
startDate: (0, _moment["default"])(date)
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
_this.setState(state, function () {
|
|
108
|
-
onSelect && onSelect({
|
|
109
|
-
startDate: (0, _moment["default"])(_this.state.startDate),
|
|
110
|
-
endDate: (0, _moment["default"])(_this.state.endDate)
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
_this.handleSelectEnd = function (date) {
|
|
116
|
-
var _this$props2 = _this.props,
|
|
117
|
-
onSelect = _this$props2.onSelect,
|
|
118
|
-
requireRangeCorrect = _this$props2.requireRangeCorrect;
|
|
119
|
-
|
|
120
|
-
_this.getHighLightRange(_this.state.startDate, date);
|
|
121
|
-
|
|
122
|
-
var state;
|
|
123
|
-
|
|
124
|
-
if (!date.isBefore(_this.state.startDate)) {
|
|
125
|
-
state = {
|
|
126
|
-
endDate: date
|
|
127
|
-
};
|
|
128
|
-
} else if (requireRangeCorrect) {
|
|
129
|
-
state = {
|
|
130
|
-
endDate: (0, _moment["default"])(date),
|
|
131
|
-
startDate: date
|
|
132
|
-
};
|
|
133
|
-
} else {
|
|
134
|
-
state = {
|
|
135
|
-
endDate: (0, _moment["default"])(date)
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
_this.setState(state, function () {
|
|
140
|
-
onSelect && onSelect({
|
|
141
|
-
startDate: (0, _moment["default"])(_this.state.startDate),
|
|
142
|
-
endDate: (0, _moment["default"])(_this.state.endDate)
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
var _this$props$defaultRa = _slicedToArray(_this.props.defaultRange, 2),
|
|
148
|
-
defaultStartDate = _this$props$defaultRa[0],
|
|
149
|
-
defaultEndDate = _this$props$defaultRa[1];
|
|
150
|
-
|
|
151
|
-
defaultStartDate = defaultStartDate != null ? defaultStartDate || (0, _moment["default"])() : null;
|
|
152
|
-
defaultEndDate = defaultEndDate != null ? defaultEndDate || (0, _moment["default"])() : null;
|
|
153
|
-
|
|
154
|
-
if (defaultStartDate && defaultEndDate && defaultStartDate.isAfter(defaultEndDate)) {
|
|
155
|
-
var _ref = [defaultEndDate, defaultStartDate];
|
|
156
|
-
defaultStartDate = _ref[0];
|
|
157
|
-
defaultEndDate = _ref[1];
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
_this.state = {
|
|
161
|
-
startDate: defaultStartDate != null ? (0, _moment["default"])(defaultStartDate) : null,
|
|
162
|
-
endDate: defaultEndDate != null ? (0, _moment["default"])(defaultEndDate) : null
|
|
163
|
-
};
|
|
164
|
-
return _this;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
_createClass(DateRangePicker, [{
|
|
168
|
-
key: "render",
|
|
169
|
-
value: function render() {
|
|
170
|
-
var _this$props3 = this.props,
|
|
171
|
-
triggerMethod = _this$props3.triggerMethod,
|
|
172
|
-
container = _this$props3.container,
|
|
173
|
-
_this$props3$ownStyle = _this$props3.ownStyle,
|
|
174
|
-
ownStyle = _this$props3$ownStyle === void 0 ? {} : _this$props3$ownStyle;
|
|
175
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
176
|
-
className: "tita-range-picker-wrapper",
|
|
177
|
-
style: ownStyle
|
|
178
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
179
|
-
className: "range-picker-header"
|
|
180
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
181
|
-
className: "range-display-start"
|
|
182
|
-
}, this.state.startDate ? this.state.startDate.format(this.props.format) : ""), /*#__PURE__*/_react["default"].createElement("span", null, "~"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
183
|
-
className: "range-display-end"
|
|
184
|
-
}, this.state.endDate ? this.state.endDate.format(this.props.format) : "")), /*#__PURE__*/_react["default"].createElement(_datePicker["default"], {
|
|
185
|
-
onSelect: this.handleSelectStart,
|
|
186
|
-
highlightRange: this.startHighlightRange,
|
|
187
|
-
selected: this.state.startDate || "",
|
|
188
|
-
className: "tita-range-picker-item",
|
|
189
|
-
triggerMethod: triggerMethod,
|
|
190
|
-
container: container
|
|
191
|
-
}), /*#__PURE__*/_react["default"].createElement(_datePicker["default"], {
|
|
192
|
-
onSelect: this.handleSelectEnd,
|
|
193
|
-
highlightRange: this.endHighlightRange,
|
|
194
|
-
selected: this.state.endDate || "",
|
|
195
|
-
className: "tita-range-picker-item",
|
|
196
|
-
triggerMethod: triggerMethod,
|
|
197
|
-
container: container
|
|
198
|
-
}));
|
|
199
|
-
}
|
|
200
|
-
}]);
|
|
201
|
-
|
|
202
|
-
return DateRangePicker;
|
|
203
|
-
}(_react.Component);
|
|
204
|
-
|
|
205
|
-
exports["default"] = DateRangePicker;
|
|
206
|
-
DateRangePicker.defaultProps = {
|
|
207
|
-
format: "YYYY-MM-DD",
|
|
208
|
-
defaultRange: [],
|
|
209
|
-
requireRangeCorrect: true
|
|
210
|
-
};
|