@thinkpixellab-public/px-vue 3.0.78 → 3.0.80

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.
@@ -24,7 +24,11 @@ export default {
24
24
  const resizeDebouncedFn =
25
25
  this.resizeDebounceValue && this.resize
26
26
  ? debounce(e => {
27
- this.resize(e);
27
+ try {
28
+ this.resize(e);
29
+ } catch (e) {
30
+ console.error('Resize: ' + e);
31
+ }
28
32
  this.resizing = false;
29
33
  }, this.resizeDebounceValue)
30
34
  : null;
@@ -44,13 +48,28 @@ export default {
44
48
  // regular version
45
49
  else {
46
50
  if (this.resize) {
47
- this.resize();
51
+ try {
52
+ this.resize();
53
+ } catch (e) {
54
+ console.error('Resize: ' + e);
55
+ }
48
56
  }
49
57
  }
50
58
  };
51
59
 
52
60
  this.resizeObserver = new ResizeObserver(resizeFn);
53
- this.resizeObserver.observe(this.observeElementValue);
61
+
62
+ if (
63
+ this.observeElementValue &&
64
+ (this.observeElementValue instanceof Element ||
65
+ this.observeElementValue instanceof SVGElement)
66
+ ) {
67
+ this.resizeObserver.observe(this.observeElementValue);
68
+ } else {
69
+ console.warn(
70
+ `Could not call ResizeObserver.observe because observeElementValue is not an Element: ${this.observeElementValue}`
71
+ );
72
+ }
54
73
  },
55
74
  beforeDestroy() {
56
75
  this.resizeObserver.disconnect();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkpixellab-public/px-vue",
3
- "version": "3.0.78",
3
+ "version": "3.0.80",
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
@@ -178,6 +178,13 @@ function cssUnitFallback(val, fallback, allowNumberless = false) {
178
178
 
179
179
  val = val.toString().trim();
180
180
 
181
+ if (
182
+ allowNumberless &&
183
+ (val.startsWith('min') || val.startsWith('max') || val.startsWith('calc'))
184
+ ) {
185
+ return val;
186
+ }
187
+
181
188
  if (isNaN(num)) {
182
189
  if (allowNumberless) {
183
190
  num = '';