@thinkpixellab-public/px-vue 3.0.84 → 3.0.85
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/components/PxBaseVariants.vue +0 -4
- package/package.json +1 -1
- package/utils/cssStr.js +9 -4
|
@@ -40,10 +40,6 @@ export default {
|
|
|
40
40
|
methods: {
|
|
41
41
|
// true if the given variant (string) or variants (array) are present
|
|
42
42
|
isVariant(val) {
|
|
43
|
-
// if (val.includes && val.includes('offset')) {
|
|
44
|
-
// debugger;
|
|
45
|
-
// }
|
|
46
|
-
|
|
47
43
|
if (this.variants && this.variants.length && val) {
|
|
48
44
|
if (typeof val == 'string') {
|
|
49
45
|
return this.variants?.includes(val);
|
package/package.json
CHANGED
package/utils/cssStr.js
CHANGED
|
@@ -99,10 +99,15 @@ function cssUnit(val) {
|
|
|
99
99
|
* @example
|
|
100
100
|
* cssUnitScale('10px', 2) => '20px'
|
|
101
101
|
*/
|
|
102
|
-
function cssUnitScale(val, scaler) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
function cssUnitScale(val, scaler, min = null, max = null) {
|
|
103
|
+
let unit = cssUnit(val);
|
|
104
|
+
let num = cssNum(val);
|
|
105
|
+
|
|
106
|
+
num = num * scaler;
|
|
107
|
+
num = min !== null && num < min ? min : num;
|
|
108
|
+
num = max !== null && num > max ? max : num;
|
|
109
|
+
|
|
110
|
+
return `${num}${unit}`;
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
/*
|