@porsche-design-system/components-react 3.27.0-rc.5 → 3.27.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 +34 -0
- package/cjs/lib/components/carousel.wrapper.cjs +3 -3
- package/cjs/lib/components/table.wrapper.cjs +3 -3
- package/esm/lib/components/carousel.wrapper.d.ts +11 -3
- package/esm/lib/components/carousel.wrapper.mjs +3 -3
- package/esm/lib/components/table.wrapper.d.ts +17 -1
- package/esm/lib/components/table.wrapper.mjs +3 -3
- package/esm/lib/types.d.ts +13 -0
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +533 -790
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +42 -23
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/table.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +8 -14
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/optgroup.cjs +2 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper-dropdown.cjs +7 -8
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +15 -19
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.cjs +1 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +521 -778
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +40 -23
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/table.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +9 -15
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/optgroup.mjs +4 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pagination.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.mjs +6 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper-dropdown.mjs +9 -10
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +16 -20
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-cell.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.mjs +2 -2
- package/ssr/esm/lib/components/carousel.wrapper.d.ts +11 -3
- package/ssr/esm/lib/components/table.wrapper.d.ts +17 -1
- package/ssr/esm/lib/dsr-components/multi-select.d.ts +4 -4
- package/ssr/esm/lib/dsr-components/popover.d.ts +2 -2
- package/ssr/esm/lib/dsr-components/select-wrapper-dropdown.d.ts +4 -4
- package/ssr/esm/lib/dsr-components/select.d.ts +5 -6
- package/ssr/esm/lib/types.d.ts +13 -0
|
@@ -3879,16 +3879,6 @@ const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-des
|
|
|
3879
3879
|
// index.ts
|
|
3880
3880
|
var MODEL_SIGNATURES_MANIFEST = { "718": { "src": "718.493a9e3.svg", "width": 79, "height": 26 }, "911": { "src": "911.b68f913.svg", "width": 94, "height": 25 }, "boxster": { "src": "boxster.c321738.svg", "width": 239, "height": 26 }, "cayenne": { "src": "cayenne.2556201.svg", "width": 245, "height": 35 }, "cayman": { "src": "cayman.cc89196.svg", "width": 229, "height": 35 }, "macan": { "src": "macan.a1844f4.svg", "width": 196, "height": 26 }, "panamera": { "src": "panamera.6dae809.svg", "width": 260, "height": 25 }, "taycan": { "src": "taycan.df444c6.svg", "width": 167, "height": 36 }, "turbo-s": { "src": "turbo-s.73f1e10.svg", "width": 199, "height": 25 }, "turbo": { "src": "turbo.6a4084a.svg", "width": 143, "height": 25 } };
|
|
3881
3881
|
|
|
3882
|
-
const OPTION_HEIGHT = 40;
|
|
3883
|
-
const MULTI_SELECT_OPTION_HEIGHT = 44;
|
|
3884
|
-
const getNoResultsOptionJssStyle = () => ({
|
|
3885
|
-
'&[role=status]': {
|
|
3886
|
-
cursor: 'not-allowed',
|
|
3887
|
-
},
|
|
3888
|
-
// TODO: shouldn't be used here, instead use sr-only functional component and style
|
|
3889
|
-
'&__sr': getHiddenTextJssStyle(),
|
|
3890
|
-
});
|
|
3891
|
-
|
|
3892
3882
|
/**
|
|
3893
3883
|
* Applies a style only on Chromium based browsers by using a media query which is only supported there.
|
|
3894
3884
|
* https://browserstack.com/guide/create-browser-specific-css
|
|
@@ -3914,6 +3904,22 @@ const supportsNativePopover = () => {
|
|
|
3914
3904
|
// determine it once
|
|
3915
3905
|
supportsNativePopover();
|
|
3916
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
|
+
|
|
3917
3923
|
const hasDocument = typeof document !== 'undefined';
|
|
3918
3924
|
|
|
3919
3925
|
const isThemeAuto = (theme) => {
|
|
@@ -3938,6 +3944,8 @@ const formatObjectOutput = (value) => {
|
|
|
3938
3944
|
};
|
|
3939
3945
|
`value, ${formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '')}`;
|
|
3940
3946
|
|
|
3947
|
+
const OPTION_LIST_SAFE_ZONE = 6;
|
|
3948
|
+
|
|
3941
3949
|
const getComponentCss$1a = (size, compact, open, theme, sticky) => {
|
|
3942
3950
|
const { primaryColor, hoverColor, contrastLowColor, backgroundColor } = getThemedColors(theme);
|
|
3943
3951
|
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, contrastLowColor: contrastLowColorDark, backgroundColor: backgroundColorDark, } = getThemedColors('dark');
|
|
@@ -5091,7 +5099,7 @@ const getGradient$1 = (theme, gradientColorTheme) => {
|
|
|
5091
5099
|
`rgba(${gradientColor},0.3) 68%,` +
|
|
5092
5100
|
`rgba(${gradientColor},0)`);
|
|
5093
5101
|
};
|
|
5094
|
-
const getComponentCss$13 = (gradientColor, hasHeading, hasDescription, hasControlsSlot, headingSize, width, hasPagination, isInfinitePagination, alignHeader, theme, hasNavigation) => {
|
|
5102
|
+
const getComponentCss$13 = (gradientColor, hasHeading, hasDescription, hasControlsSlot, headingSize, width, hasPagination, isInfinitePagination, alignHeader, theme, hasNavigation, alignControls) => {
|
|
5095
5103
|
const { primaryColor, contrastMediumColor } = getThemedColors(theme);
|
|
5096
5104
|
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
|
|
5097
5105
|
const { canvasTextColor } = getHighContrastColors();
|
|
@@ -5121,13 +5129,14 @@ const getComponentCss$13 = (gradientColor, hasHeading, hasDescription, hasContro
|
|
|
5121
5129
|
...(hasControlsSlot && {
|
|
5122
5130
|
'slot[name="controls"]': {
|
|
5123
5131
|
display: 'block',
|
|
5124
|
-
|
|
5132
|
+
gridColumn: '1/-1',
|
|
5125
5133
|
gridRowStart: 3,
|
|
5126
5134
|
alignSelf: 'center', // ensures vertical alignment to prev/next buttons
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5135
|
+
justifySelf: alignControls !== 'auto' ? alignControls : isHeaderAlignCenter ? 'center' : 'start',
|
|
5136
|
+
[mediaQueryS]: {
|
|
5137
|
+
gridColumn: alignControls !== 'center' && hasNavigation ? '1/2' : '1/-1',
|
|
5138
|
+
justifySelf: alignControls !== 'auto' ? alignControls : isHeaderAlignCenter && !hasNavigation ? 'center' : 'start',
|
|
5139
|
+
},
|
|
5131
5140
|
},
|
|
5132
5141
|
}),
|
|
5133
5142
|
...addImportantToEachRule({
|
|
@@ -5214,9 +5223,6 @@ const getComponentCss$13 = (gradientColor, hasHeading, hasDescription, hasContro
|
|
|
5214
5223
|
// !important is necessary to override inline styles set by splide library
|
|
5215
5224
|
...addImportantToEachRule({
|
|
5216
5225
|
padding: `0 ${spacingMap[width].base}`,
|
|
5217
|
-
[getMediaQueryMax('xs')]: {
|
|
5218
|
-
paddingRight: `calc(${gridBasicOffsetBase} + ${gridGap})`, // we need to give cut off slides a bit more space on mobile views
|
|
5219
|
-
},
|
|
5220
5226
|
[mediaQueryS]: {
|
|
5221
5227
|
padding: `0 ${spacingMap[width].s}`,
|
|
5222
5228
|
},
|
|
@@ -8084,111 +8090,6 @@ const getComponentCss$E = (model, safeZone, size, color, theme) => {
|
|
|
8084
8090
|
});
|
|
8085
8091
|
};
|
|
8086
8092
|
|
|
8087
|
-
const cssVariableMultiSelectPaddingInlineStart = '--p-internal-multi-select-option-padding-left';
|
|
8088
|
-
const getComponentCss$D = (theme) => {
|
|
8089
|
-
const { primaryColor, contrastHighColor, backgroundSurfaceColor, disabledColor, contrastLowColor } = getThemedColors(theme);
|
|
8090
|
-
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, contrastHighColor: contrastHighColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, contrastLowColor: contrastLowColorDark, } = getThemedColors('dark');
|
|
8091
|
-
const { highlightColor } = getHighContrastColors();
|
|
8092
|
-
return getCss({
|
|
8093
|
-
'@global': {
|
|
8094
|
-
':host': addImportantToEachRule({
|
|
8095
|
-
scrollMarginTop: spacingStaticSmall, // Creates top margin when navigating with keyboard and list is scrolled automatically
|
|
8096
|
-
...hostHiddenStyles,
|
|
8097
|
-
}),
|
|
8098
|
-
...preventFoucOfNestedElementsStyles,
|
|
8099
|
-
},
|
|
8100
|
-
option: {
|
|
8101
|
-
display: 'flex',
|
|
8102
|
-
justifyContent: 'space-between',
|
|
8103
|
-
gap: '12px',
|
|
8104
|
-
padding: `${spacingStaticSmall} 12px`,
|
|
8105
|
-
paddingInlineStart: `var(${cssVariableMultiSelectPaddingInlineStart}, 12px)`,
|
|
8106
|
-
flex: `1 0 calc(${fontLineHeight} + ${spacingStaticSmall} * 2)`,
|
|
8107
|
-
color: contrastHighColor,
|
|
8108
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8109
|
-
color: contrastHighColorDark,
|
|
8110
|
-
}),
|
|
8111
|
-
cursor: 'pointer',
|
|
8112
|
-
textAlign: 'start',
|
|
8113
|
-
wordBreak: 'break-word',
|
|
8114
|
-
boxSizing: 'border-box',
|
|
8115
|
-
borderRadius: borderRadiusSmall,
|
|
8116
|
-
transition: `${getTransition('background-color')}, ${getTransition('color')}`,
|
|
8117
|
-
...getNoResultsOptionJssStyle(),
|
|
8118
|
-
...hoverMediaQuery({
|
|
8119
|
-
'&:not([aria-disabled]):not(.option--disabled):not([role=status]):hover': {
|
|
8120
|
-
color: isHighContrastMode ? highlightColor : primaryColor,
|
|
8121
|
-
background: contrastLowColor,
|
|
8122
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8123
|
-
color: isHighContrastMode ? highlightColor : primaryColorDark,
|
|
8124
|
-
background: contrastLowColorDark,
|
|
8125
|
-
}),
|
|
8126
|
-
},
|
|
8127
|
-
}),
|
|
8128
|
-
'&--selected': {
|
|
8129
|
-
background: backgroundSurfaceColor,
|
|
8130
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8131
|
-
background: backgroundSurfaceColorDark,
|
|
8132
|
-
}),
|
|
8133
|
-
},
|
|
8134
|
-
'&--highlighted': {
|
|
8135
|
-
background: contrastLowColor,
|
|
8136
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8137
|
-
background: contrastLowColorDark,
|
|
8138
|
-
}),
|
|
8139
|
-
},
|
|
8140
|
-
'&--highlighted, &--selected': {
|
|
8141
|
-
color: isHighContrastMode ? highlightColor : primaryColor,
|
|
8142
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8143
|
-
color: isHighContrastMode ? highlightColor : primaryColorDark,
|
|
8144
|
-
}),
|
|
8145
|
-
},
|
|
8146
|
-
'&--disabled': {
|
|
8147
|
-
cursor: 'not-allowed',
|
|
8148
|
-
color: disabledColor,
|
|
8149
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8150
|
-
color: disabledColorDark,
|
|
8151
|
-
}),
|
|
8152
|
-
},
|
|
8153
|
-
'&--hidden': {
|
|
8154
|
-
display: 'none',
|
|
8155
|
-
},
|
|
8156
|
-
},
|
|
8157
|
-
checkbox: {
|
|
8158
|
-
pointerEvents: 'none', // Avoid checkbox label click which updates input within p-checkbox-wrapper
|
|
8159
|
-
},
|
|
8160
|
-
});
|
|
8161
|
-
};
|
|
8162
|
-
|
|
8163
|
-
/**
|
|
8164
|
-
* Generates placeholder styles for an input element.
|
|
8165
|
-
*
|
|
8166
|
-
* @param {JssStyle} styles - The styles to apply to the placeholder.
|
|
8167
|
-
* @returns {JssStyle} - The generated placeholder styles.
|
|
8168
|
-
*/
|
|
8169
|
-
const getPlaceholderJssStyle = (styles) => ({
|
|
8170
|
-
'&::placeholder': styles,
|
|
8171
|
-
'&::-webkit-input-placeholder': styles /* Chrome/Opera/Safari */,
|
|
8172
|
-
'&::-moz-placeholder': styles /* Firefox 19+ */,
|
|
8173
|
-
'&:-moz-placeholder': styles /* Firefox 18- */,
|
|
8174
|
-
});
|
|
8175
|
-
|
|
8176
|
-
// Used for elements that must overflow `overflow:hidden` containers, are positioned absolute and wrapped within a native `popover` element.
|
|
8177
|
-
const getPopoverResetJssStyle = () => {
|
|
8178
|
-
return {
|
|
8179
|
-
position: 'absolute',
|
|
8180
|
-
border: 'none',
|
|
8181
|
-
background: 'none',
|
|
8182
|
-
pointerEvents: 'all',
|
|
8183
|
-
padding: 0,
|
|
8184
|
-
margin: 0,
|
|
8185
|
-
overflow: 'initial',
|
|
8186
|
-
'&:-internal-popover-in-top-layer::backdrop': {
|
|
8187
|
-
display: 'none',
|
|
8188
|
-
},
|
|
8189
|
-
};
|
|
8190
|
-
};
|
|
8191
|
-
|
|
8192
8093
|
const getSlottedTextFieldTextareaSelectStyles = (child, state, isLoading, theme, additionalDefaultJssStyle) => {
|
|
8193
8094
|
const { primaryColor, contrastLowColor, contrastMediumColor, disabledColor } = getThemedColors(theme);
|
|
8194
8095
|
const { primaryColor: primaryColorDark, contrastLowColor: contrastLowColorDark, contrastMediumColor: contrastMediumColorDark, disabledColor: disabledColorDark, } = getThemedColors('dark');
|
|
@@ -8304,332 +8205,424 @@ const getUnitCounterJssStyle = (isDisabled, isReadonly, theme) => {
|
|
|
8304
8205
|
};
|
|
8305
8206
|
};
|
|
8306
8207
|
|
|
8307
|
-
const
|
|
8308
|
-
const
|
|
8309
|
-
const
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
display: 'block',
|
|
8314
|
-
...addImportantToEachRule({
|
|
8315
|
-
...colorSchemeStyles,
|
|
8316
|
-
...hostHiddenStyles,
|
|
8317
|
-
}),
|
|
8318
|
-
},
|
|
8319
|
-
...preventFoucOfNestedElementsStyles,
|
|
8320
|
-
// TODO: re-use select-wrapper-style
|
|
8321
|
-
input: getInputStyles(isDisabled, direction, isOpen, state, theme),
|
|
8322
|
-
},
|
|
8323
|
-
root: {
|
|
8324
|
-
display: 'grid',
|
|
8325
|
-
gap: spacingStaticXSmall,
|
|
8326
|
-
// min width is needed for showing at least 1 character in very narrow containers. The "1rem" value is the minimum safe zone to show at least 1 character plus the ellipsis dots.
|
|
8327
|
-
minWidth: `calc(1rem + ${formElementPaddingHorizontal} + ${borderWidthBase} * 2 + ${getCalculatedFormElementPaddingHorizontal(2)})`,
|
|
8328
|
-
},
|
|
8329
|
-
wrapper: {
|
|
8330
|
-
position: 'relative',
|
|
8331
|
-
display: 'grid',
|
|
8332
|
-
gridTemplateColumns: `minmax(0, 1fr) auto auto ${formElementLayeredSafeZone}`,
|
|
8333
|
-
},
|
|
8334
|
-
// TODO: extract for multi-select, select-wrapper and text-field (not gridArea and placeSelf)
|
|
8335
|
-
icon: {
|
|
8336
|
-
gridArea: '1/3',
|
|
8337
|
-
placeSelf: 'center',
|
|
8338
|
-
padding: formButtonOrIconPadding,
|
|
8339
|
-
pointerEvents: 'none',
|
|
8340
|
-
transform: 'rotate3d(0,0,1,0.0001deg)', // needs to be a little more than 0 for correct direction in safari
|
|
8341
|
-
transition: getTransition('transform'),
|
|
8342
|
-
'&--rotate': {
|
|
8343
|
-
transform: 'rotate3d(0,0,1,180deg)',
|
|
8344
|
-
},
|
|
8345
|
-
},
|
|
8346
|
-
// TODO: extract for multi-select, select-wrapper and text-field (not gridArea and placeSelf)
|
|
8347
|
-
button: {
|
|
8348
|
-
gridArea: '1/2',
|
|
8349
|
-
placeSelf: 'center',
|
|
8350
|
-
padding: formButtonOrIconPadding,
|
|
8351
|
-
},
|
|
8352
|
-
listbox: getListStyles$2(isOpen, direction, theme),
|
|
8353
|
-
// TODO: extract (maybe even as functional component) and re-use in multi-select and select-wrapper
|
|
8354
|
-
'no-results': {
|
|
8355
|
-
padding: `${spacingStaticSmall} 12px`,
|
|
8356
|
-
boxSizing: 'border-box',
|
|
8357
|
-
color: contrastHighColor,
|
|
8358
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8359
|
-
color: contrastHighColorDark,
|
|
8360
|
-
}),
|
|
8361
|
-
...getNoResultsOptionJssStyle(),
|
|
8362
|
-
},
|
|
8363
|
-
// TODO: maybe we should extract it as functional component too
|
|
8364
|
-
'sr-only': getHiddenTextJssStyle(),
|
|
8365
|
-
// .label / .required
|
|
8366
|
-
...getFunctionalComponentLabelStyles(isDisabled, hideLabel, theme),
|
|
8367
|
-
// .message
|
|
8368
|
-
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
8369
|
-
...(isNativePopoverCase && {
|
|
8370
|
-
popover: {
|
|
8371
|
-
...getPopoverResetJssStyle(),
|
|
8372
|
-
},
|
|
8373
|
-
}),
|
|
8374
|
-
});
|
|
8375
|
-
};
|
|
8376
|
-
// TODO: use getSlottedTextFieldTextareaSelectStyles() instead an manipulate selectors like done with PIN Code or even better make it configurable as parameter
|
|
8377
|
-
const getInputStyles = (isDisabled, direction, isOpen, state, theme) => {
|
|
8378
|
-
const { primaryColor, disabledColor, backgroundColor, contrastMediumColor } = getThemedColors(theme);
|
|
8379
|
-
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, backgroundColor: backgroundColorDark, contrastMediumColor: contrastMediumColorDark, } = getThemedColors('dark');
|
|
8208
|
+
const getButtonJssStyle = (componentName, isOpen, isDisabled, state, hasSlottedImage, anchorName, cssVarScaling, theme) => {
|
|
8209
|
+
const cssVarBackgroundColor = `--p-${componentName}-background-color`;
|
|
8210
|
+
const cssVarTextColor = `--p-${componentName}-text-color`;
|
|
8211
|
+
const cssVarBorderColor = `--p-${componentName}-border-color`;
|
|
8212
|
+
const { backgroundColor, primaryColor, disabledColor, contrastMediumColor } = getThemedColors(theme);
|
|
8213
|
+
const { backgroundColor: backgroundColorDark, primaryColor: primaryColorDark, disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark, } = getThemedColors('dark');
|
|
8380
8214
|
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
8381
8215
|
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
8382
8216
|
return {
|
|
8383
|
-
|
|
8384
|
-
|
|
8217
|
+
all: 'unset',
|
|
8218
|
+
...(getHasCSSAnchorPositioningSupport() && {
|
|
8219
|
+
anchorName,
|
|
8220
|
+
}),
|
|
8221
|
+
display: 'grid',
|
|
8222
|
+
gridTemplateColumns: `${hasSlottedImage ? 'auto ' : ''}minmax(0, 1fr) auto`,
|
|
8223
|
+
alignItems: 'center',
|
|
8224
|
+
gap: `max(4px, ${cssVarScaling} * 12px)`,
|
|
8225
|
+
padding: `max(2px, ${cssVarScaling} * ${formElementPaddingVertical}) max(4px, ${cssVarScaling} * ${formElementPaddingHorizontal})`,
|
|
8385
8226
|
minWidth: 0,
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
font: textSmallStyle.font
|
|
8389
|
-
|
|
8390
|
-
padding: `${formElementPaddingVertical} ${formElementPaddingHorizontal}`,
|
|
8391
|
-
paddingInlineEnd: getCalculatedFormElementPaddingHorizontal(2),
|
|
8392
|
-
boxSizing: 'border-box',
|
|
8393
|
-
outline: 0,
|
|
8394
|
-
WebkitAppearance: 'none', // iOS safari
|
|
8395
|
-
appearance: 'none',
|
|
8396
|
-
...textSmallStyle,
|
|
8397
|
-
textOverflow: 'ellipsis',
|
|
8398
|
-
'&:disabled': {
|
|
8399
|
-
cursor: 'not-allowed',
|
|
8400
|
-
},
|
|
8227
|
+
height: `max(${fontLineHeight}, ${cssVarScaling} * (${fontLineHeight} + 10px))`,
|
|
8228
|
+
boxSizing: 'content-box', // ensures height calculation is based on content, not including padding
|
|
8229
|
+
font: textSmallStyle.font,
|
|
8230
|
+
cursor: 'pointer',
|
|
8401
8231
|
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
|
|
8402
|
-
color: primaryColor
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
...prefersColorSchemeDarkMediaQuery(theme, getPlaceholderJssStyle({ color: primaryColorDark, opacity: 1 })),
|
|
8406
|
-
}, // Opacity fixes placeholder being shown lighter in firefox
|
|
8407
|
-
...hoverMediaQuery({
|
|
8408
|
-
'&:hover:not(:disabled):not(:focus),label:hover~.wrapper &:not(:disabled):not(:focus)': {
|
|
8409
|
-
borderColor: isOpen ? primaryColor : formStateHoverColor || primaryColor,
|
|
8410
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8411
|
-
borderColor: isOpen ? primaryColorDark : formStateHoverColorDark || primaryColorDark,
|
|
8412
|
-
}),
|
|
8413
|
-
},
|
|
8414
|
-
}),
|
|
8415
|
-
...(!isDisabled && {
|
|
8416
|
-
// TODO: getFocusJssStyle() can't be re-used because focus style differs for form elements
|
|
8417
|
-
'&:focus': {
|
|
8418
|
-
borderColor: primaryColor,
|
|
8419
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8420
|
-
borderColor: primaryColorDark,
|
|
8421
|
-
}),
|
|
8422
|
-
},
|
|
8423
|
-
}),
|
|
8424
|
-
background: backgroundColor,
|
|
8425
|
-
border: `${borderWidthBase} solid ${isOpen ? primaryColor : formStateColor || contrastMediumColor}`,
|
|
8232
|
+
color: `var(${cssVarTextColor}, ${primaryColor})`,
|
|
8233
|
+
background: `var(${cssVarBackgroundColor}, ${backgroundColor})`,
|
|
8234
|
+
border: `${borderWidthBase} solid var(${cssVarBorderColor}, ${isOpen ? primaryColor : formStateColor || contrastMediumColor})`,
|
|
8426
8235
|
borderRadius: borderRadiusSmall,
|
|
8427
|
-
...(isOpen && {
|
|
8428
|
-
['paddingBottom' ]: `calc(${formElementPaddingVertical} + 1px)`, // Add padding to keep same height when border changes
|
|
8429
|
-
['borderBottom' ]: addImportantToRule(`1px solid ${contrastMediumColor}`),
|
|
8430
|
-
['borderBottomLeftRadius' ]: 0,
|
|
8431
|
-
['borderBottomRightRadius' ]: 0,
|
|
8432
|
-
}),
|
|
8433
8236
|
...(isDisabled && {
|
|
8434
|
-
...getPlaceholderJssStyle({ color: disabledColor }),
|
|
8435
8237
|
cursor: 'not-allowed',
|
|
8436
8238
|
color: disabledColor,
|
|
8437
8239
|
borderColor: disabledColor,
|
|
8438
|
-
WebkitTextFillColor: disabledColor,
|
|
8439
8240
|
}),
|
|
8440
8241
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8441
|
-
color: primaryColorDark
|
|
8442
|
-
background: backgroundColorDark
|
|
8443
|
-
border: `${borderWidthBase} solid ${isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark}`,
|
|
8444
|
-
...(isOpen && {
|
|
8445
|
-
['borderBottom' ]: addImportantToRule(`1px solid ${contrastMediumColorDark}`),
|
|
8446
|
-
}),
|
|
8242
|
+
color: `var(${cssVarTextColor}, ${primaryColorDark})`,
|
|
8243
|
+
background: `var(${cssVarBackgroundColor}, ${backgroundColorDark})`,
|
|
8244
|
+
border: `${borderWidthBase} solid var(${cssVarBorderColor}, ${isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark})`,
|
|
8447
8245
|
...(isDisabled && {
|
|
8448
|
-
...getPlaceholderJssStyle({ color: disabledColorDark }),
|
|
8449
8246
|
color: disabledColorDark,
|
|
8450
8247
|
borderColor: disabledColorDark,
|
|
8451
|
-
WebkitTextFillColor: disabledColorDark,
|
|
8452
8248
|
}),
|
|
8453
8249
|
}),
|
|
8250
|
+
...(!isDisabled && {
|
|
8251
|
+
...hoverMediaQuery({
|
|
8252
|
+
'&:hover,label:hover~&': {
|
|
8253
|
+
borderColor: `var(${cssVarBorderColor}, ${isOpen ? primaryColor : formStateHoverColor || primaryColor})`,
|
|
8254
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8255
|
+
borderColor: `var(${cssVarBorderColor}, ${isOpen ? primaryColorDark : formStateHoverColorDark || primaryColorDark})`,
|
|
8256
|
+
}),
|
|
8257
|
+
},
|
|
8258
|
+
}),
|
|
8259
|
+
...getFocusJssStyle(theme),
|
|
8260
|
+
}),
|
|
8454
8261
|
};
|
|
8455
8262
|
};
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8263
|
+
|
|
8264
|
+
const getButtonImageJssStyle = {
|
|
8265
|
+
font: `${fontSizeTextSmall} ${fontFamily}`, // needed for correct calculations based on ex-unit
|
|
8266
|
+
width: 'auto',
|
|
8267
|
+
height: fontLineHeight,
|
|
8268
|
+
borderRadius: borderRadiusSmall,
|
|
8269
|
+
};
|
|
8270
|
+
|
|
8271
|
+
const getButtonLabelJssStyle = {
|
|
8272
|
+
overflow: 'hidden',
|
|
8273
|
+
textOverflow: 'ellipsis',
|
|
8274
|
+
whiteSpace: 'nowrap',
|
|
8275
|
+
};
|
|
8276
|
+
|
|
8277
|
+
const getIconJssStyle = (componentName, isOpen) => {
|
|
8278
|
+
const cssVarIconFilter = `--p-${componentName}-icon-filter`;
|
|
8459
8279
|
return {
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
...textSmallStyle,
|
|
8467
|
-
zIndex: 10,
|
|
8468
|
-
left: 0,
|
|
8469
|
-
right: 0,
|
|
8470
|
-
['top' ]: '100%',
|
|
8471
|
-
boxSizing: 'border-box',
|
|
8472
|
-
maxHeight: `${8.5 * (MULTI_SELECT_OPTION_HEIGHT + 8) + 6 + 2}px`, // 8.5 options * option height + 8px gap + additional spacing (6px = padding, 2px = border)
|
|
8473
|
-
overflowY: 'auto',
|
|
8474
|
-
WebkitOverflowScrolling: 'touch',
|
|
8475
|
-
background: backgroundColor,
|
|
8476
|
-
border: `2px solid ${primaryColor}`,
|
|
8477
|
-
['borderTop' ]: 'none',
|
|
8478
|
-
borderRadius: borderRadiusSmall,
|
|
8479
|
-
['borderTopLeftRadius' ]: 0,
|
|
8480
|
-
['borderTopRightRadius' ]: 0,
|
|
8481
|
-
scrollbarWidth: 'thin', // firefox
|
|
8482
|
-
scrollbarColor: 'auto', // firefox
|
|
8483
|
-
transition: getTransition('border-color'),
|
|
8484
|
-
transform: 'translate3d(0,0,0)', // fix iOS bug if less than 5 items are displayed
|
|
8485
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8486
|
-
background: backgroundColorDark,
|
|
8487
|
-
borderColor: primaryColorDark,
|
|
8280
|
+
marginInlineEnd: '-3px', // to temporarily align with multi-select and select-wrapper
|
|
8281
|
+
pointerEvents: 'none',
|
|
8282
|
+
transform: `rotate3d(0,0,1,${isOpen ? '180' : '0.0001'}deg)`, // needs to be a little more than 0 for correct direction in safari
|
|
8283
|
+
transition: getTransition('transform'),
|
|
8284
|
+
...(!isHighContrastMode && {
|
|
8285
|
+
filter: `var(${cssVarIconFilter})`,
|
|
8488
8286
|
}),
|
|
8489
8287
|
};
|
|
8490
8288
|
};
|
|
8491
8289
|
|
|
8492
|
-
const
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
},
|
|
8505
|
-
'::slotted(img)': {
|
|
8506
|
-
height: fontLineHeight,
|
|
8507
|
-
borderRadius: borderRadiusSmall,
|
|
8508
|
-
width: 'auto',
|
|
8509
|
-
},
|
|
8510
|
-
}),
|
|
8511
|
-
...preventFoucOfNestedElementsStyles,
|
|
8512
|
-
},
|
|
8513
|
-
...getOptionStyles(theme),
|
|
8514
|
-
icon: {
|
|
8515
|
-
marginInlineStart: 'auto',
|
|
8516
|
-
},
|
|
8517
|
-
});
|
|
8518
|
-
};
|
|
8519
|
-
// TODO: Copied from multi-select and select-wrapper-dropdown, extract and reuse
|
|
8520
|
-
const getOptionStyles = (theme) => {
|
|
8521
|
-
const { primaryColor: primaryColorDark, contrastHighColor: contrastHighColorDark, disabledColor: disabledColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, contrastLowColor: contrastLowColorDark, } = getThemedColors('dark');
|
|
8522
|
-
const { primaryColor, contrastHighColor, backgroundSurfaceColor, disabledColor, contrastLowColor } = getThemedColors(theme);
|
|
8290
|
+
const getNoResultsOptionJssStyle = () => ({
|
|
8291
|
+
'&[role=status]': {
|
|
8292
|
+
cursor: 'not-allowed',
|
|
8293
|
+
},
|
|
8294
|
+
// TODO: shouldn't be used here, instead use sr-only functional component and style
|
|
8295
|
+
'&__sr': getHiddenTextJssStyle(),
|
|
8296
|
+
});
|
|
8297
|
+
|
|
8298
|
+
const getOptionJssStyle = (componentName, cssVarScaling, // "1" is needed for components not yet supporting compact mode
|
|
8299
|
+
theme) => {
|
|
8300
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, contrastHighColor: contrastHighColorDark, disabledColor: disabledColorDark, contrastLowColor: contrastLowColorDark, } = getThemedColors('dark');
|
|
8301
|
+
const { primaryColor, hoverColor, contrastLowColor, contrastHighColor, disabledColor } = getThemedColors(theme);
|
|
8523
8302
|
const { highlightColor } = getHighContrastColors();
|
|
8524
|
-
const gap = `max(4px, ${
|
|
8525
|
-
const paddingBlock = `max(2px, ${
|
|
8526
|
-
const paddingInline = `max(4px, ${
|
|
8303
|
+
const gap = `max(4px, ${cssVarScaling} * 12px)`;
|
|
8304
|
+
const paddingBlock = `max(2px, ${cssVarScaling} * ${spacingStaticSmall})`;
|
|
8305
|
+
const paddingInline = `max(4px, ${cssVarScaling} * var(--p-internal-${componentName}-padding-left, 12px)) max(4px, ${cssVarScaling} * 12px)`;
|
|
8527
8306
|
return {
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
background: contrastLowColor,
|
|
8550
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8551
|
-
color: isHighContrastMode ? highlightColor : primaryColorDark,
|
|
8552
|
-
background: contrastLowColorDark,
|
|
8553
|
-
}),
|
|
8554
|
-
},
|
|
8555
|
-
}),
|
|
8556
|
-
'&--selected': {
|
|
8557
|
-
cursor: 'default',
|
|
8558
|
-
pointerEvents: 'none',
|
|
8559
|
-
background: backgroundSurfaceColor,
|
|
8307
|
+
display: 'flex',
|
|
8308
|
+
gap,
|
|
8309
|
+
paddingBlock,
|
|
8310
|
+
paddingInline,
|
|
8311
|
+
minHeight: fontLineHeight, // preserves height for empty option
|
|
8312
|
+
...textSmallStyle,
|
|
8313
|
+
color: contrastHighColor,
|
|
8314
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8315
|
+
color: contrastHighColorDark,
|
|
8316
|
+
}),
|
|
8317
|
+
cursor: 'pointer',
|
|
8318
|
+
textAlign: 'start',
|
|
8319
|
+
wordBreak: 'break-word',
|
|
8320
|
+
boxSizing: 'content-box',
|
|
8321
|
+
borderRadius: borderRadiusSmall,
|
|
8322
|
+
transition: `${getTransition('background-color')}, ${getTransition('color')}`,
|
|
8323
|
+
...getNoResultsOptionJssStyle(),
|
|
8324
|
+
...hoverMediaQuery({
|
|
8325
|
+
'&:not([aria-disabled]):not(.option--disabled):not([role=status]):hover': {
|
|
8326
|
+
color: isHighContrastMode ? highlightColor : primaryColor,
|
|
8327
|
+
background: hoverColor,
|
|
8560
8328
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8561
|
-
|
|
8329
|
+
color: isHighContrastMode ? highlightColor : primaryColorDark,
|
|
8330
|
+
background: hoverColorDark,
|
|
8562
8331
|
}),
|
|
8563
8332
|
},
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8333
|
+
}),
|
|
8334
|
+
'&--selected': {
|
|
8335
|
+
...(componentName === 'select-option' && {
|
|
8336
|
+
cursor: 'default',
|
|
8337
|
+
pointerEvents: 'none',
|
|
8338
|
+
}),
|
|
8339
|
+
background: hoverColor,
|
|
8340
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8341
|
+
background: hoverColorDark,
|
|
8342
|
+
}),
|
|
8343
|
+
},
|
|
8344
|
+
'&--highlighted': {
|
|
8345
|
+
background: contrastLowColor,
|
|
8346
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8347
|
+
background: contrastLowColorDark,
|
|
8348
|
+
}),
|
|
8349
|
+
},
|
|
8350
|
+
'&--highlighted, &--selected': {
|
|
8351
|
+
color: isHighContrastMode ? highlightColor : primaryColor,
|
|
8352
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8353
|
+
color: isHighContrastMode ? highlightColor : primaryColorDark,
|
|
8354
|
+
}),
|
|
8355
|
+
},
|
|
8356
|
+
'&--disabled': {
|
|
8357
|
+
cursor: 'not-allowed',
|
|
8358
|
+
color: disabledColor,
|
|
8359
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8360
|
+
color: disabledColorDark,
|
|
8361
|
+
}),
|
|
8362
|
+
},
|
|
8363
|
+
'&--hidden': {
|
|
8364
|
+
display: 'none',
|
|
8365
|
+
},
|
|
8366
|
+
};
|
|
8367
|
+
};
|
|
8368
|
+
|
|
8369
|
+
const keyframesName = 'fade-in';
|
|
8370
|
+
const getPopoverKeyframesStyles = {
|
|
8371
|
+
[`@keyframes ${keyframesName}`]: {
|
|
8372
|
+
from: {
|
|
8373
|
+
opacity: 0,
|
|
8374
|
+
},
|
|
8375
|
+
to: {
|
|
8376
|
+
opacity: 1,
|
|
8377
|
+
},
|
|
8378
|
+
},
|
|
8379
|
+
};
|
|
8380
|
+
const getPopoverJssStyle = (isOpen, direction, anchorName, cssVarScaling, // "1" is needed for components not yet supporting compact mode
|
|
8381
|
+
optionHeight, theme) => {
|
|
8382
|
+
const { contrastLowColor, backgroundColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
8383
|
+
const { contrastLowColor: contrastLowColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark } = getThemedColors('dark');
|
|
8384
|
+
const minHeightOptionList = `calc(${4.5 * (optionHeight + 8) + 6 + 2}px)`; // 4.5 options * option height + 8px gap + additional spacing (6px = padding, 2px = border)
|
|
8385
|
+
return {
|
|
8386
|
+
all: 'unset',
|
|
8387
|
+
position: 'absolute',
|
|
8388
|
+
zIndex: 99, // needed for backwards compatibility, to enable browsers not supporting #top-layer
|
|
8389
|
+
padding: `max(2px, ${cssVarScaling} * 6px)`,
|
|
8390
|
+
display: isOpen ? 'flex' : 'none', // needed for backwards compatibility, otherwise 'flex' would be enough
|
|
8391
|
+
flexDirection: 'column',
|
|
8392
|
+
gap: `max(2px, ${cssVarScaling} * ${spacingStaticSmall})`,
|
|
8393
|
+
maxHeight: `max(${minHeightOptionList}, calc(50vh - 54px / 2 - ${OPTION_LIST_SAFE_ZONE}px * 2))`,
|
|
8394
|
+
boxSizing: 'border-box',
|
|
8395
|
+
overflow: 'hidden auto',
|
|
8396
|
+
scrollbarWidth: 'thin', // firefox
|
|
8397
|
+
scrollbarColor: 'auto', // firefox
|
|
8398
|
+
animation: `var(${cssVariableAnimationDuration}, ${motionDurationShort}) ${keyframesName} ${motionEasingBase} forwards`,
|
|
8399
|
+
filter: 'drop-shadow(0 0 8px rgba(0,0,0,0.15))',
|
|
8400
|
+
background: isThemeDark(theme) ? backgroundSurfaceColor : backgroundColor,
|
|
8401
|
+
border: `1px solid ${contrastLowColor}`,
|
|
8402
|
+
borderRadius: borderRadiusMedium,
|
|
8403
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8404
|
+
background: backgroundSurfaceColorDark,
|
|
8405
|
+
borderColor: contrastLowColorDark,
|
|
8406
|
+
}),
|
|
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
|
+
'&:not(:popover-open)': {
|
|
8418
|
+
display: 'none',
|
|
8419
|
+
},
|
|
8420
|
+
};
|
|
8421
|
+
};
|
|
8422
|
+
|
|
8423
|
+
const getComponentCss$D = (theme) => {
|
|
8424
|
+
return getCss({
|
|
8425
|
+
'@global': {
|
|
8426
|
+
':host': {
|
|
8427
|
+
display: 'block',
|
|
8428
|
+
...addImportantToEachRule({
|
|
8429
|
+
scrollMargin: '6px', // Aligns option when list is scrolled by navigating with keyboard
|
|
8430
|
+
...hostHiddenStyles,
|
|
8568
8431
|
}),
|
|
8569
8432
|
},
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8433
|
+
...preventFoucOfNestedElementsStyles,
|
|
8434
|
+
},
|
|
8435
|
+
option: getOptionJssStyle('multi-select-option', 1, theme),
|
|
8436
|
+
checkbox: {
|
|
8437
|
+
pointerEvents: 'none', // Avoid checkbox label click which updates input within p-checkbox-wrapper
|
|
8438
|
+
},
|
|
8439
|
+
});
|
|
8440
|
+
};
|
|
8441
|
+
|
|
8442
|
+
/**
|
|
8443
|
+
* Generates placeholder styles for an input element.
|
|
8444
|
+
*
|
|
8445
|
+
* @param {JssStyle} styles - The styles to apply to the placeholder.
|
|
8446
|
+
* @returns {JssStyle} - The generated placeholder styles.
|
|
8447
|
+
*/
|
|
8448
|
+
const getPlaceholderJssStyle = (styles) => ({
|
|
8449
|
+
'&::placeholder': styles,
|
|
8450
|
+
'&::-webkit-input-placeholder': styles /* Chrome/Opera/Safari */,
|
|
8451
|
+
'&::-moz-placeholder': styles /* Firefox 19+ */,
|
|
8452
|
+
'&:-moz-placeholder': styles /* Firefox 18- */,
|
|
8453
|
+
});
|
|
8454
|
+
|
|
8455
|
+
const anchorName$2 = '--anchor-multi-select';
|
|
8456
|
+
const getComponentCss$C = (direction, isOpen, isDisabled, hideLabel, state, hasNativeCSSAnchorPositioningSupport, theme) => {
|
|
8457
|
+
const { primaryColor, disabledColor, contrastHighColor, contrastMediumColor, backgroundColor } = getThemedColors(theme);
|
|
8458
|
+
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark, contrastHighColor: contrastHighColorDark, backgroundColor: backgroundColorDark, } = getThemedColors('dark');
|
|
8459
|
+
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
8460
|
+
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
8461
|
+
return getCss({
|
|
8462
|
+
'@global': {
|
|
8463
|
+
// @keyframes fade-in
|
|
8464
|
+
...getPopoverKeyframesStyles,
|
|
8465
|
+
':host': {
|
|
8466
|
+
display: 'block',
|
|
8467
|
+
...addImportantToEachRule({
|
|
8468
|
+
...colorSchemeStyles,
|
|
8469
|
+
...hostHiddenStyles,
|
|
8574
8470
|
}),
|
|
8575
8471
|
},
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8472
|
+
...preventFoucOfNestedElementsStyles,
|
|
8473
|
+
input: {
|
|
8474
|
+
gridArea: '1/1/1/-1',
|
|
8475
|
+
flex: 1,
|
|
8476
|
+
minWidth: 0,
|
|
8477
|
+
height: `calc(${fontLineHeight} + 10px + ${borderWidthBase} * 2 + ${spacingStaticSmall} * 2)`, // we need 10px additionally so input height becomes 54px, // we need 6px additionally so input height becomes 50px
|
|
8478
|
+
font: textSmallStyle.font.replace('ex', 'ex + 6px'), // a minimum line-height is needed for input, otherwise value is scrollable in Chrome, +6px is alig
|
|
8479
|
+
margin: 0, // necessary reset for iOS Safari 15 (and maybe other browsers)
|
|
8480
|
+
padding: `${formElementPaddingVertical} ${formElementPaddingHorizontal}`,
|
|
8481
|
+
paddingInlineEnd: getCalculatedFormElementPaddingHorizontal(2),
|
|
8482
|
+
boxSizing: 'border-box',
|
|
8483
|
+
outline: 0,
|
|
8484
|
+
WebkitAppearance: 'none', // iOS safari
|
|
8485
|
+
appearance: 'none',
|
|
8486
|
+
...textSmallStyle,
|
|
8487
|
+
textOverflow: 'ellipsis',
|
|
8488
|
+
'&:disabled': {
|
|
8489
|
+
cursor: 'not-allowed',
|
|
8490
|
+
},
|
|
8491
|
+
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
|
|
8492
|
+
color: primaryColor,
|
|
8493
|
+
'&:not(:focus)': {
|
|
8494
|
+
...getPlaceholderJssStyle({ color: primaryColor, opacity: 1 }),
|
|
8495
|
+
...prefersColorSchemeDarkMediaQuery(theme, getPlaceholderJssStyle({ color: primaryColorDark, opacity: 1 })),
|
|
8496
|
+
}, // Opacity fixes placeholder being shown lighter in firefox
|
|
8497
|
+
...hoverMediaQuery({
|
|
8498
|
+
'&:hover:not(:disabled):not(:focus),label:hover~.wrapper &:not(:disabled):not(:focus)': {
|
|
8499
|
+
borderColor: isOpen ? primaryColor : formStateHoverColor || primaryColor,
|
|
8500
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8501
|
+
borderColor: isOpen ? primaryColorDark : formStateHoverColorDark || primaryColorDark,
|
|
8502
|
+
}),
|
|
8503
|
+
},
|
|
8504
|
+
}),
|
|
8505
|
+
...(!isDisabled && {
|
|
8506
|
+
'&:focus': {
|
|
8507
|
+
borderColor: primaryColor,
|
|
8508
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8509
|
+
borderColor: primaryColorDark,
|
|
8510
|
+
}),
|
|
8511
|
+
},
|
|
8512
|
+
}),
|
|
8513
|
+
background: backgroundColor,
|
|
8514
|
+
border: `${borderWidthBase} solid ${isOpen ? primaryColor : formStateColor || contrastMediumColor}`,
|
|
8515
|
+
borderRadius: borderRadiusSmall,
|
|
8516
|
+
...(isDisabled && {
|
|
8517
|
+
...getPlaceholderJssStyle({ color: disabledColor }),
|
|
8518
|
+
cursor: 'not-allowed',
|
|
8519
|
+
color: disabledColor,
|
|
8520
|
+
borderColor: disabledColor,
|
|
8521
|
+
WebkitTextFillColor: disabledColor,
|
|
8522
|
+
}),
|
|
8579
8523
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8580
|
-
color:
|
|
8524
|
+
color: primaryColorDark,
|
|
8525
|
+
background: backgroundColorDark,
|
|
8526
|
+
border: `${borderWidthBase} solid ${isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark}`,
|
|
8527
|
+
...(isDisabled && {
|
|
8528
|
+
...getPlaceholderJssStyle({ color: disabledColorDark }),
|
|
8529
|
+
color: disabledColorDark,
|
|
8530
|
+
borderColor: disabledColorDark,
|
|
8531
|
+
WebkitTextFillColor: disabledColorDark,
|
|
8532
|
+
}),
|
|
8533
|
+
}),
|
|
8534
|
+
...(hasNativeCSSAnchorPositioningSupport && {
|
|
8535
|
+
anchorName: anchorName$2,
|
|
8581
8536
|
}),
|
|
8582
8537
|
},
|
|
8583
|
-
'
|
|
8584
|
-
|
|
8538
|
+
'[popover]': getPopoverJssStyle(isOpen, direction, anchorName$2, 1, 44, theme),
|
|
8539
|
+
},
|
|
8540
|
+
root: {
|
|
8541
|
+
display: 'grid',
|
|
8542
|
+
gap: spacingStaticXSmall,
|
|
8543
|
+
// min width is needed for showing at least 1 character in very narrow containers. The "1rem" value is the minimum safe zone to show at least 1 character plus the ellipsis dots.
|
|
8544
|
+
minWidth: `calc(1rem + ${formElementPaddingHorizontal} + ${borderWidthBase} * 2 + ${getCalculatedFormElementPaddingHorizontal(2)})`,
|
|
8545
|
+
},
|
|
8546
|
+
wrapper: {
|
|
8547
|
+
position: 'relative',
|
|
8548
|
+
display: 'grid',
|
|
8549
|
+
gridTemplateColumns: `minmax(0, 1fr) auto auto ${formElementLayeredSafeZone}`,
|
|
8550
|
+
},
|
|
8551
|
+
// TODO: extract for multi-select, select-wrapper and text-field (not gridArea and placeSelf)
|
|
8552
|
+
icon: {
|
|
8553
|
+
gridArea: '1/3',
|
|
8554
|
+
placeSelf: 'center',
|
|
8555
|
+
padding: formButtonOrIconPadding,
|
|
8556
|
+
pointerEvents: 'none',
|
|
8557
|
+
transform: 'rotate3d(0,0,1,0.0001deg)', // needs to be a little more than 0 for correct direction in safari
|
|
8558
|
+
transition: getTransition('transform'),
|
|
8559
|
+
'&--rotate': {
|
|
8560
|
+
transform: 'rotate3d(0,0,1,180deg)',
|
|
8585
8561
|
},
|
|
8586
8562
|
},
|
|
8587
|
-
|
|
8563
|
+
// TODO: extract for multi-select, select-wrapper and text-field (not gridArea and placeSelf)
|
|
8564
|
+
button: {
|
|
8565
|
+
gridArea: '1/2',
|
|
8566
|
+
placeSelf: 'center',
|
|
8567
|
+
padding: formButtonOrIconPadding,
|
|
8568
|
+
},
|
|
8569
|
+
// TODO: extract (maybe even as functional component) and re-use in multi-select and select-wrapper
|
|
8570
|
+
'no-results': {
|
|
8571
|
+
padding: `${spacingStaticSmall} 12px`,
|
|
8572
|
+
boxSizing: 'border-box',
|
|
8573
|
+
color: contrastHighColor,
|
|
8574
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8575
|
+
color: contrastHighColorDark,
|
|
8576
|
+
}),
|
|
8577
|
+
...getNoResultsOptionJssStyle(),
|
|
8578
|
+
},
|
|
8579
|
+
// TODO: maybe we should extract it as functional component too
|
|
8580
|
+
'sr-only': getHiddenTextJssStyle(),
|
|
8581
|
+
// .label / .required
|
|
8582
|
+
...getFunctionalComponentLabelStyles(isDisabled, hideLabel, theme),
|
|
8583
|
+
// .message
|
|
8584
|
+
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
8585
|
+
});
|
|
8588
8586
|
};
|
|
8589
8587
|
|
|
8590
8588
|
const cssVarInternalOptgroupScaling = '--p-internal-optgroup-scaling';
|
|
8591
8589
|
const scalingVar = `var(${cssVarInternalOptgroupScaling}, 1)`;
|
|
8592
|
-
const getComponentCss$
|
|
8593
|
-
'@global': {
|
|
8594
|
-
':host': addImportantToEachRule({
|
|
8595
|
-
...colorSchemeStyles,
|
|
8596
|
-
...hostHiddenStyles,
|
|
8597
|
-
}),
|
|
8598
|
-
'::slotted(*)': {
|
|
8599
|
-
[cssVariableSelectPaddingInlineStart]: '28px',
|
|
8600
|
-
[cssVariableMultiSelectPaddingInlineStart]: '28px',
|
|
8601
|
-
},
|
|
8602
|
-
},
|
|
8603
|
-
...getOptgroupStyles(isDisabled, theme),
|
|
8604
|
-
});
|
|
8605
|
-
const getOptgroupStyles = (isDisabled, theme) => {
|
|
8590
|
+
const getComponentCss$B = (isDisabled, theme) => {
|
|
8606
8591
|
const { primaryColor, disabledColor } = getThemedColors(theme);
|
|
8607
8592
|
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark } = getThemedColors('dark');
|
|
8608
|
-
const gap = `max(2px, ${scalingVar} * ${spacingStaticSmall})`;
|
|
8609
8593
|
const padding = `max(2px, ${scalingVar} * ${spacingStaticSmall}) max(4px, ${scalingVar} * 12px)`;
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8614
|
-
|
|
8615
|
-
|
|
8616
|
-
label: {
|
|
8617
|
-
color: primaryColor,
|
|
8618
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8619
|
-
color: primaryColorDark,
|
|
8594
|
+
const gap = `max(2px, ${scalingVar} * ${spacingStaticSmall})`;
|
|
8595
|
+
return getCss({
|
|
8596
|
+
'@global': {
|
|
8597
|
+
':host': addImportantToEachRule({
|
|
8598
|
+
...colorSchemeStyles,
|
|
8599
|
+
...hostHiddenStyles,
|
|
8620
8600
|
}),
|
|
8621
|
-
|
|
8622
|
-
|
|
8601
|
+
'::slotted(*)': {
|
|
8602
|
+
'--p-internal-select-option-padding-left': '28px',
|
|
8603
|
+
'--p-internal-multi-select-option-padding-left': '28px',
|
|
8604
|
+
},
|
|
8605
|
+
'[role="group"]': {
|
|
8606
|
+
display: 'flex',
|
|
8607
|
+
flexDirection: 'column',
|
|
8608
|
+
gap,
|
|
8609
|
+
},
|
|
8610
|
+
'[role="presentation"]': {
|
|
8611
|
+
padding,
|
|
8612
|
+
font: textXSmallStyle.font.replace(' 400 ', ` ${fontWeightSemiBold} `),
|
|
8613
|
+
color: primaryColor,
|
|
8623
8614
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8624
|
-
color:
|
|
8615
|
+
color: primaryColorDark,
|
|
8625
8616
|
}),
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8617
|
+
...(isDisabled && {
|
|
8618
|
+
color: disabledColor,
|
|
8619
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8620
|
+
color: disabledColorDark,
|
|
8621
|
+
}),
|
|
8622
|
+
}),
|
|
8623
|
+
},
|
|
8631
8624
|
},
|
|
8632
|
-
};
|
|
8625
|
+
});
|
|
8633
8626
|
};
|
|
8634
8627
|
|
|
8635
8628
|
const mediaQueryMinS = getMediaQueryMin('s');
|
|
@@ -8642,7 +8635,7 @@ const disabledCursorStyle = {
|
|
|
8642
8635
|
pointerEvents: 'none', // prevents :hover (has no effect when forced), maybe we can remove it since CSS selectors already cover desired behavior
|
|
8643
8636
|
};
|
|
8644
8637
|
const hiddenStyle = { display: 'none' };
|
|
8645
|
-
const getComponentCss$
|
|
8638
|
+
const getComponentCss$A = (activePage, pageTotal, showLastPage, theme) => {
|
|
8646
8639
|
const { primaryColor, disabledColor, hoverColor } = getThemedColors(theme);
|
|
8647
8640
|
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, hoverColor: hoverColorDark, } = getThemedColors('dark');
|
|
8648
8641
|
return getCss({
|
|
@@ -8778,7 +8771,7 @@ const removeStyles = (selector, styles) => Object.fromEntries(Object.entries(sty
|
|
|
8778
8771
|
return [key, value];
|
|
8779
8772
|
}));
|
|
8780
8773
|
|
|
8781
|
-
const getComponentCss$
|
|
8774
|
+
const getComponentCss$z = (hideLabel, state, isDisabled, isLoading, length, theme) => {
|
|
8782
8775
|
const inputSize = `calc(${fontLineHeight} + 10px + ${borderWidthBase} * 2 + ${spacingStaticSmall} * 2)`; // equivalent to calculation of input height within form-styles
|
|
8783
8776
|
const inputStyles = removeStyles('input[readonly]', removeSlottedSelector(getSlottedTextFieldTextareaSelectStyles('input', state, isLoading, theme, {
|
|
8784
8777
|
// TODO: move into getSlottedTextFieldTextareaSelectStyles()
|
|
@@ -8858,12 +8851,20 @@ const getComponentCss$y = (hideLabel, state, isDisabled, isLoading, length, them
|
|
|
8858
8851
|
const POPOVER_SAFE_ZONE = 8;
|
|
8859
8852
|
|
|
8860
8853
|
const { canvasTextColor } = getHighContrastColors();
|
|
8861
|
-
const getComponentCss$
|
|
8854
|
+
const getComponentCss$y = (theme) => {
|
|
8862
8855
|
const { hoverColor, backgroundColor, primaryColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
8863
8856
|
const { hoverColor: hoverColorDark, primaryColor: primaryColorDark, backgroundSurfaceColor: backgroundSurfaceColorDark, } = getThemedColors('dark');
|
|
8864
8857
|
const shadowColor = 'rgba(0,0,0,0.3)';
|
|
8865
8858
|
return getCss({
|
|
8866
8859
|
'@global': {
|
|
8860
|
+
'@keyframes fade-in': {
|
|
8861
|
+
from: {
|
|
8862
|
+
opacity: 0,
|
|
8863
|
+
},
|
|
8864
|
+
to: {
|
|
8865
|
+
opacity: 1,
|
|
8866
|
+
},
|
|
8867
|
+
},
|
|
8867
8868
|
':host': {
|
|
8868
8869
|
position: 'relative', // ensures correct reference for floating ui fallback positioning in older browsers
|
|
8869
8870
|
display: 'inline-block',
|
|
@@ -8898,25 +8899,21 @@ const getComponentCss$x = (theme) => {
|
|
|
8898
8899
|
}),
|
|
8899
8900
|
...getFocusJssStyle(theme, { offset: 0 }),
|
|
8900
8901
|
},
|
|
8902
|
+
'[popover]': {
|
|
8903
|
+
all: 'unset',
|
|
8904
|
+
position: 'absolute',
|
|
8905
|
+
pointerEvents: 'none',
|
|
8906
|
+
filter: `drop-shadow(0 0 16px ${shadowColor})`,
|
|
8907
|
+
animation: `var(${cssVariableAnimationDuration}, ${motionDurationShort}) fade-in ${motionEasingBase} forwards`,
|
|
8908
|
+
'&:not(:popover-open)': {
|
|
8909
|
+
display: 'none', // ensures popover is not flickering when closed in some situations
|
|
8910
|
+
},
|
|
8911
|
+
},
|
|
8901
8912
|
},
|
|
8902
8913
|
label: getHiddenTextJssStyle(),
|
|
8903
8914
|
icon: {
|
|
8904
8915
|
transform: 'translate3d(0,0,0)', // Fixes movement on hover in Safari
|
|
8905
8916
|
},
|
|
8906
|
-
popover: {
|
|
8907
|
-
all: 'unset',
|
|
8908
|
-
position: 'absolute',
|
|
8909
|
-
pointerEvents: 'none',
|
|
8910
|
-
filter: `drop-shadow(0 0 16px ${shadowColor})`,
|
|
8911
|
-
animation: `${motionDurationShort} $fadeIn ${motionEasingBase} forwards`
|
|
8912
|
-
,
|
|
8913
|
-
'&:not(:popover-open)': {
|
|
8914
|
-
display: 'none', // ensures popover is not flickering when closed in some situations
|
|
8915
|
-
},
|
|
8916
|
-
'&:-internal-popover-in-top-layer::backdrop': {
|
|
8917
|
-
display: 'none',
|
|
8918
|
-
},
|
|
8919
|
-
},
|
|
8920
8917
|
arrow: {
|
|
8921
8918
|
position: 'absolute',
|
|
8922
8919
|
width: '24px',
|
|
@@ -8947,17 +8944,9 @@ const getComponentCss$x = (theme) => {
|
|
|
8947
8944
|
background: isThemeDark(theme) ? backgroundSurfaceColor : backgroundColor,
|
|
8948
8945
|
color: primaryColor,
|
|
8949
8946
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
8950
|
-
background: backgroundSurfaceColorDark,
|
|
8951
|
-
color: primaryColorDark,
|
|
8952
|
-
}),
|
|
8953
|
-
},
|
|
8954
|
-
'@keyframes fadeIn': {
|
|
8955
|
-
from: {
|
|
8956
|
-
opacity: 0,
|
|
8957
|
-
},
|
|
8958
|
-
to: {
|
|
8959
|
-
opacity: 1,
|
|
8960
|
-
},
|
|
8947
|
+
background: backgroundSurfaceColorDark,
|
|
8948
|
+
color: primaryColorDark,
|
|
8949
|
+
}),
|
|
8961
8950
|
},
|
|
8962
8951
|
});
|
|
8963
8952
|
};
|
|
@@ -8965,7 +8954,7 @@ const getComponentCss$x = (theme) => {
|
|
|
8965
8954
|
const getCheckedSVGBackgroundImage = (fill) => {
|
|
8966
8955
|
return getInlineSVGBackgroundImage(`<circle fill="${fill}" cx="12" cy="12" r="6"/>`);
|
|
8967
8956
|
};
|
|
8968
|
-
const getComponentCss$
|
|
8957
|
+
const getComponentCss$x = (hideLabel, state, isDisabled, isLoading, theme) => {
|
|
8969
8958
|
const checkedIconColor = escapeHashCharacter(getInvertedThemedColors(theme).primaryColor);
|
|
8970
8959
|
const checkedIconColorDark = escapeHashCharacter(getInvertedThemedColors('dark').primaryColor);
|
|
8971
8960
|
return getCss({
|
|
@@ -9067,7 +9056,7 @@ const getGradient = (theme, gradientColorTheme) => {
|
|
|
9067
9056
|
`rgba(${gradientColor},0)`);
|
|
9068
9057
|
};
|
|
9069
9058
|
const prevNextWrapperWidth = `calc(${fontLineHeight} + 24px)`;
|
|
9070
|
-
const getComponentCss$
|
|
9059
|
+
const getComponentCss$w = (gradientColor, isNextHidden, isPrevHidden, scrollIndicatorPosition, hasScrollbar, theme) => {
|
|
9071
9060
|
const actionPrevNextStyles = {
|
|
9072
9061
|
position: 'absolute',
|
|
9073
9062
|
top: 0,
|
|
@@ -9200,7 +9189,7 @@ const getColors$2 = (isDisabled, isSelected, theme) => {
|
|
|
9200
9189
|
};
|
|
9201
9190
|
};
|
|
9202
9191
|
const getItemPadding = (hasIconAndSlottedContent) => hasIconAndSlottedContent ? `13px ${ITEM_PADDING} 13px 13px` : `13px ${ITEM_PADDING}`;
|
|
9203
|
-
const getComponentCss$
|
|
9192
|
+
const getComponentCss$v = (isDisabled, isSelected, hasIcon, hasSlottedContent, theme) => {
|
|
9204
9193
|
const { buttonColor, labelColor, borderColor, hoverBorderColor } = getColors$2(isDisabled, isSelected, theme);
|
|
9205
9194
|
const { buttonColor: buttonColorDark, labelColor: labelColorDark, borderColor: borderColorDark, hoverBorderColor: hoverBorderColorDark, } = getColors$2(isDisabled, isSelected, 'dark');
|
|
9206
9195
|
return getCss({
|
|
@@ -9271,7 +9260,7 @@ const getComponentCss$u = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
9271
9260
|
}),
|
|
9272
9261
|
});
|
|
9273
9262
|
};
|
|
9274
|
-
const getComponentCss$
|
|
9263
|
+
const getComponentCss$u = (maxWidth, columns) => {
|
|
9275
9264
|
return getCss({
|
|
9276
9265
|
'@global': {
|
|
9277
9266
|
':host': {
|
|
@@ -9292,17 +9281,19 @@ const getComponentCss$t = (maxWidth, columns) => {
|
|
|
9292
9281
|
});
|
|
9293
9282
|
};
|
|
9294
9283
|
|
|
9295
|
-
const
|
|
9296
|
-
const getButtonStyles
|
|
9284
|
+
const anchorName$1 = '--anchor-select-wrapper';
|
|
9285
|
+
const getButtonStyles = (isOpen, state, hasNativeCSSAnchorPositioningSupport, theme) => {
|
|
9297
9286
|
const { primaryColor, disabledColor, contrastMediumColor } = getThemedColors(theme);
|
|
9298
9287
|
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark, } = getThemedColors('dark');
|
|
9299
9288
|
const { formStateHoverColor, formStateColor } = getThemedFormStateColors(theme, state);
|
|
9300
9289
|
const { formStateHoverColor: formStateHoverColorDark, formStateColor: formStateColorDark } = getThemedFormStateColors('dark', state);
|
|
9301
|
-
const isDirectionDown = direction === 'down';
|
|
9302
9290
|
return {
|
|
9303
9291
|
'@global': {
|
|
9304
9292
|
// TODO: extract generic default button/anchor reset style
|
|
9305
9293
|
button: {
|
|
9294
|
+
...(hasNativeCSSAnchorPositioningSupport && {
|
|
9295
|
+
anchorName: anchorName$1,
|
|
9296
|
+
}),
|
|
9306
9297
|
position: 'absolute',
|
|
9307
9298
|
inset: 0,
|
|
9308
9299
|
width: '100%', // fixes Firefox positioning issue
|
|
@@ -9318,42 +9309,31 @@ const getButtonStyles$1 = (direction, isOpen, state, theme) => {
|
|
|
9318
9309
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9319
9310
|
borderColor: isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark,
|
|
9320
9311
|
}),
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
borderColor:
|
|
9312
|
+
'&:disabled': {
|
|
9313
|
+
cursor: 'not-allowed',
|
|
9314
|
+
borderColor: disabledColor,
|
|
9324
9315
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9325
|
-
borderColor:
|
|
9316
|
+
borderColor: disabledColorDark,
|
|
9326
9317
|
}),
|
|
9327
9318
|
},
|
|
9328
9319
|
...hoverMediaQuery({
|
|
9329
|
-
'&:not(:disabled):
|
|
9320
|
+
'&:not(:disabled):hover': {
|
|
9330
9321
|
borderColor: isOpen ? primaryColor : formStateHoverColor || primaryColor,
|
|
9331
9322
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9332
9323
|
borderColor: isOpen ? primaryColorDark : formStateHoverColorDark || primaryColorDark,
|
|
9333
9324
|
}),
|
|
9334
9325
|
},
|
|
9335
9326
|
}),
|
|
9336
|
-
|
|
9337
|
-
cursor: 'not-allowed',
|
|
9338
|
-
borderColor: disabledColor,
|
|
9339
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9340
|
-
borderColor: disabledColorDark,
|
|
9341
|
-
}),
|
|
9342
|
-
},
|
|
9343
|
-
...(isOpen && {
|
|
9344
|
-
[isDirectionDown ? 'borderBottomLeftRadius' : 'borderTopLeftRadius']: 0,
|
|
9345
|
-
[isDirectionDown ? 'borderBottomRightRadius' : 'borderTopRightRadius']: 0,
|
|
9346
|
-
}),
|
|
9327
|
+
...getFocusJssStyle(theme),
|
|
9347
9328
|
},
|
|
9348
9329
|
},
|
|
9349
9330
|
};
|
|
9350
9331
|
};
|
|
9351
|
-
const getFilterStyles = (
|
|
9332
|
+
const getFilterStyles = (isOpen, state, disabled, hasNativeCSSAnchorPositioningSupport, theme) => {
|
|
9352
9333
|
const { primaryColor, backgroundColor, disabledColor, contrastMediumColor } = getThemedColors(theme);
|
|
9353
9334
|
const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark, disabledColor: disabledColorDark, contrastMediumColor: contrastMediumColorDark, } = getThemedColors('dark');
|
|
9354
9335
|
const { formStateHoverColor, formStateColor } = getThemedFormStateColors(theme, state);
|
|
9355
9336
|
const { formStateHoverColor: formStateHoverColorDark, formStateColor: formStateColorDark } = getThemedFormStateColors('dark', state);
|
|
9356
|
-
const isDirectionDown = direction === 'down';
|
|
9357
9337
|
const placeHolderJssStyle = {
|
|
9358
9338
|
opacity: 1,
|
|
9359
9339
|
color: disabled ? disabledColor : primaryColor,
|
|
@@ -9393,6 +9373,9 @@ const getFilterStyles = (direction, isOpen, state, disabled, theme) => {
|
|
|
9393
9373
|
color: primaryColorDark,
|
|
9394
9374
|
background: backgroundColorDark,
|
|
9395
9375
|
}),
|
|
9376
|
+
...(hasNativeCSSAnchorPositioningSupport && {
|
|
9377
|
+
anchorName: anchorName$1,
|
|
9378
|
+
}),
|
|
9396
9379
|
'&::placeholder': {
|
|
9397
9380
|
...placeHolderJssStyle,
|
|
9398
9381
|
...prefersColorSchemeDarkMediaQuery(theme, placeHolderDarkJssStyle),
|
|
@@ -9445,115 +9428,29 @@ const getFilterStyles = (direction, isOpen, state, disabled, theme) => {
|
|
|
9445
9428
|
borderColor: isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark,
|
|
9446
9429
|
}),
|
|
9447
9430
|
borderRadius: borderRadiusSmall,
|
|
9448
|
-
...(isOpen && {
|
|
9449
|
-
[isDirectionDown ? 'borderBottomLeftRadius' : 'borderTopLeftRadius']: 0,
|
|
9450
|
-
[isDirectionDown ? 'borderBottomRightRadius' : 'borderTopRightRadius']: 0,
|
|
9451
|
-
}),
|
|
9452
9431
|
},
|
|
9453
9432
|
},
|
|
9454
9433
|
},
|
|
9455
9434
|
};
|
|
9456
9435
|
};
|
|
9457
|
-
const getListStyles
|
|
9458
|
-
const
|
|
9459
|
-
const { primaryColor: primaryColorDark,
|
|
9460
|
-
const { primaryColor, backgroundColor, contrastMediumColor, contrastHighColor, backgroundSurfaceColor, disabledColor, contrastLowColor, } = getThemedColors(theme);
|
|
9461
|
-
const { highlightColor } = getHighContrastColors();
|
|
9436
|
+
const getListStyles = (direction, isOpen, theme) => {
|
|
9437
|
+
const { primaryColor, disabledColor } = getThemedColors(theme);
|
|
9438
|
+
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark } = getThemedColors('dark');
|
|
9462
9439
|
return {
|
|
9463
9440
|
'@global': {
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
gap: spacingStaticSmall,
|
|
9468
|
-
position: `var(${dropdownPositionVar}, absolute)`, // for vrt tests
|
|
9469
|
-
padding: '6px',
|
|
9470
|
-
margin: 0,
|
|
9471
|
-
background: backgroundColor,
|
|
9472
|
-
...textSmallStyle,
|
|
9473
|
-
color: contrastHighColor,
|
|
9474
|
-
zIndex: 10,
|
|
9475
|
-
left: 0,
|
|
9476
|
-
right: 0,
|
|
9477
|
-
[isDirectionDown ? 'top' : 'bottom']: 'calc(100% - 2px)', // 2px border + 2px safety for rounded corners
|
|
9478
|
-
boxSizing: 'border-box',
|
|
9479
|
-
maxHeight: `${8.5 * (OPTION_HEIGHT + 8) + 6 + 2}px`, // 8px = gap, 6px = padding, 2px = border
|
|
9480
|
-
overflowY: 'auto',
|
|
9481
|
-
WebkitOverflowScrolling: 'touch',
|
|
9482
|
-
scrollBehavior: 'smooth',
|
|
9483
|
-
border: `2px solid ${primaryColor}`,
|
|
9484
|
-
[isDirectionDown ? 'borderTop' : 'borderBottom']: addImportantToRule(`1px solid ${contrastMediumColor}`),
|
|
9485
|
-
...(isDirectionDown
|
|
9486
|
-
? ['borderBottomLeftRadius', 'borderBottomRightRadius']
|
|
9487
|
-
: ['borderTopLeftRadius', 'borderTopRightRadius']).reduce((result, curr) => ({ ...result, [curr]: borderRadiusSmall }), {}),
|
|
9488
|
-
scrollbarWidth: 'thin', // firefox
|
|
9489
|
-
scrollbarColor: 'auto', // firefox
|
|
9490
|
-
transition: getTransition('border-color'),
|
|
9491
|
-
transform: 'translate3d(0,0,0)', // fix iOS bug if less than 5 items are displayed
|
|
9492
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9493
|
-
color: contrastHighColorDark,
|
|
9494
|
-
background: backgroundColorDark,
|
|
9495
|
-
borderColor: primaryColorDark,
|
|
9496
|
-
[isDirectionDown ? 'borderTopColor' : 'borderBottomColor']: addImportantToRule(contrastMediumColorDark),
|
|
9497
|
-
}),
|
|
9498
|
-
},
|
|
9441
|
+
// @keyframes fade-in
|
|
9442
|
+
...getPopoverKeyframesStyles,
|
|
9443
|
+
'[popover]': getPopoverJssStyle(isOpen, direction, anchorName$1, 1, 40, theme),
|
|
9499
9444
|
},
|
|
9500
9445
|
option: {
|
|
9501
|
-
|
|
9502
|
-
justifyContent: 'space-between',
|
|
9503
|
-
gap: '12px',
|
|
9504
|
-
padding: `${spacingStaticSmall} 12px`,
|
|
9505
|
-
flex: `1 0 calc(${fontLineHeight} + ${spacingStaticSmall} * 2)`,
|
|
9506
|
-
cursor: 'pointer',
|
|
9507
|
-
textAlign: 'start',
|
|
9508
|
-
wordBreak: 'break-word',
|
|
9509
|
-
boxSizing: 'border-box',
|
|
9510
|
-
borderRadius: borderRadiusSmall,
|
|
9511
|
-
transition: `${getTransition('background-color')}, ${getTransition('color')}`,
|
|
9512
|
-
...getNoResultsOptionJssStyle(),
|
|
9513
|
-
...hoverMediaQuery({
|
|
9514
|
-
'&:not([aria-disabled]):not(.option--disabled):not([role=status]):hover': {
|
|
9515
|
-
color: isHighContrastMode ? highlightColor : primaryColor,
|
|
9516
|
-
background: contrastLowColor,
|
|
9517
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9518
|
-
color: isHighContrastMode ? highlightColor : primaryColorDark,
|
|
9519
|
-
background: contrastLowColorDark,
|
|
9520
|
-
}),
|
|
9521
|
-
},
|
|
9522
|
-
}),
|
|
9523
|
-
'&--highlighted': {
|
|
9524
|
-
background: contrastLowColor,
|
|
9525
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9526
|
-
background: contrastLowColorDark,
|
|
9527
|
-
}),
|
|
9528
|
-
},
|
|
9529
|
-
'&--selected': {
|
|
9530
|
-
cursor: 'default',
|
|
9531
|
-
pointerEvents: 'none',
|
|
9532
|
-
background: backgroundSurfaceColor,
|
|
9533
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9534
|
-
background: backgroundSurfaceColorDark,
|
|
9535
|
-
}),
|
|
9536
|
-
},
|
|
9537
|
-
'&--highlighted, &--selected': {
|
|
9538
|
-
color: isHighContrastMode ? highlightColor : primaryColor,
|
|
9539
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9540
|
-
color: isHighContrastMode ? highlightColor : primaryColorDark,
|
|
9541
|
-
}),
|
|
9542
|
-
},
|
|
9543
|
-
'&--disabled': {
|
|
9544
|
-
cursor: 'not-allowed',
|
|
9545
|
-
color: disabledColor,
|
|
9546
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9547
|
-
color: disabledColorDark,
|
|
9548
|
-
}),
|
|
9549
|
-
},
|
|
9550
|
-
'&--hidden': {
|
|
9551
|
-
display: 'none',
|
|
9552
|
-
},
|
|
9446
|
+
...getOptionJssStyle('select-wrapper', 1, theme),
|
|
9553
9447
|
'&--indent': {
|
|
9554
9448
|
paddingLeft: '28px',
|
|
9555
9449
|
},
|
|
9556
9450
|
},
|
|
9451
|
+
icon: {
|
|
9452
|
+
marginInlineStart: 'auto',
|
|
9453
|
+
},
|
|
9557
9454
|
optgroup: {
|
|
9558
9455
|
'&--hidden': {
|
|
9559
9456
|
display: 'none',
|
|
@@ -9575,7 +9472,7 @@ const getListStyles$1 = (direction, theme) => {
|
|
|
9575
9472
|
},
|
|
9576
9473
|
};
|
|
9577
9474
|
};
|
|
9578
|
-
const getComponentCss$
|
|
9475
|
+
const getComponentCss$t = (direction, isOpen, state, disabled, filter, hasNativeCSSAnchorPositioningSupport, theme) => {
|
|
9579
9476
|
return getCss(
|
|
9580
9477
|
// merge because of global styles
|
|
9581
9478
|
mergeDeep({
|
|
@@ -9589,17 +9486,12 @@ const getComponentCss$s = (direction, isOpen, state, disabled, filter, isNativeP
|
|
|
9589
9486
|
'sr-text': {
|
|
9590
9487
|
display: 'none',
|
|
9591
9488
|
},
|
|
9592
|
-
...(isNativePopoverCase && {
|
|
9593
|
-
popover: {
|
|
9594
|
-
...getPopoverResetJssStyle(),
|
|
9595
|
-
},
|
|
9596
|
-
}),
|
|
9597
9489
|
}, filter
|
|
9598
|
-
? getFilterStyles(
|
|
9599
|
-
: getButtonStyles
|
|
9490
|
+
? getFilterStyles(isOpen, state, disabled, hasNativeCSSAnchorPositioningSupport, theme)
|
|
9491
|
+
: getButtonStyles(isOpen, state, hasNativeCSSAnchorPositioningSupport, theme), getListStyles(direction, isOpen, theme)));
|
|
9600
9492
|
};
|
|
9601
9493
|
|
|
9602
|
-
const getComponentCss$
|
|
9494
|
+
const getComponentCss$s = (isDisabled, hasCustomDropdown, hideLabel, state, theme) => {
|
|
9603
9495
|
return getCss({
|
|
9604
9496
|
'@global': {
|
|
9605
9497
|
':host': {
|
|
@@ -9657,21 +9549,37 @@ const getComponentCss$r = (isDisabled, hasCustomDropdown, hideLabel, state, them
|
|
|
9657
9549
|
});
|
|
9658
9550
|
};
|
|
9659
9551
|
|
|
9660
|
-
const
|
|
9661
|
-
const
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9552
|
+
const cssVarInternalSelectOptionScaling = '--p-internal-select-option-scaling';
|
|
9553
|
+
const getComponentCss$r = (theme) => {
|
|
9554
|
+
return getCss({
|
|
9555
|
+
'@global': {
|
|
9556
|
+
':host': {
|
|
9557
|
+
display: 'block',
|
|
9558
|
+
},
|
|
9559
|
+
...addImportantToEachRule({
|
|
9560
|
+
':host': {
|
|
9561
|
+
scrollMargin: '6px', // Aligns option when list is scrolled by navigating with keyboard
|
|
9562
|
+
...hostHiddenStyles,
|
|
9563
|
+
},
|
|
9564
|
+
'::slotted(img)': getButtonImageJssStyle,
|
|
9565
|
+
}),
|
|
9566
|
+
...preventFoucOfNestedElementsStyles,
|
|
9567
|
+
},
|
|
9568
|
+
option: getOptionJssStyle('select-option', `var(${cssVarInternalSelectOptionScaling}, 1)`, theme),
|
|
9569
|
+
icon: {
|
|
9570
|
+
marginInlineStart: 'auto',
|
|
9571
|
+
},
|
|
9572
|
+
});
|
|
9573
|
+
};
|
|
9574
|
+
|
|
9666
9575
|
const cssVarInternalSelectScaling = '--p-internal-select-scaling';
|
|
9667
|
-
const
|
|
9668
|
-
|
|
9669
|
-
// Defaults to 1 for the standard size and can be overridden by the CSS variable `cssVarInternalSelectScaling`.
|
|
9576
|
+
const anchorName = '--anchor-select';
|
|
9577
|
+
const getComponentCss$q = (direction, isOpen, isDisabled, hideLabel, state, compact, theme, hasSlottedImage) => {
|
|
9670
9578
|
const scalingVar = `var(${cssVarInternalSelectScaling}, ${compact ? 0.5 : 1})`;
|
|
9671
|
-
const gap = `max(2px, ${scalingVar} * ${spacingStaticXSmall})`;
|
|
9672
|
-
const gridTemplateColumns = `minmax(0, 1fr) auto auto calc(max(2px, ${scalingVar} * ${formElementLayeredGap}) + ${borderWidthBase})`;
|
|
9673
9579
|
return getCss({
|
|
9674
9580
|
'@global': {
|
|
9581
|
+
// @keyframes fade-in
|
|
9582
|
+
...getPopoverKeyframesStyles,
|
|
9675
9583
|
':host': {
|
|
9676
9584
|
display: 'block',
|
|
9677
9585
|
...addImportantToEachRule({
|
|
@@ -9684,201 +9592,27 @@ const getComponentCss$q = (direction, isOpen, isDisabled, hideLabel, state, isNa
|
|
|
9684
9592
|
'--p-internal-optgroup-scaling': scalingVar,
|
|
9685
9593
|
}),
|
|
9686
9594
|
...preventFoucOfNestedElementsStyles,
|
|
9687
|
-
button:
|
|
9595
|
+
button: {
|
|
9596
|
+
...getButtonJssStyle('select', isOpen, isDisabled, state, hasSlottedImage, anchorName, scalingVar, theme),
|
|
9597
|
+
'& img': getButtonImageJssStyle,
|
|
9598
|
+
'& span': getButtonLabelJssStyle,
|
|
9599
|
+
},
|
|
9600
|
+
'[popover]': getPopoverJssStyle(isOpen, direction, anchorName, scalingVar, 40, theme),
|
|
9688
9601
|
},
|
|
9689
9602
|
root: {
|
|
9690
9603
|
display: 'grid',
|
|
9691
|
-
gap,
|
|
9604
|
+
gap: `max(2px, ${scalingVar} * ${spacingStaticXSmall})`,
|
|
9692
9605
|
// min width is needed for showing at least 1 character in very narrow containers. The "1rem" value is the minimum safe zone to show at least 1 character plus the ellipsis dots.
|
|
9693
9606
|
minWidth: `calc(1rem + ${formElementPaddingHorizontal} + ${borderWidthBase} * 2 + ${getCalculatedFormElementPaddingHorizontal(1)})`,
|
|
9694
9607
|
},
|
|
9695
|
-
|
|
9696
|
-
position: 'relative',
|
|
9697
|
-
display: 'grid',
|
|
9698
|
-
gridTemplateColumns,
|
|
9699
|
-
},
|
|
9700
|
-
icon: {
|
|
9701
|
-
gridArea: '1/3',
|
|
9702
|
-
placeSelf: 'center',
|
|
9703
|
-
padding: formButtonOrIconPadding,
|
|
9704
|
-
pointerEvents: 'none',
|
|
9705
|
-
transform: 'rotate3d(0,0,1,0.0001deg)', // needs to be a little more than 0 for correct direction in safari
|
|
9706
|
-
transition: getTransition('transform'),
|
|
9707
|
-
...(!isHighContrastMode && {
|
|
9708
|
-
filter: `var(${cssVarIconFilter})`,
|
|
9709
|
-
}),
|
|
9710
|
-
'&--rotate': {
|
|
9711
|
-
transform: 'rotate3d(0,0,1,180deg)',
|
|
9712
|
-
},
|
|
9713
|
-
},
|
|
9714
|
-
listbox: getListStyles(isOpen, direction, compact, theme),
|
|
9608
|
+
icon: getIconJssStyle('select', isOpen),
|
|
9715
9609
|
'sr-only': getHiddenTextJssStyle(),
|
|
9716
9610
|
// .label / .required
|
|
9717
9611
|
...getFunctionalComponentLabelStyles(isDisabled, hideLabel, theme),
|
|
9718
9612
|
// .message
|
|
9719
9613
|
...getFunctionalComponentStateMessageStyles(theme, state),
|
|
9720
|
-
...(isNativePopoverCase && {
|
|
9721
|
-
popover: {
|
|
9722
|
-
...getPopoverResetJssStyle(),
|
|
9723
|
-
},
|
|
9724
|
-
}),
|
|
9725
9614
|
});
|
|
9726
9615
|
};
|
|
9727
|
-
// TODO: Rename to JSSStyles
|
|
9728
|
-
// TODO: use getSlottedTextFieldTextareaSelectStyles() instead an manipulate selectors like done with PIN Code or even better make it configurable as parameter
|
|
9729
|
-
const getButtonStyles = (isDisabled, direction, isOpen, state, compact, theme, hasSlottedImage) => {
|
|
9730
|
-
const { primaryColor, disabledColor, backgroundColor, contrastMediumColor } = getThemedColors(theme);
|
|
9731
|
-
const { primaryColor: primaryColorDark, disabledColor: disabledColorDark, backgroundColor: backgroundColorDark, contrastMediumColor: contrastMediumColorDark, } = getThemedColors('dark');
|
|
9732
|
-
const { formStateColor, formStateHoverColor } = getThemedFormStateColors(theme, state);
|
|
9733
|
-
const { formStateColor: formStateColorDark, formStateHoverColor: formStateHoverColorDark } = getThemedFormStateColors('dark', state);
|
|
9734
|
-
const scalingVar = `var(${cssVarInternalSelectScaling}, ${compact ? 0.5 : 1})`;
|
|
9735
|
-
const height = `max(${fontLineHeight}, ${scalingVar} * (${fontLineHeight} + 10px))`;
|
|
9736
|
-
const paddingBlock = `max(2px, ${scalingVar} * ${formElementPaddingVertical})`;
|
|
9737
|
-
const paddingInline = `max(4px, ${scalingVar} * ${formElementPaddingHorizontal}) ${getCalculatedFormElementPaddingHorizontal(1)}`;
|
|
9738
|
-
const gap = `max(4px, ${scalingVar} * 12px)`;
|
|
9739
|
-
return {
|
|
9740
|
-
textAlign: 'start', // TODO: Newly added (rest is copied from select-wrapper-dropdown), share rest for both components
|
|
9741
|
-
overflowX: 'hidden', // TODO: Newly added (rest is copied from select-wrapper-dropdown), share rest for both components
|
|
9742
|
-
whiteSpace: 'nowrap', // TODO: Newly added (rest is copied from select-wrapper-dropdown), share rest for both components
|
|
9743
|
-
gridArea: '1/1/1/-1',
|
|
9744
|
-
minWidth: 0,
|
|
9745
|
-
// TODO: abstract and re-use for multi-select, select-wrapper and text-field-wrapper
|
|
9746
|
-
height,
|
|
9747
|
-
font: textSmallStyle.font.replace('ex', 'ex + 6px'), // a minimum line-height is needed for input, otherwise value is scrollable in Chrome, +6px is alig
|
|
9748
|
-
margin: 0, // necessary reset for iOS Safari 15 (and maybe other browsers)
|
|
9749
|
-
paddingBlock,
|
|
9750
|
-
paddingInline,
|
|
9751
|
-
boxSizing: 'content-box',
|
|
9752
|
-
outline: 0,
|
|
9753
|
-
WebkitAppearance: 'none', // iOS safari
|
|
9754
|
-
appearance: 'none',
|
|
9755
|
-
...textSmallStyle,
|
|
9756
|
-
textOverflow: 'ellipsis',
|
|
9757
|
-
cursor: 'pointer',
|
|
9758
|
-
'&:disabled': {
|
|
9759
|
-
cursor: 'not-allowed',
|
|
9760
|
-
},
|
|
9761
|
-
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
|
|
9762
|
-
color: `var(${cssVarTextColor}, ${primaryColor})`,
|
|
9763
|
-
background: `var(${cssVarBackgroundColor}, ${backgroundColor})`,
|
|
9764
|
-
border: `${borderWidthBase} solid var(${cssVarBorderColor}, ${isOpen ? primaryColor : formStateColor || contrastMediumColor})`,
|
|
9765
|
-
borderRadius: borderRadiusSmall,
|
|
9766
|
-
'&:not(:focus-visible)': {
|
|
9767
|
-
...getPlaceholderJssStyle({
|
|
9768
|
-
color: `var(${cssVarTextColor}, ${primaryColor})`,
|
|
9769
|
-
opacity: 1,
|
|
9770
|
-
}),
|
|
9771
|
-
...prefersColorSchemeDarkMediaQuery(theme, getPlaceholderJssStyle({
|
|
9772
|
-
color: `var(${cssVarTextColor}, ${primaryColorDark})`,
|
|
9773
|
-
opacity: 1, // Opacity fixes placeholder being shown lighter in firefox
|
|
9774
|
-
})),
|
|
9775
|
-
},
|
|
9776
|
-
...(hasSlottedImage && {
|
|
9777
|
-
'& > span': {
|
|
9778
|
-
display: 'flex',
|
|
9779
|
-
gap,
|
|
9780
|
-
alignItems: 'center',
|
|
9781
|
-
},
|
|
9782
|
-
'& > span > span': {
|
|
9783
|
-
textOverflow: 'ellipsis',
|
|
9784
|
-
overflow: 'hidden',
|
|
9785
|
-
},
|
|
9786
|
-
'& img': {
|
|
9787
|
-
height: fontLineHeight,
|
|
9788
|
-
borderRadius: borderRadiusSmall,
|
|
9789
|
-
width: 'auto',
|
|
9790
|
-
},
|
|
9791
|
-
}),
|
|
9792
|
-
...hoverMediaQuery({
|
|
9793
|
-
'&:hover:not(:disabled):not(:focus-visible),label:hover~.wrapper &:not(:disabled):not(:focus-visible)': {
|
|
9794
|
-
borderColor: `var(${cssVarBorderColor}, ${isOpen ? primaryColor : formStateHoverColor || primaryColor})`,
|
|
9795
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9796
|
-
borderColor: `var(${cssVarBorderColor}, ${isOpen ? primaryColorDark : formStateHoverColorDark || primaryColorDark})`,
|
|
9797
|
-
}),
|
|
9798
|
-
},
|
|
9799
|
-
}),
|
|
9800
|
-
...(!isDisabled && {
|
|
9801
|
-
'&:focus-visible': {
|
|
9802
|
-
borderColor: `var(${cssVarBorderColorFocus}, ${primaryColor})`,
|
|
9803
|
-
background: `var(${cssVarBackgroundColorFocus}, ${backgroundColor})`,
|
|
9804
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9805
|
-
borderColor: `var(${cssVarBorderColorFocus}, ${primaryColorDark})`,
|
|
9806
|
-
background: `var(${cssVarBackgroundColorFocus}, ${backgroundColorDark})`,
|
|
9807
|
-
}),
|
|
9808
|
-
},
|
|
9809
|
-
}),
|
|
9810
|
-
...(isOpen && {
|
|
9811
|
-
['paddingBottom' ]: `calc(${paddingBlock} + 1px)`, // Add padding to keep same height when border changes
|
|
9812
|
-
['borderBottom' ]: addImportantToRule(`1px solid ${contrastMediumColor}`),
|
|
9813
|
-
['borderBottomLeftRadius' ]: 0,
|
|
9814
|
-
['borderBottomRightRadius' ]: 0,
|
|
9815
|
-
}),
|
|
9816
|
-
...(isDisabled && {
|
|
9817
|
-
...getPlaceholderJssStyle({
|
|
9818
|
-
color: disabledColor,
|
|
9819
|
-
}),
|
|
9820
|
-
cursor: 'not-allowed',
|
|
9821
|
-
color: disabledColor,
|
|
9822
|
-
borderColor: disabledColor,
|
|
9823
|
-
WebkitTextFillColor: disabledColor,
|
|
9824
|
-
}),
|
|
9825
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9826
|
-
color: `var(${cssVarTextColor}, ${primaryColorDark})`,
|
|
9827
|
-
background: `var(${cssVarBackgroundColor}, ${backgroundColorDark})`,
|
|
9828
|
-
border: `${borderWidthBase} solid var(${cssVarBorderColor}, ${isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark})`,
|
|
9829
|
-
...(isOpen && {
|
|
9830
|
-
['borderBottom' ]: addImportantToRule(`1px solid ${contrastMediumColorDark}`),
|
|
9831
|
-
}),
|
|
9832
|
-
...(isDisabled && {
|
|
9833
|
-
...getPlaceholderJssStyle({ color: disabledColorDark }),
|
|
9834
|
-
color: disabledColorDark,
|
|
9835
|
-
borderColor: disabledColorDark,
|
|
9836
|
-
WebkitTextFillColor: disabledColorDark,
|
|
9837
|
-
}),
|
|
9838
|
-
}),
|
|
9839
|
-
};
|
|
9840
|
-
};
|
|
9841
|
-
// TODO: Rename to JSSStyles
|
|
9842
|
-
// TODO: Copied from multi-select, extract and use in select and multi-select
|
|
9843
|
-
const getListStyles = (isOpen, direction, compact, theme) => {
|
|
9844
|
-
const { primaryColor, backgroundColor } = getThemedColors(theme);
|
|
9845
|
-
const { primaryColor: primaryColorDark, backgroundColor: backgroundColorDark } = getThemedColors('dark');
|
|
9846
|
-
const scalingVar = `var(${cssVarInternalSelectScaling}, ${compact ? 0.5 : 1})`;
|
|
9847
|
-
const gap = `max(2px, ${scalingVar} * ${spacingStaticSmall})`;
|
|
9848
|
-
const padding = `max(2px, ${scalingVar} * 6px)`;
|
|
9849
|
-
return {
|
|
9850
|
-
position: 'absolute',
|
|
9851
|
-
margin: 0,
|
|
9852
|
-
display: isOpen ? 'flex' : 'none',
|
|
9853
|
-
flexDirection: 'column',
|
|
9854
|
-
gap,
|
|
9855
|
-
padding,
|
|
9856
|
-
...textSmallStyle,
|
|
9857
|
-
zIndex: 10,
|
|
9858
|
-
// TODO: Inset inline 0
|
|
9859
|
-
left: 0,
|
|
9860
|
-
right: 0,
|
|
9861
|
-
['top' ]: '100%',
|
|
9862
|
-
boxSizing: 'border-box',
|
|
9863
|
-
maxHeight: `${8.5 * (OPTION_HEIGHT + 8) + 6 + 2}px`, // 8.5 options * option height + 8px gap + additional spacing (6px = padding, 2px = border)
|
|
9864
|
-
overflowY: 'auto',
|
|
9865
|
-
WebkitOverflowScrolling: 'touch',
|
|
9866
|
-
background: backgroundColor,
|
|
9867
|
-
border: `2px solid var(${cssVarBorderColor}, ${primaryColor})`,
|
|
9868
|
-
['borderTop' ]: 'none',
|
|
9869
|
-
borderRadius: borderRadiusSmall,
|
|
9870
|
-
['borderTopLeftRadius' ]: 0,
|
|
9871
|
-
['borderTopRightRadius' ]: 0,
|
|
9872
|
-
scrollbarWidth: 'thin', // firefox
|
|
9873
|
-
scrollbarColor: 'auto', // firefox
|
|
9874
|
-
transition: getTransition('border-color'),
|
|
9875
|
-
transform: 'translate3d(0,0,0)', // fix iOS bug if less than 5 items are displayed
|
|
9876
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9877
|
-
background: backgroundColorDark,
|
|
9878
|
-
borderColor: `var(${cssVarBorderColor}, ${primaryColorDark})`,
|
|
9879
|
-
}),
|
|
9880
|
-
};
|
|
9881
|
-
};
|
|
9882
9616
|
|
|
9883
9617
|
const getComponentCss$p = (isOpen, hasDismissButton, theme) => {
|
|
9884
9618
|
return getCss({
|
|
@@ -10316,33 +10050,12 @@ const getComponentCss$k = () => {
|
|
|
10316
10050
|
});
|
|
10317
10051
|
};
|
|
10318
10052
|
|
|
10319
|
-
const
|
|
10320
|
-
return getCss({
|
|
10321
|
-
'@global': {
|
|
10322
|
-
':host': {
|
|
10323
|
-
display: 'table-cell',
|
|
10324
|
-
verticalAlign: 'middle',
|
|
10325
|
-
...addImportantToEachRule({
|
|
10326
|
-
padding: spacingFluidSmall,
|
|
10327
|
-
margin: 0,
|
|
10328
|
-
whiteSpace: multiline ? 'normal' : 'nowrap',
|
|
10329
|
-
...hostHiddenStyles,
|
|
10330
|
-
}),
|
|
10331
|
-
},
|
|
10332
|
-
},
|
|
10333
|
-
});
|
|
10334
|
-
};
|
|
10335
|
-
|
|
10336
|
-
const isDirectionAsc = (dir) => dir === 'asc';
|
|
10337
|
-
const isSortable = (active, direction) => {
|
|
10338
|
-
return active !== undefined && direction !== undefined;
|
|
10339
|
-
};
|
|
10340
|
-
|
|
10053
|
+
const cssVariableTablePadding = '--p-internal-table-padding';
|
|
10341
10054
|
const cssVariableTableHoverColor = '--p-internal-table-hover-color';
|
|
10342
10055
|
const cssVariableTableBorderColor = '--p-internal-table-border-color';
|
|
10343
10056
|
const cssVariableTableBorderWidth = '--p-internal-table-border-width';
|
|
10344
10057
|
const cssVariableTableHeadCellIconFilter = '--p-internal-table-head-cell-icon-filter';
|
|
10345
|
-
const getComponentCss$
|
|
10058
|
+
const getComponentCss$j = (compact, layout, theme) => {
|
|
10346
10059
|
const { primaryColor, hoverColor, contrastLowColor } = doGetThemedColors(theme);
|
|
10347
10060
|
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, contrastLowColor: contrastLowColorDark, } = doGetThemedColors('dark');
|
|
10348
10061
|
return getCss({
|
|
@@ -10362,6 +10075,7 @@ const getComponentCss$i = (theme) => {
|
|
|
10362
10075
|
},
|
|
10363
10076
|
...preventFoucOfNestedElementsStyles,
|
|
10364
10077
|
'::slotted(*)': addImportantToEachRule({
|
|
10078
|
+
...(compact && { [cssVariableTablePadding]: spacingStaticSmall }),
|
|
10365
10079
|
[cssVariableTableHoverColor]: hoverColor,
|
|
10366
10080
|
[cssVariableTableBorderColor]: contrastLowColor,
|
|
10367
10081
|
[cssVariableTableHeadCellIconFilter]: isThemeDark(theme) ? 'invert(100%)' : 'none',
|
|
@@ -10384,12 +10098,41 @@ const getComponentCss$i = (theme) => {
|
|
|
10384
10098
|
table: {
|
|
10385
10099
|
display: 'table',
|
|
10386
10100
|
borderCollapse: 'collapse',
|
|
10387
|
-
width:
|
|
10101
|
+
// with table-layout: fixed, width: 100% crops border-bottom of p-table-row when scrollable
|
|
10102
|
+
// also relative width units (%, vw) don't work as expected when scrollable or combined with auto columns
|
|
10103
|
+
...(layout === 'fixed'
|
|
10104
|
+
? {
|
|
10105
|
+
tableLayout: 'fixed',
|
|
10106
|
+
minWidth: '100%',
|
|
10107
|
+
}
|
|
10108
|
+
: { width: '100%' }),
|
|
10388
10109
|
whiteSpace: 'nowrap', // shouldn't be inherited for caption, that's why it's defined here
|
|
10389
10110
|
},
|
|
10390
10111
|
});
|
|
10391
10112
|
};
|
|
10392
10113
|
|
|
10114
|
+
const getComponentCss$i = (multiline) => {
|
|
10115
|
+
return getCss({
|
|
10116
|
+
'@global': {
|
|
10117
|
+
':host': {
|
|
10118
|
+
display: 'table-cell',
|
|
10119
|
+
verticalAlign: 'middle',
|
|
10120
|
+
...addImportantToEachRule({
|
|
10121
|
+
padding: `var(${cssVariableTablePadding}, ${spacingFluidSmall})`,
|
|
10122
|
+
margin: 0,
|
|
10123
|
+
whiteSpace: multiline ? 'normal' : 'nowrap',
|
|
10124
|
+
...hostHiddenStyles,
|
|
10125
|
+
}),
|
|
10126
|
+
},
|
|
10127
|
+
},
|
|
10128
|
+
});
|
|
10129
|
+
};
|
|
10130
|
+
|
|
10131
|
+
const isDirectionAsc = (dir) => dir === 'asc';
|
|
10132
|
+
const isSortable = (active, direction) => {
|
|
10133
|
+
return active !== undefined && direction !== undefined;
|
|
10134
|
+
};
|
|
10135
|
+
|
|
10393
10136
|
const { hoverColor } = getThemedColors('light'); // hover color and focus color are the same for light and dark
|
|
10394
10137
|
const buttonBeforeOffsetVertical = '-2px';
|
|
10395
10138
|
const buttonBeforeOffsetHorizontal = '-4px';
|
|
@@ -10400,7 +10143,7 @@ const getComponentCss$h = (active, direction, hideLabel, multiline) => {
|
|
|
10400
10143
|
':host': {
|
|
10401
10144
|
display: 'table-cell',
|
|
10402
10145
|
...addImportantToEachRule({
|
|
10403
|
-
padding: `2px ${spacingFluidSmall} ${spacingFluidSmall}`,
|
|
10146
|
+
padding: `2px var(${cssVariableTablePadding}, ${spacingFluidSmall}) var(${cssVariableTablePadding}, ${spacingFluidSmall})`,
|
|
10404
10147
|
verticalAlign: 'bottom',
|
|
10405
10148
|
whiteSpace: multiline ? 'normal' : 'nowrap',
|
|
10406
10149
|
...hostHiddenStyles,
|
|
@@ -11409,4 +11152,4 @@ const getComponentCss = (size, theme) => {
|
|
|
11409
11152
|
});
|
|
11410
11153
|
};
|
|
11411
11154
|
|
|
11412
|
-
export { getComponentCss$1a as getAccordionCss, getComponentCss$19 as getBannerCss, getComponentCss$15 as getButtonCss, getComponentCss$18 as getButtonGroupCss, getComponentCss$17 as getButtonPureCss, getComponentCss$16 as getButtonTileCss, getComponentCss$14 as getCanvasCss, getComponentCss$13 as getCarouselCss, getComponentCss$11 as getCheckboxCss, getComponentCss$12 as getCheckboxWrapperCss, getComponentCss$10 as getContentWrapperCss, getComponentCss$$ as getCrestCss, getComponentCss$_ as getDisplayCss, getComponentCss$Z as getDividerCss, getComponentCss$X as getFieldsetCss, getComponentCss$Y as getFieldsetWrapperCss, getComponentCss$V as getFlexCss, getComponentCss$W as getFlexItemCss, getComponentCss$S as getFlyoutCss, getComponentCss$U as getFlyoutMultilevelCss, getComponentCss$T as getFlyoutMultilevelItemCss, getFunctionalComponentLabelStyles, getFunctionalComponentLoadingMessageStyles, getFunctionalComponentRequiredStyles, getFunctionalComponentStateMessageStyles, getComponentCss$Q as getGridCss, getComponentCss$R as getGridItemCss, getComponentCss$P as getHeadingCss, getComponentCss$O as getHeadlineCss, getComponentCss$N as getIconCss, getComponentCss$M as getInlineNotificationCss, getComponentCss$K as getLinkCss, getComponentCss$L as getLinkPureCss, getComponentCss$K as getLinkSocialCss, getComponentCss$H as getLinkTileCss, getComponentCss$J as getLinkTileModelSignatureCss, getComponentCss$I as getLinkTileProductCss, getComponentCss$G as getMarqueCss, getComponentCss$F as getModalCss, getComponentCss$E as getModelSignatureCss, getComponentCss$C as getMultiSelectCss, getComponentCss$D as getMultiSelectOptionCss, getComponentCss$
|
|
11155
|
+
export { getComponentCss$1a as getAccordionCss, getComponentCss$19 as getBannerCss, getComponentCss$15 as getButtonCss, getComponentCss$18 as getButtonGroupCss, getComponentCss$17 as getButtonPureCss, getComponentCss$16 as getButtonTileCss, getComponentCss$14 as getCanvasCss, getComponentCss$13 as getCarouselCss, getComponentCss$11 as getCheckboxCss, getComponentCss$12 as getCheckboxWrapperCss, getComponentCss$10 as getContentWrapperCss, getComponentCss$$ as getCrestCss, getComponentCss$_ as getDisplayCss, getComponentCss$Z as getDividerCss, getComponentCss$X as getFieldsetCss, getComponentCss$Y as getFieldsetWrapperCss, getComponentCss$V as getFlexCss, getComponentCss$W as getFlexItemCss, getComponentCss$S as getFlyoutCss, getComponentCss$U as getFlyoutMultilevelCss, getComponentCss$T as getFlyoutMultilevelItemCss, getFunctionalComponentLabelStyles, getFunctionalComponentLoadingMessageStyles, getFunctionalComponentRequiredStyles, getFunctionalComponentStateMessageStyles, getComponentCss$Q as getGridCss, getComponentCss$R as getGridItemCss, getComponentCss$P as getHeadingCss, getComponentCss$O as getHeadlineCss, getComponentCss$N as getIconCss, getComponentCss$M as getInlineNotificationCss, getComponentCss$K as getLinkCss, getComponentCss$L as getLinkPureCss, getComponentCss$K as getLinkSocialCss, getComponentCss$H as getLinkTileCss, getComponentCss$J as getLinkTileModelSignatureCss, getComponentCss$I as getLinkTileProductCss, getComponentCss$G as getMarqueCss, getComponentCss$F as getModalCss, getComponentCss$E as getModelSignatureCss, getComponentCss$C as getMultiSelectCss, getComponentCss$D as getMultiSelectOptionCss, getComponentCss$B as getOptgroupCss, getComponentCss$A as getPaginationCss, getComponentCss$z as getPinCodeCss, getComponentCss$y as getPopoverCss, getComponentCss$x as getRadioButtonWrapperCss, getComponentCss$w as getScrollerCss, getComponentCss$u as getSegmentedControlCss, getComponentCss$v as getSegmentedControlItemCss, getComponentCss$q as getSelectCss, getComponentCss$r as getSelectOptionCss, getComponentCss$s as getSelectWrapperCss, getComponentCss$t as getSelectWrapperDropdownCss, getComponentCss$p as getSheetCss, getComponentCss$o as getSpinnerCss, getComponentCss$m as getStepperHorizontalCss, getComponentCss$n as getStepperHorizontalItemCss, getComponentCss$l as getSwitchCss, getComponentCss$k as getTableBodyCss, getComponentCss$i as getTableCellCss, getComponentCss$j as getTableCss, getComponentCss$h as getTableHeadCellCss, getComponentCss$f as getTableHeadCss, getComponentCss$g as getTableHeadRowCss, getComponentCss$e as getTableRowCss, getComponentCss$d as getTabsBarCss, getComponentCss$b as getTabsCss, getComponentCss$c as getTabsItemCss, getComponentCss$9 as getTagCss, getComponentCss$a as getTagDismissibleCss, getComponentCss$5 as getTextCss, getComponentCss$8 as getTextFieldWrapperCss, getComponentCss$7 as getTextListCss, getComponentCss$6 as getTextListItemCss, getComponentCss$3 as getTextareaCss, getComponentCss$4 as getTextareaWrapperCss, getComponentCss$1 as getToastCss, getComponentCss as getWordmarkCss };
|