@commercetools-frontend/application-components 21.4.0 → 21.6.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/dist/commercetools-frontend-application-components.cjs.dev.js +541 -230
- package/dist/commercetools-frontend-application-components.cjs.prod.js +430 -171
- package/dist/commercetools-frontend-application-components.esm.js +533 -232
- package/dist/declarations/src/components/detail-pages/custom-form-detail-page/custom-form-detail-page.d.ts +201 -0
- package/dist/declarations/src/components/detail-pages/custom-form-detail-page/index.d.ts +1 -0
- package/dist/declarations/src/components/detail-pages/form-detail-page/form-detail-page.d.ts +125 -0
- package/dist/declarations/src/components/detail-pages/form-detail-page/index.d.ts +1 -0
- package/dist/declarations/src/components/detail-pages/info-detail-page/index.d.ts +1 -0
- package/dist/declarations/src/components/detail-pages/info-detail-page/info-detail-page.d.ts +37 -0
- package/dist/declarations/src/components/{tabular-detail-page → detail-pages/tabular-detail-page}/index.d.ts +0 -0
- package/dist/declarations/src/components/{tabular-detail-page → detail-pages/tabular-detail-page}/tabular-detail-page.d.ts +0 -0
- package/dist/declarations/src/components/dialogs/internals/dialog-container.d.ts +3 -3
- package/dist/declarations/src/components/dialogs/internals/dialog-header.d.ts +1 -1
- package/dist/declarations/src/components/dialogs/internals/dialog.styles.d.ts +2 -1
- package/dist/declarations/src/components/modal-pages/internals/modal-page.d.ts +5 -5
- package/dist/declarations/src/components/modal-pages/internals/modal-page.styles.d.ts +1 -3
- package/dist/declarations/src/components/portals-container/portals-container.d.ts +6 -5
- package/dist/declarations/src/hooks/use-mutation-observer/index.d.ts +1 -0
- package/dist/declarations/src/hooks/use-mutation-observer/use-mutation-observer.d.ts +4 -0
- package/dist/declarations/src/index.d.ts +4 -1
- package/package.json +8 -6
|
@@ -30,18 +30,26 @@ var IconButton = require('@commercetools-uikit/icon-button');
|
|
|
30
30
|
var icons = require('@commercetools-uikit/icons');
|
|
31
31
|
var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
32
32
|
var omitBy = require('lodash/omitBy');
|
|
33
|
-
var FlatButton = require('@commercetools-uikit/flat-button');
|
|
34
33
|
var Modal = require('react-modal');
|
|
35
34
|
var constants = require('@commercetools-frontend/constants');
|
|
36
35
|
var Card = require('@commercetools-uikit/card');
|
|
37
36
|
var SecondaryIconButton = require('@commercetools-uikit/secondary-icon-button');
|
|
38
37
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
39
38
|
var _setTimeout = require('@babel/runtime-corejs3/core-js-stable/set-timeout');
|
|
39
|
+
var FlatButton = require('@commercetools-uikit/flat-button');
|
|
40
40
|
var CommercetoolsLogoSvg = require('@commercetools-frontend/assets/logos/commercetools_primary-logo_horizontal_white-text_RGB.svg');
|
|
41
41
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
42
42
|
var PageNotFoundSVG = require('@commercetools-frontend/assets/images/desert-fox.svg');
|
|
43
43
|
var FailedAuthorizationSVG = require('@commercetools-frontend/assets/images/folder-full-locked.svg');
|
|
44
|
+
var _toConsumableArray = require('@babel/runtime-corejs3/helpers/toConsumableArray');
|
|
45
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
46
|
+
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
44
47
|
var useResizeObserver = require('@react-hook/resize-observer');
|
|
48
|
+
var _Map = require('@babel/runtime-corejs3/core-js-stable/map');
|
|
49
|
+
var _indexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
50
|
+
var _spliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/splice');
|
|
51
|
+
var useLatest = require('@react-hook/latest');
|
|
52
|
+
var rafSchd = require('raf-schd');
|
|
45
53
|
|
|
46
54
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
47
55
|
|
|
@@ -62,36 +70,43 @@ var SecondaryButton__default = /*#__PURE__*/_interopDefault(SecondaryButton);
|
|
|
62
70
|
var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
|
|
63
71
|
var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
|
|
64
72
|
var omitBy__default = /*#__PURE__*/_interopDefault(omitBy);
|
|
65
|
-
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
66
73
|
var Modal__default = /*#__PURE__*/_interopDefault(Modal);
|
|
67
74
|
var Card__default = /*#__PURE__*/_interopDefault(Card);
|
|
68
75
|
var SecondaryIconButton__default = /*#__PURE__*/_interopDefault(SecondaryIconButton);
|
|
69
76
|
var _setTimeout__default = /*#__PURE__*/_interopDefault(_setTimeout);
|
|
77
|
+
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
70
78
|
var CommercetoolsLogoSvg__default = /*#__PURE__*/_interopDefault(CommercetoolsLogoSvg);
|
|
71
79
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
72
80
|
var PageNotFoundSVG__default = /*#__PURE__*/_interopDefault(PageNotFoundSVG);
|
|
73
81
|
var FailedAuthorizationSVG__default = /*#__PURE__*/_interopDefault(FailedAuthorizationSVG);
|
|
82
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
83
|
+
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
74
84
|
var useResizeObserver__default = /*#__PURE__*/_interopDefault(useResizeObserver);
|
|
85
|
+
var _Map__default = /*#__PURE__*/_interopDefault(_Map);
|
|
86
|
+
var _indexOfInstanceProperty__default = /*#__PURE__*/_interopDefault(_indexOfInstanceProperty);
|
|
87
|
+
var _spliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_spliceInstanceProperty);
|
|
88
|
+
var useLatest__default = /*#__PURE__*/_interopDefault(useLatest);
|
|
89
|
+
var rafSchd__default = /*#__PURE__*/_interopDefault(rafSchd);
|
|
75
90
|
|
|
76
91
|
// NOTE: This string will be replaced on build time with the package version.
|
|
77
|
-
var version = "21.
|
|
92
|
+
var version = "21.6.0";
|
|
78
93
|
|
|
79
94
|
var getBottomBorderStyles = function getBottomBorderStyles(background) {
|
|
80
95
|
return /*#__PURE__*/react.css(":after{content:'';position:absolute;bottom:0;left:0;right:0;height:4px;border-radius:", designSystem.customProperties.borderRadius2, ";background-color:", background, ";transition:background-color ", designSystem.customProperties.transitionEaseinout150Ms, ";}" + ("" ), "" );
|
|
81
96
|
};
|
|
82
97
|
|
|
83
|
-
var _ref$
|
|
98
|
+
var _ref$8 = {
|
|
84
99
|
name: "1u0tiat",
|
|
85
100
|
styles: "&[aria-disabled='true']{cursor:not-allowed;opacity:0.5;&:active{pointer-events:none;}}"
|
|
86
101
|
} ;
|
|
87
102
|
|
|
88
103
|
var getLinkStyles = function getLinkStyles(isActive, isDisabled) {
|
|
89
|
-
return [/*#__PURE__*/react.css("font-size:", designSystem.customProperties.fontSizeDefault, ";padding:", designSystem.customProperties.spacingS, " ", designSystem.customProperties.spacingM, ";position:relative;text-align:center;display:inline-block;color:inherit;text-decoration:inherit;&:first-of-type{padding-left:0;}", getBottomBorderStyles('transparent'), ";" + ("" ), "" ), isActive && /*#__PURE__*/react.css(getBottomBorderStyles(designSystem.customProperties.colorPrimary), ">*>*{color:", designSystem.customProperties.colorPrimary, "!important;}" + ("" ), "" ), isDisabled && _ref$
|
|
104
|
+
return [/*#__PURE__*/react.css("font-size:", designSystem.customProperties.fontSizeDefault, ";padding:", designSystem.customProperties.spacingS, " ", designSystem.customProperties.spacingM, ";position:relative;text-align:center;display:inline-block;color:inherit;text-decoration:inherit;&:first-of-type{padding-left:0;}", getBottomBorderStyles('transparent'), ";" + ("" ), "" ), isActive && /*#__PURE__*/react.css(getBottomBorderStyles(designSystem.customProperties.colorPrimary), ">*>*{color:", designSystem.customProperties.colorPrimary, "!important;}" + ("" ), "" ), isDisabled && _ref$8, !isActive && !isDisabled && /*#__PURE__*/react.css(":hover,:focus,:active{>*>*{color:", designSystem.customProperties.colorPrimary, "!important;}}" + ("" ), "" )];
|
|
90
105
|
};
|
|
91
106
|
|
|
92
|
-
function ownKeys$
|
|
107
|
+
function ownKeys$7(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
93
108
|
|
|
94
|
-
function _objectSpread$
|
|
109
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
95
110
|
|
|
96
111
|
var pathWithoutSearch = function pathWithoutSearch(path) {
|
|
97
112
|
return typeof path === 'string' ? path.split('?')[0] : path.pathname;
|
|
@@ -130,18 +145,18 @@ var TabHeader = function TabHeader(props) {
|
|
|
130
145
|
label = intl.formatMessage(props.intlMessage);
|
|
131
146
|
}
|
|
132
147
|
|
|
133
|
-
var dataAttributeProps = _objectSpread$
|
|
148
|
+
var dataAttributeProps = _objectSpread$7({
|
|
134
149
|
'data-track-event': 'click'
|
|
135
150
|
}, label && {
|
|
136
151
|
'data-track-component': startCase__default["default"](label)
|
|
137
152
|
});
|
|
138
153
|
|
|
139
154
|
warnIfMissingContent(props);
|
|
140
|
-
return jsxRuntime.jsx(reactRouterDom.Link, _objectSpread$
|
|
155
|
+
return jsxRuntime.jsx(reactRouterDom.Link, _objectSpread$7(_objectSpread$7(_objectSpread$7({
|
|
141
156
|
to: props.to,
|
|
142
157
|
css: getLinkStyles(isActive, isDisabled)
|
|
143
158
|
}, getDisabledLinkAtributes(isDisabled)), dataAttributeProps), {}, {
|
|
144
|
-
children: jsxRuntime.jsx("div", _objectSpread$
|
|
159
|
+
children: jsxRuntime.jsx("div", _objectSpread$7(_objectSpread$7({
|
|
145
160
|
role: "tab",
|
|
146
161
|
"aria-selected": isActive
|
|
147
162
|
}, getDisabledTabHeaderAriaAttributes(isDisabled)), {}, {
|
|
@@ -155,13 +170,13 @@ var TabHeader = function TabHeader(props) {
|
|
|
155
170
|
};
|
|
156
171
|
TabHeader.propTypes = {};
|
|
157
172
|
TabHeader.displayName = 'TabHeader';
|
|
158
|
-
var defaultProps$
|
|
173
|
+
var defaultProps$f = {
|
|
159
174
|
isDisabled: false,
|
|
160
175
|
exactPathMatch: false
|
|
161
176
|
};
|
|
162
|
-
TabHeader.defaultProps = defaultProps$
|
|
177
|
+
TabHeader.defaultProps = defaultProps$f;
|
|
163
178
|
|
|
164
|
-
var defaultProps$
|
|
179
|
+
var defaultProps$e = {
|
|
165
180
|
titleSize: 'small',
|
|
166
181
|
truncate: false
|
|
167
182
|
};
|
|
@@ -212,7 +227,7 @@ var renderSubtitle = function renderSubtitle(subtitle) {
|
|
|
212
227
|
});
|
|
213
228
|
};
|
|
214
229
|
|
|
215
|
-
var _ref$
|
|
230
|
+
var _ref$7 = {
|
|
216
231
|
name: "d3v9zr",
|
|
217
232
|
styles: "overflow:hidden"
|
|
218
233
|
} ;
|
|
@@ -228,27 +243,27 @@ var PageHeaderTitle = function PageHeaderTitle(props) {
|
|
|
228
243
|
});
|
|
229
244
|
var renderedSubtitle = renderSubtitle(props.subtitle, truncate);
|
|
230
245
|
return jsxRuntime.jsxs("div", {
|
|
231
|
-
css: _ref$
|
|
246
|
+
css: _ref$7,
|
|
232
247
|
children: [renderedTitle, renderedSubtitle]
|
|
233
248
|
});
|
|
234
249
|
};
|
|
235
250
|
|
|
236
251
|
PageHeaderTitle.propTypes = {};
|
|
237
252
|
PageHeaderTitle.displayName = 'PageHeaderTitle';
|
|
238
|
-
PageHeaderTitle.defaultProps = defaultProps$
|
|
253
|
+
PageHeaderTitle.defaultProps = defaultProps$e;
|
|
239
254
|
|
|
240
255
|
var TabControls = _styled__default["default"]("div", {
|
|
241
256
|
target: "elpldre1"
|
|
242
257
|
} )("margin-top:", designSystem.customProperties.spacingS, ";" + ("" ));
|
|
243
258
|
|
|
244
|
-
var _ref$
|
|
259
|
+
var _ref$6 = {
|
|
245
260
|
name: "1nrstx4",
|
|
246
261
|
styles: "display:flex;align-items:flex-end;justify-content:space-between"
|
|
247
262
|
} ;
|
|
248
263
|
|
|
249
264
|
var ControlsContainter = function ControlsContainter(props) {
|
|
250
265
|
return jsxRuntime.jsxs("div", {
|
|
251
|
-
css: _ref$
|
|
266
|
+
css: _ref$6,
|
|
252
267
|
children: [jsxRuntime.jsx(TabControls, {
|
|
253
268
|
role: "tablist",
|
|
254
269
|
children: props.tabControls
|
|
@@ -268,10 +283,10 @@ var TabularPageContainer = function TabularPageContainer(props) {
|
|
|
268
283
|
|
|
269
284
|
TabularPageContainer.propTypes = {};
|
|
270
285
|
TabularPageContainer.displayName = 'TabularPageContainer';
|
|
271
|
-
var defaultProps$
|
|
286
|
+
var defaultProps$d = {
|
|
272
287
|
color: 'surface'
|
|
273
288
|
};
|
|
274
|
-
TabularPageContainer.defaultProps = defaultProps$
|
|
289
|
+
TabularPageContainer.defaultProps = defaultProps$d;
|
|
275
290
|
|
|
276
291
|
var FormControlsContainer = _styled__default["default"]("div", {
|
|
277
292
|
target: "elpldre0"
|
|
@@ -293,9 +308,9 @@ function filterDataAttributes(obj) {
|
|
|
293
308
|
});
|
|
294
309
|
}
|
|
295
310
|
|
|
296
|
-
function ownKeys$
|
|
311
|
+
function ownKeys$6(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
297
312
|
|
|
298
|
-
function _objectSpread$
|
|
313
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$6(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$6(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
299
314
|
var primaryDefaultProps = {
|
|
300
315
|
label: i18n.sharedMessages.confirm,
|
|
301
316
|
isDisabled: false,
|
|
@@ -309,7 +324,7 @@ var useFormattedLabel = function useFormattedLabel(label) {
|
|
|
309
324
|
|
|
310
325
|
var FormPrimaryButton = function FormPrimaryButton(props) {
|
|
311
326
|
var label = useFormattedLabel(props.label);
|
|
312
|
-
return jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$
|
|
327
|
+
return jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$6({
|
|
313
328
|
label: label,
|
|
314
329
|
onClick: props.onClick,
|
|
315
330
|
isDisabled: props.isDisabled
|
|
@@ -327,7 +342,7 @@ var secondaryDefaultProps = {
|
|
|
327
342
|
|
|
328
343
|
var FormSecondaryButton = function FormSecondaryButton(props) {
|
|
329
344
|
var label = useFormattedLabel(props.label);
|
|
330
|
-
return jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$
|
|
345
|
+
return jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$6({
|
|
331
346
|
label: label,
|
|
332
347
|
onClick: props.onClick,
|
|
333
348
|
isDisabled: props.isDisabled
|
|
@@ -345,7 +360,7 @@ var deleteDefaultProps = {
|
|
|
345
360
|
|
|
346
361
|
var FormDeleteButton = function FormDeleteButton(props) {
|
|
347
362
|
var label = useFormattedLabel(props.label);
|
|
348
|
-
return jsxRuntime.jsx(IconButton__default["default"], _objectSpread$
|
|
363
|
+
return jsxRuntime.jsx(IconButton__default["default"], _objectSpread$6({
|
|
349
364
|
icon: jsxRuntime.jsx(icons.BinLinearIcon, {}),
|
|
350
365
|
label: label,
|
|
351
366
|
onClick: props.onClick,
|
|
@@ -357,7 +372,7 @@ FormDeleteButton.propTypes = {};
|
|
|
357
372
|
FormDeleteButton.displayName = 'FormDeleteButton';
|
|
358
373
|
FormDeleteButton.defaultProps = deleteDefaultProps;
|
|
359
374
|
|
|
360
|
-
var defaultProps$
|
|
375
|
+
var defaultProps$c = {
|
|
361
376
|
hideControls: false
|
|
362
377
|
};
|
|
363
378
|
|
|
@@ -390,7 +405,7 @@ var TabularMainPage = function TabularMainPage(props) {
|
|
|
390
405
|
|
|
391
406
|
TabularMainPage.propTypes = {};
|
|
392
407
|
TabularMainPage.displayName = 'TabularMainPage';
|
|
393
|
-
TabularMainPage.defaultProps = defaultProps$
|
|
408
|
+
TabularMainPage.defaultProps = defaultProps$c; // Static export of pre-configured form control buttons to easily re-use
|
|
394
409
|
// them in the custom controls.
|
|
395
410
|
|
|
396
411
|
TabularMainPage.FormPrimaryButton = FormPrimaryButton;
|
|
@@ -402,90 +417,6 @@ TabularMainPage.PageHeaderTitle = PageHeaderTitle; // This is a convenience prox
|
|
|
402
417
|
|
|
403
418
|
TabularMainPage.Intl = i18n.sharedMessages;
|
|
404
419
|
|
|
405
|
-
var messages$2 = reactIntl.defineMessages({
|
|
406
|
-
back: {
|
|
407
|
-
id: 'Components.ModalPage.TopBar.Back',
|
|
408
|
-
defaultMessage: 'Go Back'
|
|
409
|
-
},
|
|
410
|
-
close: {
|
|
411
|
-
id: 'Components.ModalPage.TopBar.Close',
|
|
412
|
-
defaultMessage: 'Close Modal Page'
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
var defaultProps$a = {
|
|
417
|
-
color: 'surface',
|
|
418
|
-
previousPathLabel: messages$2.back
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
var PageTopBar = function PageTopBar(props) {
|
|
422
|
-
var intl = reactIntl.useIntl();
|
|
423
|
-
return jsxRuntime.jsx("div", {
|
|
424
|
-
css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;background-color:", props.color === 'neutral' ? designSystem.customProperties.colorNeutral95 : designSystem.customProperties.colorSurface, ";" + ("" ), "" ),
|
|
425
|
-
children: jsxRuntime.jsx(FlatButton__default["default"], {
|
|
426
|
-
tone: "primary",
|
|
427
|
-
label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
|
|
428
|
-
icon: jsxRuntime.jsx(icons.ListIcon, {
|
|
429
|
-
size: "medium",
|
|
430
|
-
color: "primary"
|
|
431
|
-
}),
|
|
432
|
-
onClick: props.onClick
|
|
433
|
-
})
|
|
434
|
-
});
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
PageTopBar.propTypes = {};
|
|
438
|
-
PageTopBar.displayName = 'PageTopBar';
|
|
439
|
-
PageTopBar.defaultProps = defaultProps$a;
|
|
440
|
-
|
|
441
|
-
var defaultProps$9 = {
|
|
442
|
-
hideControls: false
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
var TabularDetailPage = function TabularDetailPage(props) {
|
|
446
|
-
var _props$title;
|
|
447
|
-
return jsxRuntime.jsxs(PageWrapper, {
|
|
448
|
-
children: [jsxRuntime.jsx(TabularPageContainer, {
|
|
449
|
-
color: "neutral",
|
|
450
|
-
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
451
|
-
children: [jsxRuntime.jsx(PageTopBar, {
|
|
452
|
-
color: "neutral",
|
|
453
|
-
previousPathLabel: props.previousPathLabel,
|
|
454
|
-
onClick: props.onPreviousPathClick
|
|
455
|
-
}), props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
|
|
456
|
-
title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
|
|
457
|
-
subtitle: props.subtitle,
|
|
458
|
-
titleSize: "big"
|
|
459
|
-
}), jsxRuntime.jsx(ControlsContainter, {
|
|
460
|
-
tabControls: props.tabControls,
|
|
461
|
-
formControls: jsxRuntime.jsx(FormControlsContainer, {
|
|
462
|
-
children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
|
|
463
|
-
alignItems: "flex-end",
|
|
464
|
-
children: props.formControls
|
|
465
|
-
})
|
|
466
|
-
})
|
|
467
|
-
})]
|
|
468
|
-
})
|
|
469
|
-
}), jsxRuntime.jsx(ContentWrapper, {
|
|
470
|
-
children: props.children
|
|
471
|
-
})]
|
|
472
|
-
});
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
TabularDetailPage.propTypes = {};
|
|
476
|
-
TabularDetailPage.displayName = 'TabularDetailPage';
|
|
477
|
-
TabularDetailPage.defaultProps = defaultProps$9; // Static export of pre-configured form control buttons to easily re-use
|
|
478
|
-
// them in the custom controls.
|
|
479
|
-
|
|
480
|
-
TabularDetailPage.FormPrimaryButton = FormPrimaryButton;
|
|
481
|
-
TabularDetailPage.FormSecondaryButton = FormSecondaryButton;
|
|
482
|
-
TabularDetailPage.FormDeleteButton = FormDeleteButton; // Static export of pre-configured page header title component to easily
|
|
483
|
-
// use as part of a custom title row
|
|
484
|
-
|
|
485
|
-
TabularDetailPage.PageHeaderTitle = PageHeaderTitle; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
486
|
-
|
|
487
|
-
TabularDetailPage.Intl = i18n.sharedMessages;
|
|
488
|
-
|
|
489
420
|
var getConstraintForGridStyle = function getConstraintForGridStyle(size) {
|
|
490
421
|
switch (size) {
|
|
491
422
|
case 7:
|
|
@@ -518,23 +449,31 @@ var getModalContentStyles = function getModalContentStyles(props) {
|
|
|
518
449
|
var baseStyles = /*#__PURE__*/react.css("display:grid;height:100%;width:100%;outline:none;pointer-events:none;", gridStyle, ";" + ("" ), "" );
|
|
519
450
|
return baseStyles;
|
|
520
451
|
};
|
|
452
|
+
var getOverlayStyles$1 = function getOverlayStyles(props) {
|
|
453
|
+
return /*#__PURE__*/react.css("display:flex;position:absolute;z-index:", typeof props.zIndex === 'number' ? // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
|
|
454
|
+
"".concat(props.zIndex, " !important") : 'auto', ";top:0;width:100%;height:100%;background-color:rgba(32, 62, 72, 0.5);opacity:1;" + ("" ), "" );
|
|
455
|
+
};
|
|
521
456
|
|
|
522
|
-
var
|
|
523
|
-
name: "181loe0",
|
|
524
|
-
styles: "display:flex;position:absolute;top:0;width:100%;height:100%;background-color:rgba(32, 62, 72, 0.5);opacity:1"
|
|
525
|
-
} ;
|
|
457
|
+
function ownKeys$5(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
526
458
|
|
|
527
|
-
var
|
|
528
|
-
return _ref$6;
|
|
529
|
-
};
|
|
459
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
530
460
|
|
|
531
461
|
var getDefaultParentSelector$1 = function getDefaultParentSelector() {
|
|
532
462
|
return document.querySelector("#".concat(constants.PORTALS_CONTAINER_ID));
|
|
533
463
|
};
|
|
534
464
|
|
|
535
|
-
var
|
|
465
|
+
var getOverlayElement$1 = function getOverlayElement(props, contentElement) {
|
|
466
|
+
return (// Assign the `data-role` to the overlay container, which is used as
|
|
467
|
+
// the CSS selector in the `<PortalsContainer>`.
|
|
468
|
+
jsxRuntime.jsx("div", _objectSpread$5(_objectSpread$5({}, props), {}, {
|
|
469
|
+
"data-role": "dialog-overlay",
|
|
470
|
+
children: contentElement
|
|
471
|
+
}))
|
|
472
|
+
);
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
var defaultProps$b = {
|
|
536
476
|
size: 10,
|
|
537
|
-
zIndex: 1000,
|
|
538
477
|
getParentSelector: getDefaultParentSelector$1
|
|
539
478
|
};
|
|
540
479
|
|
|
@@ -568,17 +507,12 @@ var DialogContainer = function DialogContainer(props) {
|
|
|
568
507
|
onRequestClose: props.onClose,
|
|
569
508
|
shouldCloseOnOverlayClick: Boolean(props.onClose),
|
|
570
509
|
shouldCloseOnEsc: Boolean(props.onClose),
|
|
571
|
-
|
|
510
|
+
overlayElement: getOverlayElement$1,
|
|
511
|
+
overlayClassName: makeClassName(getOverlayStyles$1(props)),
|
|
572
512
|
className: makeClassName(getModalContentStyles(props)),
|
|
573
513
|
contentLabel: props.title,
|
|
574
514
|
parentSelector: props.getParentSelector,
|
|
575
515
|
ariaHideApp: false,
|
|
576
|
-
style: {
|
|
577
|
-
// stylelint-disable-next-line selector-type-no-unknown
|
|
578
|
-
overlay: {
|
|
579
|
-
zIndex: props.zIndex
|
|
580
|
-
}
|
|
581
|
-
},
|
|
582
516
|
children: [jsxRuntime.jsx(GridArea, {
|
|
583
517
|
name: "top"
|
|
584
518
|
}), jsxRuntime.jsx(GridArea, {
|
|
@@ -608,7 +542,7 @@ var DialogContainer = function DialogContainer(props) {
|
|
|
608
542
|
|
|
609
543
|
DialogContainer.propTypes = {};
|
|
610
544
|
DialogContainer.displayName = 'DialogContainer';
|
|
611
|
-
DialogContainer.defaultProps = defaultProps$
|
|
545
|
+
DialogContainer.defaultProps = defaultProps$b;
|
|
612
546
|
|
|
613
547
|
var _ref$4 = {
|
|
614
548
|
name: "o5s7gs",
|
|
@@ -665,10 +599,10 @@ var InfoDialog = function InfoDialog(props) {
|
|
|
665
599
|
InfoDialog.propTypes = {};
|
|
666
600
|
InfoDialog.displayName = 'InfoDialog';
|
|
667
601
|
|
|
668
|
-
function ownKeys$
|
|
602
|
+
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
669
603
|
|
|
670
|
-
function _objectSpread$
|
|
671
|
-
var defaultProps$
|
|
604
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
605
|
+
var defaultProps$a = {
|
|
672
606
|
isPrimaryButtonDisabled: false,
|
|
673
607
|
dataAttributesPrimaryButton: {},
|
|
674
608
|
dataAttributesSecondaryButton: {}
|
|
@@ -684,10 +618,10 @@ var DialogFooter = function DialogFooter(props) {
|
|
|
684
618
|
scale: "m",
|
|
685
619
|
alignItems: "center",
|
|
686
620
|
justifyContent: "flex-end",
|
|
687
|
-
children: [jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$
|
|
621
|
+
children: [jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$4({
|
|
688
622
|
label: getFormattedLabel(props.labelSecondary, intl),
|
|
689
623
|
onClick: props.onCancel
|
|
690
|
-
}, filterDataAttributes(props.dataAttributesSecondaryButton))), jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$
|
|
624
|
+
}, filterDataAttributes(props.dataAttributesSecondaryButton))), jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$4({
|
|
691
625
|
label: getFormattedLabel(props.labelPrimary, intl),
|
|
692
626
|
onClick: props.onConfirm,
|
|
693
627
|
isDisabled: props.isPrimaryButtonDisabled
|
|
@@ -697,9 +631,9 @@ var DialogFooter = function DialogFooter(props) {
|
|
|
697
631
|
|
|
698
632
|
DialogFooter.propTypes = {};
|
|
699
633
|
DialogFooter.displayName = 'DialogFooter';
|
|
700
|
-
DialogFooter.defaultProps = defaultProps$
|
|
634
|
+
DialogFooter.defaultProps = defaultProps$a;
|
|
701
635
|
|
|
702
|
-
var defaultProps$
|
|
636
|
+
var defaultProps$9 = {
|
|
703
637
|
labelSecondary: i18n.sharedMessages.cancel,
|
|
704
638
|
labelPrimary: i18n.sharedMessages.confirm
|
|
705
639
|
};
|
|
@@ -731,12 +665,12 @@ var ConfirmationDialog = function ConfirmationDialog(props) {
|
|
|
731
665
|
|
|
732
666
|
ConfirmationDialog.propTypes = {};
|
|
733
667
|
ConfirmationDialog.displayName = 'ConfirmationDialog';
|
|
734
|
-
ConfirmationDialog.defaultProps = defaultProps$
|
|
668
|
+
ConfirmationDialog.defaultProps = defaultProps$9; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
735
669
|
// The Intl messages can be used for button labels.
|
|
736
670
|
|
|
737
671
|
ConfirmationDialog.Intl = i18n.sharedMessages;
|
|
738
672
|
|
|
739
|
-
var defaultProps$
|
|
673
|
+
var defaultProps$8 = {
|
|
740
674
|
labelSecondary: i18n.sharedMessages.cancel,
|
|
741
675
|
labelPrimary: i18n.sharedMessages.save
|
|
742
676
|
};
|
|
@@ -768,17 +702,18 @@ var FormDialog = function FormDialog(props) {
|
|
|
768
702
|
|
|
769
703
|
FormDialog.propTypes = {};
|
|
770
704
|
FormDialog.displayName = 'FormDialog';
|
|
771
|
-
FormDialog.defaultProps = defaultProps$
|
|
705
|
+
FormDialog.defaultProps = defaultProps$8; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
772
706
|
// The Intl messages can be used for button labels.
|
|
773
707
|
|
|
774
708
|
FormDialog.Intl = i18n.sharedMessages;
|
|
775
709
|
|
|
776
710
|
var TRANSITION_DURATION = 200;
|
|
777
|
-
var getContainerStyles = function getContainerStyles(
|
|
778
|
-
return /*#__PURE__*/react.css("position:absolute;top:0;right:0;height:100%;width:
|
|
711
|
+
var getContainerStyles = function getContainerStyles(_props) {
|
|
712
|
+
return /*#__PURE__*/react.css("position:absolute;top:0;right:0;height:100%;width:100%;display:flex;flex-direction:column;background-color:", designSystem.customProperties.colorSurface, ";box-shadow:", designSystem.customProperties.shadow4, ",", designSystem.customProperties.shadow6, ";outline:0;transform:translate3d(30px, 0, 0);transition:transform ", TRANSITION_DURATION, "ms ease;" + ("" ), "" );
|
|
779
713
|
};
|
|
780
714
|
var getOverlayStyles = function getOverlayStyles(props) {
|
|
781
|
-
return /*#__PURE__*/react.css("position:absolute;z-index:", typeof props.zIndex === 'number' ?
|
|
715
|
+
return /*#__PURE__*/react.css("position:absolute;z-index:", typeof props.zIndex === 'number' ? // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
|
|
716
|
+
"".concat(props.zIndex, " !important") : 'auto', ";top:0;left:0;width:100%;height:100%;background-color:rgba(32, 62, 72, 0.5);opacity:0;transition:opacity ", TRANSITION_DURATION, "ms ease;" + ("" ), "" );
|
|
782
717
|
};
|
|
783
718
|
|
|
784
719
|
var _ref4 = {
|
|
@@ -817,6 +752,17 @@ var getBeforeCloseOverlayAnimation = function getBeforeCloseOverlayAnimation() {
|
|
|
817
752
|
return _ref$3;
|
|
818
753
|
};
|
|
819
754
|
|
|
755
|
+
var messages$2 = reactIntl.defineMessages({
|
|
756
|
+
back: {
|
|
757
|
+
id: 'Components.ModalPage.TopBar.Back',
|
|
758
|
+
defaultMessage: 'Go Back'
|
|
759
|
+
},
|
|
760
|
+
close: {
|
|
761
|
+
id: 'Components.ModalPage.TopBar.Close',
|
|
762
|
+
defaultMessage: 'Close Modal Page'
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
|
|
820
766
|
var LargeIconWrapper = _styled__default["default"]("span", {
|
|
821
767
|
target: "edipjip0"
|
|
822
768
|
} )({
|
|
@@ -827,7 +773,7 @@ var LargeIconWrapper = _styled__default["default"]("span", {
|
|
|
827
773
|
// does not recognize the object shape.
|
|
828
774
|
|
|
829
775
|
|
|
830
|
-
var defaultProps$
|
|
776
|
+
var defaultProps$7 = {
|
|
831
777
|
color: 'surface',
|
|
832
778
|
previousPathLabel: messages$2.back
|
|
833
779
|
};
|
|
@@ -876,18 +822,30 @@ var ModalPageTopBar = function ModalPageTopBar(props) {
|
|
|
876
822
|
|
|
877
823
|
ModalPageTopBar.propTypes = {};
|
|
878
824
|
ModalPageTopBar.displayName = 'ModalPageTopBar';
|
|
879
|
-
ModalPageTopBar.defaultProps = defaultProps$
|
|
825
|
+
ModalPageTopBar.defaultProps = defaultProps$7;
|
|
826
|
+
|
|
827
|
+
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
828
|
+
|
|
829
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$3(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
880
830
|
|
|
881
831
|
var getDefaultParentSelector = function getDefaultParentSelector() {
|
|
882
832
|
return document.querySelector("#".concat(constants.PORTALS_CONTAINER_ID));
|
|
833
|
+
};
|
|
834
|
+
|
|
835
|
+
var getOverlayElement = function getOverlayElement(props, contentElement) {
|
|
836
|
+
return (// Assign the `data-role` to the overlay container, which is used as
|
|
837
|
+
// the CSS selector in the `<PortalsContainer>`.
|
|
838
|
+
jsxRuntime.jsx("div", _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
839
|
+
"data-role": "modal-overlay",
|
|
840
|
+
children: contentElement
|
|
841
|
+
}))
|
|
842
|
+
);
|
|
883
843
|
}; // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
|
|
884
844
|
// However, we need to explicitly define this otherwise the prop-types babel plugin
|
|
885
845
|
// does not recognize the object shape.
|
|
886
846
|
|
|
887
847
|
|
|
888
|
-
var defaultProps$
|
|
889
|
-
level: 1,
|
|
890
|
-
baseZIndex: 1000,
|
|
848
|
+
var defaultProps$6 = {
|
|
891
849
|
getParentSelector: getDefaultParentSelector,
|
|
892
850
|
shouldDelayOnClose: true
|
|
893
851
|
};
|
|
@@ -932,13 +890,14 @@ var ModalPage = function ModalPage(props) {
|
|
|
932
890
|
onRequestClose: handleClose,
|
|
933
891
|
shouldCloseOnOverlayClick: Boolean(props.onClose),
|
|
934
892
|
shouldCloseOnEsc: Boolean(props.onClose),
|
|
893
|
+
overlayElement: getOverlayElement,
|
|
935
894
|
overlayClassName: {
|
|
936
895
|
base: makeClassName(getOverlayStyles(props)),
|
|
937
896
|
afterOpen: makeClassName(getAfterOpenOverlayAnimation()),
|
|
938
897
|
beforeClose: makeClassName(getBeforeCloseOverlayAnimation())
|
|
939
898
|
},
|
|
940
899
|
className: {
|
|
941
|
-
base: makeClassName(getContainerStyles(
|
|
900
|
+
base: makeClassName(getContainerStyles()),
|
|
942
901
|
afterOpen: typeof props.afterOpenStyles === 'string' ? props.afterOpenStyles : makeClassName((_props$afterOpenStyle = props.afterOpenStyles) !== null && _props$afterOpenStyle !== void 0 ? _props$afterOpenStyle : getAfterOpenContainerAnimation()),
|
|
943
902
|
beforeClose: makeClassName(getBeforeCloseContainerAnimation())
|
|
944
903
|
},
|
|
@@ -966,7 +925,7 @@ var ModalPage = function ModalPage(props) {
|
|
|
966
925
|
|
|
967
926
|
ModalPage.propTypes = {};
|
|
968
927
|
ModalPage.displayName = 'ModalPage';
|
|
969
|
-
ModalPage.defaultProps = defaultProps$
|
|
928
|
+
ModalPage.defaultProps = defaultProps$6;
|
|
970
929
|
|
|
971
930
|
var PageHeader = function PageHeader(props) {
|
|
972
931
|
return jsxRuntime.jsxs("div", {
|
|
@@ -984,12 +943,10 @@ PageHeader.displayName = 'PageHeader';
|
|
|
984
943
|
|
|
985
944
|
var InfoModalPage = function InfoModalPage(props) {
|
|
986
945
|
return jsxRuntime.jsxs(ModalPage, {
|
|
987
|
-
level: props.level,
|
|
988
946
|
title: props.title,
|
|
989
947
|
isOpen: props.isOpen,
|
|
990
948
|
zIndex: props.zIndex,
|
|
991
949
|
onClose: props.onClose,
|
|
992
|
-
baseZIndex: props.baseZIndex,
|
|
993
950
|
currentPathLabel: props.topBarCurrentPathLabel || props.title,
|
|
994
951
|
previousPathLabel: props.topBarPreviousPathLabel,
|
|
995
952
|
shouldDelayOnClose: props.shouldDelayOnClose,
|
|
@@ -1009,12 +966,10 @@ InfoModalPage.displayName = 'InfoModalPage';
|
|
|
1009
966
|
|
|
1010
967
|
var CustomFormModalPage = function CustomFormModalPage(props) {
|
|
1011
968
|
return jsxRuntime.jsxs(ModalPage, {
|
|
1012
|
-
level: props.level,
|
|
1013
969
|
title: props.title,
|
|
1014
970
|
isOpen: props.isOpen,
|
|
1015
971
|
zIndex: props.zIndex,
|
|
1016
972
|
onClose: props.onClose,
|
|
1017
|
-
baseZIndex: props.baseZIndex,
|
|
1018
973
|
currentPathLabel: props.topBarCurrentPathLabel || props.title,
|
|
1019
974
|
previousPathLabel: props.topBarPreviousPathLabel,
|
|
1020
975
|
getParentSelector: props.getParentSelector,
|
|
@@ -1044,19 +999,17 @@ CustomFormModalPage.FormDeleteButton = FormDeleteButton; // This is a convenienc
|
|
|
1044
999
|
|
|
1045
1000
|
CustomFormModalPage.Intl = i18n.sharedMessages;
|
|
1046
1001
|
|
|
1047
|
-
var defaultProps$
|
|
1002
|
+
var defaultProps$5 = {
|
|
1048
1003
|
hideControls: false
|
|
1049
1004
|
};
|
|
1050
1005
|
|
|
1051
1006
|
var FormModalPage = function FormModalPage(props) {
|
|
1052
1007
|
return jsxRuntime.jsx(CustomFormModalPage, {
|
|
1053
|
-
level: props.level,
|
|
1054
1008
|
title: props.title,
|
|
1055
1009
|
subtitle: props.subtitle,
|
|
1056
1010
|
isOpen: props.isOpen,
|
|
1057
1011
|
zIndex: props.zIndex,
|
|
1058
1012
|
onClose: props.onClose,
|
|
1059
|
-
baseZIndex: props.baseZIndex,
|
|
1060
1013
|
topBarCurrentPathLabel: props.topBarCurrentPathLabel,
|
|
1061
1014
|
topBarPreviousPathLabel: props.topBarPreviousPathLabel,
|
|
1062
1015
|
getParentSelector: props.getParentSelector,
|
|
@@ -1082,23 +1035,21 @@ var FormModalPage = function FormModalPage(props) {
|
|
|
1082
1035
|
|
|
1083
1036
|
FormModalPage.propTypes = {};
|
|
1084
1037
|
FormModalPage.displayName = 'FormModalPage';
|
|
1085
|
-
FormModalPage.defaultProps = defaultProps$
|
|
1038
|
+
FormModalPage.defaultProps = defaultProps$5; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
1086
1039
|
// The Intl messages can be used for button labels.
|
|
1087
1040
|
|
|
1088
1041
|
FormModalPage.Intl = i18n.sharedMessages;
|
|
1089
1042
|
|
|
1090
|
-
var defaultProps$
|
|
1043
|
+
var defaultProps$4 = {
|
|
1091
1044
|
hideControls: false
|
|
1092
1045
|
};
|
|
1093
1046
|
|
|
1094
1047
|
var TabularModalPage = function TabularModalPage(props) {
|
|
1095
1048
|
return jsxRuntime.jsxs(ModalPage, {
|
|
1096
|
-
level: props.level,
|
|
1097
1049
|
title: props.title,
|
|
1098
1050
|
isOpen: props.isOpen,
|
|
1099
1051
|
zIndex: props.zIndex,
|
|
1100
1052
|
onClose: props.onClose,
|
|
1101
|
-
baseZIndex: props.baseZIndex,
|
|
1102
1053
|
topBarColor: "neutral",
|
|
1103
1054
|
currentPathLabel: props.topBarCurrentPathLabel || props.title,
|
|
1104
1055
|
previousPathLabel: props.topBarPreviousPathLabel,
|
|
@@ -1130,7 +1081,7 @@ var TabularModalPage = function TabularModalPage(props) {
|
|
|
1130
1081
|
|
|
1131
1082
|
TabularModalPage.propTypes = {};
|
|
1132
1083
|
TabularModalPage.displayName = 'TabularModalPage';
|
|
1133
|
-
TabularModalPage.defaultProps = defaultProps$
|
|
1084
|
+
TabularModalPage.defaultProps = defaultProps$4; // Static export of pre-configured form control buttons to easily re-use
|
|
1134
1085
|
// them in the custom controls.
|
|
1135
1086
|
|
|
1136
1087
|
TabularModalPage.FormPrimaryButton = FormPrimaryButton;
|
|
@@ -1140,6 +1091,187 @@ TabularModalPage.FormDeleteButton = FormDeleteButton; // This is a convenience p
|
|
|
1140
1091
|
|
|
1141
1092
|
TabularModalPage.Intl = i18n.sharedMessages;
|
|
1142
1093
|
|
|
1094
|
+
var defaultProps$3 = {
|
|
1095
|
+
color: 'surface',
|
|
1096
|
+
previousPathLabel: messages$2.back
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1099
|
+
var PageTopBar = function PageTopBar(props) {
|
|
1100
|
+
var intl = reactIntl.useIntl();
|
|
1101
|
+
return jsxRuntime.jsx("div", {
|
|
1102
|
+
css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;background-color:", props.color === 'neutral' ? designSystem.customProperties.colorNeutral95 : designSystem.customProperties.colorSurface, ";" + ("" ), "" ),
|
|
1103
|
+
children: jsxRuntime.jsx(FlatButton__default["default"], {
|
|
1104
|
+
tone: "primary",
|
|
1105
|
+
label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
|
|
1106
|
+
icon: jsxRuntime.jsx(icons.ListIcon, {
|
|
1107
|
+
size: "medium",
|
|
1108
|
+
color: "primary"
|
|
1109
|
+
}),
|
|
1110
|
+
onClick: props.onClick
|
|
1111
|
+
})
|
|
1112
|
+
});
|
|
1113
|
+
};
|
|
1114
|
+
|
|
1115
|
+
PageTopBar.propTypes = {};
|
|
1116
|
+
PageTopBar.displayName = 'PageTopBar';
|
|
1117
|
+
PageTopBar.defaultProps = defaultProps$3;
|
|
1118
|
+
|
|
1119
|
+
var DetailPageContainer = _styled__default["default"]("div", {
|
|
1120
|
+
target: "etkdonc0"
|
|
1121
|
+
} )("background-color:", designSystem.customProperties.colorNeutral95, ";padding:", designSystem.customProperties.spacingM, ";border-bottom:1px ", designSystem.customProperties.colorNeutral, " solid;" + ("" )); // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
|
|
1122
|
+
// However, we need to explicitly define this otherwise the prop-types babel plugin
|
|
1123
|
+
// does not recognize the object shape.
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
var defaultProps$2 = {
|
|
1127
|
+
hideControls: false
|
|
1128
|
+
};
|
|
1129
|
+
|
|
1130
|
+
var CustomFormDetailPage = function CustomFormDetailPage(props) {
|
|
1131
|
+
var _props$title;
|
|
1132
|
+
return jsxRuntime.jsxs(PageWrapper, {
|
|
1133
|
+
children: [jsxRuntime.jsx(DetailPageContainer, {
|
|
1134
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
1135
|
+
children: [jsxRuntime.jsx(PageTopBar, {
|
|
1136
|
+
color: "neutral",
|
|
1137
|
+
previousPathLabel: props.previousPathLabel,
|
|
1138
|
+
onClick: props.onPreviousPathClick
|
|
1139
|
+
}), props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
|
|
1140
|
+
title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
|
|
1141
|
+
subtitle: props.subtitle,
|
|
1142
|
+
titleSize: "big"
|
|
1143
|
+
}), !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
|
|
1144
|
+
justifyContent: "flex-end",
|
|
1145
|
+
children: props.formControls
|
|
1146
|
+
})]
|
|
1147
|
+
})
|
|
1148
|
+
}), jsxRuntime.jsx(ContentWrapper, {
|
|
1149
|
+
children: props.children
|
|
1150
|
+
})]
|
|
1151
|
+
});
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
CustomFormDetailPage.propTypes = {};
|
|
1155
|
+
CustomFormDetailPage.displayName = 'CustomFormDetailPage';
|
|
1156
|
+
CustomFormDetailPage.defaultProps = defaultProps$2; // Static export of pre-configured page header title component to easily
|
|
1157
|
+
// use as part of a custom title row
|
|
1158
|
+
|
|
1159
|
+
CustomFormDetailPage.PageHeaderTitle = PageHeaderTitle; // Static export of pre-configured form control buttons to easily re-use
|
|
1160
|
+
// them in the custom controls.
|
|
1161
|
+
|
|
1162
|
+
CustomFormDetailPage.FormPrimaryButton = FormPrimaryButton;
|
|
1163
|
+
CustomFormDetailPage.FormSecondaryButton = FormSecondaryButton;
|
|
1164
|
+
CustomFormDetailPage.FormDeleteButton = FormDeleteButton; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
1165
|
+
// The Intl messages can be used for button labels.
|
|
1166
|
+
|
|
1167
|
+
CustomFormDetailPage.Intl = i18n.sharedMessages;
|
|
1168
|
+
|
|
1169
|
+
var defaultProps$1 = {
|
|
1170
|
+
hideControls: false
|
|
1171
|
+
};
|
|
1172
|
+
|
|
1173
|
+
var FormDetailPage = function FormDetailPage(props) {
|
|
1174
|
+
return jsxRuntime.jsx(CustomFormDetailPage, {
|
|
1175
|
+
title: props.title,
|
|
1176
|
+
subtitle: props.subtitle,
|
|
1177
|
+
customTitleRow: props.customTitleRow,
|
|
1178
|
+
previousPathLabel: props.previousPathLabel,
|
|
1179
|
+
onPreviousPathClick: props.onPreviousPathClick,
|
|
1180
|
+
hideControls: props.hideControls,
|
|
1181
|
+
formControls: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1182
|
+
children: [jsxRuntime.jsx(CustomFormDetailPage.FormSecondaryButton, {
|
|
1183
|
+
label: props.labelSecondaryButton,
|
|
1184
|
+
onClick: props.onSecondaryButtonClick,
|
|
1185
|
+
isDisabled: props.isSecondaryButtonDisabled,
|
|
1186
|
+
dataAttributes: props.dataAttributesSecondaryButton
|
|
1187
|
+
}), jsxRuntime.jsx(CustomFormDetailPage.FormPrimaryButton, {
|
|
1188
|
+
label: props.labelPrimaryButton,
|
|
1189
|
+
onClick: props.onPrimaryButtonClick,
|
|
1190
|
+
isDisabled: props.isPrimaryButtonDisabled,
|
|
1191
|
+
dataAttributes: props.dataAttributesPrimaryButton
|
|
1192
|
+
})]
|
|
1193
|
+
}),
|
|
1194
|
+
children: props.children
|
|
1195
|
+
});
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
FormDetailPage.propTypes = {};
|
|
1199
|
+
FormDetailPage.displayName = 'FormDetailPage';
|
|
1200
|
+
FormDetailPage.defaultProps = defaultProps$1; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
1201
|
+
// The Intl messages can be used for button labels.
|
|
1202
|
+
// Static export of pre-configured page header title component to easily
|
|
1203
|
+
// use as part of a custom title row
|
|
1204
|
+
|
|
1205
|
+
FormDetailPage.PageHeaderTitle = PageHeaderTitle; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
1206
|
+
// The Intl messages can be used for button labels.
|
|
1207
|
+
|
|
1208
|
+
FormDetailPage.Intl = i18n.sharedMessages;
|
|
1209
|
+
|
|
1210
|
+
var InfoDetailPage = function InfoDetailPage(props) {
|
|
1211
|
+
return jsxRuntime.jsx(CustomFormDetailPage, {
|
|
1212
|
+
title: props.title,
|
|
1213
|
+
subtitle: props.subtitle,
|
|
1214
|
+
customTitleRow: props.customTitleRow,
|
|
1215
|
+
previousPathLabel: props.previousPathLabel,
|
|
1216
|
+
onPreviousPathClick: props.onPreviousPathClick,
|
|
1217
|
+
children: props.children
|
|
1218
|
+
});
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1221
|
+
InfoDetailPage.propTypes = {};
|
|
1222
|
+
InfoDetailPage.displayName = 'InfoDetailPage'; // Static export of pre-configured page header title component to easily
|
|
1223
|
+
// use as part of a custom title row
|
|
1224
|
+
|
|
1225
|
+
InfoDetailPage.PageHeaderTitle = PageHeaderTitle;
|
|
1226
|
+
|
|
1227
|
+
var defaultProps = {
|
|
1228
|
+
hideControls: false
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1231
|
+
var TabularDetailPage = function TabularDetailPage(props) {
|
|
1232
|
+
var _props$title;
|
|
1233
|
+
return jsxRuntime.jsxs(PageWrapper, {
|
|
1234
|
+
children: [jsxRuntime.jsx(TabularPageContainer, {
|
|
1235
|
+
color: "neutral",
|
|
1236
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
1237
|
+
children: [jsxRuntime.jsx(PageTopBar, {
|
|
1238
|
+
color: "neutral",
|
|
1239
|
+
previousPathLabel: props.previousPathLabel,
|
|
1240
|
+
onClick: props.onPreviousPathClick
|
|
1241
|
+
}), props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
|
|
1242
|
+
title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
|
|
1243
|
+
subtitle: props.subtitle,
|
|
1244
|
+
titleSize: "big"
|
|
1245
|
+
}), jsxRuntime.jsx(ControlsContainter, {
|
|
1246
|
+
tabControls: props.tabControls,
|
|
1247
|
+
formControls: jsxRuntime.jsx(FormControlsContainer, {
|
|
1248
|
+
children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
|
|
1249
|
+
alignItems: "flex-end",
|
|
1250
|
+
children: props.formControls
|
|
1251
|
+
})
|
|
1252
|
+
})
|
|
1253
|
+
})]
|
|
1254
|
+
})
|
|
1255
|
+
}), jsxRuntime.jsx(ContentWrapper, {
|
|
1256
|
+
children: props.children
|
|
1257
|
+
})]
|
|
1258
|
+
});
|
|
1259
|
+
};
|
|
1260
|
+
|
|
1261
|
+
TabularDetailPage.propTypes = {};
|
|
1262
|
+
TabularDetailPage.displayName = 'TabularDetailPage';
|
|
1263
|
+
TabularDetailPage.defaultProps = defaultProps; // Static export of pre-configured form control buttons to easily re-use
|
|
1264
|
+
// them in the custom controls.
|
|
1265
|
+
|
|
1266
|
+
TabularDetailPage.FormPrimaryButton = FormPrimaryButton;
|
|
1267
|
+
TabularDetailPage.FormSecondaryButton = FormSecondaryButton;
|
|
1268
|
+
TabularDetailPage.FormDeleteButton = FormDeleteButton; // Static export of pre-configured page header title component to easily
|
|
1269
|
+
// use as part of a custom title row
|
|
1270
|
+
|
|
1271
|
+
TabularDetailPage.PageHeaderTitle = PageHeaderTitle; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
1272
|
+
|
|
1273
|
+
TabularDetailPage.Intl = i18n.sharedMessages;
|
|
1274
|
+
|
|
1143
1275
|
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1144
1276
|
|
|
1145
1277
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
@@ -1341,14 +1473,80 @@ var PageUnauthorized = function PageUnauthorized() {
|
|
|
1341
1473
|
};
|
|
1342
1474
|
PageUnauthorized.displayName = 'PageUnauthorized';
|
|
1343
1475
|
|
|
1344
|
-
var
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
containerSelectorToPreventScrollingOnOpen: 'main',
|
|
1349
|
-
zIndex: 10000
|
|
1476
|
+
var _mutationObserver;
|
|
1477
|
+
|
|
1478
|
+
var getMutationObserver = function getMutationObserver(options) {
|
|
1479
|
+
return !_mutationObserver ? _mutationObserver = createMutationObserver(options) : _mutationObserver;
|
|
1350
1480
|
};
|
|
1351
1481
|
|
|
1482
|
+
function useMutationObserver(target, callback, options) {
|
|
1483
|
+
var mutationObserver = getMutationObserver(options);
|
|
1484
|
+
var storedCallback = useLatest__default["default"](callback);
|
|
1485
|
+
react$1.useLayoutEffect(function () {
|
|
1486
|
+
var didUnsubscribe = false;
|
|
1487
|
+
var targetEl = target && 'current' in target ? target.current : target;
|
|
1488
|
+
if (!targetEl) return function () {};
|
|
1489
|
+
|
|
1490
|
+
function cb(entry, observer) {
|
|
1491
|
+
if (didUnsubscribe) return;
|
|
1492
|
+
storedCallback.current(entry, observer);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
mutationObserver.subscribe(targetEl, cb);
|
|
1496
|
+
return function () {
|
|
1497
|
+
didUnsubscribe = true;
|
|
1498
|
+
mutationObserver.unsubscribe(targetEl, cb);
|
|
1499
|
+
};
|
|
1500
|
+
}, [target, mutationObserver, storedCallback]);
|
|
1501
|
+
return mutationObserver.observer;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
function createMutationObserver(options) {
|
|
1505
|
+
var callbacks = new _Map__default["default"]();
|
|
1506
|
+
var observer = new MutationObserver(rafSchd__default["default"](function (entries, obs) {
|
|
1507
|
+
var _loop = function _loop(i) {
|
|
1508
|
+
var cbs = callbacks.get(entries[i].target);
|
|
1509
|
+
cbs === null || cbs === void 0 ? void 0 : _forEachInstanceProperty__default["default"](cbs).call(cbs, function (cb) {
|
|
1510
|
+
return cb(entries[i], obs);
|
|
1511
|
+
});
|
|
1512
|
+
};
|
|
1513
|
+
|
|
1514
|
+
for (var i = 0; i < entries.length; i++) {
|
|
1515
|
+
_loop(i);
|
|
1516
|
+
}
|
|
1517
|
+
}));
|
|
1518
|
+
return {
|
|
1519
|
+
observer: observer,
|
|
1520
|
+
subscribe: function subscribe(target, callback) {
|
|
1521
|
+
var _callbacks$get;
|
|
1522
|
+
|
|
1523
|
+
observer.observe(target, options);
|
|
1524
|
+
var cbs = (_callbacks$get = callbacks.get(target)) !== null && _callbacks$get !== void 0 ? _callbacks$get : [];
|
|
1525
|
+
cbs.push(callback);
|
|
1526
|
+
callbacks.set(target, cbs);
|
|
1527
|
+
},
|
|
1528
|
+
unsubscribe: function unsubscribe(target, callback) {
|
|
1529
|
+
var _callbacks$get2;
|
|
1530
|
+
|
|
1531
|
+
var cbs = (_callbacks$get2 = callbacks.get(target)) !== null && _callbacks$get2 !== void 0 ? _callbacks$get2 : [];
|
|
1532
|
+
|
|
1533
|
+
if (cbs.length === 1) {
|
|
1534
|
+
observer.disconnect();
|
|
1535
|
+
callbacks.delete(target);
|
|
1536
|
+
return;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
var cbIndex = _indexOfInstanceProperty__default["default"](cbs).call(cbs, callback);
|
|
1540
|
+
|
|
1541
|
+
if (cbIndex !== -1) _spliceInstanceProperty__default["default"](cbs).call(cbs, cbIndex, 1);
|
|
1542
|
+
callbacks.set(target, cbs);
|
|
1543
|
+
}
|
|
1544
|
+
};
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
// The width of each indentation level.
|
|
1548
|
+
var indentationSize = '48px';
|
|
1549
|
+
|
|
1352
1550
|
var useObserverElementDimensions = function useObserverElementDimensions(element) {
|
|
1353
1551
|
var _useState = react$1.useState({
|
|
1354
1552
|
height: 0,
|
|
@@ -1374,23 +1572,81 @@ var _ref = {
|
|
|
1374
1572
|
} ;
|
|
1375
1573
|
|
|
1376
1574
|
var PortalsContainer = /*#__PURE__*/react$1.forwardRef(function (props, ref) {
|
|
1377
|
-
var _current, _current2;
|
|
1378
|
-
|
|
1575
|
+
var _props$offsetTop, _props$offsetLeft, _props$offsetLeftOnEx, _props$containerSelec, _props$zIndex, _props$baseModalZInde, _current, _current2, _context2;
|
|
1576
|
+
|
|
1577
|
+
// Initialize props with default values.
|
|
1578
|
+
// NOTE: using `defaultProps` with `forwardRef` results in the type declarations
|
|
1579
|
+
// to ignore the `defaultProps`. Therefore, the default props are typed
|
|
1580
|
+
// as optional and we initialize the value here with the default values.
|
|
1581
|
+
var offsetTop = (_props$offsetTop = props.offsetTop) !== null && _props$offsetTop !== void 0 ? _props$offsetTop : '0px';
|
|
1582
|
+
var offsetLeft = (_props$offsetLeft = props.offsetLeft) !== null && _props$offsetLeft !== void 0 ? _props$offsetLeft : '0px';
|
|
1583
|
+
var offsetLeftOnExpandedMenu = (_props$offsetLeftOnEx = props.offsetLeftOnExpandedMenu) !== null && _props$offsetLeftOnEx !== void 0 ? _props$offsetLeftOnEx : '0px';
|
|
1584
|
+
var containerSelectorToPreventScrollingOnOpen = (_props$containerSelec = props.containerSelectorToPreventScrollingOnOpen) !== null && _props$containerSelec !== void 0 ? _props$containerSelec : 'main';
|
|
1585
|
+
var zIndex = (_props$zIndex = props.zIndex) !== null && _props$zIndex !== void 0 ? _props$zIndex : 10000;
|
|
1586
|
+
var baseModalZIndex = (_props$baseModalZInde = props.baseModalZIndex) !== null && _props$baseModalZInde !== void 0 ? _props$baseModalZInde : 1000;
|
|
1587
|
+
var portalsContainerRef = react$1.useRef(null);
|
|
1379
1588
|
var globalNotificationsElementDimensions = useObserverElementDimensions(ref === null || ref === void 0 ? void 0 : (_current = ref.current) === null || _current === void 0 ? void 0 : _current.notificationsGlobalRef);
|
|
1380
1589
|
var pageNotificationsElementDimensions = useObserverElementDimensions(ref === null || ref === void 0 ? void 0 : (_current2 = ref.current) === null || _current2 === void 0 ? void 0 : _current2.notificationsPageRef);
|
|
1590
|
+
|
|
1591
|
+
var _useState3 = react$1.useState([]),
|
|
1592
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1593
|
+
stackingLayers = _useState4[0],
|
|
1594
|
+
setStackingLayers = _useState4[1]; // The mutation observer gets triggered every time a child node gets added or
|
|
1595
|
+
// removed from the portals container.
|
|
1596
|
+
// The stacking layers are then re-calculated.
|
|
1597
|
+
|
|
1598
|
+
|
|
1599
|
+
useMutationObserver(portalsContainerRef, function (mutation) {
|
|
1600
|
+
var _context;
|
|
1601
|
+
|
|
1602
|
+
var indentationLevel = 0;
|
|
1603
|
+
var nextStackingLevels = [];
|
|
1604
|
+
|
|
1605
|
+
_forEachInstanceProperty__default["default"](_context = mutation.target.childNodes).call(_context, function (node, index) {
|
|
1606
|
+
if (node instanceof HTMLElement) {
|
|
1607
|
+
var stackingLevel = index + 1;
|
|
1608
|
+
node.dataset.level = String(stackingLevel);
|
|
1609
|
+
var overlayNode = node.firstChild;
|
|
1610
|
+
|
|
1611
|
+
if (overlayNode instanceof HTMLElement) {
|
|
1612
|
+
if (overlayNode.dataset.role === 'modal-overlay') {
|
|
1613
|
+
indentationLevel += 1;
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
nextStackingLevels.push({
|
|
1618
|
+
stackingLevel: stackingLevel,
|
|
1619
|
+
indentationLevel: indentationLevel
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
});
|
|
1623
|
+
|
|
1624
|
+
setStackingLayers(nextStackingLevels);
|
|
1625
|
+
}, {
|
|
1626
|
+
// Only subscribe to changes to the child nodes of the portals container.
|
|
1627
|
+
childList: true
|
|
1628
|
+
});
|
|
1381
1629
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1382
1630
|
children: [jsxRuntime.jsx(react.Global // Apply some global styles, based on the `.ReactModal__Body--open` class.
|
|
1383
1631
|
, {
|
|
1384
|
-
styles: /*#__PURE__*/react.css(".ReactModal__Body--open ",
|
|
1632
|
+
styles: _concatInstanceProperty__default["default"](_context2 = [/*#__PURE__*/react.css(".ReactModal__Body--open ", containerSelectorToPreventScrollingOnOpen, "{overflow:hidden;}.ReactModal__Body--open #", constants.PORTALS_CONTAINER_ID, "{position:fixed;height:calc(\n 100% - ", offsetTop, " -\n ", globalNotificationsElementDimensions.height, "px -\n ", pageNotificationsElementDimensions.height, "px\n );width:calc(100% - ", offsetLeft, ");top:calc(\n ", offsetTop, " +\n ", globalNotificationsElementDimensions.height, "px +\n ", pageNotificationsElementDimensions.height, "px\n );right:0;bottom:0;z-index:", zIndex, ";}.ReactModal__Body--open.body__menu-open #", constants.PORTALS_CONTAINER_ID, "{width:calc(100% - ", offsetLeftOnExpandedMenu, ");}" + ("" ), "" )]).call(_context2, _toConsumableArray(_mapInstanceProperty__default["default"](stackingLayers).call(stackingLayers,
|
|
1633
|
+
/**
|
|
1634
|
+
* Every "overlay" container gets assigned a sequential `z-index` level.
|
|
1635
|
+
* Furthermore, the "modal overlay" containers (not "dialog") get assigned
|
|
1636
|
+
* the correct indentation level width.
|
|
1637
|
+
*/
|
|
1638
|
+
function (stackingLayer) {
|
|
1639
|
+
return /*#__PURE__*/react.css("#", constants.PORTALS_CONTAINER_ID, " .ReactModalPortal[data-level='", stackingLayer.stackingLevel, "'] [data-role$='overlay']{z-index:calc(\n ", baseModalZIndex, " + ", stackingLayer.stackingLevel, "\n );}#", constants.PORTALS_CONTAINER_ID, " .ReactModalPortal[data-level='", stackingLayer.stackingLevel, "'] [data-role='modal-overlay'] [role='dialog']{width:calc(\n 100% -\n (", indentationSize, " * ", stackingLayer.indentationLevel, ")\n );}" + ("" ), "" );
|
|
1640
|
+
})), ["" ])
|
|
1385
1641
|
}), jsxRuntime.jsx("div", {
|
|
1386
|
-
id: constants.PORTALS_CONTAINER_ID
|
|
1642
|
+
id: constants.PORTALS_CONTAINER_ID,
|
|
1643
|
+
ref: portalsContainerRef // The container needs a height in order to be tabbable: https://reactjs/react-modal#774
|
|
1387
1644
|
,
|
|
1388
1645
|
css: _ref
|
|
1389
1646
|
})]
|
|
1390
1647
|
});
|
|
1391
1648
|
});
|
|
1392
1649
|
PortalsContainer.displayName = 'PortalsContainer';
|
|
1393
|
-
PortalsContainer.defaultProps = defaultProps;
|
|
1394
1650
|
|
|
1395
1651
|
var useModalState = function useModalState() {
|
|
1396
1652
|
var isInitiallyOpen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -1414,9 +1670,12 @@ var useModalState = function useModalState() {
|
|
|
1414
1670
|
};
|
|
1415
1671
|
|
|
1416
1672
|
exports.ConfirmationDialog = ConfirmationDialog;
|
|
1673
|
+
exports.CustomFormDetailPage = CustomFormDetailPage;
|
|
1417
1674
|
exports.CustomFormModalPage = CustomFormModalPage;
|
|
1675
|
+
exports.FormDetailPage = FormDetailPage;
|
|
1418
1676
|
exports.FormDialog = FormDialog;
|
|
1419
1677
|
exports.FormModalPage = FormModalPage;
|
|
1678
|
+
exports.InfoDetailPage = InfoDetailPage;
|
|
1420
1679
|
exports.InfoDialog = InfoDialog;
|
|
1421
1680
|
exports.InfoModalPage = InfoModalPage;
|
|
1422
1681
|
exports.MaintenancePageLayout = MaintenancePageLayout;
|