@xh/hoist 79.0.0-SNAPSHOT.1766244066570 → 79.0.0-SNAPSHOT.1766260837143

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 CHANGED
@@ -24,6 +24,9 @@
24
24
  Some apps may need to update their imports.
25
25
  * `TabContainerConfig.switcher` has been repurposed to accept a `TabSwitcherConfig`. To pass
26
26
  `TabSwitcherProps` via a parent `TabContainer`, use `TabContainerProps.switcher`.
27
+ * Tightened the typing of `LocalDate` adjustment methods with new `LocalDateUnit` type. Some less
28
+ common or ambiguous units (e.g. `date` or `d`) are no longer supported. Also typed the adjustment
29
+ `value` args to `number` where applicable.
27
30
 
28
31
  ### 🐞 Bug Fixes
29
32
 
@@ -50,7 +53,7 @@
50
53
 
51
54
  ### 🐞 Bug Fixes
52
55
 
53
- * Fix to Highchart timezone handling regression from version 77. Applications should note that
56
+ * Fix to Highchart timezone handling regression from version 77. Applications should note that
54
57
  Highcharts has deprecated the `time.useUTC` option and its functioning seem suspect. Apps
55
58
  should set `time.timezone` instead. See https://api.highcharts.com/highcharts/time.useUTC.
56
59
 
@@ -61,14 +64,15 @@
61
64
  ## 78.1.0 - 2025-12-02
62
65
 
63
66
  ### ⚙️ Technical
67
+
64
68
  * New property `MsalClientConfig.enableSsoSilent` to govern use of MSAL SSO api.
65
69
 
66
70
  * Existing property `MsalClientConfig.enableTelemetry` now defaults to `true`.
67
71
 
68
- * Improved use of MSAL client API, to maximize effectiveness of SSO. Improved documentation
69
- and logging. Iframe attempts will now time out by default after 3 seconds vs. 10 seconds.
70
- This can be further modified by apps via the option
71
- `MsalClientConfig.msalClientOptions.system.iFrameHashTimeout`
72
+ * Improved use of MSAL client API, to maximize effectiveness of SSO. Improved documentation
73
+ and logging. Iframe attempts will now time out by default after 3 seconds vs. 10 seconds.
74
+ This can be further modified by apps via the option
75
+ `MsalClientConfig.msalClientOptions.system.iFrameHashTimeout`
72
76
 
73
77
  ### 📚 Libraries
74
78
 
@@ -110,7 +114,8 @@
110
114
 
111
115
  ### 💥 Breaking Changes (upgrade difficulty: 🟢 LOW)
112
116
 
113
- * Apps that use and provide the `highcharts` library should be sure to update the version to v12.4.0.
117
+ * Apps that use and provide the `highcharts` library should be sure to update the version to
118
+ v12.4.0.
114
119
  Refer to `Bootstrap.js` in Toolbox for required import changes.
115
120
  * Visit https://www.highcharts.com/blog/changelog/ for specific changes.
116
121
 
