@porsche-design-system/components-react 3.21.0 → 3.22.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/ag-grid/theme.css +17 -8
  3. package/cjs/lib/components/link-tile-model-signature.wrapper.cjs +1 -1
  4. package/cjs/lib/components/pin-code.wrapper.cjs +3 -3
  5. package/esm/lib/components/link-tile-model-signature.wrapper.mjs +1 -1
  6. package/esm/lib/components/pin-code.wrapper.d.ts +8 -0
  7. package/esm/lib/components/pin-code.wrapper.mjs +3 -3
  8. package/esm/lib/types.d.ts +33 -33
  9. package/package.json +6 -2
  10. package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +450 -437
  11. package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +419 -420
  12. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile-model-signature.wrapper.cjs +1 -1
  13. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/pin-code.wrapper.cjs +4 -4
  14. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs +1 -1
  15. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.cjs +2 -1
  16. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.cjs +2 -1
  17. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.cjs +2 -1
  18. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.cjs +2 -1
  19. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/loading-message.cjs +1 -1
  20. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +5 -1
  21. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.cjs +15 -6
  22. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.cjs +2 -1
  23. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +2 -0
  24. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.cjs +2 -1
  25. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.cjs +1 -1
  26. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/toast.cjs +1 -1
  27. package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +450 -437
  28. package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +419 -420
  29. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile-model-signature.wrapper.mjs +1 -1
  30. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/pin-code.wrapper.mjs +4 -4
  31. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +1 -1
  32. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs +2 -1
  33. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +2 -1
  34. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.mjs +2 -1
  35. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +2 -1
  36. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/loading-message.mjs +1 -1
  37. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +5 -1
  38. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs +15 -6
  39. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.mjs +2 -1
  40. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +2 -0
  41. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.mjs +2 -1
  42. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.mjs +1 -1
  43. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/toast.mjs +1 -1
  44. package/ssr/esm/lib/components/pin-code.wrapper.d.ts +8 -0
  45. package/ssr/esm/lib/dsr-components/button-pure.d.ts +1 -0
  46. package/ssr/esm/lib/dsr-components/button.d.ts +1 -0
  47. package/ssr/esm/lib/dsr-components/checkbox-wrapper.d.ts +1 -0
  48. package/ssr/esm/lib/dsr-components/checkbox.d.ts +1 -0
  49. package/ssr/esm/lib/dsr-components/flyout-multilevel-item.d.ts +1 -1
  50. package/ssr/esm/lib/dsr-components/pin-code.d.ts +6 -3
  51. package/ssr/esm/lib/dsr-components/radio-button-wrapper.d.ts +1 -0
  52. package/ssr/esm/lib/dsr-components/switch.d.ts +1 -0
  53. package/ssr/esm/lib/types.d.ts +33 -33
  54. package/styles/_index.scss +1 -1
@@ -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];
@@ -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,
@@ -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": !this.props.open ? 'true' : 'false', 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] }));
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
 
@@ -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: false })] })] }), this.props.children] }));
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
 
@@ -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: false })] })] }), this.props.children] }));
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
 
@@ -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: false })] })] }), this.props.children] }));
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
 
@@ -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: false })] })] }), this.props.children] }));
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
 
@@ -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' : !initialLoading ? '' : 'Loading finished' }));
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 };
@@ -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
- value.forEach((val) => formData.append(this.props.name, val));
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() {
@@ -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
- isWithinForm;
25
- hiddenInput;
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.isWithinForm, this.props.length, this.props.theme)));
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 }), this.props.isWithinForm && jsx("slot", { name: "internal-input" }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: false })] })] }), this.props.children] }));
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: false })] })] }), this.props.children] }));
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
 
@@ -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;
@@ -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: false })] })] }), this.props.children] }));
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 , (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 && [
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"),
@@ -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
 
@@ -9,6 +9,10 @@ export type PPinCodeProps = BaseProps & {
9
9
  * Disables the Pin Code. No events will be triggered while disabled state is active.
10
10
  */
11
11
  disabled?: boolean;
12
+ /**
13
+ * The id of a form element the pin-code should be associated with.
14
+ */
15
+ form?: string;
12
16
  /**
13
17
  * Show or hide label and description text. For better accessibility it is recommended to show the label.
14
18
  */
@@ -67,6 +71,10 @@ export declare const PPinCode: import("react").ForwardRefExoticComponent<import(
67
71
  * Disables the Pin Code. No events will be triggered while disabled state is active.
68
72
  */
69
73
  disabled?: boolean;
74
+ /**
75
+ * The id of a form element the pin-code should be associated with.
76
+ */
77
+ form?: string;
70
78
  /**
71
79
  * Show or hide label and description text. For better accessibility it is recommended to show the label.
72
80
  */
@@ -4,6 +4,7 @@ import { Component } from 'react';
4
4
  */
5
5
  export declare class DSRButtonPure extends Component<any> {
6
6
  host: HTMLElement;
7
+ private initialLoading;
7
8
  private get isDisabledOrLoading();
8
9
  render(): JSX.Element;
9
10
  }
@@ -4,5 +4,6 @@ import { Component } from 'react';
4
4
  */
5
5
  export declare class DSRButton extends Component<any> {
6
6
  host: HTMLElement;
7
+ private initialLoading;
7
8
  render(): JSX.Element;
8
9
  }
@@ -6,6 +6,7 @@ import { Component } from 'react';
6
6
  */
7
7
  export declare class DSRCheckboxWrapper extends Component<any> {
8
8
  host: HTMLElement;
9
+ private initialLoading;
9
10
  private input;
10
11
  render(): JSX.Element;
11
12
  }
@@ -6,6 +6,7 @@ import { Component } from 'react';
6
6
  export declare class DSRCheckbox extends Component<any> {
7
7
  host: HTMLElement;
8
8
  private internals;
9
+ private initialLoading;
9
10
  private defaultChecked;
10
11
  private checkboxInputElement;
11
12
  formResetCallback(): void;
@@ -1,5 +1,5 @@
1
1
  import { Component } from 'react';
2
- import { type FlyoutMultilevelItemInternalHTMLProps } from '@porsche-design-system/components/dist/utils';
2
+ import type { FlyoutMultilevelItemInternalHTMLProps } from '@porsche-design-system/components/dist/utils';
3
3
  /**
4
4
  * @slot {"name": "", "description": "Default slot for the main content." }
5
5
  *
@@ -8,9 +8,12 @@ import { Component } from 'react';
8
8
  */
9
9
  export declare class DSRPinCode extends Component<any> {
10
10
  host: HTMLElement;
11
- private form;
12
- private isWithinForm;
13
- private hiddenInput;
11
+ private internals;
12
+ private initialLoading;
13
+ private defaultValue;
14
14
  private inputElements;
15
+ formResetCallback(): void;
16
+ formDisabledCallback(): void;
17
+ formStateRestoreCallback(): void;
15
18
  render(): JSX.Element;
16
19
  }
@@ -6,6 +6,7 @@ import { Component } from 'react';
6
6
  */
7
7
  export declare class DSRRadioButtonWrapper extends Component<any> {
8
8
  host: HTMLElement;
9
+ private initialLoading;
9
10
  private input;
10
11
  render(): JSX.Element;
11
12
  }
@@ -6,5 +6,6 @@ import { Component } from 'react';
6
6
  */
7
7
  export declare class DSRSwitch extends Component<any> {
8
8
  host: HTMLElement;
9
+ private initialLoading;
9
10
  render(): JSX.Element;
10
11
  }