@xh/hoist 77.0.0-SNAPSHOT.1759414848931 → 77.0.0-SNAPSHOT.1759415601909
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 +0 -7
- package/build/types/desktop/cmp/dash/DashViewModel.d.ts +1 -10
- package/desktop/cmp/dash/DashViewModel.ts +1 -15
- package/desktop/cmp/dash/canvas/impl/DashCanvasView.ts +3 -3
- package/desktop/cmp/dash/container/DashContainerModel.ts +13 -17
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
## 77.0.0-SNAPSHOT - unreleased
|
|
4
4
|
|
|
5
|
-
### 🎁 New Features
|
|
6
|
-
|
|
7
|
-
* `DashCanvasView` and `DashContainerView` components now have a public `@bindable` `titleDetails`
|
|
8
|
-
property on their models to support displaying additional information in the title bar of these
|
|
9
|
-
components. `titleDetails` is not persisted, and is expected to be set programmatically by the
|
|
10
|
-
application as needed.
|
|
11
|
-
|
|
12
5
|
## 76.0.0 - 2025-09-26
|
|
13
6
|
|
|
14
7
|
### 💥 Breaking Changes (upgrade difficulty: 🟠 MEDIUM - AG Grid update, Hoist React upgrade)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HoistModel, MenuItemLike, PlainObject, RefreshMode, RenderMode } from '@xh/hoist/core';
|
|
2
2
|
import '@xh/hoist/desktop/register';
|
|
3
|
-
import { IReactionDisposer } from 'mobx/dist/internal';
|
|
4
3
|
import { ReactElement } from 'react';
|
|
5
4
|
import { DashViewSpec } from './DashViewSpec';
|
|
6
5
|
export type DashViewState = PlainObject;
|
|
@@ -24,16 +23,8 @@ export declare class DashViewModel<T extends DashViewSpec = DashViewSpec> extend
|
|
|
24
23
|
* constructing these models - no need to specify manually.
|
|
25
24
|
*/
|
|
26
25
|
containerModel: any;
|
|
27
|
-
/** Title with which to initialize the view.
|
|
26
|
+
/** Title with which to initialize the view. */
|
|
28
27
|
title: string;
|
|
29
|
-
/**
|
|
30
|
-
* Additional info that will be displayed after the title.
|
|
31
|
-
* Applications can bind to this property to provide dynamic title details.
|
|
32
|
-
* Value is not persisted.
|
|
33
|
-
**/
|
|
34
|
-
titleDetails: string;
|
|
35
|
-
get fullTitle(): string;
|
|
36
|
-
fullTitleReaction: IReactionDisposer;
|
|
37
28
|
/** Icon with which to initialize the view. */
|
|
38
29
|
icon: ReactElement;
|
|
39
30
|
/** State with which to initialize the view. */
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
import '@xh/hoist/desktop/register';
|
|
17
17
|
import {makeObservable, bindable} from '@xh/hoist/mobx';
|
|
18
18
|
import {throwIf} from '@xh/hoist/utils/js';
|
|
19
|
-
import {IReactionDisposer} from 'mobx/dist/internal';
|
|
20
19
|
import {ReactElement} from 'react';
|
|
21
20
|
import {DashViewSpec} from './DashViewSpec';
|
|
22
21
|
|
|
@@ -45,22 +44,9 @@ export class DashViewModel<T extends DashViewSpec = DashViewSpec> extends HoistM
|
|
|
45
44
|
*/
|
|
46
45
|
containerModel: any;
|
|
47
46
|
|
|
48
|
-
/** Title with which to initialize the view.
|
|
47
|
+
/** Title with which to initialize the view. */
|
|
49
48
|
@bindable title: string;
|
|
50
49
|
|
|
51
|
-
/**
|
|
52
|
-
* Additional info that will be displayed after the title.
|
|
53
|
-
* Applications can bind to this property to provide dynamic title details.
|
|
54
|
-
* Value is not persisted.
|
|
55
|
-
**/
|
|
56
|
-
@bindable titleDetails: string;
|
|
57
|
-
|
|
58
|
-
get fullTitle(): string {
|
|
59
|
-
return this.title + (this.titleDetails ? ' ' + this.titleDetails : '');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
fullTitleReaction: IReactionDisposer;
|
|
63
|
-
|
|
64
50
|
/** Icon with which to initialize the view. */
|
|
65
51
|
@bindable.ref icon: ReactElement;
|
|
66
52
|
|
|
@@ -34,13 +34,13 @@ export const dashCanvasView = hoistCmp.factory({
|
|
|
34
34
|
model: uses(DashCanvasViewModel, {publishMode: 'limited'}),
|
|
35
35
|
|
|
36
36
|
render({model, className}) {
|
|
37
|
-
const {viewSpec, ref, hidePanelHeader, headerItems, autoHeight
|
|
37
|
+
const {viewSpec, ref, hidePanelHeader, headerItems, autoHeight} = model,
|
|
38
38
|
headerProps = hidePanelHeader
|
|
39
39
|
? {}
|
|
40
40
|
: {
|
|
41
41
|
compactHeader: true,
|
|
42
|
-
title:
|
|
43
|
-
icon,
|
|
42
|
+
title: model.title,
|
|
43
|
+
icon: model.icon,
|
|
44
44
|
headerItems: [...headerItems, headerMenu({model})]
|
|
45
45
|
};
|
|
46
46
|
return panel({
|
|
@@ -338,7 +338,7 @@ export class DashContainerModel
|
|
|
338
338
|
renameView(id: string) {
|
|
339
339
|
const view = this.getItemByViewModel(id);
|
|
340
340
|
if (!view) return;
|
|
341
|
-
this.showTitleForm(view.tab.element
|
|
341
|
+
this.showTitleForm(view.tab.element);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
onResize() {
|
|
@@ -531,7 +531,7 @@ export class DashContainerModel
|
|
|
531
531
|
$titleEl = $el.find('.lm_title').first(),
|
|
532
532
|
iconSelector = 'svg.svg-inline--fa',
|
|
533
533
|
viewSpec = this.getViewSpec(item.config.component),
|
|
534
|
-
{icon} = viewModel;
|
|
534
|
+
{icon, title} = viewModel;
|
|
535
535
|
|
|
536
536
|
$el.off('contextmenu').contextmenu(e => {
|
|
537
537
|
const index = stack.contentItems.indexOf(item);
|
|
@@ -551,21 +551,15 @@ export class DashContainerModel
|
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
|
|
554
|
+
if (title) {
|
|
555
|
+
const currentTitle = $titleEl.text();
|
|
556
|
+
if (currentTitle !== title) $titleEl.text(title);
|
|
557
|
+
}
|
|
558
|
+
|
|
554
559
|
if (viewSpec.allowRename) {
|
|
555
560
|
this.insertTitleForm($el, viewModel);
|
|
556
|
-
$titleEl.off('dblclick').dblclick(() => this.showTitleForm($el
|
|
561
|
+
$titleEl.off('dblclick').dblclick(() => this.showTitleForm($el));
|
|
557
562
|
}
|
|
558
|
-
|
|
559
|
-
viewModel.fullTitleReaction?.();
|
|
560
|
-
viewModel.fullTitleReaction = viewModel.addReaction({
|
|
561
|
-
track: () => viewModel.fullTitle,
|
|
562
|
-
run: () => {
|
|
563
|
-
const currentTitle = $titleEl.text(),
|
|
564
|
-
newTitle = viewModel.fullTitle;
|
|
565
|
-
|
|
566
|
-
if (currentTitle !== newTitle) $titleEl.text(newTitle);
|
|
567
|
-
}
|
|
568
|
-
});
|
|
569
563
|
});
|
|
570
564
|
}
|
|
571
565
|
|
|
@@ -585,6 +579,7 @@ export class DashContainerModel
|
|
|
585
579
|
$formEl.submit(() => {
|
|
586
580
|
const title = $inputEl.val();
|
|
587
581
|
if (title.length) {
|
|
582
|
+
$titleEl.text(title);
|
|
588
583
|
viewModel.title = title;
|
|
589
584
|
}
|
|
590
585
|
|
|
@@ -593,11 +588,12 @@ export class DashContainerModel
|
|
|
593
588
|
});
|
|
594
589
|
}
|
|
595
590
|
|
|
596
|
-
private showTitleForm($tabEl
|
|
591
|
+
private showTitleForm($tabEl) {
|
|
597
592
|
if (this.renameLocked) return;
|
|
598
593
|
|
|
599
|
-
const $
|
|
600
|
-
|
|
594
|
+
const $titleEl = $tabEl.find('.lm_title').first(),
|
|
595
|
+
$inputEl = $tabEl.find('.title-form input').first(),
|
|
596
|
+
currentTitle = $titleEl.text();
|
|
601
597
|
|
|
602
598
|
$tabEl.addClass('show-title-form');
|
|
603
599
|
$inputEl.val(currentTitle);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "77.0.0-SNAPSHOT.
|
|
3
|
+
"version": "77.0.0-SNAPSHOT.1759415601909",
|
|
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",
|