framework7 7.1.2 → 7.1.3

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.
@@ -132,11 +132,13 @@ function backward(router, el, backwardOptions) {
132
132
  if (router.history.indexOf(options.route.url) >= 0) {
133
133
  backIndex = router.history.length - router.history.indexOf(options.route.url) - 1;
134
134
  router.history = router.history.slice(0, router.history.indexOf(options.route.url) + 2);
135
+ router.propsHistory = router.propsHistory.slice(0, router.history.indexOf(options.route.url) + 2);
135
136
  view.history = router.history;
136
137
  } else if (router.history[[router.history.length - 2]]) {
137
- router.history[router.history.length - 2] = options.route.url;
138
+ router.propsHistory[router.propsHistory.length - 2] = options.props || {};
138
139
  } else {
139
140
  router.history.unshift(router.url);
141
+ router.propsHistory.unshift(options.props || {});
140
142
  }
141
143
 
142
144
  if (backIndex && router.params.stackPages) {
@@ -339,12 +341,15 @@ function backward(router, el, backwardOptions) {
339
341
 
340
342
  if (options.replaceState) {
341
343
  router.history[router.history.length - 1] = options.route.url;
344
+ router.propsHistory[router.propsHistory.length - 1] = options.props || {};
342
345
  } else {
343
346
  if (router.history.length === 1) {
344
347
  router.history.unshift(router.url);
348
+ router.propsHistory.unshift(options.props || {});
345
349
  }
346
350
 
347
351
  router.history.pop();
352
+ router.propsHistory.pop();
348
353
  }
349
354
 
350
355
  router.saveHistory(); // Current Page & Navbar
@@ -434,7 +439,8 @@ function backward(router, el, backwardOptions) {
434
439
 
435
440
  if (preloadPreviousPage && router.history[router.history.length - 2] && !isMaster) {
436
441
  router.back(router.history[router.history.length - 2], {
437
- preload: true
442
+ preload: true,
443
+ props: router.propsHistory[router.propsHistory.length - 2] || {}
438
444
  });
439
445
  }
440
446
 
@@ -565,6 +571,7 @@ function back() {
565
571
  if (router.swipeBackActive) return router;
566
572
  let navigateUrl;
567
573
  let navigateOptions;
574
+ let navigateProps;
568
575
  let route;
569
576
 
570
577
  if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'object') {
@@ -664,6 +671,7 @@ function back() {
664
671
 
665
672
  router.currentRoute = previousRoute;
666
673
  router.history.pop();
674
+ router.propsHistory.pop();
667
675
  router.saveHistory();
668
676
 
669
677
  if (needHistoryBack && isBrokenBrowserHistory && !currentRouteWithoutBrowserHistory) {
@@ -717,7 +725,8 @@ function back() {
717
725
  if (!navigateOptions.force && $previousPage.length && !skipMaster) {
718
726
  if (router.params.browserHistory && $previousPage[0].f7Page && router.history[router.history.length - 2] !== $previousPage[0].f7Page.route.url) {
719
727
  router.back(router.history[router.history.length - 2], extend(navigateOptions, {
720
- force: true
728
+ force: true,
729
+ props: router.propsHistory[router.propsHistory.length - 2] || {}
721
730
  }));
722
731
  return router;
723
732
  }
@@ -754,12 +763,14 @@ function back() {
754
763
 
755
764
  if (!navigateUrl && router.history.length > 1) {
756
765
  navigateUrl = router.history[router.history.length - 2];
766
+ navigateProps = router.propsHistory[router.propsHistory.length - 2] || {};
757
767
  }
758
768
 
759
769
  if (skipMaster && !navigateOptions.force && router.history[router.history.length - 3]) {
760
770
  return router.back(router.history[router.history.length - 3], extend({}, navigateOptions || {}, {
761
771
  force: true,
762
- animate: false
772
+ animate: false,
773
+ props: router.propsHistory[router.propsHistory.length - 3] || {}
763
774
  }));
764
775
  }
765
776
 
@@ -795,9 +806,13 @@ function back() {
795
806
  const options = {};
796
807
 
797
808
  if (route.route.options) {
798
- extend(options, route.route.options, navigateOptions);
809
+ extend(options, route.route.options, navigateOptions, {
810
+ props: navigateProps || {}
811
+ });
799
812
  } else {
800
- extend(options, navigateOptions);
813
+ extend(options, navigateOptions, {
814
+ props: navigateProps || {}
815
+ });
801
816
  }
802
817
 
803
818
  options.route = route;
@@ -339,15 +339,20 @@ function forward(router, el, forwardOptions) {
339
339
  if (((options.reloadCurrent || reloadDetail && otherDetailPageEl) && router.history.length) > 0 || options.replaceState) {
340
340
  if (reloadDetail && detailsInBetweenRemoved > 0) {
341
341
  router.history = router.history.slice(0, router.history.length - detailsInBetweenRemoved);
342
+ router.propsHistory = router.propsHistory.slice(0, router.propsHistory.length - detailsInBetweenRemoved);
342
343
  }
343
344
 
344
345
  router.history[router.history.length - (options.reloadPrevious ? 2 : 1)] = url;
346
+ router.propsHistory[router.propsHistory.length - (options.reloadPrevious ? 2 : 1)] = options.props || {};
345
347
  } else if (options.reloadPrevious) {
346
348
  router.history[router.history.length - 2] = url;
349
+ router.propsHistory[router.propsHistory.length - 2] = options.props || {};
347
350
  } else if (options.reloadAll) {
348
351
  router.history = [url];
352
+ router.propsHistory = [options.props || {}];
349
353
  } else {
350
354
  router.history.push(url);
355
+ router.propsHistory.push(options.props || {});
351
356
  }
352
357
  }
353
358
 
@@ -37,6 +37,7 @@ class Router extends Framework7Class {
37
37
  params: view.params,
38
38
  routes: view.routes,
39
39
  history: view.history,
40
+ propsHistory: [],
40
41
  scrollHistory: view.scrollHistory,
41
42
  cache: app.cache,
42
43
  dynamicNavbar: app.theme === 'ios' && view.params.iosDynamicNavbar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framework7",
3
- "version": "7.1.2",
3
+ "version": "7.1.3",
4
4
  "description": "Full featured mobile HTML framework for building iOS & Android apps",
5
5
  "type": "module",
6
6
  "exports": {