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