@singularsystems/neo-react 0.10.45 → 0.10.46

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.
@@ -47,15 +47,16 @@ export declare class TabManager<T extends string = string> {
47
47
  private getTab;
48
48
  /**
49
49
  * Marks the tab as 'initial'.
50
- * @param invokeCallback True if the initialCallback should be invoked.
50
+ * @param reInitialise True if the tabs onInitialise() should be invoked.
51
51
  */
52
52
  reset(tabKey: T, reInitialise?: boolean): void;
53
- /** Calls initialise if the tab has not yet initialised. */
53
+ /** Calls onInitialise() if the tab has not yet initialised. */
54
54
  initialiseTab(tabKey: T): void;
55
55
  /**
56
- * Marks all tabs as 'initial'.
56
+ * Marks all tabs as 'initial', causing onInitialise() to be called the next time each is displayed.
57
+ * @param reInitialise True if the onInitialise() should be called on the currently displayed tab.
57
58
  */
58
- resetAll(): void;
59
+ resetAll(reInitialise?: boolean): void;
59
60
  private tabs;
60
61
  private onTabChanged;
61
62
  }
@@ -92,7 +92,7 @@ var TabManager = /** @class */ (function () {
92
92
  };
93
93
  /**
94
94
  * Marks the tab as 'initial'.
95
- * @param invokeCallback True if the initialCallback should be invoked.
95
+ * @param reInitialise True if the tabs onInitialise() should be invoked.
96
96
  */
97
97
  TabManager.prototype.reset = function (tabKey, reInitialise) {
98
98
  if (reInitialise === void 0) { reInitialise = false; }
@@ -106,7 +106,7 @@ var TabManager = /** @class */ (function () {
106
106
  }
107
107
  }
108
108
  };
109
- /** Calls initialise if the tab has not yet initialised. */
109
+ /** Calls onInitialise() if the tab has not yet initialised. */
110
110
  TabManager.prototype.initialiseTab = function (tabKey) {
111
111
  var tab = this.getTab(tabKey);
112
112
  if (tab && !tab.hasFetched) {
@@ -114,10 +114,15 @@ var TabManager = /** @class */ (function () {
114
114
  }
115
115
  };
116
116
  /**
117
- * Marks all tabs as 'initial'.
117
+ * Marks all tabs as 'initial', causing onInitialise() to be called the next time each is displayed.
118
+ * @param reInitialise True if the onInitialise() should be called on the currently displayed tab.
118
119
  */
119
- TabManager.prototype.resetAll = function () {
120
- this.tabs = {};
120
+ TabManager.prototype.resetAll = function (reInitialise) {
121
+ if (reInitialise === void 0) { reInitialise = false; }
122
+ var currentTabKey = this.observable.peek;
123
+ for (var tabKey in this.tabs) {
124
+ this.reset(tabKey, reInitialise && currentTabKey === tabKey);
125
+ }
121
126
  };
122
127
  TabManager.prototype.onTabChanged = function () {
123
128
  var tab = this.getTab(this.observable.peek);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-react",
3
- "version": "0.10.45",
3
+ "version": "0.10.46",
4
4
  "description": "React application logic and components for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",