@pumpkin-tech/pumpkin-tech-ng 0.2.12 → 0.2.13
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.
|
@@ -224,8 +224,6 @@ class PtechColDirective {
|
|
|
224
224
|
ptechColLg;
|
|
225
225
|
ptechColXl;
|
|
226
226
|
activeBp = null;
|
|
227
|
-
viewportBp = null;
|
|
228
|
-
containerBp = null;
|
|
229
227
|
activeSource = null;
|
|
230
228
|
gridColumn = 'auto / span 12';
|
|
231
229
|
minWidth = '0';
|
|
@@ -239,14 +237,7 @@ class PtechColDirective {
|
|
|
239
237
|
.subscribe(s => {
|
|
240
238
|
if (this.ptechColMode === 'container')
|
|
241
239
|
return;
|
|
242
|
-
this.
|
|
243
|
-
if (this.ptechColMode === 'auto') {
|
|
244
|
-
this.activeBp = this.pickAutoBp();
|
|
245
|
-
this.activeSource = this.containerBp ? 'container' : 'viewport';
|
|
246
|
-
this.updateSpan();
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
this.activeBp = this.viewportBp;
|
|
240
|
+
this.activeBp = this.pickActive(s.breakpoints);
|
|
250
241
|
this.activeSource = 'viewport';
|
|
251
242
|
this.updateSpan();
|
|
252
243
|
});
|
|
@@ -268,23 +259,15 @@ class PtechColDirective {
|
|
|
268
259
|
: w >= 960 ? 'md'
|
|
269
260
|
: w >= 600 ? 'sm'
|
|
270
261
|
: 'xs';
|
|
271
|
-
this.
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
if (nextBp !== this.activeBp || this.activeSource !== 'container') {
|
|
276
|
-
this.activeBp = nextBp;
|
|
277
|
-
this.activeSource = 'container';
|
|
278
|
-
this.updateSpan();
|
|
279
|
-
}
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
if (this.ptechColMode === 'container' && (bp !== this.activeBp || this.activeSource !== 'container')) {
|
|
262
|
+
if (this.ptechColMode !== 'container')
|
|
263
|
+
return;
|
|
264
|
+
if (bp !== this.activeBp || this.activeSource !== 'container') {
|
|
265
|
+
this.ngZone.run(() => {
|
|
283
266
|
this.activeBp = bp;
|
|
284
267
|
this.activeSource = 'container';
|
|
285
268
|
this.updateSpan();
|
|
286
|
-
}
|
|
287
|
-
}
|
|
269
|
+
});
|
|
270
|
+
}
|
|
288
271
|
});
|
|
289
272
|
});
|
|
290
273
|
this.ro.observe(gridParent);
|
|
@@ -316,14 +299,6 @@ class PtechColDirective {
|
|
|
316
299
|
return key;
|
|
317
300
|
return null;
|
|
318
301
|
}
|
|
319
|
-
pickAutoBp() {
|
|
320
|
-
const rank = { xs: 0, sm: 1, md: 2, lg: 3, xl: 4 };
|
|
321
|
-
if (!this.viewportBp)
|
|
322
|
-
return this.containerBp;
|
|
323
|
-
if (!this.containerBp)
|
|
324
|
-
return this.viewportBp;
|
|
325
|
-
return rank[this.viewportBp] <= rank[this.containerBp] ? this.viewportBp : this.containerBp;
|
|
326
|
-
}
|
|
327
302
|
updateSpan() {
|
|
328
303
|
const span = this.resolveColForBp();
|
|
329
304
|
if (span === this.lastSpan)
|