@xh/hoist 71.0.0-SNAPSHOT.1733266596001 → 71.0.0-SNAPSHOT.1733347475493

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.
@@ -5,7 +5,8 @@
5
5
  * Copyright © 2024 Extremely Heavy Industries Inc.
6
6
  */
7
7
 
8
- import {fragment, hbox} from '@xh/hoist/cmp/layout';
8
+ import {box, fragment, hbox} from '@xh/hoist/cmp/layout';
9
+ import {spinner} from '@xh/hoist/cmp/spinner';
9
10
  import {hoistCmp, HoistProps, uses} from '@xh/hoist/core';
10
11
  import {ViewManagerModel} from '@xh/hoist/cmp/viewmanager';
11
12
  import {button, ButtonProps} from '@xh/hoist/desktop/cmp/button';
@@ -92,7 +93,12 @@ const menuButton = hoistCmp.factory<ViewManagerModel>({
92
93
  return button({
93
94
  className: 'xh-view-manager__menu-button',
94
95
  text: view.info?.name ?? `Default ${startCase(typeDisplayName)}`,
95
- icon: !isLoading ? Icon.bookmark() : Icon.spinner({className: 'fa-spin'}),
96
+ icon: !isLoading
97
+ ? Icon.bookmark()
98
+ : box({
99
+ item: spinner({width: 13, height: 13, style: {margin: 'auto'}}),
100
+ width: 16.25
101
+ }),
96
102
  rightIcon: Icon.chevronDown(),
97
103
  outlined: true,
98
104
  ...rest
@@ -5,12 +5,14 @@
5
5
  * Copyright © 2024 Extremely Heavy Industries Inc.
6
6
  */
7
7
 
8
- import {div, filler, fragment, hbox, span} from '@xh/hoist/cmp/layout';
8
+ import {box, div, filler, fragment, hbox, span} from '@xh/hoist/cmp/layout';
9
+ import {spinner} from '@xh/hoist/cmp/spinner';
9
10
  import {hoistCmp} from '@xh/hoist/core';
10
11
  import {ViewManagerModel, ViewInfo} from '@xh/hoist/cmp/viewmanager';
11
12
  import {switchInput} from '@xh/hoist/desktop/cmp/input';
12
13
  import {Icon} from '@xh/hoist/icon';
13
14
  import {menu, menuDivider, menuItem} from '@xh/hoist/kit/blueprint';
15
+ import {wait} from '@xh/hoist/promise';
14
16
  import {consumeEvent, pluralize} from '@xh/hoist/utils/js';
15
17
  import {isEmpty, startCase} from 'lodash';
16
18
  import {ReactNode} from 'react';
@@ -34,7 +36,8 @@ export const viewMenu = hoistCmp.factory<ViewManagerProps>({
34
36
  views,
35
37
  isValueDirty,
36
38
  privateViews,
37
- globalViews
39
+ globalViews,
40
+ loadModel
38
41
  } = model;
39
42
 
40
43
  const pluralName = pluralize(startCase(typeDisplayName)),
@@ -138,10 +141,17 @@ export const viewMenu = hoistCmp.factory<ViewManagerProps>({
138
141
  onClick: () => model.openManageDialog()
139
142
  }),
140
143
  menuItem({
141
- icon: Icon.refresh(),
144
+ icon: !loadModel.isPending
145
+ ? Icon.refresh()
146
+ : box({
147
+ height: 20,
148
+ item: spinner({width: 16.25, height: 16.25})
149
+ }),
150
+ disabled: loadModel.isPending,
142
151
  text: `Refresh ${pluralName}`,
143
152
  onClick: e => {
144
- model.refreshAsync();
153
+ // Ensure at least 100ms delay to render spinner
154
+ Promise.all([wait(100), model.refreshAsync()]).linkTo(loadModel);
145
155
  consumeEvent(e);
146
156
  }
147
157
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "71.0.0-SNAPSHOT.1733266596001",
3
+ "version": "71.0.0-SNAPSHOT.1733347475493",
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",