@porsche-design-system/components-react 2.19.0-rc.2 → 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 +33 -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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -6,14 +7,8 @@ import { getGridCss as getComponentCss$E } from '../../../../../../components/di
|
|
|
6
7
|
|
|
7
8
|
class DSRGrid extends Component {
|
|
8
9
|
render() {
|
|
9
|
-
const children =
|
|
10
|
-
|
|
11
|
-
: this.props.children
|
|
12
|
-
? [this.props.children]
|
|
13
|
-
: [];
|
|
14
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
15
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
16
|
-
const manipulatedChildren = children.map((child, i) => typeof child === 'object' && defaultChildren.includes(child)
|
|
10
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
11
|
+
const manipulatedChildren = children.map((child, i) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
|
17
12
|
? { ...child, props: { ...child.props, gutter: this.props.gutter } }
|
|
18
13
|
: child);
|
|
19
14
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$E(this.props.direction, this.props.wrap, this.props.gutter)));
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -7,13 +8,7 @@ import { getHeadlineTagName } from '../../../../../../components/dist/utils/esm/
|
|
|
7
8
|
|
|
8
9
|
class DSRHeadline extends Component {
|
|
9
10
|
render() {
|
|
10
|
-
|
|
11
|
-
? this.props.children
|
|
12
|
-
: this.props.children
|
|
13
|
-
? [this.props.children]
|
|
14
|
-
: [];
|
|
15
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
16
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
11
|
+
splitChildren(this.props.children);
|
|
17
12
|
const TagName = getHeadlineTagName(null, this.props.variant, this.props.tag);
|
|
18
13
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$D(this.props.variant, this.props.align, this.props.color, this.props.ellipsis, this.props.theme)));
|
|
19
14
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsx(TagName, { className: "root", children: jsx("slot", {}) }) })] }), this.props.children] }));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getInlineNotificationCss as getComponentCss$B } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -10,18 +11,12 @@ import { PIcon } from '../components/icon.wrapper.js';
|
|
|
10
11
|
|
|
11
12
|
class DSRInlineNotification extends 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(this.props.children);
|
|
20
15
|
const bannerId = 'banner';
|
|
21
16
|
const labelId = 'label';
|
|
22
17
|
const descriptionId = 'description';
|
|
23
18
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$B(this.props.state, !!this.props.actionLabel, !this.props.persistent, this.props.theme)));
|
|
24
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx(PIcon, { className: "icon", name: getInlineNotificationIconName(this.props.state), color: "inherit", "aria-hidden": "true" }), jsxs("div", { id: bannerId, className: "content", ...getContentAriaAttributes(this.props.state, labelId, descriptionId), children: [(this.props.heading ||
|
|
19
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx(PIcon, { className: "icon", name: getInlineNotificationIconName(this.props.state), color: "inherit", "aria-hidden": "true" }), jsxs("div", { id: bannerId, className: "content", ...getContentAriaAttributes(this.props.state, labelId, descriptionId), children: [(this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0) && jsx("h5", { id: labelId, children: this.props.heading || jsx("slot", { name: "heading" }) }), jsx("p", { id: descriptionId, children: this.props.description || jsx("slot", {}) })] }), this.props.actionLabel && (jsx(PButtonPure, { className: "action", icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })), !this.props.persistent && (jsx(PButtonPure, { className: "close", type: "button", icon: "close", hideLabel: true, "aria-controls": bannerId, children: "Close notification" }))] })] }), this.props.children] }));
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
22
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-pure.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getLinkPureCss as getComponentCss$A } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -9,16 +10,10 @@ import { PIcon } from '../components/icon.wrapper.js';
|
|
|
9
10
|
|
|
10
11
|
class DSRLinkPure extends Component {
|
|
11
12
|
render() {
|
|
12
|
-
const children =
|
|
13
|
-
|
|
14
|
-
: this.props.children
|
|
15
|
-
? [this.props.children]
|
|
16
|
-
: [];
|
|
17
|
-
const namedSlottedChildren = 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); });
|
|
19
|
-
const hasSubline = namedSlottedChildren.filter(({ props: { slot } }) => slot === 'subline').length > 0;
|
|
13
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
14
|
+
const hasSubline = namedSlotChildren.filter(({ props: { slot } }) => slot === 'subline').length > 0;
|
|
20
15
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
21
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$A(this.props.icon, this.props.active, this.props.stretch, this.props.size, this.props.weight, this.props.hideLabel, this.props.alignLabel,
|
|
16
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$A(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)));
|
|
22
17
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
23
18
|
href: this.props.href,
|
|
24
19
|
target: this.props.target,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getLinkSocialCss as getComponentCss$z } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -8,13 +9,7 @@ import { PIcon } from '../components/icon.wrapper.js';
|
|
|
8
9
|
|
|
9
10
|
class DSRLinkSocial extends 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(this.props.children);
|
|
18
13
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
19
14
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$z(this.props.icon, this.props.hideLabel, !!this.props.href, this.props.theme)));
|
|
20
15
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Component, createElement } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getLinkTileCss as getComponentCss$y } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -10,13 +11,7 @@ import { PLinkPure } from '../components/link-pure.wrapper.js';
|
|
|
10
11
|
|
|
11
12
|
class DSRLinkTile extends 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(this.props.children);
|
|
20
15
|
const descriptionId = 'description';
|
|
21
16
|
const linkProps = {
|
|
22
17
|
theme: 'dark',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getLinkCss as getComponentCss$x } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -9,13 +10,7 @@ import { PIcon } from '../components/icon.wrapper.js';
|
|
|
9
10
|
|
|
10
11
|
class DSRLink extends 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(this.props.children);
|
|
19
14
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
20
15
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$x(this.props.variant, this.props.hideLabel, !this.props.href, this.props.theme)));
|
|
21
16
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getModalCss as getComponentCss$v } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -9,15 +10,9 @@ import { PButtonPure } from '../components/button-pure.wrapper.js';
|
|
|
9
10
|
|
|
10
11
|
class DSRModal extends Component {
|
|
11
12
|
render() {
|
|
12
|
-
const children =
|
|
13
|
-
? this.props.children
|
|
14
|
-
: this.props.children
|
|
15
|
-
? [this.props.children]
|
|
16
|
-
: [];
|
|
17
|
-
const namedSlottedChildren = 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
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
19
14
|
if (this.props.open) ;
|
|
20
|
-
const hasHeader = !!this.props.heading ||
|
|
15
|
+
const hasHeader = !!this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0;
|
|
21
16
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$v(this.props.open, this.props.fullscreen, this.props.disableCloseButton, hasHeader)));
|
|
22
17
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsxs("div", { className: "root", role: "dialog", "aria-modal": "true", ...{ 'aria-label': this.props.heading, ...parseAndGetAriaAttributes(this.props.aria) }, "aria-hidden": !this.props.open ? 'true' : 'false', tabIndex: -1, children: [!this.props.disableCloseButton && (jsx(PButtonPure, { className: "close", type: "button", hideLabel: true, icon: "close", children: "Close modal" })), hasHeader && (jsx("div", { className: "header", children: this.props.heading ? jsx("h1", { children: this.props.heading }) : jsx("slot", { name: "heading" }) })), jsx("slot", {})] }) })] }), this.props.children] }));
|
|
23
18
|
}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getPopoverCss as getComponentCss$t } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -13,13 +14,7 @@ class DSRPopover extends Component {
|
|
|
13
14
|
this.open = false;
|
|
14
15
|
}
|
|
15
16
|
render() {
|
|
16
|
-
|
|
17
|
-
? this.props.children
|
|
18
|
-
: this.props.children
|
|
19
|
-
? [this.props.children]
|
|
20
|
-
: [];
|
|
21
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
22
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
17
|
+
splitChildren(this.props.children);
|
|
23
18
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$t(this.props.direction).replace(/(:host {[\S\s]+?})[\S\s]+/, '$1')));
|
|
24
19
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx(PButtonPure, { type: "button", icon: "information", hideLabel: true,
|
|
25
20
|
// pass string to avoid another update on p-button on each render because of new object reference
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -8,15 +9,9 @@ import { StateMessage } from './state-message.js';
|
|
|
8
9
|
class DSRRadioButtonWrapper extends Component {
|
|
9
10
|
render() {
|
|
10
11
|
var _a;
|
|
11
|
-
const children =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
? [this.props.children]
|
|
15
|
-
: [];
|
|
16
|
-
const namedSlottedChildren = 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 style = minifyCss(stripFocusAndHoverStyles(getComponentCss$s(this.props.hideLabel, this.props.state, (_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled)));
|
|
19
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("label", { children: [(this.props.label || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsx("span", { className: "label", children: this.props.label || jsx("slot", { name: "label" }) })), jsx("slot", {})] }), (this.props.message || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsx(StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
|
|
12
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
13
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$s(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))));
|
|
14
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("label", { children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsx("span", { className: "label", children: this.props.label || jsx("slot", { name: "label" }) })), jsx("slot", {})] }), (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsx(StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
|
|
20
15
|
}
|
|
21
16
|
}
|
|
22
17
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getScrollerCss as getComponentCss$r } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -15,13 +16,7 @@ class DSRScroller extends Component {
|
|
|
15
16
|
}
|
|
16
17
|
// should only update if scrollable
|
|
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(this.props.children);
|
|
25
20
|
const renderPrevNextButton = (direction) => {
|
|
26
21
|
return (jsx("div", { className: direction === 'next' ? 'action-next' : 'action-prev', children: jsx(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));
|
|
27
22
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getSegmentedControlItemCss as getComponentCss$q } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -9,13 +10,7 @@ import { PIcon } from '../components/icon.wrapper.js';
|
|
|
9
10
|
|
|
10
11
|
class DSRSegmentedControlItem extends 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(this.props.children);
|
|
19
14
|
// this additional validation is still needed because undefined is allowed with current propTypes
|
|
20
15
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$q(this.props.disabled, this.props.selected, this.props.backgroundColor || 'background-default', // default as fallback
|
|
21
16
|
this.props.theme || 'light' // default as fallback
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -6,16 +7,10 @@ import { getSegmentedControlCss as getComponentCss$p } from '../../../../../../c
|
|
|
6
7
|
|
|
7
8
|
class DSRSegmentedControl extends Component {
|
|
8
9
|
render() {
|
|
9
|
-
const children =
|
|
10
|
-
? this.props.children
|
|
11
|
-
: this.props.children
|
|
12
|
-
? [this.props.children]
|
|
13
|
-
: [];
|
|
14
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
15
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
10
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
16
11
|
const manipulatedChildren = children.map((child, i) => {
|
|
17
12
|
var _a;
|
|
18
|
-
return typeof child === 'object' &&
|
|
13
|
+
return typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
|
19
14
|
? { ...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 } }
|
|
20
15
|
: child;
|
|
21
16
|
});
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getSelectWrapperCss as getComponentCss$o } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -10,19 +11,13 @@ import { PIcon } from '../components/icon.wrapper.js';
|
|
|
10
11
|
class DSRSelectWrapper extends Component {
|
|
11
12
|
render() {
|
|
12
13
|
var _a;
|
|
13
|
-
const children =
|
|
14
|
-
|
|
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
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
20
|
-
const { disabled } = ((_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props) || {};
|
|
14
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
15
|
+
const { disabled } = typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props) || {};
|
|
21
16
|
const labelProps = disabled
|
|
22
17
|
? {}
|
|
23
18
|
: {};
|
|
24
19
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$o(disabled, this.props.hideLabel, this.props.state, this.props.theme)));
|
|
25
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("div", { className: "root", children: [jsxs("label", { className: "label", children: [(this.props.label ||
|
|
20
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("div", { className: "root", children: [jsxs("label", { className: "label", children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsx("span", { className: "label__text", ...labelProps, children: this.props.label || jsx("slot", { name: "label" }) })), (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) && (jsx("span", { className: "label__text label__text--description", ...labelProps, children: this.props.description || jsx("slot", { name: "description" }) })), jsx(PIcon, { className: "icon", name: "arrow-head-down", color: "inherit", "aria-hidden": "true" }), jsx("slot", {})] }), this.props.hasCustomDropdown && (jsx(Fragment, {}))] }), (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsx(StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
|
|
26
21
|
}
|
|
27
22
|
}
|
|
28
23
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getStepperHorizontalItemCss as getComponentCss$l } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -9,13 +10,7 @@ import { PIcon } from '../components/icon.wrapper.js';
|
|
|
9
10
|
|
|
10
11
|
class DSRStepperHorizontalItem extends 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(this.props.children);
|
|
19
14
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$l(this.props.state, this.props.disabled, this.props.theme || 'light')));
|
|
20
15
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsxs("button", { type: "button", "aria-disabled": !this.props.state || this.props.disabled ? 'true' : null, "aria-current": this.props.state === 'current' ? 'step' : null, children: [isStateCompleteOrWarning(this.props.state) && (jsx(PIcon, { className: "icon", name: getStepperHorizontalIconName(this.props.state), size: "inherit", theme: this.props.theme || 'light', color: "inherit", "aria-hidden": "true" })), this.props.state && jsxs("span", { className: "sr-only", children: [this.props.state, ": "] }), jsx("slot", {})] }) })] }), this.props.children] }));
|
|
21
16
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getStepperHorizontalCss as getComponentCss$k } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -12,14 +13,8 @@ class DSRStepperHorizontal extends Component {
|
|
|
12
13
|
this.stepperHorizontalItems = [];
|
|
13
14
|
}
|
|
14
15
|
render() {
|
|
15
|
-
const children =
|
|
16
|
-
|
|
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
|
-
const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
22
|
-
const manipulatedChildren = children.map((child, i) => typeof child === 'object' && defaultChildren.includes(child)
|
|
16
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
17
|
+
const manipulatedChildren = children.map((child, i) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
|
23
18
|
? { ...child, props: { ...child.props, theme: this.props.theme } }
|
|
24
19
|
: child);
|
|
25
20
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$k(this.props.size)));
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getSwitchCss as getComponentCss$j } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -12,13 +13,7 @@ class DSRSwitch extends Component {
|
|
|
12
13
|
return isDisabledOrLoading(this.props.disabled, this.props.loading);
|
|
13
14
|
}
|
|
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(this.props.children);
|
|
22
17
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$j(this.props.alignLabel, this.props.hideLabel, this.props.stretch, this.props.checked, this.props.loading, this.isDisabledOrLoading, this.props.theme)));
|
|
23
18
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("label", { className: "root", children: [jsx("span", { id: "label", className: "text", children: jsx("slot", {}) }), jsx("button", { ...getSwitchButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.checked), type: "button", role: "switch", tabIndex: this.props.tabbable ? parseInt(null, 10) || null : -1, children: jsx("span", { className: "toggle", children: this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.checked ? 'light' : 'dark', aria: { 'aria-label': 'Loading state' } })) }) })] })] }), this.props.children] }));
|
|
24
19
|
}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-body.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -6,13 +7,7 @@ import { getTableBodyCss as getComponentCss$i } from '../../../../../../componen
|
|
|
6
7
|
|
|
7
8
|
class DSRTableBody extends Component {
|
|
8
9
|
render() {
|
|
9
|
-
|
|
10
|
-
? this.props.children
|
|
11
|
-
: this.props.children
|
|
12
|
-
? [this.props.children]
|
|
13
|
-
: [];
|
|
14
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
15
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
10
|
+
splitChildren(this.props.children);
|
|
16
11
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$i()));
|
|
17
12
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsx("slot", {}) })] }), this.props.children] }));
|
|
18
13
|
}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-cell.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -6,13 +7,7 @@ import { getTableCellCss as getComponentCss$h } from '../../../../../../componen
|
|
|
6
7
|
|
|
7
8
|
class DSRTableCell extends Component {
|
|
8
9
|
render() {
|
|
9
|
-
|
|
10
|
-
? this.props.children
|
|
11
|
-
: this.props.children
|
|
12
|
-
? [this.props.children]
|
|
13
|
-
: [];
|
|
14
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
15
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
10
|
+
splitChildren(this.props.children);
|
|
16
11
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$h(this.props.multiline)));
|
|
17
12
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsx("slot", {}) })] }), this.props.children] }));
|
|
18
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getTableHeadCellCss as getComponentCss$g } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -9,13 +10,7 @@ import { PIcon } from '../components/icon.wrapper.js';
|
|
|
9
10
|
|
|
10
11
|
class DSRTableHeadCell extends 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(this.props.children);
|
|
19
14
|
const { active, direction } = this.props.sort || {};
|
|
20
15
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$g(active, direction, this.props.hideLabel, this.props.multiline)));
|
|
21
16
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: isSortable(active, direction) ? (jsxs("button", { type: "button", children: [jsx("slot", {}), jsx(PIcon, { className: "icon", color: "inherit", name: "arrow-up", "aria-hidden": "true" })] })) : (jsx("span", { children: jsx("slot", {}) })) })] }), this.props.children] }));
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-row.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -6,13 +7,7 @@ import { getTableHeadRowCss as getComponentCss$f } from '../../../../../../compo
|
|
|
6
7
|
|
|
7
8
|
class DSRTableHeadRow extends Component {
|
|
8
9
|
render() {
|
|
9
|
-
|
|
10
|
-
? this.props.children
|
|
11
|
-
: this.props.children
|
|
12
|
-
? [this.props.children]
|
|
13
|
-
: [];
|
|
14
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
15
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
10
|
+
splitChildren(this.props.children);
|
|
16
11
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$f()));
|
|
17
12
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsx("slot", {}) })] }), this.props.children] }));
|
|
18
13
|
}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -6,13 +7,7 @@ import { getTableHeadCss as getComponentCss$e } from '../../../../../../componen
|
|
|
6
7
|
|
|
7
8
|
class DSRTableHead extends Component {
|
|
8
9
|
render() {
|
|
9
|
-
|
|
10
|
-
? this.props.children
|
|
11
|
-
: this.props.children
|
|
12
|
-
? [this.props.children]
|
|
13
|
-
: [];
|
|
14
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
15
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
10
|
+
splitChildren(this.props.children);
|
|
16
11
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$e()));
|
|
17
12
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsx("slot", {}) })] }), this.props.children] }));
|
|
18
13
|
}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-row.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { minifyCss } from '../../minifyCss.js';
|
|
4
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
@@ -6,13 +7,7 @@ import { getTableRowCss as getComponentCss$d } from '../../../../../../component
|
|
|
6
7
|
|
|
7
8
|
class DSRTableRow extends Component {
|
|
8
9
|
render() {
|
|
9
|
-
|
|
10
|
-
? this.props.children
|
|
11
|
-
: this.props.children
|
|
12
|
-
? [this.props.children]
|
|
13
|
-
: [];
|
|
14
|
-
children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
15
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
10
|
+
splitChildren(this.props.children);
|
|
16
11
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$d()));
|
|
17
12
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsx("slot", {}) })] }), this.props.children] }));
|
|
18
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.js';
|
|
4
|
+
import { splitChildren } from '../../splitChildren.js';
|
|
4
5
|
import { minifyCss } from '../../minifyCss.js';
|
|
5
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
|
|
6
7
|
import { getTableCss as getComponentCss$c } from '../../../../../../components/dist/styles/esm/styles-entry.js';
|
|
@@ -13,14 +14,8 @@ class DSRTable extends Component {
|
|
|
13
14
|
this.isScrollable = false;
|
|
14
15
|
}
|
|
15
16
|
render() {
|
|
16
|
-
const children =
|
|
17
|
-
|
|
18
|
-
: this.props.children
|
|
19
|
-
? [this.props.children]
|
|
20
|
-
: [];
|
|
21
|
-
const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
|
|
22
|
-
children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
|
|
23
|
-
const hasSlottedCaption = namedSlottedChildren.filter(({ props: { slot } }) => slot === 'caption').length > 0;
|
|
17
|
+
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
18
|
+
const hasSlottedCaption = namedSlotChildren.filter(({ props: { slot } }) => slot === 'caption').length > 0;
|
|
24
19
|
const captionId = 'caption';
|
|
25
20
|
const tableAttr = this.props.caption
|
|
26
21
|
? { 'aria-label': this.props.caption }
|