@porsche-design-system/components-react 4.2.0-rc.3 → 4.2.0-rc.5

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 (27) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/cjs/lib/components/flyout.wrapper.cjs +3 -3
  3. package/esm/lib/components/flyout.wrapper.d.ts +11 -1
  4. package/esm/lib/components/flyout.wrapper.mjs +3 -3
  5. package/package.json +2 -2
  6. package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +116 -62
  7. package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +139 -21
  8. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/flyout.wrapper.cjs +4 -4
  9. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs +6 -0
  10. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.cjs +7 -1
  11. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/label.cjs +1 -1
  12. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.cjs +6 -0
  13. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/sheet.cjs +6 -0
  14. package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +116 -62
  15. package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +136 -22
  16. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/flyout.wrapper.mjs +4 -4
  17. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +7 -1
  18. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs +8 -2
  19. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/label.mjs +1 -1
  20. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.mjs +7 -1
  21. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/sheet.mjs +7 -1
  22. package/ssr/esm/lib/components/flyout.wrapper.d.ts +11 -1
  23. package/ssr/esm/lib/dsr-components/banner.d.ts +1 -0
  24. package/ssr/esm/lib/dsr-components/flyout.d.ts +1 -0
  25. package/ssr/esm/lib/dsr-components/label.d.ts +2 -2
  26. package/ssr/esm/lib/dsr-components/modal.d.ts +1 -0
  27. package/ssr/esm/lib/dsr-components/sheet.d.ts +1 -0
@@ -1,5 +1,26 @@
1
1
  'use strict';
2
2
 
