@porsche-design-system/components-react 3.21.0 → 3.22.0-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 +54 -2
- package/ag-grid/theme.css +17 -8
- package/cjs/lib/components/flyout-multilevel-item.wrapper.cjs +3 -3
- package/cjs/lib/components/link-tile-model-signature.wrapper.cjs +1 -1
- package/cjs/lib/components/pin-code.wrapper.cjs +3 -3
- package/cjs/lib/components/segmented-control.wrapper.cjs +3 -3
- package/esm/lib/components/flyout-multilevel-item.wrapper.d.ts +24 -0
- package/esm/lib/components/flyout-multilevel-item.wrapper.mjs +3 -3
- package/esm/lib/components/link-tile-model-signature.wrapper.mjs +1 -1
- package/esm/lib/components/pin-code.wrapper.d.ts +8 -0
- package/esm/lib/components/pin-code.wrapper.mjs +3 -3
- package/esm/lib/components/segmented-control.wrapper.d.ts +24 -0
- package/esm/lib/components/segmented-control.wrapper.mjs +3 -3
- package/esm/lib/components/select.wrapper.d.ts +2 -2
- package/esm/lib/types.d.ts +36 -35
- package/package.json +6 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +882 -738
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +458 -419
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/flyout-multilevel-item.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile-model-signature.wrapper.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/pin-code.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/segmented-control.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.cjs +7 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout-multilevel-item.cjs +9 -6
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout-multilevel.cjs +13 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/loading-message.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.cjs +1 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +6 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pagination.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.cjs +15 -6
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.cjs +3 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.cjs +9 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.cjs +3 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +2 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/toast.cjs +1 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +882 -738
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +454 -420
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/flyout-multilevel-item.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile-model-signature.wrapper.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/pin-code.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/segmented-control.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs +7 -3
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout-multilevel-item.mjs +9 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout-multilevel.mjs +14 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/loading-message.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.mjs +1 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +6 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pagination.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs +15 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.mjs +3 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.mjs +9 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.mjs +3 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +2 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/toast.mjs +1 -1
- package/ssr/esm/lib/components/flyout-multilevel-item.wrapper.d.ts +24 -0
- package/ssr/esm/lib/components/pin-code.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/segmented-control.wrapper.d.ts +24 -0
- package/ssr/esm/lib/components/select.wrapper.d.ts +2 -2
- package/ssr/esm/lib/dsr-components/button-pure.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/button.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/canvas.d.ts +4 -0
- package/ssr/esm/lib/dsr-components/checkbox-wrapper.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/checkbox.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/flyout-multilevel-item.d.ts +3 -2
- package/ssr/esm/lib/dsr-components/flyout-multilevel.d.ts +5 -0
- package/ssr/esm/lib/dsr-components/pin-code.d.ts +6 -3
- package/ssr/esm/lib/dsr-components/radio-button-wrapper.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/segmented-control.d.ts +5 -0
- package/ssr/esm/lib/dsr-components/switch.d.ts +1 -0
- package/ssr/esm/lib/types.d.ts +36 -35
- package/styles/_index.scss +1 -1
|
@@ -5,20 +5,20 @@ import { usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.m
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRFlyoutMultilevelItem } from '../dsr-components/flyout-multilevel-item.mjs';
|
|
7
7
|
|
|
8
|
-
const PFlyoutMultilevelItem = /*#__PURE__*/ forwardRef(({ identifier, label, className, children, ...rest }, ref) => {
|
|
8
|
+
const PFlyoutMultilevelItem = /*#__PURE__*/ forwardRef(({ cascade = false, identifier, label, primary = false, secondary = false, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
const WebComponentTag = usePrefix('p-flyout-multilevel-item');
|
|
11
|
-
const propsToSync = [identifier, label];
|
|
11
|
+
const propsToSync = [cascade, identifier, label, primary, secondary];
|
|
12
12
|
useBrowserLayoutEffect(() => {
|
|
13
13
|
const { current } = elementRef;
|
|
14
|
-
['identifier', 'label'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
|
+
['cascade', 'identifier', 'label', 'primary', 'secondary'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
15
|
}, propsToSync);
|
|
16
16
|
const props = {
|
|
17
17
|
...rest,
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
...(!process.browser
|
|
20
20
|
? {
|
|
21
|
-
children: (jsx(DSRFlyoutMultilevelItem, { identifier, label, children })),
|
|
21
|
+
children: (jsx(DSRFlyoutMultilevelItem, { cascade, identifier, label, primary, secondary, children })),
|
|
22
22
|
}
|
|
23
23
|
: {
|
|
24
24
|
children,
|
|
@@ -5,7 +5,7 @@ import { usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.m
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRLinkTileModelSignature } from '../dsr-components/link-tile-model-signature.mjs';
|
|
7
7
|
|
|
8
|
-
const PLinkTileModelSignature = /*#__PURE__*/ forwardRef(({ aspectRatio = '3/4', description, heading, headingTag = 'h2', linkDirection = { base: 'column', xs: 'row' }, model = '911', weight = 'semi-bold', className, children, ...rest }, ref) => {
|
|
8
|
+
const PLinkTileModelSignature = /*#__PURE__*/ forwardRef(({ aspectRatio = '3/4', description, heading, headingTag = 'h2', linkDirection = { base: 'column', xs: 'row', }, model = '911', weight = 'semi-bold', className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
const WebComponentTag = usePrefix('p-link-tile-model-signature');
|
|
11
11
|
const propsToSync = [aspectRatio, description, heading, headingTag, linkDirection, model, weight];
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/pin-code.wrapper.mjs
CHANGED
|
@@ -5,21 +5,21 @@ import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMerge
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRPinCode } from '../dsr-components/pin-code.mjs';
|
|
7
7
|
|
|
8
|
-
const PPinCode = /*#__PURE__*/ forwardRef(({ description = '', disabled = false, hideLabel = false, label = '', length = 4, loading = false, message = '', name, onUpdate, required = false, state = 'none', theme, type = 'number', value = '', className, children, ...rest }, ref) => {
|
|
8
|
+
const PPinCode = /*#__PURE__*/ forwardRef(({ description = '', disabled = false, form, hideLabel = false, label = '', length = 4, loading = false, message = '', name, onUpdate, required = false, state = 'none', theme, type = 'number', value = '', className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
useEventCallback(elementRef, 'update', onUpdate);
|
|
11
11
|
const WebComponentTag = usePrefix('p-pin-code');
|
|
12
|
-
const propsToSync = [description, disabled, hideLabel, label, length, loading, message, name, required, state, theme || useTheme(), type, value];
|
|
12
|
+
const propsToSync = [description, disabled, form, hideLabel, label, length, loading, message, name, required, state, theme || useTheme(), type, value];
|
|
13
13
|
useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['description', 'disabled', 'hideLabel', 'label', 'length', 'loading', 'message', 'name', 'required', 'state', 'theme', 'type', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['description', 'disabled', 'form', 'hideLabel', 'label', 'length', 'loading', 'message', 'name', 'required', 'state', 'theme', 'type', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
const props = {
|
|
18
18
|
...rest,
|
|
19
19
|
// @ts-ignore
|
|
20
20
|
...(!process.browser
|
|
21
21
|
? {
|
|
22
|
-
children: (jsx(DSRPinCode, { description, disabled, hideLabel, label, length, loading, message, name, required, state, theme: theme || useTheme(), type, value, children })),
|
|
22
|
+
children: (jsx(DSRPinCode, { description, disabled, form, hideLabel, label, length, loading, message, name, required, state, theme: theme || useTheme(), type, value, children })),
|
|
23
23
|
}
|
|
24
24
|
: {
|
|
25
25
|
children,
|
|
@@ -5,15 +5,15 @@ import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMerge
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRSegmentedControl } from '../dsr-components/segmented-control.mjs';
|
|
7
7
|
|
|
8
|
-
const PSegmentedControl = /*#__PURE__*/ forwardRef(({ backgroundColor, columns = 'auto', onSegmentedControlChange, onUpdate, theme, value, className, children, ...rest }, ref) => {
|
|
8
|
+
const PSegmentedControl = /*#__PURE__*/ forwardRef(({ backgroundColor, columns = 'auto', disabled = false, form, name, onSegmentedControlChange, onUpdate, theme, value, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
useEventCallback(elementRef, 'segmentedControlChange', onSegmentedControlChange);
|
|
11
11
|
useEventCallback(elementRef, 'update', onUpdate);
|
|
12
12
|
const WebComponentTag = usePrefix('p-segmented-control');
|
|
13
|
-
const propsToSync = [backgroundColor, columns, theme || useTheme(), value];
|
|
13
|
+
const propsToSync = [backgroundColor, columns, disabled, form, name, theme || useTheme(), value];
|
|
14
14
|
useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['backgroundColor', 'columns', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['backgroundColor', 'columns', 'disabled', 'form', 'name', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
const props = {
|
|
19
19
|
...rest,
|
|
@@ -21,7 +21,7 @@ const PSegmentedControl = /*#__PURE__*/ forwardRef(({ backgroundColor, columns =
|
|
|
21
21
|
...(!process.browser
|
|
22
22
|
? {
|
|
23
23
|
...{ "role": "group" },
|
|
24
|
-
children: (jsx(DSRSegmentedControl, { backgroundColor, columns, theme: theme || useTheme(), value, children })),
|
|
24
|
+
children: (jsx(DSRSegmentedControl, { backgroundColor, columns, disabled, form, name, theme: theme || useTheme(), value, children })),
|
|
25
25
|
}
|
|
26
26
|
: {
|
|
27
27
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs
CHANGED
|
@@ -25,7 +25,7 @@ class DSRBanner extends Component {
|
|
|
25
25
|
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
26
26
|
const hasTitleSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'title').length > 0;
|
|
27
27
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$18(this.props.open)));
|
|
28
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsxs(PInlineNotification, { heading: this.props.heading, headingTag: this.props.headingTag, description: this.props.description, state: this.props.state, dismissButton: this.hasDismissButton, theme: this.props.theme, "aria-hidden":
|
|
28
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsxs(PInlineNotification, { heading: this.props.heading, headingTag: this.props.headingTag, description: this.props.description, state: this.props.state, dismissButton: this.hasDismissButton, theme: this.props.theme, "aria-hidden": this.props.open ? 'false' : 'true', children: [namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0 ? (jsx("slot", { name: "heading", slot: "heading" })) : (hasTitleSlot && jsx("slot", { name: "title", slot: "heading" })), namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0 && jsx("slot", { name: "description" })] }) })] }), this.props.children] }));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs
CHANGED
|
@@ -15,6 +15,7 @@ import { PSpinner } from '../components/spinner.wrapper.mjs';
|
|
|
15
15
|
*/
|
|
16
16
|
class DSRButtonPure extends Component {
|
|
17
17
|
host;
|
|
18
|
+
initialLoading = false;
|
|
18
19
|
get isDisabledOrLoading() {
|
|
19
20
|
return isDisabledOrLoading(this.props.disabled, this.props.loading);
|
|
20
21
|
}
|
|
@@ -28,7 +29,7 @@ class DSRButtonPure extends Component {
|
|
|
28
29
|
theme: this.props.theme,
|
|
29
30
|
};
|
|
30
31
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$16(this.props.icon, this.props.iconSource, this.props.active, this.props.loading, this.isDisabledOrLoading, this.props.stretch, this.props.size, this.props.hideLabel, this.props.alignLabel, this.props.underline, this.props.theme)));
|
|
31
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("button", { ...getButtonPureAriaAttributes(this.props.disabled, this.props.loading, this.props.aria), className: "root", type: this.props.type, name: this.props.name, value: this.props.value, "aria-describedby": this.props.loading ? loadingId : undefined, children: [this.props.loading ? (jsx(PSpinner, { ...iconProps, "aria-hidden": "true" })) : (hasIcon && (jsx(PIcon, { ...iconProps, name: this.props.icon, source: this.props.iconSource, color: this.isDisabledOrLoading ? 'state-disabled' : 'primary', theme: this.props.theme, "aria-hidden": "true" }))), jsx("span", { className: "label", children: jsx("slot", {}) })] }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading:
|
|
32
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("button", { ...getButtonPureAriaAttributes(this.props.disabled, this.props.loading, this.props.aria), className: "root", type: this.props.type, name: this.props.name, value: this.props.value, "aria-describedby": this.props.loading ? loadingId : undefined, children: [this.props.loading ? (jsx(PSpinner, { ...iconProps, "aria-hidden": "true" })) : (hasIcon && (jsx(PIcon, { ...iconProps, name: this.props.icon, source: this.props.iconSource, color: this.isDisabledOrLoading ? 'state-disabled' : 'primary', theme: this.props.theme, "aria-hidden": "true" }))), jsx("span", { className: "label", children: jsx("slot", {}) })] }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs
CHANGED
|
@@ -15,10 +15,11 @@ import { PSpinner } from '../components/spinner.wrapper.mjs';
|
|
|
15
15
|
*/
|
|
16
16
|
class DSRButton extends Component {
|
|
17
17
|
host;
|
|
18
|
+
initialLoading = false;
|
|
18
19
|
render() {
|
|
19
20
|
splitChildren(this.props.children);
|
|
20
21
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$14(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, this.props.disabled, this.props.loading, this.props.compact, this.props.theme)));
|
|
21
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("button", { ...getButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.aria), className: "root", type: this.props.type, name: this.props.name, value: this.props.value, "aria-describedby": this.props.loading ? loadingId : undefined, children: [this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" })), hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsx(PIcon, { className: "icon", size: "inherit", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: this.props.disabled ? (this.props.variant === 'primary' ? 'contrast-high' : 'state-disabled') : 'primary', theme: this.props.theme, "aria-hidden": "true" })), jsx("span", { className: "label", children: jsx("slot", {}) })] }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading:
|
|
22
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("button", { ...getButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.aria), className: "root", type: this.props.type, name: this.props.name, value: this.props.value, "aria-describedby": this.props.loading ? loadingId : undefined, children: [this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" })), hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsx(PIcon, { className: "icon", size: "inherit", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: this.props.disabled ? (this.props.variant === 'primary' ? 'contrast-high' : 'state-disabled') : 'primary', theme: this.props.theme, "aria-hidden": "true" })), jsx("span", { className: "label", children: jsx("slot", {}) })] }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs
CHANGED
|
@@ -30,6 +30,10 @@ class DSRCanvas extends Component {
|
|
|
30
30
|
hasSidebarEnd;
|
|
31
31
|
hasFooter;
|
|
32
32
|
hasBackground;
|
|
33
|
+
sidebarStart;
|
|
34
|
+
sidebarEnd;
|
|
35
|
+
root;
|
|
36
|
+
header;
|
|
33
37
|
render() {
|
|
34
38
|
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
35
39
|
const hasTitle = namedSlotChildren.filter(({ props: { slot } }) => slot === 'title').length > 0;
|
|
@@ -37,15 +41,15 @@ class DSRCanvas extends Component {
|
|
|
37
41
|
const hasFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'footer').length > 0;
|
|
38
42
|
const hasBackground = namedSlotChildren.filter(({ props: { slot } }) => slot === 'background').length > 0;
|
|
39
43
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$13(this.props.theme, this.props.sidebarStartOpen, this.props.sidebarEndOpen)));
|
|
40
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("div", { className: "root", children: [jsxs("header", { className: "header", children: [jsxs("div", { className: "blur", children: [jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {})] }), jsxs("div", { className: "header__area header__area--start", children: [!this.props.sidebarStartOpen && (jsxs(PButton, { theme: this.props.theme, icon: "sidebar", variant: "ghost", compact: true, "hide-label": "true", aria: { 'aria-expanded': this.props.sidebarStartOpen }, children: [this.props.sidebarStartOpen ? 'Close' : 'Open', " navigation sidebar"] })), jsx("slot", { name: "header-start" })] }), jsx(PCrest, { className: "header__crest" }), jsx(PWordmark, { className: "header__wordmark", size: "inherit", theme: this.props.theme }), jsx("div", { className: "header__area header__area--end", children: jsx("slot", { name: "header-end" }) })] }),
|
|
44
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("div", { className: "root", children: [jsxs("header", { className: "header", tabIndex: -1, children: [jsxs("div", { className: "blur", children: [jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {}), jsx("div", {})] }), jsxs("div", { className: "header__area header__area--start", children: [!this.props.sidebarStartOpen && (jsxs(PButton, { theme: this.props.theme, icon: "sidebar", variant: "ghost", compact: true, "hide-label": "true", aria: { 'aria-expanded': this.props.sidebarStartOpen }, children: [this.props.sidebarStartOpen ? 'Close' : 'Open', " navigation sidebar"] })), jsx("slot", { name: "header-start" })] }), jsx(PCrest, { className: "header__crest" }), jsx(PWordmark, { className: "header__wordmark", size: "inherit", theme: this.props.theme }), jsx("div", { className: "header__area header__area--end", children: jsx("slot", { name: "header-end" }) })] }), this.props.isMediaQueryS && (jsx("aside", { className: "sidebar sidebar--start",
|
|
41
45
|
// "inert" will be known from React 19 onwards, see https://github.com/facebook/react/pull/24730
|
|
42
46
|
// eslint-disable-next-line
|
|
43
47
|
/* @ts-ignore */
|
|
44
|
-
inert: this.props.sidebarStartOpen ? null : true, "aria-label": `Navigation sidebar ${this.props.sidebarStartOpen ? 'open' : 'closed'}`, children: jsxs("div", { className: "sidebar__scroller", children: [jsxs("div", { className: "sidebar__header sidebar__header--start", children: [jsxs(PButton, { theme: this.props.theme, icon: "sidebar", variant: "ghost", compact: true, "hide-label": "true", aria: { 'aria-expanded': this.props.sidebarStartOpen }, children: [this.props.sidebarStartOpen ? 'Close' : 'Open', " navigation sidebar"] }), hasTitle && (jsx("h2", { children: jsx("slot", { name: "title" }) }))] }), jsx("div", { className: "sidebar__content", children: jsx("slot", { name: "sidebar-start" }) })] }) })), hasSidebarEnd && this.props.isMediaQueryM && (jsx("aside", { className: "sidebar sidebar--end",
|
|
48
|
+
inert: this.props.sidebarStartOpen ? null : true, "aria-label": `Navigation sidebar ${this.props.sidebarStartOpen ? 'open' : 'closed'}`, tabIndex: -1, children: jsxs("div", { className: "sidebar__scroller", children: [jsxs("div", { className: "sidebar__header sidebar__header--start", children: [jsxs(PButton, { theme: this.props.theme, icon: "sidebar", variant: "ghost", compact: true, "hide-label": "true", aria: { 'aria-expanded': this.props.sidebarStartOpen }, children: [this.props.sidebarStartOpen ? 'Close' : 'Open', " navigation sidebar"] }), hasTitle && (jsx("h2", { children: jsx("slot", { name: "title" }) }))] }), jsx("div", { className: "sidebar__content", children: jsx("slot", { name: "sidebar-start" }) })] }) })), jsx("main", { className: "main", children: jsx("slot", {}) }), hasSidebarEnd && this.props.isMediaQueryM && (jsx("aside", { className: "sidebar sidebar--end",
|
|
45
49
|
// "inert" will be known from React 19 onwards, see https://github.com/facebook/react/pull/24730
|
|
46
50
|
// eslint-disable-next-line
|
|
47
51
|
/* @ts-ignore */
|
|
48
|
-
inert: this.props.sidebarEndOpen ? null : true, "aria-label": `Settings sidebar ${this.props.sidebarEndOpen ? 'open' : 'closed'}`, children: jsxs("div", { className: "sidebar__scroller", children: [jsx("div", { className: "sidebar__header sidebar__header--end", children: jsxs(PButton, { theme: this.props.theme, icon: "close", variant: "ghost", compact: true, "hide-label": "true", aria: { 'aria-expanded': this.props.sidebarEndOpen }, children: [this.props.
|
|
52
|
+
inert: this.props.sidebarEndOpen ? null : true, "aria-label": `Settings sidebar ${this.props.sidebarEndOpen ? 'open' : 'closed'}`, tabIndex: -1, children: jsxs("div", { className: "sidebar__scroller", children: [jsx("div", { className: "sidebar__header sidebar__header--end", children: jsxs(PButton, { theme: this.props.theme, icon: "close", variant: "ghost", compact: true, "hide-label": "true", aria: { 'aria-expanded': this.props.sidebarEndOpen }, children: [this.props.sidebarEndOpen ? 'Close' : 'Open', " settings sidebar"] }) }), jsx("div", { className: "sidebar__content", children: jsx("slot", { name: "sidebar-end" }) })] }) })), hasFooter && (jsx("footer", { className: "footer", children: jsx("slot", { name: "footer" }) })), hasBackground && jsx("slot", { name: "background" })] }), !this.props.isMediaQueryS && (jsxs(PFlyout, { className: "flyout-start", theme: this.props.theme, open: this.props.sidebarStartOpen, position: "start", children: [hasTitle && (jsx("h2", { slot: "header", children: jsx("slot", { name: "title" }) })), jsx("slot", { name: "sidebar-start" })] })), hasSidebarEnd && !this.props.isMediaQueryM && (jsx(PFlyout, { className: "flyout-end", theme: this.props.theme, open: this.props.sidebarEndOpen, position: "end", children: jsx("slot", { name: "sidebar-end" }) }))] })] }), this.props.children] }));
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
|
|
@@ -17,12 +17,13 @@ import { PSpinner } from '../components/spinner.wrapper.mjs';
|
|
|
17
17
|
*/
|
|
18
18
|
class DSRCheckboxWrapper extends Component {
|
|
19
19
|
host;
|
|
20
|
+
initialLoading = false;
|
|
20
21
|
input;
|
|
21
22
|
render() {
|
|
22
23
|
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
23
24
|
const { disabled } = typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && otherChildren[0]?.props || {};
|
|
24
25
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$11(this.props.hideLabel, this.props.state, disabled, this.props.loading, this.props.theme)));
|
|
25
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, isLoading: this.props.loading, isDisabled: disabled, formElement: typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && otherChildren[0]?.props }), jsxs("div", { className: "wrapper", children: [jsx("slot", {}), this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" }))] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading:
|
|
26
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, isLoading: this.props.loading, isDisabled: disabled, formElement: typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && otherChildren[0]?.props }), jsxs("div", { className: "wrapper", children: [jsx("slot", {}), this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" }))] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs
CHANGED
|
@@ -19,6 +19,7 @@ class DSRCheckbox extends Component {
|
|
|
19
19
|
// The "name" property is reflected as an attribute to ensure compatibility with native form submission.
|
|
20
20
|
// In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
|
|
21
21
|
internals;
|
|
22
|
+
initialLoading = false;
|
|
22
23
|
defaultChecked;
|
|
23
24
|
checkboxInputElement;
|
|
24
25
|
formResetCallback() {
|
|
@@ -32,7 +33,7 @@ class DSRCheckbox extends Component {
|
|
|
32
33
|
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
33
34
|
const id = 'checkbox';
|
|
34
35
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$10(this.props.hideLabel, this.props.state, this.props.disabled, this.props.loading, this.props.compact, this.props.theme)));
|
|
35
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, htmlFor: id, label: this.props.label, isLoading: this.props.loading, isDisabled: this.props.disabled, isRequired: this.props.required }), jsxs("div", { className: "wrapper", children: [jsx("input", { type: "checkbox", id: id, "aria-describedby": `${descriptionId} ${messageId}`, "aria-invalid": this.props.state === 'error' ? 'true' : null, "aria-disabled": this.props.loading || this.props.disabled ? 'true' : null, checked: this.props.checked, form: this.props.form, value: this.props.value, name: this.props.name, onBlur: this.props.onBlur, required: this.props.required, disabled: this.props.disabled }), this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" }))] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading:
|
|
36
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, htmlFor: id, label: this.props.label, isLoading: this.props.loading, isDisabled: this.props.disabled, isRequired: this.props.required }), jsxs("div", { className: "wrapper", children: [jsx("input", { type: "checkbox", id: id, "aria-describedby": `${descriptionId} ${messageId}`, "aria-invalid": this.props.state === 'error' ? 'true' : null, "aria-disabled": this.props.loading || this.props.disabled ? 'true' : null, checked: this.props.checked, form: this.props.form, value: this.props.value, name: this.props.name, onBlur: this.props.onBlur, required: this.props.required, disabled: this.props.disabled }), this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" }))] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
@@ -14,20 +14,23 @@ import { PButtonPure } from '../components/button-pure.wrapper.mjs';
|
|
|
14
14
|
*/
|
|
15
15
|
class DSRFlyoutMultilevelItem extends Component {
|
|
16
16
|
host;
|
|
17
|
+
scroller;
|
|
17
18
|
get theme() {
|
|
18
19
|
return this.props.theme || 'light'; // default as fallback (internal private prop is controlled by flyout-multilevel)
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
componentDidRender() {
|
|
22
|
+
this.props.scroller.scrollTo(0, 0); // Reset scroll position when navigated
|
|
22
23
|
}
|
|
23
24
|
render() {
|
|
24
25
|
splitChildren(this.props.children);
|
|
25
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$S(this.
|
|
26
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx(PButtonPure
|
|
26
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$S(this.props.primary, this.props.secondary, this.props.cascade, this.theme)));
|
|
27
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx(PButtonPure
|
|
28
|
+
// "inert" will be known from React 19 onwards, see https://github.com/facebook/react/pull/24730
|
|
29
|
+
/* @ts-ignore */
|
|
30
|
+
, {
|
|
27
31
|
// "inert" will be known from React 19 onwards, see https://github.com/facebook/react/pull/24730
|
|
28
|
-
// eslint-disable-next-line
|
|
29
32
|
/* @ts-ignore */
|
|
30
|
-
inert: this.
|
|
33
|
+
inert: this.props.primary || this.props.cascade, className: "button", type: "button", size: "medium", alignLabel: "start", stretch: true, icon: "arrow-head-right", active: this.props.secondary, aria: { 'aria-expanded': this.props.secondary }, theme: this.theme, children: this.props.label }), jsx(PButtonPure, { className: "back", type: "button", size: "small", alignLabel: "end", stretch: true, icon: "arrow-left", theme: this.theme, hideLabel: { base: true, s: false }, children: this.props.label }), jsx("h2", { children: this.props.label }), jsx("div", { className: "drawer", children: jsx("div", { className: "scroller", children: jsx("slot", {}) }) })] })] }), this.props.children] }));
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
|
|
@@ -5,7 +5,8 @@ import { splitChildren } from '../../splitChildren.mjs';
|
|
|
5
5
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
6
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.mjs';
|
|
7
7
|
import { getFlyoutMultilevelCss as getComponentCss$T } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
8
|
-
import { parseAndGetAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
8
|
+
import { updateFlyoutMultiLevelItemState, parseAndGetAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
9
|
+
import { PButton } from '../components/button.wrapper.mjs';
|
|
9
10
|
import { PButtonPure } from '../components/button-pure.wrapper.mjs';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -18,17 +19,24 @@ import { PButtonPure } from '../components/button-pure.wrapper.mjs';
|
|
|
18
19
|
*/
|
|
19
20
|
class DSRFlyoutMultilevel extends Component {
|
|
20
21
|
host;
|
|
21
|
-
// TODO: shouldn't open prop be changed internally too?
|
|
22
22
|
flyoutMultilevelItemElements = [];
|
|
23
|
+
primary = true;
|
|
24
|
+
isSecondaryDrawerVisible = !!this.props.activeIdentifier;
|
|
23
25
|
dialog;
|
|
26
|
+
drawer;
|
|
27
|
+
isDesktop = false;
|
|
28
|
+
async componentWillLoad() {
|
|
29
|
+
this.props.defineFlyoutMultilevelItemElements();
|
|
30
|
+
const activeItem = this.props.flyoutMultilevelItemElements.find((item) => item.identifier === this.props.activeIdentifier);
|
|
31
|
+
activeItem && updateFlyoutMultiLevelItemState(activeItem, true); // Set item state
|
|
32
|
+
}
|
|
24
33
|
render() {
|
|
25
34
|
splitChildren(this.props.children);
|
|
26
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$T(this.props.open,
|
|
27
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }),
|
|
35
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$T(this.props.open, this.primary, this.isSecondaryDrawerVisible, this.props.theme)));
|
|
36
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx("dialog", {
|
|
28
37
|
// "inert" will be known from React 19 onwards, see https://github.com/facebook/react/pull/24730
|
|
29
|
-
// eslint-disable-next-line
|
|
30
38
|
/* @ts-ignore */
|
|
31
|
-
inert: this.props.open ? null : '',
|
|
39
|
+
inert: this.props.open ? null : '', ...parseAndGetAriaAttributes(this.props.aria), children: jsxs("div", { className: "drawer", children: [jsx(PButtonPure, { className: "back", type: "button", size: "small", alignLabel: "end", stretch: true, icon: "arrow-left", theme: this.props.theme, hideLabel: true, children: "Back" }), jsx(PButton, { className: "dismiss-mobile", type: "button", variant: "ghost", hideLabel: true, icon: "close", theme: this.props.theme, children: "Dismiss flyout" }), jsx(PButtonPure, { className: "dismiss-desktop", type: "button", size: "medium", icon: "close", hideLabel: true, theme: this.props.theme, children: "Dismiss flyout" }), jsx("div", { className: "scroller", children: jsx("slot", {}) })] }) })] }), this.props.children] }));
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
42
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs
CHANGED
|
@@ -41,7 +41,7 @@ class DSRFlyout extends Component {
|
|
|
41
41
|
/* @ts-ignore */
|
|
42
42
|
inert: this.props.open ? null : '', tabIndex: -1, ...parseAndGetAriaAttributes({
|
|
43
43
|
'aria-modal': true,
|
|
44
|
-
'aria-
|
|
44
|
+
...(hasHeader && { 'aria-label': namedSlotChildren.find(({ props: { slot } }) => slot === 'header')?.props.children }),
|
|
45
45
|
...parseAndGetAriaAttributes(this.props.aria),
|
|
46
46
|
}), children: jsx("div", { className: "scroller", children: jsxs("div", { className: "flyout", children: [jsx(PButton, { variant: "ghost", className: "dismiss", type: "button", hideLabel: true, icon: "close", theme: this.props.theme, children: "Dismiss flyout" }), hasHeader && jsx("slot", { name: "header" }), jsx("slot", {}), hasFooter && jsx("slot", { name: "footer" }), hasSubFooter && jsx("slot", { name: "sub-footer" })] }) }) })] }), this.props.children] }));
|
|
47
47
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
|
|
3
3
|
const loadingId = 'loading';
|
|
4
4
|
const LoadingMessage = ({ loading, initialLoading }) => {
|
|
5
|
-
return (jsx("span", { id: loadingId, className: "loading", role: "status", children: loading ? 'Loading' :
|
|
5
|
+
return (jsx("span", { id: loadingId, className: "loading", role: "status", children: loading ? 'Loading' : initialLoading ? 'Loading finished' : '' }));
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export { LoadingMessage, loadingId };
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.mjs
CHANGED
|
@@ -40,8 +40,7 @@ class DSRModal extends Component {
|
|
|
40
40
|
/* @ts-ignore */
|
|
41
41
|
inert: this.props.open ? null : '', tabIndex: -1, ...parseAndGetAriaAttributes({
|
|
42
42
|
'aria-modal': true,
|
|
43
|
-
'aria-label': this.props.
|
|
44
|
-
'aria-hidden': !this.props.open,
|
|
43
|
+
...(hasHeader && { 'aria-label': this.props.ariaLabel }),
|
|
45
44
|
...parseAndGetAriaAttributes(this.props.aria),
|
|
46
45
|
}), children: jsx("div", { className: "scroller", children: jsxs("div", { className: "modal", children: [hasDismissButton && (jsx(PButton, { variant: "ghost", className: "dismiss", type: "button", hideLabel: true, icon: "close", theme: this.props.theme, children: "Dismiss modal" })), hasHeader &&
|
|
47
46
|
(this.props.heading ? (jsx("h2", { children: this.props.heading })) : namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0 ? (jsx("slot", { name: "heading" })) : (jsx("slot", { name: "header" }))), jsx("slot", {}), hasFooter && jsx("slot", { name: "footer" })] }) }) })] }), this.props.children] }));
|
|
@@ -14,6 +14,7 @@ class DSRMultiSelectOption extends Component {
|
|
|
14
14
|
render() {
|
|
15
15
|
splitChildren(this.props.children);
|
|
16
16
|
const { theme = 'light', selected, highlighted, hidden, textContent } = this.props;
|
|
17
|
+
this.props.disabled || this.props.disabledParent;
|
|
17
18
|
minifyCss(stripFocusAndHoverStyles(getComponentCss$C(theme)));
|
|
18
19
|
return (jsx(Fragment, {}));
|
|
19
20
|
}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs
CHANGED
|
@@ -21,6 +21,8 @@ import { PIcon } from '../components/icon.wrapper.mjs';
|
|
|
21
21
|
*/
|
|
22
22
|
class DSRMultiSelect extends Component {
|
|
23
23
|
host;
|
|
24
|
+
// The "name" property is reflected as an attribute to ensure compatibility with native form submission.
|
|
25
|
+
// In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
|
|
24
26
|
isOpen = false;
|
|
25
27
|
srHighlightedOptionText = '';
|
|
26
28
|
hasFilterResults = true;
|
|
@@ -40,7 +42,9 @@ class DSRMultiSelect extends Component {
|
|
|
40
42
|
}
|
|
41
43
|
setFormValue(value) {
|
|
42
44
|
const formData = new FormData();
|
|
43
|
-
|
|
45
|
+
for (const val of value) {
|
|
46
|
+
formData.append(this.props.name, val);
|
|
47
|
+
}
|
|
44
48
|
this.props.internals.setFormValue(formData);
|
|
45
49
|
}
|
|
46
50
|
formDisabledCallback() {
|
|
@@ -62,7 +66,7 @@ class DSRMultiSelect extends Component {
|
|
|
62
66
|
...(this.props.popoverElement?.matches(':popover-open') && {
|
|
63
67
|
'popover-open': true,
|
|
64
68
|
}),
|
|
65
|
-
}), children: jsxs("div", { id: dropdownId, className: "listbox", children: [!this.props.hasFilterResults && (jsxs("div", { className: "no-results",
|
|
69
|
+
}), children: jsxs("div", { id: dropdownId, className: "listbox", children: [!this.props.hasFilterResults && (jsxs("div", { className: "no-results", role: "option", children: [jsx("span", { "aria-hidden": "true", children: "---" }), jsx("span", { className: "sr-only", children: "No results found" })] })), jsx("slot", {})] }) })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }), jsx("span", { className: "sr-only", role: "status", "aria-live": "assertive", "aria-relevant": "additions text", children: this.props.hasFilterResults ? this.props.srHighlightedOptionText : 'No results found' })] })] }), this.props.children] }));
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pagination.mjs
CHANGED
|
@@ -20,7 +20,7 @@ class DSRPagination extends Component {
|
|
|
20
20
|
showLastPage: this.props.showLastPage,
|
|
21
21
|
});
|
|
22
22
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$y(this.props.activePage, pageTotal, this.props.showLastPage, this.props.theme)));
|
|
23
|
-
return (jsx(Fragment, { children: jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx("nav", {
|
|
23
|
+
return (jsx(Fragment, { children: jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx("nav", { "aria-label": this.props.allyLabel || this.props.intl.root, children: jsx("ul", { children: paginationItems.map((pageModel, index) => {
|
|
24
24
|
const { type, isActive, value, isBeforeCurrent, isAfterCurrent, isBeforeBeforeCurrent, isAfterAfterCurrent, } = pageModel;
|
|
25
25
|
const spanProps = {
|
|
26
26
|
role: 'button',
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs
CHANGED
|
@@ -20,18 +20,27 @@ import { PSpinner } from '../components/spinner.wrapper.mjs';
|
|
|
20
20
|
*/
|
|
21
21
|
class DSRPinCode extends Component {
|
|
22
22
|
host;
|
|
23
|
-
form
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
// The "name" property is reflected as an attribute to ensure compatibility with native form submission.
|
|
24
|
+
// In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
|
|
25
|
+
internals;
|
|
26
|
+
initialLoading = false;
|
|
27
|
+
defaultValue;
|
|
26
28
|
inputElements = [];
|
|
29
|
+
formResetCallback() {
|
|
30
|
+
this.props.internals.setFormValue(this.props.defaultValue);
|
|
31
|
+
}
|
|
32
|
+
formDisabledCallback() {
|
|
33
|
+
}
|
|
34
|
+
formStateRestoreCallback() {
|
|
35
|
+
}
|
|
27
36
|
render() {
|
|
28
37
|
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
29
38
|
// reset array of input elements
|
|
30
39
|
this.inputElements = [];
|
|
31
40
|
const currentInputId = 'current-input';
|
|
32
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$x(this.props.hideLabel, this.props.state, this.props.disabled, this.props.loading, this.props.
|
|
33
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: currentInputId, isRequired: this.props.required, isLoading: this.props.loading, isDisabled: this.props.disabled }), jsxs("div", { className: "wrapper", children: [Array.from(Array(this.props.length), (_, index) => (jsx("input", { ...(isCurrentInput(index, this.props.value, this.props.length) && { id: currentInputId }), type: this.props.type === 'number' ? 'text' : this.props.type, "aria-label": `${index + 1}-${this.props.length}`, "aria-describedby": `${labelId} ${descriptionId} ${messageId}`, "aria-invalid": this.props.state === 'error' ? 'true' : null, "aria-disabled": this.props.loading ? 'true' : null, autoComplete: "one-time-code", pattern: "\\d*", inputMode: "numeric" // get numeric keyboard on mobile
|
|
34
|
-
, defaultValue: this.props.value[index] === ' ' ? null : this.props.value[index], disabled: this.props.disabled, required: this.props.required }, index))), this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" }))] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }),
|
|
41
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$x(this.props.hideLabel, this.props.state, this.props.disabled, this.props.loading, this.props.length, this.props.theme)));
|
|
42
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: currentInputId, isRequired: this.props.required, isLoading: this.props.loading, isDisabled: this.props.disabled }), jsxs("div", { className: "wrapper", children: [Array.from(new Array(this.props.length), (_, index) => (jsx("input", { name: this.props.name, form: this.props.form, ...(isCurrentInput(index, this.props.value, this.props.length) && { id: currentInputId }), type: this.props.type === 'number' ? 'text' : this.props.type, "aria-label": `${index + 1}-${this.props.length}`, "aria-describedby": `${labelId} ${descriptionId} ${messageId}`, "aria-invalid": this.props.state === 'error' ? 'true' : null, "aria-disabled": this.props.loading ? 'true' : null, autoComplete: "one-time-code", pattern: "\\d*", inputMode: "numeric" // get numeric keyboard on mobile
|
|
43
|
+
, defaultValue: this.props.value[index] === ' ' ? null : this.props.value[index], disabled: this.props.disabled, required: this.props.required }, index))), this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" }))] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
|
|
35
44
|
}
|
|
36
45
|
}
|
|
37
46
|
|
|
@@ -17,13 +17,14 @@ import { PSpinner } from '../components/spinner.wrapper.mjs';
|
|
|
17
17
|
*/
|
|
18
18
|
class DSRRadioButtonWrapper extends Component {
|
|
19
19
|
host;
|
|
20
|
+
initialLoading = false;
|
|
20
21
|
input;
|
|
21
22
|
render() {
|
|
22
23
|
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
23
24
|
const { disabled } = typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && otherChildren[0]?.props || {};
|
|
24
25
|
const isLoading = this.props.loading && !(typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && (otherChildren[0]?.props.checked || otherChildren[0]?.props.defaultChecked)); // spinner is only displayed when radio is not checked already
|
|
25
26
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$v(this.props.hideLabel, this.props.state, disabled, isLoading, this.props.theme)));
|
|
26
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, isLoading: isLoading, isDisabled: disabled, formElement: typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && otherChildren[0]?.props }), jsxs("div", { className: "wrapper", children: [jsx("slot", {}), isLoading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" }))] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }), jsx(LoadingMessage, { loading: isLoading, initialLoading:
|
|
27
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, isLoading: isLoading, isDisabled: disabled, formElement: typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && otherChildren[0]?.props }), jsxs("div", { className: "wrapper", children: [jsx("slot", {}), isLoading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" }))] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }), jsx(LoadingMessage, { loading: isLoading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -18,9 +18,10 @@ class DSRSegmentedControlItem extends Component {
|
|
|
18
18
|
// this additional validation is still needed because undefined is allowed with current propTypes
|
|
19
19
|
const hasIcon = !!this.props.icon || !!this.props.iconSource;
|
|
20
20
|
const hasSlottedContent = !!children.length;
|
|
21
|
-
const
|
|
21
|
+
const isDisabled = this.props.disabled || this.props.disabledParent;
|
|
22
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$t(isDisabled, this.props.selected, hasIcon, hasSlottedContent, this.props.theme || 'light' // default as fallback
|
|
22
23
|
)));
|
|
23
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("button", { type: "button", ...getSegmentedControlItemAriaAttributes(this.props.selected, this.props.disabled, this.props.aria), children: [this.props.label && jsx("span", { children: this.props.label }), hasIcon && (jsx(PIcon, { className: "icon", size: "inherit", name: this.props.icon, source: this.props.iconSource, color: getIconColor(this.props.disabled), theme: this.props.theme || 'light', "aria-hidden": "true" })), jsx("slot", {})] })] }), this.props.children] }));
|
|
24
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsxs("button", { type: "button", ...getSegmentedControlItemAriaAttributes(this.props.selected, this.props.disabled, this.props.aria), children: [this.props.label && jsx("span", { children: this.props.label }), hasIcon && (jsx(PIcon, { className: "icon", size: "inherit", name: this.props.icon, source: this.props.iconSource, color: getIconColor(this.props.disabled), theme: this.props.theme || 'light', "aria-hidden": "true" })), jsx("slot", {})] }) })] }), this.props.children] }));
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -12,6 +12,15 @@ import { getSegmentedControlCss as getComponentCss$s } from '../../../../../../c
|
|
|
12
12
|
*/
|
|
13
13
|
class DSRSegmentedControl extends Component {
|
|
14
14
|
host;
|
|
15
|
+
internals;
|
|
16
|
+
defaultValue;
|
|
17
|
+
formResetCallback() {
|
|
18
|
+
this.props.internals.setFormValue(this.props.defaultValue?.toString());
|
|
19
|
+
}
|
|
20
|
+
formDisabledCallback() {
|
|
21
|
+
}
|
|
22
|
+
formStateRestoreCallback() {
|
|
23
|
+
}
|
|
15
24
|
render() {
|
|
16
25
|
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
17
26
|
const manipulatedChildren = children.map((child) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.mjs
CHANGED
|
@@ -16,13 +16,14 @@ class DSRSelectOption extends Component {
|
|
|
16
16
|
render() {
|
|
17
17
|
splitChildren(this.props.children);
|
|
18
18
|
const { theme = 'light', selected, highlighted, hidden } = this.props;
|
|
19
|
+
const isDisabled = this.props.disabled || this.props.disabledParent;
|
|
19
20
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$A(theme)));
|
|
20
21
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsxs("div", { role: "option", className: {
|
|
21
22
|
option: true,
|
|
22
23
|
'option--selected': selected,
|
|
23
24
|
'option--highlighted': highlighted,
|
|
24
|
-
'option--disabled':
|
|
25
|
-
}, ...getOptionAriaAttributes(selected,
|
|
25
|
+
'option--disabled': isDisabled,
|
|
26
|
+
}, ...getOptionAriaAttributes(selected, isDisabled, hidden, !!this.props.value), children: [jsx("slot", {}), selected && (jsx(PIcon, { className: "icon", "aria-hidden": "true", name: "check", color: isDisabled ? 'state-disabled' : 'primary', theme: theme }))] }) })] }), this.props.children] }));
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs
CHANGED
|
@@ -20,6 +20,8 @@ import { PIcon } from '../components/icon.wrapper.mjs';
|
|
|
20
20
|
*/
|
|
21
21
|
class DSRSelect extends Component {
|
|
22
22
|
host;
|
|
23
|
+
// The "name" property is reflected as an attribute to ensure compatibility with native form submission.
|
|
24
|
+
// In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
|
|
23
25
|
isOpen = false;
|
|
24
26
|
srHighlightedOptionText = '';
|
|
25
27
|
internals;
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.mjs
CHANGED
|
@@ -16,11 +16,12 @@ import { PSpinner } from '../components/spinner.wrapper.mjs';
|
|
|
16
16
|
*/
|
|
17
17
|
class DSRSwitch extends Component {
|
|
18
18
|
host;
|
|
19
|
+
initialLoading = false;
|
|
19
20
|
render() {
|
|
20
21
|
splitChildren(this.props.children);
|
|
21
22
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$l(this.props.alignLabel, this.props.hideLabel, this.props.stretch, this.props.checked, this.props.disabled, this.props.loading, this.props.theme)));
|
|
22
23
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx("button", { ...getSwitchButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.checked), id: "switch", type: "button", role: "switch", "aria-labelledby": "label" // only relevant for axe-core because of https://github.com/dequelabs/axe-core/issues/1393
|
|
23
|
-
, "aria-describedby": this.props.loading ? loadingId : undefined, children: jsx("span", { className: "toggle", children: this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" })) }) }), jsx("label", { id: "label", htmlFor: "switch", children: jsx("slot", {}) }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading:
|
|
24
|
+
, "aria-describedby": this.props.loading ? loadingId : undefined, children: jsx("span", { className: "toggle", children: this.props.loading && (jsx(PSpinner, { className: "spinner", size: "inherit", theme: this.props.theme, "aria-hidden": "true" })) }) }), jsx("label", { id: "label", htmlFor: "switch", children: jsx("slot", {}) }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -52,7 +52,7 @@ class DSRTextFieldWrapper extends Component {
|
|
|
52
52
|
const isClearable = typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && !!otherChildren[0]?.props.value;
|
|
53
53
|
const hasCounter = false; // hasCounterAndIsTypeText(otherChildren[0]?.props);
|
|
54
54
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$8(disabled, this.props.hideLabel, this.props.state, this.props.isCounterVisible, this.props.isCounterVisible ? 'suffix' : this.props.unitPosition, isPassword ? 'password' : type, this.props.showPasswordToggle, this.props.isWithinForm, this.props.submitButton, this.props.theme)));
|
|
55
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, formElement: typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && otherChildren[0]?.props, isDisabled: disabled }), jsxs("div", { className: "wrapper", children: [jsx("slot", {}), hasCounter
|
|
55
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, formElement: typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && otherChildren[0]?.props, isDisabled: disabled }), jsxs("div", { className: "wrapper", children: [jsx("slot", {}), hasCounter, (this.props.isCounterVisible) && (jsx("span", { className: "unit-counter", "aria-hidden": "true", children: this.props.unit })), isPassword && this.props.showPasswordToggle ? (jsx(PButtonPure, { ...buttonProps, type: "button", icon: this.props.showPassword ? 'view-off' : 'view', disabled: disabled, aria: { 'aria-pressed': this.props.showPassword ? 'true' : 'false' }, children: "Toggle password visibility" })) : showCustomCalendarOrTimeIndicator(isCalendar, isTime) ? (jsxs(PButtonPure, { ...buttonProps, type: "button", icon: isCalendar ? 'calendar' : 'clock', disabled: disabled, children: ["Show $", isCalendar ? 'date' : 'time', " picker"] })) : (isSearch && [
|
|
56
56
|
// TODO: create an own component, which would fix SSR support too
|
|
57
57
|
this.props.isWithinForm && this.props.submitButton ? (createElement(PButtonPure, { ...buttonProps, key: "btn-submit", type: "submit", icon: "search", disabled: disabledOrReadOnly }, "Search")) : (jsx(PIcon, { className: "icon", name: "search", color: "state-disabled", theme: this.props.theme, "aria-hidden": "true" }, "icon")),
|
|
58
58
|
createElement(PButtonPure, { ...buttonProps, key: "btn-clear", type: "button", icon: "close", tabIndex: -1, hidden: !isClearable, disabled: disabledOrReadOnly }, "Clear field"),
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/toast.mjs
CHANGED
|
@@ -10,7 +10,7 @@ class DSRToast extends Component {
|
|
|
10
10
|
render() {
|
|
11
11
|
const toast = false;
|
|
12
12
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$1().replace(/(:host {[\S\s]+?})[\S\s]+/, '$1')));
|
|
13
|
-
return (jsx(Fragment, { children: jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: toast
|
|
13
|
+
return (jsx(Fragment, { children: jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: toast })] }) }));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|