@porsche-design-system/components-react 3.21.0 → 3.22.0-rc.1
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 +54 -2
- package/ag-grid/theme.css +17 -8
- package/cjs/lib/components/flyout-multilevel-item.wrapper.cjs +3 -3
- package/cjs/lib/components/link-tile-model-signature.wrapper.cjs +1 -1
- package/cjs/lib/components/pin-code.wrapper.cjs +3 -3
- package/cjs/lib/components/segmented-control.wrapper.cjs +3 -3
- package/esm/lib/components/flyout-multilevel-item.wrapper.d.ts +24 -0
- package/esm/lib/components/flyout-multilevel-item.wrapper.mjs +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/components/segmented-control.wrapper.d.ts +24 -0
- package/esm/lib/components/segmented-control.wrapper.mjs +3 -3
- package/esm/lib/components/select.wrapper.d.ts +2 -2
- package/esm/lib/types.d.ts +36 -35
- package/package.json +6 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +882 -738
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +458 -419
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/flyout-multilevel-item.wrapper.cjs +4 -4
- 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/components/segmented-control.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/canvas.cjs +7 -3
- 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/flyout-multilevel-item.cjs +9 -6
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout-multilevel.cjs +13 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.cjs +1 -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/modal.cjs +1 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.cjs +1 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +6 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pagination.cjs +1 -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/segmented-control-item.cjs +3 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.cjs +9 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.cjs +3 -2
- 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 +882 -738
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +454 -420
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/flyout-multilevel-item.wrapper.mjs +4 -4
- 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/components/segmented-control.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/canvas.mjs +7 -3
- 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/flyout-multilevel-item.mjs +9 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout-multilevel.mjs +14 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs +1 -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/modal.mjs +1 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.mjs +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +6 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pagination.mjs +1 -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/segmented-control-item.mjs +3 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.mjs +9 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.mjs +3 -2
- 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/flyout-multilevel-item.wrapper.d.ts +24 -0
- package/ssr/esm/lib/components/pin-code.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/segmented-control.wrapper.d.ts +24 -0
- package/ssr/esm/lib/components/select.wrapper.d.ts +2 -2
- 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/canvas.d.ts +4 -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 +3 -2
- package/ssr/esm/lib/dsr-components/flyout-multilevel.d.ts +5 -0
- 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/segmented-control.d.ts +5 -0
- package/ssr/esm/lib/dsr-components/switch.d.ts +1 -0
- package/ssr/esm/lib/types.d.ts +36 -35
- 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,435 @@ 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
|
-
// ----------------------------------------
|
|
2810
|
-
|
|
2811
|
-
const minMaxWidth = /(!?\(\s*min(-device-)?-width)(.|\n)+\(\s*max(-device)?-width/i;
|
|
2812
|
-
const minWidth = /\(\s*min(-device)?-width/i;
|
|
2813
|
-
const maxMinWidth = /(!?\(\s*max(-device)?-width)(.|\n)+\(\s*min(-device)?-width/i;
|
|
2814
|
-
const maxWidth = /\(\s*max(-device)?-width/i;
|
|
2815
|
-
|
|
2816
|
-
const isMinWidth = _testQuery(minMaxWidth, maxMinWidth, minWidth);
|
|
2817
|
-
const isMaxWidth = _testQuery(maxMinWidth, minMaxWidth, maxWidth);
|
|
2818
|
-
|
|
2819
|
-
const minMaxHeight = /(!?\(\s*min(-device)?-height)(.|\n)+\(\s*max(-device)?-height/i;
|
|
2820
|
-
const minHeight = /\(\s*min(-device)?-height/i;
|
|
2821
|
-
const maxMinHeight = /(!?\(\s*max(-device)?-height)(.|\n)+\(\s*min(-device)?-height/i;
|
|
2822
|
-
const maxHeight = /\(\s*max(-device)?-height/i;
|
|
2823
|
-
|
|
2824
|
-
const isMinHeight = _testQuery(minMaxHeight, maxMinHeight, minHeight);
|
|
2825
|
-
const isMaxHeight = _testQuery(maxMinHeight, minMaxHeight, maxHeight);
|
|
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);
|
|
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
|
+
***************************************************************************** */
|
|
2842
2783
|
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
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
|
-
}
|
|
3061
|
+
var dist;
|
|
3062
|
+
var hasRequiredDist;
|
|
2997
3063
|
|
|
2998
|
-
|
|
2999
|
-
|
|
3064
|
+
function requireDist () {
|
|
3065
|
+
if (hasRequiredDist) return dist;
|
|
3066
|
+
hasRequiredDist = 1;
|
|
3000
3067
|
|
|
3001
|
-
|
|
3002
|
-
|
|
3068
|
+
var _tslib = require_tslib();
|
|
3069
|
+
var jss = require$$1;
|
|
3070
|
+
var sortCSSmq = requireSortCssMediaQueries();
|
|
3003
3071
|
|
|
3004
|
-
|
|
3005
|
-
|
|
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
|
-
// ----------------------------------------
|
|
3042
|
-
|
|
3043
|
-
var sortCssMediaQueries = sortCSSmq$1;
|
|
3044
|
-
|
|
3045
|
-
var _tslib = _tslib$1;
|
|
3046
|
-
var jss$1 = require$$1;
|
|
3047
|
-
var sortCSSmq = sortCssMediaQueries;
|
|
3048
|
-
|
|
3049
|
-
function _interopDefaultLegacy(e) {
|
|
3050
|
-
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
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
|
-
|
|
3165
|
+
return {
|
|
3166
|
+
onProcessSheet: function (sheet) {
|
|
3167
|
+
recursive(options, sheet);
|
|
3168
|
+
}
|
|
3169
|
+
};
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
dist = jssCombineAndSortMQ;
|
|
3173
|
+
return dist;
|
|
3147
3174
|
}
|
|
3148
3175
|
|
|
3149
|
-
var
|
|
3176
|
+
var distExports = requireDist();
|
|
3177
|
+
var jssPluginSortMediaQueries = /*@__PURE__*/getDefaultExportFromCjs(distExports);
|
|
3150
3178
|
|
|
3151
|
-
|
|
3179
|
+
// NOTE: these utils are in the same file on purpose
|
|
3180
|
+
// to force them being bundled into our core chunk
|
|
3181
|
+
const getTagName = (el) => el.tagName.toLowerCase();
|
|
3182
|
+
const getTagNameWithoutPrefix = (host) => {
|
|
3183
|
+
const tagName = getTagName(host);
|
|
3184
|
+
const [, tagNameWithoutPrefix = ''] = /^(?:[a-z-]+-)?(p-[a-z-]+)$/.exec(tagName) || [];
|
|
3185
|
+
return (tagNameWithoutPrefix || tagName); // return tagName as fallback for default tags
|
|
3186
|
+
};
|
|
3152
3187
|
|
|
3153
3188
|
// 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
3189
|
const scrollAreaClass = 'scroll-area';
|
|
@@ -3164,7 +3199,7 @@ function getHTMLElement(element, selector) {
|
|
|
3164
3199
|
|
|
3165
3200
|
const transformSelectorToDirectChildSelector = (selector) => selector
|
|
3166
3201
|
.split(',')
|
|
3167
|
-
.map((part) =>
|
|
3202
|
+
.map((part) => `:scope>${part}`)
|
|
3168
3203
|
.join();
|
|
3169
3204
|
|
|
3170
3205
|
/* eslint-disable prefer-arrow/prefer-arrow-functions */
|
|
@@ -3181,13 +3216,15 @@ function getDirectChildHTMLElement(element, selector) {
|
|
|
3181
3216
|
|
|
3182
3217
|
const hasSpecificDirectChildTag = (host, tag) => {
|
|
3183
3218
|
const el = getDirectChildHTMLElement(host, ':only-child');
|
|
3184
|
-
return !!
|
|
3219
|
+
return !!el?.matches(tag);
|
|
3185
3220
|
};
|
|
3186
3221
|
|
|
3187
3222
|
const isDisabledOrLoading = (disabled, loading) => {
|
|
3188
3223
|
return disabled || loading;
|
|
3189
3224
|
};
|
|
3190
3225
|
|
|
3226
|
+
const isElementOfKind = (element, tagName) => getTagNameWithoutPrefix(element) === tagName;
|
|
3227
|
+
|
|
3191
3228
|
const parseJSONAttribute = (attribute) => {
|
|
3192
3229
|
// Input is object, e.g. { 'aria-label': 'Some label' }
|
|
3193
3230
|
if (typeof attribute !== 'string') {
|
|
@@ -3197,7 +3234,7 @@ const parseJSONAttribute = (attribute) => {
|
|
|
3197
3234
|
// Convert single quotes to double quotes except the ones which are escaped by backslash
|
|
3198
3235
|
.replace(/\\'/g, '__escaped_single_quote__')
|
|
3199
3236
|
.replace(/'/g, '"')
|
|
3200
|
-
.replace(/__escaped_single_quote__/g, '
|
|
3237
|
+
.replace(/__escaped_single_quote__/g, "\\'")
|
|
3201
3238
|
// Remove string escapes except the ones followed by unicode u0027
|
|
3202
3239
|
.replace(/([^\\])\\(?!u0027)/g, '$1')
|
|
3203
3240
|
// Wrap keys in double quotes
|
|
@@ -3353,12 +3390,13 @@ supportsConstructableStylesheets();
|
|
|
3353
3390
|
const attributeMutationMap = new Map();
|
|
3354
3391
|
hasWindow &&
|
|
3355
3392
|
new MutationObserver((mutations) => {
|
|
3356
|
-
mutations
|
|
3393
|
+
for (const mutation of mutations
|
|
3357
3394
|
// reduce array to only entries that have really a changed value
|
|
3358
3395
|
.filter((mutation) => mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName))
|
|
3359
3396
|
// remove duplicates so we execute callback only once per node
|
|
3360
|
-
.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
|
|
3361
|
-
|
|
3397
|
+
.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)) {
|
|
3398
|
+
attributeMutationMap.get(mutation.target)?.();
|
|
3399
|
+
}
|
|
3362
3400
|
});
|
|
3363
3401
|
|
|
3364
3402
|
const mediaQueries = Object.values(breakpoint).map((v) => `(min-width:${v}px)`);
|
|
@@ -3380,17 +3418,14 @@ const observedNodesMap = new Map();
|
|
|
3380
3418
|
hasWindow &&
|
|
3381
3419
|
new MutationObserver((mutations) => {
|
|
3382
3420
|
// there may be race conditions in jsdom-polyfill tests where the map is already empty when a mutation happens
|
|
3383
|
-
if (observedNodesMap.size) {
|
|
3421
|
+
if (observedNodesMap.size > 0) {
|
|
3384
3422
|
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
|
-
});
|
|
3423
|
+
// remove duplicates so we execute callback only once per node
|
|
3424
|
+
for (const mutation of mutations.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)) {
|
|
3425
|
+
for (const node of observedNodes.filter((node) => node.contains(mutation.target))) {
|
|
3426
|
+
observedNodesMap.get(node)?.();
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3394
3429
|
}
|
|
3395
3430
|
});
|
|
3396
3431
|
|
|
@@ -3435,7 +3470,7 @@ const isScrollable = (isPrevHidden, isNextHidden) => {
|
|
|
3435
3470
|
};
|
|
3436
3471
|
|
|
3437
3472
|
/*
|
|
3438
|
-
Stencil Client Platform v4.
|
|
3473
|
+
Stencil Client Platform v4.22.2 | MIT Licensed | https://stenciljs.com
|
|
3439
3474
|
*/
|
|
3440
3475
|
var __defProp = Object.defineProperty;
|
|
3441
3476
|
var __export = (target, all) => {
|
|
@@ -3501,7 +3536,7 @@ const supportsNativePopover = () => {
|
|
|
3501
3536
|
if (!hasWindow) {
|
|
3502
3537
|
return false;
|
|
3503
3538
|
}
|
|
3504
|
-
return
|
|
3539
|
+
return Object.prototype.hasOwnProperty.call(HTMLElement.prototype, 'popover');
|
|
3505
3540
|
};
|
|
3506
3541
|
// determine it once
|
|
3507
3542
|
supportsNativePopover();
|
|
@@ -3519,8 +3554,7 @@ const formatObjectOutput = (value) => {
|
|
|
3519
3554
|
.replace(/(})/g, ' $1') // add space before following: }
|
|
3520
3555
|
.replace(/^"(.+)"$/, '$1'); // remove wrapping double quotes
|
|
3521
3556
|
};
|
|
3522
|
-
'value, '
|
|
3523
|
-
formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '');
|
|
3557
|
+
`value, ${formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '')}`;
|
|
3524
3558
|
const getButtonPureAriaAttributes = (isDisabled, isLoading, aria) => {
|
|
3525
3559
|
return {
|
|
3526
3560
|
...parseAndGetAriaAttributes(aria),
|
|
@@ -3566,11 +3600,33 @@ const getDisplayTagType = (host, size, tag) => {
|
|
|
3566
3600
|
if (hasSpecificDirectChildTag(host, DISPLAY_TAGS.join())) {
|
|
3567
3601
|
return 'div';
|
|
3568
3602
|
}
|
|
3569
|
-
|
|
3603
|
+
if (tag) {
|
|
3570
3604
|
return tag;
|
|
3571
3605
|
}
|
|
3572
|
-
|
|
3573
|
-
|
|
3606
|
+
return displaySizeToTagMap[size] || 'h1';
|
|
3607
|
+
};
|
|
3608
|
+
/**
|
|
3609
|
+
* Updates the state of the flyout multilevel and its children based on the provided activeItem and value.
|
|
3610
|
+
*
|
|
3611
|
+
* @param {string | undefined} activeItem - The flyout-multilevel-item element which is currently active (which has the activeIdentifier as identifier). If undefined, updates the root element.
|
|
3612
|
+
* @param {boolean} value - The new state value to apply.
|
|
3613
|
+
* @returns {void}
|
|
3614
|
+
*/
|
|
3615
|
+
const updateFlyoutMultiLevelItemState = (activeItem, value) => {
|
|
3616
|
+
activeItem.secondary = value;
|
|
3617
|
+
traverseTreeAndUpdateState(activeItem.parentElement, 'primary', value);
|
|
3618
|
+
};
|
|
3619
|
+
/**
|
|
3620
|
+
* Recursively updates the state of a flyout item's parent elements by traversing up the DOM tree.
|
|
3621
|
+
*
|
|
3622
|
+
* @param {HTMLPFlyoutMultilevelItemElement} activeItem - The current flyout item being updated.
|
|
3623
|
+
* @param {'primary' | 'secondary' | 'cascade'} prop - The property of the flyout item to update.
|
|
3624
|
+
* @param {boolean} value - The new state value to apply.
|
|
3625
|
+
*/
|
|
3626
|
+
const traverseTreeAndUpdateState = (activeItem, prop, value) => {
|
|
3627
|
+
if (isElementOfKind(activeItem, 'p-flyout-multilevel-item')) {
|
|
3628
|
+
activeItem[prop] = value;
|
|
3629
|
+
traverseTreeAndUpdateState(activeItem.parentElement, 'cascade', value);
|
|
3574
3630
|
}
|
|
3575
3631
|
};
|
|
3576
3632
|
const headingSizeToTagMap = {
|
|
@@ -3585,12 +3641,10 @@ const getHeadingTagType = (host, size, tag) => {
|
|
|
3585
3641
|
if (hasSpecificDirectChildTag(host, HEADING_TAGS.join())) {
|
|
3586
3642
|
return 'div';
|
|
3587
3643
|
}
|
|
3588
|
-
|
|
3644
|
+
if (tag) {
|
|
3589
3645
|
return tag;
|
|
3590
3646
|
}
|
|
3591
|
-
|
|
3592
|
-
return headingSizeToTagMap[size] || 'h2';
|
|
3593
|
-
}
|
|
3647
|
+
return headingSizeToTagMap[size] || 'h2';
|
|
3594
3648
|
};
|
|
3595
3649
|
const HEADLINE_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
3596
3650
|
const variantToTagMap = {
|
|
@@ -3605,12 +3659,10 @@ const getHeadlineTagType = (host, variant, tag) => {
|
|
|
3605
3659
|
if (hasSpecificDirectChildTag(host, HEADLINE_TAGS.join())) {
|
|
3606
3660
|
return 'div';
|
|
3607
3661
|
}
|
|
3608
|
-
|
|
3662
|
+
if (tag) {
|
|
3609
3663
|
return tag;
|
|
3610
3664
|
}
|
|
3611
|
-
|
|
3612
|
-
return variantToTagMap[variant] || 'h1';
|
|
3613
|
-
}
|
|
3665
|
+
return variantToTagMap[variant] || 'h1';
|
|
3614
3666
|
};
|
|
3615
3667
|
const isUrl = (str) => str?.length > 0 && /(\/)/.test(str);
|
|
3616
3668
|
const DEFAULT_ICON_NAME = 'arrow-right';
|
|
@@ -3619,10 +3671,10 @@ const buildIconUrl = (iconNameOrSource = DEFAULT_ICON_NAME) => {
|
|
|
3619
3671
|
if (iconNameOrSource === null) {
|
|
3620
3672
|
return buildIconUrl(DEFAULT_ICON_NAME);
|
|
3621
3673
|
}
|
|
3622
|
-
|
|
3674
|
+
if (isUrl(iconNameOrSource)) {
|
|
3623
3675
|
return iconNameOrSource;
|
|
3624
3676
|
}
|
|
3625
|
-
|
|
3677
|
+
if (ICONS_MANIFEST[iconNameOrSource]) {
|
|
3626
3678
|
return `${getCDNBaseURL()}/icons/${ICONS_MANIFEST[iconNameOrSource]}`;
|
|
3627
3679
|
}
|
|
3628
3680
|
return buildIconUrl(DEFAULT_ICON_NAME);
|
|
@@ -3696,7 +3748,7 @@ const createPageFunctionFactory = ({ activePage }) => {
|
|
|
3696
3748
|
isAfterAfterCurrent: pageNumber === activePage + 2,
|
|
3697
3749
|
});
|
|
3698
3750
|
};
|
|
3699
|
-
const createRange = (start, end) => Array.from(Array(end - start + 1), (_, i) => i + start);
|
|
3751
|
+
const createRange = (start, end) => Array.from(new Array(end - start + 1), (_, i) => i + start);
|
|
3700
3752
|
const createPaginationItems = (options) => {
|
|
3701
3753
|
const { pageTotal, activePage, showLastPage } = options;
|
|
3702
3754
|
const pageRange = 1;
|
|
@@ -3743,24 +3795,10 @@ const createPaginationItems = (options) => {
|
|
|
3743
3795
|
return paginationItems;
|
|
3744
3796
|
};
|
|
3745
3797
|
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;
|
|
3798
|
+
return activePage < 1 ? 1 : activePage > totalPages ? totalPages : activePage;
|
|
3755
3799
|
};
|
|
3756
3800
|
const getTotalPages = (totalItemsCount, itemsPerPage) => {
|
|
3757
|
-
|
|
3758
|
-
totalItemsCount = 1;
|
|
3759
|
-
}
|
|
3760
|
-
if (itemsPerPage < 1) {
|
|
3761
|
-
itemsPerPage = 1;
|
|
3762
|
-
}
|
|
3763
|
-
return Math.ceil(totalItemsCount / itemsPerPage);
|
|
3801
|
+
return Math.ceil((totalItemsCount < 1 ? 1 : totalItemsCount) / (itemsPerPage < 1 ? 1 : itemsPerPage));
|
|
3764
3802
|
};
|
|
3765
3803
|
/**
|
|
3766
3804
|
* Determines if the current input element corresponds to the first non-filled input
|
|
@@ -3786,7 +3824,7 @@ const getSegmentedControlItemAriaAttributes = (isSelected, isDisabled, ariaProp)
|
|
|
3786
3824
|
...parseAndGetAriaAttributes(ariaProp),
|
|
3787
3825
|
});
|
|
3788
3826
|
const getIconColor = (isDisabled) => {
|
|
3789
|
-
return
|
|
3827
|
+
return isDisabled ? 'contrast-medium' : 'primary';
|
|
3790
3828
|
};
|
|
3791
3829
|
|
|
3792
3830
|
const ITEM_PADDING = '17px';
|
|
@@ -3794,7 +3832,7 @@ const { font: BUTTON_FONT } = textSmallStyle;
|
|
|
3794
3832
|
const { font: LABEL_FONT } = textXSmallStyle;
|
|
3795
3833
|
const ICON_SIZE = '1.5rem';
|
|
3796
3834
|
const ICON_MARGIN = '.25rem';
|
|
3797
|
-
['auto', ...Array.from(Array(25), (_, i) => i + 1)];
|
|
3835
|
+
['auto', ...Array.from(new Array(25), (_, i) => i + 1)];
|
|
3798
3836
|
// Expect Porsche Next to be available and use sans-serif (wide font for safety buffer) as fallback
|
|
3799
3837
|
const tempFont = 'Porsche Next, sans-serif';
|
|
3800
3838
|
// temporary dom node to measure max-width of children content
|
|
@@ -3823,12 +3861,10 @@ const isCustomDropdown = (filter, native) => {
|
|
|
3823
3861
|
if (filter) {
|
|
3824
3862
|
return true;
|
|
3825
3863
|
}
|
|
3826
|
-
|
|
3864
|
+
if (native) {
|
|
3827
3865
|
return false;
|
|
3828
3866
|
}
|
|
3829
|
-
|
|
3830
|
-
return !isTouchDevice();
|
|
3831
|
-
}
|
|
3867
|
+
return !isTouchDevice();
|
|
3832
3868
|
};
|
|
3833
3869
|
const getSelectedOptionString = (options) => options.find((option) => option.selected)?.textContent ?? '';
|
|
3834
3870
|
const isStateCompleteOrWarning = (state) => {
|
|
@@ -3867,9 +3903,7 @@ const getTextTagType = (host, tag) => {
|
|
|
3867
3903
|
if (hasSpecificDirectChildTag(host, TEXT_TAGS.join())) {
|
|
3868
3904
|
return 'div';
|
|
3869
3905
|
}
|
|
3870
|
-
|
|
3871
|
-
return tag;
|
|
3872
|
-
}
|
|
3906
|
+
return tag;
|
|
3873
3907
|
};
|
|
3874
3908
|
|
|
3875
|
-
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 };
|
|
3909
|
+
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, getTagName, getTagNameWithoutPrefix, getTextTagType, getTotalPages, hasDocument, hasLocateAction, hasSpecificDirectChildTag, hasVisibleIcon, hasWindow, headerSlot, isCurrentInput, isCustomDropdown, isDisabledOrLoading, isElementOfKind, isInfinitePagination, isListTypeOrdered, isScrollable, isSortable, isStateCompleteOrWarning, isTouchDevice, isType, isUrl, isWithinForm, observedNodesMap, parseAndGetAriaAttributes, parseJSONAttribute, scrollAreaClass, showCustomCalendarOrTimeIndicator, supportsConstructableStylesheets, supportsNativePopover, tempDiv, tempIcon, tempLabel, traverseTreeAndUpdateState, updateFlyoutMultiLevelItemState };
|