@crystaldesign/diva-navigator 26.7.0-beta.10 → 26.7.0-beta.11
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 +445 -1317
- package/build/types/navigator/src/Header/Notifications/Dropdown.d.ts +6 -1
- 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 +4 -3
- package/build/types/navigator/src/Header/Notifications/index.d.ts.map +1 -1
- package/build/types/navigator/src/Header/Notifications/stateUtils.d.ts +1 -4
- package/build/types/navigator/src/Header/Notifications/stateUtils.d.ts.map +1 -1
- package/build/types/navigator/src/Header/Notifications/types.d.ts +4 -2
- package/build/types/navigator/src/Header/Notifications/types.d.ts.map +1 -1
- package/build/types/navigator/src/Header/Notifications/useNotifications.d.ts +10 -1
- 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/HeaderDropdownPopper/index.d.ts +15 -0
- package/build/types/navigator/src/HeaderDropdownPopper/index.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 +3 -1
- package/build/types/navigator/src/Profil/index.d.ts.map +1 -1
- package/build/types/navigator/src/index.d.ts +0 -3
- package/build/types/navigator/src/index.d.ts.map +1 -1
- package/build/types/navigator/src/tests/unit/Header/Notifications/PopupContent.test.d.ts +2 -0
- package/build/types/navigator/src/tests/unit/Header/Notifications/PopupContent.test.d.ts.map +1 -0
- package/package.json +4 -2
- package/build/types/navigator/src/DropdownContainer/index.d.ts +0 -12
- package/build/types/navigator/src/DropdownContainer/index.d.ts.map +0 -1
- package/build/types/navigator/src/OrganizationSelection/SearchField/index.d.ts +0 -8
- package/build/types/navigator/src/OrganizationSelection/SearchField/index.d.ts.map +0 -1
- package/build/types/navigator/src/OrganizationSelection/TextElement.d.ts +0 -8
- package/build/types/navigator/src/OrganizationSelection/TextElement.d.ts.map +0 -1
- package/build/types/navigator/src/OrganizationSelection/index.d.ts +0 -38
- package/build/types/navigator/src/OrganizationSelection/index.d.ts.map +0 -1
- package/build/types/navigator/src/OrganizationSelection/useCurrentSelected.d.ts +0 -6
- package/build/types/navigator/src/OrganizationSelection/useCurrentSelected.d.ts.map +0 -1
package/build/esm/index.js
CHANGED
|
@@ -5,6 +5,8 @@ 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';
|
|
8
10
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
9
11
|
import Fuse from 'fuse.js';
|
|
10
12
|
import Switch from 'react-switch';
|
|
@@ -22,12 +24,11 @@ import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstruct
|
|
|
22
24
|
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
23
25
|
import _inherits from '@babel/runtime/helpers/inherits';
|
|
24
26
|
import _wrapNativeSuper from '@babel/runtime/helpers/wrapNativeSuper';
|
|
27
|
+
import { ContentItemComponent } from '@crystaldesign/content-item';
|
|
25
28
|
import SearchIcon from '@mui/icons-material/Search';
|
|
26
29
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
27
30
|
import { Html5Qrcode } from 'html5-qrcode';
|
|
28
31
|
import Snowfall from 'react-snowfall';
|
|
29
|
-
import debounce from 'lodash/debounce';
|
|
30
|
-
import { useHover, useLayer, Arrow } from 'react-laag';
|
|
31
32
|
|
|
32
33
|
(function() {
|
|
33
34
|
const env = {"STAGE":"production"};
|
|
@@ -74,8 +75,9 @@ var headerWrapperRight = "header-wrapper-right-zLaAR";
|
|
|
74
75
|
var hide = "hide-1DmsJ";
|
|
75
76
|
var breadcrumbsWrapper = "breadcrumbs-wrapper-nqYkU";
|
|
76
77
|
var customArea = "custom-area-FLAOC";
|
|
77
|
-
var
|
|
78
|
-
|
|
78
|
+
var profileAnchor = "profile-anchor-2eGVj";
|
|
79
|
+
var css_248z$p = ".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\n.profile-anchor-2eGVj {\n display: flex;\n align-items: center;\n height: 100%;\n}\n";
|
|
80
|
+
styleInject(css_248z$p);
|
|
79
81
|
|
|
80
82
|
var scroller = "scroller-QE6K3";
|
|
81
83
|
var buttonsWrapper$1 = "buttons-wrapper-dzIfw";
|
|
@@ -83,14 +85,14 @@ var scrollButton = "scroll-button-xk93p";
|
|
|
83
85
|
var hidden$1 = "hidden-3Ovst";
|
|
84
86
|
var left = "left-9-Upj";
|
|
85
87
|
var right = "right-D4x14";
|
|
86
|
-
var css_248z$
|
|
87
|
-
styleInject(css_248z$
|
|
88
|
+
var css_248z$o = ".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";
|
|
89
|
+
styleInject(css_248z$o);
|
|
88
90
|
|
|
89
91
|
var button$2 = "button-UoHey";
|
|
90
|
-
var selected$
|
|
92
|
+
var selected$3 = "selected-VKkY8";
|
|
91
93
|
var link$2 = "link-mn-o6";
|
|
92
|
-
var css_248z$
|
|
93
|
-
styleInject(css_248z$
|
|
94
|
+
var css_248z$n = ".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";
|
|
95
|
+
styleInject(css_248z$n);
|
|
94
96
|
|
|
95
97
|
var Button = function Button(_ref) {
|
|
96
98
|
var b = _ref.b,
|
|
@@ -121,7 +123,7 @@ var Button = function Button(_ref) {
|
|
|
121
123
|
return type === buttonActionType || type === 'DIVA_WEBPLANNER' && buttonActionType === 'SELLER'; // exception for webplanner
|
|
122
124
|
};
|
|
123
125
|
return /*#__PURE__*/jsxs("div", {
|
|
124
|
-
className: classNames(button$2, isSelected() ? selected$
|
|
126
|
+
className: classNames(button$2, isSelected() ? selected$3 : undefined),
|
|
125
127
|
ref: ref,
|
|
126
128
|
"data-test-id": b.text,
|
|
127
129
|
children: [t(b.text, b.text), /*#__PURE__*/jsx("a", {
|
|
@@ -235,10 +237,10 @@ function Buttons () {
|
|
|
235
237
|
var buttonsWrapper = "buttons-wrapper-ypwVh";
|
|
236
238
|
var breadcrumb = "breadcrumb-03kGg";
|
|
237
239
|
var splitter = "splitter-blALw";
|
|
238
|
-
var selected$
|
|
240
|
+
var selected$2 = "selected-M8GAh";
|
|
239
241
|
var greetingsTextClass = "greetings-text-class-74-so";
|
|
240
|
-
var css_248z$
|
|
241
|
-
styleInject(css_248z$
|
|
242
|
+
var css_248z$m = ".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";
|
|
243
|
+
styleInject(css_248z$m);
|
|
242
244
|
|
|
243
245
|
function Breadcrumbs () {
|
|
244
246
|
var _useDivaCore = useDivaCore(),
|
|
@@ -261,7 +263,7 @@ function Breadcrumbs () {
|
|
|
261
263
|
children: [/*#__PURE__*/jsx("div", {
|
|
262
264
|
className: splitter
|
|
263
265
|
}), /*#__PURE__*/jsx("div", {
|
|
264
|
-
className: classNames(breadcrumb, breadcrumbs.current == b.level ? selected$
|
|
266
|
+
className: classNames(breadcrumb, breadcrumbs.current == b.level ? selected$2 : undefined),
|
|
265
267
|
onClick: function onClick() {
|
|
266
268
|
return openComponent(b.component);
|
|
267
269
|
},
|
|
@@ -277,55 +279,84 @@ function Breadcrumbs () {
|
|
|
277
279
|
|
|
278
280
|
var selector = "selector-zu-gI";
|
|
279
281
|
var section = "section--hy0j";
|
|
280
|
-
var selected$
|
|
281
|
-
var item
|
|
282
|
+
var selected$1 = "selected-KQjvM";
|
|
283
|
+
var item = "item-6aqaG";
|
|
282
284
|
var expanderClosed = "expander-closed-Wnhtx";
|
|
283
285
|
var expanderOpen = "expander-open-py2FE";
|
|
284
286
|
var open$1 = "open--KKW8";
|
|
285
287
|
var languageClosed = "language-closed-2KjG0";
|
|
286
|
-
var css_248z$
|
|
287
|
-
styleInject(css_248z$
|
|
288
|
+
var css_248z$l = ".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";
|
|
289
|
+
styleInject(css_248z$l);
|
|
288
290
|
|
|
289
|
-
var
|
|
290
|
-
var
|
|
291
|
-
var
|
|
292
|
-
|
|
291
|
+
var popper = "popper-WbmUv";
|
|
292
|
+
var panel = "panel-obaTv";
|
|
293
|
+
var open = "open-NYkrM";
|
|
294
|
+
var css_248z$k = ".popper-WbmUv {\n z-index: 1300;\n}\n\n.panel-obaTv {\n background-color: #f2f2f2;\n color: #333333;\n width: 400px;\n box-shadow: 0px 2px 6px 0px rgba(51, 51, 51, 0.4);\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 overflow: hidden;\n scrollbar-width: none;\n}\n\n.panel-obaTv::-webkit-scrollbar {\n display: none;\n}\n\n.open-NYkrM {\n overflow: auto;\n}\n";
|
|
295
|
+
styleInject(css_248z$k);
|
|
293
296
|
|
|
294
|
-
function ownKeys$
|
|
295
|
-
function _objectSpread$
|
|
296
|
-
function
|
|
297
|
+
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; }
|
|
298
|
+
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; }
|
|
299
|
+
function HeaderDropdownPopper(_ref) {
|
|
297
300
|
var open$1 = _ref.open,
|
|
301
|
+
anchorEl = _ref.anchorEl,
|
|
302
|
+
onClose = _ref.onClose,
|
|
298
303
|
maxHeight = _ref.maxHeight,
|
|
299
|
-
|
|
300
|
-
|
|
304
|
+
_ref$placement = _ref.placement,
|
|
305
|
+
placement = _ref$placement === void 0 ? 'bottom-end' : _ref$placement,
|
|
306
|
+
id = _ref.id,
|
|
301
307
|
className = _ref.className,
|
|
302
308
|
style = _ref.style,
|
|
303
309
|
children = _ref.children;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
310
|
+
var handleClickAway = function handleClickAway(event) {
|
|
311
|
+
if (anchorEl !== null && anchorEl !== void 0 && anchorEl.contains(event.target)) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
onClose();
|
|
315
|
+
};
|
|
316
|
+
return /*#__PURE__*/jsx(Popper, {
|
|
317
|
+
id: id,
|
|
318
|
+
className: popper,
|
|
319
|
+
open: open$1 && !!anchorEl,
|
|
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
|
+
})
|
|
314
345
|
});
|
|
315
346
|
}
|
|
316
347
|
|
|
317
|
-
function ownKeys$
|
|
318
|
-
function _objectSpread$
|
|
319
|
-
function _createForOfIteratorHelper$
|
|
320
|
-
function _unsupportedIterableToArray$
|
|
321
|
-
function _arrayLikeToArray$
|
|
348
|
+
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; }
|
|
349
|
+
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; }
|
|
350
|
+
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; } } }; }
|
|
351
|
+
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; } }
|
|
352
|
+
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; }
|
|
322
353
|
/**
|
|
323
354
|
* Returns path of node ids from root to target (inclusive), or null if not found.
|
|
324
355
|
* Use `new Set(result)` for membership checks, or `result.slice(0, -1)` for ancestors only.
|
|
325
356
|
*/
|
|
326
357
|
function findPathToNode(nodes, targetId) {
|
|
327
358
|
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
328
|
-
var _iterator = _createForOfIteratorHelper$
|
|
359
|
+
var _iterator = _createForOfIteratorHelper$3(nodes),
|
|
329
360
|
_step;
|
|
330
361
|
try {
|
|
331
362
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -344,7 +375,7 @@ function findPathToNode(nodes, targetId) {
|
|
|
344
375
|
return null;
|
|
345
376
|
}
|
|
346
377
|
function findNodeInTree(nodes, targetId) {
|
|
347
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
378
|
+
var _iterator2 = _createForOfIteratorHelper$3(nodes),
|
|
348
379
|
_step2;
|
|
349
380
|
try {
|
|
350
381
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -365,7 +396,7 @@ function findNodeInTree(nodes, targetId) {
|
|
|
365
396
|
function flattenDisplayOrder(nodes, expandedIds) {
|
|
366
397
|
var ids = [];
|
|
367
398
|
var _walk = function walk(list) {
|
|
368
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
399
|
+
var _iterator3 = _createForOfIteratorHelper$3(list),
|
|
369
400
|
_step3;
|
|
370
401
|
try {
|
|
371
402
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -392,7 +423,7 @@ function flattenDisplayOrder(nodes, expandedIds) {
|
|
|
392
423
|
*/
|
|
393
424
|
function computeEffectiveScores(nodes, scoreMap) {
|
|
394
425
|
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Map();
|
|
395
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
426
|
+
var _iterator4 = _createForOfIteratorHelper$3(nodes),
|
|
396
427
|
_step4;
|
|
397
428
|
try {
|
|
398
429
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -401,7 +432,7 @@ function computeEffectiveScores(nodes, scoreMap) {
|
|
|
401
432
|
var best = (_scoreMap$get = scoreMap.get(node._id)) !== null && _scoreMap$get !== void 0 ? _scoreMap$get : Infinity;
|
|
402
433
|
if (node.children) {
|
|
403
434
|
computeEffectiveScores(node.children, scoreMap, result);
|
|
404
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
435
|
+
var _iterator5 = _createForOfIteratorHelper$3(node.children),
|
|
405
436
|
_step5;
|
|
406
437
|
try {
|
|
407
438
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -438,7 +469,7 @@ function sortTree(nodes, selectedPath, effectiveScores) {
|
|
|
438
469
|
return 0;
|
|
439
470
|
});
|
|
440
471
|
return sorted.map(function (node) {
|
|
441
|
-
return node.children ? _objectSpread$
|
|
472
|
+
return node.children ? _objectSpread$4(_objectSpread$4({}, node), {}, {
|
|
442
473
|
children: sortTree(node.children, selectedPath, effectiveScores)
|
|
443
474
|
}) : node;
|
|
444
475
|
});
|
|
@@ -446,7 +477,7 @@ function sortTree(nodes, selectedPath, effectiveScores) {
|
|
|
446
477
|
function collectTypes(nodes) {
|
|
447
478
|
var types = new Set();
|
|
448
479
|
var _walk2 = function walk(list) {
|
|
449
|
-
var _iterator6 = _createForOfIteratorHelper$
|
|
480
|
+
var _iterator6 = _createForOfIteratorHelper$3(list),
|
|
450
481
|
_step6;
|
|
451
482
|
try {
|
|
452
483
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -464,11 +495,11 @@ function collectTypes(nodes) {
|
|
|
464
495
|
return Array.from(types);
|
|
465
496
|
}
|
|
466
497
|
|
|
467
|
-
function ownKeys$
|
|
468
|
-
function _objectSpread$
|
|
469
|
-
function _createForOfIteratorHelper$
|
|
470
|
-
function _unsupportedIterableToArray$
|
|
471
|
-
function _arrayLikeToArray$
|
|
498
|
+
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; }
|
|
499
|
+
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; }
|
|
500
|
+
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; } } }; }
|
|
501
|
+
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; } }
|
|
502
|
+
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; }
|
|
472
503
|
function treeReducer(state, action) {
|
|
473
504
|
switch (action.type) {
|
|
474
505
|
case 'SET_TREE':
|
|
@@ -478,7 +509,7 @@ function treeReducer(state, action) {
|
|
|
478
509
|
var path = findPathToNode(action.tree, action.selectedId);
|
|
479
510
|
if (path) {
|
|
480
511
|
var ancestors = path.slice(0, -1);
|
|
481
|
-
var _iterator = _createForOfIteratorHelper$
|
|
512
|
+
var _iterator = _createForOfIteratorHelper$2(ancestors),
|
|
482
513
|
_step;
|
|
483
514
|
try {
|
|
484
515
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -492,7 +523,7 @@ function treeReducer(state, action) {
|
|
|
492
523
|
}
|
|
493
524
|
}
|
|
494
525
|
}
|
|
495
|
-
return _objectSpread$
|
|
526
|
+
return _objectSpread$3(_objectSpread$3({}, state), {}, {
|
|
496
527
|
tree: action.tree,
|
|
497
528
|
totalAccessible: action.totalAccessible,
|
|
498
529
|
selectedId: action.selectedId,
|
|
@@ -504,7 +535,7 @@ function treeReducer(state, action) {
|
|
|
504
535
|
case 'SET_EXPANDED':
|
|
505
536
|
{
|
|
506
537
|
var next = new Set(state.expandedIds);
|
|
507
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
538
|
+
var _iterator2 = _createForOfIteratorHelper$2(action.nodeIds),
|
|
508
539
|
_step2;
|
|
509
540
|
try {
|
|
510
541
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -516,12 +547,12 @@ function treeReducer(state, action) {
|
|
|
516
547
|
} finally {
|
|
517
548
|
_iterator2.f();
|
|
518
549
|
}
|
|
519
|
-
return _objectSpread$
|
|
550
|
+
return _objectSpread$3(_objectSpread$3({}, state), {}, {
|
|
520
551
|
expandedIds: next
|
|
521
552
|
});
|
|
522
553
|
}
|
|
523
554
|
case 'SELECT':
|
|
524
|
-
return _objectSpread$
|
|
555
|
+
return _objectSpread$3(_objectSpread$3({}, state), {}, {
|
|
525
556
|
selectedId: action.nodeId
|
|
526
557
|
});
|
|
527
558
|
default:
|
|
@@ -601,15 +632,15 @@ function useOrgTree(onSelect) {
|
|
|
601
632
|
};
|
|
602
633
|
}
|
|
603
634
|
|
|
604
|
-
function ownKeys$
|
|
605
|
-
function _objectSpread$
|
|
606
|
-
function _createForOfIteratorHelper$
|
|
607
|
-
function _unsupportedIterableToArray$
|
|
608
|
-
function _arrayLikeToArray$
|
|
635
|
+
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; }
|
|
636
|
+
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; }
|
|
637
|
+
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; } } }; }
|
|
638
|
+
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; } }
|
|
639
|
+
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; }
|
|
609
640
|
function flattenTree(nodes) {
|
|
610
641
|
var ancestors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
611
642
|
var result = [];
|
|
612
|
-
var _iterator = _createForOfIteratorHelper$
|
|
643
|
+
var _iterator = _createForOfIteratorHelper$1(nodes),
|
|
613
644
|
_step;
|
|
614
645
|
try {
|
|
615
646
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -641,7 +672,7 @@ function annotateSubtree(nodes, matchedIds, matchIndicesMap) {
|
|
|
641
672
|
return nodes.map(function (node) {
|
|
642
673
|
var _matchedIds$has;
|
|
643
674
|
var isMatched = (_matchedIds$has = matchedIds === null || matchedIds === void 0 ? void 0 : matchedIds.has(node._id)) !== null && _matchedIds$has !== void 0 ? _matchedIds$has : false;
|
|
644
|
-
return _objectSpread$
|
|
675
|
+
return _objectSpread$2(_objectSpread$2({}, node), {}, {
|
|
645
676
|
matched: isMatched,
|
|
646
677
|
matchIndices: isMatched ? matchIndicesMap === null || matchIndicesMap === void 0 ? void 0 : matchIndicesMap.get(node._id) : undefined,
|
|
647
678
|
children: node.children ? annotateSubtree(node.children, matchedIds, matchIndicesMap) : undefined
|
|
@@ -656,7 +687,7 @@ function annotateSubtree(nodes, matchedIds, matchIndicesMap) {
|
|
|
656
687
|
function filterTree(nodes, typeFilters, matchedIds, matchIndicesMap) {
|
|
657
688
|
var hasTextSearch = matchedIds != null && matchIndicesMap != null;
|
|
658
689
|
var result = [];
|
|
659
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
690
|
+
var _iterator2 = _createForOfIteratorHelper$1(nodes),
|
|
660
691
|
_step2;
|
|
661
692
|
try {
|
|
662
693
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -664,7 +695,7 @@ function filterTree(nodes, typeFilters, matchedIds, matchIndicesMap) {
|
|
|
664
695
|
var typeOk = typeFilters.size === 0 || typeFilters.has(node.orgType);
|
|
665
696
|
var directMatch = hasTextSearch ? matchedIds.has(node._id) && typeOk : typeFilters.has(node.orgType);
|
|
666
697
|
if (directMatch) {
|
|
667
|
-
result.push(_objectSpread$
|
|
698
|
+
result.push(_objectSpread$2(_objectSpread$2({}, node), {}, {
|
|
668
699
|
matched: true,
|
|
669
700
|
matchIndices: hasTextSearch ? matchIndicesMap.get(node._id) : undefined,
|
|
670
701
|
children: node.children ? annotateSubtree(node.children, hasTextSearch ? matchedIds : undefined, hasTextSearch ? matchIndicesMap : undefined) : undefined
|
|
@@ -672,7 +703,7 @@ function filterTree(nodes, typeFilters, matchedIds, matchIndicesMap) {
|
|
|
672
703
|
} else {
|
|
673
704
|
var filteredChildren = node.children ? filterTree(node.children, typeFilters, matchedIds, matchIndicesMap) : undefined;
|
|
674
705
|
if (filteredChildren && filteredChildren.length > 0) {
|
|
675
|
-
result.push(_objectSpread$
|
|
706
|
+
result.push(_objectSpread$2(_objectSpread$2({}, node), {}, {
|
|
676
707
|
matched: false,
|
|
677
708
|
children: filteredChildren
|
|
678
709
|
}));
|
|
@@ -693,13 +724,13 @@ function filterTree(nodes, typeFilters, matchedIds, matchIndicesMap) {
|
|
|
693
724
|
*/
|
|
694
725
|
function filterTreeByTypesOnly(nodes, typeFilters) {
|
|
695
726
|
var result = [];
|
|
696
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
727
|
+
var _iterator3 = _createForOfIteratorHelper$1(nodes),
|
|
697
728
|
_step3;
|
|
698
729
|
try {
|
|
699
730
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
700
731
|
var node = _step3.value;
|
|
701
732
|
if (typeFilters.has(node.orgType)) {
|
|
702
|
-
result.push(_objectSpread$
|
|
733
|
+
result.push(_objectSpread$2(_objectSpread$2({}, node), {}, {
|
|
703
734
|
matched: true,
|
|
704
735
|
children: node.children ? annotateSubtree(node.children) : undefined
|
|
705
736
|
}));
|
|
@@ -725,7 +756,7 @@ function filterMatchIndices(indices, patternLength) {
|
|
|
725
756
|
if (indices.length <= 1) return indices;
|
|
726
757
|
var windowSize = patternLength + 2;
|
|
727
758
|
var positions = [];
|
|
728
|
-
var _iterator4 = _createForOfIteratorHelper$
|
|
759
|
+
var _iterator4 = _createForOfIteratorHelper$1(indices),
|
|
729
760
|
_step4;
|
|
730
761
|
try {
|
|
731
762
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -771,7 +802,7 @@ function getMatchPositionScore(arg) {
|
|
|
771
802
|
var _arg$matches;
|
|
772
803
|
if (!((_arg$matches = arg.matches) !== null && _arg$matches !== void 0 && _arg$matches.length)) return 3;
|
|
773
804
|
var best = 3;
|
|
774
|
-
var _iterator5 = _createForOfIteratorHelper$
|
|
805
|
+
var _iterator5 = _createForOfIteratorHelper$1(arg.matches),
|
|
775
806
|
_step5;
|
|
776
807
|
try {
|
|
777
808
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
@@ -792,7 +823,7 @@ function getMatchPositionScore(arg) {
|
|
|
792
823
|
}
|
|
793
824
|
function collectExpandedIds(nodes) {
|
|
794
825
|
var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set();
|
|
795
|
-
var _iterator6 = _createForOfIteratorHelper$
|
|
826
|
+
var _iterator6 = _createForOfIteratorHelper$1(nodes),
|
|
796
827
|
_step6;
|
|
797
828
|
try {
|
|
798
829
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
@@ -826,7 +857,7 @@ function performSearch(fuse, flatItems, query) {
|
|
|
826
857
|
var matchedIds = new Set();
|
|
827
858
|
var matchIndicesMap = new Map();
|
|
828
859
|
var scoreMap = new Map();
|
|
829
|
-
var _iterator7 = _createForOfIteratorHelper$
|
|
860
|
+
var _iterator7 = _createForOfIteratorHelper$1(words),
|
|
830
861
|
_step7;
|
|
831
862
|
try {
|
|
832
863
|
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
@@ -835,7 +866,7 @@ function performSearch(fuse, flatItems, query) {
|
|
|
835
866
|
var _r$score;
|
|
836
867
|
return ((_r$score = r.score) !== null && _r$score !== void 0 ? _r$score : 1) <= MAX_FUSE_SCORE;
|
|
837
868
|
});
|
|
838
|
-
var _iterator9 = _createForOfIteratorHelper$
|
|
869
|
+
var _iterator9 = _createForOfIteratorHelper$1(results),
|
|
839
870
|
_step9;
|
|
840
871
|
try {
|
|
841
872
|
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
@@ -848,7 +879,7 @@ function performSearch(fuse, flatItems, query) {
|
|
|
848
879
|
var positionBonus = Math.max(0, 2 - Math.min(positionRank, 2)) * POSITION_WEIGHT;
|
|
849
880
|
scoreMap.set(result.item._id, prev + ((_result$score = result.score) !== null && _result$score !== void 0 ? _result$score : 0) - positionBonus - MATCH_COUNT_BONUS);
|
|
850
881
|
if (result.matches) {
|
|
851
|
-
var _iterator10 = _createForOfIteratorHelper$
|
|
882
|
+
var _iterator10 = _createForOfIteratorHelper$1(result.matches),
|
|
852
883
|
_step10;
|
|
853
884
|
try {
|
|
854
885
|
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
@@ -882,7 +913,7 @@ function performSearch(fuse, flatItems, query) {
|
|
|
882
913
|
_iterator7.f();
|
|
883
914
|
}
|
|
884
915
|
var exactIdMatchedIds = collectExactIdMatches(flatItems, query);
|
|
885
|
-
var _iterator8 = _createForOfIteratorHelper$
|
|
916
|
+
var _iterator8 = _createForOfIteratorHelper$1(exactIdMatchedIds),
|
|
886
917
|
_step8;
|
|
887
918
|
try {
|
|
888
919
|
var _loop = function _loop() {
|
|
@@ -1090,7 +1121,7 @@ var orgTypeConfig = {
|
|
|
1090
1121
|
|
|
1091
1122
|
var container = "container-FVPtn";
|
|
1092
1123
|
var toolbar = "toolbar-ANpuZ";
|
|
1093
|
-
var searchBar
|
|
1124
|
+
var searchBar = "search-bar-gpRL2";
|
|
1094
1125
|
var searchField = "search-field-8zGFa";
|
|
1095
1126
|
var searchClearBtn = "search-clear-btn-ggM0O";
|
|
1096
1127
|
var typeFilterBar = "type-filter-bar-qx91Q";
|
|
@@ -1111,16 +1142,16 @@ var nodeNameSelected = "node-name-selected-KrVZD";
|
|
|
1111
1142
|
var matchChar = "match-char-cWyWK";
|
|
1112
1143
|
var loading$1 = "loading-zurRu";
|
|
1113
1144
|
var singleOrg = "single-org-q4R2s";
|
|
1114
|
-
var css_248z$
|
|
1115
|
-
styleInject(css_248z$
|
|
1145
|
+
var css_248z$j = ".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";
|
|
1146
|
+
styleInject(css_248z$j);
|
|
1116
1147
|
|
|
1117
|
-
function _createForOfIteratorHelper
|
|
1118
|
-
function _unsupportedIterableToArray
|
|
1119
|
-
function _arrayLikeToArray
|
|
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; }
|
|
1120
1151
|
function renderHighlightedName(text, indices) {
|
|
1121
1152
|
if (!indices || indices.length === 0) return text;
|
|
1122
1153
|
var highlighted = new Uint8Array(text.length);
|
|
1123
|
-
var _iterator = _createForOfIteratorHelper
|
|
1154
|
+
var _iterator = _createForOfIteratorHelper(indices),
|
|
1124
1155
|
_step;
|
|
1125
1156
|
try {
|
|
1126
1157
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -1335,7 +1366,7 @@ function OrgTreeSelect(_ref) {
|
|
|
1335
1366
|
className: searchField,
|
|
1336
1367
|
children: [/*#__PURE__*/jsx("input", {
|
|
1337
1368
|
ref: searchInputRef,
|
|
1338
|
-
className: searchBar
|
|
1369
|
+
className: searchBar,
|
|
1339
1370
|
type: "text",
|
|
1340
1371
|
autoComplete: "off",
|
|
1341
1372
|
placeholder: t('orgTree.filter.placeholder'),
|
|
@@ -1406,15 +1437,15 @@ function OrgTreeSelect(_ref) {
|
|
|
1406
1437
|
var wrapper$b = "wrapper-zkdZ1";
|
|
1407
1438
|
var warningText = "warning-text-bwPCz";
|
|
1408
1439
|
var modeContainer = "mode-container-iyMu1";
|
|
1409
|
-
var css_248z$
|
|
1410
|
-
styleInject(css_248z$
|
|
1440
|
+
var css_248z$i = ".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";
|
|
1441
|
+
styleInject(css_248z$i);
|
|
1411
1442
|
|
|
1412
1443
|
var toggleSwitch = "toggle-switch-dpRMP";
|
|
1413
1444
|
var switchSelection = "switch-selection-gzuIi";
|
|
1414
1445
|
var switchLabel = "switch-label-7ARiU";
|
|
1415
1446
|
var switchRadio = "switch-radio-NmaTt";
|
|
1416
|
-
var css_248z$
|
|
1417
|
-
styleInject(css_248z$
|
|
1447
|
+
var css_248z$h = ".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";
|
|
1448
|
+
styleInject(css_248z$h);
|
|
1418
1449
|
|
|
1419
1450
|
var MultiToggleSwitch = function MultiToggleSwitch(_ref) {
|
|
1420
1451
|
var values = _ref.values,
|
|
@@ -1477,8 +1508,8 @@ var logoutWrapper = "logout-wrapper-jI9Sq";
|
|
|
1477
1508
|
var logoutButton = "logout-button-m87tE";
|
|
1478
1509
|
var logoutIcon = "logout-icon-t01Yi";
|
|
1479
1510
|
var footerVersion = "footer-version-0OgH9";
|
|
1480
|
-
var css_248z$
|
|
1481
|
-
styleInject(css_248z$
|
|
1511
|
+
var css_248z$g = ".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";
|
|
1512
|
+
styleInject(css_248z$g);
|
|
1482
1513
|
|
|
1483
1514
|
var Logout = function Logout(_ref) {
|
|
1484
1515
|
var setOpen = _ref.setOpen;
|
|
@@ -1534,8 +1565,8 @@ var Logout = function Logout(_ref) {
|
|
|
1534
1565
|
};
|
|
1535
1566
|
|
|
1536
1567
|
var footerLinks = "footer-links-BZYFg";
|
|
1537
|
-
var css_248z$
|
|
1538
|
-
styleInject(css_248z$
|
|
1568
|
+
var css_248z$f = ".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";
|
|
1569
|
+
styleInject(css_248z$f);
|
|
1539
1570
|
|
|
1540
1571
|
var AGBs = function AGBs(props) {
|
|
1541
1572
|
var _useDivaCore = useDivaCore(),
|
|
@@ -1595,9 +1626,9 @@ var AGBs = function AGBs(props) {
|
|
|
1595
1626
|
};
|
|
1596
1627
|
|
|
1597
1628
|
var wrapper$9 = "wrapper-Y1Jcp";
|
|
1598
|
-
var text
|
|
1599
|
-
var css_248z$
|
|
1600
|
-
styleInject(css_248z$
|
|
1629
|
+
var text = "text-M0L7c";
|
|
1630
|
+
var css_248z$e = ".wrapper-Y1Jcp {\n display: flex;\n width: 100%;\n gap: 12px;\n align-items: center;\n}\n.text-M0L7c {\n}\n";
|
|
1631
|
+
styleInject(css_248z$e);
|
|
1601
1632
|
|
|
1602
1633
|
var HidePrices = function HidePrices(props) {
|
|
1603
1634
|
var _theme$palette;
|
|
@@ -1630,7 +1661,7 @@ var HidePrices = function HidePrices(props) {
|
|
|
1630
1661
|
uncheckedIcon: false,
|
|
1631
1662
|
checkedIcon: false
|
|
1632
1663
|
}), /*#__PURE__*/jsx("div", {
|
|
1633
|
-
className: text
|
|
1664
|
+
className: text,
|
|
1634
1665
|
children: t('navigation.user.hideprices')
|
|
1635
1666
|
}), pricePreviewActive && /*#__PURE__*/jsxs(Fragment$1, {
|
|
1636
1667
|
children: [/*#__PURE__*/jsx(Switch, {
|
|
@@ -1645,7 +1676,7 @@ var HidePrices = function HidePrices(props) {
|
|
|
1645
1676
|
checkedIcon: false,
|
|
1646
1677
|
disabled: hidePrices
|
|
1647
1678
|
}), /*#__PURE__*/jsx("div", {
|
|
1648
|
-
className: text
|
|
1679
|
+
className: text,
|
|
1649
1680
|
children: t('navigation.user.hideconfigpricepreview')
|
|
1650
1681
|
})]
|
|
1651
1682
|
}), showSnow && /*#__PURE__*/jsxs(Fragment$1, {
|
|
@@ -1660,7 +1691,7 @@ var HidePrices = function HidePrices(props) {
|
|
|
1660
1691
|
uncheckedIcon: false,
|
|
1661
1692
|
checkedIcon: false
|
|
1662
1693
|
}), /*#__PURE__*/jsx("div", {
|
|
1663
|
-
className: text
|
|
1694
|
+
className: text,
|
|
1664
1695
|
children: t('navigation.user.hidesnow')
|
|
1665
1696
|
})]
|
|
1666
1697
|
})]
|
|
@@ -1677,10 +1708,10 @@ var clickable = "clickable-MhS-F";
|
|
|
1677
1708
|
var controlWrapper = "control-wrapper-u1DL4";
|
|
1678
1709
|
var menu$1 = "menu-w8zcL";
|
|
1679
1710
|
var arrowWrapper = "arrow-wrapper-rHbX-";
|
|
1680
|
-
var arrow
|
|
1681
|
-
var openClass$
|
|
1682
|
-
var css_248z$
|
|
1683
|
-
styleInject(css_248z$
|
|
1711
|
+
var arrow = "arrow-i5G-Z";
|
|
1712
|
+
var openClass$1 = "open-class-U2edh";
|
|
1713
|
+
var css_248z$d = ".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";
|
|
1714
|
+
styleInject(css_248z$d);
|
|
1684
1715
|
|
|
1685
1716
|
var UserAndLanguage = function UserAndLanguage(_ref) {
|
|
1686
1717
|
var _i18n$language, _user$name, _user$familyName;
|
|
@@ -1724,10 +1755,10 @@ var UserAndLanguage = function UserAndLanguage(_ref) {
|
|
|
1724
1755
|
return l !== currentLang;
|
|
1725
1756
|
}))),
|
|
1726
1757
|
arrowOpen: /*#__PURE__*/jsx("div", {
|
|
1727
|
-
className: classNames(arrow
|
|
1758
|
+
className: classNames(arrow, openClass$1)
|
|
1728
1759
|
}),
|
|
1729
1760
|
arrowClosed: /*#__PURE__*/jsx("div", {
|
|
1730
|
-
className: arrow
|
|
1761
|
+
className: arrow
|
|
1731
1762
|
}),
|
|
1732
1763
|
arrowClassName: arrowWrapper,
|
|
1733
1764
|
controlClassName: controlWrapper,
|
|
@@ -1742,10 +1773,10 @@ var UserAndLanguage = function UserAndLanguage(_ref) {
|
|
|
1742
1773
|
|
|
1743
1774
|
var wrapper$7 = "wrapper-1EF4k";
|
|
1744
1775
|
var button$1 = "button-n4ZpL";
|
|
1745
|
-
var selected
|
|
1776
|
+
var selected = "selected-mk9EU";
|
|
1746
1777
|
var link$1 = "link-bFrih";
|
|
1747
|
-
var css_248z$
|
|
1748
|
-
styleInject(css_248z$
|
|
1778
|
+
var css_248z$c = ".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";
|
|
1779
|
+
styleInject(css_248z$c);
|
|
1749
1780
|
|
|
1750
1781
|
var NavigationButtons = function NavigationButtons(_ref) {
|
|
1751
1782
|
var buttons = _ref.buttons;
|
|
@@ -1761,7 +1792,7 @@ var NavigationButtons = function NavigationButtons(_ref) {
|
|
|
1761
1792
|
children: buttons.map(function (b, i) {
|
|
1762
1793
|
var _b$action;
|
|
1763
1794
|
return /*#__PURE__*/jsxs("div", {
|
|
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
|
|
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),
|
|
1765
1796
|
children: [t(b.text, b.text), /*#__PURE__*/jsx("a", {
|
|
1766
1797
|
href: resolveComponent(b.action),
|
|
1767
1798
|
children: /*#__PURE__*/jsx("span", {
|
|
@@ -1779,8 +1810,8 @@ var NavigationButtons = function NavigationButtons(_ref) {
|
|
|
1779
1810
|
|
|
1780
1811
|
var organizationName = "organization-name-uMRaO";
|
|
1781
1812
|
var organizationDescription = "organization-description-TKR5G";
|
|
1782
|
-
var css_248z$
|
|
1783
|
-
styleInject(css_248z$
|
|
1813
|
+
var css_248z$b = ".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";
|
|
1814
|
+
styleInject(css_248z$b);
|
|
1784
1815
|
|
|
1785
1816
|
var Organization = function Organization(_ref) {
|
|
1786
1817
|
_objectDestructuringEmpty(_ref);
|
|
@@ -1802,8 +1833,8 @@ var Organization = function Organization(_ref) {
|
|
|
1802
1833
|
|
|
1803
1834
|
var wrapper$6 = "wrapper-SMA8P";
|
|
1804
1835
|
var icon = "icon-6Qojh";
|
|
1805
|
-
var css_248z$
|
|
1806
|
-
styleInject(css_248z$
|
|
1836
|
+
var css_248z$a = ".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";
|
|
1837
|
+
styleInject(css_248z$a);
|
|
1807
1838
|
|
|
1808
1839
|
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";
|
|
1809
1840
|
|
|
@@ -1832,7 +1863,9 @@ var Link = function Link(_ref) {
|
|
|
1832
1863
|
|
|
1833
1864
|
function Profil (_ref) {
|
|
1834
1865
|
var open = _ref.open,
|
|
1835
|
-
setOpen = _ref.setOpen
|
|
1866
|
+
setOpen = _ref.setOpen,
|
|
1867
|
+
anchorEl = _ref.anchorEl,
|
|
1868
|
+
onClose = _ref.onClose;
|
|
1836
1869
|
var _useDivaCore = useDivaCore(),
|
|
1837
1870
|
_useDivaCore$actions = _useDivaCore.actions,
|
|
1838
1871
|
userHasPermission = _useDivaCore$actions.userHasPermission,
|
|
@@ -1857,14 +1890,14 @@ function Profil (_ref) {
|
|
|
1857
1890
|
});
|
|
1858
1891
|
var headerHeight = 60;
|
|
1859
1892
|
var maxHeight = height - headerHeight - 12;
|
|
1860
|
-
return /*#__PURE__*/jsx(
|
|
1893
|
+
return /*#__PURE__*/jsx(HeaderDropdownPopper, {
|
|
1894
|
+
id: "diva-profile-dropdown",
|
|
1861
1895
|
open: open,
|
|
1896
|
+
anchorEl: anchorEl,
|
|
1897
|
+
onClose: onClose,
|
|
1862
1898
|
maxHeight: maxHeight,
|
|
1863
|
-
|
|
1899
|
+
placement: "bottom-end",
|
|
1864
1900
|
children: open && /*#__PURE__*/jsxs("div", {
|
|
1865
|
-
onClick: function onClick(e) {
|
|
1866
|
-
return e.stopPropagation();
|
|
1867
|
-
},
|
|
1868
1901
|
children: [organization && /*#__PURE__*/jsx("div", {
|
|
1869
1902
|
className: section,
|
|
1870
1903
|
children: /*#__PURE__*/jsx(Organization, {})
|
|
@@ -1906,8 +1939,8 @@ var wrapper$5 = "wrapper-Qn4wN";
|
|
|
1906
1939
|
var logoWrapper = "logo-wrapper-hBDgt";
|
|
1907
1940
|
var logo = "logo-Vs2Ia";
|
|
1908
1941
|
var selectableLogo = "selectable-logo-1DHhf";
|
|
1909
|
-
var css_248z$
|
|
1910
|
-
styleInject(css_248z$
|
|
1942
|
+
var css_248z$9 = ".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";
|
|
1943
|
+
styleInject(css_248z$9);
|
|
1911
1944
|
|
|
1912
1945
|
var Logos = function Logos(props) {
|
|
1913
1946
|
var _useDivaCore = useDivaCore(),
|
|
@@ -1955,8 +1988,8 @@ var Logos = function Logos(props) {
|
|
|
1955
1988
|
};
|
|
1956
1989
|
|
|
1957
1990
|
var languageSelector = "language-selector-Le2oh";
|
|
1958
|
-
var css_248z$
|
|
1959
|
-
styleInject(css_248z$
|
|
1991
|
+
var css_248z$8 = ".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";
|
|
1992
|
+
styleInject(css_248z$8);
|
|
1960
1993
|
|
|
1961
1994
|
var LanguageSelector = function LanguageSelector(props) {
|
|
1962
1995
|
var _useDivaCore = useDivaCore(),
|
|
@@ -1987,9 +2020,9 @@ var accountLogo = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding
|
|
|
1987
2020
|
var wrapper$4 = "wrapper-dTEtU";
|
|
1988
2021
|
var profil = "profil-9K4HQ";
|
|
1989
2022
|
var loginMode = "login-mode-rV-Rt";
|
|
1990
|
-
var openClass
|
|
1991
|
-
var css_248z$
|
|
1992
|
-
styleInject(css_248z$
|
|
2023
|
+
var openClass = "open-class-piIJQ";
|
|
2024
|
+
var css_248z$7 = ".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";
|
|
2025
|
+
styleInject(css_248z$7);
|
|
1993
2026
|
|
|
1994
2027
|
var ProfileImg = function ProfileImg(_ref) {
|
|
1995
2028
|
var onClickProfile = _ref.onClickProfile,
|
|
@@ -2016,9 +2049,12 @@ var ProfileImg = function ProfileImg(_ref) {
|
|
|
2016
2049
|
id: 'Profile',
|
|
2017
2050
|
className: wrapper$4,
|
|
2018
2051
|
children: [showLogin && /*#__PURE__*/jsx("img", {
|
|
2019
|
-
className: classNames(profil, open ? openClass
|
|
2052
|
+
className: classNames(profil, open ? openClass : undefined),
|
|
2020
2053
|
src: user ? profileUrl : accountLogo,
|
|
2021
|
-
onClick: onClickProfile
|
|
2054
|
+
onClick: onClickProfile,
|
|
2055
|
+
"aria-expanded": open,
|
|
2056
|
+
"aria-haspopup": "true",
|
|
2057
|
+
"aria-controls": open ? 'diva-profile-dropdown' : undefined
|
|
2022
2058
|
}), loginMode$1 !== 'offline' && /*#__PURE__*/jsx("div", {
|
|
2023
2059
|
className: loginMode,
|
|
2024
2060
|
style: {
|
|
@@ -2034,8 +2070,8 @@ var ProfileImg = function ProfileImg(_ref) {
|
|
|
2034
2070
|
};
|
|
2035
2071
|
|
|
2036
2072
|
var textClass$1 = "text-class-mZIuq";
|
|
2037
|
-
var css_248z$
|
|
2038
|
-
styleInject(css_248z$
|
|
2073
|
+
var css_248z$6 = ".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";
|
|
2074
|
+
styleInject(css_248z$6);
|
|
2039
2075
|
|
|
2040
2076
|
var WelcomeText = function WelcomeText(_ref) {
|
|
2041
2077
|
var text = _ref.text;
|
|
@@ -2051,8 +2087,8 @@ var WelcomeText = function WelcomeText(_ref) {
|
|
|
2051
2087
|
var wrapper$3 = "wrapper-Nnx1C";
|
|
2052
2088
|
var textClass = "text-class-ODGFT";
|
|
2053
2089
|
var name = "name-5pMK6";
|
|
2054
|
-
var css_248z$
|
|
2055
|
-
styleInject(css_248z$
|
|
2090
|
+
var css_248z$5 = ".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";
|
|
2091
|
+
styleInject(css_248z$5);
|
|
2056
2092
|
|
|
2057
2093
|
var OrganizationName = function OrganizationName(_ref) {
|
|
2058
2094
|
var _user$name, _user$familyName;
|
|
@@ -2080,9 +2116,10 @@ var OrganizationName = function OrganizationName(_ref) {
|
|
|
2080
2116
|
|
|
2081
2117
|
var wrapper$2 = "wrapper-nEeiH";
|
|
2082
2118
|
var bellButton = "bell-button-4FCzu";
|
|
2119
|
+
var badge = "badge-VJAez";
|
|
2083
2120
|
var dropdownHeader = "dropdown-header--L5ev";
|
|
2084
2121
|
var refreshButton = "refresh-button-iYphX";
|
|
2085
|
-
var list
|
|
2122
|
+
var list = "list-oAERO";
|
|
2086
2123
|
var listItem = "list-item-5776s";
|
|
2087
2124
|
var listItemUnread = "list-item-unread-4vv9t";
|
|
2088
2125
|
var listItemRead = "list-item-read-pcnu8";
|
|
@@ -2092,65 +2129,91 @@ var itemSubject = "item-subject-1QAAc";
|
|
|
2092
2129
|
var itemDate = "item-date-1p9lQ";
|
|
2093
2130
|
var empty = "empty-AMurs";
|
|
2094
2131
|
var loading = "loading-nJYWk";
|
|
2132
|
+
var loadingMore = "loading-more-zz2Ht";
|
|
2095
2133
|
var alert = "alert-dGmPN";
|
|
2096
2134
|
var popupDate = "popup-date--2qrU";
|
|
2097
2135
|
var popupDivider = "popup-divider-oKq0i";
|
|
2136
|
+
var popupContainer = "popup-container-StVOE";
|
|
2098
2137
|
var popupContent = "popup-content-Ixtbi";
|
|
2099
|
-
var
|
|
2100
|
-
|
|
2138
|
+
var popupRichContent = "popup-rich-content-RUDYQ";
|
|
2139
|
+
var css_248z$4 = ".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.badge-VJAez .MuiBadge-badge {\n color: #ffffff;\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.loading-more-zz2Ht {\n display: flex;\n justify-content: center;\n padding: 10px 16px;\n}\n\n.loading-more-zz2Ht .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-container-StVOE {\n display: flex;\n flex-direction: column;\n max-height: 80vh;\n overflow: hidden;\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 flex: 1;\n min-height: 0;\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n.popup-rich-content-RUDYQ {\n white-space: normal;\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\n.darkmode .wrapper-nEeiH {\n border-left: black solid 1px;\n}\n";
|
|
2140
|
+
styleInject(css_248z$4);
|
|
2101
2141
|
|
|
2102
|
-
function NotificationsBell(_ref) {
|
|
2103
|
-
var
|
|
2142
|
+
var NotificationsBell = /*#__PURE__*/React.forwardRef(function NotificationsBell(_ref, ref) {
|
|
2143
|
+
var totalUnseen = _ref.totalUnseen,
|
|
2144
|
+
open = _ref.open,
|
|
2104
2145
|
onClick = _ref.onClick;
|
|
2105
2146
|
var _useTranslation = useTranslation(),
|
|
2106
2147
|
t = _useTranslation.t;
|
|
2107
2148
|
return /*#__PURE__*/jsx("div", {
|
|
2149
|
+
ref: ref,
|
|
2108
2150
|
className: wrapper$2,
|
|
2109
2151
|
children: /*#__PURE__*/jsx("button", {
|
|
2110
2152
|
type: "button",
|
|
2111
2153
|
className: bellButton,
|
|
2112
2154
|
onClick: onClick,
|
|
2155
|
+
"aria-expanded": open,
|
|
2156
|
+
"aria-haspopup": "true",
|
|
2157
|
+
"aria-controls": open ? 'diva-notifications-dropdown' : undefined,
|
|
2113
2158
|
"aria-label": t('navigator.notifications.title'),
|
|
2114
|
-
title:
|
|
2115
|
-
count:
|
|
2159
|
+
title: totalUnseen > 0 ? t('navigator.notifications.unseenCount', {
|
|
2160
|
+
count: totalUnseen
|
|
2116
2161
|
}) : t('navigator.notifications.title'),
|
|
2117
2162
|
children: /*#__PURE__*/jsx(Badge, {
|
|
2118
|
-
|
|
2163
|
+
className: badge,
|
|
2164
|
+
badgeContent: totalUnseen,
|
|
2119
2165
|
color: "error",
|
|
2120
|
-
invisible:
|
|
2166
|
+
invisible: totalUnseen === 0,
|
|
2121
2167
|
max: 99,
|
|
2122
2168
|
children: /*#__PURE__*/jsx(NotificationsNoneIcon, {})
|
|
2123
2169
|
})
|
|
2124
2170
|
})
|
|
2125
2171
|
});
|
|
2126
|
-
}
|
|
2172
|
+
});
|
|
2127
2173
|
|
|
2128
2174
|
var DROPDOWN_MAX_HEIGHT = 420;
|
|
2129
|
-
|
|
2130
|
-
// dropdown's right edge lines up with the bell button's right edge.
|
|
2131
|
-
var DROPDOWN_RIGHT_OFFSET = 311;
|
|
2175
|
+
var HEADER_HEIGHT = 48;
|
|
2132
2176
|
function NotificationsDropdown(_ref) {
|
|
2133
2177
|
var open = _ref.open,
|
|
2178
|
+
anchorEl = _ref.anchorEl,
|
|
2179
|
+
onClose = _ref.onClose,
|
|
2134
2180
|
items = _ref.items,
|
|
2135
2181
|
isLoading = _ref.loading,
|
|
2182
|
+
isLoadingMore = _ref.loadingMore,
|
|
2183
|
+
hasMore = _ref.hasMore,
|
|
2136
2184
|
errorMessage = _ref.errorMessage,
|
|
2137
2185
|
onSelect = _ref.onSelect,
|
|
2138
|
-
onRefresh = _ref.onRefresh
|
|
2186
|
+
onRefresh = _ref.onRefresh,
|
|
2187
|
+
onLoadMore = _ref.onLoadMore;
|
|
2139
2188
|
var _useTranslation = useTranslation(),
|
|
2140
2189
|
t = _useTranslation.t;
|
|
2141
|
-
|
|
2190
|
+
var sentinelRef = useRef(null);
|
|
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",
|
|
2142
2208
|
open: open,
|
|
2209
|
+
anchorEl: anchorEl,
|
|
2210
|
+
onClose: onClose,
|
|
2143
2211
|
maxHeight: DROPDOWN_MAX_HEIGHT,
|
|
2144
|
-
|
|
2145
|
-
right: DROPDOWN_RIGHT_OFFSET,
|
|
2212
|
+
placement: "bottom-end",
|
|
2146
2213
|
children: open && /*#__PURE__*/jsxs("div", {
|
|
2147
|
-
onClick: function onClick(e) {
|
|
2148
|
-
return e.stopPropagation();
|
|
2149
|
-
},
|
|
2150
2214
|
style: {
|
|
2151
2215
|
display: 'flex',
|
|
2152
|
-
flexDirection: 'column'
|
|
2153
|
-
height: '100%'
|
|
2216
|
+
flexDirection: 'column'
|
|
2154
2217
|
},
|
|
2155
2218
|
children: [/*#__PURE__*/jsxs("div", {
|
|
2156
2219
|
className: dropdownHeader,
|
|
@@ -2181,9 +2244,12 @@ function NotificationsDropdown(_ref) {
|
|
|
2181
2244
|
}) : items.length === 0 ? /*#__PURE__*/jsx("div", {
|
|
2182
2245
|
className: empty,
|
|
2183
2246
|
children: t('navigator.notifications.empty')
|
|
2184
|
-
}) : /*#__PURE__*/
|
|
2185
|
-
className: list
|
|
2186
|
-
|
|
2247
|
+
}) : /*#__PURE__*/jsxs("div", {
|
|
2248
|
+
className: list,
|
|
2249
|
+
style: {
|
|
2250
|
+
maxHeight: DROPDOWN_MAX_HEIGHT - HEADER_HEIGHT
|
|
2251
|
+
},
|
|
2252
|
+
children: [items.map(function (item) {
|
|
2187
2253
|
return /*#__PURE__*/jsxs("button", {
|
|
2188
2254
|
type: "button",
|
|
2189
2255
|
className: classNames(listItem, item.hasRead ? listItemRead : listItemUnread),
|
|
@@ -2203,7 +2269,14 @@ function NotificationsDropdown(_ref) {
|
|
|
2203
2269
|
})]
|
|
2204
2270
|
})]
|
|
2205
2271
|
}, item._id);
|
|
2206
|
-
})
|
|
2272
|
+
}), /*#__PURE__*/jsx("div", {
|
|
2273
|
+
ref: sentinelRef
|
|
2274
|
+
}), isLoadingMore && /*#__PURE__*/jsx("div", {
|
|
2275
|
+
className: loadingMore,
|
|
2276
|
+
children: /*#__PURE__*/jsx(CircularProgress, {
|
|
2277
|
+
size: 20
|
|
2278
|
+
})
|
|
2279
|
+
})]
|
|
2207
2280
|
})]
|
|
2208
2281
|
})
|
|
2209
2282
|
});
|
|
@@ -2246,18 +2319,18 @@ function _requestJson() {
|
|
|
2246
2319
|
}));
|
|
2247
2320
|
return _requestJson.apply(this, arguments);
|
|
2248
2321
|
}
|
|
2249
|
-
function fetchNotifications(_x2, _x3, _x4) {
|
|
2322
|
+
function fetchNotifications(_x2, _x3, _x4, _x5) {
|
|
2250
2323
|
return _fetchNotifications.apply(this, arguments);
|
|
2251
2324
|
}
|
|
2252
2325
|
function _fetchNotifications() {
|
|
2253
|
-
_fetchNotifications = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(userId, _ref, _ref2) {
|
|
2254
|
-
var limit,
|
|
2326
|
+
_fetchNotifications = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(userId, lang, _ref, _ref2) {
|
|
2327
|
+
var limit, skip, messageService, jwt, url, response;
|
|
2255
2328
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
2256
2329
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2257
2330
|
case 0:
|
|
2258
|
-
limit = _ref.limit,
|
|
2331
|
+
limit = _ref.limit, skip = _ref.skip;
|
|
2259
2332
|
messageService = _ref2.messageService, jwt = _ref2.jwt;
|
|
2260
|
-
url = "".concat(messageService, "/users/").concat(encodeURIComponent(userId), "/communications?limit=").concat(limit, "&
|
|
2333
|
+
url = "".concat(messageService, "/users/").concat(encodeURIComponent(userId), "/communications?limit=").concat(limit, "&skip=").concat(skip, "&lang=").concat(lang);
|
|
2261
2334
|
_context2.next = 5;
|
|
2262
2335
|
return fetch(url, {
|
|
2263
2336
|
method: 'GET',
|
|
@@ -2277,17 +2350,17 @@ function _fetchNotifications() {
|
|
|
2277
2350
|
}));
|
|
2278
2351
|
return _fetchNotifications.apply(this, arguments);
|
|
2279
2352
|
}
|
|
2280
|
-
function fetchNotification(
|
|
2353
|
+
function fetchNotification(_x6, _x7, _x8, _x9) {
|
|
2281
2354
|
return _fetchNotification.apply(this, arguments);
|
|
2282
2355
|
}
|
|
2283
2356
|
function _fetchNotification() {
|
|
2284
|
-
_fetchNotification = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(userId, communicationId, _ref3) {
|
|
2357
|
+
_fetchNotification = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(userId, communicationId, lang, _ref3) {
|
|
2285
2358
|
var messageService, jwt, url, response;
|
|
2286
2359
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
2287
2360
|
while (1) switch (_context3.prev = _context3.next) {
|
|
2288
2361
|
case 0:
|
|
2289
2362
|
messageService = _ref3.messageService, jwt = _ref3.jwt;
|
|
2290
|
-
url = "".concat(messageService, "/users/").concat(encodeURIComponent(userId), "/communications/").concat(encodeURIComponent(communicationId));
|
|
2363
|
+
url = "".concat(messageService, "/users/").concat(encodeURIComponent(userId), "/communications/").concat(encodeURIComponent(communicationId), "?lang=").concat(lang);
|
|
2291
2364
|
_context3.next = 4;
|
|
2292
2365
|
return fetch(url, {
|
|
2293
2366
|
method: 'GET',
|
|
@@ -2309,8 +2382,11 @@ function _fetchNotification() {
|
|
|
2309
2382
|
}
|
|
2310
2383
|
|
|
2311
2384
|
function NotificationPopupContent(_ref) {
|
|
2385
|
+
var _notification$content;
|
|
2312
2386
|
var notification = _ref.notification;
|
|
2313
|
-
|
|
2387
|
+
var hasRichContent = Array.isArray((_notification$content = notification.contentItem) === null || _notification$content === void 0 ? void 0 : _notification$content.content) && notification.contentItem.content.length > 0;
|
|
2388
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2389
|
+
className: popupContainer,
|
|
2314
2390
|
children: [/*#__PURE__*/jsx("div", {
|
|
2315
2391
|
className: popupDate,
|
|
2316
2392
|
children: /*#__PURE__*/jsx("span", {
|
|
@@ -2320,33 +2396,39 @@ function NotificationPopupContent(_ref) {
|
|
|
2320
2396
|
className: popupDivider
|
|
2321
2397
|
}), /*#__PURE__*/jsx("div", {
|
|
2322
2398
|
className: popupContent,
|
|
2323
|
-
children:
|
|
2399
|
+
children: hasRichContent ? /*#__PURE__*/jsx("div", {
|
|
2400
|
+
className: popupRichContent,
|
|
2401
|
+
children: /*#__PURE__*/jsx(ContentItemComponent, {
|
|
2402
|
+
configuration: notification.contentItem
|
|
2403
|
+
})
|
|
2404
|
+
}) : notification.content
|
|
2324
2405
|
})]
|
|
2325
2406
|
});
|
|
2326
2407
|
}
|
|
2327
2408
|
|
|
2328
|
-
function ownKeys$
|
|
2329
|
-
function _objectSpread$
|
|
2409
|
+
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; }
|
|
2410
|
+
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; }
|
|
2330
2411
|
function applyMarkReadUpdate(items, communicationId) {
|
|
2331
2412
|
var target = items.find(function (item) {
|
|
2332
2413
|
return item._id === communicationId;
|
|
2333
2414
|
});
|
|
2334
2415
|
if (!target || target.hasRead) {
|
|
2335
|
-
return
|
|
2336
|
-
items: items,
|
|
2337
|
-
decrement: false
|
|
2338
|
-
};
|
|
2416
|
+
return items;
|
|
2339
2417
|
}
|
|
2340
|
-
return {
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
}),
|
|
2346
|
-
decrement: true
|
|
2347
|
-
};
|
|
2418
|
+
return items.map(function (item) {
|
|
2419
|
+
return item._id === communicationId ? _objectSpread$1(_objectSpread$1({}, item), {}, {
|
|
2420
|
+
hasRead: true
|
|
2421
|
+
}) : item;
|
|
2422
|
+
});
|
|
2348
2423
|
}
|
|
2349
2424
|
|
|
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
|
+
|
|
2350
2432
|
function useNotifications() {
|
|
2351
2433
|
var _useTranslation = useTranslation(),
|
|
2352
2434
|
t = _useTranslation.t;
|
|
@@ -2357,37 +2439,51 @@ function useNotifications() {
|
|
|
2357
2439
|
apiConfig = _useDivaCore$state.apiConfig,
|
|
2358
2440
|
organization = _useDivaCore$state.organization,
|
|
2359
2441
|
openModal = _useDivaCore.actions.openModal;
|
|
2442
|
+
var _useTranslation2 = useTranslation(),
|
|
2443
|
+
i18n = _useTranslation2.i18n;
|
|
2360
2444
|
var _useState = useState(0),
|
|
2361
2445
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
var _useState3 = useState(
|
|
2446
|
+
totalUnseen = _useState2[0],
|
|
2447
|
+
setTotalUnseen = _useState2[1];
|
|
2448
|
+
var _useState3 = useState(0),
|
|
2365
2449
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
var _useState5 = useState(
|
|
2450
|
+
total = _useState4[0],
|
|
2451
|
+
setTotal = _useState4[1];
|
|
2452
|
+
var _useState5 = useState(false),
|
|
2369
2453
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
var _useState7 = useState(
|
|
2454
|
+
open = _useState6[0],
|
|
2455
|
+
setOpen = _useState6[1];
|
|
2456
|
+
var _useState7 = useState([]),
|
|
2373
2457
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
var _useState9 = useState(
|
|
2458
|
+
items = _useState8[0],
|
|
2459
|
+
setItems = _useState8[1];
|
|
2460
|
+
var _useState9 = useState(false),
|
|
2377
2461
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
2378
|
-
|
|
2379
|
-
|
|
2462
|
+
loading = _useState10[0],
|
|
2463
|
+
setLoading = _useState10[1];
|
|
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];
|
|
2380
2476
|
var userId = user === null || user === void 0 ? void 0 : user._id;
|
|
2381
2477
|
var organizationId = organization === null || organization === void 0 ? void 0 : organization._id;
|
|
2382
2478
|
var messageService = apiConfig.messageService;
|
|
2383
|
-
var enabled = !!userId && !!jwt;
|
|
2479
|
+
var enabled = !!userId && !!jwt && total > 0;
|
|
2384
2480
|
var apiContext = useMemo(function () {
|
|
2385
2481
|
return userId && jwt ? {
|
|
2386
2482
|
messageService: messageService,
|
|
2387
2483
|
jwt: jwt
|
|
2388
2484
|
} : null;
|
|
2389
2485
|
}, [userId, jwt, messageService]);
|
|
2390
|
-
var
|
|
2486
|
+
var loadUnseenCount = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
2391
2487
|
var response;
|
|
2392
2488
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2393
2489
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2400,25 +2496,26 @@ function useNotifications() {
|
|
|
2400
2496
|
case 2:
|
|
2401
2497
|
_context.prev = 2;
|
|
2402
2498
|
_context.next = 5;
|
|
2403
|
-
return fetchNotifications(userId, {
|
|
2499
|
+
return fetchNotifications(userId, i18n.language, {
|
|
2404
2500
|
limit: 0,
|
|
2405
|
-
|
|
2501
|
+
skip: 0
|
|
2406
2502
|
}, apiContext);
|
|
2407
2503
|
case 5:
|
|
2408
2504
|
response = _context.sent;
|
|
2409
|
-
|
|
2410
|
-
|
|
2505
|
+
setTotalUnseen(response.totalUnseen);
|
|
2506
|
+
setTotal(response.total);
|
|
2507
|
+
_context.next = 13;
|
|
2411
2508
|
break;
|
|
2412
|
-
case
|
|
2413
|
-
_context.prev =
|
|
2509
|
+
case 10:
|
|
2510
|
+
_context.prev = 10;
|
|
2414
2511
|
_context.t0 = _context["catch"](2);
|
|
2415
2512
|
setErrorMessage(t('navigator.notifications.error.list'));
|
|
2416
|
-
case
|
|
2513
|
+
case 13:
|
|
2417
2514
|
case "end":
|
|
2418
2515
|
return _context.stop();
|
|
2419
2516
|
}
|
|
2420
|
-
}, _callee, null, [[2,
|
|
2421
|
-
})), [apiContext, t, userId, organizationId]);
|
|
2517
|
+
}, _callee, null, [[2, 10]]);
|
|
2518
|
+
})), [apiContext, t, userId, organizationId, i18n.language]);
|
|
2422
2519
|
var loadPage = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
2423
2520
|
var response;
|
|
2424
2521
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -2432,37 +2529,79 @@ function useNotifications() {
|
|
|
2432
2529
|
case 2:
|
|
2433
2530
|
setLoading(true);
|
|
2434
2531
|
setErrorMessage(undefined);
|
|
2435
|
-
|
|
2436
|
-
_context2.
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2532
|
+
setHasMore(false);
|
|
2533
|
+
_context2.prev = 5;
|
|
2534
|
+
_context2.next = 8;
|
|
2535
|
+
return fetchNotifications(userId, i18n.language, {
|
|
2536
|
+
limit: PAGE_SIZE,
|
|
2537
|
+
skip: 0
|
|
2440
2538
|
}, apiContext);
|
|
2441
|
-
case
|
|
2539
|
+
case 8:
|
|
2442
2540
|
response = _context2.sent;
|
|
2443
2541
|
setItems(response.data);
|
|
2444
|
-
|
|
2445
|
-
|
|
2542
|
+
setTotalUnseen(response.totalUnseen);
|
|
2543
|
+
setHasMore(response.data.length < response.total);
|
|
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;
|
|
2446
2586
|
break;
|
|
2447
2587
|
case 12:
|
|
2448
|
-
|
|
2449
|
-
|
|
2588
|
+
_context3.prev = 12;
|
|
2589
|
+
_context3.t0 = _context3["catch"](3);
|
|
2450
2590
|
setErrorMessage(t('navigator.notifications.error.list'));
|
|
2451
2591
|
case 15:
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
return
|
|
2592
|
+
_context3.prev = 15;
|
|
2593
|
+
setLoadingMore(false);
|
|
2594
|
+
return _context3.finish(15);
|
|
2455
2595
|
case 18:
|
|
2456
2596
|
case "end":
|
|
2457
|
-
return
|
|
2597
|
+
return _context3.stop();
|
|
2458
2598
|
}
|
|
2459
|
-
},
|
|
2460
|
-
})), [apiContext, t, userId,
|
|
2599
|
+
}, _callee3, null, [[3, 12, 15, 18]]);
|
|
2600
|
+
})), [apiContext, t, userId, items, loadingMore, hasMore, i18n.language]);
|
|
2461
2601
|
useEffect(function () {
|
|
2462
|
-
void
|
|
2463
|
-
}, [
|
|
2602
|
+
void loadUnseenCount();
|
|
2603
|
+
}, [loadUnseenCount]);
|
|
2464
2604
|
var onBellClick = function onBellClick(event) {
|
|
2465
|
-
event.stopPropagation();
|
|
2466
2605
|
if (!userId) {
|
|
2467
2606
|
return;
|
|
2468
2607
|
}
|
|
@@ -2474,61 +2613,62 @@ function useNotifications() {
|
|
|
2474
2613
|
setOpen(false);
|
|
2475
2614
|
};
|
|
2476
2615
|
var _onSelect = useCallback(/*#__PURE__*/function () {
|
|
2477
|
-
var
|
|
2478
|
-
var notificationData
|
|
2479
|
-
return _regeneratorRuntime.wrap(function
|
|
2480
|
-
while (1) switch (
|
|
2616
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(communicationId) {
|
|
2617
|
+
var notificationData;
|
|
2618
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
2619
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
2481
2620
|
case 0:
|
|
2482
2621
|
if (!(!apiContext || !userId)) {
|
|
2483
|
-
|
|
2622
|
+
_context4.next = 2;
|
|
2484
2623
|
break;
|
|
2485
2624
|
}
|
|
2486
|
-
return
|
|
2625
|
+
return _context4.abrupt("return");
|
|
2487
2626
|
case 2:
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
return fetchNotification(userId, communicationId, apiContext);
|
|
2627
|
+
_context4.prev = 2;
|
|
2628
|
+
_context4.next = 5;
|
|
2629
|
+
return fetchNotification(userId, communicationId, i18n.language, apiContext);
|
|
2491
2630
|
case 5:
|
|
2492
|
-
notificationData =
|
|
2631
|
+
notificationData = _context4.sent;
|
|
2493
2632
|
setOpen(false);
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
setTotalUnread(function (c) {
|
|
2498
|
-
return Math.max(0, c - 1);
|
|
2499
|
-
});
|
|
2500
|
-
}
|
|
2633
|
+
setItems(function (prev) {
|
|
2634
|
+
return applyMarkReadUpdate(prev, communicationId);
|
|
2635
|
+
});
|
|
2501
2636
|
openModal({
|
|
2502
2637
|
rejectByIcon: true,
|
|
2503
|
-
title:
|
|
2504
|
-
|
|
2638
|
+
title: /*#__PURE__*/jsx(Fragment$1, {
|
|
2639
|
+
children: notificationData.subject
|
|
2640
|
+
}),
|
|
2641
|
+
width: 720,
|
|
2505
2642
|
maxWidth: '95%',
|
|
2506
2643
|
content: /*#__PURE__*/jsx(NotificationPopupContent, {
|
|
2507
2644
|
notification: notificationData
|
|
2508
|
-
})
|
|
2645
|
+
}),
|
|
2646
|
+
dontRenderForm: true
|
|
2509
2647
|
});
|
|
2510
|
-
|
|
2648
|
+
_context4.next = 14;
|
|
2511
2649
|
break;
|
|
2512
|
-
case
|
|
2513
|
-
|
|
2514
|
-
|
|
2650
|
+
case 11:
|
|
2651
|
+
_context4.prev = 11;
|
|
2652
|
+
_context4.t0 = _context4["catch"](2);
|
|
2515
2653
|
setErrorMessage(t('navigator.notifications.error.open'));
|
|
2516
|
-
case
|
|
2654
|
+
case 14:
|
|
2517
2655
|
case "end":
|
|
2518
|
-
return
|
|
2656
|
+
return _context4.stop();
|
|
2519
2657
|
}
|
|
2520
|
-
},
|
|
2658
|
+
}, _callee4, null, [[2, 11]]);
|
|
2521
2659
|
}));
|
|
2522
2660
|
return function (_x) {
|
|
2523
|
-
return
|
|
2661
|
+
return _ref4.apply(this, arguments);
|
|
2524
2662
|
};
|
|
2525
|
-
}(), [apiContext,
|
|
2663
|
+
}(), [apiContext, openModal, t, userId, setOpen]);
|
|
2526
2664
|
return {
|
|
2527
2665
|
enabled: enabled,
|
|
2528
|
-
|
|
2666
|
+
totalUnseen: totalUnseen,
|
|
2529
2667
|
open: open,
|
|
2530
2668
|
items: items,
|
|
2531
2669
|
loading: loading,
|
|
2670
|
+
loadingMore: loadingMore,
|
|
2671
|
+
hasMore: hasMore,
|
|
2532
2672
|
errorMessage: errorMessage,
|
|
2533
2673
|
onBellClick: onBellClick,
|
|
2534
2674
|
onSelect: function onSelect(id) {
|
|
@@ -2537,6 +2677,9 @@ function useNotifications() {
|
|
|
2537
2677
|
setOpen: setOpen,
|
|
2538
2678
|
onRefresh: function onRefresh() {
|
|
2539
2679
|
return void loadPage();
|
|
2680
|
+
},
|
|
2681
|
+
onLoadMore: function onLoadMore() {
|
|
2682
|
+
return void loadMore();
|
|
2540
2683
|
}
|
|
2541
2684
|
};
|
|
2542
2685
|
}
|
|
@@ -2548,11 +2691,11 @@ var scannerPlaceholder = "scanner-placeholder-HFpri";
|
|
|
2548
2691
|
var scanner = "scanner-8R-jp";
|
|
2549
2692
|
var hidden = "hidden-C49rQ";
|
|
2550
2693
|
var wrapper$1 = "wrapper-urPnU";
|
|
2551
|
-
var css_248z$
|
|
2552
|
-
styleInject(css_248z$
|
|
2694
|
+
var css_248z$3 = ".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";
|
|
2695
|
+
styleInject(css_248z$3);
|
|
2553
2696
|
|
|
2554
|
-
function ownKeys
|
|
2555
|
-
function _objectSpread
|
|
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; }
|
|
2556
2699
|
var LOG$1 = getLogger('Framework', 'QrCoedScanner');
|
|
2557
2700
|
/**
|
|
2558
2701
|
* Parses the given url and returns the diva number if it is a valid diva url.
|
|
@@ -2903,11 +3046,11 @@ function openResultInCurrentOrg(result, openComponent, closeModal) {
|
|
|
2903
3046
|
divaNr: result.divaNr
|
|
2904
3047
|
};
|
|
2905
3048
|
if (result.orderStatus === 'SEND') {
|
|
2906
|
-
params = _objectSpread
|
|
3049
|
+
params = _objectSpread(_objectSpread({}, params), {}, {
|
|
2907
3050
|
assignNewDivaNr: 'true'
|
|
2908
3051
|
});
|
|
2909
3052
|
} else {
|
|
2910
|
-
params = _objectSpread
|
|
3053
|
+
params = _objectSpread(_objectSpread({}, params), {}, {
|
|
2911
3054
|
check: '1'
|
|
2912
3055
|
});
|
|
2913
3056
|
}
|
|
@@ -3411,6 +3554,8 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3411
3554
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3412
3555
|
openProfile = _useState2[0],
|
|
3413
3556
|
setOpenProfile = _useState2[1];
|
|
3557
|
+
var notificationsAnchorRef = useRef(null);
|
|
3558
|
+
var profileAnchorRef = useRef(null);
|
|
3414
3559
|
var notifications = useNotifications();
|
|
3415
3560
|
|
|
3416
3561
|
//in the case the core is faster initalized than the first render we have to set this state async to guarantee the animation
|
|
@@ -3423,20 +3568,12 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3423
3568
|
return setHeaderLoading(false);
|
|
3424
3569
|
}, 1);
|
|
3425
3570
|
}, []);
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
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]);
|
|
3571
|
+
var closeProfile = useCallback(function () {
|
|
3572
|
+
return setOpenProfile(false);
|
|
3573
|
+
}, []);
|
|
3574
|
+
var closeNotifications = useCallback(function () {
|
|
3575
|
+
return notifications.setOpen(false);
|
|
3576
|
+
}, [notifications.setOpen]);
|
|
3440
3577
|
var onClickProfile = function onClickProfile(e) {
|
|
3441
3578
|
if (user) {
|
|
3442
3579
|
setOpenProfile(!openProfile);
|
|
@@ -3444,7 +3581,6 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3444
3581
|
} else {
|
|
3445
3582
|
showLoginWindow();
|
|
3446
3583
|
}
|
|
3447
|
-
e.stopPropagation();
|
|
3448
3584
|
};
|
|
3449
3585
|
var onBellClick = function onBellClick(e) {
|
|
3450
3586
|
setOpenProfile(false);
|
|
@@ -3453,6 +3589,7 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3453
3589
|
|
|
3454
3590
|
//still show buttons on tablet in landscape mode
|
|
3455
3591
|
var showButtons = !isMobile || isTablet && !isPortrait;
|
|
3592
|
+
var showProfileTriggers = showButtons && (showOrgName || showUserName);
|
|
3456
3593
|
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
3457
3594
|
children: [/*#__PURE__*/jsxs("div", {
|
|
3458
3595
|
id: "diva-header",
|
|
@@ -3477,15 +3614,21 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3477
3614
|
className: customArea,
|
|
3478
3615
|
children: customHeaderElement()
|
|
3479
3616
|
}), notifications.enabled && /*#__PURE__*/jsx(NotificationsBell, {
|
|
3480
|
-
|
|
3617
|
+
ref: notificationsAnchorRef,
|
|
3618
|
+
totalUnseen: notifications.totalUnseen,
|
|
3619
|
+
open: notifications.open,
|
|
3481
3620
|
onClick: onBellClick
|
|
3482
|
-
}),
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3621
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
3622
|
+
ref: profileAnchorRef,
|
|
3623
|
+
className: profileAnchor,
|
|
3624
|
+
children: [showProfileTriggers && /*#__PURE__*/jsx(OrganizationName, {
|
|
3625
|
+
showOrgName: showOrgName,
|
|
3626
|
+
showUserName: showUserName,
|
|
3627
|
+
onClickProfile: onClickProfile
|
|
3628
|
+
}), /*#__PURE__*/jsx(ProfileImg, {
|
|
3629
|
+
onClickProfile: onClickProfile,
|
|
3630
|
+
open: openProfile
|
|
3631
|
+
})]
|
|
3489
3632
|
}), !showLogin && availableLanguages.length > 1 && /*#__PURE__*/jsx(LanguageSelector, {})]
|
|
3490
3633
|
})]
|
|
3491
3634
|
}), (breadcrumbs === null || breadcrumbs === void 0 || (_breadcrumbs$breadcru = breadcrumbs.breadcrumbs.path) === null || _breadcrumbs$breadcru === void 0 ? void 0 : _breadcrumbs$breadcru.length) && /*#__PURE__*/jsx("div", {
|
|
@@ -3494,22 +3637,29 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3494
3637
|
})]
|
|
3495
3638
|
}), user && showLogin && /*#__PURE__*/jsx(Profil, {
|
|
3496
3639
|
open: openProfile,
|
|
3497
|
-
setOpen: setOpenProfile
|
|
3640
|
+
setOpen: setOpenProfile,
|
|
3641
|
+
anchorEl: profileAnchorRef.current,
|
|
3642
|
+
onClose: closeProfile
|
|
3498
3643
|
}), notifications.enabled && /*#__PURE__*/jsx(NotificationsDropdown, {
|
|
3499
3644
|
open: notifications.open,
|
|
3645
|
+
anchorEl: notificationsAnchorRef.current,
|
|
3646
|
+
onClose: closeNotifications,
|
|
3500
3647
|
items: notifications.items,
|
|
3501
3648
|
loading: notifications.loading,
|
|
3649
|
+
loadingMore: notifications.loadingMore,
|
|
3650
|
+
hasMore: notifications.hasMore,
|
|
3502
3651
|
errorMessage: notifications.errorMessage,
|
|
3503
3652
|
onSelect: notifications.onSelect,
|
|
3504
|
-
onRefresh: notifications.onRefresh
|
|
3653
|
+
onRefresh: notifications.onRefresh,
|
|
3654
|
+
onLoadMore: notifications.onLoadMore
|
|
3505
3655
|
})]
|
|
3506
3656
|
});
|
|
3507
3657
|
});
|
|
3508
3658
|
|
|
3509
3659
|
var footer = "footer-6heXz";
|
|
3510
3660
|
var footerLogo = "footer-logo-OYpy2";
|
|
3511
|
-
var css_248z$
|
|
3512
|
-
styleInject(css_248z$
|
|
3661
|
+
var css_248z$2 = ".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";
|
|
3662
|
+
styleInject(css_248z$2);
|
|
3513
3663
|
|
|
3514
3664
|
function Footer () {
|
|
3515
3665
|
var _useDivaCore = useDivaCore(),
|
|
@@ -3538,8 +3688,8 @@ var mobileBcGroup = "mobile-bc-group-qpSWw";
|
|
|
3538
3688
|
var mobileBreadcrumb = "mobile-breadcrumb-AUdyP";
|
|
3539
3689
|
var mobileSelected = "mobile-selected-9UuOs";
|
|
3540
3690
|
var mobileSplitter = "mobile-splitter-MPW46";
|
|
3541
|
-
var css_248z$
|
|
3542
|
-
styleInject(css_248z$
|
|
3691
|
+
var css_248z$1 = ".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";
|
|
3692
|
+
styleInject(css_248z$1);
|
|
3543
3693
|
|
|
3544
3694
|
function Language (_ref) {
|
|
3545
3695
|
var data = _ref.data,
|
|
@@ -3575,7 +3725,7 @@ function Language (_ref) {
|
|
|
3575
3725
|
className: classNames(selector, open ? open$1 : languageClosed),
|
|
3576
3726
|
children: data.map(function (l) {
|
|
3577
3727
|
return /*#__PURE__*/jsx("div", {
|
|
3578
|
-
className: classNames(item
|
|
3728
|
+
className: classNames(item, l == selectedLang ? selected$1 : undefined),
|
|
3579
3729
|
onClick: function onClick() {
|
|
3580
3730
|
onChange(l);
|
|
3581
3731
|
},
|
|
@@ -3729,1031 +3879,9 @@ function Menu (_ref) {
|
|
|
3729
3879
|
}
|
|
3730
3880
|
|
|
3731
3881
|
var wrapper = "wrapper-811ne";
|
|
3732
|
-
var css_248z
|
|
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";
|
|
3882
|
+
var css_248z = ".wrapper-811ne {\n display: flex;\n position: relative;\n height: 100%;\n flex-direction: column;\n}\n";
|
|
3887
3883
|
styleInject(css_248z);
|
|
3888
3884
|
|
|
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
|
-
|
|
4757
3885
|
var DivaNavigator = function DivaNavigator(_ref) {
|
|
4758
3886
|
var children = _ref.children;
|
|
4759
3887
|
var headerElement = useRef(null);
|
|
@@ -4811,4 +3939,4 @@ var DivaNavigator = function DivaNavigator(_ref) {
|
|
|
4811
3939
|
});
|
|
4812
3940
|
};
|
|
4813
3941
|
|
|
4814
|
-
export {
|
|
3942
|
+
export { DivaNavigator as default };
|