@xh/hoist 67.0.0-SNAPSHOT.1725042567416 → 67.0.0-SNAPSHOT.1725047531773

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.
@@ -50,9 +50,10 @@ const tbar = hoistCmp.factory<RegroupDialogModel>(({model}) => {
50
50
  onClick: () => model.close()
51
51
  }),
52
52
  button({
53
- text: 'Save',
53
+ text: 'Save Changes',
54
54
  icon: Icon.check(),
55
55
  intent: 'success',
56
+ outlined: true,
56
57
  disabled: model.groupName == null,
57
58
  onClick: () => model.saveAsync()
58
59
  })
@@ -184,10 +184,8 @@ export class ClusterTabModel extends HoistModel {
184
184
  confirmProps: {
185
185
  icon: Icon.skull(),
186
186
  text: 'Shutdown Now',
187
- intent: 'danger'
188
- },
189
- cancelProps: {
190
- autoFocus: true
187
+ intent: 'danger',
188
+ autoFocus: false
191
189
  }
192
190
  }))
193
191
  )
@@ -91,8 +91,8 @@ export class ServiceModel extends BaseInstanceModel {
91
91
  ),
92
92
  confirmProps: {
93
93
  text: 'Clear Caches',
94
- outlined: true,
95
94
  intent: 'danger',
95
+ outlined: true,
96
96
  autoFocus: false
97
97
  }
98
98
  });
@@ -277,7 +277,8 @@ export class AlertBannerModel extends HoistModel {
277
277
  confirmProps: {
278
278
  text: 'Yes, modify the banner',
279
279
  intent: 'primary',
280
- outlined: true
280
+ outlined: true,
281
+ autoFocus: false
281
282
  }
282
283
  });
283
284
  if (!finalConfirm) return;
@@ -227,9 +227,10 @@ const formPanel = hoistCmp.factory<AlertBannerModel>(({model}) => {
227
227
  onClick: () => model.resetForm()
228
228
  }),
229
229
  button({
230
- text: 'Save',
230
+ text: 'Save Changes',
231
231
  icon: Icon.check(),
232
232
  intent: 'success',
233
+ outlined: true,
233
234
  disabled: !isValid || !isDirty,
234
235
  onClick: () => model.saveAsync()
235
236
  })
@@ -94,6 +94,7 @@ export class ConfigPanelModel extends HoistModel {
94
94
  editAction,
95
95
  cloneAction,
96
96
  deleteAction,
97
+ '-',
97
98
  this.regroupDialogModel.regroupAction
98
99
  ],
99
100
  prepareCloneFn: ({clone}) => (clone.name = `${clone.name}_CLONE`),
@@ -79,6 +79,7 @@ export class PrefEditorModel extends HoistModel {
79
79
  addAction,
80
80
  editAction,
81
81
  deleteAction,
82
+ '-',
82
83
  this.regroupDialogModel.regroupAction
83
84
  ],
