@titaui/pc 1.11.2 → 1.11.4-1
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/es/components/cascader/time.js +31 -0
- package/es/components/common-share/request-apis.js +56 -0
- package/es/components/confidence/heart.js +66 -0
- package/es/components/create-okr-modal/fields/index.js +17 -0
- package/es/components/create-okr-modal/utils/getCreateOkrSurpassPercent.js +154 -0
- package/es/components/date-picker/BodyItem.js +121 -0
- package/es/components/date-picker/CalendarBody.js +157 -0
- package/es/components/date-picker/CalendarHeader.js +187 -0
- package/es/components/date-picker/index.js +157 -0
- package/es/components/date-range-picker/index.js +210 -0
- package/es/components/dialog/index.js +119 -0
- package/es/components/dialog-confirm/index.js +154 -0
- package/es/components/drop-selector/icon-item.js +40 -0
- package/es/components/drop-selector/index.js +179 -0
- package/es/components/dynamic/dynamic-like-ranking/mock.js +84 -0
- package/es/components/dynamic/dynamic-liking/mock.js +83 -0
- package/es/components/dynamic/dynamic-topping/request-api.js +36 -0
- package/es/components/e-priority/index.js +88 -0
- package/es/components/e-status-dropdown/index.js +94 -0
- package/es/components/grid-layout/commen-components/index.js +73 -0
- package/es/components/grid-layout/image/could.js +8 -0
- package/es/components/grid-layout/image/lv.js +8 -0
- package/es/components/grid-layout/image/tita-mask.js +8 -0
- package/es/components/help-card/request-api.js +35 -0
- package/es/components/icon-button-list/index.js +65 -0
- package/es/components/menus/context.js +18 -0
- package/es/components/menus/precls.js +8 -0
- package/es/components/okr-detail/auth.js +197 -0
- package/es/components/okr-detail/components/ao-nice/index.js +245 -0
- package/es/components/okr-detail/components/block-line/index.js +20 -0
- package/es/components/okr-detail/components/header/index.js +211 -0
- package/es/components/okr-detail/components/icon-text/index.js +116 -0
- package/es/components/okr-detail/components/okr-tree/index.js +48 -0
- package/es/components/okr-detail/components/okr-tree/precls.js +8 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/default-node.js +22 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +88 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +200 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-status-dropdown.js +98 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +412 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/get-process-color.js +62 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/index.js +90 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/get-process-color.js +46 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +421 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/index.js +54 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/style.js +62 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +94 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +273 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +207 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +236 -0
- package/es/components/okr-detail/components/padding-layout.js +22 -0
- package/es/components/okr-detail/components/tab-panel-content/index.js +27 -0
- package/es/components/okr-detail/context.js +30 -0
- package/es/components/okr-detail/e-list/index.js +243 -0
- package/es/components/okr-detail/e-list/precls.js +8 -0
- package/es/components/okr-detail/e-list/search-form/fields/e-order.js +172 -0
- package/es/components/okr-detail/e-list/search-form/fields/e-status.js +99 -0
- package/es/components/okr-detail/e-list/search-form/fields/e-user.js +49 -0
- package/es/components/okr-detail/e-list/search-form/index.js +143 -0
- package/es/components/okr-detail/error-page/index.js +33 -0
- package/es/components/okr-detail/index.js +428 -0
- package/es/components/okr-detail/loading/index.js +28 -0
- package/es/components/okr-detail/okr-list/add-parent-okr.js +37 -0
- package/es/components/okr-detail/okr-list/create-kr-item/heart.js +38 -0
- package/es/components/okr-detail/okr-list/drag-order-kr.js +62 -0
- package/es/components/okr-detail/okr-list/empty/index.js +48 -0
- package/es/components/okr-detail/okr-list/index.js +524 -0
- package/es/components/okr-detail/okr-list/warp-parent-okr.js +21 -0
- package/es/components/okr-detail/store.js +1 -0
- package/es/components/okr-flow/child-node/fields/creator.js +175 -0
- package/es/components/okr-flow/child-node/fields/okrClassify.js +31 -0
- package/es/components/okr-flow/child-node/fields/okrType.js +21 -0
- package/es/components/okr-flow/child-node/helper.js +35 -0
- package/es/components/okr-flow/child-node/index.js +110 -0
- package/es/components/okr-flow/child-node/kr-node.js +75 -0
- package/es/components/okr-flow/child-node/work-node.js +242 -0
- package/es/components/okr-flow/context.js +14 -0
- package/es/components/okr-flow/empty/index.js +29 -0
- package/es/components/okr-flow/export-modules/okr-search-panel/index.js +394 -0
- package/es/components/okr-flow/index.js +24 -0
- package/es/components/okr-flow/mini-map/index.js +112 -0
- package/es/components/okr-flow/mini-map/map.js +145 -0
- package/es/components/okr-flow/mini-map/mini-node.js +57 -0
- package/es/components/okr-flow/mini-map/utils.js +79 -0
- package/es/components/okr-flow/okr-map/index.js +192 -0
- package/es/components/okr-flow/open-data/index.js +115 -0
- package/es/components/okr-flow/precls.js +8 -0
- package/es/components/okr-flow/request-apis.js +118 -0
- package/es/components/okr-flow/root-node/index.js +229 -0
- package/es/components/okr-flow/utils/config.js +18 -0
- package/es/components/okr-flow/utils/helper.js +36 -0
- package/es/components/okr-flow/utils/index.js +66 -0
- package/es/components/okr-flow/utils/tree-handler.js +323 -0
- package/es/components/okr-progress-modal/helper.js +156 -0
- package/es/components/okr-progress-modal/request-apis.js +34 -0
- package/es/components/okr-share/request-apis.js +56 -0
- package/es/components/okrcase-library/server/network.js +407 -0
- package/es/components/pagination/locale/en_US.js +22 -0
- package/es/components/pagination/locale/zh_CN.js +22 -0
- package/es/components/point-demo/drop-down-box/index.js +159 -0
- package/es/components/point-demo/index.js +533 -0
- package/es/components/point-demo/input/index.js +176 -0
- package/es/components/point-demo/point-demo.js +75 -0
- package/es/components/point-demo/popup/index.js +113 -0
- package/es/components/point-demo/popup/placement.js +44 -0
- package/es/components/range-picker-pop/index.js +273 -0
- package/es/components/scrollbar/simplebar/helpers.js +59 -0
- package/es/components/scrollbar/simplebar/index.js +91 -0
- package/es/components/scrollbar/simplebar/scrollbar-width.js +47 -0
- package/es/components/scrollbar/simplebar/simplebar.js +852 -0
- package/es/components/scrollbar/simplebar-react.js +163 -0
- package/es/components/search-dropdown/index.js +40 -0
- package/es/components/search-input/index.js +126 -0
- package/es/components/select/Option.js +94 -0
- package/es/components/select/index.js +330 -0
- package/es/components/selector-input/debounce.js +36 -0
- package/es/components/selector-input/index.js +109 -0
- package/es/components/slider-input/index.js +119 -0
- package/es/components/switch/index.js +39 -0
- package/es/components/table/index.js +275 -0
- package/es/components/tabs/index.js +63 -0
- package/es/components/task-relation-modal/tree-node/index.js +58 -0
- package/es/components/tita-chart/charts/img/could.js +8 -0
- package/es/components/tooltip/error-tip.js +24 -0
- package/es/components/tooltip/index.js +21 -0
- package/es/components/tree/index.js +79 -0
- package/es/components/tree/precls.js +8 -0
- package/es/components/upvote/request-apis.js +45 -0
- package/es/components/user-selector/action-btns/btn-cancel.js +21 -0
- package/es/components/user-selector/action-btns/btn-ok.js +21 -0
- package/es/components/user-selector/action-btns/index.js +27 -0
- package/es/components/user-selector/context.js +18 -0
- package/es/components/user-selector/empty/group.js +55 -0
- package/es/components/user-selector/empty/index.js +28 -0
- package/es/components/user-selector/export-modules/depart-search-selector/result-part.js +41 -0
- package/es/components/user-selector/export-modules/group-selector/index.js +170 -0
- package/es/components/user-selector/export-modules/group-selector/searched-panel.js +68 -0
- package/es/components/user-selector/export-modules/multiple-user-selector--bak/index.js +246 -0
- package/es/components/user-selector/index.js +25 -0
- package/es/components/user-selector/layout/index.js +25 -0
- package/es/components/user-selector/loading/index.js +18 -0
- package/es/components/user-selector/request-apis.js +180 -0
- package/es/components/user-selector/searched-panel/index.js +139 -0
- package/es/components/user-selector/searched-panel/result-part.js +43 -0
- package/es/components/user-selector/select-tree/selected-tree/index.js +91 -0
- package/es/components/user-selector/select-tree/tree-nodes/tree-depart-node/index.js +48 -0
- package/es/components/user-selector/select-tree/tree-nodes/tree-duties-node/index.js +27 -0
- package/es/components/user-selector/select-tree/tree-nodes/tree-group-node/index.js +57 -0
- package/es/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +93 -0
- package/es/components/user-selector/utils.js +139 -0
- package/es/components/viewer/ImageListRender.js +143 -0
- package/es/components/viewer/index.js +168 -0
- package/es/components/word-cloud/index.js +109 -0
- package/es/components/word-cloud/request-apis.js +26 -0
- package/es/components-v1/animate/AnimateChild.js +76 -0
- package/es/components-v1/animate/animate.js +148 -0
- package/es/components-v1/animate/index.js +13 -0
- package/es/components-v1/dom/index.js +30 -0
- package/es/components-v1/placement/index.js +13 -0
- package/es/components-v1/placement/placement.js +111 -0
- package/es/components-v1/placement/placementInner.js +139 -0
- package/es/components-v1/pop/Pop.js +246 -0
- package/es/components-v1/pop/PopInner.js +163 -0
- package/es/components-v1/pop/index.js +13 -0
- package/es/components-v1/progress/CircleProgress.js +152 -0
- package/es/components-v1/progress/LineProgress.js +83 -0
- package/es/components-v1/progress/index.js +80 -0
- package/es/components-v1/select/Option.js +94 -0
- package/es/components-v1/select/index.js +330 -0
- package/es/components-v1/utils/animate/animate.js +103 -0
- package/es/components-v1/utils/animate/event.js +79 -0
- package/es/components-v1/utils/dom/index.js +30 -0
- package/es/components-v1/utils/placement/autoAdjustPlacement.js +93 -0
- package/es/components-v1/utils/placement/getContainerVisibleArea.js +22 -0
- package/es/components-v1/utils/placement/getExpectPlacement.js +49 -0
- package/es/components-v1/utils/placement/getPlacementInContainer.js +26 -0
- package/es/components-v1/utils/placement/placement.js +76 -0
- package/es/index.js +777 -0
- package/es/pages/appointment-demo/drop-down-box/index.js +159 -0
- package/es/pages/appointment-demo/index.js +649 -0
- package/es/pages/appointment-demo/input/index.js +176 -0
- package/es/pages/appointment-demo/popup/index.js +113 -0
- package/es/pages/appointment-demo/popup/placement.js +44 -0
- package/es/pages/group-management/components/checkbox/index.js +28 -0
- package/es/pages/group-management/components/input-form/index.js +174 -0
- package/es/pages/group-management/components/radio/index.js +21 -0
- package/es/pages/group-management/components/table/index.js +174 -0
- package/es/pages/group-management/groupInterface.js +293 -0
- package/es/pages/group-management/index.js +13 -0
- package/es/pages/group-management/page-view/empty.js +111 -0
- package/es/pages/group-management/page-view/group-empty.js +66 -0
- package/es/pages/group-management/page-view/importGroupStaff/index.js +208 -0
- package/es/pages/group-management/page-view/index.js +412 -0
- package/es/pages/group-management/page-view/loading/index.js +32 -0
- package/es/pages/group-management/table/index.js +104 -0
- package/es/pages/group-management/tree/add-group-dialog/index.js +153 -0
- package/es/pages/group-management/tree/delete-group-dialog/index.js +82 -0
- package/es/pages/group-management/tree/edit-group-dialog/index.js +155 -0
- package/es/pages/group-management/tree/group-form/index.js +207 -0
- package/es/pages/group-management/tree/index.js +168 -0
- package/es/pages/group-management/tree/operation-panel.js +41 -0
- package/es/pages/group-management/tree/trigger-render.js +99 -0
- package/es/pages/like-ranking/mock.js +366 -0
- package/es/pages/okr-map/export-modules/index.js +1 -0
- package/es/pages/okr-map/export-modules/okr-map/header/index.js +182 -0
- package/es/pages/okr-map/export-modules/okr-map/header/show-kr-confirm.js +47 -0
- package/es/pages/okr-map/export-modules/okr-map/okr-map.js +497 -0
- package/es/pages/okr-map/export-modules/share-okr-page/header/index.js +69 -0
- package/es/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +168 -0
- package/es/pages/okr-map/hooks/useStorage.js +96 -0
- package/es/pages/okr-map/index.js +18 -0
- package/es/pages/okr-map/level2-search/depart.js +53 -0
- package/es/pages/okr-map/level2-search/group.js +69 -0
- package/es/pages/okr-map/level2-search/index.js +51 -0
- package/es/pages/okr-map/level2-search/level2-input.js +46 -0
- package/es/pages/okr-map/level2-search/user.js +54 -0
- package/es/pages/okr-map/no-okr/index.js +24 -0
- package/es/pages/okr-map/number-select/index.js +81 -0
- package/es/pages/okr-map/open-data/index.js +115 -0
- package/es/pages/okr-map/precls.js +8 -0
- package/es/pages/okr-map/request-apis.js +76 -0
- package/es/pages/okr-map/share-dialog/index.js +122 -0
- package/es/pages/okr-map/unsupport-ie/index.js +83 -0
- package/es/pages/okr-map/utils.js +51 -0
- package/es/utils/auth.js +294 -0
- package/es/utils/bs-global.js +114 -0
- package/es/utils/local-storage.js +42 -0
- package/es/utils/mblog.js +33 -0
- package/es/utils/mock-bsglobal.js +1837 -0
- package/es/utils/open-data.js +341 -0
- package/es/utils/request-v1.js +115 -0
- package/es/utils/request.js +183 -0
- package/es/utils/tools.js +286 -0
- package/lib/components/button/icon-btn/index.js +17 -8
- 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/drop-selector/index.js +25 -10
- package/lib/components/dynamic/constant.js +31 -31
- package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +36 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +51 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +53 -0
- package/lib/components/dynamic/dynamic-item/index.js +40 -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/form/form-fields/date/index.css +24 -0
- package/lib/components/form/form-fields/date/index.js +98 -0
- package/lib/components/form/form-fields/user/index.css +1 -1
- package/lib/components/form/index.js +10 -3
- package/lib/components/mblog/components/MblogAction.js +3 -3
- package/lib/components/menus/export-modules/interview-menus/constant.js +30 -0
- package/lib/components/menus/export-modules/interview-menus/handle-highlight.js +63 -0
- package/lib/components/menus/export-modules/interview-menus/index.js +126 -0
- package/lib/components/menus/index.js +11 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
- package/lib/components/okr-progress-modal/index.css +1 -1
- 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/picker/components/panels/date-panel/date-body.js +116 -0
- package/lib/components/picker/components/panels/date-panel/date-head.js +66 -0
- package/lib/components/picker/components/panels/date-panel/index.css +14 -0
- package/lib/components/picker/components/panels/date-panel/index.js +49 -0
- package/lib/components/picker/components/panels/month-panel/index.css +27 -0
- package/lib/components/picker/components/panels/month-panel/index.js +63 -0
- package/lib/components/picker/components/panels/month-panel/month-body.js +87 -0
- package/lib/components/picker/components/panels/month-panel/month-head.js +47 -0
- package/lib/components/picker/components/panels/panel-body/index.js +53 -0
- package/lib/components/picker/components/panels/panel-head/index.js +48 -0
- package/lib/components/picker/components/panels/year-panel/index.css +23 -0
- package/lib/components/picker/components/panels/year-panel/index.js +65 -0
- package/lib/components/picker/components/panels/year-panel/year-body.js +92 -0
- package/lib/components/picker/components/panels/year-panel/year-head.js +35 -0
- package/lib/components/picker/components/picker-trigger/index.css +42 -0
- package/lib/components/picker/components/picker-trigger/index.js +94 -0
- package/lib/components/picker/context.js +15 -0
- package/lib/components/picker/index.css +121 -0
- package/lib/components/picker/index.js +13 -0
- package/lib/components/picker/picker-panels.js +182 -0
- package/lib/components/picker/picker.js +132 -0
- package/lib/components/picker/type.js +5 -0
- package/lib/components/picker/utils.js +28 -0
- 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/time-picker/index.css +117 -0
- package/lib/components/time-picker/index.js +13 -0
- package/lib/components/time-picker/time-picker-selector.js +138 -0
- package/lib/components/time-picker/time-picker.js +324 -0
- package/lib/components/time-picker/timer-picker-input.js +94 -0
- package/lib/components/time-picker/utils.js +52 -0
- 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 +16 -0
- package/lib/pages/aha2021/index.js +5 -1
- package/lib/utils/hooks.js +72 -0
- package/package.json +1 -1
- package/yarn-error.log +21252 -0
|
@@ -0,0 +1,324 @@
|
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
15
|
+
|
|
16
|
+
var _timerPickerInput = _interopRequireDefault(require("./timer-picker-input"));
|
|
17
|
+
|
|
18
|
+
var _timePickerSelector = _interopRequireDefault(require("./time-picker-selector"));
|
|
19
|
+
|
|
20
|
+
var _utils = require("./utils");
|
|
21
|
+
|
|
22
|
+
require("./index.css");
|
|
23
|
+
|
|
24
|
+
var _excluded = ["disabled", "timeFormat", "hourStep", "minuteStep", "onChange", "value"];
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
|
+
|
|
38
|
+
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."); }
|
|
39
|
+
|
|
40
|
+
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); }
|
|
41
|
+
|
|
42
|
+
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; }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
+
|
|
48
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
49
|
+
|
|
50
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
51
|
+
|
|
52
|
+
var TimePicker = function TimePicker(props) {
|
|
53
|
+
var disabled = props.disabled,
|
|
54
|
+
_props$timeFormat = props.timeFormat,
|
|
55
|
+
timeFormat = _props$timeFormat === void 0 ? "hh:mm" : _props$timeFormat,
|
|
56
|
+
_props$hourStep = props.hourStep,
|
|
57
|
+
hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,
|
|
58
|
+
_props$minuteStep = props.minuteStep,
|
|
59
|
+
minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,
|
|
60
|
+
onChange = props.onChange,
|
|
61
|
+
_props$value = props.value,
|
|
62
|
+
value = _props$value === void 0 ? "00:00" : _props$value,
|
|
63
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
64
|
+
|
|
65
|
+
var _useState = (0, _react.useState)(""),
|
|
66
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
67
|
+
timeSetType = _useState2[0],
|
|
68
|
+
setTimeSetType = _useState2[1];
|
|
69
|
+
|
|
70
|
+
var _useState3 = (0, _react.useState)(false),
|
|
71
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
72
|
+
visible = _useState4[0],
|
|
73
|
+
setVisible = _useState4[1];
|
|
74
|
+
|
|
75
|
+
var hourRef = (0, _react.useRef)((0, _moment["default"])(value || "00:00", timeFormat).format("HH"));
|
|
76
|
+
var hInputRef = (0, _react.useRef)();
|
|
77
|
+
var mInputRef = (0, _react.useRef)();
|
|
78
|
+
var minuteRef = (0, _react.useRef)((0, _moment["default"])(value || "00:00", timeFormat).format("mm"));
|
|
79
|
+
var triggerRef = (0, _react.useRef)();
|
|
80
|
+
var timerRef = (0, _react.useRef)();
|
|
81
|
+
var hours = (0, _utils.getHours)(hourStep);
|
|
82
|
+
var minutes = (0, _utils.getMinutes)(minuteStep);
|
|
83
|
+
|
|
84
|
+
var onTimeChange = function onTimeChange() {
|
|
85
|
+
onChange === null || onChange === void 0 ? void 0 : onChange("".concat(hourRef.current, ":").concat(minuteRef.current));
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var onInputClick = function onInputClick(type) {
|
|
89
|
+
clearTimeout(timerRef.current);
|
|
90
|
+
timerRef.current = setTimeout(function () {
|
|
91
|
+
if (type === "hour") {
|
|
92
|
+
var _hInputRef$current;
|
|
93
|
+
|
|
94
|
+
(_hInputRef$current = hInputRef.current) === null || _hInputRef$current === void 0 ? void 0 : _hInputRef$current.focus();
|
|
95
|
+
} else {
|
|
96
|
+
var _mInputRef$current;
|
|
97
|
+
|
|
98
|
+
(_mInputRef$current = mInputRef.current) === null || _mInputRef$current === void 0 ? void 0 : _mInputRef$current.focus();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
setTimeSetType(function () {
|
|
102
|
+
return type;
|
|
103
|
+
});
|
|
104
|
+
}, 0);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
var onHourInputBlur = function onHourInputBlur() {
|
|
108
|
+
// setHour((prevHour) => {
|
|
109
|
+
// const prevHour = hourRef.current;
|
|
110
|
+
// let nextHour = (Array(2).join("0") + prevHour).slice(-2);
|
|
111
|
+
// if (Number(prevHour) > Number(hours[hours.length - 1])) {
|
|
112
|
+
// nextHour = `0${prevHour.slice(0, 1)}`;
|
|
113
|
+
// }
|
|
114
|
+
// hourRef.current = nextHour;
|
|
115
|
+
// });
|
|
116
|
+
// if (timeSetType === "hour" && hInputRef.current) {
|
|
117
|
+
// hInputRef.current.focus();
|
|
118
|
+
// }
|
|
119
|
+
// onTimeChange();
|
|
120
|
+
setTimeSetType("");
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
var onHourInputChange = function onHourInputChange(e) {
|
|
124
|
+
var v = e.target.value;
|
|
125
|
+
|
|
126
|
+
if (!Number.isNaN(Number(v))) {
|
|
127
|
+
// setHour(v);
|
|
128
|
+
hourRef.current = v;
|
|
129
|
+
setTimeout(function () {
|
|
130
|
+
if (hInputRef.current) {
|
|
131
|
+
hInputRef.current.blur();
|
|
132
|
+
}
|
|
133
|
+
}, 1000);
|
|
134
|
+
onTimeChange();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
var onMinuteInputBlur = function onMinuteInputBlur() {
|
|
139
|
+
// setMinute((prevMinute) => {
|
|
140
|
+
// let nextMinute = minuteRef.current;
|
|
141
|
+
// minutes.forEach((m, i) => {
|
|
142
|
+
// const mNum = Number(m);
|
|
143
|
+
// const nextMinuteNum = Number(nextMinute);
|
|
144
|
+
// if (mNum === nextMinuteNum) {
|
|
145
|
+
// nextMinute = m;
|
|
146
|
+
// } else if (
|
|
147
|
+
// mNum < nextMinuteNum
|
|
148
|
+
// && Number(minutes[i + 1]) > nextMinuteNum
|
|
149
|
+
// ) {
|
|
150
|
+
// nextMinute = m;
|
|
151
|
+
// } else if (nextMinuteNum > Number(minutes[minutes.length - 1])) {
|
|
152
|
+
// nextMinute = "00";
|
|
153
|
+
// }
|
|
154
|
+
// });
|
|
155
|
+
// minuteRef.current = nextMinute;
|
|
156
|
+
// });
|
|
157
|
+
// if (timeSetType === "minute" && mInputRef.current) {
|
|
158
|
+
// mInputRef.current.focus();
|
|
159
|
+
// }
|
|
160
|
+
// onTimeChange();
|
|
161
|
+
setTimeSetType("");
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
var onMinuteInputChange = function onMinuteInputChange(e) {
|
|
165
|
+
var v = e.target.value;
|
|
166
|
+
|
|
167
|
+
if (!Number.isNaN(Number(v))) {
|
|
168
|
+
// setMinute(v);
|
|
169
|
+
minuteRef.current = v;
|
|
170
|
+
setTimeout(function () {
|
|
171
|
+
if (mInputRef.current) {
|
|
172
|
+
mInputRef.current.blur();
|
|
173
|
+
}
|
|
174
|
+
}, 1000);
|
|
175
|
+
onTimeChange();
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
var setTimeOnKeyboardDirectionChange = function setTimeOnKeyboardDirectionChange(keyCode, type, currTime) {
|
|
180
|
+
var datas = JSON.parse(JSON.stringify(type === "hour" ? hours : minutes));
|
|
181
|
+
var currentTimeIndex;
|
|
182
|
+
datas.forEach(function (item, index) {
|
|
183
|
+
if (item === currTime) {
|
|
184
|
+
currentTimeIndex = index;
|
|
185
|
+
} else if (item < currTime) {
|
|
186
|
+
var nextIndex = index + 1;
|
|
187
|
+
var nextData = datas[nextIndex];
|
|
188
|
+
|
|
189
|
+
if (!nextData || nextData && nextData > currTime) {
|
|
190
|
+
currentTimeIndex = keyCode === _utils.KEYCODE.directionUp || !nextData ? index : nextIndex;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
if (keyCode === _utils.KEYCODE.directionUp) {
|
|
196
|
+
// 方向键:↑
|
|
197
|
+
var nextIndex = currentTimeIndex + 1 === datas.length ? 0 : currentTimeIndex + 1;
|
|
198
|
+
var nextValue = datas[nextIndex];
|
|
199
|
+
|
|
200
|
+
if (currentTimeIndex > -1 && !!nextValue) {
|
|
201
|
+
if (type === "minute" && nextValue === datas[0]) {
|
|
202
|
+
hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return nextValue;
|
|
206
|
+
}
|
|
207
|
+
} else if (keyCode === _utils.KEYCODE.directionDown) {
|
|
208
|
+
// 方向键:↓
|
|
209
|
+
var prevIndex = currentTimeIndex - 1 < 0 ? datas.length - 1 : currentTimeIndex - 1;
|
|
210
|
+
var prevValue = datas[prevIndex];
|
|
211
|
+
|
|
212
|
+
if (currentTimeIndex > -1 && !!prevValue) {
|
|
213
|
+
if (type === "minute" && prevValue === datas[datas.length - 1]) {
|
|
214
|
+
hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return prevValue;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return currTime;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
225
|
+
var keyCode = e.keyCode;
|
|
226
|
+
|
|
227
|
+
if ([_utils.KEYCODE.directionLeft, _utils.KEYCODE.directionRight].includes(keyCode)) {
|
|
228
|
+
setTimeSetType(_utils.TargetMapByKeyCode[keyCode]);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if ([_utils.KEYCODE.directionUp, _utils.KEYCODE.directionDown].indexOf(keyCode) === -1) return;
|
|
232
|
+
|
|
233
|
+
switch (timeSetType) {
|
|
234
|
+
case "hour":
|
|
235
|
+
hourRef.current = setTimeOnKeyboardDirectionChange(keyCode, "hour", hourRef.current);
|
|
236
|
+
break;
|
|
237
|
+
|
|
238
|
+
case "minute":
|
|
239
|
+
minuteRef.current = setTimeOnKeyboardDirectionChange(keyCode, "minute", minuteRef.current);
|
|
240
|
+
break;
|
|
241
|
+
|
|
242
|
+
default:
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
onTimeChange();
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
(0, _react.useEffect)(function () {
|
|
250
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
251
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
252
|
+
return function () {
|
|
253
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
254
|
+
};
|
|
255
|
+
}, [timeSetType]);
|
|
256
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
257
|
+
className: _utils.TimePickerClass
|
|
258
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
259
|
+
className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-trigger"), _defineProperty({}, "".concat(_utils.TimePickerClass, "-trigger--disabled"), disabled)),
|
|
260
|
+
ref: triggerRef
|
|
261
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
262
|
+
className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-inputs"), _defineProperty({}, "".concat(_utils.TimePickerClass, "-inputs--placeholder"), !value))
|
|
263
|
+
}, /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
|
|
264
|
+
className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
|
|
265
|
+
active: timeSetType === "hour"
|
|
266
|
+
}),
|
|
267
|
+
disabled: disabled,
|
|
268
|
+
maxLength: 2,
|
|
269
|
+
onBlur: onHourInputBlur,
|
|
270
|
+
onChange: onHourInputChange,
|
|
271
|
+
onClick: function onClick() {
|
|
272
|
+
return onInputClick("hour");
|
|
273
|
+
},
|
|
274
|
+
ref: hInputRef,
|
|
275
|
+
value: hourRef.current
|
|
276
|
+
}), /*#__PURE__*/_react["default"].createElement("span", null, ":"), /*#__PURE__*/_react["default"].createElement(_timerPickerInput["default"], {
|
|
277
|
+
className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-input"), {
|
|
278
|
+
active: timeSetType === "minute"
|
|
279
|
+
}),
|
|
280
|
+
disabled: disabled,
|
|
281
|
+
maxLength: 2,
|
|
282
|
+
onBlur: onMinuteInputBlur,
|
|
283
|
+
onChange: onMinuteInputChange,
|
|
284
|
+
onClick: function onClick() {
|
|
285
|
+
return onInputClick("minute");
|
|
286
|
+
},
|
|
287
|
+
ref: mInputRef,
|
|
288
|
+
value: minuteRef.current
|
|
289
|
+
})), !disabled && /*#__PURE__*/_react["default"].createElement(_timePickerSelector["default"], _extends({
|
|
290
|
+
popupAlign: {
|
|
291
|
+
offset: [12, 8],
|
|
292
|
+
overflow: {
|
|
293
|
+
adjustX: true,
|
|
294
|
+
adjustY: true
|
|
295
|
+
},
|
|
296
|
+
targetOffset: [0, 0]
|
|
297
|
+
},
|
|
298
|
+
timeData: {
|
|
299
|
+
hours: hours,
|
|
300
|
+
minutes: minutes
|
|
301
|
+
},
|
|
302
|
+
timeSetting: {
|
|
303
|
+
hour: hourRef.current,
|
|
304
|
+
minute: minuteRef.current,
|
|
305
|
+
setTime: function setTime(time) {
|
|
306
|
+
hourRef.current = (0, _moment["default"])(time, "HH:mm").format("HH");
|
|
307
|
+
minuteRef.current = (0, _moment["default"])(time, "HH:mm").format("mm");
|
|
308
|
+
onChange(time);
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
visibleSetting: {
|
|
312
|
+
visible: visible,
|
|
313
|
+
setVisible: setVisible
|
|
314
|
+
}
|
|
315
|
+
}, restProps), /*#__PURE__*/_react["default"].createElement("span", {
|
|
316
|
+
className: "".concat(_utils.TimePickerClass, "-icon tu-icon-arrow-down"),
|
|
317
|
+
onClick: function onClick() {
|
|
318
|
+
setVisible(true);
|
|
319
|
+
}
|
|
320
|
+
}))));
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
var _default = TimePicker;
|
|
324
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,94 @@
|
|
|
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 _excluded = ["className", "changeTimeout", "maxLength", "onClick", "onChange", "onFocus", "stopPropagation", "type", "value"];
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
|
+
|
|
22
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
|
+
|
|
24
|
+
var TimePickerInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
25
|
+
var className = props.className,
|
|
26
|
+
_props$changeTimeout = props.changeTimeout,
|
|
27
|
+
changeTimeout = _props$changeTimeout === void 0 ? 500 : _props$changeTimeout,
|
|
28
|
+
maxLength = props.maxLength,
|
|
29
|
+
onClick = props.onClick,
|
|
30
|
+
onChange = props.onChange,
|
|
31
|
+
onFocus = props.onFocus,
|
|
32
|
+
_props$stopPropagatio = props.stopPropagation,
|
|
33
|
+
stopPropagation = _props$stopPropagatio === void 0 ? true : _props$stopPropagatio,
|
|
34
|
+
_props$type = props.type,
|
|
35
|
+
type = _props$type === void 0 ? "text" : _props$type,
|
|
36
|
+
value = props.value,
|
|
37
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
38
|
+
|
|
39
|
+
var inputRef = (0, _react.useRef)();
|
|
40
|
+
|
|
41
|
+
var setSelectionRange = function setSelectionRange(timeout) {
|
|
42
|
+
setTimeout(function () {
|
|
43
|
+
if (inputRef.current) {
|
|
44
|
+
inputRef.current.selectionStart = 0;
|
|
45
|
+
inputRef.current.selectionEnd = inputRef.current.value.length;
|
|
46
|
+
}
|
|
47
|
+
}, timeout);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
var onClickHandler = function onClickHandler(e) {
|
|
51
|
+
if (stopPropagation) {
|
|
52
|
+
e.stopPropagation();
|
|
53
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
setSelectionRange(0);
|
|
57
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var onFocusHandler = function onFocusHandler(e) {
|
|
61
|
+
setSelectionRange(0);
|
|
62
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
var onChangeHandler = function onChangeHandler(e) {
|
|
66
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
70
|
+
return {
|
|
71
|
+
focus: function focus() {
|
|
72
|
+
return inputRef.current && inputRef.current.focus();
|
|
73
|
+
},
|
|
74
|
+
blur: function blur() {
|
|
75
|
+
return inputRef.current && inputRef.current.blur();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
(0, _react.useEffect)(function () {
|
|
80
|
+
setSelectionRange(changeTimeout);
|
|
81
|
+
}, [value]);
|
|
82
|
+
return /*#__PURE__*/_react["default"].createElement("input", _extends({
|
|
83
|
+
className: className,
|
|
84
|
+
maxLength: maxLength,
|
|
85
|
+
onClick: onClickHandler,
|
|
86
|
+
onChange: onChangeHandler,
|
|
87
|
+
onFocus: onFocusHandler,
|
|
88
|
+
ref: inputRef,
|
|
89
|
+
type: type,
|
|
90
|
+
value: value
|
|
91
|
+
}, restProps));
|
|
92
|
+
});
|
|
93
|
+
var _default = TimePickerInput;
|
|
94
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TimePickerClass = exports.TargetMapByKeyCode = exports.KEYCODE = void 0;
|
|
7
|
+
exports.getHours = getHours;
|
|
8
|
+
exports.getMinutes = getMinutes;
|
|
9
|
+
var TimePickerClass = "tita-ui__time-picker";
|
|
10
|
+
exports.TimePickerClass = TimePickerClass;
|
|
11
|
+
var TargetMapByKeyCode = {
|
|
12
|
+
37: "hour",
|
|
13
|
+
39: "minute"
|
|
14
|
+
};
|
|
15
|
+
exports.TargetMapByKeyCode = TargetMapByKeyCode;
|
|
16
|
+
|
|
17
|
+
function getHours() {
|
|
18
|
+
var hourStep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
19
|
+
var hours = [];
|
|
20
|
+
|
|
21
|
+
for (var i = 0; i < 24; i += 1) {
|
|
22
|
+
if (i % hourStep === 0) {
|
|
23
|
+
hours.push(i < 10 ? "0".concat(i) : "".concat(i));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return hours;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getMinutes() {
|
|
31
|
+
var minuteStep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
32
|
+
var minutes = [];
|
|
33
|
+
|
|
34
|
+
for (var i = 0; i < 60; i += 1) {
|
|
35
|
+
if (i % minuteStep === 0) {
|
|
36
|
+
minutes.push(i < 10 ? "0".concat(i) : "".concat(i));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return minutes;
|
|
41
|
+
} // eslint-disable-next-line no-shadow
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
var KEYCODE;
|
|
45
|
+
exports.KEYCODE = KEYCODE;
|
|
46
|
+
|
|
47
|
+
(function (KEYCODE) {
|
|
48
|
+
KEYCODE[KEYCODE["directionLeft"] = 37] = "directionLeft";
|
|
49
|
+
KEYCODE[KEYCODE["directionUp"] = 38] = "directionUp";
|
|
50
|
+
KEYCODE[KEYCODE["directionRight"] = 39] = "directionRight";
|
|
51
|
+
KEYCODE[KEYCODE["directionDown"] = 40] = "directionDown";
|
|
52
|
+
})(KEYCODE || (exports.KEYCODE = KEYCODE = {}));
|
|
@@ -37,7 +37,7 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
37
37
|
var _super = _createSuper(ErrorBoundary);
|
|
38
38
|
|
|
39
39
|
function ErrorBoundary() {
|
|
40
|
-
var _this;
|
|
40
|
+
var _temp, _this;
|
|
41
41
|
|
|
42
42
|
_classCallCheck(this, ErrorBoundary);
|
|
43
43
|
|
|
@@ -45,7 +45,7 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
45
45
|
args[_key] = arguments[_key];
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.state = {
|
|
48
|
+
return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.state = {
|
|
49
49
|
hasError: false
|
|
50
50
|
}, _this.renderError = function (e) {
|
|
51
51
|
var errorTemplate = _this.props.errorTemplate;
|
|
@@ -55,7 +55,7 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
55
55
|
// fallback
|
|
56
56
|
return errorTemplate && typeof errorTemplate === "function" ? errorTemplate(e) : /*#__PURE__*/_react["default"].createElement("h5", null, "\u7EC4\u4EF6\u51FA\u9519\u4E86\uFF0C\u8BF7\u6838\u67E5\u540E\u91CD\u8BD5\uFF1A", e.message);
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, _temp));
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
_createClass(ErrorBoundary, [{
|
|
@@ -45,7 +45,7 @@ var AnimateChild = /*#__PURE__*/function (_Component) {
|
|
|
45
45
|
var _super = _createSuper(AnimateChild);
|
|
46
46
|
|
|
47
47
|
function AnimateChild() {
|
|
48
|
-
var _this;
|
|
48
|
+
var _temp, _this;
|
|
49
49
|
|
|
50
50
|
_classCallCheck(this, AnimateChild);
|
|
51
51
|
|
|
@@ -53,14 +53,14 @@ var AnimateChild = /*#__PURE__*/function (_Component) {
|
|
|
53
53
|
args[_key] = arguments[_key];
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.componentWillEnter = function (done) {
|
|
56
|
+
return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.componentWillEnter = function (done) {
|
|
57
57
|
_this.transition("enter", done);
|
|
58
58
|
}, _this.componentWillLeave = function (done) {
|
|
59
59
|
_this.transition("leave", done);
|
|
60
60
|
}, _this.transition = function (animationType, done) {
|
|
61
61
|
var name = _typeof(_this.props.transitionName) === "object" ? _this.props.transitionName[animationType] : "".concat(_this.props.transitionName, "-").concat(animationType);
|
|
62
62
|
(0, _animate["default"])((0, _reactDom.findDOMNode)(_assertThisInitialized(_this)), name, done);
|
|
63
|
-
},
|
|
63
|
+
}, _temp));
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
_createClass(AnimateChild, [{
|
|
@@ -45,7 +45,7 @@ var Avatar = /*#__PURE__*/function (_PureComponent) {
|
|
|
45
45
|
var _super = _createSuper(Avatar);
|
|
46
46
|
|
|
47
47
|
function Avatar() {
|
|
48
|
-
var _this;
|
|
48
|
+
var _temp, _this;
|
|
49
49
|
|
|
50
50
|
_classCallCheck(this, Avatar);
|
|
51
51
|
|
|
@@ -53,7 +53,7 @@ var Avatar = /*#__PURE__*/function (_PureComponent) {
|
|
|
53
53
|
args[_key] = arguments[_key];
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.renderImgAvatar = function () {
|
|
56
|
+
return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.renderImgAvatar = function () {
|
|
57
57
|
var src = _this.props.src;
|
|
58
58
|
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
59
59
|
style: {
|
|
@@ -103,7 +103,7 @@ var Avatar = /*#__PURE__*/function (_PureComponent) {
|
|
|
103
103
|
height: size.width,
|
|
104
104
|
background: color
|
|
105
105
|
}, cuttedName);
|
|
106
|
-
},
|
|
106
|
+
}, _temp));
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
_createClass(Avatar, [{
|
|
@@ -47,7 +47,7 @@ var StatelessDropdown = /*#__PURE__*/function (_Component) {
|
|
|
47
47
|
var _super = _createSuper(StatelessDropdown);
|
|
48
48
|
|
|
49
49
|
function StatelessDropdown() {
|
|
50
|
-
var _this;
|
|
50
|
+
var _temp, _this;
|
|
51
51
|
|
|
52
52
|
_classCallCheck(this, StatelessDropdown);
|
|
53
53
|
|
|
@@ -55,7 +55,7 @@ var StatelessDropdown = /*#__PURE__*/function (_Component) {
|
|
|
55
55
|
args[_key] = arguments[_key];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.renderLabel = function () {
|
|
58
|
+
return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.renderLabel = function () {
|
|
59
59
|
if (_this.props.labelText) {
|
|
60
60
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
61
61
|
className: "drop-down-label"
|
|
@@ -63,7 +63,7 @@ var StatelessDropdown = /*#__PURE__*/function (_Component) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
return "";
|
|
66
|
-
},
|
|
66
|
+
}, _temp));
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
_createClass(StatelessDropdown, [{
|
|
@@ -41,7 +41,7 @@ var CircleProgress = /*#__PURE__*/function (_Component) {
|
|
|
41
41
|
var _super = _createSuper(CircleProgress);
|
|
42
42
|
|
|
43
43
|
function CircleProgress() {
|
|
44
|
-
var _this;
|
|
44
|
+
var _temp, _this;
|
|
45
45
|
|
|
46
46
|
_classCallCheck(this, CircleProgress);
|
|
47
47
|
|
|
@@ -49,7 +49,7 @@ var CircleProgress = /*#__PURE__*/function (_Component) {
|
|
|
49
49
|
args[_key] = arguments[_key];
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.getTextContent = function () {
|
|
52
|
+
return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.getTextContent = function () {
|
|
53
53
|
var _this$props = _this.props,
|
|
54
54
|
formatText = _this$props.formatText,
|
|
55
55
|
percent = _this$props.percent;
|
|
@@ -59,7 +59,7 @@ var CircleProgress = /*#__PURE__*/function (_Component) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
return percent + getLocale("OKR_MyO_Pop_Upd_Percentage");
|
|
62
|
-
},
|
|
62
|
+
}, _temp));
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
_createClass(CircleProgress, [{
|
|
@@ -47,7 +47,7 @@ var Option = /*#__PURE__*/function (_Component) {
|
|
|
47
47
|
var _super = _createSuper(Option);
|
|
48
48
|
|
|
49
49
|
function Option() {
|
|
50
|
-
var _this;
|
|
50
|
+
var _temp, _this;
|
|
51
51
|
|
|
52
52
|
_classCallCheck(this, Option);
|
|
53
53
|
|
|
@@ -55,7 +55,7 @@ var Option = /*#__PURE__*/function (_Component) {
|
|
|
55
55
|
args[_key] = arguments[_key];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.handleSelect = function (e) {
|
|
58
|
+
return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.handleSelect = function (e) {
|
|
59
59
|
e.stopPropagation();
|
|
60
60
|
e.nativeEvent.stopImmediatePropagation();
|
|
61
61
|
var onSelect = _this.props.onSelect;
|
|
@@ -65,7 +65,7 @@ var Option = /*#__PURE__*/function (_Component) {
|
|
|
65
65
|
height: _this.props.height,
|
|
66
66
|
lineHeight: _this.props.height
|
|
67
67
|
};
|
|
68
|
-
},
|
|
68
|
+
}, _temp));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
_createClass(Option, [{
|
|
@@ -52,7 +52,7 @@ var UserSelectorPop = /*#__PURE__*/function (_PureComponent) {
|
|
|
52
52
|
var _super = _createSuper(UserSelectorPop);
|
|
53
53
|
|
|
54
54
|
function UserSelectorPop() {
|
|
55
|
-
var _this;
|
|
55
|
+
var _temp, _this;
|
|
56
56
|
|
|
57
57
|
_classCallCheck(this, UserSelectorPop);
|
|
58
58
|
|
|
@@ -60,7 +60,7 @@ var UserSelectorPop = /*#__PURE__*/function (_PureComponent) {
|
|
|
60
60
|
args[_key] = arguments[_key];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.handleShowPop = function (e) {
|
|
63
|
+
return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.handleShowPop = function (e) {
|
|
64
64
|
if (_this.props.stopPropagation && !!e) {
|
|
65
65
|
e.stopPropagation();
|
|
66
66
|
e.nativeEvent.stopImmediatePropagation();
|
|
@@ -74,7 +74,7 @@ var UserSelectorPop = /*#__PURE__*/function (_PureComponent) {
|
|
|
74
74
|
}, _this.show = function (el) {
|
|
75
75
|
// @ts-ignore
|
|
76
76
|
_this.refs.pop.show(el);
|
|
77
|
-
},
|
|
77
|
+
}, _temp));
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
_createClass(UserSelectorPop, [{
|