framework7 7.0.0-beta.12 → 7.0.0-beta.15

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Framework7 7.0.0-beta.12
2
+ * Framework7 7.0.0-beta.15
3
3
  * Full featured mobile HTML framework for building iOS & Android apps
4
4
  * https://framework7.io/
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: February 22, 2022
10
+ * Released on: April 11, 2022
11
11
  */
12
12
 
13
13
  /*====================
@@ -8326,6 +8326,9 @@ html.with-modal-preloader .page-content,
8326
8326
  opacity: 0.85;
8327
8327
  }
8328
8328
  @keyframes ios-preloader-spin {
8329
+ 0% {
8330
+ transform: rotate(0deg);
8331
+ }
8329
8332
  100% {
8330
8333
  transform: rotate(360deg);
8331
8334
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Framework7 7.0.0-beta.12
2
+ * Framework7 7.0.0-beta.15
3
3
  * Full featured mobile HTML framework for building iOS & Android apps
4
4
  * https://framework7.io/
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: February 22, 2022
10
+ * Released on: April 11, 2022
11
11
  */
12
12
 
13
13
  import $ from './shared/dom7.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Framework7 7.0.0-beta.12
2
+ * Framework7 7.0.0-beta.15
3
3
  * Full featured mobile HTML framework for building iOS & Android apps
4
4
  * https://framework7.io/
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: February 22, 2022
10
+ * Released on: April 11, 2022
11
11
  */
12
12
 
13
13
  (function (global, factory) {
@@ -10090,7 +10090,14 @@
10090
10090
  view.initMasterDetail();
10091
10091
  }
10092
10092
 
10093
- view.router.init();
10093
+ if (view.params.initRouterOnTabShow && view.$el.hasClass('tab') && !view.$el.hasClass('tab-active')) {
10094
+ view.$el.once('tab:show', () => {
10095
+ view.router.init();
10096
+ });
10097
+ } else {
10098
+ view.router.init();
10099
+ }
10100
+
10094
10101
  view.$el.trigger('view:init');
10095
10102
  view.emit('local::init viewInit', view);
10096
10103
  }
@@ -12645,6 +12652,7 @@
12645
12652
  params: {
12646
12653
  view: {
12647
12654
  init: true,
12655
+ initRouterOnTabShow: false,
12648
12656
  name: undefined,
12649
12657
  main: false,
12650
12658
  router: true,
@@ -18323,7 +18331,8 @@
18323
18331
  rowsToRender: undefined,
18324
18332
  maxBufferHeight: 0,
18325
18333
  listHeight: undefined,
18326
- dynamicHeight: typeof vl.params.height === 'function'
18334
+ dynamicHeight: typeof vl.params.height === 'function',
18335
+ autoHeight: vl.params.height === 'auto'
18327
18336
  }); // Install Modules
18328
18337
 
18329
18338
  vl.useModules(); // Attach events
@@ -18364,10 +18373,13 @@
18364
18373
  return vl;
18365
18374
  }
18366
18375
 
