@porsche-design-system/components-react 3.15.0 → 3.15.2
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 +27 -3
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +242 -225
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +53 -40
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.cjs +3 -2
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +242 -225
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +53 -40
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.mjs +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
|
|
|
14
14
|
|
|
15
15
|
### [Unreleased]
|
|
16
16
|
|
|
17
|
+
### [3.15.2] - 2024-05-29
|
|
18
|
+
|
|
19
|
+
#### Fixed
|
|
20
|
+
|
|
21
|
+
- `aria`: Refactor `parseJSONAttribute` to support Safari < 16.4
|
|
22
|
+
([#3314](https://github.com/porsche-design-system/porsche-design-system/pull/3314))
|
|
23
|
+
|
|
24
|
+
### [3.15.1] - 2024-05-23
|
|
25
|
+
|
|
26
|
+
#### Fixed
|
|
27
|
+
|
|
28
|
+
- `Banner`: Fixed position on mobile ([#3307](https://github.com/porsche-design-system/porsche-design-system/pull/3307))
|
|
29
|
+
|
|
17
30
|
### [3.15.0] - 2024-05-16
|
|
18
31
|
|
|
19
32
|
### [3.15.0-rc.5] - 2024-05-16
|
|
@@ -22,14 +35,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
|
|
|
22
35
|
|
|
23
36
|
- `Button Pure`: Prop `underline` to show an underline for the label
|
|
24
37
|
([#3212](https://github.com/porsche-design-system/porsche-design-system/pull/3212))
|
|
25
|
-
|
|
38
|
+
- Partials: Added new option `globalStyles` to `getInitialStyles` to disable global reset styles.
|
|
39
|
+
([#3213](https://github.com/porsche-design-system/porsche-design-system/pull/3213))
|
|
40
|
+
|
|
26
41
|
#### Changed
|
|
27
42
|
|
|
28
|
-
- Banner
|
|
43
|
+
- `Banner`: Refactor Banner to use native `popover`
|
|
29
44
|
([#3196](https://github.com/porsche-design-system/porsche-design-system/pull/3196))
|
|
45
|
+
- Partials: `getInitialStyles` only contain hydration visibility and global styles. All other styles are handled by
|
|
46
|
+
constructable stylesheets at component level.
|
|
47
|
+
([#3213](https://github.com/porsche-design-system/porsche-design-system/pull/3213))
|
|
48
|
+
- `Table`: Removed slotted image style `verticalAlign: 'middle'` from initialStyles
|
|
49
|
+
([#3213](https://github.com/porsche-design-system/porsche-design-system/pull/3213))
|
|
50
|
+
- `Tabs Bar`: Removed sibling tabpanel focus style from initialStyles
|
|
51
|
+
([#3213](https://github.com/porsche-design-system/porsche-design-system/pull/3213))
|
|
30
52
|
|
|
31
53
|
#### Fixed
|
|
32
54
|
|
|
55
|
+
- `Carousel`: Accessible name of carousel region wrapper
|
|
56
|
+
([#3220](https://github.com/porsche-design-system/porsche-design-system/pull/3220))
|
|
33
57
|
- `aria` property now supports escaped single quotes inside JSON strings, e.g.
|
|
34
58
|
`aria="{ 'aria-label': 'You can\'t do that? yes you can!' }"`
|
|
35
59
|
([#3217](https://github.com/porsche-design-system/porsche-design-system/pull/3217))
|
|
@@ -97,7 +121,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
|
|
|
97
121
|
- `Model Signature`: Enabling the use of hex colors, CSS gradients, CSS image and video masks. In addition, the size was
|
|
98
122
|
slightly adjusted. ([#3153](https://github.com/porsche-design-system/porsche-design-system/pull/3153))
|
|
99
123
|
|
|
100
|
-
|
|
124
|
+
#### Fixed
|
|
101
125
|
|
|
102
126
|
- `Modal`: Missing box-shadow on sticky footer when slotted content changes
|
|
103
127
|
([#3154](https://github.com/porsche-design-system/porsche-design-system/pull/3154))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porsche-design-system/components-react",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.2",
|
|
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.15.
|
|
20
|
+
"@porsche-design-system/components-js": "3.15.2"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=18.0.0 <19.0.0",
|
|
@@ -3161,17 +3161,6 @@ const hasWindow = typeof window !== 'undefined';
|
|
|
3161
3161
|
|
|
3162
3162
|
const isHighContrastMode = hasWindow && window.matchMedia?.('(forced-colors: active)').matches;
|
|
3163
3163
|
|
|
3164
|
-
const attributeMutationMap = new Map();
|
|
3165
|
-
hasWindow &&
|
|
3166
|
-
new MutationObserver((mutations) => {
|
|
3167
|
-
mutations
|
|
3168
|
-
// reduce array to only entries that have really a changed value
|
|
3169
|
-
.filter((mutation) => mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName))
|
|
3170
|
-
// remove duplicates so we execute callback only once per node
|
|
3171
|
-
.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
|
|
3172
|
-
.forEach((mutation) => attributeMutationMap.get(mutation.target)?.());
|
|
3173
|
-
});
|
|
3174
|
-
|
|
3175
3164
|
const parseJSON = (prop) => {
|
|
3176
3165
|
if (typeof prop === 'string') {
|
|
3177
3166
|
try {
|
|
@@ -3477,217 +3466,6 @@ const textLargeStyle = {
|
|
|
3477
3466
|
...fontHyphenationStyle,
|
|
3478
3467
|
};
|
|
3479
3468
|
|
|
3480
|
-
const mediaQueries = Object.values(breakpoint).map((v) => `(min-width:${v}px)`);
|
|
3481
|
-
hasWindow && window.matchMedia ? mediaQueries.map(window.matchMedia) : [];
|
|
3482
|
-
|
|
3483
|
-
Object.entries(breakpoint).reduce((result, [key, val]) => ({ ...result, [`${val}px`]: key }), {});
|
|
3484
|
-
|
|
3485
|
-
const hasVisibleIcon = (iconName, iconSource) => {
|
|
3486
|
-
return iconName !== 'none' || !!iconSource;
|
|
3487
|
-
};
|
|
3488
|
-
|
|
3489
|
-
/**
|
|
3490
|
-
* Map of observed nodes and their corresponding callback functions.
|
|
3491
|
-
*/
|
|
3492
|
-
const observedNodesMap = new Map();
|
|
3493
|
-
/**
|
|
3494
|
-
* Mutation observer for observing changes in the children of observed nodes.
|
|
3495
|
-
*/
|
|
3496
|
-
hasWindow &&
|
|
3497
|
-
new MutationObserver((mutations) => {
|
|
3498
|
-
// there may be race conditions in jsdom-polyfill tests where the map is already empty when a mutation happens
|
|
3499
|
-
if (observedNodesMap.size) {
|
|
3500
|
-
const observedNodes = Array.from(observedNodesMap.keys());
|
|
3501
|
-
mutations
|
|
3502
|
-
// remove duplicates so we execute callback only once per node
|
|
3503
|
-
.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
|
|
3504
|
-
// find all observing parent nodes of mutated node and invoke their callbacks
|
|
3505
|
-
.forEach((mutation) => {
|
|
3506
|
-
observedNodes
|
|
3507
|
-
.filter((node) => node.contains(mutation.target))
|
|
3508
|
-
.forEach((node) => observedNodesMap.get(node)?.());
|
|
3509
|
-
});
|
|
3510
|
-
}
|
|
3511
|
-
});
|
|
3512
|
-
|
|
3513
|
-
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
|
|
3514
|
-
|
|
3515
|
-
/**
|
|
3516
|
-
* Throttle execution of a function. Especially useful for rate limiting
|
|
3517
|
-
* execution of handlers on events like resize and scroll.
|
|
3518
|
-
*
|
|
3519
|
-
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
|
|
3520
|
-
* are most useful.
|
|
3521
|
-
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
|
|
3522
|
-
* as-is, to `callback` when the throttled-function is executed.
|
|
3523
|
-
* @param {object} [options] - An object to configure options.
|
|
3524
|
-
* @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
|
|
3525
|
-
* while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
|
|
3526
|
-
* one final time after the last throttled-function call. (After the throttled-function has not been called for
|
|
3527
|
-
* `delay` milliseconds, the internal counter is reset).
|
|
3528
|
-
* @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
|
|
3529
|
-
* immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
|
|
3530
|
-
* callback will never executed if both noLeading = true and noTrailing = true.
|
|
3531
|
-
* @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
|
|
3532
|
-
* false (at end), schedule `callback` to execute after `delay` ms.
|
|
3533
|
-
*
|
|
3534
|
-
* @returns {Function} A new, throttled, function.
|
|
3535
|
-
*/
|
|
3536
|
-
function throttle (delay, callback, options) {
|
|
3537
|
-
var _ref = options || {},
|
|
3538
|
-
_ref$noTrailing = _ref.noTrailing,
|
|
3539
|
-
noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
|
|
3540
|
-
_ref$noLeading = _ref.noLeading,
|
|
3541
|
-
noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
|
|
3542
|
-
_ref$debounceMode = _ref.debounceMode,
|
|
3543
|
-
debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
|
|
3544
|
-
/*
|
|
3545
|
-
* After wrapper has stopped being called, this timeout ensures that
|
|
3546
|
-
* `callback` is executed at the proper times in `throttle` and `end`
|
|
3547
|
-
* debounce modes.
|
|
3548
|
-
*/
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
var timeoutID;
|
|
3552
|
-
var cancelled = false; // Keep track of the last time `callback` was executed.
|
|
3553
|
-
|
|
3554
|
-
var lastExec = 0; // Function to clear existing timeout
|
|
3555
|
-
|
|
3556
|
-
function clearExistingTimeout() {
|
|
3557
|
-
if (timeoutID) {
|
|
3558
|
-
clearTimeout(timeoutID);
|
|
3559
|
-
}
|
|
3560
|
-
} // Function to cancel next exec
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
function cancel(options) {
|
|
3564
|
-
var _ref2 = options || {},
|
|
3565
|
-
_ref2$upcomingOnly = _ref2.upcomingOnly,
|
|
3566
|
-
upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
|
|
3567
|
-
|
|
3568
|
-
clearExistingTimeout();
|
|
3569
|
-
cancelled = !upcomingOnly;
|
|
3570
|
-
}
|
|
3571
|
-
/*
|
|
3572
|
-
* The `wrapper` function encapsulates all of the throttling / debouncing
|
|
3573
|
-
* functionality and when executed will limit the rate at which `callback`
|
|
3574
|
-
* is executed.
|
|
3575
|
-
*/
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
function wrapper() {
|
|
3579
|
-
for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3580
|
-
arguments_[_key] = arguments[_key];
|
|
3581
|
-
}
|
|
3582
|
-
|
|
3583
|
-
var self = this;
|
|
3584
|
-
var elapsed = Date.now() - lastExec;
|
|
3585
|
-
|
|
3586
|
-
if (cancelled) {
|
|
3587
|
-
return;
|
|
3588
|
-
} // Execute `callback` and update the `lastExec` timestamp.
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
function exec() {
|
|
3592
|
-
lastExec = Date.now();
|
|
3593
|
-
callback.apply(self, arguments_);
|
|
3594
|
-
}
|
|
3595
|
-
/*
|
|
3596
|
-
* If `debounceMode` is true (at begin) this is used to clear the flag
|
|
3597
|
-
* to allow future `callback` executions.
|
|
3598
|
-
*/
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
function clear() {
|
|
3602
|
-
timeoutID = undefined;
|
|
3603
|
-
}
|
|
3604
|
-
|
|
3605
|
-
if (!noLeading && debounceMode && !timeoutID) {
|
|
3606
|
-
/*
|
|
3607
|
-
* Since `wrapper` is being called for the first time and
|
|
3608
|
-
* `debounceMode` is true (at begin), execute `callback`
|
|
3609
|
-
* and noLeading != true.
|
|
3610
|
-
*/
|
|
3611
|
-
exec();
|
|
3612
|
-
}
|
|
3613
|
-
|
|
3614
|
-
clearExistingTimeout();
|
|
3615
|
-
|
|
3616
|
-
if (debounceMode === undefined && elapsed > delay) {
|
|
3617
|
-
if (noLeading) {
|
|
3618
|
-
/*
|
|
3619
|
-
* In throttle mode with noLeading, if `delay` time has
|
|
3620
|
-
* been exceeded, update `lastExec` and schedule `callback`
|
|
3621
|
-
* to execute after `delay` ms.
|
|
3622
|
-
*/
|
|
3623
|
-
lastExec = Date.now();
|
|
3624
|
-
|
|
3625
|
-
if (!noTrailing) {
|
|
3626
|
-
timeoutID = setTimeout(debounceMode ? clear : exec, delay);
|
|
3627
|
-
}
|
|
3628
|
-
} else {
|
|
3629
|
-
/*
|
|
3630
|
-
* In throttle mode without noLeading, if `delay` time has been exceeded, execute
|
|
3631
|
-
* `callback`.
|
|
3632
|
-
*/
|
|
3633
|
-
exec();
|
|
3634
|
-
}
|
|
3635
|
-
} else if (noTrailing !== true) {
|
|
3636
|
-
/*
|
|
3637
|
-
* In trailing throttle mode, since `delay` time has not been
|
|
3638
|
-
* exceeded, schedule `callback` to execute `delay` ms after most
|
|
3639
|
-
* recent execution.
|
|
3640
|
-
*
|
|
3641
|
-
* If `debounceMode` is true (at begin), schedule `clear` to execute
|
|
3642
|
-
* after `delay` ms.
|
|
3643
|
-
*
|
|
3644
|
-
* If `debounceMode` is false (at end), schedule `callback` to
|
|
3645
|
-
* execute after `delay` ms.
|
|
3646
|
-
*/
|
|
3647
|
-
timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
|
|
3648
|
-
}
|
|
3649
|
-
}
|
|
3650
|
-
|
|
3651
|
-
wrapper.cancel = cancel; // Return the wrapper function.
|
|
3652
|
-
|
|
3653
|
-
return wrapper;
|
|
3654
|
-
}
|
|
3655
|
-
|
|
3656
|
-
/* eslint-disable no-undefined */
|
|
3657
|
-
/**
|
|
3658
|
-
* Debounce execution of a function. Debouncing, unlike throttling,
|
|
3659
|
-
* guarantees that a function is only executed a single time, either at the
|
|
3660
|
-
* very beginning of a series of calls, or at the very end.
|
|
3661
|
-
*
|
|
3662
|
-
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
|
|
3663
|
-
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
|
|
3664
|
-
* to `callback` when the debounced-function is executed.
|
|
3665
|
-
* @param {object} [options] - An object to configure options.
|
|
3666
|
-
* @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
|
|
3667
|
-
* after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
|
|
3668
|
-
* (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
|
|
3669
|
-
*
|
|
3670
|
-
* @returns {Function} A new, debounced function.
|
|
3671
|
-
*/
|
|
3672
|
-
|
|
3673
|
-
function debounce (delay, callback, options) {
|
|
3674
|
-
var _ref = options || {},
|
|
3675
|
-
_ref$atBegin = _ref.atBegin,
|
|
3676
|
-
atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
|
|
3677
|
-
|
|
3678
|
-
return throttle(delay, callback, {
|
|
3679
|
-
debounceMode: atBegin !== false
|
|
3680
|
-
});
|
|
3681
|
-
}
|
|
3682
|
-
|
|
3683
|
-
debounce(800, (el, ariaElement) => {
|
|
3684
|
-
ariaElement.innerText = `You have ${el.maxLength - el.value.length} out of ${el.maxLength} characters left`;
|
|
3685
|
-
});
|
|
3686
|
-
|
|
3687
|
-
const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-design-system";
|
|
3688
|
-
|
|
3689
|
-
const MODEL_SIGNATURES_MANIFEST = { "718": { "src": "718.min.493a9e3509d6e263fa2207150082def5.svg", "width": 79, "height": 26 }, "911": { "src": "911.min.b68f913216168583298ccf83f1a6b8d5.svg", "width": 94, "height": 25 }, "boxster": { "src": "boxster.min.c321738789b37fda4bba3f7c587542aa.svg", "width": 239, "height": 26 }, "cayenne": { "src": "cayenne.min.25562011631a831516f91ec31d144104.svg", "width": 245, "height": 35 }, "cayman": { "src": "cayman.min.cc8919694c002873e1bb6a3c1dae5d41.svg", "width": 229, "height": 35 }, "macan": { "src": "macan.min.a1844f4c8d23b75e371745e9b8eb49b9.svg", "width": 196, "height": 26 }, "panamera": { "src": "panamera.min.6dae8095186567168f85c145845f090c.svg", "width": 260, "height": 25 }, "taycan": { "src": "taycan.min.df444c6f4cc1f627ceaf1b02584d6bea.svg", "width": 167, "height": 36 }, "turbo-s": { "src": "turbo-s.min.73f1e10731caffe93c07d96fa08546c1.svg", "width": 199, "height": 25 }, "turbo": { "src": "turbo.min.6a4084a8704a6c47a099b2de56b22aef.svg", "width": 143, "height": 25 } };
|
|
3690
|
-
|
|
3691
3469
|
/* Auto Generated Start */
|
|
3692
3470
|
const themeLight = {
|
|
3693
3471
|
primaryColor: '#010205',
|
|
@@ -4018,6 +3796,238 @@ const mergeDeep = (...objects) => {
|
|
|
4018
3796
|
}, {});
|
|
4019
3797
|
};
|
|
4020
3798
|
|
|
3799
|
+
// TODO: Use function from ./jss (Causes bundling issues)
|
|
3800
|
+
(() => {
|
|
3801
|
+
try {
|
|
3802
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
3803
|
+
}
|
|
3804
|
+
catch {
|
|
3805
|
+
return false;
|
|
3806
|
+
}
|
|
3807
|
+
})(); // determine it once
|
|
3808
|
+
|
|
3809
|
+
const attributeMutationMap = new Map();
|
|
3810
|
+
hasWindow &&
|
|
3811
|
+
new MutationObserver((mutations) => {
|
|
3812
|
+
mutations
|
|
3813
|
+
// reduce array to only entries that have really a changed value
|
|
3814
|
+
.filter((mutation) => mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName))
|
|
3815
|
+
// remove duplicates so we execute callback only once per node
|
|
3816
|
+
.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
|
|
3817
|
+
.forEach((mutation) => attributeMutationMap.get(mutation.target)?.());
|
|
3818
|
+
});
|
|
3819
|
+
|
|
3820
|
+
const mediaQueries = Object.values(breakpoint).map((v) => `(min-width:${v}px)`);
|
|
3821
|
+
hasWindow && window.matchMedia ? mediaQueries.map(window.matchMedia) : [];
|
|
3822
|
+
|
|
3823
|
+
Object.entries(breakpoint).reduce((result, [key, val]) => ({ ...result, [`${val}px`]: key }), {});
|
|
3824
|
+
|
|
3825
|
+
const hasVisibleIcon = (iconName, iconSource) => {
|
|
3826
|
+
return iconName !== 'none' || !!iconSource;
|
|
3827
|
+
};
|
|
3828
|
+
|
|
3829
|
+
/**
|
|
3830
|
+
* Map of observed nodes and their corresponding callback functions.
|
|
3831
|
+
*/
|
|
3832
|
+
const observedNodesMap = new Map();
|
|
3833
|
+
/**
|
|
3834
|
+
* Mutation observer for observing changes in the children of observed nodes.
|
|
3835
|
+
*/
|
|
3836
|
+
hasWindow &&
|
|
3837
|
+
new MutationObserver((mutations) => {
|
|
3838
|
+
// there may be race conditions in jsdom-polyfill tests where the map is already empty when a mutation happens
|
|
3839
|
+
if (observedNodesMap.size) {
|
|
3840
|
+
const observedNodes = Array.from(observedNodesMap.keys());
|
|
3841
|
+
mutations
|
|
3842
|
+
// remove duplicates so we execute callback only once per node
|
|
3843
|
+
.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
|
|
3844
|
+
// find all observing parent nodes of mutated node and invoke their callbacks
|
|
3845
|
+
.forEach((mutation) => {
|
|
3846
|
+
observedNodes
|
|
3847
|
+
.filter((node) => node.contains(mutation.target))
|
|
3848
|
+
.forEach((node) => observedNodesMap.get(node)?.());
|
|
3849
|
+
});
|
|
3850
|
+
}
|
|
3851
|
+
});
|
|
3852
|
+
|
|
3853
|
+
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
|
|
3854
|
+
|
|
3855
|
+
/**
|
|
3856
|
+
* Throttle execution of a function. Especially useful for rate limiting
|
|
3857
|
+
* execution of handlers on events like resize and scroll.
|
|
3858
|
+
*
|
|
3859
|
+
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
|
|
3860
|
+
* are most useful.
|
|
3861
|
+
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
|
|
3862
|
+
* as-is, to `callback` when the throttled-function is executed.
|
|
3863
|
+
* @param {object} [options] - An object to configure options.
|
|
3864
|
+
* @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
|
|
3865
|
+
* while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
|
|
3866
|
+
* one final time after the last throttled-function call. (After the throttled-function has not been called for
|
|
3867
|
+
* `delay` milliseconds, the internal counter is reset).
|
|
3868
|
+
* @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
|
|
3869
|
+
* immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
|
|
3870
|
+
* callback will never executed if both noLeading = true and noTrailing = true.
|
|
3871
|
+
* @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
|
|
3872
|
+
* false (at end), schedule `callback` to execute after `delay` ms.
|
|
3873
|
+
*
|
|
3874
|
+
* @returns {Function} A new, throttled, function.
|
|
3875
|
+
*/
|
|
3876
|
+
function throttle (delay, callback, options) {
|
|
3877
|
+
var _ref = options || {},
|
|
3878
|
+
_ref$noTrailing = _ref.noTrailing,
|
|
3879
|
+
noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
|
|
3880
|
+
_ref$noLeading = _ref.noLeading,
|
|
3881
|
+
noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
|
|
3882
|
+
_ref$debounceMode = _ref.debounceMode,
|
|
3883
|
+
debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
|
|
3884
|
+
/*
|
|
3885
|
+
* After wrapper has stopped being called, this timeout ensures that
|
|
3886
|
+
* `callback` is executed at the proper times in `throttle` and `end`
|
|
3887
|
+
* debounce modes.
|
|
3888
|
+
*/
|
|
3889
|
+
|
|
3890
|
+
|
|
3891
|
+
var timeoutID;
|
|
3892
|
+
var cancelled = false; // Keep track of the last time `callback` was executed.
|
|
3893
|
+
|
|
3894
|
+
var lastExec = 0; // Function to clear existing timeout
|
|
3895
|
+
|
|
3896
|
+
function clearExistingTimeout() {
|
|
3897
|
+
if (timeoutID) {
|
|
3898
|
+
clearTimeout(timeoutID);
|
|
3899
|
+
}
|
|
3900
|
+
} // Function to cancel next exec
|
|
3901
|
+
|
|
3902
|
+
|
|
3903
|
+
function cancel(options) {
|
|
3904
|
+
var _ref2 = options || {},
|
|
3905
|
+
_ref2$upcomingOnly = _ref2.upcomingOnly,
|
|
3906
|
+
upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
|
|
3907
|
+
|
|
3908
|
+
clearExistingTimeout();
|
|
3909
|
+
cancelled = !upcomingOnly;
|
|
3910
|
+
}
|
|
3911
|
+
/*
|
|
3912
|
+
* The `wrapper` function encapsulates all of the throttling / debouncing
|
|
3913
|
+
* functionality and when executed will limit the rate at which `callback`
|
|
3914
|
+
* is executed.
|
|
3915
|
+
*/
|
|
3916
|
+
|
|
3917
|
+
|
|
3918
|
+
function wrapper() {
|
|
3919
|
+
for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3920
|
+
arguments_[_key] = arguments[_key];
|
|
3921
|
+
}
|
|
3922
|
+
|
|
3923
|
+
var self = this;
|
|
3924
|
+
var elapsed = Date.now() - lastExec;
|
|
3925
|
+
|
|
3926
|
+
if (cancelled) {
|
|
3927
|
+
return;
|
|
3928
|
+
} // Execute `callback` and update the `lastExec` timestamp.
|
|
3929
|
+
|
|
3930
|
+
|
|
3931
|
+
function exec() {
|
|
3932
|
+
lastExec = Date.now();
|
|
3933
|
+
callback.apply(self, arguments_);
|
|
3934
|
+
}
|
|
3935
|
+
/*
|
|
3936
|
+
* If `debounceMode` is true (at begin) this is used to clear the flag
|
|
3937
|
+
* to allow future `callback` executions.
|
|
3938
|
+
*/
|
|
3939
|
+
|
|
3940
|
+
|
|
3941
|
+
function clear() {
|
|
3942
|
+
timeoutID = undefined;
|
|
3943
|
+
}
|
|
3944
|
+
|
|
3945
|
+
if (!noLeading && debounceMode && !timeoutID) {
|
|
3946
|
+
/*
|
|
3947
|
+
* Since `wrapper` is being called for the first time and
|
|
3948
|
+
* `debounceMode` is true (at begin), execute `callback`
|
|
3949
|
+
* and noLeading != true.
|
|
3950
|
+
*/
|
|
3951
|
+
exec();
|
|
3952
|
+
}
|
|
3953
|
+
|
|
3954
|
+
clearExistingTimeout();
|
|
3955
|
+
|
|
3956
|
+
if (debounceMode === undefined && elapsed > delay) {
|
|
3957
|
+
if (noLeading) {
|
|
3958
|
+
/*
|
|
3959
|
+
* In throttle mode with noLeading, if `delay` time has
|
|
3960
|
+
* been exceeded, update `lastExec` and schedule `callback`
|
|
3961
|
+
* to execute after `delay` ms.
|
|
3962
|
+
*/
|
|
3963
|
+
lastExec = Date.now();
|
|
3964
|
+
|
|
3965
|
+
if (!noTrailing) {
|
|
3966
|
+
timeoutID = setTimeout(debounceMode ? clear : exec, delay);
|
|
3967
|
+
}
|
|
3968
|
+
} else {
|
|
3969
|
+
/*
|
|
3970
|
+
* In throttle mode without noLeading, if `delay` time has been exceeded, execute
|
|
3971
|
+
* `callback`.
|
|
3972
|
+
*/
|
|
3973
|
+
exec();
|
|
3974
|
+
}
|
|
3975
|
+
} else if (noTrailing !== true) {
|
|
3976
|
+
/*
|
|
3977
|
+
* In trailing throttle mode, since `delay` time has not been
|
|
3978
|
+
* exceeded, schedule `callback` to execute `delay` ms after most
|
|
3979
|
+
* recent execution.
|
|
3980
|
+
*
|
|
3981
|
+
* If `debounceMode` is true (at begin), schedule `clear` to execute
|
|
3982
|
+
* after `delay` ms.
|
|
3983
|
+
*
|
|
3984
|
+
* If `debounceMode` is false (at end), schedule `callback` to
|
|
3985
|
+
* execute after `delay` ms.
|
|
3986
|
+
*/
|
|
3987
|
+
timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
|
|
3988
|
+
}
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
wrapper.cancel = cancel; // Return the wrapper function.
|
|
3992
|
+
|
|
3993
|
+
return wrapper;
|
|
3994
|
+
}
|
|
3995
|
+
|
|
3996
|
+
/* eslint-disable no-undefined */
|
|
3997
|
+
/**
|
|
3998
|
+
* Debounce execution of a function. Debouncing, unlike throttling,
|
|
3999
|
+
* guarantees that a function is only executed a single time, either at the
|
|
4000
|
+
* very beginning of a series of calls, or at the very end.
|
|
4001
|
+
*
|
|
4002
|
+
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
|
|
4003
|
+
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
|
|
4004
|
+
* to `callback` when the debounced-function is executed.
|
|
4005
|
+
* @param {object} [options] - An object to configure options.
|
|
4006
|
+
* @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
|
|
4007
|
+
* after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
|
|
4008
|
+
* (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
|
|
4009
|
+
*
|
|
4010
|
+
* @returns {Function} A new, debounced function.
|
|
4011
|
+
*/
|
|
4012
|
+
|
|
4013
|
+
function debounce (delay, callback, options) {
|
|
4014
|
+
var _ref = options || {},
|
|
4015
|
+
_ref$atBegin = _ref.atBegin,
|
|
4016
|
+
atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
|
|
4017
|
+
|
|
4018
|
+
return throttle(delay, callback, {
|
|
4019
|
+
debounceMode: atBegin !== false
|
|
4020
|
+
});
|
|
4021
|
+
}
|
|
4022
|
+
|
|
4023
|
+
debounce(800, (el, ariaElement) => {
|
|
4024
|
+
ariaElement.innerText = `You have ${el.maxLength - el.value.length} out of ${el.maxLength} characters left`;
|
|
4025
|
+
});
|
|
4026
|
+
|
|
4027
|
+
const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-design-system";
|
|
4028
|
+
|
|
4029
|
+
const MODEL_SIGNATURES_MANIFEST = { "718": { "src": "718.min.493a9e3509d6e263fa2207150082def5.svg", "width": 79, "height": 26 }, "911": { "src": "911.min.b68f913216168583298ccf83f1a6b8d5.svg", "width": 94, "height": 25 }, "boxster": { "src": "boxster.min.c321738789b37fda4bba3f7c587542aa.svg", "width": 239, "height": 26 }, "cayenne": { "src": "cayenne.min.25562011631a831516f91ec31d144104.svg", "width": 245, "height": 35 }, "cayman": { "src": "cayman.min.cc8919694c002873e1bb6a3c1dae5d41.svg", "width": 229, "height": 35 }, "macan": { "src": "macan.min.a1844f4c8d23b75e371745e9b8eb49b9.svg", "width": 196, "height": 26 }, "panamera": { "src": "panamera.min.6dae8095186567168f85c145845f090c.svg", "width": 260, "height": 25 }, "taycan": { "src": "taycan.min.df444c6f4cc1f627ceaf1b02584d6bea.svg", "width": 167, "height": 36 }, "turbo-s": { "src": "turbo-s.min.73f1e10731caffe93c07d96fa08546c1.svg", "width": 199, "height": 25 }, "turbo": { "src": "turbo.min.6a4084a8704a6c47a099b2de56b22aef.svg", "width": 143, "height": 25 } };
|
|
4030
|
+
|
|
4021
4031
|
const scrollShadowColor = 'rgba(204, 204, 204, 0.35)';
|
|
4022
4032
|
const scrollShadowColorDark = 'rgba(0, 0, 0, 0.6)';
|
|
4023
4033
|
|
|
@@ -4237,6 +4247,7 @@ const getBannerPopoverResetStyles = () => {
|
|
|
4237
4247
|
position: 'fixed',
|
|
4238
4248
|
margin: 0,
|
|
4239
4249
|
padding: 0,
|
|
4250
|
+
inset: 'auto', // ua popover reset
|
|
4240
4251
|
width: 'auto', // ua popover reset
|
|
4241
4252
|
height: 'auto', // ua popover reset
|
|
4242
4253
|
maxWidth: '100%', // If component is wrapped in container with maxWidth
|
|
@@ -4263,6 +4274,9 @@ const getComponentCss$14 = (isOpen) => {
|
|
|
4263
4274
|
zIndex: `var(${cssVariableZIndex},${BANNER_Z_INDEX})`,
|
|
4264
4275
|
...dropShadowHighStyle,
|
|
4265
4276
|
borderRadius: borderRadiusSmall, // needed for rounded box-shadow
|
|
4277
|
+
'&::backdrop': {
|
|
4278
|
+
display: 'none',
|
|
4279
|
+
},
|
|
4266
4280
|
...(isOpen
|
|
4267
4281
|
? {
|
|
4268
4282
|
opacity: 1,
|
|
@@ -4842,7 +4856,7 @@ const paginationWidth = `calc(${paginationActiveBulletSize} + ${paginationBullet
|
|
|
4842
4856
|
const paginationInset = '8px'; // Used to increase clickable area on touch devices
|
|
4843
4857
|
const paginationGapLarge = '16px';
|
|
4844
4858
|
const paginationWidthLarge = `calc(${paginationActiveBulletSize} + ${paginationBulletSize} * ${paginationVisibleBulletCount - 1} + ${paginationGapLarge} * ${paginationVisibleBulletCount - 1} + 2 * ${paginationInset})`; // Width for one active bullet + width of inactive bullets + spacing
|
|
4845
|
-
const selectorHeading = '
|
|
4859
|
+
const selectorHeading = '.heading';
|
|
4846
4860
|
const selectorDescription = 'p,::slotted([slot="description"])';
|
|
4847
4861
|
const mediaQueryS = getMediaQueryMin('s');
|
|
4848
4862
|
const mediaQueryXXL = getMediaQueryMin('xxl');
|
|
@@ -4888,7 +4902,7 @@ const getComponentCss$$ = (hasHeading, hasDescription, hasControlsSlot, headingS
|
|
|
4888
4902
|
...getFocusJssStyle(theme, { slotted: true }),
|
|
4889
4903
|
},
|
|
4890
4904
|
// TODO: maybe it's better to style with slot[name="heading"] and slot[name="description"] instead, then styles would be part of shadow dom
|
|
4891
|
-
//
|
|
4905
|
+
// .heading,p,::slotted([slot=description])
|
|
4892
4906
|
...((hasHeading || hasDescription) && {
|
|
4893
4907
|
[`${selectorHeading},${selectorDescription}`]: {
|
|
4894
4908
|
gridColumn: '1/-1',
|
|
@@ -4902,13 +4916,16 @@ const getComponentCss$$ = (hasHeading, hasDescription, hasControlsSlot, headingS
|
|
|
4902
4916
|
}),
|
|
4903
4917
|
},
|
|
4904
4918
|
}),
|
|
4905
|
-
// h2,::slotted([slot=heading])
|
|
4906
4919
|
...(hasHeading && {
|
|
4907
4920
|
[selectorHeading]: {
|
|
4908
4921
|
maxWidth: '56.25rem',
|
|
4909
4922
|
margin: `0 0 ${!hasDescription ? spacingFluidMedium : 0}`,
|
|
4910
4923
|
...(headingSize === 'xx-large' ? headingXXLargeStyle : headingXLargeStyle),
|
|
4911
4924
|
},
|
|
4925
|
+
['::slotted([slot=heading])']: {
|
|
4926
|
+
margin: 0, // reset ua-style
|
|
4927
|
+
...(headingSize === 'xx-large' ? headingXXLargeStyle : headingXLargeStyle),
|
|
4928
|
+
},
|
|
4912
4929
|
}),
|
|
4913
4930
|
// p,::slotted([slot=description])
|
|
4914
4931
|
...(hasDescription && {
|