@equinor/echo-components 0.5.18 → 0.5.19
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/dist/components/rightPanel/PanelStore.d.ts +9 -0
- package/dist/components/rightPanel/index.d.ts +1 -1
- package/dist/components/rightPanel/menuButton/MenuButton.d.ts +1 -3
- package/dist/components/rightPanel/panelContent/PanelContent.d.ts +3 -1
- package/dist/index.js +682 -96
- package/dist/index.js.map +1 -1
- package/dist/types/menuItem.d.ts +2 -0
- package/package.json +5 -5
- package/dist/components/rightPanel/PanelContextWrapper.d.ts +0 -19
- package/dist/components/rightPanel/usePanelContext.d.ts +0 -8
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Icon as Icon$1, Button, DotProgress, Banner, CircularProgress, Typography, Dialog, Search, Radio, Slider, Menu, Autocomplete, Tooltip as Tooltip$1 } from '@equinor/eds-core-react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { useState, useEffect, useCallback, createElement, PureComponent, useRef, useLayoutEffect, useMemo, createContext, useContext, forwardRef, isValidElement, cloneElement } from 'react';
|
|
3
|
+
import React__default, { useState, useEffect, useCallback, createElement, PureComponent, useRef, useLayoutEffect, useMemo, createContext, useContext, forwardRef, isValidElement, cloneElement, useDebugValue } from 'react';
|
|
4
4
|
import * as ReactDOM from 'react-dom';
|
|
5
5
|
import ReactDOM__default, { createPortal } from 'react-dom';
|
|
6
6
|
import * as edsIcons from '@equinor/eds-icons';
|
|
@@ -22361,21 +22361,19 @@ styleInject(css_248z$c);
|
|
|
22361
22361
|
* active, boolean describing the buttons active state
|
|
22362
22362
|
* children, the icon to be displayed
|
|
22363
22363
|
* onClick, the on click event
|
|
22364
|
-
* refValue, a reference value in case its needed
|
|
22365
22364
|
* id: the id of the button in case its needed
|
|
22366
22365
|
* }
|
|
22367
22366
|
* @return {*} {JSX.Element}
|
|
22368
22367
|
*/
|
|
22369
|
-
var MenuButton = function
|
|
22370
|
-
var text =
|
|
22371
|
-
active =
|
|
22372
|
-
children =
|
|
22373
|
-
onClick =
|
|
22374
|
-
|
|
22375
|
-
id = _ref.id;
|
|
22368
|
+
var MenuButton = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
22369
|
+
var text = props.text,
|
|
22370
|
+
active = props.active,
|
|
22371
|
+
children = props.children,
|
|
22372
|
+
onClick = props.onClick,
|
|
22373
|
+
id = props.id;
|
|
22376
22374
|
return /*#__PURE__*/React__default.createElement("button", {
|
|
22377
22375
|
title: text,
|
|
22378
|
-
ref:
|
|
22376
|
+
ref: ref,
|
|
22379
22377
|
type: "button",
|
|
22380
22378
|
onClick: onClick,
|
|
22381
22379
|
id: id,
|
|
@@ -22383,61 +22381,12 @@ var MenuButton = function MenuButton(_ref) {
|
|
|
22383
22381
|
}, children, /*#__PURE__*/React__default.createElement(Typography, {
|
|
22384
22382
|
className: styles$b.text
|
|
22385
22383
|
}, text));
|
|
22386
|
-
};
|
|
22384
|
+
});
|
|
22385
|
+
MenuButton.displayName = 'MenuButton';
|
|
22387
22386
|
MenuButton.defaultProps = {
|
|
22388
|
-
refValue: undefined,
|
|
22389
22387
|
id: ''
|
|
22390
22388
|
};
|
|
22391
22389
|
|
|
22392
|
-
/**
|
|
22393
|
-
* Panel context with default initialized values
|
|
22394
|
-
*
|
|
22395
|
-
*/
|
|
22396
|
-
var PanelContext = /*#__PURE__*/React__default.createContext({
|
|
22397
|
-
activePanel: undefined,
|
|
22398
|
-
panelSize: 'wide',
|
|
22399
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- need to match interface
|
|
22400
|
-
updateActivePanel: function updateActivePanel(newActivePanel) {
|
|
22401
|
-
throw new Error('Panel Context not initialized use Panel component');
|
|
22402
|
-
},
|
|
22403
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- need to match interface
|
|
22404
|
-
updatePanelSize: function updatePanelSize(newPanelSize) {
|
|
22405
|
-
throw new Error('Panel Context not initialized use Panel component');
|
|
22406
|
-
}
|
|
22407
|
-
});
|
|
22408
|
-
/**
|
|
22409
|
-
* The panel context wrapper that should be used within Panel component to store the state of the panel
|
|
22410
|
-
*
|
|
22411
|
-
*/
|
|
22412
|
-
var PanelContextWrapper = function PanelContextWrapper(_ref) {
|
|
22413
|
-
var children = _ref.children;
|
|
22414
|
-
var _React$useState = React__default.useState(undefined),
|
|
22415
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
22416
|
-
activePanel = _React$useState2[0],
|
|
22417
|
-
setActivePanel = _React$useState2[1];
|
|
22418
|
-
var updateActivePanel = React__default.useCallback(function (newActivePanel) {
|
|
22419
|
-
return setActivePanel(newActivePanel);
|
|
22420
|
-
}, []);
|
|
22421
|
-
var _React$useState3 = React__default.useState('wide'),
|
|
22422
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
22423
|
-
panelSize = _React$useState4[0],
|
|
22424
|
-
setPanelSize = _React$useState4[1];
|
|
22425
|
-
var updatePanelSize = React__default.useCallback(function (newPanelSize) {
|
|
22426
|
-
return setPanelSize(newPanelSize);
|
|
22427
|
-
}, []);
|
|
22428
|
-
var value = React__default.useMemo(function () {
|
|
22429
|
-
return {
|
|
22430
|
-
activePanel: activePanel,
|
|
22431
|
-
updateActivePanel: updateActivePanel,
|
|
22432
|
-
panelSize: panelSize,
|
|
22433
|
-
updatePanelSize: updatePanelSize
|
|
22434
|
-
};
|
|
22435
|
-
}, [activePanel, panelSize, updateActivePanel, updatePanelSize]);
|
|
22436
|
-
return /*#__PURE__*/React__default.createElement(PanelContext.Provider, {
|
|
22437
|
-
value: value
|
|
22438
|
-
}, children);
|
|
22439
|
-
};
|
|
22440
|
-
|
|
22441
22390
|
/**
|
|
22442
22391
|
* lodash (Custom Build) <https://lodash.com/>
|
|
22443
22392
|
* Build: `lodash modularize exports="npm" -o ./`
|
|
@@ -22878,22 +22827,583 @@ function toNumber(value) {
|
|
|
22878
22827
|
|
|
22879
22828
|
var lodash_throttle = throttle;
|
|
22880
22829
|
|
|
22830
|
+
const createStoreImpl = (createState) => {
|
|
22831
|
+
let state;
|
|
22832
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
22833
|
+
const setState = (partial, replace) => {
|
|
22834
|
+
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
22835
|
+
if (!Object.is(nextState, state)) {
|
|
22836
|
+
const previousState = state;
|
|
22837
|
+
state = (replace != null ? replace : typeof nextState !== "object") ? nextState : Object.assign({}, state, nextState);
|
|
22838
|
+
listeners.forEach((listener) => listener(state, previousState));
|
|
22839
|
+
}
|
|
22840
|
+
};
|
|
22841
|
+
const getState = () => state;
|
|
22842
|
+
const subscribe = (listener) => {
|
|
22843
|
+
listeners.add(listener);
|
|
22844
|
+
return () => listeners.delete(listener);
|
|
22845
|
+
};
|
|
22846
|
+
const destroy = () => {
|
|
22847
|
+
if ((import.meta.env && import.meta.env.MODE) !== "production") {
|
|
22848
|
+
console.warn(
|
|
22849
|
+
"[DEPRECATED] The destroy method will be unsupported in the future version. You should use unsubscribe function returned by subscribe. Everything will be garbage collected if store is garbage collected."
|
|
22850
|
+
);
|
|
22851
|
+
}
|
|
22852
|
+
listeners.clear();
|
|
22853
|
+
};
|
|
22854
|
+
const api = { setState, getState, subscribe, destroy };
|
|
22855
|
+
state = createState(setState, getState, api);
|
|
22856
|
+
return api;
|
|
22857
|
+
};
|
|
22858
|
+
const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
22859
|
+
|
|
22860
|
+
var withSelectorExports = {};
|
|
22861
|
+
var withSelector = {
|
|
22862
|
+
get exports(){ return withSelectorExports; },
|
|
22863
|
+
set exports(v){ withSelectorExports = v; },
|
|
22864
|
+
};
|
|
22865
|
+
|
|
22866
|
+
var withSelector_production_min = {};
|
|
22867
|
+
|
|
22868
|
+
var shimExports = {};
|
|
22869
|
+
var shim = {
|
|
22870
|
+
get exports(){ return shimExports; },
|
|
22871
|
+
set exports(v){ shimExports = v; },
|
|
22872
|
+
};
|
|
22873
|
+
|
|
22874
|
+
var useSyncExternalStoreShim_production_min = {};
|
|
22875
|
+
|
|
22881
22876
|
/**
|
|
22882
|
-
*
|
|
22877
|
+
* @license React
|
|
22878
|
+
* use-sync-external-store-shim.production.min.js
|
|
22883
22879
|
*
|
|
22884
|
-
*
|
|
22885
|
-
*
|
|
22880
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22881
|
+
*
|
|
22882
|
+
* This source code is licensed under the MIT license found in the
|
|
22883
|
+
* LICENSE file in the root directory of this source tree.
|
|
22886
22884
|
*/
|
|
22887
|
-
|
|
22888
|
-
|
|
22889
|
-
|
|
22890
|
-
|
|
22891
|
-
|
|
22892
|
-
|
|
22885
|
+
|
|
22886
|
+
var hasRequiredUseSyncExternalStoreShim_production_min;
|
|
22887
|
+
|
|
22888
|
+
function requireUseSyncExternalStoreShim_production_min () {
|
|
22889
|
+
if (hasRequiredUseSyncExternalStoreShim_production_min) return useSyncExternalStoreShim_production_min;
|
|
22890
|
+
hasRequiredUseSyncExternalStoreShim_production_min = 1;
|
|
22891
|
+
var e=React__default;function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c});},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c});})},[a]);p(d);return d}
|
|
22892
|
+
function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k(a,d)}catch(f){return !0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;useSyncExternalStoreShim_production_min.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;
|
|
22893
|
+
return useSyncExternalStoreShim_production_min;
|
|
22894
|
+
}
|
|
22895
|
+
|
|
22896
|
+
var useSyncExternalStoreShim_development = {};
|
|
22897
|
+
|
|
22898
|
+
/**
|
|
22899
|
+
* @license React
|
|
22900
|
+
* use-sync-external-store-shim.development.js
|
|
22901
|
+
*
|
|
22902
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22903
|
+
*
|
|
22904
|
+
* This source code is licensed under the MIT license found in the
|
|
22905
|
+
* LICENSE file in the root directory of this source tree.
|
|
22906
|
+
*/
|
|
22907
|
+
|
|
22908
|
+
var hasRequiredUseSyncExternalStoreShim_development;
|
|
22909
|
+
|
|
22910
|
+
function requireUseSyncExternalStoreShim_development () {
|
|
22911
|
+
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
22912
|
+
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
22913
|
+
|
|
22914
|
+
if (process.env.NODE_ENV !== "production") {
|
|
22915
|
+
(function() {
|
|
22916
|
+
|
|
22917
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
22918
|
+
if (
|
|
22919
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
22920
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
22921
|
+
'function'
|
|
22922
|
+
) {
|
|
22923
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
22924
|
+
}
|
|
22925
|
+
var React = React__default;
|
|
22926
|
+
|
|
22927
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
22928
|
+
|
|
22929
|
+
function error(format) {
|
|
22930
|
+
{
|
|
22931
|
+
{
|
|
22932
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
22933
|
+
args[_key2 - 1] = arguments[_key2];
|
|
22934
|
+
}
|
|
22935
|
+
|
|
22936
|
+
printWarning('error', format, args);
|
|
22937
|
+
}
|
|
22938
|
+
}
|
|
22939
|
+
}
|
|
22940
|
+
|
|
22941
|
+
function printWarning(level, format, args) {
|
|
22942
|
+
// When changing this logic, you might want to also
|
|
22943
|
+
// update consoleWithStackDev.www.js as well.
|
|
22944
|
+
{
|
|
22945
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
22946
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
22947
|
+
|
|
22948
|
+
if (stack !== '') {
|
|
22949
|
+
format += '%s';
|
|
22950
|
+
args = args.concat([stack]);
|
|
22951
|
+
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
22952
|
+
|
|
22953
|
+
|
|
22954
|
+
var argsWithFormat = args.map(function (item) {
|
|
22955
|
+
return String(item);
|
|
22956
|
+
}); // Careful: RN currently depends on this prefix
|
|
22957
|
+
|
|
22958
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
22959
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
22960
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
22961
|
+
|
|
22962
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
22963
|
+
}
|
|
22964
|
+
}
|
|
22965
|
+
|
|
22966
|
+
/**
|
|
22967
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
22968
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
22969
|
+
*/
|
|
22970
|
+
function is(x, y) {
|
|
22971
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
|
|
22972
|
+
;
|
|
22973
|
+
}
|
|
22974
|
+
|
|
22975
|
+
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
22976
|
+
|
|
22977
|
+
// dispatch for CommonJS interop named imports.
|
|
22978
|
+
|
|
22979
|
+
var useState = React.useState,
|
|
22980
|
+
useEffect = React.useEffect,
|
|
22981
|
+
useLayoutEffect = React.useLayoutEffect,
|
|
22982
|
+
useDebugValue = React.useDebugValue;
|
|
22983
|
+
var didWarnOld18Alpha = false;
|
|
22984
|
+
var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
|
|
22985
|
+
// because of a very particular set of implementation details and assumptions
|
|
22986
|
+
// -- change any one of them and it will break. The most important assumption
|
|
22987
|
+
// is that updates are always synchronous, because concurrent rendering is
|
|
22988
|
+
// only available in versions of React that also have a built-in
|
|
22989
|
+
// useSyncExternalStore API. And we only use this shim when the built-in API
|
|
22990
|
+
// does not exist.
|
|
22991
|
+
//
|
|
22992
|
+
// Do not assume that the clever hacks used by this hook also work in general.
|
|
22993
|
+
// The point of this shim is to replace the need for hacks by other libraries.
|
|
22994
|
+
|
|
22995
|
+
function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
22996
|
+
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
22997
|
+
// will need to track that themselves and return the correct value
|
|
22998
|
+
// from `getSnapshot`.
|
|
22999
|
+
getServerSnapshot) {
|
|
23000
|
+
{
|
|
23001
|
+
if (!didWarnOld18Alpha) {
|
|
23002
|
+
if (React.startTransition !== undefined) {
|
|
23003
|
+
didWarnOld18Alpha = true;
|
|
23004
|
+
|
|
23005
|
+
error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
|
|
23006
|
+
}
|
|
23007
|
+
}
|
|
23008
|
+
} // Read the current snapshot from the store on every render. Again, this
|
|
23009
|
+
// breaks the rules of React, and only works here because of specific
|
|
23010
|
+
// implementation details, most importantly that updates are
|
|
23011
|
+
// always synchronous.
|
|
23012
|
+
|
|
23013
|
+
|
|
23014
|
+
var value = getSnapshot();
|
|
23015
|
+
|
|
23016
|
+
{
|
|
23017
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
23018
|
+
var cachedValue = getSnapshot();
|
|
23019
|
+
|
|
23020
|
+
if (!objectIs(value, cachedValue)) {
|
|
23021
|
+
error('The result of getSnapshot should be cached to avoid an infinite loop');
|
|
23022
|
+
|
|
23023
|
+
didWarnUncachedGetSnapshot = true;
|
|
23024
|
+
}
|
|
23025
|
+
}
|
|
23026
|
+
} // Because updates are synchronous, we don't queue them. Instead we force a
|
|
23027
|
+
// re-render whenever the subscribed state changes by updating an some
|
|
23028
|
+
// arbitrary useState hook. Then, during render, we call getSnapshot to read
|
|
23029
|
+
// the current value.
|
|
23030
|
+
//
|
|
23031
|
+
// Because we don't actually use the state returned by the useState hook, we
|
|
23032
|
+
// can save a bit of memory by storing other stuff in that slot.
|
|
23033
|
+
//
|
|
23034
|
+
// To implement the early bailout, we need to track some things on a mutable
|
|
23035
|
+
// object. Usually, we would put that in a useRef hook, but we can stash it in
|
|
23036
|
+
// our useState hook instead.
|
|
23037
|
+
//
|
|
23038
|
+
// To force a re-render, we call forceUpdate({inst}). That works because the
|
|
23039
|
+
// new object always fails an equality check.
|
|
23040
|
+
|
|
23041
|
+
|
|
23042
|
+
var _useState = useState({
|
|
23043
|
+
inst: {
|
|
23044
|
+
value: value,
|
|
23045
|
+
getSnapshot: getSnapshot
|
|
23046
|
+
}
|
|
23047
|
+
}),
|
|
23048
|
+
inst = _useState[0].inst,
|
|
23049
|
+
forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
|
|
23050
|
+
// in the layout phase so we can access it during the tearing check that
|
|
23051
|
+
// happens on subscribe.
|
|
23052
|
+
|
|
23053
|
+
|
|
23054
|
+
useLayoutEffect(function () {
|
|
23055
|
+
inst.value = value;
|
|
23056
|
+
inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
|
|
23057
|
+
// commit phase if there was an interleaved mutation. In concurrent mode
|
|
23058
|
+
// this can happen all the time, but even in synchronous mode, an earlier
|
|
23059
|
+
// effect may have mutated the store.
|
|
23060
|
+
|
|
23061
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
23062
|
+
// Force a re-render.
|
|
23063
|
+
forceUpdate({
|
|
23064
|
+
inst: inst
|
|
23065
|
+
});
|
|
23066
|
+
}
|
|
23067
|
+
}, [subscribe, value, getSnapshot]);
|
|
23068
|
+
useEffect(function () {
|
|
23069
|
+
// Check for changes right before subscribing. Subsequent changes will be
|
|
23070
|
+
// detected in the subscription handler.
|
|
23071
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
23072
|
+
// Force a re-render.
|
|
23073
|
+
forceUpdate({
|
|
23074
|
+
inst: inst
|
|
23075
|
+
});
|
|
23076
|
+
}
|
|
23077
|
+
|
|
23078
|
+
var handleStoreChange = function () {
|
|
23079
|
+
// TODO: Because there is no cross-renderer API for batching updates, it's
|
|
23080
|
+
// up to the consumer of this library to wrap their subscription event
|
|
23081
|
+
// with unstable_batchedUpdates. Should we try to detect when this isn't
|
|
23082
|
+
// the case and print a warning in development?
|
|
23083
|
+
// The store changed. Check if the snapshot changed since the last time we
|
|
23084
|
+
// read from the store.
|
|
23085
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
23086
|
+
// Force a re-render.
|
|
23087
|
+
forceUpdate({
|
|
23088
|
+
inst: inst
|
|
23089
|
+
});
|
|
23090
|
+
}
|
|
23091
|
+
}; // Subscribe to the store and return a clean-up function.
|
|
23092
|
+
|
|
23093
|
+
|
|
23094
|
+
return subscribe(handleStoreChange);
|
|
23095
|
+
}, [subscribe]);
|
|
23096
|
+
useDebugValue(value);
|
|
23097
|
+
return value;
|
|
23098
|
+
}
|
|
23099
|
+
|
|
23100
|
+
function checkIfSnapshotChanged(inst) {
|
|
23101
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
23102
|
+
var prevValue = inst.value;
|
|
23103
|
+
|
|
23104
|
+
try {
|
|
23105
|
+
var nextValue = latestGetSnapshot();
|
|
23106
|
+
return !objectIs(prevValue, nextValue);
|
|
23107
|
+
} catch (error) {
|
|
23108
|
+
return true;
|
|
23109
|
+
}
|
|
23110
|
+
}
|
|
23111
|
+
|
|
23112
|
+
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
23113
|
+
// Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
23114
|
+
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
23115
|
+
// will need to track that themselves and return the correct value
|
|
23116
|
+
// from `getSnapshot`.
|
|
23117
|
+
return getSnapshot();
|
|
23118
|
+
}
|
|
23119
|
+
|
|
23120
|
+
var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
|
|
23121
|
+
|
|
23122
|
+
var isServerEnvironment = !canUseDOM;
|
|
23123
|
+
|
|
23124
|
+
var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
23125
|
+
var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
|
|
23126
|
+
|
|
23127
|
+
useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
|
|
23128
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
23129
|
+
if (
|
|
23130
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
23131
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
23132
|
+
'function'
|
|
23133
|
+
) {
|
|
23134
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
23135
|
+
}
|
|
23136
|
+
|
|
23137
|
+
})();
|
|
23138
|
+
}
|
|
23139
|
+
return useSyncExternalStoreShim_development;
|
|
23140
|
+
}
|
|
23141
|
+
|
|
23142
|
+
var hasRequiredShim;
|
|
23143
|
+
|
|
23144
|
+
function requireShim () {
|
|
23145
|
+
if (hasRequiredShim) return shimExports;
|
|
23146
|
+
hasRequiredShim = 1;
|
|
23147
|
+
(function (module) {
|
|
23148
|
+
|
|
23149
|
+
if (process.env.NODE_ENV === 'production') {
|
|
23150
|
+
module.exports = requireUseSyncExternalStoreShim_production_min();
|
|
23151
|
+
} else {
|
|
23152
|
+
module.exports = requireUseSyncExternalStoreShim_development();
|
|
23153
|
+
}
|
|
23154
|
+
} (shim));
|
|
23155
|
+
return shimExports;
|
|
22893
23156
|
}
|
|
22894
23157
|
|
|
22895
|
-
|
|
22896
|
-
|
|
23158
|
+
/**
|
|
23159
|
+
* @license React
|
|
23160
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
23161
|
+
*
|
|
23162
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23163
|
+
*
|
|
23164
|
+
* This source code is licensed under the MIT license found in the
|
|
23165
|
+
* LICENSE file in the root directory of this source tree.
|
|
23166
|
+
*/
|
|
23167
|
+
|
|
23168
|
+
var hasRequiredWithSelector_production_min;
|
|
23169
|
+
|
|
23170
|
+
function requireWithSelector_production_min () {
|
|
23171
|
+
if (hasRequiredWithSelector_production_min) return withSelector_production_min;
|
|
23172
|
+
hasRequiredWithSelector_production_min = 1;
|
|
23173
|
+
var h=React__default,n=requireShim();function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q="function"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;
|
|
23174
|
+
withSelector_production_min.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f;}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return [function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);
|
|
23175
|
+
u(function(){f.hasValue=!0;f.value=d;},[d]);w(d);return d};
|
|
23176
|
+
return withSelector_production_min;
|
|
23177
|
+
}
|
|
23178
|
+
|
|
23179
|
+
var withSelector_development = {};
|
|
23180
|
+
|
|
23181
|
+
/**
|
|
23182
|
+
* @license React
|
|
23183
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
23184
|
+
*
|
|
23185
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23186
|
+
*
|
|
23187
|
+
* This source code is licensed under the MIT license found in the
|
|
23188
|
+
* LICENSE file in the root directory of this source tree.
|
|
23189
|
+
*/
|
|
23190
|
+
|
|
23191
|
+
var hasRequiredWithSelector_development;
|
|
23192
|
+
|
|
23193
|
+
function requireWithSelector_development () {
|
|
23194
|
+
if (hasRequiredWithSelector_development) return withSelector_development;
|
|
23195
|
+
hasRequiredWithSelector_development = 1;
|
|
23196
|
+
|
|
23197
|
+
if (process.env.NODE_ENV !== "production") {
|
|
23198
|
+
(function() {
|
|
23199
|
+
|
|
23200
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
23201
|
+
if (
|
|
23202
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
23203
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
23204
|
+
'function'
|
|
23205
|
+
) {
|
|
23206
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
23207
|
+
}
|
|
23208
|
+
var React = React__default;
|
|
23209
|
+
var shim = requireShim();
|
|
23210
|
+
|
|
23211
|
+
/**
|
|
23212
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
23213
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
23214
|
+
*/
|
|
23215
|
+
function is(x, y) {
|
|
23216
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
|
|
23217
|
+
;
|
|
23218
|
+
}
|
|
23219
|
+
|
|
23220
|
+
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
23221
|
+
|
|
23222
|
+
var useSyncExternalStore = shim.useSyncExternalStore;
|
|
23223
|
+
|
|
23224
|
+
// for CommonJS interop.
|
|
23225
|
+
|
|
23226
|
+
var useRef = React.useRef,
|
|
23227
|
+
useEffect = React.useEffect,
|
|
23228
|
+
useMemo = React.useMemo,
|
|
23229
|
+
useDebugValue = React.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments.
|
|
23230
|
+
|
|
23231
|
+
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
23232
|
+
// Use this to track the rendered snapshot.
|
|
23233
|
+
var instRef = useRef(null);
|
|
23234
|
+
var inst;
|
|
23235
|
+
|
|
23236
|
+
if (instRef.current === null) {
|
|
23237
|
+
inst = {
|
|
23238
|
+
hasValue: false,
|
|
23239
|
+
value: null
|
|
23240
|
+
};
|
|
23241
|
+
instRef.current = inst;
|
|
23242
|
+
} else {
|
|
23243
|
+
inst = instRef.current;
|
|
23244
|
+
}
|
|
23245
|
+
|
|
23246
|
+
var _useMemo = useMemo(function () {
|
|
23247
|
+
// Track the memoized state using closure variables that are local to this
|
|
23248
|
+
// memoized instance of a getSnapshot function. Intentionally not using a
|
|
23249
|
+
// useRef hook, because that state would be shared across all concurrent
|
|
23250
|
+
// copies of the hook/component.
|
|
23251
|
+
var hasMemo = false;
|
|
23252
|
+
var memoizedSnapshot;
|
|
23253
|
+
var memoizedSelection;
|
|
23254
|
+
|
|
23255
|
+
var memoizedSelector = function (nextSnapshot) {
|
|
23256
|
+
if (!hasMemo) {
|
|
23257
|
+
// The first time the hook is called, there is no memoized result.
|
|
23258
|
+
hasMemo = true;
|
|
23259
|
+
memoizedSnapshot = nextSnapshot;
|
|
23260
|
+
|
|
23261
|
+
var _nextSelection = selector(nextSnapshot);
|
|
23262
|
+
|
|
23263
|
+
if (isEqual !== undefined) {
|
|
23264
|
+
// Even if the selector has changed, the currently rendered selection
|
|
23265
|
+
// may be equal to the new selection. We should attempt to reuse the
|
|
23266
|
+
// current value if possible, to preserve downstream memoizations.
|
|
23267
|
+
if (inst.hasValue) {
|
|
23268
|
+
var currentSelection = inst.value;
|
|
23269
|
+
|
|
23270
|
+
if (isEqual(currentSelection, _nextSelection)) {
|
|
23271
|
+
memoizedSelection = currentSelection;
|
|
23272
|
+
return currentSelection;
|
|
23273
|
+
}
|
|
23274
|
+
}
|
|
23275
|
+
}
|
|
23276
|
+
|
|
23277
|
+
memoizedSelection = _nextSelection;
|
|
23278
|
+
return _nextSelection;
|
|
23279
|
+
} // We may be able to reuse the previous invocation's result.
|
|
23280
|
+
|
|
23281
|
+
|
|
23282
|
+
// We may be able to reuse the previous invocation's result.
|
|
23283
|
+
var prevSnapshot = memoizedSnapshot;
|
|
23284
|
+
var prevSelection = memoizedSelection;
|
|
23285
|
+
|
|
23286
|
+
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
23287
|
+
// The snapshot is the same as last time. Reuse the previous selection.
|
|
23288
|
+
return prevSelection;
|
|
23289
|
+
} // The snapshot has changed, so we need to compute a new selection.
|
|
23290
|
+
|
|
23291
|
+
|
|
23292
|
+
// The snapshot has changed, so we need to compute a new selection.
|
|
23293
|
+
var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data
|
|
23294
|
+
// has changed. If it hasn't, return the previous selection. That signals
|
|
23295
|
+
// to React that the selections are conceptually equal, and we can bail
|
|
23296
|
+
// out of rendering.
|
|
23297
|
+
|
|
23298
|
+
// If a custom isEqual function is provided, use that to check if the data
|
|
23299
|
+
// has changed. If it hasn't, return the previous selection. That signals
|
|
23300
|
+
// to React that the selections are conceptually equal, and we can bail
|
|
23301
|
+
// out of rendering.
|
|
23302
|
+
if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {
|
|
23303
|
+
return prevSelection;
|
|
23304
|
+
}
|
|
23305
|
+
|
|
23306
|
+
memoizedSnapshot = nextSnapshot;
|
|
23307
|
+
memoizedSelection = nextSelection;
|
|
23308
|
+
return nextSelection;
|
|
23309
|
+
}; // Assigning this to a constant so that Flow knows it can't change.
|
|
23310
|
+
|
|
23311
|
+
|
|
23312
|
+
// Assigning this to a constant so that Flow knows it can't change.
|
|
23313
|
+
var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot;
|
|
23314
|
+
|
|
23315
|
+
var getSnapshotWithSelector = function () {
|
|
23316
|
+
return memoizedSelector(getSnapshot());
|
|
23317
|
+
};
|
|
23318
|
+
|
|
23319
|
+
var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () {
|
|
23320
|
+
return memoizedSelector(maybeGetServerSnapshot());
|
|
23321
|
+
};
|
|
23322
|
+
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
23323
|
+
}, [getSnapshot, getServerSnapshot, selector, isEqual]),
|
|
23324
|
+
getSelection = _useMemo[0],
|
|
23325
|
+
getServerSelection = _useMemo[1];
|
|
23326
|
+
|
|
23327
|
+
var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);
|
|
23328
|
+
useEffect(function () {
|
|
23329
|
+
inst.hasValue = true;
|
|
23330
|
+
inst.value = value;
|
|
23331
|
+
}, [value]);
|
|
23332
|
+
useDebugValue(value);
|
|
23333
|
+
return value;
|
|
23334
|
+
}
|
|
23335
|
+
|
|
23336
|
+
withSelector_development.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
|
|
23337
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
23338
|
+
if (
|
|
23339
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
23340
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
23341
|
+
'function'
|
|
23342
|
+
) {
|
|
23343
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
23344
|
+
}
|
|
23345
|
+
|
|
23346
|
+
})();
|
|
23347
|
+
}
|
|
23348
|
+
return withSelector_development;
|
|
23349
|
+
}
|
|
23350
|
+
|
|
23351
|
+
(function (module) {
|
|
23352
|
+
|
|
23353
|
+
if (process.env.NODE_ENV === 'production') {
|
|
23354
|
+
module.exports = requireWithSelector_production_min();
|
|
23355
|
+
} else {
|
|
23356
|
+
module.exports = requireWithSelector_development();
|
|
23357
|
+
}
|
|
23358
|
+
} (withSelector));
|
|
23359
|
+
|
|
23360
|
+
var useSyncExternalStoreExports = /*@__PURE__*/getDefaultExportFromCjs(withSelectorExports);
|
|
23361
|
+
|
|
23362
|
+
const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;
|
|
23363
|
+
function useStore(api, selector = api.getState, equalityFn) {
|
|
23364
|
+
const slice = useSyncExternalStoreWithSelector(
|
|
23365
|
+
api.subscribe,
|
|
23366
|
+
api.getState,
|
|
23367
|
+
api.getServerState || api.getState,
|
|
23368
|
+
selector,
|
|
23369
|
+
equalityFn
|
|
23370
|
+
);
|
|
23371
|
+
useDebugValue(slice);
|
|
23372
|
+
return slice;
|
|
23373
|
+
}
|
|
23374
|
+
const createImpl = (createState) => {
|
|
23375
|
+
if ((import.meta.env && import.meta.env.MODE) !== "production" && typeof createState !== "function") {
|
|
23376
|
+
console.warn(
|
|
23377
|
+
'[DEPRECATED] Passing a vanilla store will be unsupported in the future version. Please use `import { useStore } from "zustand"` to use the vanilla store in React.'
|
|
23378
|
+
);
|
|
23379
|
+
}
|
|
23380
|
+
const api = typeof createState === "function" ? createStore(createState) : createState;
|
|
23381
|
+
const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn);
|
|
23382
|
+
Object.assign(useBoundStore, api);
|
|
23383
|
+
return useBoundStore;
|
|
23384
|
+
};
|
|
23385
|
+
const create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
23386
|
+
|
|
23387
|
+
// need to import whole of zustand for the build to be correct so the store can be used by other modules in the proper way
|
|
23388
|
+
var usePanelStore = create(function (set) {
|
|
23389
|
+
return {
|
|
23390
|
+
activePanel: undefined,
|
|
23391
|
+
panelSize: 'wide',
|
|
23392
|
+
updateActivePanel: function updateActivePanel(newActivePanel) {
|
|
23393
|
+
set({
|
|
23394
|
+
activePanel: newActivePanel
|
|
23395
|
+
});
|
|
23396
|
+
},
|
|
23397
|
+
updatePanelSize: function updatePanelSize(newPanelSize) {
|
|
23398
|
+
set({
|
|
23399
|
+
panelSize: newPanelSize
|
|
23400
|
+
});
|
|
23401
|
+
}
|
|
23402
|
+
};
|
|
23403
|
+
});
|
|
23404
|
+
|
|
23405
|
+
var css_248z$b = ".panelWrapper-module_wrapper__asJxL{position:fixed;right:0;z-index:5}.panelWrapper-module_topBarWrapper__Nt84G{background-color:#fff;border-left:1px solid #dcdcdc;box-sizing:border-box;height:calc(100dvh - 64px);padding-left:0;padding-right:0;width:64px;z-index:10}.panelWrapper-module_topBarWrapper__Nt84G div:first-child{display:none}.panelWrapper-module_contentPanel__JWij5,.panelWrapper-module_narrowPanel__zW0DI{background:#fff;box-sizing:border-box;height:100%;overflow:hidden;position:absolute;right:64px;top:0;transition:width .4s ease-in-out;width:0;z-index:1200}.panelWrapper-module_narrowPanel__zW0DI{width:240px!important}.panelWrapper-module_activeContentPanel__1nAhR{border-left:2px solid #f7f7f7;padding-left:14px;padding-right:16px;padding-top:16px;width:320px}.panelWrapper-module_buttonWrapperMobile__pcR1V{display:none}.panelWrapper-module_buttonWrapper__xbmQI{height:calc(100dvh - 70px)}.panelWrapper-module_buttonAtBottomWrapper__jLd-d{bottom:6px;position:absolute;width:100%}@media screen and (max-width:927px) and (orientation:landscape){.panelWrapper-module_topBarWrapper__Nt84G{width:calc(100dvw - 56px)}}@media screen and (max-width:767px) and (orientation:portrait){.panelWrapper-module_activeContentPanel__1nAhR,.panelWrapper-module_topBarWrapper__Nt84G{width:100dvw}}@media screen and (max-width:767px) and (orientation:portrait),screen and (max-width:927px) and (orientation:landscape){.panelWrapper-module_buttonAtBottomWrapper__jLd-d{display:none}.panelWrapper-module_topBarWrapper__Nt84G{border-bottom:1px solid #dcdcdc;border-left:none;display:flex;flex-direction:row;height:48px;padding-bottom:0;padding-top:0;z-index:10}.panelWrapper-module_topBarWrapper__Nt84G div:first-child{display:flex}.panelWrapper-module_moduleTitle__4Wloo{display:flex;margin:auto 0 auto 16px}.panelWrapper-module_moduleTitle__4Wloo p{color:var(--echoText);font-size:16px;font-weight:500;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.panelWrapper-module_contentPanel__JWij5,.panelWrapper-module_narrowPanel__zW0DI{height:100dvh;right:0}.panelWrapper-module_buttonWrapperMobile__pcR1V{display:flex;justify-content:flex-end;margin-right:8px}.panelWrapper-module_buttonWrapper__xbmQI{display:none}}@media screen and (max-width:768px) and (orientation:portrait){.panelWrapper-module_moduleTitle__4Wloo{width:140px}.panelWrapper-module_buttonWrapperMobile__pcR1V{width:calc(100vw - 140px)}}@media screen and (max-width:927px) and (orientation:landscape){.panelWrapper-module_moduleTitle__4Wloo{width:240px}.panelWrapper-module_buttonWrapperMobile__pcR1V{width:calc(100vw - 240px)}}";
|
|
23406
|
+
var styles$a = {"wrapper":"panelWrapper-module_wrapper__asJxL","topBarWrapper":"panelWrapper-module_topBarWrapper__Nt84G","narrowPanel":"panelWrapper-module_narrowPanel__zW0DI","contentPanel":"panelWrapper-module_contentPanel__JWij5","activeContentPanel":"panelWrapper-module_activeContentPanel__1nAhR","buttonWrapperMobile":"panelWrapper-module_buttonWrapperMobile__pcR1V","buttonWrapper":"panelWrapper-module_buttonWrapper__xbmQI","buttonAtBottomWrapper":"panelWrapper-module_buttonAtBottomWrapper__jLd-d","moduleTitle":"panelWrapper-module_moduleTitle__4Wloo"};
|
|
22897
23407
|
styleInject(css_248z$b);
|
|
22898
23408
|
|
|
22899
23409
|
/**
|
|
@@ -22913,12 +23423,12 @@ var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
22913
23423
|
var _classnames;
|
|
22914
23424
|
var menuItems = _ref.menuItems,
|
|
22915
23425
|
header = _ref.header;
|
|
22916
|
-
var _a, _b;
|
|
22917
|
-
var
|
|
22918
|
-
activePanel =
|
|
22919
|
-
panelSize =
|
|
22920
|
-
updateActivePanel =
|
|
22921
|
-
updatePanelSize =
|
|
23426
|
+
var _a, _b, _c;
|
|
23427
|
+
var _usePanelStore = usePanelStore(),
|
|
23428
|
+
activePanel = _usePanelStore.activePanel,
|
|
23429
|
+
panelSize = _usePanelStore.panelSize,
|
|
23430
|
+
updateActivePanel = _usePanelStore.updateActivePanel,
|
|
23431
|
+
updatePanelSize = _usePanelStore.updatePanelSize;
|
|
22922
23432
|
var _useState = useState(false),
|
|
22923
23433
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22924
23434
|
isMenuOpen = _useState2[0],
|
|
@@ -22932,6 +23442,10 @@ var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
22932
23442
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
22933
23443
|
buttonsInOverflow = _useState6[0],
|
|
22934
23444
|
setButtonsInOverflow = _useState6[1];
|
|
23445
|
+
var _useState7 = useState(),
|
|
23446
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
23447
|
+
buttonAtBottom = _useState8[0],
|
|
23448
|
+
setButtonAtBottom = _useState8[1];
|
|
22935
23449
|
var mobileWrapperRef = useRef(null);
|
|
22936
23450
|
var desktopWrapperRef = useRef(null);
|
|
22937
23451
|
var handleActiveMenuItemChanged = function handleActiveMenuItemChanged(menuItemType, panelSizeToUse) {
|
|
@@ -22946,9 +23460,15 @@ var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
22946
23460
|
var calculateOverflow = useCallback(function () {
|
|
22947
23461
|
var _a, _b, _c, _d, _e, _f;
|
|
22948
23462
|
var numberOfIconsThereIsRoomFor;
|
|
23463
|
+
var shouldShowButtonAtBottom = false;
|
|
22949
23464
|
if ((_a = mobileWrapperRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) {
|
|
22950
23465
|
numberOfIconsThereIsRoomFor = ((_c = (_b = mobileWrapperRef.current) === null || _b === void 0 ? void 0 : _b.clientWidth) !== null && _c !== void 0 ? _c : 0) / 56;
|
|
22951
23466
|
} else if ((_d = desktopWrapperRef.current) === null || _d === void 0 ? void 0 : _d.clientHeight) {
|
|
23467
|
+
var buttonAtBottomFromList = menuItems.find(function (item) {
|
|
23468
|
+
return item.isBottomItem === true;
|
|
23469
|
+
});
|
|
23470
|
+
if (buttonAtBottomFromList) shouldShowButtonAtBottom = true;
|
|
23471
|
+
setButtonAtBottom(buttonAtBottomFromList);
|
|
22952
23472
|
numberOfIconsThereIsRoomFor = ((_f = (_e = desktopWrapperRef.current) === null || _e === void 0 ? void 0 : _e.clientHeight) !== null && _f !== void 0 ? _f : 0) / 56;
|
|
22953
23473
|
}
|
|
22954
23474
|
if (!numberOfIconsThereIsRoomFor) {
|
|
@@ -22964,9 +23484,19 @@ var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
22964
23484
|
}
|
|
22965
23485
|
}
|
|
22966
23486
|
var menuItemsCopy = _toConsumableArray$1(menuItems);
|
|
23487
|
+
// if there is a button at the bottom then there is less room for the other buttons
|
|
23488
|
+
if (shouldShowButtonAtBottom) {
|
|
23489
|
+
iconsInOverflow += 1;
|
|
23490
|
+
var _buttonAtBottomFromList = menuItems.find(function (item) {
|
|
23491
|
+
return item.isBottomItem === true;
|
|
23492
|
+
});
|
|
23493
|
+
if (_buttonAtBottomFromList) menuItemsCopy = menuItems.filter(function (item) {
|
|
23494
|
+
return item.labelId !== _buttonAtBottomFromList.labelId;
|
|
23495
|
+
});
|
|
23496
|
+
}
|
|
22967
23497
|
setButtonsToDisplay(menuItemsCopy.slice(0, menuItems.length - iconsInOverflow));
|
|
22968
23498
|
setButtonsInOverflow(menuItemsCopy.slice(menuItems.length - iconsInOverflow));
|
|
22969
|
-
}, [menuItems]);
|
|
23499
|
+
}, [menuItems, mobileWrapperRef, desktopWrapperRef]);
|
|
22970
23500
|
useEffect(function () {
|
|
22971
23501
|
calculateOverflow();
|
|
22972
23502
|
}, [calculateOverflow]);
|
|
@@ -22999,12 +23529,55 @@ var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
22999
23529
|
}
|
|
23000
23530
|
return null;
|
|
23001
23531
|
};
|
|
23532
|
+
var shouldCloseMoreOnOutsideClick = function shouldCloseMoreOnOutsideClick() {
|
|
23533
|
+
if (buttonsInOverflow.find(function (button) {
|
|
23534
|
+
return button.skipPanelContent;
|
|
23535
|
+
})) {
|
|
23536
|
+
return undefined;
|
|
23537
|
+
} else {
|
|
23538
|
+
return function () {
|
|
23539
|
+
return setIsMenuOpen(false);
|
|
23540
|
+
};
|
|
23541
|
+
}
|
|
23542
|
+
};
|
|
23543
|
+
var renderButtonAtBottom = function renderButtonAtBottom(button) {
|
|
23544
|
+
if (!button) return;
|
|
23545
|
+
if (button.skipPanelContent) {
|
|
23546
|
+
var PanelComponent = button.component;
|
|
23547
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
23548
|
+
className: styles$a.buttonAtBottomWrapper
|
|
23549
|
+
}, /*#__PURE__*/React__default.createElement(PanelComponent, {
|
|
23550
|
+
key: button.labelId
|
|
23551
|
+
}));
|
|
23552
|
+
}
|
|
23553
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
23554
|
+
className: styles$a.buttonAtBottomWrapper
|
|
23555
|
+
}, /*#__PURE__*/React__default.createElement(MenuButton, {
|
|
23556
|
+
text: button.label,
|
|
23557
|
+
key: button.labelId,
|
|
23558
|
+
id: button.labelId,
|
|
23559
|
+
active: activePanel === button.labelId,
|
|
23560
|
+
onClick: function onClick() {
|
|
23561
|
+
return handleActiveMenuItemChanged(button.labelId, button.panelSize);
|
|
23562
|
+
}
|
|
23563
|
+
}, typeof button.icon === 'string' ? /*#__PURE__*/React__default.createElement(Icon$1, {
|
|
23564
|
+
color: themeConst.echoText,
|
|
23565
|
+
name: button.icon
|
|
23566
|
+
}) : button.icon));
|
|
23567
|
+
};
|
|
23002
23568
|
var renderMenuItems = function renderMenuItems() {
|
|
23003
23569
|
var _a, _b;
|
|
23004
23570
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, buttonsToDisplay.map(function (button) {
|
|
23571
|
+
if (button.skipPanelContent) {
|
|
23572
|
+
var PanelComponent = button.component;
|
|
23573
|
+
return /*#__PURE__*/React__default.createElement(PanelComponent, {
|
|
23574
|
+
key: button.labelId
|
|
23575
|
+
});
|
|
23576
|
+
}
|
|
23005
23577
|
return /*#__PURE__*/React__default.createElement(MenuButton, {
|
|
23006
23578
|
text: button.label,
|
|
23007
23579
|
key: button.labelId,
|
|
23580
|
+
id: button.labelId,
|
|
23008
23581
|
active: activePanel === button.labelId,
|
|
23009
23582
|
onClick: function onClick() {
|
|
23010
23583
|
return handleActiveMenuItemChanged(button.labelId, button.panelSize);
|
|
@@ -23015,7 +23588,7 @@ var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
23015
23588
|
}) : button.icon);
|
|
23016
23589
|
}), buttonsInOverflow.length > 0 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MenuButton, {
|
|
23017
23590
|
text: "More",
|
|
23018
|
-
|
|
23591
|
+
ref: menuRef,
|
|
23019
23592
|
id: "more-menu-options-anchor",
|
|
23020
23593
|
active: isMenuOpen,
|
|
23021
23594
|
onClick: function onClick() {
|
|
@@ -23025,14 +23598,23 @@ var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
23025
23598
|
color: themeConst.echoText,
|
|
23026
23599
|
name: "more_vertical"
|
|
23027
23600
|
})), /*#__PURE__*/React__default.createElement(Menu, {
|
|
23601
|
+
style: {
|
|
23602
|
+
overflowX: 'auto',
|
|
23603
|
+
maxHeight: 'calc(100dvh - 70px)'
|
|
23604
|
+
},
|
|
23028
23605
|
anchorEl: menuRef.current,
|
|
23029
23606
|
id: "more-menu-options",
|
|
23030
|
-
onClose:
|
|
23031
|
-
return setIsMenuOpen(false);
|
|
23032
|
-
},
|
|
23607
|
+
onClose: shouldCloseMoreOnOutsideClick,
|
|
23033
23608
|
placement: ((_b = (_a = mobileWrapperRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0) > 0 ? 'bottom-start' : 'left',
|
|
23034
23609
|
open: isMenuOpen
|
|
23035
23610
|
}, buttonsInOverflow.map(function (button) {
|
|
23611
|
+
if (button.skipPanelContent) {
|
|
23612
|
+
var PanelComponent = button.component;
|
|
23613
|
+
return /*#__PURE__*/React__default.createElement(PanelComponent, {
|
|
23614
|
+
key: button.labelId,
|
|
23615
|
+
isOverflow: true
|
|
23616
|
+
});
|
|
23617
|
+
}
|
|
23036
23618
|
return /*#__PURE__*/React__default.createElement(Menu.Item, {
|
|
23037
23619
|
key: button.labelId,
|
|
23038
23620
|
onClick: function onClick() {
|
|
@@ -23042,7 +23624,7 @@ var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
23042
23624
|
color: themeConst.echoText,
|
|
23043
23625
|
name: button.icon
|
|
23044
23626
|
}) : button.icon, button.label);
|
|
23045
|
-
}))));
|
|
23627
|
+
}))), renderButtonAtBottom(buttonAtBottom));
|
|
23046
23628
|
};
|
|
23047
23629
|
var renderMenuItemsBasedOnRef = function renderMenuItemsBasedOnRef(ref) {
|
|
23048
23630
|
if (ref) return renderMenuItems();
|
|
@@ -23059,7 +23641,7 @@ var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
23059
23641
|
}, renderMenuItemsBasedOnRef((_a = mobileWrapperRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth)), /*#__PURE__*/React__default.createElement("div", {
|
|
23060
23642
|
className: styles$a.buttonWrapper,
|
|
23061
23643
|
ref: desktopWrapperRef
|
|
23062
|
-
}, renderMenuItemsBasedOnRef((_b = desktopWrapperRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight))), /*#__PURE__*/React__default.createElement("div", {
|
|
23644
|
+
}, renderMenuItemsBasedOnRef((_b = desktopWrapperRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight))), !((_c = getActivePanel(activePanel)) === null || _c === void 0 ? void 0 : _c.skipPanelContent) && /*#__PURE__*/React__default.createElement("div", {
|
|
23063
23645
|
className: classnames$2(styles$a.contentPanel, (_classnames = {}, _defineProperty$1(_classnames, styles$a.narrowPanel, panelSize === 'narrow' && activePanel), _defineProperty$1(_classnames, styles$a.activeContentPanel, activePanel), _classnames))
|
|
23064
23646
|
}, getPanelComponentForActivePanel(activePanel)));
|
|
23065
23647
|
};
|
|
@@ -23077,14 +23659,14 @@ var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
23077
23659
|
var Panel = function Panel(_ref) {
|
|
23078
23660
|
var menuItems = _ref.menuItems,
|
|
23079
23661
|
header = _ref.header;
|
|
23080
|
-
return /*#__PURE__*/React__default.createElement(
|
|
23662
|
+
return /*#__PURE__*/React__default.createElement(PanelWrapper, {
|
|
23081
23663
|
header: header,
|
|
23082
23664
|
menuItems: menuItems
|
|
23083
|
-
})
|
|
23665
|
+
});
|
|
23084
23666
|
};
|
|
23085
23667
|
|
|
23086
|
-
var css_248z$a = ".panelContent-module_headerWrapper__BAc2H{display:flex;justify-content:space-between;padding-bottom:16px}.panelContent-module_panelTitle__jqqJT{margin:auto 0!important}.panelContent-module_bodyWrapper__EHsg5{height:calc(100dvh - 112px);margin-right:-8px;margin-top:16px;overflow-x:hidden;overflow-y:auto}.panelContent-module_contentWrapper__1re5K{margin-right:8px}";
|
|
23087
|
-
var styles$9 = {"headerWrapper":"panelContent-module_headerWrapper__BAc2H","panelTitle":"panelContent-module_panelTitle__jqqJT","bodyWrapper":"panelContent-module_bodyWrapper__EHsg5","contentWrapper":"panelContent-module_contentWrapper__1re5K"};
|
|
23668
|
+
var css_248z$a = ".panelContent-module_headerWrapper__BAc2H{display:flex;justify-content:space-between;padding-bottom:16px}.panelContent-module_panelTitle__jqqJT{margin:auto 0!important}.panelContent-module_bodyWrapperWithFooter__uoMyR,.panelContent-module_bodyWrapper__EHsg5{height:calc(100dvh - 112px);margin-right:-8px;margin-top:16px;overflow-x:hidden;overflow-y:auto}.panelContent-module_bodyWrapperWithFooter__uoMyR{height:calc(100dvh - 140px)}.panelContent-module_footer__P1Nr8{height:52px}.panelContent-module_contentWrapper__1re5K{margin-right:8px}";
|
|
23669
|
+
var styles$9 = {"headerWrapper":"panelContent-module_headerWrapper__BAc2H","panelTitle":"panelContent-module_panelTitle__jqqJT","bodyWrapper":"panelContent-module_bodyWrapper__EHsg5","bodyWrapperWithFooter":"panelContent-module_bodyWrapperWithFooter__uoMyR","footer":"panelContent-module_footer__P1Nr8","contentWrapper":"panelContent-module_contentWrapper__1re5K"};
|
|
23088
23670
|
styleInject(css_248z$a);
|
|
23089
23671
|
|
|
23090
23672
|
/**
|
|
@@ -23096,16 +23678,18 @@ styleInject(css_248z$a);
|
|
|
23096
23678
|
* header, the header text to display
|
|
23097
23679
|
* children, the panels content
|
|
23098
23680
|
* backToMainPanel: optional parameter that controls whether the panel should have a back button or not
|
|
23099
|
-
* to be used in cases where there are panels within panels
|
|
23681
|
+
* to be used in cases where there are panels within panels,
|
|
23682
|
+
* footer: optional param, if used a footer will be shown in the panel content
|
|
23100
23683
|
* }
|
|
23101
23684
|
* @return {*} {JSX.Element}
|
|
23102
23685
|
*/
|
|
23103
23686
|
var PanelContent = function PanelContent(_ref) {
|
|
23104
23687
|
var header = _ref.header,
|
|
23105
23688
|
children = _ref.children,
|
|
23106
|
-
backToMainPanel = _ref.backToMainPanel
|
|
23107
|
-
|
|
23108
|
-
|
|
23689
|
+
backToMainPanel = _ref.backToMainPanel,
|
|
23690
|
+
footer = _ref.footer;
|
|
23691
|
+
var _usePanelStore = usePanelStore(),
|
|
23692
|
+
updateActivePanel = _usePanelStore.updateActivePanel;
|
|
23109
23693
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
23110
23694
|
className: styles$9.headerWrapper
|
|
23111
23695
|
}, backToMainPanel && /*#__PURE__*/React__default.createElement(Button, {
|
|
@@ -23124,10 +23708,12 @@ var PanelContent = function PanelContent(_ref) {
|
|
|
23124
23708
|
}, /*#__PURE__*/React__default.createElement(Icon$1, {
|
|
23125
23709
|
name: "close"
|
|
23126
23710
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
23127
|
-
className: styles$9.bodyWrapper
|
|
23711
|
+
className: footer ? styles$9.bodyWrapperWithFooter : styles$9.bodyWrapper
|
|
23128
23712
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
23129
23713
|
className: styles$9.contentWrapper
|
|
23130
|
-
}, children))
|
|
23714
|
+
}, children)), footer && /*#__PURE__*/React__default.createElement("div", {
|
|
23715
|
+
className: styles$9.footer
|
|
23716
|
+
}, footer));
|
|
23131
23717
|
};
|
|
23132
23718
|
PanelContent.defaultProps = {
|
|
23133
23719
|
backToMainPanel: undefined
|
|
@@ -24042,5 +24628,5 @@ var OptionsList = function OptionsList(_ref) {
|
|
|
24042
24628
|
}));
|
|
24043
24629
|
};
|
|
24044
24630
|
|
|
24045
|
-
export { ButtonWithPopover, ContextMenu, DataInfoButton, DialogGenerator, DraggableItemsWrapper, Dropdown, EchoBottomBar, EchoCard, EchoHeader, EchoTooltip, FloatingActionButton, FloatingSearchBar, Icon, IconList, InlineTagIconLink, LinkCard, ListItem, ListRow, OptionsList, Panel, PanelContent, PanelWrapper, RadioButtonGroup, ReactDatePicker, RoundIconButton, RoundIconButtonVariants, SideSheet, SideSheetOrientation, SidebarButton, SliderField, SplitView, TagCategoryIcon, TagCategoryType, TagContextMenu, TagIcon, TagIconShadowWrapper, TextIconButton, TimePicker, WorkOrderListItem, classnames$1 as classnames, echoIcons, getIcon, notifications_m1, notifications_m2, notifications_m3, notifications_m4, notifications_m5, notifications_m6, notifications_m9, notifications_main_group, punches_main_group, punches_pa, punches_pb, robim_external_ald, robim_external_iwit, robim_external_timp, robim_external_timp_text, themeConst, useIsMobile, useKeyboardNavigation, useListNavigator,
|
|
24631
|
+
export { ButtonWithPopover, ContextMenu, DataInfoButton, DialogGenerator, DraggableItemsWrapper, Dropdown, EchoBottomBar, EchoCard, EchoHeader, EchoTooltip, FloatingActionButton, FloatingSearchBar, Icon, IconList, InlineTagIconLink, LinkCard, ListItem, ListRow, OptionsList, Panel, PanelContent, PanelWrapper, RadioButtonGroup, ReactDatePicker, RoundIconButton, RoundIconButtonVariants, SideSheet, SideSheetOrientation, SidebarButton, SliderField, SplitView, TagCategoryIcon, TagCategoryType, TagContextMenu, TagIcon, TagIconShadowWrapper, TextIconButton, TimePicker, WorkOrderListItem, classnames$1 as classnames, echoIcons, getIcon, notifications_m1, notifications_m2, notifications_m3, notifications_m4, notifications_m5, notifications_m6, notifications_m9, notifications_main_group, punches_main_group, punches_pa, punches_pb, robim_external_ald, robim_external_iwit, robim_external_timp, robim_external_timp_text, themeConst, useIsMobile, useKeyboardNavigation, useListNavigator, usePanelStore, useSectionNavigator, workorders_main_group, workorders_pm01, workorders_pm02, workorders_pm03, workorders_pm04, workorders_pm05, workorders_pm06, workorders_pm10, workorders_pm15, workorders_pm20 };
|
|
24046
24632
|
//# sourceMappingURL=index.js.map
|