@titaui/pc 1.11.4-1 → 1.11.4-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/date-picker/BodyItem.js +3 -3
- package/lib/components/date-picker/CalendarHeader.js +3 -3
- package/lib/components/delete-confirm-pop/ConfirmPop.js +3 -3
- package/lib/components/dynamic/constant.js +31 -30
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +21 -6
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +4 -4
- package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +19 -7
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
- package/{es/pages/group-management/page-view/loading → lib/components/dynamic/dynamic-item/dynamic-interview-share}/index.js +33 -11
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
- package/lib/components/dynamic/dynamic-item/index.js +41 -32
- package/lib/components/eReport/eReportLists/reportList.js +3 -3
- package/lib/components/emotions-selector/selector-pop.js +3 -3
- package/lib/components/ereport-list/index.js +3 -3
- package/lib/components/mblog/components/MblogAction.js +3 -3
- package/lib/components/menus/export-modules/interview-menus/constant.js +12 -12
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
- package/lib/components/okr-review/components/ReviewItem/index.js +3 -3
- package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +3 -3
- package/lib/components/range-selector-pop/RangeSelectorPop.js +3 -3
- package/lib/components/rich-editor/models/schema.js +6 -6
- package/lib/components/rich-editor/plugins/block/block-quote/index.js +8 -8
- package/lib/components/rich-editor/plugins/block/heading/index.js +8 -8
- package/lib/components/rich-editor/plugins/block/lists/index.js +14 -14
- package/lib/components/rich-editor/plugins/block/paragraph/index.js +5 -5
- package/lib/components/rich-editor/plugins/core/index.js +4 -4
- package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -5
- package/lib/components/rich-editor/plugins/extension/placeholder/index.js +4 -4
- package/lib/components/rich-editor/plugins/inline/color/index.js +11 -11
- package/lib/components/rich-editor/plugins/inline/delete-line/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/em/index.js +5 -5
- package/lib/components/rich-editor/plugins/inline/link/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/strong/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/under-line/index.js +8 -8
- package/lib/components/rich-editor/react/uiProvider.js +3 -3
- package/lib/components/rich-editor/ui/Popup/index.js +3 -3
- package/lib/components/select/Option.js +3 -3
- package/lib/components/task-tree/helper.js +61 -0
- package/lib/components/task-tree/images/P1.svg +15 -0
- package/lib/components/task-tree/images/P2.svg +15 -0
- package/lib/components/task-tree/images/P3.svg +15 -0
- package/lib/components/task-tree/images/P4.svg +15 -0
- package/lib/components/task-tree/images/P5.svg +15 -0
- package/lib/components/task-tree/images/arrow.svg +9 -0
- package/lib/components/task-tree/images/empty-131.png +0 -0
- package/lib/components/task-tree/images/followed.svg +33 -0
- package/lib/components/task-tree/images/nice.svg +108 -0
- package/lib/components/task-tree/images/struc12.png +0 -0
- package/lib/components/task-tree/images/struc2.png +0 -0
- package/lib/components/task-tree/images/xialat-s.svg +13 -0
- package/lib/components/task-tree/index.js +27 -0
- package/lib/components/task-tree/mock.js +944 -0
- package/{es/components/okr-detail/components/okr-tree → lib/components/task-tree}/precls.js +1 -1
- package/lib/components/task-tree/request-apis.js +88 -0
- package/lib/components/task-tree/task-item-node/constant.js +45 -0
- package/{es/components/okr-detail/components/okr-tree/tree-node/default-node.js → lib/components/task-tree/task-item-node/e-empty.js} +13 -6
- package/{es/components/okr-detail/components/okr-tree/tree-node/e-node → lib/components/task-tree/task-item-node}/e-project.js +29 -34
- package/{es/components/e-status-dropdown/index.js → lib/components/task-tree/task-item-node/e-status-dropdown.js} +3 -3
- package/{es/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js → lib/components/task-tree/task-item-node/e-task.js} +140 -121
- package/{es/components/okr-detail/components/okr-tree/tree-node → lib/components/task-tree/task-item-node}/get-process-color.js +3 -3
- package/lib/components/task-tree/task-item-node/index.css +290 -0
- package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
- package/lib/components/task-tree/task-tree.css +8 -0
- package/{es/components/okr-detail/components/okr-tree/index.js → lib/components/task-tree/task-tree.js} +17 -16
- package/lib/components/tita-chart/errorBoundary/index.js +3 -3
- package/lib/components-v1/animate/AnimateChild.js +3 -3
- package/lib/components-v1/avatar/index.js +3 -3
- package/lib/components-v1/dropDownSelector/StatelessDropdown.js +3 -3
- package/lib/components-v1/progress/CircleProgress.js +3 -3
- package/lib/components-v1/select/Option.js +3 -3
- package/lib/components-v1/userSelector/UserSelectorPop.js +3 -3
- package/lib/components-v1/userSelector/components/MultiMode/index.js +3 -3
- package/lib/components-v1/userSelector/components/UserItem.js +3 -3
- package/lib/index.js +8 -0
- package/package.json +1 -1
- package/yarn-error.log +6356 -5424
- package/es/components/cascader/time.js +0 -31
- package/es/components/common-share/request-apis.js +0 -56
- package/es/components/confidence/heart.js +0 -66
- package/es/components/create-okr-modal/fields/index.js +0 -17
- package/es/components/create-okr-modal/utils/getCreateOkrSurpassPercent.js +0 -154
- package/es/components/date-picker/BodyItem.js +0 -121
- package/es/components/date-picker/CalendarBody.js +0 -157
- package/es/components/date-picker/CalendarHeader.js +0 -187
- package/es/components/date-picker/index.js +0 -157
- package/es/components/date-range-picker/index.js +0 -210
- package/es/components/dialog/index.js +0 -119
- package/es/components/dialog-confirm/index.js +0 -154
- package/es/components/drop-selector/icon-item.js +0 -40
- package/es/components/drop-selector/index.js +0 -179
- package/es/components/dynamic/dynamic-like-ranking/mock.js +0 -84
- package/es/components/dynamic/dynamic-liking/mock.js +0 -83
- package/es/components/dynamic/dynamic-topping/request-api.js +0 -36
- package/es/components/e-priority/index.js +0 -88
- package/es/components/grid-layout/commen-components/index.js +0 -73
- package/es/components/grid-layout/image/could.js +0 -8
- package/es/components/grid-layout/image/lv.js +0 -8
- package/es/components/grid-layout/image/tita-mask.js +0 -8
- package/es/components/help-card/request-api.js +0 -35
- package/es/components/icon-button-list/index.js +0 -65
- package/es/components/menus/context.js +0 -18
- package/es/components/menus/precls.js +0 -8
- package/es/components/okr-detail/auth.js +0 -197
- package/es/components/okr-detail/components/ao-nice/index.js +0 -245
- package/es/components/okr-detail/components/block-line/index.js +0 -20
- package/es/components/okr-detail/components/header/index.js +0 -211
- package/es/components/okr-detail/components/icon-text/index.js +0 -116
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +0 -88
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-status-dropdown.js +0 -98
- package/es/components/okr-detail/components/okr-tree/tree-node/index.js +0 -90
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/get-process-color.js +0 -46
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +0 -421
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/index.js +0 -54
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/style.js +0 -62
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +0 -94
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +0 -273
- package/es/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +0 -207
- package/es/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +0 -236
- package/es/components/okr-detail/components/padding-layout.js +0 -22
- package/es/components/okr-detail/components/tab-panel-content/index.js +0 -27
- package/es/components/okr-detail/context.js +0 -30
- package/es/components/okr-detail/e-list/index.js +0 -243
- package/es/components/okr-detail/e-list/precls.js +0 -8
- package/es/components/okr-detail/e-list/search-form/fields/e-order.js +0 -172
- package/es/components/okr-detail/e-list/search-form/fields/e-status.js +0 -99
- package/es/components/okr-detail/e-list/search-form/fields/e-user.js +0 -49
- package/es/components/okr-detail/e-list/search-form/index.js +0 -143
- package/es/components/okr-detail/error-page/index.js +0 -33
- package/es/components/okr-detail/index.js +0 -428
- package/es/components/okr-detail/loading/index.js +0 -28
- package/es/components/okr-detail/okr-list/add-parent-okr.js +0 -37
- package/es/components/okr-detail/okr-list/create-kr-item/heart.js +0 -38
- package/es/components/okr-detail/okr-list/drag-order-kr.js +0 -62
- package/es/components/okr-detail/okr-list/empty/index.js +0 -48
- package/es/components/okr-detail/okr-list/index.js +0 -524
- package/es/components/okr-detail/okr-list/warp-parent-okr.js +0 -21
- package/es/components/okr-detail/store.js +0 -1
- package/es/components/okr-flow/child-node/fields/creator.js +0 -175
- package/es/components/okr-flow/child-node/fields/okrClassify.js +0 -31
- package/es/components/okr-flow/child-node/fields/okrType.js +0 -21
- package/es/components/okr-flow/child-node/helper.js +0 -35
- package/es/components/okr-flow/child-node/index.js +0 -110
- package/es/components/okr-flow/child-node/kr-node.js +0 -75
- package/es/components/okr-flow/child-node/work-node.js +0 -242
- package/es/components/okr-flow/context.js +0 -14
- package/es/components/okr-flow/empty/index.js +0 -29
- package/es/components/okr-flow/export-modules/okr-search-panel/index.js +0 -394
- package/es/components/okr-flow/index.js +0 -24
- package/es/components/okr-flow/mini-map/index.js +0 -112
- package/es/components/okr-flow/mini-map/map.js +0 -145
- package/es/components/okr-flow/mini-map/mini-node.js +0 -57
- package/es/components/okr-flow/mini-map/utils.js +0 -79
- package/es/components/okr-flow/okr-map/index.js +0 -192
- package/es/components/okr-flow/open-data/index.js +0 -115
- package/es/components/okr-flow/precls.js +0 -8
- package/es/components/okr-flow/request-apis.js +0 -118
- package/es/components/okr-flow/root-node/index.js +0 -229
- package/es/components/okr-flow/utils/config.js +0 -18
- package/es/components/okr-flow/utils/helper.js +0 -36
- package/es/components/okr-flow/utils/index.js +0 -66
- package/es/components/okr-flow/utils/tree-handler.js +0 -323
- package/es/components/okr-progress-modal/helper.js +0 -156
- package/es/components/okr-progress-modal/request-apis.js +0 -34
- package/es/components/okr-share/request-apis.js +0 -56
- package/es/components/okrcase-library/server/network.js +0 -407
- package/es/components/pagination/locale/en_US.js +0 -22
- package/es/components/pagination/locale/zh_CN.js +0 -22
- package/es/components/point-demo/drop-down-box/index.js +0 -159
- package/es/components/point-demo/index.js +0 -533
- package/es/components/point-demo/input/index.js +0 -176
- package/es/components/point-demo/point-demo.js +0 -75
- package/es/components/point-demo/popup/index.js +0 -113
- package/es/components/point-demo/popup/placement.js +0 -44
- package/es/components/range-picker-pop/index.js +0 -273
- package/es/components/scrollbar/simplebar/helpers.js +0 -59
- package/es/components/scrollbar/simplebar/index.js +0 -91
- package/es/components/scrollbar/simplebar/scrollbar-width.js +0 -47
- package/es/components/scrollbar/simplebar/simplebar.js +0 -852
- package/es/components/scrollbar/simplebar-react.js +0 -163
- package/es/components/search-dropdown/index.js +0 -40
- package/es/components/search-input/index.js +0 -126
- package/es/components/select/Option.js +0 -94
- package/es/components/select/index.js +0 -330
- package/es/components/selector-input/debounce.js +0 -36
- package/es/components/selector-input/index.js +0 -109
- package/es/components/slider-input/index.js +0 -119
- package/es/components/switch/index.js +0 -39
- package/es/components/table/index.js +0 -275
- package/es/components/tabs/index.js +0 -63
- package/es/components/task-relation-modal/tree-node/index.js +0 -58
- package/es/components/tita-chart/charts/img/could.js +0 -8
- package/es/components/tooltip/error-tip.js +0 -24
- package/es/components/tooltip/index.js +0 -21
- package/es/components/tree/index.js +0 -79
- package/es/components/tree/precls.js +0 -8
- package/es/components/upvote/request-apis.js +0 -45
- package/es/components/user-selector/action-btns/btn-cancel.js +0 -21
- package/es/components/user-selector/action-btns/btn-ok.js +0 -21
- package/es/components/user-selector/action-btns/index.js +0 -27
- package/es/components/user-selector/context.js +0 -18
- package/es/components/user-selector/empty/group.js +0 -55
- package/es/components/user-selector/empty/index.js +0 -28
- package/es/components/user-selector/export-modules/depart-search-selector/result-part.js +0 -41
- package/es/components/user-selector/export-modules/group-selector/index.js +0 -170
- package/es/components/user-selector/export-modules/group-selector/searched-panel.js +0 -68
- package/es/components/user-selector/export-modules/multiple-user-selector--bak/index.js +0 -246
- package/es/components/user-selector/index.js +0 -25
- package/es/components/user-selector/layout/index.js +0 -25
- package/es/components/user-selector/loading/index.js +0 -18
- package/es/components/user-selector/request-apis.js +0 -180
- package/es/components/user-selector/searched-panel/index.js +0 -139
- package/es/components/user-selector/searched-panel/result-part.js +0 -43
- package/es/components/user-selector/select-tree/selected-tree/index.js +0 -91
- package/es/components/user-selector/select-tree/tree-nodes/tree-depart-node/index.js +0 -48
- package/es/components/user-selector/select-tree/tree-nodes/tree-duties-node/index.js +0 -27
- package/es/components/user-selector/select-tree/tree-nodes/tree-group-node/index.js +0 -57
- package/es/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +0 -93
- package/es/components/user-selector/utils.js +0 -139
- package/es/components/viewer/ImageListRender.js +0 -143
- package/es/components/viewer/index.js +0 -168
- package/es/components/word-cloud/index.js +0 -109
- package/es/components/word-cloud/request-apis.js +0 -26
- package/es/components-v1/animate/AnimateChild.js +0 -76
- package/es/components-v1/animate/animate.js +0 -148
- package/es/components-v1/animate/index.js +0 -13
- package/es/components-v1/dom/index.js +0 -30
- package/es/components-v1/placement/index.js +0 -13
- package/es/components-v1/placement/placement.js +0 -111
- package/es/components-v1/placement/placementInner.js +0 -139
- package/es/components-v1/pop/Pop.js +0 -246
- package/es/components-v1/pop/PopInner.js +0 -163
- package/es/components-v1/pop/index.js +0 -13
- package/es/components-v1/progress/CircleProgress.js +0 -152
- package/es/components-v1/progress/LineProgress.js +0 -83
- package/es/components-v1/progress/index.js +0 -80
- package/es/components-v1/select/Option.js +0 -94
- package/es/components-v1/select/index.js +0 -330
- package/es/components-v1/utils/animate/animate.js +0 -103
- package/es/components-v1/utils/animate/event.js +0 -79
- package/es/components-v1/utils/dom/index.js +0 -30
- package/es/components-v1/utils/placement/autoAdjustPlacement.js +0 -93
- package/es/components-v1/utils/placement/getContainerVisibleArea.js +0 -22
- package/es/components-v1/utils/placement/getExpectPlacement.js +0 -49
- package/es/components-v1/utils/placement/getPlacementInContainer.js +0 -26
- package/es/components-v1/utils/placement/placement.js +0 -76
- package/es/index.js +0 -777
- package/es/pages/appointment-demo/drop-down-box/index.js +0 -159
- package/es/pages/appointment-demo/index.js +0 -649
- package/es/pages/appointment-demo/input/index.js +0 -176
- package/es/pages/appointment-demo/popup/index.js +0 -113
- package/es/pages/appointment-demo/popup/placement.js +0 -44
- package/es/pages/group-management/components/checkbox/index.js +0 -28
- package/es/pages/group-management/components/input-form/index.js +0 -174
- package/es/pages/group-management/components/radio/index.js +0 -21
- package/es/pages/group-management/components/table/index.js +0 -174
- package/es/pages/group-management/groupInterface.js +0 -293
- package/es/pages/group-management/index.js +0 -13
- package/es/pages/group-management/page-view/empty.js +0 -111
- package/es/pages/group-management/page-view/group-empty.js +0 -66
- package/es/pages/group-management/page-view/importGroupStaff/index.js +0 -208
- package/es/pages/group-management/page-view/index.js +0 -412
- package/es/pages/group-management/table/index.js +0 -104
- package/es/pages/group-management/tree/add-group-dialog/index.js +0 -153
- package/es/pages/group-management/tree/delete-group-dialog/index.js +0 -82
- package/es/pages/group-management/tree/edit-group-dialog/index.js +0 -155
- package/es/pages/group-management/tree/group-form/index.js +0 -207
- package/es/pages/group-management/tree/index.js +0 -168
- package/es/pages/group-management/tree/operation-panel.js +0 -41
- package/es/pages/group-management/tree/trigger-render.js +0 -99
- package/es/pages/like-ranking/mock.js +0 -366
- package/es/pages/okr-map/export-modules/index.js +0 -1
- package/es/pages/okr-map/export-modules/okr-map/header/index.js +0 -182
- package/es/pages/okr-map/export-modules/okr-map/header/show-kr-confirm.js +0 -47
- package/es/pages/okr-map/export-modules/okr-map/okr-map.js +0 -497
- package/es/pages/okr-map/export-modules/share-okr-page/header/index.js +0 -69
- package/es/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +0 -168
- package/es/pages/okr-map/hooks/useStorage.js +0 -96
- package/es/pages/okr-map/index.js +0 -18
- package/es/pages/okr-map/level2-search/depart.js +0 -53
- package/es/pages/okr-map/level2-search/group.js +0 -69
- package/es/pages/okr-map/level2-search/index.js +0 -51
- package/es/pages/okr-map/level2-search/level2-input.js +0 -46
- package/es/pages/okr-map/level2-search/user.js +0 -54
- package/es/pages/okr-map/no-okr/index.js +0 -24
- package/es/pages/okr-map/number-select/index.js +0 -81
- package/es/pages/okr-map/open-data/index.js +0 -115
- package/es/pages/okr-map/precls.js +0 -8
- package/es/pages/okr-map/request-apis.js +0 -76
- package/es/pages/okr-map/share-dialog/index.js +0 -122
- package/es/pages/okr-map/unsupport-ie/index.js +0 -83
- package/es/pages/okr-map/utils.js +0 -51
- package/es/utils/auth.js +0 -294
- package/es/utils/bs-global.js +0 -114
- package/es/utils/local-storage.js +0 -42
- package/es/utils/mblog.js +0 -33
- package/es/utils/mock-bsglobal.js +0 -1837
- package/es/utils/open-data.js +0 -341
- package/es/utils/request-v1.js +0 -115
- package/es/utils/request.js +0 -183
- package/es/utils/tools.js +0 -286
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _classcat = _interopRequireDefault(require("classcat"));
|
|
13
|
-
|
|
14
|
-
var _reactFlowRenderer = require("@titaui/react-flow-renderer");
|
|
15
|
-
|
|
16
|
-
var _utils = require("./utils");
|
|
17
|
-
|
|
18
|
-
var _miniNode = _interopRequireDefault(require("./mini-node"));
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
|
|
28
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
-
|
|
30
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
-
|
|
32
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
|
-
|
|
34
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
-
|
|
36
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
|
|
38
|
-
var defaultWidth = 200;
|
|
39
|
-
var defaultHeight = 120;
|
|
40
|
-
|
|
41
|
-
function MiniMap(_ref) {
|
|
42
|
-
var style = _ref.style,
|
|
43
|
-
className = _ref.className,
|
|
44
|
-
_ref$nodeStrokeColor = _ref.nodeStrokeColor,
|
|
45
|
-
nodeStrokeColor = _ref$nodeStrokeColor === void 0 ? "#555" : _ref$nodeStrokeColor,
|
|
46
|
-
_ref$nodeColor = _ref.nodeColor,
|
|
47
|
-
nodeColor = _ref$nodeColor === void 0 ? "#fff" : _ref$nodeColor,
|
|
48
|
-
_ref$nodeClassName = _ref.nodeClassName,
|
|
49
|
-
nodeClassName = _ref$nodeClassName === void 0 ? "" : _ref$nodeClassName,
|
|
50
|
-
_ref$nodeBorderRadius = _ref.nodeBorderRadius,
|
|
51
|
-
nodeBorderRadius = _ref$nodeBorderRadius === void 0 ? 5 : _ref$nodeBorderRadius,
|
|
52
|
-
_ref$nodeStrokeWidth = _ref.nodeStrokeWidth,
|
|
53
|
-
nodeStrokeWidth = _ref$nodeStrokeWidth === void 0 ? 2 : _ref$nodeStrokeWidth,
|
|
54
|
-
_ref$maskColor = _ref.maskColor,
|
|
55
|
-
maskColor = _ref$maskColor === void 0 ? "rgb(240, 242, 243, 0.7)" : _ref$maskColor,
|
|
56
|
-
onMoveStart = _ref.onMoveStart;
|
|
57
|
-
var containerWidth = (0, _reactFlowRenderer.useStoreState)(function (s) {
|
|
58
|
-
return s.width;
|
|
59
|
-
});
|
|
60
|
-
var containerHeight = (0, _reactFlowRenderer.useStoreState)(function (s) {
|
|
61
|
-
return s.height;
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
var _useStoreState = (0, _reactFlowRenderer.useStoreState)(function (s) {
|
|
65
|
-
return s.transform;
|
|
66
|
-
}),
|
|
67
|
-
_useStoreState2 = _slicedToArray(_useStoreState, 3),
|
|
68
|
-
tX = _useStoreState2[0],
|
|
69
|
-
tY = _useStoreState2[1],
|
|
70
|
-
tScale = _useStoreState2[2];
|
|
71
|
-
|
|
72
|
-
var nodes = (0, _reactFlowRenderer.useStoreState)(function (s) {
|
|
73
|
-
return s.nodes;
|
|
74
|
-
});
|
|
75
|
-
var mapClasses = (0, _classcat["default"])(["react-flow__minimap", className]);
|
|
76
|
-
var elementWidth = style && style.width || defaultWidth;
|
|
77
|
-
var elementHeight = style && style.height || defaultHeight;
|
|
78
|
-
|
|
79
|
-
var nodeColorFunc = function nodeColorFunc() {
|
|
80
|
-
return nodeColor;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
var nodeStrokeColorFunc = function nodeStrokeColorFunc() {
|
|
84
|
-
return nodeStrokeColor;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
var nodeClassNameFunc = function nodeClassNameFunc() {
|
|
88
|
-
return nodeClassName;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
var hasNodes = nodes && nodes.length;
|
|
92
|
-
var bb = (0, _utils.getRectOfNodes)(nodes);
|
|
93
|
-
var viewBB = {
|
|
94
|
-
x: -tX / tScale,
|
|
95
|
-
y: -tY / tScale,
|
|
96
|
-
width: containerWidth / tScale,
|
|
97
|
-
height: containerHeight / tScale
|
|
98
|
-
};
|
|
99
|
-
var boundingRect = hasNodes ? (0, _utils.getBoundsofRects)(bb, viewBB) : viewBB;
|
|
100
|
-
var scaledWidth = boundingRect.width / elementWidth;
|
|
101
|
-
var scaledHeight = boundingRect.height / elementHeight;
|
|
102
|
-
var viewScale = Math.max(scaledWidth, scaledHeight);
|
|
103
|
-
var viewWidth = viewScale * elementWidth;
|
|
104
|
-
var viewHeight = viewScale * elementHeight;
|
|
105
|
-
var offset = 5 * viewScale;
|
|
106
|
-
var x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset;
|
|
107
|
-
var y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset;
|
|
108
|
-
var width = viewWidth + offset * 2;
|
|
109
|
-
var height = viewHeight + offset * 2;
|
|
110
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
111
|
-
onMouseDown: onMoveStart
|
|
112
|
-
}, /*#__PURE__*/_react["default"].createElement("svg", {
|
|
113
|
-
width: elementWidth,
|
|
114
|
-
height: elementHeight,
|
|
115
|
-
viewBox: "".concat(x, " ").concat(y, " ").concat(width, " ").concat(height),
|
|
116
|
-
style: style
|
|
117
|
-
}, nodes.filter(function (node) {
|
|
118
|
-
return !node.isHidden;
|
|
119
|
-
}).map(function (node) {
|
|
120
|
-
return /*#__PURE__*/_react["default"].createElement(_miniNode["default"], {
|
|
121
|
-
key: node.id,
|
|
122
|
-
x: node.__rf.position.x,
|
|
123
|
-
y: node.__rf.position.y,
|
|
124
|
-
width: node.__rf.width,
|
|
125
|
-
height: node.__rf.height,
|
|
126
|
-
style: node.style,
|
|
127
|
-
className: nodeClassNameFunc(node),
|
|
128
|
-
color: nodeColorFunc(node),
|
|
129
|
-
borderRadius: nodeBorderRadius,
|
|
130
|
-
strokeColor: nodeStrokeColorFunc(node),
|
|
131
|
-
strokeWidth: nodeStrokeWidth
|
|
132
|
-
});
|
|
133
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
134
|
-
className: "react-flow__minimap-mask",
|
|
135
|
-
d: "M".concat(x - offset, ",").concat(y - offset, "h").concat(width + offset * 2, "v").concat(height + offset * 2, "h").concat(-width - offset * 2, "zM").concat(viewBB.x, ",").concat(viewBB.y, "h").concat(viewBB.width, "v").concat(viewBB.height, "h").concat(-viewBB.width, "z"),
|
|
136
|
-
fill: maskColor,
|
|
137
|
-
fillRule: "evenodd"
|
|
138
|
-
})));
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
MiniMap.displayName = "MiniMap";
|
|
142
|
-
|
|
143
|
-
var _default = /*#__PURE__*/(0, _react.memo)(MiniMap);
|
|
144
|
-
|
|
145
|
-
exports["default"] = _default;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
var _precls = _interopRequireDefault(require("../precls"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
|
-
function MiniNode(_ref) {
|
|
23
|
-
var x = _ref.x,
|
|
24
|
-
y = _ref.y,
|
|
25
|
-
width = _ref.width,
|
|
26
|
-
height = _ref.height,
|
|
27
|
-
style = _ref.style,
|
|
28
|
-
color = _ref.color,
|
|
29
|
-
strokeColor = _ref.strokeColor,
|
|
30
|
-
strokeWidth = _ref.strokeWidth,
|
|
31
|
-
className = _ref.className,
|
|
32
|
-
borderRadius = _ref.borderRadius;
|
|
33
|
-
|
|
34
|
-
var _ref2 = style || {},
|
|
35
|
-
background = _ref2.background,
|
|
36
|
-
backgroundColor = _ref2.backgroundColor;
|
|
37
|
-
|
|
38
|
-
var fill = color || background || backgroundColor;
|
|
39
|
-
return /*#__PURE__*/_react["default"].createElement("rect", {
|
|
40
|
-
className: (0, _classnames["default"])(["".concat(_precls["default"], "--minimap-node"), className]),
|
|
41
|
-
x: x,
|
|
42
|
-
y: y,
|
|
43
|
-
rx: borderRadius,
|
|
44
|
-
ry: borderRadius,
|
|
45
|
-
width: width,
|
|
46
|
-
height: height,
|
|
47
|
-
fill: fill,
|
|
48
|
-
stroke: strokeColor,
|
|
49
|
-
strokeWidth: strokeWidth
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
MiniNode.displayName = "MiniNode";
|
|
54
|
-
|
|
55
|
-
var _default = /*#__PURE__*/(0, _react.memo)(MiniNode);
|
|
56
|
-
|
|
57
|
-
exports["default"] = _default;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.rectToBox = exports.getRectOfNodes = exports.getBoundsofRects = exports.boxToRect = void 0;
|
|
7
|
-
|
|
8
|
-
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; }
|
|
9
|
-
|
|
10
|
-
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; }
|
|
11
|
-
|
|
12
|
-
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; }
|
|
13
|
-
|
|
14
|
-
var rectToBox = function rectToBox(_ref) {
|
|
15
|
-
var x = _ref.x,
|
|
16
|
-
y = _ref.y,
|
|
17
|
-
width = _ref.width,
|
|
18
|
-
height = _ref.height;
|
|
19
|
-
return {
|
|
20
|
-
x: x,
|
|
21
|
-
y: y,
|
|
22
|
-
x2: x + width,
|
|
23
|
-
y2: y + height
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
exports.rectToBox = rectToBox;
|
|
28
|
-
|
|
29
|
-
var getBoundsOfBoxes = function getBoundsOfBoxes(box1, box2) {
|
|
30
|
-
return {
|
|
31
|
-
x: Math.min(box1.x, box2.x),
|
|
32
|
-
y: Math.min(box1.y, box2.y),
|
|
33
|
-
x2: Math.max(box1.x2, box2.x2),
|
|
34
|
-
y2: Math.max(box1.y2, box2.y2)
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
var boxToRect = function boxToRect(_ref2) {
|
|
39
|
-
var x = _ref2.x,
|
|
40
|
-
y = _ref2.y,
|
|
41
|
-
x2 = _ref2.x2,
|
|
42
|
-
y2 = _ref2.y2;
|
|
43
|
-
return {
|
|
44
|
-
x: x,
|
|
45
|
-
y: y,
|
|
46
|
-
width: x2 - x,
|
|
47
|
-
height: y2 - y
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
exports.boxToRect = boxToRect;
|
|
52
|
-
|
|
53
|
-
var getBoundsofRects = function getBoundsofRects(rect1, rect2) {
|
|
54
|
-
return boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2)));
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
exports.getBoundsofRects = getBoundsofRects;
|
|
58
|
-
|
|
59
|
-
var getRectOfNodes = function getRectOfNodes(nodes) {
|
|
60
|
-
var box = nodes.reduce(function (currBox, _ref3) {
|
|
61
|
-
var _ref3$__rf = _ref3.__rf;
|
|
62
|
-
_ref3$__rf = _ref3$__rf === void 0 ? {} : _ref3$__rf;
|
|
63
|
-
var position = _ref3$__rf.position,
|
|
64
|
-
width = _ref3$__rf.width,
|
|
65
|
-
height = _ref3$__rf.height;
|
|
66
|
-
return getBoundsOfBoxes(currBox, rectToBox(_objectSpread(_objectSpread({}, position), {}, {
|
|
67
|
-
width: width,
|
|
68
|
-
height: height
|
|
69
|
-
})));
|
|
70
|
-
}, {
|
|
71
|
-
x: Infinity,
|
|
72
|
-
y: Infinity,
|
|
73
|
-
x2: -Infinity,
|
|
74
|
-
y2: -Infinity
|
|
75
|
-
});
|
|
76
|
-
return boxToRect(box);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
exports.getRectOfNodes = getRectOfNodes;
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _reactFlowRenderer = _interopRequireWildcard(require("@titaui/react-flow-renderer"));
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _html2canvas = _interopRequireDefault(require("html2canvas"));
|
|
17
|
-
|
|
18
|
-
var _empty = _interopRequireDefault(require("../empty"));
|
|
19
|
-
|
|
20
|
-
var _toast = _interopRequireDefault(require("../../toast"));
|
|
21
|
-
|
|
22
|
-
var _utils = require("../utils");
|
|
23
|
-
|
|
24
|
-
var _context = require("../context");
|
|
25
|
-
|
|
26
|
-
var _drawerManager = _interopRequireDefault(require("../../drawer-manager"));
|
|
27
|
-
|
|
28
|
-
var _miniMap = _interopRequireDefault(require("../mini-map"));
|
|
29
|
-
|
|
30
|
-
require("./index.scss");
|
|
31
|
-
|
|
32
|
-
var _precls = _interopRequireDefault(require("../precls"));
|
|
33
|
-
|
|
34
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
|
-
|
|
36
|
-
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); }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
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
|
-
|
|
42
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
43
|
-
|
|
44
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
45
|
-
|
|
46
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
47
|
-
|
|
48
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
49
|
-
|
|
50
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
51
|
-
|
|
52
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
|
-
|
|
54
|
-
var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
55
|
-
var _props$direction = props.direction,
|
|
56
|
-
direction = _props$direction === void 0 ? "horizontal" : _props$direction,
|
|
57
|
-
_props$darkTheme = props.darkTheme,
|
|
58
|
-
darkTheme = _props$darkTheme === void 0 ? false : _props$darkTheme,
|
|
59
|
-
_props$showkr = props.showkr,
|
|
60
|
-
showkr = _props$showkr === void 0 ? false : _props$showkr,
|
|
61
|
-
_props$onNodeClick = props.onNodeClick,
|
|
62
|
-
onNodeClick = _props$onNodeClick === void 0 ? function () {} : _props$onNodeClick,
|
|
63
|
-
_props$onChildExpand = props.onChildExpand,
|
|
64
|
-
onChildExpand = _props$onChildExpand === void 0 ? function () {} : _props$onChildExpand,
|
|
65
|
-
_props$onParentExpand = props.onParentExpand,
|
|
66
|
-
onParentExpand = _props$onParentExpand === void 0 ? function () {} : _props$onParentExpand,
|
|
67
|
-
_props$onChildClose = props.onChildClose,
|
|
68
|
-
onChildClose = _props$onChildClose === void 0 ? function () {} : _props$onChildClose,
|
|
69
|
-
_props$dataSource = props.dataSource,
|
|
70
|
-
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource;
|
|
71
|
-
|
|
72
|
-
var _useState = (0, _react.useState)([]),
|
|
73
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
74
|
-
elements = _useState2[0],
|
|
75
|
-
setElements = _useState2[1];
|
|
76
|
-
|
|
77
|
-
var _useState3 = (0, _react.useState)(),
|
|
78
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
79
|
-
flowInstance = _useState4[0],
|
|
80
|
-
setFlowInstance = _useState4[1];
|
|
81
|
-
|
|
82
|
-
var isMoving = (0, _react.useRef)(false);
|
|
83
|
-
|
|
84
|
-
var handleEmementClick = function handleEmementClick(_e, element) {
|
|
85
|
-
var _element$data = element.data,
|
|
86
|
-
data = _element$data === void 0 ? {} : _element$data,
|
|
87
|
-
type = element.type;
|
|
88
|
-
if (type == "default" || type == "RootNode") return;
|
|
89
|
-
onNodeClick & onNodeClick(data);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
var layoutedElements = (0, _utils.getLayoutedElements)(dataSource, direction);
|
|
93
|
-
|
|
94
|
-
var getDefaultPos = function getDefaultPos() {
|
|
95
|
-
var containerHeight = document.body.clientHeight - 200 - 96;
|
|
96
|
-
var containerWidth = document.body.clientWidth - 180 - 320;
|
|
97
|
-
var rootNode = layoutedElements[0];
|
|
98
|
-
|
|
99
|
-
if (direction == "horizontal") {
|
|
100
|
-
var targetY = containerHeight / 2;
|
|
101
|
-
return [-160, targetY - rootNode.position.y];
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
var targetX = containerWidth / 2;
|
|
105
|
-
return [targetX - rootNode.position.x, -48];
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
var onLoad = function onLoad(reactFlowInstance) {
|
|
109
|
-
setFlowInstance(reactFlowInstance);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
(0, _react.useEffect)(function () {
|
|
113
|
-
if (flowInstance) {
|
|
114
|
-
var _getDefaultPos = getDefaultPos(),
|
|
115
|
-
_getDefaultPos2 = _slicedToArray(_getDefaultPos, 2),
|
|
116
|
-
x = _getDefaultPos2[0],
|
|
117
|
-
y = _getDefaultPos2[1];
|
|
118
|
-
|
|
119
|
-
flowInstance.setTransform({
|
|
120
|
-
x: x,
|
|
121
|
-
y: y,
|
|
122
|
-
zoom: 1
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}, [direction, flowInstance]);
|
|
126
|
-
|
|
127
|
-
var mapMovingHandler = function mapMovingHandler(e) {
|
|
128
|
-
if (flowInstance) {
|
|
129
|
-
var _flowInstance$toObjec = flowInstance.toObject(),
|
|
130
|
-
_flowInstance$toObjec2 = _slicedToArray(_flowInstance$toObjec.position, 2),
|
|
131
|
-
x = _flowInstance$toObjec2[0],
|
|
132
|
-
y = _flowInstance$toObjec2[1],
|
|
133
|
-
zoom = _flowInstance$toObjec.zoom,
|
|
134
|
-
width = _flowInstance$toObjec.width,
|
|
135
|
-
height = _flowInstance$toObjec.height;
|
|
136
|
-
|
|
137
|
-
var spacePixel = 15;
|
|
138
|
-
var moveX = x - e.movementX * spacePixel;
|
|
139
|
-
var moveY = y - e.movementY * spacePixel;
|
|
140
|
-
|
|
141
|
-
if (isMoving.current) {
|
|
142
|
-
if (moveX > width * 2.5 || moveX < -1 * width * 2.5) return;
|
|
143
|
-
if (moveY > height * 2.5 || moveY < -1 * height * 2.5) return;
|
|
144
|
-
flowInstance.setTransform({
|
|
145
|
-
x: moveX,
|
|
146
|
-
y: moveY,
|
|
147
|
-
zoom: zoom
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
var panelMouseUpHandler = function panelMouseUpHandler() {
|
|
154
|
-
isMoving.current = false; // drawerWrapper.close()
|
|
155
|
-
}; // const closeOkrDrawer = () => {
|
|
156
|
-
// drawerWrapper.close()
|
|
157
|
-
// }
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return /*#__PURE__*/_react["default"].createElement(_context.CommonContext.Provider, {
|
|
161
|
-
value: {
|
|
162
|
-
direction: direction,
|
|
163
|
-
showkr: showkr,
|
|
164
|
-
onNodeClick: onNodeClick,
|
|
165
|
-
onChildExpand: onChildExpand,
|
|
166
|
-
onParentExpand: onParentExpand,
|
|
167
|
-
onChildClose: onChildClose,
|
|
168
|
-
darkTheme: darkTheme
|
|
169
|
-
}
|
|
170
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
171
|
-
className: (0, _classnames["default"])("".concat(_precls["default"]), _defineProperty({}, "".concat(_precls["default"], "__dark"), darkTheme)),
|
|
172
|
-
onMouseMove: mapMovingHandler,
|
|
173
|
-
onMouseUp: panelMouseUpHandler // onClick={closeOkrDrawer}
|
|
174
|
-
|
|
175
|
-
}, /*#__PURE__*/_react["default"].createElement(_reactFlowRenderer.ReactFlowProvider, null, dataSource.length == 0 ? /*#__PURE__*/_react["default"].createElement(_empty["default"], null) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_reactFlowRenderer["default"], {
|
|
176
|
-
onLoad: onLoad,
|
|
177
|
-
elements: layoutedElements,
|
|
178
|
-
nodesDraggable: false,
|
|
179
|
-
nodesConnectable: false,
|
|
180
|
-
nodeTypes: _utils.nodeTypes,
|
|
181
|
-
onElementClick: handleEmementClick,
|
|
182
|
-
minZoom: 0.25,
|
|
183
|
-
maxZoom: 1.5,
|
|
184
|
-
panOnScroll: true
|
|
185
|
-
}), /*#__PURE__*/_react["default"].createElement(_miniMap["default"], {
|
|
186
|
-
onMoveStart: function onMoveStart() {
|
|
187
|
-
return isMoving.current = true;
|
|
188
|
-
}
|
|
189
|
-
})))));
|
|
190
|
-
});
|
|
191
|
-
var _default = OkrMap;
|
|
192
|
-
exports["default"] = _default;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.isWechat = exports.getSource = exports.getOpenId = exports.OpenUserName = exports.OpenDepartmentName = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
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); }
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
|
-
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; }
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
|
-
var WX_SOURCE = 860;
|
|
23
|
-
var WX_UA_STR = "micromessenger";
|
|
24
|
-
|
|
25
|
-
var getGlobal = function getGlobal(key) {
|
|
26
|
-
return window.BSGlobal[key];
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
var getSource = function getSource() {
|
|
30
|
-
return getGlobal("tenantInfo").Source;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
exports.getSource = getSource;
|
|
34
|
-
|
|
35
|
-
var isWechat = function isWechat() {
|
|
36
|
-
return getSource() == 860;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
exports.isWechat = isWechat;
|
|
40
|
-
|
|
41
|
-
var getUA = function getUA() {
|
|
42
|
-
return navigator.userAgent.toLowerCase();
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var getOpenId = function getOpenId(id, type) {
|
|
46
|
-
var openIds;
|
|
47
|
-
|
|
48
|
-
if (type == "userName") {
|
|
49
|
-
openIds = getGlobal("openIds");
|
|
50
|
-
} else if (type == "departmentName") {
|
|
51
|
-
openIds = getGlobal("openDepartmentIds");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return openIds && openIds[id];
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
exports.getOpenId = getOpenId;
|
|
58
|
-
|
|
59
|
-
function openData(p) {
|
|
60
|
-
if (getSource() == WX_SOURCE || getUA().includes(WX_UA_STR)) {
|
|
61
|
-
return function (p) {
|
|
62
|
-
if (p.id === undefined) return p.name || null;
|
|
63
|
-
var openId = getOpenId(p.id, p.type);
|
|
64
|
-
if (!openId) return p.name || p.id || null;
|
|
65
|
-
var ref = (0, _react.useRef)(null);
|
|
66
|
-
(0, _react.useEffect)(function () {
|
|
67
|
-
window.WWOpenData && window.WWOpenData.bind(ref.current);
|
|
68
|
-
});
|
|
69
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
70
|
-
style: {
|
|
71
|
-
display: "inline-block",
|
|
72
|
-
position: "relative",
|
|
73
|
-
overflow: "hidden",
|
|
74
|
-
textOverflow: "ellipsis",
|
|
75
|
-
verticalAlign: "middle"
|
|
76
|
-
}
|
|
77
|
-
}, /*#__PURE__*/_react["default"].createElement("ww-open-data", {
|
|
78
|
-
ref: ref,
|
|
79
|
-
type: p.type,
|
|
80
|
-
openid: openId
|
|
81
|
-
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
82
|
-
style: {
|
|
83
|
-
position: "absolute",
|
|
84
|
-
top: 0,
|
|
85
|
-
left: 0,
|
|
86
|
-
right: 0,
|
|
87
|
-
bottom: 0,
|
|
88
|
-
zIndex: 1
|
|
89
|
-
}
|
|
90
|
-
}));
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return function (p) {
|
|
95
|
-
return p.name || p.id || null;
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
var getOpenData = openData();
|
|
100
|
-
|
|
101
|
-
var OpenUserName = function OpenUserName(p) {
|
|
102
|
-
return getOpenData(_objectSpread(_objectSpread({}, p), {}, {
|
|
103
|
-
type: "userName"
|
|
104
|
-
}));
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
exports.OpenUserName = OpenUserName;
|
|
108
|
-
|
|
109
|
-
var OpenDepartmentName = function OpenDepartmentName(p) {
|
|
110
|
-
return getOpenData(_objectSpread(_objectSpread({}, p), {}, {
|
|
111
|
-
type: "departmentName"
|
|
112
|
-
}));
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
exports.OpenDepartmentName = OpenDepartmentName;
|