@xh/hoist 75.0.0-SNAPSHOT.1753198948130 → 75.0.0-SNAPSHOT.1753279912670
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 +3 -0
- package/build/types/cmp/grid/GridModel.d.ts +2 -1
- package/build/types/desktop/cmp/button/{ColAutosizeButton.d.ts → grid/ColAutosizeButton.d.ts} +3 -3
- package/build/types/desktop/cmp/button/{ColChooserButton.d.ts → grid/ColChooserButton.d.ts} +3 -3
- package/build/types/desktop/cmp/button/grid/ExpandToLevelButton.d.ts +18 -0
- package/build/types/desktop/cmp/button/{ExportButton.d.ts → grid/ExportButton.d.ts} +7 -7
- package/build/types/desktop/cmp/button/index.d.ts +7 -6
- package/build/types/desktop/cmp/button/{ZoneMapperButton.d.ts → zoneGrid/ZoneMapperButton.d.ts} +3 -4
- package/build/types/mobile/cmp/button/{ColAutosizeButton.d.ts → grid/ColAutosizeButton.d.ts} +2 -2
- package/build/types/mobile/cmp/button/{ColChooserButton.d.ts → grid/ColChooserButton.d.ts} +4 -4
- package/build/types/mobile/cmp/button/{ExpandCollapseButton.d.ts → grid/ExpandCollapseButton.d.ts} +5 -2
- package/build/types/mobile/cmp/button/grid/ExpandToLevelButton.d.ts +15 -0
- package/build/types/mobile/cmp/button/index.d.ts +5 -4
- package/build/types/mobile/cmp/button/{ZoneMapperButton.d.ts → zoneGrid/ZoneMapperButton.d.ts} +2 -3
- package/cmp/grid/GridModel.ts +2 -1
- package/desktop/cmp/button/{ColAutosizeButton.ts → grid/ColAutosizeButton.ts} +25 -15
- package/desktop/cmp/button/{ColChooserButton.ts → grid/ColChooserButton.ts} +10 -10
- package/desktop/cmp/button/grid/ExpandToLevelButton.ts +96 -0
- package/desktop/cmp/button/grid/ExportButton.ts +75 -0
- package/desktop/cmp/button/index.ts +7 -6
- package/desktop/cmp/button/{ModalToggleButton.ts → panel/ModalToggleButton.ts} +12 -6
- package/desktop/cmp/button/{ZoneMapperButton.ts → zoneGrid/ZoneMapperButton.ts} +11 -11
- package/mobile/cmp/button/{ColAutosizeButton.ts → grid/ColAutosizeButton.ts} +26 -10
- package/mobile/cmp/button/grid/ColChooserButton.ts +58 -0
- package/mobile/cmp/button/{ExpandCollapseButton.ts → grid/ExpandCollapseButton.ts} +12 -6
- package/mobile/cmp/button/grid/ExpandToLevelButton.ts +91 -0
- package/mobile/cmp/button/index.ts +5 -4
- package/mobile/cmp/button/zoneGrid/ZoneMapperButton.ts +58 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/desktop/cmp/button/ExportButton.ts +0 -65
- package/mobile/cmp/button/ColChooserButton.ts +0 -44
- package/mobile/cmp/button/ZoneMapperButton.ts +0 -42
- /package/build/types/desktop/cmp/button/{ModalToggleButton.d.ts → panel/ModalToggleButton.d.ts} +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file belongs to Hoist, an application development toolkit
|
|
3
|
-
* developed by Extremely Heavy Industries (www.xh.io | info@xh.io)
|
|
4
|
-
*
|
|
5
|
-
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
|
-
*/
|
|
7
|
-
import {GridModel} from '@xh/hoist/cmp/grid';
|
|
8
|
-
import {hoistCmp, useContextModel} from '@xh/hoist/core';
|
|
9
|
-
import '@xh/hoist/desktop/register';
|
|
10
|
-
import {Icon} from '@xh/hoist/icon';
|
|
11
|
-
import {errorIf, withDefault} from '@xh/hoist/utils/js';
|
|
12
|
-
import {ExportOptions} from '@xh/hoist/svc';
|
|
13
|
-
import {button, ButtonProps} from './Button';
|
|
14
|
-
|
|
15
|
-
export interface ExportButtonProps extends ButtonProps {
|
|
16
|
-
gridModel?: GridModel;
|
|
17
|
-
exportOptions?: ExportOptions;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Convenience Button preconfigured for use as a trigger for an export/download of data.
|
|
22
|
-
*
|
|
23
|
-
* Must be provided either an onClick handler *or* a gridModel. GridModel may be provided
|
|
24
|
-
* in props, or otherwise will be looked up by this model from context.
|
|
25
|
-
*
|
|
26
|
-
* If a gridModel is provided, this button will call exportAsync() on the model class.
|
|
27
|
-
* Options supported by GridExportService.exportAsync() can be set via the exportOptions
|
|
28
|
-
* props.
|
|
29
|
-
*
|
|
30
|
-
* Requires the `GridModel.enableExport` config option to be true.
|
|
31
|
-
*/
|
|
32
|
-
export const [ExportButton, exportButton] = hoistCmp.withFactory<ExportButtonProps>({
|
|
33
|
-
displayName: 'ExportButton',
|
|
34
|
-
model: false,
|
|
35
|
-
|
|
36
|
-
render({icon, title, onClick, gridModel, exportOptions = {}, disabled, ...rest}, ref) {
|
|
37
|
-
const contextGridModel = useContextModel(GridModel);
|
|
38
|
-
|
|
39
|
-
if (!onClick) {
|
|
40
|
-
gridModel = withDefault(gridModel, contextGridModel);
|
|
41
|
-
|
|
42
|
-
errorIf(
|
|
43
|
-
!gridModel || !gridModel.enableExport,
|
|
44
|
-
'ExportButton must be bound to GridModel with enableExport == true, otherwise exports will not work.'
|
|
45
|
-
);
|
|
46
|
-
onClick = gridModel ? () => exportGridData(gridModel, exportOptions) : null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return button({
|
|
50
|
-
ref,
|
|
51
|
-
icon: withDefault(icon, Icon.download()),
|
|
52
|
-
title: withDefault(title, 'Export'),
|
|
53
|
-
onClick,
|
|
54
|
-
disabled: withDefault(disabled, gridModel && gridModel.empty),
|
|
55
|
-
...rest
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
//---------------------------
|
|
61
|
-
// Implementation
|
|
62
|
-
//---------------------------
|
|
63
|
-
function exportGridData(gridModel: GridModel, exportOptions: ExportOptions) {
|
|
64
|
-
gridModel.exportAsync(exportOptions).catchDefault();
|
|
65
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file belongs to Hoist, an application development toolkit
|
|
3
|
-
* developed by Extremely Heavy Industries (www.xh.io | info@xh.io)
|
|
4
|
-
*
|
|
5
|
-
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
|
-
*/
|
|
7
|
-
import {GridModel} from '@xh/hoist/cmp/grid';
|
|
8
|
-
import {hoistCmp, useContextModel} from '@xh/hoist/core';
|
|
9
|
-
import {Icon} from '@xh/hoist/icon';
|
|
10
|
-
import {button, ButtonProps} from '@xh/hoist/mobile/cmp/button';
|
|
11
|
-
import '@xh/hoist/mobile/register';
|
|
12
|
-
import {logError, withDefault} from '@xh/hoist/utils/js';
|
|
13
|
-
|
|
14
|
-
export interface ColChooserButtonProps extends ButtonProps {
|
|
15
|
-
/** GridModel of the grid for which this button should show a chooser. */
|
|
16
|
-
gridModel?: GridModel;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* A convenience button to trigger the display of a ColChooser for user selection,
|
|
21
|
-
* discovery and reordering of available Grid columns.
|
|
22
|
-
*
|
|
23
|
-
* Requires a `GridModel.colChooserModel` config option, set to true for default implementation.
|
|
24
|
-
*/
|
|
25
|
-
export const [ColChooserButton, colChooserButton] = hoistCmp.withFactory<ColChooserButtonProps>({
|
|
26
|
-
displayName: 'ColChooserButton',
|
|
27
|
-
model: false,
|
|
28
|
-
|
|
29
|
-
render({gridModel, icon = Icon.gridPanel(), onClick, ...props}) {
|
|
30
|
-
gridModel = withDefault(gridModel, useContextModel(GridModel));
|
|
31
|
-
|
|
32
|
-
if (!gridModel) {
|
|
33
|
-
logError(
|
|
34
|
-
"No GridModel available. Provide via a 'gridModel' prop, or context.",
|
|
35
|
-
ColChooserButton
|
|
36
|
-
);
|
|
37
|
-
return button({icon, disabled: true, ...props});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
onClick = onClick ?? (() => gridModel.showColChooser());
|
|
41
|
-
|
|
42
|
-
return button({icon, onClick, ...props});
|
|
43
|
-
}
|
|
44
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file belongs to Hoist, an application development toolkit
|
|
3
|
-
* developed by Extremely Heavy Industries (www.xh.io | info@xh.io)
|
|
4
|
-
*
|
|
5
|
-
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
|
-
*/
|
|
7
|
-
import {hoistCmp, useContextModel} from '@xh/hoist/core';
|
|
8
|
-
import {ZoneGridModel} from '../../../cmp/zoneGrid';
|
|
9
|
-
import {button, ButtonProps} from '@xh/hoist/mobile/cmp/button';
|
|
10
|
-
import {Icon} from '@xh/hoist/icon';
|
|
11
|
-
import {logError, withDefault} from '@xh/hoist/utils/js';
|
|
12
|
-
import '@xh/hoist/mobile/register';
|
|
13
|
-
|
|
14
|
-
export interface ZoneMapperButtonProps extends ButtonProps {
|
|
15
|
-
/** ZoneGridModel of the grid for which this button should show a chooser. */
|
|
16
|
-
zoneGridModel?: ZoneGridModel;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* A convenience button to trigger the display of a ZoneMapper UI for ZoneGrid configuration.
|
|
21
|
-
*
|
|
22
|
-
* Requires a `ZoneGridModel.zoneMapperModel` config option, set to true for default implementation.
|
|
23
|
-
*/
|
|
24
|
-
export const [ZoneMapperButton, zoneMapperButton] = hoistCmp.withFactory<ZoneMapperButtonProps>({
|
|
25
|
-
displayName: 'ZoneMapperButton',
|
|
26
|
-
model: false,
|
|
27
|
-
render({zoneGridModel, icon = Icon.gridLarge(), onClick, ...props}) {
|
|
28
|
-
zoneGridModel = withDefault(zoneGridModel, useContextModel(ZoneGridModel));
|
|
29
|
-
|
|
30
|
-
if (!zoneGridModel) {
|
|
31
|
-
logError(
|
|
32
|
-
"No ZoneGridModel available. Provide via a 'zoneGridModel' prop, or context.",
|
|
33
|
-
ZoneMapperButton
|
|
34
|
-
);
|
|
35
|
-
return button({icon, disabled: true, ...props});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
onClick = onClick ?? (() => zoneGridModel.showMapper());
|
|
39
|
-
|
|
40
|
-
return button({icon, onClick, ...props});
|
|
41
|
-
}
|
|
42
|
-
});
|
/package/build/types/desktop/cmp/button/{ModalToggleButton.d.ts → panel/ModalToggleButton.d.ts}
RENAMED
|
File without changes
|