@commercetools-frontend/application-components 21.2.1 → 21.3.3
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 +653 -330
- package/dist/commercetools-frontend-application-components.cjs.prod.js +502 -243
- package/dist/commercetools-frontend-application-components.esm.js +640 -321
- package/dist/declarations/src/components/dialogs/internals/dialog-container.d.ts +1 -1
- package/dist/declarations/src/components/{modal-pages/internals → internals}/default-form-buttons.d.ts +1 -1
- package/dist/declarations/src/components/{modal-pages/internals → internals}/messages.d.ts +0 -0
- package/dist/declarations/src/components/{modal-pages/internals/modal-page-header-title.d.ts → internals/page-header-title.d.ts} +5 -4
- package/dist/declarations/src/components/{modal-pages/internals/modal-page-header.d.ts → internals/page-header.d.ts} +3 -3
- package/dist/declarations/src/components/internals/page-top-bar.d.ts +20 -0
- package/dist/declarations/src/components/internals/page.styles.d.ts +9 -0
- package/dist/declarations/src/components/internals/tabular-page.d.ts +24 -0
- package/dist/declarations/src/components/modal-pages/internals/modal-page.styles.d.ts +0 -5
- package/dist/declarations/src/components/portals-container/portals-container.d.ts +7 -1
- package/dist/declarations/src/components/tab-header/index.d.ts +1 -0
- package/dist/declarations/src/components/tab-header/tab-header.d.ts +18 -0
- package/dist/declarations/src/components/tab-header/tab.styles.d.ts +2 -0
- package/dist/declarations/src/components/tabular-detail-page/index.d.ts +1 -0
- package/dist/declarations/src/components/tabular-detail-page/tabular-detail-page.d.ts +202 -0
- package/dist/declarations/src/components/tabular-main-page/index.d.ts +1 -0
- package/dist/declarations/src/components/tabular-main-page/tabular-main-page.d.ts +194 -0
- package/dist/declarations/src/index.d.ts +3 -0
- package/package.json +22 -18
|
@@ -2,20 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('prop-types');
|
|
6
|
-
var react$1 = require('react');
|
|
7
|
-
var _styled = require('@emotion/styled/base');
|
|
8
|
-
var Modal = require('react-modal');
|
|
9
|
-
var react = require('@emotion/react');
|
|
10
|
-
var constants = require('@commercetools-frontend/constants');
|
|
11
|
-
var designSystem = require('@commercetools-uikit/design-system');
|
|
12
|
-
var Card = require('@commercetools-uikit/card');
|
|
13
|
-
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
14
|
-
var icons = require('@commercetools-uikit/icons');
|
|
15
|
-
var SecondaryIconButton = require('@commercetools-uikit/secondary-icon-button');
|
|
16
|
-
var Text = require('@commercetools-uikit/text');
|
|
17
|
-
var Spacings = require('@commercetools-uikit/spacings');
|
|
18
|
-
var i18n = require('@commercetools-frontend/i18n');
|
|
19
5
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
20
6
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
21
7
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -25,15 +11,32 @@ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-
|
|
|
25
11
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
26
12
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
27
13
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
14
|
+
require('prop-types');
|
|
15
|
+
var reactRouterDom = require('react-router-dom');
|
|
16
|
+
var startCase = require('lodash/startCase');
|
|
28
17
|
var reactIntl = require('react-intl');
|
|
29
|
-
|
|
18
|
+
require('@commercetools-uikit/utils');
|
|
19
|
+
var Text = require('@commercetools-uikit/text');
|
|
20
|
+
var react = require('@emotion/react');
|
|
21
|
+
var designSystem = require('@commercetools-uikit/design-system');
|
|
22
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
23
|
+
var Spacings = require('@commercetools-uikit/spacings');
|
|
24
|
+
var i18n = require('@commercetools-frontend/i18n');
|
|
25
|
+
var _styled = require('@emotion/styled/base');
|
|
26
|
+
var react$1 = require('react');
|
|
30
27
|
var PrimaryButton = require('@commercetools-uikit/primary-button');
|
|
28
|
+
var SecondaryButton = require('@commercetools-uikit/secondary-button');
|
|
29
|
+
var IconButton = require('@commercetools-uikit/icon-button');
|
|
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
|
+
var Modal = require('react-modal');
|
|
35
|
+
var constants = require('@commercetools-frontend/constants');
|
|
36
|
+
var Card = require('@commercetools-uikit/card');
|
|
37
|
+
var SecondaryIconButton = require('@commercetools-uikit/secondary-icon-button');
|
|
33
38
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
34
39
|
var _setTimeout = require('@babel/runtime-corejs3/core-js-stable/set-timeout');
|
|
35
|
-
var FlatButton = require('@commercetools-uikit/flat-button');
|
|
36
|
-
var IconButton = require('@commercetools-uikit/icon-button');
|
|
37
40
|
var CommercetoolsLogoSvg = require('@commercetools-frontend/assets/logos/commercetools_primary-logo_horizontal_white-text_RGB.svg');
|
|
38
41
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
39
42
|
var PageNotFoundSVG = require('@commercetools-frontend/assets/images/desert-fox.svg');
|
|
@@ -41,12 +44,6 @@ var FailedAuthorizationSVG = require('@commercetools-frontend/assets/images/fold
|
|
|
41
44
|
|
|
42
45
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
43
46
|
|
|
44
|
-
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
45
|
-
var Modal__default = /*#__PURE__*/_interopDefault(Modal);
|
|
46
|
-
var Card__default = /*#__PURE__*/_interopDefault(Card);
|
|
47
|
-
var SecondaryIconButton__default = /*#__PURE__*/_interopDefault(SecondaryIconButton);
|
|
48
|
-
var Text__default = /*#__PURE__*/_interopDefault(Text);
|
|
49
|
-
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
50
47
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
51
48
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
52
49
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
@@ -55,20 +52,437 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
55
52
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
56
53
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
57
54
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
58
|
-
var
|
|
55
|
+
var startCase__default = /*#__PURE__*/_interopDefault(startCase);
|
|
56
|
+
var Text__default = /*#__PURE__*/_interopDefault(Text);
|
|
57
|
+
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
58
|
+
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
59
59
|
var PrimaryButton__default = /*#__PURE__*/_interopDefault(PrimaryButton);
|
|
60
|
+
var SecondaryButton__default = /*#__PURE__*/_interopDefault(SecondaryButton);
|
|
61
|
+
var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
|
|
60
62
|
var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
|
|
61
63
|
var omitBy__default = /*#__PURE__*/_interopDefault(omitBy);
|
|
62
|
-
var _setTimeout__default = /*#__PURE__*/_interopDefault(_setTimeout);
|
|
63
64
|
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
64
|
-
var
|
|
65
|
+
var Modal__default = /*#__PURE__*/_interopDefault(Modal);
|
|
66
|
+
var Card__default = /*#__PURE__*/_interopDefault(Card);
|
|
67
|
+
var SecondaryIconButton__default = /*#__PURE__*/_interopDefault(SecondaryIconButton);
|
|
68
|
+
var _setTimeout__default = /*#__PURE__*/_interopDefault(_setTimeout);
|
|
65
69
|
var CommercetoolsLogoSvg__default = /*#__PURE__*/_interopDefault(CommercetoolsLogoSvg);
|
|
66
70
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
67
71
|
var PageNotFoundSVG__default = /*#__PURE__*/_interopDefault(PageNotFoundSVG);
|
|
68
72
|
var FailedAuthorizationSVG__default = /*#__PURE__*/_interopDefault(FailedAuthorizationSVG);
|
|
69
73
|
|
|
70
74
|
// NOTE: This string will be replaced on build time with the package version.
|
|
71
|
-
var version = "21.
|
|
75
|
+
var version = "21.3.3";
|
|
76
|
+
|
|
77
|
+
var getBottomBorderStyles = function getBottomBorderStyles(background) {
|
|
78
|
+
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, ";}" + ("" ), "" );
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
var _ref$9 = {
|
|
82
|
+
name: "1u0tiat",
|
|
83
|
+
styles: "&[aria-disabled='true']{cursor:not-allowed;opacity:0.5;&:active{pointer-events:none;}}"
|
|
84
|
+
} ;
|
|
85
|
+
|
|
86
|
+
var getLinkStyles = function getLinkStyles(isActive, isDisabled) {
|
|
87
|
+
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$9, !isActive && !isDisabled && /*#__PURE__*/react.css(":hover,:focus,:active{>*>*{color:", designSystem.customProperties.colorPrimary, "!important;}}" + ("" ), "" )];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
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; }
|
|
91
|
+
|
|
92
|
+
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; }
|
|
93
|
+
|
|
94
|
+
var pathWithoutSearch = function pathWithoutSearch(path) {
|
|
95
|
+
return typeof path === 'string' ? path.split('?')[0] : path.pathname;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
var warnIfMissingContent = function warnIfMissingContent(props) {
|
|
99
|
+
Boolean(props.intlMessage) || Boolean(props.label);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
var getDisabledTabHeaderAriaAttributes = function getDisabledTabHeaderAriaAttributes(isDisabled) {
|
|
103
|
+
return isDisabled ? {
|
|
104
|
+
'aria-disabled': true
|
|
105
|
+
} : {};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var getDisabledLinkAtributes = function getDisabledLinkAtributes(isDisabled) {
|
|
109
|
+
return isDisabled ? {
|
|
110
|
+
tabIndex: -1,
|
|
111
|
+
'aria-disabled': true
|
|
112
|
+
} : {};
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
var TabHeader = function TabHeader(props) {
|
|
116
|
+
var intl = reactIntl.useIntl();
|
|
117
|
+
var location = reactRouterDom.useLocation();
|
|
118
|
+
var isActive = Boolean(reactRouterDom.matchPath(location.pathname, {
|
|
119
|
+
// strip the search, otherwise the path won't match
|
|
120
|
+
path: pathWithoutSearch(props.to),
|
|
121
|
+
exact: props.exactPathMatch,
|
|
122
|
+
strict: false
|
|
123
|
+
}));
|
|
124
|
+
var isDisabled = props.isDisabled;
|
|
125
|
+
var label = props.label;
|
|
126
|
+
|
|
127
|
+
if (props.intlMessage) {
|
|
128
|
+
label = intl.formatMessage(props.intlMessage);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
var dataAttributeProps = _objectSpread$5({
|
|
132
|
+
'data-track-event': 'click'
|
|
133
|
+
}, label && {
|
|
134
|
+
'data-track-component': startCase__default["default"](label)
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
warnIfMissingContent(props);
|
|
138
|
+
return jsxRuntime.jsx(reactRouterDom.Link, _objectSpread$5(_objectSpread$5(_objectSpread$5({
|
|
139
|
+
to: props.to,
|
|
140
|
+
css: getLinkStyles(isActive, isDisabled)
|
|
141
|
+
}, getDisabledLinkAtributes(isDisabled)), dataAttributeProps), {}, {
|
|
142
|
+
children: jsxRuntime.jsx("div", _objectSpread$5(_objectSpread$5({
|
|
143
|
+
role: "tab",
|
|
144
|
+
"aria-selected": isActive
|
|
145
|
+
}, getDisabledTabHeaderAriaAttributes(isDisabled)), {}, {
|
|
146
|
+
children: jsxRuntime.jsx(Text__default["default"].Subheadline, {
|
|
147
|
+
as: "h4",
|
|
148
|
+
truncate: true,
|
|
149
|
+
children: label
|
|
150
|
+
})
|
|
151
|
+
}))
|
|
152
|
+
}));
|
|
153
|
+
};
|
|
154
|
+
TabHeader.propTypes = {};
|
|
155
|
+
TabHeader.displayName = 'TabHeader';
|
|
156
|
+
var defaultProps$e = {
|
|
157
|
+
isDisabled: false,
|
|
158
|
+
exactPathMatch: false
|
|
159
|
+
};
|
|
160
|
+
TabHeader.defaultProps = defaultProps$e;
|
|
161
|
+
|
|
162
|
+
var defaultProps$d = {
|
|
163
|
+
titleSize: 'small',
|
|
164
|
+
truncate: false
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
var SubtitleWrapper = _styled__default["default"]("div", {
|
|
168
|
+
target: "epaiodd0"
|
|
169
|
+
} )("margin-top:", designSystem.customProperties.spacingM, ";" + ("" ));
|
|
170
|
+
|
|
171
|
+
var renderTitle = function renderTitle(props) {
|
|
172
|
+
switch (props.titleSize) {
|
|
173
|
+
case 'big':
|
|
174
|
+
return jsxRuntime.jsx(Text__default["default"].Headline, {
|
|
175
|
+
as: "h2",
|
|
176
|
+
title: props.title,
|
|
177
|
+
truncate: props.truncate,
|
|
178
|
+
children: props.title
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
default:
|
|
182
|
+
return jsxRuntime.jsx(Text__default["default"].Subheadline, {
|
|
183
|
+
as: "h4",
|
|
184
|
+
title: props.title,
|
|
185
|
+
truncate: props.truncate,
|
|
186
|
+
children: props.title
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
var renderSubtitle = function renderSubtitle(subtitle) {
|
|
192
|
+
var truncate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
193
|
+
|
|
194
|
+
if (!subtitle) {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if ( /*#__PURE__*/react$1.isValidElement(subtitle)) {
|
|
199
|
+
return jsxRuntime.jsx(SubtitleWrapper, {
|
|
200
|
+
children: subtitle
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return jsxRuntime.jsx(SubtitleWrapper, {
|
|
205
|
+
children: jsxRuntime.jsx(Text__default["default"].Body, {
|
|
206
|
+
title: subtitle,
|
|
207
|
+
truncate: truncate,
|
|
208
|
+
children: subtitle
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
var _ref$8 = {
|
|
214
|
+
name: "d3v9zr",
|
|
215
|
+
styles: "overflow:hidden"
|
|
216
|
+
} ;
|
|
217
|
+
|
|
218
|
+
var PageHeaderTitle = function PageHeaderTitle(props) {
|
|
219
|
+
var titleSize = props.titleSize,
|
|
220
|
+
title = props.title,
|
|
221
|
+
truncate = props.truncate;
|
|
222
|
+
var renderedTitle = renderTitle({
|
|
223
|
+
titleSize: titleSize,
|
|
224
|
+
title: title,
|
|
225
|
+
truncate: truncate
|
|
226
|
+
});
|
|
227
|
+
var renderedSubtitle = renderSubtitle(props.subtitle, truncate);
|
|
228
|
+
return jsxRuntime.jsxs("div", {
|
|
229
|
+
css: _ref$8,
|
|
230
|
+
children: [renderedTitle, renderedSubtitle]
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
PageHeaderTitle.propTypes = {};
|
|
235
|
+
PageHeaderTitle.displayName = 'PageHeaderTitle';
|
|
236
|
+
PageHeaderTitle.defaultProps = defaultProps$d;
|
|
237
|
+
|
|
238
|
+
var TabControls = _styled__default["default"]("div", {
|
|
239
|
+
target: "elpldre1"
|
|
240
|
+
} )("margin-top:", designSystem.customProperties.spacingS, ";" + ("" ));
|
|
241
|
+
|
|
242
|
+
var _ref$7 = {
|
|
243
|
+
name: "1nrstx4",
|
|
244
|
+
styles: "display:flex;align-items:flex-end;justify-content:space-between"
|
|
245
|
+
} ;
|
|
246
|
+
|
|
247
|
+
var ControlsContainter = function ControlsContainter(props) {
|
|
248
|
+
return jsxRuntime.jsxs("div", {
|
|
249
|
+
css: _ref$7,
|
|
250
|
+
children: [jsxRuntime.jsx(TabControls, {
|
|
251
|
+
role: "tablist",
|
|
252
|
+
children: props.tabControls
|
|
253
|
+
}), props.formControls]
|
|
254
|
+
});
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
ControlsContainter.propTypes = {};
|
|
258
|
+
ControlsContainter.displayName = 'ControlsContainter';
|
|
259
|
+
|
|
260
|
+
var TabularPageContainer = function TabularPageContainer(props) {
|
|
261
|
+
return jsxRuntime.jsx("div", {
|
|
262
|
+
css: /*#__PURE__*/react.css("background-color:", props.color === 'surface' ? designSystem.customProperties.colorSurface : designSystem.customProperties.colorNeutral95, ";padding:", designSystem.customProperties.spacingM, " ", designSystem.customProperties.spacingM, " 0;border-bottom:1px ", designSystem.customProperties.colorNeutral, " solid;" + ("" ), "" ),
|
|
263
|
+
children: props.children
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
TabularPageContainer.propTypes = {};
|
|
268
|
+
TabularPageContainer.displayName = 'TabularPageContainer';
|
|
269
|
+
var defaultProps$c = {
|
|
270
|
+
color: 'surface'
|
|
271
|
+
};
|
|
272
|
+
TabularPageContainer.defaultProps = defaultProps$c;
|
|
273
|
+
|
|
274
|
+
var FormControlsContainer = _styled__default["default"]("div", {
|
|
275
|
+
target: "elpldre0"
|
|
276
|
+
} )("margin-bottom:", designSystem.customProperties.spacingM, ";" + ("" ));
|
|
277
|
+
|
|
278
|
+
var ContentWrapper = _styled__default["default"]("div", {
|
|
279
|
+
target: "e1b7jwn01"
|
|
280
|
+
} )("flex:1;flex-basis:0;padding:", designSystem.customProperties.spacingM, ";overflow:auto;" + ("" ));
|
|
281
|
+
var PageWrapper = _styled__default["default"]("div", {
|
|
282
|
+
target: "e1b7jwn00"
|
|
283
|
+
} )({
|
|
284
|
+
name: "kdbhus",
|
|
285
|
+
styles: "height:100%;display:flex;flex-direction:column"
|
|
286
|
+
} );
|
|
287
|
+
|
|
288
|
+
function filterDataAttributes(obj) {
|
|
289
|
+
return omitBy__default["default"](obj, function (_value, key) {
|
|
290
|
+
return !_startsWithInstanceProperty__default["default"](key).call(key, 'data-');
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
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; }
|
|
295
|
+
|
|
296
|
+
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; }
|
|
297
|
+
var primaryDefaultProps = {
|
|
298
|
+
label: i18n.sharedMessages.confirm,
|
|
299
|
+
isDisabled: false,
|
|
300
|
+
dataAttributes: {}
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
var useFormattedLabel = function useFormattedLabel(label) {
|
|
304
|
+
var intl = reactIntl.useIntl();
|
|
305
|
+
return typeof label === 'string' ? label : intl.formatMessage(label);
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
var FormPrimaryButton = function FormPrimaryButton(props) {
|
|
309
|
+
var label = useFormattedLabel(props.label);
|
|
310
|
+
return jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$4({
|
|
311
|
+
label: label,
|
|
312
|
+
onClick: props.onClick,
|
|
313
|
+
isDisabled: props.isDisabled
|
|
314
|
+
}, filterDataAttributes(props.dataAttributes)));
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
FormPrimaryButton.propTypes = {};
|
|
318
|
+
FormPrimaryButton.displayName = 'FormPrimaryButton';
|
|
319
|
+
FormPrimaryButton.defaultProps = primaryDefaultProps;
|
|
320
|
+
var secondaryDefaultProps = {
|
|
321
|
+
label: i18n.sharedMessages.cancel,
|
|
322
|
+
isDisabled: false,
|
|
323
|
+
dataAttributes: {}
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
var FormSecondaryButton = function FormSecondaryButton(props) {
|
|
327
|
+
var label = useFormattedLabel(props.label);
|
|
328
|
+
return jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$4({
|
|
329
|
+
label: label,
|
|
330
|
+
onClick: props.onClick,
|
|
331
|
+
isDisabled: props.isDisabled
|
|
332
|
+
}, filterDataAttributes(props.dataAttributes)));
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
FormSecondaryButton.propTypes = {};
|
|
336
|
+
FormSecondaryButton.displayName = 'FormSecondaryButton';
|
|
337
|
+
FormSecondaryButton.defaultProps = secondaryDefaultProps;
|
|
338
|
+
var deleteDefaultProps = {
|
|
339
|
+
label: i18n.sharedMessages.delete,
|
|
340
|
+
isDisabled: false,
|
|
341
|
+
dataAttributes: {}
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
var FormDeleteButton = function FormDeleteButton(props) {
|
|
345
|
+
var label = useFormattedLabel(props.label);
|
|
346
|
+
return jsxRuntime.jsx(IconButton__default["default"], _objectSpread$4({
|
|
347
|
+
icon: jsxRuntime.jsx(icons.BinLinearIcon, {}),
|
|
348
|
+
label: label,
|
|
349
|
+
onClick: props.onClick,
|
|
350
|
+
isDisabled: props.isDisabled
|
|
351
|
+
}, filterDataAttributes(props.dataAttributes)));
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
FormDeleteButton.propTypes = {};
|
|
355
|
+
FormDeleteButton.displayName = 'FormDeleteButton';
|
|
356
|
+
FormDeleteButton.defaultProps = deleteDefaultProps;
|
|
357
|
+
|
|
358
|
+
var defaultProps$b = {
|
|
359
|
+
hideControls: false
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
var TabularMainPage = function TabularMainPage(props) {
|
|
363
|
+
var _props$title;
|
|
364
|
+
return jsxRuntime.jsxs(PageWrapper, {
|
|
365
|
+
children: [jsxRuntime.jsx(TabularPageContainer, {
|
|
366
|
+
color: "surface",
|
|
367
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
368
|
+
children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
|
|
369
|
+
title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
|
|
370
|
+
subtitle: props.subtitle,
|
|
371
|
+
titleSize: "big"
|
|
372
|
+
}), jsxRuntime.jsx(ControlsContainter, {
|
|
373
|
+
tabControls: props.tabControls,
|
|
374
|
+
formControls: jsxRuntime.jsx(FormControlsContainer, {
|
|
375
|
+
children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
|
|
376
|
+
alignItems: "flex-end",
|
|
377
|
+
children: props.formControls
|
|
378
|
+
})
|
|
379
|
+
})
|
|
380
|
+
})]
|
|
381
|
+
})
|
|
382
|
+
}), jsxRuntime.jsx(ContentWrapper, {
|
|
383
|
+
css: /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorNeutral95, ";" + ("" ), "" ),
|
|
384
|
+
children: props.children
|
|
385
|
+
})]
|
|
386
|
+
});
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
TabularMainPage.propTypes = {};
|
|
390
|
+
TabularMainPage.displayName = 'TabularMainPage';
|
|
391
|
+
TabularMainPage.defaultProps = defaultProps$b; // Static export of pre-configured form control buttons to easily re-use
|
|
392
|
+
// them in the custom controls.
|
|
393
|
+
|
|
394
|
+
TabularMainPage.FormPrimaryButton = FormPrimaryButton;
|
|
395
|
+
TabularMainPage.FormSecondaryButton = FormSecondaryButton;
|
|
396
|
+
TabularMainPage.FormDeleteButton = FormDeleteButton; // Static export of pre-configured page header title component to easily
|
|
397
|
+
// use as part of a custom title row
|
|
398
|
+
|
|
399
|
+
TabularMainPage.PageHeaderTitle = PageHeaderTitle; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
400
|
+
|
|
401
|
+
TabularMainPage.Intl = i18n.sharedMessages;
|
|
402
|
+
|
|
403
|
+
var messages$2 = reactIntl.defineMessages({
|
|
404
|
+
back: {
|
|
405
|
+
id: 'Components.ModalPage.TopBar.Back',
|
|
406
|
+
defaultMessage: 'Go Back'
|
|
407
|
+
},
|
|
408
|
+
close: {
|
|
409
|
+
id: 'Components.ModalPage.TopBar.Close',
|
|
410
|
+
defaultMessage: 'Close Modal Page'
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
var defaultProps$a = {
|
|
415
|
+
color: 'surface',
|
|
416
|
+
previousPathLabel: messages$2.back
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
var PageTopBar = function PageTopBar(props) {
|
|
420
|
+
var intl = reactIntl.useIntl();
|
|
421
|
+
return jsxRuntime.jsx("div", {
|
|
422
|
+
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, ";" + ("" ), "" ),
|
|
423
|
+
children: jsxRuntime.jsx(FlatButton__default["default"], {
|
|
424
|
+
tone: "primary",
|
|
425
|
+
label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
|
|
426
|
+
icon: jsxRuntime.jsx(icons.ListIcon, {
|
|
427
|
+
size: "medium",
|
|
428
|
+
color: "primary"
|
|
429
|
+
}),
|
|
430
|
+
onClick: props.onClick
|
|
431
|
+
})
|
|
432
|
+
});
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
PageTopBar.propTypes = {};
|
|
436
|
+
PageTopBar.displayName = 'PageTopBar';
|
|
437
|
+
PageTopBar.defaultProps = defaultProps$a;
|
|
438
|
+
|
|
439
|
+
var defaultProps$9 = {
|
|
440
|
+
hideControls: false
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
var TabularDetailPage = function TabularDetailPage(props) {
|
|
444
|
+
var _props$title;
|
|
445
|
+
return jsxRuntime.jsxs(PageWrapper, {
|
|
446
|
+
children: [jsxRuntime.jsx(TabularPageContainer, {
|
|
447
|
+
color: "neutral",
|
|
448
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
449
|
+
children: [jsxRuntime.jsx(PageTopBar, {
|
|
450
|
+
color: "neutral",
|
|
451
|
+
previousPathLabel: props.previousPathLabel,
|
|
452
|
+
onClick: props.onPreviousPathClick
|
|
453
|
+
}), props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
|
|
454
|
+
title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
|
|
455
|
+
subtitle: props.subtitle,
|
|
456
|
+
titleSize: "big"
|
|
457
|
+
}), jsxRuntime.jsx(ControlsContainter, {
|
|
458
|
+
tabControls: props.tabControls,
|
|
459
|
+
formControls: jsxRuntime.jsx(FormControlsContainer, {
|
|
460
|
+
children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
|
|
461
|
+
alignItems: "flex-end",
|
|
462
|
+
children: props.formControls
|
|
463
|
+
})
|
|
464
|
+
})
|
|
465
|
+
})]
|
|
466
|
+
})
|
|
467
|
+
}), jsxRuntime.jsx(ContentWrapper, {
|
|
468
|
+
children: props.children
|
|
469
|
+
})]
|
|
470
|
+
});
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
TabularDetailPage.propTypes = {};
|
|
474
|
+
TabularDetailPage.displayName = 'TabularDetailPage';
|
|
475
|
+
TabularDetailPage.defaultProps = defaultProps$9; // Static export of pre-configured form control buttons to easily re-use
|
|
476
|
+
// them in the custom controls.
|
|
477
|
+
|
|
478
|
+
TabularDetailPage.FormPrimaryButton = FormPrimaryButton;
|
|
479
|
+
TabularDetailPage.FormSecondaryButton = FormSecondaryButton;
|
|
480
|
+
TabularDetailPage.FormDeleteButton = FormDeleteButton; // Static export of pre-configured page header title component to easily
|
|
481
|
+
// use as part of a custom title row
|
|
482
|
+
|
|
483
|
+
TabularDetailPage.PageHeaderTitle = PageHeaderTitle; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
484
|
+
|
|
485
|
+
TabularDetailPage.Intl = i18n.sharedMessages;
|
|
72
486
|
|
|
73
487
|
var getConstraintForGridStyle = function getConstraintForGridStyle(size) {
|
|
74
488
|
switch (size) {
|
|
@@ -103,13 +517,13 @@ var getModalContentStyles = function getModalContentStyles(props) {
|
|
|
103
517
|
return baseStyles;
|
|
104
518
|
};
|
|
105
519
|
|
|
106
|
-
var _ref$
|
|
520
|
+
var _ref$6 = {
|
|
107
521
|
name: "181loe0",
|
|
108
522
|
styles: "display:flex;position:absolute;top:0;width:100%;height:100%;background-color:rgba(32, 62, 72, 0.5);opacity:1"
|
|
109
523
|
} ;
|
|
110
524
|
|
|
111
525
|
var getModalOverlayStyles = function getModalOverlayStyles() {
|
|
112
|
-
return _ref$
|
|
526
|
+
return _ref$6;
|
|
113
527
|
};
|
|
114
528
|
|
|
115
529
|
var getDefaultParentSelector$1 = function getDefaultParentSelector() {
|
|
@@ -128,17 +542,17 @@ var GridArea = _styled__default["default"]("div", {
|
|
|
128
542
|
return props.name;
|
|
129
543
|
}, ";" + ("" ));
|
|
130
544
|
|
|
131
|
-
var _ref2$
|
|
545
|
+
var _ref2$2 = {
|
|
132
546
|
name: "13udsys",
|
|
133
547
|
styles: "height:100%"
|
|
134
548
|
} ;
|
|
135
549
|
|
|
136
550
|
var sizeStyles = function sizeStyles(props) {
|
|
137
|
-
if (props.size === 'scale') return _ref2$
|
|
551
|
+
if (props.size === 'scale') return _ref2$2;
|
|
138
552
|
return /*#__PURE__*/react.css("" , "" );
|
|
139
553
|
};
|
|
140
554
|
|
|
141
|
-
var _ref$
|
|
555
|
+
var _ref$5 = {
|
|
142
556
|
name: "1187q51",
|
|
143
557
|
styles: "display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;overflow:hidden"
|
|
144
558
|
} ;
|
|
@@ -173,7 +587,7 @@ var DialogContainer = function DialogContainer(props) {
|
|
|
173
587
|
name: "bottom"
|
|
174
588
|
}), jsxRuntime.jsx(GridArea, {
|
|
175
589
|
name: "main",
|
|
176
|
-
css: _ref$
|
|
590
|
+
css: _ref$5,
|
|
177
591
|
children: jsxRuntime.jsx(Card__default["default"] // 1. For the min-height: https://stackoverflow.com/questions/28636832/firefox-overflow-y-not-working-with-nested-flexbox/28639686#28639686
|
|
178
592
|
// 2. For the scale size, we want the card to stretch to 100% height
|
|
179
593
|
// 3. For the actual "> div" container with the content, we need to use normal pointer events so that clicking on it does not close the dialog.
|
|
@@ -194,14 +608,14 @@ DialogContainer.propTypes = {};
|
|
|
194
608
|
DialogContainer.displayName = 'DialogContainer';
|
|
195
609
|
DialogContainer.defaultProps = defaultProps$8;
|
|
196
610
|
|
|
197
|
-
var _ref$
|
|
611
|
+
var _ref$4 = {
|
|
198
612
|
name: "o5s7gs",
|
|
199
613
|
styles: "flex:0 1 auto;display:flex;flex-direction:column"
|
|
200
614
|
} ;
|
|
201
615
|
|
|
202
616
|
var DialogHeader = function DialogHeader(props) {
|
|
203
617
|
return jsxRuntime.jsx("div", {
|
|
204
|
-
css: _ref$
|
|
618
|
+
css: _ref$4,
|
|
205
619
|
children: jsxRuntime.jsxs(Spacings__default["default"].Inline, {
|
|
206
620
|
scale: "m",
|
|
207
621
|
alignItems: "center",
|
|
@@ -249,15 +663,9 @@ var InfoDialog = function InfoDialog(props) {
|
|
|
249
663
|
InfoDialog.propTypes = {};
|
|
250
664
|
InfoDialog.displayName = 'InfoDialog';
|
|
251
665
|
|
|
252
|
-
function
|
|
253
|
-
return omitBy__default["default"](obj, function (_value, key) {
|
|
254
|
-
return !_startsWithInstanceProperty__default["default"](key).call(key, 'data-');
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
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; }
|
|
666
|
+
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; }
|
|
259
667
|
|
|
260
|
-
function _objectSpread$
|
|
668
|
+
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; }
|
|
261
669
|
var defaultProps$7 = {
|
|
262
670
|
isPrimaryButtonDisabled: false,
|
|
263
671
|
dataAttributesPrimaryButton: {},
|
|
@@ -274,10 +682,10 @@ var DialogFooter = function DialogFooter(props) {
|
|
|
274
682
|
scale: "m",
|
|
275
683
|
alignItems: "center",
|
|
276
684
|
justifyContent: "flex-end",
|
|
277
|
-
children: [jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$
|
|
685
|
+
children: [jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$3({
|
|
278
686
|
label: getFormattedLabel(props.labelSecondary, intl),
|
|
279
687
|
onClick: props.onCancel
|
|
280
|
-
}, filterDataAttributes(props.dataAttributesSecondaryButton))), jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$
|
|
688
|
+
}, filterDataAttributes(props.dataAttributesSecondaryButton))), jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$3({
|
|
281
689
|
label: getFormattedLabel(props.labelPrimary, intl),
|
|
282
690
|
onClick: props.onConfirm,
|
|
283
691
|
isDisabled: props.isPrimaryButtonDisabled
|
|
@@ -380,46 +788,32 @@ var getAfterOpenContainerAnimation = function getAfterOpenContainerAnimation() {
|
|
|
380
788
|
return _ref4;
|
|
381
789
|
};
|
|
382
790
|
|
|
383
|
-
var _ref3
|
|
791
|
+
var _ref3 = {
|
|
384
792
|
name: "1d9ftqx",
|
|
385
793
|
styles: "opacity:1!important"
|
|
386
794
|
} ;
|
|
387
795
|
|
|
388
796
|
var getAfterOpenOverlayAnimation = function getAfterOpenOverlayAnimation() {
|
|
389
|
-
return _ref3
|
|
797
|
+
return _ref3;
|
|
390
798
|
};
|
|
391
799
|
|
|
392
|
-
var _ref2$
|
|
800
|
+
var _ref2$1 = {
|
|
393
801
|
name: "110wxen",
|
|
394
802
|
styles: "transform:translate3d(30px, 0, 0)!important"
|
|
395
803
|
} ;
|
|
396
804
|
|
|
397
805
|
var getBeforeCloseContainerAnimation = function getBeforeCloseContainerAnimation() {
|
|
398
|
-
return _ref2$
|
|
806
|
+
return _ref2$1;
|
|
399
807
|
};
|
|
400
808
|
|
|
401
|
-
var _ref$
|
|
809
|
+
var _ref$3 = {
|
|
402
810
|
name: "728dx5",
|
|
403
811
|
styles: "opacity:0!important"
|
|
404
812
|
} ;
|
|
405
813
|
|
|
406
814
|
var getBeforeCloseOverlayAnimation = function getBeforeCloseOverlayAnimation() {
|
|
407
|
-
return _ref$
|
|
815
|
+
return _ref$3;
|
|
408
816
|
};
|
|
409
|
-
var ContentWrapper = _styled__default["default"]("div", {
|
|
410
|
-
target: "e1jbmsa0"
|
|
411
|
-
} )("flex:1;padding:", designSystem.customProperties.spacingM, ";overflow:auto;" + ("" ));
|
|
412
|
-
|
|
413
|
-
var messages$2 = reactIntl.defineMessages({
|
|
414
|
-
back: {
|
|
415
|
-
id: 'Components.ModalPage.TopBar.Back',
|
|
416
|
-
defaultMessage: 'Go Back'
|
|
417
|
-
},
|
|
418
|
-
close: {
|
|
419
|
-
id: 'Components.ModalPage.TopBar.Close',
|
|
420
|
-
defaultMessage: 'Close Modal Page'
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
817
|
|
|
424
818
|
var LargeIconWrapper = _styled__default["default"]("span", {
|
|
425
819
|
target: "edipjip0"
|
|
@@ -436,7 +830,7 @@ var defaultProps$4 = {
|
|
|
436
830
|
previousPathLabel: messages$2.back
|
|
437
831
|
};
|
|
438
832
|
|
|
439
|
-
var _ref$
|
|
833
|
+
var _ref$2 = {
|
|
440
834
|
name: "uvw8rn",
|
|
441
835
|
styles: "display:flex;overflow:hidden;button:first-of-type svg{height:12px!important;width:12px!important;}"
|
|
442
836
|
} ;
|
|
@@ -446,7 +840,7 @@ var ModalPageTopBar = function ModalPageTopBar(props) {
|
|
|
446
840
|
return jsxRuntime.jsxs("div", {
|
|
447
841
|
css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;padding:", designSystem.customProperties.spacingS, " ", designSystem.customProperties.spacingM, ";background-color:", props.color === 'neutral' ? designSystem.customProperties.colorNeutral95 : designSystem.customProperties.colorSurface, ";border-bottom:1px solid ", props.color === 'neutral' ? designSystem.customProperties.colorSurface : designSystem.customProperties.colorNeutral, ";& *+*{margin-left:", designSystem.customProperties.spacingS, ";}p{font-size:12px!important;}" + ("" ), "" ),
|
|
448
842
|
children: [jsxRuntime.jsxs("div", {
|
|
449
|
-
css: _ref$
|
|
843
|
+
css: _ref$2,
|
|
450
844
|
children: [jsxRuntime.jsx(FlatButton__default["default"], {
|
|
451
845
|
tone: "primary",
|
|
452
846
|
label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
|
|
@@ -572,87 +966,19 @@ ModalPage.propTypes = {};
|
|
|
572
966
|
ModalPage.displayName = 'ModalPage';
|
|
573
967
|
ModalPage.defaultProps = defaultProps$3;
|
|
574
968
|
|
|
575
|
-
var
|
|
576
|
-
titleSize: 'small'
|
|
577
|
-
};
|
|
578
|
-
|
|
579
|
-
var SubtitleWrapper = _styled__default["default"]("div", {
|
|
580
|
-
target: "e1vqgk5c0"
|
|
581
|
-
} )("margin-top:", designSystem.customProperties.spacingM, ";" + ("" )); // eslint-disable-next-line react/display-name
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
var renderTitle = function renderTitle(size, title) {
|
|
585
|
-
switch (size) {
|
|
586
|
-
case 'big':
|
|
587
|
-
return jsxRuntime.jsx(Text__default["default"].Headline, {
|
|
588
|
-
as: "h2",
|
|
589
|
-
title: title,
|
|
590
|
-
truncate: true,
|
|
591
|
-
children: title
|
|
592
|
-
});
|
|
593
|
-
|
|
594
|
-
default:
|
|
595
|
-
return jsxRuntime.jsx(Text__default["default"].Subheadline, {
|
|
596
|
-
as: "h4",
|
|
597
|
-
title: title,
|
|
598
|
-
truncate: true,
|
|
599
|
-
children: title
|
|
600
|
-
});
|
|
601
|
-
}
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
var renderSubtitle = function renderSubtitle(subtitle) {
|
|
605
|
-
if (!subtitle) {
|
|
606
|
-
return null;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
if ( /*#__PURE__*/react$1.isValidElement(subtitle)) {
|
|
610
|
-
return jsxRuntime.jsx(SubtitleWrapper, {
|
|
611
|
-
children: subtitle
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
return jsxRuntime.jsx(SubtitleWrapper, {
|
|
616
|
-
children: jsxRuntime.jsx(Text__default["default"].Body, {
|
|
617
|
-
title: subtitle,
|
|
618
|
-
truncate: true,
|
|
619
|
-
children: subtitle
|
|
620
|
-
})
|
|
621
|
-
});
|
|
622
|
-
};
|
|
623
|
-
|
|
624
|
-
var _ref$3 = {
|
|
625
|
-
name: "d3v9zr",
|
|
626
|
-
styles: "overflow:hidden"
|
|
627
|
-
} ;
|
|
628
|
-
|
|
629
|
-
var ModalPageHeaderTitle = function ModalPageHeaderTitle(props) {
|
|
630
|
-
// eslint-disable-next-line testing-library/render-result-naming-convention
|
|
631
|
-
var renderedTitle = renderTitle(props.titleSize, props.title); // eslint-disable-next-line testing-library/render-result-naming-convention
|
|
632
|
-
|
|
633
|
-
var renderedSubtitle = renderSubtitle(props.subtitle);
|
|
634
|
-
return jsxRuntime.jsxs("div", {
|
|
635
|
-
css: _ref$3,
|
|
636
|
-
children: [renderedTitle, renderedSubtitle]
|
|
637
|
-
});
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
ModalPageHeaderTitle.propTypes = {};
|
|
641
|
-
ModalPageHeaderTitle.displayName = 'ModalPageHeaderTitle';
|
|
642
|
-
ModalPageHeaderTitle.defaultProps = defaultProps$2;
|
|
643
|
-
|
|
644
|
-
var ModalPageHeader = function ModalPageHeader(props) {
|
|
969
|
+
var PageHeader = function PageHeader(props) {
|
|
645
970
|
return jsxRuntime.jsxs("div", {
|
|
646
971
|
css: /*#__PURE__*/react.css("display:flex;align-items:flex-end;justify-content:space-between;margin:0 ", designSystem.customProperties.spacingM, ";padding:", designSystem.customProperties.spacingM, " 0;border-bottom:1px solid ", designSystem.customProperties.colorNeutral60, ";&>*+*{margin-left:", designSystem.customProperties.spacingM, ";}" + ("" ), "" ),
|
|
647
|
-
children: [jsxRuntime.jsx(
|
|
972
|
+
children: [jsxRuntime.jsx(PageHeaderTitle, {
|
|
648
973
|
title: props.title,
|
|
649
|
-
subtitle: props.subtitle
|
|
974
|
+
subtitle: props.subtitle,
|
|
975
|
+
truncate: true
|
|
650
976
|
}), props.children]
|
|
651
977
|
});
|
|
652
978
|
};
|
|
653
979
|
|
|
654
|
-
|
|
655
|
-
|
|
980
|
+
PageHeader.propTypes = {};
|
|
981
|
+
PageHeader.displayName = 'PageHeader';
|
|
656
982
|
|
|
657
983
|
var InfoModalPage = function InfoModalPage(props) {
|
|
658
984
|
return jsxRuntime.jsxs(ModalPage, {
|
|
@@ -667,7 +993,7 @@ var InfoModalPage = function InfoModalPage(props) {
|
|
|
667
993
|
shouldDelayOnClose: props.shouldDelayOnClose,
|
|
668
994
|
getParentSelector: props.getParentSelector,
|
|
669
995
|
afterOpenStyles: props.afterOpenStyles,
|
|
670
|
-
children: [jsxRuntime.jsx(
|
|
996
|
+
children: [jsxRuntime.jsx(PageHeader, {
|
|
671
997
|
title: props.title,
|
|
672
998
|
subtitle: props.subtitle
|
|
673
999
|
}), jsxRuntime.jsx(ContentWrapper, {
|
|
@@ -679,70 +1005,6 @@ var InfoModalPage = function InfoModalPage(props) {
|
|
|
679
1005
|
InfoModalPage.propTypes = {};
|
|
680
1006
|
InfoModalPage.displayName = 'InfoModalPage';
|
|
681
1007
|
|
|
682
|
-
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; }
|
|
683
|
-
|
|
684
|
-
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; }
|
|
685
|
-
var primaryDefaultProps = {
|
|
686
|
-
label: i18n.sharedMessages.confirm,
|
|
687
|
-
isDisabled: false,
|
|
688
|
-
dataAttributes: {}
|
|
689
|
-
};
|
|
690
|
-
|
|
691
|
-
var useFormattedLabel = function useFormattedLabel(label) {
|
|
692
|
-
var intl = reactIntl.useIntl();
|
|
693
|
-
return typeof label === 'string' ? label : intl.formatMessage(label);
|
|
694
|
-
};
|
|
695
|
-
|
|
696
|
-
var FormPrimaryButton = function FormPrimaryButton(props) {
|
|
697
|
-
var label = useFormattedLabel(props.label);
|
|
698
|
-
return jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$3({
|
|
699
|
-
label: label,
|
|
700
|
-
onClick: props.onClick,
|
|
701
|
-
isDisabled: props.isDisabled
|
|
702
|
-
}, filterDataAttributes(props.dataAttributes)));
|
|
703
|
-
};
|
|
704
|
-
|
|
705
|
-
FormPrimaryButton.propTypes = {};
|
|
706
|
-
FormPrimaryButton.displayName = 'FormPrimaryButton';
|
|
707
|
-
FormPrimaryButton.defaultProps = primaryDefaultProps;
|
|
708
|
-
var secondaryDefaultProps = {
|
|
709
|
-
label: i18n.sharedMessages.cancel,
|
|
710
|
-
isDisabled: false,
|
|
711
|
-
dataAttributes: {}
|
|
712
|
-
};
|
|
713
|
-
|
|
714
|
-
var FormSecondaryButton = function FormSecondaryButton(props) {
|
|
715
|
-
var label = useFormattedLabel(props.label);
|
|
716
|
-
return jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$3({
|
|
717
|
-
label: label,
|
|
718
|
-
onClick: props.onClick,
|
|
719
|
-
isDisabled: props.isDisabled
|
|
720
|
-
}, filterDataAttributes(props.dataAttributes)));
|
|
721
|
-
};
|
|
722
|
-
|
|
723
|
-
FormSecondaryButton.propTypes = {};
|
|
724
|
-
FormSecondaryButton.displayName = 'FormSecondaryButton';
|
|
725
|
-
FormSecondaryButton.defaultProps = secondaryDefaultProps;
|
|
726
|
-
var deleteDefaultProps = {
|
|
727
|
-
label: i18n.sharedMessages.delete,
|
|
728
|
-
isDisabled: false,
|
|
729
|
-
dataAttributes: {}
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
var FormDeleteButton = function FormDeleteButton(props) {
|
|
733
|
-
var label = useFormattedLabel(props.label);
|
|
734
|
-
return jsxRuntime.jsx(IconButton__default["default"], _objectSpread$3({
|
|
735
|
-
icon: jsxRuntime.jsx(icons.BinLinearIcon, {}),
|
|
736
|
-
label: label,
|
|
737
|
-
onClick: props.onClick,
|
|
738
|
-
isDisabled: props.isDisabled
|
|
739
|
-
}, filterDataAttributes(props.dataAttributes)));
|
|
740
|
-
};
|
|
741
|
-
|
|
742
|
-
FormDeleteButton.propTypes = {};
|
|
743
|
-
FormDeleteButton.displayName = 'FormDeleteButton';
|
|
744
|
-
FormDeleteButton.defaultProps = deleteDefaultProps;
|
|
745
|
-
|
|
746
1008
|
var CustomFormModalPage = function CustomFormModalPage(props) {
|
|
747
1009
|
return jsxRuntime.jsxs(ModalPage, {
|
|
748
1010
|
level: props.level,
|
|
@@ -756,7 +1018,7 @@ var CustomFormModalPage = function CustomFormModalPage(props) {
|
|
|
756
1018
|
getParentSelector: props.getParentSelector,
|
|
757
1019
|
shouldDelayOnClose: props.shouldDelayOnClose,
|
|
758
1020
|
afterOpenStyles: props.afterOpenStyles,
|
|
759
|
-
children: [jsxRuntime.jsx(
|
|
1021
|
+
children: [jsxRuntime.jsx(PageHeader, {
|
|
760
1022
|
title: props.title,
|
|
761
1023
|
subtitle: props.subtitle,
|
|
762
1024
|
children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
|
|
@@ -780,7 +1042,7 @@ CustomFormModalPage.FormDeleteButton = FormDeleteButton; // This is a convenienc
|
|
|
780
1042
|
|
|
781
1043
|
CustomFormModalPage.Intl = i18n.sharedMessages;
|
|
782
1044
|
|
|
783
|
-
var defaultProps$
|
|
1045
|
+
var defaultProps$2 = {
|
|
784
1046
|
hideControls: false
|
|
785
1047
|
};
|
|
786
1048
|
|
|
@@ -818,30 +1080,15 @@ var FormModalPage = function FormModalPage(props) {
|
|
|
818
1080
|
|
|
819
1081
|
FormModalPage.propTypes = {};
|
|
820
1082
|
FormModalPage.displayName = 'FormModalPage';
|
|
821
|
-
FormModalPage.defaultProps = defaultProps$
|
|
1083
|
+
FormModalPage.defaultProps = defaultProps$2; // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
|
|
822
1084
|
// The Intl messages can be used for button labels.
|
|
823
1085
|
|
|
824
1086
|
FormModalPage.Intl = i18n.sharedMessages;
|
|
825
1087
|
|
|
826
|
-
var defaultProps = {
|
|
1088
|
+
var defaultProps$1 = {
|
|
827
1089
|
hideControls: false
|
|
828
1090
|
};
|
|
829
1091
|
|
|
830
|
-
var _ref$2 = {
|
|
831
|
-
name: "18uqayh",
|
|
832
|
-
styles: "margin-bottom:16px"
|
|
833
|
-
} ;
|
|
834
|
-
|
|
835
|
-
var _ref2$1 = {
|
|
836
|
-
name: "hkh81z",
|
|
837
|
-
styles: "margin-top:8px"
|
|
838
|
-
} ;
|
|
839
|
-
|
|
840
|
-
var _ref3 = {
|
|
841
|
-
name: "1nrstx4",
|
|
842
|
-
styles: "display:flex;align-items:flex-end;justify-content:space-between"
|
|
843
|
-
} ;
|
|
844
|
-
|
|
845
1092
|
var TabularModalPage = function TabularModalPage(props) {
|
|
846
1093
|
return jsxRuntime.jsxs(ModalPage, {
|
|
847
1094
|
level: props.level,
|
|
@@ -856,24 +1103,21 @@ var TabularModalPage = function TabularModalPage(props) {
|
|
|
856
1103
|
getParentSelector: props.getParentSelector,
|
|
857
1104
|
shouldDelayOnClose: props.shouldDelayOnClose,
|
|
858
1105
|
afterOpenStyles: props.afterOpenStyles,
|
|
859
|
-
children: [jsxRuntime.jsx(
|
|
860
|
-
|
|
1106
|
+
children: [jsxRuntime.jsx(TabularPageContainer, {
|
|
1107
|
+
color: "neutral",
|
|
861
1108
|
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
862
|
-
children: [props.customTitleRow || jsxRuntime.jsx(
|
|
1109
|
+
children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
|
|
863
1110
|
title: props.title,
|
|
864
|
-
subtitle: props.subtitle
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
children: props.tabControls
|
|
870
|
-
}), jsxRuntime.jsx("div", {
|
|
871
|
-
css: _ref$2,
|
|
1111
|
+
subtitle: props.subtitle,
|
|
1112
|
+
truncate: true
|
|
1113
|
+
}), jsxRuntime.jsx(ControlsContainter, {
|
|
1114
|
+
tabControls: props.tabControls,
|
|
1115
|
+
formControls: jsxRuntime.jsx(FormControlsContainer, {
|
|
872
1116
|
children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
|
|
873
1117
|
alignItems: "flex-end",
|
|
874
1118
|
children: props.formControls
|
|
875
1119
|
})
|
|
876
|
-
})
|
|
1120
|
+
})
|
|
877
1121
|
})]
|
|
878
1122
|
})
|
|
879
1123
|
}), jsxRuntime.jsx(ContentWrapper, {
|
|
@@ -884,7 +1128,7 @@ var TabularModalPage = function TabularModalPage(props) {
|
|
|
884
1128
|
|
|
885
1129
|
TabularModalPage.propTypes = {};
|
|
886
1130
|
TabularModalPage.displayName = 'TabularModalPage';
|
|
887
|
-
TabularModalPage.defaultProps = defaultProps; // Static export of pre-configured form control buttons to easily re-use
|
|
1131
|
+
TabularModalPage.defaultProps = defaultProps$1; // Static export of pre-configured form control buttons to easily re-use
|
|
888
1132
|
// them in the custom controls.
|
|
889
1133
|
|
|
890
1134
|
TabularModalPage.FormPrimaryButton = FormPrimaryButton;
|
|
@@ -1095,20 +1339,32 @@ var PageUnauthorized = function PageUnauthorized() {
|
|
|
1095
1339
|
};
|
|
1096
1340
|
PageUnauthorized.displayName = 'PageUnauthorized';
|
|
1097
1341
|
|
|
1342
|
+
var defaultProps = {
|
|
1343
|
+
offsetTop: '0',
|
|
1344
|
+
containerSelectorToPreventScrollingOnOpen: 'main',
|
|
1345
|
+
zIndex: 10000
|
|
1346
|
+
}; // All modal components expect to be rendered inside this container.
|
|
1347
|
+
|
|
1098
1348
|
var _ref = {
|
|
1099
1349
|
name: "qk9kof",
|
|
1100
1350
|
styles: "display:flex;height:1px;margin-top:-1px"
|
|
1101
1351
|
} ;
|
|
1102
1352
|
|
|
1103
|
-
var PortalsContainer = function PortalsContainer() {
|
|
1104
|
-
return jsxRuntime.
|
|
1105
|
-
|
|
1106
|
-
,
|
|
1107
|
-
|
|
1353
|
+
var PortalsContainer = function PortalsContainer(props) {
|
|
1354
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1355
|
+
children: [jsxRuntime.jsx(react.Global // Apply some global styles, based on the `.ReactModal__Body--open` class.
|
|
1356
|
+
, {
|
|
1357
|
+
styles: /*#__PURE__*/react.css(".ReactModal__Body--open ", props.containerSelectorToPreventScrollingOnOpen, "{overflow:hidden;}.ReactModal__Body--open #", constants.PORTALS_CONTAINER_ID, "{position:fixed;height:calc(100% - ", props.offsetTop, ");width:100%;top:", props.offsetTop, ";bottom:0;z-index:", props.zIndex, ";}" + ("" ), "" )
|
|
1358
|
+
}), jsxRuntime.jsx("div", {
|
|
1359
|
+
id: constants.PORTALS_CONTAINER_ID // The container needs a height in order to be tabbable: https://reactjs/react-modal#774
|
|
1360
|
+
,
|
|
1361
|
+
css: _ref
|
|
1362
|
+
})]
|
|
1108
1363
|
});
|
|
1109
1364
|
};
|
|
1110
1365
|
|
|
1111
1366
|
PortalsContainer.displayName = 'PortalsContainer';
|
|
1367
|
+
PortalsContainer.defaultProps = defaultProps;
|
|
1112
1368
|
|
|
1113
1369
|
var useModalState = function useModalState() {
|
|
1114
1370
|
var isInitiallyOpen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -1142,6 +1398,9 @@ exports.PageNotFound = PageNotFound;
|
|
|
1142
1398
|
exports.PageUnauthorized = PageUnauthorized;
|
|
1143
1399
|
exports.PortalsContainer = PortalsContainer;
|
|
1144
1400
|
exports.PublicPageLayout = PublicPageLayout;
|
|
1401
|
+
exports.TabHeader = TabHeader;
|
|
1402
|
+
exports.TabularDetailPage = TabularDetailPage;
|
|
1403
|
+
exports.TabularMainPage = TabularMainPage;
|
|
1145
1404
|
exports.TabularModalPage = TabularModalPage;
|
|
1146
1405
|
exports.useModalState = useModalState;
|
|
1147
1406
|
exports.version = version;
|