@xh/hoist 80.0.0-SNAPSHOT.1769042130982 → 80.0.0-SNAPSHOT.1769114224366
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/data/cube/Cube.d.ts +2 -0
- package/build/types/data/cube/View.d.ts +4 -2
- package/data/cube/Cube.ts +12 -0
- package/data/cube/View.ts +27 -3
- package/desktop/cmp/dash/container/impl/DashContainerMenuButton.ts +4 -2
- package/kit/golden-layout/styles.scss +14 -11
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
* Added `AggregationContext` as an additional argument to `CubeField.canAggregateFn`.
|
|
37
37
|
* Added `filterMatchMode` option to `ColChooserModel`, allowing customizing match to `start`,
|
|
38
38
|
`startWord`, or `any`.
|
|
39
|
+
* Added support for reconnecting a `View` to its associated `Cube`
|
|
39
40
|
|
|
40
41
|
### ⚙️ Typescript API Adjustments
|
|
41
42
|
|
|
@@ -61,6 +62,8 @@
|
|
|
61
62
|
CSS overrides with overrides to variables where possible.
|
|
62
63
|
* Added new CSS variables `--xh-intent-danger-text-color` (and others). Consider using these when
|
|
63
64
|
styling text with Hoist intent colors to enhance legibility in dark mode.
|
|
65
|
+
* Tweaked styling of `DashContainer` tab controls, adding a left border to the control surface and
|
|
66
|
+
improving the visibility of the tab overflow dropdown.
|
|
64
67
|
|
|
65
68
|
### 📚 Libraries
|
|
66
69
|
|
|
@@ -127,6 +127,8 @@ export declare class Cube extends HoistBase {
|
|
|
127
127
|
viewIsConnected(view: View): boolean;
|
|
128
128
|
/** Cease pushing further updates to this Cube's data into a previously connected View. */
|
|
129
129
|
disconnectView(view: View): void;
|
|
130
|
+
/** Connect a View to this Cube for live updates. */
|
|
131
|
+
connectView(view: View): void;
|
|
130
132
|
/**
|
|
131
133
|
* Populate this cube with a new dataset.
|
|
132
134
|
* This method largely delegates to {@link Store.loadData} - see that method for more info.
|
|
@@ -66,11 +66,13 @@ export declare class View extends HoistBase implements FilterBindTarget, FilterV
|
|
|
66
66
|
get isFiltered(): boolean;
|
|
67
67
|
/** Stop receiving live updates into this view when the linked Cube data changes. */
|
|
68
68
|
disconnect(): void;
|
|
69
|
+
/** Connect to the associated Cube to begin receiving live updates. */
|
|
70
|
+
connect(): void;
|
|
69
71
|
/**
|
|
70
72
|
* Change the query in some way, re-computing the data in this View to reflect the new query.
|
|
71
73
|
*
|
|
72
|
-
* @param overrides - changes to be applied to the query.
|
|
73
|
-
*
|
|
74
|
+
* @param overrides - changes to be applied to the query. If changing the `cube` and currently
|
|
75
|
+
* connected, then we will disconnect from the old cube and connect to the new one.
|
|
74
76
|
*/
|
|
75
77
|
updateQuery(overrides: Partial<QueryConfig>): void;
|
|
76
78
|
/** Gather all unique values for each dimension field in the query. */
|
package/data/cube/Cube.ts
CHANGED
|
@@ -227,6 +227,18 @@ export class Cube extends HoistBase {
|
|
|
227
227
|
this._connectedViews.delete(view);
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
+
/** Connect a View to this Cube for live updates. */
|
|
231
|
+
connectView(view: View) {
|
|
232
|
+
if (this.viewIsConnected(view)) return;
|
|
233
|
+
|
|
234
|
+
this._connectedViews.add(view);
|
|
235
|
+
|
|
236
|
+
// If the view is not up-to-date with the current cube data, then reload the view
|
|
237
|
+
if (view.info !== this.info) {
|
|
238
|
+
view.noteCubeLoaded();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
230
242
|
//-------------------
|
|
231
243
|
// Data Loading API
|
|
232
244
|
//-------------------
|
package/data/cube/View.ts
CHANGED
|
@@ -156,21 +156,45 @@ export class View
|
|
|
156
156
|
this.cube.disconnectView(this);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
/** Connect to the associated Cube to begin receiving live updates. */
|
|
160
|
+
@action
|
|
161
|
+
connect() {
|
|
162
|
+
this.cube.connectView(this);
|
|
163
|
+
}
|
|
164
|
+
|
|
159
165
|
/**
|
|
160
166
|
* Change the query in some way, re-computing the data in this View to reflect the new query.
|
|
161
167
|
*
|
|
162
|
-
* @param overrides - changes to be applied to the query.
|
|
163
|
-
*
|
|
168
|
+
* @param overrides - changes to be applied to the query. If changing the `cube` and currently
|
|
169
|
+
* connected, then we will disconnect from the old cube and connect to the new one.
|
|
164
170
|
*/
|
|
165
171
|
@action
|
|
166
172
|
updateQuery(overrides: Partial<QueryConfig>) {
|
|
167
|
-
throwIf(overrides.cube, 'Cannot redirect view to a different cube in updateQuery().');
|
|
168
173
|
const oldQuery = this.query,
|
|
169
174
|
newQuery = oldQuery.clone(overrides);
|
|
175
|
+
|
|
170
176
|
if (oldQuery.equals(newQuery)) return;
|
|
171
177
|
|
|
172
178
|
this.query = newQuery;
|
|
173
179
|
|
|
180
|
+
// If the cube is changing then we need to clear the row cache, and potentially disconnect
|
|
181
|
+
// from the old cube and connect to the new one
|
|
182
|
+
const {cube: oldCube} = oldQuery,
|
|
183
|
+
{cube: newCube} = newQuery;
|
|
184
|
+
|
|
185
|
+
if (oldCube !== newCube) {
|
|
186
|
+
this.info = null;
|
|
187
|
+
this._rowCache.clear();
|
|
188
|
+
|
|
189
|
+
if (oldCube.viewIsConnected(this)) {
|
|
190
|
+
oldCube.disconnectView(this);
|
|
191
|
+
newCube.connectView(this);
|
|
192
|
+
|
|
193
|
+
// Connecting to the new cube will have triggered a full update so we early out
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
174
198
|
// Must clear row cache if we have complex aggregates or more than filter changing.
|
|
175
199
|
if (!this.aggregatorsAreSimple || !oldQuery.equalsExcludingFilter(newQuery)) {
|
|
176
200
|
this._rowCache.clear();
|
|
@@ -17,15 +17,17 @@ import {dashContainerContextMenu} from './DashContainerContextMenu';
|
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
19
|
export const dashContainerMenuButton = hoistCmp.factory({
|
|
20
|
+
className: 'xh-dash-container-menu-btn',
|
|
20
21
|
model: null,
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
render({stack, dashContainerModel, className}) {
|
|
22
24
|
if (dashContainerModel.contentLocked || !dashContainerModel.showMenuButton) return null;
|
|
23
25
|
|
|
24
26
|
return popover({
|
|
25
27
|
position: Position.BOTTOM,
|
|
26
28
|
item: button({
|
|
27
29
|
icon: Icon.ellipsisVertical(),
|
|
28
|
-
className
|
|
30
|
+
className
|
|
29
31
|
}),
|
|
30
32
|
content: dashContainerContextMenu({stack, dashContainerModel})
|
|
31
33
|
});
|
|
@@ -15,16 +15,6 @@
|
|
|
15
15
|
background: rgba(0, 0, 0, 0.06);
|
|
16
16
|
min-height: 25px;
|
|
17
17
|
|
|
18
|
-
.xh-dash-container-add-button {
|
|
19
|
-
padding: 5px;
|
|
20
|
-
color: #999;
|
|
21
|
-
|
|
22
|
-
&:hover {
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
color: var(--xh-text-color);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
18
|
.lm_tabs {
|
|
29
19
|
flex: 1;
|
|
30
20
|
position: relative;
|
|
@@ -37,9 +27,21 @@
|
|
|
37
27
|
display: flex;
|
|
38
28
|
align-items: center;
|
|
39
29
|
|
|
30
|
+
// Add left border to visually structure the control area and help it stand out.
|
|
31
|
+
border-left: var(--xh-border-solid);
|
|
32
|
+
padding-left: 3px;
|
|
33
|
+
|
|
34
|
+
> li {
|
|
35
|
+
// Avoid muted opacity on controls - we want users to be able to see these.
|
|
36
|
+
opacity: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
40
39
|
.lm_tabdropdown {
|
|
41
40
|
&::before {
|
|
42
|
-
|
|
41
|
+
// Set warning intent on tab dropdown - this is a tiny V arrow icon that appears when a
|
|
42
|
+
// tabbed stack is too small to render all tabs. This is the only clue to the user that
|
|
43
|
+
// there are more widgets in the layout!
|
|
44
|
+
color: var(--xh-intent-primary-text-color);
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
}
|
|
@@ -116,6 +118,7 @@
|
|
|
116
118
|
border: none;
|
|
117
119
|
margin: 0;
|
|
118
120
|
height: 30px;
|
|
121
|
+
padding: 0 8px;
|
|
119
122
|
|
|
120
123
|
&:hover {
|
|
121
124
|
background-color: var(--xh-menu-item-highlight-bg);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "80.0.0-SNAPSHOT.
|
|
3
|
+
"version": "80.0.0-SNAPSHOT.1769114224366",
|
|
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",
|