@@ -42,6 +42,8 @@ export type DebounceSpec = number | (DebounceSettings & {
42
42
  */
43
43
  export type Content = ReactElement | FunctionComponent | Component | ElementFactory | (() => ReactElement);
44
44
  export type DateLike = Date | LocalDate | MomentInput;
45
+ /** Valid units for the {@link LocalDate} adjustment methods. */
46
+ export type LocalDateUnit = 'year' | 'years' | 'quarter' | 'quarters' | 'month' | 'months' | 'week' | 'weeks' | 'day' | 'days';
45
47
  export type PageState =
46
48
  /**
47
49
  * Window/tab is visible and focused.
@@ -1,4 +1,4 @@
1
- import { LoadSupport, LoadSpec, Loadable, PlainObject, TaskObserver } from '@xh/hoist/core';
1
+ import { Loadable, LoadSpec, LoadSupport, PlainObject, TaskObserver } from '@xh/hoist/core';
2
2
  import { Store, StoreConfig } from './Store';
3
3
  export interface UrlStoreConfig extends StoreConfig {
4
4
  /** URL from which to load data. */
@@ -1,4 +1,5 @@
1
- import moment, { Moment, MomentInput } from 'moment';
1
+ import { LocalDateUnit } from '@xh/hoist/core';
2
+ import { Moment, MomentInput } from 'moment';
2
3
  /**
3
4
  * A Date representation that does not contain time information. Useful for business day or calendar
4
5
  * day data where time and time zone should be explicitly ignored. Client-side equivalent of the
@@ -8,15 +9,13 @@ import moment, { Moment, MomentInput } from 'moment';
8
9
  * For efficiency and to enable strict equality checks, instances of this class are memoized:
9
10
  * only a single version of the object will be created and returned for each calendar day,
10
11
  * as long as the caller uses one of the *public factory methods*, which they always should!
11
- *
12
- * Unit accepted by manipulation methods are ['year', 'quarter', 'month', 'week', 'day', 'date'].
13
12
  */
14
13
  export declare class LocalDate {
14
+ static readonly VALID_UNITS: Set<LocalDateUnit>;
15
15
  private static _instances;
16
- static VALID_UNITS: string[];
17
- private _isoString;
18
- private _moment;
19
- private _date;
16
+ private readonly _isoString;
17
+ private readonly _moment;
18
+ private readonly _date;
20
19
  /**
21
20
  * Get an instance of this class.
22
21
  * This is the standard way to get an instance of this object from serialized server-side data.
@@ -64,11 +63,11 @@ export declare class LocalDate {
64
63
  toJSON(): string;
65
64
  valueOf(): string;
66
65
  get isLocalDate(): boolean;
67
- add(value: any, unit?: string): LocalDate;
68
- subtract(value: any, unit?: string): LocalDate;
69
- addWeekdays(value: any): LocalDate;
70
- subtractWeekdays(value: any): LocalDate;
71
- startOf(unit: any): LocalDate;
66
+ add(value: number, unit?: LocalDateUnit): LocalDate;
67
+ subtract(value: number, unit?: LocalDateUnit): LocalDate;
68
+ addWeekdays(value: number): LocalDate;
69
+ subtractWeekdays(value: number): LocalDate;
70
+ startOf(unit: LocalDateUnit): LocalDate;
72
71
  startOfMonth(): LocalDate;
73
72
  startOfQuarter(): LocalDate;
74
73
  startOfYear(): LocalDate;
@@ -84,13 +83,10 @@ export declare class LocalDate {
84
83
  currentOrNextWeekday(): LocalDate;
85
84
  /** The same date if already a weekday, or the previous weekday. */
86
85
  currentOrPreviousWeekday(): LocalDate;
87
- diff(other: LocalDate, unit?: moment.unitOfTime.Diff): number;
86
+ diff(other: LocalDate, unit?: LocalDateUnit): number;
88
87
  /** @internal - use one of the static factory methods instead. */
89
88
  private constructor();
90
89
  private ensureUnitValid;
91
90
  }
92
- /**
93
- * Is the input value a local Date?
94
- * Convenience alias for LocalDate.isLocalDate()
95
- */
91
+ /** @returns true if the input value is a `LocalDate` instance. */
96
92
  export declare function isLocalDate(val: any): val is LocalDate;
@@ -26,10 +26,7 @@ import './AgGrid.scss';
26
26
  import {AgGridModel} from './AgGridModel';
27
27
 
28
28
  export interface AgGridProps
29
- extends HoistProps<AgGridModel>,
30
- GridOptions,
31
- LayoutProps,
32
- TestSupportProps {}
29
+ extends HoistProps<AgGridModel>, GridOptions, LayoutProps, TestSupportProps {}
33
30
 
34
31
  /**
35
32
  * Minimal wrapper for AgGridReact, supporting direct use of the ag-Grid component with limited
@@ -16,8 +16,7 @@ import {ReactNode} from 'react';
16
16
  import type {AgProvidedColumnGroup, IHeaderGroupParams} from '@xh/hoist/kit/ag-grid';
17
17
 
18
18
  export interface ColumnGroupHeaderProps
19
- extends HoistProps<ColumnGroupHeaderModel>,
20
- IHeaderGroupParams {
19
+ extends HoistProps<ColumnGroupHeaderModel>, IHeaderGroupParams {
21
20
  gridModel: GridModel;
22
21
  xhColumnGroup: ColumnGroup;
23
22
  }
@@ -67,7 +67,8 @@ export interface DefaultHoistProps<M extends HoistModel = HoistModel> extends Ho
67
67
  * which also supports this interface. Eventually, they should be passed to a Box class.
68
68
  */
69
69
  export interface BoxProps
70
- extends LayoutProps,
70
+ extends
71
+ LayoutProps,
71
72
  TestSupportProps,
72
73
  Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'contextMenu'> {}
73
74
 
@@ -7,7 +7,14 @@
7
7
  import {action, computed, comparer, makeObservable, observable} from '@xh/hoist/mobx';
8
8
  import {apiDeprecated, warnIf} from '@xh/hoist/utils/js';
9
9
  import {isFunction} from 'lodash';
10
- import {DefaultHoistProps, HoistBase, LoadSpecConfig, managed, PlainObject, TaskObserver} from '../';
10
+ import {
11
+ DefaultHoistProps,
12
+ HoistBase,
13
+ LoadSpecConfig,
14
+ managed,
15
+ PlainObject,
16
+ TaskObserver
17
+ } from '../';
11
18
  import {instanceManager} from '../impl/InstanceManager';
12
19
  import {Loadable, LoadSpec, LoadSupport} from '../load';
13
20
  import {ModelSelector} from './';
@@ -63,6 +63,19 @@ export type Content =
63
63
 
64
64
  export type DateLike = Date | LocalDate | MomentInput;
65
65
 
66
+ /** Valid units for the {@link LocalDate} adjustment methods. */
67
+ export type LocalDateUnit =
68
+ | 'year'
69
+ | 'years'
70
+ | 'quarter'
71
+ | 'quarters'
72
+ | 'month'
73
+ | 'months'
74
+ | 'week'
75
+ | 'weeks'
76
+ | 'day'
77
+ | 'days';
78
+
66
79
  export type PageState =
67
80
  /**
68
81
  * Window/tab is visible and focused.
package/data/UrlStore.ts CHANGED
@@ -5,7 +5,15 @@
5
5
  * Copyright © 2025 Extremely Heavy Industries Inc.
6
6
  */
7
7
 
8
- import {XH, managed, LoadSupport, LoadSpec, Loadable, PlainObject, TaskObserver} from '@xh/hoist/core';
8
+ import {
9
+ Loadable,
10
+ LoadSpec,
11
+ LoadSupport,
12
+ managed,
13
+ PlainObject,
14
+ TaskObserver,
15
+ XH
16
+ } from '@xh/hoist/core';
9
17
  import {apiDeprecated} from '@xh/hoist/utils/js';
10
18
 
11
19
  import {Store, StoreConfig} from './Store';
@@ -23,11 +23,7 @@ import {ReactElement, ReactNode} from 'react';
23
23
  import './Button.scss';
24
24
 
25
25
  export interface ButtonProps<M extends HoistModel = null>
26
- extends HoistProps<M>,
27
- StyleProps,
28
- LayoutProps,
29
- TestSupportProps,
30
- Omit<BpButtonProps, 'ref'> {
26
+ extends HoistProps<M>, StyleProps, LayoutProps, TestSupportProps, Omit<BpButtonProps, 'ref'> {
31
27
  active?: boolean;
32
28
  autoFocus?: boolean;
33
29
  disabled?: boolean;
@@ -20,7 +20,8 @@ import {splitLayoutProps} from '@xh/hoist/utils/react';
20
20
  import {SetOptional} from 'type-fest';
21
21
 
22
22
  export interface ButtonGroupProps<M extends HoistModel = null>
23
- extends HoistProps<M>,
23
+ extends
24
+ HoistProps<M>,
24
25
  LayoutProps,
25
26
  StyleProps,
26
27
  TestSupportProps,
@@ -49,8 +49,10 @@ import {
49
49
  } from './impl/DashContainerUtils';
50
50
  import {dashContainerView} from './impl/DashContainerView';
51
51
 
52
- export interface DashContainerConfig
53
- extends DashConfig<DashContainerViewSpec, DashContainerViewState> {
52
+ export interface DashContainerConfig extends DashConfig<
53
+ DashContainerViewSpec,
54
+ DashContainerViewState
55
+ > {
54
56
  /** Strategy for rendering DashContainerViews. Can also be set per-view in `viewSpecs`*/
55
57
  renderMode?: RenderMode;
56
58
 
@@ -14,8 +14,7 @@ import {castArray, filter, isEmpty, without} from 'lodash';
14
14
  import {Children, cloneElement, isValidElement} from 'react';
15
15
 
16
16
  export interface ButtonGroupInputProps
17
- extends Omit<ButtonGroupProps<HoistModel>, 'onChange'>,
18
- HoistInputProps {
17
+ extends Omit<ButtonGroupProps<HoistModel>, 'onChange'>, HoistInputProps {
19
18
  /**
20
19
  * True to allow buttons to be unselected (aka inactivated). Defaults to false.
21
20
  * Does not apply when enableMulti: true.
@@ -21,8 +21,7 @@ import {restGridToolbar} from './impl/RestGridToolbar';
21
21
  import {RestGridModel} from './RestGridModel';
22
22
 
23
23
  export interface RestGridProps
24
- extends HoistProps<RestGridModel>,
25
- Omit<PanelProps, 'model' | 'modelConfig' | 'modelRef'> {
24
+ extends HoistProps<RestGridModel>, Omit<PanelProps, 'model' | 'modelConfig' | 'modelRef'> {
26
25
  /**
27
26
  * This constitutes an 'escape hatch' for applications that need to get to the underlying
28
27
  * AG Grid API. Use with care - settings made here might be overwritten and/or interfere with