@crystaldesign/diva-navigator 26.6.0 → 26.7.0-beta.10
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/build/esm/index.js +1317 -445
- package/build/types/navigator/src/DropdownContainer/index.d.ts +12 -0
- package/build/types/navigator/src/DropdownContainer/index.d.ts.map +1 -0
- package/build/types/navigator/src/Header/Notifications/Dropdown.d.ts +1 -6
- package/build/types/navigator/src/Header/Notifications/Dropdown.d.ts.map +1 -1
- package/build/types/navigator/src/Header/Notifications/PopupContent.d.ts.map +1 -1
- package/build/types/navigator/src/Header/Notifications/api.d.ts +3 -3
- package/build/types/navigator/src/Header/Notifications/api.d.ts.map +1 -1
- package/build/types/navigator/src/Header/Notifications/index.d.ts +3 -4
- package/build/types/navigator/src/Header/Notifications/index.d.ts.map +1 -1
- package/build/types/navigator/src/Header/Notifications/stateUtils.d.ts +4 -1
- package/build/types/navigator/src/Header/Notifications/stateUtils.d.ts.map +1 -1
- package/build/types/navigator/src/Header/Notifications/types.d.ts +2 -4
- package/build/types/navigator/src/Header/Notifications/types.d.ts.map +1 -1
- package/build/types/navigator/src/Header/Notifications/useNotifications.d.ts +1 -10
- package/build/types/navigator/src/Header/Notifications/useNotifications.d.ts.map +1 -1
- package/build/types/navigator/src/Header/OrganizationName/index.d.ts +1 -1
- package/build/types/navigator/src/Header/OrganizationName/index.d.ts.map +1 -1
- package/build/types/navigator/src/Header/ProfileImg/index.d.ts +1 -1
- package/build/types/navigator/src/Header/ProfileImg/index.d.ts.map +1 -1
- package/build/types/navigator/src/Header/index.d.ts.map +1 -1
- package/build/types/navigator/src/OrganizationSelection/SearchField/index.d.ts +8 -0
- package/build/types/navigator/src/OrganizationSelection/SearchField/index.d.ts.map +1 -0
- package/build/types/navigator/src/OrganizationSelection/TextElement.d.ts +8 -0
- package/build/types/navigator/src/OrganizationSelection/TextElement.d.ts.map +1 -0
- package/build/types/navigator/src/OrganizationSelection/index.d.ts +38 -0
- package/build/types/navigator/src/OrganizationSelection/index.d.ts.map +1 -0
- package/build/types/navigator/src/OrganizationSelection/useCurrentSelected.d.ts +6 -0
- package/build/types/navigator/src/OrganizationSelection/useCurrentSelected.d.ts.map +1 -0
- package/build/types/navigator/src/OrganizationSelector/index.d.ts.map +1 -1
- package/build/types/navigator/src/Profil/index.d.ts +1 -3
- package/build/types/navigator/src/Profil/index.d.ts.map +1 -1
- package/build/types/navigator/src/index.d.ts +3 -0
- package/build/types/navigator/src/index.d.ts.map +1 -1
- package/package.json +2 -4
- package/build/types/navigator/src/HeaderDropdownPopper/index.d.ts +0 -15
- package/build/types/navigator/src/HeaderDropdownPopper/index.d.ts.map +0 -1
- package/build/types/navigator/src/tests/unit/Header/Notifications/PopupContent.test.d.ts +0 -2
- package/build/types/navigator/src/tests/unit/Header/Notifications/PopupContent.test.d.ts.map +0 -1
package/build/esm/index.js
CHANGED
|
@@ -5,8 +5,6 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { useTranslation, useDivaCore, DivaUtils, getLogger } from '@crystaldesign/diva-core';
|
|
6
6
|
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
7
7
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
8
|
-
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
9
|
-
import Popper from '@mui/material/Popper';
|
|
10
8
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
11
9
|
import Fuse from 'fuse.js';
|
|
12
10
|
import Switch from 'react-switch';
|
|
@@ -24,11 +22,12 @@ import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstruct
|
|
|
24
22
|
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
25
23
|
import _inherits from '@babel/runtime/helpers/inherits';
|
|
26
24
|
import _wrapNativeSuper from '@babel/runtime/helpers/wrapNativeSuper';
|
|
27
|
-
import { ContentItemComponent } from '@crystaldesign/content-item';
|
|
28
25
|
import SearchIcon from '@mui/icons-material/Search';
|
|
29
26
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
30
27
|
import { Html5Qrcode } from 'html5-qrcode';
|
|
31
28
|
import Snowfall from 'react-snowfall';
|
|
29
|
+
import debounce from 'lodash/debounce';
|
|
30
|
+
import { useHover, useLayer, Arrow } from 'react-laag';
|
|
32
31
|
|
|
33
32
|
(function() {
|
|
34
33
|
const env = {"STAGE":"production"};
|
|
@@ -75,9 +74,8 @@ var headerWrapperRight = "header-wrapper-right-zLaAR";
|
|
|
75
74
|
var hide = "hide-1DmsJ";
|
|
76
75
|
var breadcrumbsWrapper = "breadcrumbs-wrapper-nqYkU";
|
|
77
76
|
var customArea = "custom-area-FLAOC";
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
styleInject(css_248z$p);
|
|
77
|
+
var css_248z$r = ".header-bLyVg {\n background-color: white;\n color: #333333;\n height: -moz-fit-content;\n height: fit-content;\n width: 100%;\n position: relative;\n box-shadow: 0px 1px 4px 0px rgba(51, 51, 51, 1);\n font-family: var(--diva-typography-font-family);\n transition: height ease-in-out 1s;\n z-index: 2;\n display: flex;\n flex-direction: column;\n}\n\n.header-wrapper-BPUbF {\n width: 100%;\n height: 60px;\n position: relative;\n display: flex;\n justify-content: flex-start;\n z-index: 1;\n}\n\n.header-wrapper-left-qxYUn {\n display: flex;\n z-index: 1;\n}\n\n.header-wrapper-right-zLaAR {\n display: flex;\n flex: 1 1 250px;\n max-width: -moz-max-content;\n max-width: max-content;\n justify-content: flex-end;\n height: 100%;\n align-items: center;\n overflow: visible;\n right: 0;\n background-color: #fff;\n z-index: 10;\n margin-left: auto;\n flex-basis: fit-content;\n}\n\n.darkmode .header-wrapper-right-zLaAR {\n background-color: transparent;\n background-color: initial;\n}\n\n.hide-1DmsJ {\n height: 0;\n transition: height ease-in-out 1s;\n}\n\n.breadcrumbs-wrapper-nqYkU {\n width: 100%;\n height: 30px;\n position: relative;\n border-top: 1px solid #f2f2f2;\n}\n\n.selected-z3Uht {\n transform: scale(1.1);\n color: var(--diva-theme-palette-primary-main);\n}\n.custom-area-FLAOC {\n margin: 8px;\n height: 46px;\n overflow: auto;\n}\n";
|
|
78
|
+
styleInject(css_248z$r);
|
|
81
79
|
|
|
82
80
|
var scroller = "scroller-QE6K3";
|
|
83
81
|
var buttonsWrapper$1 = "buttons-wrapper-dzIfw";
|
|
@@ -85,14 +83,14 @@ var scrollButton = "scroll-button-xk93p";
|
|
|
85
83
|
var hidden$1 = "hidden-3Ovst";
|
|
86
84
|
var left = "left-9-Upj";
|
|
87
85
|
var right = "right-D4x14";
|
|
88
|
-
var css_248z$
|
|
89
|
-
styleInject(css_248z$
|
|
86
|
+
var css_248z$q = ".scroller-QE6K3 {\n overflow: auto;\n display: flex;\n align-items: center;\n position: relative;\n flex-shrink: 100;\n}\n\n.buttons-wrapper-dzIfw {\n display: flex;\n height: 100%;\n position: relative;\n overflow: auto;\n\n /* Hide scrollbar for IE, Edge and Firefox */\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n}\n/* Hide scrollbar for Chrome, Safari and Opera */\n.buttons-wrapper-dzIfw::-webkit-scrollbar {\n display: none;\n}\n\n.scroll-button-xk93p {\n width: 30px;\n height: 40px;\n z-index: 6;\n background-size: 100%;\n background-position: right;\n background-image: url(\"data:image/svg+xml,%3Csvg width%3D%2225%22 height%3D%2224%22 viewBox%3D%220 0 25 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M10.5 7L15.5 12L10.5 17%22 stroke%3D%22%234F4F4F%22 stroke-width%3D%221.5%22 stroke-linecap%3D%22round%22 stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\"),\n linear-gradient(270deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 1) 72%, rgba(255, 255, 255, 0) 100%);\n background-repeat: no-repeat;\n cursor: pointer;\n opacity: 1;\n transition: ease 0.2s;\n}\n\n.scroll-button-xk93p.hidden-3Ovst {\n opacity: 0;\n z-index: 0;\n}\n\n.scroll-button-xk93p.left-9-Upj {\n position: absolute;\n left: 0;\n transform: rotate(180deg);\n}\n.scroll-button-xk93p.right-D4x14 {\n position: absolute;\n right: 0;\n}\n";
|
|
87
|
+
styleInject(css_248z$q);
|
|
90
88
|
|
|
91
89
|
var button$2 = "button-UoHey";
|
|
92
|
-
var selected$
|
|
90
|
+
var selected$4 = "selected-VKkY8";
|
|
93
91
|
var link$2 = "link-mn-o6";
|
|
94
|
-
var css_248z$
|
|
95
|
-
styleInject(css_248z$
|
|
92
|
+
var css_248z$p = ".button-UoHey {\n position: relative;\n cursor: pointer;\n padding: 20px 16px;\n text-transform: uppercase;\n font-weight: 700;\n font-size: 14px;\n line-height: 20px;\n transition: color 0.3s ease, border 0.3s ease;\n letter-spacing: 0.1rem;\n text-wrap: nowrap;\n white-space: nowrap;\n}\n\n.button-UoHey:hover,\n.selected-VKkY8 {\n border: none;\n color: var(--diva-theme-palette-primary-main);\n}\n\n.link-mn-o6 {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 1;\n}\n\n.button-UoHey::after {\n content: '';\n position: absolute;\n width: 0px;\n height: 2px;\n left: 50%;\n bottom: 0;\n background-color: var(--diva-theme-palette-primary-main);\n transition: all ease-in-out 0.2s;\n}\n.button-UoHey:hover::after,\n.selected-VKkY8::after {\n width: 100%;\n left: 0;\n}\n";
|
|
93
|
+
styleInject(css_248z$p);
|
|
96
94
|
|
|
97
95
|
var Button = function Button(_ref) {
|
|
98
96
|
var b = _ref.b,
|
|
@@ -123,7 +121,7 @@ var Button = function Button(_ref) {
|
|
|
123
121
|
return type === buttonActionType || type === 'DIVA_WEBPLANNER' && buttonActionType === 'SELLER'; // exception for webplanner
|
|
124
122
|
};
|
|
125
123
|
return /*#__PURE__*/jsxs("div", {
|
|
126
|
-
className: classNames(button$2, isSelected() ? selected$
|
|
124
|
+
className: classNames(button$2, isSelected() ? selected$4 : undefined),
|
|
127
125
|
ref: ref,
|
|
128
126
|
"data-test-id": b.text,
|
|
129
127
|
children: [t(b.text, b.text), /*#__PURE__*/jsx("a", {
|
|
@@ -237,10 +235,10 @@ function Buttons () {
|
|
|
237
235
|
var buttonsWrapper = "buttons-wrapper-ypwVh";
|
|
238
236
|
var breadcrumb = "breadcrumb-03kGg";
|
|
239
237
|
var splitter = "splitter-blALw";
|
|
240
|
-
var selected$
|
|
238
|
+
var selected$3 = "selected-M8GAh";
|
|
241
239
|
var greetingsTextClass = "greetings-text-class-74-so";
|
|
242
|
-
var css_248z$
|
|
243
|
-
styleInject(css_248z$
|
|
240
|
+
var css_248z$o = ".buttons-wrapper-ypwVh {\n display: flex;\n align-items: center;\n height: 100%;\n gap: 6px;\n margin-left: 24px;\n color: #4f4f4f;\n}\n.breadcrumb-03kGg {\n cursor: pointer;\n font-size: small;\n}\n\n.splitter-blALw:first-of-type {\n display: none;\n}\n\n.splitter-blALw {\n display: inline-block;\n width: 20px;\n height: 20px;\n background: center / 80% no-repeat url(\"data:image/svg+xml,%3Csvg width%3D%2212%22 height%3D%2212%22 viewBox%3D%220 0 12 12%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M5 3.5L7.5 6L5 8.5%22 stroke%3D%22%237B7B7B%22 stroke-linecap%3D%22round%22 stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\");\n}\n\n.breadcrumb-03kGg:hover {\n transform: scale(1.1);\n color: var(--diva-theme-palette-primary-main);\n text-decoration: underline;\n transition: all 200ms;\n}\n\n.breadcrumb-03kGg.selected-M8GAh {\n color: var(--diva-theme-palette-primary-main);\n text-decoration: underline;\n}\n\n.greetings-text-class-74-so {\n position: absolute;\n right: 16px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n letter-spacing: 1px;\n font-size: 16px;\n}\n";
|
|
241
|
+
styleInject(css_248z$o);
|
|
244
242
|
|
|
245
243
|
function Breadcrumbs () {
|
|
246
244
|
var _useDivaCore = useDivaCore(),
|
|
@@ -263,7 +261,7 @@ function Breadcrumbs () {
|
|
|
263
261
|
children: [/*#__PURE__*/jsx("div", {
|
|
264
262
|
className: splitter
|
|
265
263
|
}), /*#__PURE__*/jsx("div", {
|
|
266
|
-
className: classNames(breadcrumb, breadcrumbs.current == b.level ? selected$
|
|
264
|
+
className: classNames(breadcrumb, breadcrumbs.current == b.level ? selected$3 : undefined),
|
|
267
265
|
onClick: function onClick() {
|
|
268
266
|
return openComponent(b.component);
|
|
269
267
|
},
|
|
@@ -279,84 +277,55 @@ function Breadcrumbs () {
|
|
|
279
277
|
|
|
280
278
|
var selector = "selector-zu-gI";
|
|
281
279
|
var section = "section--hy0j";
|
|
282
|
-
var selected$
|
|
283
|
-
var item = "item-6aqaG";
|
|
280
|
+
var selected$2 = "selected-KQjvM";
|
|
281
|
+
var item$1 = "item-6aqaG";
|
|
284
282
|
var expanderClosed = "expander-closed-Wnhtx";
|
|
285
283
|
var expanderOpen = "expander-open-py2FE";
|
|
286
284
|
var open$1 = "open--KKW8";
|
|
287
285
|
var languageClosed = "language-closed-2KjG0";
|
|
288
|
-
var css_248z$
|
|
289
|
-
styleInject(css_248z$
|
|
286
|
+
var css_248z$n = ".selector-zu-gI {\n display: flex;\n flex-direction: column;\n transition: max-height ease-in-out 0.3s;\n line-height: 30px;\n overflow: hidden;\n}\n\n.selector-zu-gI .MuiFormControl-root {\n margin-left: 25px;\n margin-top: 0;\n width: 223px;\n}\n\n.selector-zu-gI .MuiInputBase-root {\n font-size: small;\n margin-top: 0;\n}\n\n.section--hy0j {\n padding: 14px 22px;\n border-bottom: solid white 1px;\n}\n\n.selected-KQjvM {\n font-weight: 300;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 30px;\n flex-shrink: 0;\n}\n.selected-KQjvM::before {\n width: 12px !important;\n}\n.selected-KQjvM::before {\n content: '';\n background: url(\"data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22iso-8859-1%22%3F%3E%3C!-- Generator%3A Adobe Illustrator 19.0.0%2C SVG Export Plug-In . SVG Version%3A 6.00 Build 0) --%3E%3Csvg version%3D%221.1%22 id%3D%22Capa_1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 x%3D%220px%22 y%3D%220px%22%09 viewBox%3D%220 0 426.667 426.667%22 style%3D%22enable-background%3Anew 0 0 426.667 426.667%3B%22 xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%09%3Cg%3E%09%09%3Cpath d%3D%22M421.876%2C56.307c-6.548-6.78-17.352-6.968-24.132-0.42c-0.142%2C0.137-0.282%2C0.277-0.42%2C0.42L119.257%2C334.375%09%09%09l-90.334-90.334c-6.78-6.548-17.584-6.36-24.132%2C0.42c-6.388%2C6.614-6.388%2C17.099%2C0%2C23.713l102.4%2C102.4%09%09%09c6.665%2C6.663%2C17.468%2C6.663%2C24.132%2C0L421.456%2C80.44C428.236%2C73.891%2C428.424%2C63.087%2C421.876%2C56.307z%22%2F%3E%09%3C%2Fg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E\") no-repeat center;\n display: block;\n height: 12px;\n margin: 8px 6px 0 6px;\n float: left;\n}\n\n.item-6aqaG::before {\n content: '';\n display: block;\n width: 26px;\n height: 12px;\n float: left;\n}\n\n.expander-closed-Wnhtx::after {\n background: url(\"data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22iso-8859-1%22%3F%3E%3C!-- Generator%3A Adobe Illustrator 19.0.0%2C SVG Export Plug-In . SVG Version%3A 6.00 Build 0) --%3E%3Csvg version%3D%221.1%22 id%3D%22Capa_1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 x%3D%220px%22 y%3D%220px%22%09 viewBox%3D%220 0 490.688 490.688%22 style%3D%22enable-background%3Anew 0 0 490.688 490.688%3B%22 xml%3Aspace%3D%22preserve%22%3E%3Cpath style%3D%22fill%3A%23FFC107%3B%22 d%3D%22M472.328%2C120.529L245.213%2C347.665L18.098%2C120.529c-4.237-4.093-10.99-3.975-15.083%2C0.262%09c-3.992%2C4.134-3.992%2C10.687%2C0%2C14.82l234.667%2C234.667c4.165%2C4.164%2C10.917%2C4.164%2C15.083%2C0l234.667-234.667%09c4.237-4.093%2C4.354-10.845%2C0.262-15.083c-4.093-4.237-10.845-4.354-15.083-0.262c-0.089%2C0.086-0.176%2C0.173-0.262%2C0.262%09L472.328%2C120.529z%22%2F%3E%3Cpath d%3D%22M245.213%2C373.415c-2.831%2C0.005-5.548-1.115-7.552-3.115L2.994%2C135.633c-4.093-4.237-3.975-10.99%2C0.262-15.083%09c4.134-3.992%2C10.687-3.992%2C14.82%2C0l227.136%2C227.115l227.115-227.136c4.093-4.237%2C10.845-4.354%2C15.083-0.262%09c4.237%2C4.093%2C4.354%2C10.845%2C0.262%2C15.083c-0.086%2C0.089-0.173%2C0.176-0.262%2C0.262L252.744%2C370.279%09C250.748%2C372.281%2C248.039%2C373.408%2C245.213%2C373.415z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E\") no-repeat center;\n content: '';\n display: block;\n width: 10px;\n height: 10px;\n float: right;\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n}\n.expander-open-py2FE::after {\n background: url(\"data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22iso-8859-1%22%3F%3E%3C!-- Generator%3A Adobe Illustrator 19.0.0%2C SVG Export Plug-In . SVG Version%3A 6.00 Build 0) --%3E%3Csvg version%3D%221.1%22 id%3D%22Capa_1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 x%3D%220px%22 y%3D%220px%22%09 viewBox%3D%220 0 490.523 490.523%22 style%3D%22enable-background%3Anew 0 0 490.523 490.523%3B%22 xml%3Aspace%3D%22preserve%22%3E%3Cpath style%3D%22fill%3A%23FFC107%3B%22 d%3D%22M487.411%2C355.047L252.744%2C120.38c-4.165-4.164-10.917-4.164-15.083%2C0L2.994%2C355.047%09c-4.093%2C4.237-3.976%2C10.99%2C0.262%2C15.083c4.134%2C3.993%2C10.687%2C3.993%2C14.821%2C0l227.115-227.115l227.115%2C227.136%09c4.237%2C4.093%2C10.99%2C3.976%2C15.083-0.261c3.993-4.134%2C3.993-10.688%2C0-14.821L487.411%2C355.047z%22%2F%3E%3Cpath d%3D%22M479.859%2C373.266c-2.831%2C0.005-5.548-1.115-7.552-3.115L245.192%2C143.015L18.077%2C370.151%09c-4.237%2C4.093-10.99%2C3.976-15.083-0.262c-3.993-4.134-3.993-10.687%2C0-14.821l234.667-234.667c4.165-4.164%2C10.917-4.164%2C15.083%2C0%09l234.667%2C234.667c4.159%2C4.172%2C4.148%2C10.926-0.024%2C15.085C485.388%2C372.146%2C482.681%2C373.265%2C479.859%2C373.266z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E\") no-repeat center;\n content: '';\n display: block;\n width: 10px;\n height: 10px;\n float: right;\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n}\n\n@keyframes hide-scroll-2yXs9 {\n from,\n to {\n overflow: hidden;\n }\n}\n\n.list--32wO {\n flex: 1;\n overflow: hidden;\n scrollbar-width: thin;\n}\n\n.list--32wO::-webkit-scrollbar {\n width: 5px;\n}\n.list--32wO::-webkit-scrollbar-track {\n background: #dfdfdf;\n border-radius: 3px;\n}\n.list--32wO::-webkit-scrollbar-thumb {\n background: #b1b1b1;\n border-radius: 3px;\n}\n\n.open--KKW8 .list--32wO {\n overflow: auto;\n}\n\n.language-closed-2KjG0 {\n transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);\n max-height: 0;\n}\n\n.searchDiv-PFCFg:hover + .hide-ad3Ar {\n display: block;\n}\n\n.hide-ad3Ar {\n display: none;\n}\n";
|
|
287
|
+
styleInject(css_248z$n);
|
|
290
288
|
|
|
291
|
-
var
|
|
292
|
-
var
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
styleInject(css_248z$k);
|
|
289
|
+
var dropdown$1 = "dropdown-NjdqX";
|
|
290
|
+
var open = "open-NBiGR";
|
|
291
|
+
var css_248z$m = ".dropdown-NjdqX {\n background-color: #f2f2f2;\n color: #333333;\n width: 400px;\n position: absolute;\n box-shadow: 0px 2px 6px 0px rgba(51, 51, 51, 0.4);\n right: 2px;\n font-size: small;\n font-family: var(--diva-typography-font-family);\n transition: max-height 0.25s ease-in-out;\n max-height: 0px;\n z-index: 20;\n overflow: hidden;\n scrollbar-width: none;\n}\n\n.dropdown-NjdqX::-webkit-scrollbar {\n display: none;\n}\n\n.open-NBiGR {\n overflow: auto;\n}\n";
|
|
292
|
+
styleInject(css_248z$m);
|
|
296
293
|
|
|
297
|
-
function ownKeys$
|
|
298
|
-
function _objectSpread$
|
|
299
|
-
function
|
|
294
|
+
function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
295
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
296
|
+
function DropdownContainer(_ref) {
|
|
300
297
|
var open$1 = _ref.open,
|
|
301
|
-
anchorEl = _ref.anchorEl,
|
|
302
|
-
onClose = _ref.onClose,
|
|
303
298
|
maxHeight = _ref.maxHeight,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
id = _ref.id,
|
|
299
|
+
top = _ref.top,
|
|
300
|
+
right = _ref.right,
|
|
307
301
|
className = _ref.className,
|
|
308
302
|
style = _ref.style,
|
|
309
303
|
children = _ref.children;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
anchorEl: anchorEl,
|
|
321
|
-
placement: placement,
|
|
322
|
-
modifiers: [{
|
|
323
|
-
name: 'offset',
|
|
324
|
-
options: {
|
|
325
|
-
offset: [0, 4]
|
|
326
|
-
}
|
|
327
|
-
}, {
|
|
328
|
-
name: 'preventOverflow',
|
|
329
|
-
options: {
|
|
330
|
-
padding: 8
|
|
331
|
-
}
|
|
332
|
-
}],
|
|
333
|
-
children: /*#__PURE__*/jsx(ClickAwayListener, {
|
|
334
|
-
onClickAway: handleClickAway,
|
|
335
|
-
children: /*#__PURE__*/jsx("div", {
|
|
336
|
-
children: /*#__PURE__*/jsx("div", {
|
|
337
|
-
className: classNames(panel, open$1 && open, className),
|
|
338
|
-
style: _objectSpread$5({
|
|
339
|
-
maxHeight: open$1 ? maxHeight : 0
|
|
340
|
-
}, style),
|
|
341
|
-
children: children
|
|
342
|
-
})
|
|
343
|
-
})
|
|
344
|
-
})
|
|
304
|
+
return /*#__PURE__*/jsx("div", {
|
|
305
|
+
className: classNames(dropdown$1, open$1 && open, className),
|
|
306
|
+
style: _objectSpread$7(_objectSpread$7(_objectSpread$7({}, top !== undefined && {
|
|
307
|
+
top: top
|
|
308
|
+
}), right !== undefined && {
|
|
309
|
+
right: right
|
|
310
|
+
}), {}, {
|
|
311
|
+
maxHeight: open$1 ? maxHeight : 0
|
|
312
|
+
}, style),
|
|
313
|
+
children: children
|
|
345
314
|
});
|
|
346
315
|
}
|
|
347
316
|
|
|
348
|
-
function ownKeys$
|
|
349
|
-
function _objectSpread$
|
|
350
|
-
function _createForOfIteratorHelper$
|
|
351
|
-
function _unsupportedIterableToArray$
|
|
352
|
-
function _arrayLikeToArray$
|
|
317
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
318
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
319
|
+
function _createForOfIteratorHelper$4(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
320
|
+
function _unsupportedIterableToArray$4(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$4(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0; } }
|
|
321
|
+
function _arrayLikeToArray$4(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
353
322
|
/**
|
|
354
323
|
* Returns path of node ids from root to target (inclusive), or null if not found.
|
|
355
324
|
* Use `new Set(result)` for membership checks, or `result.slice(0, -1)` for ancestors only.
|
|
356
325
|
*/
|
|
357
326
|
function findPathToNode(nodes, targetId) {
|
|
358
327
|
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
359
|
-
var _iterator = _createForOfIteratorHelper$
|
|
328
|
+
var _iterator = _createForOfIteratorHelper$4(nodes),
|
|
360
329
|
_step;
|
|
361
330
|
try {
|
|
362
331
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -375,7 +344,7 @@ function findPathToNode(nodes, targetId) {
|
|
|
375
344
|
return null;
|
|
376
345
|
}
|
|
377
346
|
function findNodeInTree(nodes, targetId) {
|
|
378
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
347
|
+
var _iterator2 = _createForOfIteratorHelper$4(nodes),
|
|
379
348
|
_step2;
|
|
380
349
|
try {
|
|
381
350
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -396,7 +365,7 @@ function findNodeInTree(nodes, targetId) {
|
|
|
396
365
|
function flattenDisplayOrder(nodes, expandedIds) {
|
|
397
366
|
var ids = [];
|
|
398
367
|
var _walk = function walk(list) {
|
|
399
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
368
|
+
var _iterator3 = _createForOfIteratorHelper$4(list),
|
|
400
369
|
_step3;
|
|
401
370
|
try {
|
|
402
371
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -423,7 +392,7 @@ function flattenDisplayOrder(nodes, expandedIds) {
|
|
|
423
392
|
*/
|
|
424
393
|
function computeEffectiveScores(nodes, scoreMap) {
|
|
425
394
|
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Map();
|
|
426
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
395
|
+
var _iterator4 = _createForOfIteratorHelper$4(nodes),
|
|
427
396
|
_step4;
|
|
428
397
|
try {
|
|
429
398
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -432,7 +401,7 @@ function computeEffectiveScores(nodes, scoreMap) {
|
|
|
432
401
|
var best = (_scoreMap$get = scoreMap.get(node._id)) !== null && _scoreMap$get !== void 0 ? _scoreMap$get : Infinity;
|
|
433
402
|
if (node.children) {
|
|
434
403
|
computeEffectiveScores(node.children, scoreMap, result);
|
|
435
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
404
|
+
var _iterator5 = _createForOfIteratorHelper$4(node.children),
|
|
436
405
|
_step5;
|
|
437
406
|
try {
|
|
438
407
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -469,7 +438,7 @@ function sortTree(nodes, selectedPath, effectiveScores) {
|
|
|
469
438
|
return 0;
|
|
470
439
|
});
|
|
471
440
|
return sorted.map(function (node) {
|
|
472
|
-
return node.children ? _objectSpread$
|
|
441
|
+
return node.children ? _objectSpread$6(_objectSpread$6({}, node), {}, {
|
|
473
442
|
children: sortTree(node.children, selectedPath, effectiveScores)
|
|
474
443
|
}) : node;
|
|
475
444
|
});
|
|
@@ -477,7 +446,7 @@ function sortTree(nodes, selectedPath, effectiveScores) {
|
|
|
477
446
|
function collectTypes(nodes) {
|
|
478
447
|
var types = new Set();
|
|
479
448
|
var _walk2 = function walk(list) {
|
|
480
|
-
var _iterator6 = _createForOfIteratorHelper$
|
|
449
|
+
var _iterator6 = _createForOfIteratorHelper$4(list),
|
|
481
450
|
_step6;
|
|
482
451
|
try {
|
|
483
452
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -495,11 +464,11 @@ function collectTypes(nodes) {
|
|
|
495
464
|
return Array.from(types);
|
|
496
465
|
}
|
|
497
466
|
|
|
498
|
-
function ownKeys$
|
|
499
|
-
function _objectSpread$
|
|
500
|
-
function _createForOfIteratorHelper$
|
|
501
|
-
function _unsupportedIterableToArray$
|
|
502
|
-
function _arrayLikeToArray$
|
|
467
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
468
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
469
|
+
function _createForOfIteratorHelper$3(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$3(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
470
|
+
function _unsupportedIterableToArray$3(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$3(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; } }
|
|
471
|
+
function _arrayLikeToArray$3(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
503
472
|
function treeReducer(state, action) {
|
|
504
473
|
switch (action.type) {
|
|
505
474
|
case 'SET_TREE':
|
|
@@ -509,7 +478,7 @@ function treeReducer(state, action) {
|
|
|
509
478
|
var path = findPathToNode(action.tree, action.selectedId);
|
|
510
479
|
if (path) {
|
|
511
480
|
var ancestors = path.slice(0, -1);
|
|
512
|
-
var _iterator = _createForOfIteratorHelper$
|
|
481
|
+
var _iterator = _createForOfIteratorHelper$3(ancestors),
|
|
513
482
|
_step;
|
|
514
483
|
try {
|
|
515
484
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -523,7 +492,7 @@ function treeReducer(state, action) {
|
|
|
523
492
|
}
|
|
524
493
|
}
|
|
525
494
|
}
|
|
526
|
-
return _objectSpread$
|
|
495
|
+
return _objectSpread$5(_objectSpread$5({}, state), {}, {
|
|
527
496
|
tree: action.tree,
|
|
528
497
|
totalAccessible: action.totalAccessible,
|
|
529
498
|
selectedId: action.selectedId,
|
|
@@ -535,7 +504,7 @@ function treeReducer(state, action) {
|
|
|
535
504
|
case 'SET_EXPANDED':
|
|
536
505
|
{
|
|
537
506
|
var next = new Set(state.expandedIds);
|
|
538
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
507
|
+
var _iterator2 = _createForOfIteratorHelper$3(action.nodeIds),
|
|
539
508
|
_step2;
|
|
540
509
|
try {
|
|
541
510
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -547,12 +516,12 @@ function treeReducer(state, action) {
|
|
|
547
516
|
} finally {
|
|
548
517
|
_iterator2.f();
|
|
549
518
|
}
|
|
550
|
-
return _objectSpread$
|
|
519
|
+
return _objectSpread$5(_objectSpread$5({}, state), {}, {
|
|
551
520
|
expandedIds: next
|
|
552
521
|
});
|
|
553
522
|
}
|
|
554
523
|
case 'SELECT':
|
|
555
|
-
return _objectSpread$
|
|
524
|
+
return _objectSpread$5(_objectSpread$5({}, state), {}, {
|
|
556
525
|
selectedId: action.nodeId
|
|
557
526
|
});
|
|
558
527
|
default:
|
|
@@ -632,15 +601,15 @@ function useOrgTree(onSelect) {
|
|
|
632
601
|
};
|
|
633
602
|
}
|
|
634
603
|
|
|
635
|
-
function ownKeys$
|
|
636
|
-
function _objectSpread$
|
|
637
|
-
function _createForOfIteratorHelper$
|
|
638
|
-
function _unsupportedIterableToArray$
|
|
639
|
-
function _arrayLikeToArray$
|
|
604
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
605
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
606
|
+
function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
607
|
+
function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; } }
|
|
608
|
+
function _arrayLikeToArray$2(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
640
609
|
function flattenTree(nodes) {
|
|
641
610
|
var ancestors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
642
611
|
var result = [];
|
|
643
|
-
var _iterator = _createForOfIteratorHelper$
|
|
612
|
+
var _iterator = _createForOfIteratorHelper$2(nodes),
|
|
644
613
|
_step;
|
|
645
614
|
try {
|
|
646
615
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -672,7 +641,7 @@ function annotateSubtree(nodes, matchedIds, matchIndicesMap) {
|
|
|
672
641
|
return nodes.map(function (node) {
|
|
673
642
|
var _matchedIds$has;
|
|
674
643
|
var isMatched = (_matchedIds$has = matchedIds === null || matchedIds === void 0 ? void 0 : matchedIds.has(node._id)) !== null && _matchedIds$has !== void 0 ? _matchedIds$has : false;
|
|
675
|
-
return _objectSpread$
|
|
644
|
+
return _objectSpread$4(_objectSpread$4({}, node), {}, {
|
|
676
645
|
matched: isMatched,
|
|
677
646
|
matchIndices: isMatched ? matchIndicesMap === null || matchIndicesMap === void 0 ? void 0 : matchIndicesMap.get(node._id) : undefined,
|
|
678
647
|
children: node.children ? annotateSubtree(node.children, matchedIds, matchIndicesMap) : undefined
|
|
@@ -687,7 +656,7 @@ function annotateSubtree(nodes, matchedIds, matchIndicesMap) {
|
|
|
687
656
|
function filterTree(nodes, typeFilters, matchedIds, matchIndicesMap) {
|
|
688
657
|
var hasTextSearch = matchedIds != null && matchIndicesMap != null;
|
|
689
658
|
var result = [];
|
|
690
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
659
|
+
var _iterator2 = _createForOfIteratorHelper$2(nodes),
|
|
691
660
|
_step2;
|
|
692
661
|
try {
|
|
693
662
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -695,7 +664,7 @@ function filterTree(nodes, typeFilters, matchedIds, matchIndicesMap) {
|
|
|
695
664
|
var typeOk = typeFilters.size === 0 || typeFilters.has(node.orgType);
|
|
696
665
|
var directMatch = hasTextSearch ? matchedIds.has(node._id) && typeOk : typeFilters.has(node.orgType);
|
|
697
666
|
if (directMatch) {
|
|
698
|
-
result.push(_objectSpread$
|
|
667
|
+
result.push(_objectSpread$4(_objectSpread$4({}, node), {}, {
|
|
699
668
|
matched: true,
|
|
700
669
|
matchIndices: hasTextSearch ? matchIndicesMap.get(node._id) : undefined,
|
|
701
670
|
children: node.children ? annotateSubtree(node.children, hasTextSearch ? matchedIds : undefined, hasTextSearch ? matchIndicesMap : undefined) : undefined
|
|
@@ -703,7 +672,7 @@ function filterTree(nodes, typeFilters, matchedIds, matchIndicesMap) {
|
|
|
703
672
|
} else {
|
|
704
673
|
var filteredChildren = node.children ? filterTree(node.children, typeFilters, matchedIds, matchIndicesMap) : undefined;
|
|
705
674
|
if (filteredChildren && filteredChildren.length > 0) {
|
|
706
|
-
result.push(_objectSpread$
|
|
675
|
+
result.push(_objectSpread$4(_objectSpread$4({}, node), {}, {
|
|
707
676
|
matched: false,
|
|
708
677
|
children: filteredChildren
|
|
709
678
|
}));
|
|
@@ -724,13 +693,13 @@ function filterTree(nodes, typeFilters, matchedIds, matchIndicesMap) {
|
|
|
724
693
|
*/
|
|
725
694
|
function filterTreeByTypesOnly(nodes, typeFilters) {
|
|
726
695
|
var result = [];
|
|
727
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
696
|
+
var _iterator3 = _createForOfIteratorHelper$2(nodes),
|
|
728
697
|
_step3;
|
|
729
698
|
try {
|
|
730
699
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
731
700
|
var node = _step3.value;
|
|
732
701
|
if (typeFilters.has(node.orgType)) {
|
|
733
|
-
result.push(_objectSpread$
|
|
702
|
+
result.push(_objectSpread$4(_objectSpread$4({}, node), {}, {
|
|
734
703
|
matched: true,
|
|
735
704
|
children: node.children ? annotateSubtree(node.children) : undefined
|
|
736
705
|
}));
|
|
@@ -756,7 +725,7 @@ function filterMatchIndices(indices, patternLength) {
|
|
|
756
725
|
if (indices.length <= 1) return indices;
|
|
757
726
|
var windowSize = patternLength + 2;
|
|
758
727
|
var positions = [];
|
|
759
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
728
|
+
var _iterator4 = _createForOfIteratorHelper$2(indices),
|
|
760
729
|
_step4;
|
|
761
730
|
try {
|
|
762
731
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -802,7 +771,7 @@ function getMatchPositionScore(arg) {
|
|
|
802
771
|
var _arg$matches;
|
|
803
772
|
if (!((_arg$matches = arg.matches) !== null && _arg$matches !== void 0 && _arg$matches.length)) return 3;
|
|
804
773
|
var best = 3;
|
|
805
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
774
|
+
var _iterator5 = _createForOfIteratorHelper$2(arg.matches),
|
|
806
775
|
_step5;
|
|
807
776
|
try {
|
|
808
777
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -823,7 +792,7 @@ function getMatchPositionScore(arg) {
|
|
|
823
792
|
}
|
|
824
793
|
function collectExpandedIds(nodes) {
|
|
825
794
|
var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set();
|
|
826
|
-
var _iterator6 = _createForOfIteratorHelper$
|
|
795
|
+
var _iterator6 = _createForOfIteratorHelper$2(nodes),
|
|
827
796
|
_step6;
|
|
828
797
|
try {
|
|
829
798
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -857,7 +826,7 @@ function performSearch(fuse, flatItems, query) {
|
|
|
857
826
|
var matchedIds = new Set();
|
|
858
827
|
var matchIndicesMap = new Map();
|
|
859
828
|
var scoreMap = new Map();
|
|
860
|
-
var _iterator7 = _createForOfIteratorHelper$
|
|
829
|
+
var _iterator7 = _createForOfIteratorHelper$2(words),
|
|
861
830
|
_step7;
|
|
862
831
|
try {
|
|
863
832
|
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
@@ -866,7 +835,7 @@ function performSearch(fuse, flatItems, query) {
|
|
|
866
835
|
var _r$score;
|
|
867
836
|
return ((_r$score = r.score) !== null && _r$score !== void 0 ? _r$score : 1) <= MAX_FUSE_SCORE;
|
|
868
837
|
});
|
|
869
|
-
var _iterator9 = _createForOfIteratorHelper$
|
|
838
|
+
var _iterator9 = _createForOfIteratorHelper$2(results),
|
|
870
839
|
_step9;
|
|
871
840
|
try {
|
|
872
841
|
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
@@ -879,7 +848,7 @@ function performSearch(fuse, flatItems, query) {
|
|
|
879
848
|
var positionBonus = Math.max(0, 2 - Math.min(positionRank, 2)) * POSITION_WEIGHT;
|
|
880
849
|
scoreMap.set(result.item._id, prev + ((_result$score = result.score) !== null && _result$score !== void 0 ? _result$score : 0) - positionBonus - MATCH_COUNT_BONUS);
|
|
881
850
|
if (result.matches) {
|
|
882
|
-
var _iterator10 = _createForOfIteratorHelper$
|
|
851
|
+
var _iterator10 = _createForOfIteratorHelper$2(result.matches),
|
|
883
852
|
_step10;
|
|
884
853
|
try {
|
|
885
854
|
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
@@ -913,7 +882,7 @@ function performSearch(fuse, flatItems, query) {
|
|
|
913
882
|
_iterator7.f();
|
|
914
883
|
}
|
|
915
884
|
var exactIdMatchedIds = collectExactIdMatches(flatItems, query);
|
|
916
|
-
var _iterator8 = _createForOfIteratorHelper$
|
|
885
|
+
var _iterator8 = _createForOfIteratorHelper$2(exactIdMatchedIds),
|
|
917
886
|
_step8;
|
|
918
887
|
try {
|
|
919
888
|
var _loop = function _loop() {
|
|
@@ -1121,7 +1090,7 @@ var orgTypeConfig = {
|
|
|
1121
1090
|
|
|
1122
1091
|
var container = "container-FVPtn";
|
|
1123
1092
|
var toolbar = "toolbar-ANpuZ";
|
|
1124
|
-
var searchBar = "search-bar-gpRL2";
|
|
1093
|
+
var searchBar$1 = "search-bar-gpRL2";
|
|
1125
1094
|
var searchField = "search-field-8zGFa";
|
|
1126
1095
|
var searchClearBtn = "search-clear-btn-ggM0O";
|
|
1127
1096
|
var typeFilterBar = "type-filter-bar-qx91Q";
|
|
@@ -1142,16 +1111,16 @@ var nodeNameSelected = "node-name-selected-KrVZD";
|
|
|
1142
1111
|
var matchChar = "match-char-cWyWK";
|
|
1143
1112
|
var loading$1 = "loading-zurRu";
|
|
1144
1113
|
var singleOrg = "single-org-q4R2s";
|
|
1145
|
-
var css_248z$
|
|
1146
|
-
styleInject(css_248z$
|
|
1114
|
+
var css_248z$l = ".container-FVPtn {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.toolbar-ANpuZ {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n margin-bottom: 8px;\n flex-wrap: wrap;\n}\n\n.search-bar-gpRL2 {\n border: 0px solid transparent !important;\n outline: 0px !important;\n}\n\n.search-bar-gpRL2 {\n background-color: #fff;\n border-radius: 16px;\n width: 100%;\n min-width: 120px;\n padding: 6px 34px 6px 14px;\n box-sizing: border-box;\n font-size: 14px;\n font-family: var(--diva-typography-font-family);\n}\n\n.search-field-8zGFa {\n position: relative;\n flex: 1 1 auto;\n min-width: 120px;\n}\n\n.search-clear-btn-ggM0O {\n position: absolute;\n top: 50%;\n right: 8px;\n transform: translateY(-50%);\n width: 18px;\n height: 18px;\n border: 0;\n border-radius: 50%;\n background: #ececec;\n color: #666;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n line-height: 1;\n padding: 0;\n}\n\n.search-clear-btn-ggM0O:hover {\n background: #dddddd;\n color: #333;\n}\n\n.search-bar-gpRL2::-moz-placeholder {\n color: #b6b6b7;\n opacity: 1;\n}\n\n.search-bar-gpRL2::placeholder {\n color: #b6b6b7;\n opacity: 1;\n}\n\n.type-filter-bar-qx91Q {\n display: flex;\n flex-direction: row;\n gap: 4px;\n flex-wrap: wrap;\n}\n\n.type-filter-btn-hjYcz {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n background-color: #fff;\n border: 1px solid #e0e0e0;\n border-radius: 12px;\n padding: 4px 10px;\n font-size: 12px;\n font-family: var(--diva-typography-font-family);\n cursor: pointer;\n color: #888;\n transition: all 0.15s ease;\n}\n\n.type-filter-btn-hjYcz:hover {\n border-color: #bbb;\n color: #555;\n}\n\n.type-filter-btn-active-ho-V5 {\n border-color: #999;\n color: #333;\n font-weight: 600;\n background-color: #f5f5f5;\n}\n\n.type-filter-bullet-pBoC0 {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex-shrink: 0;\n}\n\n.tree-list-P-vOa {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.tree-list-focusable-Al7xA:focus {\n outline: none;\n}\n\n/* Firefox scrollbar */\n.tree-list-P-vOa {\n scrollbar-width: thin;\n scrollbar-color: #7b7b7b #dfdfdf;\n}\n\n/* Chrome, Edge, Safari */\n.tree-list-P-vOa::-webkit-scrollbar {\n width: 6px;\n}\n\n.tree-list-P-vOa::-webkit-scrollbar-track {\n background: #dfdfdf;\n border-radius: 3px;\n}\n\n.tree-list-P-vOa::-webkit-scrollbar-thumb {\n background-color: #7b7b7b;\n border-radius: 3px;\n}\n\n.node-row-KzaKA {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.node-item-rGHuo {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: 26px;\n}\n\n.node-arrow-vMZ2- {\n width: 16px;\n height: 16px;\n flex-shrink: 0;\n cursor: pointer;\n background: center / 50% no-repeat url(\"data:image/svg+xml,%3Csvg width%3D%227%22 height%3D%2211%22 viewBox%3D%220 0 7 11%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M4.24303 5.41303L0.517911 1.73629C0.220592 1.44283 0.220592 0.967042 0.517911 0.673584C0.81523 0.380127 1.29728 0.380127 1.5946 0.673584L5.85806 4.88168C6.15538 5.17513 6.15538 5.65092 5.85806 5.94438L1.5946 10.1525C1.29728 10.4459 0.81523 10.4459 0.517911 10.1525C0.220592 9.85902 0.220592 9.38323 0.517911 9.08977L4.24303 5.41303Z%22 fill%3D%22%23B6B6B7%22%2F%3E%3C%2Fsvg%3E\");\n transition: transform 0.2s ease;\n}\n\n.node-arrow-open-KCbav {\n transform: rotate(90deg);\n}\n\n.node-arrow-placeholder-3cEV6 {\n width: 16px;\n height: 16px;\n flex-shrink: 0;\n}\n\n.type-bullet-47jTS {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex-shrink: 0;\n margin-left: 2px;\n}\n\n.node-name-YngKB {\n font-size: 14px;\n line-height: 20px;\n padding-left: 6px;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: calc(100% - 22px);\n transition: font-weight 0.15s ease;\n}\n\n.node-name-YngKB:hover,\n.node-name-focused-B4Pi1 {\n text-decoration: underline;\n}\n\n.node-name-selected-KrVZD {\n font-weight: 700;\n}\n\n.match-char-cWyWK {\n background-color: rgba(255, 235, 59, 0.45);\n border-radius: 1px;\n}\n\n.loading-zurRu {\n font-size: 14px;\n color: #888;\n padding: 8px 0;\n}\n\n.single-org-q4R2s {\n font-size: 14px;\n font-weight: 600;\n}\n";
|
|
1115
|
+
styleInject(css_248z$l);
|
|
1147
1116
|
|
|
1148
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
1149
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
1150
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1117
|
+
function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
1118
|
+
function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
|
|
1119
|
+
function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1151
1120
|
function renderHighlightedName(text, indices) {
|
|
1152
1121
|
if (!indices || indices.length === 0) return text;
|
|
1153
1122
|
var highlighted = new Uint8Array(text.length);
|
|
1154
|
-
var _iterator = _createForOfIteratorHelper(indices),
|
|
1123
|
+
var _iterator = _createForOfIteratorHelper$1(indices),
|
|
1155
1124
|
_step;
|
|
1156
1125
|
try {
|
|
1157
1126
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -1366,7 +1335,7 @@ function OrgTreeSelect(_ref) {
|
|
|
1366
1335
|
className: searchField,
|
|
1367
1336
|
children: [/*#__PURE__*/jsx("input", {
|
|
1368
1337
|
ref: searchInputRef,
|
|
1369
|
-
className: searchBar,
|
|
1338
|
+
className: searchBar$1,
|
|
1370
1339
|
type: "text",
|
|
1371
1340
|
autoComplete: "off",
|
|
1372
1341
|
placeholder: t('orgTree.filter.placeholder'),
|
|
@@ -1437,15 +1406,15 @@ function OrgTreeSelect(_ref) {
|
|
|
1437
1406
|
var wrapper$b = "wrapper-zkdZ1";
|
|
1438
1407
|
var warningText = "warning-text-bwPCz";
|
|
1439
1408
|
var modeContainer = "mode-container-iyMu1";
|
|
1440
|
-
var css_248z$
|
|
1441
|
-
styleInject(css_248z$
|
|
1409
|
+
var css_248z$k = ".wrapper-zkdZ1 {\n margin-bottom: 12px;\n}\n\n.warning-text-bwPCz {\n color: #f87000;\n\n font-size: 12px;\n width: 100%;\n text-align: right;\n}\n\n.mode-container-iyMu1 {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 6px;\n}\n";
|
|
1410
|
+
styleInject(css_248z$k);
|
|
1442
1411
|
|
|
1443
1412
|
var toggleSwitch = "toggle-switch-dpRMP";
|
|
1444
1413
|
var switchSelection = "switch-selection-gzuIi";
|
|
1445
1414
|
var switchLabel = "switch-label-7ARiU";
|
|
1446
1415
|
var switchRadio = "switch-radio-NmaTt";
|
|
1447
|
-
var css_248z$
|
|
1448
|
-
styleInject(css_248z$
|
|
1416
|
+
var css_248z$j = ".toggle-switch-dpRMP {\n position: relative;\n height: 26px;\n width: 137px;\n border: #aaa 1px solid;\n border-radius: 3px;\n box-sizing: content-box;\n box-sizing: initial;\n}\n\n.switch-selection-gzuIi {\n display: block;\n position: absolute;\n z-index: 1;\n top: 0px;\n left: 0px;\n width: 45px;\n height: 26px;\n background-color: var(--diva-theme-palette-primary-main);\n border-radius: 3px;\n transition: left 0.25s ease-out;\n}\n\n.switch-label-7ARiU {\n position: relative;\n z-index: 2;\n float: left;\n width: 45px;\n line-height: 26px;\n font-size: 11px;\n color: rgba(0, 0, 0, 0.6);\n text-align: center;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n transition: color 0.25s ease-out;\n}\n\n.switch-radio-NmaTt {\n display: none;\n}\n\n.switch-radio-NmaTt:checked ~ .switch-label-7ARiU {\n transition: 0.15s ease-out;\n color: #fff;\n}\n";
|
|
1417
|
+
styleInject(css_248z$j);
|
|
1449
1418
|
|
|
1450
1419
|
var MultiToggleSwitch = function MultiToggleSwitch(_ref) {
|
|
1451
1420
|
var values = _ref.values,
|
|
@@ -1508,8 +1477,8 @@ var logoutWrapper = "logout-wrapper-jI9Sq";
|
|
|
1508
1477
|
var logoutButton = "logout-button-m87tE";
|
|
1509
1478
|
var logoutIcon = "logout-icon-t01Yi";
|
|
1510
1479
|
var footerVersion = "footer-version-0OgH9";
|
|
1511
|
-
var css_248z$
|
|
1512
|
-
styleInject(css_248z$
|
|
1480
|
+
var css_248z$i = ".wrapper-y5jTr {\n display: flex;\n justify-content: space-between;\n color: #000;\n}\n\n.logout-wrapper-jI9Sq {\n display: flex;\n font-size: normal;\n align-items: center;\n gap: 12px;\n cursor: pointer;\n}\n\n.logout-button-m87tE {\n font-weight: 300;\n width: -moz-fit-content;\n width: fit-content;\n transition: color 0.4s ease-out;\n}\n\n.logout-icon-t01Yi {\n width: 18px !important;\n}\n\n.logout-icon-t01Yi {\n transition: color 0.4s ease-out;\n background-size: 100%;\n display: block;\n height: 18px;\n}\n\n.logout-wrapper-jI9Sq:hover .logout-icon-t01Yi,\n.logout-wrapper-jI9Sq:hover .logout-button-m87tE {\n color: var(--diva-theme-palette-primary-main);\n font-weight: 700;\n}\n\n.footer-version-0OgH9 {\n font-size: small;\n color: grey;\n}\n";
|
|
1481
|
+
styleInject(css_248z$i);
|
|
1513
1482
|
|
|
1514
1483
|
var Logout = function Logout(_ref) {
|
|
1515
1484
|
var setOpen = _ref.setOpen;
|
|
@@ -1565,8 +1534,8 @@ var Logout = function Logout(_ref) {
|
|
|
1565
1534
|
};
|
|
1566
1535
|
|
|
1567
1536
|
var footerLinks = "footer-links-BZYFg";
|
|
1568
|
-
var css_248z$
|
|
1569
|
-
styleInject(css_248z$
|
|
1537
|
+
var css_248z$h = ".footer-links-BZYFg {\n display: flex;\n width: 100%;\n justify-content: space-around;\n font-family: var(--diva-typography-font-family);\n padding-top: 12px;\n}\n.footer-links-BZYFg a {\n cursor: pointer;\n margin-top: auto;\n font-size: 12px;\n margin-bottom: auto;\n transition: color 0.3s ease;\n}\n\n.footer-links-BZYFg a:hover {\n color: var(--diva-theme-palette-primary-main);\n}\n.footer-links-BZYFg:first-of-type {\n padding-top: 0;\n}\n";
|
|
1538
|
+
styleInject(css_248z$h);
|
|
1570
1539
|
|
|
1571
1540
|
var AGBs = function AGBs(props) {
|
|
1572
1541
|
var _useDivaCore = useDivaCore(),
|
|
@@ -1626,9 +1595,9 @@ var AGBs = function AGBs(props) {
|
|
|
1626
1595
|
};
|
|
1627
1596
|
|
|
1628
1597
|
var wrapper$9 = "wrapper-Y1Jcp";
|
|
1629
|
-
var text = "text-M0L7c";
|
|
1630
|
-
var css_248z$
|
|
1631
|
-
styleInject(css_248z$
|
|
1598
|
+
var text$1 = "text-M0L7c";
|
|
1599
|
+
var css_248z$g = ".wrapper-Y1Jcp {\n display: flex;\n width: 100%;\n gap: 12px;\n align-items: center;\n}\n.text-M0L7c {\n}\n";
|
|
1600
|
+
styleInject(css_248z$g);
|
|
1632
1601
|
|
|
1633
1602
|
var HidePrices = function HidePrices(props) {
|
|
1634
1603
|
var _theme$palette;
|
|
@@ -1661,7 +1630,7 @@ var HidePrices = function HidePrices(props) {
|
|
|
1661
1630
|
uncheckedIcon: false,
|
|
1662
1631
|
checkedIcon: false
|
|
1663
1632
|
}), /*#__PURE__*/jsx("div", {
|
|
1664
|
-
className: text,
|
|
1633
|
+
className: text$1,
|
|
1665
1634
|
children: t('navigation.user.hideprices')
|
|
1666
1635
|
}), pricePreviewActive && /*#__PURE__*/jsxs(Fragment$1, {
|
|
1667
1636
|
children: [/*#__PURE__*/jsx(Switch, {
|
|
@@ -1676,7 +1645,7 @@ var HidePrices = function HidePrices(props) {
|
|
|
1676
1645
|
checkedIcon: false,
|
|
1677
1646
|
disabled: hidePrices
|
|
1678
1647
|
}), /*#__PURE__*/jsx("div", {
|
|
1679
|
-
className: text,
|
|
1648
|
+
className: text$1,
|
|
1680
1649
|
children: t('navigation.user.hideconfigpricepreview')
|
|
1681
1650
|
})]
|
|
1682
1651
|
}), showSnow && /*#__PURE__*/jsxs(Fragment$1, {
|
|
@@ -1691,7 +1660,7 @@ var HidePrices = function HidePrices(props) {
|
|
|
1691
1660
|
uncheckedIcon: false,
|
|
1692
1661
|
checkedIcon: false
|
|
1693
1662
|
}), /*#__PURE__*/jsx("div", {
|
|
1694
|
-
className: text,
|
|
1663
|
+
className: text$1,
|
|
1695
1664
|
children: t('navigation.user.hidesnow')
|
|
1696
1665
|
})]
|
|
1697
1666
|
})]
|
|
@@ -1708,10 +1677,10 @@ var clickable = "clickable-MhS-F";
|
|
|
1708
1677
|
var controlWrapper = "control-wrapper-u1DL4";
|
|
1709
1678
|
var menu$1 = "menu-w8zcL";
|
|
1710
1679
|
var arrowWrapper = "arrow-wrapper-rHbX-";
|
|
1711
|
-
var arrow = "arrow-i5G-Z";
|
|
1712
|
-
var openClass$
|
|
1713
|
-
var css_248z$
|
|
1714
|
-
styleInject(css_248z$
|
|
1680
|
+
var arrow$1 = "arrow-i5G-Z";
|
|
1681
|
+
var openClass$2 = "open-class-U2edh";
|
|
1682
|
+
var css_248z$f = ".wrapper-tqv-Y {\n display: flex;\n width: 100%;\n}\n\n.username-wrapper-4OtrW {\n display: flex;\n flex-direction: column;\n gap: 5px;\n overflow: hidden;\n text-wrap: nowrap;\n white-space: nowrap;\n}\n.username-cM3J3 {\n font-weight: 700;\n font-size: 15px;\n}\n\n.email-AIUDL {\n font-size: 13px;\n}\n\n.language-wrapper-Cl-bc {\n width: 100px;\n display: flex;\n justify-content: center;\n padding: 16px 0px;\n border-left: 1px solid #fff;\n height: 36px;\n}\n\n.dropdown-ryNwY {\n margin-top: 10px;\n font-size: 15px;\n z-index: 100;\n}\n.clickable-MhS-F {\n cursor: pointer;\n}\n\n.dropdown-ryNwY .is-selected {\n transition: text-shadow ease-in-out 0.4s;\n}\n\n.dropdown-ryNwY:hover .is-selected {\n text-shadow: 0px 0px 12px rgba(0, 0, 0, 0.55);\n}\n\n.control-wrapper-u1DL4 {\n display: flex;\n gap: 6px;\n justify-content: center;\n align-items: center;\n}\n\n.menu-w8zcL {\n margin-top: 10px;\n background-color: #f2f2f2;\n border-radius: 26px;\n width: 36px;\n box-shadow: 0px 4px 4px 0px rgba(0,0,0,0.25098);\n overflow: hidden;\n transform: translateY(-44px);\n padding: 7px;\n display: flex;\n gap: 12px;\n flex-direction: column;\n}\n\n.menu-w8zcL > div {\n width: 36px;\n height: 36px;\n text-align: center;\n line-height: 36px;\n cursor: pointer;\n transition: color 0.3s ease, background-color 0.3s ease;\n border-radius: 50%;\n}\n\n.menu-w8zcL > div:hover {\n color: #fff;\n background-color: var(--diva-theme-palette-primary-main);\n}\n\n.menu-w8zcL .is-selected {\n color: #fff;\n background-color: var(--diva-theme-palette-primary-main);\n}\n\n.arrow-wrapper-rHbX- {\n width: 20px;\n height: 20px;\n}\n\n.arrow-i5G-Z {\n width: 20px;\n height: 20px;\n background: center / 50% no-repeat url(\"data:image/svg+xml,%3Csvg width%3D%227%22 height%3D%2211%22 viewBox%3D%220 0 7 11%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M4.24303 5.41303L0.517911 1.73629C0.220592 1.44283 0.220592 0.967042 0.517911 0.673584C0.81523 0.380127 1.29728 0.380127 1.5946 0.673584L5.85806 4.88168C6.15538 5.17513 6.15538 5.65092 5.85806 5.94438L1.5946 10.1525C1.29728 10.4459 0.81523 10.4459 0.517911 10.1525C0.220592 9.85902 0.220592 9.38323 0.517911 9.08977L4.24303 5.41303Z%22 fill%3D%22%23B6B6B7%22%2F%3E%3C%2Fsvg%3E\");\n transition: transform 0.3s ease;\n}\n\n.arrow-i5G-Z:hover {\n cursor: pointer;\n}\n\n.open-class-U2edh {\n transform: rotate(90deg);\n}\n";
|
|
1683
|
+
styleInject(css_248z$f);
|
|
1715
1684
|
|
|
1716
1685
|
var UserAndLanguage = function UserAndLanguage(_ref) {
|
|
1717
1686
|
var _i18n$language, _user$name, _user$familyName;
|
|
@@ -1755,10 +1724,10 @@ var UserAndLanguage = function UserAndLanguage(_ref) {
|
|
|
1755
1724
|
return l !== currentLang;
|
|
1756
1725
|
}))),
|
|
1757
1726
|
arrowOpen: /*#__PURE__*/jsx("div", {
|
|
1758
|
-
className: classNames(arrow, openClass$
|
|
1727
|
+
className: classNames(arrow$1, openClass$2)
|
|
1759
1728
|
}),
|
|
1760
1729
|
arrowClosed: /*#__PURE__*/jsx("div", {
|
|
1761
|
-
className: arrow
|
|
1730
|
+
className: arrow$1
|
|
1762
1731
|
}),
|
|
1763
1732
|
arrowClassName: arrowWrapper,
|
|
1764
1733
|
controlClassName: controlWrapper,
|
|
@@ -1773,10 +1742,10 @@ var UserAndLanguage = function UserAndLanguage(_ref) {
|
|
|
1773
1742
|
|
|
1774
1743
|
var wrapper$7 = "wrapper-1EF4k";
|
|
1775
1744
|
var button$1 = "button-n4ZpL";
|
|
1776
|
-
var selected = "selected-mk9EU";
|
|
1745
|
+
var selected$1 = "selected-mk9EU";
|
|
1777
1746
|
var link$1 = "link-bFrih";
|
|
1778
|
-
var css_248z$
|
|
1779
|
-
styleInject(css_248z$
|
|
1747
|
+
var css_248z$e = ".wrapper-1EF4k {\n display: flex;\n flex-direction: column;\n max-height: 200px;\n overflow: auto;\n}\n\n.button-n4ZpL {\n font-size: large;\n font-weight: bolder;\n}\n\n.button-n4ZpL {\n position: relative;\n cursor: pointer;\n margin: 0px 8px;\n padding: 8px;\n text-transform: uppercase;\n font-weight: 600;\n font-size: 14px;\n letter-spacing: 0.1rem;\n border-left: 2px solid #fff;\n transition: border 0.4s ease, color 0.4s ease;\n}\n\n.button-n4ZpL:hover,\n.selected-mk9EU {\n border-left: 2px solid var(--diva-theme-palette-primary-main);\n color: var(--diva-theme-palette-primary-main);\n}\n\n.link-bFrih {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 1;\n}\n";
|
|
1748
|
+
styleInject(css_248z$e);
|
|
1780
1749
|
|
|
1781
1750
|
var NavigationButtons = function NavigationButtons(_ref) {
|
|
1782
1751
|
var buttons = _ref.buttons;
|
|
@@ -1792,7 +1761,7 @@ var NavigationButtons = function NavigationButtons(_ref) {
|
|
|
1792
1761
|
children: buttons.map(function (b, i) {
|
|
1793
1762
|
var _b$action;
|
|
1794
1763
|
return /*#__PURE__*/jsxs("div", {
|
|
1795
|
-
className: classNames(button$1, !!(currentComponent !== null && currentComponent !== void 0 && currentComponent.type) && (currentComponent === null || currentComponent === void 0 ? void 0 : currentComponent.type) === ((_b$action = b.action) === null || _b$action === void 0 ? void 0 : _b$action.type) ? selected : undefined),
|
|
1764
|
+
className: classNames(button$1, !!(currentComponent !== null && currentComponent !== void 0 && currentComponent.type) && (currentComponent === null || currentComponent === void 0 ? void 0 : currentComponent.type) === ((_b$action = b.action) === null || _b$action === void 0 ? void 0 : _b$action.type) ? selected$1 : undefined),
|
|
1796
1765
|
children: [t(b.text, b.text), /*#__PURE__*/jsx("a", {
|
|
1797
1766
|
href: resolveComponent(b.action),
|
|
1798
1767
|
children: /*#__PURE__*/jsx("span", {
|
|
@@ -1810,8 +1779,8 @@ var NavigationButtons = function NavigationButtons(_ref) {
|
|
|
1810
1779
|
|
|
1811
1780
|
var organizationName = "organization-name-uMRaO";
|
|
1812
1781
|
var organizationDescription = "organization-description-TKR5G";
|
|
1813
|
-
var css_248z$
|
|
1814
|
-
styleInject(css_248z$
|
|
1782
|
+
var css_248z$d = ".organization-name-uMRaO {\n font-weight: 700;\n font-size: 15px;\n color: var(--diva-theme-palette-primary-main);\n}\n.organization-description-TKR5G {\n font-size: 12px;\n margin-top: 6px;\n}\n";
|
|
1783
|
+
styleInject(css_248z$d);
|
|
1815
1784
|
|
|
1816
1785
|
var Organization = function Organization(_ref) {
|
|
1817
1786
|
_objectDestructuringEmpty(_ref);
|
|
@@ -1833,8 +1802,8 @@ var Organization = function Organization(_ref) {
|
|
|
1833
1802
|
|
|
1834
1803
|
var wrapper$6 = "wrapper-SMA8P";
|
|
1835
1804
|
var icon = "icon-6Qojh";
|
|
1836
|
-
var css_248z$
|
|
1837
|
-
styleInject(css_248z$
|
|
1805
|
+
var css_248z$c = ".wrapper-SMA8P {\n display: flex;\n justify-content: center;\n font-family: var(--diva-typography-font-family);\n cursor: pointer;\n}\n\n.icon-6Qojh {\n width: 14px;\n height: 14px;\n opacity: 0.5;\n}\n\n.wrapper-SMA8P:hover .icon-6Qojh {\n opacity: 1;\n}\n.wrapper-SMA8P:hover a {\n color: var(--diva-theme-palette-primary-main);\n}\n";
|
|
1806
|
+
styleInject(css_248z$c);
|
|
1838
1807
|
|
|
1839
1808
|
var newWindowArrowIcon = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20width%3D%22800px%22%20height%3D%22800px%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%2012V6C5%205.44772%205.44772%205%206%205H18C18.5523%205%2019%205.44772%2019%206V18C19%2018.5523%2018.5523%2019%2018%2019H12M8.11111%2012H12M12%2012V15.8889M12%2012L5%2019%22%20stroke%3D%22%23464455%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E";
|
|
1840
1809
|
|
|
@@ -1863,9 +1832,7 @@ var Link = function Link(_ref) {
|
|
|
1863
1832
|
|
|
1864
1833
|
function Profil (_ref) {
|
|
1865
1834
|
var open = _ref.open,
|
|
1866
|
-
setOpen = _ref.setOpen
|
|
1867
|
-
anchorEl = _ref.anchorEl,
|
|
1868
|
-
onClose = _ref.onClose;
|
|
1835
|
+
setOpen = _ref.setOpen;
|
|
1869
1836
|
var _useDivaCore = useDivaCore(),
|
|
1870
1837
|
_useDivaCore$actions = _useDivaCore.actions,
|
|
1871
1838
|
userHasPermission = _useDivaCore$actions.userHasPermission,
|
|
@@ -1890,14 +1857,14 @@ function Profil (_ref) {
|
|
|
1890
1857
|
});
|
|
1891
1858
|
var headerHeight = 60;
|
|
1892
1859
|
var maxHeight = height - headerHeight - 12;
|
|
1893
|
-
return /*#__PURE__*/jsx(
|
|
1894
|
-
id: "diva-profile-dropdown",
|
|
1860
|
+
return /*#__PURE__*/jsx(DropdownContainer, {
|
|
1895
1861
|
open: open,
|
|
1896
|
-
anchorEl: anchorEl,
|
|
1897
|
-
onClose: onClose,
|
|
1898
1862
|
maxHeight: maxHeight,
|
|
1899
|
-
|
|
1863
|
+
top: headerHeight + 2,
|
|
1900
1864
|
children: open && /*#__PURE__*/jsxs("div", {
|
|
1865
|
+
onClick: function onClick(e) {
|
|
1866
|
+
return e.stopPropagation();
|
|
1867
|
+
},
|
|
1901
1868
|
children: [organization && /*#__PURE__*/jsx("div", {
|
|
1902
1869
|
className: section,
|
|
1903
1870
|
children: /*#__PURE__*/jsx(Organization, {})
|
|
@@ -1939,8 +1906,8 @@ var wrapper$5 = "wrapper-Qn4wN";
|
|
|
1939
1906
|
var logoWrapper = "logo-wrapper-hBDgt";
|
|
1940
1907
|
var logo = "logo-Vs2Ia";
|
|
1941
1908
|
var selectableLogo = "selectable-logo-1DHhf";
|
|
1942
|
-
var css_248z$
|
|
1943
|
-
styleInject(css_248z$
|
|
1909
|
+
var css_248z$b = ".wrapper-Qn4wN {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-basis: fit-content;\n}\n\n.logo-wrapper-hBDgt {\n margin: 6px 22px;\n}\n\n.logo-wrapper-hBDgt:first-of-type {\n width: 156px;\n display: flex;\n align-self: center;\n}\n\n.logo-Vs2Ia {\n max-width: 156px;\n max-height: 44px;\n}\n\n.selectable-logo-1DHhf {\n cursor: pointer;\n}\n";
|
|
1910
|
+
styleInject(css_248z$b);
|
|
1944
1911
|
|
|
1945
1912
|
var Logos = function Logos(props) {
|
|
1946
1913
|
var _useDivaCore = useDivaCore(),
|
|
@@ -1988,8 +1955,8 @@ var Logos = function Logos(props) {
|
|
|
1988
1955
|
};
|
|
1989
1956
|
|
|
1990
1957
|
var languageSelector = "language-selector-Le2oh";
|
|
1991
|
-
var css_248z$
|
|
1992
|
-
styleInject(css_248z$
|
|
1958
|
+
var css_248z$a = ".language-selector-Le2oh {\n width: 50px;\n height: 30px;\n margin: auto;\n margin-right: 22px;\n border: none;\n border-bottom: 1px solid;\n}\n\n.language-selector-Le2oh.focus-visible-8WTUk {\n outline: none;\n}\n\n.language-selector-Le2oh:focus-visible {\n outline: none;\n}\n";
|
|
1959
|
+
styleInject(css_248z$a);
|
|
1993
1960
|
|
|
1994
1961
|
var LanguageSelector = function LanguageSelector(props) {
|
|
1995
1962
|
var _useDivaCore = useDivaCore(),
|
|
@@ -2020,9 +1987,9 @@ var accountLogo = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding
|
|
|
2020
1987
|
var wrapper$4 = "wrapper-dTEtU";
|
|
2021
1988
|
var profil = "profil-9K4HQ";
|
|
2022
1989
|
var loginMode = "login-mode-rV-Rt";
|
|
2023
|
-
var openClass = "open-class-piIJQ";
|
|
2024
|
-
var css_248z$
|
|
2025
|
-
styleInject(css_248z$
|
|
1990
|
+
var openClass$1 = "open-class-piIJQ";
|
|
1991
|
+
var css_248z$9 = ".wrapper-dTEtU {\n border-left: #f2f2f2 solid 1px;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW #diva-header.darkmode .wrapper-dTEtU {\n border-left: black solid 1px;\n}\n\n.profil-9K4HQ {\n margin: 6px 22px;\n height: 46px;\n cursor: pointer;\n border-radius: 50%;\n transition: box-shadow ease-in-out 0.4s;\n}\n\n.login-mode-rV-Rt {\n position: absolute;\n bottom: 4px;\n right: 15px;\n color: white;\n background-color: var(--diva-theme-palette-primary-main);\n font-size: 12px;\n padding: 2px;\n border-radius: 3px;\n cursor: pointer;\n}\n\n.profil-9K4HQ:hover,\n.open-class-piIJQ {\n box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.55);\n}\n";
|
|
1992
|
+
styleInject(css_248z$9);
|
|
2026
1993
|
|
|
2027
1994
|
var ProfileImg = function ProfileImg(_ref) {
|
|
2028
1995
|
var onClickProfile = _ref.onClickProfile,
|
|
@@ -2049,12 +2016,9 @@ var ProfileImg = function ProfileImg(_ref) {
|
|
|
2049
2016
|
id: 'Profile',
|
|
2050
2017
|
className: wrapper$4,
|
|
2051
2018
|
children: [showLogin && /*#__PURE__*/jsx("img", {
|
|
2052
|
-
className: classNames(profil, open ? openClass : undefined),
|
|
2019
|
+
className: classNames(profil, open ? openClass$1 : undefined),
|
|
2053
2020
|
src: user ? profileUrl : accountLogo,
|
|
2054
|
-
onClick: onClickProfile
|
|
2055
|
-
"aria-expanded": open,
|
|
2056
|
-
"aria-haspopup": "true",
|
|
2057
|
-
"aria-controls": open ? 'diva-profile-dropdown' : undefined
|
|
2021
|
+
onClick: onClickProfile
|
|
2058
2022
|
}), loginMode$1 !== 'offline' && /*#__PURE__*/jsx("div", {
|
|
2059
2023
|
className: loginMode,
|
|
2060
2024
|
style: {
|
|
@@ -2070,8 +2034,8 @@ var ProfileImg = function ProfileImg(_ref) {
|
|
|
2070
2034
|
};
|
|
2071
2035
|
|
|
2072
2036
|
var textClass$1 = "text-class-mZIuq";
|
|
2073
|
-
var css_248z$
|
|
2074
|
-
styleInject(css_248z$
|
|
2037
|
+
var css_248z$8 = ".text-class-mZIuq {\n font-size: 16px;\n line-height: 19px;\n transition: color 0.3s ease, border 0.3s ease;\n letter-spacing: 0.1rem;\n text-wrap: nowrap;\n white-space: nowrap;\n padding: 20px 16px;\n border-right: #f2f2f2 solid 1px;\n flex-basis: fit-content;\n}\n";
|
|
2038
|
+
styleInject(css_248z$8);
|
|
2075
2039
|
|
|
2076
2040
|
var WelcomeText = function WelcomeText(_ref) {
|
|
2077
2041
|
var text = _ref.text;
|
|
@@ -2087,8 +2051,8 @@ var WelcomeText = function WelcomeText(_ref) {
|
|
|
2087
2051
|
var wrapper$3 = "wrapper-Nnx1C";
|
|
2088
2052
|
var textClass = "text-class-ODGFT";
|
|
2089
2053
|
var name = "name-5pMK6";
|
|
2090
|
-
var css_248z$
|
|
2091
|
-
styleInject(css_248z$
|
|
2054
|
+
var css_248z$7 = ".wrapper-Nnx1C {\n display: flex;\n flex-direction: column;\n padding: 8px 16px;\n border-left: #f2f2f2 solid 1px;\n width: 220px;\n box-sizing: border-box;\n cursor: pointer;\n justify-content: center;\n height: calc(100% - 16px);\n}\n.diva-component-DIVA_BACKOFFICE_NEW #diva-header.darkmode .wrapper-Nnx1C {\n border-left: black solid 1px;\n}\n\n.text-class-ODGFT,\n.name-5pMK6 {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n transition:\n color 0.3s ease,\n border 0.3s ease;\n letter-spacing: 1px;\n}\n.text-class-ODGFT {\n font-size: 14px;\n}\n\n.name-5pMK6 {\n font-size: 13px;\n}\n\n.wrapper-Nnx1C:hover .text-class-ODGFT,\n.wrapper-Nnx1C:hover .name-5pMK6 {\n color: var(--diva-theme-palette-primary-main);\n}\n";
|
|
2055
|
+
styleInject(css_248z$7);
|
|
2092
2056
|
|
|
2093
2057
|
var OrganizationName = function OrganizationName(_ref) {
|
|
2094
2058
|
var _user$name, _user$familyName;
|
|
@@ -2116,10 +2080,9 @@ var OrganizationName = function OrganizationName(_ref) {
|
|
|
2116
2080
|
|
|
2117
2081
|
var wrapper$2 = "wrapper-nEeiH";
|
|
2118
2082
|
var bellButton = "bell-button-4FCzu";
|
|
2119
|
-
var badge = "badge-VJAez";
|
|
2120
2083
|
var dropdownHeader = "dropdown-header--L5ev";
|
|
2121
2084
|
var refreshButton = "refresh-button-iYphX";
|
|
2122
|
-
var list = "list-oAERO";
|
|
2085
|
+
var list$1 = "list-oAERO";
|
|
2123
2086
|
var listItem = "list-item-5776s";
|
|
2124
2087
|
var listItemUnread = "list-item-unread-4vv9t";
|
|
2125
2088
|
var listItemRead = "list-item-read-pcnu8";
|
|
@@ -2129,91 +2092,65 @@ var itemSubject = "item-subject-1QAAc";
|
|
|
2129
2092
|
var itemDate = "item-date-1p9lQ";
|
|
2130
2093
|
var empty = "empty-AMurs";
|
|
2131
2094
|
var loading = "loading-nJYWk";
|
|
2132
|
-
var loadingMore = "loading-more-zz2Ht";
|
|
2133
2095
|
var alert = "alert-dGmPN";
|
|
2134
2096
|
var popupDate = "popup-date--2qrU";
|
|
2135
2097
|
var popupDivider = "popup-divider-oKq0i";
|
|
2136
|
-
var popupContainer = "popup-container-StVOE";
|
|
2137
2098
|
var popupContent = "popup-content-Ixtbi";
|
|
2138
|
-
var
|
|
2139
|
-
|
|
2140
|
-
styleInject(css_248z$4);
|
|
2099
|
+
var css_248z$6 = ".wrapper-nEeiH {\n position: relative;\n display: flex;\n align-items: center;\n height: 100%;\n border-left: #f2f2f2 solid 1px;\n padding: 0 14px;\n}\n\n.bell-button-4FCzu {\n display: flex;\n align-items: center;\n justify-content: center;\n background: none;\n border: none;\n cursor: pointer;\n padding: 4px;\n color: #333333;\n font-size: 22px;\n line-height: 1;\n}\n\n.bell-button-4FCzu:hover {\n color: #1677ff;\n color: var(--diva-theme-palette-primary-main, #1677ff);\n}\n\n.dropdown-header--L5ev {\n padding: 12px 16px;\n border-bottom: 1px solid #ffffff;\n font-weight: 600;\n color: #333333;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.refresh-button-iYphX {\n background: none;\n border: none;\n padding: 4px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #666666;\n border-radius: 4px;\n transition:\n background-color 0.2s,\n color 0.2s;\n}\n\n.refresh-button-iYphX:hover {\n background-color: #e8e8e8;\n color: #1677ff;\n color: var(--diva-theme-palette-primary-main, #1677ff);\n}\n\n.refresh-button-iYphX:active {\n background-color: #d8d8d8;\n}\n\n.list-oAERO {\n overflow-y: auto;\n flex: 1;\n}\n\n.list-item-5776s {\n display: block;\n width: 100%;\n text-align: left;\n border: none;\n border-bottom: 1px solid #ffffff;\n padding: 12px 16px 12px 32px;\n cursor: pointer;\n font-family: inherit;\n font-size: inherit;\n position: relative;\n transition: background-color 0.2s ease;\n}\n\n.list-item-unread-4vv9t {\n background-color: #ffffff;\n}\n\n.list-item-read-pcnu8 {\n background-color: #f7f7f7;\n}\n\n.list-item-5776s:hover {\n background-color: #e8e8e8;\n}\n\n.unread-dot-9o8ro {\n position: absolute;\n left: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 8px;\n height: 8px;\n background-color: #1677ff;\n background-color: var(--diva-theme-palette-primary-main, #1677ff);\n border-radius: 50%;\n}\n\n.item-header-la3nu {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n width: 100%;\n}\n\n.item-subject-1QAAc {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.list-item-unread-4vv9t .item-subject-1QAAc {\n font-weight: 600;\n color: #111111;\n}\n\n.list-item-read-pcnu8 .item-subject-1QAAc {\n font-weight: 400;\n color: #555555;\n}\n\n.item-date-1p9lQ {\n flex-shrink: 0;\n font-size: 11px;\n}\n\n.list-item-unread-4vv9t .item-date-1p9lQ {\n color: #666666;\n}\n\n.list-item-read-pcnu8 .item-date-1p9lQ {\n color: #999999;\n}\n\n.empty-AMurs {\n padding: 24px 16px;\n text-align: center;\n color: #666666;\n}\n\n.loading-nJYWk {\n display: flex;\n justify-content: center;\n padding: 24px 16px;\n}\n\n.loading-nJYWk .MuiCircularProgress-root {\n color: #1677ff;\n color: var(--diva-theme-palette-primary-main, #1677ff);\n}\n\n.alert-dGmPN {\n margin: 8px 12px;\n}\n\n.popup-date--2qrU {\n font-size: 11px;\n color: #888888;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 0 4px;\n}\n\n.popup-divider-oKq0i {\n height: 1px;\n background-color: #eef0f2;\n margin: 12px 0 16px 0;\n border: none;\n}\n\n.popup-content-Ixtbi {\n font-size: 14px;\n line-height: 1.6;\n color: #2c2c2c;\n white-space: pre-wrap;\n word-break: break-word;\n padding: 0 4px 4px 4px;\n max-height: 320px;\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n.popup-content-Ixtbi::-webkit-scrollbar {\n width: 5px;\n}\n\n.popup-content-Ixtbi::-webkit-scrollbar-track {\n background: #f1f1f1;\n border-radius: 3px;\n}\n\n.popup-content-Ixtbi::-webkit-scrollbar-thumb {\n background: #c1c1c1;\n border-radius: 3px;\n}\n\n.popup-content-Ixtbi::-webkit-scrollbar-thumb:hover {\n background: #a8a8a8;\n}\n\n.darkmode .dropdown-header--L5ev,\n.darkmode .list-item-5776s,\n.darkmode .item-subject-1QAAc,\n.darkmode .item-date-1p9lQ,\n.darkmode .empty-AMurs {\n color: #333333;\n}\n\n.darkmode .list-item-unread-4vv9t .item-subject-1QAAc {\n color: #111111;\n}\n\n.darkmode .list-item-read-pcnu8 .item-subject-1QAAc {\n color: #555555;\n}\n\n.darkmode .list-item-unread-4vv9t .item-date-1p9lQ {\n color: #666666;\n}\n\n.darkmode .list-item-read-pcnu8 .item-date-1p9lQ {\n color: #999999;\n}\n";
|
|
2100
|
+
styleInject(css_248z$6);
|
|
2141
2101
|
|
|
2142
|
-
|
|
2143
|
-
var
|
|
2144
|
-
open = _ref.open,
|
|
2102
|
+
function NotificationsBell(_ref) {
|
|
2103
|
+
var totalUnread = _ref.totalUnread,
|
|
2145
2104
|
onClick = _ref.onClick;
|
|
2146
2105
|
var _useTranslation = useTranslation(),
|
|
2147
2106
|
t = _useTranslation.t;
|
|
2148
2107
|
return /*#__PURE__*/jsx("div", {
|
|
2149
|
-
ref: ref,
|
|
2150
2108
|
className: wrapper$2,
|
|
2151
2109
|
children: /*#__PURE__*/jsx("button", {
|
|
2152
2110
|
type: "button",
|
|
2153
2111
|
className: bellButton,
|
|
2154
2112
|
onClick: onClick,
|
|
2155
|
-
"aria-expanded": open,
|
|
2156
|
-
"aria-haspopup": "true",
|
|
2157
|
-
"aria-controls": open ? 'diva-notifications-dropdown' : undefined,
|
|
2158
2113
|
"aria-label": t('navigator.notifications.title'),
|
|
2159
|
-
title:
|
|
2160
|
-
count:
|
|
2114
|
+
title: totalUnread > 0 ? t('navigator.notifications.unreadCount', {
|
|
2115
|
+
count: totalUnread
|
|
2161
2116
|
}) : t('navigator.notifications.title'),
|
|
2162
2117
|
children: /*#__PURE__*/jsx(Badge, {
|
|
2163
|
-
|
|
2164
|
-
badgeContent: totalUnseen,
|
|
2118
|
+
badgeContent: totalUnread,
|
|
2165
2119
|
color: "error",
|
|
2166
|
-
invisible:
|
|
2120
|
+
invisible: totalUnread === 0,
|
|
2167
2121
|
max: 99,
|
|
2168
2122
|
children: /*#__PURE__*/jsx(NotificationsNoneIcon, {})
|
|
2169
2123
|
})
|
|
2170
2124
|
})
|
|
2171
2125
|
});
|
|
2172
|
-
}
|
|
2126
|
+
}
|
|
2173
2127
|
|
|
2174
2128
|
var DROPDOWN_MAX_HEIGHT = 420;
|
|
2175
|
-
|
|
2129
|
+
// Right offset = OrganizationName width (220) + ProfileImg wrapper width (~91) so the
|
|
2130
|
+
// dropdown's right edge lines up with the bell button's right edge.
|
|
2131
|
+
var DROPDOWN_RIGHT_OFFSET = 311;
|
|
2176
2132
|
function NotificationsDropdown(_ref) {
|
|
2177
2133
|
var open = _ref.open,
|
|
2178
|
-
anchorEl = _ref.anchorEl,
|
|
2179
|
-
onClose = _ref.onClose,
|
|
2180
2134
|
items = _ref.items,
|
|
2181
2135
|
isLoading = _ref.loading,
|
|
2182
|
-
isLoadingMore = _ref.loadingMore,
|
|
2183
|
-
hasMore = _ref.hasMore,
|
|
2184
2136
|
errorMessage = _ref.errorMessage,
|
|
2185
2137
|
onSelect = _ref.onSelect,
|
|
2186
|
-
onRefresh = _ref.onRefresh
|
|
2187
|
-
onLoadMore = _ref.onLoadMore;
|
|
2138
|
+
onRefresh = _ref.onRefresh;
|
|
2188
2139
|
var _useTranslation = useTranslation(),
|
|
2189
2140
|
t = _useTranslation.t;
|
|
2190
|
-
|
|
2191
|
-
useEffect(function () {
|
|
2192
|
-
var sentinel = sentinelRef.current;
|
|
2193
|
-
if (!sentinel || !hasMore || isLoadingMore) return;
|
|
2194
|
-
var observer = new IntersectionObserver(function (entries) {
|
|
2195
|
-
if (entries[0].isIntersecting) {
|
|
2196
|
-
onLoadMore();
|
|
2197
|
-
}
|
|
2198
|
-
}, {
|
|
2199
|
-
threshold: 0.1
|
|
2200
|
-
});
|
|
2201
|
-
observer.observe(sentinel);
|
|
2202
|
-
return function () {
|
|
2203
|
-
return observer.disconnect();
|
|
2204
|
-
};
|
|
2205
|
-
}, [hasMore, isLoadingMore, onLoadMore]);
|
|
2206
|
-
return /*#__PURE__*/jsx(HeaderDropdownPopper, {
|
|
2207
|
-
id: "diva-notifications-dropdown",
|
|
2141
|
+
return /*#__PURE__*/jsx(DropdownContainer, {
|
|
2208
2142
|
open: open,
|
|
2209
|
-
anchorEl: anchorEl,
|
|
2210
|
-
onClose: onClose,
|
|
2211
2143
|
maxHeight: DROPDOWN_MAX_HEIGHT,
|
|
2212
|
-
|
|
2144
|
+
top: 62,
|
|
2145
|
+
right: DROPDOWN_RIGHT_OFFSET,
|
|
2213
2146
|
children: open && /*#__PURE__*/jsxs("div", {
|
|
2147
|
+
onClick: function onClick(e) {
|
|
2148
|
+
return e.stopPropagation();
|
|
2149
|
+
},
|
|
2214
2150
|
style: {
|
|
2215
2151
|
display: 'flex',
|
|
2216
|
-
flexDirection: 'column'
|
|
2152
|
+
flexDirection: 'column',
|
|
2153
|
+
height: '100%'
|
|
2217
2154
|
},
|
|
2218
2155
|
children: [/*#__PURE__*/jsxs("div", {
|
|
2219
2156
|
className: dropdownHeader,
|
|
@@ -2244,12 +2181,9 @@ function NotificationsDropdown(_ref) {
|
|
|
2244
2181
|
}) : items.length === 0 ? /*#__PURE__*/jsx("div", {
|
|
2245
2182
|
className: empty,
|
|
2246
2183
|
children: t('navigator.notifications.empty')
|
|
2247
|
-
}) : /*#__PURE__*/
|
|
2248
|
-
className: list,
|
|
2249
|
-
|
|
2250
|
-
maxHeight: DROPDOWN_MAX_HEIGHT - HEADER_HEIGHT
|
|
2251
|
-
},
|
|
2252
|
-
children: [items.map(function (item) {
|
|
2184
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
2185
|
+
className: list$1,
|
|
2186
|
+
children: items.map(function (item) {
|
|
2253
2187
|
return /*#__PURE__*/jsxs("button", {
|
|
2254
2188
|
type: "button",
|
|
2255
2189
|
className: classNames(listItem, item.hasRead ? listItemRead : listItemUnread),
|
|
@@ -2269,14 +2203,7 @@ function NotificationsDropdown(_ref) {
|
|
|
2269
2203
|
})]
|
|
2270
2204
|
})]
|
|
2271
2205
|
}, item._id);
|
|
2272
|
-
})
|
|
2273
|
-
ref: sentinelRef
|
|
2274
|
-
}), isLoadingMore && /*#__PURE__*/jsx("div", {
|
|
2275
|
-
className: loadingMore,
|
|
2276
|
-
children: /*#__PURE__*/jsx(CircularProgress, {
|
|
2277
|
-
size: 20
|
|
2278
|
-
})
|
|
2279
|
-
})]
|
|
2206
|
+
})
|
|
2280
2207
|
})]
|
|
2281
2208
|
})
|
|
2282
2209
|
});
|
|
@@ -2319,18 +2246,18 @@ function _requestJson() {
|
|
|
2319
2246
|
}));
|
|
2320
2247
|
return _requestJson.apply(this, arguments);
|
|
2321
2248
|
}
|
|
2322
|
-
function fetchNotifications(_x2, _x3, _x4
|
|
2249
|
+
function fetchNotifications(_x2, _x3, _x4) {
|
|
2323
2250
|
return _fetchNotifications.apply(this, arguments);
|
|
2324
2251
|
}
|
|
2325
2252
|
function _fetchNotifications() {
|
|
2326
|
-
_fetchNotifications = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(userId,
|
|
2327
|
-
var limit,
|
|
2253
|
+
_fetchNotifications = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(userId, _ref, _ref2) {
|
|
2254
|
+
var limit, offset, messageService, jwt, url, response;
|
|
2328
2255
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
2329
2256
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2330
2257
|
case 0:
|
|
2331
|
-
limit = _ref.limit,
|
|
2258
|
+
limit = _ref.limit, offset = _ref.offset;
|
|
2332
2259
|
messageService = _ref2.messageService, jwt = _ref2.jwt;
|
|
2333
|
-
url = "".concat(messageService, "/users/").concat(encodeURIComponent(userId), "/communications?limit=").concat(limit, "&
|
|
2260
|
+
url = "".concat(messageService, "/users/").concat(encodeURIComponent(userId), "/communications?limit=").concat(limit, "&offset=").concat(offset);
|
|
2334
2261
|
_context2.next = 5;
|
|
2335
2262
|
return fetch(url, {
|
|
2336
2263
|
method: 'GET',
|
|
@@ -2350,17 +2277,17 @@ function _fetchNotifications() {
|
|
|
2350
2277
|
}));
|
|
2351
2278
|
return _fetchNotifications.apply(this, arguments);
|
|
2352
2279
|
}
|
|
2353
|
-
function fetchNotification(_x6, _x7
|
|
2280
|
+
function fetchNotification(_x5, _x6, _x7) {
|
|
2354
2281
|
return _fetchNotification.apply(this, arguments);
|
|
2355
2282
|
}
|
|
2356
2283
|
function _fetchNotification() {
|
|
2357
|
-
_fetchNotification = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(userId, communicationId,
|
|
2284
|
+
_fetchNotification = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(userId, communicationId, _ref3) {
|
|
2358
2285
|
var messageService, jwt, url, response;
|
|
2359
2286
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
2360
2287
|
while (1) switch (_context3.prev = _context3.next) {
|
|
2361
2288
|
case 0:
|
|
2362
2289
|
messageService = _ref3.messageService, jwt = _ref3.jwt;
|
|
2363
|
-
url = "".concat(messageService, "/users/").concat(encodeURIComponent(userId), "/communications/").concat(encodeURIComponent(communicationId)
|
|
2290
|
+
url = "".concat(messageService, "/users/").concat(encodeURIComponent(userId), "/communications/").concat(encodeURIComponent(communicationId));
|
|
2364
2291
|
_context3.next = 4;
|
|
2365
2292
|
return fetch(url, {
|
|
2366
2293
|
method: 'GET',
|
|
@@ -2382,11 +2309,8 @@ function _fetchNotification() {
|
|
|
2382
2309
|
}
|
|
2383
2310
|
|
|
2384
2311
|
function NotificationPopupContent(_ref) {
|
|
2385
|
-
var _notification$content;
|
|
2386
2312
|
var notification = _ref.notification;
|
|
2387
|
-
|
|
2388
|
-
return /*#__PURE__*/jsxs("div", {
|
|
2389
|
-
className: popupContainer,
|
|
2313
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
2390
2314
|
children: [/*#__PURE__*/jsx("div", {
|
|
2391
2315
|
className: popupDate,
|
|
2392
2316
|
children: /*#__PURE__*/jsx("span", {
|
|
@@ -2396,39 +2320,33 @@ function NotificationPopupContent(_ref) {
|
|
|
2396
2320
|
className: popupDivider
|
|
2397
2321
|
}), /*#__PURE__*/jsx("div", {
|
|
2398
2322
|
className: popupContent,
|
|
2399
|
-
children:
|
|
2400
|
-
className: popupRichContent,
|
|
2401
|
-
children: /*#__PURE__*/jsx(ContentItemComponent, {
|
|
2402
|
-
configuration: notification.contentItem
|
|
2403
|
-
})
|
|
2404
|
-
}) : notification.content
|
|
2323
|
+
children: notification.content
|
|
2405
2324
|
})]
|
|
2406
2325
|
});
|
|
2407
2326
|
}
|
|
2408
2327
|
|
|
2409
|
-
function ownKeys$
|
|
2410
|
-
function _objectSpread$
|
|
2328
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2329
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2411
2330
|
function applyMarkReadUpdate(items, communicationId) {
|
|
2412
2331
|
var target = items.find(function (item) {
|
|
2413
2332
|
return item._id === communicationId;
|
|
2414
2333
|
});
|
|
2415
2334
|
if (!target || target.hasRead) {
|
|
2416
|
-
return
|
|
2335
|
+
return {
|
|
2336
|
+
items: items,
|
|
2337
|
+
decrement: false
|
|
2338
|
+
};
|
|
2417
2339
|
}
|
|
2418
|
-
return
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2340
|
+
return {
|
|
2341
|
+
items: items.map(function (item) {
|
|
2342
|
+
return item._id === communicationId ? _objectSpread$3(_objectSpread$3({}, item), {}, {
|
|
2343
|
+
hasRead: true
|
|
2344
|
+
}) : item;
|
|
2345
|
+
}),
|
|
2346
|
+
decrement: true
|
|
2347
|
+
};
|
|
2423
2348
|
}
|
|
2424
2349
|
|
|
2425
|
-
var PAGE_SIZE = 20;
|
|
2426
|
-
|
|
2427
|
-
/**
|
|
2428
|
-
* Notifications UI state. The bell badge and the dropdown row styling are driven by separate concepts:
|
|
2429
|
-
* `totalUnseen` (badge visibility) and `items[].hasRead` (per-row "unread" styling). Reads are not the same as seens.
|
|
2430
|
-
*/
|
|
2431
|
-
|
|
2432
2350
|
function useNotifications() {
|
|
2433
2351
|
var _useTranslation = useTranslation(),
|
|
2434
2352
|
t = _useTranslation.t;
|
|
@@ -2439,51 +2357,37 @@ function useNotifications() {
|
|
|
2439
2357
|
apiConfig = _useDivaCore$state.apiConfig,
|
|
2440
2358
|
organization = _useDivaCore$state.organization,
|
|
2441
2359
|
openModal = _useDivaCore.actions.openModal;
|
|
2442
|
-
var _useTranslation2 = useTranslation(),
|
|
2443
|
-
i18n = _useTranslation2.i18n;
|
|
2444
2360
|
var _useState = useState(0),
|
|
2445
2361
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
var _useState3 = useState(
|
|
2362
|
+
totalUnread = _useState2[0],
|
|
2363
|
+
setTotalUnread = _useState2[1];
|
|
2364
|
+
var _useState3 = useState(false),
|
|
2449
2365
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
var _useState5 = useState(
|
|
2366
|
+
open = _useState4[0],
|
|
2367
|
+
setOpen = _useState4[1];
|
|
2368
|
+
var _useState5 = useState([]),
|
|
2453
2369
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
var _useState7 = useState(
|
|
2370
|
+
items = _useState6[0],
|
|
2371
|
+
setItems = _useState6[1];
|
|
2372
|
+
var _useState7 = useState(false),
|
|
2457
2373
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
var _useState9 = useState(
|
|
2374
|
+
loading = _useState8[0],
|
|
2375
|
+
setLoading = _useState8[1];
|
|
2376
|
+
var _useState9 = useState(undefined),
|
|
2461
2377
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
var _useState11 = useState(false),
|
|
2465
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
2466
|
-
loadingMore = _useState12[0],
|
|
2467
|
-
setLoadingMore = _useState12[1];
|
|
2468
|
-
var _useState13 = useState(false),
|
|
2469
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
2470
|
-
hasMore = _useState14[0],
|
|
2471
|
-
setHasMore = _useState14[1];
|
|
2472
|
-
var _useState15 = useState(undefined),
|
|
2473
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
2474
|
-
errorMessage = _useState16[0],
|
|
2475
|
-
setErrorMessage = _useState16[1];
|
|
2378
|
+
errorMessage = _useState10[0],
|
|
2379
|
+
setErrorMessage = _useState10[1];
|
|
2476
2380
|
var userId = user === null || user === void 0 ? void 0 : user._id;
|
|
2477
2381
|
var organizationId = organization === null || organization === void 0 ? void 0 : organization._id;
|
|
2478
2382
|
var messageService = apiConfig.messageService;
|
|
2479
|
-
var enabled = !!userId && !!jwt
|
|
2383
|
+
var enabled = !!userId && !!jwt;
|
|
2480
2384
|
var apiContext = useMemo(function () {
|
|
2481
2385
|
return userId && jwt ? {
|
|
2482
2386
|
messageService: messageService,
|
|
2483
2387
|
jwt: jwt
|
|
2484
2388
|
} : null;
|
|
2485
2389
|
}, [userId, jwt, messageService]);
|
|
2486
|
-
var
|
|
2390
|
+
var loadCounts = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
2487
2391
|
var response;
|
|
2488
2392
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2489
2393
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2496,26 +2400,25 @@ function useNotifications() {
|
|
|
2496
2400
|
case 2:
|
|
2497
2401
|
_context.prev = 2;
|
|
2498
2402
|
_context.next = 5;
|
|
2499
|
-
return fetchNotifications(userId,
|
|
2403
|
+
return fetchNotifications(userId, {
|
|
2500
2404
|
limit: 0,
|
|
2501
|
-
|
|
2405
|
+
offset: 0
|
|
2502
2406
|
}, apiContext);
|
|
2503
2407
|
case 5:
|
|
2504
2408
|
response = _context.sent;
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
_context.next = 13;
|
|
2409
|
+
setTotalUnread(response.totalUnread);
|
|
2410
|
+
_context.next = 12;
|
|
2508
2411
|
break;
|
|
2509
|
-
case
|
|
2510
|
-
_context.prev =
|
|
2412
|
+
case 9:
|
|
2413
|
+
_context.prev = 9;
|
|
2511
2414
|
_context.t0 = _context["catch"](2);
|
|
2512
2415
|
setErrorMessage(t('navigator.notifications.error.list'));
|
|
2513
|
-
case
|
|
2416
|
+
case 12:
|
|
2514
2417
|
case "end":
|
|
2515
2418
|
return _context.stop();
|
|
2516
2419
|
}
|
|
2517
|
-
}, _callee, null, [[2,
|
|
2518
|
-
})), [apiContext, t, userId, organizationId
|
|
2420
|
+
}, _callee, null, [[2, 9]]);
|
|
2421
|
+
})), [apiContext, t, userId, organizationId]);
|
|
2519
2422
|
var loadPage = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
2520
2423
|
var response;
|
|
2521
2424
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -2529,79 +2432,37 @@ function useNotifications() {
|
|
|
2529
2432
|
case 2:
|
|
2530
2433
|
setLoading(true);
|
|
2531
2434
|
setErrorMessage(undefined);
|
|
2532
|
-
|
|
2533
|
-
_context2.
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
skip: 0
|
|
2435
|
+
_context2.prev = 4;
|
|
2436
|
+
_context2.next = 7;
|
|
2437
|
+
return fetchNotifications(userId, {
|
|
2438
|
+
limit: 20,
|
|
2439
|
+
offset: 0
|
|
2538
2440
|
}, apiContext);
|
|
2539
|
-
case
|
|
2441
|
+
case 7:
|
|
2540
2442
|
response = _context2.sent;
|
|
2541
2443
|
setItems(response.data);
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
_context2.next = 17;
|
|
2545
|
-
break;
|
|
2546
|
-
case 14:
|
|
2547
|
-
_context2.prev = 14;
|
|
2548
|
-
_context2.t0 = _context2["catch"](5);
|
|
2549
|
-
setErrorMessage(t('navigator.notifications.error.list'));
|
|
2550
|
-
case 17:
|
|
2551
|
-
_context2.prev = 17;
|
|
2552
|
-
setLoading(false);
|
|
2553
|
-
return _context2.finish(17);
|
|
2554
|
-
case 20:
|
|
2555
|
-
case "end":
|
|
2556
|
-
return _context2.stop();
|
|
2557
|
-
}
|
|
2558
|
-
}, _callee2, null, [[5, 14, 17, 20]]);
|
|
2559
|
-
})), [apiContext, t, userId, organizationId, i18n.language]);
|
|
2560
|
-
var loadMore = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
2561
|
-
var response;
|
|
2562
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
2563
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
2564
|
-
case 0:
|
|
2565
|
-
if (!(!apiContext || !userId || loadingMore || !hasMore)) {
|
|
2566
|
-
_context3.next = 2;
|
|
2567
|
-
break;
|
|
2568
|
-
}
|
|
2569
|
-
return _context3.abrupt("return");
|
|
2570
|
-
case 2:
|
|
2571
|
-
setLoadingMore(true);
|
|
2572
|
-
_context3.prev = 3;
|
|
2573
|
-
_context3.next = 6;
|
|
2574
|
-
return fetchNotifications(userId, i18n.language, {
|
|
2575
|
-
limit: PAGE_SIZE,
|
|
2576
|
-
skip: items.length
|
|
2577
|
-
}, apiContext);
|
|
2578
|
-
case 6:
|
|
2579
|
-
response = _context3.sent;
|
|
2580
|
-
setItems(function (prev) {
|
|
2581
|
-
return [].concat(_toConsumableArray(prev), _toConsumableArray(response.data));
|
|
2582
|
-
});
|
|
2583
|
-
setTotalUnseen(response.totalUnseen);
|
|
2584
|
-
setHasMore(items.length + response.data.length < response.total);
|
|
2585
|
-
_context3.next = 15;
|
|
2444
|
+
setTotalUnread(response.totalUnread);
|
|
2445
|
+
_context2.next = 15;
|
|
2586
2446
|
break;
|
|
2587
2447
|
case 12:
|
|
2588
|
-
|
|
2589
|
-
|
|
2448
|
+
_context2.prev = 12;
|
|
2449
|
+
_context2.t0 = _context2["catch"](4);
|
|
2590
2450
|
setErrorMessage(t('navigator.notifications.error.list'));
|
|
2591
2451
|
case 15:
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
return
|
|
2452
|
+
_context2.prev = 15;
|
|
2453
|
+
setLoading(false);
|
|
2454
|
+
return _context2.finish(15);
|
|
2595
2455
|
case 18:
|
|
2596
2456
|
case "end":
|
|
2597
|
-
return
|
|
2457
|
+
return _context2.stop();
|
|
2598
2458
|
}
|
|
2599
|
-
},
|
|
2600
|
-
})), [apiContext, t, userId,
|
|
2459
|
+
}, _callee2, null, [[4, 12, 15, 18]]);
|
|
2460
|
+
})), [apiContext, t, userId, organizationId]);
|
|
2601
2461
|
useEffect(function () {
|
|
2602
|
-
void
|
|
2603
|
-
}, [
|
|
2462
|
+
void loadCounts();
|
|
2463
|
+
}, [loadCounts]);
|
|
2604
2464
|
var onBellClick = function onBellClick(event) {
|
|
2465
|
+
event.stopPropagation();
|
|
2605
2466
|
if (!userId) {
|
|
2606
2467
|
return;
|
|
2607
2468
|
}
|
|
@@ -2613,62 +2474,61 @@ function useNotifications() {
|
|
|
2613
2474
|
setOpen(false);
|
|
2614
2475
|
};
|
|
2615
2476
|
var _onSelect = useCallback(/*#__PURE__*/function () {
|
|
2616
|
-
var
|
|
2617
|
-
var notificationData;
|
|
2618
|
-
return _regeneratorRuntime.wrap(function
|
|
2619
|
-
while (1) switch (
|
|
2477
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(communicationId) {
|
|
2478
|
+
var notificationData, updated;
|
|
2479
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
2480
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
2620
2481
|
case 0:
|
|
2621
2482
|
if (!(!apiContext || !userId)) {
|
|
2622
|
-
|
|
2483
|
+
_context3.next = 2;
|
|
2623
2484
|
break;
|
|
2624
2485
|
}
|
|
2625
|
-
return
|
|
2486
|
+
return _context3.abrupt("return");
|
|
2626
2487
|
case 2:
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
return fetchNotification(userId, communicationId,
|
|
2488
|
+
_context3.prev = 2;
|
|
2489
|
+
_context3.next = 5;
|
|
2490
|
+
return fetchNotification(userId, communicationId, apiContext);
|
|
2630
2491
|
case 5:
|
|
2631
|
-
notificationData =
|
|
2492
|
+
notificationData = _context3.sent;
|
|
2632
2493
|
setOpen(false);
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2494
|
+
updated = applyMarkReadUpdate(items, communicationId);
|
|
2495
|
+
setItems(updated.items);
|
|
2496
|
+
if (updated.decrement) {
|
|
2497
|
+
setTotalUnread(function (c) {
|
|
2498
|
+
return Math.max(0, c - 1);
|
|
2499
|
+
});
|
|
2500
|
+
}
|
|
2636
2501
|
openModal({
|
|
2637
2502
|
rejectByIcon: true,
|
|
2638
|
-
title:
|
|
2639
|
-
|
|
2640
|
-
}),
|
|
2641
|
-
width: 720,
|
|
2503
|
+
title: notificationData.subject,
|
|
2504
|
+
width: 520,
|
|
2642
2505
|
maxWidth: '95%',
|
|
2643
2506
|
content: /*#__PURE__*/jsx(NotificationPopupContent, {
|
|
2644
2507
|
notification: notificationData
|
|
2645
|
-
})
|
|
2646
|
-
dontRenderForm: true
|
|
2508
|
+
})
|
|
2647
2509
|
});
|
|
2648
|
-
|
|
2510
|
+
_context3.next = 16;
|
|
2649
2511
|
break;
|
|
2650
|
-
case
|
|
2651
|
-
|
|
2652
|
-
|
|
2512
|
+
case 13:
|
|
2513
|
+
_context3.prev = 13;
|
|
2514
|
+
_context3.t0 = _context3["catch"](2);
|
|
2653
2515
|
setErrorMessage(t('navigator.notifications.error.open'));
|
|
2654
|
-
case
|
|
2516
|
+
case 16:
|
|
2655
2517
|
case "end":
|
|
2656
|
-
return
|
|
2518
|
+
return _context3.stop();
|
|
2657
2519
|
}
|
|
2658
|
-
},
|
|
2520
|
+
}, _callee3, null, [[2, 13]]);
|
|
2659
2521
|
}));
|
|
2660
2522
|
return function (_x) {
|
|
2661
|
-
return
|
|
2523
|
+
return _ref3.apply(this, arguments);
|
|
2662
2524
|
};
|
|
2663
|
-
}(), [apiContext, openModal, t, userId, setOpen]);
|
|
2525
|
+
}(), [apiContext, items, openModal, t, userId, setOpen]);
|
|
2664
2526
|
return {
|
|
2665
2527
|
enabled: enabled,
|
|
2666
|
-
|
|
2528
|
+
totalUnread: totalUnread,
|
|
2667
2529
|
open: open,
|
|
2668
2530
|
items: items,
|
|
2669
2531
|
loading: loading,
|
|
2670
|
-
loadingMore: loadingMore,
|
|
2671
|
-
hasMore: hasMore,
|
|
2672
2532
|
errorMessage: errorMessage,
|
|
2673
2533
|
onBellClick: onBellClick,
|
|
2674
2534
|
onSelect: function onSelect(id) {
|
|
@@ -2677,9 +2537,6 @@ function useNotifications() {
|
|
|
2677
2537
|
setOpen: setOpen,
|
|
2678
2538
|
onRefresh: function onRefresh() {
|
|
2679
2539
|
return void loadPage();
|
|
2680
|
-
},
|
|
2681
|
-
onLoadMore: function onLoadMore() {
|
|
2682
|
-
return void loadMore();
|
|
2683
2540
|
}
|
|
2684
2541
|
};
|
|
2685
2542
|
}
|
|
@@ -2691,11 +2548,11 @@ var scannerPlaceholder = "scanner-placeholder-HFpri";
|
|
|
2691
2548
|
var scanner = "scanner-8R-jp";
|
|
2692
2549
|
var hidden = "hidden-C49rQ";
|
|
2693
2550
|
var wrapper$1 = "wrapper-urPnU";
|
|
2694
|
-
var css_248z$
|
|
2695
|
-
styleInject(css_248z$
|
|
2551
|
+
var css_248z$5 = ".button-gd-lv {\n min-width: 0 !important;\n}\n\n.button-gd-lv {\n margin: 0 16px;\n text-wrap: nowrap;\n overflow: hidden;\n max-width: 40px;\n transition: max-width 200ms ease;\n}\n\n.button-gd-lv .MuiButton-startIcon {\n margin-right: 0;\n margin-left: 0;\n transition: margin-right 200ms ease;\n}\n\n.label-tExJZ {\n display: inline-block;\n opacity: 0;\n width: 0;\n white-space: nowrap;\n overflow: hidden;\n margin-left: 0;\n transition:\n opacity 150ms ease,\n width 200ms ease,\n margin-left 200ms ease;\n}\n\n.button-gd-lv:hover {\n max-width: 240px;\n}\n\n.button-gd-lv:hover .MuiButton-startIcon {\n margin-right: 8px;\n}\n\n.button-gd-lv:hover .label-tExJZ {\n opacity: 1;\n width: auto;\n margin-left: 4px;\n}\n\n.scanner-icon-ve-jf {\n background-image: url(\"data:image/svg+xml,%3Csvg enable-background%3D%22new 0 0 24 24%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 width%3D%2224%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22m0 0h24v24h-24z%22 fill%3D%22none%22%2F%3E%3Cpath d%3D%22m9.5 6.5v3h-3v-3zm1.5-1.5h-6v6h6zm-1.5 9.5v3h-3v-3zm1.5-1.5h-6v6h6zm6.5-6.5v3h-3v-3zm1.5-1.5h-6v6h6zm-6 8h1.5v1.5h-1.5zm1.5 1.5h1.5v1.5h-1.5zm1.5-1.5h1.5v1.5h-1.5zm-3 3h1.5v1.5h-1.5zm1.5 1.5h1.5v1.5h-1.5zm1.5-1.5h1.5v1.5h-1.5zm1.5-1.5h1.5v1.5h-1.5zm0 3h1.5v1.5h-1.5zm4.5-10.5h-2v-3h-3v-2h5zm0 15v-5h-2v3h-3v2zm-20 0h5v-2h-3v-3h-2zm0-20v5h2v-3h3v-2z%22%2F%3E%3C%2Fsvg%3E\");\n background-repeat: no-repeat;\n background-size: contain;\n height: 100px;\n width: 100px;\n margin: 10px 0;\n}\n\n.scanner-placeholder-HFpri {\n margin: 0 auto;\n width: -moz-fit-content;\n width: fit-content;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.scanner-8R-jp {\n width: 600px;\n max-width: 100%;\n margin-top: 10px;\n}\n\n.hidden-C49rQ {\n display: none;\n}\n\n.wrapper-urPnU {\n margin-top: -20px;\n}\n";
|
|
2552
|
+
styleInject(css_248z$5);
|
|
2696
2553
|
|
|
2697
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2698
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2554
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2555
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2699
2556
|
var LOG$1 = getLogger('Framework', 'QrCoedScanner');
|
|
2700
2557
|
/**
|
|
2701
2558
|
* Parses the given url and returns the diva number if it is a valid diva url.
|
|
@@ -3046,11 +2903,11 @@ function openResultInCurrentOrg(result, openComponent, closeModal) {
|
|
|
3046
2903
|
divaNr: result.divaNr
|
|
3047
2904
|
};
|
|
3048
2905
|
if (result.orderStatus === 'SEND') {
|
|
3049
|
-
params = _objectSpread(_objectSpread({}, params), {}, {
|
|
2906
|
+
params = _objectSpread$2(_objectSpread$2({}, params), {}, {
|
|
3050
2907
|
assignNewDivaNr: 'true'
|
|
3051
2908
|
});
|
|
3052
2909
|
} else {
|
|
3053
|
-
params = _objectSpread(_objectSpread({}, params), {}, {
|
|
2910
|
+
params = _objectSpread$2(_objectSpread$2({}, params), {}, {
|
|
3054
2911
|
check: '1'
|
|
3055
2912
|
});
|
|
3056
2913
|
}
|
|
@@ -3554,8 +3411,6 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3554
3411
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3555
3412
|
openProfile = _useState2[0],
|
|
3556
3413
|
setOpenProfile = _useState2[1];
|
|
3557
|
-
var notificationsAnchorRef = useRef(null);
|
|
3558
|
-
var profileAnchorRef = useRef(null);
|
|
3559
3414
|
var notifications = useNotifications();
|
|
3560
3415
|
|
|
3561
3416
|
//in the case the core is faster initalized than the first render we have to set this state async to guarantee the animation
|
|
@@ -3568,12 +3423,20 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3568
3423
|
return setHeaderLoading(false);
|
|
3569
3424
|
}, 1);
|
|
3570
3425
|
}, []);
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3426
|
+
useEffect(function () {
|
|
3427
|
+
var checkIfClickedOutside = function checkIfClickedOutside(e) {
|
|
3428
|
+
if (openProfile) {
|
|
3429
|
+
setOpenProfile(false);
|
|
3430
|
+
}
|
|
3431
|
+
if (notifications.open) {
|
|
3432
|
+
notifications.setOpen(false);
|
|
3433
|
+
}
|
|
3434
|
+
};
|
|
3435
|
+
document.addEventListener('click', checkIfClickedOutside);
|
|
3436
|
+
return function () {
|
|
3437
|
+
document.removeEventListener('click', checkIfClickedOutside);
|
|
3438
|
+
};
|
|
3439
|
+
}, [openProfile, notifications.open, notifications.setOpen]);
|
|
3577
3440
|
var onClickProfile = function onClickProfile(e) {
|
|
3578
3441
|
if (user) {
|
|
3579
3442
|
setOpenProfile(!openProfile);
|
|
@@ -3581,6 +3444,7 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3581
3444
|
} else {
|
|
3582
3445
|
showLoginWindow();
|
|
3583
3446
|
}
|
|
3447
|
+
e.stopPropagation();
|
|
3584
3448
|
};
|
|
3585
3449
|
var onBellClick = function onBellClick(e) {
|
|
3586
3450
|
setOpenProfile(false);
|
|
@@ -3589,7 +3453,6 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3589
3453
|
|
|
3590
3454
|
//still show buttons on tablet in landscape mode
|
|
3591
3455
|
var showButtons = !isMobile || isTablet && !isPortrait;
|
|
3592
|
-
var showProfileTriggers = showButtons && (showOrgName || showUserName);
|
|
3593
3456
|
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
3594
3457
|
children: [/*#__PURE__*/jsxs("div", {
|
|
3595
3458
|
id: "diva-header",
|
|
@@ -3614,21 +3477,15 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3614
3477
|
className: customArea,
|
|
3615
3478
|
children: customHeaderElement()
|
|
3616
3479
|
}), notifications.enabled && /*#__PURE__*/jsx(NotificationsBell, {
|
|
3617
|
-
|
|
3618
|
-
totalUnseen: notifications.totalUnseen,
|
|
3619
|
-
open: notifications.open,
|
|
3480
|
+
totalUnread: notifications.totalUnread,
|
|
3620
3481
|
onClick: onBellClick
|
|
3621
|
-
}), /*#__PURE__*/
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
}), /*#__PURE__*/jsx(ProfileImg, {
|
|
3629
|
-
onClickProfile: onClickProfile,
|
|
3630
|
-
open: openProfile
|
|
3631
|
-
})]
|
|
3482
|
+
}), showButtons && (showOrgName || showUserName) && /*#__PURE__*/jsx(OrganizationName, {
|
|
3483
|
+
showOrgName: showOrgName,
|
|
3484
|
+
showUserName: showUserName,
|
|
3485
|
+
onClickProfile: onClickProfile
|
|
3486
|
+
}), /*#__PURE__*/jsx(ProfileImg, {
|
|
3487
|
+
onClickProfile: onClickProfile,
|
|
3488
|
+
open: openProfile
|
|
3632
3489
|
}), !showLogin && availableLanguages.length > 1 && /*#__PURE__*/jsx(LanguageSelector, {})]
|
|
3633
3490
|
})]
|
|
3634
3491
|
}), (breadcrumbs === null || breadcrumbs === void 0 || (_breadcrumbs$breadcru = breadcrumbs.breadcrumbs.path) === null || _breadcrumbs$breadcru === void 0 ? void 0 : _breadcrumbs$breadcru.length) && /*#__PURE__*/jsx("div", {
|
|
@@ -3637,29 +3494,22 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3637
3494
|
})]
|
|
3638
3495
|
}), user && showLogin && /*#__PURE__*/jsx(Profil, {
|
|
3639
3496
|
open: openProfile,
|
|
3640
|
-
setOpen: setOpenProfile
|
|
3641
|
-
anchorEl: profileAnchorRef.current,
|
|
3642
|
-
onClose: closeProfile
|
|
3497
|
+
setOpen: setOpenProfile
|
|
3643
3498
|
}), notifications.enabled && /*#__PURE__*/jsx(NotificationsDropdown, {
|
|
3644
3499
|
open: notifications.open,
|
|
3645
|
-
anchorEl: notificationsAnchorRef.current,
|
|
3646
|
-
onClose: closeNotifications,
|
|
3647
3500
|
items: notifications.items,
|
|
3648
3501
|
loading: notifications.loading,
|
|
3649
|
-
loadingMore: notifications.loadingMore,
|
|
3650
|
-
hasMore: notifications.hasMore,
|
|
3651
3502
|
errorMessage: notifications.errorMessage,
|
|
3652
3503
|
onSelect: notifications.onSelect,
|
|
3653
|
-
onRefresh: notifications.onRefresh
|
|
3654
|
-
onLoadMore: notifications.onLoadMore
|
|
3504
|
+
onRefresh: notifications.onRefresh
|
|
3655
3505
|
})]
|
|
3656
3506
|
});
|
|
3657
3507
|
});
|
|
3658
3508
|
|
|
3659
3509
|
var footer = "footer-6heXz";
|
|
3660
3510
|
var footerLogo = "footer-logo-OYpy2";
|
|
3661
|
-
var css_248z$
|
|
3662
|
-
styleInject(css_248z$
|
|
3511
|
+
var css_248z$4 = ".footer-6heXz {\n position: absolute;\n bottom: 0;\n left: 0;\n height: 36px;\n width: 100px;\n background-color: rgba(125, 125, 125, 0.3);\n border-radius: 18px;\n left: 10px;\n bottom: 10px;\n}\n\n.footer-logo-OYpy2 {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 1000 293.65%22%3E%3Cpath d%3D%22M250.89%2C147.3c-3.18-74-30.4-143.18-141.73-143.18L0%2C4.26A307.86%2C307.86%2C0%2C0%2C1%2C26.12%2C60.7h74.2c52.86%2C0%2C76%2C25.68%2C78.61%2C85.29%2C2.66%2C61.81-18.29%2C87.92-71.15%2C87.92H79.2l-46.71.52a287.29%2C287.29%2C0%2C0%2C1-20%2C53.88h109c111.32%2C0%2C132.67-67%2C129.48-141M306.84%2C289h71.23V0a300.07%2C300.07%2C0%2C0%2C1-71.23%2C25.92Zm318.8.62L726.59.85a300%2C300%2C0%2C0%2C1-83.65%2C32.24L577.11%2C224%2C511.29%2C33.09A300%2C300%2C0%2C0%2C1%2C427.64.85l101%2C288.76Zm374.36%2C4L899.05%2C4.91H802L775.14%2C81.74%2C701.05%2C293.65A300.32%2C300.32%2C0%2C0%2C1%2C785%2C261.35l6.79-21%2C19.14-57.54L850.52%2C62l40.07%2C120.85%2C18.7%2C57.54%2C7%2C21A300.2%2C300.2%2C0%2C0%2C1%2C1000%2C293.65%22 fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E\");\n background-repeat: no-repeat;\n background-size: 65%;\n height: 100%;\n width: 100%;\n z-index: 795;\n background-position: center;\n}\n";
|
|
3512
|
+
styleInject(css_248z$4);
|
|
3663
3513
|
|
|
3664
3514
|
function Footer () {
|
|
3665
3515
|
var _useDivaCore = useDivaCore(),
|
|
@@ -3688,8 +3538,8 @@ var mobileBcGroup = "mobile-bc-group-qpSWw";
|
|
|
3688
3538
|
var mobileBreadcrumb = "mobile-breadcrumb-AUdyP";
|
|
3689
3539
|
var mobileSelected = "mobile-selected-9UuOs";
|
|
3690
3540
|
var mobileSplitter = "mobile-splitter-MPW46";
|
|
3691
|
-
var css_248z$
|
|
3692
|
-
styleInject(css_248z$
|
|
3541
|
+
var css_248z$3 = ".menu-zxz3X {\n width: 100vw;\n max-width: 400px;\n height: 100%;\n background-color: #f2f2f2;\n transition: transform 0.3s cubic-bezier(0, 0.52, 0, 1);\n overflow: auto;\n box-sizing: border-box;\n padding-top: 32px;\n padding-bottom: 32px;\n}\n\n.menu-zxz3X > img {\n margin-left: 16px;\n max-width: 146px;\n max-height: 46px;\n}\n\n.show-Nh7LC {\n transform: translate3d(0px, 0, 0);\n overflow: hidden;\n}\n\n.close-icon-w0Qa8 {\n position: relative;\n opacity: 0.3;\n margin: 16px 16px 0 0;\n width: 32px;\n height: 32px;\n z-index: 300;\n align-self: flex-end;\n cursor: pointer;\n margin: 16px;\n width: 50px;\n height: 40px;\n}\n\n.menu-group-MIbAN {\n margin: 40px 16px 0 16px;\n display: flex;\n flex-direction: column;\n}\n\n.side-button-CA5qH {\n width: 100%;\n background: #f8f8f8;\n padding: 10px 7px;\n border-radius: 5px;\n cursor: pointer;\n box-sizing: border-box;\n margin-top: 6px;\n line-height: 16px;\n position: relative;\n}\n\n.side-button-CA5qH:hover {\n background: #e1e2e1;\n}\n\n.link-2uP9-::after {\n background: url(\"data:image/svg+xml,%3Csvg viewBox%3D%220 0 8 14%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M5.54795 7.20988L0.682832 2.2301C0.294525 1.83264 0.294525 1.18823 0.682832 0.79077C1.07114 0.393311 1.70071 0.393311 2.08902 0.79077L7.65722 6.49021C8.04553 6.88767 8.04553 7.53208 7.65722 7.92954L2.08902 13.629C1.70071 14.0264 1.07114 14.0264 0.682832 13.629C0.294525 13.2315 0.294525 12.5871 0.682832 12.1897L5.54795 7.20988Z%22 fill%3D%22%23BBBBBB%22%2F%3E%3C%2Fsvg%3E\") no-repeat center;\n content: '';\n display: block;\n width: 10px;\n height: 10px;\n float: right;\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n margin-right: 7px;\n}\n\n.mobile-footer-E-HE9 {\n height: 120px;\n background-color: #272727;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n.mobile-footer-links-iYfrX {\n display: flex;\n font-size: small;\n color: #b6b6b6;\n justify-content: space-around;\n margin-top: 20px;\n}\n\n.mobile-footer-links-iYfrX a {\n cursor: pointer;\n color: #b6b6b6;\n}\n\n.mobile-footer-logo-dytg6 {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 1000 293.65%22%3E%3Cpath d%3D%22M250.89%2C147.3c-3.18-74-30.4-143.18-141.73-143.18L0%2C4.26A307.86%2C307.86%2C0%2C0%2C1%2C26.12%2C60.7h74.2c52.86%2C0%2C76%2C25.68%2C78.61%2C85.29%2C2.66%2C61.81-18.29%2C87.92-71.15%2C87.92H79.2l-46.71.52a287.29%2C287.29%2C0%2C0%2C1-20%2C53.88h109c111.32%2C0%2C132.67-67%2C129.48-141M306.84%2C289h71.23V0a300.07%2C300.07%2C0%2C0%2C1-71.23%2C25.92Zm318.8.62L726.59.85a300%2C300%2C0%2C0%2C1-83.65%2C32.24L577.11%2C224%2C511.29%2C33.09A300%2C300%2C0%2C0%2C1%2C427.64.85l101%2C288.76Zm374.36%2C4L899.05%2C4.91H802L775.14%2C81.74%2C701.05%2C293.65A300.32%2C300.32%2C0%2C0%2C1%2C785%2C261.35l6.79-21%2C19.14-57.54L850.52%2C62l40.07%2C120.85%2C18.7%2C57.54%2C7%2C21A300.2%2C300.2%2C0%2C0%2C1%2C1000%2C293.65%22 fill%3D%22%23b3b3b3%22%2F%3E%3C%2Fsvg%3E\");\n background-repeat: no-repeat;\n height: 20px;\n width: 70px;\n position: absolute;\n left: 50%;\n bottom: 20px;\n transform: translateX(-50%);\n}\n\n.mobile-bc-group-qpSWw {\n display: flex;\n border-top: 0.8px solid #b6b6b7;\n padding: 12px 16px;\n border-bottom: 0.8px solid #b6b6b7;\n margin-top: 40px;\n overflow: auto;\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n}\n\n.mobile-bc-group-qpSWw::-webkit-scrollbar {\n display: none;\n}\n\n.mobile-breadcrumb-AUdyP:hover {\n font-weight: 300;\n text-decoration: underline;\n transition: all 200ms;\n}\n\n.mobile-selected-9UuOs {\n font-weight: 300;\n text-decoration: underline;\n color: var(--diva-theme-palette-primary-main);\n}\n\n.mobile-splitter-MPW46:first-of-type {\n display: none;\n}\n\n.mobile-splitter-MPW46 {\n background: url(\"data:image/svg+xml,%3Csvg viewBox%3D%220 0 8 14%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M5.54795 7.20988L0.682832 2.2301C0.294525 1.83264 0.294525 1.18823 0.682832 0.79077C1.07114 0.393311 1.70071 0.393311 2.08902 0.79077L7.65722 6.49021C8.04553 6.88767 8.04553 7.53208 7.65722 7.92954L2.08902 13.629C1.70071 14.0264 1.07114 14.0264 0.682832 13.629C0.294525 13.2315 0.294525 12.5871 0.682832 12.1897L5.54795 7.20988Z%22 fill%3D%22%23BBBBBB%22%2F%3E%3C%2Fsvg%3E\") no-repeat center;\n min-width: 10px;\n height: 10px;\n margin: auto 5px;\n}\n";
|
|
3542
|
+
styleInject(css_248z$3);
|
|
3693
3543
|
|
|
3694
3544
|
function Language (_ref) {
|
|
3695
3545
|
var data = _ref.data,
|
|
@@ -3725,7 +3575,7 @@ function Language (_ref) {
|
|
|
3725
3575
|
className: classNames(selector, open ? open$1 : languageClosed),
|
|
3726
3576
|
children: data.map(function (l) {
|
|
3727
3577
|
return /*#__PURE__*/jsx("div", {
|
|
3728
|
-
className: classNames(item, l == selectedLang ? selected$
|
|
3578
|
+
className: classNames(item$1, l == selectedLang ? selected$2 : undefined),
|
|
3729
3579
|
onClick: function onClick() {
|
|
3730
3580
|
onChange(l);
|
|
3731
3581
|
},
|
|
@@ -3879,9 +3729,1031 @@ function Menu (_ref) {
|
|
|
3879
3729
|
}
|
|
3880
3730
|
|
|
3881
3731
|
var wrapper = "wrapper-811ne";
|
|
3882
|
-
var css_248z = ".wrapper-811ne {\n display: flex;\n position: relative;\n height: 100%;\n flex-direction: column;\n}\n";
|
|
3732
|
+
var css_248z$2 = ".wrapper-811ne {\n display: flex;\n position: relative;\n height: 100%;\n flex-direction: column;\n}\n";
|
|
3733
|
+
styleInject(css_248z$2);
|
|
3734
|
+
|
|
3735
|
+
var item = "item-pGwu4";
|
|
3736
|
+
var text = "text-nRjLJ";
|
|
3737
|
+
var selected = "selected-z25La";
|
|
3738
|
+
var openClass = "open-class-gFhWe";
|
|
3739
|
+
var row = "row-I58t6";
|
|
3740
|
+
var selectable = "selectable-2W-K7";
|
|
3741
|
+
var leftSpace = "left-space-vcauM";
|
|
3742
|
+
var arrow = "arrow-egJ6F";
|
|
3743
|
+
var list = "list-4f7FZ";
|
|
3744
|
+
var tooltip = "tooltip-gsR2r";
|
|
3745
|
+
var disabled = "disabled-RYfn7";
|
|
3746
|
+
var disabledClick = "disabled-click-74X-4";
|
|
3747
|
+
var css_248z$1 = ".item-pGwu4 {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 4px;\n}\n.text-nRjLJ {\n font-weight: normal;\n color: gray;\n}\n\n.selected-z25La {\n font-weight: 700;\n text-decoration: underline;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 20px;\n flex-shrink: 0;\n}\n\n.open-class-gFhWe .selected-z25La {\n height: -moz-fit-content;\n height: fit-content;\n}\n\n.row-I58t6 {\n display: flex;\n flex-direction: column;\n width: 100%;\n position: relative;\n height: -moz-fit-content;\n height: fit-content;\n}\n\n.row-I58t6 .MuiFormControl-root {\n margin-left: 25px;\n margin-top: 0;\n}\n\n.row-I58t6 .MuiInputBase-root {\n font-size: small;\n margin-top: 0;\n}\n\n.selectable-2W-K7 {\n cursor: pointer;\n line-height: 20px;\n padding-left: 8px;\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: calc(100% - 20px);\n color: inherit;\n transition: color 0.3s ease;\n}\n\n.selectable-2W-K7:hover {\n font-weight: 700;\n color: var(--diva-theme-palette-primary-main);\n}\n\n.left-space-vcauM {\n width: 16px;\n height: 20px;\n}\n\n.arrow-egJ6F {\n background: center / 50% no-repeat url(\"data:image/svg+xml,%3Csvg width%3D%227%22 height%3D%2211%22 viewBox%3D%220 0 7 11%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M4.24303 5.41303L0.517911 1.73629C0.220592 1.44283 0.220592 0.967042 0.517911 0.673584C0.81523 0.380127 1.29728 0.380127 1.5946 0.673584L5.85806 4.88168C6.15538 5.17513 6.15538 5.65092 5.85806 5.94438L1.5946 10.1525C1.29728 10.4459 0.81523 10.4459 0.517911 10.1525C0.220592 9.85902 0.220592 9.38323 0.517911 9.08977L4.24303 5.41303Z%22 fill%3D%22%23B6B6B7%22%2F%3E%3C%2Fsvg%3E\");\n transition: transform 0.3s ease;\n}\n\n.arrow-egJ6F:hover {\n cursor: pointer;\n}\n\n.open-class-gFhWe .arrow-egJ6F {\n transform: rotate(90deg);\n height: 16px;\n width: 16px;\n}\n\n.list-4f7FZ {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n/* ===== Scrollbar CSS ===== */\n/* Firefox */\n.list-4f7FZ {\n scrollbar-width: thin;\n scrollbar-color: #7b7b7b #dfdfdf;\n}\n\n/* Chrome, Edge, and Safari */\n.list-4f7FZ::-webkit-scrollbar {\n width: 6px;\n}\n\n.list-4f7FZ::-webkit-scrollbar-track {\n background: #dfdfdf;\n border-radius: 3px;\n}\n\n.list-4f7FZ::-webkit-scrollbar-thumb {\n background-color: #7b7b7b;\n border-radius: 3px;\n border: 0px solid #ffffff;\n}\n\n.tooltip-gsR2r {\n background-color: #1b181a;\n color: white;\n padding: 6px;\n border-radius: 4px;\n font-size: 14px;\n z-index: 12;\n}\n\n.disabled-RYfn7 {\n color: grey !important;\n}\n\n.disabled-RYfn7 {\n opacity: 0.8;\n}\n.disabled-click-74X-4 {\n cursor: normal;\n}\n\n.search-87aXI {\n background-color: #fff;\n border-radius: 16px;\n}\n";
|
|
3748
|
+
styleInject(css_248z$1);
|
|
3749
|
+
|
|
3750
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3751
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3752
|
+
function TextElement(_ref) {
|
|
3753
|
+
var _theme$typography;
|
|
3754
|
+
var data = _ref.data,
|
|
3755
|
+
onSelect = _ref.onSelect,
|
|
3756
|
+
multi = _ref.multi;
|
|
3757
|
+
var textElementRef = useRef(null);
|
|
3758
|
+
var _useDivaCore = useDivaCore(),
|
|
3759
|
+
theme = _useDivaCore.state.theme;
|
|
3760
|
+
var compareSize = function compareSize() {
|
|
3761
|
+
var compare = textElementRef.current.scrollWidth > textElementRef.current.clientWidth;
|
|
3762
|
+
setHover(compare);
|
|
3763
|
+
};
|
|
3764
|
+
useEffect(function () {
|
|
3765
|
+
compareSize();
|
|
3766
|
+
window.addEventListener('resize', compareSize);
|
|
3767
|
+
return function () {
|
|
3768
|
+
window.removeEventListener('resize', compareSize);
|
|
3769
|
+
};
|
|
3770
|
+
}, []);
|
|
3771
|
+
var _useMemo = useMemo(function () {
|
|
3772
|
+
if (!data.displayName.includes('/')) {
|
|
3773
|
+
return {
|
|
3774
|
+
displayName: data.displayName,
|
|
3775
|
+
tooltipText: data.displayName,
|
|
3776
|
+
isShortend: false
|
|
3777
|
+
};
|
|
3778
|
+
}
|
|
3779
|
+
var isShortend = false;
|
|
3780
|
+
var split = data.displayName.split('/');
|
|
3781
|
+
if (split[0] && split[0].length > 10) {
|
|
3782
|
+
split[0] = split[0].slice(0, 10) + '...';
|
|
3783
|
+
isShortend = true;
|
|
3784
|
+
}
|
|
3785
|
+
if (split.length >= 3) {
|
|
3786
|
+
split[1] = '...';
|
|
3787
|
+
split[2] = split[split.length - 1];
|
|
3788
|
+
isShortend = true;
|
|
3789
|
+
}
|
|
3790
|
+
return {
|
|
3791
|
+
displayName: split.slice(0, 3).join('/'),
|
|
3792
|
+
tooltipText: data.displayName,
|
|
3793
|
+
isShortend: isShortend
|
|
3794
|
+
};
|
|
3795
|
+
}, [data.displayName]),
|
|
3796
|
+
displayName = _useMemo.displayName,
|
|
3797
|
+
tooltipText = _useMemo.tooltipText,
|
|
3798
|
+
isShortend = _useMemo.isShortend;
|
|
3799
|
+
var _useState = useState(false),
|
|
3800
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3801
|
+
hoverStatus = _useState2[0],
|
|
3802
|
+
setHover = _useState2[1];
|
|
3803
|
+
var _useHover = useHover(),
|
|
3804
|
+
_useHover2 = _slicedToArray(_useHover, 2),
|
|
3805
|
+
isOver = _useHover2[0],
|
|
3806
|
+
hoverProps = _useHover2[1];
|
|
3807
|
+
var _useLayer = useLayer({
|
|
3808
|
+
isOpen: isOver && (hoverStatus || isShortend),
|
|
3809
|
+
snap: true,
|
|
3810
|
+
placement: 'left-center'
|
|
3811
|
+
}),
|
|
3812
|
+
triggerProps = _useLayer.triggerProps,
|
|
3813
|
+
layerProps = _useLayer.layerProps,
|
|
3814
|
+
arrowProps = _useLayer.arrowProps,
|
|
3815
|
+
renderLayer = _useLayer.renderLayer;
|
|
3816
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
3817
|
+
children: [/*#__PURE__*/jsx("div", _objectSpread$1(_objectSpread$1(_objectSpread$1({}, triggerProps), hoverProps), {}, {
|
|
3818
|
+
style: {
|
|
3819
|
+
width: 'calc(100% - 30px)'
|
|
3820
|
+
},
|
|
3821
|
+
children: /*#__PURE__*/jsx("div", {
|
|
3822
|
+
ref: textElementRef,
|
|
3823
|
+
className: classNames(text, selectable, data.isSelected ? selected : undefined, data.type ? undefined : disabled, !data.hasChildren ? disabledClick : undefined),
|
|
3824
|
+
onClick: function onClick() {
|
|
3825
|
+
return !data.isSelected || multi ? onSelect(data, !data.isSelected) : false;
|
|
3826
|
+
} //with multi we can select and deselct, otherwise deselect is not allowed
|
|
3827
|
+
,
|
|
3828
|
+
children: displayName
|
|
3829
|
+
})
|
|
3830
|
+
})), isOver && (hoverStatus || isShortend) && renderLayer(/*#__PURE__*/jsxs("div", _objectSpread$1(_objectSpread$1({
|
|
3831
|
+
className: tooltip
|
|
3832
|
+
}, layerProps), {}, {
|
|
3833
|
+
style: _objectSpread$1(_objectSpread$1({}, {
|
|
3834
|
+
fontFamily: theme === null || theme === void 0 || (_theme$typography = theme.typography) === null || _theme$typography === void 0 ? void 0 : _theme$typography.fontFamily
|
|
3835
|
+
}), layerProps.style),
|
|
3836
|
+
children: [tooltipText, /*#__PURE__*/jsx(Arrow, _objectSpread$1(_objectSpread$1({
|
|
3837
|
+
onPointerEnterCapture: undefined,
|
|
3838
|
+
onPointerLeaveCapture: undefined
|
|
3839
|
+
}, arrowProps), {}, {
|
|
3840
|
+
backgroundColor: '#1b181a'
|
|
3841
|
+
}))]
|
|
3842
|
+
})))]
|
|
3843
|
+
});
|
|
3844
|
+
}
|
|
3845
|
+
|
|
3846
|
+
function useCurrentSelected (current) {
|
|
3847
|
+
var _useState = useState(parseHierarchies(current)),
|
|
3848
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3849
|
+
selectedHierarchies = _useState2[0],
|
|
3850
|
+
setSelectedHierarchies = _useState2[1];
|
|
3851
|
+
var _useState3 = useState(parseOrganizations(selectedHierarchies)),
|
|
3852
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3853
|
+
selectedOrganizations = _useState4[0],
|
|
3854
|
+
setSelectedOrganizations = _useState4[1];
|
|
3855
|
+
useEffect(function () {
|
|
3856
|
+
var newHierarchies = parseHierarchies(current);
|
|
3857
|
+
setSelectedHierarchies(newHierarchies);
|
|
3858
|
+
setSelectedOrganizations(parseOrganizations(newHierarchies));
|
|
3859
|
+
}, [current]);
|
|
3860
|
+
return {
|
|
3861
|
+
selectedHierarchies: selectedHierarchies,
|
|
3862
|
+
selectedOrganizations: selectedOrganizations
|
|
3863
|
+
};
|
|
3864
|
+
}
|
|
3865
|
+
function parseHierarchies(current) {
|
|
3866
|
+
if (!current || !current[0]) {
|
|
3867
|
+
return [];
|
|
3868
|
+
}
|
|
3869
|
+
if (isArrayArray(current)) {
|
|
3870
|
+
return _toConsumableArray(current);
|
|
3871
|
+
} else {
|
|
3872
|
+
return [current];
|
|
3873
|
+
}
|
|
3874
|
+
}
|
|
3875
|
+
function parseOrganizations(selectedHirarchies) {
|
|
3876
|
+
return selectedHirarchies.map(function (h) {
|
|
3877
|
+
return h[h.length - 1];
|
|
3878
|
+
});
|
|
3879
|
+
}
|
|
3880
|
+
var isArrayArray = function isArrayArray(x) {
|
|
3881
|
+
return Array.isArray(x[0]);
|
|
3882
|
+
};
|
|
3883
|
+
|
|
3884
|
+
var searchBar = "search-bar-Ad-re";
|
|
3885
|
+
var searchIcon = "search-icon-m-KRO";
|
|
3886
|
+
var css_248z = ".search-bar-Ad-re {\n border: 0px solid transparent !important;\n outline: 0px !important;\n}\n\n.search-bar-Ad-re {\n background-color: #fff;\n border-radius: 16px;\n width: calc(100% - 48px);\n padding: 8px 16px 8px 32px;\n font-size: 15px;\n font-family: var(--diva-typography-font-family);\n}\n\n.search-bar-Ad-re::-moz-placeholder {\n color: #b6b6b7;\n opacity: 1; /* Firefox */\n}\n\n.search-bar-Ad-re::placeholder {\n color: #b6b6b7;\n opacity: 1; /* Firefox */\n}\n\n.search-icon-m-KRO {\n width: 24px !important;\n}\n\n.search-icon-m-KRO {\n position: absolute;\n top: 50%;\n left: 6px;\n transform: translateY(-50%);\n background: url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M15.489 15.4905L19 19.0015M5 11.1455C4.99956 8.21437 7.06975 5.69108 9.94452 5.11883C12.8193 4.54659 15.698 6.08477 16.82 8.79267C17.9421 11.5006 16.995 14.624 14.558 16.2528C12.121 17.8815 8.87287 17.562 6.8 15.4895C5.64763 14.3376 5.00014 12.775 5 11.1455Z%22 stroke%3D%22%234F4F4F%22 stroke-width%3D%221.5%22 stroke-linecap%3D%22round%22 stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\") no-repeat center;\n background-size: 100%;\n display: block;\n height: 24px;\n}\n";
|
|
3883
3887
|
styleInject(css_248z);
|
|
3884
3888
|
|
|
3889
|
+
var SearchField = function SearchField(_ref) {
|
|
3890
|
+
var value = _ref.value,
|
|
3891
|
+
_onChange = _ref.onChange;
|
|
3892
|
+
var _useTranslation = useTranslation(),
|
|
3893
|
+
t = _useTranslation.t;
|
|
3894
|
+
return /*#__PURE__*/jsxs("form", {
|
|
3895
|
+
autoComplete: "off",
|
|
3896
|
+
onSubmit: function onSubmit(e) {
|
|
3897
|
+
return e.preventDefault();
|
|
3898
|
+
},
|
|
3899
|
+
style: {
|
|
3900
|
+
height: 'fit-content',
|
|
3901
|
+
marginBottom: 0
|
|
3902
|
+
},
|
|
3903
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
3904
|
+
className: searchIcon
|
|
3905
|
+
}), /*#__PURE__*/jsx("input", {
|
|
3906
|
+
className: searchBar,
|
|
3907
|
+
autoComplete: 'off',
|
|
3908
|
+
value: value,
|
|
3909
|
+
onChange: function onChange(e) {
|
|
3910
|
+
_onChange(e);
|
|
3911
|
+
},
|
|
3912
|
+
placeholder: t('filter.global'),
|
|
3913
|
+
type: "text"
|
|
3914
|
+
})]
|
|
3915
|
+
});
|
|
3916
|
+
};
|
|
3917
|
+
|
|
3918
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3919
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3920
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
3921
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3922
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
3923
|
+
function index (_ref) {
|
|
3924
|
+
var _scroller$current3;
|
|
3925
|
+
var onChange = _ref.onChange,
|
|
3926
|
+
setOrgsCount = _ref.setOrgsCount,
|
|
3927
|
+
current = _ref.current,
|
|
3928
|
+
maxHeight = _ref.maxHeight,
|
|
3929
|
+
multi = _ref.multi,
|
|
3930
|
+
root = _ref.root;
|
|
3931
|
+
var _useDivaCore = useDivaCore(),
|
|
3932
|
+
organizationHandler = _useDivaCore.handler.organizationHandler;
|
|
3933
|
+
var _useCurrentSelected = useCurrentSelected(current),
|
|
3934
|
+
selectedHierarchies = _useCurrentSelected.selectedHierarchies,
|
|
3935
|
+
selectedOrganizations = _useCurrentSelected.selectedOrganizations;
|
|
3936
|
+
var _useState = useState(),
|
|
3937
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3938
|
+
scroll = _useState2[0],
|
|
3939
|
+
setScroll = _useState2[1];
|
|
3940
|
+
var scroller = useRef(null);
|
|
3941
|
+
var _useState3 = useState(),
|
|
3942
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3943
|
+
data = _useState4[0],
|
|
3944
|
+
setData = _useState4[1];
|
|
3945
|
+
var _useState5 = useState(0),
|
|
3946
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
3947
|
+
total = _useState6[0],
|
|
3948
|
+
setTotal = _useState6[1];
|
|
3949
|
+
var _useState7 = useState(true),
|
|
3950
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
3951
|
+
loading = _useState8[0],
|
|
3952
|
+
setLoading = _useState8[1];
|
|
3953
|
+
var _useState9 = useState(false),
|
|
3954
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
3955
|
+
showSearch = _useState10[0],
|
|
3956
|
+
setShowSearch = _useState10[1];
|
|
3957
|
+
var _useState11 = useState(''),
|
|
3958
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
3959
|
+
search = _useState12[0],
|
|
3960
|
+
setSearch = _useState12[1];
|
|
3961
|
+
var _useState13 = useState(),
|
|
3962
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
3963
|
+
searchData = _useState14[0],
|
|
3964
|
+
setSearchData = _useState14[1];
|
|
3965
|
+
var onSearch = /*#__PURE__*/function () {
|
|
3966
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(query) {
|
|
3967
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3968
|
+
while (1) switch (_context.prev = _context.next) {
|
|
3969
|
+
case 0:
|
|
3970
|
+
setSearch(query || '');
|
|
3971
|
+
debouncedSearch(query);
|
|
3972
|
+
case 2:
|
|
3973
|
+
case "end":
|
|
3974
|
+
return _context.stop();
|
|
3975
|
+
}
|
|
3976
|
+
}, _callee);
|
|
3977
|
+
}));
|
|
3978
|
+
return function onSearch(_x) {
|
|
3979
|
+
return _ref2.apply(this, arguments);
|
|
3980
|
+
};
|
|
3981
|
+
}();
|
|
3982
|
+
var getElementLimit = useCallback(function () {
|
|
3983
|
+
var _scroller$current, _scroller$current2;
|
|
3984
|
+
if (!scroller.current) return 0;
|
|
3985
|
+
if (((_scroller$current = scroller.current) === null || _scroller$current === void 0 ? void 0 : _scroller$current.clientHeight) < 300) return 20;
|
|
3986
|
+
var multiplier = ((_scroller$current2 = scroller.current) === null || _scroller$current2 === void 0 ? void 0 : _scroller$current2.clientHeight) / 300;
|
|
3987
|
+
return Math.ceil(20 * multiplier);
|
|
3988
|
+
}, [scroller.current, (_scroller$current3 = scroller.current) === null || _scroller$current3 === void 0 ? void 0 : _scroller$current3.clientHeight]);
|
|
3989
|
+
var debouncedSearch = useCallback(debounce(/*#__PURE__*/function () {
|
|
3990
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(query) {
|
|
3991
|
+
var _root$_id;
|
|
3992
|
+
var data, result, _iterator, _step, _loop;
|
|
3993
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context3) {
|
|
3994
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
3995
|
+
case 0:
|
|
3996
|
+
if (query !== null && query !== void 0 && query.length) {
|
|
3997
|
+
_context3.next = 4;
|
|
3998
|
+
break;
|
|
3999
|
+
}
|
|
4000
|
+
setSearchData([]);
|
|
4001
|
+
scroller.current.scrollTo({
|
|
4002
|
+
top: 0
|
|
4003
|
+
});
|
|
4004
|
+
return _context3.abrupt("return");
|
|
4005
|
+
case 4:
|
|
4006
|
+
data = [];
|
|
4007
|
+
_context3.next = 7;
|
|
4008
|
+
return organizationHandler.getOrganizationsChildren((_root$_id = root === null || root === void 0 ? void 0 : root._id) !== null && _root$_id !== void 0 ? _root$_id : 'ROOT', 0, getElementLimit(), query);
|
|
4009
|
+
case 7:
|
|
4010
|
+
result = _context3.sent;
|
|
4011
|
+
data.push({
|
|
4012
|
+
_id: 'ROOT',
|
|
4013
|
+
displayName: '',
|
|
4014
|
+
children: _toConsumableArray(result.data.map(function (d) {
|
|
4015
|
+
var _d$parentOrganization, _d$parentOrganization2;
|
|
4016
|
+
return {
|
|
4017
|
+
_id: d._id,
|
|
4018
|
+
displayName: ((_d$parentOrganization = (_d$parentOrganization2 = d.parentOrganizations) === null || _d$parentOrganization2 === void 0 ? void 0 : _d$parentOrganization2.map(function (d) {
|
|
4019
|
+
return d.displayName + '/';
|
|
4020
|
+
}).join('')) !== null && _d$parentOrganization !== void 0 ? _d$parentOrganization : '') + d.displayName,
|
|
4021
|
+
parentOrganizations: d.parentOrganizations,
|
|
4022
|
+
type: d.type,
|
|
4023
|
+
parent: 'ROOT'
|
|
4024
|
+
};
|
|
4025
|
+
})),
|
|
4026
|
+
total: result.total
|
|
4027
|
+
});
|
|
4028
|
+
_iterator = _createForOfIteratorHelper(selectedOrganizations.entries());
|
|
4029
|
+
_context3.prev = 10;
|
|
4030
|
+
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
4031
|
+
var _step$value, i, selected, indexOfCurrent, _ref4, _current;
|
|
4032
|
+
return _regeneratorRuntime.wrap(function _loop$(_context2) {
|
|
4033
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
4034
|
+
case 0:
|
|
4035
|
+
_step$value = _slicedToArray(_step.value, 2), i = _step$value[0], selected = _step$value[1];
|
|
4036
|
+
//mark the current selected organization as selected
|
|
4037
|
+
indexOfCurrent = data[0].children.findIndex(function (v) {
|
|
4038
|
+
return v._id == selected._id;
|
|
4039
|
+
});
|
|
4040
|
+
if (indexOfCurrent >= 0) {
|
|
4041
|
+
_current = data[0].children.splice(indexOfCurrent, 1);
|
|
4042
|
+
_current[0].isSelected = true;
|
|
4043
|
+
(_ref4 = data[0].children).unshift.apply(_ref4, _toConsumableArray(_current));
|
|
4044
|
+
} else {
|
|
4045
|
+
data[0].children.unshift({
|
|
4046
|
+
_id: selected._id,
|
|
4047
|
+
displayName: selectedHierarchies[i].map(function (d) {
|
|
4048
|
+
return d.displayName;
|
|
4049
|
+
}).join('/'),
|
|
4050
|
+
isSelected: true,
|
|
4051
|
+
parentOrganizations: selectedHierarchies[i].slice(0, -1),
|
|
4052
|
+
type: selected.type
|
|
4053
|
+
});
|
|
4054
|
+
}
|
|
4055
|
+
case 3:
|
|
4056
|
+
case "end":
|
|
4057
|
+
return _context2.stop();
|
|
4058
|
+
}
|
|
4059
|
+
}, _loop);
|
|
4060
|
+
});
|
|
4061
|
+
_iterator.s();
|
|
4062
|
+
case 13:
|
|
4063
|
+
if ((_step = _iterator.n()).done) {
|
|
4064
|
+
_context3.next = 17;
|
|
4065
|
+
break;
|
|
4066
|
+
}
|
|
4067
|
+
return _context3.delegateYield(_loop(), "t0", 15);
|
|
4068
|
+
case 15:
|
|
4069
|
+
_context3.next = 13;
|
|
4070
|
+
break;
|
|
4071
|
+
case 17:
|
|
4072
|
+
_context3.next = 22;
|
|
4073
|
+
break;
|
|
4074
|
+
case 19:
|
|
4075
|
+
_context3.prev = 19;
|
|
4076
|
+
_context3.t1 = _context3["catch"](10);
|
|
4077
|
+
_iterator.e(_context3.t1);
|
|
4078
|
+
case 22:
|
|
4079
|
+
_context3.prev = 22;
|
|
4080
|
+
_iterator.f();
|
|
4081
|
+
return _context3.finish(22);
|
|
4082
|
+
case 25:
|
|
4083
|
+
setSearchData(data);
|
|
4084
|
+
scroller.current.scrollTo({
|
|
4085
|
+
top: 0
|
|
4086
|
+
});
|
|
4087
|
+
case 27:
|
|
4088
|
+
case "end":
|
|
4089
|
+
return _context3.stop();
|
|
4090
|
+
}
|
|
4091
|
+
}, _callee2, null, [[10, 19, 22, 25]]);
|
|
4092
|
+
}));
|
|
4093
|
+
return function (_x2) {
|
|
4094
|
+
return _ref3.apply(this, arguments);
|
|
4095
|
+
};
|
|
4096
|
+
}(), 300), [selectedHierarchies, selectedOrganizations]);
|
|
4097
|
+
var debouncedScroll = useCallback(debounce(/*#__PURE__*/function () {
|
|
4098
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(e) {
|
|
4099
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context4) {
|
|
4100
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
4101
|
+
case 0:
|
|
4102
|
+
setScroll({
|
|
4103
|
+
scrollTop: e.target.scrollTop,
|
|
4104
|
+
scrollHeight: e.target.scrollHeight,
|
|
4105
|
+
clientHeight: e.target.clientHeight
|
|
4106
|
+
});
|
|
4107
|
+
case 1:
|
|
4108
|
+
case "end":
|
|
4109
|
+
return _context4.stop();
|
|
4110
|
+
}
|
|
4111
|
+
}, _callee3);
|
|
4112
|
+
}));
|
|
4113
|
+
return function (_x3) {
|
|
4114
|
+
return _ref5.apply(this, arguments);
|
|
4115
|
+
};
|
|
4116
|
+
}(), 300), []);
|
|
4117
|
+
var onSelect = useCallback(function (data, select) {
|
|
4118
|
+
if (select) {
|
|
4119
|
+
var _data$parentOrganizat, _data$parentOrganizat2;
|
|
4120
|
+
var splittedName = data.displayName.split('/');
|
|
4121
|
+
var selected = [].concat(_toConsumableArray((_data$parentOrganizat = (_data$parentOrganizat2 = data.parentOrganizations) === null || _data$parentOrganizat2 === void 0 ? void 0 : _data$parentOrganizat2.map(function (d) {
|
|
4122
|
+
return {
|
|
4123
|
+
_id: d._id,
|
|
4124
|
+
displayName: d.displayName,
|
|
4125
|
+
hasChildren: true,
|
|
4126
|
+
type: d.type
|
|
4127
|
+
};
|
|
4128
|
+
})) !== null && _data$parentOrganizat !== void 0 ? _data$parentOrganizat : []), [{
|
|
4129
|
+
_id: data._id,
|
|
4130
|
+
displayName: splittedName[splittedName.length - 1],
|
|
4131
|
+
hasChildren: data.hasChildren,
|
|
4132
|
+
type: data.type
|
|
4133
|
+
}]);
|
|
4134
|
+
if (multi) {
|
|
4135
|
+
onChange([].concat(_toConsumableArray(selectedHierarchies), [selected]));
|
|
4136
|
+
} else {
|
|
4137
|
+
onChange(selected);
|
|
4138
|
+
}
|
|
4139
|
+
} else {
|
|
4140
|
+
if (multi) {
|
|
4141
|
+
var removeIndex = selectedHierarchies.findIndex(function (h) {
|
|
4142
|
+
return h[h.length - 1]._id == data._id;
|
|
4143
|
+
});
|
|
4144
|
+
if (removeIndex > -1) {
|
|
4145
|
+
var newData = _toConsumableArray(selectedHierarchies);
|
|
4146
|
+
newData.splice(removeIndex, 1);
|
|
4147
|
+
onChange(_toConsumableArray(newData));
|
|
4148
|
+
}
|
|
4149
|
+
} else {
|
|
4150
|
+
onChange([]);
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
setSearchData([]);
|
|
4154
|
+
setSearch('');
|
|
4155
|
+
scroller.current.scrollTo({
|
|
4156
|
+
top: 0
|
|
4157
|
+
});
|
|
4158
|
+
}, [onChange, selectedHierarchies]);
|
|
4159
|
+
var onOpen = useCallback(/*#__PURE__*/function () {
|
|
4160
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(id) {
|
|
4161
|
+
var flat, elem, _parent$children, _parent$children$leng, _parent$children2, _parent$children3, parent, result, _elem$children, _elem$children2, _result;
|
|
4162
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
4163
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
4164
|
+
case 0:
|
|
4165
|
+
if (data) {
|
|
4166
|
+
_context5.next = 2;
|
|
4167
|
+
break;
|
|
4168
|
+
}
|
|
4169
|
+
return _context5.abrupt("return");
|
|
4170
|
+
case 2:
|
|
4171
|
+
flat = flatElements(data);
|
|
4172
|
+
elem = flat.find(function (f) {
|
|
4173
|
+
return f._id == id;
|
|
4174
|
+
});
|
|
4175
|
+
if (!(elem !== null && elem !== void 0 && elem.open)) {
|
|
4176
|
+
_context5.next = 21;
|
|
4177
|
+
break;
|
|
4178
|
+
}
|
|
4179
|
+
//if the element is already open, we close it
|
|
4180
|
+
//than we have to check if enough siblings are loaded, if not we load the rest
|
|
4181
|
+
elem.open = false;
|
|
4182
|
+
parent = flat.find(function (f) {
|
|
4183
|
+
return f._id == elem.parent;
|
|
4184
|
+
});
|
|
4185
|
+
if (!(!parent || parent.children && ((_parent$children = parent.children) === null || _parent$children === void 0 ? void 0 : _parent$children.length) >= parent.total)) {
|
|
4186
|
+
_context5.next = 12;
|
|
4187
|
+
break;
|
|
4188
|
+
}
|
|
4189
|
+
setData(_toConsumableArray(data));
|
|
4190
|
+
return _context5.abrupt("return");
|
|
4191
|
+
case 12:
|
|
4192
|
+
if (!parent.children) {
|
|
4193
|
+
parent.children = [];
|
|
4194
|
+
}
|
|
4195
|
+
case 13:
|
|
4196
|
+
_context5.next = 15;
|
|
4197
|
+
return organizationHandler.getOrganizationsChildren(parent._id, (_parent$children$leng = (_parent$children2 = parent.children) === null || _parent$children2 === void 0 ? void 0 : _parent$children2.length) !== null && _parent$children$leng !== void 0 ? _parent$children$leng : 0, getElementLimit());
|
|
4198
|
+
case 15:
|
|
4199
|
+
result = _context5.sent;
|
|
4200
|
+
(_parent$children3 = parent.children).push.apply(_parent$children3, _toConsumableArray(result.data.map(function (d) {
|
|
4201
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
4202
|
+
parent: elem._id
|
|
4203
|
+
});
|
|
4204
|
+
})));
|
|
4205
|
+
parent.total = result.total;
|
|
4206
|
+
setData(_toConsumableArray(data));
|
|
4207
|
+
_context5.next = 39;
|
|
4208
|
+
break;
|
|
4209
|
+
case 21:
|
|
4210
|
+
if (elem !== null && elem !== void 0 && elem.hasChildren) {
|
|
4211
|
+
_context5.next = 23;
|
|
4212
|
+
break;
|
|
4213
|
+
}
|
|
4214
|
+
return _context5.abrupt("return");
|
|
4215
|
+
case 23:
|
|
4216
|
+
elem.open = true;
|
|
4217
|
+
if (!(elem.children && ((_elem$children = elem.children) === null || _elem$children === void 0 ? void 0 : _elem$children.length) >= elem.total)) {
|
|
4218
|
+
_context5.next = 29;
|
|
4219
|
+
break;
|
|
4220
|
+
}
|
|
4221
|
+
setData(_toConsumableArray(data));
|
|
4222
|
+
return _context5.abrupt("return");
|
|
4223
|
+
case 29:
|
|
4224
|
+
if (!elem.children) {
|
|
4225
|
+
elem.children = [];
|
|
4226
|
+
}
|
|
4227
|
+
case 30:
|
|
4228
|
+
if (!(!elem.children || !elem.total || elem.children.length < elem.total)) {
|
|
4229
|
+
_context5.next = 38;
|
|
4230
|
+
break;
|
|
4231
|
+
}
|
|
4232
|
+
_context5.next = 33;
|
|
4233
|
+
return organizationHandler.getOrganizationsChildren(id, elem.children.length, 100);
|
|
4234
|
+
case 33:
|
|
4235
|
+
_result = _context5.sent;
|
|
4236
|
+
(_elem$children2 = elem.children).push.apply(_elem$children2, _toConsumableArray(_result.data.map(function (d) {
|
|
4237
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
4238
|
+
parent: elem._id
|
|
4239
|
+
});
|
|
4240
|
+
})));
|
|
4241
|
+
elem.total = _result.total;
|
|
4242
|
+
_context5.next = 30;
|
|
4243
|
+
break;
|
|
4244
|
+
case 38:
|
|
4245
|
+
setData(_toConsumableArray(data));
|
|
4246
|
+
case 39:
|
|
4247
|
+
case "end":
|
|
4248
|
+
return _context5.stop();
|
|
4249
|
+
}
|
|
4250
|
+
}, _callee4);
|
|
4251
|
+
}));
|
|
4252
|
+
return function (_x4) {
|
|
4253
|
+
return _ref6.apply(this, arguments);
|
|
4254
|
+
};
|
|
4255
|
+
}(), [data, setData]);
|
|
4256
|
+
var elementLimit = getElementLimit();
|
|
4257
|
+
useEffect(function () {
|
|
4258
|
+
if (!elementLimit) return;
|
|
4259
|
+
var fn = /*#__PURE__*/function () {
|
|
4260
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
4261
|
+
var total, flatTotal, totalList, _iterator2, _step2, _loop2, result, _root$_id2, _result2, rootData;
|
|
4262
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context8) {
|
|
4263
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
4264
|
+
case 0:
|
|
4265
|
+
total = 0;
|
|
4266
|
+
flatTotal = 0;
|
|
4267
|
+
totalList = []; //first add all selected organizations
|
|
4268
|
+
_iterator2 = _createForOfIteratorHelper(selectedHierarchies);
|
|
4269
|
+
_context8.prev = 4;
|
|
4270
|
+
_loop2 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop2() {
|
|
4271
|
+
var _parentsOfSelected$_i, _parentsOfSelected;
|
|
4272
|
+
var hierarchy, selectedChild, existing, rootIndex, parentsOfSelected, orgData, isNew, _iterator3, _step3, _loop3;
|
|
4273
|
+
return _regeneratorRuntime.wrap(function _loop2$(_context7) {
|
|
4274
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
4275
|
+
case 0:
|
|
4276
|
+
hierarchy = _step2.value;
|
|
4277
|
+
selectedChild = hierarchy[hierarchy.length - 1]; //if the selected organization is already loaded as a parent or child of another selected organization
|
|
4278
|
+
//we simple set it as selected and are done
|
|
4279
|
+
existing = getExisting(totalList, selectedChild._id);
|
|
4280
|
+
if (!existing) {
|
|
4281
|
+
_context7.next = 6;
|
|
4282
|
+
break;
|
|
4283
|
+
}
|
|
4284
|
+
existing.isSelected = true;
|
|
4285
|
+
return _context7.abrupt("return", 1);
|
|
4286
|
+
case 6:
|
|
4287
|
+
rootIndex = 0;
|
|
4288
|
+
if (root) {
|
|
4289
|
+
rootIndex = hierarchy.findIndex(function (d) {
|
|
4290
|
+
return d._id == root._id;
|
|
4291
|
+
});
|
|
4292
|
+
}
|
|
4293
|
+
parentsOfSelected = hierarchy.slice(rootIndex, -1);
|
|
4294
|
+
parentsOfSelected.reverse(); //iterate list from the back
|
|
4295
|
+
orgData = _objectSpread(_objectSpread({}, selectedChild), {}, {
|
|
4296
|
+
parent: (_parentsOfSelected$_i = (_parentsOfSelected = parentsOfSelected[parentsOfSelected.length - 1]) === null || _parentsOfSelected === void 0 ? void 0 : _parentsOfSelected._id) !== null && _parentsOfSelected$_i !== void 0 ? _parentsOfSelected$_i : 'ROOT',
|
|
4297
|
+
isSelected: true,
|
|
4298
|
+
hasChildren: selectedChild.hasChildren,
|
|
4299
|
+
parentOrganizations: parentsOfSelected
|
|
4300
|
+
});
|
|
4301
|
+
isNew = true;
|
|
4302
|
+
_iterator3 = _createForOfIteratorHelper(parentsOfSelected);
|
|
4303
|
+
_context7.prev = 13;
|
|
4304
|
+
_loop3 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop3() {
|
|
4305
|
+
var organization, existing, indexOfCurrent, limit, _result3, _result3$data, rest, _iterator4, _step4, _indexOfCurrent;
|
|
4306
|
+
return _regeneratorRuntime.wrap(function _loop3$(_context6) {
|
|
4307
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
4308
|
+
case 0:
|
|
4309
|
+
organization = _step3.value;
|
|
4310
|
+
//set the parent field of the previouse organization
|
|
4311
|
+
orgData.parent = organization._id;
|
|
4312
|
+
existing = getExisting(totalList, organization._id); //if the parent was already loaded, use that instance and add the previouse organization as first child
|
|
4313
|
+
if (existing) {
|
|
4314
|
+
if (!existing.children) existing.children = [];
|
|
4315
|
+
//incase the previouse organization was already in the list as child, remove it. Otherwise the entry is double
|
|
4316
|
+
indexOfCurrent = existing.children.findIndex(function (v) {
|
|
4317
|
+
return v._id == orgData._id;
|
|
4318
|
+
});
|
|
4319
|
+
if (indexOfCurrent >= 0) {
|
|
4320
|
+
existing.children.splice(indexOfCurrent, 1);
|
|
4321
|
+
total -= 1;
|
|
4322
|
+
}
|
|
4323
|
+
existing.children.unshift(orgData); //set the previouse organization as first child
|
|
4324
|
+
total += 1;
|
|
4325
|
+
isNew = false;
|
|
4326
|
+
orgData = existing;
|
|
4327
|
+
} else {
|
|
4328
|
+
//if the parent was not loaded yet, create a new instance, and add the previouse organization as first child
|
|
4329
|
+
orgData = _objectSpread(_objectSpread({}, organization), {}, {
|
|
4330
|
+
parent: '',
|
|
4331
|
+
//parent ID is set below on next iteration
|
|
4332
|
+
hasChildren: true,
|
|
4333
|
+
children: [orgData] //set the previouse organization as first child
|
|
4334
|
+
});
|
|
4335
|
+
total += 1;
|
|
4336
|
+
}
|
|
4337
|
+
|
|
4338
|
+
//if the organization was already open, the children are also alreaddy loaded and we are done, otherwise we have to load the children
|
|
4339
|
+
if (orgData.open) {
|
|
4340
|
+
_context6.next = 22;
|
|
4341
|
+
break;
|
|
4342
|
+
}
|
|
4343
|
+
//load at least one element, so we know the total count of children of the organization
|
|
4344
|
+
limit = elementLimit - total;
|
|
4345
|
+
limit = limit > 0 ? limit : 1;
|
|
4346
|
+
_context6.next = 9;
|
|
4347
|
+
return organizationHandler.getOrganizationsChildren(organization._id, 0, limit);
|
|
4348
|
+
case 9:
|
|
4349
|
+
_result3 = _context6.sent;
|
|
4350
|
+
if (!(_result3.total > _result3.data.length)) {
|
|
4351
|
+
_context6.next = 15;
|
|
4352
|
+
break;
|
|
4353
|
+
}
|
|
4354
|
+
_context6.next = 13;
|
|
4355
|
+
return organizationHandler.getOrganizationsChildren(organization._id, _result3.data.length, _result3.total - _result3.data.length);
|
|
4356
|
+
case 13:
|
|
4357
|
+
rest = _context6.sent;
|
|
4358
|
+
(_result3$data = _result3.data).push.apply(_result3$data, _toConsumableArray(rest.data));
|
|
4359
|
+
case 15:
|
|
4360
|
+
total += _result3.total;
|
|
4361
|
+
flatTotal = _result3.flatTotal;
|
|
4362
|
+
|
|
4363
|
+
//incase the a loaded child was already in the list as child, remove it. Otherwise the entry is double
|
|
4364
|
+
_iterator4 = _createForOfIteratorHelper(findAllIndexes(_result3.data, hierarchy));
|
|
4365
|
+
try {
|
|
4366
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
4367
|
+
_indexOfCurrent = _step4.value;
|
|
4368
|
+
_result3.data.splice(_indexOfCurrent, 1);
|
|
4369
|
+
total -= 1;
|
|
4370
|
+
}
|
|
4371
|
+
} catch (err) {
|
|
4372
|
+
_iterator4.e(err);
|
|
4373
|
+
} finally {
|
|
4374
|
+
_iterator4.f();
|
|
4375
|
+
}
|
|
4376
|
+
orgData.open = true;
|
|
4377
|
+
orgData.total = _result3.total;
|
|
4378
|
+
orgData.children = [].concat(_toConsumableArray(orgData.children), _toConsumableArray(_result3.data.map(function (d) {
|
|
4379
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
4380
|
+
parent: organization._id
|
|
4381
|
+
});
|
|
4382
|
+
})));
|
|
4383
|
+
case 22:
|
|
4384
|
+
if (isNew) {
|
|
4385
|
+
_context6.next = 24;
|
|
4386
|
+
break;
|
|
4387
|
+
}
|
|
4388
|
+
return _context6.abrupt("return", 1);
|
|
4389
|
+
case 24:
|
|
4390
|
+
case "end":
|
|
4391
|
+
return _context6.stop();
|
|
4392
|
+
}
|
|
4393
|
+
}, _loop3);
|
|
4394
|
+
});
|
|
4395
|
+
_iterator3.s();
|
|
4396
|
+
case 16:
|
|
4397
|
+
if ((_step3 = _iterator3.n()).done) {
|
|
4398
|
+
_context7.next = 22;
|
|
4399
|
+
break;
|
|
4400
|
+
}
|
|
4401
|
+
return _context7.delegateYield(_loop3(), "t0", 18);
|
|
4402
|
+
case 18:
|
|
4403
|
+
if (!_context7.t0) {
|
|
4404
|
+
_context7.next = 20;
|
|
4405
|
+
break;
|
|
4406
|
+
}
|
|
4407
|
+
return _context7.abrupt("break", 22);
|
|
4408
|
+
case 20:
|
|
4409
|
+
_context7.next = 16;
|
|
4410
|
+
break;
|
|
4411
|
+
case 22:
|
|
4412
|
+
_context7.next = 27;
|
|
4413
|
+
break;
|
|
4414
|
+
case 24:
|
|
4415
|
+
_context7.prev = 24;
|
|
4416
|
+
_context7.t1 = _context7["catch"](13);
|
|
4417
|
+
_iterator3.e(_context7.t1);
|
|
4418
|
+
case 27:
|
|
4419
|
+
_context7.prev = 27;
|
|
4420
|
+
_iterator3.f();
|
|
4421
|
+
return _context7.finish(27);
|
|
4422
|
+
case 30:
|
|
4423
|
+
if (isNew) totalList.push(orgData); //add the orgData is not new, it is already in the list
|
|
4424
|
+
case 31:
|
|
4425
|
+
case "end":
|
|
4426
|
+
return _context7.stop();
|
|
4427
|
+
}
|
|
4428
|
+
}, _loop2, null, [[13, 24, 27, 30]]);
|
|
4429
|
+
});
|
|
4430
|
+
_iterator2.s();
|
|
4431
|
+
case 7:
|
|
4432
|
+
if ((_step2 = _iterator2.n()).done) {
|
|
4433
|
+
_context8.next = 13;
|
|
4434
|
+
break;
|
|
4435
|
+
}
|
|
4436
|
+
return _context8.delegateYield(_loop2(), "t0", 9);
|
|
4437
|
+
case 9:
|
|
4438
|
+
if (!_context8.t0) {
|
|
4439
|
+
_context8.next = 11;
|
|
4440
|
+
break;
|
|
4441
|
+
}
|
|
4442
|
+
return _context8.abrupt("continue", 11);
|
|
4443
|
+
case 11:
|
|
4444
|
+
_context8.next = 7;
|
|
4445
|
+
break;
|
|
4446
|
+
case 13:
|
|
4447
|
+
_context8.next = 18;
|
|
4448
|
+
break;
|
|
4449
|
+
case 15:
|
|
4450
|
+
_context8.prev = 15;
|
|
4451
|
+
_context8.t1 = _context8["catch"](4);
|
|
4452
|
+
_iterator2.e(_context8.t1);
|
|
4453
|
+
case 18:
|
|
4454
|
+
_context8.prev = 18;
|
|
4455
|
+
_iterator2.f();
|
|
4456
|
+
return _context8.finish(18);
|
|
4457
|
+
case 21:
|
|
4458
|
+
if (!(totalList.length == 0 && root)) {
|
|
4459
|
+
_context8.next = 30;
|
|
4460
|
+
break;
|
|
4461
|
+
}
|
|
4462
|
+
_context8.next = 24;
|
|
4463
|
+
return organizationHandler.getOrganizationsChildren(root._id, 0, elementLimit - total);
|
|
4464
|
+
case 24:
|
|
4465
|
+
result = _context8.sent;
|
|
4466
|
+
totalList.push(_objectSpread(_objectSpread({}, root), {}, {
|
|
4467
|
+
children: _toConsumableArray(result.data.map(function (d) {
|
|
4468
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
4469
|
+
parent: root._id
|
|
4470
|
+
});
|
|
4471
|
+
})),
|
|
4472
|
+
total: result.total
|
|
4473
|
+
}));
|
|
4474
|
+
total += result.total - result.data.length;
|
|
4475
|
+
flatTotal = result.flatTotal;
|
|
4476
|
+
_context8.next = 39;
|
|
4477
|
+
break;
|
|
4478
|
+
case 30:
|
|
4479
|
+
if (totalList.find(function (org) {
|
|
4480
|
+
return org._id == (root === null || root === void 0 ? void 0 : root._id);
|
|
4481
|
+
})) {
|
|
4482
|
+
_context8.next = 39;
|
|
4483
|
+
break;
|
|
4484
|
+
}
|
|
4485
|
+
_context8.next = 33;
|
|
4486
|
+
return organizationHandler.getOrganizationsChildren((_root$_id2 = root === null || root === void 0 ? void 0 : root._id) !== null && _root$_id2 !== void 0 ? _root$_id2 : 'ROOT', 0, Math.max(elementLimit - total, 1));
|
|
4487
|
+
case 33:
|
|
4488
|
+
_result2 = _context8.sent;
|
|
4489
|
+
rootData = _result2;
|
|
4490
|
+
rootData.data = _result2.data.filter(function (d) {
|
|
4491
|
+
return !totalList.find(function (org) {
|
|
4492
|
+
return org._id == d._id;
|
|
4493
|
+
});
|
|
4494
|
+
});
|
|
4495
|
+
totalList.push.apply(totalList, _toConsumableArray(rootData.data));
|
|
4496
|
+
total += _result2.total - (_result2.data.length - rootData.data.length);
|
|
4497
|
+
flatTotal = _result2.flatTotal;
|
|
4498
|
+
case 39:
|
|
4499
|
+
setData([{
|
|
4500
|
+
_id: 'ROOT',
|
|
4501
|
+
displayName: '',
|
|
4502
|
+
children: _toConsumableArray(totalList.map(function (d) {
|
|
4503
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
4504
|
+
parent: 'ROOT'
|
|
4505
|
+
});
|
|
4506
|
+
})),
|
|
4507
|
+
total: total
|
|
4508
|
+
}]);
|
|
4509
|
+
flatTotal = flatTotal > total ? flatTotal : total;
|
|
4510
|
+
setTotal(flatTotal);
|
|
4511
|
+
if (flatTotal > 5) setShowSearch(true);
|
|
4512
|
+
setOrgsCount === null || setOrgsCount === void 0 || setOrgsCount(flatTotal);
|
|
4513
|
+
setLoading(false);
|
|
4514
|
+
case 45:
|
|
4515
|
+
case "end":
|
|
4516
|
+
return _context8.stop();
|
|
4517
|
+
}
|
|
4518
|
+
}, _callee5, null, [[4, 15, 18, 21]]);
|
|
4519
|
+
}));
|
|
4520
|
+
return function fn() {
|
|
4521
|
+
return _ref7.apply(this, arguments);
|
|
4522
|
+
};
|
|
4523
|
+
}();
|
|
4524
|
+
fn();
|
|
4525
|
+
}, [selectedHierarchies]);
|
|
4526
|
+
useEffect(function () {
|
|
4527
|
+
if (scroll) {
|
|
4528
|
+
if (!data) return;
|
|
4529
|
+
var flat = flatElements(searchData !== null && searchData !== void 0 && searchData.length ? searchData : data);
|
|
4530
|
+
//check if scrolled to bottom, with a tolerance of 1px.
|
|
4531
|
+
if (Math.abs(scroll.scrollHeight - scroll.scrollTop - scroll.clientHeight) <= 1.0 && total > flat.length) {
|
|
4532
|
+
_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
4533
|
+
var lastParent, correctSkip, _iterator5, _step5, hierarchy, _iterator7, _step7, indexOfCurrent, result, _iterator6, _step6, _hierarchy, _iterator8, _step8, _indexOfCurrent2, _ref9, _ref10;
|
|
4534
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context9) {
|
|
4535
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
4536
|
+
case 0:
|
|
4537
|
+
lastParent = getLastParentWithUnloadedItems(flat);
|
|
4538
|
+
if (!(!lastParent || !lastParent.children)) {
|
|
4539
|
+
_context9.next = 3;
|
|
4540
|
+
break;
|
|
4541
|
+
}
|
|
4542
|
+
return _context9.abrupt("return");
|
|
4543
|
+
case 3:
|
|
4544
|
+
setLoading(true);
|
|
4545
|
+
|
|
4546
|
+
//the elements from selected hierarchies are always included int the beginning of list but from the server we load the data sorted by name
|
|
4547
|
+
//this means we would skip to many elements, so we have to reduce the skip count by the number of selected elements that are alphabetically after the last loaded element
|
|
4548
|
+
correctSkip = 0;
|
|
4549
|
+
_iterator5 = _createForOfIteratorHelper(selectedHierarchies);
|
|
4550
|
+
try {
|
|
4551
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
4552
|
+
hierarchy = _step5.value;
|
|
4553
|
+
_iterator7 = _createForOfIteratorHelper(findAllIndexes(lastParent.children, hierarchy));
|
|
4554
|
+
try {
|
|
4555
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
4556
|
+
indexOfCurrent = _step7.value;
|
|
4557
|
+
if (lastParent.children[indexOfCurrent].displayName > lastParent.children[lastParent.children.length - 1].displayName) correctSkip++;
|
|
4558
|
+
}
|
|
4559
|
+
} catch (err) {
|
|
4560
|
+
_iterator7.e(err);
|
|
4561
|
+
} finally {
|
|
4562
|
+
_iterator7.f();
|
|
4563
|
+
}
|
|
4564
|
+
}
|
|
4565
|
+
} catch (err) {
|
|
4566
|
+
_iterator5.e(err);
|
|
4567
|
+
} finally {
|
|
4568
|
+
_iterator5.f();
|
|
4569
|
+
}
|
|
4570
|
+
_context9.next = 9;
|
|
4571
|
+
return organizationHandler.getOrganizationsChildren(lastParent._id, lastParent.children.length - correctSkip, getElementLimit(), search);
|
|
4572
|
+
case 9:
|
|
4573
|
+
result = _context9.sent;
|
|
4574
|
+
//incase the a loaded child was already in the list as child, remove it. Otherwise the entry is double
|
|
4575
|
+
_iterator6 = _createForOfIteratorHelper(selectedHierarchies);
|
|
4576
|
+
try {
|
|
4577
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
4578
|
+
_hierarchy = _step6.value;
|
|
4579
|
+
_iterator8 = _createForOfIteratorHelper(findAllIndexes(result.data, _hierarchy));
|
|
4580
|
+
try {
|
|
4581
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
4582
|
+
_indexOfCurrent2 = _step8.value;
|
|
4583
|
+
result.data.splice(_indexOfCurrent2, 1);
|
|
4584
|
+
}
|
|
4585
|
+
} catch (err) {
|
|
4586
|
+
_iterator8.e(err);
|
|
4587
|
+
} finally {
|
|
4588
|
+
_iterator8.f();
|
|
4589
|
+
}
|
|
4590
|
+
}
|
|
4591
|
+
} catch (err) {
|
|
4592
|
+
_iterator6.e(err);
|
|
4593
|
+
} finally {
|
|
4594
|
+
_iterator6.f();
|
|
4595
|
+
}
|
|
4596
|
+
if (searchData !== null && searchData !== void 0 && searchData.length) {
|
|
4597
|
+
(_ref9 = lastParent.children).push.apply(_ref9, _toConsumableArray(result.data.map(function (d) {
|
|
4598
|
+
var _d$parentOrganization3, _d$parentOrganization4;
|
|
4599
|
+
return {
|
|
4600
|
+
_id: d._id,
|
|
4601
|
+
displayName: ((_d$parentOrganization3 = (_d$parentOrganization4 = d.parentOrganizations) === null || _d$parentOrganization4 === void 0 ? void 0 : _d$parentOrganization4.map(function (d) {
|
|
4602
|
+
return d.displayName + '/';
|
|
4603
|
+
}).join('')) !== null && _d$parentOrganization3 !== void 0 ? _d$parentOrganization3 : '') + d.displayName,
|
|
4604
|
+
parentOrganizations: d.parentOrganizations,
|
|
4605
|
+
type: d.type
|
|
4606
|
+
};
|
|
4607
|
+
})));
|
|
4608
|
+
lastParent.total = result.total;
|
|
4609
|
+
setSearchData(_toConsumableArray(searchData));
|
|
4610
|
+
setLoading(false);
|
|
4611
|
+
} else {
|
|
4612
|
+
(_ref10 = lastParent.children).push.apply(_ref10, _toConsumableArray(result.data.map(function (d) {
|
|
4613
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
4614
|
+
parent: lastParent._id
|
|
4615
|
+
});
|
|
4616
|
+
})));
|
|
4617
|
+
lastParent.total = result.total;
|
|
4618
|
+
setData(_toConsumableArray(data));
|
|
4619
|
+
setLoading(false);
|
|
4620
|
+
}
|
|
4621
|
+
case 13:
|
|
4622
|
+
case "end":
|
|
4623
|
+
return _context9.stop();
|
|
4624
|
+
}
|
|
4625
|
+
}, _callee6);
|
|
4626
|
+
}))();
|
|
4627
|
+
}
|
|
4628
|
+
}
|
|
4629
|
+
}, [scroll]);
|
|
4630
|
+
var elements = searchData !== null && searchData !== void 0 && searchData.length ? searchData[0].children : data === null || data === void 0 ? void 0 : data[0].children;
|
|
4631
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
4632
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
4633
|
+
className: classNames(row),
|
|
4634
|
+
style: {
|
|
4635
|
+
marginBottom: 12
|
|
4636
|
+
},
|
|
4637
|
+
children: showSearch && /*#__PURE__*/jsx(SearchField, {
|
|
4638
|
+
value: search,
|
|
4639
|
+
onChange: function onChange(e) {
|
|
4640
|
+
return onSearch(e.target.value);
|
|
4641
|
+
}
|
|
4642
|
+
})
|
|
4643
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
4644
|
+
className: list,
|
|
4645
|
+
style: {
|
|
4646
|
+
maxHeight: maxHeight
|
|
4647
|
+
},
|
|
4648
|
+
onScroll: debouncedScroll,
|
|
4649
|
+
ref: scroller,
|
|
4650
|
+
children: [elements === null || elements === void 0 ? void 0 : elements.map(function (d) {
|
|
4651
|
+
return /*#__PURE__*/jsx(Elements, {
|
|
4652
|
+
data: d,
|
|
4653
|
+
level: 0,
|
|
4654
|
+
onOpen: onOpen,
|
|
4655
|
+
onSelect: onSelect,
|
|
4656
|
+
multi: multi
|
|
4657
|
+
}, d._id);
|
|
4658
|
+
}), loading && /*#__PURE__*/jsx("div", {
|
|
4659
|
+
className: classNames(row),
|
|
4660
|
+
children: "Loading..."
|
|
4661
|
+
})]
|
|
4662
|
+
})]
|
|
4663
|
+
});
|
|
4664
|
+
}
|
|
4665
|
+
function Elements(_ref11) {
|
|
4666
|
+
var data = _ref11.data,
|
|
4667
|
+
level = _ref11.level,
|
|
4668
|
+
onOpen = _ref11.onOpen,
|
|
4669
|
+
onSelect = _ref11.onSelect,
|
|
4670
|
+
multi = _ref11.multi;
|
|
4671
|
+
return /*#__PURE__*/jsxs("div", {
|
|
4672
|
+
className: classNames(row),
|
|
4673
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
4674
|
+
className: classNames(data.open ? openClass : undefined),
|
|
4675
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
4676
|
+
className: item,
|
|
4677
|
+
style: {
|
|
4678
|
+
marginLeft: 10 * level
|
|
4679
|
+
},
|
|
4680
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
4681
|
+
className: classNames(leftSpace, data.hasChildren ? arrow : undefined),
|
|
4682
|
+
onClick: function onClick() {
|
|
4683
|
+
return onOpen(data._id);
|
|
4684
|
+
}
|
|
4685
|
+
}), /*#__PURE__*/jsx(TextElement, {
|
|
4686
|
+
data: data,
|
|
4687
|
+
onSelect: onSelect,
|
|
4688
|
+
multi: multi
|
|
4689
|
+
})]
|
|
4690
|
+
})
|
|
4691
|
+
}), data.open && data.children.map(function (d) {
|
|
4692
|
+
return /*#__PURE__*/jsx(Elements, {
|
|
4693
|
+
data: d,
|
|
4694
|
+
level: level + 1,
|
|
4695
|
+
onOpen: onOpen,
|
|
4696
|
+
onSelect: onSelect,
|
|
4697
|
+
multi: multi
|
|
4698
|
+
}, d._id);
|
|
4699
|
+
})]
|
|
4700
|
+
});
|
|
4701
|
+
}
|
|
4702
|
+
function getExisting(data, id) {
|
|
4703
|
+
return flatElements(data).find(function (org) {
|
|
4704
|
+
return org._id == id;
|
|
4705
|
+
});
|
|
4706
|
+
}
|
|
4707
|
+
function flatElements(data) {
|
|
4708
|
+
var _data$flatMap;
|
|
4709
|
+
var d = (_data$flatMap = data === null || data === void 0 ? void 0 : data.flatMap(function (d) {
|
|
4710
|
+
var _d$children;
|
|
4711
|
+
return [d].concat(_toConsumableArray(flatElements((_d$children = d.children) !== null && _d$children !== void 0 ? _d$children : [])));
|
|
4712
|
+
})) !== null && _data$flatMap !== void 0 ? _data$flatMap : [];
|
|
4713
|
+
return d;
|
|
4714
|
+
}
|
|
4715
|
+
function getLastParentWithUnloadedItems(flatData) {
|
|
4716
|
+
var lastParent;
|
|
4717
|
+
var _iterator9 = _createForOfIteratorHelper(_toConsumableArray(flatData).reverse()),
|
|
4718
|
+
_step9;
|
|
4719
|
+
try {
|
|
4720
|
+
var _loop4 = function _loop4() {
|
|
4721
|
+
var _lastParent;
|
|
4722
|
+
var elem = _step9.value;
|
|
4723
|
+
if (((_lastParent = lastParent) === null || _lastParent === void 0 ? void 0 : _lastParent._id) == elem.parent) {
|
|
4724
|
+
return 0; // continue
|
|
4725
|
+
}
|
|
4726
|
+
lastParent = flatData.find(function (f) {
|
|
4727
|
+
return f._id == elem.parent;
|
|
4728
|
+
});
|
|
4729
|
+
if (lastParent && lastParent.children.length < lastParent.total) {
|
|
4730
|
+
return 1; // break
|
|
4731
|
+
}
|
|
4732
|
+
},
|
|
4733
|
+
_ret;
|
|
4734
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
4735
|
+
_ret = _loop4();
|
|
4736
|
+
if (_ret === 0) continue;
|
|
4737
|
+
if (_ret === 1) break;
|
|
4738
|
+
}
|
|
4739
|
+
} catch (err) {
|
|
4740
|
+
_iterator9.e(err);
|
|
4741
|
+
} finally {
|
|
4742
|
+
_iterator9.f();
|
|
4743
|
+
}
|
|
4744
|
+
return lastParent;
|
|
4745
|
+
}
|
|
4746
|
+
function findAllIndexes(a, b) {
|
|
4747
|
+
return a.reduce(function (result, current, index) {
|
|
4748
|
+
if (b.find(function (org) {
|
|
4749
|
+
return org._id == current._id;
|
|
4750
|
+
})) {
|
|
4751
|
+
result.push(index);
|
|
4752
|
+
}
|
|
4753
|
+
return result;
|
|
4754
|
+
}, []);
|
|
4755
|
+
}
|
|
4756
|
+
|
|
3885
4757
|
var DivaNavigator = function DivaNavigator(_ref) {
|
|
3886
4758
|
var children = _ref.children;
|
|
3887
4759
|
var headerElement = useRef(null);
|
|
@@ -3939,4 +4811,4 @@ var DivaNavigator = function DivaNavigator(_ref) {
|
|
|
3939
4811
|
});
|
|
3940
4812
|
};
|
|
3941
4813
|
|
|
3942
|
-
export { DivaNavigator as default };
|
|
4814
|
+
export { index as Selection, DivaNavigator as default };
|