84
85
  columns: [
@@ -125,10 +125,12 @@ export class RoleModel extends HoistModel {
125
125
  if (this.readonly) return false;
126
126
 
127
127
  const confirm = await XH.confirm({
128
- icon: Icon.warning(),
129
- title: 'Confirm delete?',
130
- message: `Are you sure you want to delete "${role.name}"? This may affect access to this applications.`,
131
- confirmProps: {intent: 'danger', text: 'Confirm Delete'}
128
+ message: `Are you sure you want to delete "${role.name}"? This may affect access to this application.`,
129
+ confirmProps: {
130
+ text: 'Yes, delete role',
131
+ intent: 'danger',
132
+ autoFocus: false
133
+ }
132
134
  });
133
135
  if (!confirm) return false;
134
136
 
@@ -197,8 +199,9 @@ export class RoleModel extends HoistModel {
197
199
  private groupByAction(): RecordActionSpec {
198
200
  return {
199
201
  text: 'Group By Category',
202
+ icon: Icon.treeList(),
200
203
  displayFn: () => ({
201
- icon: this.showInGroups ? Icon.checkCircle() : Icon.circle()
204
+ text: this.showInGroups ? 'Ungroup Grid' : 'Group by Category'
202
205
  }),
203
206
  actionFn: () => {
204
207
  this.showInGroups = !this.showInGroups;
@@ -350,15 +353,17 @@ export class RoleModel extends HoistModel {
350
353
 
351
354
  private getContextMenuItems() {
352
355
  return this.readonly
353
- ? [this.groupByAction(), ...GridModel.defaultContextMenu]
356
+ ? [this.groupByAction(), '-', ...GridModel.defaultContextMenu]
354
357
  : [
355
358
  this.addAction(),
356
359
  this.editAction(),
357
360
  this.cloneAction(),
358
361
  this.deleteAction(),
362
+ '-',
359
363
  this.recategorizeDialogModel.recategorizeAction(),
360
364
  '-',
361
365
  this.groupByAction(),
366
+ '-',
362
367
  ...GridModel.defaultContextMenu
363
368
  ];
364
369
  }
@@ -33,23 +33,24 @@ export const roleEditor = hoistCmp.factory({
33
33
  mask: savingTask,
34
34
  bbar: [
35
35
  button({
36
- onClick: () => model.deleteAsync(),
36
+ text: 'Delete',
37
37
  icon: Icon.delete(),
38
38
  intent: 'danger',
39
- text: 'Delete',
40
- disabled: !role
39
+ disabled: !role,
40
+ onClick: () => model.deleteAsync()
41
41
  }),
42
42
  filler(),
43
43
  button({
44
- onClick: () => model.cancel(),
45
- text: 'Cancel'
44
+ text: 'Cancel',
45
+ onClick: () => model.cancel()
46
46
  }),
47
47
  button({
48
- onClick: () => model.saveAsync(),
48
+ text: 'Save Changes',
49
49
  icon: Icon.check(),
50
50
  intent: 'success',
51
- text: 'Save',
52
- disabled: saveDisabled
51
+ outlined: true,
52
+ disabled: saveDisabled,
53
+ onClick: () => model.saveAsync()
53
54
  })
54
55
  ]
55
56
  })
@@ -5,7 +5,6 @@
5
5
  * Copyright © 2024 Extremely Heavy Industries Inc.
6
6
  */
7
7
  import {HoistModel, managed, TaskObserver, XH} from '@xh/hoist/core';
8
- import {Icon} from '@xh/hoist/icon';
9
8
  import {action, computed, makeObservable, observable} from '@xh/hoist/mobx';
10
9
  import {omit} from 'lodash';
11
10
  import {RoleModel} from '../RoleModel';
@@ -78,15 +77,13 @@ export class RoleEditorModel extends HoistModel {
78
77
  this.doCancel();
79
78
  } else {
80
79
  XH.confirm({
81
- icon: Icon.warning(),
82
- title: 'Discard unsaved changes?',
83
80
  message: 'You have unsaved changes. Are you sure you wish to proceed?',
84
81
  cancelProps: {
85
82
  text: 'Keep editing'
86
83
  },
87
84
  confirmProps: {
88
- intent: 'danger',
89
- text: 'Discard changes'
85
+ text: 'Discard Changes',
86
+ intent: 'danger'
90
87
  },
91
88
  onConfirm: () => this.doCancel()
92
89
  });
@@ -159,6 +159,7 @@ export class RoleFormModel extends HoistModel {
159
159
  return new GridModel({
160
160
  emptyText: 'None added.',
161
161
  hideHeaders: true,
162
+ showHover: true,
162
163
  selModel: 'multiple',
163
164
  store: {
164
165
  fields: [{name: 'error', type: 'string'}],
@@ -194,6 +195,7 @@ export class RoleFormModel extends HoistModel {
194
195
  ...props,
195
196
  inputProps: {
196
197
  enableCreate: entity !== 'ROLE',
198
+ createMessageFn: user => `Add ${user}`,
197
199
  options: this.filterSelected(options, selected)
198
200
  }
199
201
  });
@@ -24,7 +24,7 @@ export const recategorizeDialog = hoistCmp.factory({
24
24
  return dialog({
25
25
  title: `Change Category (${model.selectedRecords.length} roles)`,
26
26
  icon: Icon.folder(),
27
- style: {width: 300},
27
+ style: {width: 400},
28
28
  isOpen: true,
29
29
  isCloseButtonShown: false,
30
30
  item: panel({
@@ -35,7 +35,7 @@ export const recategorizeDialog = hoistCmp.factory({
35
35
  bind: 'categoryName',
36
36
  enableCreate: true,
37
37
  options: model.options,
38
- width: 260
38
+ width: '100%'
39
39
  })
40
40
  ),
41
41
  bbar: bbar()
@@ -52,9 +52,10 @@ const bbar = hoistCmp.factory<RecategorizeDialogModel>(({model}) => {
52
52
  onClick: () => model.close()
53
53
  }),
54
54
  button({
55
- text: 'Save',
55
+ text: 'Save Changes',
56
56
  icon: Icon.check(),
57
57
  intent: 'success',
58
+ outlined: true,
58
59
  disabled: model.categoryName == null,
59
60
  onClick: () => model.saveAsync()
60
61
  })
@@ -1,21 +1,21 @@
1
1
  import { RowDoubleClickedEvent } from '@ag-grid-community/core';
2
2
  import { BaseFieldConfig } from '@xh/hoist/cmp/form';
3
3
  import { GridConfig, GridModel } from '@xh/hoist/cmp/grid';
4
- import { HoistModel, PlainObject, ElementSpec } from '@xh/hoist/core';
4
+ import { ElementSpec, HoistModel, PlainObject } from '@xh/hoist/core';
5
5
  import '@xh/hoist/desktop/register';
6
6
  import { RecordAction, RecordActionSpec, StoreRecord } from '@xh/hoist/data';
7
+ import { ExportOptions } from '@xh/hoist/svc';
8
+ import { FormFieldProps } from '../form';
7
9
  import { RestStore, RestStoreConfig } from './data/RestStore';
8
10
  import { RestFormModel } from './impl/RestFormModel';
9
- import { FormFieldProps } from '../form';
10
- import { ExportOptions } from '@xh/hoist/svc';
11
11
  export interface RestGridConfig extends GridConfig {
12
12
  store?: RestStore | RestStoreConfig;
13
13
  /** Prevent users from creating, updating, or destroying a record. Defaults to false. */
14
14
  readonly?: boolean;
15
15
  /** Actions to display in the toolbar. Defaults to add, edit, delete. */
16
16
  toolbarActions?: Array<RecordAction | RecordActionSpec>;
17
- /** actions to display in the grid context menu. Defaults to add, edit, delete. */
18
- menuActions?: Array<RecordAction | RecordActionSpec>;
17
+ /** Actions to display in the grid context menu. Defaults to add, edit, delete. */
18
+ menuActions?: Array<RecordAction | RecordActionSpec | '-'>;
19
19
  /** Actions to display in the form toolbar. Defaults to delete. */
20
20
  formActions?: Array<RecordAction | RecordActionSpec>;
21
21
  /** Warning to display before actions on a selection of records. */
@@ -68,7 +68,7 @@ export declare class RestGridModel extends HoistModel {
68
68
  readonly: boolean;
69
69
  editors: RestGridEditor[];
70
70
  toolbarActions: Array<RecordAction | RecordActionSpec>;
71
- menuActions: Array<RecordAction | RecordActionSpec>;
71
+ menuActions: Array<RecordAction | RecordActionSpec | '-'>;
72
72
  formActions: Array<RecordAction | RecordActionSpec>;
73
73
  prepareCloneFn: (input: {
74
74
  record: StoreRecord;
@@ -8,17 +8,16 @@
8
8
  import {RowDoubleClickedEvent} from '@ag-grid-community/core';
9
9
  import {BaseFieldConfig} from '@xh/hoist/cmp/form';
10
10
  import {GridConfig, GridModel} from '@xh/hoist/cmp/grid';
11
- import {HoistModel, managed, PlainObject, ElementSpec, XH} from '@xh/hoist/core';
11
+ import {ElementSpec, HoistModel, managed, PlainObject, XH} from '@xh/hoist/core';
12
12
  import '@xh/hoist/desktop/register';
13
13
  import {RecordAction, RecordActionSpec, StoreRecord} from '@xh/hoist/data';
14
- import {Icon} from '@xh/hoist/icon/Icon';
14
+ import {ExportOptions} from '@xh/hoist/svc';
15
15
  import {pluralize, throwIf, withDefault} from '@xh/hoist/utils/js';
16
16
  import {isFunction} from 'lodash';
17
- import {RestStore, RestStoreConfig} from './data/RestStore';
18
- import {RestFormModel} from './impl/RestFormModel';
19
17
  import {FormFieldProps} from '../form';
20
18
  import {addAction, deleteAction, editAction, viewAction} from './Actions';
21
- import {ExportOptions} from '@xh/hoist/svc';
19
+ import {RestStore, RestStoreConfig} from './data/RestStore';
20
+ import {RestFormModel} from './impl/RestFormModel';
22
21
 
23
22
  export interface RestGridConfig extends GridConfig {
24
23
  store?: RestStore | RestStoreConfig;
@@ -29,8 +28,8 @@ export interface RestGridConfig extends GridConfig {
29
28
  /** Actions to display in the toolbar. Defaults to add, edit, delete. */
30
29
  toolbarActions?: Array<RecordAction | RecordActionSpec>;
31
30
 
32
- /** actions to display in the grid context menu. Defaults to add, edit, delete. */
33
- menuActions?: Array<RecordAction | RecordActionSpec>;
31
+ /** Actions to display in the grid context menu. Defaults to add, edit, delete. */
32
+ menuActions?: Array<RecordAction | RecordActionSpec | '-'>;
34
33
 
35
34
  /** Actions to display in the form toolbar. Defaults to delete. */
36
35
  formActions?: Array<RecordAction | RecordActionSpec>;
@@ -96,7 +95,7 @@ export class RestGridModel extends HoistModel {
96
95
  readonly: boolean;
97
96
  editors: RestGridEditor[];
98
97
  toolbarActions: Array<RecordAction | RecordActionSpec>;
99
- menuActions: Array<RecordAction | RecordActionSpec>;
98
+ menuActions: Array<RecordAction | RecordActionSpec | '-'>;
100
99
  formActions: Array<RecordAction | RecordActionSpec>;
101
100
  prepareCloneFn: (input: {record: StoreRecord; clone: PlainObject}) => void;
102
101
  unit: string;
@@ -243,9 +242,7 @@ export class RestGridModel extends HoistModel {
243
242
  warning = this.actionWarning.del,
244
243
  message = isFunction(warning) ? warning(records) : warning;
245
244
 
246
- message
247
- ? XH.confirm({message, title: 'Warning', icon: Icon.warning(), onConfirm: delFn})
248
- : delFn();
245
+ message ? XH.confirm({message, title: 'Warning', onConfirm: delFn}) : delFn();
249
246
  }
250
247
 
251
248
  async exportAsync(options?: ExportOptions) {
@@ -80,9 +80,10 @@ const tbar = hoistCmp.factory<RestFormModel>(({model}) => {
80
80
  onClick: () => model.close()
81
81
  }),
82
82
  button({
83
- text: 'Save',
83
+ text: 'Save Changes',
84
84
  icon: Icon.check(),
85
85
  intent: 'success',
86
+ outlined: true,
86
87
  disabled: !model.isAdd && !formModel.isDirty,
87
88
  onClick: () => model.validateAndSaveAsync(),
88
89
  omit: formModel.readonly
@@ -8,9 +8,8 @@ import {FormModel} from '@xh/hoist/cmp/form';
8
8
  import {HoistModel, managed, PlainObject, XH} from '@xh/hoist/core';
9
9
  import {required} from '@xh/hoist/data';
10
10
  import {RestGridEditor, RestGridModel} from '@xh/hoist/desktop/cmp/rest';
11
- import {Icon} from '@xh/hoist/icon';
12
11
  import {action, makeObservable, observable} from '@xh/hoist/mobx';
13
- import {throwIf, mergeDeep} from '@xh/hoist/utils/js';
12
+ import {mergeDeep, throwIf} from '@xh/hoist/utils/js';
14
13
  import {isFunction, isNil} from 'lodash';
15
14
  import {createRef} from 'react';
16
15
  import {RestField} from '../data/RestField';
@@ -119,7 +118,7 @@ export class RestFormModel extends HoistModel {
119
118
  const warning = this.actionWarning[this.isAdd ? 'add' : 'edit'],
120
119
  message = isFunction(warning) ? warning([this.currentRecord]) : warning;
121
120
  if (message) {
122
- if (!(await XH.confirm({message, title: 'Warning', icon: Icon.warning()}))) {
121
+ if (!(await XH.confirm({message, title: 'Warning'}))) {
123
122
  return;
124
123
  }
125
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "67.0.0-SNAPSHOT.1725042567416",
3
+ "version": "67.0.0-SNAPSHOT.1725047531773",
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",