@gravionlabs/helix-desktop 0.0.0-stage → 22.4.0
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/LICENSE.md +21 -0
- package/README.md +25 -2
- package/fesm2022/gravionlabs-helix-desktop-tauri.mjs +470 -0
- package/fesm2022/gravionlabs-helix-desktop-tauri.mjs.map +1 -0
- package/fesm2022/gravionlabs-helix-desktop.mjs +1776 -0
- package/fesm2022/gravionlabs-helix-desktop.mjs.map +1 -0
- package/package.json +61 -4
- package/styles.css +401 -0
- package/types/gravionlabs-helix-desktop-tauri.d.ts +153 -0
- package/types/gravionlabs-helix-desktop.d.ts +528 -0
|
@@ -0,0 +1,1776 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, Directive, ElementRef, booleanAttribute, computed, contentChild, inject, input, model, numberAttribute, output, viewChildren } from "@angular/core";
|
|
4
|
+
import { HxDrawer } from "@gravionlabs/helix-ui";
|
|
5
|
+
var HxActivityBar = class HxActivityBar {
|
|
6
|
+
items = input.required(...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
7
|
+
activeId = input(null, ...ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []);
|
|
8
|
+
expanded = input(true, ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
|
|
9
|
+
label = input("Activity bar", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
10
|
+
selected = output();
|
|
11
|
+
buttons = viewChildren("button", ...ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []);
|
|
12
|
+
groups = computed(() => {
|
|
13
|
+
const items = this.items();
|
|
14
|
+
return [{
|
|
15
|
+
name: "top",
|
|
16
|
+
items: items.filter((i) => i.position !== "bottom")
|
|
17
|
+
}, {
|
|
18
|
+
name: "bottom",
|
|
19
|
+
items: items.filter((i) => i.position === "bottom")
|
|
20
|
+
}].filter((g) => g.items.length > 0);
|
|
21
|
+
}, ...ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []);
|
|
22
|
+
ordered = computed(() => this.groups().flatMap((g) => g.items), ...ngDevMode ? [{ debugName: "ordered" }] : /* istanbul ignore next */ []);
|
|
23
|
+
tabStopId = computed(() => {
|
|
24
|
+
const ordered = this.ordered();
|
|
25
|
+
return ((this.expanded() ? ordered.find((i) => i.id === this.activeId()) : void 0) ?? ordered[0])?.id ?? null;
|
|
26
|
+
}, ...ngDevMode ? [{ debugName: "tabStopId" }] : /* istanbul ignore next */ []);
|
|
27
|
+
isView(item) {
|
|
28
|
+
return item.kind !== "action";
|
|
29
|
+
}
|
|
30
|
+
isActive(item) {
|
|
31
|
+
return this.isView(item) && this.expanded() && item.id === this.activeId();
|
|
32
|
+
}
|
|
33
|
+
asTemplate(icon) {
|
|
34
|
+
return typeof icon === "string" ? null : icon;
|
|
35
|
+
}
|
|
36
|
+
select(item) {
|
|
37
|
+
this.selected.emit(item.id);
|
|
38
|
+
}
|
|
39
|
+
onKeydown(event) {
|
|
40
|
+
const buttons = this.buttons().map((b) => b.nativeElement);
|
|
41
|
+
if (buttons.length === 0) return;
|
|
42
|
+
const current = buttons.indexOf(document.activeElement);
|
|
43
|
+
let next;
|
|
44
|
+
switch (event.key) {
|
|
45
|
+
case "ArrowDown":
|
|
46
|
+
case "ArrowRight":
|
|
47
|
+
next = (current + 1) % buttons.length;
|
|
48
|
+
break;
|
|
49
|
+
case "ArrowUp":
|
|
50
|
+
case "ArrowLeft":
|
|
51
|
+
next = (current - 1 + buttons.length) % buttons.length;
|
|
52
|
+
break;
|
|
53
|
+
case "Home":
|
|
54
|
+
next = 0;
|
|
55
|
+
break;
|
|
56
|
+
case "End":
|
|
57
|
+
next = buttons.length - 1;
|
|
58
|
+
break;
|
|
59
|
+
default: return;
|
|
60
|
+
}
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
buttons[next]?.focus();
|
|
63
|
+
}
|
|
64
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
65
|
+
minVersion: "12.0.0",
|
|
66
|
+
version: "22.2.4",
|
|
67
|
+
ngImport: i0,
|
|
68
|
+
type: HxActivityBar,
|
|
69
|
+
deps: [],
|
|
70
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
71
|
+
});
|
|
72
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
73
|
+
minVersion: "17.0.0",
|
|
74
|
+
version: "22.2.4",
|
|
75
|
+
type: HxActivityBar,
|
|
76
|
+
isStandalone: true,
|
|
77
|
+
selector: "hx-activity-bar",
|
|
78
|
+
inputs: {
|
|
79
|
+
items: {
|
|
80
|
+
classPropertyName: "items",
|
|
81
|
+
publicName: "items",
|
|
82
|
+
isSignal: true,
|
|
83
|
+
isRequired: true,
|
|
84
|
+
transformFunction: null
|
|
85
|
+
},
|
|
86
|
+
activeId: {
|
|
87
|
+
classPropertyName: "activeId",
|
|
88
|
+
publicName: "activeId",
|
|
89
|
+
isSignal: true,
|
|
90
|
+
isRequired: false,
|
|
91
|
+
transformFunction: null
|
|
92
|
+
},
|
|
93
|
+
expanded: {
|
|
94
|
+
classPropertyName: "expanded",
|
|
95
|
+
publicName: "expanded",
|
|
96
|
+
isSignal: true,
|
|
97
|
+
isRequired: false,
|
|
98
|
+
transformFunction: null
|
|
99
|
+
},
|
|
100
|
+
label: {
|
|
101
|
+
classPropertyName: "label",
|
|
102
|
+
publicName: "label",
|
|
103
|
+
isSignal: true,
|
|
104
|
+
isRequired: false,
|
|
105
|
+
transformFunction: null
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
outputs: { selected: "selected" },
|
|
109
|
+
host: {
|
|
110
|
+
attributes: {
|
|
111
|
+
"role": "toolbar",
|
|
112
|
+
"aria-orientation": "vertical"
|
|
113
|
+
},
|
|
114
|
+
listeners: { "keydown": "onKeydown($event)" },
|
|
115
|
+
properties: { "attr.aria-label": "label()" },
|
|
116
|
+
classAttribute: "hx-activity-bar"
|
|
117
|
+
},
|
|
118
|
+
viewQueries: [{
|
|
119
|
+
propertyName: "buttons",
|
|
120
|
+
predicate: ["button"],
|
|
121
|
+
descendants: true,
|
|
122
|
+
isSignal: true
|
|
123
|
+
}],
|
|
124
|
+
ngImport: i0,
|
|
125
|
+
template: `
|
|
126
|
+
@for (group of groups(); track group.name) {
|
|
127
|
+
<div class="hx-activity-bar-group" [class.hx-activity-bar-bottom]="group.name === 'bottom'">
|
|
128
|
+
@for (item of group.items; track item.id) {
|
|
129
|
+
<button
|
|
130
|
+
#button
|
|
131
|
+
type="button"
|
|
132
|
+
class="hx-activity-bar-item"
|
|
133
|
+
[class.hx-activity-bar-active]="isActive(item)"
|
|
134
|
+
[attr.data-id]="item.id"
|
|
135
|
+
[attr.aria-label]="item.label"
|
|
136
|
+
[attr.aria-pressed]="isView(item) ? isActive(item) : null"
|
|
137
|
+
[attr.title]="item.label"
|
|
138
|
+
[attr.tabindex]="item.id === tabStopId() ? 0 : -1"
|
|
139
|
+
(click)="select(item)"
|
|
140
|
+
>
|
|
141
|
+
<span class="hx-activity-bar-icon" aria-hidden="true">
|
|
142
|
+
@if (asTemplate(item.icon); as tpl) {
|
|
143
|
+
<ng-container [ngTemplateOutlet]="tpl" />
|
|
144
|
+
} @else {
|
|
145
|
+
<span [class]="item.icon"></span>
|
|
146
|
+
}
|
|
147
|
+
</span>
|
|
148
|
+
@if (item.badge !== undefined && item.badge !== null) {
|
|
149
|
+
<span
|
|
150
|
+
class="hx-activity-bar-badge"
|
|
151
|
+
[class.hx-activity-bar-badge-dot]="item.badge === true"
|
|
152
|
+
>{{ item.badge === true ? '' : item.badge }}</span
|
|
153
|
+
>
|
|
154
|
+
}
|
|
155
|
+
</button>
|
|
156
|
+
}
|
|
157
|
+
</div>
|
|
158
|
+
}
|
|
159
|
+
`,
|
|
160
|
+
isInline: true,
|
|
161
|
+
dependencies: [{
|
|
162
|
+
kind: "directive",
|
|
163
|
+
type: NgTemplateOutlet,
|
|
164
|
+
selector: "[ngTemplateOutlet]",
|
|
165
|
+
inputs: [
|
|
166
|
+
"ngTemplateOutletContext",
|
|
167
|
+
"ngTemplateOutlet",
|
|
168
|
+
"ngTemplateOutletInjector"
|
|
169
|
+
]
|
|
170
|
+
}],
|
|
171
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
175
|
+
minVersion: "12.0.0",
|
|
176
|
+
version: "22.2.4",
|
|
177
|
+
ngImport: i0,
|
|
178
|
+
type: HxActivityBar,
|
|
179
|
+
decorators: [{
|
|
180
|
+
type: Component,
|
|
181
|
+
args: [{
|
|
182
|
+
selector: "hx-activity-bar",
|
|
183
|
+
imports: [NgTemplateOutlet],
|
|
184
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
185
|
+
host: {
|
|
186
|
+
class: "hx-activity-bar",
|
|
187
|
+
role: "toolbar",
|
|
188
|
+
"aria-orientation": "vertical",
|
|
189
|
+
"[attr.aria-label]": "label()",
|
|
190
|
+
"(keydown)": "onKeydown($event)"
|
|
191
|
+
},
|
|
192
|
+
template: `
|
|
193
|
+
@for (group of groups(); track group.name) {
|
|
194
|
+
<div class="hx-activity-bar-group" [class.hx-activity-bar-bottom]="group.name === 'bottom'">
|
|
195
|
+
@for (item of group.items; track item.id) {
|
|
196
|
+
<button
|
|
197
|
+
#button
|
|
198
|
+
type="button"
|
|
199
|
+
class="hx-activity-bar-item"
|
|
200
|
+
[class.hx-activity-bar-active]="isActive(item)"
|
|
201
|
+
[attr.data-id]="item.id"
|
|
202
|
+
[attr.aria-label]="item.label"
|
|
203
|
+
[attr.aria-pressed]="isView(item) ? isActive(item) : null"
|
|
204
|
+
[attr.title]="item.label"
|
|
205
|
+
[attr.tabindex]="item.id === tabStopId() ? 0 : -1"
|
|
206
|
+
(click)="select(item)"
|
|
207
|
+
>
|
|
208
|
+
<span class="hx-activity-bar-icon" aria-hidden="true">
|
|
209
|
+
@if (asTemplate(item.icon); as tpl) {
|
|
210
|
+
<ng-container [ngTemplateOutlet]="tpl" />
|
|
211
|
+
} @else {
|
|
212
|
+
<span [class]="item.icon"></span>
|
|
213
|
+
}
|
|
214
|
+
</span>
|
|
215
|
+
@if (item.badge !== undefined && item.badge !== null) {
|
|
216
|
+
<span
|
|
217
|
+
class="hx-activity-bar-badge"
|
|
218
|
+
[class.hx-activity-bar-badge-dot]="item.badge === true"
|
|
219
|
+
>{{ item.badge === true ? '' : item.badge }}</span
|
|
220
|
+
>
|
|
221
|
+
}
|
|
222
|
+
</button>
|
|
223
|
+
}
|
|
224
|
+
</div>
|
|
225
|
+
}
|
|
226
|
+
`
|
|
227
|
+
}]
|
|
228
|
+
}],
|
|
229
|
+
propDecorators: {
|
|
230
|
+
items: [{
|
|
231
|
+
type: i0.Input,
|
|
232
|
+
args: [{
|
|
233
|
+
isSignal: true,
|
|
234
|
+
alias: "items",
|
|
235
|
+
required: true
|
|
236
|
+
}]
|
|
237
|
+
}],
|
|
238
|
+
activeId: [{
|
|
239
|
+
type: i0.Input,
|
|
240
|
+
args: [{
|
|
241
|
+
isSignal: true,
|
|
242
|
+
alias: "activeId",
|
|
243
|
+
required: false
|
|
244
|
+
}]
|
|
245
|
+
}],
|
|
246
|
+
expanded: [{
|
|
247
|
+
type: i0.Input,
|
|
248
|
+
args: [{
|
|
249
|
+
isSignal: true,
|
|
250
|
+
alias: "expanded",
|
|
251
|
+
required: false
|
|
252
|
+
}]
|
|
253
|
+
}],
|
|
254
|
+
label: [{
|
|
255
|
+
type: i0.Input,
|
|
256
|
+
args: [{
|
|
257
|
+
isSignal: true,
|
|
258
|
+
alias: "label",
|
|
259
|
+
required: false
|
|
260
|
+
}]
|
|
261
|
+
}],
|
|
262
|
+
selected: [{
|
|
263
|
+
type: i0.Output,
|
|
264
|
+
args: ["selected"]
|
|
265
|
+
}],
|
|
266
|
+
buttons: [{
|
|
267
|
+
type: i0.ViewChildren,
|
|
268
|
+
args: ["button", { isSignal: true }]
|
|
269
|
+
}]
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
var HxAppShell = class HxAppShell {
|
|
273
|
+
sidebarWidth = model(260, ...ngDevMode ? [{ debugName: "sidebarWidth" }] : /* istanbul ignore next */ []);
|
|
274
|
+
collapsed = model(false, ...ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []);
|
|
275
|
+
activeId = model(null, ...ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []);
|
|
276
|
+
minWidth = input(160, {
|
|
277
|
+
...ngDevMode ? { debugName: "minWidth" } : /* istanbul ignore next */ {},
|
|
278
|
+
transform: numberAttribute
|
|
279
|
+
});
|
|
280
|
+
maxWidth = input(480, {
|
|
281
|
+
...ngDevMode ? { debugName: "maxWidth" } : /* istanbul ignore next */ {},
|
|
282
|
+
transform: numberAttribute
|
|
283
|
+
});
|
|
284
|
+
step = input(16, {
|
|
285
|
+
...ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {},
|
|
286
|
+
transform: numberAttribute
|
|
287
|
+
});
|
|
288
|
+
resizerLabel = input("Resize sidebar", ...ngDevMode ? [{ debugName: "resizerLabel" }] : /* istanbul ignore next */ []);
|
|
289
|
+
fixedWidth = input(false, {
|
|
290
|
+
...ngDevMode ? { debugName: "fixedWidth" } : /* istanbul ignore next */ {},
|
|
291
|
+
transform: booleanAttribute
|
|
292
|
+
});
|
|
293
|
+
sidebarChange = output();
|
|
294
|
+
width = computed(() => this.clamp(this.sidebarWidth()), ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
|
|
295
|
+
dragStartX = 0;
|
|
296
|
+
dragStartWidth = 0;
|
|
297
|
+
dragging = false;
|
|
298
|
+
selectView(id) {
|
|
299
|
+
if (id === this.activeId() && !this.collapsed()) this.collapsed.set(true);
|
|
300
|
+
else {
|
|
301
|
+
this.activeId.set(id);
|
|
302
|
+
this.collapsed.set(false);
|
|
303
|
+
}
|
|
304
|
+
this.report();
|
|
305
|
+
}
|
|
306
|
+
resizeTo(width) {
|
|
307
|
+
const next = this.clamp(width);
|
|
308
|
+
if (next === this.sidebarWidth()) return;
|
|
309
|
+
this.sidebarWidth.set(next);
|
|
310
|
+
this.report();
|
|
311
|
+
}
|
|
312
|
+
onPointerDown(event) {
|
|
313
|
+
if (this.fixedWidth() || event.button > 0) return;
|
|
314
|
+
this.dragging = true;
|
|
315
|
+
this.dragStartX = event.clientX;
|
|
316
|
+
this.dragStartWidth = this.width();
|
|
317
|
+
event.target.setPointerCapture?.(event.pointerId);
|
|
318
|
+
event.preventDefault();
|
|
319
|
+
}
|
|
320
|
+
onPointerMove(event) {
|
|
321
|
+
if (!this.dragging) return;
|
|
322
|
+
const rtl = getComputedStyle(event.target).direction === "rtl";
|
|
323
|
+
const delta = event.clientX - this.dragStartX;
|
|
324
|
+
this.resizeTo(this.dragStartWidth + (rtl ? -delta : delta));
|
|
325
|
+
}
|
|
326
|
+
onPointerEnd(event) {
|
|
327
|
+
if (!this.dragging) return;
|
|
328
|
+
this.dragging = false;
|
|
329
|
+
event.target.releasePointerCapture?.(event.pointerId);
|
|
330
|
+
}
|
|
331
|
+
onKeydown(event) {
|
|
332
|
+
if (this.fixedWidth()) return;
|
|
333
|
+
const step = this.step() * (event.shiftKey ? 4 : 1);
|
|
334
|
+
const rtl = getComputedStyle(event.target).direction === "rtl";
|
|
335
|
+
switch (event.key) {
|
|
336
|
+
case "ArrowLeft":
|
|
337
|
+
this.resizeTo(this.width() + (rtl ? step : -step));
|
|
338
|
+
break;
|
|
339
|
+
case "ArrowRight":
|
|
340
|
+
this.resizeTo(this.width() + (rtl ? -step : step));
|
|
341
|
+
break;
|
|
342
|
+
case "Home":
|
|
343
|
+
this.resizeTo(this.minWidth());
|
|
344
|
+
break;
|
|
345
|
+
case "End":
|
|
346
|
+
this.resizeTo(this.maxWidth());
|
|
347
|
+
break;
|
|
348
|
+
default: return;
|
|
349
|
+
}
|
|
350
|
+
event.preventDefault();
|
|
351
|
+
}
|
|
352
|
+
clamp(width) {
|
|
353
|
+
return Math.min(this.maxWidth(), Math.max(this.minWidth(), Math.round(width)));
|
|
354
|
+
}
|
|
355
|
+
report() {
|
|
356
|
+
this.sidebarChange.emit({
|
|
357
|
+
width: this.width(),
|
|
358
|
+
collapsed: this.collapsed()
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
362
|
+
minVersion: "12.0.0",
|
|
363
|
+
version: "22.2.4",
|
|
364
|
+
ngImport: i0,
|
|
365
|
+
type: HxAppShell,
|
|
366
|
+
deps: [],
|
|
367
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
368
|
+
});
|
|
369
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
370
|
+
minVersion: "17.0.0",
|
|
371
|
+
version: "22.2.4",
|
|
372
|
+
type: HxAppShell,
|
|
373
|
+
isStandalone: true,
|
|
374
|
+
selector: "hx-app-shell",
|
|
375
|
+
inputs: {
|
|
376
|
+
sidebarWidth: {
|
|
377
|
+
classPropertyName: "sidebarWidth",
|
|
378
|
+
publicName: "sidebarWidth",
|
|
379
|
+
isSignal: true,
|
|
380
|
+
isRequired: false,
|
|
381
|
+
transformFunction: null
|
|
382
|
+
},
|
|
383
|
+
collapsed: {
|
|
384
|
+
classPropertyName: "collapsed",
|
|
385
|
+
publicName: "collapsed",
|
|
386
|
+
isSignal: true,
|
|
387
|
+
isRequired: false,
|
|
388
|
+
transformFunction: null
|
|
389
|
+
},
|
|
390
|
+
activeId: {
|
|
391
|
+
classPropertyName: "activeId",
|
|
392
|
+
publicName: "activeId",
|
|
393
|
+
isSignal: true,
|
|
394
|
+
isRequired: false,
|
|
395
|
+
transformFunction: null
|
|
396
|
+
},
|
|
397
|
+
minWidth: {
|
|
398
|
+
classPropertyName: "minWidth",
|
|
399
|
+
publicName: "minWidth",
|
|
400
|
+
isSignal: true,
|
|
401
|
+
isRequired: false,
|
|
402
|
+
transformFunction: null
|
|
403
|
+
},
|
|
404
|
+
maxWidth: {
|
|
405
|
+
classPropertyName: "maxWidth",
|
|
406
|
+
publicName: "maxWidth",
|
|
407
|
+
isSignal: true,
|
|
408
|
+
isRequired: false,
|
|
409
|
+
transformFunction: null
|
|
410
|
+
},
|
|
411
|
+
step: {
|
|
412
|
+
classPropertyName: "step",
|
|
413
|
+
publicName: "step",
|
|
414
|
+
isSignal: true,
|
|
415
|
+
isRequired: false,
|
|
416
|
+
transformFunction: null
|
|
417
|
+
},
|
|
418
|
+
resizerLabel: {
|
|
419
|
+
classPropertyName: "resizerLabel",
|
|
420
|
+
publicName: "resizerLabel",
|
|
421
|
+
isSignal: true,
|
|
422
|
+
isRequired: false,
|
|
423
|
+
transformFunction: null
|
|
424
|
+
},
|
|
425
|
+
fixedWidth: {
|
|
426
|
+
classPropertyName: "fixedWidth",
|
|
427
|
+
publicName: "fixedWidth",
|
|
428
|
+
isSignal: true,
|
|
429
|
+
isRequired: false,
|
|
430
|
+
transformFunction: null
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
outputs: {
|
|
434
|
+
sidebarWidth: "sidebarWidthChange",
|
|
435
|
+
collapsed: "collapsedChange",
|
|
436
|
+
activeId: "activeIdChange",
|
|
437
|
+
sidebarChange: "sidebarChange"
|
|
438
|
+
},
|
|
439
|
+
host: { classAttribute: "hx-app-shell" },
|
|
440
|
+
ngImport: i0,
|
|
441
|
+
template: `
|
|
442
|
+
<ng-content select="[slot=toolbar]" />
|
|
443
|
+
<div class="hx-app-shell-body">
|
|
444
|
+
<ng-content select="[slot=activity]" />
|
|
445
|
+
<div
|
|
446
|
+
class="hx-app-shell-sidebar"
|
|
447
|
+
[hidden]="collapsed()"
|
|
448
|
+
[style.width.px]="width()"
|
|
449
|
+
>
|
|
450
|
+
<ng-content select="[slot=sidebar]" />
|
|
451
|
+
</div>
|
|
452
|
+
@if (!collapsed()) {
|
|
453
|
+
<div
|
|
454
|
+
class="hx-app-shell-resizer"
|
|
455
|
+
role="separator"
|
|
456
|
+
aria-orientation="vertical"
|
|
457
|
+
tabindex="0"
|
|
458
|
+
[attr.aria-label]="resizerLabel()"
|
|
459
|
+
[attr.aria-valuenow]="width()"
|
|
460
|
+
[attr.aria-valuemin]="minWidth()"
|
|
461
|
+
[attr.aria-valuemax]="maxWidth()"
|
|
462
|
+
(pointerdown)="onPointerDown($event)"
|
|
463
|
+
(pointermove)="onPointerMove($event)"
|
|
464
|
+
(pointerup)="onPointerEnd($event)"
|
|
465
|
+
(pointercancel)="onPointerEnd($event)"
|
|
466
|
+
(keydown)="onKeydown($event)"
|
|
467
|
+
></div>
|
|
468
|
+
}
|
|
469
|
+
<main class="hx-app-shell-content"><ng-content /></main>
|
|
470
|
+
<ng-content select="[slot=panel]" />
|
|
471
|
+
</div>
|
|
472
|
+
<ng-content select="[slot=status]" />
|
|
473
|
+
`,
|
|
474
|
+
isInline: true,
|
|
475
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
476
|
+
});
|
|
477
|
+
};
|
|
478
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
479
|
+
minVersion: "12.0.0",
|
|
480
|
+
version: "22.2.4",
|
|
481
|
+
ngImport: i0,
|
|
482
|
+
type: HxAppShell,
|
|
483
|
+
decorators: [{
|
|
484
|
+
type: Component,
|
|
485
|
+
args: [{
|
|
486
|
+
selector: "hx-app-shell",
|
|
487
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
488
|
+
host: { class: "hx-app-shell" },
|
|
489
|
+
template: `
|
|
490
|
+
<ng-content select="[slot=toolbar]" />
|
|
491
|
+
<div class="hx-app-shell-body">
|
|
492
|
+
<ng-content select="[slot=activity]" />
|
|
493
|
+
<div
|
|
494
|
+
class="hx-app-shell-sidebar"
|
|
495
|
+
[hidden]="collapsed()"
|
|
496
|
+
[style.width.px]="width()"
|
|
497
|
+
>
|
|
498
|
+
<ng-content select="[slot=sidebar]" />
|
|
499
|
+
</div>
|
|
500
|
+
@if (!collapsed()) {
|
|
501
|
+
<div
|
|
502
|
+
class="hx-app-shell-resizer"
|
|
503
|
+
role="separator"
|
|
504
|
+
aria-orientation="vertical"
|
|
505
|
+
tabindex="0"
|
|
506
|
+
[attr.aria-label]="resizerLabel()"
|
|
507
|
+
[attr.aria-valuenow]="width()"
|
|
508
|
+
[attr.aria-valuemin]="minWidth()"
|
|
509
|
+
[attr.aria-valuemax]="maxWidth()"
|
|
510
|
+
(pointerdown)="onPointerDown($event)"
|
|
511
|
+
(pointermove)="onPointerMove($event)"
|
|
512
|
+
(pointerup)="onPointerEnd($event)"
|
|
513
|
+
(pointercancel)="onPointerEnd($event)"
|
|
514
|
+
(keydown)="onKeydown($event)"
|
|
515
|
+
></div>
|
|
516
|
+
}
|
|
517
|
+
<main class="hx-app-shell-content"><ng-content /></main>
|
|
518
|
+
<ng-content select="[slot=panel]" />
|
|
519
|
+
</div>
|
|
520
|
+
<ng-content select="[slot=status]" />
|
|
521
|
+
`
|
|
522
|
+
}]
|
|
523
|
+
}],
|
|
524
|
+
propDecorators: {
|
|
525
|
+
sidebarWidth: [{
|
|
526
|
+
type: i0.Input,
|
|
527
|
+
args: [{
|
|
528
|
+
isSignal: true,
|
|
529
|
+
alias: "sidebarWidth",
|
|
530
|
+
required: false
|
|
531
|
+
}]
|
|
532
|
+
}, {
|
|
533
|
+
type: i0.Output,
|
|
534
|
+
args: ["sidebarWidthChange"]
|
|
535
|
+
}],
|
|
536
|
+
collapsed: [{
|
|
537
|
+
type: i0.Input,
|
|
538
|
+
args: [{
|
|
539
|
+
isSignal: true,
|
|
540
|
+
alias: "collapsed",
|
|
541
|
+
required: false
|
|
542
|
+
}]
|
|
543
|
+
}, {
|
|
544
|
+
type: i0.Output,
|
|
545
|
+
args: ["collapsedChange"]
|
|
546
|
+
}],
|
|
547
|
+
activeId: [{
|
|
548
|
+
type: i0.Input,
|
|
549
|
+
args: [{
|
|
550
|
+
isSignal: true,
|
|
551
|
+
alias: "activeId",
|
|
552
|
+
required: false
|
|
553
|
+
}]
|
|
554
|
+
}, {
|
|
555
|
+
type: i0.Output,
|
|
556
|
+
args: ["activeIdChange"]
|
|
557
|
+
}],
|
|
558
|
+
minWidth: [{
|
|
559
|
+
type: i0.Input,
|
|
560
|
+
args: [{
|
|
561
|
+
isSignal: true,
|
|
562
|
+
alias: "minWidth",
|
|
563
|
+
required: false
|
|
564
|
+
}]
|
|
565
|
+
}],
|
|
566
|
+
maxWidth: [{
|
|
567
|
+
type: i0.Input,
|
|
568
|
+
args: [{
|
|
569
|
+
isSignal: true,
|
|
570
|
+
alias: "maxWidth",
|
|
571
|
+
required: false
|
|
572
|
+
}]
|
|
573
|
+
}],
|
|
574
|
+
step: [{
|
|
575
|
+
type: i0.Input,
|
|
576
|
+
args: [{
|
|
577
|
+
isSignal: true,
|
|
578
|
+
alias: "step",
|
|
579
|
+
required: false
|
|
580
|
+
}]
|
|
581
|
+
}],
|
|
582
|
+
resizerLabel: [{
|
|
583
|
+
type: i0.Input,
|
|
584
|
+
args: [{
|
|
585
|
+
isSignal: true,
|
|
586
|
+
alias: "resizerLabel",
|
|
587
|
+
required: false
|
|
588
|
+
}]
|
|
589
|
+
}],
|
|
590
|
+
fixedWidth: [{
|
|
591
|
+
type: i0.Input,
|
|
592
|
+
args: [{
|
|
593
|
+
isSignal: true,
|
|
594
|
+
alias: "fixedWidth",
|
|
595
|
+
required: false
|
|
596
|
+
}]
|
|
597
|
+
}],
|
|
598
|
+
sidebarChange: [{
|
|
599
|
+
type: i0.Output,
|
|
600
|
+
args: ["sidebarChange"]
|
|
601
|
+
}]
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
var HxAppToolbar = class HxAppToolbar {
|
|
605
|
+
windowButtonsInset = input(false, {
|
|
606
|
+
...ngDevMode ? { debugName: "windowButtonsInset" } : /* istanbul ignore next */ {},
|
|
607
|
+
transform: booleanAttribute
|
|
608
|
+
});
|
|
609
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
610
|
+
minVersion: "12.0.0",
|
|
611
|
+
version: "22.2.4",
|
|
612
|
+
ngImport: i0,
|
|
613
|
+
type: HxAppToolbar,
|
|
614
|
+
deps: [],
|
|
615
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
616
|
+
});
|
|
617
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
618
|
+
minVersion: "17.1.0",
|
|
619
|
+
version: "22.2.4",
|
|
620
|
+
type: HxAppToolbar,
|
|
621
|
+
isStandalone: true,
|
|
622
|
+
selector: "hx-app-toolbar",
|
|
623
|
+
inputs: { windowButtonsInset: {
|
|
624
|
+
classPropertyName: "windowButtonsInset",
|
|
625
|
+
publicName: "windowButtonsInset",
|
|
626
|
+
isSignal: true,
|
|
627
|
+
isRequired: false,
|
|
628
|
+
transformFunction: null
|
|
629
|
+
} },
|
|
630
|
+
host: {
|
|
631
|
+
attributes: { "data-tauri-drag-region": "" },
|
|
632
|
+
properties: { "class.hx-app-toolbar-inset": "windowButtonsInset()" },
|
|
633
|
+
classAttribute: "hx-app-toolbar"
|
|
634
|
+
},
|
|
635
|
+
ngImport: i0,
|
|
636
|
+
template: `
|
|
637
|
+
<div class="hx-app-toolbar-start"><ng-content select="[slot=start]" /></div>
|
|
638
|
+
<div class="hx-app-toolbar-centre" data-tauri-drag-region><ng-content select="[slot=centre]" /></div>
|
|
639
|
+
<div class="hx-app-toolbar-end"><ng-content select="[slot=end]" /></div>
|
|
640
|
+
`,
|
|
641
|
+
isInline: true,
|
|
642
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
643
|
+
});
|
|
644
|
+
};
|
|
645
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
646
|
+
minVersion: "12.0.0",
|
|
647
|
+
version: "22.2.4",
|
|
648
|
+
ngImport: i0,
|
|
649
|
+
type: HxAppToolbar,
|
|
650
|
+
decorators: [{
|
|
651
|
+
type: Component,
|
|
652
|
+
args: [{
|
|
653
|
+
selector: "hx-app-toolbar",
|
|
654
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
655
|
+
host: {
|
|
656
|
+
class: "hx-app-toolbar",
|
|
657
|
+
"[class.hx-app-toolbar-inset]": "windowButtonsInset()",
|
|
658
|
+
"data-tauri-drag-region": ""
|
|
659
|
+
},
|
|
660
|
+
template: `
|
|
661
|
+
<div class="hx-app-toolbar-start"><ng-content select="[slot=start]" /></div>
|
|
662
|
+
<div class="hx-app-toolbar-centre" data-tauri-drag-region><ng-content select="[slot=centre]" /></div>
|
|
663
|
+
<div class="hx-app-toolbar-end"><ng-content select="[slot=end]" /></div>
|
|
664
|
+
`
|
|
665
|
+
}]
|
|
666
|
+
}],
|
|
667
|
+
propDecorators: { windowButtonsInset: [{
|
|
668
|
+
type: i0.Input,
|
|
669
|
+
args: [{
|
|
670
|
+
isSignal: true,
|
|
671
|
+
alias: "windowButtonsInset",
|
|
672
|
+
required: false
|
|
673
|
+
}]
|
|
674
|
+
}] }
|
|
675
|
+
});
|
|
676
|
+
const HX_BOTTOM_BAR_MAX_ITEMS = 5;
|
|
677
|
+
var HxBottomBar = class HxBottomBar {
|
|
678
|
+
items = input.required(...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
679
|
+
activeId = input(null, ...ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []);
|
|
680
|
+
label = input("Views", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
681
|
+
selected = output();
|
|
682
|
+
visible = computed(() => this.items().slice(0, 5), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
|
|
683
|
+
isActive(item) {
|
|
684
|
+
return item.kind !== "action" && item.id === this.activeId();
|
|
685
|
+
}
|
|
686
|
+
asTemplate(icon) {
|
|
687
|
+
return typeof icon === "string" ? null : icon;
|
|
688
|
+
}
|
|
689
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
690
|
+
minVersion: "12.0.0",
|
|
691
|
+
version: "22.2.4",
|
|
692
|
+
ngImport: i0,
|
|
693
|
+
type: HxBottomBar,
|
|
694
|
+
deps: [],
|
|
695
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
696
|
+
});
|
|
697
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
698
|
+
minVersion: "17.0.0",
|
|
699
|
+
version: "22.2.4",
|
|
700
|
+
type: HxBottomBar,
|
|
701
|
+
isStandalone: true,
|
|
702
|
+
selector: "hx-bottom-bar",
|
|
703
|
+
inputs: {
|
|
704
|
+
items: {
|
|
705
|
+
classPropertyName: "items",
|
|
706
|
+
publicName: "items",
|
|
707
|
+
isSignal: true,
|
|
708
|
+
isRequired: true,
|
|
709
|
+
transformFunction: null
|
|
710
|
+
},
|
|
711
|
+
activeId: {
|
|
712
|
+
classPropertyName: "activeId",
|
|
713
|
+
publicName: "activeId",
|
|
714
|
+
isSignal: true,
|
|
715
|
+
isRequired: false,
|
|
716
|
+
transformFunction: null
|
|
717
|
+
},
|
|
718
|
+
label: {
|
|
719
|
+
classPropertyName: "label",
|
|
720
|
+
publicName: "label",
|
|
721
|
+
isSignal: true,
|
|
722
|
+
isRequired: false,
|
|
723
|
+
transformFunction: null
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
outputs: { selected: "selected" },
|
|
727
|
+
host: {
|
|
728
|
+
attributes: { "role": "toolbar" },
|
|
729
|
+
properties: { "attr.aria-label": "label()" },
|
|
730
|
+
classAttribute: "hx-bottom-bar"
|
|
731
|
+
},
|
|
732
|
+
ngImport: i0,
|
|
733
|
+
template: `
|
|
734
|
+
@for (item of visible(); track item.id) {
|
|
735
|
+
<button
|
|
736
|
+
type="button"
|
|
737
|
+
class="hx-bottom-bar-item"
|
|
738
|
+
[class.hx-bottom-bar-active]="isActive(item)"
|
|
739
|
+
[attr.data-id]="item.id"
|
|
740
|
+
[attr.aria-label]="item.label"
|
|
741
|
+
[attr.aria-pressed]="item.kind === 'action' ? null : isActive(item)"
|
|
742
|
+
(click)="selected.emit(item.id)"
|
|
743
|
+
>
|
|
744
|
+
<span class="hx-bottom-bar-icon" aria-hidden="true">
|
|
745
|
+
@if (asTemplate(item.icon); as tpl) {
|
|
746
|
+
<ng-container [ngTemplateOutlet]="tpl" />
|
|
747
|
+
} @else {
|
|
748
|
+
<span [class]="item.icon"></span>
|
|
749
|
+
}
|
|
750
|
+
</span>
|
|
751
|
+
<span class="hx-bottom-bar-label">{{ item.label }}</span>
|
|
752
|
+
@if (item.badge !== undefined && item.badge !== null) {
|
|
753
|
+
<span class="hx-bottom-bar-badge" [class.hx-bottom-bar-badge-dot]="item.badge === true">{{
|
|
754
|
+
item.badge === true ? '' : item.badge
|
|
755
|
+
}}</span>
|
|
756
|
+
}
|
|
757
|
+
</button>
|
|
758
|
+
}
|
|
759
|
+
`,
|
|
760
|
+
isInline: true,
|
|
761
|
+
dependencies: [{
|
|
762
|
+
kind: "directive",
|
|
763
|
+
type: NgTemplateOutlet,
|
|
764
|
+
selector: "[ngTemplateOutlet]",
|
|
765
|
+
inputs: [
|
|
766
|
+
"ngTemplateOutletContext",
|
|
767
|
+
"ngTemplateOutlet",
|
|
768
|
+
"ngTemplateOutletInjector"
|
|
769
|
+
]
|
|
770
|
+
}],
|
|
771
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
772
|
+
});
|
|
773
|
+
};
|
|
774
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
775
|
+
minVersion: "12.0.0",
|
|
776
|
+
version: "22.2.4",
|
|
777
|
+
ngImport: i0,
|
|
778
|
+
type: HxBottomBar,
|
|
779
|
+
decorators: [{
|
|
780
|
+
type: Component,
|
|
781
|
+
args: [{
|
|
782
|
+
selector: "hx-bottom-bar",
|
|
783
|
+
imports: [NgTemplateOutlet],
|
|
784
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
785
|
+
host: {
|
|
786
|
+
class: "hx-bottom-bar",
|
|
787
|
+
role: "toolbar",
|
|
788
|
+
"[attr.aria-label]": "label()"
|
|
789
|
+
},
|
|
790
|
+
template: `
|
|
791
|
+
@for (item of visible(); track item.id) {
|
|
792
|
+
<button
|
|
793
|
+
type="button"
|
|
794
|
+
class="hx-bottom-bar-item"
|
|
795
|
+
[class.hx-bottom-bar-active]="isActive(item)"
|
|
796
|
+
[attr.data-id]="item.id"
|
|
797
|
+
[attr.aria-label]="item.label"
|
|
798
|
+
[attr.aria-pressed]="item.kind === 'action' ? null : isActive(item)"
|
|
799
|
+
(click)="selected.emit(item.id)"
|
|
800
|
+
>
|
|
801
|
+
<span class="hx-bottom-bar-icon" aria-hidden="true">
|
|
802
|
+
@if (asTemplate(item.icon); as tpl) {
|
|
803
|
+
<ng-container [ngTemplateOutlet]="tpl" />
|
|
804
|
+
} @else {
|
|
805
|
+
<span [class]="item.icon"></span>
|
|
806
|
+
}
|
|
807
|
+
</span>
|
|
808
|
+
<span class="hx-bottom-bar-label">{{ item.label }}</span>
|
|
809
|
+
@if (item.badge !== undefined && item.badge !== null) {
|
|
810
|
+
<span class="hx-bottom-bar-badge" [class.hx-bottom-bar-badge-dot]="item.badge === true">{{
|
|
811
|
+
item.badge === true ? '' : item.badge
|
|
812
|
+
}}</span>
|
|
813
|
+
}
|
|
814
|
+
</button>
|
|
815
|
+
}
|
|
816
|
+
`
|
|
817
|
+
}]
|
|
818
|
+
}],
|
|
819
|
+
propDecorators: {
|
|
820
|
+
items: [{
|
|
821
|
+
type: i0.Input,
|
|
822
|
+
args: [{
|
|
823
|
+
isSignal: true,
|
|
824
|
+
alias: "items",
|
|
825
|
+
required: true
|
|
826
|
+
}]
|
|
827
|
+
}],
|
|
828
|
+
activeId: [{
|
|
829
|
+
type: i0.Input,
|
|
830
|
+
args: [{
|
|
831
|
+
isSignal: true,
|
|
832
|
+
alias: "activeId",
|
|
833
|
+
required: false
|
|
834
|
+
}]
|
|
835
|
+
}],
|
|
836
|
+
label: [{
|
|
837
|
+
type: i0.Input,
|
|
838
|
+
args: [{
|
|
839
|
+
isSignal: true,
|
|
840
|
+
alias: "label",
|
|
841
|
+
required: false
|
|
842
|
+
}]
|
|
843
|
+
}],
|
|
844
|
+
selected: [{
|
|
845
|
+
type: i0.Output,
|
|
846
|
+
args: ["selected"]
|
|
847
|
+
}]
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
const SWIPE_DISTANCE = 48;
|
|
851
|
+
var HxMobileShell = class HxMobileShell {
|
|
852
|
+
items = input.required(...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
853
|
+
activeId = model(null, ...ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []);
|
|
854
|
+
drawerOpen = model(false, ...ngDevMode ? [{ debugName: "drawerOpen" }] : /* istanbul ignore next */ []);
|
|
855
|
+
heading = input("", ...ngDevMode ? [{ debugName: "heading" }] : /* istanbul ignore next */ []);
|
|
856
|
+
menuLabel = input("Menu", ...ngDevMode ? [{ debugName: "menuLabel" }] : /* istanbul ignore next */ []);
|
|
857
|
+
closeLabel = input("Close", ...ngDevMode ? [{ debugName: "closeLabel" }] : /* istanbul ignore next */ []);
|
|
858
|
+
barLabel = input("Views", ...ngDevMode ? [{ debugName: "barLabel" }] : /* istanbul ignore next */ []);
|
|
859
|
+
touchX = null;
|
|
860
|
+
chooseView(id) {
|
|
861
|
+
this.activeId.set(id);
|
|
862
|
+
this.drawerOpen.set(false);
|
|
863
|
+
}
|
|
864
|
+
onBarSelect(id) {
|
|
865
|
+
if (this.items().find((i) => i.id === id)?.kind !== "action") this.activeId.set(id);
|
|
866
|
+
this.drawerOpen.set(false);
|
|
867
|
+
}
|
|
868
|
+
onTouchStart(event) {
|
|
869
|
+
this.touchX = event.changedTouches[0]?.clientX ?? null;
|
|
870
|
+
}
|
|
871
|
+
onTouchEnd(event) {
|
|
872
|
+
const start = this.touchX;
|
|
873
|
+
this.touchX = null;
|
|
874
|
+
const end = event.changedTouches[0]?.clientX;
|
|
875
|
+
if (start === null || end === void 0) return;
|
|
876
|
+
const rtl = getComputedStyle(event.target).direction === "rtl";
|
|
877
|
+
const delta = end - start;
|
|
878
|
+
if (rtl ? delta >= SWIPE_DISTANCE : delta <= -48) this.drawerOpen.set(false);
|
|
879
|
+
}
|
|
880
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
881
|
+
minVersion: "12.0.0",
|
|
882
|
+
version: "22.2.4",
|
|
883
|
+
ngImport: i0,
|
|
884
|
+
type: HxMobileShell,
|
|
885
|
+
deps: [],
|
|
886
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
887
|
+
});
|
|
888
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
889
|
+
minVersion: "17.1.0",
|
|
890
|
+
version: "22.2.4",
|
|
891
|
+
type: HxMobileShell,
|
|
892
|
+
isStandalone: true,
|
|
893
|
+
selector: "hx-mobile-shell",
|
|
894
|
+
inputs: {
|
|
895
|
+
items: {
|
|
896
|
+
classPropertyName: "items",
|
|
897
|
+
publicName: "items",
|
|
898
|
+
isSignal: true,
|
|
899
|
+
isRequired: true,
|
|
900
|
+
transformFunction: null
|
|
901
|
+
},
|
|
902
|
+
activeId: {
|
|
903
|
+
classPropertyName: "activeId",
|
|
904
|
+
publicName: "activeId",
|
|
905
|
+
isSignal: true,
|
|
906
|
+
isRequired: false,
|
|
907
|
+
transformFunction: null
|
|
908
|
+
},
|
|
909
|
+
drawerOpen: {
|
|
910
|
+
classPropertyName: "drawerOpen",
|
|
911
|
+
publicName: "drawerOpen",
|
|
912
|
+
isSignal: true,
|
|
913
|
+
isRequired: false,
|
|
914
|
+
transformFunction: null
|
|
915
|
+
},
|
|
916
|
+
heading: {
|
|
917
|
+
classPropertyName: "heading",
|
|
918
|
+
publicName: "heading",
|
|
919
|
+
isSignal: true,
|
|
920
|
+
isRequired: false,
|
|
921
|
+
transformFunction: null
|
|
922
|
+
},
|
|
923
|
+
menuLabel: {
|
|
924
|
+
classPropertyName: "menuLabel",
|
|
925
|
+
publicName: "menuLabel",
|
|
926
|
+
isSignal: true,
|
|
927
|
+
isRequired: false,
|
|
928
|
+
transformFunction: null
|
|
929
|
+
},
|
|
930
|
+
closeLabel: {
|
|
931
|
+
classPropertyName: "closeLabel",
|
|
932
|
+
publicName: "closeLabel",
|
|
933
|
+
isSignal: true,
|
|
934
|
+
isRequired: false,
|
|
935
|
+
transformFunction: null
|
|
936
|
+
},
|
|
937
|
+
barLabel: {
|
|
938
|
+
classPropertyName: "barLabel",
|
|
939
|
+
publicName: "barLabel",
|
|
940
|
+
isSignal: true,
|
|
941
|
+
isRequired: false,
|
|
942
|
+
transformFunction: null
|
|
943
|
+
}
|
|
944
|
+
},
|
|
945
|
+
outputs: {
|
|
946
|
+
activeId: "activeIdChange",
|
|
947
|
+
drawerOpen: "drawerOpenChange"
|
|
948
|
+
},
|
|
949
|
+
host: { classAttribute: "hx-mobile-shell" },
|
|
950
|
+
ngImport: i0,
|
|
951
|
+
template: `
|
|
952
|
+
<header class="hx-mobile-shell-bar">
|
|
953
|
+
<button
|
|
954
|
+
type="button"
|
|
955
|
+
class="hx-mobile-shell-menu"
|
|
956
|
+
[attr.aria-label]="menuLabel()"
|
|
957
|
+
aria-haspopup="dialog"
|
|
958
|
+
[attr.aria-expanded]="drawerOpen()"
|
|
959
|
+
(click)="drawerOpen.set(true)"
|
|
960
|
+
>
|
|
961
|
+
<span aria-hidden="true">☰</span>
|
|
962
|
+
</button>
|
|
963
|
+
<span class="hx-mobile-shell-title">{{ heading() }}</span>
|
|
964
|
+
<ng-content select="[slot=end]" />
|
|
965
|
+
</header>
|
|
966
|
+
<main class="hx-mobile-shell-content"><ng-content /></main>
|
|
967
|
+
<hx-bottom-bar [items]="items()" [activeId]="activeId()" [label]="barLabel()" (selected)="onBarSelect($event)" />
|
|
968
|
+
<hx-drawer
|
|
969
|
+
[(visible)]="drawerOpen"
|
|
970
|
+
position="left"
|
|
971
|
+
[ariaLabel]="menuLabel()"
|
|
972
|
+
[closeLabel]="closeLabel()"
|
|
973
|
+
width="min(20rem, 85vw)"
|
|
974
|
+
panelClass="hx-mobile-shell-drawer"
|
|
975
|
+
>
|
|
976
|
+
<div
|
|
977
|
+
class="hx-mobile-shell-drawer-body"
|
|
978
|
+
(touchstart)="onTouchStart($event)"
|
|
979
|
+
(touchend)="onTouchEnd($event)"
|
|
980
|
+
>
|
|
981
|
+
<ng-content select="[slot=drawer]" />
|
|
982
|
+
</div>
|
|
983
|
+
</hx-drawer>
|
|
984
|
+
`,
|
|
985
|
+
isInline: true,
|
|
986
|
+
dependencies: [{
|
|
987
|
+
kind: "component",
|
|
988
|
+
type: HxBottomBar,
|
|
989
|
+
selector: "hx-bottom-bar",
|
|
990
|
+
inputs: [
|
|
991
|
+
"items",
|
|
992
|
+
"activeId",
|
|
993
|
+
"label"
|
|
994
|
+
],
|
|
995
|
+
outputs: ["selected"]
|
|
996
|
+
}, {
|
|
997
|
+
kind: "component",
|
|
998
|
+
type: HxDrawer,
|
|
999
|
+
selector: "hx-drawer",
|
|
1000
|
+
inputs: [
|
|
1001
|
+
"visible",
|
|
1002
|
+
"header",
|
|
1003
|
+
"position",
|
|
1004
|
+
"modal",
|
|
1005
|
+
"dismissable",
|
|
1006
|
+
"closable",
|
|
1007
|
+
"closeOnEscape",
|
|
1008
|
+
"fullScreen",
|
|
1009
|
+
"width",
|
|
1010
|
+
"height",
|
|
1011
|
+
"panelClass",
|
|
1012
|
+
"closeLabel",
|
|
1013
|
+
"ariaLabel"
|
|
1014
|
+
],
|
|
1015
|
+
outputs: [
|
|
1016
|
+
"visibleChange",
|
|
1017
|
+
"shown",
|
|
1018
|
+
"hidden"
|
|
1019
|
+
]
|
|
1020
|
+
}],
|
|
1021
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1022
|
+
});
|
|
1023
|
+
};
|
|
1024
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1025
|
+
minVersion: "12.0.0",
|
|
1026
|
+
version: "22.2.4",
|
|
1027
|
+
ngImport: i0,
|
|
1028
|
+
type: HxMobileShell,
|
|
1029
|
+
decorators: [{
|
|
1030
|
+
type: Component,
|
|
1031
|
+
args: [{
|
|
1032
|
+
selector: "hx-mobile-shell",
|
|
1033
|
+
imports: [HxBottomBar, HxDrawer],
|
|
1034
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1035
|
+
host: { class: "hx-mobile-shell" },
|
|
1036
|
+
template: `
|
|
1037
|
+
<header class="hx-mobile-shell-bar">
|
|
1038
|
+
<button
|
|
1039
|
+
type="button"
|
|
1040
|
+
class="hx-mobile-shell-menu"
|
|
1041
|
+
[attr.aria-label]="menuLabel()"
|
|
1042
|
+
aria-haspopup="dialog"
|
|
1043
|
+
[attr.aria-expanded]="drawerOpen()"
|
|
1044
|
+
(click)="drawerOpen.set(true)"
|
|
1045
|
+
>
|
|
1046
|
+
<span aria-hidden="true">☰</span>
|
|
1047
|
+
</button>
|
|
1048
|
+
<span class="hx-mobile-shell-title">{{ heading() }}</span>
|
|
1049
|
+
<ng-content select="[slot=end]" />
|
|
1050
|
+
</header>
|
|
1051
|
+
<main class="hx-mobile-shell-content"><ng-content /></main>
|
|
1052
|
+
<hx-bottom-bar [items]="items()" [activeId]="activeId()" [label]="barLabel()" (selected)="onBarSelect($event)" />
|
|
1053
|
+
<hx-drawer
|
|
1054
|
+
[(visible)]="drawerOpen"
|
|
1055
|
+
position="left"
|
|
1056
|
+
[ariaLabel]="menuLabel()"
|
|
1057
|
+
[closeLabel]="closeLabel()"
|
|
1058
|
+
width="min(20rem, 85vw)"
|
|
1059
|
+
panelClass="hx-mobile-shell-drawer"
|
|
1060
|
+
>
|
|
1061
|
+
<div
|
|
1062
|
+
class="hx-mobile-shell-drawer-body"
|
|
1063
|
+
(touchstart)="onTouchStart($event)"
|
|
1064
|
+
(touchend)="onTouchEnd($event)"
|
|
1065
|
+
>
|
|
1066
|
+
<ng-content select="[slot=drawer]" />
|
|
1067
|
+
</div>
|
|
1068
|
+
</hx-drawer>
|
|
1069
|
+
`
|
|
1070
|
+
}]
|
|
1071
|
+
}],
|
|
1072
|
+
propDecorators: {
|
|
1073
|
+
items: [{
|
|
1074
|
+
type: i0.Input,
|
|
1075
|
+
args: [{
|
|
1076
|
+
isSignal: true,
|
|
1077
|
+
alias: "items",
|
|
1078
|
+
required: true
|
|
1079
|
+
}]
|
|
1080
|
+
}],
|
|
1081
|
+
activeId: [{
|
|
1082
|
+
type: i0.Input,
|
|
1083
|
+
args: [{
|
|
1084
|
+
isSignal: true,
|
|
1085
|
+
alias: "activeId",
|
|
1086
|
+
required: false
|
|
1087
|
+
}]
|
|
1088
|
+
}, {
|
|
1089
|
+
type: i0.Output,
|
|
1090
|
+
args: ["activeIdChange"]
|
|
1091
|
+
}],
|
|
1092
|
+
drawerOpen: [{
|
|
1093
|
+
type: i0.Input,
|
|
1094
|
+
args: [{
|
|
1095
|
+
isSignal: true,
|
|
1096
|
+
alias: "drawerOpen",
|
|
1097
|
+
required: false
|
|
1098
|
+
}]
|
|
1099
|
+
}, {
|
|
1100
|
+
type: i0.Output,
|
|
1101
|
+
args: ["drawerOpenChange"]
|
|
1102
|
+
}],
|
|
1103
|
+
heading: [{
|
|
1104
|
+
type: i0.Input,
|
|
1105
|
+
args: [{
|
|
1106
|
+
isSignal: true,
|
|
1107
|
+
alias: "heading",
|
|
1108
|
+
required: false
|
|
1109
|
+
}]
|
|
1110
|
+
}],
|
|
1111
|
+
menuLabel: [{
|
|
1112
|
+
type: i0.Input,
|
|
1113
|
+
args: [{
|
|
1114
|
+
isSignal: true,
|
|
1115
|
+
alias: "menuLabel",
|
|
1116
|
+
required: false
|
|
1117
|
+
}]
|
|
1118
|
+
}],
|
|
1119
|
+
closeLabel: [{
|
|
1120
|
+
type: i0.Input,
|
|
1121
|
+
args: [{
|
|
1122
|
+
isSignal: true,
|
|
1123
|
+
alias: "closeLabel",
|
|
1124
|
+
required: false
|
|
1125
|
+
}]
|
|
1126
|
+
}],
|
|
1127
|
+
barLabel: [{
|
|
1128
|
+
type: i0.Input,
|
|
1129
|
+
args: [{
|
|
1130
|
+
isSignal: true,
|
|
1131
|
+
alias: "barLabel",
|
|
1132
|
+
required: false
|
|
1133
|
+
}]
|
|
1134
|
+
}]
|
|
1135
|
+
}
|
|
1136
|
+
});
|
|
1137
|
+
const PLATFORMS = [
|
|
1138
|
+
"desktop",
|
|
1139
|
+
"mobile",
|
|
1140
|
+
"macos",
|
|
1141
|
+
"windows",
|
|
1142
|
+
"linux",
|
|
1143
|
+
"ios",
|
|
1144
|
+
"android",
|
|
1145
|
+
"web"
|
|
1146
|
+
];
|
|
1147
|
+
function getHxPlatformKind(platform) {
|
|
1148
|
+
if (platform === "ios" || platform === "android" || platform === "mobile") return "mobile";
|
|
1149
|
+
return platform === "web" ? "web" : "desktop";
|
|
1150
|
+
}
|
|
1151
|
+
function getHxPlatform(root = document.documentElement) {
|
|
1152
|
+
const value = root.getAttribute("data-platform");
|
|
1153
|
+
return value && PLATFORMS.includes(value) ? value : "web";
|
|
1154
|
+
}
|
|
1155
|
+
function setHxPlatform(platform, root = document.documentElement) {
|
|
1156
|
+
root.setAttribute("data-platform", platform);
|
|
1157
|
+
}
|
|
1158
|
+
var HxStatusBar = class HxStatusBar {
|
|
1159
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1160
|
+
minVersion: "12.0.0",
|
|
1161
|
+
version: "22.2.4",
|
|
1162
|
+
ngImport: i0,
|
|
1163
|
+
type: HxStatusBar,
|
|
1164
|
+
deps: [],
|
|
1165
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1166
|
+
});
|
|
1167
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1168
|
+
minVersion: "14.0.0",
|
|
1169
|
+
version: "22.2.4",
|
|
1170
|
+
type: HxStatusBar,
|
|
1171
|
+
isStandalone: true,
|
|
1172
|
+
selector: "hx-status-bar",
|
|
1173
|
+
host: { classAttribute: "hx-status-bar" },
|
|
1174
|
+
ngImport: i0,
|
|
1175
|
+
template: `
|
|
1176
|
+
<div class="hx-status-group hx-status-start"><ng-content select="[slot=start]" /></div>
|
|
1177
|
+
<div class="hx-status-group hx-status-end"><ng-content select="[slot=end]" /></div>
|
|
1178
|
+
`,
|
|
1179
|
+
isInline: true,
|
|
1180
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1181
|
+
});
|
|
1182
|
+
};
|
|
1183
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1184
|
+
minVersion: "12.0.0",
|
|
1185
|
+
version: "22.2.4",
|
|
1186
|
+
ngImport: i0,
|
|
1187
|
+
type: HxStatusBar,
|
|
1188
|
+
decorators: [{
|
|
1189
|
+
type: Component,
|
|
1190
|
+
args: [{
|
|
1191
|
+
selector: "hx-status-bar",
|
|
1192
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1193
|
+
host: { class: "hx-status-bar" },
|
|
1194
|
+
template: `
|
|
1195
|
+
<div class="hx-status-group hx-status-start"><ng-content select="[slot=start]" /></div>
|
|
1196
|
+
<div class="hx-status-group hx-status-end"><ng-content select="[slot=end]" /></div>
|
|
1197
|
+
`
|
|
1198
|
+
}]
|
|
1199
|
+
}]
|
|
1200
|
+
});
|
|
1201
|
+
var HxStatusPopover = class HxStatusPopover {
|
|
1202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1203
|
+
minVersion: "12.0.0",
|
|
1204
|
+
version: "22.2.4",
|
|
1205
|
+
ngImport: i0,
|
|
1206
|
+
type: HxStatusPopover,
|
|
1207
|
+
deps: [],
|
|
1208
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1209
|
+
});
|
|
1210
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1211
|
+
minVersion: "14.0.0",
|
|
1212
|
+
version: "22.2.4",
|
|
1213
|
+
type: HxStatusPopover,
|
|
1214
|
+
isStandalone: true,
|
|
1215
|
+
selector: "[hxStatusPopover]",
|
|
1216
|
+
ngImport: i0
|
|
1217
|
+
});
|
|
1218
|
+
};
|
|
1219
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1220
|
+
minVersion: "12.0.0",
|
|
1221
|
+
version: "22.2.4",
|
|
1222
|
+
ngImport: i0,
|
|
1223
|
+
type: HxStatusPopover,
|
|
1224
|
+
decorators: [{
|
|
1225
|
+
type: Directive,
|
|
1226
|
+
args: [{ selector: "[hxStatusPopover]" }]
|
|
1227
|
+
}]
|
|
1228
|
+
});
|
|
1229
|
+
var HxStatusItem = class HxStatusItem {
|
|
1230
|
+
host = inject(ElementRef);
|
|
1231
|
+
kind = input("text", ...ngDevMode ? [{ debugName: "kind" }] : /* istanbul ignore next */ []);
|
|
1232
|
+
title = input(null, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
1233
|
+
ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
1234
|
+
disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
1235
|
+
tone = input("neutral", ...ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []);
|
|
1236
|
+
announce = input(false, ...ngDevMode ? [{ debugName: "announce" }] : /* istanbul ignore next */ []);
|
|
1237
|
+
popoverOpen = model(false, ...ngDevMode ? [{ debugName: "popoverOpen" }] : /* istanbul ignore next */ []);
|
|
1238
|
+
popover = contentChild(HxStatusPopover, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
|
|
1239
|
+
get hasPopover() {
|
|
1240
|
+
return this.popover() !== void 0;
|
|
1241
|
+
}
|
|
1242
|
+
onButtonClick() {
|
|
1243
|
+
if (this.hasPopover) this.popoverOpen.update((open) => !open);
|
|
1244
|
+
}
|
|
1245
|
+
close() {
|
|
1246
|
+
if (this.popoverOpen()) this.popoverOpen.set(false);
|
|
1247
|
+
}
|
|
1248
|
+
onDocumentClick(event) {
|
|
1249
|
+
if (this.popoverOpen() && !this.host.nativeElement.contains(event.target)) this.popoverOpen.set(false);
|
|
1250
|
+
}
|
|
1251
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1252
|
+
minVersion: "12.0.0",
|
|
1253
|
+
version: "22.2.4",
|
|
1254
|
+
ngImport: i0,
|
|
1255
|
+
type: HxStatusItem,
|
|
1256
|
+
deps: [],
|
|
1257
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1258
|
+
});
|
|
1259
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1260
|
+
minVersion: "17.0.0",
|
|
1261
|
+
version: "22.2.4",
|
|
1262
|
+
type: HxStatusItem,
|
|
1263
|
+
isStandalone: true,
|
|
1264
|
+
selector: "hx-status-item",
|
|
1265
|
+
inputs: {
|
|
1266
|
+
kind: {
|
|
1267
|
+
classPropertyName: "kind",
|
|
1268
|
+
publicName: "kind",
|
|
1269
|
+
isSignal: true,
|
|
1270
|
+
isRequired: false,
|
|
1271
|
+
transformFunction: null
|
|
1272
|
+
},
|
|
1273
|
+
title: {
|
|
1274
|
+
classPropertyName: "title",
|
|
1275
|
+
publicName: "title",
|
|
1276
|
+
isSignal: true,
|
|
1277
|
+
isRequired: false,
|
|
1278
|
+
transformFunction: null
|
|
1279
|
+
},
|
|
1280
|
+
ariaLabel: {
|
|
1281
|
+
classPropertyName: "ariaLabel",
|
|
1282
|
+
publicName: "ariaLabel",
|
|
1283
|
+
isSignal: true,
|
|
1284
|
+
isRequired: false,
|
|
1285
|
+
transformFunction: null
|
|
1286
|
+
},
|
|
1287
|
+
disabled: {
|
|
1288
|
+
classPropertyName: "disabled",
|
|
1289
|
+
publicName: "disabled",
|
|
1290
|
+
isSignal: true,
|
|
1291
|
+
isRequired: false,
|
|
1292
|
+
transformFunction: null
|
|
1293
|
+
},
|
|
1294
|
+
tone: {
|
|
1295
|
+
classPropertyName: "tone",
|
|
1296
|
+
publicName: "tone",
|
|
1297
|
+
isSignal: true,
|
|
1298
|
+
isRequired: false,
|
|
1299
|
+
transformFunction: null
|
|
1300
|
+
},
|
|
1301
|
+
announce: {
|
|
1302
|
+
classPropertyName: "announce",
|
|
1303
|
+
publicName: "announce",
|
|
1304
|
+
isSignal: true,
|
|
1305
|
+
isRequired: false,
|
|
1306
|
+
transformFunction: null
|
|
1307
|
+
},
|
|
1308
|
+
popoverOpen: {
|
|
1309
|
+
classPropertyName: "popoverOpen",
|
|
1310
|
+
publicName: "popoverOpen",
|
|
1311
|
+
isSignal: true,
|
|
1312
|
+
isRequired: false,
|
|
1313
|
+
transformFunction: null
|
|
1314
|
+
}
|
|
1315
|
+
},
|
|
1316
|
+
outputs: { popoverOpen: "popoverOpenChange" },
|
|
1317
|
+
host: {
|
|
1318
|
+
listeners: {
|
|
1319
|
+
"document:keydown.escape": "close()",
|
|
1320
|
+
"document:click": "onDocumentClick($event)"
|
|
1321
|
+
},
|
|
1322
|
+
properties: {
|
|
1323
|
+
"class.hx-status-warn": "tone() === 'warn'",
|
|
1324
|
+
"class.hx-status-error": "tone() === 'error'",
|
|
1325
|
+
"class.hx-status-accent": "tone() === 'accent'",
|
|
1326
|
+
"attr.title": "null",
|
|
1327
|
+
"attr.role": "announce() ? 'status' : null"
|
|
1328
|
+
},
|
|
1329
|
+
classAttribute: "hx-status-item"
|
|
1330
|
+
},
|
|
1331
|
+
queries: [{
|
|
1332
|
+
propertyName: "popover",
|
|
1333
|
+
first: true,
|
|
1334
|
+
predicate: HxStatusPopover,
|
|
1335
|
+
descendants: true,
|
|
1336
|
+
isSignal: true
|
|
1337
|
+
}],
|
|
1338
|
+
ngImport: i0,
|
|
1339
|
+
template: `
|
|
1340
|
+
@if (kind() === 'button') {
|
|
1341
|
+
<button
|
|
1342
|
+
type="button"
|
|
1343
|
+
class="hx-status-control"
|
|
1344
|
+
[attr.title]="title()"
|
|
1345
|
+
[attr.aria-label]="ariaLabel()"
|
|
1346
|
+
[attr.aria-haspopup]="hasPopover ? 'dialog' : null"
|
|
1347
|
+
[attr.aria-expanded]="hasPopover ? popoverOpen() : null"
|
|
1348
|
+
[disabled]="disabled()"
|
|
1349
|
+
(click)="onButtonClick()"
|
|
1350
|
+
>
|
|
1351
|
+
<ng-container [ngTemplateOutlet]="content" />
|
|
1352
|
+
</button>
|
|
1353
|
+
} @else {
|
|
1354
|
+
<span
|
|
1355
|
+
class="hx-status-control"
|
|
1356
|
+
[attr.title]="title()"
|
|
1357
|
+
[attr.aria-label]="ariaLabel()"
|
|
1358
|
+
>
|
|
1359
|
+
<ng-container [ngTemplateOutlet]="content" />
|
|
1360
|
+
</span>
|
|
1361
|
+
}
|
|
1362
|
+
<ng-template #content><ng-content /></ng-template>
|
|
1363
|
+
@if (popoverOpen()) {
|
|
1364
|
+
<div class="hx-status-popover"><ng-content select="[hxStatusPopover]" /></div>
|
|
1365
|
+
}
|
|
1366
|
+
`,
|
|
1367
|
+
isInline: true,
|
|
1368
|
+
dependencies: [{
|
|
1369
|
+
kind: "directive",
|
|
1370
|
+
type: NgTemplateOutlet,
|
|
1371
|
+
selector: "[ngTemplateOutlet]",
|
|
1372
|
+
inputs: [
|
|
1373
|
+
"ngTemplateOutletContext",
|
|
1374
|
+
"ngTemplateOutlet",
|
|
1375
|
+
"ngTemplateOutletInjector"
|
|
1376
|
+
]
|
|
1377
|
+
}],
|
|
1378
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1379
|
+
});
|
|
1380
|
+
};
|
|
1381
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1382
|
+
minVersion: "12.0.0",
|
|
1383
|
+
version: "22.2.4",
|
|
1384
|
+
ngImport: i0,
|
|
1385
|
+
type: HxStatusItem,
|
|
1386
|
+
decorators: [{
|
|
1387
|
+
type: Component,
|
|
1388
|
+
args: [{
|
|
1389
|
+
selector: "hx-status-item",
|
|
1390
|
+
imports: [NgTemplateOutlet],
|
|
1391
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1392
|
+
host: {
|
|
1393
|
+
class: "hx-status-item",
|
|
1394
|
+
"[class.hx-status-warn]": "tone() === 'warn'",
|
|
1395
|
+
"[class.hx-status-error]": "tone() === 'error'",
|
|
1396
|
+
"[class.hx-status-accent]": "tone() === 'accent'",
|
|
1397
|
+
"[attr.title]": "null",
|
|
1398
|
+
"[attr.role]": "announce() ? 'status' : null",
|
|
1399
|
+
"(document:keydown.escape)": "close()",
|
|
1400
|
+
"(document:click)": "onDocumentClick($event)"
|
|
1401
|
+
},
|
|
1402
|
+
template: `
|
|
1403
|
+
@if (kind() === 'button') {
|
|
1404
|
+
<button
|
|
1405
|
+
type="button"
|
|
1406
|
+
class="hx-status-control"
|
|
1407
|
+
[attr.title]="title()"
|
|
1408
|
+
[attr.aria-label]="ariaLabel()"
|
|
1409
|
+
[attr.aria-haspopup]="hasPopover ? 'dialog' : null"
|
|
1410
|
+
[attr.aria-expanded]="hasPopover ? popoverOpen() : null"
|
|
1411
|
+
[disabled]="disabled()"
|
|
1412
|
+
(click)="onButtonClick()"
|
|
1413
|
+
>
|
|
1414
|
+
<ng-container [ngTemplateOutlet]="content" />
|
|
1415
|
+
</button>
|
|
1416
|
+
} @else {
|
|
1417
|
+
<span
|
|
1418
|
+
class="hx-status-control"
|
|
1419
|
+
[attr.title]="title()"
|
|
1420
|
+
[attr.aria-label]="ariaLabel()"
|
|
1421
|
+
>
|
|
1422
|
+
<ng-container [ngTemplateOutlet]="content" />
|
|
1423
|
+
</span>
|
|
1424
|
+
}
|
|
1425
|
+
<ng-template #content><ng-content /></ng-template>
|
|
1426
|
+
@if (popoverOpen()) {
|
|
1427
|
+
<div class="hx-status-popover"><ng-content select="[hxStatusPopover]" /></div>
|
|
1428
|
+
}
|
|
1429
|
+
`
|
|
1430
|
+
}]
|
|
1431
|
+
}],
|
|
1432
|
+
propDecorators: {
|
|
1433
|
+
kind: [{
|
|
1434
|
+
type: i0.Input,
|
|
1435
|
+
args: [{
|
|
1436
|
+
isSignal: true,
|
|
1437
|
+
alias: "kind",
|
|
1438
|
+
required: false
|
|
1439
|
+
}]
|
|
1440
|
+
}],
|
|
1441
|
+
title: [{
|
|
1442
|
+
type: i0.Input,
|
|
1443
|
+
args: [{
|
|
1444
|
+
isSignal: true,
|
|
1445
|
+
alias: "title",
|
|
1446
|
+
required: false
|
|
1447
|
+
}]
|
|
1448
|
+
}],
|
|
1449
|
+
ariaLabel: [{
|
|
1450
|
+
type: i0.Input,
|
|
1451
|
+
args: [{
|
|
1452
|
+
isSignal: true,
|
|
1453
|
+
alias: "ariaLabel",
|
|
1454
|
+
required: false
|
|
1455
|
+
}]
|
|
1456
|
+
}],
|
|
1457
|
+
disabled: [{
|
|
1458
|
+
type: i0.Input,
|
|
1459
|
+
args: [{
|
|
1460
|
+
isSignal: true,
|
|
1461
|
+
alias: "disabled",
|
|
1462
|
+
required: false
|
|
1463
|
+
}]
|
|
1464
|
+
}],
|
|
1465
|
+
tone: [{
|
|
1466
|
+
type: i0.Input,
|
|
1467
|
+
args: [{
|
|
1468
|
+
isSignal: true,
|
|
1469
|
+
alias: "tone",
|
|
1470
|
+
required: false
|
|
1471
|
+
}]
|
|
1472
|
+
}],
|
|
1473
|
+
announce: [{
|
|
1474
|
+
type: i0.Input,
|
|
1475
|
+
args: [{
|
|
1476
|
+
isSignal: true,
|
|
1477
|
+
alias: "announce",
|
|
1478
|
+
required: false
|
|
1479
|
+
}]
|
|
1480
|
+
}],
|
|
1481
|
+
popoverOpen: [{
|
|
1482
|
+
type: i0.Input,
|
|
1483
|
+
args: [{
|
|
1484
|
+
isSignal: true,
|
|
1485
|
+
alias: "popoverOpen",
|
|
1486
|
+
required: false
|
|
1487
|
+
}]
|
|
1488
|
+
}, {
|
|
1489
|
+
type: i0.Output,
|
|
1490
|
+
args: ["popoverOpenChange"]
|
|
1491
|
+
}],
|
|
1492
|
+
popover: [{
|
|
1493
|
+
type: i0.ContentChild,
|
|
1494
|
+
args: [i0.forwardRef(() => HxStatusPopover), { isSignal: true }]
|
|
1495
|
+
}]
|
|
1496
|
+
}
|
|
1497
|
+
});
|
|
1498
|
+
var HxStatusVersion = class HxStatusVersion {
|
|
1499
|
+
version = input.required(...ngDevMode ? [{ debugName: "version" }] : /* istanbul ignore next */ []);
|
|
1500
|
+
channel = input(null, ...ngDevMode ? [{ debugName: "channel" }] : /* istanbul ignore next */ []);
|
|
1501
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1502
|
+
minVersion: "12.0.0",
|
|
1503
|
+
version: "22.2.4",
|
|
1504
|
+
ngImport: i0,
|
|
1505
|
+
type: HxStatusVersion,
|
|
1506
|
+
deps: [],
|
|
1507
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1508
|
+
});
|
|
1509
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1510
|
+
minVersion: "17.0.0",
|
|
1511
|
+
version: "22.2.4",
|
|
1512
|
+
type: HxStatusVersion,
|
|
1513
|
+
isStandalone: true,
|
|
1514
|
+
selector: "hx-status-version",
|
|
1515
|
+
inputs: {
|
|
1516
|
+
version: {
|
|
1517
|
+
classPropertyName: "version",
|
|
1518
|
+
publicName: "version",
|
|
1519
|
+
isSignal: true,
|
|
1520
|
+
isRequired: true,
|
|
1521
|
+
transformFunction: null
|
|
1522
|
+
},
|
|
1523
|
+
channel: {
|
|
1524
|
+
classPropertyName: "channel",
|
|
1525
|
+
publicName: "channel",
|
|
1526
|
+
isSignal: true,
|
|
1527
|
+
isRequired: false,
|
|
1528
|
+
transformFunction: null
|
|
1529
|
+
}
|
|
1530
|
+
},
|
|
1531
|
+
host: { classAttribute: "hx-status-version" },
|
|
1532
|
+
ngImport: i0,
|
|
1533
|
+
template: `
|
|
1534
|
+
<span class="hx-status-control hx-status-version-text">v{{ version() }}</span>
|
|
1535
|
+
@if (channel()) {
|
|
1536
|
+
<span class="hx-status-channel">{{ channel() }}</span>
|
|
1537
|
+
}
|
|
1538
|
+
`,
|
|
1539
|
+
isInline: true,
|
|
1540
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1541
|
+
});
|
|
1542
|
+
};
|
|
1543
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1544
|
+
minVersion: "12.0.0",
|
|
1545
|
+
version: "22.2.4",
|
|
1546
|
+
ngImport: i0,
|
|
1547
|
+
type: HxStatusVersion,
|
|
1548
|
+
decorators: [{
|
|
1549
|
+
type: Component,
|
|
1550
|
+
args: [{
|
|
1551
|
+
selector: "hx-status-version",
|
|
1552
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1553
|
+
host: { class: "hx-status-version" },
|
|
1554
|
+
template: `
|
|
1555
|
+
<span class="hx-status-control hx-status-version-text">v{{ version() }}</span>
|
|
1556
|
+
@if (channel()) {
|
|
1557
|
+
<span class="hx-status-channel">{{ channel() }}</span>
|
|
1558
|
+
}
|
|
1559
|
+
`
|
|
1560
|
+
}]
|
|
1561
|
+
}],
|
|
1562
|
+
propDecorators: {
|
|
1563
|
+
version: [{
|
|
1564
|
+
type: i0.Input,
|
|
1565
|
+
args: [{
|
|
1566
|
+
isSignal: true,
|
|
1567
|
+
alias: "version",
|
|
1568
|
+
required: true
|
|
1569
|
+
}]
|
|
1570
|
+
}],
|
|
1571
|
+
channel: [{
|
|
1572
|
+
type: i0.Input,
|
|
1573
|
+
args: [{
|
|
1574
|
+
isSignal: true,
|
|
1575
|
+
alias: "channel",
|
|
1576
|
+
required: false
|
|
1577
|
+
}]
|
|
1578
|
+
}]
|
|
1579
|
+
}
|
|
1580
|
+
});
|
|
1581
|
+
var HxStatusZoom = class HxStatusZoom {
|
|
1582
|
+
value = model(100, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
1583
|
+
min = input(50, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
|
|
1584
|
+
max = input(200, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
|
|
1585
|
+
step = input(10, ...ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []);
|
|
1586
|
+
reset = input(100, ...ngDevMode ? [{ debugName: "reset" }] : /* istanbul ignore next */ []);
|
|
1587
|
+
change(delta) {
|
|
1588
|
+
this.set(this.value() + delta);
|
|
1589
|
+
}
|
|
1590
|
+
set(next) {
|
|
1591
|
+
const clamped = Math.min(this.max(), Math.max(this.min(), next));
|
|
1592
|
+
if (clamped !== this.value()) this.value.set(clamped);
|
|
1593
|
+
}
|
|
1594
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1595
|
+
minVersion: "12.0.0",
|
|
1596
|
+
version: "22.2.4",
|
|
1597
|
+
ngImport: i0,
|
|
1598
|
+
type: HxStatusZoom,
|
|
1599
|
+
deps: [],
|
|
1600
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1601
|
+
});
|
|
1602
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1603
|
+
minVersion: "17.1.0",
|
|
1604
|
+
version: "22.2.4",
|
|
1605
|
+
type: HxStatusZoom,
|
|
1606
|
+
isStandalone: true,
|
|
1607
|
+
selector: "hx-status-zoom",
|
|
1608
|
+
inputs: {
|
|
1609
|
+
value: {
|
|
1610
|
+
classPropertyName: "value",
|
|
1611
|
+
publicName: "value",
|
|
1612
|
+
isSignal: true,
|
|
1613
|
+
isRequired: false,
|
|
1614
|
+
transformFunction: null
|
|
1615
|
+
},
|
|
1616
|
+
min: {
|
|
1617
|
+
classPropertyName: "min",
|
|
1618
|
+
publicName: "min",
|
|
1619
|
+
isSignal: true,
|
|
1620
|
+
isRequired: false,
|
|
1621
|
+
transformFunction: null
|
|
1622
|
+
},
|
|
1623
|
+
max: {
|
|
1624
|
+
classPropertyName: "max",
|
|
1625
|
+
publicName: "max",
|
|
1626
|
+
isSignal: true,
|
|
1627
|
+
isRequired: false,
|
|
1628
|
+
transformFunction: null
|
|
1629
|
+
},
|
|
1630
|
+
step: {
|
|
1631
|
+
classPropertyName: "step",
|
|
1632
|
+
publicName: "step",
|
|
1633
|
+
isSignal: true,
|
|
1634
|
+
isRequired: false,
|
|
1635
|
+
transformFunction: null
|
|
1636
|
+
},
|
|
1637
|
+
reset: {
|
|
1638
|
+
classPropertyName: "reset",
|
|
1639
|
+
publicName: "reset",
|
|
1640
|
+
isSignal: true,
|
|
1641
|
+
isRequired: false,
|
|
1642
|
+
transformFunction: null
|
|
1643
|
+
}
|
|
1644
|
+
},
|
|
1645
|
+
outputs: { value: "valueChange" },
|
|
1646
|
+
host: { classAttribute: "hx-status-zoom" },
|
|
1647
|
+
ngImport: i0,
|
|
1648
|
+
template: `
|
|
1649
|
+
<button
|
|
1650
|
+
type="button"
|
|
1651
|
+
class="hx-status-control hx-status-zoom-out"
|
|
1652
|
+
title="Zoom out"
|
|
1653
|
+
aria-label="Zoom out"
|
|
1654
|
+
[disabled]="value() <= min()"
|
|
1655
|
+
(click)="change(-step())"
|
|
1656
|
+
>
|
|
1657
|
+
−
|
|
1658
|
+
</button>
|
|
1659
|
+
<button
|
|
1660
|
+
type="button"
|
|
1661
|
+
class="hx-status-control hx-status-zoom-level"
|
|
1662
|
+
title="Reset zoom"
|
|
1663
|
+
[attr.aria-label]="'Reset zoom, ' + value() + ' percent'"
|
|
1664
|
+
(click)="set(reset())"
|
|
1665
|
+
>
|
|
1666
|
+
{{ value() }}%
|
|
1667
|
+
</button>
|
|
1668
|
+
<button
|
|
1669
|
+
type="button"
|
|
1670
|
+
class="hx-status-control hx-status-zoom-in"
|
|
1671
|
+
title="Zoom in"
|
|
1672
|
+
aria-label="Zoom in"
|
|
1673
|
+
[disabled]="value() >= max()"
|
|
1674
|
+
(click)="change(step())"
|
|
1675
|
+
>
|
|
1676
|
+
+
|
|
1677
|
+
</button>
|
|
1678
|
+
`,
|
|
1679
|
+
isInline: true,
|
|
1680
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1681
|
+
});
|
|
1682
|
+
};
|
|
1683
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1684
|
+
minVersion: "12.0.0",
|
|
1685
|
+
version: "22.2.4",
|
|
1686
|
+
ngImport: i0,
|
|
1687
|
+
type: HxStatusZoom,
|
|
1688
|
+
decorators: [{
|
|
1689
|
+
type: Component,
|
|
1690
|
+
args: [{
|
|
1691
|
+
selector: "hx-status-zoom",
|
|
1692
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1693
|
+
host: { class: "hx-status-zoom" },
|
|
1694
|
+
template: `
|
|
1695
|
+
<button
|
|
1696
|
+
type="button"
|
|
1697
|
+
class="hx-status-control hx-status-zoom-out"
|
|
1698
|
+
title="Zoom out"
|
|
1699
|
+
aria-label="Zoom out"
|
|
1700
|
+
[disabled]="value() <= min()"
|
|
1701
|
+
(click)="change(-step())"
|
|
1702
|
+
>
|
|
1703
|
+
−
|
|
1704
|
+
</button>
|
|
1705
|
+
<button
|
|
1706
|
+
type="button"
|
|
1707
|
+
class="hx-status-control hx-status-zoom-level"
|
|
1708
|
+
title="Reset zoom"
|
|
1709
|
+
[attr.aria-label]="'Reset zoom, ' + value() + ' percent'"
|
|
1710
|
+
(click)="set(reset())"
|
|
1711
|
+
>
|
|
1712
|
+
{{ value() }}%
|
|
1713
|
+
</button>
|
|
1714
|
+
<button
|
|
1715
|
+
type="button"
|
|
1716
|
+
class="hx-status-control hx-status-zoom-in"
|
|
1717
|
+
title="Zoom in"
|
|
1718
|
+
aria-label="Zoom in"
|
|
1719
|
+
[disabled]="value() >= max()"
|
|
1720
|
+
(click)="change(step())"
|
|
1721
|
+
>
|
|
1722
|
+
+
|
|
1723
|
+
</button>
|
|
1724
|
+
`
|
|
1725
|
+
}]
|
|
1726
|
+
}],
|
|
1727
|
+
propDecorators: {
|
|
1728
|
+
value: [{
|
|
1729
|
+
type: i0.Input,
|
|
1730
|
+
args: [{
|
|
1731
|
+
isSignal: true,
|
|
1732
|
+
alias: "value",
|
|
1733
|
+
required: false
|
|
1734
|
+
}]
|
|
1735
|
+
}, {
|
|
1736
|
+
type: i0.Output,
|
|
1737
|
+
args: ["valueChange"]
|
|
1738
|
+
}],
|
|
1739
|
+
min: [{
|
|
1740
|
+
type: i0.Input,
|
|
1741
|
+
args: [{
|
|
1742
|
+
isSignal: true,
|
|
1743
|
+
alias: "min",
|
|
1744
|
+
required: false
|
|
1745
|
+
}]
|
|
1746
|
+
}],
|
|
1747
|
+
max: [{
|
|
1748
|
+
type: i0.Input,
|
|
1749
|
+
args: [{
|
|
1750
|
+
isSignal: true,
|
|
1751
|
+
alias: "max",
|
|
1752
|
+
required: false
|
|
1753
|
+
}]
|
|
1754
|
+
}],
|
|
1755
|
+
step: [{
|
|
1756
|
+
type: i0.Input,
|
|
1757
|
+
args: [{
|
|
1758
|
+
isSignal: true,
|
|
1759
|
+
alias: "step",
|
|
1760
|
+
required: false
|
|
1761
|
+
}]
|
|
1762
|
+
}],
|
|
1763
|
+
reset: [{
|
|
1764
|
+
type: i0.Input,
|
|
1765
|
+
args: [{
|
|
1766
|
+
isSignal: true,
|
|
1767
|
+
alias: "reset",
|
|
1768
|
+
required: false
|
|
1769
|
+
}]
|
|
1770
|
+
}]
|
|
1771
|
+
}
|
|
1772
|
+
});
|
|
1773
|
+
const HELIX_DESKTOP_VERSION = "0.1.0";
|
|
1774
|
+
export { HELIX_DESKTOP_VERSION, HX_BOTTOM_BAR_MAX_ITEMS, HxActivityBar, HxAppShell, HxAppToolbar, HxBottomBar, HxMobileShell, HxStatusBar, HxStatusItem, HxStatusPopover, HxStatusVersion, HxStatusZoom, getHxPlatform, getHxPlatformKind, setHxPlatform };
|
|
1775
|
+
|
|
1776
|
+
//# sourceMappingURL=gravionlabs-helix-desktop.mjs.map
|