3
+ function getHTMLElement(element, selector) {
4
+ return element?.querySelector(selector);
5
+ }
6
+
7
+ const transformSelectorToDirectChildSelector = (selector) => selector
8
+ .split(',')
9
+ .map((part) => `:scope>${part}`)
10
+ .join();
11
+
12
+ /* eslint-disable prefer-arrow/prefer-arrow-functions */
13
+ function getDirectChildHTMLElement(element, selector) {
14
+ // querySelector(All) doesn't work with :scope pseudo class and comma separator in jsdom, yet
15
+ // https://github.com/jsdom/jsdom/issues/3141
16
+ // therefore we got a workaround so it works nicely when consumed from jsdom-polyfill package
17
+ return (transformSelectorToDirectChildSelector(selector)
18
+ .split(',')
19
+ .map((sel) => getHTMLElement(element, sel))
20
+ .filter((x) => x)[0] || null // comma separated selector might return null, so we have to filter
21
+ );
22
+ }
23
+
3
24
  function _extends() {
4
25
  _extends = Object.assign ? Object.assign.bind() : function (target) {
5
26
  for (var i = 1; i < arguments.length; i++) {
@@ -3191,26 +3212,30 @@ const getTagNameWithoutPrefix = (host) => {
3191
3212
  return (tagNameWithoutPrefix || tagName); // return tagName as fallback for default tags
3192
3213
  };
3193
3214
 
3194
- function getHTMLElement(element, selector) {
3195
- return element?.querySelector(selector);
3196
- }
3197
-
3198
- const transformSelectorToDirectChildSelector = (selector) => selector
3199
- .split(',')
3200
- .map((part) => `:scope>${part}`)
3201
- .join();
3202
-
3203
- /* eslint-disable prefer-arrow/prefer-arrow-functions */
3204
- function getDirectChildHTMLElement(element, selector) {
3205
- // querySelector(All) doesn't work with :scope pseudo class and comma separator in jsdom, yet
3206
- // https://github.com/jsdom/jsdom/issues/3141
3207
- // therefore we got a workaround so it works nicely when consumed from jsdom-polyfill package
3208
- return (transformSelectorToDirectChildSelector(selector)
3209
- .split(',')
3210
- .map((sel) => getHTMLElement(element, sel))
3211
- .filter((x) => x)[0] || null // comma separated selector might return null, so we have to filter
3212
- );
3213
- }
3215
+ const parseCssTimeToMs = (value) => {
3216
+ const trimmed = value.trim();
3217
+ const num = Number.parseFloat(trimmed);
3218
+ if (Number.isNaN(num)) {
3219
+ return 0;
3220
+ }
3221
+ return trimmed.endsWith('ms') ? num : num * 1000; // seconds otherwise
3222
+ };
3223
+ /**
3224
+ * Returns the longest `transition-duration` + `transition-delay` (in ms) across an element's computed transitions.
3225
+ * Useful as a safety-net timeout when a `transitionend` event might not fire (e.g. with reduced motion or a 0 duration).
3226
+ *
3227
+ * @param {HTMLElement} element - The element to read the computed transition values from.
3228
+ * @returns {number} The maximum combined duration and delay in milliseconds.
3229
+ */
3230
+ const getMaxTransitionDurationMs = (element) => {
3231
+ const { transitionDuration, transitionDelay } = getComputedStyle(element);
3232
+ const durations = transitionDuration.split(',');
3233
+ const delays = transitionDelay.split(',');
3234
+ return durations.reduce((max, duration, index) => {
3235
+ const total = parseCssTimeToMs(duration) + parseCssTimeToMs(delays[index] ?? '0s');
3236
+ return total > max ? total : max;
3237
+ }, 0);
3238
+ };
3214
3239
 
3215
3240
  const hasSpecificDirectChildTag = (host, tag) => {
3216
3241
  const el = getDirectChildHTMLElement(host, ':only-child');
@@ -3457,6 +3482,18 @@ hasWindow$1 &&
3457
3482
  }
3458
3483
  });
3459
3484
 
3485
+ const showDialog = (dialog, scrollArea) => {
3486
+ // Must only be called when the dialog isn't already open and after the render cycle has finished (e.g. in
3487
+ // `componentDidRender()`), so visibility states are ready and the dismiss button can be focused correctly.
3488
+ // The "only when not already open" precondition is guaranteed by the caller (`createTopLayerController`'s `requestShow`
3489
+ // guards with `!isShown()`), since `showModal()` throws if the dialog is already open.
3490
+ scrollArea.scrollTo(0, 0); // reset scroll position each time dialog gets opened again
3491
+ dialog.inert = true; // This will prevent the autofocus of focusable elements inside the dialog (e.g. close button) element which is conflicting with our transition
3492
+ dialog.showModal(); // shows modal on `#top-layer`
3493
+ dialog.inert = false; // Re-enable focus on dialog element
3494
+ dialog.focus(); // set focus programmatically to dialog element to prevent transition bug in Safari
3495
+ };
3496
+
3460
3497
  const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-design-system";
3461
3498
 
3462
3499
  const hasDocument = typeof document !== 'undefined';
@@ -3465,7 +3502,7 @@ const hasShowPickerSupport = () => (hasDocument &&
3465
3502
  'showPicker' in HTMLInputElement.prototype &&
3466
3503
  CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
3467
3504
 
3468
- const prefix = `[Porsche Design System v${"4.2.0-rc.3"}]` // this part isn't covered by unit tests
3505
+ const prefix = `[Porsche Design System v${"4.2.0-rc.5"}]` // this part isn't covered by unit tests
3469
3506
  ;
3470
3507
  const consoleError$1 = (...messages) => {
3471
3508
  console.error(prefix, ...messages);
@@ -3486,6 +3523,83 @@ const supportsNativePopover = () => {
3486
3523
  const hasNativePopoverSupport = supportsNativePopover();
3487
3524
  // getter for easy mocking
3488
3525
  const getHasNativePopoverSupport = () => hasNativePopoverSupport;
3526
+
3527
+ // Single source of truth for the two CSS feature queries behind the "keep on #top-layer during fade-out" capability,
3528
+ // shared by the JS detection (`supportsOverlayTransition`) and the CSS `@supports` wrapper
3529
+ // (`overlayTransitionSupportsQuery`) so the two can never drift.
3530
+ const overlayFeature = 'overlay: auto';
3531
+ const allowDiscreteFeature = 'transition-behavior: allow-discrete';
3532
+ /**
3533
+ * Detects whether the browser can keep an element (e.g. a `dialog` or a `popover`) on the `#top-layer` during a
3534
+ * fade-out animation via the `overlay` property combined with `transition-behavior: allow-discrete`.
3535
+ *
3536
+ * BOTH capabilities are required: `transition-behavior: allow-discrete` is now widely supported (e.g. Firefox), but the
3537
+ * `overlay` property itself is Chromium-only. Firefox supports `allow-discrete` yet NOT `overlay`, so it would drop out
3538
+ * of the `#top-layer` immediately when leaving it and fall back to a high `z-index` — which breaks as soon as an
3539
+ * ancestor creates a new stacking context (e.g. `transform`/`isolation`, like a nested `p-modal` within `p-flyout`).
3540
+ *
3541
+ * For browsers lacking the `overlay` transition the element must be kept natively shown during the fade-out and only be
3542
+ * removed from the `#top-layer` once the transition has finished (see `createTopLayerController`).
3543
+ *
3544
+ * @returns {boolean} `true` if both `overlay` and `transition-behavior: allow-discrete` are supported.
3545
+ */
3546
+ const supportsOverlayTransition = () => typeof CSS !== 'undefined' && CSS.supports(overlayFeature) && CSS.supports(allowDiscreteFeature);
3547
+
3548
+ // Extra time added on top of the computed transition duration before hiding. The timer starts in `requestHide()`,
3549
+ // one frame before the transition actually begins, so this buffer biases the hide slightly *after* the visual
3550
+ // transition ends — preventing the element from leaving the #top-layer too early and flickering.
3551
+ const HIDE_BUFFER_MS = 50;
3552
+ /**
3553
+ * Creates a controller that manages an element's presence on the `#top-layer`, keeping it there during its fade-out
3554
+ * animation in browsers that don't support the `overlay` transition (Safari/Firefox). On hide it defers the native
3555
+ * removal (`dialog.close()` / `element.hidePopover()`) until the fade-out has finished, scheduled via a timeout derived
3556
+ * from the element's computed transition duration. In Chromium the native removal happens immediately because the
3557
+ * `overlay` + `allow-discrete` transition keeps the element on the `#top-layer` while it fades out.
3558
+ *
3559
+ * Both `requestShow` and `requestHide` are idempotent (guarded by `isShown`), so they can safely be called on every
3560
+ * render. State is scoped to the controller instance, so no shared registry is required.
3561
+ *
3562
+ * @param {TopLayerOptions} options - Element-specific hooks (show state, show/hide actions, element getter).
3563
+ * @returns {TopLayerController} The controller used to request show, request hide, and cancel.
3564
+ */
3565
+ const createTopLayerController = (options) => {
3566
+ const { getElement, isShown, show, hide } = options;
3567
+ let hideTimer;
3568
+ const cancel = () => {
3569
+ if (hideTimer) {
3570
+ clearTimeout(hideTimer);
3571
+ hideTimer = undefined;
3572
+ }
3573
+ };
3574
+ const requestShow = () => {
3575
+ cancel(); // cancel any pending deferred hide first, so re-opening during fade-out wins (element may still be shown)
3576
+ if (isShown()) {
3577
+ return; // `showModal()` / `showPopover()` throw if the element is already shown
3578
+ }
3579
+ show();
3580
+ };
3581
+ const requestHide = () => {
3582
+ if (!isShown()) {
3583
+ return; // already hidden (or a deferred hide already completed)
3584
+ }
3585
+ if (supportsOverlayTransition()) {
3586
+ hide(); // Chromium: `overlay` + `allow-discrete` keeps it on the #top-layer during the fade-out
3587
+ }
3588
+ else {
3589
+ // Safari/Firefox: keep it on the real #top-layer during the fade-out and hide once the transition has finished.
3590
+ cancel(); // drop any in-flight deferred hide before re-scheduling
3591
+ const element = getElement();
3592
+ const timeoutMs = (element ? getMaxTransitionDurationMs(element) : 0) + HIDE_BUFFER_MS;
3593
+ hideTimer = setTimeout(() => {
3594
+ cancel();
3595
+ if (isShown()) {
3596
+ hide();
3597
+ }
3598
+ }, timeoutMs);
3599
+ }
3600
+ };
3601
+ return { requestShow, requestHide, cancel };
3602
+ };
3489
3603
  const headerSlot = 'header';
3490
3604
  const anchorSlot = 'anchor';
3491
3605
 
@@ -4121,6 +4235,7 @@ exports.buildIconUrl = buildIconUrl;
4121
4235
  exports.consoleError = consoleError$1;
4122
4236
  exports.createPaginationItems = createPaginationItems;
4123
4237
  exports.createRange = createRange;
4238
+ exports.createTopLayerController = createTopLayerController;
4124
4239
  exports.crestSize = crestSize;
4125
4240
  exports.descriptionId = descriptionId;
4126
4241
  exports.displaySizeToTagMap = displaySizeToTagMap;
@@ -4140,6 +4255,7 @@ exports.getHasNativePopoverSupport = getHasNativePopoverSupport;
4140
4255
  exports.getHeadingTagType = getHeadingTagType;
4141
4256
  exports.getInlineNotificationAriaAttributes = getInlineNotificationAriaAttributes;
4142
4257
  exports.getListboxAriaAttributes = getListboxAriaAttributes;
4258
+ exports.getMaxTransitionDurationMs = getMaxTransitionDurationMs;
4143
4259
  exports.getSanitizedActiveTabIndex = getSanitizedActiveTabIndex;
4144
4260
  exports.getSegmentedControlItemAriaAttributes = getSegmentedControlItemAriaAttributes;
4145
4261
  exports.getStepperHorizontalIconName = getStepperHorizontalIconName;
@@ -4170,8 +4286,10 @@ exports.observedNodesMap = observedNodesMap;
4170
4286
  exports.parseAndGetAriaAttributes = parseAndGetAriaAttributes;
4171
4287
  exports.parseJSONAttribute = parseJSONAttribute;
4172
4288
  exports.setAriaIDREF = setAriaIDREF;
4289
+ exports.showDialog = showDialog;
4173
4290
  exports.supportsConstructableStylesheets = supportsConstructableStylesheets;
4174
4291
  exports.supportsNativePopover = supportsNativePopover;
4292
+ exports.supportsOverlayTransition = supportsOverlayTransition;
4175
4293
  exports.tempDiv = tempDiv;
4176
4294
  exports.tempIcon = tempIcon;
4177
4295
  exports.tempLabel = tempLabel;
@@ -7,23 +7,23 @@ var hooks = require('../../hooks.cjs');
7
7
  var utils = require('../../utils.cjs');
8
8
  var flyout = require('../dsr-components/flyout.cjs');
9
9
 
10
- const PFlyout = /*#__PURE__*/ react.forwardRef(({ aria, backdrop = 'blur', background = 'canvas', disableBackdropClick = false, footerBehavior = 'sticky', onDismiss, onMotionHiddenEnd, onMotionVisibleEnd, open = false, position = 'end', className, children, ...rest }, ref) => {
10
+ const PFlyout = /*#__PURE__*/ react.forwardRef(({ aria, backdrop = 'blur', background = 'canvas', disableBackdropClick = false, footerBehavior = 'sticky', fullscreen = false, onDismiss, onMotionHiddenEnd, onMotionVisibleEnd, open = false, position = 'end', className, children, ...rest }, ref) => {
11
11
  const elementRef = react.useRef(undefined);
12
12
  hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
13
13
  hooks.useEventCallback(elementRef, 'motionHiddenEnd', onMotionHiddenEnd);
14
14
  hooks.useEventCallback(elementRef, 'motionVisibleEnd', onMotionVisibleEnd);
15
15
  const WebComponentTag = hooks.usePrefix('p-flyout');
16
- const propsToSync = [aria, backdrop, background, disableBackdropClick, footerBehavior, open, position];
16
+ const propsToSync = [aria, backdrop, background, disableBackdropClick, footerBehavior, fullscreen, open, position];
17
17
  hooks.useBrowserLayoutEffect(() => {
18
18
  const { current } = elementRef;
19
- ['aria', 'backdrop', 'background', 'disableBackdropClick', 'footerBehavior', 'open', 'position'].forEach((propName, i) => (current[propName] = propsToSync[i]));
19
+ ['aria', 'backdrop', 'background', 'disableBackdropClick', 'footerBehavior', 'fullscreen', 'open', 'position'].forEach((propName, i) => (current[propName] = propsToSync[i]));
20
20
  }, propsToSync);
21
21
  const props = {
22
22
  ...rest,
23
23
  // @ts-ignore
24
24
  ...(!process.browser
25
25
  ? {
26
- children: (jsxRuntime.jsx(flyout.DSRFlyout, { aria, backdrop, background, disableBackdropClick, footerBehavior, open, position, children })),
26
+ children: (jsxRuntime.jsx(flyout.DSRFlyout, { aria, backdrop, background, disableBackdropClick, footerBehavior, fullscreen, open, position, children })),
27
27
  }
28
28
  : {
29
29
  children,
@@ -23,6 +23,12 @@ class DSRBanner extends react.Component {
23
23
  refDismiss;
24
24
  hasHeadingSlot;
25
25
  hasDescriptionSlot;
26
+ topLayer = utilsEntry.createTopLayerController({
27
+ getElement: () => this.props.refPopover,
28
+ isShown: () => !!this.props.refPopover?.matches(':popover-open'),
29
+ show: () => this.props.refPopover?.showPopover(),
30
+ hide: () => this.props.refPopover?.hidePopover(),
31
+ });
26
32
  render() {
27
33
  const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
28
34
  const hasHeadingSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0;
@@ -25,12 +25,18 @@ class DSRFlyout extends react.Component {
25
25
  hasHeader;
26
26
  hasFooter;
27
27
  hasSubFooter;
28
+ topLayer = utilsEntry.createTopLayerController({
29
+ getElement: () => this.props.dialog,
30
+ isShown: () => !!this.props.dialog?.open,
31
+ show: () => utilsEntry.showDialog(this.props.dialog, this.props.scroller),
32
+ hide: () => this.props.dialog?.close(),
33
+ });
28
34
  render() {
29
35
  const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
30
36
  const hasHeader = namedSlotChildren.filter(({ props: { slot } }) => slot === 'header').length > 0;
31
37
  const hasFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'footer').length > 0;
32
38
  const hasSubFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'sub-footer').length > 0;
33
- const style = minifyCss.minifyCss(stylesEntry.getFlyoutCss(this.props.open, this.props.background, this.props.backdrop, this.props.position, hasHeader, hasFooter, hasSubFooter, this.props.footerBehavior));
39
+ const style = minifyCss.minifyCss(stylesEntry.getFlyoutCss(this.props.open, this.props.background, this.props.backdrop, this.props.position, hasHeader, hasFooter, hasSubFooter, this.props.footerBehavior, this.props.fullscreen));
34
40
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(dialogBase.DialogBase, { host: null, dismissable: true, containerClass: "flyout", header: hasHeader ? jsxRuntime.jsx("slot", { name: "header" }) : undefined, footer: hasFooter ? jsxRuntime.jsx("slot", { name: "footer" }) : undefined, subFooter: hasSubFooter ? jsxRuntime.jsx("slot", { name: "sub-footer" }) : undefined, ariaAttributes: utilsEntry.parseAndGetAriaAttributes({
35
41
  'aria-modal': true,
36
42
  ...{ 'aria-label': hasHeader ? namedSlotChildren.find(({ props: { slot } }) => slot === 'header')?.props.children : 'Flyout' },
@@ -10,7 +10,7 @@ const Label = ({ hasLabel, hasDescription, children,
10
10
  label, tag, description, htmlFor, isRequired, isLoading, isDisabled, stopClickPropagation, }) => {
11
11
  splitChildren.splitChildren(children);
12
12
  const TagType = tag || 'label';
13
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasLabel && (jsxRuntime.jsxs("div", { className: "label-wrapper", children: [jsxRuntime.jsx(TagType, { className: "label", id: utilsEntry.labelId, "aria-disabled": isLoading || isDisabled ? 'true' : null, htmlFor: htmlFor, children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label || jsxRuntime.jsx("slot", { name: "label" }), isRequired /* && !isParentFieldsetRequired(host) */ && jsxRuntime.jsx(required.Required, {})] }) }), jsxRuntime.jsx("slot", { name: "label-after" })] })), hasDescription && (jsxRuntime.jsx("span", { className: "label", id: utilsEntry.descriptionId, "aria-disabled": isLoading || isDisabled ? 'true' : null, children: description || jsxRuntime.jsx("slot", { name: "description" }) }))] }));
13
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasLabel && (jsxRuntime.jsxs("div", { className: "label-wrapper", children: [jsxRuntime.jsx(TagType, { className: "label", id: utilsEntry.labelId, "aria-disabled": isLoading || isDisabled ? 'true' : null, htmlFor: htmlFor, children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label || jsxRuntime.jsx("slot", { name: "label" }), isRequired /* && !isParentFieldsetRequired(host) */ && jsxRuntime.jsx(required.Required, {})] }) }), stopClickPropagation ? (jsxRuntime.jsx("span", { className: "label-after", children: jsxRuntime.jsx("slot", { name: "label-after" }) })) : (jsxRuntime.jsx("slot", { name: "label-after" }))] })), hasDescription && (jsxRuntime.jsx("span", { className: "label", id: utilsEntry.descriptionId, "aria-disabled": isLoading || isDisabled ? 'true' : null, children: description || jsxRuntime.jsx("slot", { name: "description" }) }))] }));
14
14
  };
15
15
 
16
16
  exports.Label = Label;
@@ -22,6 +22,12 @@ class DSRModal extends react.Component {
22
22
  footer;
23
23
  hasHeader;
24
24
  hasFooter;
25
+ topLayer = utilsEntry.createTopLayerController({
26
+ getElement: () => this.props.dialog,
27
+ isShown: () => !!this.props.dialog?.open,
28
+ show: () => utilsEntry.showDialog(this.props.dialog, this.props.scroller),
29
+ hide: () => this.props.dialog?.close(),
30
+ });
25
31
  render() {
26
32
  const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
27
33
  const hasHeader = namedSlotChildren.filter(({ props: { slot } }) => slot === 'header').length > 0;
@@ -19,6 +19,12 @@ class DSRSheet extends react.Component {
19
19
  dialog;
20
20
  scroller;
21
21
  hasHeader;
22
+ topLayer = utilsEntry.createTopLayerController({
23
+ getElement: () => this.props.dialog,
24
+ isShown: () => !!this.props.dialog?.open,
25
+ show: () => utilsEntry.showDialog(this.props.dialog, this.props.scroller),
26
+ hide: () => this.props.dialog?.close(),
27
+ });
22
28
  render() {
23
29
  const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
24
30
  const hasHeader = namedSlotChildren.filter(({ props: { slot } }) => slot === 'header').length > 0;