@xh/hoist 71.0.0-SNAPSHOT.1735600578743 → 71.0.0-SNAPSHOT.1735658425894

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
@@ -32,6 +32,7 @@
32
32
  ID and access tokens in a single request and to use refresh tokens to maintain access without
33
33
  relying on third-party cookies.
34
34
  * Updated sorting on grouped grids to place ungrouped items at the bottom.
35
+ * `DashCanvas` views can now be resized left and up in addition to right and down.
35
36
 
36
37
  ### 🐞 Bug Fixes
37
38
 
@@ -53,6 +54,7 @@
53
54
  * Improved accuracy of `IconProps` interface, with use of the `IconName` and `IconPrefix` types
54
55
  provided by FontAwesome.
55
56
  * Improved accuracy of `PersistOptions.type` enum.
57
+ * Corrected the type of `ColumnSpec.editor`.
56
58
 
57
59
  ### 📚 Libraries
58
60
 
@@ -1,4 +1,4 @@
1
- import { IRowNode } from '@xh/hoist/kit/ag-grid';
1
+ import { CustomCellEditorProps } from '@ag-grid-community/react';
2
2
  import { GridFilterFieldSpecConfig } from '@xh/hoist/cmp/grid/filter/GridFilterFieldSpec';
3
3
  import { HSide, PersistOptions, Some } from '@xh/hoist/core';
4
4
  import { Store, StoreRecord, View } from '@xh/hoist/data';
@@ -6,7 +6,7 @@ import { ReactElement, ReactNode } from 'react';
6
6
  import { Column } from './columns/Column';
7
7
  import { ColumnGroup } from './columns/ColumnGroup';
8
8
  import { GridModel } from './GridModel';
