@linzjs/lui 17.30.0 → 17.32.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 +15 -0
- package/README.md +4 -3
- package/dist/components/LuiHeader/LuiHeader.d.ts +8 -0
- package/dist/components/LuiHeaderMenu/LuiHeaderMenus.d.ts +12 -0
- package/dist/components/LuiHeaderMenuV2/LuiHeaderMenusV2.d.ts +73 -0
- package/dist/components/LuiHeaderV2/LuiHeaderV2.d.ts +20 -0
- package/dist/components/LuiIcon/LuiIcon.d.ts +2 -1
- package/dist/components/LuiUpdateSplashModal/LuiUpdatesSplashModal.d.ts +8 -4
- package/dist/components/common/StorybookSupport.d.ts +1 -1
- package/dist/components/common/UseMediaQuery.d.ts +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +588 -145
- package/dist/index.js.map +1 -1
- package/dist/lui.css +361 -0
- package/dist/lui.css.map +1 -1
- package/dist/lui.esm.js +577 -146
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/Components/HeaderV2/header-v2.scss +242 -0
- package/dist/scss/Components/LuiUpdateSplashModal/splashModal.scss +23 -0
- package/dist/scss/Components/MenuV2/menu-v2.scss +172 -0
- package/dist/scss/base.scss +3 -0
- package/package.json +11 -6
package/dist/lui.esm.js
CHANGED
|
@@ -520,13 +520,14 @@ var ICON_STATUS = {
|
|
|
520
520
|
disabled: 'LuiIcon--disabled'
|
|
521
521
|
};
|
|
522
522
|
var LuiIcon = function (_a) {
|
|
523
|
-
var name = _a.name, className = _a.className, _b = _a.size, size = _b === void 0 ? 'ns' : _b, title = _a.title, alt = _a.alt, _c = _a.status, status = _c === void 0 ? 'none' : _c, spanProps = _a.spanProps;
|
|
523
|
+
var name = _a.name, className = _a.className, _b = _a.size, size = _b === void 0 ? 'ns' : _b, title = _a.title, alt = _a.alt, _c = _a.status, status = _c === void 0 ? 'none' : _c, spanProps = _a.spanProps, color = _a.color;
|
|
524
524
|
var iconSVG = ICONS[name];
|
|
525
525
|
if (!iconSVG) {
|
|
526
526
|
console.warn("<LuiIcon>: No icon found for: ".concat(iconSVG));
|
|
527
527
|
return null;
|
|
528
528
|
}
|
|
529
|
-
|
|
529
|
+
var customStyle = color ? { fill: color } : {};
|
|
530
|
+
return (React$1.createElement("span", __assign$3({ className: clsx$1('LuiIcon', className, size && ICON_SIZES[size], status && ICON_STATUS[status]), "data-icon": name, title: title, "aria-label": alt }, spanProps, { style: customStyle }), iconSVG));
|
|
530
531
|
};
|
|
531
532
|
|
|
532
533
|
function getMaterialIconForLevel(level) {
|
|
@@ -7713,12 +7714,12 @@ function findDOMNode(draggable) {
|
|
|
7713
7714
|
return node2;
|
|
7714
7715
|
}
|
|
7715
7716
|
var DraggableCore$2 = {};
|
|
7716
|
-
var log$1 = {};
|
|
7717
|
-
Object.defineProperty(log$1, "__esModule", {
|
|
7717
|
+
var log$1$1 = {};
|
|
7718
|
+
Object.defineProperty(log$1$1, "__esModule", {
|
|
7718
7719
|
value: true
|
|
7719
7720
|
});
|
|
7720
|
-
log$1.default = log;
|
|
7721
|
-
function log() {
|
|
7721
|
+
log$1$1.default = log$5;
|
|
7722
|
+
function log$5() {
|
|
7722
7723
|
}
|
|
7723
7724
|
function _typeof$2(obj) {
|
|
7724
7725
|
"@babel/helpers - typeof";
|
|
@@ -7743,7 +7744,7 @@ var _reactDom$1 = _interopRequireDefault$5(reactDom.exports);
|
|
|
7743
7744
|
var _domFns = domFns;
|
|
7744
7745
|
var _positionFns = positionFns;
|
|
7745
7746
|
var _shims = shims;
|
|
7746
|
-
var _log = _interopRequireDefault$5(log$1);
|
|
7747
|
+
var _log = _interopRequireDefault$5(log$1$1);
|
|
7747
7748
|
function _interopRequireDefault$5(obj) {
|
|
7748
7749
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
7749
7750
|
}
|
|
@@ -7844,7 +7845,7 @@ function _arrayWithHoles$1(arr) {
|
|
|
7844
7845
|
if (Array.isArray(arr))
|
|
7845
7846
|
return arr;
|
|
7846
7847
|
}
|
|
7847
|
-
function _classCallCheck$
|
|
7848
|
+
function _classCallCheck$3(instance, Constructor) {
|
|
7848
7849
|
if (!(instance instanceof Constructor)) {
|
|
7849
7850
|
throw new TypeError("Cannot call a class as a function");
|
|
7850
7851
|
}
|
|
@@ -7955,7 +7956,7 @@ var DraggableCore$1 = /* @__PURE__ */ function(_React$Component) {
|
|
|
7955
7956
|
var _super = _createSuper$1(DraggableCore2);
|
|
7956
7957
|
function DraggableCore2() {
|
|
7957
7958
|
var _this;
|
|
7958
|
-
_classCallCheck$
|
|
7959
|
+
_classCallCheck$3(this, DraggableCore2);
|
|
7959
7960
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
7960
7961
|
args[_key] = arguments[_key];
|
|
7961
7962
|
}
|
|
@@ -8201,7 +8202,7 @@ _defineProperty$2(DraggableCore$1, "defaultProps", {
|
|
|
8201
8202
|
var _positionFns2 = positionFns;
|
|
8202
8203
|
var _shims2 = shims;
|
|
8203
8204
|
var _DraggableCore = _interopRequireDefault2(DraggableCore$2);
|
|
8204
|
-
var _log2 = _interopRequireDefault2(log$1);
|
|
8205
|
+
var _log2 = _interopRequireDefault2(log$1$1);
|
|
8205
8206
|
var _excluded = ["axis", "bounds", "children", "defaultPosition", "defaultClassName", "defaultClassNameDragging", "defaultClassNameDragged", "position", "positionOffset", "scale"];
|
|
8206
8207
|
function _interopRequireDefault2(obj) {
|
|
8207
8208
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
@@ -18907,7 +18908,7 @@ function _typeof(obj) {
|
|
|
18907
18908
|
}, _typeof(obj);
|
|
18908
18909
|
}
|
|
18909
18910
|
|
|
18910
|
-
function _classCallCheck$
|
|
18911
|
+
function _classCallCheck$2(instance, Constructor) {
|
|
18911
18912
|
if (!(instance instanceof Constructor)) {
|
|
18912
18913
|
throw new TypeError("Cannot call a class as a function");
|
|
18913
18914
|
}
|
|
@@ -19536,7 +19537,7 @@ var MenuPlacer = /*#__PURE__*/function (_Component) {
|
|
|
19536
19537
|
function MenuPlacer() {
|
|
19537
19538
|
var _this;
|
|
19538
19539
|
|
|
19539
|
-
_classCallCheck$
|
|
19540
|
+
_classCallCheck$2(this, MenuPlacer);
|
|
19540
19541
|
|
|
19541
19542
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19542
19543
|
args[_key] = arguments[_key];
|
|
@@ -19724,7 +19725,7 @@ var MenuPortal = /*#__PURE__*/function (_Component2) {
|
|
|
19724
19725
|
function MenuPortal() {
|
|
19725
19726
|
var _this2;
|
|
19726
19727
|
|
|
19727
|
-
_classCallCheck$
|
|
19728
|
+
_classCallCheck$2(this, MenuPortal);
|
|
19728
19729
|
|
|
19729
19730
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
19730
19731
|
args[_key2] = arguments[_key2];
|
|
@@ -21729,7 +21730,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
21729
21730
|
function Select(_props) {
|
|
21730
21731
|
var _this;
|
|
21731
21732
|
|
|
21732
|
-
_classCallCheck$
|
|
21733
|
+
_classCallCheck$2(this, Select);
|
|
21733
21734
|
|
|
21734
21735
|
_this = _super.call(this, _props);
|
|
21735
21736
|
_this.state = {
|
|
@@ -40091,8 +40092,12 @@ var buildHideClassDict = function (_a) {
|
|
|
40091
40092
|
};
|
|
40092
40093
|
};
|
|
40093
40094
|
|
|
40095
|
+
/**
|
|
40096
|
+
* @deprecated: this is replaced by LuiHeaderV2
|
|
40097
|
+
*/
|
|
40094
40098
|
var LuiHeader = function (_a) {
|
|
40095
40099
|
var headingText = _a.headingText, _b = _a.size, size = _b === void 0 ? 'small' : _b, homeLink = _a.homeLink, transparent = _a.transparent, children = _a.children, _c = _a.sticky, sticky = _c === void 0 ? true : _c;
|
|
40100
|
+
useDeprecatedWarning('LuiHeader');
|
|
40096
40101
|
var logoElement = size === 'normal' ? (React__default.createElement("img", { className: "linz-logo", alt: "LINZ Logo", src: logo })) : (React__default.createElement("img", { className: "linz-motif", alt: "LINZ Logo", src: motif }));
|
|
40097
40102
|
var logoContainer = logoElement;
|
|
40098
40103
|
if (typeof homeLink === 'string') {
|
|
@@ -40117,12 +40122,15 @@ var LuiHeader = function (_a) {
|
|
|
40117
40122
|
React__default.createElement("div", { className: "lui-header-col" }, children))));
|
|
40118
40123
|
};
|
|
40119
40124
|
/**
|
|
40125
|
+
* @deprecated: this is replaced by LuiHeaderMenuItemV2
|
|
40126
|
+
*
|
|
40120
40127
|
* The \`LuiHeaderMenuItem\` is the base component for all menu items that are to be shown in the header.
|
|
40121
40128
|
* Note that it depends on it being rendered inside a LuiHeader for its styles to apply properly.
|
|
40122
40129
|
* To configure the item for responsiveness, ensure to set any of the hideOn* properties.
|
|
40123
40130
|
*/
|
|
40124
40131
|
var LuiHeaderMenuItem = forwardRef(function (_a, ref) {
|
|
40125
40132
|
var icon = _a.icon, label = _a.label, badge = _a.badge, hide = _a.hide, onClick = _a.onClick, _b = _a["data-testid"], dataTestId = _b === void 0 ? 'menu-item' : _b, children = _a.children;
|
|
40133
|
+
useDeprecatedWarning('LuiHeaderMenuItem');
|
|
40126
40134
|
var menuItemClasses = clsx$1('lui-header-menu-item', hide && buildHideClassDict(hide));
|
|
40127
40135
|
var resolvedIcon = !icon && !label ? 'menu' : icon;
|
|
40128
40136
|
return (React__default.createElement("div", { className: menuItemClasses, ref: ref },
|
|
@@ -40137,8 +40145,12 @@ var LuiCloseableHeaderMenuContext = createContext({
|
|
|
40137
40145
|
open: function () { },
|
|
40138
40146
|
close: function () { }
|
|
40139
40147
|
});
|
|
40148
|
+
/**
|
|
40149
|
+
* @deprecated replaced by LuiCloseableHeaderMenuItemV2
|
|
40150
|
+
*/
|
|
40140
40151
|
var LuiCloseableHeaderMenuItem = function (_a) {
|
|
40141
40152
|
var open = _a.open, setOpen = _a.setOpen, props = __rest$1(_a, ["open", "setOpen"]);
|
|
40153
|
+
useDeprecatedWarning('LuiCloseableHeaderMenuItem');
|
|
40142
40154
|
useEscapeFunction(function () { return setOpen(false); });
|
|
40143
40155
|
var menuDiv = usePageClickFunction(function (event) { return open || event.stopPropagation(); }, function (event) {
|
|
40144
40156
|
if (!open) {
|
|
@@ -40162,12 +40174,77 @@ var LuiMenuCloseButton = function (_a) {
|
|
|
40162
40174
|
return (React__default.createElement("i", { className: classes, onClick: menu.close, "data-testid": dataTestId }, icon));
|
|
40163
40175
|
};
|
|
40164
40176
|
|
|
40177
|
+
var LuiHeaderV2 = function (_a) {
|
|
40178
|
+
var headingText = _a.headingText, _b = _a.size, size = _b === void 0 ? 'small' : _b, homeLink = _a.homeLink, transparent = _a.transparent, children = _a.children, _c = _a.sticky, sticky = _c === void 0 ? true : _c, appMenu = _a.appMenu;
|
|
40179
|
+
var logoElement = size === 'normal' ? (React__default.createElement("img", { className: "LuiHeaderV2-linz-logo", alt: "LINZ Logo", src: logo })) : (React__default.createElement("img", { className: "LuiHeaderV2-linz-motif", alt: "LINZ Logo", src: motif }));
|
|
40180
|
+
var logoContainer = logoElement;
|
|
40181
|
+
if (typeof homeLink === 'string') {
|
|
40182
|
+
logoContainer = React__default.createElement("a", { href: homeLink }, logoElement);
|
|
40183
|
+
}
|
|
40184
|
+
else if (typeof homeLink === 'function') {
|
|
40185
|
+
logoContainer = (React__default.createElement("div", { className: "clickable", onClick: function () {
|
|
40186
|
+
homeLink();
|
|
40187
|
+
} }, logoElement));
|
|
40188
|
+
}
|
|
40189
|
+
return (React__default.createElement("header", { className: clsx$1({
|
|
40190
|
+
LuiHeaderV2: true,
|
|
40191
|
+
'LuiHeaderV2-transparent': transparent,
|
|
40192
|
+
'LuiHeaderV2-small': size === 'small',
|
|
40193
|
+
'LuiHeaderV2-sticky': sticky
|
|
40194
|
+
}) },
|
|
40195
|
+
React__default.createElement("div", { className: "LuiHeaderV2-row" },
|
|
40196
|
+
React__default.createElement("div", { className: "LuiHeaderV2-col" },
|
|
40197
|
+
!!appMenu && appMenu,
|
|
40198
|
+
React__default.createElement("div", { className: "LuiHeaderV2-logo" }, logoContainer),
|
|
40199
|
+
headingText && (React__default.createElement("div", { className: "LuiHeaderV2-title" },
|
|
40200
|
+
React__default.createElement("h1", null, headingText)))),
|
|
40201
|
+
React__default.createElement("div", { className: "LuiHeaderV2-col" }, children))));
|
|
40202
|
+
};
|
|
40203
|
+
var LuiHeaderMenuItemV2 = forwardRef(function (_a, ref) {
|
|
40204
|
+
var icon = _a.icon, _b = _a.iconColor, iconColor = _b === void 0 ? '#ffffff' : _b, label = _a.label, badge = _a.badge, hide = _a.hide, onClick = _a.onClick, _c = _a["data-testid"], dataTestId = _c === void 0 ? 'menu-item' : _c, children = _a.children;
|
|
40205
|
+
var menuItemClasses = clsx$1('LuiHeaderV2-menu-item', hide && buildHideClassDict(hide));
|
|
40206
|
+
var resolvedIcon = !icon && !label ? 'ic_menu' : icon;
|
|
40207
|
+
return (React__default.createElement("div", { className: menuItemClasses, ref: ref },
|
|
40208
|
+
React__default.createElement("div", { className: "LuiHeaderV2-menu-button" },
|
|
40209
|
+
resolvedIcon && (React__default.createElement("div", { className: clsx$1('LuiHeaderV2-menu-icon', onClick && 'clickable'), "data-testid": dataTestId, onClick: onClick },
|
|
40210
|
+
React__default.createElement(LuiIcon, { size: "lg", name: resolvedIcon, alt: '', color: iconColor }))),
|
|
40211
|
+
label && (React__default.createElement("div", { className: clsx$1(onClick && 'clickable', { 'LuiHeaderV2-menu-label': !!resolvedIcon }, { 'LuiHeaderV2-menu-label-only': !resolvedIcon }), onClick: onClick }, label)),
|
|
40212
|
+
badge && React__default.createElement("div", { className: "LuiHeaderV2-badge" }, badge)),
|
|
40213
|
+
!!children && children));
|
|
40214
|
+
});
|
|
40215
|
+
var LuiCloseableHeaderMenuItemV2 = function (_a) {
|
|
40216
|
+
var open = _a.open, setOpen = _a.setOpen, children = _a.children, props = __rest$1(_a, ["open", "setOpen", "children"]);
|
|
40217
|
+
useEscapeFunction(function () { return setOpen(false); });
|
|
40218
|
+
var menuDiv = usePageClickFunction(function (event) { return open || event.stopPropagation(); }, function (event) {
|
|
40219
|
+
if (!open) {
|
|
40220
|
+
event.stopPropagation();
|
|
40221
|
+
setOpen(false);
|
|
40222
|
+
}
|
|
40223
|
+
});
|
|
40224
|
+
var menuControls = {
|
|
40225
|
+
isOpen: function () { return open; },
|
|
40226
|
+
open: function () { return setOpen(!open); },
|
|
40227
|
+
close: function () { return setOpen(false); }
|
|
40228
|
+
};
|
|
40229
|
+
var menuItemProps = __assign$3({ onClick: function () { return menuControls.open(); } }, props);
|
|
40230
|
+
return (React__default.createElement(LuiCloseableHeaderMenuContext.Provider, { value: menuControls },
|
|
40231
|
+
React__default.createElement(LuiHeaderMenuItemV2, __assign$3({ ref: menuDiv }, menuItemProps), !!children && children)));
|
|
40232
|
+
};
|
|
40233
|
+
|
|
40234
|
+
/**
|
|
40235
|
+
* @deprecated replaced by LuiDrawerMenuOptionsV2
|
|
40236
|
+
*/
|
|
40165
40237
|
var LuiDrawerMenuOptions = function (_a) {
|
|
40166
40238
|
var children = _a.children;
|
|
40239
|
+
useDeprecatedWarning('LuiDrawerMenuOptions');
|
|
40167
40240
|
return React__default.createElement("div", { className: "lui-menu-drawer-options" }, children);
|
|
40168
40241
|
};
|
|
40242
|
+
/**
|
|
40243
|
+
* @deprecated replaced by LuiDrawerMenuOptionV2
|
|
40244
|
+
*/
|
|
40169
40245
|
var LuiDrawerMenuOption = function (_a) {
|
|
40170
40246
|
var icon = _a.icon, label = _a.label, badge = _a.badge, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b;
|
|
40247
|
+
useDeprecatedWarning('LuiDrawerMenuOption');
|
|
40171
40248
|
var menu = useContext(LuiCloseableHeaderMenuContext);
|
|
40172
40249
|
return (React__default.createElement("div", { className: "lui-menu-drawer-option", onClick: function () {
|
|
40173
40250
|
menu.close();
|
|
@@ -40178,8 +40255,12 @@ var LuiDrawerMenuOption = function (_a) {
|
|
|
40178
40255
|
label),
|
|
40179
40256
|
badge));
|
|
40180
40257
|
};
|
|
40258
|
+
/**
|
|
40259
|
+
* @deprecated replaced by LuiDrawerMenuV2
|
|
40260
|
+
*/
|
|
40181
40261
|
var LuiDrawerMenu = function (_a) {
|
|
40182
40262
|
var restOfProps = __rest$1(_a, []);
|
|
40263
|
+
useDeprecatedWarning('LuiDrawerMenu');
|
|
40183
40264
|
var children = restOfProps.children, _b = restOfProps.hasStickyHeader, hasStickyHeader = _b === void 0 ? true : _b, menuPropsCopy = __rest$1(restOfProps, ["children", "hasStickyHeader"]);
|
|
40184
40265
|
var _c = useState(false), open = _c[0], setOpen = _c[1];
|
|
40185
40266
|
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen, icon: open ? 'close' : 'menu', onClick: function () { return setOpen(!open); } });
|
|
@@ -40202,8 +40283,12 @@ var LuiDrawerMenu = function (_a) {
|
|
|
40202
40283
|
'lui-menu-drawer-closed': !open
|
|
40203
40284
|
}), "data-testid": 'drawer', "aria-hidden": !open }, children)));
|
|
40204
40285
|
};
|
|
40286
|
+
/**
|
|
40287
|
+
* @deprecated replaced by LuiDropdownMenuV2
|
|
40288
|
+
*/
|
|
40205
40289
|
var LuiDropdownMenu = function (_a) {
|
|
40206
40290
|
var restOfProps = __rest$1(_a, []);
|
|
40291
|
+
useDeprecatedWarning('LuiDropdownMenu');
|
|
40207
40292
|
var children = restOfProps.children, menuPropsCopy = __rest$1(restOfProps, ["children"]);
|
|
40208
40293
|
var _b = useState(false), open = _b[0], setOpen = _b[1];
|
|
40209
40294
|
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen });
|
|
@@ -40229,6 +40314,84 @@ var LuiDrawerMenuDivider = function () {
|
|
|
40229
40314
|
return React__default.createElement("hr", { className: "LuiDrawerMenuDivider" });
|
|
40230
40315
|
};
|
|
40231
40316
|
|
|
40317
|
+
var LuiDrawerMenuOptionsV2 = function (_a) {
|
|
40318
|
+
var children = _a.children;
|
|
40319
|
+
return (React__default.createElement("div", { className: "LuiHeaderMenuV2-drawer-options" }, children));
|
|
40320
|
+
};
|
|
40321
|
+
var LuiDrawerMenuOptionV2 = function (_a) {
|
|
40322
|
+
var icon = _a.icon, iconColor = _a.iconColor, label = _a.label, badge = _a.badge, _b = _a.iconSize, iconSize = _b === void 0 ? 'md' : _b, _c = _a.subMenu, subMenu = _c === void 0 ? false : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d;
|
|
40323
|
+
var menu = useContext(LuiCloseableHeaderMenuContext);
|
|
40324
|
+
return (React__default.createElement("div", { className: "LuiHeaderMenuV2-drawer-option", onClick: function () {
|
|
40325
|
+
if (!subMenu) {
|
|
40326
|
+
menu.close();
|
|
40327
|
+
}
|
|
40328
|
+
onClick();
|
|
40329
|
+
}, "data-testid": 'drawer-option' },
|
|
40330
|
+
React__default.createElement("div", { className: "LuiHeaderMenuV2-drawer-option-label" },
|
|
40331
|
+
typeof icon === 'string' ? (React__default.createElement(LuiIcon, { size: iconSize, name: icon, alt: '', color: iconColor, "data-testid": 'drawer-option-icon' })) : (icon),
|
|
40332
|
+
label),
|
|
40333
|
+
badge));
|
|
40334
|
+
};
|
|
40335
|
+
var LuiDrawerMenuV2 = function (_a) {
|
|
40336
|
+
var children = _a.children, _b = _a.hasStickyHeader, hasStickyHeader = _b === void 0 ? true : _b, menuPropsCopy = __rest$1(_a, ["children", "hasStickyHeader"]);
|
|
40337
|
+
var _c = useState(false), open = _c[0], setOpen = _c[1];
|
|
40338
|
+
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen, icon: open ? 'ic_clear' : 'ic_menu', onClick: function () { return setOpen(!open); } });
|
|
40339
|
+
useEffect(function () {
|
|
40340
|
+
// Support for non-sticky headers. Scroll back to top when menu is opened
|
|
40341
|
+
if (open && !hasStickyHeader) {
|
|
40342
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
40343
|
+
}
|
|
40344
|
+
// Disable page scrolling while menu is open
|
|
40345
|
+
if (open) {
|
|
40346
|
+
document.body.classList.add('LuiHeaderMenuV2-drawer-open');
|
|
40347
|
+
}
|
|
40348
|
+
else {
|
|
40349
|
+
document.body.classList.remove('LuiHeaderMenuV2-drawer-open');
|
|
40350
|
+
}
|
|
40351
|
+
}, [open, hasStickyHeader]);
|
|
40352
|
+
return (React__default.createElement(LuiCloseableHeaderMenuItemV2, __assign$3({}, closeableMenuProps),
|
|
40353
|
+
React__default.createElement("div", { className: clsx$1({
|
|
40354
|
+
'LuiHeaderMenuV2-drawer': true,
|
|
40355
|
+
'LuiHeaderMenuV2-drawer-closed': !open
|
|
40356
|
+
}), "data-testid": 'drawer', "aria-hidden": !open }, children)));
|
|
40357
|
+
};
|
|
40358
|
+
var LuiDropdownMenuV2 = function (_a) {
|
|
40359
|
+
var restOfProps = __rest$1(_a, []);
|
|
40360
|
+
var children = restOfProps.children, _b = restOfProps.anchorOrigin, _c = _b === void 0 ? {
|
|
40361
|
+
horizontal: 'left'
|
|
40362
|
+
} : _b, _d = _c.horizontal, horizontal = _d === void 0 ? 'left' : _d, _e = restOfProps.size, size = _e === void 0 ? 'md' : _e, menuPropsCopy = __rest$1(restOfProps, ["children", "anchorOrigin", "size"]);
|
|
40363
|
+
var _f = useState(null), open = _f[0], setOpen = _f[1];
|
|
40364
|
+
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open || false, setOpen: function (currentOpen) {
|
|
40365
|
+
setOpen(function (preOpen) {
|
|
40366
|
+
if (preOpen !== null) {
|
|
40367
|
+
return currentOpen;
|
|
40368
|
+
}
|
|
40369
|
+
// if the menu was not opened before, then ignore close event,
|
|
40370
|
+
// thus apply -closed animation css only if the menu is closed from the open state
|
|
40371
|
+
return currentOpen || null;
|
|
40372
|
+
});
|
|
40373
|
+
} });
|
|
40374
|
+
return (React__default.createElement(LuiCloseableHeaderMenuItemV2, __assign$3({}, closeableMenuProps),
|
|
40375
|
+
React__default.createElement("div", { className: "LuiHeaderMenuV2-dropdown-container" },
|
|
40376
|
+
React__default.createElement("div", { className: clsx$1('LuiHeaderMenuV2-dropdown', 'lui-box-shadow', { 'anchor-horizontal-icon-left': horizontal === 'left' }, {
|
|
40377
|
+
'anchor-horizontal-icon-right': !menuPropsCopy.label && horizontal === 'right'
|
|
40378
|
+
}, {
|
|
40379
|
+
'anchor-horizontal-label-right': menuPropsCopy.label && horizontal === 'right'
|
|
40380
|
+
}, "dropdown-".concat(size), {
|
|
40381
|
+
'LuiHeaderMenuV2-dropdown-open': open
|
|
40382
|
+
}, {
|
|
40383
|
+
'LuiHeaderMenuV2-dropdown-closed': open !== null && !open
|
|
40384
|
+
}), "data-testid": 'dropdown', "aria-hidden": !open },
|
|
40385
|
+
children,
|
|
40386
|
+
' '))));
|
|
40387
|
+
};
|
|
40388
|
+
var LuiDrawerMenuSectionV2 = function (props) {
|
|
40389
|
+
return React__default.createElement(LuiDrawerMenuSection, __assign$3({}, props));
|
|
40390
|
+
};
|
|
40391
|
+
var LuiDrawerMenuDividerV2 = function () {
|
|
40392
|
+
return React__default.createElement(LuiDrawerMenuDivider, null);
|
|
40393
|
+
};
|
|
40394
|
+
|
|
40232
40395
|
var lib = {exports: {}};
|
|
40233
40396
|
|
|
40234
40397
|
var Modal$2 = {};
|
|
@@ -40257,7 +40420,16 @@ exports.default = findTabbableDescendants;
|
|
|
40257
40420
|
* http://api.jqueryui.com/category/ui-core/
|
|
40258
40421
|
*/
|
|
40259
40422
|
|
|
40260
|
-
var
|
|
40423
|
+
var DISPLAY_NONE = "none";
|
|
40424
|
+
var DISPLAY_CONTENTS = "contents";
|
|
40425
|
+
|
|
40426
|
+
var tabbableNode = /input|select|textarea|button|object|iframe/;
|
|
40427
|
+
|
|
40428
|
+
function isNotOverflowing(element, style) {
|
|
40429
|
+
return style.getPropertyValue("overflow") !== "visible" ||
|
|
40430
|
+
// if 'overflow: visible' set, check if there is actually any overflow
|
|
40431
|
+
element.scrollWidth <= 0 && element.scrollHeight <= 0;
|
|
40432
|
+
}
|
|
40261
40433
|
|
|
40262
40434
|
function hidesContents(element) {
|
|
40263
40435
|
var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;
|
|
@@ -40265,17 +40437,27 @@ function hidesContents(element) {
|
|
|
40265
40437
|
// If the node is empty, this is good enough
|
|
40266
40438
|
if (zeroSize && !element.innerHTML) return true;
|
|
40267
40439
|
|
|
40268
|
-
|
|
40269
|
-
|
|
40270
|
-
|
|
40271
|
-
|
|
40272
|
-
|
|
40440
|
+
try {
|
|
40441
|
+
// Otherwise we need to check some styles
|
|
40442
|
+
var style = window.getComputedStyle(element);
|
|
40443
|
+
var displayValue = style.getPropertyValue("display");
|
|
40444
|
+
return zeroSize ? displayValue !== DISPLAY_CONTENTS && isNotOverflowing(element, style) : displayValue === DISPLAY_NONE;
|
|
40445
|
+
} catch (exception) {
|
|
40446
|
+
// eslint-disable-next-line no-console
|
|
40447
|
+
console.warn("Failed to inspect element style");
|
|
40448
|
+
return false;
|
|
40449
|
+
}
|
|
40273
40450
|
}
|
|
40274
40451
|
|
|
40275
40452
|
function visible(element) {
|
|
40276
40453
|
var parentElement = element;
|
|
40454
|
+
var rootNode = element.getRootNode && element.getRootNode();
|
|
40277
40455
|
while (parentElement) {
|
|
40278
40456
|
if (parentElement === document.body) break;
|
|
40457
|
+
|
|
40458
|
+
// if we are not hidden yet, skip to checking outside the Web Component
|
|
40459
|
+
if (rootNode && parentElement === rootNode) parentElement = rootNode.host.parentNode;
|
|
40460
|
+
|
|
40279
40461
|
if (hidesContents(parentElement)) return false;
|
|
40280
40462
|
parentElement = parentElement.parentNode;
|
|
40281
40463
|
}
|
|
@@ -40296,7 +40478,10 @@ function tabbable(element) {
|
|
|
40296
40478
|
}
|
|
40297
40479
|
|
|
40298
40480
|
function findTabbableDescendants(element) {
|
|
40299
|
-
|
|
40481
|
+
var descendants = [].slice.call(element.querySelectorAll("*"), 0).reduce(function (finished, el) {
|
|
40482
|
+
return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot));
|
|
40483
|
+
}, []);
|
|
40484
|
+
return descendants.filter(tabbable);
|
|
40300
40485
|
}
|
|
40301
40486
|
module.exports = exports["default"];
|
|
40302
40487
|
}(tabbable, tabbable.exports));
|
|
@@ -40304,6 +40489,8 @@ module.exports = exports["default"];
|
|
|
40304
40489
|
Object.defineProperty(focusManager, "__esModule", {
|
|
40305
40490
|
value: true
|
|
40306
40491
|
});
|
|
40492
|
+
focusManager.resetState = resetState$4;
|
|
40493
|
+
focusManager.log = log$4;
|
|
40307
40494
|
focusManager.handleBlur = handleBlur;
|
|
40308
40495
|
focusManager.handleFocus = handleFocus;
|
|
40309
40496
|
focusManager.markForFocusLater = markForFocusLater;
|
|
@@ -40322,6 +40509,25 @@ var focusLaterElements = [];
|
|
|
40322
40509
|
var modalElement = null;
|
|
40323
40510
|
var needToFocus = false;
|
|
40324
40511
|
|
|
40512
|
+
/* eslint-disable no-console */
|
|
40513
|
+
/* istanbul ignore next */
|
|
40514
|
+
function resetState$4() {
|
|
40515
|
+
focusLaterElements = [];
|
|
40516
|
+
}
|
|
40517
|
+
|
|
40518
|
+
/* istanbul ignore next */
|
|
40519
|
+
function log$4() {
|
|
40520
|
+
if (process.env.NODE_ENV !== "production") {
|
|
40521
|
+
console.log("focusManager ----------");
|
|
40522
|
+
focusLaterElements.forEach(function (f) {
|
|
40523
|
+
var check = f || {};
|
|
40524
|
+
console.log(check.nodeName, check.className, check.id);
|
|
40525
|
+
});
|
|
40526
|
+
console.log("end focusManager ----------");
|
|
40527
|
+
}
|
|
40528
|
+
}
|
|
40529
|
+
/* eslint-enable no-console */
|
|
40530
|
+
|
|
40325
40531
|
function handleBlur() {
|
|
40326
40532
|
needToFocus = true;
|
|
40327
40533
|
}
|
|
@@ -40353,11 +40559,13 @@ function markForFocusLater() {
|
|
|
40353
40559
|
|
|
40354
40560
|
/* eslint-disable no-console */
|
|
40355
40561
|
function returnFocus() {
|
|
40562
|
+
var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
40563
|
+
|
|
40356
40564
|
var toFocus = null;
|
|
40357
40565
|
try {
|
|
40358
40566
|
if (focusLaterElements.length !== 0) {
|
|
40359
40567
|
toFocus = focusLaterElements.pop();
|
|
40360
|
-
toFocus.focus();
|
|
40568
|
+
toFocus.focus({ preventScroll: preventScroll });
|
|
40361
40569
|
}
|
|
40362
40570
|
return;
|
|
40363
40571
|
} catch (e) {
|
|
@@ -40409,6 +40617,12 @@ var _tabbable2 = _interopRequireDefault(_tabbable);
|
|
|
40409
40617
|
|
|
40410
40618
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40411
40619
|
|
|
40620
|
+
function getActiveElement() {
|
|
40621
|
+
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
40622
|
+
|
|
40623
|
+
return el.activeElement.shadowRoot ? getActiveElement(el.activeElement.shadowRoot) : el.activeElement;
|
|
40624
|
+
}
|
|
40625
|
+
|
|
40412
40626
|
function scopeTab(node, event) {
|
|
40413
40627
|
var tabbable = (0, _tabbable2.default)(node);
|
|
40414
40628
|
|
|
@@ -40423,19 +40637,20 @@ function scopeTab(node, event) {
|
|
|
40423
40637
|
var shiftKey = event.shiftKey;
|
|
40424
40638
|
var head = tabbable[0];
|
|
40425
40639
|
var tail = tabbable[tabbable.length - 1];
|
|
40640
|
+
var activeElement = getActiveElement();
|
|
40426
40641
|
|
|
40427
40642
|
// proceed with default browser behavior on tab.
|
|
40428
40643
|
// Focus on last element on shift + tab.
|
|
40429
|
-
if (node ===
|
|
40644
|
+
if (node === activeElement) {
|
|
40430
40645
|
if (!shiftKey) return;
|
|
40431
40646
|
target = tail;
|
|
40432
40647
|
}
|
|
40433
40648
|
|
|
40434
|
-
if (tail ===
|
|
40649
|
+
if (tail === activeElement && !shiftKey) {
|
|
40435
40650
|
target = head;
|
|
40436
40651
|
}
|
|
40437
40652
|
|
|
40438
|
-
if (head ===
|
|
40653
|
+
if (head === activeElement && shiftKey) {
|
|
40439
40654
|
target = tail;
|
|
40440
40655
|
}
|
|
40441
40656
|
|
|
@@ -40463,7 +40678,7 @@ function scopeTab(node, event) {
|
|
|
40463
40678
|
// the focus
|
|
40464
40679
|
if (!isSafariDesktop) return;
|
|
40465
40680
|
|
|
40466
|
-
var x = tabbable.indexOf(
|
|
40681
|
+
var x = tabbable.indexOf(activeElement);
|
|
40467
40682
|
|
|
40468
40683
|
if (x > -1) {
|
|
40469
40684
|
x += shiftKey ? -1 : 1;
|
|
@@ -40596,7 +40811,7 @@ var exenv = {exports: {}};
|
|
|
40596
40811
|
Object.defineProperty(safeHTMLElement, "__esModule", {
|
|
40597
40812
|
value: true
|
|
40598
40813
|
});
|
|
40599
|
-
safeHTMLElement.canUseDOM = undefined;
|
|
40814
|
+
safeHTMLElement.canUseDOM = safeHTMLElement.SafeNodeList = safeHTMLElement.SafeHTMLCollection = undefined;
|
|
40600
40815
|
|
|
40601
40816
|
var _exenv = exenv.exports;
|
|
40602
40817
|
|
|
@@ -40608,6 +40823,10 @@ var EE = _exenv2.default;
|
|
|
40608
40823
|
|
|
40609
40824
|
var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};
|
|
40610
40825
|
|
|
40826
|
+
safeHTMLElement.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};
|
|
40827
|
+
|
|
40828
|
+
safeHTMLElement.SafeNodeList = EE.canUseDOM ? window.NodeList : {};
|
|
40829
|
+
|
|
40611
40830
|
safeHTMLElement.canUseDOM = EE.canUseDOM;
|
|
40612
40831
|
|
|
40613
40832
|
safeHTMLElement.default = SafeHTMLElement;
|
|
@@ -40615,13 +40834,14 @@ safeHTMLElement.default = SafeHTMLElement;
|
|
|
40615
40834
|
Object.defineProperty(ariaAppHider$1, "__esModule", {
|
|
40616
40835
|
value: true
|
|
40617
40836
|
});
|
|
40837
|
+
ariaAppHider$1.resetState = resetState$3;
|
|
40838
|
+
ariaAppHider$1.log = log$3;
|
|
40618
40839
|
ariaAppHider$1.assertNodeList = assertNodeList;
|
|
40619
40840
|
ariaAppHider$1.setElement = setElement;
|
|
40620
40841
|
ariaAppHider$1.validateElement = validateElement;
|
|
40621
40842
|
ariaAppHider$1.hide = hide$2;
|
|
40622
40843
|
ariaAppHider$1.show = show;
|
|
40623
40844
|
ariaAppHider$1.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;
|
|
40624
|
-
ariaAppHider$1.resetForTesting = resetForTesting;
|
|
40625
40845
|
|
|
40626
40846
|
var _warning = warning_1;
|
|
40627
40847
|
|
|
@@ -40633,6 +40853,36 @@ function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : {
|
|
|
40633
40853
|
|
|
40634
40854
|
var globalElement = null;
|
|
40635
40855
|
|
|
40856
|
+
/* eslint-disable no-console */
|
|
40857
|
+
/* istanbul ignore next */
|
|
40858
|
+
function resetState$3() {
|
|
40859
|
+
if (globalElement) {
|
|
40860
|
+
if (globalElement.removeAttribute) {
|
|
40861
|
+
globalElement.removeAttribute("aria-hidden");
|
|
40862
|
+
} else if (globalElement.length != null) {
|
|
40863
|
+
globalElement.forEach(function (element) {
|
|
40864
|
+
return element.removeAttribute("aria-hidden");
|
|
40865
|
+
});
|
|
40866
|
+
} else {
|
|
40867
|
+
document.querySelectorAll(globalElement).forEach(function (element) {
|
|
40868
|
+
return element.removeAttribute("aria-hidden");
|
|
40869
|
+
});
|
|
40870
|
+
}
|
|
40871
|
+
}
|
|
40872
|
+
globalElement = null;
|
|
40873
|
+
}
|
|
40874
|
+
|
|
40875
|
+
/* istanbul ignore next */
|
|
40876
|
+
function log$3() {
|
|
40877
|
+
if (process.env.NODE_ENV !== "production") {
|
|
40878
|
+
var check = globalElement || {};
|
|
40879
|
+
console.log("ariaAppHider ----------");
|
|
40880
|
+
console.log(check.nodeName, check.className, check.id);
|
|
40881
|
+
console.log("end ariaAppHider ----------");
|
|
40882
|
+
}
|
|
40883
|
+
}
|
|
40884
|
+
/* eslint-enable no-console */
|
|
40885
|
+
|
|
40636
40886
|
function assertNodeList(nodeList, selector) {
|
|
40637
40887
|
if (!nodeList || !nodeList.length) {
|
|
40638
40888
|
throw new Error("react-modal: No elements were found for selector " + selector + ".");
|
|
@@ -40644,31 +40894,74 @@ function setElement(element) {
|
|
|
40644
40894
|
if (typeof useElement === "string" && _safeHTMLElement$1.canUseDOM) {
|
|
40645
40895
|
var el = document.querySelectorAll(useElement);
|
|
40646
40896
|
assertNodeList(el, useElement);
|
|
40647
|
-
useElement =
|
|
40897
|
+
useElement = el;
|
|
40648
40898
|
}
|
|
40649
40899
|
globalElement = useElement || globalElement;
|
|
40650
40900
|
return globalElement;
|
|
40651
40901
|
}
|
|
40652
40902
|
|
|
40653
40903
|
function validateElement(appElement) {
|
|
40654
|
-
|
|
40904
|
+
var el = appElement || globalElement;
|
|
40905
|
+
if (el) {
|
|
40906
|
+
return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];
|
|
40907
|
+
} else {
|
|
40655
40908
|
(0, _warning2.default)(false, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" "));
|
|
40656
40909
|
|
|
40657
|
-
return
|
|
40910
|
+
return [];
|
|
40658
40911
|
}
|
|
40659
|
-
|
|
40660
|
-
return true;
|
|
40661
40912
|
}
|
|
40662
40913
|
|
|
40663
40914
|
function hide$2(appElement) {
|
|
40664
|
-
|
|
40665
|
-
|
|
40915
|
+
var _iteratorNormalCompletion = true;
|
|
40916
|
+
var _didIteratorError = false;
|
|
40917
|
+
var _iteratorError = undefined;
|
|
40918
|
+
|
|
40919
|
+
try {
|
|
40920
|
+
for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
40921
|
+
var el = _step.value;
|
|
40922
|
+
|
|
40923
|
+
el.setAttribute("aria-hidden", "true");
|
|
40924
|
+
}
|
|
40925
|
+
} catch (err) {
|
|
40926
|
+
_didIteratorError = true;
|
|
40927
|
+
_iteratorError = err;
|
|
40928
|
+
} finally {
|
|
40929
|
+
try {
|
|
40930
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
40931
|
+
_iterator.return();
|
|
40932
|
+
}
|
|
40933
|
+
} finally {
|
|
40934
|
+
if (_didIteratorError) {
|
|
40935
|
+
throw _iteratorError;
|
|
40936
|
+
}
|
|
40937
|
+
}
|
|
40666
40938
|
}
|
|
40667
40939
|
}
|
|
40668
40940
|
|
|
40669
40941
|
function show(appElement) {
|
|
40670
|
-
|
|
40671
|
-
|
|
40942
|
+
var _iteratorNormalCompletion2 = true;
|
|
40943
|
+
var _didIteratorError2 = false;
|
|
40944
|
+
var _iteratorError2 = undefined;
|
|
40945
|
+
|
|
40946
|
+
try {
|
|
40947
|
+
for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
40948
|
+
var el = _step2.value;
|
|
40949
|
+
|
|
40950
|
+
el.removeAttribute("aria-hidden");
|
|
40951
|
+
}
|
|
40952
|
+
} catch (err) {
|
|
40953
|
+
_didIteratorError2 = true;
|
|
40954
|
+
_iteratorError2 = err;
|
|
40955
|
+
} finally {
|
|
40956
|
+
try {
|
|
40957
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
|
40958
|
+
_iterator2.return();
|
|
40959
|
+
}
|
|
40960
|
+
} finally {
|
|
40961
|
+
if (_didIteratorError2) {
|
|
40962
|
+
throw _iteratorError2;
|
|
40963
|
+
}
|
|
40964
|
+
}
|
|
40672
40965
|
}
|
|
40673
40966
|
}
|
|
40674
40967
|
|
|
@@ -40676,43 +40969,62 @@ function documentNotReadyOrSSRTesting() {
|
|
|
40676
40969
|
globalElement = null;
|
|
40677
40970
|
}
|
|
40678
40971
|
|
|
40679
|
-
function resetForTesting() {
|
|
40680
|
-
globalElement = null;
|
|
40681
|
-
}
|
|
40682
|
-
|
|
40683
40972
|
var classList = {};
|
|
40684
40973
|
|
|
40685
40974
|
Object.defineProperty(classList, "__esModule", {
|
|
40686
40975
|
value: true
|
|
40687
40976
|
});
|
|
40688
|
-
classList.
|
|
40977
|
+
classList.resetState = resetState$2;
|
|
40978
|
+
classList.log = log$2;
|
|
40689
40979
|
var htmlClassList = {};
|
|
40690
40980
|
var docBodyClassList = {};
|
|
40691
40981
|
|
|
40692
|
-
|
|
40982
|
+
/* eslint-disable no-console */
|
|
40983
|
+
/* istanbul ignore next */
|
|
40984
|
+
function removeClass(at, cls) {
|
|
40985
|
+
at.classList.remove(cls);
|
|
40986
|
+
}
|
|
40987
|
+
|
|
40988
|
+
/* istanbul ignore next */
|
|
40989
|
+
function resetState$2() {
|
|
40990
|
+
var htmlElement = document.getElementsByTagName("html")[0];
|
|
40991
|
+
for (var cls in htmlClassList) {
|
|
40992
|
+
removeClass(htmlElement, htmlClassList[cls]);
|
|
40993
|
+
}
|
|
40994
|
+
|
|
40995
|
+
var body = document.body;
|
|
40996
|
+
for (var _cls in docBodyClassList) {
|
|
40997
|
+
removeClass(body, docBodyClassList[_cls]);
|
|
40998
|
+
}
|
|
40999
|
+
|
|
41000
|
+
htmlClassList = {};
|
|
41001
|
+
docBodyClassList = {};
|
|
41002
|
+
}
|
|
41003
|
+
|
|
41004
|
+
/* istanbul ignore next */
|
|
41005
|
+
function log$2() {
|
|
40693
41006
|
if (process.env.NODE_ENV !== "production") {
|
|
40694
41007
|
var classes = document.getElementsByTagName("html")[0].className;
|
|
40695
41008
|
var buffer = "Show tracked classes:\n\n";
|
|
40696
41009
|
|
|
40697
|
-
buffer += "<html /> (" + classes + "):\n";
|
|
41010
|
+
buffer += "<html /> (" + classes + "):\n ";
|
|
40698
41011
|
for (var x in htmlClassList) {
|
|
40699
|
-
buffer += " " + x + " " + htmlClassList[x] + "\n";
|
|
41012
|
+
buffer += " " + x + " " + htmlClassList[x] + "\n ";
|
|
40700
41013
|
}
|
|
40701
41014
|
|
|
40702
41015
|
classes = document.body.className;
|
|
40703
41016
|
|
|
40704
|
-
|
|
40705
|
-
buffer += "\n\ndoc.body (" + classes + "):\n";
|
|
41017
|
+
buffer += "\n\ndoc.body (" + classes + "):\n ";
|
|
40706
41018
|
for (var _x in docBodyClassList) {
|
|
40707
|
-
buffer += " " + _x + " " + docBodyClassList[_x] + "\n";
|
|
41019
|
+
buffer += " " + _x + " " + docBodyClassList[_x] + "\n ";
|
|
40708
41020
|
}
|
|
40709
41021
|
|
|
40710
41022
|
buffer += "\n";
|
|
40711
41023
|
|
|
40712
|
-
// eslint-disable-next-line no-console
|
|
40713
41024
|
console.log(buffer);
|
|
40714
41025
|
}
|
|
40715
41026
|
}
|
|
41027
|
+
/* eslint-enable no-console */
|
|
40716
41028
|
|
|
40717
41029
|
/**
|
|
40718
41030
|
* Track the number of reference of a class.
|
|
@@ -40788,22 +41100,22 @@ classList.remove = function remove(element, classString) {
|
|
|
40788
41100
|
return untrackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
|
|
40789
41101
|
};
|
|
40790
41102
|
|
|
40791
|
-
var portalOpenInstances = {
|
|
40792
|
-
|
|
40793
|
-
(function (module, exports) {
|
|
41103
|
+
var portalOpenInstances$1 = {};
|
|
40794
41104
|
|
|
40795
|
-
Object.defineProperty(
|
|
41105
|
+
Object.defineProperty(portalOpenInstances$1, "__esModule", {
|
|
40796
41106
|
value: true
|
|
40797
41107
|
});
|
|
41108
|
+
portalOpenInstances$1.log = log$1;
|
|
41109
|
+
portalOpenInstances$1.resetState = resetState$1;
|
|
40798
41110
|
|
|
40799
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
41111
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
40800
41112
|
|
|
40801
41113
|
// Tracks portals that are open and emits events to subscribers
|
|
40802
41114
|
|
|
40803
41115
|
var PortalOpenInstances = function PortalOpenInstances() {
|
|
40804
41116
|
var _this = this;
|
|
40805
41117
|
|
|
40806
|
-
_classCallCheck(this, PortalOpenInstances);
|
|
41118
|
+
_classCallCheck$1(this, PortalOpenInstances);
|
|
40807
41119
|
|
|
40808
41120
|
this.register = function (openInstance) {
|
|
40809
41121
|
if (_this.openInstances.indexOf(openInstance) !== -1) {
|
|
@@ -40848,11 +41160,34 @@ var PortalOpenInstances = function PortalOpenInstances() {
|
|
|
40848
41160
|
|
|
40849
41161
|
var portalOpenInstances = new PortalOpenInstances();
|
|
40850
41162
|
|
|
40851
|
-
|
|
40852
|
-
|
|
40853
|
-
|
|
41163
|
+
/* eslint-disable no-console */
|
|
41164
|
+
/* istanbul ignore next */
|
|
41165
|
+
function log$1() {
|
|
41166
|
+
console.log("portalOpenInstances ----------");
|
|
41167
|
+
console.log(portalOpenInstances.openInstances.length);
|
|
41168
|
+
portalOpenInstances.openInstances.forEach(function (p) {
|
|
41169
|
+
return console.log(p);
|
|
41170
|
+
});
|
|
41171
|
+
console.log("end portalOpenInstances ----------");
|
|
41172
|
+
}
|
|
41173
|
+
|
|
41174
|
+
/* istanbul ignore next */
|
|
41175
|
+
function resetState$1() {
|
|
41176
|
+
portalOpenInstances = new PortalOpenInstances();
|
|
41177
|
+
}
|
|
41178
|
+
/* eslint-enable no-console */
|
|
41179
|
+
|
|
41180
|
+
portalOpenInstances$1.default = portalOpenInstances;
|
|
40854
41181
|
|
|
40855
|
-
var
|
|
41182
|
+
var bodyTrap$1 = {};
|
|
41183
|
+
|
|
41184
|
+
Object.defineProperty(bodyTrap$1, "__esModule", {
|
|
41185
|
+
value: true
|
|
41186
|
+
});
|
|
41187
|
+
bodyTrap$1.resetState = resetState;
|
|
41188
|
+
bodyTrap$1.log = log;
|
|
41189
|
+
|
|
41190
|
+
var _portalOpenInstances = portalOpenInstances$1;
|
|
40856
41191
|
|
|
40857
41192
|
var _portalOpenInstances2 = _interopRequireDefault$1(_portalOpenInstances);
|
|
40858
41193
|
|
|
@@ -40864,6 +41199,34 @@ var before = void 0,
|
|
|
40864
41199
|
after = void 0,
|
|
40865
41200
|
instances = [];
|
|
40866
41201
|
|
|
41202
|
+
/* eslint-disable no-console */
|
|
41203
|
+
/* istanbul ignore next */
|
|
41204
|
+
function resetState() {
|
|
41205
|
+
var _arr = [before, after];
|
|
41206
|
+
|
|
41207
|
+
for (var _i = 0; _i < _arr.length; _i++) {
|
|
41208
|
+
var item = _arr[_i];
|
|
41209
|
+
if (!item) continue;
|
|
41210
|
+
item.parentNode && item.parentNode.removeChild(item);
|
|
41211
|
+
}
|
|
41212
|
+
before = after = null;
|
|
41213
|
+
instances = [];
|
|
41214
|
+
}
|
|
41215
|
+
|
|
41216
|
+
/* istanbul ignore next */
|
|
41217
|
+
function log() {
|
|
41218
|
+
console.log("bodyTrap ----------");
|
|
41219
|
+
console.log(instances.length);
|
|
41220
|
+
var _arr2 = [before, after];
|
|
41221
|
+
for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
|
|
41222
|
+
var item = _arr2[_i2];
|
|
41223
|
+
var check = item || {};
|
|
41224
|
+
console.log(check.nodeName, check.className, check.id);
|
|
41225
|
+
}
|
|
41226
|
+
console.log("edn bodyTrap ----------");
|
|
41227
|
+
}
|
|
41228
|
+
/* eslint-enable no-console */
|
|
41229
|
+
|
|
40867
41230
|
function focusContent() {
|
|
40868
41231
|
if (instances.length === 0) {
|
|
40869
41232
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -40876,7 +41239,7 @@ function focusContent() {
|
|
|
40876
41239
|
}
|
|
40877
41240
|
|
|
40878
41241
|
function bodyTrap(eventType, openInstances) {
|
|
40879
|
-
if (!before
|
|
41242
|
+
if (!before && !after) {
|
|
40880
41243
|
before = document.createElement("div");
|
|
40881
41244
|
before.setAttribute("data-react-modal-body-trap", "");
|
|
40882
41245
|
before.style.position = "absolute";
|
|
@@ -40924,8 +41287,6 @@ var _createClass = function () { function defineProperties(target, props) { for
|
|
|
40924
41287
|
|
|
40925
41288
|
var _react = React__default;
|
|
40926
41289
|
|
|
40927
|
-
var _react2 = _interopRequireDefault(_react);
|
|
40928
|
-
|
|
40929
41290
|
var _propTypes = propTypes.exports;
|
|
40930
41291
|
|
|
40931
41292
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
@@ -40950,7 +41311,7 @@ var _safeHTMLElement = safeHTMLElement;
|
|
|
40950
41311
|
|
|
40951
41312
|
var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);
|
|
40952
41313
|
|
|
40953
|
-
var _portalOpenInstances = portalOpenInstances
|
|
41314
|
+
var _portalOpenInstances = portalOpenInstances$1;
|
|
40954
41315
|
|
|
40955
41316
|
var _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);
|
|
40956
41317
|
|
|
@@ -40972,8 +41333,17 @@ var CLASS_NAMES = {
|
|
|
40972
41333
|
content: "ReactModal__Content"
|
|
40973
41334
|
};
|
|
40974
41335
|
|
|
40975
|
-
|
|
40976
|
-
|
|
41336
|
+
/**
|
|
41337
|
+
* We need to support the deprecated `KeyboardEvent.keyCode` in addition to
|
|
41338
|
+
* `KeyboardEvent.code` for apps that still support IE11. Can be removed when
|
|
41339
|
+
* `react-modal` only supports React >18 (which dropped IE support).
|
|
41340
|
+
*/
|
|
41341
|
+
var isTabKey = function isTabKey(event) {
|
|
41342
|
+
return event.code === "Tab" || event.keyCode === 9;
|
|
41343
|
+
};
|
|
41344
|
+
var isEscKey = function isEscKey(event) {
|
|
41345
|
+
return event.code === "Escape" || event.keyCode === 27;
|
|
41346
|
+
};
|
|
40977
41347
|
|
|
40978
41348
|
var ariaHiddenInstances = 0;
|
|
40979
41349
|
|
|
@@ -41000,13 +41370,16 @@ var ModalPortal = function (_Component) {
|
|
|
41000
41370
|
appElement = _this$props.appElement,
|
|
41001
41371
|
ariaHideApp = _this$props.ariaHideApp,
|
|
41002
41372
|
htmlOpenClassName = _this$props.htmlOpenClassName,
|
|
41003
|
-
bodyOpenClassName = _this$props.bodyOpenClassName
|
|
41373
|
+
bodyOpenClassName = _this$props.bodyOpenClassName,
|
|
41374
|
+
parentSelector = _this$props.parentSelector;
|
|
41004
41375
|
|
|
41005
|
-
// Remove classes.
|
|
41006
41376
|
|
|
41007
|
-
|
|
41377
|
+
var parentDocument = parentSelector && parentSelector().ownerDocument || document;
|
|
41008
41378
|
|
|
41009
|
-
|
|
41379
|
+
// Remove classes.
|
|
41380
|
+
bodyOpenClassName && classList$1.remove(parentDocument.body, bodyOpenClassName);
|
|
41381
|
+
|
|
41382
|
+
htmlOpenClassName && classList$1.remove(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
|
|
41010
41383
|
|
|
41011
41384
|
// Reset aria-hidden attribute if all modals have been removed
|
|
41012
41385
|
if (ariaHideApp && ariaHiddenInstances > 0) {
|
|
@@ -41019,7 +41392,7 @@ var ModalPortal = function (_Component) {
|
|
|
41019
41392
|
|
|
41020
41393
|
if (_this.props.shouldFocusAfterRender) {
|
|
41021
41394
|
if (_this.props.shouldReturnFocusAfterClose) {
|
|
41022
|
-
focusManager$1.returnFocus();
|
|
41395
|
+
focusManager$1.returnFocus(_this.props.preventScroll);
|
|
41023
41396
|
focusManager$1.teardownScopedFocus();
|
|
41024
41397
|
} else {
|
|
41025
41398
|
focusManager$1.popWithoutFocus();
|
|
@@ -41045,14 +41418,16 @@ var ModalPortal = function (_Component) {
|
|
|
41045
41418
|
}
|
|
41046
41419
|
|
|
41047
41420
|
_this.setState({ isOpen: true }, function () {
|
|
41048
|
-
_this.
|
|
41049
|
-
|
|
41050
|
-
|
|
41051
|
-
_this.props.onAfterOpen
|
|
41052
|
-
|
|
41053
|
-
|
|
41054
|
-
|
|
41055
|
-
|
|
41421
|
+
_this.openAnimationFrame = requestAnimationFrame(function () {
|
|
41422
|
+
_this.setState({ afterOpen: true });
|
|
41423
|
+
|
|
41424
|
+
if (_this.props.isOpen && _this.props.onAfterOpen) {
|
|
41425
|
+
_this.props.onAfterOpen({
|
|
41426
|
+
overlayEl: _this.overlay,
|
|
41427
|
+
contentEl: _this.content
|
|
41428
|
+
});
|
|
41429
|
+
}
|
|
41430
|
+
});
|
|
41056
41431
|
});
|
|
41057
41432
|
}
|
|
41058
41433
|
};
|
|
@@ -41066,7 +41441,7 @@ var ModalPortal = function (_Component) {
|
|
|
41066
41441
|
};
|
|
41067
41442
|
|
|
41068
41443
|
_this.focusContent = function () {
|
|
41069
|
-
return _this.content && !_this.contentHasFocus() && _this.content.focus();
|
|
41444
|
+
return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true });
|
|
41070
41445
|
};
|
|
41071
41446
|
|
|
41072
41447
|
_this.closeWithTimeout = function () {
|
|
@@ -41086,11 +41461,11 @@ var ModalPortal = function (_Component) {
|
|
|
41086
41461
|
};
|
|
41087
41462
|
|
|
41088
41463
|
_this.handleKeyDown = function (event) {
|
|
41089
|
-
if (event
|
|
41464
|
+
if (isTabKey(event)) {
|
|
41090
41465
|
(0, _scopeTab2.default)(_this.content, event);
|
|
41091
41466
|
}
|
|
41092
41467
|
|
|
41093
|
-
if (_this.props.shouldCloseOnEsc && event
|
|
41468
|
+
if (_this.props.shouldCloseOnEsc && isEscKey(event)) {
|
|
41094
41469
|
event.stopPropagation();
|
|
41095
41470
|
_this.requestClose(event);
|
|
41096
41471
|
}
|
|
@@ -41217,6 +41592,7 @@ var ModalPortal = function (_Component) {
|
|
|
41217
41592
|
this.afterClose();
|
|
41218
41593
|
}
|
|
41219
41594
|
clearTimeout(this.closeTimer);
|
|
41595
|
+
cancelAnimationFrame(this.openAnimationFrame);
|
|
41220
41596
|
}
|
|
41221
41597
|
}, {
|
|
41222
41598
|
key: "beforeOpen",
|
|
@@ -41225,13 +41601,16 @@ var ModalPortal = function (_Component) {
|
|
|
41225
41601
|
appElement = _props.appElement,
|
|
41226
41602
|
ariaHideApp = _props.ariaHideApp,
|
|
41227
41603
|
htmlOpenClassName = _props.htmlOpenClassName,
|
|
41228
|
-
bodyOpenClassName = _props.bodyOpenClassName
|
|
41604
|
+
bodyOpenClassName = _props.bodyOpenClassName,
|
|
41605
|
+
parentSelector = _props.parentSelector;
|
|
41229
41606
|
|
|
41230
|
-
// Add classes.
|
|
41231
41607
|
|
|
41232
|
-
|
|
41608
|
+
var parentDocument = parentSelector && parentSelector().ownerDocument || document;
|
|
41233
41609
|
|
|
41234
|
-
|
|
41610
|
+
// Add classes.
|
|
41611
|
+
bodyOpenClassName && classList$1.add(parentDocument.body, bodyOpenClassName);
|
|
41612
|
+
|
|
41613
|
+
htmlOpenClassName && classList$1.add(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
|
|
41235
41614
|
|
|
41236
41615
|
if (ariaHideApp) {
|
|
41237
41616
|
ariaHiddenInstances += 1;
|
|
@@ -41250,40 +41629,42 @@ var ModalPortal = function (_Component) {
|
|
|
41250
41629
|
id = _props2.id,
|
|
41251
41630
|
className = _props2.className,
|
|
41252
41631
|
overlayClassName = _props2.overlayClassName,
|
|
41253
|
-
defaultStyles = _props2.defaultStyles
|
|
41632
|
+
defaultStyles = _props2.defaultStyles,
|
|
41633
|
+
children = _props2.children;
|
|
41254
41634
|
|
|
41255
41635
|
var contentStyles = className ? {} : defaultStyles.content;
|
|
41256
41636
|
var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;
|
|
41257
41637
|
|
|
41258
|
-
|
|
41259
|
-
|
|
41260
|
-
|
|
41261
|
-
|
|
41262
|
-
|
|
41263
|
-
|
|
41264
|
-
|
|
41265
|
-
|
|
41266
|
-
|
|
41267
|
-
|
|
41268
|
-
|
|
41269
|
-
|
|
41270
|
-
|
|
41271
|
-
|
|
41272
|
-
|
|
41273
|
-
|
|
41274
|
-
|
|
41275
|
-
|
|
41276
|
-
|
|
41277
|
-
|
|
41278
|
-
|
|
41279
|
-
|
|
41280
|
-
|
|
41281
|
-
|
|
41282
|
-
|
|
41283
|
-
|
|
41284
|
-
|
|
41285
|
-
|
|
41286
|
-
);
|
|
41638
|
+
if (this.shouldBeClosed()) {
|
|
41639
|
+
return null;
|
|
41640
|
+
}
|
|
41641
|
+
|
|
41642
|
+
var overlayProps = {
|
|
41643
|
+
ref: this.setOverlayRef,
|
|
41644
|
+
className: this.buildClassName("overlay", overlayClassName),
|
|
41645
|
+
style: _extends({}, overlayStyles, this.props.style.overlay),
|
|
41646
|
+
onClick: this.handleOverlayOnClick,
|
|
41647
|
+
onMouseDown: this.handleOverlayOnMouseDown
|
|
41648
|
+
};
|
|
41649
|
+
|
|
41650
|
+
var contentProps = _extends({
|
|
41651
|
+
id: id,
|
|
41652
|
+
ref: this.setContentRef,
|
|
41653
|
+
style: _extends({}, contentStyles, this.props.style.content),
|
|
41654
|
+
className: this.buildClassName("content", className),
|
|
41655
|
+
tabIndex: "-1",
|
|
41656
|
+
onKeyDown: this.handleKeyDown,
|
|
41657
|
+
onMouseDown: this.handleContentOnMouseDown,
|
|
41658
|
+
onMouseUp: this.handleContentOnMouseUp,
|
|
41659
|
+
onClick: this.handleContentOnClick,
|
|
41660
|
+
role: this.props.role,
|
|
41661
|
+
"aria-label": this.props.contentLabel
|
|
41662
|
+
}, this.attributesFromObject("aria", _extends({ modal: true }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
|
|
41663
|
+
"data-testid": this.props.testId
|
|
41664
|
+
});
|
|
41665
|
+
|
|
41666
|
+
var contentElement = this.props.contentElement(contentProps, children);
|
|
41667
|
+
return this.props.overlayElement(overlayProps, contentElement);
|
|
41287
41668
|
}
|
|
41288
41669
|
}]);
|
|
41289
41670
|
|
|
@@ -41309,10 +41690,11 @@ ModalPortal.propTypes = {
|
|
|
41309
41690
|
}),
|
|
41310
41691
|
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
|
|
41311
41692
|
overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
|
|
41693
|
+
parentSelector: _propTypes2.default.func,
|
|
41312
41694
|
bodyOpenClassName: _propTypes2.default.string,
|
|
41313
41695
|
htmlOpenClassName: _propTypes2.default.string,
|
|
41314
41696
|
ariaHideApp: _propTypes2.default.bool,
|
|
41315
|
-
appElement: _propTypes2.default.instanceOf(_safeHTMLElement2.default),
|
|
41697
|
+
appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
|
|
41316
41698
|
onAfterOpen: _propTypes2.default.func,
|
|
41317
41699
|
onAfterClose: _propTypes2.default.func,
|
|
41318
41700
|
onRequestClose: _propTypes2.default.func,
|
|
@@ -41320,6 +41702,7 @@ ModalPortal.propTypes = {
|
|
|
41320
41702
|
shouldFocusAfterRender: _propTypes2.default.bool,
|
|
41321
41703
|
shouldCloseOnOverlayClick: _propTypes2.default.bool,
|
|
41322
41704
|
shouldReturnFocusAfterClose: _propTypes2.default.bool,
|
|
41705
|
+
preventScroll: _propTypes2.default.bool,
|
|
41323
41706
|
role: _propTypes2.default.string,
|
|
41324
41707
|
contentLabel: _propTypes2.default.string,
|
|
41325
41708
|
aria: _propTypes2.default.object,
|
|
@@ -41329,6 +41712,8 @@ ModalPortal.propTypes = {
|
|
|
41329
41712
|
overlayRef: _propTypes2.default.func,
|
|
41330
41713
|
contentRef: _propTypes2.default.func,
|
|
41331
41714
|
id: _propTypes2.default.string,
|
|
41715
|
+
overlayElement: _propTypes2.default.func,
|
|
41716
|
+
contentElement: _propTypes2.default.func,
|
|
41332
41717
|
testId: _propTypes2.default.string
|
|
41333
41718
|
};
|
|
41334
41719
|
exports.default = ModalPortal;
|
|
@@ -41547,7 +41932,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
41547
41932
|
var portalClassName = Modal$2.portalClassName = "ReactModalPortal";
|
|
41548
41933
|
var bodyOpenClassName = Modal$2.bodyOpenClassName = "ReactModal__Body--open";
|
|
41549
41934
|
|
|
41550
|
-
var isReact16 = _reactDom2.default.createPortal !== undefined;
|
|
41935
|
+
var isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;
|
|
41936
|
+
|
|
41937
|
+
var createHTMLElement = function createHTMLElement(name) {
|
|
41938
|
+
return document.createElement(name);
|
|
41939
|
+
};
|
|
41551
41940
|
|
|
41552
41941
|
var getCreatePortal = function getCreatePortal() {
|
|
41553
41942
|
return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;
|
|
@@ -41574,7 +41963,7 @@ var Modal$1 = function (_Component) {
|
|
|
41574
41963
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {
|
|
41575
41964
|
!isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);
|
|
41576
41965
|
var parent = getParentElement(_this.props.parentSelector);
|
|
41577
|
-
if (parent) {
|
|
41966
|
+
if (parent && parent.contains(_this.node)) {
|
|
41578
41967
|
parent.removeChild(_this.node);
|
|
41579
41968
|
} else {
|
|
41580
41969
|
// eslint-disable-next-line no-console
|
|
@@ -41595,7 +41984,7 @@ var Modal$1 = function (_Component) {
|
|
|
41595
41984
|
if (!_safeHTMLElement.canUseDOM) return;
|
|
41596
41985
|
|
|
41597
41986
|
if (!isReact16) {
|
|
41598
|
-
this.node =
|
|
41987
|
+
this.node = createHTMLElement("div");
|
|
41599
41988
|
}
|
|
41600
41989
|
this.node.className = this.props.portalClassName;
|
|
41601
41990
|
|
|
@@ -41664,7 +42053,7 @@ var Modal$1 = function (_Component) {
|
|
|
41664
42053
|
}
|
|
41665
42054
|
|
|
41666
42055
|
if (!this.node && isReact16) {
|
|
41667
|
-
this.node =
|
|
42056
|
+
this.node = createHTMLElement("div");
|
|
41668
42057
|
}
|
|
41669
42058
|
|
|
41670
42059
|
var createPortal = getCreatePortal();
|
|
@@ -41707,7 +42096,7 @@ Modal$1.propTypes = {
|
|
|
41707
42096
|
afterOpen: _propTypes2.default.string.isRequired,
|
|
41708
42097
|
beforeClose: _propTypes2.default.string.isRequired
|
|
41709
42098
|
})]),
|
|
41710
|
-
appElement: _propTypes2.default.instanceOf(_safeHTMLElement2.default),
|
|
42099
|
+
appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
|
|
41711
42100
|
onAfterOpen: _propTypes2.default.func,
|
|
41712
42101
|
onRequestClose: _propTypes2.default.func,
|
|
41713
42102
|
closeTimeoutMS: _propTypes2.default.number,
|
|
@@ -41715,6 +42104,7 @@ Modal$1.propTypes = {
|
|
|
41715
42104
|
shouldFocusAfterRender: _propTypes2.default.bool,
|
|
41716
42105
|
shouldCloseOnOverlayClick: _propTypes2.default.bool,
|
|
41717
42106
|
shouldReturnFocusAfterClose: _propTypes2.default.bool,
|
|
42107
|
+
preventScroll: _propTypes2.default.bool,
|
|
41718
42108
|
parentSelector: _propTypes2.default.func,
|
|
41719
42109
|
aria: _propTypes2.default.object,
|
|
41720
42110
|
data: _propTypes2.default.object,
|
|
@@ -41722,7 +42112,10 @@ Modal$1.propTypes = {
|
|
|
41722
42112
|
contentLabel: _propTypes2.default.string,
|
|
41723
42113
|
shouldCloseOnEsc: _propTypes2.default.bool,
|
|
41724
42114
|
overlayRef: _propTypes2.default.func,
|
|
41725
|
-
contentRef: _propTypes2.default.func
|
|
42115
|
+
contentRef: _propTypes2.default.func,
|
|
42116
|
+
id: _propTypes2.default.string,
|
|
42117
|
+
overlayElement: _propTypes2.default.func,
|
|
42118
|
+
contentElement: _propTypes2.default.func
|
|
41726
42119
|
};
|
|
41727
42120
|
Modal$1.defaultProps = {
|
|
41728
42121
|
isOpen: false,
|
|
@@ -41735,8 +42128,23 @@ Modal$1.defaultProps = {
|
|
|
41735
42128
|
shouldCloseOnEsc: true,
|
|
41736
42129
|
shouldCloseOnOverlayClick: true,
|
|
41737
42130
|
shouldReturnFocusAfterClose: true,
|
|
42131
|
+
preventScroll: false,
|
|
41738
42132
|
parentSelector: function parentSelector() {
|
|
41739
42133
|
return document.body;
|
|
42134
|
+
},
|
|
42135
|
+
overlayElement: function overlayElement(props, contentEl) {
|
|
42136
|
+
return _react2.default.createElement(
|
|
42137
|
+
"div",
|
|
42138
|
+
props,
|
|
42139
|
+
contentEl
|
|
42140
|
+
);
|
|
42141
|
+
},
|
|
42142
|
+
contentElement: function contentElement(props, children) {
|
|
42143
|
+
return _react2.default.createElement(
|
|
42144
|
+
"div",
|
|
42145
|
+
props,
|
|
42146
|
+
children
|
|
42147
|
+
);
|
|
41740
42148
|
}
|
|
41741
42149
|
};
|
|
41742
42150
|
Modal$1.defaultStyles = {
|
|
@@ -41767,6 +42175,12 @@ Modal$1.defaultStyles = {
|
|
|
41767
42175
|
|
|
41768
42176
|
(0, _reactLifecyclesCompat.polyfill)(Modal$1);
|
|
41769
42177
|
|
|
42178
|
+
if (process.env.NODE_ENV !== "production") {
|
|
42179
|
+
Modal$1.setCreateHTMLElement = function (fn) {
|
|
42180
|
+
return createHTMLElement = fn;
|
|
42181
|
+
};
|
|
42182
|
+
}
|
|
42183
|
+
|
|
41770
42184
|
Modal$2.default = Modal$1;
|
|
41771
42185
|
|
|
41772
42186
|
(function (module, exports) {
|
|
@@ -41789,36 +42203,25 @@ var Modal = /*@__PURE__*/getDefaultExportFromCjs(lib.exports);
|
|
|
41789
42203
|
|
|
41790
42204
|
var LuiUpdatesSplashModal = function (props) {
|
|
41791
42205
|
var _a;
|
|
41792
|
-
var
|
|
41793
|
-
|
|
41794
|
-
|
|
41795
|
-
|
|
41796
|
-
|
|
41797
|
-
|
|
41798
|
-
if ((node === null || node === void 0 ? void 0 : node.current) && node.current.contains(e.target)) {
|
|
41799
|
-
// inside click
|
|
41800
|
-
return;
|
|
41801
|
-
}
|
|
41802
|
-
// outside click
|
|
41803
|
-
props.onClose();
|
|
41804
|
-
}, [props]);
|
|
41805
|
-
useEffect(function () {
|
|
41806
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
41807
|
-
return function () {
|
|
41808
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
41809
|
-
};
|
|
41810
|
-
}, [handleClickOutside]);
|
|
42206
|
+
var _b = React__default.useState(props.enabled), showModal = _b[0], setshowModal = _b[1];
|
|
42207
|
+
var currentVersion = window.localStorage.getItem(props.id);
|
|
42208
|
+
var handleClose = function () {
|
|
42209
|
+
setshowModal(false);
|
|
42210
|
+
window.localStorage.setItem(props.id, props.releaseVersion);
|
|
42211
|
+
};
|
|
41811
42212
|
// process may be undefined, e.g. webpack 5 does not include a polyfill for it. Assume if process is undefined then
|
|
41812
42213
|
// this isn't running in a test.
|
|
41813
42214
|
if (typeof process === 'undefined' || ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) !== 'test') {
|
|
41814
42215
|
Modal.setAppElement('#root');
|
|
41815
42216
|
}
|
|
41816
|
-
return (React__default.createElement(Modal, {
|
|
41817
|
-
|
|
42217
|
+
return (React__default.createElement(Modal, { isOpen: props.enabled &&
|
|
42218
|
+
showModal &&
|
|
42219
|
+
props.releaseVersion.trim() !== currentVersion, shouldCloseOnEsc: true, onRequestClose: handleClose, shouldCloseOnOverlayClick: true, contentLabel: "Recent updates", className: "lui-splash-content", overlayClassName: "splash_overlay" },
|
|
42220
|
+
React__default.createElement("div", { className: clsx$1('lui-large-feature-notification', props.wrapperClass) },
|
|
41818
42221
|
React__default.createElement("div", { className: "lui-feature-header" },
|
|
41819
42222
|
React__default.createElement("h1", null, props.header),
|
|
41820
|
-
React__default.createElement("button", { "aria-label": "Close dialog", onClick:
|
|
41821
|
-
React__default.createElement(
|
|
42223
|
+
React__default.createElement("button", { "aria-label": "Close dialog", onClick: handleClose },
|
|
42224
|
+
React__default.createElement(LuiIcon, { alt: "cross_icon", name: "ic_clear", status: "interactive", size: "md" }))),
|
|
41822
42225
|
React__default.createElement("div", { className: "lui-feature-img" },
|
|
41823
42226
|
React__default.createElement("img", { className: "lui-hide-xs lui-hide-sm", alt: "What's new", src: props.bigImage }),
|
|
41824
42227
|
React__default.createElement("img", { className: "lui-hide-md lui-hide-lg lui-hide-xl", alt: "What's new", src: props.smallImage })),
|
|
@@ -57961,5 +58364,33 @@ function LuiSideMenuItem(_a) {
|
|
|
57961
58364
|
React__default.createElement("span", { className: "navText" }, label))));
|
|
57962
58365
|
}
|
|
57963
58366
|
|
|
57964
|
-
|
|
58367
|
+
var breakpoints = {
|
|
58368
|
+
sm: 480,
|
|
58369
|
+
md: 768,
|
|
58370
|
+
lg: 1024,
|
|
58371
|
+
xl: 1280,
|
|
58372
|
+
xxl: 1600
|
|
58373
|
+
};
|
|
58374
|
+
var breakpointQuery = {
|
|
58375
|
+
up: function (bp) { return "(min-width: ".concat(breakpoints[bp], "px)"); },
|
|
58376
|
+
down: function (bp) { return "(max-width: ".concat(breakpoints[bp], "px)"); },
|
|
58377
|
+
between: function (bp1, bp2) {
|
|
58378
|
+
return "(min-width: ".concat(breakpoints[bp1], "px) and (max-width: ").concat(breakpoints[bp2], "px)");
|
|
58379
|
+
}
|
|
58380
|
+
};
|
|
58381
|
+
var useMediaQuery = function (query) {
|
|
58382
|
+
var _a = useState(false), matches = _a[0], setMatches = _a[1];
|
|
58383
|
+
useEffect(function () {
|
|
58384
|
+
var media = window.matchMedia(query);
|
|
58385
|
+
if (media.matches !== matches) {
|
|
58386
|
+
setMatches(media.matches);
|
|
58387
|
+
}
|
|
58388
|
+
var listener = function () { return setMatches(media.matches); };
|
|
58389
|
+
window.addEventListener('resize', listener);
|
|
58390
|
+
return function () { return window.removeEventListener('resize', listener); };
|
|
58391
|
+
}, [matches, query]);
|
|
58392
|
+
return matches;
|
|
58393
|
+
};
|
|
58394
|
+
|
|
58395
|
+
export { CheckboxItemRenderer, FIRM_KEY, FIRM_NAME_KEY, GLOBAL_CLIENT_REFERENCE_KEY, LOLActiveFirmMessage, LOLAuthorisedLink, LOLCommonDrawerMenu, LOLCommonDrawerMenuAfterLinks, LOLDrawerMenu, LOLFirmSwitcherMenu, LOLGlobalClientRefContext, LOLGlobalClientRefContextProvider, LOLLogoutLink, LOLSearchBox, LOLUserContext, LOLUserContextProvider, LOLUserLastLogin, LUI_WINDOW_NAME, LuiAccordicard, LuiAccordicardStatic, LuiAlertModal, LuiAlertModalButtons, LuiBadge, LuiBanner, LuiBannerContent, LuiBearingFormikInput, LuiBearingInput, LuiButton, LuiButtonGroup, LuiCheckboxInput, LuiCloseableHeaderMenuContext, LuiCloseableHeaderMenuItem, LuiCloseableHeaderMenuItemV2, LuiComboSelect, LuiControlledMenu, LuiDrawerMenu, LuiDrawerMenuDivider, LuiDrawerMenuDividerV2, LuiDrawerMenuOption, LuiDrawerMenuOptionV2, LuiDrawerMenuOptions, LuiDrawerMenuOptionsV2, LuiDrawerMenuSection, LuiDrawerMenuSectionV2, LuiDrawerMenuV2, LuiDropdownMenu, LuiDropdownMenuV2, LuiErrorPage, LuiExpandableBanner, LuiFileInputBox, LuiFilterContainer, LuiFilterMenu, LuiFloatingWindow, FloatingWindowContextProvider as LuiFloatingWindowContextProvider, LuiFooter, LuiFormSectionHeader, LuiFormikCheckbox, LuiFormikForm, LuiFormikFormLabel, LuiFormikFormSubmitButton, LuiFormikRadioButton, LuiFormikRadioGroup, LuiFormikSelect, LuiFormikTextInput, LuiHeader, LuiHeaderMenuItem, LuiHeaderMenuItemV2, LuiHeaderV2, LuiIcon, LuiListBox, LuiLoadingSpinner, LuiLoadingSpinnerChristmas, LuiLoadingSpinnerEaster, LuiMenu, LuiMenuCloseButton, LuiMessagingContextProvider, LuiMiniSpinner, LuiModal, LuiRadioInput, LuiResizableLayout, LuiSearchBox, LuiSearchInput, LuiSelectDataMenu, LuiSelectInput, LuiSelectMenu, LuiSelectMenuItem, LuiSelectSubMenuItem, LuiShadow, LuiSideMenu, LuiSideMenuItem, LuiSidePanel, LuiSidePanelProvider, LuiStaticMessage, LuiStatusSpinner, LuiSwitchButton, LuiTab, LuiTabs, LuiTabsContext, LuiTabsGroup, LuiTabsPanel, LuiTabsPanelSwitch, LuiTextAreaInput, LuiTextInput, LuiToastMessage, LuiTooltip, LuiUpdatesSplashModal, RadioItemRenderer, SplitPanelState, breakpointQuery, breakpoints, getDefaultSearchMenuOptions, isChromatic, useClickedOutsideElement, useLOLGlobalClientRefContext, useLOLUserContext, useFloatingWindow as useLuiFloatingWindow, useMediaQuery, useShowLUIMessage };
|
|
57965
58396
|
//# sourceMappingURL=lui.esm.js.map
|