@porsche-design-system/components-react 3.27.0 → 3.27.1-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.
- package/CHANGELOG.md +13 -7
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +13 -56
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +0 -18
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +1 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper-dropdown.cjs +1 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +1 -2
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +13 -56
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +1 -17
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +2 -3
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper-dropdown.mjs +2 -3
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +2 -3
- package/ssr/esm/lib/dsr-components/multi-select.d.ts +0 -1
- package/ssr/esm/lib/dsr-components/select-wrapper-dropdown.d.ts +0 -1
- package/ssr/esm/lib/dsr-components/select.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,16 +14,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
|
|
|
14
14
|
|
|
15
15
|
### [Unreleased]
|
|
16
16
|
|
|
17
|
-
### [3.27.0] - 2025-
|
|
18
|
-
|
|
19
|
-
### [3.27.0-rc.6] - 2025-02-28
|
|
17
|
+
### [3.27.1-rc.0] - 2025-03-05
|
|
20
18
|
|
|
21
|
-
####
|
|
19
|
+
#### Fixed
|
|
22
20
|
|
|
23
|
-
- `Carousel`: Center layout of Carousel on mobile view
|
|
24
|
-
([#3765](https://github.com/porsche-design-system/porsche-design-system/pull/3765))
|
|
25
21
|
- `Carousel`: `auto` value of `slides-per-page` prop is breakpoint customizable
|
|
26
|
-
([#
|
|
22
|
+
([#3783](https://github.com/porsche-design-system/porsche-design-system/pull/3783))
|
|
23
|
+
- `Select`, `Multi Select`, `Select Wrapper`: remove positioning with native anchor positioning due to a Chrome bug
|
|
24
|
+
([#3780](https://github.com/porsche-design-system/porsche-design-system/pull/3780))
|
|
25
|
+
|
|
26
|
+
### [3.27.0] - 2025-02-28
|
|
27
|
+
|
|
28
|
+
### [3.27.0-rc.6] - 2025-02-28
|
|
27
29
|
|
|
28
30
|
#### Added
|
|
29
31
|
|
|
@@ -47,6 +49,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
|
|
|
47
49
|
- `Select`, `Select Wrapper`:
|
|
48
50
|
- focus outline becomes default focus style when no filter is used
|
|
49
51
|
([#3754](https://github.com/porsche-design-system/porsche-design-system/pull/3754))
|
|
52
|
+
- `Carousel`: Center layout of Carousel on mobile view
|
|
53
|
+
([#3765](https://github.com/porsche-design-system/porsche-design-system/pull/3765))
|
|
54
|
+
- `Carousel`: `auto` value of `slides-per-page` prop is breakpoint customizable
|
|
55
|
+
([#3771](https://github.com/porsche-design-system/porsche-design-system/pull/3771))
|
|
50
56
|
|
|
51
57
|
### [3.27.0-rc.5] - 2025-02-20
|
|
52
58
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porsche-design-system/components-react",
|
|
3
|
-
"version": "3.27.0",
|
|
3
|
+
"version": "3.27.1-rc.0",
|
|
4
4
|
"description": "Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"porsche",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"license": "SEE LICENSE IN LICENSE",
|
|
18
18
|
"homepage": "https://designsystem.porsche.com",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@porsche-design-system/components-js": "3.27.0"
|
|
20
|
+
"@porsche-design-system/components-js": "3.27.1-rc.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"ag-grid-community": ">= 33.0.0 <34.0.0",
|
|
@@ -3906,22 +3906,6 @@ const supportsNativePopover = () => {
|
|
|
3906
3906
|
// determine it once
|
|
3907
3907
|
supportsNativePopover();
|
|
3908
3908
|
|
|
3909
|
-
/**
|
|
3910
|
-
* Checks if the current environment supports the native CSS Anchor Positioning.
|
|
3911
|
-
*
|
|
3912
|
-
* @returns {boolean} `true` if native CSS Anchor Positioning is supported, `false` otherwise.
|
|
3913
|
-
*/
|
|
3914
|
-
const supportsNativeCSSAnchorPositioning = () => {
|
|
3915
|
-
// SSR or older browsers
|
|
3916
|
-
if (typeof CSS === 'undefined' || !CSS.supports)
|
|
3917
|
-
return false;
|
|
3918
|
-
return CSS.supports('(anchor-name: --test) and (position-anchor: --test) and (position-area: bottom) and (position-try-fallbacks: flip-block) and (width: anchor-size(width))');
|
|
3919
|
-
};
|
|
3920
|
-
// determine it once
|
|
3921
|
-
const hasNativeCSSAnchorPositioningSupport = supportsNativeCSSAnchorPositioning();
|
|
3922
|
-
// getter for easy mocking
|
|
3923
|
-
const getHasCSSAnchorPositioningSupport = () => hasNativeCSSAnchorPositioningSupport;
|
|
3924
|
-
|
|
3925
3909
|
const hasDocument = typeof document !== 'undefined';
|
|
3926
3910
|
|
|
3927
3911
|
const isThemeAuto = (theme) => {
|
|
@@ -8207,7 +8191,7 @@ const getUnitCounterJssStyle = (isDisabled, isReadonly, theme) => {
|
|
|
8207
8191
|
};
|
|
8208
8192
|
};
|
|
8209
8193
|
|
|
8210
|
-
const getButtonJssStyle = (componentName, isOpen, isDisabled, state, hasSlottedImage,
|
|
8194
|
+
const getButtonJssStyle = (componentName, isOpen, isDisabled, state, hasSlottedImage, cssVarScaling, theme) => {
|
|
8211
8195
|
const cssVarBackgroundColor = `--p-${componentName}-background-color`;
|
|
8212
8196
|
const cssVarTextColor = `--p-${componentName}-text-color`;
|
|
8213
8197
|
const cssVarBorderColor = `--p-${componentName}-border-color`;
|
|
@@ -8217,9 +8201,6 @@ const getButtonJssStyle = (componentName, isOpen, isDisabled, state, hasSlottedI
|
|
|
8217
8201
|
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
8218
8202
|
return {
|
|
8219
8203
|
all: 'unset',
|
|
8220
|
-
...(getHasCSSAnchorPositioningSupport() && {
|
|
8221
|
-
anchorName,
|
|
8222
|
-
}),
|
|
8223
8204
|
display: 'grid',
|
|
8224
8205
|
gridTemplateColumns: `${hasSlottedImage ? 'auto ' : ''}minmax(0, 1fr) auto`,
|
|
8225
8206
|
alignItems: 'center',
|
|
@@ -8379,7 +8360,7 @@ const getPopoverKeyframesStyles = {
|
|
|
8379
8360
|
},
|
|
8380
8361
|
},
|
|
8381
8362
|
};
|
|
8382
|
-
const getPopoverJssStyle = (isOpen,
|
|
8363
|
+
const getPopoverJssStyle = (isOpen, cssVarScaling, // "1" is needed for components not yet supporting compact mode
|
|
8383
8364
|
optionHeight, theme) => {
|
|
8384
8365
|
const { contrastLowColor, backgroundColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
8385
8366
|
const { contrastLowColor: contrastLowColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark } = getThemedColors('dark');
|
|
@@ -8406,16 +8387,6 @@ optionHeight, theme) => {
|
|
|
8406
8387
|
background: backgroundSurfaceColorDark,
|
|
8407
8388
|
borderColor: contrastLowColorDark,
|
|
8408
8389
|
}),
|
|
8409
|
-
...(getHasCSSAnchorPositioningSupport() && {
|
|
8410
|
-
positionAnchor: anchorName,
|
|
8411
|
-
positionVisibility: 'always',
|
|
8412
|
-
positionTryOrder: 'normal',
|
|
8413
|
-
positionArea: direction === 'up' ? 'top' : 'bottom',
|
|
8414
|
-
positionTryFallbacks: 'flip-block',
|
|
8415
|
-
width: 'anchor-size(width)',
|
|
8416
|
-
maxHeight: `max(${minHeightOptionList}, calc(50vh - anchor-size(height) / 2 - ${OPTION_LIST_SAFE_ZONE}px * 2))`,
|
|
8417
|
-
margin: `${OPTION_LIST_SAFE_ZONE}px 0`,
|
|
8418
|
-
}),
|
|
8419
8390
|
'&:not(:popover-open)': {
|
|
8420
8391
|
display: 'none',
|
|
8421
8392
|
},
|
|
@@ -8454,8 +8425,7 @@ const getPlaceholderJssStyle = (styles) => ({
|
|
|
8454
8425
|
'&:-moz-placeholder': styles /* Firefox 18- */,
|
|
8455
8426
|
});
|
|
8456
8427
|
|
|
8457
|
-
const
|
|
8458
|
-
const getComponentCss$C = (direction, isOpen, isDisabled, hideLabel, state, hasNativeCSSAnchorPositioningSupport, theme) => {
|
|
8428
|
+
const getComponentCss$C = (isOpen, isDisabled, hideLabel, state, theme) => {
|
|
8459
8429
|
const { primaryColor, disabledColor, contrastHighColor, contrastMediumColor, backgroundColor } = getThemedColors(theme);
|
|
8460
8430
|
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, backgroundColor: backgroundColorDark, } = getThemedColors('dark');
|
|
8461
8431
|
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
@@ -8533,11 +8503,8 @@ const getComponentCss$C = (direction, isOpen, isDisabled, hideLabel, state, hasN
|
|
|
8533
8503
|
WebkitTextFillColor: disabledColorDark,
|
|
8534
8504
|
}),
|
|
8535
8505
|
}),
|
|
8536
|
-
...(hasNativeCSSAnchorPositioningSupport && {
|
|
8537
|
-
anchorName: anchorName$2,
|
|
8538
|
-
}),
|
|
8539
8506
|
},
|
|
8540
|
-
'[popover]': getPopoverJssStyle(isOpen,
|
|
8507
|
+
'[popover]': getPopoverJssStyle(isOpen, 1, 44, theme),
|
|
8541
8508
|
},
|
|
8542
8509
|
root: {
|
|
8543
8510
|
display: 'grid',
|
|
@@ -9283,8 +9250,7 @@ const getComponentCss$u = (maxWidth, columns) => {
|
|
|
9283
9250
|
});
|
|
9284
9251
|
};
|
|
9285
9252
|
|
|
9286
|
-
const
|
|
9287
|
-
const getButtonStyles = (isOpen, state, hasNativeCSSAnchorPositioningSupport, theme) => {
|
|
9253
|
+
const getButtonStyles = (isOpen, state, theme) => {
|
|
9288
9254
|
const { primaryColor, disabledColor, contrastMediumColor } = getThemedColors(theme);
|
|
9289
9255
|
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark, } = getThemedColors('dark');
|
|
9290
9256
|
const { formStateHoverColor, formStateColor } = getThemedFormStateColors(theme, state);
|
|
@@ -9293,9 +9259,6 @@ const getButtonStyles = (isOpen, state, hasNativeCSSAnchorPositioningSupport, th
|
|
|
9293
9259
|
'@global': {
|
|
9294
9260
|
// TODO: extract generic default button/anchor reset style
|
|
9295
9261
|
button: {
|
|
9296
|
-
...(hasNativeCSSAnchorPositioningSupport && {
|
|
9297
|
-
anchorName: anchorName$1,
|
|
9298
|
-
}),
|
|
9299
9262
|
position: 'absolute',
|
|
9300
9263
|
inset: 0,
|
|
9301
9264
|
width: '100%', // fixes Firefox positioning issue
|
|
@@ -9331,7 +9294,7 @@ const getButtonStyles = (isOpen, state, hasNativeCSSAnchorPositioningSupport, th
|
|
|
9331
9294
|
},
|
|
9332
9295
|
};
|
|
9333
9296
|
};
|
|
9334
|
-
const getFilterStyles = (isOpen, state, disabled,
|
|
9297
|
+
const getFilterStyles = (isOpen, state, disabled, theme) => {
|
|
9335
9298
|
const { primaryColor, backgroundColor, disabledColor, contrastMediumColor } = getThemedColors(theme);
|
|
9336
9299
|
const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark, disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark, } = getThemedColors('dark');
|
|
9337
9300
|
const { formStateHoverColor, formStateColor } = getThemedFormStateColors(theme, state);
|
|
@@ -9375,9 +9338,6 @@ const getFilterStyles = (isOpen, state, disabled, hasNativeCSSAnchorPositioningS
|
|
|
9375
9338
|
color: primaryColorDark,
|
|
9376
9339
|
background: backgroundColorDark,
|
|
9377
9340
|
}),
|
|
9378
|
-
...(hasNativeCSSAnchorPositioningSupport && {
|
|
9379
|
-
anchorName: anchorName$1,
|
|
9380
|
-
}),
|
|
9381
9341
|
'&::placeholder': {
|
|
9382
9342
|
...placeHolderJssStyle,
|
|
9383
9343
|
...prefersColorSchemeDarkMediaQuery(theme, placeHolderDarkJssStyle),
|
|
@@ -9435,14 +9395,14 @@ const getFilterStyles = (isOpen, state, disabled, hasNativeCSSAnchorPositioningS
|
|
|
9435
9395
|
},
|
|
9436
9396
|
};
|
|
9437
9397
|
};
|
|
9438
|
-
const getListStyles = (
|
|
9398
|
+
const getListStyles = (isOpen, theme) => {
|
|
9439
9399
|
const { primaryColor, disabledColor } = getThemedColors(theme);
|
|
9440
9400
|
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark } = getThemedColors('dark');
|
|
9441
9401
|
return {
|
|
9442
9402
|
'@global': {
|
|
9443
9403
|
// @keyframes fade-in
|
|
9444
9404
|
...getPopoverKeyframesStyles,
|
|
9445
|
-
'[popover]': getPopoverJssStyle(isOpen,
|
|
9405
|
+
'[popover]': getPopoverJssStyle(isOpen, 1, 40, theme),
|
|
9446
9406
|
},
|
|
9447
9407
|
option: {
|
|
9448
9408
|
...getOptionJssStyle('select-wrapper', 1, theme),
|
|
@@ -9474,7 +9434,7 @@ const getListStyles = (direction, isOpen, theme) => {
|
|
|
9474
9434
|
},
|
|
9475
9435
|
};
|
|
9476
9436
|
};
|
|
9477
|
-
const getComponentCss$t = (
|
|
9437
|
+
const getComponentCss$t = (isOpen, state, disabled, filter, theme) => {
|
|
9478
9438
|
return getCss(
|
|
9479
9439
|
// merge because of global styles
|
|
9480
9440
|
mergeDeep({
|
|
@@ -9488,9 +9448,7 @@ const getComponentCss$t = (direction, isOpen, state, disabled, filter, hasNative
|
|
|
9488
9448
|
'sr-text': {
|
|
9489
9449
|
display: 'none',
|
|
9490
9450
|
},
|
|
9491
|
-
}, filter
|
|
9492
|
-
? getFilterStyles(isOpen, state, disabled, hasNativeCSSAnchorPositioningSupport, theme)
|
|
9493
|
-
: getButtonStyles(isOpen, state, hasNativeCSSAnchorPositioningSupport, theme), getListStyles(direction, isOpen, theme)));
|
|
9451
|
+
}, filter ? getFilterStyles(isOpen, state, disabled, theme) : getButtonStyles(isOpen, state, theme), getListStyles(isOpen, theme)));
|
|
9494
9452
|
};
|
|
9495
9453
|
|
|
9496
9454
|
const getComponentCss$s = (isDisabled, hasCustomDropdown, hideLabel, state, theme) => {
|
|
@@ -9575,8 +9533,7 @@ const getComponentCss$r = (theme) => {
|
|
|
9575
9533
|
};
|
|
9576
9534
|
|
|
9577
9535
|
const cssVarInternalSelectScaling = '--p-internal-select-scaling';
|
|
9578
|
-
const
|
|
9579
|
-
const getComponentCss$q = (direction, isOpen, isDisabled, hideLabel, state, compact, theme, hasSlottedImage) => {
|
|
9536
|
+
const getComponentCss$q = (isOpen, isDisabled, hideLabel, state, compact, theme, hasSlottedImage) => {
|
|
9580
9537
|
const scalingVar = `var(${cssVarInternalSelectScaling}, ${compact ? 0.5 : 1})`;
|
|
9581
9538
|
return getCss({
|
|
9582
9539
|
'@global': {
|
|
@@ -9595,11 +9552,11 @@ const getComponentCss$q = (direction, isOpen, isDisabled, hideLabel, state, comp
|
|
|
9595
9552
|
}),
|
|
9596
9553
|
...preventFoucOfNestedElementsStyles,
|
|
9597
9554
|
button: {
|
|
9598
|
-
...getButtonJssStyle('select', isOpen, isDisabled, state, hasSlottedImage,
|
|
9555
|
+
...getButtonJssStyle('select', isOpen, isDisabled, state, hasSlottedImage, scalingVar, theme),
|
|
9599
9556
|
'& img': getButtonImageJssStyle,
|
|
9600
9557
|
'& span': getButtonLabelJssStyle,
|
|
9601
9558
|
},
|
|
9602
|
-
'[popover]': getPopoverJssStyle(isOpen,
|
|
9559
|
+
'[popover]': getPopoverJssStyle(isOpen, scalingVar, 40, theme),
|
|
9603
9560
|
},
|
|
9604
9561
|
root: {
|
|
9605
9562
|
display: 'grid',
|
|
@@ -3545,22 +3545,6 @@ const hasNativePopoverSupport = supportsNativePopover();
|
|
|
3545
3545
|
// getter for easy mocking
|
|
3546
3546
|
const getHasNativePopoverSupport = () => hasNativePopoverSupport;
|
|
3547
3547
|
|
|
3548
|
-
/**
|
|
3549
|
-
* Checks if the current environment supports the native CSS Anchor Positioning.
|
|
3550
|
-
*
|
|
3551
|
-
* @returns {boolean} `true` if native CSS Anchor Positioning is supported, `false` otherwise.
|
|
3552
|
-
*/
|
|
3553
|
-
const supportsNativeCSSAnchorPositioning = () => {
|
|
3554
|
-
// SSR or older browsers
|
|
3555
|
-
if (typeof CSS === 'undefined' || !CSS.supports)
|
|
3556
|
-
return false;
|
|
3557
|
-
return CSS.supports('(anchor-name: --test) and (position-anchor: --test) and (position-area: bottom) and (position-try-fallbacks: flip-block) and (width: anchor-size(width))');
|
|
3558
|
-
};
|
|
3559
|
-
// determine it once
|
|
3560
|
-
const hasNativeCSSAnchorPositioningSupport = supportsNativeCSSAnchorPositioning();
|
|
3561
|
-
// getter for easy mocking
|
|
3562
|
-
const getHasCSSAnchorPositioningSupport = () => hasNativeCSSAnchorPositioningSupport;
|
|
3563
|
-
|
|
3564
3548
|
const hasDocument = typeof document !== 'undefined';
|
|
3565
3549
|
|
|
3566
3550
|
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
@@ -3955,7 +3939,6 @@ exports.getCurrentActivePage = getCurrentActivePage;
|
|
|
3955
3939
|
exports.getDirectChildHTMLElement = getDirectChildHTMLElement;
|
|
3956
3940
|
exports.getDisplayTagType = getDisplayTagType;
|
|
3957
3941
|
exports.getHTMLElement = getHTMLElement;
|
|
3958
|
-
exports.getHasCSSAnchorPositioningSupport = getHasCSSAnchorPositioningSupport;
|
|
3959
3942
|
exports.getHasNativePopoverSupport = getHasNativePopoverSupport;
|
|
3960
3943
|
exports.getHeadingTagType = getHeadingTagType;
|
|
3961
3944
|
exports.getHeadlineTagType = getHeadlineTagType;
|
|
@@ -4002,7 +3985,6 @@ exports.parseJSONAttribute = parseJSONAttribute;
|
|
|
4002
3985
|
exports.scrollAreaClass = scrollAreaClass;
|
|
4003
3986
|
exports.showCustomCalendarOrTimeIndicator = showCustomCalendarOrTimeIndicator;
|
|
4004
3987
|
exports.supportsConstructableStylesheets = supportsConstructableStylesheets;
|
|
4005
|
-
exports.supportsNativeCSSAnchorPositioning = supportsNativeCSSAnchorPositioning;
|
|
4006
3988
|
exports.supportsNativePopover = supportsNativePopover;
|
|
4007
3989
|
exports.tempDiv = tempDiv;
|
|
4008
3990
|
exports.tempIcon = tempIcon;
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs
CHANGED
|
@@ -37,7 +37,6 @@ class DSRMultiSelect extends react.Component {
|
|
|
37
37
|
preventOptionUpdate = false; // Used to prevent value watcher from updating options when options are already updated
|
|
38
38
|
popoverElement;
|
|
39
39
|
hasNativePopoverSupport = utilsEntry.getHasNativePopoverSupport();
|
|
40
|
-
hasNativeCSSAnchorPositioningSupport = utilsEntry.getHasCSSAnchorPositioningSupport();
|
|
41
40
|
cleanUpAutoUpdate;
|
|
42
41
|
get currentValue() {
|
|
43
42
|
return utilsEntry.getSelectedOptionValues(this.props.multiSelectOptions);
|
|
@@ -61,7 +60,7 @@ class DSRMultiSelect extends react.Component {
|
|
|
61
60
|
const inputId = 'filter';
|
|
62
61
|
const popoverId = 'list';
|
|
63
62
|
const optionsSelectedId = 'options-selected';
|
|
64
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getMultiSelectCss(this.props.
|
|
63
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getMultiSelectCss(this.props.isOpen, this.props.disabled, this.props.hideLabel, this.props.state, this.props.theme)));
|
|
65
64
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.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: inputId, isRequired: this.props.required, isDisabled: this.props.disabled }), this.props.currentValue && (jsxRuntime.jsxs("span", { id: optionsSelectedId, className: "sr-only", children: [utilsEntry.getSelectedOptions(this.props.multiSelectOptions).length, " options selected"] })), jsxRuntime.jsxs("div", { className: `wrapper${this.props.disabled ? ' disabled' : ''}`, children: [jsxRuntime.jsx("input", { id: inputId, role: "combobox", autoComplete: "off", disabled: this.props.disabled, required: this.props.required, "aria-invalid": this.props.state === 'error' ? 'true' : null }), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "arrow-head-down", theme: this.props.theme, "aria-hidden": "true" }), this.props.currentValue && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { type: "button", className: "button", icon: "close", hideLabel: true, theme: this.props.theme, disabled: this.props.disabled, children: "Reset selection" })), jsxRuntime.jsxs("div", { id: popoverId, popover: "manual", tabIndex: -1, 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] }));
|
|
66
65
|
}
|
|
67
66
|
}
|
|
@@ -16,7 +16,6 @@ class DSRSelectWrapperDropdown extends react.Component {
|
|
|
16
16
|
inputOrButtonElement;
|
|
17
17
|
popoverElement;
|
|
18
18
|
hasNativePopoverSupport = utilsEntry.getHasNativePopoverSupport();
|
|
19
|
-
hasNativeCSSAnchorPositioningSupport = utilsEntry.getHasCSSAnchorPositioningSupport();
|
|
20
19
|
cleanUpAutoUpdate;
|
|
21
20
|
get selectedIndex() {
|
|
22
21
|
return 0;
|
|
@@ -27,7 +26,7 @@ class DSRSelectWrapperDropdown extends react.Component {
|
|
|
27
26
|
const inputId = 'filter';
|
|
28
27
|
this.props.description && 'description';
|
|
29
28
|
const buttonId = 'value';
|
|
30
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSelectWrapperDropdownCss(this.
|
|
29
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSelectWrapperDropdownCss(this.isOpen, this.props.state, this.props.disabled, this.props.filter, this.props.theme)));
|
|
31
30
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: this.props.filter ? ([
|
|
32
31
|
jsxRuntime.jsx("input", { id: inputId, type: "text", role: "combobox", disabled: this.props.disabled, placeholder: utilsEntry.getSelectedOptionMap(this.optionMaps)?.value || null, autoComplete: "off", defaultValue: this.searchString }, "input"),
|
|
33
32
|
jsxRuntime.jsx("span", {
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs
CHANGED
|
@@ -37,7 +37,6 @@ class DSRSelect extends react.Component {
|
|
|
37
37
|
searchTimeout = null;
|
|
38
38
|
slottedImagePath = '';
|
|
39
39
|
hasNativePopoverSupport = utilsEntry.getHasNativePopoverSupport();
|
|
40
|
-
hasNativeCSSAnchorPositioningSupport = utilsEntry.getHasCSSAnchorPositioningSupport();
|
|
41
40
|
cleanUpAutoUpdate;
|
|
42
41
|
formDisabledCallback() {
|
|
43
42
|
}
|
|
@@ -55,7 +54,7 @@ class DSRSelect extends react.Component {
|
|
|
55
54
|
const initialStatusId = 'initial-status';
|
|
56
55
|
const ariaDescribedBy = [descriptionId, selectMessageId, initialStatusId].filter(Boolean).join(' ');
|
|
57
56
|
const selectedOption = utilsEntry.getSelectedOptionString(otherChildren);
|
|
58
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSelectCss(this.props.
|
|
57
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSelectCss(this.props.isOpen, this.props.disabled, this.props.hideLabel, this.props.state, this.props.compact, this.props.theme, !!this.props.slottedImagePath)));
|
|
59
58
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.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: buttonId, isRequired: this.props.required, isDisabled: this.props.disabled }), jsxRuntime.jsxs("button", { "aria-invalid": this.props.state === 'error' ? 'true' : null, type: "button", role: "combobox", id: buttonId, ...utilsEntry.getComboboxAriaAttributes(this.props.isOpen, this.props.required, label.labelId, ariaDescribedBy, popoverId), disabled: this.props.disabled, children: [this.props.slottedImagePath && jsxRuntime.jsx("img", { src: this.props.slottedImagePath, alt: "" }), jsxRuntime.jsx("span", { children: selectedOption }), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "arrow-head-down", theme: this.props.theme, color: this.props.disabled ? 'state-disabled' : 'primary', "aria-hidden": "true" })] }), jsxRuntime.jsx("div", { id: popoverId, popover: "manual", tabIndex: -1, ...utilsEntry.getListAriaAttributes(this.props.label, this.props.required, false, this.props.isOpen), children: 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.srHighlightedOptionText })] })] }), this.props.children] }));
|
|
60
59
|
}
|
|
61
60
|
getSelectedOptionImagePath = (options) => {
|
|
@@ -3904,22 +3904,6 @@ const supportsNativePopover = () => {
|
|
|
3904
3904
|
// determine it once
|
|
3905
3905
|
supportsNativePopover();
|
|
3906
3906
|
|
|
3907
|
-
/**
|
|
3908
|
-
* Checks if the current environment supports the native CSS Anchor Positioning.
|
|
3909
|
-
*
|
|
3910
|
-
* @returns {boolean} `true` if native CSS Anchor Positioning is supported, `false` otherwise.
|
|
3911
|
-
*/
|
|
3912
|
-
const supportsNativeCSSAnchorPositioning = () => {
|
|
3913
|
-
// SSR or older browsers
|
|
3914
|
-
if (typeof CSS === 'undefined' || !CSS.supports)
|
|
3915
|
-
return false;
|
|
3916
|
-
return CSS.supports('(anchor-name: --test) and (position-anchor: --test) and (position-area: bottom) and (position-try-fallbacks: flip-block) and (width: anchor-size(width))');
|
|
3917
|
-
};
|
|
3918
|
-
// determine it once
|
|
3919
|
-
const hasNativeCSSAnchorPositioningSupport = supportsNativeCSSAnchorPositioning();
|
|
3920
|
-
// getter for easy mocking
|
|
3921
|
-
const getHasCSSAnchorPositioningSupport = () => hasNativeCSSAnchorPositioningSupport;
|
|
3922
|
-
|
|
3923
3907
|
const hasDocument = typeof document !== 'undefined';
|
|
3924
3908
|
|
|
3925
3909
|
const isThemeAuto = (theme) => {
|
|
@@ -8205,7 +8189,7 @@ const getUnitCounterJssStyle = (isDisabled, isReadonly, theme) => {
|
|
|
8205
8189
|
};
|
|
8206
8190
|
};
|
|
8207
8191
|
|
|
8208
|
-
const getButtonJssStyle = (componentName, isOpen, isDisabled, state, hasSlottedImage,
|
|
8192
|
+
const getButtonJssStyle = (componentName, isOpen, isDisabled, state, hasSlottedImage, cssVarScaling, theme) => {
|
|
8209
8193
|
const cssVarBackgroundColor = `--p-${componentName}-background-color`;
|
|
8210
8194
|
const cssVarTextColor = `--p-${componentName}-text-color`;
|
|
8211
8195
|
const cssVarBorderColor = `--p-${componentName}-border-color`;
|
|
@@ -8215,9 +8199,6 @@ const getButtonJssStyle = (componentName, isOpen, isDisabled, state, hasSlottedI
|
|
|
8215
8199
|
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
8216
8200
|
return {
|
|
8217
8201
|
all: 'unset',
|
|
8218
|
-
...(getHasCSSAnchorPositioningSupport() && {
|
|
8219
|
-
anchorName,
|
|
8220
|
-
}),
|
|
8221
8202
|
display: 'grid',
|
|
8222
8203
|
gridTemplateColumns: `${hasSlottedImage ? 'auto ' : ''}minmax(0, 1fr) auto`,
|
|
8223
8204
|
alignItems: 'center',
|
|
@@ -8377,7 +8358,7 @@ const getPopoverKeyframesStyles = {
|
|
|
8377
8358
|
},
|
|
8378
8359
|
},
|
|
8379
8360
|
};
|
|
8380
|
-
const getPopoverJssStyle = (isOpen,
|
|
8361
|
+
const getPopoverJssStyle = (isOpen, cssVarScaling, // "1" is needed for components not yet supporting compact mode
|
|
8381
8362
|
optionHeight, theme) => {
|
|
8382
8363
|
const { contrastLowColor, backgroundColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
8383
8364
|
const { contrastLowColor: contrastLowColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark } = getThemedColors('dark');
|
|
@@ -8404,16 +8385,6 @@ optionHeight, theme) => {
|
|
|
8404
8385
|
background: backgroundSurfaceColorDark,
|
|
8405
8386
|
borderColor: contrastLowColorDark,
|
|
8406
8387
|
}),
|
|
8407
|
-
...(getHasCSSAnchorPositioningSupport() && {
|
|
8408
|
-
positionAnchor: anchorName,
|
|
8409
|
-
positionVisibility: 'always',
|
|
8410
|
-
positionTryOrder: 'normal',
|
|
8411
|
-
positionArea: direction === 'up' ? 'top' : 'bottom',
|
|
8412
|
-
positionTryFallbacks: 'flip-block',
|
|
8413
|
-
width: 'anchor-size(width)',
|
|
8414
|
-
maxHeight: `max(${minHeightOptionList}, calc(50vh - anchor-size(height) / 2 - ${OPTION_LIST_SAFE_ZONE}px * 2))`,
|
|
8415
|
-
margin: `${OPTION_LIST_SAFE_ZONE}px 0`,
|
|
8416
|
-
}),
|
|
8417
8388
|
'&:not(:popover-open)': {
|
|
8418
8389
|
display: 'none',
|
|
8419
8390
|
},
|
|
@@ -8452,8 +8423,7 @@ const getPlaceholderJssStyle = (styles) => ({
|
|
|
8452
8423
|
'&:-moz-placeholder': styles /* Firefox 18- */,
|
|
8453
8424
|
});
|
|
8454
8425
|
|
|
8455
|
-
const
|
|
8456
|
-
const getComponentCss$C = (direction, isOpen, isDisabled, hideLabel, state, hasNativeCSSAnchorPositioningSupport, theme) => {
|
|
8426
|
+
const getComponentCss$C = (isOpen, isDisabled, hideLabel, state, theme) => {
|
|
8457
8427
|
const { primaryColor, disabledColor, contrastHighColor, contrastMediumColor, backgroundColor } = getThemedColors(theme);
|
|
8458
8428
|
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, backgroundColor: backgroundColorDark, } = getThemedColors('dark');
|
|
8459
8429
|
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
@@ -8531,11 +8501,8 @@ const getComponentCss$C = (direction, isOpen, isDisabled, hideLabel, state, hasN
|
|
|
8531
8501
|
WebkitTextFillColor: disabledColorDark,
|
|
8532
8502
|
}),
|
|
8533
8503
|
}),
|
|
8534
|
-
...(hasNativeCSSAnchorPositioningSupport && {
|
|
8535
|
-
anchorName: anchorName$2,
|
|
8536
|
-
}),
|
|
8537
8504
|
},
|
|
8538
|
-
'[popover]': getPopoverJssStyle(isOpen,
|
|
8505
|
+
'[popover]': getPopoverJssStyle(isOpen, 1, 44, theme),
|
|
8539
8506
|
},
|
|
8540
8507
|
root: {
|
|
8541
8508
|
display: 'grid',
|
|
@@ -9281,8 +9248,7 @@ const getComponentCss$u = (maxWidth, columns) => {
|
|
|
9281
9248
|
});
|
|
9282
9249
|
};
|
|
9283
9250
|
|
|
9284
|
-
const
|
|
9285
|
-
const getButtonStyles = (isOpen, state, hasNativeCSSAnchorPositioningSupport, theme) => {
|
|
9251
|
+
const getButtonStyles = (isOpen, state, theme) => {
|
|
9286
9252
|
const { primaryColor, disabledColor, contrastMediumColor } = getThemedColors(theme);
|
|
9287
9253
|
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark, } = getThemedColors('dark');
|
|
9288
9254
|
const { formStateHoverColor, formStateColor } = getThemedFormStateColors(theme, state);
|
|
@@ -9291,9 +9257,6 @@ const getButtonStyles = (isOpen, state, hasNativeCSSAnchorPositioningSupport, th
|
|
|
9291
9257
|
'@global': {
|
|
9292
9258
|
// TODO: extract generic default button/anchor reset style
|
|
9293
9259
|
button: {
|
|
9294
|
-
...(hasNativeCSSAnchorPositioningSupport && {
|
|
9295
|
-
anchorName: anchorName$1,
|
|
9296
|
-
}),
|
|
9297
9260
|
position: 'absolute',
|
|
9298
9261
|
inset: 0,
|
|
9299
9262
|
width: '100%', // fixes Firefox positioning issue
|
|
@@ -9329,7 +9292,7 @@ const getButtonStyles = (isOpen, state, hasNativeCSSAnchorPositioningSupport, th
|
|
|
9329
9292
|
},
|
|
9330
9293
|
};
|
|
9331
9294
|
};
|
|
9332
|
-
const getFilterStyles = (isOpen, state, disabled,
|
|
9295
|
+
const getFilterStyles = (isOpen, state, disabled, theme) => {
|
|
9333
9296
|
const { primaryColor, backgroundColor, disabledColor, contrastMediumColor } = getThemedColors(theme);
|
|
9334
9297
|
const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark, disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark, } = getThemedColors('dark');
|
|
9335
9298
|
const { formStateHoverColor, formStateColor } = getThemedFormStateColors(theme, state);
|
|
@@ -9373,9 +9336,6 @@ const getFilterStyles = (isOpen, state, disabled, hasNativeCSSAnchorPositioningS
|
|
|
9373
9336
|
color: primaryColorDark,
|
|
9374
9337
|
background: backgroundColorDark,
|
|
9375
9338
|
}),
|
|
9376
|
-
...(hasNativeCSSAnchorPositioningSupport && {
|
|
9377
|
-
anchorName: anchorName$1,
|
|
9378
|
-
}),
|
|
9379
9339
|
'&::placeholder': {
|
|
9380
9340
|
...placeHolderJssStyle,
|
|
9381
9341
|
...prefersColorSchemeDarkMediaQuery(theme, placeHolderDarkJssStyle),
|
|
@@ -9433,14 +9393,14 @@ const getFilterStyles = (isOpen, state, disabled, hasNativeCSSAnchorPositioningS
|
|
|
9433
9393
|
},
|
|
9434
9394
|
};
|
|
9435
9395
|
};
|
|
9436
|
-
const getListStyles = (
|
|
9396
|
+
const getListStyles = (isOpen, theme) => {
|
|
9437
9397
|
const { primaryColor, disabledColor } = getThemedColors(theme);
|
|
9438
9398
|
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark } = getThemedColors('dark');
|
|
9439
9399
|
return {
|
|
9440
9400
|
'@global': {
|
|
9441
9401
|
// @keyframes fade-in
|
|
9442
9402
|
...getPopoverKeyframesStyles,
|
|
9443
|
-
'[popover]': getPopoverJssStyle(isOpen,
|
|
9403
|
+
'[popover]': getPopoverJssStyle(isOpen, 1, 40, theme),
|
|
9444
9404
|
},
|
|
9445
9405
|
option: {
|
|
9446
9406
|
...getOptionJssStyle('select-wrapper', 1, theme),
|
|
@@ -9472,7 +9432,7 @@ const getListStyles = (direction, isOpen, theme) => {
|
|
|
9472
9432
|
},
|
|
9473
9433
|
};
|
|
9474
9434
|
};
|
|
9475
|
-
const getComponentCss$t = (
|
|
9435
|
+
const getComponentCss$t = (isOpen, state, disabled, filter, theme) => {
|
|
9476
9436
|
return getCss(
|
|
9477
9437
|
// merge because of global styles
|
|
9478
9438
|
mergeDeep({
|
|
@@ -9486,9 +9446,7 @@ const getComponentCss$t = (direction, isOpen, state, disabled, filter, hasNative
|
|
|
9486
9446
|
'sr-text': {
|
|
9487
9447
|
display: 'none',
|
|
9488
9448
|
},
|
|
9489
|
-
}, filter
|
|
9490
|
-
? getFilterStyles(isOpen, state, disabled, hasNativeCSSAnchorPositioningSupport, theme)
|
|
9491
|
-
: getButtonStyles(isOpen, state, hasNativeCSSAnchorPositioningSupport, theme), getListStyles(direction, isOpen, theme)));
|
|
9449
|
+
}, filter ? getFilterStyles(isOpen, state, disabled, theme) : getButtonStyles(isOpen, state, theme), getListStyles(isOpen, theme)));
|
|
9492
9450
|
};
|
|
9493
9451
|
|
|
9494
9452
|
const getComponentCss$s = (isDisabled, hasCustomDropdown, hideLabel, state, theme) => {
|
|
@@ -9573,8 +9531,7 @@ const getComponentCss$r = (theme) => {
|
|
|
9573
9531
|
};
|
|
9574
9532
|
|
|
9575
9533
|
const cssVarInternalSelectScaling = '--p-internal-select-scaling';
|
|
9576
|
-
const
|
|
9577
|
-
const getComponentCss$q = (direction, isOpen, isDisabled, hideLabel, state, compact, theme, hasSlottedImage) => {
|
|
9534
|
+
const getComponentCss$q = (isOpen, isDisabled, hideLabel, state, compact, theme, hasSlottedImage) => {
|
|
9578
9535
|
const scalingVar = `var(${cssVarInternalSelectScaling}, ${compact ? 0.5 : 1})`;
|
|
9579
9536
|
return getCss({
|
|
9580
9537
|
'@global': {
|
|
@@ -9593,11 +9550,11 @@ const getComponentCss$q = (direction, isOpen, isDisabled, hideLabel, state, comp
|
|
|
9593
9550
|
}),
|
|
9594
9551
|
...preventFoucOfNestedElementsStyles,
|
|
9595
9552
|
button: {
|
|
9596
|
-
...getButtonJssStyle('select', isOpen, isDisabled, state, hasSlottedImage,
|
|
9553
|
+
...getButtonJssStyle('select', isOpen, isDisabled, state, hasSlottedImage, scalingVar, theme),
|
|
9597
9554
|
'& img': getButtonImageJssStyle,
|
|
9598
9555
|
'& span': getButtonLabelJssStyle,
|
|
9599
9556
|
},
|
|
9600
|
-
'[popover]': getPopoverJssStyle(isOpen,
|
|
9557
|
+
'[popover]': getPopoverJssStyle(isOpen, scalingVar, 40, theme),
|
|
9601
9558
|
},
|
|
9602
9559
|
root: {
|
|
9603
9560
|
display: 'grid',
|
|
@@ -3543,22 +3543,6 @@ const hasNativePopoverSupport = supportsNativePopover();
|
|
|
3543
3543
|
// getter for easy mocking
|
|
3544
3544
|
const getHasNativePopoverSupport = () => hasNativePopoverSupport;
|
|
3545
3545
|
|
|
3546
|
-
/**
|
|
3547
|
-
* Checks if the current environment supports the native CSS Anchor Positioning.
|
|
3548
|
-
*
|
|
3549
|
-
* @returns {boolean} `true` if native CSS Anchor Positioning is supported, `false` otherwise.
|
|
3550
|
-
*/
|
|
3551
|
-
const supportsNativeCSSAnchorPositioning = () => {
|
|
3552
|
-
// SSR or older browsers
|
|
3553
|
-
if (typeof CSS === 'undefined' || !CSS.supports)
|
|
3554
|
-
return false;
|
|
3555
|
-
return CSS.supports('(anchor-name: --test) and (position-anchor: --test) and (position-area: bottom) and (position-try-fallbacks: flip-block) and (width: anchor-size(width))');
|
|
3556
|
-
};
|
|
3557
|
-
// determine it once
|
|
3558
|
-
const hasNativeCSSAnchorPositioningSupport = supportsNativeCSSAnchorPositioning();
|
|
3559
|
-
// getter for easy mocking
|
|
3560
|
-
const getHasCSSAnchorPositioningSupport = () => hasNativeCSSAnchorPositioningSupport;
|
|
3561
|
-
|
|
3562
3546
|
const hasDocument = typeof document !== 'undefined';
|
|
3563
3547
|
|
|
3564
3548
|
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
@@ -3925,4 +3909,4 @@ const getTextTagType = (host, tag) => {
|
|
|
3925
3909
|
return tag;
|
|
3926
3910
|
};
|
|
3927
3911
|
|
|
3928
|
-
export { DISPLAY_TAGS, HEADING_TAGS, HEADLINE_TAGS, ItemType, TEXT_TAGS, _hasShowPickerSupport, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildIconUrl, buildImgSrc, buildSrcSet, createPaginationItems, createRange, crestSize, debounce, displaySizeToTagMap, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getClosestHTMLElement, getComboboxAriaAttributes, getContentAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getHTMLElement,
|
|
3912
|
+
export { DISPLAY_TAGS, HEADING_TAGS, HEADLINE_TAGS, ItemType, TEXT_TAGS, _hasShowPickerSupport, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildIconUrl, buildImgSrc, buildSrcSet, createPaginationItems, createRange, crestSize, debounce, displaySizeToTagMap, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getClosestHTMLElement, getComboboxAriaAttributes, getContentAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getHTMLElement, getHasNativePopoverSupport, getHeadingTagType, getHeadlineTagType, getIconColor, getInlineNotificationIconName, getInnerManifest, getListAriaAttributes, getOptionAriaAttributes, getRole, getSegmentedControlItemAriaAttributes, getSelectedOptionMap, getSelectedOptionString, getSelectedOptionValues, getSelectedOptions, getStepperHorizontalIconName, getSvgUrl, getSwitchButtonAriaAttributes, getTagName, getTagNameWithoutPrefix, getTextTagType, getTotalPages, hasDocument, hasLocateAction, hasSpecificDirectChildTag, hasVisibleIcon, hasWindow$1 as hasWindow, headerSlot, isCurrentInput, isCustomDropdown, isDisabledOrLoading, isElementOfKind, isInfinitePagination, isListTypeOrdered, isScrollable, isSortable, isStateCompleteOrWarning, isTouchDevice, isType, isUrl, isWithinForm, observedNodesMap, parseAndGetAriaAttributes, parseJSONAttribute, scrollAreaClass, showCustomCalendarOrTimeIndicator, supportsConstructableStylesheets, supportsNativePopover, tempDiv, tempIcon, tempLabel, traverseTreeAndUpdateState, updateFlyoutMultiLevelItemState };
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { splitChildren } from '../../splitChildren.mjs';
|
|
|
5
5
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
6
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.mjs';
|
|
7
7
|
import { getMultiSelectCss as getComponentCss$C } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
8
|
-
import { getHasNativePopoverSupport,
|
|
8
|
+
import { getHasNativePopoverSupport, getSelectedOptionValues, getSelectedOptions } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
9
9
|
import { PButtonPure } from '../components/button-pure.wrapper.mjs';
|
|
10
10
|
import { Label } from './label.mjs';
|
|
11
11
|
import { StateMessage } from './state-message.mjs';
|
|
@@ -35,7 +35,6 @@ class DSRMultiSelect extends Component {
|
|
|
35
35
|
preventOptionUpdate = false; // Used to prevent value watcher from updating options when options are already updated
|
|
36
36
|
popoverElement;
|
|
37
37
|
hasNativePopoverSupport = getHasNativePopoverSupport();
|
|
38
|
-
hasNativeCSSAnchorPositioningSupport = getHasCSSAnchorPositioningSupport();
|
|
39
38
|
cleanUpAutoUpdate;
|
|
40
39
|
get currentValue() {
|
|
41
40
|
return getSelectedOptionValues(this.props.multiSelectOptions);
|
|
@@ -59,7 +58,7 @@ class DSRMultiSelect extends Component {
|
|
|
59
58
|
const inputId = 'filter';
|
|
60
59
|
const popoverId = 'list';
|
|
61
60
|
const optionsSelectedId = 'options-selected';
|
|
62
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$C(this.props.
|
|
61
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$C(this.props.isOpen, this.props.disabled, this.props.hideLabel, this.props.state, this.props.theme)));
|
|
63
62
|
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: inputId, isRequired: this.props.required, isDisabled: this.props.disabled }), this.props.currentValue && (jsxs("span", { id: optionsSelectedId, className: "sr-only", children: [getSelectedOptions(this.props.multiSelectOptions).length, " options selected"] })), jsxs("div", { className: `wrapper${this.props.disabled ? ' disabled' : ''}`, children: [jsx("input", { id: inputId, role: "combobox", autoComplete: "off", disabled: this.props.disabled, required: this.props.required, "aria-invalid": this.props.state === 'error' ? 'true' : null }), jsx(PIcon, { className: "icon", name: "arrow-head-down", theme: this.props.theme, "aria-hidden": "true" }), this.props.currentValue && (jsx(PButtonPure, { type: "button", className: "button", icon: "close", hideLabel: true, theme: this.props.theme, disabled: this.props.disabled, children: "Reset selection" })), jsxs("div", { id: popoverId, popover: "manual", tabIndex: -1, children: [!this.props.hasFilterResults && (jsxs("div", { className: "no-results", role: "option", children: [jsx("span", { "aria-hidden": "true", children: "---" }), jsx("span", { className: "sr-only", children: "No results found" })] })), jsx("slot", {})] })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }), jsx("span", { className: "sr-only", role: "status", "aria-live": "assertive", "aria-relevant": "additions text", children: this.props.hasFilterResults ? this.props.srHighlightedOptionText : 'No results found' })] })] }), this.props.children] }));
|
|
64
63
|
}
|
|
65
64
|
}
|
|
@@ -4,7 +4,7 @@ import '../../provider.mjs';
|
|
|
4
4
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
5
5
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.mjs';
|
|
6
6
|
import { getSelectWrapperDropdownCss as getComponentCss$t } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
7
|
-
import { getHasNativePopoverSupport,
|
|
7
|
+
import { getHasNativePopoverSupport, getSelectedOptionMap } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
8
8
|
|
|
9
9
|
class DSRSelectWrapperDropdown extends Component {
|
|
10
10
|
host;
|
|
@@ -14,7 +14,6 @@ class DSRSelectWrapperDropdown extends Component {
|
|
|
14
14
|
inputOrButtonElement;
|
|
15
15
|
popoverElement;
|
|
16
16
|
hasNativePopoverSupport = getHasNativePopoverSupport();
|
|
17
|
-
hasNativeCSSAnchorPositioningSupport = getHasCSSAnchorPositioningSupport();
|
|
18
17
|
cleanUpAutoUpdate;
|
|
19
18
|
get selectedIndex() {
|
|
20
19
|
return 0;
|
|
@@ -25,7 +24,7 @@ class DSRSelectWrapperDropdown extends Component {
|
|
|
25
24
|
const inputId = 'filter';
|
|
26
25
|
this.props.description && 'description';
|
|
27
26
|
const buttonId = 'value';
|
|
28
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$t(this.
|
|
27
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$t(this.isOpen, this.props.state, this.props.disabled, this.props.filter, this.props.theme)));
|
|
29
28
|
return (jsx(Fragment, { children: jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: this.props.filter ? ([
|
|
30
29
|
jsx("input", { id: inputId, type: "text", role: "combobox", disabled: this.props.disabled, placeholder: getSelectedOptionMap(this.optionMaps)?.value || null, autoComplete: "off", defaultValue: this.searchString }, "input"),
|
|
31
30
|
jsx("span", {
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { splitChildren } from '../../splitChildren.mjs';
|
|
|
5
5
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
6
6
|
import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.mjs';
|
|
7
7
|
import { getSelectCss as getComponentCss$q } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
8
|
-
import { getHasNativePopoverSupport,
|
|
8
|
+
import { getHasNativePopoverSupport, getSelectedOptionString, getComboboxAriaAttributes, getListAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
9
9
|
import { Label, labelId } from './label.mjs';
|
|
10
10
|
import { messageId, StateMessage } from './state-message.mjs';
|
|
11
11
|
import { PIcon } from '../components/icon.wrapper.mjs';
|
|
@@ -35,7 +35,6 @@ class DSRSelect extends Component {
|
|
|
35
35
|
searchTimeout = null;
|
|
36
36
|
slottedImagePath = '';
|
|
37
37
|
hasNativePopoverSupport = getHasNativePopoverSupport();
|
|
38
|
-
hasNativeCSSAnchorPositioningSupport = getHasCSSAnchorPositioningSupport();
|
|
39
38
|
cleanUpAutoUpdate;
|
|
40
39
|
formDisabledCallback() {
|
|
41
40
|
}
|
|
@@ -53,7 +52,7 @@ class DSRSelect extends Component {
|
|
|
53
52
|
const initialStatusId = 'initial-status';
|
|
54
53
|
const ariaDescribedBy = [descriptionId, selectMessageId, initialStatusId].filter(Boolean).join(' ');
|
|
55
54
|
const selectedOption = getSelectedOptionString(otherChildren);
|
|
56
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$q(this.props.
|
|
55
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$q(this.props.isOpen, this.props.disabled, this.props.hideLabel, this.props.state, this.props.compact, this.props.theme, !!this.props.slottedImagePath)));
|
|
57
56
|
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: buttonId, isRequired: this.props.required, isDisabled: this.props.disabled }), jsxs("button", { "aria-invalid": this.props.state === 'error' ? 'true' : null, type: "button", role: "combobox", id: buttonId, ...getComboboxAriaAttributes(this.props.isOpen, this.props.required, labelId, ariaDescribedBy, popoverId), disabled: this.props.disabled, children: [this.props.slottedImagePath && jsx("img", { src: this.props.slottedImagePath, alt: "" }), jsx("span", { children: selectedOption }), jsx(PIcon, { className: "icon", name: "arrow-head-down", theme: this.props.theme, color: this.props.disabled ? 'state-disabled' : 'primary', "aria-hidden": "true" })] }), jsx("div", { id: popoverId, popover: "manual", tabIndex: -1, ...getListAriaAttributes(this.props.label, this.props.required, false, this.props.isOpen), children: jsx("slot", {}) }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null }), jsx("span", { className: "sr-only", role: "status", "aria-live": "assertive", "aria-relevant": "additions text", children: this.props.srHighlightedOptionText })] })] }), this.props.children] }));
|
|
58
57
|
}
|
|
59
58
|
getSelectedOptionImagePath = (options) => {
|
|
@@ -21,7 +21,6 @@ export declare class DSRMultiSelect extends Component<any> {
|
|
|
21
21
|
private preventOptionUpdate;
|
|
22
22
|
private popoverElement;
|
|
23
23
|
private hasNativePopoverSupport;
|
|
24
|
-
private hasNativeCSSAnchorPositioningSupport;
|
|
25
24
|
private cleanUpAutoUpdate;
|
|
26
25
|
private get currentValue();
|
|
27
26
|
setFormValue(value: string[]): void;
|
|
@@ -7,7 +7,6 @@ export declare class DSRSelectWrapperDropdown extends Component<any> {
|
|
|
7
7
|
private inputOrButtonElement;
|
|
8
8
|
private popoverElement;
|
|
9
9
|
private hasNativePopoverSupport;
|
|
10
|
-
private hasNativeCSSAnchorPositioningSupport;
|
|
11
10
|
private cleanUpAutoUpdate;
|
|
12
11
|
private get selectedIndex();
|
|
13
12
|
render(): JSX.Element;
|
|
@@ -22,7 +22,6 @@ export declare class DSRSelect extends Component<any> {
|
|
|
22
22
|
private searchTimeout;
|
|
23
23
|
private slottedImagePath;
|
|
24
24
|
private hasNativePopoverSupport;
|
|
25
|
-
private hasNativeCSSAnchorPositioningSupport;
|
|
26
25
|
private cleanUpAutoUpdate;
|
|
27
26
|
formDisabledCallback(): void;
|
|
28
27
|
formStateRestoreCallback(): void;
|