@titaui/pc 1.11.27-beta.8 → 1.11.29
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/avatar/name-avatar/index.css +0 -1
- package/lib/components/avatar/name-avatar/index.js +13 -22
- package/lib/components/avatar/text-avatar/index.css +7 -0
- package/lib/components/avatar/text-avatar/index.js +32 -7
- package/lib/components/button/icon-btn/index.js +17 -8
- package/lib/components/button/rect-btn/index.css +11 -45
- package/lib/components/button/rect-btn/index.js +13 -19
- package/lib/components/change-okr-modal/Item.js +14 -14
- package/lib/components/change-okr-modal/index.js +1 -2
- package/lib/components/create-okr-modal/index.js +1 -3
- package/lib/components/create-okr-modal/request-api.js +1 -1
- package/lib/components/dialog-confirm/index.css +2 -2
- package/lib/components/drawer/headerAction.js +1 -5
- package/lib/components/drawer/headerDrop.js +4 -42
- package/lib/components/drawer/index.css +0 -33
- package/lib/components/drawer/index.js +3 -26
- package/lib/components/drop-selector/index.js +25 -10
- package/lib/components/dynamic/advertise/components/next-btn/index.css +27 -0
- package/lib/components/dynamic/advertise/components/next-btn/index.js +32 -0
- package/lib/components/dynamic/advertise/components/pre-btn/index.css +26 -0
- package/lib/components/dynamic/advertise/components/pre-btn/index.js +32 -0
- package/lib/components/dynamic/advertise/index.css +21 -0
- package/lib/components/dynamic/advertise/index.js +126 -0
- package/lib/components/dynamic/advertise/interface.js +5 -0
- package/lib/components/dynamic/advertise/util.js +28 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.css +81 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.js +203 -0
- package/lib/components/dynamic/components/first-level-tabs/index.css +101 -0
- package/lib/components/dynamic/components/first-level-tabs/index.js +131 -0
- package/lib/components/dynamic/constant.js +33 -32
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +9 -9
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +51 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +50 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +65 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +5 -5
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +6 -6
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +10 -10
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +13 -13
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +9 -9
- package/lib/components/dynamic/dynamic-item/index.js +50 -32
- package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +23 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.css +146 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.js +180 -0
- package/lib/components/dynamic/dynamic-like-ranking/item.js +105 -0
- package/lib/components/dynamic/dynamic-like-ranking/mock.js +84 -0
- package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +30 -0
- package/lib/components/dynamic/dynamic-liking/index.css +81 -0
- package/lib/{pages/new-okr-list/header/operate-record.js → components/dynamic/dynamic-liking/index.js} +39 -91
- package/lib/components/dynamic/dynamic-liking/item.js +75 -0
- package/lib/components/dynamic/dynamic-liking/mock.js +83 -0
- package/lib/components/dynamic/dynamic-list/index.js +7 -15
- package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +16 -0
- package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +30 -0
- package/lib/components/dynamic/dynamic-topping/index.css +141 -0
- package/lib/components/dynamic/dynamic-topping/index.js +82 -0
- package/lib/components/dynamic/dynamic-topping/interface.js +5 -0
- package/lib/components/dynamic/dynamic-topping/item.js +153 -0
- package/lib/components/dynamic/dynamic-topping/request-api.js +36 -0
- package/lib/components/dynamic/dynamic.css +173 -0
- package/lib/components/dynamic/dynamic.js +428 -0
- package/lib/components/dynamic/export-module/index.js +37 -0
- package/lib/components/dynamic/img/dynamic-top.svg +14 -0
- package/lib/components/dynamic/index.js +12 -9
- package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
- package/lib/components/dynamic/my-team/img/line.png +0 -0
- package/lib/components/dynamic/my-team/img/team.png +0 -0
- package/lib/components/dynamic/my-team/index.css +184 -0
- package/lib/components/dynamic/my-team/index.js +263 -0
- package/lib/components/dynamic/my-team/request-api.js +52 -0
- package/lib/components/dynamic/my-team/util.js +20 -0
- package/lib/components/dynamic/new-ui.css +192 -0
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +58 -0
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +68 -0
- package/lib/components/dynamic/online-broadcast/data.js +77 -0
- package/lib/components/dynamic/online-broadcast/img/broadcast.svg +14 -0
- package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
- package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
- package/lib/components/dynamic/online-broadcast/index.css +46 -0
- package/lib/components/dynamic/online-broadcast/index.js +61 -0
- package/lib/components/dynamic/online-broadcast/interfact.js +5 -0
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +39 -0
- package/lib/components/dynamic/quick-operation/components/create-okr/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-okr/index.js +39 -0
- package/lib/components/dynamic/quick-operation/components/create-share/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-share/index.js +39 -0
- package/lib/components/dynamic/quick-operation/components/create-task/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-task/index.js +44 -0
- package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
- package/lib/components/dynamic/quick-operation/index.css +51 -0
- package/lib/components/dynamic/quick-operation/index.js +120 -0
- package/lib/components/dynamic/request-api.js +68 -7
- package/lib/components/e-priority/index.js +8 -8
- package/lib/components/eReport/eReportShare/index.js +11 -11
- package/lib/components/form/form-fields/date/index.css +24 -0
- package/lib/components/form/form-fields/date/index.js +102 -0
- package/lib/components/form/form-fields/input/index.js +10 -10
- package/lib/components/form/form-fields/user/index.css +23 -3
- package/lib/components/form/form-fields/user/index.js +18 -8
- package/lib/components/form/form-fields/user/user-input.js +15 -6
- package/lib/components/form/index.js +10 -3
- package/lib/components/grid-layout/sub-employee-okr/person-okr.js +5 -5
- package/lib/components/icon-button-list/index.js +3 -3
- package/lib/components/img-viewer/index.css +3 -3
- package/lib/components/img-viewer/index.js +11 -11
- package/lib/components/menus/components/menu-tree/images/interview-menu/my-interview.svg +16 -0
- package/lib/components/menus/components/menu-tree/images/interview-menu/template.svg +16 -0
- package/lib/components/menus/components/menu-tree/images/interview-menu/todo.svg +16 -0
- package/lib/components/menus/components/menu-tree/index.css +4 -2
- package/lib/components/menus/components/menu-tree/tree-node/index.css +85 -1
- 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.css +7 -0
- package/lib/components/menus/export-modules/interview-menus/index.js +128 -0
- package/lib/components/menus/index.js +11 -5
- package/lib/components/nav-top/components/menu/index.js +14 -14
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +25 -19
- package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +48 -10
- package/lib/components/nav-top/components/user-message/constant.js +1 -0
- package/lib/components/nav-top/components/user-message/hrMessage.js +22 -19
- package/lib/components/nav-top/components/user-message/index.js +23 -20
- package/lib/components/nav-top/index.js +4 -8
- package/lib/components/nav-top/request.apis.js +3 -1
- package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +4 -20
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +1 -9
- package/lib/components/okr-detail/components/header/index.js +3 -10
- package/lib/components/okr-detail/components/header/o-name.js +3 -10
- package/lib/components/okr-detail/components/o-classify.js +1 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +7 -7
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +10 -14
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +10 -0
- package/lib/components/okr-detail/detail-header/actions.js +23 -23
- package/lib/components/okr-detail/detail-header/delete-confirm/delete-confirm.js +43 -98
- package/lib/components/okr-detail/detail-header/delete-confirm/style.js +38 -0
- package/lib/components/okr-detail/detail-header/index.css +0 -11
- package/lib/components/okr-detail/detail-header/index.js +234 -228
- package/lib/components/okr-detail/index.js +21 -40
- package/lib/components/okr-detail/okr-list/index.js +8 -11
- package/lib/components/okr-detail/request-apis.js +4 -10
- package/lib/components/okr-flow/child-node/index.css +6 -6
- package/lib/components/okr-flow/child-node/work-node.js +21 -21
- package/lib/components/okr-flow/export-modal/index.js +33 -19
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +14 -14
- package/lib/components/okr-flow/okr-map/index.js +5 -5
- package/lib/components/okr-flow/request-apis.js +4 -4
- package/lib/components/okr-flow/root-node/index.js +25 -24
- package/lib/components/okr-flow/utils/index.js +5 -5
- package/lib/components/okr-flow/utils/tree-handler.js +17 -17
- package/lib/components/okr-period-selector/index.js +5 -9
- package/lib/components/okr-period-selector/select-cycle.js +19 -23
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +30 -30
- package/lib/components/operation-records/index.js +1 -1
- package/lib/components/operation-records/style.js +1 -1
- package/lib/components/pagination/index.css +3 -3
- package/lib/components/pagination/select.css +58 -23
- package/lib/components/period-selector/index.css +3 -3
- package/lib/components/period-selector/index.js +11 -11
- package/lib/components/picker/components/panels/date-panel/date-body.js +118 -0
- package/lib/components/picker/components/panels/date-panel/date-head.js +87 -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 +89 -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 +57 -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/popup/index.js +4 -4
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +10 -16
- package/lib/components/radio/index.css +9 -9
- package/lib/components/scrollbar/scroll-mask/index.js +1 -1
- package/lib/components/superset-charts/utils/axios.js +5 -5
- package/lib/components/survey-model/index.css +18 -18
- package/lib/components/survey-model/instance.js +1 -1
- package/lib/components/task-relation-modal/request-api.js +1 -2
- package/lib/components/task-tree/helper.js +61 -0
- package/lib/components/task-tree/images/P1.svg +15 -0
- package/lib/components/task-tree/images/P2.svg +15 -0
- package/lib/components/task-tree/images/P3.svg +15 -0
- package/lib/components/task-tree/images/P4.svg +15 -0
- package/lib/components/task-tree/images/P5.svg +15 -0
- package/lib/components/task-tree/images/arrow.svg +9 -0
- package/lib/components/task-tree/images/empty-131.png +0 -0
- package/lib/components/task-tree/images/followed.svg +33 -0
- package/lib/components/task-tree/images/nice.svg +108 -0
- package/lib/components/task-tree/images/struc12.png +0 -0
- package/lib/components/task-tree/images/struc2.png +0 -0
- package/lib/components/task-tree/images/xialat-s.svg +13 -0
- package/lib/components/task-tree/index.js +22 -0
- package/lib/components/task-tree/mock.js +944 -0
- package/lib/components/task-tree/precls.js +8 -0
- package/lib/components/task-tree/request-apis.js +88 -0
- package/lib/components/task-tree/task-item-node/constant.js +45 -0
- package/lib/components/task-tree/task-item-node/e-empty.js +29 -0
- package/lib/components/task-tree/task-item-node/e-project.js +212 -0
- package/lib/components/task-tree/task-item-node/e-status-dropdown.js +94 -0
- package/lib/components/task-tree/task-item-node/e-task.js +426 -0
- package/lib/components/task-tree/task-item-node/get-process-color.js +62 -0
- package/lib/components/task-tree/task-item-node/index.css +289 -0
- package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
- package/lib/components/task-tree/task-tree.css +16 -0
- package/lib/components/task-tree/task-tree.js +49 -0
- package/lib/components/time-picker/index.css +123 -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 +336 -0
- package/lib/components/time-picker/timer-picker-input.js +96 -0
- package/lib/components/time-picker/utils.js +52 -0
- package/lib/components/toast/index.js +3 -5
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
- package/lib/components-v1/radio/radio.js +3 -3
- package/lib/components-v1/radio/style/index.css +8 -8
- package/lib/index.js +0 -40
- package/lib/pages/aha2021/index.js +5 -1
- package/lib/pages/new-okr-list/header/index.css +0 -45
- package/lib/pages/new-okr-list/header/index.js +16 -38
- package/lib/pages/new-okr-list/index.js +1 -3
- package/lib/pages/new-okr-list/list/index.js +2 -19
- package/lib/pages/new-okr-list/request-api.js +2 -8
- package/lib/pages/okr-map/export-modules/okr-map/header/index.js +24 -24
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +31 -31
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +2 -2
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +11 -11
- package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +8 -8
- package/lib/pages/okr-map/number-select/index.js +2 -2
- package/lib/pages/okr-map/unsupport-ie/index.js +5 -3
- package/lib/utils/auth.js +6 -6
- package/lib/utils/bs-global.js +12 -12
- package/lib/utils/format-time.js +1 -8
- package/lib/utils/hooks.js +72 -0
- package/lib/utils/open-data.js +27 -31
- package/package.json +6 -3
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -223
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -31
- package/.prettierrc.js +0 -90
- package/.vscode/settings.json +0 -5
- package/lib/components/okr-detail/detail-header/constant.js +0 -53
- package/lib/components/okr-detail/detail-header/delete-confirm/index.css +0 -55
- package/lib/components/okr-detail/helper.js +0 -108
- package/lib/components/textarea/index.css +0 -142
- package/lib/components/textarea/index.js +0 -259
- package/lib/pages/new-okr-list/header/common.js +0 -52
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
.titaui-task-tree__e-task-node {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
padding: 2px 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.titaui-task-tree__e-task-node-prefix {
|
|
9
|
+
position: relative;
|
|
10
|
+
top: 2px;
|
|
11
|
+
display: inline-block;
|
|
12
|
+
vertical-align: top;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.titaui-task-tree__e-task-node-prefix .tu-icon-jiantou-right:before {
|
|
16
|
+
color: #89919f;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.titaui-task-tree__e-task-node-title {
|
|
20
|
+
height: 22px;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
23
|
+
color: #3f4755;
|
|
24
|
+
line-height: 22px;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
word-break: keep-all;
|
|
28
|
+
padding-top: 1px;
|
|
29
|
+
flex: 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.titaui-task-tree__e-task-node-priority {
|
|
33
|
+
display: inline-block;
|
|
34
|
+
margin-right: 4px;
|
|
35
|
+
vertical-align: top;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.titaui-task-tree__e-task-node-priority > span {
|
|
39
|
+
position: relative;
|
|
40
|
+
top: 1px;
|
|
41
|
+
display: inline-block;
|
|
42
|
+
vertical-align: text-bottom;
|
|
43
|
+
height: 16px;
|
|
44
|
+
width: 16px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.titaui-task-tree__e-task-node-priority-p1 {
|
|
48
|
+
background: url(../images/P1.svg) transparent no-repeat 50% 50%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.titaui-task-tree__e-task-node-priority-p2 {
|
|
52
|
+
background: url(../images/P2.svg) transparent no-repeat 50% 50%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.titaui-task-tree__e-task-node-priority-p3 {
|
|
56
|
+
background: url(../images/P3.svg) transparent no-repeat 50% 50%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.titaui-task-tree__e-task-node-priority-p4 {
|
|
60
|
+
background: url(../images/P4.svg) transparent no-repeat 50% 50%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.titaui-task-tree__e-task-node-priority-p5 {
|
|
64
|
+
background: url(../images/P5.svg) transparent no-repeat 50% 50%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.titaui-task-tree__e-task-node-actions {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
float: right;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.titaui-task-tree__e-task-node-actions-user {
|
|
74
|
+
display: inline-block;
|
|
75
|
+
width: 64px;
|
|
76
|
+
margin-left: 16px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.titaui-task-tree__e-task-node-actions-date {
|
|
80
|
+
font-size: 12px;
|
|
81
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
82
|
+
color: #89919f;
|
|
83
|
+
line-height: 18px;
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: flex-end;
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
width: 78px;
|
|
89
|
+
height: 26px;
|
|
90
|
+
padding: 4px;
|
|
91
|
+
text-align: left;
|
|
92
|
+
line-height: 26px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.titaui-task-tree__e-task-node-actions-date > span {
|
|
96
|
+
vertical-align: text-bottom;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.titaui-task-tree__e-task-node-actions-progress {
|
|
100
|
+
position: relative;
|
|
101
|
+
top: 3px;
|
|
102
|
+
color: #89919f;
|
|
103
|
+
cursor: auto;
|
|
104
|
+
width: 64px;
|
|
105
|
+
margin-left: 16px;
|
|
106
|
+
margin-right: 4px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.titaui-task-tree__e-task-node-actions-progress .tooltip-text-wrapper {
|
|
110
|
+
margin-left: 4px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.titaui-task-tree__e-task-node-actions-connect {
|
|
114
|
+
display: inline-block;
|
|
115
|
+
color: #cccccc;
|
|
116
|
+
margin-left: 27px;
|
|
117
|
+
margin-right: 10px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.titaui-task-tree__e-task-node-actions-connect:hover {
|
|
121
|
+
color: #2879ff;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.titaui-task-tree__e-task-node-select-priority {
|
|
125
|
+
display: inline-block;
|
|
126
|
+
width: 16px;
|
|
127
|
+
height: 16px;
|
|
128
|
+
margin-right: 10px;
|
|
129
|
+
vertical-align: text-bottom;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.titaui-task-tree__e-project-node {
|
|
133
|
+
position: relative;
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
width: 100%;
|
|
137
|
+
padding: 2px 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.titaui-task-tree__e-project-node-prefix {
|
|
141
|
+
display: inline-block;
|
|
142
|
+
font-size: 14px;
|
|
143
|
+
width: 21px;
|
|
144
|
+
color: #89919f;
|
|
145
|
+
line-height: 1;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.titaui-task-tree__e-project-node-title {
|
|
149
|
+
display: inline-flex;
|
|
150
|
+
font-size: 14px;
|
|
151
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
152
|
+
color: #3f4755;
|
|
153
|
+
line-height: 22px;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
word-break: keep-all;
|
|
157
|
+
flex: 1;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.titaui-task-tree__e-project-node-title-name {
|
|
161
|
+
overflow: hidden;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.titaui-task-tree__e-project-node-title-approvaling {
|
|
165
|
+
display: inline-flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
min-width: 36px;
|
|
169
|
+
padding: 0 6px;
|
|
170
|
+
height: 20px;
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
font-weight: 400;
|
|
173
|
+
color: #f05e5e;
|
|
174
|
+
background: rgba(240, 94, 94, 0.1);
|
|
175
|
+
border-radius: 10px;
|
|
176
|
+
margin-left: 8px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.titaui-task-tree__e-project-node-gray {
|
|
180
|
+
color: #bfc7d5 !important;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.titaui-task-tree__e-project-node-priority {
|
|
184
|
+
display: inline-block;
|
|
185
|
+
margin-right: 4px;
|
|
186
|
+
vertical-align: top;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.titaui-task-tree__e-project-node-priority > span {
|
|
190
|
+
position: relative;
|
|
191
|
+
top: 1px;
|
|
192
|
+
display: inline-block;
|
|
193
|
+
vertical-align: text-bottom;
|
|
194
|
+
height: 16px;
|
|
195
|
+
width: 16px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.titaui-task-tree__e-project-node-priority-p1 {
|
|
199
|
+
background: url(../images/P1.svg) transparent no-repeat 50% 50%;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.titaui-task-tree__e-project-node-priority-p2 {
|
|
203
|
+
background: url(../images/P2.svg) transparent no-repeat 50% 50%;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.titaui-task-tree__e-project-node-priority-p3 {
|
|
207
|
+
background: url(../images/P3.svg) transparent no-repeat 50% 50%;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.titaui-task-tree__e-project-node-priority-p4 {
|
|
211
|
+
background: url(../images/P4.svg) transparent no-repeat 50% 50%;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.titaui-task-tree__e-project-node-priority-p5 {
|
|
215
|
+
background: url(../images/P5.svg) transparent no-repeat 50% 50%;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.titaui-task-tree__e-project-node-actions {
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
float: right;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.titaui-task-tree__e-project-node-actions-user {
|
|
225
|
+
display: inline-block;
|
|
226
|
+
width: 64px;
|
|
227
|
+
margin-left: 16px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.titaui-task-tree__e-project-node-actions-date {
|
|
231
|
+
font-size: 12px;
|
|
232
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
233
|
+
color: #89919f;
|
|
234
|
+
line-height: 18px;
|
|
235
|
+
display: inline-flex;
|
|
236
|
+
align-items: center;
|
|
237
|
+
justify-content: flex-end;
|
|
238
|
+
box-sizing: border-box;
|
|
239
|
+
width: 78px;
|
|
240
|
+
height: 26px;
|
|
241
|
+
padding: 4px;
|
|
242
|
+
text-align: left;
|
|
243
|
+
line-height: 26px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.titaui-task-tree__e-project-node-actions-date > span {
|
|
247
|
+
vertical-align: text-bottom;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.titaui-task-tree__e-project-node-actions-progress {
|
|
251
|
+
position: relative;
|
|
252
|
+
top: 3px;
|
|
253
|
+
color: #89919f;
|
|
254
|
+
cursor: auto;
|
|
255
|
+
width: 64px;
|
|
256
|
+
margin-left: 16px;
|
|
257
|
+
margin-right: 4px;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.titaui-task-tree__e-project-node-actions-progress .tooltip-text-wrapper {
|
|
261
|
+
margin-left: 4px;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.titaui-task-tree__e-project-node-actions-connect {
|
|
265
|
+
display: inline-block;
|
|
266
|
+
color: #cccccc;
|
|
267
|
+
margin-left: 27px;
|
|
268
|
+
margin-right: 10px;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.titaui-task-tree__e-project-node-actions-connect:hover {
|
|
272
|
+
color: #2879ff;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.titaui-task-tree__e-empty-node {
|
|
276
|
+
font-size: 12px;
|
|
277
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
278
|
+
color: #a4acb9;
|
|
279
|
+
line-height: 18px;
|
|
280
|
+
padding-left: 12px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.titaui-task-tree__e-empty-node:hover {
|
|
284
|
+
cursor: text;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.e-node-status-icon {
|
|
288
|
+
color: #89919f;
|
|
289
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _eTask = _interopRequireDefault(require("./e-task"));
|
|
11
|
+
|
|
12
|
+
var _eProject = _interopRequireDefault(require("./e-project"));
|
|
13
|
+
|
|
14
|
+
var _eEmpty = _interopRequireDefault(require("./e-empty"));
|
|
15
|
+
|
|
16
|
+
require("./index.css");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
var _default = function _default(node, level) {
|
|
23
|
+
switch (node.nodeType) {
|
|
24
|
+
case "e-task":
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement(_eTask["default"], _extends({}, node, {
|
|
26
|
+
level: level
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
case "e-project":
|
|
30
|
+
return /*#__PURE__*/_react["default"].createElement(_eProject["default"], _extends({}, node, {
|
|
31
|
+
level: level
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
case "e-empty":
|
|
35
|
+
return /*#__PURE__*/_react["default"].createElement(_eEmpty["default"], _extends({}, node, {
|
|
36
|
+
level: level
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
default:
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.titaui-task-tree {
|
|
2
|
+
position: relative;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.titaui-task-tree .rc-tree-treenode {
|
|
7
|
+
padding: 0 4px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.titaui-task-tree .rc-tree-treenode .rc-tree-node-content-wrapper {
|
|
11
|
+
width: 100% !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.titaui-task-tree .rc-tree-treenode-switcher-close:hover {
|
|
15
|
+
background: #f7f8fa;
|
|
16
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _taskNodeRender = _interopRequireDefault(require("./task-item-node/task-node-render"));
|
|
11
|
+
|
|
12
|
+
var _tree = _interopRequireDefault(require("../tree"));
|
|
13
|
+
|
|
14
|
+
var _precls = _interopRequireDefault(require("./precls"));
|
|
15
|
+
|
|
16
|
+
require("./task-tree.css");
|
|
17
|
+
|
|
18
|
+
var _excluded = ["dataSource", "defaultExpandedKeys", "draggable"];
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
24
|
+
function _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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
var TaskTree = function TaskTree(props) {
|
|
29
|
+
var dataSource = props.dataSource,
|
|
30
|
+
defaultExpandedKeys = props.defaultExpandedKeys,
|
|
31
|
+
_props$draggable = props.draggable,
|
|
32
|
+
draggable = _props$draggable === void 0 ? false : _props$draggable,
|
|
33
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
36
|
+
className: _precls["default"]
|
|
37
|
+
}, /*#__PURE__*/_react["default"].createElement(_tree["default"], _extends({
|
|
38
|
+
draggable: draggable,
|
|
39
|
+
defaultExpandedKeys: defaultExpandedKeys,
|
|
40
|
+
treeData: dataSource,
|
|
41
|
+
titleRender: _taskNodeRender["default"],
|
|
42
|
+
allowDrop: function allowDrop() {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
}, restProps)));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var _default = TaskTree;
|
|
49
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
.tita-ui__time-picker-trigger {
|
|
2
|
+
width: 100px;
|
|
3
|
+
height: 32px;
|
|
4
|
+
padding: 0 12px;
|
|
5
|
+
font-size: 13px;
|
|
6
|
+
font-weight: 400;
|
|
7
|
+
line-height: 18px;
|
|
8
|
+
border: 1px solid #e9ecf0;
|
|
9
|
+
border-radius: 8px;
|
|
10
|
+
transition: all 0.3s ease;
|
|
11
|
+
background: #ffffff;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
color: #3f4755;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.tita-ui__time-picker-trigger:hover {
|
|
19
|
+
border-color: #2879ff;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.tita-ui__time-picker-trigger--disabled {
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.tita-ui__time-picker-trigger--disabled .tita-ui__time-picker-input {
|
|
27
|
+
cursor: not-allowed;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.tita-ui__time-picker-trigger--disabled:hover {
|
|
31
|
+
border-color: #e9ecf0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.tita-ui__time-picker-inputs {
|
|
35
|
+
flex: 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.tita-ui__time-picker-inputs--placeholder input,
|
|
39
|
+
.tita-ui__time-picker-inputs--placeholder span {
|
|
40
|
+
text-shadow: 0 0 0 #bfc7d5;
|
|
41
|
+
color: transparent;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.tita-ui__time-picker-input {
|
|
45
|
+
width: 16px;
|
|
46
|
+
padding: 0;
|
|
47
|
+
text-shadow: 0 0 0 #3f4755;
|
|
48
|
+
border: none;
|
|
49
|
+
color: transparent;
|
|
50
|
+
outline: none;
|
|
51
|
+
text-align: right;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.tita-ui__time-picker-input.active {
|
|
55
|
+
background-color: #2879ff;
|
|
56
|
+
text-shadow: 0 0 0 #ffffff;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tita-ui__time-picker-input::selection {
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.tita-ui__time-picker-icon {
|
|
64
|
+
font-size: 16px;
|
|
65
|
+
color: #3f4755;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.tita-ui__time-picker-icon::before {
|
|
70
|
+
transform: scale(0.5);
|
|
71
|
+
display: inline-block;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.tita-ui__time-picker-icon:hover {
|
|
75
|
+
color: #2879ff;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.tita-ui__time-picker-menu {
|
|
79
|
+
width: 100px;
|
|
80
|
+
border-radius: 8px;
|
|
81
|
+
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.1);
|
|
82
|
+
background: #ffffff;
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.tita-ui__time-picker-menu-item {
|
|
87
|
+
margin: 0;
|
|
88
|
+
padding: 7px 12px;
|
|
89
|
+
font-size: 14px;
|
|
90
|
+
font-weight: 400;
|
|
91
|
+
line-height: 18px;
|
|
92
|
+
color: #3f4755;
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.tita-ui__time-picker-menu-item:hover {
|
|
97
|
+
color: #2879ff;
|
|
98
|
+
background: #f7f8fa;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.tita-ui__time-picker-menu-item.active {
|
|
102
|
+
color: #2879ff;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.tita-ui__time-picker-menu-item--sticky {
|
|
106
|
+
height: 16px;
|
|
107
|
+
border-radius: 8px;
|
|
108
|
+
background-color: #ffffff;
|
|
109
|
+
position: sticky;
|
|
110
|
+
z-index: 10;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.tita-ui__time-picker-menu-item--sticky.top {
|
|
114
|
+
top: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.tita-ui__time-picker-menu-item--sticky.bottom {
|
|
118
|
+
bottom: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.tita-ui__time-picker-menu-item--sticky.shadow {
|
|
122
|
+
box-shadow: 0px 0px 8px 0px #e9eef3;
|
|
123
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _timePicker = _interopRequireDefault(require("./time-picker"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = _timePicker["default"];
|
|
13
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,138 @@
|
|
|
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 _popup = _interopRequireDefault(require("../popup"));
|
|
15
|
+
|
|
16
|
+
var _scrollbar = _interopRequireDefault(require("../scrollbar"));
|
|
17
|
+
|
|
18
|
+
var _utils = require("./utils");
|
|
19
|
+
|
|
20
|
+
var _excluded = ["children", "popupStyle", "timeData", "timeSetting", "visibleSetting"];
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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 _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; }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
40
|
+
var PICKERITEM_HEIGHT = 32;
|
|
41
|
+
|
|
42
|
+
var TimePickerSelector = function TimePickerSelector(props) {
|
|
43
|
+
var children = props.children,
|
|
44
|
+
popupStyle = props.popupStyle,
|
|
45
|
+
_props$timeData = props.timeData,
|
|
46
|
+
hours = _props$timeData.hours,
|
|
47
|
+
minutes = _props$timeData.minutes,
|
|
48
|
+
_props$timeSetting = props.timeSetting,
|
|
49
|
+
hour = _props$timeSetting.hour,
|
|
50
|
+
minute = _props$timeSetting.minute,
|
|
51
|
+
setTime = _props$timeSetting.setTime,
|
|
52
|
+
_props$visibleSetting = props.visibleSetting,
|
|
53
|
+
visible = _props$visibleSetting.visible,
|
|
54
|
+
setVisible = _props$visibleSetting.setVisible,
|
|
55
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
56
|
+
|
|
57
|
+
var pickerMenuRef = (0, _react.useRef)();
|
|
58
|
+
var pickerMenuItemActiveIndexRef = (0, _react.useRef)(0);
|
|
59
|
+
var timerRef = (0, _react.useRef)();
|
|
60
|
+
|
|
61
|
+
var onItemClickHandler = function onItemClickHandler(time) {
|
|
62
|
+
// setHour(hour);
|
|
63
|
+
// setMinute(minute);
|
|
64
|
+
setTime(time);
|
|
65
|
+
setVisible(false);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var renderContent = function renderContent() {
|
|
69
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
70
|
+
className: "".concat(_utils.TimePickerClass, "-menu")
|
|
71
|
+
}, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], {
|
|
72
|
+
style: {
|
|
73
|
+
maxHeight: 192
|
|
74
|
+
}
|
|
75
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
76
|
+
className: "".concat(_utils.TimePickerClass, "-menu-item--sticky top")
|
|
77
|
+
}), hours.map(function (h, hIndex) {
|
|
78
|
+
return minutes.map(function (m, mIndex) {
|
|
79
|
+
var isCurrentTime = Number(h) === Number(hour) && Number(m) === Number(minute);
|
|
80
|
+
|
|
81
|
+
if (isCurrentTime) {
|
|
82
|
+
pickerMenuItemActiveIndexRef.current = hIndex + mIndex + 1 + hIndex * (minutes.length - 1);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var time = "".concat(h, ":").concat(m);
|
|
86
|
+
return (
|
|
87
|
+
/*#__PURE__*/
|
|
88
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
89
|
+
_react["default"].createElement("p", {
|
|
90
|
+
className: (0, _classnames["default"])("".concat(_utils.TimePickerClass, "-menu-item"), {
|
|
91
|
+
active: isCurrentTime
|
|
92
|
+
}),
|
|
93
|
+
key: m,
|
|
94
|
+
onClick: function onClick() {
|
|
95
|
+
return onItemClickHandler(time);
|
|
96
|
+
}
|
|
97
|
+
}, time)
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
}), /*#__PURE__*/_react["default"].createElement("p", {
|
|
101
|
+
className: "".concat(_utils.TimePickerClass, "-menu-item--sticky bottom")
|
|
102
|
+
})));
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
(0, _react.useEffect)(function () {
|
|
106
|
+
timerRef.current = setTimeout(function () {
|
|
107
|
+
if (visible && pickerMenuRef.current) {
|
|
108
|
+
pickerMenuRef.current.scrollTop = pickerMenuItemActiveIndexRef.current * PICKERITEM_HEIGHT - PICKERITEM_HEIGHT; // 32: pickerItem height, 23: pickerMenu paddingTop + pickerItem paddingTop
|
|
109
|
+
}
|
|
110
|
+
}, 10);
|
|
111
|
+
return function () {
|
|
112
|
+
clearTimeout(timerRef.current);
|
|
113
|
+
};
|
|
114
|
+
}, [visible]);
|
|
115
|
+
return /*#__PURE__*/_react["default"].createElement(_popup["default"], _extends({
|
|
116
|
+
popup: renderContent(),
|
|
117
|
+
popupVisible: visible,
|
|
118
|
+
onPopupVisibleChange: setVisible,
|
|
119
|
+
popupStyle: _objectSpread(_objectSpread({}, popupStyle), {}, {
|
|
120
|
+
zIndex: 2000
|
|
121
|
+
})
|
|
122
|
+
}, restProps), children);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
TimePickerSelector.defaultProps = {
|
|
126
|
+
children: null,
|
|
127
|
+
popupStyle: {},
|
|
128
|
+
popupAlign: {
|
|
129
|
+
offset: [0, 0],
|
|
130
|
+
overflow: {
|
|
131
|
+
adjustX: true,
|
|
132
|
+
adjustY: true
|
|
133
|
+
},
|
|
134
|
+
targetOffset: [0, 0]
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
var _default = TimePickerSelector;
|
|
138
|
+
exports["default"] = _default;
|