@titaui/pc 1.5.82 → 1.5.83
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/icon-avatar/index.css +15 -0
- package/lib/components/avatar/icon-avatar/index.js +50 -0
- package/lib/components/avatar/index.js +9 -1
- package/lib/components/avatar/num-avatar/index.css +12 -0
- package/lib/components/avatar/num-avatar/index.js +34 -0
- package/lib/components/button/admin-button/default.js +35 -0
- package/lib/components/button/admin-button/drop-down-arrow.js +93 -0
- package/lib/components/button/admin-button/index.css +86 -0
- package/lib/components/button/admin-button/index.js +40 -0
- package/lib/components/button/admin-button/primary.js +33 -0
- package/lib/components/button/admin-button/secondary.js +35 -0
- package/lib/components/button/default-button/index.css +49 -0
- package/lib/components/button/default-button/index.js +51 -0
- package/lib/components/button/export-button/index.css +51 -0
- package/lib/components/button/export-button/index.js +81 -0
- package/lib/components/button/images/daoru.svg +18 -0
- package/lib/components/button/index.js +23 -0
- package/lib/components/button/interface.js +5 -0
- package/lib/components/change-okr/Filter.js +133 -65
- package/lib/components/change-okr/Item.js +6 -0
- package/lib/components/change-okr/filterTab.js +2 -0
- package/lib/components/change-okr/index.js +2 -2
- package/lib/components/checkbox/index.js +4 -3
- package/lib/components/communication/CommunicationRecord.js +116 -161
- package/lib/components/communication/ConvertUserName.js +1 -1
- package/lib/components/communication/index.css +63 -0
- package/lib/components/communication/index.js +53 -28
- package/lib/components/communication/style.js +21 -25
- package/lib/components/create-okr/animation/check-animation.js +2746 -0
- package/lib/components/create-okr/constant.js +27 -0
- package/lib/components/create-okr/createCycle.js +193 -0
- package/lib/components/create-okr/createSuccessCmp.js +233 -0
- package/lib/components/create-okr/createSuccessCmpWrapper.js +20 -0
- package/lib/components/create-okr/fields/date-cycle.js +98 -0
- package/lib/components/create-okr/fields/index.css +346 -0
- package/lib/components/create-okr/fields/index.js +17 -0
- package/lib/components/create-okr/fields/input-with-err-popup.js +57 -0
- package/lib/components/create-okr/fields/o-new-name.js +197 -0
- package/lib/components/create-okr/fields/okr-case.js +98 -0
- package/lib/components/create-okr/fields/okr-classify.js +51 -0
- package/lib/components/create-okr/fields/okr-create-suggest.js +147 -0
- package/lib/components/create-okr/fields/okr-new-user-selector.js +106 -0
- package/lib/components/create-okr/fields/okr-parent.js +157 -0
- package/lib/components/create-okr/fields/okr-type-detail.js +196 -0
- package/lib/components/create-okr/fields/okr-type.js +131 -0
- package/lib/components/create-okr/fields/okr-visibility-detail.js +224 -0
- package/lib/components/create-okr/fields/okr-visibility.js +169 -0
- package/lib/components/create-okr/img/check-normal.svg +29 -0
- package/lib/components/create-okr/img/check-right.svg +16 -0
- package/lib/components/create-okr/img/check-wrong.svg +29 -0
- package/lib/components/create-okr/img/create-success-head.png +0 -0
- package/lib/components/create-okr/img/create-success-left-quotation.svg +14 -0
- package/lib/components/create-okr/img/create-success-message.svg +1 -0
- package/lib/components/create-okr/img/create-success-right-quotation.svg +14 -0
- package/lib/components/create-okr/img/create-success-shadow.svg +23 -0
- package/lib/components/create-okr/img/example.svg +11 -0
- package/lib/components/create-okr/img/hand.svg +12 -0
- package/lib/components/create-okr/img/kr-add.svg +12 -0
- package/lib/components/create-okr/img/left-quotation.svg +12 -0
- package/lib/components/create-okr/img/light.svg +1 -0
- package/lib/components/create-okr/img/pack-up.js +28 -0
- package/lib/components/create-okr/img/qr-code.png +0 -0
- package/lib/components/create-okr/img/right-quotation.svg +12 -0
- package/lib/components/create-okr/img/shower.png +0 -0
- package/lib/components/create-okr/img/target.svg +19 -0
- package/lib/components/create-okr/img/teach-okr.svg +17 -0
- package/lib/components/create-okr/img/wave.png +0 -0
- package/lib/components/create-okr/img/weight.svg +12 -0
- package/lib/components/create-okr/index.css +446 -0
- package/lib/components/create-okr/index.js +911 -0
- package/lib/components/create-okr/interface.js +5 -0
- package/lib/components/create-okr/kr-items/index.css +180 -0
- package/lib/components/create-okr/kr-items/kr-item-weight.js +194 -0
- package/lib/components/create-okr/kr-items/krDatas.js +299 -0
- package/lib/components/create-okr/kr-items/krItem.js +167 -0
- package/lib/components/create-okr/objectType.js +273 -0
- package/lib/components/create-okr/request-api.js +220 -0
- package/lib/components/create-okr/style.js +100 -0
- package/lib/components/create-okr/utils/getCreateOkrSurpassPercent.js +124 -0
- package/lib/components/create-okr/utils/helper.js +99 -0
- package/lib/components/create-okr/utils/index.js +23 -0
- package/lib/components/dropdown-layer/icon-item.js +5 -3
- package/lib/components/dropdown-layer/index.css +16 -0
- package/lib/components/dropdown-layer/index.js +21 -14
- package/lib/components/dynamic/components/condition-render/index.js +20 -0
- package/lib/components/dynamic/components/dangerous-html/index.js +22 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.css +78 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.js +192 -0
- package/lib/components/dynamic/components/obj-status/index.css +22 -0
- package/lib/components/dynamic/components/obj-status/index.js +38 -0
- package/lib/components/dynamic/components/percent/index.css +21 -0
- package/lib/components/dynamic/components/percent/index.js +38 -0
- package/lib/components/dynamic/components/title/index.css +35 -0
- package/lib/components/dynamic/components/title/index.js +59 -0
- package/lib/components/dynamic/constant.js +97 -0
- package/lib/components/dynamic/context/index.js +13 -0
- package/lib/components/dynamic/dynamic-item/components/header/index.css +101 -0
- package/lib/components/dynamic/dynamic-item/components/header/index.js +299 -0
- package/lib/components/dynamic/dynamic-item/components/icon/index.css +10 -0
- package/lib/components/dynamic/dynamic-item/components/icon/index.js +35 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align.svg +22 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-relative.svg +22 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +95 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +173 -0
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +59 -0
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +107 -0
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +48 -0
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +89 -0
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +96 -0
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +171 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +67 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +110 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +16 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/img/milestone.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +111 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +158 -0
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +95 -0
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +215 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/constant.js +16 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/img/project.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +91 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +125 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-relative.svg +22 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +95 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +192 -0
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.css +138 -0
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.js +183 -0
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +153 -0
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +138 -0
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +97 -0
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +207 -0
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +59 -0
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +107 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/constant.js +50 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-cancel.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-delay.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-done.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-pause.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-progress.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unaccept.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unstart.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.css +111 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +164 -0
- package/lib/components/dynamic/dynamic-item/index.css +128 -0
- package/lib/components/dynamic/dynamic-item/index.js +352 -0
- 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/index.css +126 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.js +157 -0
- package/lib/components/dynamic/dynamic-like-ranking/item.js +107 -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/components/dynamic/dynamic-liking/index.js +76 -0
- package/lib/components/dynamic/dynamic-liking/item.js +91 -0
- package/lib/components/dynamic/dynamic-liking/mock.js +83 -0
- package/lib/components/dynamic/dynamic-list/index.css +36 -0
- package/lib/components/dynamic/dynamic-list/index.js +61 -0
- package/lib/components/dynamic/dynamic-topping/image/quotationMark.svg +16 -0
- package/lib/components/dynamic/dynamic-topping/image/topIcon.svg +30 -0
- package/lib/components/dynamic/dynamic-topping/index.css +148 -0
- package/lib/components/dynamic/dynamic-topping/index.js +80 -0
- package/lib/components/dynamic/dynamic-topping/interface.js +5 -0
- package/lib/components/dynamic/dynamic-topping/item.js +140 -0
- package/lib/components/dynamic/dynamic-topping/request-api.js +36 -0
- package/lib/components/dynamic/dynamic.css +204 -0
- package/lib/components/dynamic/dynamic.js +391 -0
- package/lib/components/dynamic/export-module/index.js +33 -0
- package/lib/components/dynamic/img/dynamic-P1.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P2.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P3.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P4.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P5.svg +15 -0
- package/lib/components/dynamic/img/dynamic-delay.svg +17 -0
- package/lib/components/dynamic/img/dynamic-desire.svg +61 -0
- package/lib/components/dynamic/img/dynamic-empty.png +0 -0
- package/lib/components/dynamic/img/dynamic-end.svg +17 -0
- package/lib/components/dynamic/img/dynamic-left-quoto.svg +13 -0
- package/lib/components/dynamic/img/dynamic-loading.gif +0 -0
- package/lib/components/dynamic/img/dynamic-normal.svg +17 -0
- package/lib/components/dynamic/img/dynamic-promise.svg +61 -0
- package/lib/components/dynamic/img/dynamic-reword.svg +24 -0
- package/lib/components/dynamic/img/dynamic-right-quoto.svg +13 -0
- package/lib/components/dynamic/img/dynamic-risk.svg +17 -0
- package/lib/components/dynamic/img/dynamic-submit-delay.svg +16 -0
- package/lib/components/dynamic/img/dynamic-submit-normal.svg +18 -0
- package/lib/components/dynamic/img/dynamic-top.svg +14 -0
- package/lib/components/dynamic/index.js +27 -0
- package/lib/components/dynamic/interface.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 +37 -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 +37 -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 +37 -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 +42 -0
- package/lib/components/dynamic/quick-operation/img/create-announcement.png +0 -0
- package/lib/components/dynamic/quick-operation/img/create-okr.png +0 -0
- package/lib/components/dynamic/quick-operation/img/create-share.png +0 -0
- package/lib/components/dynamic/quick-operation/img/create-task.png +0 -0
- package/lib/components/dynamic/quick-operation/index.css +51 -0
- package/lib/components/dynamic/quick-operation/index.js +112 -0
- package/lib/components/dynamic/request-api.js +92 -0
- package/lib/components/dynamic/util.js +140 -0
- package/lib/components/emotionsSelector/style.js +1 -1
- package/lib/components/file-list/components/single-file/index.css +84 -0
- package/lib/components/file-list/components/single-file/index.js +115 -0
- package/lib/components/file-list/img/new-file-list-doc.svg +1 -0
- package/lib/components/file-list/img/new-file-list-other.svg +1 -0
- package/lib/components/file-list/img/new-file-list-pdf.svg +1 -0
- package/lib/components/file-list/img/new-file-list-ppt.svg +1 -0
- package/lib/components/file-list/img/new-file-list-radio.svg +1 -0
- package/lib/components/file-list/img/new-file-list-video.svg +1 -0
- package/lib/components/file-list/img/new-file-list-xls.svg +1 -0
- package/lib/components/file-list/index.css +5 -0
- package/lib/components/file-list/index.js +61 -0
- package/lib/components/file-list/interface.js +5 -0
- package/lib/components/file-list/util.js +78 -0
- package/lib/components/form/form-fields/input/index.css +11 -0
- package/lib/components/form/form-fields/input/index.js +3 -1
- package/lib/components/grid-page/image/{Assistant.svg → assistant.svg} +0 -0
- package/lib/components/grid-page/image/{Boss.svg → boss.svg} +0 -0
- package/lib/components/grid-page/image/{Default-background.png → default-background.png} +0 -0
- package/lib/components/grid-page/image/{UserManager.svg → userManager.svg} +0 -0
- package/lib/components/grid-page/personal-info/index.js +5 -5
- package/lib/components/img-viewer/icon/enlarge.js +30 -0
- package/lib/components/img-viewer/icon/left-rotate.js +46 -0
- package/lib/components/img-viewer/icon/right-rotate.js +44 -0
- package/lib/components/img-viewer/icon/shrink.js +37 -0
- package/lib/components/img-viewer/image/loading.gif +0 -0
- package/lib/components/img-viewer/index.css +155 -0
- package/lib/components/img-viewer/index.js +228 -0
- package/lib/components/img-viewer/interface.js +5 -0
- package/lib/components/img-viewer/util.js +16 -0
- package/lib/components/mblog/components/MblogAction.js +10 -6
- package/lib/components/mblog/index.js +24 -11
- package/lib/components/mblog/style.js +8 -8
- package/lib/components/okr-detail/components/header/index.css +4 -0
- package/lib/components/okr-detail/components/header/o-cycle.js +2 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +15 -8
- package/lib/components/okr-flow/child-node/work-node.js +7 -1
- package/lib/components/okr-period-selector/select-cycle.js +139 -151
- package/lib/components/okr-progress-detail/index.css +1 -0
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +5 -5
- package/lib/components/okr-review/ReviewPop/index.js +4 -4
- package/lib/components/period-selector/common.js +168 -17
- package/lib/components/period-selector/components/selector/index.js +103 -38
- package/lib/components/period-selector/components/selector/style.js +23 -9
- package/lib/components/period-selector/index.js +29 -28
- package/lib/components/popup/index.js +3 -1
- package/lib/components/publish-dynamic-modal/index.js +13 -0
- package/lib/components/publish-dynamic-modal/interface.js +5 -0
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.css +3 -0
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +191 -0
- package/lib/components/publish-dynamic-modal/requist-api.js +48 -0
- package/lib/components/radio/index.css +5 -0
- package/lib/components/radio/radio.js +12 -4
- package/lib/components/search-key-handle/index.js +39 -0
- package/lib/components/table/index.css +0 -1
- package/lib/components/upload/components/uploadedPreview.js +62 -54
- package/lib/components/upload/img/doc.svg +1 -0
- package/lib/components/upload/img/other.svg +1 -0
- package/lib/components/upload/img/pdf.svg +1 -0
- package/lib/components/upload/img/ppt.svg +1 -0
- package/lib/components/upload/img/radio.svg +1 -0
- package/lib/components/upload/img/video.svg +1 -0
- package/lib/components/upload/img/xls.svg +1 -0
- package/lib/components/upload/index.css +26 -0
- package/lib/components/upload/index.js +89 -57
- package/lib/components/upload/style.js +7 -7
- package/lib/components/upload/type.js +15 -15
- package/lib/components/upload/util.js +102 -0
- package/lib/components/upvote/index.js +37 -14
- package/lib/components/user-selector/export-modules/field-tree-selector/index.css +4 -0
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +50 -24
- package/lib/components/user-selector/export-modules/field-tree-selector/single-selector/index.js +11 -2
- package/lib/components/user-selector/layout/index.css +1 -1
- package/lib/components-v1/buttonv2/ButtonLinked.js +35 -0
- package/lib/components-v1/buttonv2/ButtonOutlined.js +64 -0
- package/lib/components-v1/buttonv2/ButtonRounded.js +101 -0
- package/lib/components-v1/buttonv2/DefaultButton.js +86 -0
- package/lib/components-v1/buttonv2/index.js +37 -0
- package/lib/components-v1/buttonv2/style/style.js +53 -0
- package/lib/components-v1/buttonv2/style/theme.css +3 -0
- package/lib/components-v1/confirm/index.js +158 -0
- package/lib/index.js +49 -5
- package/lib/pages/dynamic/index.css +5 -0
- package/lib/pages/dynamic/index.js +25 -0
- package/lib/pages/home-page/components/data-list/nav-selector/index.js +18 -0
- package/lib/pages/home-page/components/data-list/table/utils-function.js +6 -3
- package/lib/pages/like-ranking/column.js +141 -0
- package/lib/pages/like-ranking/filter-buttons/department.js +44 -0
- package/lib/pages/like-ranking/filter-buttons/group.js +34 -0
- package/lib/pages/like-ranking/filter-buttons/index.css +19 -0
- package/lib/pages/like-ranking/filter-buttons/index.js +40 -0
- package/lib/pages/like-ranking/filter-buttons/modular.js +110 -0
- package/lib/pages/like-ranking/filter-buttons/name.js +73 -0
- package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.css +27 -0
- package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.js +38 -0
- package/lib/pages/like-ranking/filter-buttons/timer.js +56 -0
- package/lib/pages/like-ranking/image/dynamic-empty.png +0 -0
- package/lib/pages/like-ranking/image/loading.gif +0 -0
- package/lib/pages/like-ranking/image/ranking-1.png +0 -0
- package/lib/pages/like-ranking/image/ranking-2.png +0 -0
- package/lib/pages/like-ranking/image/ranking-3.png +0 -0
- package/lib/pages/like-ranking/index.css +185 -0
- package/lib/pages/like-ranking/index.js +252 -0
- package/lib/pages/like-ranking/mock.js +366 -0
- package/lib/pages/like-ranking/request-api.js +15 -0
- package/lib/utils/auth.js +46 -5
- package/lib/utils/bs-global.js +26 -2
- package/lib/utils/format-time.js +161 -0
- package/lib/utils/helpers.js +41 -0
- package/lib/utils/roundWeight.js +105 -0
- package/lib/utils/tools.js +140 -20
- package/package.json +2 -2
|
@@ -7,27 +7,27 @@ exports._dealAttachmentType = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _dealAttachmentType = function _dealAttachmentType(fileType) {
|
|
9
9
|
var IsImage = false;
|
|
10
|
-
var
|
|
11
|
-
|
|
10
|
+
var FileType = fileType; // if (/^(jpg|png|gif|jpeg|image|JPG|PNG|GIF|JPEG)$/.test(fileType)) {
|
|
11
|
+
// IsImage = true;
|
|
12
|
+
// IconColor = '#44CF85';
|
|
13
|
+
// } else if (/^(exe|pdf|txt|doc|docx|ppt|pptx|xls|xlsx)$/.test(fileType)) {
|
|
14
|
+
// IconColor = '#49B9DD';
|
|
15
|
+
// } else if (/^(rar|zip)$/.test(fileType)) {
|
|
16
|
+
// IconColor = '#FFBA46';
|
|
17
|
+
// } else if (/^(mp3|wma|wav|flac|ape|ogg|aac|m4a)$/.test(fileType)) {
|
|
18
|
+
// IconColor = '#8479D6';
|
|
19
|
+
// } else if (/^(mp4|mkv|rm|rmvb|avi|3gp|flv|wmv|asf|mpeg|mpg|mov|ts|m4v)$/.test(fileType)) {
|
|
20
|
+
// IconColor = '#3EBBA8';
|
|
21
|
+
// } else {
|
|
22
|
+
// FileType = 'none'
|
|
23
|
+
// }
|
|
12
24
|
|
|
13
|
-
if (/^(jpg|png|gif|jpeg|
|
|
25
|
+
if (/^(jpg|png|gif|jpeg|JPG|PNG|GIF|JPEG)$/.test(fileType)) {
|
|
14
26
|
IsImage = true;
|
|
15
|
-
IconColor = '#44CF85';
|
|
16
|
-
} else if (/^(exe|pdf|txt|doc|docx|ppt|pptx|xls|xlsx)$/.test(fileType)) {
|
|
17
|
-
IconColor = '#49B9DD';
|
|
18
|
-
} else if (/^(rar|zip)$/.test(fileType)) {
|
|
19
|
-
IconColor = '#FFBA46';
|
|
20
|
-
} else if (/^(mp3|wma|wav|flac|ape|ogg|aac|m4a)$/.test(fileType)) {
|
|
21
|
-
IconColor = '#8479D6';
|
|
22
|
-
} else if (/^(mp4|mkv|rm|rmvb|avi|3gp|flv|wmv|asf|mpeg|mpg|mov|ts|m4v)$/.test(fileType)) {
|
|
23
|
-
IconColor = '#3EBBA8';
|
|
24
|
-
} else {
|
|
25
|
-
FileType = 'none';
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
return {
|
|
29
30
|
IsImage: IsImage,
|
|
30
|
-
IconColor: IconColor,
|
|
31
31
|
FileType: FileType
|
|
32
32
|
};
|
|
33
33
|
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getPreviewImgs = exports.isImg = exports.getFileTypeMapIcon = exports.getFileSize = void 0;
|
|
7
|
+
|
|
8
|
+
var _doc = _interopRequireDefault(require("./img/doc.svg"));
|
|
9
|
+
|
|
10
|
+
var _other = _interopRequireDefault(require("./img/other.svg"));
|
|
11
|
+
|
|
12
|
+
var _pdf = _interopRequireDefault(require("./img/pdf.svg"));
|
|
13
|
+
|
|
14
|
+
var _ppt = _interopRequireDefault(require("./img/ppt.svg"));
|
|
15
|
+
|
|
16
|
+
var _radio = _interopRequireDefault(require("./img/radio.svg"));
|
|
17
|
+
|
|
18
|
+
var _video = _interopRequireDefault(require("./img/video.svg"));
|
|
19
|
+
|
|
20
|
+
var _xls = _interopRequireDefault(require("./img/xls.svg"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
var getFileSize = function getFileSize(fileSize) {
|
|
25
|
+
if (fileSize < 1024) {
|
|
26
|
+
return fileSize + "B";
|
|
27
|
+
} else if (fileSize < 1024 * 1024) {
|
|
28
|
+
var temp = fileSize / 1024;
|
|
29
|
+
temp = Number(temp.toFixed(2));
|
|
30
|
+
return temp + "KB";
|
|
31
|
+
} else if (fileSize < 1024 * 1024 * 1024) {
|
|
32
|
+
var _temp = fileSize / (1024 * 1024);
|
|
33
|
+
|
|
34
|
+
_temp = Number(_temp.toFixed(2));
|
|
35
|
+
return _temp + "M";
|
|
36
|
+
} else {
|
|
37
|
+
var _temp2 = fileSize / (1024 * 1024 * 1024);
|
|
38
|
+
|
|
39
|
+
_temp2 = Number(_temp2.toFixed(2));
|
|
40
|
+
return _temp2 + "GB";
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.getFileSize = getFileSize;
|
|
45
|
+
|
|
46
|
+
var getFileTypeMapIcon = function getFileTypeMapIcon(fileType) {
|
|
47
|
+
// if (/^(jpg|png|gif|jpeg|image|JPG|PNG|GIF|JPEG)$/.test(fileType)) {
|
|
48
|
+
// return
|
|
49
|
+
// } else
|
|
50
|
+
if (/^(mp3|ogg|ape|flac)$/.test(fileType.toLowerCase())) {
|
|
51
|
+
return _radio["default"];
|
|
52
|
+
} else if (/^(avi|wmv|mov|mp4|rmvb)$/.test(fileType.toLowerCase())) {
|
|
53
|
+
return _video["default"];
|
|
54
|
+
} else if (/^(pptx|ppt)$/.test(fileType.toLowerCase())) {
|
|
55
|
+
return _ppt["default"];
|
|
56
|
+
} else if (/^(doc|docx)$/.test(fileType.toLowerCase())) {
|
|
57
|
+
return _doc["default"];
|
|
58
|
+
} else if (/^(xls|xlsx)$/.test(fileType.toLowerCase())) {
|
|
59
|
+
return _xls["default"];
|
|
60
|
+
} else if (/^(pdf)$/.test(fileType.toLowerCase())) {
|
|
61
|
+
return _pdf["default"];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return _other["default"];
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
exports.getFileTypeMapIcon = getFileTypeMapIcon;
|
|
68
|
+
|
|
69
|
+
var isImg = function isImg(fileType) {
|
|
70
|
+
if (/^(jpg|png|gif|jpeg|image|JPG|PNG|GIF|JPEG)$/.test(fileType)) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return false;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
exports.isImg = isImg;
|
|
78
|
+
|
|
79
|
+
var getPreviewImgs = function getPreviewImgs(files) {
|
|
80
|
+
return files.filter(function (file) {
|
|
81
|
+
return isImg(file.FileType);
|
|
82
|
+
}).map(function (file) {
|
|
83
|
+
return {
|
|
84
|
+
documentId: file.documentId,
|
|
85
|
+
bigImageUrl: file.ClientUrl,
|
|
86
|
+
fileName: file.FileName,
|
|
87
|
+
fileType: file.FileType,
|
|
88
|
+
previewUrl: file.ClientUrl,
|
|
89
|
+
deleteable: file.Deleteable,
|
|
90
|
+
smallImageUrl: file.ClientUrl,
|
|
91
|
+
createDate: '',
|
|
92
|
+
documentSource: '',
|
|
93
|
+
downloadUrl: file.DownloadUrl,
|
|
94
|
+
imageUrl: file.ClientUrl,
|
|
95
|
+
relatedFileId: null,
|
|
96
|
+
size: file.FileSize,
|
|
97
|
+
thumbnailGenerated: null
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
exports.getPreviewImgs = getPreviewImgs;
|
|
@@ -15,12 +15,14 @@ var _selector = _interopRequireDefault(require("./selector"));
|
|
|
15
15
|
|
|
16
16
|
var _attitude = _interopRequireDefault(require("./attitude"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
19
19
|
|
|
20
20
|
var _requestApis = require("./request-apis");
|
|
21
21
|
|
|
22
22
|
var _upvoteListModal = _interopRequireDefault(require("./upvoteListModal"));
|
|
23
23
|
|
|
24
|
+
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
25
|
+
|
|
24
26
|
require("./index.css");
|
|
25
27
|
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -29,8 +31,14 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
31
|
|
|
30
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
33
|
|
|
34
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
35
|
+
|
|
36
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
37
|
+
|
|
32
38
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
33
39
|
|
|
40
|
+
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; }
|
|
41
|
+
|
|
34
42
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
35
43
|
|
|
36
44
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -48,6 +56,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
48
56
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
57
|
|
|
50
58
|
function UpvoteButton(_ref) {
|
|
59
|
+
var _classnames;
|
|
60
|
+
|
|
51
61
|
var type = _ref.type,
|
|
52
62
|
count = _ref.count,
|
|
53
63
|
style = _ref.style,
|
|
@@ -57,7 +67,11 @@ function UpvoteButton(_ref) {
|
|
|
57
67
|
onChange = _ref.onChange,
|
|
58
68
|
handleRequest = _ref.handleRequest,
|
|
59
69
|
_ref$popAlign = _ref.popAlign,
|
|
60
|
-
popAlign = _ref$popAlign === void 0 ?
|
|
70
|
+
popAlign = _ref$popAlign === void 0 ? "right" : _ref$popAlign,
|
|
71
|
+
_ref$buttonType = _ref.buttonType,
|
|
72
|
+
buttonType = _ref$buttonType === void 0 ? '' : _ref$buttonType,
|
|
73
|
+
_ref$customUpvoteBtnC = _ref.customUpvoteBtnCls,
|
|
74
|
+
customUpvoteBtnCls = _ref$customUpvoteBtnC === void 0 ? '' : _ref$customUpvoteBtnC;
|
|
61
75
|
|
|
62
76
|
var _useState = (0, _react.useState)({
|
|
63
77
|
type: type,
|
|
@@ -216,10 +230,9 @@ function UpvoteButton(_ref) {
|
|
|
216
230
|
})),
|
|
217
231
|
ref: btnref
|
|
218
232
|
}, renderBuntton ? renderBuntton(upvoteState.type, upvoteState.count) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
219
|
-
className: (0,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}),
|
|
233
|
+
className: (0, _classnames2["default"])((_classnames = {
|
|
234
|
+
"tu-icon-APP-zan1": !buttonType && upvoteState.type == 0
|
|
235
|
+
}, _defineProperty(_classnames, customUpvoteBtnCls, customUpvoteBtnCls && upvoteState.type == 0), _defineProperty(_classnames, buttonType, buttonType && upvoteState.type == 0), _defineProperty(_classnames, "feed-upvote-button", true), _classnames)),
|
|
223
236
|
style: {
|
|
224
237
|
backgroundImage: "url(".concat((_attitude["default"].find(function (a) {
|
|
225
238
|
return a.type == upvoteState.type;
|
|
@@ -230,7 +243,10 @@ function UpvoteButton(_ref) {
|
|
|
230
243
|
onClick: function onClick() {
|
|
231
244
|
upvoteState.count > 0 && setModalVisible(true);
|
|
232
245
|
}
|
|
233
|
-
},
|
|
246
|
+
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
247
|
+
overlay: "点赞记录",
|
|
248
|
+
placement: "top"
|
|
249
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, renderCount ? renderCount(upvoteState.type, upvoteState.count) : upvoteState.count))), /*#__PURE__*/_react["default"].createElement(_upvoteListModal["default"], {
|
|
234
250
|
feedId: feedId,
|
|
235
251
|
visible: modalVisible,
|
|
236
252
|
onClose: function onClose() {
|
|
@@ -242,22 +258,22 @@ function UpvoteButton(_ref) {
|
|
|
242
258
|
var UpvoteButtonForFeed = function UpvoteButtonForFeed(props) {
|
|
243
259
|
return /*#__PURE__*/_react["default"].createElement(UpvoteButton, _extends({}, props, {
|
|
244
260
|
renderBuntton: function renderBuntton(type) {
|
|
245
|
-
var text = !type ?
|
|
261
|
+
var text = !type ? "点赞" : "已赞";
|
|
246
262
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
247
263
|
style: {
|
|
248
|
-
display:
|
|
249
|
-
alignItems:
|
|
264
|
+
display: "flex",
|
|
265
|
+
alignItems: "center"
|
|
250
266
|
}
|
|
251
267
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
252
|
-
className: (0,
|
|
253
|
-
|
|
254
|
-
|
|
268
|
+
className: (0, _classnames2["default"])({
|
|
269
|
+
"tu-icon-APP-zan1": type == 0,
|
|
270
|
+
"feed-upvote-button": true
|
|
255
271
|
}),
|
|
256
272
|
style: {
|
|
257
273
|
backgroundImage: "url(".concat((_attitude["default"].find(function (a) {
|
|
258
274
|
return a.type == type;
|
|
259
275
|
}) || {
|
|
260
|
-
img:
|
|
276
|
+
img: ""
|
|
261
277
|
}).img, ")"),
|
|
262
278
|
marginRight: 4
|
|
263
279
|
}
|
|
@@ -270,5 +286,12 @@ var UpvoteButtonForFeed = function UpvoteButtonForFeed(props) {
|
|
|
270
286
|
};
|
|
271
287
|
|
|
272
288
|
exports.UpvoteButtonForFeed = UpvoteButtonForFeed;
|
|
289
|
+
|
|
290
|
+
UpvoteButton.getAttitudes = function () {
|
|
291
|
+
return _attitude["default"].map(function (att) {
|
|
292
|
+
return _objectSpread({}, att);
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
|
|
273
296
|
var _default = UpvoteButton;
|
|
274
297
|
exports["default"] = _default;
|
|
@@ -41,6 +41,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
41
41
|
|
|
42
42
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
43
|
|
|
44
|
+
var defauleSelectNodes = {
|
|
45
|
+
groups: [],
|
|
46
|
+
departments: [],
|
|
47
|
+
users: []
|
|
48
|
+
};
|
|
49
|
+
|
|
44
50
|
var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
45
51
|
var multiple = props.multiple,
|
|
46
52
|
trigger = props.trigger,
|
|
@@ -51,15 +57,15 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
51
57
|
_props$onSelect = props.onSelect,
|
|
52
58
|
onSelect = _props$onSelect === void 0 ? function () {} : _props$onSelect,
|
|
53
59
|
_props$position = props.position,
|
|
54
|
-
position = _props$position === void 0 ?
|
|
60
|
+
position = _props$position === void 0 ? "bottomRight" : _props$position,
|
|
55
61
|
_props$selectNodes = props.selectNodes,
|
|
56
|
-
selectNodes = _props$selectNodes === void 0 ?
|
|
62
|
+
selectNodes = _props$selectNodes === void 0 ? defauleSelectNodes : _props$selectNodes,
|
|
57
63
|
sourceFrom = props.sourceFrom,
|
|
58
64
|
departOnly = props.departOnly,
|
|
59
65
|
_props$auth = props.auth,
|
|
60
66
|
auth = _props$auth === void 0 ? false : _props$auth,
|
|
61
67
|
_props$placeholder = props.placeholder,
|
|
62
|
-
placeholder = _props$placeholder === void 0 ?
|
|
68
|
+
placeholder = _props$placeholder === void 0 ? "请选择" : _props$placeholder,
|
|
63
69
|
_props$getDepartRoot = props.getDepartRoot,
|
|
64
70
|
getDepartRoot = _props$getDepartRoot === void 0 ? function () {} : _props$getDepartRoot,
|
|
65
71
|
_props$destroyPopupOn = props.destroyPopupOnHide,
|
|
@@ -72,18 +78,32 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
72
78
|
disabledDepartSelect = _props$disabledDepart === void 0 ? false : _props$disabledDepart,
|
|
73
79
|
_props$panes = props.panes,
|
|
74
80
|
panes = _props$panes === void 0 ? {
|
|
75
|
-
|
|
76
|
-
|
|
81
|
+
depart: true,
|
|
82
|
+
group: true
|
|
77
83
|
} : _props$panes,
|
|
78
84
|
_onPopupVisibleChange = props.onPopupVisibleChange,
|
|
79
|
-
popClass = props.popClass
|
|
85
|
+
popClass = props.popClass,
|
|
86
|
+
_props$searchWord = props.searchWord,
|
|
87
|
+
searchWord = _props$searchWord === void 0 ? "" : _props$searchWord,
|
|
88
|
+
_props$showSearchInpu = props.showSearchInput,
|
|
89
|
+
showSearchInput = _props$showSearchInpu === void 0 ? true : _props$showSearchInpu,
|
|
90
|
+
getPopupContainer = props.getPopupContainer,
|
|
91
|
+
_props$popupAlign = props.popupAlign,
|
|
92
|
+
popupAlign = _props$popupAlign === void 0 ? {
|
|
93
|
+
offset: [0, 0],
|
|
94
|
+
overflow: {
|
|
95
|
+
adjustX: true,
|
|
96
|
+
adjustY: true
|
|
97
|
+
},
|
|
98
|
+
targetOffset: [0, 0]
|
|
99
|
+
} : _props$popupAlign;
|
|
80
100
|
|
|
81
101
|
var _useState = (0, _react.useState)([]),
|
|
82
102
|
_useState2 = _slicedToArray(_useState, 2),
|
|
83
103
|
selected = _useState2[0],
|
|
84
104
|
setSelected = _useState2[1];
|
|
85
105
|
|
|
86
|
-
var _useState3 = (0, _react.useState)(
|
|
106
|
+
var _useState3 = (0, _react.useState)(''),
|
|
87
107
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
88
108
|
selectedText = _useState4[0],
|
|
89
109
|
setSelectedText = _useState4[1];
|
|
@@ -107,8 +127,8 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
107
127
|
var users = selectNodes.users;
|
|
108
128
|
(groups || []).forEach(function (data) {
|
|
109
129
|
selected.push({
|
|
110
|
-
|
|
111
|
-
|
|
130
|
+
nodeType: "group",
|
|
131
|
+
id: data.id,
|
|
112
132
|
data: data
|
|
113
133
|
});
|
|
114
134
|
texts.push(data.name);
|
|
@@ -116,8 +136,8 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
116
136
|
});
|
|
117
137
|
(departments || []).forEach(function (data) {
|
|
118
138
|
selected.push({
|
|
119
|
-
|
|
120
|
-
|
|
139
|
+
nodeType: "depart",
|
|
140
|
+
id: data.id,
|
|
121
141
|
data: data
|
|
122
142
|
});
|
|
123
143
|
texts.push(data.name);
|
|
@@ -128,8 +148,8 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
128
148
|
});
|
|
129
149
|
(users || []).forEach(function (data) {
|
|
130
150
|
selected.push({
|
|
131
|
-
|
|
132
|
-
|
|
151
|
+
nodeType: "person",
|
|
152
|
+
id: data.userId + "",
|
|
133
153
|
data: data
|
|
134
154
|
});
|
|
135
155
|
texts.push(data.name);
|
|
@@ -138,8 +158,8 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
138
158
|
name: data.name
|
|
139
159
|
}));
|
|
140
160
|
});
|
|
141
|
-
var text = texts.join("、");
|
|
142
|
-
|
|
161
|
+
var text = texts.join("、"); // if (!text) text = placeholder;
|
|
162
|
+
|
|
143
163
|
setSelectedText(text);
|
|
144
164
|
setJsxDomValues(jsxDomValues);
|
|
145
165
|
setSelected(selected);
|
|
@@ -170,7 +190,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
170
190
|
var jsxDomValues = [];
|
|
171
191
|
selectNodes.forEach(function (item) {
|
|
172
192
|
switch (item.nodeType) {
|
|
173
|
-
case
|
|
193
|
+
case "person":
|
|
174
194
|
users.push(item.data);
|
|
175
195
|
texts.push(item.data.name);
|
|
176
196
|
jsxDomValues.push( /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
@@ -179,7 +199,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
179
199
|
}));
|
|
180
200
|
break;
|
|
181
201
|
|
|
182
|
-
case
|
|
202
|
+
case "depart":
|
|
183
203
|
departments.push(item.data);
|
|
184
204
|
texts.push(item.data.name);
|
|
185
205
|
jsxDomValues.push( /*#__PURE__*/_react["default"].createElement(_openData.OpenDepartmentName, {
|
|
@@ -188,7 +208,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
188
208
|
}));
|
|
189
209
|
break;
|
|
190
210
|
|
|
191
|
-
case
|
|
211
|
+
case "group":
|
|
192
212
|
groups.push(item.data);
|
|
193
213
|
texts.push(item.data.name);
|
|
194
214
|
jsxDomValues.push( /*#__PURE__*/_react["default"].createElement("span", null, item.data.name));
|
|
@@ -199,7 +219,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
199
219
|
}
|
|
200
220
|
});
|
|
201
221
|
var wechartOpts = {
|
|
202
|
-
|
|
222
|
+
isWechat: (0, _openData.isWechat)(),
|
|
203
223
|
jsxDomValues: jsxDomValues
|
|
204
224
|
};
|
|
205
225
|
|
|
@@ -213,8 +233,8 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
213
233
|
onSelect(selectNodes, wechartOpts);
|
|
214
234
|
}
|
|
215
235
|
|
|
216
|
-
var text = texts.join(
|
|
217
|
-
|
|
236
|
+
var text = texts.join("、"); // if (!text) text = placeholder;
|
|
237
|
+
|
|
218
238
|
setSelectedText(text);
|
|
219
239
|
setJsxDomValues(jsxDomValues);
|
|
220
240
|
};
|
|
@@ -229,7 +249,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
229
249
|
onOk: onOkHandler,
|
|
230
250
|
selected: selected
|
|
231
251
|
}) : /*#__PURE__*/_react["default"].createElement(_singleSelector["default"], {
|
|
232
|
-
onSelect: onOkHandler
|
|
252
|
+
onSelect: onOkHandler,
|
|
253
|
+
searchWord: searchWord,
|
|
254
|
+
showSearchInput: showSearchInput
|
|
233
255
|
});
|
|
234
256
|
return /*#__PURE__*/_react["default"].createElement(_context.CommonContext.Provider, {
|
|
235
257
|
value: {
|
|
@@ -251,7 +273,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
251
273
|
forceRender: forceRender,
|
|
252
274
|
destroyPopupOnHide: destroyPopupOnHide,
|
|
253
275
|
popup: popup,
|
|
254
|
-
extraClass: popClass
|
|
276
|
+
extraClass: popClass,
|
|
277
|
+
getPopupContainer: getPopupContainer,
|
|
278
|
+
popupAlign: popupAlign
|
|
255
279
|
}, children || trigger ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
256
280
|
onClick: function onClick() {
|
|
257
281
|
return setVisible(true);
|
|
@@ -263,7 +287,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
263
287
|
}
|
|
264
288
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
265
289
|
className: "persel-selector-field__text"
|
|
266
|
-
}, (0, _openData.isWechat)() ? jsxDomValues : selectedText
|
|
290
|
+
}, (0, _openData.isWechat)() ? jsxDomValues : selectedText ? selectedText : /*#__PURE__*/_react["default"].createElement("span", {
|
|
291
|
+
className: "persel-selector-field__text-holder"
|
|
292
|
+
}, placeholder)), /*#__PURE__*/_react["default"].createElement("span", {
|
|
267
293
|
className: "persel-selector-field__suffix"
|
|
268
294
|
})))));
|
|
269
295
|
});
|
package/lib/components/user-selector/export-modules/field-tree-selector/single-selector/index.js
CHANGED
|
@@ -39,7 +39,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
39
39
|
|
|
40
40
|
var _default = function _default(props) {
|
|
41
41
|
var _props$onSelect = props.onSelect,
|
|
42
|
-
onSelect = _props$onSelect === void 0 ? function () {} : _props$onSelect
|
|
42
|
+
onSelect = _props$onSelect === void 0 ? function () {} : _props$onSelect,
|
|
43
|
+
_props$searchWord = props.searchWord,
|
|
44
|
+
searchWord = _props$searchWord === void 0 ? '' : _props$searchWord,
|
|
45
|
+
_props$showSearchInpu = props.showSearchInput,
|
|
46
|
+
showSearchInput = _props$showSearchInpu === void 0 ? true : _props$showSearchInpu;
|
|
43
47
|
|
|
44
48
|
var _useState = (0, _react.useState)(''),
|
|
45
49
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -54,12 +58,17 @@ var _default = function _default(props) {
|
|
|
54
58
|
setSearchKey(val);
|
|
55
59
|
};
|
|
56
60
|
|
|
61
|
+
(0, _react.useEffect)(function () {
|
|
62
|
+
setSearchKey(searchWord);
|
|
63
|
+
}, [searchWord]);
|
|
57
64
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
58
65
|
className: "persel-box persel-box-single",
|
|
59
66
|
onClick: function onClick(e) {
|
|
60
67
|
return e.stopPropagation();
|
|
61
68
|
}
|
|
62
|
-
}, /*#__PURE__*/_react["default"].createElement(_layout.SinglePersonalLayout,
|
|
69
|
+
}, /*#__PURE__*/_react["default"].createElement(_layout.SinglePersonalLayout, {
|
|
70
|
+
onePart: !showSearchInput
|
|
71
|
+
}, showSearchInput && /*#__PURE__*/_react["default"].createElement(_selectorInput["default"], {
|
|
63
72
|
onChange: onSearchChangeHandler
|
|
64
73
|
}), searchKey ? /*#__PURE__*/_react["default"].createElement(_searchedPanel["default"], {
|
|
65
74
|
searchKey: searchKey,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ButtonLinked = ButtonLinked;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
require("./style/theme.css");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
21
|
+
|
|
22
|
+
var LinkedButtonWrapper = _styledComponents["default"].a(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: 14px;\n user-select: select none;\n font-family: 'Microsoft YaHei', 'PingFang SC';\n &:hover {\n }\n"])));
|
|
23
|
+
|
|
24
|
+
function ButtonLinked(_ref) {
|
|
25
|
+
var children = _ref.children,
|
|
26
|
+
onClick = _ref.onClick,
|
|
27
|
+
className = _ref.className,
|
|
28
|
+
style = _ref.style;
|
|
29
|
+
// 类似于链接,只不过有一个hover效果
|
|
30
|
+
return /*#__PURE__*/_react["default"].createElement(LinkedButtonWrapper, {
|
|
31
|
+
className: (0, _classnames["default"])(className, 'tita-linked-button'),
|
|
32
|
+
style: style,
|
|
33
|
+
onClick: onClick
|
|
34
|
+
}, children);
|
|
35
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ButtonOutlined = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _style = require(".//style/style");
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
+
|
|
20
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21
|
+
|
|
22
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23
|
+
|
|
24
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
|
+
|
|
26
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
+
|
|
28
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
29
|
+
|
|
30
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
31
|
+
|
|
32
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
|
+
|
|
34
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
|
+
|
|
36
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
+
|
|
38
|
+
var ButtonOutlined = /*#__PURE__*/function (_Component) {
|
|
39
|
+
_inherits(ButtonOutlined, _Component);
|
|
40
|
+
|
|
41
|
+
var _super = _createSuper(ButtonOutlined);
|
|
42
|
+
|
|
43
|
+
function ButtonOutlined(props) {
|
|
44
|
+
_classCallCheck(this, ButtonOutlined);
|
|
45
|
+
|
|
46
|
+
return _super.call(this, props);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_createClass(ButtonOutlined, [{
|
|
50
|
+
key: "render",
|
|
51
|
+
value: function render() {
|
|
52
|
+
var _this$props = this.props,
|
|
53
|
+
children = _this$props.children,
|
|
54
|
+
onClick = _this$props.onClick;
|
|
55
|
+
return /*#__PURE__*/_react["default"].createElement(_style.ButtonOutlinedWrapper, {
|
|
56
|
+
onClick: onClick
|
|
57
|
+
}, children);
|
|
58
|
+
}
|
|
59
|
+
}]);
|
|
60
|
+
|
|
61
|
+
return ButtonOutlined;
|
|
62
|
+
}(_react.Component);
|
|
63
|
+
|
|
64
|
+
exports.ButtonOutlined = ButtonOutlined;
|