@titaui/pc 1.12.11 → 1.12.13-beta.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/attachments-preview/index.css +11 -0
- package/lib/components/attachments-preview/index.js +112 -0
- package/lib/components/auto-save/img/failed.svg +17 -0
- package/lib/components/auto-save/img/success.svg +16 -0
- package/lib/components/auto-save/index.css +39 -0
- package/lib/components/auto-save/index.js +78 -0
- package/lib/components/auto-save/interface.js +5 -0
- package/lib/components/change-okr-modal/index.js +2 -4
- package/lib/components/color-date-picker/index.css +72 -0
- package/lib/components/color-date-picker/index.js +129 -0
- package/lib/components/color-date-picker/interface.js +14 -0
- package/lib/components/common-share/publishMblog.js +2 -4
- package/lib/components/create-okr-modal/fields/okr-type-detail.js +2 -4
- package/lib/components/create-okr-modal/fields/okr-visibility-detail.js +2 -4
- package/lib/components/create-okr-modal/index.js +2 -4
- package/lib/components/create-okr-modal/request-api.js +12 -16
- package/lib/components/create-okr-modal/utils/helper.js +2 -6
- package/lib/components/dialog-confirm/index.css +1 -0
- package/lib/components/dialog-confirm/index.js +5 -3
- package/lib/components/dialog-upload/img/doc.svg +1 -0
- package/lib/components/dialog-upload/img/other.svg +1 -0
- package/lib/components/dialog-upload/img/pdf.svg +1 -0
- package/lib/components/dialog-upload/img/ppt.svg +1 -0
- package/lib/components/dialog-upload/img/radio.svg +1 -0
- package/lib/components/dialog-upload/img/video.svg +1 -0
- package/lib/components/dialog-upload/img/xls.svg +1 -0
- package/lib/components/dialog-upload/index.css +77 -0
- package/lib/components/dialog-upload/index.js +330 -0
- package/lib/components/dialog-upload/type.js +35 -0
- package/lib/components/dialog-upload/uploaded-preview.css +77 -0
- package/lib/components/dialog-upload/uploaded-preview.js +132 -0
- package/lib/components/dialog-upload/util.js +131 -0
- package/lib/components/drawer-manager/drawerWrapper.js +2 -4
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/api.js +27 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/encourage.js +119 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/APP-shoucang-m.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/ascore.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/curEfforts.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/curGood.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/curGreat.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/efforts.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/good.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/great.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/halfscore.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/loading.gif +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/score.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/top.svg +14 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/index.css +75 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/index.js +195 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/rate.js +143 -0
- package/lib/components/dynamic/dynamic-item/components/header/img/evalute.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/header/img/fighting.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/header/img/happy.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/header/img/long-story.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/header/img/pressure.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/header/index.js +1 -5
- package/lib/components/dynamic/dynamic-item/components/okr-progress/constant.js +31 -0
- package/lib/components/dynamic/dynamic-item/components/okr-progress/index.css +171 -0
- package/lib/components/dynamic/dynamic-item/components/okr-progress/index.js +151 -0
- package/lib/components/dynamic/dynamic-item/components/okr-progress/interface.js +5 -0
- package/lib/components/dynamic/dynamic-item/components/okr-progress/request-api.js +10 -0
- package/lib/components/dynamic/dynamic-item/components/okr-progress/utils.js +10 -0
- package/lib/components/dynamic/dynamic-item/components/progress/components/kr-progress/index.css +8 -0
- package/lib/components/dynamic/dynamic-item/components/progress/components/kr-progress/index.js +26 -0
- package/lib/components/dynamic/dynamic-item/components/progress/components/o-progress/index.css +8 -0
- package/lib/components/dynamic/dynamic-item/components/progress/components/o-progress/index.js +26 -0
- package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/index.css +197 -0
- package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/index.js +220 -0
- package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/request-api.js +20 -0
- package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/util.js +134 -0
- package/lib/components/dynamic/dynamic-item/components/progress/components/task-progress/index.css +10 -0
- package/lib/components/dynamic/dynamic-item/components/progress/components/task-progress/index.js +60 -0
- package/lib/components/dynamic/dynamic-item/components/progress/index.css +25 -0
- package/lib/components/dynamic/dynamic-item/components/progress/index.js +71 -0
- package/lib/components/dynamic/dynamic-item/components/progress/interface.js +5 -0
- package/lib/components/dynamic/dynamic-item/components/schedule/index.css +35 -0
- package/lib/components/dynamic/dynamic-item/components/schedule/index.js +55 -0
- package/lib/components/dynamic/dynamic-item/components/schedule/interface.js +5 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/constant.js +45 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/img/evalute.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/img/fighting.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/img/happy.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/img/long-story.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/img/pressure.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/index.css +166 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/index.js +359 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/operate-record.js +49 -0
- package/lib/components/dynamic/dynamic-item/components/table-row-o-project/index.css +24 -0
- package/lib/components/dynamic/dynamic-item/components/table-row-o-project/index.js +52 -0
- package/lib/components/dynamic/dynamic-item/components/table-row-o-project/interface.js +5 -0
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.css +50 -0
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.js +65 -0
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/interface.js +5 -0
- package/lib/components/dynamic/dynamic-item/components/task-progress/constant.js +16 -0
- package/lib/components/dynamic/dynamic-item/components/task-progress/index.css +201 -0
- package/lib/components/dynamic/dynamic-item/components/task-progress/index.js +169 -0
- package/lib/components/dynamic/dynamic-item/components/task-progress/interface.js +5 -0
- package/lib/components/dynamic/dynamic-item/components/task-progress/utils.js +27 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +3 -2
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/come-on-big.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/come-on-small.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/evaluate-big.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/nice-big.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/nice-small.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/very-good-big.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/very-good-small.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.css +68 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.js +50 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.css +43 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.js +87 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/constant.js +45 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/evalute.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/fighting.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/happy.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/long-story.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/pressure.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.css +184 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.js +231 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/util.js +30 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +3 -2
- package/lib/components/dynamic/dynamic-item/index.css +1 -0
- package/lib/components/dynamic/dynamic-item/index.js +18 -5
- package/lib/components/firework/index.js +2 -6
- package/lib/components/form/form-fields/date/index.js +6 -6
- package/lib/components/form/form-fields/input-verification-code/index.js +2 -4
- package/lib/components/grid-layout/util/network.js +6 -10
- package/lib/components/import-modal/helper.js +225 -0
- package/lib/components/import-modal/image/loading.gif +0 -0
- package/lib/components/import-modal/import-okr-modal/index.css +18 -0
- package/lib/components/import-modal/import-okr-modal/index.js +137 -0
- package/lib/components/import-modal/import-task-modal/index.css +18 -0
- package/lib/components/import-modal/import-task-modal/index.js +243 -0
- package/lib/components/import-modal/import-task-modal/search-form.js +141 -0
- package/lib/components/import-modal/index.css +30 -0
- package/lib/components/import-modal/index.js +20 -0
- package/lib/components/import-modal/radio.js +62 -0
- package/lib/components/import-modal/request-api.js +204 -0
- package/lib/components/import-modal/search/category-select.js +74 -0
- package/lib/components/import-modal/search/okr-classify-select.js +74 -0
- package/lib/components/import-modal/search/okr-status-select.js +74 -0
- package/lib/components/import-modal/search/okr-type-select.js +87 -0
- package/lib/components/import-modal/search/principal.js +135 -0
- package/lib/components/import-modal/search/relation.js +80 -0
- package/lib/components/import-modal/search/search-dropdown/index.css +50 -0
- package/lib/components/import-modal/search/search-dropdown/index.js +32 -0
- package/lib/components/import-modal/search/task-relation.js +80 -0
- package/lib/components/import-modal/search/task-status-select.js +87 -0
- package/lib/components/import-modal/search/work-relation.js +83 -0
- package/lib/components/import-modal/search/work-status-select.js +74 -0
- package/lib/components/import-modal/tree/okr-tree/index.css +61 -0
- package/lib/components/import-modal/tree/okr-tree/index.js +267 -0
- package/lib/components/import-modal/tree/okr-tree/search-form.js +169 -0
- package/lib/components/import-modal/tree/task-work-tree/index.css +124 -0
- package/lib/components/import-modal/tree/task-work-tree/index.js +190 -0
- package/lib/components/import-modal/tree-node/index.css +0 -0
- package/lib/components/import-modal/tree-node/index.js +51 -0
- package/lib/components/import-modal/tree-node/kr-node/index.css +65 -0
- package/lib/components/import-modal/tree-node/kr-node/index.js +112 -0
- package/lib/components/import-modal/tree-node/milestone-node/index.css +61 -0
- package/lib/components/import-modal/tree-node/milestone-node/index.js +118 -0
- package/lib/components/import-modal/tree-node/o-node/index.css +53 -0
- package/lib/components/import-modal/tree-node/o-node/index.js +142 -0
- package/lib/components/import-modal/tree-node/work-node/index.css +51 -0
- package/lib/components/import-modal/tree-node/work-node/index.js +108 -0
- package/lib/components/menus/components/menu-tree/images/summary-menu/caidan-enjoy.svg +14 -0
- package/lib/components/menus/components/menu-tree/images/summary-menu/my-setup.svg +18 -0
- package/lib/components/menus/components/menu-tree/images/summary-menu/my-zongjie.svg +15 -0
- package/lib/components/menus/components/menu-tree/images/summary-menu/zongjie-s.svg +15 -0
- package/lib/components/menus/components/menu-tree/tree-node/index.css +120 -0
- package/lib/components/menus/components/menu-tree/tree-node/index.js +22 -2
- package/lib/components/menus/components/menu-tree/tree-node/subordinates.js +78 -0
- package/lib/components/menus/components/menu-tree/tree-node/summary-share.js +78 -0
- package/lib/components/menus/export-modules/interview-menus/constant.js +22 -1
- package/lib/components/menus/export-modules/summary-menus/depart-menus/helper.js +56 -0
- package/lib/components/menus/export-modules/summary-menus/depart-menus/index.css +32 -0
- package/lib/components/menus/export-modules/summary-menus/depart-menus/index.js +231 -0
- package/lib/components/menus/export-modules/summary-menus/index.css +9 -0
- package/lib/components/menus/export-modules/summary-menus/index.js +136 -0
- package/lib/components/menus/export-modules/summary-menus/menu-highlight.js +76 -0
- package/lib/components/menus/export-modules/summary-menus/menus.js +189 -0
- package/lib/components/menus/export-modules/summary-menus/request-api.js +17 -0
- package/lib/components/menus/export-modules/summary-menus/subordinate-menus/helper.js +28 -0
- package/lib/components/menus/export-modules/summary-menus/subordinate-menus/index.css +14 -0
- package/lib/components/menus/export-modules/summary-menus/subordinate-menus/index.js +201 -0
- package/lib/components/menus/export-modules/summary-menus/summary-front-menus.js +242 -0
- package/lib/components/menus/i18n.js +8 -0
- package/lib/components/menus/index.js +6 -0
- package/lib/components/menus/request-apis.js +8 -2
- package/lib/components/nav-top/components/menu/index.js +1 -1
- package/lib/components/new-confidence/constant.js +53 -0
- package/lib/components/new-confidence/img/1.svg +40 -0
- package/lib/components/new-confidence/img/10.svg +33 -0
- package/lib/components/new-confidence/img/2.svg +40 -0
- package/lib/components/new-confidence/img/3.svg +40 -0
- package/lib/components/new-confidence/img/4.svg +40 -0
- package/lib/components/new-confidence/img/5.svg +40 -0
- package/lib/components/new-confidence/img/6.svg +40 -0
- package/lib/components/new-confidence/img/7.svg +40 -0
- package/lib/components/new-confidence/img/8.svg +40 -0
- package/lib/components/new-confidence/img/9.svg +40 -0
- package/lib/components/new-confidence/index.css +62 -0
- package/lib/components/new-confidence/index.js +115 -0
- package/lib/components/new-confidence/interface.js +5 -0
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +2 -4
- package/lib/components/okr-detail/components/ao-nice/index.js +4 -6
- package/lib/components/okr-detail/components/header/edit-name.js +2 -4
- package/lib/components/okr-detail/components/header/o-avatar.js +2 -4
- package/lib/components/okr-detail/components/header/o-classify.js +2 -4
- package/lib/components/okr-detail/components/o-classify.js +2 -4
- package/lib/components/okr-detail/components/o-progress-update/index.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.js +6 -8
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +2 -4
- package/lib/components/okr-detail/detail-footer/index.js +2 -4
- package/lib/components/okr-detail/detail-header/index.js +10 -12
- package/lib/components/okr-detail/okr-list/index.js +2 -4
- package/lib/components/okr-detail/request-apis.js +2 -6
- package/lib/components/okr-flow/child-node/fields/creator.js +2 -4
- package/lib/components/okr-flow/child-node/work-node.js +2 -4
- package/lib/components/okr-flow/export-modal/index.js +23 -4
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +8 -10
- package/lib/components/okr-flow/request-apis.js +2 -6
- package/lib/components/okr-flow/root-node/index.js +2 -4
- package/lib/components/okr-progress/components/o-progress-update/index.js +2 -4
- package/lib/components/okr-progress-modal/index.js +2 -4
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +2 -4
- package/lib/components/okr-share/common-painter/darwAvatar.js +4 -8
- package/lib/components/okr-share/common-painter/openDataPainter.js +2 -6
- package/lib/components/okr-share/common-painter/utils.js +4 -8
- package/lib/components/okr-share/pink-card/drawDepartmentName.js +2 -6
- package/lib/components/okr-share/pink-card/drawKrs.js +2 -6
- package/lib/components/okr-share/pink-card/drawQuote.js +2 -6
- package/lib/components/okr-share/pink-card/drawUserName.js +2 -6
- package/lib/components/okr-share/pink-card/index.js +2 -6
- package/lib/components/okr-share/publishMblog.js +2 -4
- package/lib/components/okr-share/shareCardSelector.js +4 -6
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +4 -4
- package/lib/components/okrcase-library/server/network.js +20 -24
- package/lib/components/open-data-painter/index.js +2 -6
- package/lib/components/period-selector/helper/index.js +2 -6
- package/lib/components/photo-card/components/card/index.js +12 -9
- package/lib/components/picker/components/cross.svg +17 -0
- package/lib/components/picker/components/panels/date-panel/date-body.js +14 -2
- package/lib/components/picker/components/panels/date-panel/index.js +1 -1
- package/lib/components/picker/components/panels/month-panel/index.css +5 -0
- package/lib/components/picker/components/panels/month-panel/index.js +34 -4
- package/lib/components/picker/components/panels/month-panel/month-body.js +2 -3
- package/lib/components/picker/components/panels/month-panel/month-head.js +1 -1
- package/lib/components/picker/components/panels/week-panel/index.css +42 -0
- package/lib/components/picker/components/panels/week-panel/index.js +49 -0
- package/lib/components/picker/components/panels/week-panel/utils.js +124 -0
- package/lib/components/picker/components/panels/week-panel/week-body.js +71 -0
- package/lib/components/picker/components/panels/week-panel/week-head.js +80 -0
- package/lib/components/picker/components/panels/year-panel/index.css +5 -0
- package/lib/components/picker/components/panels/year-panel/index.js +34 -3
- package/lib/components/picker/components/panels/year-panel/year-body.js +10 -3
- package/lib/components/picker/components/picker-trigger/index.css +6 -1
- package/lib/components/picker/components/picker-trigger/index.js +9 -4
- package/lib/components/picker/context.js +17 -2
- package/lib/components/picker/index.css +29 -1
- package/lib/components/picker/index.js +3 -0
- package/lib/components/picker/picker-panels.js +98 -61
- package/lib/components/picker/picker.js +44 -30
- package/lib/components/picker/range-picker/components/picker-trigger/index.css +97 -0
- package/lib/components/picker/range-picker/components/picker-trigger/index.js +109 -0
- package/lib/components/picker/range-picker/components/placeholder/index.js +91 -0
- package/lib/components/picker/range-picker/components/select-input/index.js +72 -0
- package/lib/components/picker/range-picker/components/shortcuts/index.js +45 -0
- package/lib/components/picker/range-picker/index.css +158 -0
- package/lib/components/picker/range-picker/index.js +263 -0
- package/lib/components/picker/utils.js +168 -11
- package/lib/components/promise-confirm/index.css +0 -0
- package/lib/components/promise-confirm/index.js +117 -0
- package/lib/components/promise-confirm/interface.js +5 -0
- package/lib/components/rate/index.css +111 -0
- package/lib/components/rate/index.js +52 -0
- package/lib/components/regulation-setting-item/index.css +33 -0
- package/lib/components/regulation-setting-item/index.js +37 -0
- package/lib/components/rich-editor/schemas/list.js +0 -1
- package/lib/components/rich-editor-at/components/index.css +66 -0
- package/lib/components/rich-editor-at/components/index.js +189 -0
- package/lib/components/rich-editor-at/index.css +40 -0
- package/lib/components/rich-editor-at/index.js +113 -0
- package/lib/components/rich-editor-upload/index.css +11 -0
- package/lib/components/rich-editor-upload/index.js +87 -0
- package/lib/components/search-input/index.js +5 -0
- package/lib/components/select-tags/index.js +7 -1
- package/lib/components/superset-charts/fetch-assets-and-append/get-assets-with-cache.js +2 -6
- package/lib/components/superset-charts/fetch-assets-and-append/index.js +4 -8
- package/lib/components/survey-model/request-api.js +2 -6
- package/lib/components/task-relation-modal/index.js +4 -6
- package/lib/components/task-relation-modal/tree/category-tree/index.js +2 -4
- package/lib/components/task-relation-modal/tree/okr-tree/index.js +2 -4
- package/lib/components/task-relation-modal/tree/work-tree/index.js +2 -4
- package/lib/components/task-relation-modal/work-relation/index.js +4 -6
- package/lib/components/task-tree/task-item-node/e-project.js +2 -4
- package/lib/components/task-tree/task-item-node/e-task.js +2 -4
- package/lib/components/textarea/index.js +7 -5
- package/lib/components/toast/index.js +8 -12
- package/lib/components/upvote/index.js +4 -6
- package/lib/components/version-change-modal/index.js +4 -6
- package/lib/components/version-change-modal/request-api.js +2 -6
- package/lib/components/weekly-report/card.js +12 -4
- package/lib/components/weekly-report/common-painter/darwAvatar.js +6 -10
- package/lib/components/weekly-report/common-painter/drawName.js +2 -6
- package/lib/components/weekly-report/common-painter/openDataPainter.js +2 -6
- package/lib/components/weekly-report/index.js +4 -6
- package/lib/components/write-summary-modal/index.css +79 -0
- package/lib/components/write-summary-modal/index.js +167 -0
- package/lib/components/write-summary-modal/interface.js +19 -0
- package/lib/components/write-summary-modal/request-api.js +18 -0
- package/lib/components/write-summary-modal/utils.js +31 -0
- package/lib/index.js +64 -0
- package/lib/pages/group-management/groupInterface.js +2 -6
- package/lib/pages/new-okr-list/request-api.js +14 -18
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +2 -4
- package/lib/pages/okr-map/request-apis.js +2 -6
- package/lib/utils/bs-global.js +1 -1
- package/lib/utils/constant.js +14 -2
- package/lib/utils/helpers.js +56 -11
- package/lib/utils/open-data.js +4 -6
- package/lib/utils/request-v1.js +2 -6
- package/lib/utils/request.js +2 -6
- package/package.json +2 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports["default"] = void 0;
|
|
7
9
|
|
|
8
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
11
|
|
|
10
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
13
|
|
|
@@ -21,6 +23,10 @@ require("./index.css");
|
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
25
|
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
24
30
|
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); }
|
|
25
31
|
|
|
26
32
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -29,10 +35,28 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
29
35
|
|
|
30
36
|
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; }
|
|
31
37
|
|
|
38
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
|
+
|
|
40
|
+
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."); }
|
|
41
|
+
|
|
42
|
+
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); }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
|
+
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; }
|
|
47
|
+
|
|
48
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
|
+
|
|
32
50
|
var YearPanel = function YearPanel(props) {
|
|
33
51
|
var onViewDateChange = props.onViewDateChange,
|
|
34
52
|
viewDate = props.viewDate;
|
|
35
|
-
|
|
53
|
+
|
|
54
|
+
var _useState = (0, _react.useState)(),
|
|
55
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
56
|
+
newViewDate = _useState2[0],
|
|
57
|
+
setNewViewDate = _useState2[1];
|
|
58
|
+
|
|
59
|
+
var yearNumber = (0, _moment["default"])(newViewDate).year();
|
|
36
60
|
|
|
37
61
|
var startYear = Math.floor(yearNumber / _utils.YEAR_DECADE_COUNT) * _utils.YEAR_DECADE_COUNT;
|
|
38
62
|
|
|
@@ -40,7 +64,7 @@ var YearPanel = function YearPanel(props) {
|
|
|
40
64
|
|
|
41
65
|
var onDecadeYearChange = function onDecadeYearChange(diff) {
|
|
42
66
|
if (onViewDateChange) {
|
|
43
|
-
onViewDateChange((0, _moment["default"])(
|
|
67
|
+
onViewDateChange((0, _moment["default"])(newViewDate).add(diff, 'y'));
|
|
44
68
|
}
|
|
45
69
|
};
|
|
46
70
|
|
|
@@ -49,6 +73,13 @@ var YearPanel = function YearPanel(props) {
|
|
|
49
73
|
endYear: endYear
|
|
50
74
|
}));
|
|
51
75
|
|
|
76
|
+
(0, _react.useEffect)(function () {
|
|
77
|
+
if (typeof viewDate === 'string') {
|
|
78
|
+
setNewViewDate(viewDate.split('~')[0]);
|
|
79
|
+
} else {
|
|
80
|
+
setNewViewDate(viewDate);
|
|
81
|
+
}
|
|
82
|
+
}, []);
|
|
52
83
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
53
84
|
className: (0, _classnames["default"])("".concat(_utils.PickerPanelClass, "__year"))
|
|
54
85
|
}, /*#__PURE__*/_react["default"].createElement(_yearHead["default"], _extends({}, extendProps, {
|
|
@@ -36,8 +36,15 @@ var YearPanelBody = function YearPanelBody(props) {
|
|
|
36
36
|
endYear = props.endYear;
|
|
37
37
|
|
|
38
38
|
var _useContext = (0, _react.useContext)(_context["default"]),
|
|
39
|
+
format = _useContext.format,
|
|
39
40
|
value = _useContext.value,
|
|
40
|
-
|
|
41
|
+
settingType = _useContext.settingType;
|
|
42
|
+
|
|
43
|
+
var date = (0, _utils.getPickerDateBySettingType)({
|
|
44
|
+
format: format,
|
|
45
|
+
settingType: settingType,
|
|
46
|
+
values: value
|
|
47
|
+
});
|
|
41
48
|
|
|
42
49
|
var getCells = function getCells(baseYear) {
|
|
43
50
|
var cols = [];
|
|
@@ -47,14 +54,14 @@ var YearPanelBody = function YearPanelBody(props) {
|
|
|
47
54
|
|
|
48
55
|
var year = baseYear + col;
|
|
49
56
|
cols.push( /*#__PURE__*/_react["default"].createElement("td", {
|
|
50
|
-
className: (0, _classnames["default"])(_utils.PickerCellClass, (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--this-year"), year === (0, _moment["default"])().year()), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--in-view"), year >= startYear && year <= endYear), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--selected"), year === (0, _moment["default"])(
|
|
57
|
+
className: (0, _classnames["default"])(_utils.PickerCellClass, (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--this-year"), year === (0, _moment["default"])().year()), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--in-view"), year >= startYear && year <= endYear), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--selected"), year === (0, _moment["default"])(date).year()), _classNames)),
|
|
51
58
|
key: year
|
|
52
59
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
53
60
|
className: (0, _classnames["default"])("".concat(_utils.PickerCellClass, "__inner")),
|
|
54
61
|
title: year,
|
|
55
62
|
onClick: function onClick() {
|
|
56
63
|
if (onSelect) {
|
|
57
|
-
onSelect((0, _moment["default"])(viewDate).year(year),
|
|
64
|
+
onSelect((0, _moment["default"])(viewDate).year(year), 'year');
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
67
|
}, year)));
|
|
@@ -12,10 +12,14 @@
|
|
|
12
12
|
align-items: center;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.tita-ui__picker-trigger:hover {
|
|
15
|
+
.tita-ui__picker-trigger:hover, .tita-ui__picker-trigger--focused {
|
|
16
16
|
border-color: #2879ff;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
.tita-ui__picker-trigger--focused .tita-ui__picker-trigger__operation .tu-icon-caret-down::before {
|
|
20
|
+
transform: scale(0.5) rotate(-180deg);
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
.tita-ui__picker-trigger__input {
|
|
20
24
|
flex: 1;
|
|
21
25
|
margin-right: 12px;
|
|
@@ -41,6 +45,7 @@
|
|
|
41
45
|
|
|
42
46
|
.tita-ui__picker-trigger__operation .tu-icon-caret-down::before {
|
|
43
47
|
transform: scale(0.5);
|
|
48
|
+
transition: all 0.3s ease;
|
|
44
49
|
display: inline-block;
|
|
45
50
|
}
|
|
46
51
|
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
15
|
+
|
|
14
16
|
var _utils = require("../../utils");
|
|
15
17
|
|
|
16
18
|
var _context = _interopRequireDefault(require("../../context"));
|
|
@@ -26,7 +28,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
26
28
|
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; }
|
|
27
29
|
|
|
28
30
|
var PickerTrigger = function PickerTrigger(props) {
|
|
31
|
+
var _classNames;
|
|
32
|
+
|
|
29
33
|
var children = props.children,
|
|
34
|
+
focused = props.focused,
|
|
30
35
|
viewDate = props.viewDate,
|
|
31
36
|
_props$disabled = props.disabled,
|
|
32
37
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
@@ -36,13 +41,13 @@ var PickerTrigger = function PickerTrigger(props) {
|
|
|
36
41
|
_onClick = props.onClick;
|
|
37
42
|
|
|
38
43
|
var _useContext = (0, _react.useContext)(_context["default"]),
|
|
39
|
-
|
|
44
|
+
picker = _useContext.picker,
|
|
40
45
|
format = _useContext.format,
|
|
41
46
|
value = _useContext.value;
|
|
42
47
|
|
|
43
48
|
var currFormat = format;
|
|
44
49
|
|
|
45
|
-
switch (
|
|
50
|
+
switch (picker) {
|
|
46
51
|
case 'date':
|
|
47
52
|
currFormat = 'YYYY/MM/DD';
|
|
48
53
|
break;
|
|
@@ -68,13 +73,13 @@ var PickerTrigger = function PickerTrigger(props) {
|
|
|
68
73
|
return !disabled && _onClick();
|
|
69
74
|
}
|
|
70
75
|
}, children) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
71
|
-
className: (0, _classnames["default"])(_utils.PickerTriggerClass,
|
|
76
|
+
className: (0, _classnames["default"])(_utils.PickerTriggerClass, (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerTriggerClass, "--disabled"), disabled), _defineProperty(_classNames, "".concat(_utils.PickerTriggerClass, "--focused"), focused), _classNames)),
|
|
72
77
|
onClick: function onClick() {
|
|
73
78
|
return !disabled && _onClick();
|
|
74
79
|
}
|
|
75
80
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
76
81
|
className: (0, _classnames["default"])("".concat(_utils.PickerTriggerClass, "__input"), _defineProperty({}, "".concat(_utils.PickerTriggerClass, "__input--placeholder"), !value && placeholder))
|
|
77
|
-
}, value ? viewDate.format(currFormat) : placeholder), /*#__PURE__*/_react["default"].createElement("div", {
|
|
82
|
+
}, value ? (0, _moment["default"])(viewDate).format(currFormat) : placeholder), /*#__PURE__*/_react["default"].createElement("div", {
|
|
78
83
|
className: (0, _classnames["default"])("".concat(_utils.PickerTriggerClass, "__operation"))
|
|
79
84
|
}, !disabled && /*#__PURE__*/_react["default"].createElement("span", {
|
|
80
85
|
className: "tu-icon-caret-down"
|
|
@@ -3,13 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = void 0;
|
|
6
|
+
exports["default"] = exports.RangePickerContext = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
13
|
|
|
12
|
-
var PickerContext = /*#__PURE__*/_react["default"].createContext({
|
|
14
|
+
var PickerContext = /*#__PURE__*/_react["default"].createContext({
|
|
15
|
+
format: 'YYYY/MM/DD',
|
|
16
|
+
picker: 'date',
|
|
17
|
+
settingType: 'startDate',
|
|
18
|
+
value: [(0, _moment["default"])()]
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var RangePickerContext = /*#__PURE__*/_react["default"].createContext({
|
|
22
|
+
format: 'YYYY/MM/DD',
|
|
23
|
+
picker: 'date',
|
|
24
|
+
settingType: 'startDate',
|
|
25
|
+
values: [(0, _moment["default"])(), (0, _moment["default"])()]
|
|
26
|
+
});
|
|
13
27
|
|
|
28
|
+
exports.RangePickerContext = RangePickerContext;
|
|
14
29
|
var _default = PickerContext;
|
|
15
30
|
exports["default"] = _default;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
color: #141c28;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.tita-ui__picker-cell--
|
|
30
|
+
.tita-ui__picker-cell--today .tita-ui__picker-cell__inner, .tita-ui__picker-cell:hover .tita-ui__picker-cell__inner {
|
|
31
31
|
background-color: #f0f4fa;
|
|
32
32
|
color: #2879ff;
|
|
33
33
|
}
|
|
@@ -37,6 +37,34 @@
|
|
|
37
37
|
color: #ffffff;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
.tita-ui__picker-cell--selected:hover .tita-ui__picker-cell__inner {
|
|
41
|
+
background-color: #5c8eff;
|
|
42
|
+
color: #ffffff;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.tita-ui__picker-cell--in-ranges {
|
|
46
|
+
position: relative;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.tita-ui__picker-cell--in-ranges::after {
|
|
50
|
+
content: '';
|
|
51
|
+
background-color: rgba(40, 121, 255, 0.1);
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 4px;
|
|
55
|
+
right: 0;
|
|
56
|
+
bottom: 4px;
|
|
57
|
+
left: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.tita-ui__picker-cell--in-ranges--start.tita-ui__picker-cell--selected::after {
|
|
61
|
+
left: 10px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.tita-ui__picker-cell--in-ranges--end.tita-ui__picker-cell--selected::after {
|
|
65
|
+
right: 10px;
|
|
66
|
+
}
|
|
67
|
+
|
|
40
68
|
.tita-ui__picker-cell__inner {
|
|
41
69
|
width: 100%;
|
|
42
70
|
height: 100%;
|
|
@@ -7,7 +7,10 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _picker = _interopRequireDefault(require("./picker"));
|
|
9
9
|
|
|
10
|
+
var _rangePicker = _interopRequireDefault(require("./range-picker"));
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
13
|
|
|
14
|
+
_picker["default"]['Range'] = _rangePicker["default"];
|
|
12
15
|
var _default = _picker["default"];
|
|
13
16
|
exports["default"] = _default;
|
|
@@ -17,6 +17,10 @@ var _monthPanel = _interopRequireDefault(require("./components/panels/month-pane
|
|
|
17
17
|
|
|
18
18
|
var _yearPanel = _interopRequireDefault(require("./components/panels/year-panel"));
|
|
19
19
|
|
|
20
|
+
var _weekPanel = _interopRequireDefault(require("./components/panels/week-panel"));
|
|
21
|
+
|
|
22
|
+
var _context = _interopRequireDefault(require("./context"));
|
|
23
|
+
|
|
20
24
|
var _utils = require("./utils");
|
|
21
25
|
|
|
22
26
|
require("./index.css");
|
|
@@ -40,26 +44,30 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
40
44
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
45
|
|
|
42
46
|
var PickerPanels = function PickerPanels(props) {
|
|
43
|
-
var _props$
|
|
44
|
-
|
|
47
|
+
var _props$picker = props.picker,
|
|
48
|
+
picker = _props$picker === void 0 ? 'date' : _props$picker,
|
|
45
49
|
onChange = props.onChange,
|
|
46
50
|
onClose = props.onClose,
|
|
51
|
+
settingType = props.settingType,
|
|
47
52
|
_props$value = props.value,
|
|
48
|
-
value = _props$value === void 0 ? (0, _moment["default"])() : _props$value;
|
|
53
|
+
value = _props$value === void 0 ? [(0, _moment["default"])()] : _props$value;
|
|
49
54
|
|
|
50
|
-
var
|
|
55
|
+
var _useContext = (0, _react.useContext)(_context["default"]),
|
|
56
|
+
format = _useContext.format;
|
|
57
|
+
|
|
58
|
+
var _useState = (0, _react.useState)(picker),
|
|
51
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
52
60
|
pickerMode = _useState2[0],
|
|
53
61
|
setPickerMode = _useState2[1];
|
|
54
62
|
|
|
55
|
-
var _useState3 = (0, _react.useState)(value
|
|
63
|
+
var _useState3 = (0, _react.useState)(value),
|
|
56
64
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
65
|
viewDate = _useState4[0],
|
|
58
66
|
setViewDate = _useState4[1];
|
|
59
67
|
|
|
60
68
|
var onViewDateChange = function onViewDateChange(date) {
|
|
61
69
|
setViewDate(function () {
|
|
62
|
-
return date;
|
|
70
|
+
return [date];
|
|
63
71
|
});
|
|
64
72
|
};
|
|
65
73
|
|
|
@@ -70,16 +78,14 @@ var PickerPanels = function PickerPanels(props) {
|
|
|
70
78
|
};
|
|
71
79
|
|
|
72
80
|
var onCloseHandler = function onCloseHandler() {
|
|
73
|
-
if (pickerMode ===
|
|
74
|
-
|
|
75
|
-
onClose();
|
|
76
|
-
}
|
|
81
|
+
if (pickerMode === picker && onClose) {
|
|
82
|
+
onClose();
|
|
77
83
|
}
|
|
78
84
|
};
|
|
79
85
|
|
|
80
86
|
var onDateSelect = function onDateSelect(date) {
|
|
81
87
|
if (onChange) {
|
|
82
|
-
onChange(date);
|
|
88
|
+
onChange([date]);
|
|
83
89
|
}
|
|
84
90
|
|
|
85
91
|
onCloseHandler();
|
|
@@ -87,15 +93,15 @@ var PickerPanels = function PickerPanels(props) {
|
|
|
87
93
|
|
|
88
94
|
var onMonthSelect = function onMonthSelect(date) {
|
|
89
95
|
setViewDate(function () {
|
|
90
|
-
return date;
|
|
96
|
+
return [date];
|
|
91
97
|
});
|
|
92
98
|
|
|
93
|
-
if (
|
|
94
|
-
onPanelChange(date,
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (onChange) {
|
|
98
|
-
onChange(date);
|
|
99
|
+
if (picker !== 'month' && picker !== 'week') {
|
|
100
|
+
onPanelChange(date, 'date');
|
|
101
|
+
} else if (picker === 'week') {
|
|
102
|
+
onPanelChange(date, 'week');
|
|
103
|
+
} else if (onChange) {
|
|
104
|
+
onChange([date]);
|
|
99
105
|
}
|
|
100
106
|
|
|
101
107
|
onCloseHandler();
|
|
@@ -103,80 +109,111 @@ var PickerPanels = function PickerPanels(props) {
|
|
|
103
109
|
|
|
104
110
|
var onYearSelect = function onYearSelect(date) {
|
|
105
111
|
setViewDate(function () {
|
|
106
|
-
return date;
|
|
112
|
+
return [date];
|
|
107
113
|
});
|
|
108
114
|
|
|
109
|
-
if (
|
|
110
|
-
onPanelChange(date,
|
|
115
|
+
if (picker !== 'year') {
|
|
116
|
+
onPanelChange(date, 'month');
|
|
117
|
+
} else if (onChange) {
|
|
118
|
+
onChange([date]);
|
|
111
119
|
}
|
|
112
120
|
|
|
121
|
+
onCloseHandler();
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
var onWeekSelect = function onWeekSelect(date, year) {
|
|
125
|
+
setViewDate(function () {
|
|
126
|
+
return [date];
|
|
127
|
+
});
|
|
128
|
+
|
|
113
129
|
if (onChange) {
|
|
114
|
-
onChange(date);
|
|
130
|
+
onChange([date]);
|
|
115
131
|
}
|
|
116
132
|
|
|
117
133
|
onCloseHandler();
|
|
118
134
|
};
|
|
119
135
|
|
|
120
|
-
var onSelectChange = function onSelectChange(date, type) {
|
|
136
|
+
var onSelectChange = function onSelectChange(date, type, year) {
|
|
121
137
|
switch (type) {
|
|
122
|
-
case
|
|
138
|
+
case 'date':
|
|
123
139
|
onDateSelect(date);
|
|
124
140
|
break;
|
|
125
141
|
|
|
126
|
-
case
|
|
142
|
+
case 'month':
|
|
127
143
|
onMonthSelect(date);
|
|
128
144
|
break;
|
|
129
145
|
|
|
130
|
-
case
|
|
146
|
+
case 'year':
|
|
131
147
|
onYearSelect(date);
|
|
132
148
|
break;
|
|
133
149
|
|
|
150
|
+
case 'week':
|
|
151
|
+
onWeekSelect(date, year);
|
|
152
|
+
break;
|
|
153
|
+
|
|
134
154
|
default:
|
|
135
155
|
break;
|
|
136
156
|
}
|
|
137
157
|
};
|
|
138
158
|
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
159
|
+
var renderPanels = (0, _react.useCallback)(function () {
|
|
160
|
+
var panel;
|
|
161
|
+
var date = (0, _utils.getPickerDateBySettingType)({
|
|
162
|
+
format: format,
|
|
163
|
+
settingType: settingType,
|
|
164
|
+
values: viewDate
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
switch (pickerMode) {
|
|
168
|
+
case 'date':
|
|
169
|
+
panel = /*#__PURE__*/_react["default"].createElement(_datePanel["default"], {
|
|
170
|
+
viewDate: date,
|
|
171
|
+
onSelect: onSelectChange,
|
|
172
|
+
onViewDateChange: onViewDateChange,
|
|
173
|
+
onPanelChange: onPanelChange
|
|
174
|
+
});
|
|
175
|
+
break;
|
|
176
|
+
|
|
177
|
+
case 'month':
|
|
178
|
+
panel = /*#__PURE__*/_react["default"].createElement(_monthPanel["default"], {
|
|
179
|
+
viewDate: date,
|
|
180
|
+
onSelect: onSelectChange,
|
|
181
|
+
onViewDateChange: onViewDateChange,
|
|
182
|
+
onPanelChange: onPanelChange
|
|
183
|
+
});
|
|
184
|
+
break;
|
|
185
|
+
|
|
186
|
+
case 'year':
|
|
187
|
+
panel = /*#__PURE__*/_react["default"].createElement(_yearPanel["default"], {
|
|
188
|
+
viewDate: date,
|
|
189
|
+
onSelect: onSelectChange,
|
|
190
|
+
onViewDateChange: onViewDateChange
|
|
191
|
+
});
|
|
192
|
+
break;
|
|
193
|
+
|
|
194
|
+
case 'week':
|
|
195
|
+
panel = /*#__PURE__*/_react["default"].createElement(_weekPanel["default"], {
|
|
196
|
+
viewDate: date,
|
|
197
|
+
onSelect: onSelectChange,
|
|
198
|
+
onViewDateChange: onViewDateChange,
|
|
199
|
+
onPanelChange: onPanelChange,
|
|
200
|
+
valueTypeIsRange: true
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
default:
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
171
206
|
|
|
207
|
+
return panel;
|
|
208
|
+
}, [pickerMode, viewDate]);
|
|
172
209
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
173
210
|
className: _utils.PickerClass
|
|
174
|
-
},
|
|
211
|
+
}, renderPanels());
|
|
175
212
|
};
|
|
176
213
|
|
|
177
214
|
PickerPanels.defaultProps = {
|
|
178
|
-
|
|
179
|
-
value: (0, _moment["default"])()
|
|
215
|
+
picker: 'date',
|
|
216
|
+
value: [(0, _moment["default"])()]
|
|
180
217
|
};
|
|
181
218
|
var _default = PickerPanels;
|
|
182
219
|
exports["default"] = _default;
|
|
@@ -25,7 +25,7 @@ var _utils = require("./utils");
|
|
|
25
25
|
|
|
26
26
|
require("./index.css");
|
|
27
27
|
|
|
28
|
-
var _excluded = ["
|
|
28
|
+
var _excluded = ["children", "direction", "displayMode", "format", "picker", "popupPlacement", "settingType", "value", "visible", "onChange", "onPopupVisibleChange"];
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
31
|
|
|
@@ -52,16 +52,17 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
52
52
|
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; }
|
|
53
53
|
|
|
54
54
|
var Picker = function Picker(props) {
|
|
55
|
-
var
|
|
55
|
+
var children = props.children,
|
|
56
|
+
direction = props.direction,
|
|
57
|
+
displayMode = props.displayMode,
|
|
56
58
|
format = props.format,
|
|
57
|
-
|
|
58
|
-
mode = props.mode,
|
|
59
|
-
children = props.children,
|
|
59
|
+
picker = props.picker,
|
|
60
60
|
popupPlacement = props.popupPlacement,
|
|
61
|
-
|
|
61
|
+
settingType = props.settingType,
|
|
62
|
+
value = props.value,
|
|
63
|
+
visible = props.visible,
|
|
64
|
+
onChange = props.onChange,
|
|
62
65
|
onPopupVisibleChange = props.onPopupVisibleChange,
|
|
63
|
-
_props$visible = props.visible,
|
|
64
|
-
visible = _props$visible === void 0 ? false : _props$visible,
|
|
65
66
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
66
67
|
|
|
67
68
|
var _useState = (0, _react.useState)(visible),
|
|
@@ -74,17 +75,23 @@ var Picker = function Picker(props) {
|
|
|
74
75
|
return popupPlacement;
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
return direction ===
|
|
78
|
+
return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
|
|
78
79
|
};
|
|
79
80
|
|
|
80
81
|
var onChangeHandler = function onChangeHandler(date) {
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
var result = onChange(date);
|
|
83
|
+
|
|
84
|
+
if (result && result instanceof Promise) {
|
|
85
|
+
result.then(function (res) {
|
|
86
|
+
res && onCloseHandler();
|
|
87
|
+
});
|
|
88
|
+
} else if (result !== false) {
|
|
89
|
+
onCloseHandler();
|
|
83
90
|
}
|
|
84
91
|
};
|
|
85
92
|
|
|
86
93
|
var onCloseHandler = function onCloseHandler() {
|
|
87
|
-
setPopupVisible(false);
|
|
94
|
+
return setPopupVisible(false);
|
|
88
95
|
};
|
|
89
96
|
|
|
90
97
|
var handlePopupVisibleChange = function handlePopupVisibleChange(visible) {
|
|
@@ -92,40 +99,47 @@ var Picker = function Picker(props) {
|
|
|
92
99
|
onPopupVisibleChange === null || onPopupVisibleChange === void 0 ? void 0 : onPopupVisibleChange(visible);
|
|
93
100
|
};
|
|
94
101
|
|
|
102
|
+
var popContent = (0, _react.useMemo)(function () {
|
|
103
|
+
return /*#__PURE__*/_react["default"].createElement(_pickerPanels["default"], _extends({
|
|
104
|
+
value: value,
|
|
105
|
+
picker: picker,
|
|
106
|
+
onChange: onChangeHandler,
|
|
107
|
+
onClose: onCloseHandler,
|
|
108
|
+
settingType: settingType
|
|
109
|
+
}, restProps));
|
|
110
|
+
}, [settingType, value]);
|
|
95
111
|
return /*#__PURE__*/_react["default"].createElement(_context["default"].Provider, {
|
|
96
112
|
value: {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
113
|
+
picker: picker,
|
|
114
|
+
format: format,
|
|
115
|
+
settingType: settingType,
|
|
116
|
+
value: value
|
|
100
117
|
}
|
|
101
|
-
}, /*#__PURE__*/_react["default"].createElement(_popup["default"], _extends({
|
|
118
|
+
}, displayMode === 'layer' && /*#__PURE__*/_react["default"].createElement(_popup["default"], _extends({
|
|
102
119
|
extraClass: (0, _classnames["default"])(_utils.PickerDropdownClass),
|
|
103
|
-
popup:
|
|
104
|
-
value: value,
|
|
105
|
-
mode: mode
|
|
106
|
-
}, restProps, {
|
|
107
|
-
onChange: onChangeHandler,
|
|
108
|
-
onClose: onCloseHandler
|
|
109
|
-
})),
|
|
120
|
+
popup: popContent,
|
|
110
121
|
popupVisible: popupVisible,
|
|
111
122
|
popupPlacement: getPopupPlacement(),
|
|
112
123
|
onPopupVisibleChange: handlePopupVisibleChange
|
|
113
124
|
}, restProps), /*#__PURE__*/_react["default"].createElement(_pickerTrigger["default"], _extends({
|
|
114
|
-
|
|
125
|
+
focused: popupVisible,
|
|
126
|
+
viewDate: (0, _moment["default"])(value[0]),
|
|
115
127
|
onClick: function onClick() {
|
|
116
128
|
return setPopupVisible(true);
|
|
117
129
|
}
|
|
118
|
-
}, restProps), children)));
|
|
130
|
+
}, restProps), children)), displayMode === 'tiled' && popContent);
|
|
119
131
|
};
|
|
120
132
|
|
|
121
133
|
Picker.defaultProps = {
|
|
122
134
|
children: null,
|
|
123
|
-
value: (0, _moment["default"])(),
|
|
124
|
-
|
|
125
|
-
format:
|
|
135
|
+
value: [(0, _moment["default"])()],
|
|
136
|
+
picker: 'date',
|
|
137
|
+
format: 'YYYY/MM/DD',
|
|
126
138
|
popupStyle: {},
|
|
127
|
-
popupPlacement:
|
|
128
|
-
direction:
|
|
139
|
+
popupPlacement: 'bottomLeft',
|
|
140
|
+
direction: 'ltr',
|
|
141
|
+
displayMode: 'layer',
|
|
142
|
+
settingType: 'startDate',
|
|
129
143
|
visible: false
|
|
130
144
|
};
|
|
131
145
|
var _default = Picker;
|