framework7 7.0.0-beta.11 → 7.0.0-beta.16

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.
Files changed (37) hide show
  1. package/components/preloader/preloader-ios.less +3 -0
  2. package/components/preloader/preloader-rtl.css +1 -1
  3. package/components/preloader/preloader.css +1 -1
  4. package/components/statusbar/statusbar.d.ts +9 -9
  5. package/components/view/view-class.js +8 -1
  6. package/components/view/view.d.ts +3 -1
  7. package/components/view/view.js +1 -0
  8. package/components/virtual-list/virtual-list-class.js +44 -7
  9. package/components/virtual-list/virtual-list.d.ts +2 -2
  10. package/components/virtual-list/virtual-list.lazy.js +1 -1
  11. package/framework7-bundle-rtl.css +5 -2
  12. package/framework7-bundle-rtl.min.css +3 -3
  13. package/framework7-bundle.css +5 -2
  14. package/framework7-bundle.esm.js +2 -2
  15. package/framework7-bundle.js +57 -13
  16. package/framework7-bundle.js.map +1 -1
  17. package/framework7-bundle.less +2 -2
  18. package/framework7-bundle.min.css +3 -3
  19. package/framework7-bundle.min.js +3 -3
  20. package/framework7-bundle.min.js.map +1 -1
  21. package/framework7-lite-bundle.esm.js +2 -2
  22. package/framework7-lite.esm.js +2 -2
  23. package/framework7-rtl.css +2 -2
  24. package/framework7-rtl.min.css +2 -2
  25. package/framework7.css +2 -2
  26. package/framework7.esm.js +2 -2
  27. package/framework7.js +13 -6
  28. package/framework7.js.map +1 -1
  29. package/framework7.less +2 -2
  30. package/framework7.min.css +2 -2
  31. package/framework7.min.js +3 -3
  32. package/framework7.min.js.map +1 -1
  33. package/modules/component/component.d.ts +2 -2
  34. package/modules/device/device.js +1 -1
  35. package/package.json +2 -1
  36. package/shared/get-device.d.ts +0 -2
  37. package/shared/get-device.js +1 -2
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Framework7 7.0.0-beta.11
2
+ * Framework7 7.0.0-beta.16
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 17, 2022
10
+ * Released on: April 12, 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.11
2
+ * Framework7 7.0.0-beta.16
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 17, 2022
10
+ * Released on: April 12, 2022
11
11
  */
12
12
 
13
13
  import $ from './shared/dom7.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Framework7 7.0.0-beta.11
2
+ * Framework7 7.0.0-beta.16
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 17, 2022
10
+ * Released on: April 12, 2022
11
11
  */
12
12
 
13
13
  (function (global, factory) {
@@ -2237,8 +2237,7 @@
2237
2237
  firefox: false,
2238
2238
  macos: false,
2239
2239
  windows: false,
2240
- cordova: !!(window.cordova || window.phonegap),
2241
- phonegap: !!(window.cordova || window.phonegap),
2240
+ cordova: !!window.cordova,
2242
2241
  electron: false,
2243
2242
  capacitor: !!window.Capacitor,
2244
2243
  nwjs: false
@@ -3216,7 +3215,7 @@
3216
3215
  }
3217
3216
  }
3218
3217
 
3219
- if (device.cordova || device.phonegap) {
3218
+ if (device.cordova) {
3220
3219
  classNames.push('device-cordova');
3221
3220
  }
3222
3221
 
@@ -10091,7 +10090,14 @@
10091
10090
  view.initMasterDetail();
10092
10091
  }
10093
10092
 
10094
- 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
+
10095
10101
  view.$el.trigger('view:init');
10096
10102
  view.emit('local::init viewInit', view);
10097
10103
  }
@@ -12646,6 +12652,7 @@
12646
12652
  params: {
12647
12653
  view: {
12648
12654
  init: true,
12655
+ initRouterOnTabShow: false,
12649
12656
  name: undefined,
12650
12657
  main: false,
12651
12658
  router: true,
@@ -18324,7 +18331,8 @@
18324
18331
  rowsToRender: undefined,
18325
18332
  maxBufferHeight: 0,
18326
18333
  listHeight: undefined,
18327
- dynamicHeight: typeof vl.params.height === 'function'
18334
+ dynamicHeight: typeof vl.params.height === 'function',
18335
+ autoHeight: vl.params.height === 'auto'
18328
18336
  }); // Install Modules
