@xh/hoist 58.0.0 → 58.0.1
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.
- package/CHANGELOG.md +7 -0
- package/cmp/tab/TabContainerModel.ts +8 -4
- package/format/FormatNumber.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
PersistOptions
|
|
16
16
|
} from '@xh/hoist/core';
|
|
17
17
|
import {action, observable, makeObservable} from '@xh/hoist/mobx';
|
|
18
|
+
import {wait} from '@xh/hoist/promise';
|
|
18
19
|
import {ensureUniqueBy, throwIf} from '@xh/hoist/utils/js';
|
|
19
20
|
import {isOmitted} from '@xh/hoist/utils/impl';
|
|
20
21
|
import {find, isString, isUndefined, without, difference, findLast} from 'lodash';
|
|
@@ -151,6 +152,7 @@ export class TabContainerModel extends HoistModel {
|
|
|
151
152
|
track: () => XH.routerState,
|
|
152
153
|
run: this.syncWithRouter
|
|
153
154
|
});
|
|
155
|
+
wait().then(() => this.syncWithRouter());
|
|
154
156
|
|
|
155
157
|
this.forwardRouterToTab(this.activeTabId);
|
|
156
158
|
} else if (persistWith) {
|
|
@@ -288,7 +290,8 @@ export class TabContainerModel extends HoistModel {
|
|
|
288
290
|
|
|
289
291
|
const {route} = this;
|
|
290
292
|
if (route) {
|
|
291
|
-
|
|
293
|
+
const {params} = XH.router.getState();
|
|
294
|
+
XH.navigate(route + '.' + tab.id, params);
|
|
292
295
|
} else {
|
|
293
296
|
this.setActiveTabIdInternal(tab.id);
|
|
294
297
|
}
|
|
@@ -333,10 +336,11 @@ export class TabContainerModel extends HoistModel {
|
|
|
333
336
|
|
|
334
337
|
private syncWithRouter() {
|
|
335
338
|
const {tabs, route} = this,
|
|
336
|
-
{router} = XH
|
|
339
|
+
{router} = XH,
|
|
340
|
+
state = router.getState();
|
|
337
341
|
|
|
338
|
-
if (router.isActive(route)) {
|
|
339
|
-
const tab = tabs.find(t => router.isActive(route + '.' + t.id));
|
|
342
|
+
if (state && router.isActive(route)) {
|
|
343
|
+
const tab = tabs.find(t => router.isActive(route + '.' + t.id, state.params));
|
|
340
344
|
if (tab && !tab.isActive && !tab.disabled) {
|
|
341
345
|
this.setActiveTabIdInternal(tab.id);
|
|
342
346
|
}
|
package/format/FormatNumber.ts
CHANGED
|
@@ -407,7 +407,7 @@ function calcClassFromColorSpec(v: number, colorSpec: ColorSpec | boolean): stri
|
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
function calcStyleFromColorSpec(v: number, colorSpec: ColorSpec | boolean): CSSProperties {
|
|
410
|
-
if (!isFinite(v) || isBoolean(colorSpec)) return {};
|
|
410
|
+
if (!isFinite(v) || isBoolean(colorSpec) || !colorSpec) return {};
|
|
411
411
|
|
|
412
412
|
const possibleStyles = v < 0 ? colorSpec.neg : v > 0 ? colorSpec.pos : colorSpec.neutral;
|
|
413
413
|
return !isString(possibleStyles) ? possibleStyles : {};
|