@xh/hoist 74.1.2 → 75.0.0-SNAPSHOT.1749666833237
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 +5 -41
- package/build/types/cmp/grouping/GroupingChooserModel.d.ts +4 -8
- package/build/types/cmp/viewmanager/ViewInfo.d.ts +3 -7
- package/build/types/core/types/Interfaces.d.ts +1 -1
- package/build/types/desktop/cmp/grouping/GroupingChooser.d.ts +6 -17
- package/build/types/desktop/cmp/panel/Panel.d.ts +1 -1
- package/build/types/desktop/cmp/viewmanager/ViewManager.d.ts +10 -26
- package/build/types/mobile/cmp/grouping/GroupingChooser.d.ts +6 -2
- package/build/types/utils/impl/index.d.ts +0 -1
- package/cmp/grouping/GroupingChooserModel.ts +12 -25
- package/cmp/viewmanager/ViewInfo.ts +3 -7
- package/core/HoistAppModel.ts +0 -1
- package/core/exception/ExceptionHandler.ts +1 -1
- package/core/types/Interfaces.ts +2 -2
- package/desktop/cmp/button/AppMenuButton.ts +46 -3
- package/desktop/cmp/grouping/GroupingChooser.scss +40 -45
- package/desktop/cmp/grouping/GroupingChooser.ts +89 -159
- package/desktop/cmp/panel/Panel.ts +1 -1
- package/desktop/cmp/viewmanager/ViewManager.ts +16 -58
- package/desktop/cmp/viewmanager/ViewMenu.ts +2 -9
- package/mobile/appcontainer/FeedbackDialog.ts +0 -4
- package/mobile/appcontainer/OptionsDialog.ts +1 -3
- package/mobile/cmp/grid/impl/ColChooser.ts +2 -3
- package/mobile/cmp/grouping/GroupingChooser.scss +20 -41
- package/mobile/cmp/grouping/GroupingChooser.ts +89 -60
- package/mobile/cmp/panel/DialogPanel.scss +0 -5
- package/package.json +1 -1
- package/svc/TrackService.ts +3 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/utils/impl/index.ts +0 -1
- package/utils/js/LangUtils.ts +1 -1
- package/build/types/utils/impl/MenuItems.d.ts +0 -13
- package/utils/impl/MenuItems.ts +0 -57
package/utils/impl/index.ts
CHANGED
package/utils/js/LangUtils.ts
CHANGED
|
@@ -178,7 +178,7 @@ export function apiDeprecated(name: string, opts: APIWarnOptions = {}) {
|
|
|
178
178
|
|
|
179
179
|
const v = opts.v ?? 'a future release',
|
|
180
180
|
msg = opts.msg ? ` ${opts.msg}.` : '',
|
|
181
|
-
warn = `The use of '${name}' has been deprecated and will be removed in ${v}
|
|
181
|
+
warn = `The use of '${name}' has been deprecated and will be removed in ${v}.${msg}`;
|
|
182
182
|
if (!_seenWarnings[warn]) {
|
|
183
183
|
console.warn(warn);
|
|
184
184
|
_seenWarnings[warn] = true;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MenuItemLike } from '@xh/hoist/core';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
/**
|
|
4
|
-
* Parse MenuItem configs into Blueprint MenuItems.
|
|
5
|
-
*
|
|
6
|
-
* Note this is currently used in a few limited places and is not generally applied to all menu-
|
|
7
|
-
* like components in Hoist. In particular, it is not used by the `menu` component re-exported from
|
|
8
|
-
* Blueprint. See https://github.com/xh/hoist-react/issues/2400 covering TBD work to more fully
|
|
9
|
-
* standardize a Hoist menu component that might then incorporate this processing.
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare function parseMenuItems(items: MenuItemLike[]): ReactNode[];
|
package/utils/impl/MenuItems.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {isMenuItem, MenuItemLike} from '@xh/hoist/core';
|
|
2
|
-
import {menuDivider, menuItem} from '@xh/hoist/kit/blueprint';
|
|
3
|
-
import {MenuItemProps} from '@blueprintjs/core';
|
|
4
|
-
import {wait} from '@xh/hoist/promise';
|
|
5
|
-
import {isOmitted} from '@xh/hoist/utils/impl/IsOmitted';
|
|
6
|
-
import {filterConsecutiveMenuSeparators} from '@xh/hoist/utils/impl/Separators';
|
|
7
|
-
import {clone, isEmpty} from 'lodash';
|
|
8
|
-
import {ReactNode} from 'react';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Parse MenuItem configs into Blueprint MenuItems.
|
|
12
|
-
*
|
|
13
|
-
* Note this is currently used in a few limited places and is not generally applied to all menu-
|
|
14
|
-
* like components in Hoist. In particular, it is not used by the `menu` component re-exported from
|
|
15
|
-
* Blueprint. See https://github.com/xh/hoist-react/issues/2400 covering TBD work to more fully
|
|
16
|
-
* standardize a Hoist menu component that might then incorporate this processing.
|
|
17
|
-
*
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export function parseMenuItems(items: MenuItemLike[]): ReactNode[] {
|
|
21
|
-
items = items.map(item => {
|
|
22
|
-
if (!isMenuItem(item)) return item;
|
|
23
|
-
|
|
24
|
-
item = clone(item);
|
|
25
|
-
item.items = clone(item.items);
|
|
26
|
-
item.prepareFn?.(item);
|
|
27
|
-
return item;
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return items
|
|
31
|
-
.filter(it => !isMenuItem(it) || (!it.hidden && !isOmitted(it)))
|
|
32
|
-
.filter(filterConsecutiveMenuSeparators())
|
|
33
|
-
.map(item => {
|
|
34
|
-
if (item === '-') return menuDivider();
|
|
35
|
-
if (!isMenuItem(item)) return item;
|
|
36
|
-
|
|
37
|
-
const {actionFn} = item;
|
|
38
|
-
|
|
39
|
-
// Create menuItem from config
|
|
40
|
-
const cfg: MenuItemProps = {
|
|
41
|
-
text: item.text,
|
|
42
|
-
icon: item.icon,
|
|
43
|
-
intent: item.intent,
|
|
44
|
-
className: item.className,
|
|
45
|
-
onClick: actionFn ? e => wait().then(() => actionFn(e)) : null, // do async to allow menu to close
|
|
46
|
-
disabled: item.disabled
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
// Recursively parse any submenus
|
|
50
|
-
if (!isEmpty(item.items)) {
|
|
51
|
-
cfg.children = parseMenuItems(item.items);
|
|
52
|
-
cfg.popoverProps = {openOnTargetFocus: false};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return menuItem(cfg);
|
|
56
|
-
});
|
|
57
|
-
}
|