@xh/hoist 77.0.0-SNAPSHOT.1759334906779 → 77.0.0-SNAPSHOT.1759338550975
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 +7 -0
- package/build/types/desktop/cmp/dash/DashViewModel.d.ts +6 -0
- package/desktop/cmp/dash/DashViewModel.ts +7 -0
- package/desktop/cmp/dash/canvas/impl/DashCanvasView.ts +4 -3
- package/desktop/cmp/dash/container/DashContainerModel.ts +15 -6
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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
|
+
|
|
5
12
|
## 76.0.0 - 2025-09-26
|
|
6
13
|
|
|
7
14
|
### 💥 Breaking Changes (upgrade difficulty: 🟠 MEDIUM - AG Grid update, Hoist React upgrade)
|
|
@@ -25,6 +25,12 @@ export declare class DashViewModel<T extends DashViewSpec = DashViewSpec> extend
|
|
|
25
25
|
containerModel: any;
|
|
26
26
|
/** Title with which to initialize the view. */
|
|
27
27
|
title: string;
|
|
28
|
+
/**
|
|
29
|
+
* Additional info that will be displayed after the title.
|
|
30
|
+
* Applications can bind to this property to provide dynamic title details.
|
|
31
|
+
* Value is not persisted.
|
|
32
|
+
**/
|
|
33
|
+
titleDetails: string;
|
|
28
34
|
/** Icon with which to initialize the view. */
|
|
29
35
|
icon: ReactElement;
|
|
30
36
|
/** State with which to initialize the view. */
|
|
@@ -47,6 +47,13 @@ export class DashViewModel<T extends DashViewSpec = DashViewSpec> extends HoistM
|
|
|
47
47
|
/** Title with which to initialize the view. */
|
|
48
48
|
@bindable title: string;
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Additional info that will be displayed after the title.
|
|
52
|
+
* Applications can bind to this property to provide dynamic title details.
|
|
53
|
+
* Value is not persisted.
|
|
54
|
+
**/
|
|
55
|
+
@bindable titleDetails: string;
|
|
56
|
+
|
|
50
57
|
/** Icon with which to initialize the view. */
|
|
51
58
|
@bindable.ref icon: ReactElement;
|
|
52
59
|
|
|
@@ -34,13 +34,14 @@ 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, titleDetails, title, icon} =
|
|
38
|
+
model,
|
|
38
39
|
headerProps = hidePanelHeader
|
|
39
40
|
? {}
|
|
40
41
|
: {
|
|
41
42
|
compactHeader: true,
|
|
42
|
-
title:
|
|
43
|
-
icon
|
|
43
|
+
title: title + (titleDetails ? ' ' + titleDetails : ''),
|
|
44
|
+
icon,
|
|
44
45
|
headerItems: [...headerItems, headerMenu({model})]
|
|
45
46
|
};
|
|
46
47
|
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, this.getViewModel(id));
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
onResize() {
|
|
@@ -558,8 +558,18 @@ export class DashContainerModel
|
|
|
558
558
|
|
|
559
559
|
if (viewSpec.allowRename) {
|
|
560
560
|
this.insertTitleForm($el, viewModel);
|
|
561
|
-
$titleEl.off('dblclick').dblclick(() => this.showTitleForm($el));
|
|
561
|
+
$titleEl.off('dblclick').dblclick(() => this.showTitleForm($el, viewModel));
|
|
562
562
|
}
|
|
563
|
+
|
|
564
|
+
viewModel.addReaction({
|
|
565
|
+
track: () => viewModel.titleDetails,
|
|
566
|
+
run: () => {
|
|
567
|
+
const currentTitle = $titleEl.text(),
|
|
568
|
+
{title, titleDetails} = viewModel,
|
|
569
|
+
newTitle = title + (titleDetails ? ' ' + titleDetails : '');
|
|
570
|
+
if (currentTitle !== newTitle) $titleEl.text(newTitle);
|
|
571
|
+
}
|
|
572
|
+
});
|
|
563
573
|
});
|
|
564
574
|
}
|
|
565
575
|
|
|
@@ -588,12 +598,11 @@ export class DashContainerModel
|
|
|
588
598
|
});
|
|
589
599
|
}
|
|
590
600
|
|
|
591
|
-
private showTitleForm($tabEl) {
|
|
601
|
+
private showTitleForm($tabEl, viewModel: DashViewModel) {
|
|
592
602
|
if (this.renameLocked) return;
|
|
593
603
|
|
|
594
|
-
const $
|
|
595
|
-
|
|
596
|
-
currentTitle = $titleEl.text();
|
|
604
|
+
const $inputEl = $tabEl.find('.title-form input').first(),
|
|
605
|
+
currentTitle = viewModel.title;
|
|
597
606
|
|
|
598
607
|
$tabEl.addClass('show-title-form');
|
|
599
608
|
$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.1759338550975",
|
|
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",
|