@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkpixellab-public/px-vue",
3
- "version": "3.0.84",
3
+ "version": "3.0.85",
4
4
  "description": "General purpose Vue components and helpers that can be used across projects.",
5
5
  "author": "Pixel Lab",
6
6
  "license": "MIT",
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
- const unit = cssUnit(val);
104
- const num = cssNum(val);
105
- return `${num * scaler}${unit}`;
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
  /*