@commercetools-frontend/application-components 22.12.0 → 22.13.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 +366 -256
- package/dist/commercetools-frontend-application-components.cjs.prod.js +269 -185
- package/dist/commercetools-frontend-application-components.esm.js +367 -257
- package/dist/declarations/src/components/detail-pages/custom-form-detail-page/custom-form-detail-page.d.ts +2 -2
- package/dist/declarations/src/components/detail-pages/form-detail-page/form-detail-page.d.ts +2 -2
- package/dist/declarations/src/components/detail-pages/info-detail-page/info-detail-page.d.ts +2 -2
- package/dist/declarations/src/components/detail-pages/tabular-detail-page/tabular-detail-page.d.ts +2 -2
- package/dist/declarations/src/components/drawer/drawer.d.ts +180 -0
- package/dist/declarations/src/components/drawer/index.d.ts +1 -0
- package/dist/declarations/src/components/internals/page-header-title.d.ts +2 -1
- package/dist/declarations/src/components/main-pages/custom-form-main-page/custom-form-main-page.d.ts +2 -2
- package/dist/declarations/src/components/main-pages/form-main-page/form-main-page.d.ts +2 -2
- package/dist/declarations/src/components/main-pages/info-main-page/info-main-page.d.ts +2 -2
- package/dist/declarations/src/components/main-pages/tabular-main-page/tabular-main-page.d.ts +2 -2
- package/dist/declarations/src/components/modal-pages/internals/modal-page-top-bar.d.ts +7 -1
- package/dist/declarations/src/components/modal-pages/internals/modal-page.d.ts +3 -1
- package/dist/declarations/src/components/modal-pages/internals/modal-page.styles.d.ts +22 -4
- package/dist/declarations/src/index.d.ts +1 -1
- package/package.json +9 -9
- package/dist/declarations/src/components/custom-views/custom-panel/custom-panel.d.ts +0 -9
- package/dist/declarations/src/components/custom-views/custom-panel/index.d.ts +0 -1
- package/dist/{public-page-layout-0e1daa2e.cjs.prod.js → public-page-layout-295bf2b5.cjs.prod.js} +2 -2
- package/dist/{public-page-layout-82978d93.esm.js → public-page-layout-c0dbc038.esm.js} +2 -2
- package/dist/{public-page-layout-4e26387d.cjs.dev.js → public-page-layout-e590ce5b.cjs.dev.js} +2 -2
|
@@ -40,9 +40,9 @@ var sentry = require('@commercetools-frontend/sentry');
|
|
|
40
40
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
41
41
|
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
42
42
|
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
43
|
-
var reactBroadcast = require('@flopflip/react-broadcast');
|
|
44
|
-
var FlatButton = require('@commercetools-uikit/flat-button');
|
|
45
43
|
var IconButton = require('@commercetools-uikit/icon-button');
|
|
44
|
+
var FlatButton = require('@commercetools-uikit/flat-button');
|
|
45
|
+
var reactBroadcast = require('@flopflip/react-broadcast');
|
|
46
46
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
47
47
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
48
48
|
var PageNotFoundSVG = require('@commercetools-frontend/assets/images/page-not-found.svg');
|
|
@@ -74,8 +74,8 @@ var omitBy__default = /*#__PURE__*/_interopDefault(omitBy);
|
|
|
74
74
|
var _setTimeout__default = /*#__PURE__*/_interopDefault(_setTimeout);
|
|
75
75
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
76
76
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
77
|
-
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
78
77
|
var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
|
|
78
|
+
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
79
79
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
80
80
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
81
81
|
var PageNotFoundSVG__default = /*#__PURE__*/_interopDefault(PageNotFoundSVG);
|
|
@@ -83,7 +83,7 @@ var FailedAuthorizationSVG__default = /*#__PURE__*/_interopDefault(FailedAuthori
|
|
|
83
83
|
var useResizeObserver__default = /*#__PURE__*/_interopDefault(useResizeObserver);
|
|
84
84
|
|
|
85
85
|
// NOTE: This string will be replaced on build time with the package version.
|
|
86
|
-
var version = "22.
|
|
86
|
+
var version = "22.13.0";
|
|
87
87
|
|
|
88
88
|
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9;
|
|
89
89
|
const appKitSpacing55 = '40px';
|
|
@@ -199,11 +199,11 @@ const TabHeader = props => {
|
|
|
199
199
|
};
|
|
200
200
|
TabHeader.propTypes = {};
|
|
201
201
|
TabHeader.displayName = 'TabHeader';
|
|
202
|
-
const defaultProps$
|
|
202
|
+
const defaultProps$j = {
|
|
203
203
|
isDisabled: false,
|
|
204
204
|
exactPathMatch: false
|
|
205
205
|
};
|
|
206
|
-
TabHeader.defaultProps = defaultProps$
|
|
206
|
+
TabHeader.defaultProps = defaultProps$j;
|
|
207
207
|
|
|
208
208
|
const getConstraintForGridStyle = size => {
|
|
209
209
|
switch (size) {
|
|
@@ -255,7 +255,7 @@ jsxRuntime.jsx("div", _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
|
255
255
|
"data-role": "dialog-overlay",
|
|
256
256
|
children: contentElement
|
|
257
257
|
}));
|
|
258
|
-
const defaultProps$
|
|
258
|
+
const defaultProps$i = {
|
|
259
259
|
// TODO: t-shirt sizes are deprecated but we need to keep using them for
|
|
260
260
|
// backwards compatibility and to help with styling migration
|
|
261
261
|
// After the migration is done, we should change this default value to 13.
|
|
@@ -324,7 +324,7 @@ const DialogContainer = props => jsxRuntime.jsx(react.ClassNames, {
|
|
|
324
324
|
});
|
|
325
325
|
DialogContainer.propTypes = {};
|
|
326
326
|
DialogContainer.displayName = 'DialogContainer';
|
|
327
|
-
DialogContainer.defaultProps = defaultProps$
|
|
327
|
+
DialogContainer.defaultProps = defaultProps$i;
|
|
328
328
|
|
|
329
329
|
// The overflow should be "auto", to make the container scrollable
|
|
330
330
|
const DialogContent = /*#__PURE__*/_styled__default["default"]("div", {
|
|
@@ -381,7 +381,7 @@ function filterDataAttributes(obj) {
|
|
|
381
381
|
|
|
382
382
|
function ownKeys$5(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
383
383
|
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
384
|
-
const defaultProps$
|
|
384
|
+
const defaultProps$h = {
|
|
385
385
|
isPrimaryButtonDisabled: false,
|
|
386
386
|
dataAttributesPrimaryButton: {},
|
|
387
387
|
dataAttributesSecondaryButton: {}
|
|
@@ -409,9 +409,9 @@ const DialogFooter = props => {
|
|
|
409
409
|
};
|
|
410
410
|
DialogFooter.propTypes = {};
|
|
411
411
|
DialogFooter.displayName = 'DialogFooter';
|
|
412
|
-
DialogFooter.defaultProps = defaultProps$
|
|
412
|
+
DialogFooter.defaultProps = defaultProps$h;
|
|
413
413
|
|
|
414
|
-
const defaultProps$
|
|
414
|
+
const defaultProps$g = {
|
|
415
415
|
labelSecondary: i18n.sharedMessages.cancel,
|
|
416
416
|
labelPrimary: i18n.sharedMessages.confirm
|
|
417
417
|
};
|
|
@@ -439,12 +439,12 @@ const ConfirmationDialog = props => jsxRuntime.jsxs(DialogContainer, {
|
|
|
439
439
|
});
|
|
440
440
|
ConfirmationDialog.propTypes = {};
|
|
441
441
|
ConfirmationDialog.displayName = 'ConfirmationDialog';
|
|
442
|
-
ConfirmationDialog.defaultProps = defaultProps$
|
|
442
|
+
ConfirmationDialog.defaultProps = defaultProps$g;
|
|
443
443
|
// This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
444
444
|
// The Intl messages can be used for button labels.
|
|
445
445
|
ConfirmationDialog.Intl = i18n.sharedMessages;
|
|
446
446
|
|
|
447
|
-
const defaultProps$
|
|
447
|
+
const defaultProps$f = {
|
|
448
448
|
labelSecondary: i18n.sharedMessages.cancel,
|
|
449
449
|
labelPrimary: i18n.sharedMessages.save
|
|
450
450
|
};
|
|
@@ -473,12 +473,12 @@ const FormDialog = props => jsxRuntime.jsxs(DialogContainer, {
|
|
|
473
473
|
});
|
|
474
474
|
FormDialog.propTypes = {};
|
|
475
475
|
FormDialog.displayName = 'FormDialog';
|
|
476
|
-
FormDialog.defaultProps = defaultProps$
|
|
476
|
+
FormDialog.defaultProps = defaultProps$f;
|
|
477
477
|
// This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
478
478
|
// The Intl messages can be used for button labels.
|
|
479
479
|
FormDialog.Intl = i18n.sharedMessages;
|
|
480
480
|
|
|
481
|
-
const defaultProps$
|
|
481
|
+
const defaultProps$e = {
|
|
482
482
|
titleSize: 'small',
|
|
483
483
|
truncate: false
|
|
484
484
|
};
|
|
@@ -494,6 +494,13 @@ const Title = props => {
|
|
|
494
494
|
truncate: props.truncate,
|
|
495
495
|
children: props.title
|
|
496
496
|
});
|
|
497
|
+
case 'medium':
|
|
498
|
+
return jsxRuntime.jsx(Text__default["default"].Headline, {
|
|
499
|
+
as: "h2",
|
|
500
|
+
title: props.title,
|
|
501
|
+
truncate: props.truncate,
|
|
502
|
+
children: props.title
|
|
503
|
+
});
|
|
497
504
|
default:
|
|
498
505
|
return jsxRuntime.jsx(Text__default["default"].Subheadline, {
|
|
499
506
|
as: "h4",
|
|
@@ -542,7 +549,7 @@ const PageHeaderTitle = props => jsxRuntime.jsxs("div", {
|
|
|
542
549
|
});
|
|
543
550
|
PageHeaderTitle.propTypes = {};
|
|
544
551
|
PageHeaderTitle.displayName = 'PageHeaderTitle';
|
|
545
|
-
PageHeaderTitle.defaultProps = defaultProps$
|
|
552
|
+
PageHeaderTitle.defaultProps = defaultProps$e;
|
|
546
553
|
|
|
547
554
|
const PageHeader = props => {
|
|
548
555
|
return jsxRuntime.jsxs("div", {
|
|
@@ -568,24 +575,218 @@ const PageWrapper = /*#__PURE__*/_styled__default["default"]("div", {
|
|
|
568
575
|
styles: "height:100%;display:flex;flex-direction:column"
|
|
569
576
|
} );
|
|
570
577
|
|
|
578
|
+
function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
579
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
580
|
+
const primaryDefaultProps = {
|
|
581
|
+
label: i18n.sharedMessages.confirm,
|
|
582
|
+
isDisabled: false,
|
|
583
|
+
dataAttributes: {}
|
|
584
|
+
};
|
|
585
|
+
const useFormattedLabel = label => {
|
|
586
|
+
const intl = reactIntl.useIntl();
|
|
587
|
+
return typeof label === 'string' ? label : intl.formatMessage(label);
|
|
588
|
+
};
|
|
589
|
+
const FormPrimaryButton = props => {
|
|
590
|
+
const label = useFormattedLabel(props.label);
|
|
591
|
+
return jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$4({
|
|
592
|
+
label: label,
|
|
593
|
+
onClick: props.onClick,
|
|
594
|
+
isDisabled: props.isDisabled
|
|
595
|
+
}, filterDataAttributes(props.dataAttributes)));
|
|
596
|
+
};
|
|
597
|
+
FormPrimaryButton.propTypes = {};
|
|
598
|
+
FormPrimaryButton.displayName = 'FormPrimaryButton';
|
|
599
|
+
FormPrimaryButton.defaultProps = primaryDefaultProps;
|
|
600
|
+
const secondaryDefaultProps = {
|
|
601
|
+
label: i18n.sharedMessages.cancel,
|
|
602
|
+
isDisabled: false,
|
|
603
|
+
dataAttributes: {}
|
|
604
|
+
};
|
|
605
|
+
const FormSecondaryButton = props => {
|
|
606
|
+
const label = useFormattedLabel(props.label);
|
|
607
|
+
return jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$4({
|
|
608
|
+
label: label,
|
|
609
|
+
onClick: props.onClick,
|
|
610
|
+
isDisabled: props.isDisabled,
|
|
611
|
+
iconLeft: props.iconLeft
|
|
612
|
+
}, filterDataAttributes(props.dataAttributes)));
|
|
613
|
+
};
|
|
614
|
+
FormSecondaryButton.propTypes = {};
|
|
615
|
+
FormSecondaryButton.displayName = 'FormSecondaryButton';
|
|
616
|
+
FormSecondaryButton.defaultProps = secondaryDefaultProps;
|
|
617
|
+
const deleteDefaultProps = {
|
|
618
|
+
label: i18n.sharedMessages.delete,
|
|
619
|
+
isDisabled: false,
|
|
620
|
+
dataAttributes: {}
|
|
621
|
+
};
|
|
622
|
+
const FormDeleteButton = props => {
|
|
623
|
+
const label = useFormattedLabel(props.label);
|
|
624
|
+
return jsxRuntime.jsx(IconButton__default["default"], _objectSpread$4({
|
|
625
|
+
icon: jsxRuntime.jsx(icons.BinLinearIcon, {}),
|
|
626
|
+
label: label,
|
|
627
|
+
onClick: props.onClick,
|
|
628
|
+
isDisabled: props.isDisabled
|
|
629
|
+
}, filterDataAttributes(props.dataAttributes)));
|
|
630
|
+
};
|
|
631
|
+
FormDeleteButton.propTypes = {};
|
|
632
|
+
FormDeleteButton.displayName = 'FormDeleteButton';
|
|
633
|
+
FormDeleteButton.defaultProps = deleteDefaultProps;
|
|
634
|
+
|
|
635
|
+
const messages$4 = reactIntl.defineMessages({
|
|
636
|
+
back: {
|
|
637
|
+
id: 'Components.ModalPage.TopBar.Back',
|
|
638
|
+
defaultMessage: 'Go Back'
|
|
639
|
+
},
|
|
640
|
+
close: {
|
|
641
|
+
id: 'Components.ModalPage.TopBar.Close',
|
|
642
|
+
defaultMessage: 'Close Modal Page'
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
// Component to have a larger clickable surface
|
|
647
|
+
var _ref2$2 = {
|
|
648
|
+
name: "1rxhroq",
|
|
649
|
+
styles: "display:flex;align-items:center;justify-content:center;&::after{content:'';position:absolute;height:35px;width:48px;top:0;right:0;}"
|
|
650
|
+
} ;
|
|
651
|
+
const LargeIconWrapper = props => jsxRuntime.jsx("span", {
|
|
652
|
+
css: _ref2$2,
|
|
653
|
+
children: /*#__PURE__*/react$1.cloneElement(props.children, {
|
|
654
|
+
size: props.size
|
|
655
|
+
})
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
// NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
|
|
659
|
+
// However, we need to explicitly define this otherwise the prop-types babel plugin
|
|
660
|
+
// does not recognize the object shape.
|
|
661
|
+
LargeIconWrapper.propTypes = {};
|
|
662
|
+
const defaultProps$d = {
|
|
663
|
+
color: 'surface',
|
|
664
|
+
previousPathLabel: messages$4.back,
|
|
665
|
+
hidePathLabel: false
|
|
666
|
+
};
|
|
667
|
+
var _ref$4 = {
|
|
668
|
+
name: "uvw8rn",
|
|
669
|
+
styles: "display:flex;overflow:hidden;button:first-of-type svg{height:12px!important;width:12px!important;}"
|
|
670
|
+
} ;
|
|
671
|
+
const ModalPageTopBar = props => {
|
|
672
|
+
const intl = reactIntl.useIntl();
|
|
673
|
+
return jsxRuntime.jsxs("div", {
|
|
674
|
+
css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;padding:", designTokens.paddingForModalTopBar, ";background-color:", props.color === 'neutral' ? designTokens.backgroundColorForPageHeader : designSystem.designTokens.colorSurface, ";border-bottom:1px solid ", props.color === 'neutral' ? designSystem.designTokens.colorSurface : designTokens.borderColorForModalTopBarWhenSurface, ";& *+*{margin-left:", designSystem.designTokens.spacingS, ";}p{font-size:12px!important;}" + ("" ), "" ),
|
|
675
|
+
children: [jsxRuntime.jsxs("div", {
|
|
676
|
+
css: _ref$4,
|
|
677
|
+
children: [!props.hidePathLabel && jsxRuntime.jsx(FlatButton__default["default"], {
|
|
678
|
+
tone: "primary",
|
|
679
|
+
label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
|
|
680
|
+
icon: jsxRuntime.jsx(icons.AngleLeftIcon, {
|
|
681
|
+
size: "medium",
|
|
682
|
+
color: "primary"
|
|
683
|
+
}),
|
|
684
|
+
onClick: props.onClose
|
|
685
|
+
}), props.currentPathLabel && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
686
|
+
children: [jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
687
|
+
as: "span",
|
|
688
|
+
children: "/"
|
|
689
|
+
}), jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
690
|
+
as: "span",
|
|
691
|
+
title: props.currentPathLabel,
|
|
692
|
+
truncate: true,
|
|
693
|
+
children: props.currentPathLabel
|
|
694
|
+
})]
|
|
695
|
+
})]
|
|
696
|
+
}), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
697
|
+
label: intl.formatMessage(messages$4.close),
|
|
698
|
+
onClick: props.onClose,
|
|
699
|
+
icon: jsxRuntime.jsx(LargeIconWrapper, {
|
|
700
|
+
children: jsxRuntime.jsx(icons.CloseIcon, {})
|
|
701
|
+
}),
|
|
702
|
+
size: "big"
|
|
703
|
+
})]
|
|
704
|
+
});
|
|
705
|
+
};
|
|
706
|
+
ModalPageTopBar.propTypes = {};
|
|
707
|
+
ModalPageTopBar.displayName = 'ModalPageTopBar';
|
|
708
|
+
ModalPageTopBar.defaultProps = defaultProps$d;
|
|
709
|
+
|
|
710
|
+
const defaultProps$c = {
|
|
711
|
+
size: 10,
|
|
712
|
+
hideControls: false,
|
|
713
|
+
onPrimaryButtonClick: () => {},
|
|
714
|
+
onSecondaryButtonClick: () => {}
|
|
715
|
+
};
|
|
571
716
|
const ContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
|
|
572
|
-
target: "
|
|
573
|
-
} )("height:100%;padding:", designSystem.designTokens.
|
|
574
|
-
|
|
575
|
-
|
|
717
|
+
target: "e18jo6y41"
|
|
718
|
+
} )("height:100%;padding:", designSystem.designTokens.spacing50, ";" + ("" ));
|
|
719
|
+
const HeaderWrapper = /*#__PURE__*/_styled__default["default"]("div", {
|
|
720
|
+
target: "e18jo6y40"
|
|
721
|
+
} )("padding:", designSystem.designTokens.spacing40, " 40px;border-bottom:1px solid ", designTokens.borderColorForModalPageHeaderDivider, ";" + ("" ));
|
|
722
|
+
function Drawer(props) {
|
|
723
|
+
const intl = reactIntl.useIntl();
|
|
724
|
+
return jsxRuntime.jsxs(ModalPage, {
|
|
725
|
+
isOpen: props.isOpen,
|
|
576
726
|
hidePathLabel: true,
|
|
577
|
-
|
|
727
|
+
hideTopBar: true,
|
|
578
728
|
onClose: props.onClose,
|
|
579
729
|
size: props.size,
|
|
580
730
|
title: props.title,
|
|
581
|
-
|
|
731
|
+
afterOpenStyles: props.afterOpenStyles,
|
|
732
|
+
customViewLocatorCode: props.customViewLocatorCode,
|
|
733
|
+
getParentSelector: props.getParentSelector,
|
|
734
|
+
shouldDelayOnClose: props.shouldDelayOnClose,
|
|
735
|
+
topBarColor: props.topBarColor,
|
|
736
|
+
zIndex: props.zIndex,
|
|
737
|
+
children: [jsxRuntime.jsx(HeaderWrapper, {
|
|
738
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
739
|
+
children: [jsxRuntime.jsxs(Spacings__default["default"].Inline, {
|
|
740
|
+
justifyContent: "space-between",
|
|
741
|
+
children: [jsxRuntime.jsx(PageHeaderTitle, {
|
|
742
|
+
title: props.title,
|
|
743
|
+
titleSize: "medium",
|
|
744
|
+
subtitle: props.subtitle && jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
745
|
+
children: props.subtitle
|
|
746
|
+
})
|
|
747
|
+
}), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
748
|
+
label: intl.formatMessage(messages$4.close),
|
|
749
|
+
onClick: props.onClose,
|
|
750
|
+
icon: jsxRuntime.jsx(LargeIconWrapper, {
|
|
751
|
+
children: jsxRuntime.jsx(icons.CloseIcon, {})
|
|
752
|
+
}),
|
|
753
|
+
size: "big"
|
|
754
|
+
})]
|
|
755
|
+
}), jsxRuntime.jsxs(Spacings__default["default"].Inline, {
|
|
756
|
+
justifyContent: "flex-end",
|
|
757
|
+
children: [!props.hideControls && props.formControls && props.formControls, !props.hideControls && !props.formControls && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
758
|
+
children: [jsxRuntime.jsx(FormSecondaryButton, {
|
|
759
|
+
label: props.labelSecondaryButton,
|
|
760
|
+
onClick: props.onSecondaryButtonClick,
|
|
761
|
+
isDisabled: props.isSecondaryButtonDisabled,
|
|
762
|
+
dataAttributes: props.dataAttributesSecondaryButton,
|
|
763
|
+
iconLeft: props.iconLeftSecondaryButton
|
|
764
|
+
}), jsxRuntime.jsx(FormPrimaryButton, {
|
|
765
|
+
label: props.labelPrimaryButton,
|
|
766
|
+
onClick: props.onPrimaryButtonClick,
|
|
767
|
+
isDisabled: props.isPrimaryButtonDisabled,
|
|
768
|
+
dataAttributes: props.dataAttributesPrimaryButton
|
|
769
|
+
})]
|
|
770
|
+
})]
|
|
771
|
+
})]
|
|
772
|
+
})
|
|
773
|
+
}), jsxRuntime.jsx(ContentWrapper, {
|
|
582
774
|
children: props.children
|
|
583
|
-
})
|
|
775
|
+
})]
|
|
584
776
|
});
|
|
585
777
|
}
|
|
586
|
-
|
|
778
|
+
Drawer.propTypes = {};
|
|
779
|
+
Drawer.displayName = 'Drawer';
|
|
780
|
+
Drawer.defaultProps = defaultProps$c;
|
|
781
|
+
// Static export of pre-configured form control buttons to easily re-use
|
|
782
|
+
// them in the custom controls.
|
|
783
|
+
Drawer.FormPrimaryButton = FormPrimaryButton;
|
|
784
|
+
Drawer.FormSecondaryButton = FormSecondaryButton;
|
|
785
|
+
// This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
786
|
+
// The Intl messages can be used for button labels.
|
|
787
|
+
Drawer.Intl = i18n.sharedMessages;
|
|
587
788
|
|
|
588
|
-
const messages$
|
|
789
|
+
const messages$3 = reactIntl.defineMessages({
|
|
589
790
|
loadError: {
|
|
590
791
|
id: 'CustomViewLoader.error.load',
|
|
591
792
|
defaultMessage: 'We could not load the Custom View. Please contact your administrator to check its configuration.'
|
|
@@ -636,7 +837,7 @@ function CustomViewLoader(props) {
|
|
|
636
837
|
showNotification({
|
|
637
838
|
domain: constants.DOMAINS.PAGE,
|
|
638
839
|
kind: constants.NOTIFICATION_KINDS_PAGE.error,
|
|
639
|
-
text: intl.formatMessage(messages$
|
|
840
|
+
text: intl.formatMessage(messages$3.loadError)
|
|
640
841
|
});
|
|
641
842
|
return;
|
|
642
843
|
}
|
|
@@ -680,10 +881,11 @@ function CustomViewLoader(props) {
|
|
|
680
881
|
}
|
|
681
882
|
const panelSize = ((_props$customView$typ = props.customView.typeSettings) === null || _props$customView$typ === void 0 || (_props$customView$typ = _props$customView$typ.size) === null || _props$customView$typ === void 0 ? void 0 : _props$customView$typ.toLocaleLowerCase()) || 'large';
|
|
682
883
|
const iFrameUrl = [window.location.origin, 'custom-views', props.customView.id, 'projects', projectKey].join('/');
|
|
683
|
-
return jsxRuntime.jsx(
|
|
884
|
+
return jsxRuntime.jsx(Drawer, {
|
|
885
|
+
isOpen: true,
|
|
684
886
|
title: "Custom View: ".concat(props.customView.defaultLabel),
|
|
685
887
|
onClose: props.onClose,
|
|
686
|
-
size: panelSize,
|
|
888
|
+
size: panelSize === 'small' ? 10 : 30,
|
|
687
889
|
children: jsxRuntime.jsx(CustomPanelIframe, {
|
|
688
890
|
id: "custom-view-".concat(props.customView.id),
|
|
689
891
|
title: "Custom View: ".concat(props.customView.defaultLabel),
|
|
@@ -695,7 +897,7 @@ function CustomViewLoader(props) {
|
|
|
695
897
|
}
|
|
696
898
|
CustomViewLoader.propTypes = {};
|
|
697
899
|
|
|
698
|
-
var messages$
|
|
900
|
+
var messages$2 = reactIntl.defineMessages({
|
|
699
901
|
title: {
|
|
700
902
|
id: 'CustomViewsSelector.title',
|
|
701
903
|
defaultMessage: 'Custom Views:'
|
|
@@ -726,8 +928,8 @@ const useCustomViewsConnector = _ref => {
|
|
|
726
928
|
};
|
|
727
929
|
};
|
|
728
930
|
|
|
729
|
-
function ownKeys$
|
|
730
|
-
function _objectSpread$
|
|
931
|
+
function ownKeys$3(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
932
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$3(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
731
933
|
const COMPONENT_HEIGHT = '56px';
|
|
732
934
|
const Wrapper = /*#__PURE__*/_styled__default["default"]("div", {
|
|
733
935
|
target: "e16cb3zv1"
|
|
@@ -777,7 +979,7 @@ function CustomViewSelector(props) {
|
|
|
777
979
|
color: "neutral60"
|
|
778
980
|
}), jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
779
981
|
tone: "secondary",
|
|
780
|
-
intlMessage: messages$
|
|
982
|
+
intlMessage: messages$2.title
|
|
781
983
|
})]
|
|
782
984
|
}), _mapInstanceProperty__default["default"](customViews).call(customViews, customView => jsxRuntime.jsx(SecondaryButton__default["default"], {
|
|
783
985
|
label: customView.defaultLabel,
|
|
@@ -801,119 +1003,57 @@ const CustomViewSelectorOrNothing = props => {
|
|
|
801
1003
|
if (!props.customViewLocatorCode) {
|
|
802
1004
|
return null;
|
|
803
1005
|
}
|
|
804
|
-
return jsxRuntime.jsx(CustomViewSelector, _objectSpread$
|
|
1006
|
+
return jsxRuntime.jsx(CustomViewSelector, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
805
1007
|
customViewLocatorCode: props.customViewLocatorCode
|
|
806
1008
|
}));
|
|
807
1009
|
};
|
|
808
1010
|
CustomViewSelectorOrNothing.propTypes = {};
|
|
809
1011
|
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
1012
|
+
const stylesBySize = {
|
|
1013
|
+
'10': {
|
|
1014
|
+
width: '600px',
|
|
1015
|
+
transitionTime: 200
|
|
814
1016
|
},
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
1017
|
+
'20': {
|
|
1018
|
+
width: '900px',
|
|
1019
|
+
transitionTime: 200
|
|
1020
|
+
},
|
|
1021
|
+
'30': {
|
|
1022
|
+
width: '1200px',
|
|
1023
|
+
transitionTime: 200
|
|
1024
|
+
},
|
|
1025
|
+
scale: {
|
|
1026
|
+
width: '100%',
|
|
1027
|
+
transitionTime: 300
|
|
818
1028
|
}
|
|
819
|
-
});
|
|
820
|
-
|
|
821
|
-
// Component to have a larger clickable surface
|
|
822
|
-
var _ref2$2 = {
|
|
823
|
-
name: "1rxhroq",
|
|
824
|
-
styles: "display:flex;align-items:center;justify-content:center;&::after{content:'';position:absolute;height:35px;width:48px;top:0;right:0;}"
|
|
825
|
-
} ;
|
|
826
|
-
const LargeIconWrapper = props => jsxRuntime.jsx("span", {
|
|
827
|
-
css: _ref2$2,
|
|
828
|
-
children: /*#__PURE__*/react$1.cloneElement(props.children, {
|
|
829
|
-
size: props.size
|
|
830
|
-
})
|
|
831
|
-
});
|
|
832
|
-
|
|
833
|
-
// NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
|
|
834
|
-
// However, we need to explicitly define this otherwise the prop-types babel plugin
|
|
835
|
-
// does not recognize the object shape.
|
|
836
|
-
LargeIconWrapper.propTypes = {};
|
|
837
|
-
const defaultProps$c = {
|
|
838
|
-
color: 'surface',
|
|
839
|
-
previousPathLabel: messages$2.back,
|
|
840
|
-
hidePathLabel: false
|
|
841
|
-
};
|
|
842
|
-
var _ref$4 = {
|
|
843
|
-
name: "uvw8rn",
|
|
844
|
-
styles: "display:flex;overflow:hidden;button:first-of-type svg{height:12px!important;width:12px!important;}"
|
|
845
|
-
} ;
|
|
846
|
-
const ModalPageTopBar = props => {
|
|
847
|
-
const intl = reactIntl.useIntl();
|
|
848
|
-
return jsxRuntime.jsxs("div", {
|
|
849
|
-
css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;padding:", designTokens.paddingForModalTopBar, ";background-color:", props.color === 'neutral' ? designTokens.backgroundColorForPageHeader : designSystem.designTokens.colorSurface, ";border-bottom:1px solid ", props.color === 'neutral' ? designSystem.designTokens.colorSurface : designTokens.borderColorForModalTopBarWhenSurface, ";& *+*{margin-left:", designSystem.designTokens.spacingS, ";}p{font-size:12px!important;}" + ("" ), "" ),
|
|
850
|
-
children: [jsxRuntime.jsxs("div", {
|
|
851
|
-
css: _ref$4,
|
|
852
|
-
children: [!props.hidePathLabel && jsxRuntime.jsx(FlatButton__default["default"], {
|
|
853
|
-
tone: "primary",
|
|
854
|
-
label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
|
|
855
|
-
icon: jsxRuntime.jsx(icons.AngleLeftIcon, {
|
|
856
|
-
size: "medium",
|
|
857
|
-
color: "primary"
|
|
858
|
-
}),
|
|
859
|
-
onClick: props.onClose
|
|
860
|
-
}), props.currentPathLabel && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
861
|
-
children: [jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
862
|
-
as: "span",
|
|
863
|
-
children: "/"
|
|
864
|
-
}), jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
865
|
-
as: "span",
|
|
866
|
-
title: props.currentPathLabel,
|
|
867
|
-
truncate: true,
|
|
868
|
-
children: props.currentPathLabel
|
|
869
|
-
})]
|
|
870
|
-
})]
|
|
871
|
-
}), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
872
|
-
label: intl.formatMessage(messages$2.close),
|
|
873
|
-
onClick: props.onClose,
|
|
874
|
-
icon: jsxRuntime.jsx(LargeIconWrapper, {
|
|
875
|
-
children: jsxRuntime.jsx(icons.CloseIcon, {})
|
|
876
|
-
}),
|
|
877
|
-
size: "big"
|
|
878
|
-
})]
|
|
879
|
-
});
|
|
880
1029
|
};
|
|
881
|
-
|
|
882
|
-
ModalPageTopBar.displayName = 'ModalPageTopBar';
|
|
883
|
-
ModalPageTopBar.defaultProps = defaultProps$c;
|
|
884
|
-
|
|
885
|
-
const TRANSITION_DURATION = 200;
|
|
886
|
-
const getContainerStyles = _props => /*#__PURE__*/react.css("position:absolute;top:0;right:0;height:100%;width:", _props.size === 'small' ? '600px !important' : '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;" + ("" ), "" );
|
|
1030
|
+
const getContainerStyles = props => /*#__PURE__*/react.css("position:absolute;top:0;right:0;height:100%;width:", props.size !== 'scale' ? "".concat(stylesBySize[props.size].width, " !important") : stylesBySize.scale.width, ";display:flex;flex-direction:column;background-color:", designSystem.customProperties.colorSurface, ";box-shadow:0px 0px 40px 0px rgba(0, 0, 0, 0.1);outline:0;transform:translate3d(\n ", props.size !== 'scale' ? stylesBySize[props.size].width : '30px', ",\n 0,\n 0\n );transition:transform ", stylesBySize[props.size].transitionTime, "ms ease;" + ("" ), "" );
|
|
887
1031
|
const getOverlayStyles = props => /*#__PURE__*/react.css("position:absolute;z-index:", typeof props.zIndex === 'number' ? // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
|
|
888
|
-
"".concat(props.zIndex, " !important") : 'auto', ";top:0;left:0;width:100%;height:100%;background-color:
|
|
889
|
-
var
|
|
1032
|
+
"".concat(props.zIndex, " !important") : 'auto', ";top:0;left:0;width:100%;height:100%;background-color:hsla(195, 35%, 20%, 0.05);opacity:0;transition:transform ", stylesBySize[props.size].transitionTime, "ms ease;" + ("" ), "" );
|
|
1033
|
+
var _ref3 = {
|
|
890
1034
|
name: "1ffv7m4",
|
|
891
1035
|
styles: "transform:translate3d(0, 0, 0)!important"
|
|
892
1036
|
} ;
|
|
893
|
-
const getAfterOpenContainerAnimation = () =>
|
|
894
|
-
var
|
|
1037
|
+
const getAfterOpenContainerAnimation = () => _ref3;
|
|
1038
|
+
var _ref2$1 = {
|
|
895
1039
|
name: "1d9ftqx",
|
|
896
1040
|
styles: "opacity:1!important"
|
|
897
1041
|
} ;
|
|
898
|
-
const getAfterOpenOverlayAnimation = () =>
|
|
899
|
-
|
|
900
|
-
name: "110wxen",
|
|
901
|
-
styles: "transform:translate3d(30px, 0, 0)!important"
|
|
902
|
-
} ;
|
|
903
|
-
const getBeforeCloseContainerAnimation = () => _ref2$1;
|
|
1042
|
+
const getAfterOpenOverlayAnimation = () => _ref2$1;
|
|
1043
|
+
const getBeforeCloseContainerAnimation = props => /*#__PURE__*/react.css("transform:translate3d(\n ", props.size !== 'scale' ? stylesBySize[props.size].width : '30px', ",\n ,\n 0,\n 0\n )!important;" + ("" ), "" );
|
|
904
1044
|
var _ref$3 = {
|
|
905
1045
|
name: "728dx5",
|
|
906
1046
|
styles: "opacity:0!important"
|
|
907
1047
|
} ;
|
|
908
1048
|
const getBeforeCloseOverlayAnimation = () => _ref$3;
|
|
909
1049
|
|
|
910
|
-
function ownKeys$
|
|
911
|
-
function _objectSpread$
|
|
1050
|
+
function ownKeys$2(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1051
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
912
1052
|
const getDefaultParentSelector = () => document.querySelector("#".concat(constants.PORTALS_CONTAINER_ID));
|
|
913
1053
|
const getOverlayElement = (props, contentElement) =>
|
|
914
1054
|
// Assign the `data-role` to the overlay container, which is used as
|
|
915
1055
|
// the CSS selector in the `<PortalsContainer>`.
|
|
916
|
-
jsxRuntime.jsx("div", _objectSpread$
|
|
1056
|
+
jsxRuntime.jsx("div", _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
917
1057
|
"data-role": "modal-overlay",
|
|
918
1058
|
children: contentElement
|
|
919
1059
|
}));
|
|
@@ -922,9 +1062,9 @@ jsxRuntime.jsx("div", _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
|
922
1062
|
// However, we need to explicitly define this otherwise the prop-types babel plugin
|
|
923
1063
|
// does not recognize the object shape.
|
|
924
1064
|
const defaultProps$b = {
|
|
1065
|
+
size: 'scale',
|
|
925
1066
|
getParentSelector: getDefaultParentSelector,
|
|
926
|
-
shouldDelayOnClose: true
|
|
927
|
-
size: 'large'
|
|
1067
|
+
shouldDelayOnClose: true
|
|
928
1068
|
};
|
|
929
1069
|
const ModalPage = props => {
|
|
930
1070
|
const _useState = react$1.useState(false),
|
|
@@ -941,6 +1081,7 @@ const ModalPage = props => {
|
|
|
941
1081
|
};
|
|
942
1082
|
}, [props.isOpen]);
|
|
943
1083
|
const onClose = props.onClose;
|
|
1084
|
+
const TRANSITION_DURATION = stylesBySize[props.size].transitionTime;
|
|
944
1085
|
const handleClose = react$1.useCallback(event => {
|
|
945
1086
|
if (props.shouldDelayOnClose) {
|
|
946
1087
|
// In this case we want the closing animation to be shown
|
|
@@ -953,7 +1094,7 @@ const ModalPage = props => {
|
|
|
953
1094
|
return;
|
|
954
1095
|
}
|
|
955
1096
|
onClose && onClose(event);
|
|
956
|
-
}, [onClose, props.shouldDelayOnClose]);
|
|
1097
|
+
}, [onClose, props.shouldDelayOnClose, TRANSITION_DURATION]);
|
|
957
1098
|
return jsxRuntime.jsx(react.ClassNames, {
|
|
958
1099
|
children: _ref => {
|
|
959
1100
|
var _props$afterOpenStyle;
|
|
@@ -972,7 +1113,7 @@ const ModalPage = props => {
|
|
|
972
1113
|
className: {
|
|
973
1114
|
base: makeClassName(getContainerStyles(props)),
|
|
974
1115
|
afterOpen: typeof props.afterOpenStyles === 'string' ? props.afterOpenStyles : makeClassName((_props$afterOpenStyle = props.afterOpenStyles) !== null && _props$afterOpenStyle !== void 0 ? _props$afterOpenStyle : getAfterOpenContainerAnimation()),
|
|
975
|
-
beforeClose: makeClassName(getBeforeCloseContainerAnimation())
|
|
1116
|
+
beforeClose: makeClassName(getBeforeCloseContainerAnimation(props))
|
|
976
1117
|
},
|
|
977
1118
|
contentLabel: props.title,
|
|
978
1119
|
parentSelector: props.getParentSelector,
|
|
@@ -988,7 +1129,7 @@ const ModalPage = props => {
|
|
|
988
1129
|
},
|
|
989
1130
|
children: [jsxRuntime.jsx(CustomViewSelectorOrNothing, {
|
|
990
1131
|
customViewLocatorCode: props.customViewLocatorCode
|
|
991
|
-
}), jsxRuntime.jsx(ModalPageTopBar, {
|
|
1132
|
+
}), !props.hideTopBar && jsxRuntime.jsx(ModalPageTopBar, {
|
|
992
1133
|
color: props.topBarColor,
|
|
993
1134
|
onClose: handleClose,
|
|
994
1135
|
currentPathLabel: props.currentPathLabel,
|
|
@@ -1024,63 +1165,6 @@ const InfoModalPage = props => jsxRuntime.jsxs(ModalPage, {
|
|
|
1024
1165
|
InfoModalPage.propTypes = {};
|
|
1025
1166
|
InfoModalPage.displayName = 'InfoModalPage';
|
|
1026
1167
|
|
|
1027
|
-
function ownKeys$2(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1028
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1029
|
-
const primaryDefaultProps = {
|
|
1030
|
-
label: i18n.sharedMessages.confirm,
|
|
1031
|
-
isDisabled: false,
|
|
1032
|
-
dataAttributes: {}
|
|
1033
|
-
};
|
|
1034
|
-
const useFormattedLabel = label => {
|
|
1035
|
-
const intl = reactIntl.useIntl();
|
|
1036
|
-
return typeof label === 'string' ? label : intl.formatMessage(label);
|
|
1037
|
-
};
|
|
1038
|
-
const FormPrimaryButton = props => {
|
|
1039
|
-
const label = useFormattedLabel(props.label);
|
|
1040
|
-
return jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$2({
|
|
1041
|
-
label: label,
|
|
1042
|
-
onClick: props.onClick,
|
|
1043
|
-
isDisabled: props.isDisabled
|
|
1044
|
-
}, filterDataAttributes(props.dataAttributes)));
|
|
1045
|
-
};
|
|
1046
|
-
FormPrimaryButton.propTypes = {};
|
|
1047
|
-
FormPrimaryButton.displayName = 'FormPrimaryButton';
|
|
1048
|
-
FormPrimaryButton.defaultProps = primaryDefaultProps;
|
|
1049
|
-
const secondaryDefaultProps = {
|
|
1050
|
-
label: i18n.sharedMessages.cancel,
|
|
1051
|
-
isDisabled: false,
|
|
1052
|
-
dataAttributes: {}
|
|
1053
|
-
};
|
|
1054
|
-
const FormSecondaryButton = props => {
|
|
1055
|
-
const label = useFormattedLabel(props.label);
|
|
1056
|
-
return jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$2({
|
|
1057
|
-
label: label,
|
|
1058
|
-
onClick: props.onClick,
|
|
1059
|
-
isDisabled: props.isDisabled,
|
|
1060
|
-
iconLeft: props.iconLeft
|
|
1061
|
-
}, filterDataAttributes(props.dataAttributes)));
|
|
1062
|
-
};
|
|
1063
|
-
FormSecondaryButton.propTypes = {};
|
|
1064
|
-
FormSecondaryButton.displayName = 'FormSecondaryButton';
|
|
1065
|
-
FormSecondaryButton.defaultProps = secondaryDefaultProps;
|
|
1066
|
-
const deleteDefaultProps = {
|
|
1067
|
-
label: i18n.sharedMessages.delete,
|
|
1068
|
-
isDisabled: false,
|
|
1069
|
-
dataAttributes: {}
|
|
1070
|
-
};
|
|
1071
|
-
const FormDeleteButton = props => {
|
|
1072
|
-
const label = useFormattedLabel(props.label);
|
|
1073
|
-
return jsxRuntime.jsx(IconButton__default["default"], _objectSpread$2({
|
|
1074
|
-
icon: jsxRuntime.jsx(icons.BinLinearIcon, {}),
|
|
1075
|
-
label: label,
|
|
1076
|
-
onClick: props.onClick,
|
|
1077
|
-
isDisabled: props.isDisabled
|
|
1078
|
-
}, filterDataAttributes(props.dataAttributes)));
|
|
1079
|
-
};
|
|
1080
|
-
FormDeleteButton.propTypes = {};
|
|
1081
|
-
FormDeleteButton.displayName = 'FormDeleteButton';
|
|
1082
|
-
FormDeleteButton.defaultProps = deleteDefaultProps;
|
|
1083
|
-
|
|
1084
1168
|
const CustomFormModalPage = props => jsxRuntime.jsxs(ModalPage, {
|
|
1085
1169
|
title: props.title,
|
|
1086
1170
|
isOpen: props.isOpen,
|
|
@@ -1252,7 +1336,7 @@ TabularModalPage.Intl = i18n.sharedMessages;
|
|
|
1252
1336
|
|
|
1253
1337
|
const defaultProps$7 = {
|
|
1254
1338
|
color: 'surface',
|
|
1255
|
-
previousPathLabel: messages$
|
|
1339
|
+
previousPathLabel: messages$4.back
|
|
1256
1340
|
};
|
|
1257
1341
|
const PageTopBar = props => {
|
|
1258
1342
|
const intl = reactIntl.useIntl();
|
|
@@ -1428,7 +1512,7 @@ TabularDetailPage.PageHeaderTitle = PageHeaderTitle;
|
|
|
1428
1512
|
// This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
1429
1513
|
TabularDetailPage.Intl = i18n.sharedMessages;
|
|
1430
1514
|
|
|
1431
|
-
const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-
|
|
1515
|
+
const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-295bf2b5.cjs.prod.js' /* webpackChunkName: "public-page-layout" */); }));
|
|
1432
1516
|
|
|
1433
1517
|
const MainPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
|
|
1434
1518
|
target: "ev8m2jf2"
|
|
@@ -1918,9 +2002,9 @@ exports.ConfirmationDialog = ConfirmationDialog;
|
|
|
1918
2002
|
exports.CustomFormDetailPage = CustomFormDetailPage;
|
|
1919
2003
|
exports.CustomFormMainPage = CustomFormMainPage;
|
|
1920
2004
|
exports.CustomFormModalPage = CustomFormModalPage;
|
|
1921
|
-
exports.CustomPanel = CustomPanel;
|
|
1922
2005
|
exports.CustomViewLoader = CustomViewLoader;
|
|
1923
2006
|
exports.CustomViewsSelector = CustomViewSelectorOrNothing;
|
|
2007
|
+
exports.Drawer = Drawer;
|
|
1924
2008
|
exports.FormDetailPage = FormDetailPage;
|
|
1925
2009
|
exports.FormDialog = FormDialog;
|
|
1926
2010
|
exports.FormMainPage = FormMainPage;
|