18367
- setListSize() {
18376
+ setListSize(autoHeightRerender) {
18368
18377
  const vl = this;
18369
18378
  const items = vl.filteredItems || vl.items;
18370
- vl.pageHeight = vl.$scrollableParentEl[0].offsetHeight;
18379
+
18380
+ if (!autoHeightRerender) {
18381
+ vl.pageHeight = vl.$scrollableParentEl[0].offsetHeight;
18382
+ }
18371
18383
 
18372
18384
  if (vl.dynamicHeight) {
18373
18385
  vl.listHeight = 0;
@@ -18378,6 +18390,31 @@
18378
18390
  vl.listHeight += itemHeight;
18379
18391
  vl.heights.push(itemHeight);
18380
18392
  }
18393
+ } else if (vl.autoHeight) {
18394
+ vl.listHeight = 0;
18395
+ if (!vl.heights) vl.heights = [];
18396
+ if (!vl.heightsCalculated) vl.heightsCalculated = [];
18397
+ const renderedItems = {};
18398
+ vl.$itemsWrapEl.find(`[data-virtual-list-index]`).forEach(el => {
18399
+ renderedItems[parseInt(el.getAttribute('data-virtual-list-index'), 10)] = el;
18400
+ });
18401
+
18402
+ for (let i = 0; i < items.length; i += 1) {
18403
+ const renderedItem = renderedItems[i];
18404
+
18405
+ if (renderedItem) {
18406
+ if (!vl.heightsCalculated.includes(i)) {
18407
+ vl.heights[i] = renderedItem.offsetHeight;
18408
+ vl.heightsCalculated.push(i);
18409
+ }
18410
+ }
18411
+
18412
+ if (typeof vl.heights[i] === 'undefined') {
18413
+ vl.heights[i] = 40;
18414
+ }
18415
+
18416
+ vl.listHeight += vl.heights[i];
18417
+ }
18381
18418
  } else {
18382
18419
  vl.listHeight = Math.ceil(items.length / vl.params.cols) * vl.params.height;
18383
18420
  vl.rowsPerScreen = Math.ceil(vl.pageHeight / vl.params.height);
@@ -18412,7 +18449,7 @@
18412
18449
  let heightBeforeFirstItem = 0;
18413
18450
  let heightBeforeLastItem = 0;
18414
18451
 
18415
- if (vl.dynamicHeight) {
18452
+ if (vl.dynamicHeight || vl.autoHeight) {
18416
18453
  let itemTop = 0;
18417
18454
  let itemHeight;
18418
18455
  vl.maxBufferHeight = vl.pageHeight;
@@ -18479,7 +18516,7 @@
18479
18516
 
18480
18517
 
18481
18518
  if (i === fromIndex) {
18482
- if (vl.dynamicHeight) {
18519
+ if (vl.dynamicHeight || vl.autoHeight) {
18483
18520
  topPosition = heightBeforeFirstItem;
18484
18521
  } else {
18485
18522
  topPosition = i * vl.params.height / vl.params.cols;
@@ -18497,7 +18534,7 @@
18497
18534
 
18498
18535
 
18499
18536
  if (!vl.updatableScroll) {
18500
- if (vl.dynamicHeight) {
18537
+ if (vl.dynamicHeight || vl.autoHeight) {
18501
18538
  vl.itemsWrapEl.style.height = `${heightBeforeLastItem}px`;
18502
18539
  } else {
18503
18540
  vl.itemsWrapEl.style.height = `${i * vl.params.height / vl.params.cols}px`;
@@ -18537,6 +18574,12 @@
18537
18574
  items: renderExternalItems
18538
18575
  });
18539
18576
  }
18577
+
18578
+ if (vl.autoHeight) {
18579
+ requestAnimationFrame(() => {
18580
+ vl.setListSize(true);
18581
+ });
18582
+ }
18540
18583
  } // Filter
18541
18584
 
18542
18585
 
@@ -18573,7 +18616,7 @@
18573
18616
  if (index > vl.items.length) return false;
18574
18617
  let itemTop = 0;
18575
18618
 
18576
- if (vl.dynamicHeight) {
18619
+ if (vl.dynamicHeight || vl.autoHeight) {
18577
18620
  for (let i = 0; i < index; i += 1) {
18578
18621
  itemTop += vl.heights[i];
18579
18622
  }
@@ -18601,6 +18644,7 @@
18601
18644
  const vl = this;
18602
18645
 
18603
18646
  if (vl.isVisible()) {
18647
+ vl.heightsCalculated = [];
18604
18648
  vl.setListSize();
18605
18649
  vl.render(true);
18606
18650
  }
@@ -18801,6 +18845,7 @@
18801
18845
  vl.domCache = {};
18802
18846
  }
18803
18847
 
18848
+ vl.heightsCalculated = [];
18804
18849
  vl.setListSize();
18805
18850
  vl.render(true);
18806
18851
  }