@porsche-design-system/components-react 3.22.0-rc.0 → 3.22.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.
- package/CHANGELOG.md +31 -0
- package/cjs/lib/components/flyout-multilevel-item.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/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 +3 -2
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +432 -301
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +41 -1
- 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/segmented-control.wrapper.cjs +4 -4
- 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/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/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 +1 -1
- 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/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/esm/components/dist/styles/esm/styles-entry.mjs +432 -301
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +37 -2
- 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/segmented-control.wrapper.mjs +4 -4
- 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/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/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 +1 -1
- 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/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/lib/components/flyout-multilevel-item.wrapper.d.ts +24 -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/canvas.d.ts +4 -0
- package/ssr/esm/lib/dsr-components/flyout-multilevel-item.d.ts +2 -1
- package/ssr/esm/lib/dsr-components/flyout-multilevel.d.ts +5 -0
- package/ssr/esm/lib/dsr-components/segmented-control.d.ts +5 -0
- package/ssr/esm/lib/types.d.ts +3 -2
|
@@ -3178,6 +3178,15 @@ function requireDist () {
|
|
|
3178
3178
|
var distExports = requireDist();
|
|
3179
3179
|
var jssPluginSortMediaQueries = /*@__PURE__*/getDefaultExportFromCjs(distExports);
|
|
3180
3180
|
|
|
3181
|
+
// NOTE: these utils are in the same file on purpose
|
|
3182
|
+
// to force them being bundled into our core chunk
|
|
3183
|
+
const getTagName = (el) => el.tagName.toLowerCase();
|
|
3184
|
+
const getTagNameWithoutPrefix = (host) => {
|
|
3185
|
+
const tagName = getTagName(host);
|
|
3186
|
+
const [, tagNameWithoutPrefix = ''] = /^(?:[a-z-]+-)?(p-[a-z-]+)$/.exec(tagName) || [];
|
|
3187
|
+
return (tagNameWithoutPrefix || tagName); // return tagName as fallback for default tags
|
|
3188
|
+
};
|
|
3189
|
+
|
|
3181
3190
|
// This class is shared since the popover needs to register a scroll listener to this node in order to hide the popover when the table is scrolled
|
|
3182
3191
|
const scrollAreaClass = 'scroll-area';
|
|
3183
3192
|
|
|
@@ -3216,6 +3225,8 @@ const isDisabledOrLoading = (disabled, loading) => {
|
|
|
3216
3225
|
return disabled || loading;
|
|
3217
3226
|
};
|
|
3218
3227
|
|
|
3228
|
+
const isElementOfKind = (element, tagName) => getTagNameWithoutPrefix(element) === tagName;
|
|
3229
|
+
|
|
3219
3230
|
const parseJSONAttribute = (attribute) => {
|
|
3220
3231
|
// Input is object, e.g. { 'aria-label': 'Some label' }
|
|
3221
3232
|
if (typeof attribute !== 'string') {
|
|
@@ -3461,7 +3472,7 @@ const isScrollable = (isPrevHidden, isNextHidden) => {
|
|
|
3461
3472
|
};
|
|
3462
3473
|
|
|
3463
3474
|
/*
|
|
3464
|
-
Stencil Client Platform v4.
|
|
3475
|
+
Stencil Client Platform v4.22.2 | MIT Licensed | https://stenciljs.com
|
|
3465
3476
|
*/
|
|
3466
3477
|
var __defProp = Object.defineProperty;
|
|
3467
3478
|
var __export = (target, all) => {
|
|
@@ -3596,6 +3607,30 @@ const getDisplayTagType = (host, size, tag) => {
|
|
|
3596
3607
|
}
|
|
3597
3608
|
return displaySizeToTagMap[size] || 'h1';
|
|
3598
3609
|
};
|
|
3610
|
+
/**
|
|
3611
|
+
* Updates the state of the flyout multilevel and its children based on the provided activeItem and value.
|
|
3612
|
+
*
|
|
3613
|
+
* @param {string | undefined} activeItem - The flyout-multilevel-item element which is currently active (which has the activeIdentifier as identifier). If undefined, updates the root element.
|
|
3614
|
+
* @param {boolean} value - The new state value to apply.
|
|
3615
|
+
* @returns {void}
|
|
3616
|
+
*/
|
|
3617
|
+
const updateFlyoutMultiLevelItemState = (activeItem, value) => {
|
|
3618
|
+
activeItem.secondary = value;
|
|
3619
|
+
traverseTreeAndUpdateState(activeItem.parentElement, 'primary', value);
|
|
3620
|
+
};
|
|
3621
|
+
/**
|
|
3622
|
+
* Recursively updates the state of a flyout item's parent elements by traversing up the DOM tree.
|
|
3623
|
+
*
|
|
3624
|
+
* @param {HTMLPFlyoutMultilevelItemElement} activeItem - The current flyout item being updated.
|
|
3625
|
+
* @param {'primary' | 'secondary' | 'cascade'} prop - The property of the flyout item to update.
|
|
3626
|
+
* @param {boolean} value - The new state value to apply.
|
|
3627
|
+
*/
|
|
3628
|
+
const traverseTreeAndUpdateState = (activeItem, prop, value) => {
|
|
3629
|
+
if (isElementOfKind(activeItem, 'p-flyout-multilevel-item')) {
|
|
3630
|
+
activeItem[prop] = value;
|
|
3631
|
+
traverseTreeAndUpdateState(activeItem.parentElement, 'cascade', value);
|
|
3632
|
+
}
|
|
3633
|
+
};
|
|
3599
3634
|
const headingSizeToTagMap = {
|
|
3600
3635
|
small: 'h6',
|
|
3601
3636
|
medium: 'h5',
|
|
@@ -3917,6 +3952,8 @@ exports.getSelectedOptions = getSelectedOptions;
|
|
|
3917
3952
|
exports.getStepperHorizontalIconName = getStepperHorizontalIconName;
|
|
3918
3953
|
exports.getSvgUrl = getSvgUrl;
|
|
3919
3954
|
exports.getSwitchButtonAriaAttributes = getSwitchButtonAriaAttributes;
|
|
3955
|
+
exports.getTagName = getTagName;
|
|
3956
|
+
exports.getTagNameWithoutPrefix = getTagNameWithoutPrefix;
|
|
3920
3957
|
exports.getTextTagType = getTextTagType;
|
|
3921
3958
|
exports.getTotalPages = getTotalPages;
|
|
3922
3959
|
exports.hasDocument = hasDocument;
|
|
@@ -3928,6 +3965,7 @@ exports.headerSlot = headerSlot;
|
|
|
3928
3965
|
exports.isCurrentInput = isCurrentInput;
|
|
3929
3966
|
exports.isCustomDropdown = isCustomDropdown;
|
|
3930
3967
|
exports.isDisabledOrLoading = isDisabledOrLoading;
|
|
3968
|
+
exports.isElementOfKind = isElementOfKind;
|
|
3931
3969
|
exports.isInfinitePagination = isInfinitePagination;
|
|
3932
3970
|
exports.isListTypeOrdered = isListTypeOrdered;
|
|
3933
3971
|
exports.isScrollable = isScrollable;
|
|
@@ -3947,3 +3985,5 @@ exports.supportsNativePopover = supportsNativePopover;
|
|
|
3947
3985
|
exports.tempDiv = tempDiv;
|
|
3948
3986
|
exports.tempIcon = tempIcon;
|
|
3949
3987
|
exports.tempLabel = tempLabel;
|
|
3988
|
+
exports.traverseTreeAndUpdateState = traverseTreeAndUpdateState;
|
|
3989
|
+
exports.updateFlyoutMultiLevelItemState = updateFlyoutMultiLevelItemState;
|
|
@@ -7,20 +7,20 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var flyoutMultilevelItem = require('../dsr-components/flyout-multilevel-item.cjs');
|
|
9
9
|
|
|
10
|
-
const PFlyoutMultilevelItem = /*#__PURE__*/ react.forwardRef(({ identifier, label, className, children, ...rest }, ref) => {
|
|
10
|
+
const PFlyoutMultilevelItem = /*#__PURE__*/ react.forwardRef(({ cascade = false, identifier, label, primary = false, secondary = false, className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
const WebComponentTag = hooks.usePrefix('p-flyout-multilevel-item');
|
|
13
|
-
const propsToSync = [identifier, label];
|
|
13
|
+
const propsToSync = [cascade, identifier, label, primary, secondary];
|
|
14
14
|
hooks.useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['identifier', 'label'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['cascade', 'identifier', 'label', 'primary', 'secondary'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
const props = {
|
|
19
19
|
...rest,
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
...(!process.browser
|
|
22
22
|
? {
|
|
23
|
-
children: (jsxRuntime.jsx(flyoutMultilevelItem.DSRFlyoutMultilevelItem, { identifier, label, children })),
|
|
23
|
+
children: (jsxRuntime.jsx(flyoutMultilevelItem.DSRFlyoutMultilevelItem, { cascade, identifier, label, primary, secondary, children })),
|
|
24
24
|
}
|
|
25
25
|
: {
|
|
26
26
|
children,
|
|
@@ -7,15 +7,15 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var segmentedControl = require('../dsr-components/segmented-control.cjs');
|
|
9
9
|
|
|
10
|
-
const PSegmentedControl = /*#__PURE__*/ react.forwardRef(({ backgroundColor, columns = 'auto', onSegmentedControlChange, onUpdate, theme, value, className, children, ...rest }, ref) => {
|
|
10
|
+
const PSegmentedControl = /*#__PURE__*/ react.forwardRef(({ backgroundColor, columns = 'auto', disabled = false, form, name, onSegmentedControlChange, onUpdate, theme, value, className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
hooks.useEventCallback(elementRef, 'segmentedControlChange', onSegmentedControlChange);
|
|
13
13
|
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
14
14
|
const WebComponentTag = hooks.usePrefix('p-segmented-control');
|
|
15
|
-
const propsToSync = [backgroundColor, columns, theme || hooks.useTheme(), value];
|
|
15
|
+
const propsToSync = [backgroundColor, columns, disabled, form, name, theme || hooks.useTheme(), value];
|
|
16
16
|
hooks.useBrowserLayoutEffect(() => {
|
|
17
17
|
const { current } = elementRef;
|
|
18
|
-
['backgroundColor', 'columns', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
|
+
['backgroundColor', 'columns', 'disabled', 'form', 'name', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
19
19
|
}, propsToSync);
|
|
20
20
|
const props = {
|
|
21
21
|
...rest,
|
|
@@ -23,7 +23,7 @@ const PSegmentedControl = /*#__PURE__*/ react.forwardRef(({ backgroundColor, col
|
|
|
23
23
|
...(!process.browser
|
|
24
24
|
? {
|
|
25
25
|
...{ "role": "group" },
|
|
26
|
-
children: (jsxRuntime.jsx(segmentedControl.DSRSegmentedControl, { backgroundColor, columns, theme: theme || hooks.useTheme(), value, children })),
|
|
26
|
+
children: (jsxRuntime.jsx(segmentedControl.DSRSegmentedControl, { backgroundColor, columns, disabled, form, name, theme: theme || hooks.useTheme(), value, children })),
|
|
27
27
|
}
|
|
28
28
|
: {
|
|
29
29
|
children,
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.cjs
CHANGED
|
@@ -32,6 +32,10 @@ class DSRCanvas extends react.Component {
|
|
|
32
32
|
hasSidebarEnd;
|
|
33
33
|
hasFooter;
|
|
34
34
|
hasBackground;
|
|
35
|
+
sidebarStart;
|
|
36
|
+
sidebarEnd;
|
|
37
|
+
root;
|
|
38
|
+
header;
|
|
35
39
|
render() {
|
|
36
40
|
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
37
41
|
const hasTitle = namedSlotChildren.filter(({ props: { slot } }) => slot === 'title').length > 0;
|
|
@@ -39,15 +43,15 @@ class DSRCanvas extends react.Component {
|
|
|
39
43
|
const hasFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'footer').length > 0;
|
|
40
44
|
const hasBackground = namedSlotChildren.filter(({ props: { slot } }) => slot === 'background').length > 0;
|
|
41
45
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getCanvasCss(this.props.theme, this.props.sidebarStartOpen, this.props.sidebarEndOpen)));
|
|
42
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsxs("header", { className: "header", children: [jsxRuntime.jsxs("div", { className: "blur", children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {})] }), jsxRuntime.jsxs("div", { className: "header__area header__area--start", children: [!this.props.sidebarStartOpen && (jsxRuntime.jsxs(button_wrapper.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"] })), jsxRuntime.jsx("slot", { name: "header-start" })] }), jsxRuntime.jsx(crest_wrapper.PCrest, { className: "header__crest" }), jsxRuntime.jsx(wordmark_wrapper.PWordmark, { className: "header__wordmark", size: "inherit", theme: this.props.theme }), jsxRuntime.jsx("div", { className: "header__area header__area--end", children: jsxRuntime.jsx("slot", { name: "header-end" }) })] }),
|
|
46
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsxs("header", { className: "header", tabIndex: -1, children: [jsxRuntime.jsxs("div", { className: "blur", children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {})] }), jsxRuntime.jsxs("div", { className: "header__area header__area--start", children: [!this.props.sidebarStartOpen && (jsxRuntime.jsxs(button_wrapper.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"] })), jsxRuntime.jsx("slot", { name: "header-start" })] }), jsxRuntime.jsx(crest_wrapper.PCrest, { className: "header__crest" }), jsxRuntime.jsx(wordmark_wrapper.PWordmark, { className: "header__wordmark", size: "inherit", theme: this.props.theme }), jsxRuntime.jsx("div", { className: "header__area header__area--end", children: jsxRuntime.jsx("slot", { name: "header-end" }) })] }), this.props.isMediaQueryS && (jsxRuntime.jsx("aside", { className: "sidebar sidebar--start",
|
|
43
47
|
// "inert" will be known from React 19 onwards, see https://github.com/facebook/react/pull/24730
|
|
44
48
|
// eslint-disable-next-line
|
|
45
49
|
/* @ts-ignore */
|
|
46
|
-
inert: this.props.sidebarStartOpen ? null : true, "aria-label": `Navigation sidebar ${this.props.sidebarStartOpen ? 'open' : 'closed'}`, children: jsxRuntime.jsxs("div", { className: "sidebar__scroller", children: [jsxRuntime.jsxs("div", { className: "sidebar__header sidebar__header--start", children: [jsxRuntime.jsxs(button_wrapper.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 && (jsxRuntime.jsx("h2", { children: jsxRuntime.jsx("slot", { name: "title" }) }))] }), jsxRuntime.jsx("div", { className: "sidebar__content", children: jsxRuntime.jsx("slot", { name: "sidebar-start" }) })] }) })), hasSidebarEnd && this.props.isMediaQueryM && (jsxRuntime.jsx("aside", { className: "sidebar sidebar--end",
|
|
50
|
+
inert: this.props.sidebarStartOpen ? null : true, "aria-label": `Navigation sidebar ${this.props.sidebarStartOpen ? 'open' : 'closed'}`, tabIndex: -1, children: jsxRuntime.jsxs("div", { className: "sidebar__scroller", children: [jsxRuntime.jsxs("div", { className: "sidebar__header sidebar__header--start", children: [jsxRuntime.jsxs(button_wrapper.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 && (jsxRuntime.jsx("h2", { children: jsxRuntime.jsx("slot", { name: "title" }) }))] }), jsxRuntime.jsx("div", { className: "sidebar__content", children: jsxRuntime.jsx("slot", { name: "sidebar-start" }) })] }) })), jsxRuntime.jsx("main", { className: "main", children: jsxRuntime.jsx("slot", {}) }), hasSidebarEnd && this.props.isMediaQueryM && (jsxRuntime.jsx("aside", { className: "sidebar sidebar--end",
|
|
47
51
|
// "inert" will be known from React 19 onwards, see https://github.com/facebook/react/pull/24730
|
|
48
52
|
// eslint-disable-next-line
|
|
49
53
|
/* @ts-ignore */
|
|
50
|
-
inert: this.props.sidebarEndOpen ? null : true, "aria-label": `Settings sidebar ${this.props.sidebarEndOpen ? 'open' : 'closed'}`, children: jsxRuntime.jsxs("div", { className: "sidebar__scroller", children: [jsxRuntime.jsx("div", { className: "sidebar__header sidebar__header--end", children: jsxRuntime.jsxs(button_wrapper.PButton, { theme: this.props.theme, icon: "close", variant: "ghost", compact: true, "hide-label": "true", aria: { 'aria-expanded': this.props.sidebarEndOpen }, children: [this.props.
|
|
54
|
+
inert: this.props.sidebarEndOpen ? null : true, "aria-label": `Settings sidebar ${this.props.sidebarEndOpen ? 'open' : 'closed'}`, tabIndex: -1, children: jsxRuntime.jsxs("div", { className: "sidebar__scroller", children: [jsxRuntime.jsx("div", { className: "sidebar__header sidebar__header--end", children: jsxRuntime.jsxs(button_wrapper.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"] }) }), jsxRuntime.jsx("div", { className: "sidebar__content", children: jsxRuntime.jsx("slot", { name: "sidebar-end" }) })] }) })), hasFooter && (jsxRuntime.jsx("footer", { className: "footer", children: jsxRuntime.jsx("slot", { name: "footer" }) })), hasBackground && jsxRuntime.jsx("slot", { name: "background" })] }), !this.props.isMediaQueryS && (jsxRuntime.jsxs(flyout_wrapper.PFlyout, { className: "flyout-start", theme: this.props.theme, open: this.props.sidebarStartOpen, position: "start", children: [hasTitle && (jsxRuntime.jsx("h2", { slot: "header", children: jsxRuntime.jsx("slot", { name: "title" }) })), jsxRuntime.jsx("slot", { name: "sidebar-start" })] })), hasSidebarEnd && !this.props.isMediaQueryM && (jsxRuntime.jsx(flyout_wrapper.PFlyout, { className: "flyout-end", theme: this.props.theme, open: this.props.sidebarEndOpen, position: "end", children: jsxRuntime.jsx("slot", { name: "sidebar-end" }) }))] })] }), this.props.children] }));
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
|
|
@@ -16,20 +16,23 @@ var buttonPure_wrapper = require('../components/button-pure.wrapper.cjs');
|
|
|
16
16
|
*/
|
|
17
17
|
class DSRFlyoutMultilevelItem extends react.Component {
|
|
18
18
|
host;
|
|
19
|
+
scroller;
|
|
19
20
|
get theme() {
|
|
20
21
|
return this.props.theme || 'light'; // default as fallback (internal private prop is controlled by flyout-multilevel)
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
componentDidRender() {
|
|
24
|
+
this.props.scroller.scrollTo(0, 0); // Reset scroll position when navigated
|
|
24
25
|
}
|
|
25
26
|
render() {
|
|
26
27
|
splitChildren.splitChildren(this.props.children);
|
|
27
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFlyoutMultilevelItemCss(this.
|
|
28
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(buttonPure_wrapper.PButtonPure
|
|
28
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFlyoutMultilevelItemCss(this.props.primary, this.props.secondary, this.props.cascade, this.theme)));
|
|
29
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(buttonPure_wrapper.PButtonPure
|
|
30
|
+
// "inert" will be known from React 19 onwards, see https://github.com/facebook/react/pull/24730
|
|
31
|
+
/* @ts-ignore */
|
|
32
|
+
, {
|
|
29
33
|
// "inert" will be known from React 19 onwards, see https://github.com/facebook/react/pull/24730
|
|
30
|
-
// eslint-disable-next-line
|
|
31
34
|
/* @ts-ignore */
|
|
32
|
-
inert: this.
|
|
35
|
+
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 }), jsxRuntime.jsx(buttonPure_wrapper.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 }), jsxRuntime.jsx("h2", { children: this.props.label }), jsxRuntime.jsx("div", { className: "drawer", children: jsxRuntime.jsx("div", { className: "scroller", children: jsxRuntime.jsx("slot", {}) }) })] })] }), this.props.children] }));
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
|
|
@@ -8,6 +8,7 @@ var minifyCss = require('../../minifyCss.cjs');
|
|
|
8
8
|
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.cjs');
|
|
9
9
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
|
|
10
10
|
var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
|
|
11
|
+
var button_wrapper = require('../components/button.wrapper.cjs');
|
|
11
12
|
var buttonPure_wrapper = require('../components/button-pure.wrapper.cjs');
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -20,17 +21,24 @@ var buttonPure_wrapper = require('../components/button-pure.wrapper.cjs');
|
|
|
20
21
|
*/
|
|
21
22
|
class DSRFlyoutMultilevel extends react.Component {
|
|
22
23
|
host;
|
|
23
|
-
// TODO: shouldn't open prop be changed internally too?
|
|
24
24
|
flyoutMultilevelItemElements = [];
|
|
25
|
+
primary = true;
|
|
26
|
+
isSecondaryDrawerVisible = !!this.props.activeIdentifier;
|
|
25
27
|
dialog;
|
|
28
|
+
drawer;
|
|
29
|
+
isDesktop = false;
|
|
30
|
+
async componentWillLoad() {
|
|
31
|
+
this.props.defineFlyoutMultilevelItemElements();
|
|
32
|
+
const activeItem = this.props.flyoutMultilevelItemElements.find((item) => item.identifier === this.props.activeIdentifier);
|
|
33
|
+
activeItem && utilsEntry.updateFlyoutMultiLevelItemState(activeItem, true); // Set item state
|
|
34
|
+
}
|
|
26
35
|
render() {
|
|
27
36
|
splitChildren.splitChildren(this.props.children);
|
|
28
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFlyoutMultilevelCss(this.props.open,
|
|
29
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.
|
|
37
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFlyoutMultilevelCss(this.props.open, this.primary, this.isSecondaryDrawerVisible, this.props.theme)));
|
|
38
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("dialog", {
|
|
30
39
|
// "inert" will be known from React 19 onwards, see https://github.com/facebook/react/pull/24730
|
|
31
|
-
// eslint-disable-next-line
|
|
32
40
|
/* @ts-ignore */
|
|
33
|
-
inert: this.props.open ? null : '',
|
|
41
|
+
inert: this.props.open ? null : '', ...utilsEntry.parseAndGetAriaAttributes(this.props.aria), children: jsxRuntime.jsxs("div", { className: "drawer", children: [jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "back", type: "button", size: "small", alignLabel: "end", stretch: true, icon: "arrow-left", theme: this.props.theme, hideLabel: true, children: "Back" }), jsxRuntime.jsx(button_wrapper.PButton, { className: "dismiss-mobile", type: "button", variant: "ghost", hideLabel: true, icon: "close", theme: this.props.theme, children: "Dismiss flyout" }), jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "dismiss-desktop", type: "button", size: "medium", icon: "close", hideLabel: true, theme: this.props.theme, children: "Dismiss flyout" }), jsxRuntime.jsx("div", { className: "scroller", children: jsxRuntime.jsx("slot", {}) })] }) })] }), this.props.children] }));
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.cjs
CHANGED
|
@@ -43,7 +43,7 @@ class DSRFlyout extends react.Component {
|
|
|
43
43
|
/* @ts-ignore */
|
|
44
44
|
inert: this.props.open ? null : '', tabIndex: -1, ...utilsEntry.parseAndGetAriaAttributes({
|
|
45
45
|
'aria-modal': true,
|
|
46
|
-
'aria-
|
|
46
|
+
...(hasHeader && { 'aria-label': namedSlotChildren.find(({ props: { slot } }) => slot === 'header')?.props.children }),
|
|
47
47
|
...utilsEntry.parseAndGetAriaAttributes(this.props.aria),
|
|
48
48
|
}), children: jsxRuntime.jsx("div", { className: "scroller", children: jsxRuntime.jsxs("div", { className: "flyout", children: [jsxRuntime.jsx(button_wrapper.PButton, { variant: "ghost", className: "dismiss", type: "button", hideLabel: true, icon: "close", theme: this.props.theme, children: "Dismiss flyout" }), hasHeader && jsxRuntime.jsx("slot", { name: "header" }), jsxRuntime.jsx("slot", {}), hasFooter && jsxRuntime.jsx("slot", { name: "footer" }), hasSubFooter && jsxRuntime.jsx("slot", { name: "sub-footer" })] }) }) })] }), this.props.children] }));
|
|
49
49
|
}
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.cjs
CHANGED
|
@@ -42,8 +42,7 @@ class DSRModal extends react.Component {
|
|
|
42
42
|
/* @ts-ignore */
|
|
43
43
|
inert: this.props.open ? null : '', tabIndex: -1, ...utilsEntry.parseAndGetAriaAttributes({
|
|
44
44
|
'aria-modal': true,
|
|
45
|
-
'aria-label': this.props.
|
|
46
|
-
'aria-hidden': !this.props.open,
|
|
45
|
+
...(hasHeader && { 'aria-label': this.props.ariaLabel }),
|
|
47
46
|
...utilsEntry.parseAndGetAriaAttributes(this.props.aria),
|
|
48
47
|
}), children: jsxRuntime.jsx("div", { className: "scroller", children: jsxRuntime.jsxs("div", { className: "modal", children: [hasDismissButton && (jsxRuntime.jsx(button_wrapper.PButton, { variant: "ghost", className: "dismiss", type: "button", hideLabel: true, icon: "close", theme: this.props.theme, children: "Dismiss modal" })), hasHeader &&
|
|
49
48
|
(this.props.heading ? (jsxRuntime.jsx("h2", { children: this.props.heading })) : namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0 ? (jsxRuntime.jsx("slot", { name: "heading" })) : (jsxRuntime.jsx("slot", { name: "header" }))), jsxRuntime.jsx("slot", {}), hasFooter && jsxRuntime.jsx("slot", { name: "footer" })] }) }) })] }), this.props.children] }));
|
|
@@ -16,6 +16,7 @@ class DSRMultiSelectOption extends react.Component {
|
|
|
16
16
|
render() {
|
|
17
17
|
splitChildren.splitChildren(this.props.children);
|
|
18
18
|
const { theme = 'light', selected, highlighted, hidden, textContent } = this.props;
|
|
19
|
+
this.props.disabled || this.props.disabledParent;
|
|
19
20
|
minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getMultiSelectOptionCss(theme)));
|
|
20
21
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, {}));
|
|
21
22
|
}
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs
CHANGED
|
@@ -68,7 +68,7 @@ class DSRMultiSelect extends react.Component {
|
|
|
68
68
|
...(this.props.popoverElement?.matches(':popover-open') && {
|
|
69
69
|
'popover-open': true,
|
|
70
70
|
}),
|
|
71
|
-
}), children: jsxRuntime.jsxs("div", { id: dropdownId, className: "listbox", children: [!this.props.hasFilterResults && (jsxRuntime.jsxs("div", { className: "no-results",
|
|
71
|
+
}), children: jsxRuntime.jsxs("div", { id: dropdownId, className: "listbox", children: [!this.props.hasFilterResults && (jsxRuntime.jsxs("div", { className: "no-results", role: "option", children: [jsxRuntime.jsx("span", { "aria-hidden": "true", children: "---" }), jsxRuntime.jsx("span", { className: "sr-only", children: "No results found" })] })), jsxRuntime.jsx("slot", {})] }) })] }), jsxRuntime.jsx(stateMessage.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 }), jsxRuntime.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] }));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pagination.cjs
CHANGED
|
@@ -22,7 +22,7 @@ class DSRPagination extends react.Component {
|
|
|
22
22
|
showLastPage: this.props.showLastPage,
|
|
23
23
|
});
|
|
24
24
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getPaginationCss(this.props.activePage, pageTotal, this.props.showLastPage, this.props.theme)));
|
|
25
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("nav", {
|
|
25
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("nav", { "aria-label": this.props.allyLabel || this.props.intl.root, children: jsxRuntime.jsx("ul", { children: paginationItems.map((pageModel, index) => {
|
|
26
26
|
const { type, isActive, value, isBeforeCurrent, isAfterCurrent, isBeforeBeforeCurrent, isAfterAfterCurrent, } = pageModel;
|
|
27
27
|
const spanProps = {
|
|
28
28
|
role: 'button',
|
|
@@ -20,9 +20,10 @@ class DSRSegmentedControlItem extends react.Component {
|
|
|
20
20
|
// this additional validation is still needed because undefined is allowed with current propTypes
|
|
21
21
|
const hasIcon = !!this.props.icon || !!this.props.iconSource;
|
|
22
22
|
const hasSlottedContent = !!children.length;
|
|
23
|
-
const
|
|
23
|
+
const isDisabled = this.props.disabled || this.props.disabledParent;
|
|
24
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSegmentedControlItemCss(isDisabled, this.props.selected, hasIcon, hasSlottedContent, this.props.theme || 'light' // default as fallback
|
|
24
25
|
)));
|
|
25
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("button", { type: "button", ...utilsEntry.getSegmentedControlItemAriaAttributes(this.props.selected, this.props.disabled, this.props.aria), children: [this.props.label && jsxRuntime.jsx("span", { children: this.props.label }), hasIcon && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", size: "inherit", name: this.props.icon, source: this.props.iconSource, color: utilsEntry.getIconColor(this.props.disabled), theme: this.props.theme || 'light', "aria-hidden": "true" })), jsxRuntime.jsx("slot", {})] })] }), this.props.children] }));
|
|
26
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("button", { type: "button", ...utilsEntry.getSegmentedControlItemAriaAttributes(this.props.selected, this.props.disabled, this.props.aria), children: [this.props.label && jsxRuntime.jsx("span", { children: this.props.label }), hasIcon && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", size: "inherit", name: this.props.icon, source: this.props.iconSource, color: utilsEntry.getIconColor(this.props.disabled), theme: this.props.theme || 'light', "aria-hidden": "true" })), jsxRuntime.jsx("slot", {})] }) })] }), this.props.children] }));
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -14,6 +14,15 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
|
|
|
14
14
|
*/
|
|
15
15
|
class DSRSegmentedControl extends react.Component {
|
|
16
16
|
host;
|
|
17
|
+
internals;
|
|
18
|
+
defaultValue;
|
|
19
|
+
formResetCallback() {
|
|
20
|
+
this.props.internals.setFormValue(this.props.defaultValue?.toString());
|
|
21
|
+
}
|
|
22
|
+
formDisabledCallback() {
|
|
23
|
+
}
|
|
24
|
+
formStateRestoreCallback() {
|
|
25
|
+
}
|
|
17
26
|
render() {
|
|
18
27
|
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
19
28
|
const manipulatedChildren = children.map((child) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.cjs
CHANGED
|
@@ -18,13 +18,14 @@ class DSRSelectOption extends react.Component {
|
|
|
18
18
|
render() {
|
|
19
19
|
splitChildren.splitChildren(this.props.children);
|
|
20
20
|
const { theme = 'light', selected, highlighted, hidden } = this.props;
|
|
21
|
+
const isDisabled = this.props.disabled || this.props.disabledParent;
|
|
21
22
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSelectOptionCss(theme)));
|
|
22
23
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { role: "option", className: {
|
|
23
24
|
option: true,
|
|
24
25
|
'option--selected': selected,
|
|
25
26
|
'option--highlighted': highlighted,
|
|
26
|
-
'option--disabled':
|
|
27
|
-
}, ...utilsEntry.getOptionAriaAttributes(selected,
|
|
27
|
+
'option--disabled': isDisabled,
|
|
28
|
+
}, ...utilsEntry.getOptionAriaAttributes(selected, isDisabled, hidden, !!this.props.value), children: [jsxRuntime.jsx("slot", {}), selected && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", "aria-hidden": "true", name: "check", color: isDisabled ? 'state-disabled' : 'primary', theme: theme }))] }) })] }), this.props.children] }));
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|