@thinkpixellab-public/px-vue 3.0.83 → 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);
@@ -27,6 +27,7 @@
27
27
  :viewBox="svgViewBox"
28
28
  :height="calcHeight"
29
29
  :width="calcWidth"
30
+ :aria-label="title"
30
31
  :title="title"
31
32
  :role="role"
32
33
  :focusable="focusable"
@@ -67,7 +68,7 @@ export default {
67
68
  title: { type: String, default: null },
68
69
 
69
70
  // the role applied for accessibility
70
- role: { type: String, default: 'img' },
71
+ role: { type: String, default: null },
71
72
 
72
73
  // focusable false by default for accessibility in older browsers
73
74
  focusable: { type: Boolean, default: false },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkpixellab-public/px-vue",
3
- "version": "3.0.83",
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
  /*