18329
18337
 
18330
18338
  vl.useModules(); // Attach events
@@ -18365,10 +18373,13 @@
18365
18373
  return vl;
18366
18374
  }
18367
18375
 
18368
- setListSize() {
18376
+ setListSize(autoHeightRerender) {
18369
18377
  const vl = this;
18370
18378
  const items = vl.filteredItems || vl.items;
18371
- vl.pageHeight = vl.$scrollableParentEl[0].offsetHeight;
18379
+
18380
+ if (!autoHeightRerender) {
18381
+ vl.pageHeight = vl.$scrollableParentEl[0].offsetHeight;
18382
+ }
18372
18383
 
18373
18384
  if (vl.dynamicHeight) {
18374
18385
  vl.listHeight = 0;
@@ -18379,6 +18390,31 @@
18379
18390
  vl.listHeight += itemHeight;
18380
18391
  vl.heights.push(itemHeight);
18381
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
+ }
18382
18418
  } else {
18383
18419
  vl.listHeight = Math.ceil(items.length / vl.params.cols) * vl.params.height;
18384
18420
  vl.rowsPerScreen = Math.ceil(vl.pageHeight / vl.params.height);
@@ -18413,7 +18449,7 @@
18413
18449
  let heightBeforeFirstItem = 0;
18414
18450
  let heightBeforeLastItem = 0;
18415
18451
 
18416
- if (vl.dynamicHeight) {
18452
+ if (vl.dynamicHeight || vl.autoHeight) {
18417
18453
  let itemTop = 0;
18418
18454
  let itemHeight;
18419
18455
  vl.maxBufferHeight = vl.pageHeight;
@@ -18480,7 +18516,7 @@
18480
18516
 
18481
18517
 
18482
18518
  if (i === fromIndex) {
18483
- if (vl.dynamicHeight) {
18519
+ if (vl.dynamicHeight || vl.autoHeight) {
18484
18520
  topPosition = heightBeforeFirstItem;
18485
18521
  } else {
18486
18522
  topPosition = i * vl.params.height / vl.params.cols;
@@ -18498,7 +18534,7 @@
18498
18534
 
18499
18535
 
18500
18536
  if (!vl.updatableScroll) {
18501
- if (vl.dynamicHeight) {
18537
+ if (vl.dynamicHeight || vl.autoHeight) {
18502
18538
  vl.itemsWrapEl.style.height = `${heightBeforeLastItem}px`;
18503
18539
  } else {
18504
18540
  vl.itemsWrapEl.style.height = `${i * vl.params.height / vl.params.cols}px`;
@@ -18538,6 +18574,12 @@
18538
18574
  items: renderExternalItems
18539
18575
  });
18540
18576
  }
18577
+
18578
+ if (vl.autoHeight) {
18579
+ requestAnimationFrame(() => {
18580
+ vl.setListSize(true);
18581
+ });
18582
+ }
18541
18583
  } // Filter
18542
18584
 
18543
18585
 
@@ -18574,7 +18616,7 @@
18574
18616
  if (index > vl.items.length) return false;
18575
18617
  let itemTop = 0;
18576
18618
 
18577
- if (vl.dynamicHeight) {
18619
+ if (vl.dynamicHeight || vl.autoHeight) {
18578
18620
  for (let i = 0; i < index; i += 1) {
18579
18621
  itemTop += vl.heights[i];
18580
18622
  }
@@ -18602,6 +18644,7 @@
18602
18644
  const vl = this;
18603
18645
 
18604
18646
  if (vl.isVisible()) {
18647
+ vl.heightsCalculated = [];
18605
18648
  vl.setListSize();
18606
18649
  vl.render(true);
18607
18650
  }
@@ -18802,6 +18845,7 @@
18802
18845
  vl.domCache = {};
18803
18846
  }
18804
18847
 
18848
+ vl.heightsCalculated = [];
18805
18849
  vl.setListSize();
18806
18850
  vl.render(true);
18807
18851
  }