@linzjs/lui 21.34.1-3 → 21.35.0
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/CHANGELOG.md +7 -0
- package/dist/components/Toast/Helpers/ToastSection.d.ts +9 -0
- package/dist/components/Toast/Helpers/ToastTypes.d.ts +34 -0
- package/dist/components/Toast/Helpers/getToastProviderEl.d.ts +15 -0
- package/dist/components/Toast/Helpers/toastUsage.d.ts +2 -0
- package/dist/components/Toast/Helpers/useToastState.d.ts +21 -0
- package/dist/components/Toast/ToastProvider.d.ts +10 -0
- package/dist/components/Toast/Upgrade/LuiToastMessageCompatibleInterface.d.ts +5 -0
- package/dist/components/Toast/Upgrade/index.d.ts +14 -0
- package/dist/components/Toast/Upgrade/observeOlderToasts.d.ts +6 -0
- package/dist/components/Toast/Upgrade/useShowLUIMessageCompatibleInterface.d.ts +5 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/useToast.d.ts +16 -0
- package/dist/components/common/Hooks.d.ts +0 -1
- package/dist/hooks/useClickedOutsideElement.d.ts +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +534 -251
- package/dist/index.js.map +1 -1
- package/dist/lui.css +0 -94
- package/dist/lui.css.map +1 -1
- package/dist/lui.esm.js +531 -246
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/base.scss +0 -1
- package/package.json +1 -1
- package/dist/components/LuiModal/LuiAlertModalV2.d.ts +0 -7
- package/dist/components/LuiModal/LuiModalV2.d.ts +0 -35
- package/dist/scss/Components/Modal/modal-v2.scss +0 -122
package/dist/lui.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { forwardRef as forwardRef$1, useState, createContext, createElement, useContext, useRef, PureComponent, useEffect, Fragment, useCallback, useLayoutEffect, Component, useMemo, cloneElement, Children, isValidElement } from 'react';
|
|
2
|
+
import React__default, { forwardRef as forwardRef$1, useState, createContext, createElement, useContext, useRef, PureComponent, useEffect, Fragment, useCallback, useLayoutEffect, Component, useMemo, cloneElement, Children, isValidElement, useReducer } from 'react';
|
|
3
3
|
import { Menu as Menu$1, ControlledMenu, applyStatics, MenuItem, SubMenu, MenuDivider, MenuHeader, useMenuState, FocusableItem } from '@szhsin/react-menu';
|
|
4
4
|
import lottie from 'lottie-web/build/player/lottie_light';
|
|
5
5
|
import crypto$1 from 'crypto';
|
|
6
|
-
import
|
|
6
|
+
import ReactDOM, { createPortal } from 'react-dom';
|
|
7
7
|
|
|
8
8
|
function r$2(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$2(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$2(e))&&(n&&(n+=" "),n+=t);return n}
|
|
9
9
|
|
|
@@ -25655,8 +25655,8 @@ function styleInject(css, ref) {
|
|
|
25655
25655
|
}
|
|
25656
25656
|
}
|
|
25657
25657
|
|
|
25658
|
-
var css_248z$
|
|
25659
|
-
styleInject(css_248z$
|
|
25658
|
+
var css_248z$l = ".LuiFloatingWindow-buttons {\n display: flex;\n align-items: center;\n}\n\n.LuiFloatingWindow-extra-buttons-divider {\n margin-right: 4px;\n margin-left: 8px;\n margin-top: -6px;\n font-size: x-large;\n opacity: 0.7;\n}\n\n.FloatingWindow-window {\n box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.1490196078), 0px 6px 10px 0px rgba(0, 0, 0, 0.2509803922);\n position: absolute;\n background-color: #ffffff;\n top: 10%;\n left: 5%;\n display: flex;\n flex-direction: column;\n border-radius: 9px;\n}\n\n.FloatingWindow-container {\n display: flex;\n height: calc(100% - 50px);\n width: 100%;\n overflow: auto;\n}\n\n.FloatingWindow-header-element {\n flex: 0;\n}\n\n.FloatingWindow-header {\n height: 48px;\n line-height: 48px;\n color: #2a292c;\n padding: 0 8px;\n display: flex;\n overflow: hidden;\n justify-content: space-between;\n border-bottom: 2px #eaeaea solid;\n font-size: 1em;\n font-weight: 600;\n}\n\n.FloatingWindow-header-title-text {\n font-size: 1em;\n font-weight: 600;\n overflow: hidden;\n}\n\n.FloatingWindow-buttons {\n display: flex;\n align-items: center;\n}\n\n.FloatingWindow-extra-buttons-divider {\n margin-right: 4px;\n margin-left: 8px;\n margin-top: -6px;\n font-size: x-large;\n opacity: 0.7;\n}\n\n.FloatingWindowHeaderButton-button {\n padding: 0 0 0 8px;\n border: none;\n outline: none;\n border-radius: 50%;\n background-color: transparent;\n color: #6b6966;\n display: flex;\n}\n\n.FloatingWindowHeaderButton-icon {\n fill: #6b6966;\n}\n\n.floating-window-icon {\n display: inline-block;\n height: 24px;\n max-height: 24px;\n max-width: 24px;\n width: 24px;\n fill: #6b6966;\n}";
|
|
25659
|
+
styleInject(css_248z$l);
|
|
25660
25660
|
|
|
25661
25661
|
/**
|
|
25662
25662
|
* Overwrite the common buttons for floating window to
|
|
@@ -25746,87 +25746,6 @@ var LuiFloatingWindow = function (props) {
|
|
|
25746
25746
|
return (React__default.createElement(WF, __assign({}, props, { name: LUI_WINDOW_NAME, initialSize: initialSize, initialPosition: initialPosition || INITIAL_POSITION, minSize: { width: MINI_WIDTH, height: MINI_HEIGHT }, bounds: bounds, headerProps: generateHeaders, startDisplayed: startDisplayed, startPoppedOut: startPoppedOut })));
|
|
25747
25747
|
};
|
|
25748
25748
|
|
|
25749
|
-
var LuiToastMessage = function (_a) {
|
|
25750
|
-
var level = _a.level, _b = _a.displayTimeout, displayTimeout = _b === void 0 ? 4000 : _b, _c = _a.display, display = _c === void 0 ? true : _c, requireDismiss = _a.requireDismiss, onClose = _a.onClose, _d = _a.onCloseDelay, onCloseDelay = _d === void 0 ? displayTimeout : _d, children = _a.children, type = _a.type;
|
|
25751
|
-
var _e = useState('lui-msg-toast-show'), className = _e[0], setClassname = _e[1];
|
|
25752
|
-
var _f = useState(undefined), fadeOutTimer = _f[0], setFadeOutTimer = _f[1];
|
|
25753
|
-
var _g = useState(undefined), removeTimer = _g[0], setRemoveTimer = _g[1];
|
|
25754
|
-
var materialIcon = getMaterialIconForLevel(level);
|
|
25755
|
-
var callOnCloseAfterDissolved = function () {
|
|
25756
|
-
// This is so the caller can remove it from the dom
|
|
25757
|
-
if (onClose) {
|
|
25758
|
-
var timer = window.setTimeout(onClose, onCloseDelay);
|
|
25759
|
-
setRemoveTimer(timer);
|
|
25760
|
-
}
|
|
25761
|
-
};
|
|
25762
|
-
useEffect(function () {
|
|
25763
|
-
// clear timers if previously set
|
|
25764
|
-
fadeOutTimer && clearTimeout(fadeOutTimer);
|
|
25765
|
-
removeTimer && clearTimeout(removeTimer);
|
|
25766
|
-
setClassname('lui-msg-toast-show');
|
|
25767
|
-
if (!requireDismiss && displayTimeout !== 0) {
|
|
25768
|
-
// set a new timer
|
|
25769
|
-
var timer = window.setTimeout(function () {
|
|
25770
|
-
setClassname('lui-msg-toast-hide');
|
|
25771
|
-
callOnCloseAfterDissolved();
|
|
25772
|
-
}, displayTimeout);
|
|
25773
|
-
setFadeOutTimer(timer);
|
|
25774
|
-
}
|
|
25775
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25776
|
-
}, [requireDismiss, displayTimeout, children]);
|
|
25777
|
-
useEffect(function () {
|
|
25778
|
-
if (!display) {
|
|
25779
|
-
setClassname('lui-msg-toast-hide');
|
|
25780
|
-
callOnCloseAfterDissolved();
|
|
25781
|
-
}
|
|
25782
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25783
|
-
}, [display]);
|
|
25784
|
-
return (React__default.createElement("div", { role: "status", "data-testid": className, className: "lui-msg-".concat(level, " lui-msg-toast lui-msg-toast-dismissable ").concat(className) },
|
|
25785
|
-
React__default.createElement("i", { className: "lui-msg-status-icon material-icons-round" }, materialIcon),
|
|
25786
|
-
children,
|
|
25787
|
-
React__default.createElement("button", { "aria-label": "Close dialog", type: type || 'button', onClick: function () {
|
|
25788
|
-
setClassname('lui-msg-toast-hide');
|
|
25789
|
-
callOnCloseAfterDissolved();
|
|
25790
|
-
} },
|
|
25791
|
-
React__default.createElement("i", { className: "material-icons-round" }, "close"))));
|
|
25792
|
-
};
|
|
25793
|
-
|
|
25794
|
-
var UIMessagingContext = createContext({
|
|
25795
|
-
// @ts-ignore
|
|
25796
|
-
showMessage: function (props) { }
|
|
25797
|
-
});
|
|
25798
|
-
function useShowLUIMessage() {
|
|
25799
|
-
return useContext(UIMessagingContext).showMessage;
|
|
25800
|
-
}
|
|
25801
|
-
var LuiMessagingContextProvider = function (props) {
|
|
25802
|
-
var _a = useState(), _message = _a[0], setMessage = _a[1];
|
|
25803
|
-
var _b = useState(), _messageType = _b[0], setMessageType = _b[1];
|
|
25804
|
-
var _c = useState('success'), _messageLevel = _c[0], setMessageLevel = _c[1];
|
|
25805
|
-
var _d = useState(true), _requireDismiss = _d[0], setRequireDismiss = _d[1];
|
|
25806
|
-
var showMessage = function (props) {
|
|
25807
|
-
setMessage(props.message);
|
|
25808
|
-
setMessageType(props.messageType);
|
|
25809
|
-
setMessageLevel(props.messageLevel);
|
|
25810
|
-
setRequireDismiss(props.requireDismiss === undefined
|
|
25811
|
-
? props.messageLevel === 'error'
|
|
25812
|
-
: props.requireDismiss);
|
|
25813
|
-
};
|
|
25814
|
-
var renderMessage = function () {
|
|
25815
|
-
switch (_messageType) {
|
|
25816
|
-
case 'toast':
|
|
25817
|
-
return (React__default.createElement(LuiToastMessage, { onClose: function () {
|
|
25818
|
-
setMessage(undefined);
|
|
25819
|
-
}, level: _messageLevel, requireDismiss: _requireDismiss },
|
|
25820
|
-
React__default.createElement("span", { "data-testid": 'toastMessageShow' }, typeof _message === 'string' ? React__default.createElement("h2", null, _message) : _message)));
|
|
25821
|
-
default:
|
|
25822
|
-
return null;
|
|
25823
|
-
}
|
|
25824
|
-
};
|
|
25825
|
-
return (React__default.createElement(UIMessagingContext.Provider, { value: { showMessage: showMessage } },
|
|
25826
|
-
_message && renderMessage(),
|
|
25827
|
-
props.children));
|
|
25828
|
-
};
|
|
25829
|
-
|
|
25830
25749
|
var LuiExpandableBanner = function (props) {
|
|
25831
25750
|
var contentMaxHeight = props.contentMaxHeight;
|
|
25832
25751
|
var initiallyCollapsed = useRef(props.start === 'expanded' ? false : true);
|
|
@@ -27932,8 +27851,8 @@ ReactSplitGrid.defaultProps = {
|
|
|
27932
27851
|
onDrag: undefined,
|
|
27933
27852
|
};
|
|
27934
27853
|
|
|
27935
|
-
var css_248z$
|
|
27936
|
-
styleInject(css_248z$
|
|
27854
|
+
var css_248z$k = ".LuiResizableLayout-leftPanel {\n display: flex;\n flex-direction: column;\n /* this overflow and the one below (LuiResizableLayout-leftPanelBody) are need to make only\n the search result div scroll (instead of the whole page) */\n overflow: auto;\n}\n\n.LuiResizableLayout-rightPanel {\n display: flex;\n flex-direction: column;\n /* this overflow and the one below (LuiResizableLayout-leftPanelBody) are need to make only\n the search result div scroll (instead of the whole page) */\n overflow: auto;\n}\n\n.LuiResizableLayout-leftPanelBody {\n overflow-y: auto;\n}\n\n.LuiResizableLayout-gutterParentControl {\n display: flex;\n /* use visibility and opacity instead of display: none as we want to be able to fade in on hover */\n visibility: hidden;\n opacity: 0;\n position: fixed;\n top: 50%;\n z-index: 500;\n margin-left: -30px; /*half total control width, minus half the gutter width*/\n transition: 0.3s all 2s ease-in;\n}\n\n.LuiResizableLayout-gutterControlLeft, .LuiResizableLayout-gutterControlRight {\n background-color: #eaeaea;\n width: 32px;\n height: 80px;\n text-align: center;\n display: flex;\n align-items: center;\n}\n\n.LuiResizableLayout-gutterControlLeft {\n border-radius: 3px 0 0 3px;\n}\n\n.LuiResizableLayout-gutterControlRight {\n border-radius: 0 3px 3px 0;\n}\n\n.LuiResizableLayout-gutterControlLeft > .LuiIcon, .LuiResizableLayout-gutterControlRight > .LuiIcon {\n height: auto;\n}\n\n.LuiResizableLayout-gutterControlLeft:hover, .LuiResizableLayout-gutterControlRight:hover {\n background-color: #73c8e1;\n cursor: pointer;\n}\n\n.LuiResizableLayout-gutterControl-collapsed {\n visibility: hidden;\n}\n\n/* TODO: move the expand gutter button so it doesn't show over the scroll bar */\n.LuiResizableLayout-gutterParentControlVisible {\n visibility: visible;\n opacity: 1;\n}\n\n.LuiResizableLayout-grid {\n display: grid;\n height: 100%;\n}\n\n.LuiResizableLayout-gutterCol {\n grid-row: 1/-1;\n cursor: col-resize;\n width: 16px;\n z-index: 1;\n}\n\n.LuiResizableLayout-gutterCol-collapsed {\n width: 4px;\n}\n\n.LuiResizableLayout-gutterCol1 {\n grid-column: 2;\n}\n\n.LuiResizableLayout-gutterCol:hover > .LuiResizableLayout-gutterParentControl {\n visibility: visible;\n opacity: 1;\n transition: 0s all 0s ease-in;\n}\n\n.LuiResizableLayout-gutterSlider {\n width: 4px;\n height: 100%;\n background-color: #eaeaea;\n pointer-events: none;\n}\n\n.LuiResizableLayout-gutterCol:hover .LuiResizableLayout-gutterSlider, .LuiResizableLayout-gutterCol:active .LuiResizableLayout-gutterSlider {\n background-color: #73c8e1;\n}";
|
|
27855
|
+
styleInject(css_248z$k);
|
|
27937
27856
|
|
|
27938
27857
|
var GutterComponent = function (props) {
|
|
27939
27858
|
var leftIcon = (React__default.createElement(LuiIcon, { name: "ic_double_arrow_left", alt: "", status: "interactive" }));
|
|
@@ -31692,8 +31611,8 @@ var LuiTabsPanelSwitch = function (props) {
|
|
|
31692
31611
|
} }, tabProps), children));
|
|
31693
31612
|
};
|
|
31694
31613
|
|
|
31695
|
-
var css_248z$
|
|
31696
|
-
styleInject(css_248z$
|
|
31614
|
+
var css_248z$j = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiError {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: #2a292c;\n}\n.LuiError-errorIcon {\n vertical-align: middle;\n display: inline-block;\n}\n.LuiError-errorText {\n margin-left: 0.5rem;\n}";
|
|
31615
|
+
styleInject(css_248z$j);
|
|
31697
31616
|
|
|
31698
31617
|
var LuiError = function (_a) {
|
|
31699
31618
|
var error = _a.error, className = _a.className;
|
|
@@ -32055,8 +31974,8 @@ var LuiDateInput = React__default.forwardRef(function (_a, ref) {
|
|
|
32055
31974
|
return React__default.createElement(LuiTextInput, __assign({}, mapped, { ref: ref }));
|
|
32056
31975
|
});
|
|
32057
31976
|
|
|
32058
|
-
var css_248z$
|
|
32059
|
-
styleInject(css_248z$
|
|
31977
|
+
var css_248z$i = ".LuiTextInput.money input {\n background-image: url(\"data:image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 50 50'> <text x='4' y='31' font-size='15' font-family='Open Sans, system-ui, sans-seri' text-anchor='middle'>$</text> </svg>\");\n background-position: 10px center;\n background-repeat: no-repeat;\n padding-left: 22px;\n line-height: unset;\n}";
|
|
31978
|
+
styleInject(css_248z$i);
|
|
32060
31979
|
|
|
32061
31980
|
var MoneyParser = /** @class */ (function () {
|
|
32062
31981
|
function MoneyParser(init, options) {
|
|
@@ -32667,7 +32586,7 @@ function hash$2 (value, length) {
|
|
|
32667
32586
|
* @param {string} value
|
|
32668
32587
|
* @return {string}
|
|
32669
32588
|
*/
|
|
32670
|
-
function trim (value) {
|
|
32589
|
+
function trim$1 (value) {
|
|
32671
32590
|
return value.trim()
|
|
32672
32591
|
}
|
|
32673
32592
|
|
|
@@ -32884,7 +32803,7 @@ function dealloc (value) {
|
|
|
32884
32803
|
* @return {string}
|
|
32885
32804
|
*/
|
|
32886
32805
|
function delimit (type) {
|
|
32887
|
-
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
|
|
32806
|
+
return trim$1(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
|
|
32888
32807
|
}
|
|
32889
32808
|
|
|
32890
32809
|
/**
|
|
@@ -33133,7 +33052,7 @@ function ruleset (value, root, parent, index, offset, rules, points, type, props
|
|
|
33133
33052
|
|
|
33134
33053
|
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
33135
33054
|
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
|
33136
|
-
if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
|
|
33055
|
+
if (z = trim$1(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
|
|
33137
33056
|
props[k++] = z;
|
|
33138
33057
|
|
|
33139
33058
|
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
|
|
@@ -39708,9 +39627,9 @@ var StateManagedSelect = /*#__PURE__*/React__default.forwardRef(function (props,
|
|
|
39708
39627
|
|
|
39709
39628
|
var Select = StateManagedSelect;
|
|
39710
39629
|
|
|
39711
|
-
var css_248z$
|
|
39630
|
+
var css_248z$h = "";
|
|
39712
39631
|
var colors = {"charcoal":"#2a292c","fuscous":"#6b6966","gray":"#989189","silver":"#beb9b4","lily":"#eaeaea","dew":"#DAD7D6","hint":"#f9f9f9","snow":"#ffffff","white":"#ffffff","teal":"#00425d","sea":"#007198","electric":"#0096cc","spray":"#73c8e1","polar":"#e2f3f7","memesia":"#1F69C3","sherpa":"#004b50","surfie":"#017a76","persian":"#00a599","downy":"#73cdc8","iceberg":"#dcf5f0","sacramento":"#004e32","salem":"#08814d","pigment":"#0aa245","granny":"#9bd79b","panache":"#e9fae7","brand-primary":"#004b50","brand-secondary":"#017a76","engine":"#cc0000","carrot":"#EA6A2E","kendall":"#F5CCCC","elizabeth":"#FBDED0","andrea":"#3A7CDF","celestial":"#D7E5F9","golf":"#0AA345","error":"#cc0000","error-bg":"#F5CCCC","error-focus":"#5a0000","warning":"#EA6A2E","warning-bg":"#fbdfd2","warning-focus":"#b33a01","success":"#0aa245","success-bg":"#e9fae7","info":"#3A7CDF","info-bg":"#d8e5f9","visited":"#00425d","green-hover":"#107c3a","green-active":"#094a22","green-btn":"#0aa245","txt-link":"#1F69C3","primary-hover-btn":"#005678","selection":"#c7e9f3","heading-color":"#017a76","heading-color--secondary":"#2a292c","base-type-color":"#2a292c","input-text":"#2a292c","input-placeholder":"#6b6966","input-placeholder-when-disabled":"#989189","base-icon-color":"#007198","disabled-color":"#989189","disabled-color-dark":"#6b6966","linz-color-primary":"#023d48","linz-color-primary-hover":"#01818a","linz-color-tertiary":"#e1e44a","linz-color-tertiary-hover":"#cdcf59","color-test-pink":"#f09","linz-linear-gradient-blue":"linear-gradient(70deg, #00425d 12%, #007198 100%)","linz-linear-gradient-teal":"linear-gradient(270deg, #00a599 1%, #73cdc8 100%)"};
|
|
39713
|
-
styleInject(css_248z$
|
|
39632
|
+
styleInject(css_248z$h);
|
|
39714
39633
|
|
|
39715
39634
|
var _excluded = ["allowCreateWhileLoading", "createOptionPosition", "formatCreateLabel", "isValidNewOption", "getNewOptionData", "onCreateOption", "options", "onChange"];
|
|
39716
39635
|
|
|
@@ -39895,14 +39814,6 @@ var useEscapeFunction = function (onEscape) {
|
|
|
39895
39814
|
};
|
|
39896
39815
|
}, [escFunction]);
|
|
39897
39816
|
};
|
|
39898
|
-
var useEscapeFunction2 = function (onEscape, trigger) {
|
|
39899
|
-
if (trigger === void 0) { trigger = 'keydown'; }
|
|
39900
|
-
var escFunction = useCallback(function (event) { return event.key === 'Escape' && onEscape(event); }, [onEscape]);
|
|
39901
|
-
useEffect(function () {
|
|
39902
|
-
document.addEventListener(trigger, escFunction);
|
|
39903
|
-
return function () { return document.removeEventListener(trigger, escFunction); };
|
|
39904
|
-
}, [escFunction]);
|
|
39905
|
-
};
|
|
39906
39817
|
/**
|
|
39907
39818
|
* A hook which allows handling of click event anywhere on the page.
|
|
39908
39819
|
* Provides a way of handling clicks done inside or outside the element bound to the returned react ref.
|
|
@@ -41838,7 +41749,7 @@ var _react = React__default;
|
|
|
41838
41749
|
|
|
41839
41750
|
var _react2 = _interopRequireDefault(_react);
|
|
41840
41751
|
|
|
41841
|
-
var _reactDom =
|
|
41752
|
+
var _reactDom = ReactDOM;
|
|
41842
41753
|
|
|
41843
41754
|
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
41844
41755
|
|
|
@@ -42262,118 +42173,8 @@ var LuiModalHeader = function (props) {
|
|
|
42262
42173
|
React__default.createElement(LuiIcon, { name: "ic_clear", alt: "Help", size: "lg" }))))))));
|
|
42263
42174
|
};
|
|
42264
42175
|
|
|
42265
|
-
|
|
42266
|
-
|
|
42267
|
-
* usage:
|
|
42268
|
-
```typescript
|
|
42269
|
-
const refElement = React.useRef<HTMLButtonElement>(null);
|
|
42270
|
-
const handleClickOutside = () => {
|
|
42271
|
-
console.log("hello world");
|
|
42272
|
-
};
|
|
42273
|
-
useClickedOutsideElement(refElement, handleClickOutside);
|
|
42274
|
-
return <button ref={refElement}>Click Me!</button>;
|
|
42275
|
-
```
|
|
42276
|
-
*/
|
|
42277
|
-
function useClickedOutsideElement(refElement, handleClickOutside) {
|
|
42278
|
-
React__default.useEffect(function () {
|
|
42279
|
-
function onOutsideClicked(event) {
|
|
42280
|
-
var element = refElement.current;
|
|
42281
|
-
if (!(element === null || element === void 0 ? void 0 : element.contains(event.target))) {
|
|
42282
|
-
handleClickOutside();
|
|
42283
|
-
}
|
|
42284
|
-
}
|
|
42285
|
-
document.addEventListener('mousedown', onOutsideClicked);
|
|
42286
|
-
return function () {
|
|
42287
|
-
document.removeEventListener('mousedown', onOutsideClicked);
|
|
42288
|
-
};
|
|
42289
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42290
|
-
}, []);
|
|
42291
|
-
}
|
|
42292
|
-
|
|
42293
|
-
var _a;
|
|
42294
|
-
// this is here for the tests
|
|
42295
|
-
var isTest = typeof process !== 'undefined' && ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'test';
|
|
42296
|
-
if (!isTest)
|
|
42297
|
-
Modal.setAppElement('#root');
|
|
42298
|
-
var LuiModalV2 = function (props) {
|
|
42299
|
-
var _a;
|
|
42300
|
-
var modalRef = useRef(null);
|
|
42301
|
-
var handleClickOutside = useCallback(function () { var _a; return props.shouldCloseOnOverlayClick && ((_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props)); }, [props.shouldCloseOnEsc, props.onClose]);
|
|
42302
|
-
useClickedOutsideElement(modalRef, handleClickOutside);
|
|
42303
|
-
var handleEsc = useCallback(function (e) {
|
|
42304
|
-
var _a;
|
|
42305
|
-
if (props.shouldCloseOnEsc !== false) {
|
|
42306
|
-
e.stopPropagation();
|
|
42307
|
-
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
42308
|
-
}
|
|
42309
|
-
}, [props.shouldCloseOnEsc, props.onClose]);
|
|
42310
|
-
useEscapeFunction2(handleEsc, props.shouldCloseOnEsc === 'use-keyup' ? 'keyup' : 'keydown');
|
|
42311
|
-
var handleAutoFocus = function (el) {
|
|
42312
|
-
if (props.preventAutoFocus)
|
|
42313
|
-
return;
|
|
42314
|
-
if (el && !el.contains(el.ownerDocument.activeElement)) {
|
|
42315
|
-
var firstFocusableElement = el.querySelector('input,button');
|
|
42316
|
-
firstFocusableElement === null || firstFocusableElement === void 0 ? void 0 : firstFocusableElement.focus();
|
|
42317
|
-
}
|
|
42318
|
-
};
|
|
42319
|
-
var showCloseButton = Boolean(props.showCloseButton && props.onClose);
|
|
42320
|
-
var showHelpButton = Boolean(props.helpLink);
|
|
42321
|
-
var showButtons = showCloseButton || showHelpButton;
|
|
42322
|
-
var showHeadingIcon = props.headingIcon && !props.isLoading;
|
|
42323
|
-
return (React__default.createElement(Modal, { key: props.key, isOpen: true,
|
|
42324
|
-
// disble the `shouldClose` props as we handle them ourselves
|
|
42325
|
-
shouldCloseOnOverlayClick: false, shouldCloseOnEsc: false, overlayClassName: "modal", className: props.lowContrast ? 'lui-scrim-low-contrast' : 'lui-scrim',
|
|
42326
|
-
// required to prevent warnings that are not applicable in real usage
|
|
42327
|
-
ariaHideApp: !isTest, parentSelector: props.appendToElement },
|
|
42328
|
-
React__default.createElement("div", { ref: function (el) {
|
|
42329
|
-
modalRef.current = el;
|
|
42330
|
-
handleAutoFocus(el);
|
|
42331
|
-
}, className: clsx('lui-modal-v2 lui-box-shadow', props.maxWidth && 'lui-max-width', props.className) },
|
|
42332
|
-
React__default.createElement("div", { className: "lui-modal-v2-header", id: "lui-modal-v2-header" },
|
|
42333
|
-
props.isLoading && (React__default.createElement(LuiMiniSpinner, { size: 20, divProps: { className: 'lui-modal-v2-header-spinner' } })),
|
|
42334
|
-
showHeadingIcon && (React__default.createElement("div", { className: "lui-modal-v2-header-icon" },
|
|
42335
|
-
React__default.createElement(LuiIcon, __assign({ size: "md", name: "", alt: "Help" }, props.headingIcon, { className: clsx('', (_a = props.headingIcon) === null || _a === void 0 ? void 0 : _a.className) })))),
|
|
42336
|
-
props.headingText && (React__default.createElement("h2", { className: "lui-modal-v2-header-title" }, props.headingText)),
|
|
42337
|
-
showButtons && (React__default.createElement("div", { className: "lui-modal-v2-header-buttons" },
|
|
42338
|
-
showHelpButton && React__default.createElement(HelpButton, { helpLink: props.helpLink }),
|
|
42339
|
-
showCloseButton && React__default.createElement(CloseButton, { onClose: props.onClose })))),
|
|
42340
|
-
React__default.createElement("div", { className: "lui-modal-v2-contents" }, props.children))));
|
|
42341
|
-
};
|
|
42342
|
-
var LuiModalV2Buttons = function (props) { return (React__default.createElement("div", { className: clsx('lui-modal-v2-btn-row', props.className) }, props.children)); };
|
|
42343
|
-
var HelpButton = function (props) { return (React__default.createElement("button", { "aria-label": "Modal Help", title: "Help", className: "lui-modal-v2-header-help-btn", onClick: typeof props.helpLink === 'string'
|
|
42344
|
-
? function () { return window.open(props.helpLink, '_blank'); }
|
|
42345
|
-
: props.helpLink },
|
|
42346
|
-
React__default.createElement(LuiIcon, { name: "ic_help_outline", alt: "Help", size: "md" }))); };
|
|
42347
|
-
var CloseButton = function (props) { return (React__default.createElement("button", { "aria-label": "Modal Close", title: "Close", className: "lui-modal-v2-header-close-btn", onClick: props.onClose },
|
|
42348
|
-
React__default.createElement(LuiIcon, { name: "ic_clear", alt: "Help", size: "md" }))); };
|
|
42349
|
-
/** Allows injecting the modal header text */
|
|
42350
|
-
var LuiModalV2HeadingText = function (props) {
|
|
42351
|
-
var _a = useState(), target = _a[0], setTarget = _a[1];
|
|
42352
|
-
useEffect(function () {
|
|
42353
|
-
var modalHeader = document.querySelector('#lui-modal-v2-header');
|
|
42354
|
-
modalHeader && setTarget(modalHeader);
|
|
42355
|
-
}, []);
|
|
42356
|
-
if (!target)
|
|
42357
|
-
return null;
|
|
42358
|
-
return createPortal(React__default.createElement("h2", { className: clsx('lui-modal-v2-header-title lui-modal-v2-header-title-portal', props.className) }, props.children), target);
|
|
42359
|
-
};
|
|
42360
|
-
|
|
42361
|
-
var LuiAlertModalV2 = function (props) {
|
|
42362
|
-
var level = props.level, className = props.className, children = props.children, rest = __rest(props, ["level", "className", "children"]);
|
|
42363
|
-
var materialIcon = getMaterialIconForLevel(level);
|
|
42364
|
-
var status = Object.keys(ICON_STATUS).includes(level)
|
|
42365
|
-
? level
|
|
42366
|
-
: 'interactive';
|
|
42367
|
-
return (React__default.createElement(LuiModalV2, __assign({}, rest, { className: clsx("lui-modal-v2-".concat(level), className), headingIcon: {
|
|
42368
|
-
name: "ic_".concat(materialIcon),
|
|
42369
|
-
alt: "".concat(level, " status icon"),
|
|
42370
|
-
size: 'md',
|
|
42371
|
-
status: status
|
|
42372
|
-
} }), children));
|
|
42373
|
-
};
|
|
42374
|
-
|
|
42375
|
-
var css_248z$e = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n user-select: none;\n overflow: hidden;\n z-index: 1; /* Necessary for overflow: hidden to work correctly in Safari */\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: linear-gradient(\n 90deg,\n var(--base-color),\n var(--highlight-color),\n var(--base-color)\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n\n@media (prefers-reduced-motion) {\n .react-loading-skeleton {\n --pseudo-element-display: none; /* Disable animation */\n }\n}\n";
|
|
42376
|
-
styleInject(css_248z$e);
|
|
42176
|
+
var css_248z$g = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n user-select: none;\n overflow: hidden;\n z-index: 1; /* Necessary for overflow: hidden to work correctly in Safari */\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: linear-gradient(\n 90deg,\n var(--base-color),\n var(--highlight-color),\n var(--base-color)\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n\n@media (prefers-reduced-motion) {\n .react-loading-skeleton {\n --pseudo-element-display: none; /* Disable animation */\n }\n}\n";
|
|
42177
|
+
styleInject(css_248z$g);
|
|
42377
42178
|
|
|
42378
42179
|
/**
|
|
42379
42180
|
* @internal
|
|
@@ -46970,6 +46771,34 @@ var LuiTooltip = function (props) {
|
|
|
46970
46771
|
return React__default.createElement(Tippy, __assign({}, tippyProps), children);
|
|
46971
46772
|
};
|
|
46972
46773
|
|
|
46774
|
+
/**
|
|
46775
|
+
* This hook will callback with handleClickOutside() when "mousedown" dom event occurs off the refElement
|
|
46776
|
+
* usage:
|
|
46777
|
+
```typescript
|
|
46778
|
+
const refElement = React.useRef<HTMLButtonElement>(null);
|
|
46779
|
+
const handleClickOutside = () => {
|
|
46780
|
+
console.log("hello world");
|
|
46781
|
+
};
|
|
46782
|
+
useClickedOutsideElement(refElement, handleClickOutside);
|
|
46783
|
+
return <button ref={refElement}>Click Me!</button>;
|
|
46784
|
+
```
|
|
46785
|
+
*/
|
|
46786
|
+
function useClickedOutsideElement(refElement, handleClickOutside) {
|
|
46787
|
+
React__default.useEffect(function () {
|
|
46788
|
+
function onOutsideClicked(event) {
|
|
46789
|
+
var element = refElement.current;
|
|
46790
|
+
if (!(element === null || element === void 0 ? void 0 : element.contains(event.target))) {
|
|
46791
|
+
handleClickOutside();
|
|
46792
|
+
}
|
|
46793
|
+
}
|
|
46794
|
+
document.addEventListener('mousedown', onOutsideClicked);
|
|
46795
|
+
return function () {
|
|
46796
|
+
document.removeEventListener('mousedown', onOutsideClicked);
|
|
46797
|
+
};
|
|
46798
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46799
|
+
}, []);
|
|
46800
|
+
}
|
|
46801
|
+
|
|
46973
46802
|
var getFillClassName = function (fillVariation, backgroundFill) {
|
|
46974
46803
|
if (backgroundFill) {
|
|
46975
46804
|
return 'LuiBadge--fill';
|
|
@@ -47019,8 +46848,8 @@ var LuiSidePanelProvider = function (_a) {
|
|
|
47019
46848
|
React__default.createElement(LuiSidePanelContainer, __assign({}, props))));
|
|
47020
46849
|
};
|
|
47021
46850
|
|
|
47022
|
-
var css_248z$
|
|
47023
|
-
styleInject(css_248z$
|
|
46851
|
+
var css_248z$f = ".lui-switch-checkbox {\n height: 0;\n width: 0;\n visibility: hidden;\n}\n\n.lui-switch-label {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n width: 40px;\n height: 20px;\n background: grey;\n border-radius: 40px;\n position: relative;\n transition: background-color 0.2s;\n}\n\n.lui-switch-label .lui-switch-button {\n content: \"\";\n position: absolute;\n top: 2px;\n left: 2px;\n width: 18px;\n height: 16px;\n border-radius: 18px;\n transition: 0.2s;\n background: #fff;\n box-shadow: 0 0 2px 0 rgba(10, 10, 10, 0.29);\n}\n\n.lui-switch-checkbox:checked + .lui-switch-label .lui-switch-button {\n left: calc(100% - 2px);\n transform: translateX(-100%);\n}\n\n.lui-switch-label:active .lui-switch-button {\n width: 20px;\n}";
|
|
46852
|
+
styleInject(css_248z$f);
|
|
47024
46853
|
|
|
47025
46854
|
var LuiSwitchButton = function (props) {
|
|
47026
46855
|
var generatedId = useGenerateOrDefaultId();
|
|
@@ -54651,8 +54480,8 @@ var LuiAccordicardStatic = function (props) {
|
|
|
54651
54480
|
React__default.createElement(LuiIcon, { className: clsx('LuiAccordicardStatic-chevron', isOpen ? 'LuiAccordicardStatic-chevron--isOpen' : null), name: 'ic_expand_more', alt: "expand", title: "Expand and collapse panel", size: "md" }))));
|
|
54652
54481
|
};
|
|
54653
54482
|
|
|
54654
|
-
var css_248z$
|
|
54655
|
-
styleInject(css_248z$
|
|
54483
|
+
var css_248z$e = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.lui-accordion {\n padding: 8px;\n display: flex;\n border-radius: 5px;\n box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.2509803922), 0px 0px 3px 0px rgba(0, 0, 0, 0.1490196078);\n}\n.lui-accordion .chevron {\n transition: all 0.3s ease-in-out;\n transform: rotate(0);\n}\n.lui-accordion .chevron--isOpen {\n transform: rotate(180deg);\n}\n.lui-accordion .accordion-heading {\n padding: 4px;\n}\n.lui-accordion h4 {\n padding: 4px;\n}\n.lui-accordion > summary {\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n.lui-accordion > summary h4 {\n margin-top: 0;\n display: inline-block;\n}\n.lui-accordion > summary::marker, .lui-accordion > summary::-webkit-details-marker {\n display: none;\n}";
|
|
54484
|
+
styleInject(css_248z$e);
|
|
54656
54485
|
|
|
54657
54486
|
var LuiAccordion = function (props) {
|
|
54658
54487
|
var _a = props.expanded, expanded = _a === void 0 ? false : _a, heading = props.heading, children = props.children, _b = props.iconColor, iconColor = _b === void 0 ? '#017A76' : _b, className = props.className, _c = props.style, style = _c === void 0 ? {} : _c;
|
|
@@ -54763,8 +54592,8 @@ var LuiMultiSwitch = function (_a) {
|
|
|
54763
54592
|
React__default.createElement("div", { className: clsx('LuiMultiSwitch-labels', disabled && 'LuiMultiSwitch-disabled') }, options === null || options === void 0 ? void 0 : options.map(function (option, i) { return (React__default.createElement("label", { role: 'radio', key: i, htmlFor: id.current, "aria-disabled": option.disabled || disabled, "aria-checked": selectedIndex === i, className: option.className, onClick: function () { return select(i); }, onTouchStart: function () { return select(i); } }, option.text)); }))));
|
|
54764
54593
|
};
|
|
54765
54594
|
|
|
54766
|
-
var css_248z$
|
|
54767
|
-
styleInject(css_248z$
|
|
54595
|
+
var css_248z$d = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiListBox {\n padding: 0;\n list-style: none;\n}\n.LuiListBox .LuiListBoxItem {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: normal;\n user-select: none;\n color: #2a292c;\n line-height: 24px;\n outline: none;\n padding: 0.5rem 0.75rem;\n border: 2px solid transparent;\n}\n.LuiListBox .LuiListBoxItem:focus-visible {\n border-color: #007198;\n}\n.LuiListBox .LuiListBoxItem.LuiListBoxItem-selected {\n background: #e2f3f7;\n}\n.LuiListBox .LuiListBoxItem:hover, .LuiListBox .LuiListBoxItem.LuiListBoxItem-selected:hover {\n background: #d6eef4;\n}\n.LuiListBox .LuiListBoxItem.LuiListBoxItem-disabled {\n background: #eaeaea;\n}\n.LuiListBox .LuiListBox-emptyIndicator, .LuiListBox .LuiListBox-loadingIndicator {\n padding: 0.5rem 0.75rem;\n}\n.LuiListBox .LuiListBoxGroup .LuiListBoxGroup-heading {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n user-select: none;\n color: #6b6966;\n line-height: 16px;\n padding: 0.5rem 0.5rem;\n}";
|
|
54596
|
+
styleInject(css_248z$d);
|
|
54768
54597
|
|
|
54769
54598
|
function $c1d7fb2ec91bae71$var$Item(props) {
|
|
54770
54599
|
return null;
|
|
@@ -58264,16 +58093,16 @@ function DefaultEmptyIndicator() {
|
|
|
58264
58093
|
return React__default.createElement("li", { className: "LuiListBox-emptyIndicator" }, "Nothing to Display");
|
|
58265
58094
|
}
|
|
58266
58095
|
|
|
58267
|
-
var css_248z$
|
|
58268
|
-
styleInject(css_248z$
|
|
58096
|
+
var css_248z$c = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.RadioItemRenderer {\n display: flex;\n align-items: center;\n position: relative;\n padding: 0 0 0 2rem;\n}\n.RadioItemRenderer::before {\n content: \"\";\n height: 1.5rem;\n min-width: 1.5rem;\n width: 1.5rem;\n border: 2px solid #007198;\n border-radius: 50%;\n background-color: transparent;\n position: absolute;\n left: 0;\n top: 0;\n margin-right: 0.75rem;\n}\n.RadioItemRenderer:after {\n content: \"\";\n position: absolute;\n left: 5px;\n top: 5px;\n background-color: #007198;\n height: 14px;\n min-width: 14px;\n width: 14px;\n border-radius: 50%;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n}\n.RadioItemRenderer-isSelected:after {\n opacity: 1;\n}";
|
|
58097
|
+
styleInject(css_248z$c);
|
|
58269
58098
|
|
|
58270
58099
|
function RadioItemRenderer(_a) {
|
|
58271
58100
|
var item = _a.item, isSelected = _a.isSelected;
|
|
58272
58101
|
return (React__default.createElement("div", { className: "RadioItemRenderer ".concat(isSelected ? 'RadioItemRenderer-isSelected' : '') }, item.label));
|
|
58273
58102
|
}
|
|
58274
58103
|
|
|
58275
|
-
var css_248z$
|
|
58276
|
-
styleInject(css_248z$
|
|
58104
|
+
var css_248z$b = ".CheckboxRenderer {\n display: flex;\n align-items: center;\n}";
|
|
58105
|
+
styleInject(css_248z$b);
|
|
58277
58106
|
|
|
58278
58107
|
function CheckboxItemRenderer(_a) {
|
|
58279
58108
|
var item = _a.item, isSelected = _a.isSelected;
|
|
@@ -58297,8 +58126,8 @@ function LuiSideMenuItem(_a) {
|
|
|
58297
58126
|
React__default.createElement("span", { className: "navText" }, label))));
|
|
58298
58127
|
}
|
|
58299
58128
|
|
|
58300
|
-
var css_248z$
|
|
58301
|
-
styleInject(css_248z$
|
|
58129
|
+
var css_248z$a = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n@keyframes animate-stripes {\n 100% {\n background-position: 100px 0;\n }\n}\n.ProgressBar, .ProgressBar-PROC, .ProgressBar-COMP, .ProgressBar-FAIL {\n height: 5px;\n width: 100%;\n background-color: #eaeaea;\n border-radius: 3px;\n}\n.ProgressBar-FAIL {\n background-color: #cc0000;\n}\n.ProgressBar-COMP {\n background-color: #0aa245;\n}\n.ProgressBar-PROC {\n background-color: #0096cc;\n transition: width 0.3s ease-in-out;\n}\n.ProgressBar-PROC.indeterminate {\n background-image: linear-gradient(-45deg, transparent 25%, rgba(255, 255, 255, 0.75) 25%, rgba(255, 255, 255, 0.75) 75%, transparent 75%);\n background-size: 50px 100%;\n animation: animate-stripes 5s linear infinite;\n}";
|
|
58130
|
+
styleInject(css_248z$a);
|
|
58302
58131
|
|
|
58303
58132
|
var LuiProgressBar = function (_a) {
|
|
58304
58133
|
var value = _a.value, max = _a.max, error = _a.error, _b = _a.barHeight, barHeight = _b === void 0 ? '5px' : _b;
|
|
@@ -58326,8 +58155,8 @@ var LuiProgressBar = function (_a) {
|
|
|
58326
58155
|
React__default.createElement("div", { "data-testid": 'progress-bar-size', className: clsx("ProgressBar-".concat(status), { indeterminate: indeterminate }), style: { width: "".concat(percentage, "%"), height: barHeight } })));
|
|
58327
58156
|
};
|
|
58328
58157
|
|
|
58329
|
-
var css_248z$
|
|
58330
|
-
styleInject(css_248z$
|
|
58158
|
+
var css_248z$9 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.Toolbar {\n position: absolute;\n align-items: center;\n align-self: center;\n background: #ffffff;\n border-radius: 5px;\n display: flex;\n flex-direction: column;\n height: fit-content;\n margin: 0 0.75rem;\n padding: 0;\n width: fit-content;\n z-index: 1000;\n box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.2509803922), 0px 0px 3px 0px rgba(0, 0, 0, 0.1490196078);\n}\n\n.Left {\n justify-self: start;\n}\n\n.Right {\n justify-self: end;\n}";
|
|
58159
|
+
styleInject(css_248z$9);
|
|
58331
58160
|
|
|
58332
58161
|
var ToolbarDirection;
|
|
58333
58162
|
(function (ToolbarDirection) {
|
|
@@ -58349,8 +58178,8 @@ var ToolbarIcon = function (_a) {
|
|
|
58349
58178
|
return iconImage ? (React__default.createElement("img", { className: "LuiIcon--lg", alt: iconName, src: iconImage })) : (React__default.createElement(LuiIcon, { name: iconName, alt: iconName, size: 'md' }));
|
|
58350
58179
|
};
|
|
58351
58180
|
|
|
58352
|
-
var css_248z$
|
|
58353
|
-
styleInject(css_248z$
|
|
58181
|
+
var css_248z$8 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.ToolbarButton {\n height: 40px;\n width: 40px;\n line-height: 12px;\n margin: 2px;\n padding: 0.25rem;\n}\n\n.ToolbarButton-placement {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.ToolbarButton img {\n border-radius: 3px;\n margin: -0.25rem;\n}\n\n.ToolbarButton,\n.ToolbarButton:hover,\n.ToolbarButton:disabled,\n.ToolbarButton:active:enabled {\n border-radius: 5px;\n border: 2px #ffffff solid !important;\n}\n\n.ToolbarItem-separator {\n height: 2px;\n background-color: #eaeaea;\n width: 100%;\n}";
|
|
58182
|
+
styleInject(css_248z$8);
|
|
58354
58183
|
|
|
58355
58184
|
/**
|
|
58356
58185
|
* Create button for using either LuiIcon or Image.
|
|
@@ -58413,8 +58242,8 @@ var useMediaQuery = function (query) {
|
|
|
58413
58242
|
return matches;
|
|
58414
58243
|
};
|
|
58415
58244
|
|
|
58416
|
-
var css_248z$
|
|
58417
|
-
styleInject(css_248z$
|
|
58245
|
+
var css_248z$7 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiCounter-round {\n background: #007198;\n color: #ffffff;\n text-align: center;\n width: 1.5em;\n height: 1.5em;\n border-radius: 50%;\n display: inline-block;\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n pointer-events: none;\n}";
|
|
58246
|
+
styleInject(css_248z$7);
|
|
58418
58247
|
|
|
58419
58248
|
var LuiCounter = React__default.forwardRef(function (props, ref) {
|
|
58420
58249
|
var selectedNum = props.selectedNum, totalNum = props.totalNum, _a = props.shape, shape = _a === void 0 ? 'rect' : _a, _b = props.countZero, countZero = _b === void 0 ? true : _b, title = props.title, className = props.className, rest = __rest(props, ["selectedNum", "totalNum", "shape", "countZero", "title", "className"]);
|
|
@@ -58429,8 +58258,8 @@ var LuiCounter = React__default.forwardRef(function (props, ref) {
|
|
|
58429
58258
|
return (React__default.createElement(React__default.Fragment, null, !(selectedNum === 0 && !countZero) && (React__default.createElement("span", __assign({ ref: ref, className: determineCounterClassname(), "data-testid": "lui-counter-number-".concat(shape), title: title !== null && title !== void 0 ? title : "".concat(selectedNum, " of ").concat(totalNum, " rows selected") }, rest), selectedNum.toLocaleString()))));
|
|
58430
58259
|
});
|
|
58431
58260
|
|
|
58432
|
-
var css_248z$
|
|
58433
|
-
styleInject(css_248z$
|
|
58261
|
+
var css_248z$6 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.lui-pagination-override-mobile .lui-pagination-desktop {\n display: none;\n visibility: hidden;\n opacity: 0;\n}\n.lui-pagination-override-mobile .lui-pagination-mobile {\n display: flex;\n}\n\n.lui-pagination-override-desktop .lui-pagination-mobile {\n display: none;\n visibility: hidden;\n opacity: 0;\n}\n.lui-pagination-override-desktop .lui-pagination-desktop {\n display: flex;\n}\n\n.lui-pagination-controller {\n container-type: inline-size;\n}\n@container (min-width: 500px) {\n .lui-pagination-controller .lui-pagination-mobile {\n display: none;\n visibility: hidden;\n opacity: 0;\n }\n .lui-pagination-controller .lui-pagination-desktop {\n display: flex;\n }\n}\n@container (max-width: 499px) {\n .lui-pagination-controller .lui-pagination-desktop {\n display: none;\n visibility: hidden;\n opacity: 0;\n }\n .lui-pagination-controller .lui-pagination-mobile {\n display: flex;\n }\n}\n\n.lui-pagination {\n display: flex;\n user-select: none;\n justify-content: center;\n}\n.lui-pagination-page-counter {\n display: flex;\n align-items: center;\n margin-left: 0.75rem;\n margin-right: 0.75rem;\n}\n.lui-pagination .lui-button {\n color: #2a292c;\n height: 40px;\n padding: 0.5rem 0.75rem;\n vertical-align: top;\n}\n.lui-pagination .lui-button .lui-pagination-navigation-icon {\n padding-top: 1px;\n}\n.lui-pagination .lui-button .lui-pagination-navigation-icon path {\n fill: #2a292c;\n}\n.lui-pagination .lui-button:hover {\n color: #2a292c;\n}\n.lui-pagination .lui-button-selected {\n background-color: #007198;\n color: #ffffff;\n}\n.lui-pagination-ellipsis {\n pointer-events: none;\n}\n.lui-pagination-navigate-disabled {\n pointer-events: none;\n}\n.lui-pagination-navigate-disabled .lui-pagination-navigation-icon {\n padding-top: 1px;\n}\n.lui-pagination-navigate-disabled .lui-pagination-navigation-icon path {\n fill: #989189 !important;\n}";
|
|
58262
|
+
styleInject(css_248z$6);
|
|
58434
58263
|
|
|
58435
58264
|
var LuiPagination = function (_a) {
|
|
58436
58265
|
var totalPages = _a.totalPages, currentPage = _a.currentPage, onPageChange = _a.onPageChange, _b = _a.isMobileLayout, isMobileLayout = _b === void 0 ? null : _b;
|
|
@@ -58540,11 +58369,11 @@ var LuiPagination = function (_a) {
|
|
|
58540
58369
|
React__default.createElement("div", { className: "pagination" }, renderPaginationNumbers())))));
|
|
58541
58370
|
};
|
|
58542
58371
|
|
|
58543
|
-
var css_248z$
|
|
58544
|
-
styleInject(css_248z$
|
|
58372
|
+
var css_248z$5 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.Separator {\n background-color: #eaeaea;\n position: absolute;\n display: flex;\n justify-content: space-around;\n transition-property: background-color;\n transition-delay: 750ms;\n transition-duration: 0ms;\n}\n.Separator-arrows {\n align-self: center;\n position: relative;\n opacity: 0;\n transition-property: opacity;\n transition-delay: 750ms;\n transition-duration: 0ms;\n}\n.Separator:focus-within, .Separator:hover, .Separator:focus, .Separator:active {\n background-color: #73c8e1;\n transition-delay: 0ms;\n transition-duration: 0ms;\n}\n.Separator:focus-within .Separator-arrows, .Separator:hover .Separator-arrows, .Separator:focus .Separator-arrows, .Separator:active .Separator-arrows {\n opacity: 1;\n transition-delay: 0ms;\n transition-duration: 0ms;\n display: inline-block;\n}";
|
|
58373
|
+
styleInject(css_248z$5);
|
|
58545
58374
|
|
|
58546
|
-
var css_248z$
|
|
58547
|
-
styleInject(css_248z$
|
|
58375
|
+
var css_248z$4 = ".Control {\n transition: opacity 0.2s ease;\n position: absolute;\n margin-left: 0 !important;\n display: flex;\n justify-content: space-around;\n align-items: center;\n}";
|
|
58376
|
+
styleInject(css_248z$4);
|
|
58548
58377
|
|
|
58549
58378
|
var useForkRef = function (forwardedRef) {
|
|
58550
58379
|
var localRef = useRef(null);
|
|
@@ -59302,8 +59131,8 @@ var keyDownHandler = function (e) {
|
|
|
59302
59131
|
return valueNow + delta;
|
|
59303
59132
|
};
|
|
59304
59133
|
|
|
59305
|
-
var css_248z$
|
|
59306
|
-
styleInject(css_248z$
|
|
59134
|
+
var css_248z$3 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.Splitter {\n display: grid;\n position: relative;\n overflow: hidden;\n opacity: 0;\n}\n.Splitter > :first-child, .Splitter > :nth-child(2) {\n position: relative;\n z-index: 0;\n background: #f9f9f9;\n overflow: auto;\n}\n.Splitter.resizing * {\n pointer-events: none;\n user-select: none;\n}";
|
|
59135
|
+
styleInject(css_248z$3);
|
|
59307
59136
|
|
|
59308
59137
|
/**
|
|
59309
59138
|
* Container that appends a separator when the children count equals 2.
|
|
@@ -59355,8 +59184,8 @@ var useSplitterRef = function () {
|
|
|
59355
59184
|
return { ref: ref, setRatio: setRatio };
|
|
59356
59185
|
};
|
|
59357
59186
|
|
|
59358
|
-
var css_248z = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiBannerV2 {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: normal;\n box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.2509803922), 0px 0px 3px 0px rgba(0, 0, 0, 0.1490196078);\n font-size: 16px;\n display: grid;\n align-items: center;\n min-height: 3rem;\n position: relative;\n background-color: #ffffff;\n border-radius: 5px;\n padding-bottom: 0.5rem;\n padding-top: 0.5rem;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.LuiBannerV2 > :first-child {\n margin-top: 0;\n}\n.LuiBannerV2.has-level {\n padding-left: 3.25rem;\n border-left-width: 0.5rem;\n border-left-style: solid;\n}\n.LuiBannerV2.warning {\n border-left-color: #EA6A2E;\n}\n.LuiBannerV2.error {\n border-left-color: #cc0000;\n}\n.LuiBannerV2.info {\n border-left-color: #3A7CDF;\n}\n.LuiBannerV2.success {\n border-left-color: #0AA345;\n}\n.LuiBannerV2.can-dismiss {\n padding-right: 2.5rem;\n}\n.LuiBannerV2-Icon {\n position: absolute;\n left: 0.5rem;\n top: 0.5rem;\n}\n.LuiBannerV2-Icon.warning {\n color: #EA6A2E;\n}\n.LuiBannerV2-Icon.error {\n color: #cc0000;\n}\n.LuiBannerV2-Icon.info {\n color: #3A7CDF;\n}\n.LuiBannerV2-Icon.success {\n color: #0AA345;\n}\n.LuiBannerV2-Icon svg {\n fill: currentColor;\n}\n.LuiBannerV2-Dismiss {\n display: flex;\n position: absolute;\n right: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n background-color: transparent;\n padding: 0;\n}\n.LuiBannerV2-Dismiss svg {\n fill: #6b6966;\n}";
|
|
59359
|
-
styleInject(css_248z);
|
|
59187
|
+
var css_248z$2 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiBannerV2 {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: normal;\n box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.2509803922), 0px 0px 3px 0px rgba(0, 0, 0, 0.1490196078);\n font-size: 16px;\n display: grid;\n align-items: center;\n min-height: 3rem;\n position: relative;\n background-color: #ffffff;\n border-radius: 5px;\n padding-bottom: 0.5rem;\n padding-top: 0.5rem;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.LuiBannerV2 > :first-child {\n margin-top: 0;\n}\n.LuiBannerV2.has-level {\n padding-left: 3.25rem;\n border-left-width: 0.5rem;\n border-left-style: solid;\n}\n.LuiBannerV2.warning {\n border-left-color: #EA6A2E;\n}\n.LuiBannerV2.error {\n border-left-color: #cc0000;\n}\n.LuiBannerV2.info {\n border-left-color: #3A7CDF;\n}\n.LuiBannerV2.success {\n border-left-color: #0AA345;\n}\n.LuiBannerV2.can-dismiss {\n padding-right: 2.5rem;\n}\n.LuiBannerV2-Icon {\n position: absolute;\n left: 0.5rem;\n top: 0.5rem;\n}\n.LuiBannerV2-Icon.warning {\n color: #EA6A2E;\n}\n.LuiBannerV2-Icon.error {\n color: #cc0000;\n}\n.LuiBannerV2-Icon.info {\n color: #3A7CDF;\n}\n.LuiBannerV2-Icon.success {\n color: #0AA345;\n}\n.LuiBannerV2-Icon svg {\n fill: currentColor;\n}\n.LuiBannerV2-Dismiss {\n display: flex;\n position: absolute;\n right: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n background-color: transparent;\n padding: 0;\n}\n.LuiBannerV2-Dismiss svg {\n fill: #6b6966;\n}";
|
|
59188
|
+
styleInject(css_248z$2);
|
|
59360
59189
|
|
|
59361
59190
|
var LuiBannerV2 = forwardRef$1(function (_a, ref) {
|
|
59362
59191
|
var _b, _c, _d;
|
|
@@ -59375,5 +59204,461 @@ var LuiBannerV2 = forwardRef$1(function (_a, ref) {
|
|
|
59375
59204
|
onDismiss && (React__default.createElement("button", __assign({}, dismissButtonProps, { className: clsx('LuiBannerV2-Dismiss', dismissButtonProps === null || dismissButtonProps === void 0 ? void 0 : dismissButtonProps.className), "aria-label": (_b = dismissButtonProps === null || dismissButtonProps === void 0 ? void 0 : dismissButtonProps['aria-label']) !== null && _b !== void 0 ? _b : 'Dismiss', type: (_c = dismissButtonProps === null || dismissButtonProps === void 0 ? void 0 : dismissButtonProps.type) !== null && _c !== void 0 ? _c : 'button', onClick: onDismiss }), (_d = dismissButtonProps === null || dismissButtonProps === void 0 ? void 0 : dismissButtonProps.children) !== null && _d !== void 0 ? _d : (React__default.createElement(LuiIcon, { size: "md", name: "ic_clear", spanProps: { 'aria-hidden': true }, alt: "Dismiss" }))))));
|
|
59376
59205
|
});
|
|
59377
59206
|
|
|
59378
|
-
|
|
59207
|
+
var css_248z$1 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.ToastProvider {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n pointer-events: none;\n display: grid;\n grid-template-columns: repeat(3, auto);\n grid-template-areas: \"left center right\";\n padding: 1.5rem;\n z-index: 1200;\n}\n.ToastProvider .LuiBannerV2 {\n justify-content: flex-start;\n min-height: 4rem;\n min-width: 320px;\n max-width: min(50vw - 2rem, 400px);\n background-color: #f9f9f9;\n}\n.ToastProvider .LuiBannerV2-Icon {\n top: 50%;\n transform: translateY(-50%);\n}\n.ToastProvider .LuiBannerV2-Icon.warning {\n transform: translateY(calc(-50% - 1px));\n}\n.ToastProvider .LuiBannerV2 * {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: normal;\n font-weight: 400;\n}";
|
|
59208
|
+
styleInject(css_248z$1);
|
|
59209
|
+
|
|
59210
|
+
var topRightToastsHeight = function (portal) {
|
|
59211
|
+
var _a, _b, _c, _d;
|
|
59212
|
+
var toasts = (_b = (_a = portal.getElementsByClassName('topRight')[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll('[data-toastid]')) !== null && _b !== void 0 ? _b : [];
|
|
59213
|
+
var lastOne = toasts[toasts.length - 1];
|
|
59214
|
+
var rect = lastOne === null || lastOne === void 0 ? void 0 : lastOne.getBoundingClientRect();
|
|
59215
|
+
return ((_c = rect === null || rect === void 0 ? void 0 : rect.top) !== null && _c !== void 0 ? _c : 0) + ((_d = rect === null || rect === void 0 ? void 0 : rect.height) !== null && _d !== void 0 ? _d : 0);
|
|
59216
|
+
};
|
|
59217
|
+
var observer = function (portal) {
|
|
59218
|
+
return new MutationObserver(function () {
|
|
59219
|
+
var oldToasts = document === null || document === void 0 ? void 0 : document.querySelectorAll('.lui-msg-toast');
|
|
59220
|
+
if (oldToasts === null || oldToasts === void 0 ? void 0 : oldToasts.length) {
|
|
59221
|
+
var newTop_1 = Math.max(topRightToastsHeight(portal) - 24, 0);
|
|
59222
|
+
oldToasts.forEach(function (el) {
|
|
59223
|
+
var oldToast = el;
|
|
59224
|
+
var oldTop = parseInt(oldToast.style.top);
|
|
59225
|
+
if (newTop_1 !== oldTop) {
|
|
59226
|
+
oldToast.style.top = "".concat(newTop_1, "px");
|
|
59227
|
+
oldToast.style.transition = oldTop > newTop_1 ? 'top 0.2s ease-in' : '';
|
|
59228
|
+
}
|
|
59229
|
+
});
|
|
59230
|
+
}
|
|
59231
|
+
});
|
|
59232
|
+
};
|
|
59233
|
+
/**
|
|
59234
|
+
* Observes DOM changes in the elements tree to identify older toasts
|
|
59235
|
+
* that have been added to the page, to calculate a CSS top value so
|
|
59236
|
+
* that these are stacked below the new ones, if any.
|
|
59237
|
+
*/
|
|
59238
|
+
var observeOlderToasts = function (portal) {
|
|
59239
|
+
return observer(portal).observe(document.body, {
|
|
59240
|
+
childList: true,
|
|
59241
|
+
subtree: true
|
|
59242
|
+
});
|
|
59243
|
+
};
|
|
59244
|
+
|
|
59245
|
+
var portalId = 'lui-global-toast-container';
|
|
59246
|
+
/**
|
|
59247
|
+
* Retrieves the toast provider container element. It creates a new
|
|
59248
|
+
* one if it hasn't been created already.
|
|
59249
|
+
*
|
|
59250
|
+
* @description It is expected that application A, renders application B, that happens to render
|
|
59251
|
+
* the new toasts as well. In this case, application B will still render the context
|
|
59252
|
+
* provider to handle their toasts, but it will re-use the portal created by A.
|
|
59253
|
+
*
|
|
59254
|
+
* When the provider is created, it will observe older toasts coming to the screen
|
|
59255
|
+
* to make them visually align with the new ones. This needs to happens when the portal is
|
|
59256
|
+
* created, regardless of what app has created it.
|
|
59257
|
+
*
|
|
59258
|
+
* @returns HTMLDivElement
|
|
59259
|
+
*/
|
|
59260
|
+
var getToastProviderEl = function () {
|
|
59261
|
+
var portal = document.getElementById(portalId);
|
|
59262
|
+
if (portal) {
|
|
59263
|
+
return portal;
|
|
59264
|
+
}
|
|
59265
|
+
portal = document.createElement('div');
|
|
59266
|
+
portal.id = portalId;
|
|
59267
|
+
portal.className = 'ToastProvider';
|
|
59268
|
+
if (document.body.firstChild) {
|
|
59269
|
+
document.body.insertBefore(portal, document.body.firstChild);
|
|
59270
|
+
}
|
|
59271
|
+
else {
|
|
59272
|
+
document.body.appendChild(portal);
|
|
59273
|
+
}
|
|
59274
|
+
// Register the observer when the portal is created to visually align older toastd with new ones
|
|
59275
|
+
observeOlderToasts(portal);
|
|
59276
|
+
return portal;
|
|
59277
|
+
};
|
|
59278
|
+
|
|
59279
|
+
var css_248z = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.ToastSection {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n padding: 0.5rem;\n max-height: 100%;\n overflow-y: auto;\n overflow-x: hidden;\n /* IE and Edge */\n -ms-overflow-style: none;\n /* Firefox */\n scrollbar-width: none;\n /* Opera Safari Chrome */\n}\n.ToastSection::-webkit-scrollbar {\n display: none;\n}\n.ToastSection > :not(:last-child) {\n margin-bottom: 0.5rem;\n}\n.ToastSection [data-toastId] {\n pointer-events: all;\n}\n.ToastSection.topLeft {\n grid-area: left;\n}\n.ToastSection.topLeft [data-toastId] {\n margin-right: auto;\n max-height: 100vh;\n animation: 0.4s topLeftin forwards;\n}\n@keyframes topLeftin {\n 0% {\n opacity: 0;\n transform: translateX(-40%);\n }\n 100% {\n opacity: 1;\n transform: translate(0%);\n }\n}\n.ToastSection.topLeft [data-toastId].ItemDeleted {\n animation: 0.4s topLeftout forwards;\n}\n@keyframes topLeftout {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n transform: translateX(-40%);\n }\n 100% {\n opacity: 0;\n max-height: 0;\n margin-bottom: 0;\n }\n}\n.ToastSection.topCenter {\n grid-area: center;\n}\n.ToastSection.topCenter [data-toastId] {\n margin-left: auto;\n margin-right: auto;\n max-height: 100vh;\n animation: 0.4s topCenterin forwards;\n}\n@keyframes topCenterin {\n 0% {\n opacity: 0;\n transform: translateY(-40%);\n }\n 100% {\n opacity: 1;\n transform: translate(0%);\n }\n}\n.ToastSection.topCenter [data-toastId].ItemDeleted {\n animation: 0.4s topCenterout forwards;\n}\n@keyframes topCenterout {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n transform: translateY(-40%);\n }\n 100% {\n opacity: 0;\n max-height: 0;\n margin-bottom: 0;\n }\n}\n.ToastSection.topRight {\n grid-area: right;\n}\n.ToastSection.topRight [data-toastId] {\n margin-left: auto;\n max-height: 100vh;\n animation: 0.4s topRightin forwards;\n}\n@keyframes topRightin {\n 0% {\n opacity: 0;\n transform: translateX(40%);\n }\n 100% {\n opacity: 1;\n transform: translate(0%);\n }\n}\n.ToastSection.topRight [data-toastId].ItemDeleted {\n animation: 0.4s topRightout forwards;\n}\n@keyframes topRightout {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n transform: translateX(40%);\n }\n 100% {\n opacity: 0;\n max-height: 0;\n margin-bottom: 0;\n }\n}\n.ToastSection.bottomLeft {\n margin-right: auto;\n grid-area: left;\n margin-top: auto;\n}\n.ToastSection.bottomLeft [data-toastId] {\n animation: 0.4s bottomLeftin forwards;\n}\n@keyframes bottomLeftin {\n 0% {\n opacity: 0;\n max-height: 0;\n }\n 50% {\n max-height: 100vh;\n opacity: 0;\n transform: translateX(-40%);\n }\n 100% {\n opacity: 1;\n transform: translate(0%);\n }\n}\n.ToastSection.bottomLeft [data-toastId].ItemDeleted {\n animation: 0.4s bottomLeftout forwards;\n}\n@keyframes bottomLeftout {\n 0% {\n opacity: 1;\n max-height: 100vh;\n }\n 100% {\n opacity: 0;\n transform: translateX(-40%);\n }\n}\n.ToastSection.bottomCenter {\n grid-area: center;\n margin-top: auto;\n margin-left: auto;\n margin-right: auto;\n}\n.ToastSection.bottomCenter [data-toastId] {\n animation: 0.4s bottomCenterin forwards;\n}\n@keyframes bottomCenterin {\n 0% {\n opacity: 0;\n max-height: 0;\n }\n 50% {\n max-height: 100vh;\n opacity: 0;\n transform: translateY(40%);\n }\n 100% {\n opacity: 1;\n transform: translate(0%);\n }\n}\n.ToastSection.bottomCenter [data-toastId].ItemDeleted {\n animation: 0.4s bottomCenterout forwards;\n}\n@keyframes bottomCenterout {\n 0% {\n opacity: 1;\n max-height: 100vh;\n }\n 100% {\n opacity: 0;\n transform: translateY(-40%);\n }\n}\n.ToastSection.bottomRight {\n grid-area: right;\n margin-top: auto;\n}\n.ToastSection.bottomRight [data-toastId] {\n margin-left: auto;\n animation: 0.4s bottomRightin forwards;\n}\n@keyframes bottomRightin {\n 0% {\n opacity: 0;\n max-height: 0;\n }\n 50% {\n max-height: 100vh;\n opacity: 0;\n transform: translateX(40%);\n }\n 100% {\n opacity: 1;\n transform: translate(0%);\n }\n}\n.ToastSection.bottomRight [data-toastId].ItemDeleted {\n animation: 0.4s bottomRightout forwards;\n}\n@keyframes bottomRightout {\n 0% {\n opacity: 1;\n max-height: 100vh;\n }\n 100% {\n opacity: 0;\n transform: translateX(40%);\n }\n}";
|
|
59280
|
+
styleInject(css_248z);
|
|
59281
|
+
|
|
59282
|
+
var getToastSectionEl = function (position) {
|
|
59283
|
+
var portal = getToastProviderEl();
|
|
59284
|
+
var section = portal.getElementsByClassName(position)[0];
|
|
59285
|
+
if (section) {
|
|
59286
|
+
return section;
|
|
59287
|
+
}
|
|
59288
|
+
section = document.createElement('div');
|
|
59289
|
+
section.className = "ToastSection ".concat(position);
|
|
59290
|
+
portal.appendChild(section);
|
|
59291
|
+
return section;
|
|
59292
|
+
};
|
|
59293
|
+
var ToastSection = function (_a) {
|
|
59294
|
+
var position = _a.position, list = _a.list, remove = _a.remove, defaultTimeout = _a.defaultTimeout;
|
|
59295
|
+
var section = getToastSectionEl(position);
|
|
59296
|
+
var _b = useState(list), state = _b[0], setState = _b[1];
|
|
59297
|
+
useEffect(
|
|
59298
|
+
/**
|
|
59299
|
+
* Delay deletions from provider state. Add instead a 'ItemDeleted' class to the
|
|
59300
|
+
* toasts that are pending deletion to trigger an exiting animation.
|
|
59301
|
+
*
|
|
59302
|
+
* Because of this local copy of the global state, any toasts additions need to be
|
|
59303
|
+
* copied over in a useEffect as well.
|
|
59304
|
+
*/
|
|
59305
|
+
function delayToastsDeletionAndAddNewOnes() {
|
|
59306
|
+
var deleted = state
|
|
59307
|
+
.filter(function (s) { return !list.some(function (l) { return l.id === s.id; }); })
|
|
59308
|
+
.map(function (s) { return s.id; });
|
|
59309
|
+
var added = list.filter(function (l) { return !state.some(function (s) { return s.id === l.id; }); });
|
|
59310
|
+
deleted
|
|
59311
|
+
.map(function (id) { return section.querySelector("[data-toastid=\"".concat(id, "\"]")); })
|
|
59312
|
+
.forEach(function (deletedToast) { return deletedToast === null || deletedToast === void 0 ? void 0 : deletedToast.classList.add('ItemDeleted'); });
|
|
59313
|
+
if (added.length) {
|
|
59314
|
+
setState(function (prev) { return __spreadArray(__spreadArray([], prev, true), added, true); });
|
|
59315
|
+
}
|
|
59316
|
+
}, [list, state]);
|
|
59317
|
+
useEffect(
|
|
59318
|
+
/**
|
|
59319
|
+
* Capture toast updates to be copied to the local state
|
|
59320
|
+
*/
|
|
59321
|
+
function updateExistingToasts() {
|
|
59322
|
+
if (list.length === state.length) {
|
|
59323
|
+
var updated_1 = list.filter(function (l) {
|
|
59324
|
+
return state.find(function (s) { return s.id === l.id && s.updatedAt !== l.updatedAt; });
|
|
59325
|
+
});
|
|
59326
|
+
if (updated_1.length) {
|
|
59327
|
+
setState(function (prev) {
|
|
59328
|
+
return prev.map(function (p) { var _a; return (_a = updated_1.find(function (u) { return u.id === p.id; })) !== null && _a !== void 0 ? _a : p; });
|
|
59329
|
+
});
|
|
59330
|
+
}
|
|
59331
|
+
}
|
|
59332
|
+
}, [list, state]);
|
|
59333
|
+
useEffect(
|
|
59334
|
+
/**
|
|
59335
|
+
* Capture 'animationend' so that once a toast has left the page, it can
|
|
59336
|
+
* be cleared from the local state.
|
|
59337
|
+
*
|
|
59338
|
+
* @description It uses `addEventListener` in the section, because the
|
|
59339
|
+
* section portal may have been created by a parent App and not necessarily
|
|
59340
|
+
* the consumer application.
|
|
59341
|
+
*/
|
|
59342
|
+
function clearLocalStateAfterDeleteAnimationEnds() {
|
|
59343
|
+
var animationEnd = function (e) {
|
|
59344
|
+
var _a, _b, _c;
|
|
59345
|
+
var animatedToast = e.target;
|
|
59346
|
+
var animatedId = Number(animatedToast.getAttribute('data-toastid'));
|
|
59347
|
+
if (animatedToast.classList.contains('ItemDeleted')) {
|
|
59348
|
+
(_c = (_b = (_a = state
|
|
59349
|
+
.find(function (s) { return s.id === animatedId; })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.onLeave) === null || _c === void 0 ? void 0 : _c.call(_b, animatedId);
|
|
59350
|
+
setState(function (prev) { return prev.filter(function (t) { return t.id !== animatedId; }); });
|
|
59351
|
+
}
|
|
59352
|
+
};
|
|
59353
|
+
section.addEventListener('animationend', animationEnd);
|
|
59354
|
+
return function () { return section.removeEventListener('animationend', animationEnd); };
|
|
59355
|
+
}, [section, state]);
|
|
59356
|
+
return ReactDOM.createPortal(React.createElement(Fragment, { key: position }, state.map(function (toast) { return (React.createElement(Toast, __assign({ key: toast.id }, { toast: toast, remove: remove, defaultTimeout: defaultTimeout }))); })), section);
|
|
59357
|
+
};
|
|
59358
|
+
var Toast = function (props) {
|
|
59359
|
+
var _a, _b;
|
|
59360
|
+
var toast = props.toast, remove = props.remove, defaultTimeout = props.defaultTimeout;
|
|
59361
|
+
var close = useCallback(function () { return remove(toast.id); }, [remove, toast.id]);
|
|
59362
|
+
var ms = (_b = (_a = toast.options) === null || _a === void 0 ? void 0 : _a.timeout) !== null && _b !== void 0 ? _b : defaultTimeout;
|
|
59363
|
+
var shouldPersist = [
|
|
59364
|
+
NaN,
|
|
59365
|
+
Infinity,
|
|
59366
|
+
Number.MAX_SAFE_INTEGER,
|
|
59367
|
+
Number.MAX_VALUE,
|
|
59368
|
+
].includes(ms);
|
|
59369
|
+
useEffect(function () {
|
|
59370
|
+
if (!shouldPersist) {
|
|
59371
|
+
var timer_1 = setTimeout(close, ms);
|
|
59372
|
+
return function () { return clearTimeout(timer_1); };
|
|
59373
|
+
}
|
|
59374
|
+
return;
|
|
59375
|
+
}, [shouldPersist, ms, close]);
|
|
59376
|
+
return (React.createElement("div", { "data-toastid": toast.id }, typeof toast.notification === 'function'
|
|
59377
|
+
? toast.notification({ close: close })
|
|
59378
|
+
: toast.notification));
|
|
59379
|
+
};
|
|
59380
|
+
|
|
59381
|
+
var reducer = function (state, action) {
|
|
59382
|
+
var updatedAt = new Date().getTime();
|
|
59383
|
+
if (action.type === 'add') {
|
|
59384
|
+
var createdAt = updatedAt;
|
|
59385
|
+
var notification = action.notification, options = action.options, id = action.id;
|
|
59386
|
+
var toast = { notification: notification, options: options, id: id, updatedAt: updatedAt, createdAt: createdAt };
|
|
59387
|
+
var toasts = __spreadArray([toast], state.toasts, true);
|
|
59388
|
+
return trim(__assign(__assign({}, state), { toasts: toasts }));
|
|
59389
|
+
}
|
|
59390
|
+
if (action.type === 'remove') {
|
|
59391
|
+
return __assign(__assign({}, state), { toasts: state.toasts.filter(function (t) { return t.id !== action.id; }) });
|
|
59392
|
+
}
|
|
59393
|
+
if (action.type === 'update') {
|
|
59394
|
+
var notification = action.notification, options = action.options, id_1 = action.id;
|
|
59395
|
+
var updated_1 = { notification: notification, options: options, id: id_1, updatedAt: updatedAt };
|
|
59396
|
+
return __assign(__assign({}, state), { toasts: state.toasts.map(function (t) { return (t.id !== id_1 ? t : __assign(__assign({}, t), updated_1)); }) });
|
|
59397
|
+
}
|
|
59398
|
+
return state;
|
|
59399
|
+
};
|
|
59400
|
+
var useToastState = function (_a) {
|
|
59401
|
+
var stack = _a.stack;
|
|
59402
|
+
var _b = useReducer(reducer, {
|
|
59403
|
+
toasts: [],
|
|
59404
|
+
stack: stack
|
|
59405
|
+
}), state = _b[0], dispatch = _b[1];
|
|
59406
|
+
var toasts = group(state.toasts);
|
|
59407
|
+
return { toasts: toasts, dispatch: dispatch };
|
|
59408
|
+
};
|
|
59409
|
+
var group = function (list) {
|
|
59410
|
+
var initial = [];
|
|
59411
|
+
return list.reduce(function (res, item) {
|
|
59412
|
+
var _a;
|
|
59413
|
+
var _b, _c;
|
|
59414
|
+
var position = (_c = (_b = item === null || item === void 0 ? void 0 : item.options) === null || _b === void 0 ? void 0 : _b.position) !== null && _c !== void 0 ? _c : 'topRight';
|
|
59415
|
+
return __assign(__assign({}, res), (_a = {}, _a[position] = __spreadArray(__spreadArray([], res[position], true), [item], false), _a));
|
|
59416
|
+
}, {
|
|
59417
|
+
topLeft: initial,
|
|
59418
|
+
topCenter: initial,
|
|
59419
|
+
topRight: initial,
|
|
59420
|
+
bottomLeft: initial,
|
|
59421
|
+
bottomCenter: initial,
|
|
59422
|
+
bottomRight: initial
|
|
59423
|
+
});
|
|
59424
|
+
};
|
|
59425
|
+
var trim = function (state) { return (__assign(__assign({}, state), { toasts: Object.values(group(state.toasts))
|
|
59426
|
+
.map(function (toasts) {
|
|
59427
|
+
return toasts
|
|
59428
|
+
.sort(function (a, b) { return (a.createdAt > b.createdAt ? -1 : 1); })
|
|
59429
|
+
.slice(0, state.stack);
|
|
59430
|
+
})
|
|
59431
|
+
.flat() })); };
|
|
59432
|
+
|
|
59433
|
+
var ToastContext = React.createContext(undefined);
|
|
59434
|
+
var portal = getToastProviderEl();
|
|
59435
|
+
var ToastProvider = function (_a) {
|
|
59436
|
+
var children = _a.children, _b = _a.defaultTimeout, defaultTimeout = _b === void 0 ? 4000 : _b, _c = _a.stack, stack = _c === void 0 ? 5 : _c;
|
|
59437
|
+
var _d = useToastState({ stack: stack }), toasts = _d.toasts, dispatch = _d.dispatch;
|
|
59438
|
+
var remove = useCallback(function (id) { return dispatch({ type: 'remove', id: id }); }, [dispatch]);
|
|
59439
|
+
if (useContext(ToastContext)) {
|
|
59440
|
+
return React.createElement(React.Fragment, null, children);
|
|
59441
|
+
}
|
|
59442
|
+
return (React.createElement(React.Fragment, null,
|
|
59443
|
+
ReactDOM.createPortal(React.createElement(React.Fragment, null, Object.entries(toasts).map(function (_a) {
|
|
59444
|
+
var section = _a[0], list = _a[1];
|
|
59445
|
+
return (React.createElement(ToastSection, __assign({ key: section }, {
|
|
59446
|
+
position: section,
|
|
59447
|
+
list: list,
|
|
59448
|
+
remove: remove,
|
|
59449
|
+
defaultTimeout: defaultTimeout
|
|
59450
|
+
})));
|
|
59451
|
+
})), portal),
|
|
59452
|
+
React.createElement(ToastContext.Provider, { value: dispatch }, children)));
|
|
59453
|
+
};
|
|
59454
|
+
|
|
59455
|
+
var getUniqueToastId = function () { return Math.floor(Math.random() * 10000); };
|
|
59456
|
+
var toastFunctions = function (dispatch) {
|
|
59457
|
+
var toast = function (notification, options) {
|
|
59458
|
+
var id = getUniqueToastId();
|
|
59459
|
+
dispatch === null || dispatch === void 0 ? void 0 : dispatch({ type: 'add', notification: notification, options: options, id: id });
|
|
59460
|
+
return id;
|
|
59461
|
+
};
|
|
59462
|
+
var update = function (id, notification, options) {
|
|
59463
|
+
dispatch === null || dispatch === void 0 ? void 0 : dispatch({ type: 'update', notification: notification, options: options, id: id });
|
|
59464
|
+
return id;
|
|
59465
|
+
};
|
|
59466
|
+
var banner = function (level, defaults) {
|
|
59467
|
+
if (defaults === void 0) { defaults = {}; }
|
|
59468
|
+
return function (children, options) {
|
|
59469
|
+
if (options === void 0) { options = defaults; }
|
|
59470
|
+
return toast(function (_a) {
|
|
59471
|
+
var close = _a.close;
|
|
59472
|
+
return (React.createElement(LuiBannerV2, __assign({}, { level: level, children: children }, { onDismiss: options.timeout === Infinity ? close : undefined })));
|
|
59473
|
+
}, options);
|
|
59474
|
+
};
|
|
59475
|
+
};
|
|
59476
|
+
return {
|
|
59477
|
+
toast: toast,
|
|
59478
|
+
update: update,
|
|
59479
|
+
dismiss: function (id) { return dispatch === null || dispatch === void 0 ? void 0 : dispatch({ type: 'remove', id: id }); },
|
|
59480
|
+
info: banner('info'),
|
|
59481
|
+
success: banner('success'),
|
|
59482
|
+
error: banner('error', { timeout: Infinity }),
|
|
59483
|
+
warning: banner('warning', { timeout: Infinity }),
|
|
59484
|
+
plain: banner()
|
|
59485
|
+
};
|
|
59486
|
+
};
|
|
59487
|
+
var useToast = function () {
|
|
59488
|
+
var dispatch = useContext(ToastContext);
|
|
59489
|
+
return useMemo(function () { return toastFunctions(dispatch); }, [dispatch]);
|
|
59490
|
+
};
|
|
59491
|
+
|
|
59492
|
+
var LuiToastMessage$1 = function (_a) {
|
|
59493
|
+
var level = _a.level, _b = _a.displayTimeout, displayTimeout = _b === void 0 ? 4000 : _b, _c = _a.display, display = _c === void 0 ? true : _c, requireDismiss = _a.requireDismiss, onClose = _a.onClose, _d = _a.onCloseDelay, onCloseDelay = _d === void 0 ? displayTimeout : _d, children = _a.children, type = _a.type;
|
|
59494
|
+
var _e = useState('lui-msg-toast-show'), className = _e[0], setClassname = _e[1];
|
|
59495
|
+
var _f = useState(undefined), fadeOutTimer = _f[0], setFadeOutTimer = _f[1];
|
|
59496
|
+
var _g = useState(undefined), removeTimer = _g[0], setRemoveTimer = _g[1];
|
|
59497
|
+
var materialIcon = getMaterialIconForLevel(level);
|
|
59498
|
+
var callOnCloseAfterDissolved = function () {
|
|
59499
|
+
// This is so the caller can remove it from the dom
|
|
59500
|
+
if (onClose) {
|
|
59501
|
+
var timer = window.setTimeout(onClose, onCloseDelay);
|
|
59502
|
+
setRemoveTimer(timer);
|
|
59503
|
+
}
|
|
59504
|
+
};
|
|
59505
|
+
useEffect(function () {
|
|
59506
|
+
// clear timers if previously set
|
|
59507
|
+
fadeOutTimer && clearTimeout(fadeOutTimer);
|
|
59508
|
+
removeTimer && clearTimeout(removeTimer);
|
|
59509
|
+
setClassname('lui-msg-toast-show');
|
|
59510
|
+
if (!requireDismiss && displayTimeout !== 0) {
|
|
59511
|
+
// set a new timer
|
|
59512
|
+
var timer = window.setTimeout(function () {
|
|
59513
|
+
setClassname('lui-msg-toast-hide');
|
|
59514
|
+
callOnCloseAfterDissolved();
|
|
59515
|
+
}, displayTimeout);
|
|
59516
|
+
setFadeOutTimer(timer);
|
|
59517
|
+
}
|
|
59518
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59519
|
+
}, [requireDismiss, displayTimeout, children]);
|
|
59520
|
+
useEffect(function () {
|
|
59521
|
+
if (!display) {
|
|
59522
|
+
setClassname('lui-msg-toast-hide');
|
|
59523
|
+
callOnCloseAfterDissolved();
|
|
59524
|
+
}
|
|
59525
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59526
|
+
}, [display]);
|
|
59527
|
+
return (React__default.createElement("div", { role: "status", "data-testid": className, className: "lui-msg-".concat(level, " lui-msg-toast lui-msg-toast-dismissable ").concat(className) },
|
|
59528
|
+
React__default.createElement("i", { className: "lui-msg-status-icon material-icons-round" }, materialIcon),
|
|
59529
|
+
children,
|
|
59530
|
+
React__default.createElement("button", { "aria-label": "Close dialog", type: type || 'button', onClick: function () {
|
|
59531
|
+
setClassname('lui-msg-toast-hide');
|
|
59532
|
+
callOnCloseAfterDissolved();
|
|
59533
|
+
} },
|
|
59534
|
+
React__default.createElement("i", { className: "material-icons-round" }, "close"))));
|
|
59535
|
+
};
|
|
59536
|
+
|
|
59537
|
+
var UIMessagingContext = createContext({
|
|
59538
|
+
// @ts-ignore
|
|
59539
|
+
showMessage: function (props) { }
|
|
59540
|
+
});
|
|
59541
|
+
function useShowLUIMessage$1() {
|
|
59542
|
+
return useContext(UIMessagingContext).showMessage;
|
|
59543
|
+
}
|
|
59544
|
+
var LuiMessagingContextProvider$1 = function (props) {
|
|
59545
|
+
var _a = useState(), _message = _a[0], setMessage = _a[1];
|
|
59546
|
+
var _b = useState(), _messageType = _b[0], setMessageType = _b[1];
|
|
59547
|
+
var _c = useState('success'), _messageLevel = _c[0], setMessageLevel = _c[1];
|
|
59548
|
+
var _d = useState(true), _requireDismiss = _d[0], setRequireDismiss = _d[1];
|
|
59549
|
+
var showMessage = function (props) {
|
|
59550
|
+
setMessage(props.message);
|
|
59551
|
+
setMessageType(props.messageType);
|
|
59552
|
+
setMessageLevel(props.messageLevel);
|
|
59553
|
+
setRequireDismiss(props.requireDismiss === undefined
|
|
59554
|
+
? props.messageLevel === 'error'
|
|
59555
|
+
: props.requireDismiss);
|
|
59556
|
+
};
|
|
59557
|
+
var renderMessage = function () {
|
|
59558
|
+
switch (_messageType) {
|
|
59559
|
+
case 'toast':
|
|
59560
|
+
return (React__default.createElement(LuiToastMessage$1, { onClose: function () {
|
|
59561
|
+
setMessage(undefined);
|
|
59562
|
+
}, level: _messageLevel, requireDismiss: _requireDismiss },
|
|
59563
|
+
React__default.createElement("span", { "data-testid": 'toastMessageShow' }, typeof _message === 'string' ? React__default.createElement("h2", null, _message) : _message)));
|
|
59564
|
+
default:
|
|
59565
|
+
return null;
|
|
59566
|
+
}
|
|
59567
|
+
};
|
|
59568
|
+
return (React__default.createElement(UIMessagingContext.Provider, { value: { showMessage: showMessage } },
|
|
59569
|
+
_message && renderMessage(),
|
|
59570
|
+
props.children));
|
|
59571
|
+
};
|
|
59572
|
+
|
|
59573
|
+
var LuiToastMessageCompatibleInterface = function (props) {
|
|
59574
|
+
var level = props.level, _a = props.displayTimeout, displayTimeout = _a === void 0 ? 4000 : _a, _b = props.display, display = _b === void 0 ? true : _b, requireDismiss = props.requireDismiss, onClose = props.onClose, children = props.children;
|
|
59575
|
+
var toastIdRef = useRef(undefined);
|
|
59576
|
+
var onceDismissedRef = useRef(false);
|
|
59577
|
+
var displayRef = useRef(display);
|
|
59578
|
+
var _c = useToast(), toast = _c.toast, dismiss = _c.dismiss, update = _c.update;
|
|
59579
|
+
displayRef.current = display;
|
|
59580
|
+
// Close when it's unmounted
|
|
59581
|
+
useEffect(function () {
|
|
59582
|
+
return function () {
|
|
59583
|
+
if (toastIdRef.current) {
|
|
59584
|
+
dismiss(toastIdRef.current);
|
|
59585
|
+
toastIdRef.current = undefined;
|
|
59586
|
+
}
|
|
59587
|
+
};
|
|
59588
|
+
}, []);
|
|
59589
|
+
useEffect(function () {
|
|
59590
|
+
var onceDismissed = onceDismissedRef.current;
|
|
59591
|
+
if (display && !onceDismissed) {
|
|
59592
|
+
var notification = function (_a) {
|
|
59593
|
+
var close = _a.close;
|
|
59594
|
+
var onDismiss = requireDismiss ? close : undefined;
|
|
59595
|
+
return React__default.createElement(LuiBannerV2, __assign({}, { level: level, onDismiss: onDismiss, children: children }));
|
|
59596
|
+
};
|
|
59597
|
+
var options = {
|
|
59598
|
+
timeout: displayTimeout === 0 ? Infinity : displayTimeout,
|
|
59599
|
+
onLeave: function () {
|
|
59600
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
59601
|
+
onceDismissedRef.current = displayRef.current;
|
|
59602
|
+
toastIdRef.current = undefined;
|
|
59603
|
+
}
|
|
59604
|
+
};
|
|
59605
|
+
if (!toastIdRef.current) {
|
|
59606
|
+
toastIdRef.current = toast(notification, options);
|
|
59607
|
+
}
|
|
59608
|
+
else {
|
|
59609
|
+
update(toastIdRef.current, notification, options);
|
|
59610
|
+
}
|
|
59611
|
+
}
|
|
59612
|
+
if (!display && toastIdRef.current !== undefined) {
|
|
59613
|
+
dismiss(toastIdRef.current);
|
|
59614
|
+
toastIdRef.current = undefined;
|
|
59615
|
+
}
|
|
59616
|
+
}, [props]);
|
|
59617
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
59618
|
+
};
|
|
59619
|
+
|
|
59620
|
+
/**
|
|
59621
|
+
* Provide new toast hook with old interface from original useShowLUIMessage
|
|
59622
|
+
*/
|
|
59623
|
+
var useShowLUIMessageCompatibleInterface = function () {
|
|
59624
|
+
var toast = useToast().toast;
|
|
59625
|
+
return function (props) {
|
|
59626
|
+
var message = props.message, messageLevel = props.messageLevel, requireDismiss = props.requireDismiss;
|
|
59627
|
+
var toastProps = { children: message, level: messageLevel };
|
|
59628
|
+
if (requireDismiss || messageLevel === 'error') {
|
|
59629
|
+
toast(function (_a) {
|
|
59630
|
+
var close = _a.close;
|
|
59631
|
+
return React__default.createElement(LuiBannerV2, __assign({}, toastProps, { onDismiss: close }));
|
|
59632
|
+
});
|
|
59633
|
+
}
|
|
59634
|
+
else {
|
|
59635
|
+
toast(React__default.createElement(LuiBannerV2, __assign({}, toastProps)));
|
|
59636
|
+
}
|
|
59637
|
+
};
|
|
59638
|
+
};
|
|
59639
|
+
|
|
59640
|
+
var ToastUpgrade = createContext(false);
|
|
59641
|
+
var useToastUpgrade = function () { return useContext(ToastUpgrade); };
|
|
59642
|
+
/**
|
|
59643
|
+
* @deprecated Use ToastProvider or LuiMessagingContextProvider with upgrade prop set to true to get the new designs
|
|
59644
|
+
*/
|
|
59645
|
+
var LuiMessagingContextProvider = function (props) {
|
|
59646
|
+
var _a = props.upgrade, upgrade = _a === void 0 ? false : _a, rest = __rest(props, ["upgrade"]);
|
|
59647
|
+
if (useContext(ToastContext)) {
|
|
59648
|
+
return React__default.createElement(React__default.Fragment, null, rest.children);
|
|
59649
|
+
}
|
|
59650
|
+
return (React__default.createElement(ToastUpgrade.Provider, { value: upgrade }, upgrade ? (React__default.createElement(ToastProvider, __assign({}, rest))) : (React__default.createElement(LuiMessagingContextProvider$1, __assign({}, rest)))));
|
|
59651
|
+
};
|
|
59652
|
+
var useShowLUIMessage = function () {
|
|
59653
|
+
var upgrade = useToastUpgrade();
|
|
59654
|
+
var older = useShowLUIMessage$1();
|
|
59655
|
+
var newer = useShowLUIMessageCompatibleInterface();
|
|
59656
|
+
return upgrade ? newer : older;
|
|
59657
|
+
};
|
|
59658
|
+
var LuiToastMessage = function (props) {
|
|
59659
|
+
var upgrade = useToastUpgrade();
|
|
59660
|
+
return upgrade ? (React__default.createElement(LuiToastMessageCompatibleInterface, __assign({}, props))) : (React__default.createElement(LuiToastMessage$1, __assign({}, props)));
|
|
59661
|
+
};
|
|
59662
|
+
|
|
59663
|
+
export { CheckboxItemRenderer, LUI_WINDOW_NAME, LuiAccordicard, LuiAccordicardStatic, LuiAccordion, LuiAlertModal, LuiAlertModalButtons, LuiAppFooterSml, LuiBadge, LuiBanner, LuiBannerContent, LuiBannerV2, LuiBearingInput, LuiButton, LuiButtonGroup, LuiCheckboxInput, LuiCloseableHeaderMenuContext, LuiCloseableHeaderMenuContextV2, LuiCloseableHeaderMenuItem, LuiCloseableHeaderMenuItemV2, LuiComboSelect, LuiControlledMenu, LuiCounter, LuiDateInput, LuiDrawerMenu, LuiDrawerMenuDivider, LuiDrawerMenuDividerV2, LuiDrawerMenuOption, LuiDrawerMenuOptionV2, LuiDrawerMenuOptions, LuiDrawerMenuOptionsV2, LuiDrawerMenuSection, LuiDrawerMenuSectionV2, LuiDrawerMenuV2, LuiDropdownMenu, LuiDropdownMenuV2, LuiDropdownMenuV2DropContent, LuiErrorIllustration, LuiErrorPage, LuiExpandableBanner, LuiFileInputBox, LuiFilterContainer, LuiFilterMenu, LuiFloatingWindow, $F as LuiFloatingWindowContextProvider, LuiFooter, LuiFormSectionHeader, LuiHeader, LuiHeaderMenuItem, LuiHeaderMenuItemV2, LuiHeaderV2, LuiIcon, LuiListBox, LuiLoadingSpinner, LuiMenu, LuiMenuCloseButton, LuiMenuCloseButtonV2, LuiMessagingContextProvider, LuiMiniSpinner, LuiModal, LuiMoneyInput, LuiMultiSwitch, LuiMultiSwitchYesNo, LuiPagination, LuiProgressBar, LuiRadioInput, LuiResizableLayout, LuiSearchBox, LuiSearchInput, LuiSelectDataMenu, LuiSelectInput, LuiSelectMenu, LuiSelectMenuItem, LuiSelectMenuItemSwitch, LuiSelectSubMenuItem, LuiShadow, LuiSideMenu, LuiSideMenuItem, LuiSidePanel, LuiSidePanelProvider, LuiSideToolbar, LuiSplitButton, LuiSplitButtonMenuItem, LuiSplitButtonPosition, LuiStaticMessage, LuiStatusSpinner, LuiSwitchButton, LuiTab, LuiTabs, LuiTabsContext, LuiTabsGroup, LuiTabsPanel, LuiTabsPanelSwitch, LuiTextAreaInput, LuiTextInput, LuiToastMessage, LuiTooltip, LuiUpdatesSplashModal, RadioItemRenderer, SplitPanelState, Splitter, ToastProvider, ToolbarButton, ToolbarDirection, ToolbarItem, ToolbarItemSeparator, breakpointQuery, breakpoints, isChromatic, useClickedOutsideElement, useEscapeFunction, useLuiCloseableHeaderMenuContextV2, lR as useLuiFloatingWindow, useMediaQuery, usePageClickFunction, useShowLUIMessage, useSplitterRef, useToast };
|
|
59379
59664
|
//# sourceMappingURL=lui.esm.js.map
|