9
- import type { CellClassParams, HeaderClassParams, HeaderValueGetterParams, ICellRendererParams, ITooltipParams, RowClassParams, ValueSetterParams } from '@xh/hoist/kit/ag-grid';
9
+ import type { CellClassParams, HeaderClassParams, HeaderValueGetterParams, ICellRendererParams, IRowNode, ITooltipParams, RowClassParams, ValueSetterParams } from '@xh/hoist/kit/ag-grid';
10
10
  export interface ColumnState {
11
11
  colId: string;
12
12
  width: number;
@@ -220,15 +220,23 @@ export type ColumnEditableFn = (params: {
220
220
  gridModel: GridModel;
221
221
  }) => boolean;
222
222
  /**
223
- * Function to return one Grid cell editor. This value will be used to create a new Component
224
- * whenever editing is initiated on a cell.
223
+ * Function to return one Grid cell editor. This function will be used to create a new
224
+ * Component, whenever editing is initiated on a cell.
225
+ * The never parameter is never provided - it is included to satisfy typescript. See
226
+ * discussion in https://github.com/xh/hoist-react/pull/3351.
225
227
  * @returns the react element to use as the cell editor.
226
228
  */
227
- export type ColumnEditorFn = (params: {
229
+ export type ColumnEditorFn = (props: ColumnEditorProps, never?: any) => ReactElement;
230
+ /**
231
+ * The object passed into the first argument of {@link ColumnSpec.editor}.
232
+ * Satisfies the {@link EditorProps} of an editor component.
233
+ */
234
+ export type ColumnEditorProps = {
228
235
  record: StoreRecord;
229
236
  column: Column;
230
237
  gridModel: GridModel;
231
- }) => ReactElement;
238
+ agParams: CustomCellEditorProps;
239
+ };
232
240
  /**
233
241
  * Function to update the value of a StoreRecord field after inline editing
234
242
  */
@@ -1,9 +1,8 @@
1
1
  import { HAlign, HSide, PlainObject, Some, Thunkable } from '@xh/hoist/core';
2
2
  import { CubeFieldSpec, FieldSpec, RecordAction, RecordActionSpec, StoreRecord } from '@xh/hoist/data';
3
- import { ReactNode } from 'react';
3
+ import { FunctionComponent, ReactNode } from 'react';
4
4
  import { GridModel } from '../GridModel';
5
- import { ColumnCellClassFn, ColumnCellClassRuleFn, ColumnComparator, ColumnEditableFn, ColumnEditorFn, ColumnExcelFormatFn, ColumnExportValueFn, ColumnGetValueFn, ColumnHeaderClassFn, ColumnHeaderNameFn, ColumnRenderer, ColumnSetValueFn, ColumnSortSpec, ColumnSortValueFn, ColumnTooltipFn } from '../Types';
6
- import { FunctionComponent } from 'react';
5
+ import { ColumnCellClassFn, ColumnCellClassRuleFn, ColumnComparator, ColumnEditableFn, ColumnEditorFn, ColumnEditorProps, ColumnExcelFormatFn, ColumnExportValueFn, ColumnGetValueFn, ColumnHeaderClassFn, ColumnHeaderNameFn, ColumnRenderer, ColumnSetValueFn, ColumnSortSpec, ColumnSortValueFn, ColumnTooltipFn } from '../Types';
7
6
  import type { ColDef } from '@xh/hoist/kit/ag-grid';
8
7
  export interface ColumnSpec {
9
8
  /**
@@ -216,10 +215,10 @@ export interface ColumnSpec {
216
215
  */
217
216
  editable?: boolean | ColumnEditableFn;
218
217
  /**
219
- * Cell editor Component or a function to create one. Adding an editor will also
220
- * install a cellClassRule and tooltip to display the validation state of the cell in question.
218
+ * Cell editor Component or a function to create one. Adding an editor will also install a
219
+ * cellClassRule and tooltip to display the validation state of the cell in question.
221
220
  */
222
- editor?: FunctionComponent | ColumnEditorFn;
221
+ editor?: FunctionComponent<ColumnEditorProps> | ColumnEditorFn;
223
222
  /**
224
223
  * True if this cell editor should be rendered as a popup over the cell instead of within the
225
224
  * actual cell element. Popup editors will have their width set to match the cell by default.
@@ -330,7 +329,7 @@ export declare class Column {
330
329
  autosizeBufferPx: number;
331
330
  autoHeight: boolean;
332
331
  editable: boolean | ColumnEditableFn;
333
- editor: FunctionComponent | ColumnEditorFn;
332
+ editor: FunctionComponent<ColumnEditorProps> | ColumnEditorFn;
334
333
  editorIsPopup: boolean;
335
334
  setValueFn: ColumnSetValueFn;
336
335
  getValueFn: ColumnGetValueFn;
@@ -12,6 +12,6 @@ export interface EditorProps<InputPropsT extends HoistInputProps> extends HoistP
12
12
  /** StoreRecord being edited. */
13
13
  record: StoreRecord;
14
14
  /** Props to pass through to the underlying HoistInput component */
15
- inputProps: InputPropsT;
15
+ inputProps?: InputPropsT;
16
16
  agParams: CustomCellEditorProps;
17
17
  }
package/cmp/grid/Types.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * Copyright © 2025 Extremely Heavy Industries Inc.
6
6
  */
7
7
 
8
- import {IRowNode} from '@xh/hoist/kit/ag-grid';
8
+ import {CustomCellEditorProps} from '@ag-grid-community/react';
9
9
  import {GridFilterFieldSpecConfig} from '@xh/hoist/cmp/grid/filter/GridFilterFieldSpec';
10
10
  import {HSide, PersistOptions, Some} from '@xh/hoist/core';
11
11
  import {Store, StoreRecord, View} from '@xh/hoist/data';
@@ -19,6 +19,7 @@ import type {
19
19
  HeaderClassParams,
20
20
  HeaderValueGetterParams,
21
21
  ICellRendererParams,
22
+ IRowNode,
22
23
  ITooltipParams,
23
24
  RowClassParams,
24
25
  ValueSetterParams
@@ -278,15 +279,24 @@ export type ColumnEditableFn = (params: {
278
279
  }) => boolean;
279
280
 
280
281
  /**
281
- * Function to return one Grid cell editor. This value will be used to create a new Component
282
- * whenever editing is initiated on a cell.
282
+ * Function to return one Grid cell editor. This function will be used to create a new
283
+ * Component, whenever editing is initiated on a cell.
284
+ * The never parameter is never provided - it is included to satisfy typescript. See
285
+ * discussion in https://github.com/xh/hoist-react/pull/3351.
283
286
  * @returns the react element to use as the cell editor.
284
287
  */
285
- export type ColumnEditorFn = (params: {
288
+ export type ColumnEditorFn = (props: ColumnEditorProps, never?: any) => ReactElement;
289
+
290
+ /**
291
+ * The object passed into the first argument of {@link ColumnSpec.editor}.
292
+ * Satisfies the {@link EditorProps} of an editor component.
293
+ */
294
+ export type ColumnEditorProps = {
286
295
  record: StoreRecord;
287
296
  column: Column;
288
297
  gridModel: GridModel;
289
- }) => ReactElement;
298
+ agParams: CustomCellEditorProps;
299
+ };
290
300
 
291
301
  /**
292
302
  * Function to update the value of a StoreRecord field after inline editing
@@ -34,9 +34,9 @@ import {
34
34
  toString
35
35
  } from 'lodash';
36
36
  import {
37
- Attributes,
38
37
  createElement,
39
38
  forwardRef,
39
+ FunctionComponent,
40
40
  isValidElement,
41
41
  ReactNode,
42
42
  useImperativeHandle,
@@ -52,6 +52,7 @@ import {
52
52
  ColumnComparator,
53
53
  ColumnEditableFn,
54
54
  ColumnEditorFn,
55
+ ColumnEditorProps,
55
56
  ColumnExcelFormatFn,
56
57
  ColumnExportValueFn,
57
58
  ColumnGetValueFn,
@@ -64,7 +65,6 @@ import {
64
65
  ColumnTooltipFn
65
66
  } from '../Types';
66
67
  import {ExcelFormat} from '../enums/ExcelFormat';
67
- import {FunctionComponent} from 'react';
68
68
  import type {
69
69
  ColDef,
70
70
  ITooltipParams,
@@ -333,10 +333,10 @@ export interface ColumnSpec {
333
333
  editable?: boolean | ColumnEditableFn;
334
334
 
335
335
  /**
336
- * Cell editor Component or a function to create one. Adding an editor will also
337
- * install a cellClassRule and tooltip to display the validation state of the cell in question.
336
+ * Cell editor Component or a function to create one. Adding an editor will also install a
337
+ * cellClassRule and tooltip to display the validation state of the cell in question.
338
338
  */
339
- editor?: FunctionComponent | ColumnEditorFn;
339
+ editor?: FunctionComponent<ColumnEditorProps> | ColumnEditorFn;
340
340
 
341
341
  /**
342
342
  * True if this cell editor should be rendered as a popup over the cell instead of within the
@@ -471,7 +471,7 @@ export class Column {
471
471
  autosizeBufferPx: number;
472
472
  autoHeight: boolean;
473
473
  editable: boolean | ColumnEditableFn;
474
- editor: FunctionComponent | ColumnEditorFn;
474
+ editor: FunctionComponent<ColumnEditorProps> | ColumnEditorFn;
475
475
  editorIsPopup: boolean;
476
476
  setValueFn: ColumnSetValueFn;
477
477
  getValueFn: ColumnGetValueFn;
@@ -986,8 +986,7 @@ export class Column {
986
986
  ref
987
987
  };
988
988
  // Can be a component or elem factory/ ad-hoc render function.
989
- if ((editor as any).isHoistComponent)
990
- return createElement(editor, props as Attributes);
989
+ if ((editor as any).isHoistComponent) return createElement(editor, props);
991
990
  if (isFunction(editor)) return editor(props);
992
991
  throw XH.exception('Column editor must be a HoistComponent or a render function');
993
992
  });
@@ -1,3 +1,32 @@
1
+ @mixin resize-handle-ew {
2
+ height: 100%;
3
+ top: 0;
4
+ transform: rotate(0);
5
+ width: 8px;
6
+ }
7
+
8
+ @mixin resize-handle-ns {
9
+ height: 8px;
10
+ left: 0;
11
+ transform: rotate(0);
12
+ width: 100%;
13
+ }
14
+
15
+ @mixin resize-handle-corner {
16
+ height: 16px;
17
+ width: 16px;
18
+ }
19
+
20
+ @mixin resize-handle-se-sw {
21
+ @include resize-handle-corner;
22
+ bottom: -8px;
23
+ }
24
+
25
+ @mixin resize-handle-ne-nw {
26
+ @include resize-handle-corner;
27
+ top: -8px;
28
+ }
29
+
1
30
  .xh-dash-canvas {
2
31
  width: 100%;
3
32
  height: 100%;
@@ -21,27 +50,44 @@
21
50
 
22
51
  > .react-resizable-handle {
23
52
  // Make the resize handles fill the entire side
53
+ &.react-resizable-handle-n {
54
+ @include resize-handle-ns;
55
+ top: -4px;
56
+ }
57
+
24
58
  &.react-resizable-handle-s {
59
+ @include resize-handle-ns;
25
60
  bottom: -4px;
26
- height: 8px;
27
- left: 0;
28
- transform: rotate(0);
29
- width: 100%;
30
61
  }
31
62
 
32
63
  &.react-resizable-handle-e {
33
- height: 100%;
64
+ @include resize-handle-ew;
34
65
  right: -4px;
35
- top: 0;
36
- transform: rotate(0);
37
- width: 8px;
66
+ }
67
+
68
+ &.react-resizable-handle-w {
69
+ @include resize-handle-ew;
70
+ left: -4px;
71
+ }
72
+
73
+ &.react-resizable-handle-ne {
74
+ @include resize-handle-ne-nw;
75
+ right: -8px;
76
+ }
77
+
78
+ &.react-resizable-handle-nw {
79
+ @include resize-handle-ne-nw;
80
+ left: -8px;
38
81
  }
39
82
 
40
83
  &.react-resizable-handle-se {
41
- bottom: -8px;
42
- height: 16px;
84
+ @include resize-handle-se-sw;
43
85
  right: -8px;
44
- width: 16px;
86
+ }
87
+
88
+ &.react-resizable-handle-sw {
89
+ @include resize-handle-se-sw;
90
+ left: -8px;
45
91
  }
46
92
 
47
93
  // Hide the resize handles
@@ -112,7 +112,9 @@ export class DashCanvasModel
112
112
 
113
113
  return {
114
114
  ...it,
115
- resizeHandles: autoHeight ? ['e'] : ['e', 's', 'se'],
115
+ resizeHandles: autoHeight
116
+ ? ['w', 'e']
117
+ : ['s', 'w', 'e', 'n', 'sw', 'nw', 'se', 'ne'],
116
118
  maxH: viewSpec.maxHeight,
117
119
  minH: viewSpec.minHeight,
118
120
  maxW: viewSpec.maxWidth,
@@ -22,7 +22,7 @@ export interface EditorProps<InputPropsT extends HoistInputProps> extends HoistP
22
22
  record: StoreRecord;
23
23
 
24
24
  /** Props to pass through to the underlying HoistInput component */
25
- inputProps: InputPropsT;
25
+ inputProps?: InputPropsT;
26
26
 
27
27
  agParams: CustomCellEditorProps;
28
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "71.0.0-SNAPSHOT.1735600578743",
3
+ "version": "71.0.0-SNAPSHOT.1735658425894",
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",