@porsche-design-system/components-react 2.19.0 → 2.19.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -3
- package/jsdom-polyfill/index.js +12 -1
- package/jsdom-polyfill.d.ts +1 -0
- package/lib/components/button-group.wrapper.d.ts +3 -3
- package/lib/components/button-pure.wrapper.d.ts +3 -3
- package/lib/components/divider.wrapper.d.ts +3 -3
- package/lib/components/flex-item.wrapper.d.ts +13 -13
- package/lib/components/flex.wrapper.d.ts +13 -13
- package/lib/components/grid-item.wrapper.d.ts +5 -5
- package/lib/components/grid.wrapper.d.ts +7 -7
- package/lib/components/icon.wrapper.d.ts +3 -3
- package/lib/components/link-pure.wrapper.d.ts +5 -5
- package/lib/components/link-tile.wrapper.d.ts +3 -3
- package/lib/components/link.wrapper.d.ts +3 -3
- package/lib/components/marque.wrapper.d.ts +3 -3
- package/lib/components/modal.wrapper.d.ts +3 -3
- package/lib/components/spinner.wrapper.d.ts +5 -5
- package/lib/components/switch.wrapper.d.ts +3 -3
- package/lib/types.d.ts +26 -47
- package/package.json +2 -2
- package/ssr/components/dist/styles/esm/styles-entry.js +46 -23
- package/ssr/components/dist/utils/esm/utils-entry.js +46 -23
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.js +5 -10
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-pure.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-body.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-cell.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-cell.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-row.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-row.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag-dismissible.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.js +7 -12
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list-item.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list.js +3 -8
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text.js +2 -7
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea-wrapper.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/splitChildren.js +28 -0
- package/ssr/esm/components/dist/styles/esm/styles-entry.js +46 -23
- package/ssr/esm/components/dist/utils/esm/utils-entry.js +46 -23
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.js +5 -10
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-pure.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-body.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-cell.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-cell.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-row.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-row.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag-dismissible.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.js +7 -12
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list-item.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list.js +3 -8
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text.js +2 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea-wrapper.js +4 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/splitChildren.js +26 -0
- package/ssr/lib/components/button-group.wrapper.d.ts +3 -3
- package/ssr/lib/components/button-pure.wrapper.d.ts +3 -3
- package/ssr/lib/components/divider.wrapper.d.ts +3 -3
- package/ssr/lib/components/flex-item.wrapper.d.ts +13 -13
- package/ssr/lib/components/flex.wrapper.d.ts +13 -13
- package/ssr/lib/components/grid-item.wrapper.d.ts +5 -5
- package/ssr/lib/components/grid.wrapper.d.ts +7 -7
- package/ssr/lib/components/icon.wrapper.d.ts +3 -3
- package/ssr/lib/components/link-pure.wrapper.d.ts +5 -5
- package/ssr/lib/components/link-tile.wrapper.d.ts +3 -3
- package/ssr/lib/components/link.wrapper.d.ts +3 -3
- package/ssr/lib/components/marque.wrapper.d.ts +3 -3
- package/ssr/lib/components/modal.wrapper.d.ts +3 -3
- package/ssr/lib/components/spinner.wrapper.d.ts +5 -5
- package/ssr/lib/components/switch.wrapper.d.ts +3 -3
- package/ssr/lib/types.d.ts +26 -47
- package/ssr/splitChildren.d.ts +17 -0
- package/testing/index.js +8 -42
- package/testing.d.ts +1 -9
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -15,13 +16,7 @@ class DSRButton extends react.Component {
|
|
|
15
16
|
return utilsEntry.isDisabledOrLoading(this.props.disabled, this.props.loading);
|
|
16
17
|
}
|
|
17
18
|
render() {
|
|
18
|
-
|
|
19
|
-
? this.props.children
|
|
20
|
-
: this.props.children
|
|
21
|
-
? [this.props.children]
|
|
22
|
-
: [];
|
|
23
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
24
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
19
|
+
splitChildren.splitChildren(this.props.children);
|
|
25
20
|
const iconProps = {
|
|
26
21
|
className: 'icon',
|
|
27
22
|
size: 'inherit',
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -15,13 +16,7 @@ class DSRCarousel extends react.Component {
|
|
|
15
16
|
}
|
|
16
17
|
render() {
|
|
17
18
|
var _a;
|
|
18
|
-
const children =
|
|
19
|
-
? this.props.children
|
|
20
|
-
: this.props.children
|
|
21
|
-
? [this.props.children]
|
|
22
|
-
: [];
|
|
23
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
24
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
19
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
25
20
|
const btnProps = {
|
|
26
21
|
className: 'btn',
|
|
27
22
|
type: 'button',
|
|
@@ -30,8 +25,8 @@ class DSRCarousel extends react.Component {
|
|
|
30
25
|
// 'aria-controls': 'splide-track', // TODO: cross shadow dom? use native button tag instead of p-button-pure?
|
|
31
26
|
};
|
|
32
27
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getCarouselCss(this.props.wrapContent, this.props.disablePagination, this.props.theme)));
|
|
33
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "header", children: [this.props.heading ? jsxRuntime.jsx("h2", { children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" }), (this.props.description ||
|
|
34
|
-
((this.props.description && jsxRuntime.jsx("p", { children: this.props.description })) || jsxRuntime.jsx("slot", { name: "description" })), jsxRuntime.jsxs("div", { className: "nav", children: [jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-left" }), jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-right" })] })] }), jsxRuntime.jsx("div", { id: "splide", className: "splide", "aria-label": this.props.heading || ((_a =
|
|
28
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "header", children: [this.props.heading ? jsxRuntime.jsx("h2", { children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" }), (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) &&
|
|
29
|
+
((this.props.description && jsxRuntime.jsx("p", { children: this.props.description })) || jsxRuntime.jsx("slot", { name: "description" })), jsxRuntime.jsxs("div", { className: "nav", children: [jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-left" }), jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-right" })] })] }), jsxRuntime.jsx("div", { id: "splide", className: "splide", "aria-label": this.props.heading || ((_a = namedSlotChildren.find(({ props: { slot } }) => slot === 'heading')) === null || _a === void 0 ? void 0 : _a.props.children), children: jsxRuntime.jsx("div", { className: "splide__track", children: jsxRuntime.jsx("div", { className: "splide__list", children: otherChildren.map((_, i) => (jsxRuntime.jsx("div", { className: "splide__slide", children: jsxRuntime.jsx("slot", { name: `slide-${i}` }) }, i))) }) }) }), this.props.disablePagination !== true && jsxRuntime.jsx("div", { className: "pagination" })] })] }), this.props.children] }));
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
32
|
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.js');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var minifyCss = require('../../minifyCss.js');
|
|
6
7
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
@@ -10,15 +11,9 @@ var stateMessage = require('./state-message.js');
|
|
|
10
11
|
class DSRCheckboxWrapper extends react.Component {
|
|
11
12
|
render() {
|
|
12
13
|
var _a;
|
|
13
|
-
const children =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
? [this.props.children]
|
|
17
|
-
: [];
|
|
18
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
19
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
20
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getCheckboxWrapperCss(this.props.hideLabel, this.props.state, (_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled)));
|
|
21
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("label", { children: [(this.props.label || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label", children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), jsxRuntime.jsx("slot", {})] }), (this.props.message || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
|
|
14
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
15
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getCheckboxWrapperCss(this.props.hideLabel, this.props.state, typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled))));
|
|
16
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("label", { children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label", children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), jsxRuntime.jsx("slot", {})] }), (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
|
|
22
17
|
}
|
|
23
18
|
}
|
|
24
19
|
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.js');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var minifyCss = require('../../minifyCss.js');
|
|
6
7
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
@@ -8,13 +9,7 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
|
|
|
8
9
|
|
|
9
10
|
class DSRContentWrapper extends react.Component {
|
|
10
11
|
render() {
|
|
11
|
-
|
|
12
|
-
? this.props.children
|
|
13
|
-
: this.props.children
|
|
14
|
-
? [this.props.children]
|
|
15
|
-
: [];
|
|
16
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
17
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
12
|
+
splitChildren.splitChildren(this.props.children);
|
|
18
13
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getContentWrapperCss(this.props.width, this.props.backgroundColor, this.props.theme)));
|
|
19
14
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("div", { className: "root", children: jsxRuntime.jsx("slot", {}) })] }), this.props.children] }));
|
|
20
15
|
}
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.js');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var minifyCss = require('../../minifyCss.js');
|
|
6
7
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
@@ -10,17 +11,11 @@ var required = require('./required.js');
|
|
|
10
11
|
|
|
11
12
|
class DSRFieldsetWrapper extends react.Component {
|
|
12
13
|
render() {
|
|
13
|
-
const children =
|
|
14
|
-
? this.props.children
|
|
15
|
-
: this.props.children
|
|
16
|
-
? [this.props.children]
|
|
17
|
-
: [];
|
|
18
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
19
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
14
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
20
15
|
const messageId = 'message';
|
|
21
|
-
const hasMessageValue = (this.props.message ||
|
|
22
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFieldsetWrapperCss(this.props.state, this.props.labelSize, (this.props.label ||
|
|
23
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("fieldset", { "aria-describedby": hasMessageValue ? messageId : null, children: [(this.props.label ||
|
|
16
|
+
const hasMessageValue = (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state);
|
|
17
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFieldsetWrapperCss(this.props.state, this.props.labelSize, (this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0))));
|
|
18
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("fieldset", { "aria-describedby": hasMessageValue ? messageId : null, children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsxs("legend", { children: [this.props.label || jsxRuntime.jsx("slot", { name: "label" }), this.props.required && jsxRuntime.jsx(required.Required, {})] })), jsxRuntime.jsx("slot", {}), hasMessageValue && jsxRuntime.jsx(stateMessage.StateMessage, { id: messageId, state: this.props.state, message: this.props.message, host: null })] })] }), this.props.children] }));
|
|
24
19
|
}
|
|
25
20
|
}
|
|
26
21
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.js');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var minifyCss = require('../../minifyCss.js');
|
|
6
7
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
@@ -8,13 +9,7 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
|
|
|
8
9
|
|
|
9
10
|
class DSRFlexItem extends react.Component {
|
|
10
11
|
render() {
|
|
11
|
-
|
|
12
|
-
? this.props.children
|
|
13
|
-
: this.props.children
|
|
14
|
-
? [this.props.children]
|
|
15
|
-
: [];
|
|
16
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
17
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
12
|
+
splitChildren.splitChildren(this.props.children);
|
|
18
13
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFlexItemCss(this.props.width, this.props.offset, this.props.alignSelf, this.props.grow, this.props.shrink, this.props.flex)));
|
|
19
14
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("slot", {})] }), this.props.children] }));
|
|
20
15
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.js');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var minifyCss = require('../../minifyCss.js');
|
|
6
7
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
@@ -8,13 +9,7 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
|
|
|
8
9
|
|
|
9
10
|
class DSRFlex extends react.Component {
|
|
10
11
|
render() {
|
|
11
|
-
|
|
12
|
-
? this.props.children
|
|
13
|
-
: this.props.children
|
|
14
|
-
? [this.props.children]
|
|
15
|
-
: [];
|
|
16
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
17
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
12
|
+
splitChildren.splitChildren(this.props.children);
|
|
18
13
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFlexCss(this.props.inline, this.props.wrap, this.props.direction, this.props.justifyContent, this.props.alignItems, this.props.alignContent)));
|
|
19
14
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("slot", {})] }), this.props.children] }));
|
|
20
15
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.js');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var minifyCss = require('../../minifyCss.js');
|
|
6
7
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
@@ -8,13 +9,7 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
|
|
|
8
9
|
|
|
9
10
|
class DSRGridItem extends react.Component {
|
|
10
11
|
render() {
|
|
11
|
-
|
|
12
|
-
? this.props.children
|
|
13
|
-
: this.props.children
|
|
14
|
-
? [this.props.children]
|
|
15
|
-
: [];
|
|
16
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
17
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
12
|
+
splitChildren.splitChildren(this.props.children);
|
|
18
13
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getGridItemCss(this.props.size, this.props.offset, this.props.gutter || { base: 16, s: 24, m: 36 } // default as fallback
|
|
19
14
|
)));
|
|
20
15
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("slot", {})] }), this.props.children] }));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.js');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var minifyCss = require('../../minifyCss.js');
|
|
6
7
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
@@ -8,14 +9,8 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
|
|
|
8
9
|
|
|
9
10
|
class DSRGrid extends react.Component {
|
|
10
11
|
render() {
|
|
11
|
-
const children =
|
|
12
|
-
|
|
13
|
-
: this.props.children
|
|
14
|
-
? [this.props.children]
|
|
15
|
-
: [];
|
|
16
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
17
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
18
|
-
const manipulatedChildren = children.map((child, i) => typeof child === 'object' && defaultChildren.includes(child)
|
|
12
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
13
|
+
const manipulatedChildren = children.map((child, i) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
|
19
14
|
? { ...child, props: { ...child.props, gutter: this.props.gutter } }
|
|
20
15
|
: child);
|
|
21
16
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getGridCss(this.props.direction, this.props.wrap, this.props.gutter)));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.js');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var minifyCss = require('../../minifyCss.js');
|
|
6
7
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
@@ -9,13 +10,7 @@ var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entr
|
|
|
9
10
|
|
|
10
11
|
class DSRHeadline extends react.Component {
|
|
11
12
|
render() {
|
|
12
|
-
|
|
13
|
-
? this.props.children
|
|
14
|
-
: this.props.children
|
|
15
|
-
? [this.props.children]
|
|
16
|
-
: [];
|
|
17
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
18
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
13
|
+
splitChildren.splitChildren(this.props.children);
|
|
19
14
|
const TagName = utilsEntry.getHeadlineTagName(null, this.props.variant, this.props.tag);
|
|
20
15
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getHeadlineCss(this.props.variant, this.props.align, this.props.color, this.props.ellipsis, this.props.theme)));
|
|
21
16
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(TagName, { className: "root", children: jsxRuntime.jsx("slot", {}) }) })] }), this.props.children] }));
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -12,18 +13,12 @@ var icon_wrapper = require('../components/icon.wrapper.js');
|
|
|
12
13
|
|
|
13
14
|
class DSRInlineNotification extends react.Component {
|
|
14
15
|
render() {
|
|
15
|
-
const children =
|
|
16
|
-
? this.props.children
|
|
17
|
-
: this.props.children
|
|
18
|
-
? [this.props.children]
|
|
19
|
-
: [];
|
|
20
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
21
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
16
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
22
17
|
const bannerId = 'banner';
|
|
23
18
|
const labelId = 'label';
|
|
24
19
|
const descriptionId = 'description';
|
|
25
20
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getInlineNotificationCss(this.props.state, !!this.props.actionLabel, !this.props.persistent, this.props.theme)));
|
|
26
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: utilsEntry.getInlineNotificationIconName(this.props.state), color: "inherit", "aria-hidden": "true" }), jsxRuntime.jsxs("div", { id: bannerId, className: "content", ...utilsEntry.getContentAriaAttributes(this.props.state, labelId, descriptionId), children: [(this.props.heading ||
|
|
21
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: utilsEntry.getInlineNotificationIconName(this.props.state), color: "inherit", "aria-hidden": "true" }), jsxRuntime.jsxs("div", { id: bannerId, className: "content", ...utilsEntry.getContentAriaAttributes(this.props.state, labelId, descriptionId), children: [(this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0) && jsxRuntime.jsx("h5", { id: labelId, children: this.props.heading || jsxRuntime.jsx("slot", { name: "heading" }) }), jsxRuntime.jsx("p", { id: descriptionId, children: this.props.description || jsxRuntime.jsx("slot", {}) })] }), this.props.actionLabel && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "action", icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })), !this.props.persistent && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "close", type: "button", icon: "close", hideLabel: true, "aria-controls": bannerId, children: "Close notification" }))] })] }), this.props.children] }));
|
|
27
22
|
}
|
|
28
23
|
}
|
|
29
24
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -11,16 +12,10 @@ var icon_wrapper = require('../components/icon.wrapper.js');
|
|
|
11
12
|
|
|
12
13
|
class DSRLinkPure extends react.Component {
|
|
13
14
|
render() {
|
|
14
|
-
const children =
|
|
15
|
-
|
|
16
|
-
: this.props.children
|
|
17
|
-
? [this.props.children]
|
|
18
|
-
: [];
|
|
19
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
20
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
21
|
-
const hasSubline = namedSlottedChildren.filter(({ props: { slot } }) => slot === 'subline').length > 0;
|
|
15
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
16
|
+
const hasSubline = namedSlotChildren.filter(({ props: { slot } }) => slot === 'subline').length > 0;
|
|
22
17
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
23
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkPureCss(this.props.icon, this.props.active, this.props.stretch, this.props.size, this.props.weight, this.props.hideLabel, this.props.alignLabel,
|
|
18
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkPureCss(this.props.icon, this.props.active, this.props.stretch, this.props.size, this.props.weight, this.props.hideLabel, this.props.alignLabel, namedSlotChildren.filter(({ props: { slot } }) => slot === 'subline').length > 0, !this.props.href, this.props.theme)));
|
|
24
19
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
25
20
|
href: this.props.href,
|
|
26
21
|
target: this.props.target,
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -10,13 +11,7 @@ var icon_wrapper = require('../components/icon.wrapper.js');
|
|
|
10
11
|
|
|
11
12
|
class DSRLinkSocial extends react.Component {
|
|
12
13
|
render() {
|
|
13
|
-
|
|
14
|
-
? this.props.children
|
|
15
|
-
: this.props.children
|
|
16
|
-
? [this.props.children]
|
|
17
|
-
: [];
|
|
18
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
19
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
14
|
+
splitChildren.splitChildren(this.props.children);
|
|
20
15
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
21
16
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkSocialCss(this.props.icon, this.props.hideLabel, !!this.props.href, this.props.theme)));
|
|
22
17
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -12,13 +13,7 @@ var linkPure_wrapper = require('../components/link-pure.wrapper.js');
|
|
|
12
13
|
|
|
13
14
|
class DSRLinkTile extends react.Component {
|
|
14
15
|
render() {
|
|
15
|
-
|
|
16
|
-
? this.props.children
|
|
17
|
-
: this.props.children
|
|
18
|
-
? [this.props.children]
|
|
19
|
-
: [];
|
|
20
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
21
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
16
|
+
splitChildren.splitChildren(this.props.children);
|
|
22
17
|
const descriptionId = 'description';
|
|
23
18
|
const linkProps = {
|
|
24
19
|
theme: 'dark',
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -11,13 +12,7 @@ var icon_wrapper = require('../components/icon.wrapper.js');
|
|
|
11
12
|
|
|
12
13
|
class DSRLink extends react.Component {
|
|
13
14
|
render() {
|
|
14
|
-
|
|
15
|
-
? this.props.children
|
|
16
|
-
: this.props.children
|
|
17
|
-
? [this.props.children]
|
|
18
|
-
: [];
|
|
19
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
20
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
15
|
+
splitChildren.splitChildren(this.props.children);
|
|
21
16
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
22
17
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkCss(this.props.variant, this.props.hideLabel, !this.props.href, this.props.theme)));
|
|
23
18
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -11,15 +12,9 @@ var buttonPure_wrapper = require('../components/button-pure.wrapper.js');
|
|
|
11
12
|
|
|
12
13
|
class DSRModal extends react.Component {
|
|
13
14
|
render() {
|
|
14
|
-
const children =
|
|
15
|
-
? this.props.children
|
|
16
|
-
: this.props.children
|
|
17
|
-
? [this.props.children]
|
|
18
|
-
: [];
|
|
19
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
20
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
15
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
21
16
|
if (this.props.open) ;
|
|
22
|
-
const hasHeader = !!this.props.heading ||
|
|
17
|
+
const hasHeader = !!this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0;
|
|
23
18
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getModalCss(this.props.open, this.props.fullscreen, this.props.disableCloseButton, hasHeader)));
|
|
24
19
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "root", role: "dialog", "aria-modal": "true", ...{ 'aria-label': this.props.heading, ...utilsEntry.parseAndGetAriaAttributes(this.props.aria) }, "aria-hidden": !this.props.open ? 'true' : 'false', tabIndex: -1, children: [!this.props.disableCloseButton && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "close", type: "button", hideLabel: true, icon: "close", children: "Close modal" })), hasHeader && (jsxRuntime.jsx("div", { className: "header", children: this.props.heading ? jsxRuntime.jsx("h1", { children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" }) })), jsxRuntime.jsx("slot", {})] }) })] }), this.props.children] }));
|
|
25
20
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -15,13 +16,7 @@ class DSRPopover extends react.Component {
|
|
|
15
16
|
this.open = false;
|
|
16
17
|
}
|
|
17
18
|
render() {
|
|
18
|
-
|
|
19
|
-
? this.props.children
|
|
20
|
-
: this.props.children
|
|
21
|
-
? [this.props.children]
|
|
22
|
-
: [];
|
|
23
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
24
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
19
|
+
splitChildren.splitChildren(this.props.children);
|
|
25
20
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getPopoverCss(this.props.direction).replace(/(:host {[\S\s]+?})[\S\s]+/, '$1')));
|
|
26
21
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { type: "button", icon: "information", hideLabel: true,
|
|
27
22
|
// pass string to avoid another update on p-button on each render because of new object reference
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.js');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var minifyCss = require('../../minifyCss.js');
|
|
6
7
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
@@ -10,15 +11,9 @@ var stateMessage = require('./state-message.js');
|
|
|
10
11
|
class DSRRadioButtonWrapper extends react.Component {
|
|
11
12
|
render() {
|
|
12
13
|
var _a;
|
|
13
|
-
const children =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
? [this.props.children]
|
|
17
|
-
: [];
|
|
18
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
19
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
20
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getRadioButtonWrapperCss(this.props.hideLabel, this.props.state, (_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled)));
|
|
21
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("label", { children: [(this.props.label || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label", children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), jsxRuntime.jsx("slot", {})] }), (this.props.message || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
|
|
14
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
15
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getRadioButtonWrapperCss(this.props.hideLabel, this.props.state, typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled))));
|
|
16
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("label", { children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label", children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), jsxRuntime.jsx("slot", {})] }), (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
|
|
22
17
|
}
|
|
23
18
|
}
|
|
24
19
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -17,13 +18,7 @@ class DSRScroller extends react.Component {
|
|
|
17
18
|
}
|
|
18
19
|
// should only update if scrollable
|
|
19
20
|
render() {
|
|
20
|
-
|
|
21
|
-
? this.props.children
|
|
22
|
-
: this.props.children
|
|
23
|
-
? [this.props.children]
|
|
24
|
-
: [];
|
|
25
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
26
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
21
|
+
splitChildren.splitChildren(this.props.children);
|
|
27
22
|
const renderPrevNextButton = (direction) => {
|
|
28
23
|
return (jsxRuntime.jsx("div", { className: direction === 'next' ? 'action-next' : 'action-prev', children: jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "button", type: "button", tabIndex: -1, hideLabel: true, size: "inherit", icon: direction === 'next' ? 'arrow-head-right' : 'arrow-head-left', theme: this.props.theme, "aria-hidden": "true", children: direction }) }, direction));
|
|
29
24
|
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -11,13 +12,7 @@ var icon_wrapper = require('../components/icon.wrapper.js');
|
|
|
11
12
|
|
|
12
13
|
class DSRSegmentedControlItem extends react.Component {
|
|
13
14
|
render() {
|
|
14
|
-
|
|
15
|
-
? this.props.children
|
|
16
|
-
: this.props.children
|
|
17
|
-
? [this.props.children]
|
|
18
|
-
: [];
|
|
19
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
20
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
15
|
+
splitChildren.splitChildren(this.props.children);
|
|
21
16
|
// this additional validation is still needed because undefined is allowed with current propTypes
|
|
22
17
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSegmentedControlItemCss(this.props.disabled, this.props.selected, this.props.backgroundColor || 'background-default', // default as fallback
|
|
23
18
|
this.props.theme || 'light' // default as fallback
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.js');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
var minifyCss = require('../../minifyCss.js');
|
|
6
7
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
@@ -8,16 +9,10 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
|
|
|
8
9
|
|
|
9
10
|
class DSRSegmentedControl extends react.Component {
|
|
10
11
|
render() {
|
|
11
|
-
const children =
|
|
12
|
-
? this.props.children
|
|
13
|
-
: this.props.children
|
|
14
|
-
? [this.props.children]
|
|
15
|
-
: [];
|
|
16
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
17
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
12
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
18
13
|
const manipulatedChildren = children.map((child, i) => {
|
|
19
14
|
var _a;
|
|
20
|
-
return typeof child === 'object' &&
|
|
15
|
+
return typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
|
21
16
|
? { ...child, props: { ...child.props, selected: ((_a = child.props) === null || _a === void 0 ? void 0 : _a.value) === this.props.value, backgroundColor: this.props.backgroundColor, theme: this.props.theme } }
|
|
22
17
|
: child;
|
|
23
18
|
});
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
require('../../provider.js');
|
|
6
|
+
var splitChildren = require('../../splitChildren.js');
|
|
6
7
|
var minifyCss = require('../../minifyCss.js');
|
|
7
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
8
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
@@ -12,19 +13,13 @@ var icon_wrapper = require('../components/icon.wrapper.js');
|
|
|
12
13
|
class DSRSelectWrapper extends react.Component {
|
|
13
14
|
render() {
|
|
14
15
|
var _a;
|
|
15
|
-
const children =
|
|
16
|
-
|
|
17
|
-
: this.props.children
|
|
18
|
-
? [this.props.children]
|
|
19
|
-
: [];
|
|
20
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
21
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
22
|
-
const { disabled } = ((_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props) || {};
|
|
16
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
17
|
+
const { disabled } = typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props) || {};
|
|
23
18
|
const labelProps = disabled
|
|
24
19
|
? {}
|
|
25
20
|
: {};
|
|
26
21
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSelectWrapperCss(disabled, this.props.hideLabel, this.props.state, this.props.theme)));
|
|
27
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsxs("label", { className: "label", children: [(this.props.label ||
|
|
22
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsxs("label", { className: "label", children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label__text", ...labelProps, children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) && (jsxRuntime.jsx("span", { className: "label__text label__text--description", ...labelProps, children: this.props.description || jsxRuntime.jsx("slot", { name: "description" }) })), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "arrow-head-down", color: "inherit", "aria-hidden": "true" }), jsxRuntime.jsx("slot", {})] }), this.props.hasCustomDropdown && (jsxRuntime.jsx(jsxRuntime.Fragment, {}))] }), (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
|
|
28
23
|
}
|
|
29
24
|
}
|
|
30
25
|
|