@porsche-design-system/components-react 3.21.0 → 3.22.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -2
- package/ag-grid/theme.css +17 -8
- package/cjs/lib/components/link-tile-model-signature.wrapper.cjs +1 -1
- package/cjs/lib/components/pin-code.wrapper.cjs +3 -3
- package/esm/lib/components/link-tile-model-signature.wrapper.mjs +1 -1
- package/esm/lib/components/pin-code.wrapper.d.ts +8 -0
- package/esm/lib/components/pin-code.wrapper.mjs +3 -3
- package/esm/lib/types.d.ts +33 -33
- package/package.json +6 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +450 -437
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +419 -420
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile-model-signature.wrapper.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/pin-code.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/loading-message.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +5 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.cjs +15 -6
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +2 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/toast.cjs +1 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +450 -437
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +419 -420
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile-model-signature.wrapper.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/pin-code.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/loading-message.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +5 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs +15 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +2 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/toast.mjs +1 -1
- package/ssr/esm/lib/components/pin-code.wrapper.d.ts +8 -0
- package/ssr/esm/lib/dsr-components/button-pure.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/button.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/checkbox-wrapper.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/checkbox.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/flyout-multilevel-item.d.ts +1 -1
- package/ssr/esm/lib/dsr-components/pin-code.d.ts +6 -3
- package/ssr/esm/lib/dsr-components/radio-button-wrapper.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/switch.d.ts +1 -0
- package/ssr/esm/lib/types.d.ts +33 -33
- package/styles/_index.scss +1 -1
|
@@ -33,7 +33,7 @@ function toPrimitive(t, r) {
|
|
|
33
33
|
if ("object" != _typeof(t) || !t) return t;
|
|
34
34
|
var e = t[Symbol.toPrimitive];
|
|
35
35
|
if (void 0 !== e) {
|
|
36
|
-
var i = e.call(t, r
|
|
36
|
+
var i = e.call(t, r);
|
|
37
37
|
if ("object" != _typeof(i)) return i;
|
|
38
38
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
39
39
|
}
|
|
@@ -2757,400 +2757,426 @@ function getAugmentedNamespace(n) {
|
|
|
2757
2757
|
return a;
|
|
2758
2758
|
}
|
|
2759
2759
|
|
|
2760
|
-
var _tslib
|
|
2760
|
+
var _tslib = {};
|
|
2761
2761
|
|
|
2762
|
-
|
|
2762
|
+
var hasRequired_tslib;
|
|
2763
2763
|
|
|
2764
|
-
|
|
2764
|
+
function require_tslib () {
|
|
2765
|
+
if (hasRequired_tslib) return _tslib;
|
|
2766
|
+
hasRequired_tslib = 1;
|
|
2767
|
+
(function (exports) {
|
|
2765
2768
|
|
|
2766
|
-
|
|
2767
|
-
Copyright (c) Microsoft Corporation.
|
|
2769
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2768
2770
|
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
+
/*! *****************************************************************************
|
|
2772
|
+
Copyright (c) Microsoft Corporation.
|
|
2771
2773
|
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2775
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2776
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2777
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2778
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2779
|
-
***************************************************************************** */
|
|
2774
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
2775
|
+
purpose with or without fee is hereby granted.
|
|
2780
2776
|
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
}
|
|
2790
|
-
return t;
|
|
2791
|
-
};
|
|
2792
|
-
return exports.__assign.apply(this, arguments);
|
|
2793
|
-
};
|
|
2794
|
-
} (_tslib$1));
|
|
2795
|
-
|
|
2796
|
-
var require$$1 = /*@__PURE__*/getAugmentedNamespace(jss_esm);
|
|
2797
|
-
|
|
2798
|
-
/**
|
|
2799
|
-
* The custom `sort` method for
|
|
2800
|
-
* for the [`css-mqpacker`](https://www.npmjs.com/package/css-mqpacker) or
|
|
2801
|
-
* [`pleeease`](https://www.npmjs.com/package/pleeease) which using `css-mqpacker`
|
|
2802
|
-
* or, perhaps, something else ))
|
|
2803
|
-
*
|
|
2804
|
-
* @module sort-css-media-queries
|
|
2805
|
-
* @author Oleg Dutchenko <dutchenko.o.wezom@gmail.com>
|
|
2806
|
-
* @version 1.5.0
|
|
2807
|
-
*/
|
|
2808
|
-
|
|
2809
|
-
// ----------------------------------------
|
|
2810
|
-
// Private
|
|
2811
|
-
// ----------------------------------------
|
|
2777
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2778
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2779
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2780
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2781
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2782
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2783
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
2784
|
+
***************************************************************************** */
|
|
2812
2785
|
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
const isPrint = /print/i;
|
|
2830
|
-
const isPrintOnly = /^print$/i;
|
|
2831
|
-
|
|
2832
|
-
const maxValue = Number.MAX_VALUE;
|
|
2833
|
-
|
|
2834
|
-
/**
|
|
2835
|
-
* Obtain the length of the media request in pixels.
|
|
2836
|
-
* Copy from original source `function inspectLength (length)`
|
|
2837
|
-
* {@link https://github.com/hail2u/node-css-mqpacker/blob/master/index.js#L58}
|
|
2838
|
-
* @private
|
|
2839
|
-
* @param {string} length
|
|
2840
|
-
* @return {number}
|
|
2841
|
-
*/
|
|
2842
|
-
function _getQueryLength (length) {
|
|
2843
|
-
length = /(-?\d*\.?\d+)(ch|em|ex|px|rem)/.exec(length);
|
|
2844
|
-
|
|
2845
|
-
if (length === null) {
|
|
2846
|
-
return maxValue
|
|
2847
|
-
}
|
|
2848
|
-
|
|
2849
|
-
let number = length[1];
|
|
2850
|
-
const unit = length[2];
|
|
2851
|
-
|
|
2852
|
-
switch (unit) {
|
|
2853
|
-
case 'ch':
|
|
2854
|
-
number = parseFloat(number) * 8.8984375;
|
|
2855
|
-
break
|
|
2856
|
-
|
|
2857
|
-
case 'em':
|
|
2858
|
-
case 'rem':
|
|
2859
|
-
number = parseFloat(number) * 16;
|
|
2860
|
-
break
|
|
2861
|
-
|
|
2862
|
-
case 'ex':
|
|
2863
|
-
number = parseFloat(number) * 8.296875;
|
|
2864
|
-
break
|
|
2865
|
-
|
|
2866
|
-
case 'px':
|
|
2867
|
-
number = parseFloat(number);
|
|
2868
|
-
break
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2871
|
-
return +number
|
|
2872
|
-
}
|
|
2873
|
-
|
|
2874
|
-
/**
|
|
2875
|
-
* Wrapper for creating test functions
|
|
2876
|
-
* @private
|
|
2877
|
-
* @param {RegExp} doubleTestTrue
|
|
2878
|
-
* @param {RegExp} doubleTestFalse
|
|
2879
|
-
* @param {RegExp} singleTest
|
|
2880
|
-
* @return {Function}
|
|
2881
|
-
*/
|
|
2882
|
-
function _testQuery (doubleTestTrue, doubleTestFalse, singleTest) {
|
|
2883
|
-
/**
|
|
2884
|
-
* @param {string} query
|
|
2885
|
-
* @return {boolean}
|
|
2886
|
-
*/
|
|
2887
|
-
return function (query) {
|
|
2888
|
-
if (doubleTestTrue.test(query)) {
|
|
2889
|
-
return true
|
|
2890
|
-
} else if (doubleTestFalse.test(query)) {
|
|
2891
|
-
return false
|
|
2892
|
-
}
|
|
2893
|
-
return singleTest.test(query)
|
|
2894
|
-
}
|
|
2895
|
-
}
|
|
2896
|
-
|
|
2897
|
-
/**
|
|
2898
|
-
* @private
|
|
2899
|
-
* @param {string} a
|
|
2900
|
-
* @param {string} b
|
|
2901
|
-
* @return {number|null}
|
|
2902
|
-
*/
|
|
2903
|
-
function _testIsPrint (a, b) {
|
|
2904
|
-
const isPrintA = isPrint.test(a);
|
|
2905
|
-
const isPrintOnlyA = isPrintOnly.test(a);
|
|
2906
|
-
|
|
2907
|
-
const isPrintB = isPrint.test(b);
|
|
2908
|
-
const isPrintOnlyB = isPrintOnly.test(b);
|
|
2909
|
-
|
|
2910
|
-
if (isPrintA && isPrintB) {
|
|
2911
|
-
if (!isPrintOnlyA && isPrintOnlyB) {
|
|
2912
|
-
return 1
|
|
2913
|
-
}
|
|
2914
|
-
if (isPrintOnlyA && !isPrintOnlyB) {
|
|
2915
|
-
return -1
|
|
2916
|
-
}
|
|
2917
|
-
return a.localeCompare(b)
|
|
2918
|
-
}
|
|
2919
|
-
if (isPrintA) {
|
|
2920
|
-
return 1
|
|
2921
|
-
}
|
|
2922
|
-
if (isPrintB) {
|
|
2923
|
-
return -1
|
|
2924
|
-
}
|
|
2925
|
-
|
|
2926
|
-
return null
|
|
2786
|
+
exports.__assign = function () {
|
|
2787
|
+
exports.__assign =
|
|
2788
|
+
Object.assign ||
|
|
2789
|
+
function __assign(t) {
|
|
2790
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2791
|
+
s = arguments[i];
|
|
2792
|
+
for (var p in s)
|
|
2793
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2794
|
+
}
|
|
2795
|
+
return t;
|
|
2796
|
+
};
|
|
2797
|
+
return exports.__assign.apply(this, arguments);
|
|
2798
|
+
};
|
|
2799
|
+
} (_tslib));
|
|
2800
|
+
return _tslib;
|
|
2927
2801
|
}
|
|
2928
2802
|
|
|
2929
|
-
|
|
2930
|
-
// Public
|
|
2931
|
-
// ----------------------------------------
|
|
2932
|
-
|
|
2933
|
-
/**
|
|
2934
|
-
* Sorting an array with media queries
|
|
2935
|
-
* according to the mobile-first methodology.
|
|
2936
|
-
* @param {string} a
|
|
2937
|
-
* @param {string} b
|
|
2938
|
-
* @return {number} 1 / 0 / -1
|
|
2939
|
-
*/
|
|
2940
|
-
function sortCSSmq$1 (a, b) {
|
|
2941
|
-
const testIsPrint = _testIsPrint(a, b);
|
|
2942
|
-
if (testIsPrint !== null) {
|
|
2943
|
-
return testIsPrint
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
const minA = isMinWidth(a) || isMinHeight(a);
|
|
2947
|
-
const maxA = isMaxWidth(a) || isMaxHeight(a);
|
|
2803
|
+
var require$$1 = /*@__PURE__*/getAugmentedNamespace(jss_esm);
|
|
2948
2804
|
|
|
2949
|
-
|
|
2950
|
-
|
|
2805
|
+
var sortCssMediaQueries;
|
|
2806
|
+
var hasRequiredSortCssMediaQueries;
|
|
2807
|
+
|
|
2808
|
+
function requireSortCssMediaQueries () {
|
|
2809
|
+
if (hasRequiredSortCssMediaQueries) return sortCssMediaQueries;
|
|
2810
|
+
hasRequiredSortCssMediaQueries = 1;
|
|
2811
|
+
|
|
2812
|
+
/**
|
|
2813
|
+
* The custom `sort` method for
|
|
2814
|
+
* for the [`css-mqpacker`](https://www.npmjs.com/package/css-mqpacker) or
|
|
2815
|
+
* [`pleeease`](https://www.npmjs.com/package/pleeease) which using `css-mqpacker`
|
|
2816
|
+
* or, perhaps, something else ))
|
|
2817
|
+
*
|
|
2818
|
+
* @module sort-css-media-queries
|
|
2819
|
+
* @author Oleg Dutchenko <dutchenko.o.wezom@gmail.com>
|
|
2820
|
+
* @version 1.5.0
|
|
2821
|
+
*/
|
|
2822
|
+
|
|
2823
|
+
// ----------------------------------------
|
|
2824
|
+
// Private
|
|
2825
|
+
// ----------------------------------------
|
|
2826
|
+
|
|
2827
|
+
const minMaxWidth = /(!?\(\s*min(-device-)?-width)(.|\n)+\(\s*max(-device)?-width/i;
|
|
2828
|
+
const minWidth = /\(\s*min(-device)?-width/i;
|
|
2829
|
+
const maxMinWidth = /(!?\(\s*max(-device)?-width)(.|\n)+\(\s*min(-device)?-width/i;
|
|
2830
|
+
const maxWidth = /\(\s*max(-device)?-width/i;
|
|
2831
|
+
|
|
2832
|
+
const isMinWidth = _testQuery(minMaxWidth, maxMinWidth, minWidth);
|
|
2833
|
+
const isMaxWidth = _testQuery(maxMinWidth, minMaxWidth, maxWidth);
|
|
2834
|
+
|
|
2835
|
+
const minMaxHeight = /(!?\(\s*min(-device)?-height)(.|\n)+\(\s*max(-device)?-height/i;
|
|
2836
|
+
const minHeight = /\(\s*min(-device)?-height/i;
|
|
2837
|
+
const maxMinHeight = /(!?\(\s*max(-device)?-height)(.|\n)+\(\s*min(-device)?-height/i;
|
|
2838
|
+
const maxHeight = /\(\s*max(-device)?-height/i;
|
|
2839
|
+
|
|
2840
|
+
const isMinHeight = _testQuery(minMaxHeight, maxMinHeight, minHeight);
|
|
2841
|
+
const isMaxHeight = _testQuery(maxMinHeight, minMaxHeight, maxHeight);
|
|
2842
|
+
|
|
2843
|
+
const isPrint = /print/i;
|
|
2844
|
+
const isPrintOnly = /^print$/i;
|
|
2845
|
+
|
|
2846
|
+
const maxValue = Number.MAX_VALUE;
|
|
2847
|
+
|
|
2848
|
+
/**
|
|
2849
|
+
* Obtain the length of the media request in pixels.
|
|
2850
|
+
* Copy from original source `function inspectLength (length)`
|
|
2851
|
+
* {@link https://github.com/hail2u/node-css-mqpacker/blob/master/index.js#L58}
|
|
2852
|
+
* @private
|
|
2853
|
+
* @param {string} length
|
|
2854
|
+
* @return {number}
|
|
2855
|
+
*/
|
|
2856
|
+
function _getQueryLength (length) {
|
|
2857
|
+
length = /(-?\d*\.?\d+)(ch|em|ex|px|rem)/.exec(length);
|
|
2858
|
+
|
|
2859
|
+
if (length === null) {
|
|
2860
|
+
return maxValue
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
let number = length[1];
|
|
2864
|
+
const unit = length[2];
|
|
2865
|
+
|
|
2866
|
+
switch (unit) {
|
|
2867
|
+
case 'ch':
|
|
2868
|
+
number = parseFloat(number) * 8.8984375;
|
|
2869
|
+
break
|
|
2870
|
+
|
|
2871
|
+
case 'em':
|
|
2872
|
+
case 'rem':
|
|
2873
|
+
number = parseFloat(number) * 16;
|
|
2874
|
+
break
|
|
2875
|
+
|
|
2876
|
+
case 'ex':
|
|
2877
|
+
number = parseFloat(number) * 8.296875;
|
|
2878
|
+
break
|
|
2879
|
+
|
|
2880
|
+
case 'px':
|
|
2881
|
+
number = parseFloat(number);
|
|
2882
|
+
break
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
return +number
|
|
2886
|
+
}
|
|
2951
2887
|
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2888
|
+
/**
|
|
2889
|
+
* Wrapper for creating test functions
|
|
2890
|
+
* @private
|
|
2891
|
+
* @param {RegExp} doubleTestTrue
|
|
2892
|
+
* @param {RegExp} doubleTestFalse
|
|
2893
|
+
* @param {RegExp} singleTest
|
|
2894
|
+
* @return {Function}
|
|
2895
|
+
*/
|
|
2896
|
+
function _testQuery (doubleTestTrue, doubleTestFalse, singleTest) {
|
|
2897
|
+
/**
|
|
2898
|
+
* @param {string} query
|
|
2899
|
+
* @return {boolean}
|
|
2900
|
+
*/
|
|
2901
|
+
return function (query) {
|
|
2902
|
+
if (doubleTestTrue.test(query)) {
|
|
2903
|
+
return true
|
|
2904
|
+
} else if (doubleTestFalse.test(query)) {
|
|
2905
|
+
return false
|
|
2906
|
+
}
|
|
2907
|
+
return singleTest.test(query)
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2958
2910
|
|
|
2959
|
-
|
|
2960
|
-
|
|
2911
|
+
/**
|
|
2912
|
+
* @private
|
|
2913
|
+
* @param {string} a
|
|
2914
|
+
* @param {string} b
|
|
2915
|
+
* @return {number|null}
|
|
2916
|
+
*/
|
|
2917
|
+
function _testIsPrint (a, b) {
|
|
2918
|
+
const isPrintA = isPrint.test(a);
|
|
2919
|
+
const isPrintOnlyA = isPrintOnly.test(a);
|
|
2920
|
+
|
|
2921
|
+
const isPrintB = isPrint.test(b);
|
|
2922
|
+
const isPrintOnlyB = isPrintOnly.test(b);
|
|
2923
|
+
|
|
2924
|
+
if (isPrintA && isPrintB) {
|
|
2925
|
+
if (!isPrintOnlyA && isPrintOnlyB) {
|
|
2926
|
+
return 1
|
|
2927
|
+
}
|
|
2928
|
+
if (isPrintOnlyA && !isPrintOnlyB) {
|
|
2929
|
+
return -1
|
|
2930
|
+
}
|
|
2931
|
+
return a.localeCompare(b)
|
|
2932
|
+
}
|
|
2933
|
+
if (isPrintA) {
|
|
2934
|
+
return 1
|
|
2935
|
+
}
|
|
2936
|
+
if (isPrintB) {
|
|
2937
|
+
return -1
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
return null
|
|
2941
|
+
}
|
|
2961
2942
|
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2943
|
+
// ----------------------------------------
|
|
2944
|
+
// Public
|
|
2945
|
+
// ----------------------------------------
|
|
2946
|
+
|
|
2947
|
+
/**
|
|
2948
|
+
* Sorting an array with media queries
|
|
2949
|
+
* according to the mobile-first methodology.
|
|
2950
|
+
* @param {string} a
|
|
2951
|
+
* @param {string} b
|
|
2952
|
+
* @return {number} 1 / 0 / -1
|
|
2953
|
+
*/
|
|
2954
|
+
function sortCSSmq (a, b) {
|
|
2955
|
+
const testIsPrint = _testIsPrint(a, b);
|
|
2956
|
+
if (testIsPrint !== null) {
|
|
2957
|
+
return testIsPrint
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
const minA = isMinWidth(a) || isMinHeight(a);
|
|
2961
|
+
const maxA = isMaxWidth(a) || isMaxHeight(a);
|
|
2962
|
+
|
|
2963
|
+
const minB = isMinWidth(b) || isMinHeight(b);
|
|
2964
|
+
const maxB = isMaxWidth(b) || isMaxHeight(b);
|
|
2965
|
+
|
|
2966
|
+
if (minA && maxB) {
|
|
2967
|
+
return -1
|
|
2968
|
+
}
|
|
2969
|
+
if (maxA && minB) {
|
|
2970
|
+
return 1
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2973
|
+
let lengthA = _getQueryLength(a);
|
|
2974
|
+
let lengthB = _getQueryLength(b);
|
|
2975
|
+
|
|
2976
|
+
if (lengthA === maxValue && lengthB === maxValue) {
|
|
2977
|
+
return a.localeCompare(b)
|
|
2978
|
+
} else if (lengthA === maxValue) {
|
|
2979
|
+
return 1
|
|
2980
|
+
} else if (lengthB === maxValue) {
|
|
2981
|
+
return -1
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
if (lengthA > lengthB) {
|
|
2985
|
+
if (maxA) {
|
|
2986
|
+
return -1
|
|
2987
|
+
}
|
|
2988
|
+
return 1
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
if (lengthA < lengthB) {
|
|
2992
|
+
if (maxA) {
|
|
2993
|
+
return 1
|
|
2994
|
+
}
|
|
2995
|
+
return -1
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
return a.localeCompare(b)
|
|
2999
|
+
}
|
|
2969
3000
|
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
3001
|
+
/**
|
|
3002
|
+
* Sorting an array with media queries
|
|
3003
|
+
* according to the desktop-first methodology.
|
|
3004
|
+
* @param {string} a
|
|
3005
|
+
* @param {string} b
|
|
3006
|
+
* @return {number} 1 / 0 / -1
|
|
3007
|
+
*/
|
|
3008
|
+
sortCSSmq.desktopFirst = function (a, b) {
|
|
3009
|
+
const testIsPrint = _testIsPrint(a, b);
|
|
3010
|
+
if (testIsPrint !== null) {
|
|
3011
|
+
return testIsPrint
|
|
3012
|
+
}
|
|
3013
|
+
|
|
3014
|
+
const minA = isMinWidth(a) || isMinHeight(a);
|
|
3015
|
+
const maxA = isMaxWidth(a) || isMaxHeight(a);
|
|
3016
|
+
|
|
3017
|
+
const minB = isMinWidth(b) || isMinHeight(b);
|
|
3018
|
+
const maxB = isMaxWidth(b) || isMaxHeight(b);
|
|
3019
|
+
|
|
3020
|
+
if (minA && maxB) {
|
|
3021
|
+
return 1
|
|
3022
|
+
}
|
|
3023
|
+
if (maxA && minB) {
|
|
3024
|
+
return -1
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
const lengthA = _getQueryLength(a);
|
|
3028
|
+
const lengthB = _getQueryLength(b);
|
|
3029
|
+
|
|
3030
|
+
if (lengthA === maxValue && lengthB === maxValue) {
|
|
3031
|
+
return a.localeCompare(b)
|
|
3032
|
+
} else if (lengthA === maxValue) {
|
|
3033
|
+
return 1
|
|
3034
|
+
} else if (lengthB === maxValue) {
|
|
3035
|
+
return -1
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
if (lengthA > lengthB) {
|
|
3039
|
+
if (maxA) {
|
|
3040
|
+
return -1
|
|
3041
|
+
}
|
|
3042
|
+
return 1
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
if (lengthA < lengthB) {
|
|
3046
|
+
if (maxA) {
|
|
3047
|
+
return 1
|
|
3048
|
+
}
|
|
3049
|
+
return -1
|
|
3050
|
+
}
|
|
3051
|
+
|
|
3052
|
+
return -(a.localeCompare(b))
|
|
3053
|
+
};
|
|
2976
3054
|
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
}
|
|
2981
|
-
return -1
|
|
2982
|
-
}
|
|
3055
|
+
// ----------------------------------------
|
|
3056
|
+
// Exports
|
|
3057
|
+
// ----------------------------------------
|
|
2983
3058
|
|
|
2984
|
-
|
|
3059
|
+
sortCssMediaQueries = sortCSSmq;
|
|
3060
|
+
return sortCssMediaQueries;
|
|
2985
3061
|
}
|
|
2986
3062
|
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
* according to the desktop-first methodology.
|
|
2990
|
-
* @param {string} a
|
|
2991
|
-
* @param {string} b
|
|
2992
|
-
* @return {number} 1 / 0 / -1
|
|
2993
|
-
*/
|
|
2994
|
-
sortCSSmq$1.desktopFirst = function (a, b) {
|
|
2995
|
-
const testIsPrint = _testIsPrint(a, b);
|
|
2996
|
-
if (testIsPrint !== null) {
|
|
2997
|
-
return testIsPrint
|
|
2998
|
-
}
|
|
2999
|
-
|
|
3000
|
-
const minA = isMinWidth(a) || isMinHeight(a);
|
|
3001
|
-
const maxA = isMaxWidth(a) || isMaxHeight(a);
|
|
3002
|
-
|
|
3003
|
-
const minB = isMinWidth(b) || isMinHeight(b);
|
|
3004
|
-
const maxB = isMaxWidth(b) || isMaxHeight(b);
|
|
3005
|
-
|
|
3006
|
-
if (minA && maxB) {
|
|
3007
|
-
return 1
|
|
3008
|
-
}
|
|
3009
|
-
if (maxA && minB) {
|
|
3010
|
-
return -1
|
|
3011
|
-
}
|
|
3012
|
-
|
|
3013
|
-
const lengthA = _getQueryLength(a);
|
|
3014
|
-
const lengthB = _getQueryLength(b);
|
|
3015
|
-
|
|
3016
|
-
if (lengthA === maxValue && lengthB === maxValue) {
|
|
3017
|
-
return a.localeCompare(b)
|
|
3018
|
-
} else if (lengthA === maxValue) {
|
|
3019
|
-
return 1
|
|
3020
|
-
} else if (lengthB === maxValue) {
|
|
3021
|
-
return -1
|
|
3022
|
-
}
|
|
3023
|
-
|
|
3024
|
-
if (lengthA > lengthB) {
|
|
3025
|
-
if (maxA) {
|
|
3026
|
-
return -1
|
|
3027
|
-
}
|
|
3028
|
-
return 1
|
|
3029
|
-
}
|
|
3030
|
-
|
|
3031
|
-
if (lengthA < lengthB) {
|
|
3032
|
-
if (maxA) {
|
|
3033
|
-
return 1
|
|
3034
|
-
}
|
|
3035
|
-
return -1
|
|
3036
|
-
}
|
|
3037
|
-
|
|
3038
|
-
return -(a.localeCompare(b))
|
|
3039
|
-
};
|
|
3040
|
-
|
|
3041
|
-
// ----------------------------------------
|
|
3042
|
-
// Exports
|
|
3043
|
-
// ----------------------------------------
|
|
3063
|
+
var dist;
|
|
3064
|
+
var hasRequiredDist;
|
|
3044
3065
|
|
|
3045
|
-
|
|
3066
|
+
function requireDist () {
|
|
3067
|
+
if (hasRequiredDist) return dist;
|
|
3068
|
+
hasRequiredDist = 1;
|
|
3046
3069
|
|
|
3047
|
-
var _tslib =
|
|
3048
|
-
var jss
|
|
3049
|
-
var sortCSSmq =
|
|
3070
|
+
var _tslib = require_tslib();
|
|
3071
|
+
var jss = require$$1;
|
|
3072
|
+
var sortCSSmq = requireSortCssMediaQueries();
|
|
3050
3073
|
|
|
3051
|
-
function _interopDefaultLegacy(e) {
|
|
3052
|
-
|
|
3053
|
-
}
|
|
3074
|
+
function _interopDefaultLegacy(e) {
|
|
3075
|
+
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
3076
|
+
}
|
|
3054
3077
|
|
|
3055
|
-
var sortCSSmq__default = /*#__PURE__*/ _interopDefaultLegacy(sortCSSmq);
|
|
3078
|
+
var sortCSSmq__default = /*#__PURE__*/ _interopDefaultLegacy(sortCSSmq);
|
|
3056
3079
|
|
|
3057
|
-
function isPlainObject(sample) {
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
}
|
|
3062
|
-
var UN_QUERIED = '__UN_QUERIED';
|
|
3063
|
-
function recursiveInnerAndGetQueries(pluginOptions, rules) {
|
|
3064
|
-
var queries = {
|
|
3065
|
-
groups: {},
|
|
3066
|
-
groupsSortNames: []
|
|
3067
|
-
};
|
|
3068
|
-
for (var index = 0; index < rules.length; index++) {
|
|
3069
|
-
var rule = rules[index];
|
|
3070
|
-
var query =
|
|
3071
|
-
rule.type === 'conditional' && typeof rule.query === 'string'
|
|
3072
|
-
? rule.query
|
|
3073
|
-
: UN_QUERIED;
|
|
3074
|
-
if (!queries.groups.hasOwnProperty(query)) {
|
|
3075
|
-
queries.groupsSortNames.push(query);
|
|
3076
|
-
queries.groups[query] = [];
|
|
3077
|
-
}
|
|
3078
|
-
queries.groups[query].push(index);
|
|
3079
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3080
|
-
recursive(pluginOptions, rule);
|
|
3080
|
+
function isPlainObject(sample) {
|
|
3081
|
+
return (
|
|
3082
|
+
sample !== null && typeof sample === 'object' && Array.isArray(sample) === false
|
|
3083
|
+
);
|
|
3081
3084
|
}
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
var
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3085
|
+
var UN_QUERIED = '__UN_QUERIED';
|
|
3086
|
+
function recursiveInnerAndGetQueries(pluginOptions, rules) {
|
|
3087
|
+
var queries = {
|
|
3088
|
+
groups: {},
|
|
3089
|
+
groupsSortNames: []
|
|
3090
|
+
};
|
|
3091
|
+
for (var index = 0; index < rules.length; index++) {
|
|
3092
|
+
var rule = rules[index];
|
|
3093
|
+
var query =
|
|
3094
|
+
rule.type === 'conditional' && typeof rule.query === 'string'
|
|
3095
|
+
? rule.query
|
|
3096
|
+
: UN_QUERIED;
|
|
3097
|
+
if (!queries.groups.hasOwnProperty(query)) {
|
|
3098
|
+
queries.groupsSortNames.push(query);
|
|
3099
|
+
queries.groups[query] = [];
|
|
3090
3100
|
}
|
|
3091
|
-
|
|
3092
|
-
|
|
3101
|
+
queries.groups[query].push(index);
|
|
3102
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3103
|
+
recursive(pluginOptions, rule);
|
|
3093
3104
|
}
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
if (options === void 0) {
|
|
3101
|
-
options = {};
|
|
3102
|
-
}
|
|
3103
|
-
var str = '';
|
|
3104
|
-
var sheet = this.options.sheet;
|
|
3105
|
-
var link = sheet ? sheet.options.link : false;
|
|
3106
|
-
var _a = recursiveInnerAndGetQueries(pluginOptions, this.index),
|
|
3107
|
-
groups = _a.groups,
|
|
3108
|
-
groupsSortNames = _a.groupsSortNames;
|
|
3109
|
-
for (var i = 0; i < groupsSortNames.length; i++) {
|
|
3110
|
-
var groupName = groupsSortNames[i];
|
|
3111
|
-
var group = groups[groupsSortNames[i]];
|
|
3112
|
-
if (groupName !== UN_QUERIED && pluginOptions.combineMediaQueries) {
|
|
3113
|
-
str += '\n' + groupName + ' {';
|
|
3114
|
-
for (var i_1 = 0; i_1 < group.length; i_1++) {
|
|
3115
|
-
var rule = this.index[group[i_1]];
|
|
3116
|
-
var css = rule.rules.toString(
|
|
3117
|
-
_tslib.__assign(_tslib.__assign({}, options), {
|
|
3118
|
-
indent: (options.indent || 0) + 1
|
|
3119
|
-
})
|
|
3120
|
-
);
|
|
3121
|
-
if (!css && !link) continue;
|
|
3122
|
-
if (str) str += '\n';
|
|
3123
|
-
str += css;
|
|
3124
|
-
}
|
|
3125
|
-
str += '\n}\n';
|
|
3105
|
+
queries.groupsSortNames.sort(function (a, b) {
|
|
3106
|
+
var aWeight = a === UN_QUERIED ? 0 : a.length;
|
|
3107
|
+
var bWeight = b === UN_QUERIED ? 0 : b.length;
|
|
3108
|
+
if (aWeight > 0 && bWeight > 0) {
|
|
3109
|
+
if (pluginOptions.desktopFirst) {
|
|
3110
|
+
return sortCSSmq__default['default'].desktopFirst(a, b);
|
|
3126
3111
|
} else {
|
|
3127
|
-
|
|
3128
|
-
var rule = this.index[group[i_2]];
|
|
3129
|
-
var css = rule.toString(options);
|
|
3130
|
-
if (!css && !link) continue;
|
|
3131
|
-
if (str) str += '\n';
|
|
3132
|
-
str += css;
|
|
3133
|
-
}
|
|
3112
|
+
return sortCSSmq__default['default'](a, b);
|
|
3134
3113
|
}
|
|
3114
|
+
} else {
|
|
3115
|
+
return aWeight - bWeight;
|
|
3135
3116
|
}
|
|
3136
|
-
|
|
3137
|
-
|
|
3117
|
+
});
|
|
3118
|
+
return queries;
|
|
3138
3119
|
}
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3120
|
+
function recursive(pluginOptions, data) {
|
|
3121
|
+
if (isPlainObject(data) && data.rules instanceof jss.RuleList) {
|
|
3122
|
+
data.rules.toString = function (options) {
|
|
3123
|
+
if (options === void 0) {
|
|
3124
|
+
options = {};
|
|
3125
|
+
}
|
|
3126
|
+
var str = '';
|
|
3127
|
+
var sheet = this.options.sheet;
|
|
3128
|
+
var link = sheet ? sheet.options.link : false;
|
|
3129
|
+
var _a = recursiveInnerAndGetQueries(pluginOptions, this.index),
|
|
3130
|
+
groups = _a.groups,
|
|
3131
|
+
groupsSortNames = _a.groupsSortNames;
|
|
3132
|
+
for (var i = 0; i < groupsSortNames.length; i++) {
|
|
3133
|
+
var groupName = groupsSortNames[i];
|
|
3134
|
+
var group = groups[groupsSortNames[i]];
|
|
3135
|
+
if (groupName !== UN_QUERIED && pluginOptions.combineMediaQueries) {
|
|
3136
|
+
str += '\n' + groupName + ' {';
|
|
3137
|
+
for (var i_1 = 0; i_1 < group.length; i_1++) {
|
|
3138
|
+
var rule = this.index[group[i_1]];
|
|
3139
|
+
var css = rule.rules.toString(
|
|
3140
|
+
_tslib.__assign(_tslib.__assign({}, options), {
|
|
3141
|
+
indent: (options.indent || 0) + 1
|
|
3142
|
+
})
|
|
3143
|
+
);
|
|
3144
|
+
if (!css && !link) continue;
|
|
3145
|
+
if (str) str += '\n';
|
|
3146
|
+
str += css;
|
|
3147
|
+
}
|
|
3148
|
+
str += '\n}\n';
|
|
3149
|
+
} else {
|
|
3150
|
+
for (var i_2 = 0; i_2 < group.length; i_2++) {
|
|
3151
|
+
var rule = this.index[group[i_2]];
|
|
3152
|
+
var css = rule.toString(options);
|
|
3153
|
+
if (!css && !link) continue;
|
|
3154
|
+
if (str) str += '\n';
|
|
3155
|
+
str += css;
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
return str;
|
|
3160
|
+
};
|
|
3161
|
+
}
|
|
3143
3162
|
}
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3163
|
+
function jssCombineAndSortMQ(options) {
|
|
3164
|
+
if (options === void 0) {
|
|
3165
|
+
options = {};
|
|
3147
3166
|
}
|
|
3148
|
-
|
|
3149
|
-
|
|
3167
|
+
return {
|
|
3168
|
+
onProcessSheet: function (sheet) {
|
|
3169
|
+
recursive(options, sheet);
|
|
3170
|
+
}
|
|
3171
|
+
};
|
|
3172
|
+
}
|
|
3150
3173
|
|
|
3151
|
-
|
|
3174
|
+
dist = jssCombineAndSortMQ;
|
|
3175
|
+
return dist;
|
|
3176
|
+
}
|
|
3152
3177
|
|
|
3153
|
-
var
|
|
3178
|
+
var distExports = requireDist();
|
|
3179
|
+
var jssPluginSortMediaQueries = /*@__PURE__*/getDefaultExportFromCjs(distExports);
|
|
3154
3180
|
|
|
3155
3181
|
// This class is shared since the popover needs to register a scroll listener to this node in order to hide the popover when the table is scrolled
|
|
3156
3182
|
const scrollAreaClass = 'scroll-area';
|
|
@@ -3166,7 +3192,7 @@ function getHTMLElement(element, selector) {
|
|
|
3166
3192
|
|
|
3167
3193
|
const transformSelectorToDirectChildSelector = (selector) => selector
|
|
3168
3194
|
.split(',')
|
|
3169
|
-
.map((part) =>
|
|
3195
|
+
.map((part) => `:scope>${part}`)
|
|
3170
3196
|
.join();
|
|
3171
3197
|
|
|
3172
3198
|
/* eslint-disable prefer-arrow/prefer-arrow-functions */
|
|
@@ -3183,7 +3209,7 @@ function getDirectChildHTMLElement(element, selector) {
|
|
|
3183
3209
|
|
|
3184
3210
|
const hasSpecificDirectChildTag = (host, tag) => {
|
|
3185
3211
|
const el = getDirectChildHTMLElement(host, ':only-child');
|
|
3186
|
-
return !!
|
|
3212
|
+
return !!el?.matches(tag);
|
|
3187
3213
|
};
|
|
3188
3214
|
|
|
3189
3215
|
const isDisabledOrLoading = (disabled, loading) => {
|
|
@@ -3199,7 +3225,7 @@ const parseJSONAttribute = (attribute) => {
|
|
|
3199
3225
|
// Convert single quotes to double quotes except the ones which are escaped by backslash
|
|
3200
3226
|
.replace(/\\'/g, '__escaped_single_quote__')
|
|
3201
3227
|
.replace(/'/g, '"')
|
|
3202
|
-
.replace(/__escaped_single_quote__/g, '
|
|
3228
|
+
.replace(/__escaped_single_quote__/g, "\\'")
|
|
3203
3229
|
// Remove string escapes except the ones followed by unicode u0027
|
|
3204
3230
|
.replace(/([^\\])\\(?!u0027)/g, '$1')
|
|
3205
3231
|
// Wrap keys in double quotes
|
|
@@ -3355,12 +3381,13 @@ supportsConstructableStylesheets();
|
|
|
3355
3381
|
const attributeMutationMap = new Map();
|
|
3356
3382
|
hasWindow &&
|
|
3357
3383
|
new MutationObserver((mutations) => {
|
|
3358
|
-
mutations
|
|
3384
|
+
for (const mutation of mutations
|
|
3359
3385
|
// reduce array to only entries that have really a changed value
|
|
3360
3386
|
.filter((mutation) => mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName))
|
|
3361
3387
|
// remove duplicates so we execute callback only once per node
|
|
3362
|
-
.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
|
|
3363
|
-
|
|
3388
|
+
.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)) {
|
|
3389
|
+
attributeMutationMap.get(mutation.target)?.();
|
|
3390
|
+
}
|
|
3364
3391
|
});
|
|
3365
3392
|
|
|
3366
3393
|
const mediaQueries = Object.values(breakpoint).map((v) => `(min-width:${v}px)`);
|
|
@@ -3382,17 +3409,14 @@ const observedNodesMap = new Map();
|
|
|
3382
3409
|
hasWindow &&
|
|
3383
3410
|
new MutationObserver((mutations) => {
|
|
3384
3411
|
// there may be race conditions in jsdom-polyfill tests where the map is already empty when a mutation happens
|
|
3385
|
-
if (observedNodesMap.size) {
|
|
3412
|
+
if (observedNodesMap.size > 0) {
|
|
3386
3413
|
const observedNodes = Array.from(observedNodesMap.keys());
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
.filter((node) => node.contains(mutation.target))
|
|
3394
|
-
.forEach((node) => observedNodesMap.get(node)?.());
|
|
3395
|
-
});
|
|
3414
|
+
// remove duplicates so we execute callback only once per node
|
|
3415
|
+
for (const mutation of mutations.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)) {
|
|
3416
|
+
for (const node of observedNodes.filter((node) => node.contains(mutation.target))) {
|
|
3417
|
+
observedNodesMap.get(node)?.();
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3396
3420
|
}
|
|
3397
3421
|
});
|
|
3398
3422
|
|
|
@@ -3503,7 +3527,7 @@ const supportsNativePopover = () => {
|
|
|
3503
3527
|
if (!hasWindow) {
|
|
3504
3528
|
return false;
|
|
3505
3529
|
}
|
|
3506
|
-
return
|
|
3530
|
+
return Object.prototype.hasOwnProperty.call(HTMLElement.prototype, 'popover');
|
|
3507
3531
|
};
|
|
3508
3532
|
// determine it once
|
|
3509
3533
|
supportsNativePopover();
|
|
@@ -3521,8 +3545,7 @@ const formatObjectOutput = (value) => {
|
|
|
3521
3545
|
.replace(/(})/g, ' $1') // add space before following: }
|
|
3522
3546
|
.replace(/^"(.+)"$/, '$1'); // remove wrapping double quotes
|
|
3523
3547
|
};
|
|
3524
|
-
'value, '
|
|
3525
|
-
formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '');
|
|
3548
|
+
`value, ${formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '')}`;
|
|
3526
3549
|
const getButtonPureAriaAttributes = (isDisabled, isLoading, aria) => {
|
|
3527
3550
|
return {
|
|
3528
3551
|
...parseAndGetAriaAttributes(aria),
|
|
@@ -3568,12 +3591,10 @@ const getDisplayTagType = (host, size, tag) => {
|
|
|
3568
3591
|
if (hasSpecificDirectChildTag(host, DISPLAY_TAGS.join())) {
|
|
3569
3592
|
return 'div';
|
|
3570
3593
|
}
|
|
3571
|
-
|
|
3594
|
+
if (tag) {
|
|
3572
3595
|
return tag;
|
|
3573
3596
|
}
|
|
3574
|
-
|
|
3575
|
-
return displaySizeToTagMap[size] || 'h1';
|
|
3576
|
-
}
|
|
3597
|
+
return displaySizeToTagMap[size] || 'h1';
|
|
3577
3598
|
};
|
|
3578
3599
|
const headingSizeToTagMap = {
|
|
3579
3600
|
small: 'h6',
|
|
@@ -3587,12 +3608,10 @@ const getHeadingTagType = (host, size, tag) => {
|
|
|
3587
3608
|
if (hasSpecificDirectChildTag(host, HEADING_TAGS.join())) {
|
|
3588
3609
|
return 'div';
|
|
3589
3610
|
}
|
|
3590
|
-
|
|
3611
|
+
if (tag) {
|
|
3591
3612
|
return tag;
|
|
3592
3613
|
}
|
|
3593
|
-
|
|
3594
|
-
return headingSizeToTagMap[size] || 'h2';
|
|
3595
|
-
}
|
|
3614
|
+
return headingSizeToTagMap[size] || 'h2';
|
|
3596
3615
|
};
|
|
3597
3616
|
const HEADLINE_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
3598
3617
|
const variantToTagMap = {
|
|
@@ -3607,12 +3626,10 @@ const getHeadlineTagType = (host, variant, tag) => {
|
|
|
3607
3626
|
if (hasSpecificDirectChildTag(host, HEADLINE_TAGS.join())) {
|
|
3608
3627
|
return 'div';
|
|
3609
3628
|
}
|
|
3610
|
-
|
|
3629
|
+
if (tag) {
|
|
3611
3630
|
return tag;
|
|
3612
3631
|
}
|
|
3613
|
-
|
|
3614
|
-
return variantToTagMap[variant] || 'h1';
|
|
3615
|
-
}
|
|
3632
|
+
return variantToTagMap[variant] || 'h1';
|
|
3616
3633
|
};
|
|
3617
3634
|
const isUrl = (str) => str?.length > 0 && /(\/)/.test(str);
|
|
3618
3635
|
const DEFAULT_ICON_NAME = 'arrow-right';
|
|
@@ -3621,10 +3638,10 @@ const buildIconUrl = (iconNameOrSource = DEFAULT_ICON_NAME) => {
|
|
|
3621
3638
|
if (iconNameOrSource === null) {
|
|
3622
3639
|
return buildIconUrl(DEFAULT_ICON_NAME);
|
|
3623
3640
|
}
|
|
3624
|
-
|
|
3641
|
+
if (isUrl(iconNameOrSource)) {
|
|
3625
3642
|
return iconNameOrSource;
|
|
3626
3643
|
}
|
|
3627
|
-
|
|
3644
|
+
if (ICONS_MANIFEST[iconNameOrSource]) {
|
|
3628
3645
|
return `${getCDNBaseURL()}/icons/${ICONS_MANIFEST[iconNameOrSource]}`;
|
|
3629
3646
|
}
|
|
3630
3647
|
return buildIconUrl(DEFAULT_ICON_NAME);
|
|
@@ -3698,7 +3715,7 @@ const createPageFunctionFactory = ({ activePage }) => {
|
|
|
3698
3715
|
isAfterAfterCurrent: pageNumber === activePage + 2,
|
|
3699
3716
|
});
|
|
3700
3717
|
};
|
|
3701
|
-
const createRange = (start, end) => Array.from(Array(end - start + 1), (_, i) => i + start);
|
|
3718
|
+
const createRange = (start, end) => Array.from(new Array(end - start + 1), (_, i) => i + start);
|
|
3702
3719
|
const createPaginationItems = (options) => {
|
|
3703
3720
|
const { pageTotal, activePage, showLastPage } = options;
|
|
3704
3721
|
const pageRange = 1;
|
|
@@ -3745,24 +3762,10 @@ const createPaginationItems = (options) => {
|
|
|
3745
3762
|
return paginationItems;
|
|
3746
3763
|
};
|
|
3747
3764
|
const getCurrentActivePage = (activePage, totalPages) => {
|
|
3748
|
-
|
|
3749
|
-
if (activePage < 1) {
|
|
3750
|
-
activePage = 1;
|
|
3751
|
-
}
|
|
3752
|
-
// If the user has done something like /page/99999 we want to clamp that back down.
|
|
3753
|
-
if (activePage > totalPages) {
|
|
3754
|
-
activePage = totalPages;
|
|
3755
|
-
}
|
|
3756
|
-
return activePage;
|
|
3765
|
+
return activePage < 1 ? 1 : activePage > totalPages ? totalPages : activePage;
|
|
3757
3766
|
};
|
|
3758
3767
|
const getTotalPages = (totalItemsCount, itemsPerPage) => {
|
|
3759
|
-
|
|
3760
|
-
totalItemsCount = 1;
|
|
3761
|
-
}
|
|
3762
|
-
if (itemsPerPage < 1) {
|
|
3763
|
-
itemsPerPage = 1;
|
|
3764
|
-
}
|
|
3765
|
-
return Math.ceil(totalItemsCount / itemsPerPage);
|
|
3768
|
+
return Math.ceil((totalItemsCount < 1 ? 1 : totalItemsCount) / (itemsPerPage < 1 ? 1 : itemsPerPage));
|
|
3766
3769
|
};
|
|
3767
3770
|
/**
|
|
3768
3771
|
* Determines if the current input element corresponds to the first non-filled input
|
|
@@ -3788,7 +3791,7 @@ const getSegmentedControlItemAriaAttributes = (isSelected, isDisabled, ariaProp)
|
|
|
3788
3791
|
...parseAndGetAriaAttributes(ariaProp),
|
|
3789
3792
|
});
|
|
3790
3793
|
const getIconColor = (isDisabled) => {
|
|
3791
|
-
return
|
|
3794
|
+
return isDisabled ? 'contrast-medium' : 'primary';
|
|
3792
3795
|
};
|
|
3793
3796
|
|
|
3794
3797
|
const ITEM_PADDING = '17px';
|
|
@@ -3796,7 +3799,7 @@ const { font: BUTTON_FONT } = textSmallStyle;
|
|
|
3796
3799
|
const { font: LABEL_FONT } = textXSmallStyle;
|
|
3797
3800
|
const ICON_SIZE = '1.5rem';
|
|
3798
3801
|
const ICON_MARGIN = '.25rem';
|
|
3799
|
-
['auto', ...Array.from(Array(25), (_, i) => i + 1)];
|
|
3802
|
+
['auto', ...Array.from(new Array(25), (_, i) => i + 1)];
|
|
3800
3803
|
// Expect Porsche Next to be available and use sans-serif (wide font for safety buffer) as fallback
|
|
3801
3804
|
const tempFont = 'Porsche Next, sans-serif';
|
|
3802
3805
|
// temporary dom node to measure max-width of children content
|
|
@@ -3825,12 +3828,10 @@ const isCustomDropdown = (filter, native) => {
|
|
|
3825
3828
|
if (filter) {
|
|
3826
3829
|
return true;
|
|
3827
3830
|
}
|
|
3828
|
-
|
|
3831
|
+
if (native) {
|
|
3829
3832
|
return false;
|
|
3830
3833
|
}
|
|
3831
|
-
|
|
3832
|
-
return !isTouchDevice();
|
|
3833
|
-
}
|
|
3834
|
+
return !isTouchDevice();
|
|
3834
3835
|
};
|
|
3835
3836
|
const getSelectedOptionString = (options) => options.find((option) => option.selected)?.textContent ?? '';
|
|
3836
3837
|
const isStateCompleteOrWarning = (state) => {
|
|
@@ -3869,9 +3870,7 @@ const getTextTagType = (host, tag) => {
|
|
|
3869
3870
|
if (hasSpecificDirectChildTag(host, TEXT_TAGS.join())) {
|
|
3870
3871
|
return 'div';
|
|
3871
3872
|
}
|
|
3872
|
-
|
|
3873
|
-
return tag;
|
|
3874
|
-
}
|
|
3873
|
+
return tag;
|
|
3875
3874
|
};
|
|
3876
3875
|
|
|
3877
3876
|
exports.DISPLAY_TAGS = DISPLAY_TAGS;
|