@crystaldesign/diva-navigator 26.2.0-beta.23 → 26.2.0-beta.24
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
CHANGED
|
@@ -287,7 +287,6 @@ var leftSpace = "left-space-vcauM";
|
|
|
287
287
|
var arrow$1 = "arrow-egJ6F";
|
|
288
288
|
var list = "list-4f7FZ";
|
|
289
289
|
var tooltip = "tooltip-gsR2r";
|
|
290
|
-
var disabled = "disabled-RYfn7";
|
|
291
290
|
var disabledClick = "disabled-click-74X-4";
|
|
292
291
|
var css_248z$j = ".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";
|
|
293
292
|
styleInject(css_248z$j);
|
|
@@ -297,9 +296,9 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
297
296
|
function TextElement(_ref) {
|
|
298
297
|
var _theme$typography;
|
|
299
298
|
var data = _ref.data,
|
|
300
|
-
onSelect = _ref.onSelect
|
|
301
|
-
|
|
302
|
-
|
|
299
|
+
onSelect = _ref.onSelect;
|
|
300
|
+
_ref.multi;
|
|
301
|
+
_ref.onOpen;
|
|
303
302
|
var textElementRef = useRef(null);
|
|
304
303
|
var _useDivaCore = useDivaCore(),
|
|
305
304
|
theme = _useDivaCore.state.theme;
|
|
@@ -366,11 +365,9 @@ function TextElement(_ref) {
|
|
|
366
365
|
},
|
|
367
366
|
children: /*#__PURE__*/jsx("div", {
|
|
368
367
|
ref: textElementRef,
|
|
369
|
-
className: classNames(text$1, selectable, data.isSelected ? selected$1 : undefined,
|
|
370
|
-
onClick:
|
|
371
|
-
|
|
372
|
-
} : function () {
|
|
373
|
-
onOpen(data._id);
|
|
368
|
+
className: classNames(text$1, selectable, data.isSelected ? selected$1 : undefined, !data.hasChildren ? disabledClick : undefined),
|
|
369
|
+
onClick: function onClick() {
|
|
370
|
+
onSelect(data, !data.isSelected);
|
|
374
371
|
} //with multi we can select and deselct, otherwise deselect is not allowed
|
|
375
372
|
,
|
|
376
373
|
children: displayName
|
|
@@ -469,7 +466,6 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
469
466
|
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; } }
|
|
470
467
|
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; }
|
|
471
468
|
function OrganizationSelection (_ref) {
|
|
472
|
-
var _scroller$current3;
|
|
473
469
|
var onChange = _ref.onChange,
|
|
474
470
|
setOrgsCount = _ref.setOrgsCount,
|
|
475
471
|
current = _ref.current,
|
|
@@ -527,13 +523,13 @@ function OrganizationSelection (_ref) {
|
|
|
527
523
|
return _ref2.apply(this, arguments);
|
|
528
524
|
};
|
|
529
525
|
}();
|
|
530
|
-
var getElementLimit =
|
|
526
|
+
var getElementLimit = function getElementLimit() {
|
|
531
527
|
var _scroller$current, _scroller$current2;
|
|
532
528
|
if (!scroller.current) return 0;
|
|
533
529
|
if (((_scroller$current = scroller.current) === null || _scroller$current === void 0 ? void 0 : _scroller$current.clientHeight) < 300) return 20;
|
|
534
530
|
var multiplier = ((_scroller$current2 = scroller.current) === null || _scroller$current2 === void 0 ? void 0 : _scroller$current2.clientHeight) / 300;
|
|
535
531
|
return Math.ceil(20 * multiplier);
|
|
536
|
-
}
|
|
532
|
+
};
|
|
537
533
|
var debouncedSearch = useCallback(debounce(/*#__PURE__*/function () {
|
|
538
534
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(query) {
|
|
539
535
|
var _root$_id;
|
|
@@ -662,7 +658,7 @@ function OrganizationSelection (_ref) {
|
|
|
662
658
|
return _ref5.apply(this, arguments);
|
|
663
659
|
};
|
|
664
660
|
}(), 300), []);
|
|
665
|
-
var onSelect =
|
|
661
|
+
var onSelect = function onSelect(data, select) {
|
|
666
662
|
if (select) {
|
|
667
663
|
var _data$parentOrganizat, _data$parentOrganizat2;
|
|
668
664
|
var splittedName = data.displayName.split('/');
|
|
@@ -703,8 +699,8 @@ function OrganizationSelection (_ref) {
|
|
|
703
699
|
scroller.current.scrollTo({
|
|
704
700
|
top: 0
|
|
705
701
|
});
|
|
706
|
-
}
|
|
707
|
-
var onOpen =
|
|
702
|
+
};
|
|
703
|
+
var onOpen = /*#__PURE__*/function () {
|
|
708
704
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(id) {
|
|
709
705
|
var flat, elem, _parent$children, _parent$children$leng, _parent$children2, _parent$children3, parent, result, _elem$children, _elem$children2, _result;
|
|
710
706
|
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
@@ -797,10 +793,10 @@ function OrganizationSelection (_ref) {
|
|
|
797
793
|
}
|
|
798
794
|
}, _callee4);
|
|
799
795
|
}));
|
|
800
|
-
return function (_x4) {
|
|
796
|
+
return function onOpen(_x4) {
|
|
801
797
|
return _ref6.apply(this, arguments);
|
|
802
798
|
};
|
|
803
|
-
}()
|
|
799
|
+
}();
|
|
804
800
|
var elementLimit = getElementLimit();
|
|
805
801
|
useEffect(function () {
|
|
806
802
|
if (!elementLimit) return;
|
|
@@ -1778,9 +1774,9 @@ function Profil (_ref) {
|
|
|
1778
1774
|
conditionsUrl = _useDivaCore$state$na.conditionsUrl,
|
|
1779
1775
|
feedbackUrl = _useDivaCore$state$na.feedbackUrl;
|
|
1780
1776
|
var _useState = useState(0),
|
|
1781
|
-
_useState2 = _slicedToArray(_useState, 2)
|
|
1782
|
-
|
|
1783
|
-
setOrgsCount = _useState2[1];
|
|
1777
|
+
_useState2 = _slicedToArray(_useState, 2);
|
|
1778
|
+
_useState2[0];
|
|
1779
|
+
var setOrgsCount = _useState2[1];
|
|
1784
1780
|
var buttonsInMenu = isMobile ? buttons : buttons.filter(function (b) {
|
|
1785
1781
|
return b.inMenu;
|
|
1786
1782
|
});
|
|
@@ -1806,7 +1802,7 @@ function Profil (_ref) {
|
|
|
1806
1802
|
}), (user === null || user === void 0 ? void 0 : user._id) && organization && /*#__PURE__*/jsx("div", {
|
|
1807
1803
|
className: section,
|
|
1808
1804
|
style: {
|
|
1809
|
-
display:
|
|
1805
|
+
display: 'block'
|
|
1810
1806
|
},
|
|
1811
1807
|
children: /*#__PURE__*/jsx(Selection, {
|
|
1812
1808
|
setOrgsCount: setOrgsCount
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextElement.d.ts","sourceRoot":"","sources":["../../../../../src/OrganizationSelection/TextElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"TextElement.d.ts","sourceRoot":"","sources":["../../../../../src/OrganizationSelection/TextElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAK5B,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,MAAM,GACP,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD,qBA2EA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/OrganizationSelection/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAWjD,UAAU,KAAK;IACb,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,UAAU,SAAS;IACjB,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,KAAK,IAAI,CAAC;IAC3C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,OAAO,CAA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
|
"devDependencies": {
|
|
6
6
|
"@testing-library/jest-dom": "^6.5.0",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
},
|
|
25
25
|
"module": "build/esm/index.js",
|
|
26
26
|
"types": "./build/types/navigator/src/index.d.ts",
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "78bdb67f1436c0c404af5d4eac35a12fd58daa94"
|
|
28
28
|
}
|