@porsche-design-system/components-react 3.21.0-rc.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 +27 -2
- package/ag-grid/theme.css +17 -8
- package/cjs/lib/components/link-tile-model-signature.wrapper.cjs +1 -1
- package/cjs/lib/components/pin-code.wrapper.cjs +3 -3
- package/esm/lib/components/link-tile-model-signature.wrapper.mjs +1 -1
- package/esm/lib/components/pin-code.wrapper.d.ts +8 -0
- package/esm/lib/components/pin-code.wrapper.mjs +3 -3
- package/esm/lib/types.d.ts +33 -33
- package/package.json +6 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +450 -437
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +419 -420
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile-model-signature.wrapper.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/pin-code.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/loading-message.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +5 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.cjs +15 -6
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +2 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/toast.cjs +1 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +450 -437
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +419 -420
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile-model-signature.wrapper.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/pin-code.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/loading-message.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +5 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs +15 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +2 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/toast.mjs +1 -1
- package/ssr/esm/lib/components/pin-code.wrapper.d.ts +8 -0
- package/ssr/esm/lib/dsr-components/button-pure.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/button.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/checkbox-wrapper.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/checkbox.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/flyout-multilevel-item.d.ts +1 -1
- package/ssr/esm/lib/dsr-components/pin-code.d.ts +6 -3
- package/ssr/esm/lib/dsr-components/radio-button-wrapper.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/switch.d.ts +1 -0
- package/ssr/esm/lib/types.d.ts +33 -33
- package/styles/_index.scss +1 -1
|
@@ -33,7 +33,7 @@ function toPrimitive(t, r) {
|
|
|
33
33
|
if ("object" != _typeof(t) || !t) return t;
|
|
34
34
|
var e = t[Symbol.toPrimitive];
|
|
35
35
|
if (void 0 !== e) {
|
|
36
|
-
var i = e.call(t, r
|
|
36
|
+
var i = e.call(t, r);
|
|
37
37
|
if ("object" != _typeof(i)) return i;
|
|
38
38
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
39
39
|
}
|
|
@@ -2757,400 +2757,426 @@ function getAugmentedNamespace(n) {
|
|
|
2757
2757
|
return a;
|
|
2758
2758
|
}
|
|
2759
2759
|
|
|
2760
|
-
var _tslib
|
|
2760
|
+
var _tslib = {};
|
|
2761
2761
|
|
|
2762
|
-
|
|
2762
|
+
var hasRequired_tslib;
|
|
2763
2763
|
|
|
2764
|
-
|
|
2764
|
+
function require_tslib () {
|
|
2765
|
+
if (hasRequired_tslib) return _tslib;
|
|
2766
|
+
hasRequired_tslib = 1;
|
|
2767
|
+
(function (exports) {
|
|
2765
2768
|
|
|
2766
|
-
|
|
2767
|
-
Copyright (c) Microsoft Corporation.
|
|
2769
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2768
2770
|
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
+
/*! *****************************************************************************
|
|
2772
|
+
Copyright (c) Microsoft Corporation.
|
|
2771
2773
|
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2775
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2776
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2777
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2778
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2779
|
-
***************************************************************************** */
|
|
2774
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
2775
|
+
purpose with or without fee is hereby granted.
|
|
2780
2776
|
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
}
|
|
2790
|
-
return t;
|
|
2791
|
-
};
|
|
2792
|
-
return exports.__assign.apply(this, arguments);
|
|
2793
|
-
};
|
|
2794
|
-
} (_tslib$1));
|
|
2795
|
-
|
|
2796
|
-
var require$$1 = /*@__PURE__*/getAugmentedNamespace(jss_esm);
|
|
2797
|
-
|
|
2798
|
-
/**
|
|
2799
|
-
* The custom `sort` method for
|
|
2800
|
-
* for the [`css-mqpacker`](https://www.npmjs.com/package/css-mqpacker) or
|
|
2801
|
-
* [`pleeease`](https://www.npmjs.com/package/pleeease) which using `css-mqpacker`
|
|
2802
|
-
* or, perhaps, something else ))
|
|
2803
|
-
*
|
|
2804
|
-
* @module sort-css-media-queries
|
|
2805
|
-
* @author Oleg Dutchenko <dutchenko.o.wezom@gmail.com>
|
|
2806
|
-
* @version 1.5.0
|
|
2807
|
-
*/
|
|
2808
|
-
|
|
2809
|
-
// ----------------------------------------
|
|
2810
|
-
// Private
|
|
2811
|
-
// ----------------------------------------
|
|
2812
|
-
|
|
2813
|
-
const minMaxWidth = /(!?\(\s*min(-device-)?-width)(.|\n)+\(\s*max(-device)?-width/i;
|
|
2814
|
-
const minWidth = /\(\s*min(-device)?-width/i;
|
|
2815
|
-
const maxMinWidth = /(!?\(\s*max(-device)?-width)(.|\n)+\(\s*min(-device)?-width/i;
|
|
2816
|
-
const maxWidth = /\(\s*max(-device)?-width/i;
|
|
2817
|
-
|
|
2818
|
-
const isMinWidth = _testQuery(minMaxWidth, maxMinWidth, minWidth);
|
|
2819
|
-
const isMaxWidth = _testQuery(maxMinWidth, minMaxWidth, maxWidth);
|
|
2820
|
-
|
|
2821
|
-
const minMaxHeight = /(!?\(\s*min(-device)?-height)(.|\n)+\(\s*max(-device)?-height/i;
|
|
2822
|
-
const minHeight = /\(\s*min(-device)?-height/i;
|
|
2823
|
-
const maxMinHeight = /(!?\(\s*max(-device)?-height)(.|\n)+\(\s*min(-device)?-height/i;
|
|
2824
|
-
const maxHeight = /\(\s*max(-device)?-height/i;
|
|
2825
|
-
|
|
2826
|
-
const isMinHeight = _testQuery(minMaxHeight, maxMinHeight, minHeight);
|
|
2827
|
-
const isMaxHeight = _testQuery(maxMinHeight, minMaxHeight, maxHeight);
|
|
2828
|
-
|
|
2829
|
-
const isPrint = /print/i;
|
|
2830
|
-
const isPrintOnly = /^print$/i;
|
|
2831
|
-
|
|
2832
|
-
const maxValue = Number.MAX_VALUE;
|
|
2833
|
-
|
|
2834
|
-
/**
|
|
2835
|
-
* Obtain the length of the media request in pixels.
|
|
2836
|
-
* Copy from original source `function inspectLength (length)`
|
|
2837
|
-
* {@link https://github.com/hail2u/node-css-mqpacker/blob/master/index.js#L58}
|
|
2838
|
-
* @private
|
|
2839
|
-
* @param {string} length
|
|
2840
|
-
* @return {number}
|
|
2841
|
-
*/
|
|
2842
|
-
function _getQueryLength (length) {
|
|
2843
|
-
length = /(-?\d*\.?\d+)(ch|em|ex|px|rem)/.exec(length);
|
|
2844
|
-
|
|
2845
|
-
if (length === null) {
|
|
2846
|
-
return maxValue
|
|
2847
|
-
}
|
|
2848
|
-
|
|
2849
|
-
let number = length[1];
|
|
2850
|
-
const unit = length[2];
|
|
2851
|
-
|
|
2852
|
-
switch (unit) {
|
|
2853
|
-
case 'ch':
|
|
2854
|
-
number = parseFloat(number) * 8.8984375;
|
|
2855
|
-
break
|
|
2856
|
-
|
|
2857
|
-
case 'em':
|
|
2858
|
-
case 'rem':
|
|
2859
|
-
number = parseFloat(number) * 16;
|
|
2860
|
-
break
|
|
2861
|
-
|
|
2862
|
-
case 'ex':
|
|
2863
|
-
number = parseFloat(number) * 8.296875;
|
|
2864
|
-
break
|
|
2865
|
-
|
|
2866
|
-
case 'px':
|
|
2867
|
-
number = parseFloat(number);
|
|
2868
|
-
break
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2871
|
-
return +number
|
|
2872
|
-
}
|
|
2873
|
-
|
|
2874
|
-
/**
|
|
2875
|
-
* Wrapper for creating test functions
|
|
2876
|
-
* @private
|
|
2877
|
-
* @param {RegExp} doubleTestTrue
|
|
2878
|
-
* @param {RegExp} doubleTestFalse
|
|
2879
|
-
* @param {RegExp} singleTest
|
|
2880
|
-
* @return {Function}
|
|
2881
|
-
*/
|
|
2882
|
-
function _testQuery (doubleTestTrue, doubleTestFalse, singleTest) {
|
|
2883
|
-
/**
|
|
2884
|
-
* @param {string} query
|
|
2885
|
-
* @return {boolean}
|
|
2886
|
-
*/
|
|
2887
|
-
return function (query) {
|
|
2888
|
-
if (doubleTestTrue.test(query)) {
|
|
2889
|
-
return true
|
|
2890
|
-
} else if (doubleTestFalse.test(query)) {
|
|
2891
|
-
return false
|
|
2892
|
-
}
|
|
2893
|
-
return singleTest.test(query)
|
|
2894
|
-
}
|
|
2895
|
-
}
|
|
2896
|
-
|
|
2897
|
-
/**
|
|
2898
|
-
* @private
|
|
2899
|
-
* @param {string} a
|
|
2900
|
-
* @param {string} b
|
|
2901
|
-
* @return {number|null}
|
|
2902
|
-
*/
|
|
2903
|
-
function _testIsPrint (a, b) {
|
|
2904
|
-
const isPrintA = isPrint.test(a);
|
|
2905
|
-
const isPrintOnlyA = isPrintOnly.test(a);
|
|
2906
|
-
|
|
2907
|
-
const isPrintB = isPrint.test(b);
|
|
2908
|
-
const isPrintOnlyB = isPrintOnly.test(b);
|
|
2909
|
-
|
|
2910
|
-
if (isPrintA && isPrintB) {
|
|
2911
|
-
if (!isPrintOnlyA && isPrintOnlyB) {
|
|
2912
|
-
return 1
|
|
2913
|
-
}
|
|
2914
|
-
if (isPrintOnlyA && !isPrintOnlyB) {
|
|
2915
|
-
return -1
|
|
2916
|
-
}
|
|
2917
|
-
return a.localeCompare(b)
|
|
2918
|
-
}
|
|
2919
|
-
if (isPrintA) {
|
|
2920
|
-
return 1
|
|
2921
|
-
}
|
|
2922
|
-
if (isPrintB) {
|
|
2923
|
-
return -1
|
|
2924
|
-
}
|
|
2777
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2778
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2779
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2780
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2781
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2782
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2783
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
2784
|
+
***************************************************************************** */
|
|
2925
2785
|
|
|
2926
|
-
|
|
2786
|
+
exports.__assign = function () {
|
|
2787
|
+
exports.__assign =
|
|
2788
|
+
Object.assign ||
|
|
2789
|
+
function __assign(t) {
|
|
2790
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2791
|
+
s = arguments[i];
|
|
2792
|
+
for (var p in s)
|
|
2793
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2794
|
+
}
|
|
2795
|
+
return t;
|
|
2796
|
+
};
|
|
2797
|
+
return exports.__assign.apply(this, arguments);
|
|
2798
|
+
};
|
|
2799
|
+
} (_tslib));
|
|
2800
|
+
return _tslib;
|
|
2927
2801
|
}
|
|
2928
2802
|
|
|
2929
|
-
|
|
2930
|
-
// Public
|
|
2931
|
-
// ----------------------------------------
|
|
2932
|
-
|
|
2933
|
-
/**
|
|
2934
|
-
* Sorting an array with media queries
|
|
2935
|
-
* according to the mobile-first methodology.
|
|
2936
|
-
* @param {string} a
|
|
2937
|
-
* @param {string} b
|
|
2938
|
-
* @return {number} 1 / 0 / -1
|
|
2939
|
-
*/
|
|
2940
|
-
function sortCSSmq$1 (a, b) {
|
|
2941
|
-
const testIsPrint = _testIsPrint(a, b);
|
|
2942
|
-
if (testIsPrint !== null) {
|
|
2943
|
-
return testIsPrint
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
const minA = isMinWidth(a) || isMinHeight(a);
|
|
2947
|
-
const maxA = isMaxWidth(a) || isMaxHeight(a);
|
|
2803
|
+
var require$$1 = /*@__PURE__*/getAugmentedNamespace(jss_esm);
|
|
2948
2804
|
|
|
2949
|
-
|
|
2950
|
-
|
|
2805
|
+
var sortCssMediaQueries;
|
|
2806
|
+
var hasRequiredSortCssMediaQueries;
|
|
2807
|
+
|
|
2808
|
+
function requireSortCssMediaQueries () {
|
|
2809
|
+
if (hasRequiredSortCssMediaQueries) return sortCssMediaQueries;
|
|
2810
|
+
hasRequiredSortCssMediaQueries = 1;
|
|
2811
|
+
|
|
2812
|
+
/**
|
|
2813
|
+
* The custom `sort` method for
|
|
2814
|
+
* for the [`css-mqpacker`](https://www.npmjs.com/package/css-mqpacker) or
|
|
2815
|
+
* [`pleeease`](https://www.npmjs.com/package/pleeease) which using `css-mqpacker`
|
|
2816
|
+
* or, perhaps, something else ))
|
|
2817
|
+
*
|
|
2818
|
+
* @module sort-css-media-queries
|
|
2819
|
+
* @author Oleg Dutchenko <dutchenko.o.wezom@gmail.com>
|
|
2820
|
+
* @version 1.5.0
|
|
2821
|
+
*/
|
|
2822
|
+
|
|
2823
|
+
// ----------------------------------------
|
|
2824
|
+
// Private
|
|
2825
|
+
// ----------------------------------------
|
|
2826
|
+
|
|
2827
|
+
const minMaxWidth = /(!?\(\s*min(-device-)?-width)(.|\n)+\(\s*max(-device)?-width/i;
|
|
2828
|
+
const minWidth = /\(\s*min(-device)?-width/i;
|
|
2829
|
+
const maxMinWidth = /(!?\(\s*max(-device)?-width)(.|\n)+\(\s*min(-device)?-width/i;
|
|
2830
|
+
const maxWidth = /\(\s*max(-device)?-width/i;
|
|
2831
|
+
|
|
2832
|
+
const isMinWidth = _testQuery(minMaxWidth, maxMinWidth, minWidth);
|
|
2833
|
+
const isMaxWidth = _testQuery(maxMinWidth, minMaxWidth, maxWidth);
|
|
2834
|
+
|
|
2835
|
+
const minMaxHeight = /(!?\(\s*min(-device)?-height)(.|\n)+\(\s*max(-device)?-height/i;
|
|
2836
|
+
const minHeight = /\(\s*min(-device)?-height/i;
|
|
2837
|
+
const maxMinHeight = /(!?\(\s*max(-device)?-height)(.|\n)+\(\s*min(-device)?-height/i;
|
|
2838
|
+
const maxHeight = /\(\s*max(-device)?-height/i;
|
|
2839
|
+
|
|
2840
|
+
const isMinHeight = _testQuery(minMaxHeight, maxMinHeight, minHeight);
|
|
2841
|
+
const isMaxHeight = _testQuery(maxMinHeight, minMaxHeight, maxHeight);
|
|
2842
|
+
|
|
2843
|
+
const isPrint = /print/i;
|
|
2844
|
+
const isPrintOnly = /^print$/i;
|
|
2845
|
+
|
|
2846
|
+
const maxValue = Number.MAX_VALUE;
|
|
2847
|
+
|
|
2848
|
+
/**
|
|
2849
|
+
* Obtain the length of the media request in pixels.
|
|
2850
|
+
* Copy from original source `function inspectLength (length)`
|
|
2851
|
+
* {@link https://github.com/hail2u/node-css-mqpacker/blob/master/index.js#L58}
|
|
2852
|
+
* @private
|
|
2853
|
+
* @param {string} length
|
|
2854
|
+
* @return {number}
|
|
2855
|
+
*/
|
|
2856
|
+
function _getQueryLength (length) {
|
|
2857
|
+
length = /(-?\d*\.?\d+)(ch|em|ex|px|rem)/.exec(length);
|
|
2858
|
+
|
|
2859
|
+
if (length === null) {
|
|
2860
|
+
return maxValue
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
let number = length[1];
|
|
2864
|
+
const unit = length[2];
|
|
2865
|
+
|
|
2866
|
+
switch (unit) {
|
|
2867
|
+
case 'ch':
|
|
2868
|
+
number = parseFloat(number) * 8.8984375;
|
|
2869
|
+
break
|
|
2870
|
+
|
|
2871
|
+
case 'em':
|
|
2872
|
+
case 'rem':
|
|
2873
|
+
number = parseFloat(number) * 16;
|
|
2874
|
+
break
|
|
2875
|
+
|
|
2876
|
+
case 'ex':
|
|
2877
|
+
number = parseFloat(number) * 8.296875;
|
|
2878
|
+
break
|
|
2879
|
+
|
|
2880
|
+
case 'px':
|
|
2881
|
+
number = parseFloat(number);
|
|
2882
|
+
break
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
return +number
|
|
2886
|
+
}
|
|
2951
2887
|
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2888
|
+
/**
|
|
2889
|
+
* Wrapper for creating test functions
|
|
2890
|
+
* @private
|
|
2891
|
+
* @param {RegExp} doubleTestTrue
|
|
2892
|
+
* @param {RegExp} doubleTestFalse
|
|
2893
|
+
* @param {RegExp} singleTest
|
|
2894
|
+
* @return {Function}
|
|
2895
|
+
*/
|
|
2896
|
+
function _testQuery (doubleTestTrue, doubleTestFalse, singleTest) {
|
|
2897
|
+
/**
|
|
2898
|
+
* @param {string} query
|
|
2899
|
+
* @return {boolean}
|
|
2900
|
+
*/
|
|
2901
|
+
return function (query) {
|
|
2902
|
+
if (doubleTestTrue.test(query)) {
|
|
2903
|
+
return true
|
|
2904
|
+
} else if (doubleTestFalse.test(query)) {
|
|
2905
|
+
return false
|
|
2906
|
+
}
|
|
2907
|
+
return singleTest.test(query)
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2958
2910
|
|
|
2959
|
-
|
|
2960
|
-
|
|
2911
|
+
/**
|
|
2912
|
+
* @private
|
|
2913
|
+
* @param {string} a
|
|
2914
|
+
* @param {string} b
|
|
2915
|
+
* @return {number|null}
|
|
2916
|
+
*/
|
|
2917
|
+
function _testIsPrint (a, b) {
|
|
2918
|
+
const isPrintA = isPrint.test(a);
|
|
2919
|
+
const isPrintOnlyA = isPrintOnly.test(a);
|
|
2920
|
+
|
|
2921
|
+
const isPrintB = isPrint.test(b);
|
|
2922
|
+
const isPrintOnlyB = isPrintOnly.test(b);
|
|
2923
|
+
|
|
2924
|
+
if (isPrintA && isPrintB) {
|
|
2925
|
+
if (!isPrintOnlyA && isPrintOnlyB) {
|
|
2926
|
+
return 1
|
|
2927
|
+
}
|
|
2928
|
+
if (isPrintOnlyA && !isPrintOnlyB) {
|
|
2929
|
+
return -1
|
|
2930
|
+
}
|
|
2931
|
+
return a.localeCompare(b)
|
|
2932
|
+
}
|
|
2933
|
+
if (isPrintA) {
|
|
2934
|
+
return 1
|
|
2935
|
+
}
|
|
2936
|
+
if (isPrintB) {
|
|
2937
|
+
return -1
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
return null
|
|
2941
|
+
}
|
|
2961
2942
|
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2943
|
+
// ----------------------------------------
|
|
2944
|
+
// Public
|
|
2945
|
+
// ----------------------------------------
|
|
2946
|
+
|
|
2947
|
+
/**
|
|
2948
|
+
* Sorting an array with media queries
|
|
2949
|
+
* according to the mobile-first methodology.
|
|
2950
|
+
* @param {string} a
|
|
2951
|
+
* @param {string} b
|
|
2952
|
+
* @return {number} 1 / 0 / -1
|
|
2953
|
+
*/
|
|
2954
|
+
function sortCSSmq (a, b) {
|
|
2955
|
+
const testIsPrint = _testIsPrint(a, b);
|
|
2956
|
+
if (testIsPrint !== null) {
|
|
2957
|
+
return testIsPrint
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
const minA = isMinWidth(a) || isMinHeight(a);
|
|
2961
|
+
const maxA = isMaxWidth(a) || isMaxHeight(a);
|
|
2962
|
+
|
|
2963
|
+
const minB = isMinWidth(b) || isMinHeight(b);
|
|
2964
|
+
const maxB = isMaxWidth(b) || isMaxHeight(b);
|
|
2965
|
+
|
|
2966
|
+
if (minA && maxB) {
|
|
2967
|
+
return -1
|
|
2968
|
+
}
|
|
2969
|
+
if (maxA && minB) {
|
|
2970
|
+
return 1
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2973
|
+
let lengthA = _getQueryLength(a);
|
|
2974
|
+
let lengthB = _getQueryLength(b);
|
|
2975
|
+
|
|
2976
|
+
if (lengthA === maxValue && lengthB === maxValue) {
|
|
2977
|
+
return a.localeCompare(b)
|
|
2978
|
+
} else if (lengthA === maxValue) {
|
|
2979
|
+
return 1
|
|
2980
|
+
} else if (lengthB === maxValue) {
|
|
2981
|
+
return -1
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
if (lengthA > lengthB) {
|
|
2985
|
+
if (maxA) {
|
|
2986
|
+
return -1
|
|
2987
|
+
}
|
|
2988
|
+
return 1
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
if (lengthA < lengthB) {
|
|
2992
|
+
if (maxA) {
|
|
2993
|
+
return 1
|
|
2994
|
+
}
|
|
2995
|
+
return -1
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
return a.localeCompare(b)
|
|
2999
|
+
}
|
|
2969
3000
|
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
3001
|
+
/**
|
|
3002
|
+
* Sorting an array with media queries
|
|
3003
|
+
* according to the desktop-first methodology.
|
|
3004
|
+
* @param {string} a
|
|
3005
|
+
* @param {string} b
|
|
3006
|
+
* @return {number} 1 / 0 / -1
|
|
3007
|
+
*/
|
|
3008
|
+
sortCSSmq.desktopFirst = function (a, b) {
|
|
3009
|
+
const testIsPrint = _testIsPrint(a, b);
|
|
3010
|
+
if (testIsPrint !== null) {
|
|
3011
|
+
return testIsPrint
|
|
3012
|
+
}
|
|
3013
|
+
|
|
3014
|
+
const minA = isMinWidth(a) || isMinHeight(a);
|
|
3015
|
+
const maxA = isMaxWidth(a) || isMaxHeight(a);
|
|
3016
|
+
|
|
3017
|
+
const minB = isMinWidth(b) || isMinHeight(b);
|
|
3018
|
+
const maxB = isMaxWidth(b) || isMaxHeight(b);
|
|
3019
|
+
|
|
3020
|
+
if (minA && maxB) {
|
|
3021
|
+
return 1
|
|
3022
|
+
}
|
|
3023
|
+
if (maxA && minB) {
|
|
3024
|
+
return -1
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
const lengthA = _getQueryLength(a);
|
|
3028
|
+
const lengthB = _getQueryLength(b);
|
|
3029
|
+
|
|
3030
|
+
if (lengthA === maxValue && lengthB === maxValue) {
|
|
3031
|
+
return a.localeCompare(b)
|
|
3032
|
+
} else if (lengthA === maxValue) {
|
|
3033
|
+
return 1
|
|
3034
|
+
} else if (lengthB === maxValue) {
|
|
3035
|
+
return -1
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
if (lengthA > lengthB) {
|
|
3039
|
+
if (maxA) {
|
|
3040
|
+
return -1
|
|
3041
|
+
}
|
|
3042
|
+
return 1
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
if (lengthA < lengthB) {
|
|
3046
|
+
if (maxA) {
|
|
3047
|
+
return 1
|
|
3048
|
+
}
|
|
3049
|
+
return -1
|
|
3050
|
+
}
|
|
3051
|
+
|
|
3052
|
+
return -(a.localeCompare(b))
|
|
3053
|
+
};
|
|
2976
3054
|
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
}
|
|
2981
|
-
return -1
|
|
2982
|
-
}
|
|
3055
|
+
// ----------------------------------------
|
|
3056
|
+
// Exports
|
|
3057
|
+
// ----------------------------------------
|
|
2983
3058
|
|
|
2984
|
-
|
|
3059
|
+
sortCssMediaQueries = sortCSSmq;
|
|
3060
|
+
return sortCssMediaQueries;
|
|
2985
3061
|
}
|
|
2986
3062
|
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
* according to the desktop-first methodology.
|
|
2990
|
-
* @param {string} a
|
|
2991
|
-
* @param {string} b
|
|
2992
|
-
* @return {number} 1 / 0 / -1
|
|
2993
|
-
*/
|
|
2994
|
-
sortCSSmq$1.desktopFirst = function (a, b) {
|
|
2995
|
-
const testIsPrint = _testIsPrint(a, b);
|
|
2996
|
-
if (testIsPrint !== null) {
|
|
2997
|
-
return testIsPrint
|
|
2998
|
-
}
|
|
3063
|
+
var dist;
|
|
3064
|
+
var hasRequiredDist;
|
|
2999
3065
|
|
|
3000
|
-
|
|
3001
|
-
|
|
3066
|
+
function requireDist () {
|
|
3067
|
+
if (hasRequiredDist) return dist;
|
|
3068
|
+
hasRequiredDist = 1;
|
|
3002
3069
|
|
|
3003
|
-
|
|
3004
|
-
|
|
3070
|
+
var _tslib = require_tslib();
|
|
3071
|
+
var jss = require$$1;
|
|
3072
|
+
var sortCSSmq = requireSortCssMediaQueries();
|
|
3005
3073
|
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
if (maxA && minB) {
|
|
3010
|
-
return -1
|
|
3011
|
-
}
|
|
3012
|
-
|
|
3013
|
-
const lengthA = _getQueryLength(a);
|
|
3014
|
-
const lengthB = _getQueryLength(b);
|
|
3015
|
-
|
|
3016
|
-
if (lengthA === maxValue && lengthB === maxValue) {
|
|
3017
|
-
return a.localeCompare(b)
|
|
3018
|
-
} else if (lengthA === maxValue) {
|
|
3019
|
-
return 1
|
|
3020
|
-
} else if (lengthB === maxValue) {
|
|
3021
|
-
return -1
|
|
3022
|
-
}
|
|
3023
|
-
|
|
3024
|
-
if (lengthA > lengthB) {
|
|
3025
|
-
if (maxA) {
|
|
3026
|
-
return -1
|
|
3027
|
-
}
|
|
3028
|
-
return 1
|
|
3029
|
-
}
|
|
3030
|
-
|
|
3031
|
-
if (lengthA < lengthB) {
|
|
3032
|
-
if (maxA) {
|
|
3033
|
-
return 1
|
|
3034
|
-
}
|
|
3035
|
-
return -1
|
|
3036
|
-
}
|
|
3037
|
-
|
|
3038
|
-
return -(a.localeCompare(b))
|
|
3039
|
-
};
|
|
3040
|
-
|
|
3041
|
-
// ----------------------------------------
|
|
3042
|
-
// Exports
|
|
3043
|
-
// ----------------------------------------
|
|
3044
|
-
|
|
3045
|
-
var sortCssMediaQueries = sortCSSmq$1;
|
|
3046
|
-
|
|
3047
|
-
var _tslib = _tslib$1;
|
|
3048
|
-
var jss$1 = require$$1;
|
|
3049
|
-
var sortCSSmq = sortCssMediaQueries;
|
|
3050
|
-
|
|
3051
|
-
function _interopDefaultLegacy(e) {
|
|
3052
|
-
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
3053
|
-
}
|
|
3074
|
+
function _interopDefaultLegacy(e) {
|
|
3075
|
+
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
3076
|
+
}
|
|
3054
3077
|
|
|
3055
|
-
var sortCSSmq__default = /*#__PURE__*/ _interopDefaultLegacy(sortCSSmq);
|
|
3078
|
+
var sortCSSmq__default = /*#__PURE__*/ _interopDefaultLegacy(sortCSSmq);
|
|
3056
3079
|
|
|
3057
|
-
function isPlainObject(sample) {
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
}
|
|
3062
|
-
var UN_QUERIED = '__UN_QUERIED';
|
|
3063
|
-
function recursiveInnerAndGetQueries(pluginOptions, rules) {
|
|
3064
|
-
var queries = {
|
|
3065
|
-
groups: {},
|
|
3066
|
-
groupsSortNames: []
|
|
3067
|
-
};
|
|
3068
|
-
for (var index = 0; index < rules.length; index++) {
|
|
3069
|
-
var rule = rules[index];
|
|
3070
|
-
var query =
|
|
3071
|
-
rule.type === 'conditional' && typeof rule.query === 'string'
|
|
3072
|
-
? rule.query
|
|
3073
|
-
: UN_QUERIED;
|
|
3074
|
-
if (!queries.groups.hasOwnProperty(query)) {
|
|
3075
|
-
queries.groupsSortNames.push(query);
|
|
3076
|
-
queries.groups[query] = [];
|
|
3077
|
-
}
|
|
3078
|
-
queries.groups[query].push(index);
|
|
3079
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3080
|
-
recursive(pluginOptions, rule);
|
|
3080
|
+
function isPlainObject(sample) {
|
|
3081
|
+
return (
|
|
3082
|
+
sample !== null && typeof sample === 'object' && Array.isArray(sample) === false
|
|
3083
|
+
);
|
|
3081
3084
|
}
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
var
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3085
|
+
var UN_QUERIED = '__UN_QUERIED';
|
|
3086
|
+
function recursiveInnerAndGetQueries(pluginOptions, rules) {
|
|
3087
|
+
var queries = {
|
|
3088
|
+
groups: {},
|
|
3089
|
+
groupsSortNames: []
|
|
3090
|
+
};
|
|
3091
|
+
for (var index = 0; index < rules.length; index++) {
|
|
3092
|
+
var rule = rules[index];
|
|
3093
|
+
var query =
|
|
3094
|
+
rule.type === 'conditional' && typeof rule.query === 'string'
|
|
3095
|
+
? rule.query
|
|
3096
|
+
: UN_QUERIED;
|
|
3097
|
+
if (!queries.groups.hasOwnProperty(query)) {
|
|
3098
|
+
queries.groupsSortNames.push(query);
|
|
3099
|
+
queries.groups[query] = [];
|
|
3090
3100
|
}
|
|
3091
|
-
|
|
3092
|
-
|
|
3101
|
+
queries.groups[query].push(index);
|
|
3102
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3103
|
+
recursive(pluginOptions, rule);
|
|
3093
3104
|
}
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
if (options === void 0) {
|
|
3101
|
-
options = {};
|
|
3102
|
-
}
|
|
3103
|
-
var str = '';
|
|
3104
|
-
var sheet = this.options.sheet;
|
|
3105
|
-
var link = sheet ? sheet.options.link : false;
|
|
3106
|
-
var _a = recursiveInnerAndGetQueries(pluginOptions, this.index),
|
|
3107
|
-
groups = _a.groups,
|
|
3108
|
-
groupsSortNames = _a.groupsSortNames;
|
|
3109
|
-
for (var i = 0; i < groupsSortNames.length; i++) {
|
|
3110
|
-
var groupName = groupsSortNames[i];
|
|
3111
|
-
var group = groups[groupsSortNames[i]];
|
|
3112
|
-
if (groupName !== UN_QUERIED && pluginOptions.combineMediaQueries) {
|
|
3113
|
-
str += '\n' + groupName + ' {';
|
|
3114
|
-
for (var i_1 = 0; i_1 < group.length; i_1++) {
|
|
3115
|
-
var rule = this.index[group[i_1]];
|
|
3116
|
-
var css = rule.rules.toString(
|
|
3117
|
-
_tslib.__assign(_tslib.__assign({}, options), {
|
|
3118
|
-
indent: (options.indent || 0) + 1
|
|
3119
|
-
})
|
|
3120
|
-
);
|
|
3121
|
-
if (!css && !link) continue;
|
|
3122
|
-
if (str) str += '\n';
|
|
3123
|
-
str += css;
|
|
3124
|
-
}
|
|
3125
|
-
str += '\n}\n';
|
|
3105
|
+
queries.groupsSortNames.sort(function (a, b) {
|
|
3106
|
+
var aWeight = a === UN_QUERIED ? 0 : a.length;
|
|
3107
|
+
var bWeight = b === UN_QUERIED ? 0 : b.length;
|
|
3108
|
+
if (aWeight > 0 && bWeight > 0) {
|
|
3109
|
+
if (pluginOptions.desktopFirst) {
|
|
3110
|
+
return sortCSSmq__default['default'].desktopFirst(a, b);
|
|
3126
3111
|
} else {
|
|
3127
|
-
|
|
3128
|
-
var rule = this.index[group[i_2]];
|
|
3129
|
-
var css = rule.toString(options);
|
|
3130
|
-
if (!css && !link) continue;
|
|
3131
|
-
if (str) str += '\n';
|
|
3132
|
-
str += css;
|
|
3133
|
-
}
|
|
3112
|
+
return sortCSSmq__default['default'](a, b);
|
|
3134
3113
|
}
|
|
3114
|
+
} else {
|
|
3115
|
+
return aWeight - bWeight;
|
|
3135
3116
|
}
|
|
3136
|
-
|
|
3137
|
-
|
|
3117
|
+
});
|
|
3118
|
+
return queries;
|
|
3138
3119
|
}
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3120
|
+
function recursive(pluginOptions, data) {
|
|
3121
|
+
if (isPlainObject(data) && data.rules instanceof jss.RuleList) {
|
|
3122
|
+
data.rules.toString = function (options) {
|
|
3123
|
+
if (options === void 0) {
|
|
3124
|
+
options = {};
|
|
3125
|
+
}
|
|
3126
|
+
var str = '';
|
|
3127
|
+
var sheet = this.options.sheet;
|
|
3128
|
+
var link = sheet ? sheet.options.link : false;
|
|
3129
|
+
var _a = recursiveInnerAndGetQueries(pluginOptions, this.index),
|
|
3130
|
+
groups = _a.groups,
|
|
3131
|
+
groupsSortNames = _a.groupsSortNames;
|
|
3132
|
+
for (var i = 0; i < groupsSortNames.length; i++) {
|
|
3133
|
+
var groupName = groupsSortNames[i];
|
|
3134
|
+
var group = groups[groupsSortNames[i]];
|
|
3135
|
+
if (groupName !== UN_QUERIED && pluginOptions.combineMediaQueries) {
|
|
3136
|
+
str += '\n' + groupName + ' {';
|
|
3137
|
+
for (var i_1 = 0; i_1 < group.length; i_1++) {
|
|
3138
|
+
var rule = this.index[group[i_1]];
|
|
3139
|
+
var css = rule.rules.toString(
|
|
3140
|
+
_tslib.__assign(_tslib.__assign({}, options), {
|
|
3141
|
+
indent: (options.indent || 0) + 1
|
|
3142
|
+
})
|
|
3143
|
+
);
|
|
3144
|
+
if (!css && !link) continue;
|
|
3145
|
+
if (str) str += '\n';
|
|
3146
|
+
str += css;
|
|
3147
|
+
}
|
|
3148
|
+
str += '\n}\n';
|
|
3149
|
+
} else {
|
|
3150
|
+
for (var i_2 = 0; i_2 < group.length; i_2++) {
|
|
3151
|
+
var rule = this.index[group[i_2]];
|
|
3152
|
+
var css = rule.toString(options);
|
|
3153
|
+
if (!css && !link) continue;
|
|
3154
|
+
if (str) str += '\n';
|
|
3155
|
+
str += css;
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
return str;
|
|
3160
|
+
};
|
|
3161
|
+
}
|
|
3143
3162
|
}
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3163
|
+
function jssCombineAndSortMQ(options) {
|
|
3164
|
+
if (options === void 0) {
|
|
3165
|
+
options = {};
|
|
3147
3166
|
}
|
|
3148
|
-
|
|
3149
|
-
|
|
3167
|
+
return {
|
|
3168
|
+
onProcessSheet: function (sheet) {
|
|
3169
|
+
recursive(options, sheet);
|
|
3170
|
+
}
|
|
3171
|
+
};
|
|
3172
|
+
}
|
|
3150
3173
|
|
|
3151
|
-
|
|
3174
|
+
dist = jssCombineAndSortMQ;
|
|
3175
|
+
return dist;
|
|
3176
|
+
}
|
|
3152
3177
|
|
|
3153
|
-
var
|
|
3178
|
+
var distExports = requireDist();
|
|
3179
|
+
var jssPluginSortMediaQueries = /*@__PURE__*/getDefaultExportFromCjs(distExports);
|
|
3154
3180
|
|
|
3155
3181
|
const isDisabledOrLoading = (disabled, loading) => {
|
|
3156
3182
|
return disabled || loading;
|
|
@@ -3168,30 +3194,10 @@ const darken = (hsl) => {
|
|
|
3168
3194
|
};
|
|
3169
3195
|
const changeColor = (hsl, lightness) => {
|
|
3170
3196
|
return hsl.replace(/\s(\d+)(%?)\//, (_, p1, p2) => {
|
|
3171
|
-
return ` ${Math.min(Math.max(parseInt(p1, 10) + lightness, 0), 100)}${p2}/`;
|
|
3197
|
+
return ` ${Math.min(Math.max(Number.parseInt(p1, 10) + lightness, 0), 100)}${p2}/`;
|
|
3172
3198
|
});
|
|
3173
3199
|
};
|
|
3174
3200
|
|
|
3175
|
-
const parseJSON = (prop) => {
|
|
3176
|
-
if (typeof prop === 'string') {
|
|
3177
|
-
try {
|
|
3178
|
-
// prop is potentially JSON parsable string, e.g. "{ base: 'block', l: 'inline' }" or "true" or "false"
|
|
3179
|
-
return JSON.parse(prop
|
|
3180
|
-
.replace(/'/g, '"') // convert single quotes to double quotes
|
|
3181
|
-
.replace(/[\s"]?([a-z]+)[\s"]?:([^//])/g, '"$1":$2') // wrap keys in double quotes if they don't have them but ignore potential urls
|
|
3182
|
-
);
|
|
3183
|
-
}
|
|
3184
|
-
catch {
|
|
3185
|
-
// prop is string, e.g. "block" or "inline"
|
|
3186
|
-
return prop;
|
|
3187
|
-
}
|
|
3188
|
-
}
|
|
3189
|
-
else {
|
|
3190
|
-
// prop is object, e.g. { base: 'block', l: 'inline' } or number, e.g. 123 or boolean, e.g. true
|
|
3191
|
-
return prop;
|
|
3192
|
-
}
|
|
3193
|
-
};
|
|
3194
|
-
|
|
3195
3201
|
const borderRadiusSmall = '4px';
|
|
3196
3202
|
|
|
3197
3203
|
const borderRadiusMedium = '8px';
|
|
@@ -3630,6 +3636,7 @@ const addImportantToEachRule = (input) => {
|
|
|
3630
3636
|
? result
|
|
3631
3637
|
: // @ts-expect-error: Type string can't be used to index type JssStyle
|
|
3632
3638
|
((result[key] =
|
|
3639
|
+
// biome-ignore lint/style/noCommaOperator: to be refactored
|
|
3633
3640
|
typeof value === 'object' ? addImportantToEachRule(value) : addImportantToRule(value)),
|
|
3634
3641
|
result), {});
|
|
3635
3642
|
};
|
|
@@ -3777,6 +3784,26 @@ const forcedColorsMediaQuery = (style) => {
|
|
|
3777
3784
|
return { '@media (forced-colors: active)': style };
|
|
3778
3785
|
};
|
|
3779
3786
|
|
|
3787
|
+
const parseJSON = (prop) => {
|
|
3788
|
+
if (typeof prop === 'string') {
|
|
3789
|
+
try {
|
|
3790
|
+
// prop is potentially JSON parsable string, e.g. "{ base: 'block', l: 'inline' }" or "true" or "false"
|
|
3791
|
+
return JSON.parse(prop
|
|
3792
|
+
.replace(/'/g, '"') // convert single quotes to double quotes
|
|
3793
|
+
.replace(/[\s"]?([a-z]+)[\s"]?:([^//])/g, '"$1":$2') // wrap keys in double quotes if they don't have them but ignore potential urls
|
|
3794
|
+
);
|
|
3795
|
+
}
|
|
3796
|
+
catch {
|
|
3797
|
+
// prop is string, e.g. "block" or "inline"
|
|
3798
|
+
return prop;
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
else {
|
|
3802
|
+
// prop is object, e.g. { base: 'block', l: 'inline' } or number, e.g. 123 or boolean, e.g. true
|
|
3803
|
+
return prop;
|
|
3804
|
+
}
|
|
3805
|
+
};
|
|
3806
|
+
|
|
3780
3807
|
// NOTE: handpicked selection of plugins from jss-preset-default
|
|
3781
3808
|
const jss = createJss({
|
|
3782
3809
|
plugins: [
|
|
@@ -3820,6 +3847,7 @@ const isObject = (obj) => typeof obj === 'object' && !Array.isArray(obj);
|
|
|
3820
3847
|
// NOTE: taken from https://stackoverflow.com/a/48218209
|
|
3821
3848
|
const mergeDeep = (...objects) => {
|
|
3822
3849
|
return objects.reduce((prev, obj) => {
|
|
3850
|
+
// biome-ignore lint/complexity/noForEach: to be refactored
|
|
3823
3851
|
Object.keys(obj).forEach((key) => {
|
|
3824
3852
|
const pVal = prev[key];
|
|
3825
3853
|
const oVal = obj[key];
|
|
@@ -3847,12 +3875,13 @@ const mergeDeep = (...objects) => {
|
|
|
3847
3875
|
const attributeMutationMap = new Map();
|
|
3848
3876
|
hasWindow &&
|
|
3849
3877
|
new MutationObserver((mutations) => {
|
|
3850
|
-
mutations
|
|
3878
|
+
for (const mutation of mutations
|
|
3851
3879
|
// reduce array to only entries that have really a changed value
|
|
3852
3880
|
.filter((mutation) => mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName))
|
|
3853
3881
|
// remove duplicates so we execute callback only once per node
|
|
3854
|
-
.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
|
|
3855
|
-
|
|
3882
|
+
.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)) {
|
|
3883
|
+
attributeMutationMap.get(mutation.target)?.();
|
|
3884
|
+
}
|
|
3856
3885
|
});
|
|
3857
3886
|
|
|
3858
3887
|
const mediaQueries = Object.values(breakpoint).map((v) => `(min-width:${v}px)`);
|
|
@@ -3874,17 +3903,14 @@ const observedNodesMap = new Map();
|
|
|
3874
3903
|
hasWindow &&
|
|
3875
3904
|
new MutationObserver((mutations) => {
|
|
3876
3905
|
// there may be race conditions in jsdom-polyfill tests where the map is already empty when a mutation happens
|
|
3877
|
-
if (observedNodesMap.size) {
|
|
3906
|
+
if (observedNodesMap.size > 0) {
|
|
3878
3907
|
const observedNodes = Array.from(observedNodesMap.keys());
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
.filter((node) => node.contains(mutation.target))
|
|
3886
|
-
.forEach((node) => observedNodesMap.get(node)?.());
|
|
3887
|
-
});
|
|
3908
|
+
// remove duplicates so we execute callback only once per node
|
|
3909
|
+
for (const mutation of mutations.filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)) {
|
|
3910
|
+
for (const node of observedNodes.filter((node) => node.contains(mutation.target))) {
|
|
3911
|
+
observedNodesMap.get(node)?.();
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3888
3914
|
}
|
|
3889
3915
|
});
|
|
3890
3916
|
|
|
@@ -3923,7 +3949,7 @@ const supportsNativePopover = () => {
|
|
|
3923
3949
|
if (!hasWindow) {
|
|
3924
3950
|
return false;
|
|
3925
3951
|
}
|
|
3926
|
-
return
|
|
3952
|
+
return Object.prototype.hasOwnProperty.call(HTMLElement.prototype, 'popover');
|
|
3927
3953
|
};
|
|
3928
3954
|
// determine it once
|
|
3929
3955
|
supportsNativePopover();
|
|
@@ -3950,8 +3976,7 @@ const formatObjectOutput = (value) => {
|
|
|
3950
3976
|
.replace(/(})/g, ' $1') // add space before following: }
|
|
3951
3977
|
.replace(/^"(.+)"$/, '$1'); // remove wrapping double quotes
|
|
3952
3978
|
};
|
|
3953
|
-
'value, '
|
|
3954
|
-
formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '');
|
|
3979
|
+
`value, ${formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '')}`;
|
|
3955
3980
|
|
|
3956
3981
|
const getComponentCss$19 = (size, compact, open, theme, sticky) => {
|
|
3957
3982
|
const { primaryColor, hoverColor, contrastLowColor, backgroundColor } = getThemedColors(theme);
|
|
@@ -5127,7 +5152,7 @@ const getComponentCss$12 = (gradientColor, hasHeading, hasDescription, hasContro
|
|
|
5127
5152
|
},
|
|
5128
5153
|
...preventFoucOfNestedElementsStyles,
|
|
5129
5154
|
...(hasControlsSlot && {
|
|
5130
|
-
|
|
5155
|
+
'slot[name="controls"]': {
|
|
5131
5156
|
display: 'block',
|
|
5132
5157
|
gridColumnStart: 1,
|
|
5133
5158
|
gridRowStart: 3,
|
|
@@ -5163,10 +5188,10 @@ const getComponentCss$12 = (gradientColor, hasHeading, hasDescription, hasContro
|
|
|
5163
5188
|
...(hasHeading && {
|
|
5164
5189
|
[selectorHeading]: {
|
|
5165
5190
|
maxWidth: '56.25rem',
|
|
5166
|
-
margin: `0 0 ${
|
|
5191
|
+
margin: `0 0 ${hasDescription ? 0 : spacingFluidMedium}`,
|
|
5167
5192
|
...(headingSize === 'xx-large' ? headingXXLargeStyle : headingXLargeStyle),
|
|
5168
5193
|
},
|
|
5169
|
-
|
|
5194
|
+
'::slotted([slot=heading])': {
|
|
5170
5195
|
margin: 0, // reset ua-style
|
|
5171
5196
|
...(headingSize === 'xx-large' ? headingXXLargeStyle : headingXLargeStyle),
|
|
5172
5197
|
},
|
|
@@ -5751,8 +5776,19 @@ const getComponentCss$10 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5751
5776
|
backgroundSize: 'cover',
|
|
5752
5777
|
}),
|
|
5753
5778
|
},
|
|
5754
|
-
...(
|
|
5779
|
+
...(isLoading
|
|
5755
5780
|
? {
|
|
5781
|
+
'input:checked': {
|
|
5782
|
+
// background-image is merged in later
|
|
5783
|
+
borderColor: checkedColor,
|
|
5784
|
+
backgroundColor: checkedColor,
|
|
5785
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5786
|
+
borderColor: checkedColorDark,
|
|
5787
|
+
backgroundColor: checkedColorDark,
|
|
5788
|
+
}),
|
|
5789
|
+
},
|
|
5790
|
+
}
|
|
5791
|
+
: {
|
|
5756
5792
|
'input:checked': {
|
|
5757
5793
|
borderColor: checkedColor,
|
|
5758
5794
|
backgroundColor: checkedColor,
|
|
@@ -5787,17 +5823,6 @@ const getComponentCss$10 = (hideLabel, state, isDisabled, isLoading, compact, th
|
|
|
5787
5823
|
backgroundImage: getIndeterminateSVGBackgroundImage('white'),
|
|
5788
5824
|
})),
|
|
5789
5825
|
},
|
|
5790
|
-
}
|
|
5791
|
-
: {
|
|
5792
|
-
'input:checked': {
|
|
5793
|
-
// background-image is merged in later
|
|
5794
|
-
borderColor: checkedColor,
|
|
5795
|
-
backgroundColor: checkedColor,
|
|
5796
|
-
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
5797
|
-
borderColor: checkedColorDark,
|
|
5798
|
-
backgroundColor: checkedColorDark,
|
|
5799
|
-
}),
|
|
5800
|
-
},
|
|
5801
5826
|
}),
|
|
5802
5827
|
...(!disabledOrLoading &&
|
|
5803
5828
|
!isHighContrastMode &&
|
|
@@ -7894,7 +7919,7 @@ const getComponentCss$D = (model, safeZone, size, color, theme) => {
|
|
|
7894
7919
|
maxWidth: '100%',
|
|
7895
7920
|
maxHeight: '100%',
|
|
7896
7921
|
// width + height style can't be !important atm to be backwards compatible with e.g. `<p-model-signature size="inherit" style="height: 50px"/>`
|
|
7897
|
-
width: `var(${cssVariableWidth},${isSizeInherit ? 'auto' : width
|
|
7922
|
+
width: `var(${cssVariableWidth},${isSizeInherit ? 'auto' : `${width}px`})`,
|
|
7898
7923
|
height: `var(${cssVariableHeight},auto)`,
|
|
7899
7924
|
...addImportantToEachRule({
|
|
7900
7925
|
mask: `url(${getSvgUrl(model)}) no-repeat left top / contain`,
|
|
@@ -8062,7 +8087,7 @@ const getSlottedTextFieldTextareaSelectStyles = (child, state, isLoading, theme,
|
|
|
8062
8087
|
}),
|
|
8063
8088
|
...additionalDefaultJssStyle,
|
|
8064
8089
|
},
|
|
8065
|
-
|
|
8090
|
+
'::slotted(:not(input[type="password"]))': {
|
|
8066
8091
|
textOverflow: 'ellipsis',
|
|
8067
8092
|
},
|
|
8068
8093
|
...(!isLoading &&
|
|
@@ -8610,7 +8635,7 @@ const removeStyles = (selector, styles) => Object.fromEntries(Object.entries(sty
|
|
|
8610
8635
|
return [key, value];
|
|
8611
8636
|
}));
|
|
8612
8637
|
|
|
8613
|
-
const getComponentCss$x = (hideLabel, state, isDisabled, isLoading,
|
|
8638
|
+
const getComponentCss$x = (hideLabel, state, isDisabled, isLoading, length, theme) => {
|
|
8614
8639
|
const inputSize = `calc(${fontLineHeight} + 10px + ${borderWidthBase} * 2 + ${spacingStaticSmall} * 2)`; // equivalent to calculation of input height within form-styles
|
|
8615
8640
|
const inputStyles = removeStyles('input[readonly]', removeSlottedSelector(getSlottedTextFieldTextareaSelectStyles('input', state, isLoading, theme, {
|
|
8616
8641
|
// TODO: move into getSlottedTextFieldTextareaSelectStyles()
|
|
@@ -8658,15 +8683,6 @@ const getComponentCss$x = (hideLabel, state, isDisabled, isLoading, isWithinForm
|
|
|
8658
8683
|
...preventFoucOfNestedElementsStyles,
|
|
8659
8684
|
// input
|
|
8660
8685
|
...inputStyles,
|
|
8661
|
-
...(isWithinForm &&
|
|
8662
|
-
addImportantToEachRule({
|
|
8663
|
-
'::slotted([slot=internal-input])': {
|
|
8664
|
-
position: 'absolute',
|
|
8665
|
-
height: inputSize,
|
|
8666
|
-
width: 0,
|
|
8667
|
-
opacity: 0,
|
|
8668
|
-
},
|
|
8669
|
-
})),
|
|
8670
8686
|
},
|
|
8671
8687
|
root: {
|
|
8672
8688
|
display: 'grid',
|
|
@@ -9206,11 +9222,7 @@ const getComponentCss$t = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
9206
9222
|
}),
|
|
9207
9223
|
});
|
|
9208
9224
|
};
|
|
9209
|
-
|
|
9210
|
-
const MIN_ITEM_WIDTH = 46;
|
|
9211
|
-
const MAX_ITEM_WIDTH = 220;
|
|
9212
9225
|
const getComponentCss$s = (maxWidth, columns) => {
|
|
9213
|
-
maxWidth = (maxWidth > MAX_ITEM_WIDTH && MAX_ITEM_WIDTH) || (maxWidth < MIN_ITEM_WIDTH && MIN_ITEM_WIDTH) || maxWidth;
|
|
9214
9226
|
return getCss({
|
|
9215
9227
|
'@global': {
|
|
9216
9228
|
':host': {
|
|
@@ -9218,7 +9230,9 @@ const getComponentCss$s = (maxWidth, columns) => {
|
|
|
9218
9230
|
...addImportantToEachRule({
|
|
9219
9231
|
gridAutoRows: '1fr', // for equal height
|
|
9220
9232
|
...buildResponsiveStyles(columns, (col) => ({
|
|
9221
|
-
gridTemplateColumns: col === 'auto'
|
|
9233
|
+
gridTemplateColumns: col === 'auto'
|
|
9234
|
+
? `repeat(auto-fit, ${maxWidth}px)`
|
|
9235
|
+
: `repeat(${col}, minmax(0, 1fr))`,
|
|
9222
9236
|
})),
|
|
9223
9237
|
gap: '6px',
|
|
9224
9238
|
...colorSchemeStyles,
|
|
@@ -9870,9 +9884,9 @@ const getComponentCss$o = (size, theme) => {
|
|
|
9870
9884
|
};
|
|
9871
9885
|
|
|
9872
9886
|
const getSVGPath = (stepCount, numberedCircleColors, isStateCurrent) => {
|
|
9873
|
-
// # of the
|
|
9874
|
-
|
|
9875
|
-
const { disabledColor, invertedBaseColor, primaryColor } =
|
|
9887
|
+
// # of the hex color starts a fragment identifier in URLs, so we have to replace it with the escaped value of # = %23
|
|
9888
|
+
const escapedNumberedCircleColors = Object.entries(numberedCircleColors).reduce((result, [key, value]) => ({ ...result, [key]: escapeHashCharacter(value) }), {});
|
|
9889
|
+
const { disabledColor, invertedBaseColor, primaryColor } = escapedNumberedCircleColors;
|
|
9876
9890
|
const fillColor = isStateCurrent ? invertedBaseColor : disabledColor;
|
|
9877
9891
|
const svgCirclePath = `<circle fill="${isStateCurrent ? primaryColor : 'none'}"${isStateCurrent ? '' : ` stroke="${fillColor}"`} stroke-width="1px" cx="12" cy="12" r="9"/>`;
|
|
9878
9892
|
// Full SVG is provided by design (./numbers_raw.svg), created with illustrator and optimized with ImageOptim.
|
|
@@ -9901,7 +9915,7 @@ const getComponentCss$n = (state, disabled, theme) => {
|
|
|
9901
9915
|
'@global': {
|
|
9902
9916
|
':host': {
|
|
9903
9917
|
...(isStateCurrentOrUndefined &&
|
|
9904
|
-
Array.from(Array(9)).reduce((result, _, i) => ({
|
|
9918
|
+
Array.from(new Array(9)).reduce((result, _, i) => ({
|
|
9905
9919
|
...result,
|
|
9906
9920
|
[`&(:nth-of-type(${i + 1})) $button::before`]: {
|
|
9907
9921
|
backgroundImage: getInlineSVGBackgroundImage(getSVGPath(i, {
|
|
@@ -10467,8 +10481,7 @@ const getComponentCss$d = (size, weight, theme) => {
|
|
|
10467
10481
|
},
|
|
10468
10482
|
// conditionally applied and removed based on if activeTabIndex exists
|
|
10469
10483
|
[scrollerAnimatedCssClass]: {
|
|
10470
|
-
['
|
|
10471
|
-
transformSelector('::slotted([role][aria-selected="true"])::after, ::slotted([role][aria-current="true"])::after')]: {
|
|
10484
|
+
[`& ${transformSelector('::slotted([role][aria-selected="true"])::after, ::slotted([role][aria-current="true"])::after')}`]: {
|
|
10472
10485
|
transition: addImportantToRule(`visibility 0s linear var(${cssVariableTransitionDuration}, ${motionDurationModerate})`), // bar appears after transition
|
|
10473
10486
|
},
|
|
10474
10487
|
},
|
|
@@ -11087,7 +11100,7 @@ const getComponentCss$3 = (isDisabled, hideLabel, state, hasCounter, resize, the
|
|
|
11087
11100
|
},
|
|
11088
11101
|
...hoverMediaQuery({
|
|
11089
11102
|
// with the media query the selector has higher priority and overrides disabled styles
|
|
11090
|
-
|
|
11103
|
+
'textarea:not(:disabled):not(:focus):not([readonly]):hover,label:hover~.wrapper textarea:not(:disabled):not(:focus):not([readonly])': {
|
|
11091
11104
|
borderColor: formStateHoverColor || primaryColor,
|
|
11092
11105
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
11093
11106
|
borderColor: formStateHoverColorDark || primaryColorDark,
|