@xh/hoist 69.0.0-SNAPSHOT.1728424290087 → 69.0.0-SNAPSHOT.1728431598764

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
@@ -11,6 +11,7 @@ is not expected to affect any applications.
11
11
  * Added new AppStates `AUTHENTICATING`, `INITIALIZING_HOIST`, and `INITIALIZING_APP` to support
12
12
  more granular tracking and timing of app startup lifecycle.
13
13
  * Improved the default "Loaded App" activity tracking entry with more granular data on load timing.
14
+ * `RestGrid` now displays an optional refresh button in its toolbar.
14
15
 
15
16
  ### ⚙️ Technical
16
17
 
@@ -48,6 +48,7 @@ export class LogLevelDialogModel extends HoistModel {
48
48
  enableExport: true,
49
49
  exportOptions: {filename: exportFilenameWithDate('log-levels')},
50
50
  readonly: AppModel.readonly,
51
+ showRefreshButton: true,
51
52
  store: {
52
53
  url: 'rest/logLevelAdmin',
53
54
  fieldDefaults: {disableXssProtection: true},
@@ -43,6 +43,7 @@ export class PrefEditorModel extends HoistModel {
43
43
  enableExport: true,
44
44
  exportOptions: {filename: exportFilenameWithDate('prefs')},
45
45
  selModel: 'multiple',
46
+ showRefreshButton: true,
46
47
  store: {
47
48
  url: 'rest/preferenceAdmin',
48
49
  reloadLookupsOnLoad: true,
@@ -18,7 +18,9 @@ export interface RestGridConfig extends GridConfig {
18
18
  menuActions?: Array<RecordAction | RecordActionSpec | '-'>;
19
19
  /** Actions to display in the form toolbar. Defaults to delete. */
20
20
  formActions?: Array<RecordAction | RecordActionSpec>;
21
- /** Warning to display before actions on a selection of records. */
21
+ /** Show a refresh button in the toolbar. Defaults to false. **/
22
+ showRefreshButton?: boolean;
23
+ /** Warning to display before actions on a selection of records. */
22
24
  actionWarning?: {
23
25
  add?: string | ((recs: StoreRecord[]) => string);
24
26
  del?: string | ((recs: StoreRecord[]) => string);
@@ -70,6 +72,7 @@ export declare class RestGridModel extends HoistModel {
70
72
  toolbarActions: Array<RecordAction | RecordActionSpec>;
71
73
  menuActions: Array<RecordAction | RecordActionSpec | '-'>;
72
74
  formActions: Array<RecordAction | RecordActionSpec>;
75
+ showRefreshButton: boolean;
73
76
  prepareCloneFn: (input: {
74
77
  record: StoreRecord;
75
78
  clone: PlainObject;
@@ -83,7 +86,7 @@ export declare class RestGridModel extends HoistModel {
83
86
  get selModel(): import("@xh/hoist/data").StoreSelectionModel;
84
87
  get selectedRecords(): StoreRecord[];
85
88
  get selectedRecord(): StoreRecord;
86
- constructor({ readonly, toolbarActions, menuActions, formActions, actionWarning, prepareCloneFn, unit, filterFields, editors, onRowDoubleClicked, store, appData, ...rest }: RestGridConfig);
89
+ constructor({ readonly, toolbarActions, menuActions, formActions, showRefreshButton, actionWarning, prepareCloneFn, unit, filterFields, editors, onRowDoubleClicked, store, appData, ...rest }: RestGridConfig);
87
90
  /** Load the underlying store. */
88
91
  doLoadAsync(loadSpec: any): Promise<void>;
89
92
  /** Load the underlying store. */
@@ -34,7 +34,10 @@ export interface RestGridConfig extends GridConfig {
34
34
  /** Actions to display in the form toolbar. Defaults to delete. */
35
35
  formActions?: Array<RecordAction | RecordActionSpec>;
36
36
 
37
- /** Warning to display before actions on a selection of records. */
37
+ /** Show a refresh button in the toolbar. Defaults to false. **/
38
+ showRefreshButton?: boolean;
39
+
40
+ /** Warning to display before actions on a selection of records. */
38
41
  actionWarning?: {
39
42
  add?: string | ((recs: StoreRecord[]) => string);
40
43
  del?: string | ((recs: StoreRecord[]) => string);
@@ -97,6 +100,7 @@ export class RestGridModel extends HoistModel {
97
100
  toolbarActions: Array<RecordAction | RecordActionSpec>;
98
101
  menuActions: Array<RecordAction | RecordActionSpec | '-'>;
99
102
  formActions: Array<RecordAction | RecordActionSpec>;
103
+ showRefreshButton: boolean;
100
104
  prepareCloneFn: (input: {record: StoreRecord; clone: PlainObject}) => void;
101
105
  unit: string;
102
106
  filterFields: string[] = null;
@@ -133,6 +137,7 @@ export class RestGridModel extends HoistModel {
133
137
  toolbarActions = !readonly ? [addAction, editAction, deleteAction] : [viewAction],
134
138
  menuActions = !readonly ? [addAction, editAction, deleteAction] : [viewAction],
135
139
  formActions = !readonly ? [deleteAction] : [],
140
+ showRefreshButton = false,
136
141
  actionWarning,
137
142
  prepareCloneFn,
138
143
  unit = 'record',
@@ -149,6 +154,7 @@ export class RestGridModel extends HoistModel {
149
154
  this.toolbarActions = toolbarActions;
150
155
  this.menuActions = menuActions;
151
156
  this.formActions = formActions;
157
+ this.showRefreshButton = showRefreshButton;
152
158
 
153
159
  this.actionWarning = Object.assign(this.actionWarning, actionWarning);
154
160
 
@@ -54,7 +54,10 @@ export const restGridToolbar = hoistCmp.factory({
54
54
  gridModel,
55
55
  omit: !model.gridModel.enableExport
56
56
  }),
57
- refreshButton({model})
57
+ refreshButton({
58
+ model,
59
+ omit: !model.showRefreshButton
60
+ })
58
61
  );
59
62
  }
60
63
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "69.0.0-SNAPSHOT.1728424290087",
3
+ "version": "69.0.0-SNAPSHOT.1728431598764",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",