@thinkpixellab-public/px-vue 3.0.66 → 3.0.67

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.
@@ -49,11 +49,18 @@
49
49
  -->
50
50
 
51
51
  <script>
52
+ import utils from '../utils/utils.js';
53
+
52
54
  export default {
53
55
  data() {
54
56
  return { isMobile: null };
55
57
  },
56
58
  mounted() {
59
+ if (utils.getQueryBool('alwaysMobile')) {
60
+ this.isMobile = true;
61
+ return;
62
+ }
63
+
57
64
  if (this.$globalOn) {
58
65
  this.$globalOn('mobile-changed', isMobile => {
59
66
  this.isMobile = isMobile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkpixellab-public/px-vue",
3
- "version": "3.0.66",
3
+ "version": "3.0.67",
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
@@ -190,6 +190,13 @@ function cssEmFallback(val, allowNumberless = false) {
190
190
  return cssUnitFallback(val, 'em', allowNumberless);
191
191
  }
192
192
 
193
+ /*
194
+ Px version of cssUnitFallback
195
+ */
196
+ function cssPxFallback(val, allowNumberless = false) {
197
+ return cssUnitFallback(val, 'px', allowNumberless);
198
+ }
199
+
193
200
  export {
194
201
  cssPx,
195
202
  cssEm,
@@ -201,4 +208,5 @@ export {
201
208
  cssUnit,
202
209
  cssUnitFallback,
203
210
  cssEmFallback,
211
+ cssPxFallback,
204
212
  };
package/utils/drag.js CHANGED
@@ -60,7 +60,6 @@ function Drag(element, options) {
60
60
 
61
61
  this.onStart = nativeEvent => {
62
62
  if (this.disabled) {
63
- debugger;
64
63
  return;
65
64
  }
66
65
 
package/utils/utils.js CHANGED
@@ -116,6 +116,38 @@ export default {
116
116
  return chunks;
117
117
  },
118
118
 
119
+ /**
120
+ * Returns an array containing any elements that are in arrA not in arrB (e.g. arrA - arrB)
121
+ * @param {} arrA The source array
122
+ * @param {} arrB The comparison array
123
+ *
124
+ * @expample arrMinus([1,2,3], [3,4,5]) ==> [1,2]
125
+ */
126
+ arrMinus: function (arrA, arrB) {
127
+ return arrA.filter(item => !arrB.includes(item));
128
+ },
129
+
130
+ /**
131
+ * Returns an object like {added: [...], removed: [...]} containing the delta between arrOld and
132
+ * arrNew such that removed are elements in arrOld but not in arrNew and added are elements in
133
+ * arrNew but not in arrOld.
134
+ * @param {} arrOld The source array
135
+ * @param {} arrNew The comparison array
136
+ */
137
+ arrDelta: function (arrOld, arrNew) {
138
+ return {
139
+ added: this.arrMinus(arrNew, arrOld),
140
+ removed: this.arrMinus(arrOld, arrNew),
141
+ };
142
+ },
143
+
144
+ /**
145
+ * Returns an array of all elements found in both arrA and arrB.
146
+ */
147
+ arrIntersect: function (arrA, arrB) {
148
+ return arrA.filter(value => arrB.includes(value));
149
+ },
150
+
119
151
  /**
120
152
  * Returns an object representing the current query string parameters.
121
153
  */