@hyalo/angular 0.0.0-stage → 0.3.1
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 +95 -0
- package/LICENSE +21 -0
- package/README.md +45 -2
- package/fesm2022/hyalo-angular-accordion.mjs +230 -0
- package/fesm2022/hyalo-angular-accordion.mjs.map +1 -0
- package/fesm2022/hyalo-angular-alert.mjs +171 -0
- package/fesm2022/hyalo-angular-alert.mjs.map +1 -0
- package/fesm2022/hyalo-angular-aspect-ratio.mjs +64 -0
- package/fesm2022/hyalo-angular-aspect-ratio.mjs.map +1 -0
- package/fesm2022/hyalo-angular-avatar.mjs +169 -0
- package/fesm2022/hyalo-angular-avatar.mjs.map +1 -0
- package/fesm2022/hyalo-angular-badge.mjs +268 -0
- package/fesm2022/hyalo-angular-badge.mjs.map +1 -0
- package/fesm2022/hyalo-angular-bento.mjs +132 -0
- package/fesm2022/hyalo-angular-bento.mjs.map +1 -0
- package/fesm2022/hyalo-angular-blocks.mjs +985 -0
- package/fesm2022/hyalo-angular-blocks.mjs.map +1 -0
- package/fesm2022/hyalo-angular-border-beam.mjs +73 -0
- package/fesm2022/hyalo-angular-border-beam.mjs.map +1 -0
- package/fesm2022/hyalo-angular-breadcrumb.mjs +77 -0
- package/fesm2022/hyalo-angular-breadcrumb.mjs.map +1 -0
- package/fesm2022/hyalo-angular-button-group.mjs +90 -0
- package/fesm2022/hyalo-angular-button-group.mjs.map +1 -0
- package/fesm2022/hyalo-angular-button.mjs +204 -0
- package/fesm2022/hyalo-angular-button.mjs.map +1 -0
- package/fesm2022/hyalo-angular-card.mjs +221 -0
- package/fesm2022/hyalo-angular-card.mjs.map +1 -0
- package/fesm2022/hyalo-angular-carousel.mjs +709 -0
- package/fesm2022/hyalo-angular-carousel.mjs.map +1 -0
- package/fesm2022/hyalo-angular-chapter-nav.mjs +336 -0
- package/fesm2022/hyalo-angular-chapter-nav.mjs.map +1 -0
- package/fesm2022/hyalo-angular-chart-engine-DSJop6He.mjs +5 -0
- package/fesm2022/hyalo-angular-chart-engine-DSJop6He.mjs.map +1 -0
- package/fesm2022/hyalo-angular-chart.mjs +391 -0
- package/fesm2022/hyalo-angular-chart.mjs.map +1 -0
- package/fesm2022/hyalo-angular-choice.mjs +789 -0
- package/fesm2022/hyalo-angular-choice.mjs.map +1 -0
- package/fesm2022/hyalo-angular-code-block-highlight-B20d5C76.mjs +40 -0
- package/fesm2022/hyalo-angular-code-block-highlight-B20d5C76.mjs.map +1 -0
- package/fesm2022/hyalo-angular-code-block.mjs +161 -0
- package/fesm2022/hyalo-angular-code-block.mjs.map +1 -0
- package/fesm2022/hyalo-angular-command.mjs +193 -0
- package/fesm2022/hyalo-angular-command.mjs.map +1 -0
- package/fesm2022/hyalo-angular-copy.mjs +138 -0
- package/fesm2022/hyalo-angular-copy.mjs.map +1 -0
- package/fesm2022/hyalo-angular-core.mjs +424 -0
- package/fesm2022/hyalo-angular-core.mjs.map +1 -0
- package/fesm2022/hyalo-angular-description-list.mjs +57 -0
- package/fesm2022/hyalo-angular-description-list.mjs.map +1 -0
- package/fesm2022/hyalo-angular-dialog.mjs +600 -0
- package/fesm2022/hyalo-angular-dialog.mjs.map +1 -0
- package/fesm2022/hyalo-angular-divider.mjs +66 -0
- package/fesm2022/hyalo-angular-divider.mjs.map +1 -0
- package/fesm2022/hyalo-angular-empty-state.mjs +123 -0
- package/fesm2022/hyalo-angular-empty-state.mjs.map +1 -0
- package/fesm2022/hyalo-angular-field.mjs +344 -0
- package/fesm2022/hyalo-angular-field.mjs.map +1 -0
- package/fesm2022/hyalo-angular-filter.mjs +309 -0
- package/fesm2022/hyalo-angular-filter.mjs.map +1 -0
- package/fesm2022/hyalo-angular-hotspot.mjs +225 -0
- package/fesm2022/hyalo-angular-hotspot.mjs.map +1 -0
- package/fesm2022/hyalo-angular-hover-card.mjs +233 -0
- package/fesm2022/hyalo-angular-hover-card.mjs.map +1 -0
- package/fesm2022/hyalo-angular-icon.mjs +385 -0
- package/fesm2022/hyalo-angular-icon.mjs.map +1 -0
- package/fesm2022/hyalo-angular-image-compare.mjs +168 -0
- package/fesm2022/hyalo-angular-image-compare.mjs.map +1 -0
- package/fesm2022/hyalo-angular-interaction.mjs +446 -0
- package/fesm2022/hyalo-angular-interaction.mjs.map +1 -0
- package/fesm2022/hyalo-angular-kbd.mjs +41 -0
- package/fesm2022/hyalo-angular-kbd.mjs.map +1 -0
- package/fesm2022/hyalo-angular-lightbox.mjs +228 -0
- package/fesm2022/hyalo-angular-lightbox.mjs.map +1 -0
- package/fesm2022/hyalo-angular-link.mjs +42 -0
- package/fesm2022/hyalo-angular-link.mjs.map +1 -0
- package/fesm2022/hyalo-angular-list.mjs +131 -0
- package/fesm2022/hyalo-angular-list.mjs.map +1 -0
- package/fesm2022/hyalo-angular-marquee.mjs +197 -0
- package/fesm2022/hyalo-angular-marquee.mjs.map +1 -0
- package/fesm2022/hyalo-angular-menu.mjs +423 -0
- package/fesm2022/hyalo-angular-menu.mjs.map +1 -0
- package/fesm2022/hyalo-angular-mesh.mjs +126 -0
- package/fesm2022/hyalo-angular-mesh.mjs.map +1 -0
- package/fesm2022/hyalo-angular-motion.mjs +620 -0
- package/fesm2022/hyalo-angular-motion.mjs.map +1 -0
- package/fesm2022/hyalo-angular-navbar.mjs +343 -0
- package/fesm2022/hyalo-angular-navbar.mjs.map +1 -0
- package/fesm2022/hyalo-angular-navigation-menu.mjs +222 -0
- package/fesm2022/hyalo-angular-navigation-menu.mjs.map +1 -0
- package/fesm2022/hyalo-angular-number-ticker.mjs +174 -0
- package/fesm2022/hyalo-angular-number-ticker.mjs.map +1 -0
- package/fesm2022/hyalo-angular-overlay.mjs +163 -0
- package/fesm2022/hyalo-angular-overlay.mjs.map +1 -0
- package/fesm2022/hyalo-angular-pagination.mjs +187 -0
- package/fesm2022/hyalo-angular-pagination.mjs.map +1 -0
- package/fesm2022/hyalo-angular-popover-overlay-kit-6wPwnxln.mjs +3 -0
- package/fesm2022/hyalo-angular-popover.mjs +516 -0
- package/fesm2022/hyalo-angular-popover.mjs.map +1 -0
- package/fesm2022/hyalo-angular-progress.mjs +209 -0
- package/fesm2022/hyalo-angular-progress.mjs.map +1 -0
- package/fesm2022/hyalo-angular-progressive-blur.mjs +73 -0
- package/fesm2022/hyalo-angular-progressive-blur.mjs.map +1 -0
- package/fesm2022/hyalo-angular-refraction-renderer-5ZA-kfsA.mjs +186 -0
- package/fesm2022/hyalo-angular-refraction-renderer-5ZA-kfsA.mjs.map +1 -0
- package/fesm2022/hyalo-angular-refraction.mjs +178 -0
- package/fesm2022/hyalo-angular-refraction.mjs.map +1 -0
- package/fesm2022/hyalo-angular-scroll-area.mjs +93 -0
- package/fesm2022/hyalo-angular-scroll-area.mjs.map +1 -0
- package/fesm2022/hyalo-angular-scroll-to-top.mjs +127 -0
- package/fesm2022/hyalo-angular-scroll-to-top.mjs.map +1 -0
- package/fesm2022/hyalo-angular-segmented.mjs +223 -0
- package/fesm2022/hyalo-angular-segmented.mjs.map +1 -0
- package/fesm2022/hyalo-angular-select.mjs +561 -0
- package/fesm2022/hyalo-angular-select.mjs.map +1 -0
- package/fesm2022/hyalo-angular-sidebar.mjs +241 -0
- package/fesm2022/hyalo-angular-sidebar.mjs.map +1 -0
- package/fesm2022/hyalo-angular-skeleton.mjs +131 -0
- package/fesm2022/hyalo-angular-skeleton.mjs.map +1 -0
- package/fesm2022/hyalo-angular-sparkline.mjs +110 -0
- package/fesm2022/hyalo-angular-sparkline.mjs.map +1 -0
- package/fesm2022/hyalo-angular-split-text.mjs +126 -0
- package/fesm2022/hyalo-angular-split-text.mjs.map +1 -0
- package/fesm2022/hyalo-angular-stat.mjs +193 -0
- package/fesm2022/hyalo-angular-stat.mjs.map +1 -0
- package/fesm2022/hyalo-angular-stepper.mjs +254 -0
- package/fesm2022/hyalo-angular-stepper.mjs.map +1 -0
- package/fesm2022/hyalo-angular-table.mjs +335 -0
- package/fesm2022/hyalo-angular-table.mjs.map +1 -0
- package/fesm2022/hyalo-angular-tabs.mjs +324 -0
- package/fesm2022/hyalo-angular-tabs.mjs.map +1 -0
- package/fesm2022/hyalo-angular-theme.mjs +94 -0
- package/fesm2022/hyalo-angular-theme.mjs.map +1 -0
- package/fesm2022/hyalo-angular-timeline.mjs +157 -0
- package/fesm2022/hyalo-angular-timeline.mjs.map +1 -0
- package/fesm2022/hyalo-angular-toast.mjs +323 -0
- package/fesm2022/hyalo-angular-toast.mjs.map +1 -0
- package/fesm2022/hyalo-angular.mjs +2 -0
- package/package.json +329 -3
- package/styles/hyalo-core.css +25 -0
- package/styles/hyalo.css +17 -0
- package/styles/overlays/dialog.css +9 -0
- package/styles/overlays/popover.css +9 -0
- package/styles/overlays/select.css +9 -0
- package/styles/overlays/toast.css +8 -0
- package/styles/palettes/aurora.css +47 -0
- package/styles/palettes/ember.css +47 -0
- package/styles/palettes/graphite.css +47 -0
- package/styles/palettes/ocean.css +47 -0
- package/styles/palettes/orchid.css +47 -0
- package/styles/palettes/rose.css +47 -0
- package/styles/parts/card.css +49 -0
- package/styles/parts/dialog.css +116 -0
- package/styles/parts/drawer.css +124 -0
- package/styles/parts/field.css +44 -0
- package/styles/parts/glass.css +139 -0
- package/styles/parts/motion.css +101 -0
- package/styles/parts/navbar.css +55 -0
- package/styles/parts/popover.css +27 -0
- package/styles/parts/presence.css +55 -0
- package/styles/parts/reset.css +42 -0
- package/styles/parts/select.css +46 -0
- package/styles/parts/themes.css +105 -0
- package/styles/parts/toast.css +128 -0
- package/styles/parts/tokens.css +151 -0
- package/styles/parts/typography.css +81 -0
- package/types/hyalo-angular-accordion.d.ts +74 -0
- package/types/hyalo-angular-alert.d.ts +47 -0
- package/types/hyalo-angular-aspect-ratio.d.ts +13 -0
- package/types/hyalo-angular-avatar.d.ts +39 -0
- package/types/hyalo-angular-badge.d.ts +82 -0
- package/types/hyalo-angular-bento.d.ts +25 -0
- package/types/hyalo-angular-blocks.d.ts +272 -0
- package/types/hyalo-angular-border-beam.d.ts +15 -0
- package/types/hyalo-angular-breadcrumb.d.ts +22 -0
- package/types/hyalo-angular-button-group.d.ts +19 -0
- package/types/hyalo-angular-button.d.ts +89 -0
- package/types/hyalo-angular-card.d.ts +61 -0
- package/types/hyalo-angular-carousel.d.ts +147 -0
- package/types/hyalo-angular-chapter-nav.d.ts +79 -0
- package/types/hyalo-angular-chart.d.ts +90 -0
- package/types/hyalo-angular-choice.d.ts +259 -0
- package/types/hyalo-angular-code-block.d.ts +46 -0
- package/types/hyalo-angular-command.d.ts +41 -0
- package/types/hyalo-angular-copy.d.ts +39 -0
- package/types/hyalo-angular-core.d.ts +210 -0
- package/types/hyalo-angular-description-list.d.ts +16 -0
- package/types/hyalo-angular-dialog.d.ts +171 -0
- package/types/hyalo-angular-divider.d.ts +12 -0
- package/types/hyalo-angular-empty-state.d.ts +30 -0
- package/types/hyalo-angular-field.d.ts +141 -0
- package/types/hyalo-angular-filter.d.ts +122 -0
- package/types/hyalo-angular-hotspot.d.ts +70 -0
- package/types/hyalo-angular-hover-card.d.ts +47 -0
- package/types/hyalo-angular-icon.d.ts +122 -0
- package/types/hyalo-angular-image-compare.d.ts +55 -0
- package/types/hyalo-angular-interaction.d.ts +131 -0
- package/types/hyalo-angular-kbd.d.ts +5 -0
- package/types/hyalo-angular-lightbox.d.ts +67 -0
- package/types/hyalo-angular-link.d.ts +5 -0
- package/types/hyalo-angular-list.d.ts +30 -0
- package/types/hyalo-angular-marquee.d.ts +48 -0
- package/types/hyalo-angular-menu.d.ts +105 -0
- package/types/hyalo-angular-mesh.d.ts +36 -0
- package/types/hyalo-angular-motion.d.ts +218 -0
- package/types/hyalo-angular-navbar.d.ts +110 -0
- package/types/hyalo-angular-navigation-menu.d.ts +47 -0
- package/types/hyalo-angular-number-ticker.d.ts +52 -0
- package/types/hyalo-angular-overlay.d.ts +40 -0
- package/types/hyalo-angular-pagination.d.ts +59 -0
- package/types/hyalo-angular-popover.d.ts +152 -0
- package/types/hyalo-angular-progress.d.ts +46 -0
- package/types/hyalo-angular-progressive-blur.d.ts +14 -0
- package/types/hyalo-angular-refraction.d.ts +46 -0
- package/types/hyalo-angular-scroll-area.d.ts +18 -0
- package/types/hyalo-angular-scroll-to-top.d.ts +31 -0
- package/types/hyalo-angular-segmented.d.ts +79 -0
- package/types/hyalo-angular-select.d.ts +176 -0
- package/types/hyalo-angular-sidebar.d.ts +57 -0
- package/types/hyalo-angular-skeleton.d.ts +34 -0
- package/types/hyalo-angular-sparkline.d.ts +19 -0
- package/types/hyalo-angular-split-text.d.ts +24 -0
- package/types/hyalo-angular-stat.d.ts +56 -0
- package/types/hyalo-angular-stepper.d.ts +63 -0
- package/types/hyalo-angular-table.d.ts +125 -0
- package/types/hyalo-angular-tabs.d.ts +102 -0
- package/types/hyalo-angular-theme.d.ts +46 -0
- package/types/hyalo-angular-timeline.d.ts +36 -0
- package/types/hyalo-angular-toast.d.ts +79 -0
- package/types/hyalo-angular.d.ts +2 -0
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive, ElementRef, Injectable, InjectionToken, Injector, afterNextRender, inject, input } from "@angular/core";
|
|
3
|
+
import { filter, firstValueFrom } from "rxjs";
|
|
4
|
+
import { HyMotion, HySpring, HyVelocityTracker, MOTION, SPRINGS, project, rubberband } from "@hyalo/angular/motion";
|
|
5
|
+
import { HyFidelity, injectId } from "@hyalo/angular/core";
|
|
6
|
+
import { Dialog } from "@angular/cdk/dialog";
|
|
7
|
+
import { HyButton } from "@hyalo/angular/button";
|
|
8
|
+
import { createGlobalPositionStrategy } from "@angular/cdk/overlay";
|
|
9
|
+
const HY_DIALOG_DATA = new InjectionToken("HY_DIALOG_DATA");
|
|
10
|
+
var HyDialogRef = class {
|
|
11
|
+
cdkRef;
|
|
12
|
+
closing = false;
|
|
13
|
+
closed;
|
|
14
|
+
exit = null;
|
|
15
|
+
constructor(cdkRef) {
|
|
16
|
+
this.cdkRef = cdkRef;
|
|
17
|
+
this.closed = firstValueFrom(cdkRef.closed, { defaultValue: void 0 });
|
|
18
|
+
}
|
|
19
|
+
get id() {
|
|
20
|
+
return this.cdkRef.id;
|
|
21
|
+
}
|
|
22
|
+
get containerElement() {
|
|
23
|
+
return this.cdkRef.overlayRef.overlayElement?.querySelector(".cdk-dialog-container") ?? null;
|
|
24
|
+
}
|
|
25
|
+
close(result) {
|
|
26
|
+
if (this.closing) return;
|
|
27
|
+
this.closing = true;
|
|
28
|
+
if (this.exit) {
|
|
29
|
+
this.exit(() => this.cdkRef.close(result));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const pane = this.cdkRef.overlayRef.overlayElement;
|
|
33
|
+
const backdrop = this.cdkRef.overlayRef.backdropElement;
|
|
34
|
+
const panel = this.containerElement;
|
|
35
|
+
pane.dataset["state"] = "closing";
|
|
36
|
+
backdrop?.setAttribute("data-state", "closing");
|
|
37
|
+
let done = false;
|
|
38
|
+
const finish = () => {
|
|
39
|
+
if (done) return;
|
|
40
|
+
done = true;
|
|
41
|
+
pane.removeEventListener("animationend", onEnd);
|
|
42
|
+
this.cdkRef.close(result);
|
|
43
|
+
};
|
|
44
|
+
const onEnd = (event) => {
|
|
45
|
+
if (event.target === pane || event.target === panel) finish();
|
|
46
|
+
};
|
|
47
|
+
pane.addEventListener("animationend", onEnd);
|
|
48
|
+
setTimeout(finish, MOTION.settle.duration * 1e3 + 80);
|
|
49
|
+
}
|
|
50
|
+
cancelClose() {
|
|
51
|
+
this.closing = false;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var HyDialogTitle = class HyDialogTitle {
|
|
55
|
+
id = injectId("dialog-title");
|
|
56
|
+
constructor() {
|
|
57
|
+
const el = inject(ElementRef).nativeElement;
|
|
58
|
+
afterNextRender(() => el.closest("[role=\"dialog\"], [role=\"alertdialog\"]")?.setAttribute("aria-labelledby", this.id));
|
|
59
|
+
}
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
61
|
+
minVersion: "12.0.0",
|
|
62
|
+
version: "22.2.3",
|
|
63
|
+
ngImport: i0,
|
|
64
|
+
type: HyDialogTitle,
|
|
65
|
+
deps: [],
|
|
66
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
67
|
+
});
|
|
68
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
69
|
+
minVersion: "14.0.0",
|
|
70
|
+
version: "22.2.3",
|
|
71
|
+
type: HyDialogTitle,
|
|
72
|
+
isStandalone: true,
|
|
73
|
+
selector: "[hyDialogTitle]",
|
|
74
|
+
host: {
|
|
75
|
+
properties: { "id": "id" },
|
|
76
|
+
classAttribute: "hy-dialog__title"
|
|
77
|
+
},
|
|
78
|
+
ngImport: i0
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
82
|
+
minVersion: "12.0.0",
|
|
83
|
+
version: "22.2.3",
|
|
84
|
+
ngImport: i0,
|
|
85
|
+
type: HyDialogTitle,
|
|
86
|
+
decorators: [{
|
|
87
|
+
type: Directive,
|
|
88
|
+
args: [{
|
|
89
|
+
selector: "[hyDialogTitle]",
|
|
90
|
+
host: {
|
|
91
|
+
class: "hy-dialog__title",
|
|
92
|
+
"[id]": "id"
|
|
93
|
+
}
|
|
94
|
+
}]
|
|
95
|
+
}],
|
|
96
|
+
ctorParameters: () => []
|
|
97
|
+
});
|
|
98
|
+
var HyDialogContent = class HyDialogContent {
|
|
99
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
100
|
+
minVersion: "12.0.0",
|
|
101
|
+
version: "22.2.3",
|
|
102
|
+
ngImport: i0,
|
|
103
|
+
type: HyDialogContent,
|
|
104
|
+
deps: [],
|
|
105
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
106
|
+
});
|
|
107
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
108
|
+
minVersion: "14.0.0",
|
|
109
|
+
version: "22.2.3",
|
|
110
|
+
type: HyDialogContent,
|
|
111
|
+
isStandalone: true,
|
|
112
|
+
selector: "[hyDialogContent]",
|
|
113
|
+
host: { classAttribute: "hy-dialog__content" },
|
|
114
|
+
ngImport: i0
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
118
|
+
minVersion: "12.0.0",
|
|
119
|
+
version: "22.2.3",
|
|
120
|
+
ngImport: i0,
|
|
121
|
+
type: HyDialogContent,
|
|
122
|
+
decorators: [{
|
|
123
|
+
type: Directive,
|
|
124
|
+
args: [{
|
|
125
|
+
selector: "[hyDialogContent]",
|
|
126
|
+
host: { class: "hy-dialog__content" }
|
|
127
|
+
}]
|
|
128
|
+
}]
|
|
129
|
+
});
|
|
130
|
+
var HyDialogActions = class HyDialogActions {
|
|
131
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
132
|
+
minVersion: "12.0.0",
|
|
133
|
+
version: "22.2.3",
|
|
134
|
+
ngImport: i0,
|
|
135
|
+
type: HyDialogActions,
|
|
136
|
+
deps: [],
|
|
137
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
138
|
+
});
|
|
139
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
140
|
+
minVersion: "14.0.0",
|
|
141
|
+
version: "22.2.3",
|
|
142
|
+
type: HyDialogActions,
|
|
143
|
+
isStandalone: true,
|
|
144
|
+
selector: "[hyDialogActions]",
|
|
145
|
+
host: { classAttribute: "hy-dialog__actions" },
|
|
146
|
+
ngImport: i0
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
150
|
+
minVersion: "12.0.0",
|
|
151
|
+
version: "22.2.3",
|
|
152
|
+
ngImport: i0,
|
|
153
|
+
type: HyDialogActions,
|
|
154
|
+
decorators: [{
|
|
155
|
+
type: Directive,
|
|
156
|
+
args: [{
|
|
157
|
+
selector: "[hyDialogActions]",
|
|
158
|
+
host: { class: "hy-dialog__actions" }
|
|
159
|
+
}]
|
|
160
|
+
}]
|
|
161
|
+
});
|
|
162
|
+
var HyDialogClose = class HyDialogClose {
|
|
163
|
+
ref = inject(HyDialogRef, { optional: true });
|
|
164
|
+
hyDialogClose = input(void 0, {
|
|
165
|
+
...ngDevMode ? { debugName: "hyDialogClose" } : /* istanbul ignore next */ {},
|
|
166
|
+
transform: (value) => value === "" ? void 0 : value
|
|
167
|
+
});
|
|
168
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
169
|
+
minVersion: "12.0.0",
|
|
170
|
+
version: "22.2.3",
|
|
171
|
+
ngImport: i0,
|
|
172
|
+
type: HyDialogClose,
|
|
173
|
+
deps: [],
|
|
174
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
175
|
+
});
|
|
176
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
177
|
+
minVersion: "17.1.0",
|
|
178
|
+
version: "22.2.3",
|
|
179
|
+
type: HyDialogClose,
|
|
180
|
+
isStandalone: true,
|
|
181
|
+
selector: "button[hyDialogClose]",
|
|
182
|
+
inputs: { hyDialogClose: {
|
|
183
|
+
classPropertyName: "hyDialogClose",
|
|
184
|
+
publicName: "hyDialogClose",
|
|
185
|
+
isSignal: true,
|
|
186
|
+
isRequired: false,
|
|
187
|
+
transformFunction: null
|
|
188
|
+
} },
|
|
189
|
+
host: {
|
|
190
|
+
attributes: { "type": "button" },
|
|
191
|
+
listeners: { "click": "ref?.close(hyDialogClose())" }
|
|
192
|
+
},
|
|
193
|
+
ngImport: i0
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
197
|
+
minVersion: "12.0.0",
|
|
198
|
+
version: "22.2.3",
|
|
199
|
+
ngImport: i0,
|
|
200
|
+
type: HyDialogClose,
|
|
201
|
+
decorators: [{
|
|
202
|
+
type: Directive,
|
|
203
|
+
args: [{
|
|
204
|
+
selector: "button[hyDialogClose]",
|
|
205
|
+
host: {
|
|
206
|
+
type: "button",
|
|
207
|
+
"(click)": "ref?.close(hyDialogClose())"
|
|
208
|
+
}
|
|
209
|
+
}]
|
|
210
|
+
}],
|
|
211
|
+
propDecorators: { hyDialogClose: [{
|
|
212
|
+
type: i0.Input,
|
|
213
|
+
args: [{
|
|
214
|
+
isSignal: true,
|
|
215
|
+
alias: "hyDialogClose",
|
|
216
|
+
required: false
|
|
217
|
+
}]
|
|
218
|
+
}] }
|
|
219
|
+
});
|
|
220
|
+
const HY_DIALOG_PARTS = [
|
|
221
|
+
HyDialogTitle,
|
|
222
|
+
HyDialogContent,
|
|
223
|
+
HyDialogActions,
|
|
224
|
+
HyDialogClose
|
|
225
|
+
];
|
|
226
|
+
const SLOP = 10;
|
|
227
|
+
const INTERACTIVE = "button, a[href], input, select, textarea, label, summary, [contenteditable], [role=\"slider\"], [tabindex]:not([tabindex=\"-1\"])";
|
|
228
|
+
function driveSheet(panel, backdrop, side, host) {
|
|
229
|
+
const lifetime = new ((panel.ownerDocument.defaultView?.AbortController) ?? AbortController)();
|
|
230
|
+
let disposed = false;
|
|
231
|
+
let resize;
|
|
232
|
+
let clickTimer;
|
|
233
|
+
const vertical = side === "bottom";
|
|
234
|
+
const rtl = getComputedStyle(panel).direction === "rtl";
|
|
235
|
+
const sign = vertical ? 1 : side === "end" !== rtl ? 1 : -1;
|
|
236
|
+
const size = () => (vertical ? panel.offsetHeight : panel.offsetWidth) + 32;
|
|
237
|
+
panel.classList.add("hy-sheet-driven");
|
|
238
|
+
if (backdrop) backdrop.style.transition = "none";
|
|
239
|
+
const paint = (offset) => {
|
|
240
|
+
const full = size();
|
|
241
|
+
let shown = offset < 0 ? rubberband(offset, full) : offset;
|
|
242
|
+
if (!host.dismissible && offset > 0) shown = rubberband(offset, full);
|
|
243
|
+
const px = `${shown * sign}px`;
|
|
244
|
+
panel.style.translate = vertical ? `0 ${px}` : `${px} 0`;
|
|
245
|
+
if (backdrop) backdrop.style.opacity = String(Math.min(1, Math.max(0, 1 - shown / full)));
|
|
246
|
+
};
|
|
247
|
+
const spring = new HySpring(0, paint);
|
|
248
|
+
panel.style.translate = vertical ? "0 100%" : `${sign * 100}% 0`;
|
|
249
|
+
if (backdrop) backdrop.style.opacity = "0";
|
|
250
|
+
let enterFrame = requestAnimationFrame(() => {
|
|
251
|
+
enterFrame = 0;
|
|
252
|
+
spring.set(size());
|
|
253
|
+
spring.to(0, SPRINGS.settle);
|
|
254
|
+
});
|
|
255
|
+
let closing = false;
|
|
256
|
+
const exit = (finish) => {
|
|
257
|
+
cancelAnimationFrame(enterFrame);
|
|
258
|
+
enterFrame = 0;
|
|
259
|
+
if (disposed || panel.ownerDocument.hidden) {
|
|
260
|
+
spring.stop();
|
|
261
|
+
finish();
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
closing = true;
|
|
265
|
+
spring.to(size(), {
|
|
266
|
+
...SPRINGS.settle,
|
|
267
|
+
onRest: finish
|
|
268
|
+
});
|
|
269
|
+
};
|
|
270
|
+
if (vertical) {
|
|
271
|
+
const grabber = panel.ownerDocument.createElement("div");
|
|
272
|
+
grabber.className = "hy-drawer__grabber";
|
|
273
|
+
grabber.setAttribute("aria-hidden", "true");
|
|
274
|
+
panel.prepend(grabber);
|
|
275
|
+
if (typeof ResizeObserver === "function") {
|
|
276
|
+
resize = new ResizeObserver(() => {
|
|
277
|
+
panel.style.touchAction = panel.scrollHeight > panel.clientHeight + 1 ? "" : "none";
|
|
278
|
+
});
|
|
279
|
+
resize.observe(panel);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
let press = null;
|
|
283
|
+
const tracker = new HyVelocityTracker();
|
|
284
|
+
const along = (e) => (vertical ? e.clientY : e.clientX) * sign;
|
|
285
|
+
const across = (e) => vertical ? e.clientX : e.clientY;
|
|
286
|
+
const grab = (p, e) => {
|
|
287
|
+
p.dragging = true;
|
|
288
|
+
p.x = along(e);
|
|
289
|
+
p.from = spring.value;
|
|
290
|
+
spring.stop();
|
|
291
|
+
if (closing) {
|
|
292
|
+
closing = false;
|
|
293
|
+
host.cancelClose();
|
|
294
|
+
}
|
|
295
|
+
tracker.reset();
|
|
296
|
+
tracker.add(spring.value);
|
|
297
|
+
try {
|
|
298
|
+
panel.setPointerCapture(e.pointerId);
|
|
299
|
+
} catch {}
|
|
300
|
+
panel.dataset["dragging"] = "";
|
|
301
|
+
panel.ownerDocument.getSelection()?.removeAllRanges();
|
|
302
|
+
};
|
|
303
|
+
panel.addEventListener("pointerdown", (e) => {
|
|
304
|
+
if (e.button !== 0 || !e.isPrimary) return;
|
|
305
|
+
const target = e.target;
|
|
306
|
+
const onGrabber = !!target.closest(".hy-drawer__grabber");
|
|
307
|
+
if (!onGrabber && target.closest(INTERACTIVE)) return;
|
|
308
|
+
if (vertical && !onGrabber && panel.scrollTop > 0) return;
|
|
309
|
+
const p = {
|
|
310
|
+
id: e.pointerId,
|
|
311
|
+
x: along(e),
|
|
312
|
+
y: across(e),
|
|
313
|
+
from: spring.value,
|
|
314
|
+
dragging: false
|
|
315
|
+
};
|
|
316
|
+
press = p;
|
|
317
|
+
if (spring.running) grab(p, e);
|
|
318
|
+
}, { signal: lifetime.signal });
|
|
319
|
+
panel.addEventListener("pointermove", (e) => {
|
|
320
|
+
if (!press || e.pointerId !== press.id) return;
|
|
321
|
+
const moved = along(e) - press.x;
|
|
322
|
+
if (!press.dragging) {
|
|
323
|
+
const cross = Math.abs(across(e) - press.y);
|
|
324
|
+
if (cross > SLOP && cross > Math.abs(moved)) {
|
|
325
|
+
press = null;
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (Math.abs(moved) < SLOP) return;
|
|
329
|
+
grab(press, e);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
const offset = press.from + moved;
|
|
333
|
+
tracker.add(offset);
|
|
334
|
+
spring.set(offset);
|
|
335
|
+
}, { signal: lifetime.signal });
|
|
336
|
+
const swallow = (click) => {
|
|
337
|
+
click.stopPropagation();
|
|
338
|
+
click.preventDefault();
|
|
339
|
+
};
|
|
340
|
+
const release = (e) => {
|
|
341
|
+
if (!press || e.pointerId !== press.id) return;
|
|
342
|
+
const wasDragging = press.dragging;
|
|
343
|
+
press = null;
|
|
344
|
+
if (!wasDragging) return;
|
|
345
|
+
delete panel.dataset["dragging"];
|
|
346
|
+
panel.addEventListener("click", swallow, {
|
|
347
|
+
capture: true,
|
|
348
|
+
once: true,
|
|
349
|
+
signal: lifetime.signal
|
|
350
|
+
});
|
|
351
|
+
clearTimeout(clickTimer);
|
|
352
|
+
clickTimer = setTimeout(() => panel.removeEventListener("click", swallow, { capture: true }));
|
|
353
|
+
const velocity = e.type === "pointercancel" ? 0 : tracker.velocity();
|
|
354
|
+
const full = size();
|
|
355
|
+
const landing = spring.value + project(velocity);
|
|
356
|
+
const out = Math.abs(velocity) > 400 ? velocity > 0 : landing > full / 2;
|
|
357
|
+
spring.velocity = velocity;
|
|
358
|
+
if (out && host.dismissible) host.close();
|
|
359
|
+
else spring.to(0, SPRINGS.settle);
|
|
360
|
+
};
|
|
361
|
+
panel.addEventListener("pointerup", release, { signal: lifetime.signal });
|
|
362
|
+
panel.addEventListener("pointercancel", release, { signal: lifetime.signal });
|
|
363
|
+
return {
|
|
364
|
+
exit,
|
|
365
|
+
destroy: () => {
|
|
366
|
+
if (disposed) return;
|
|
367
|
+
disposed = true;
|
|
368
|
+
cancelAnimationFrame(enterFrame);
|
|
369
|
+
spring.stop();
|
|
370
|
+
resize?.disconnect();
|
|
371
|
+
lifetime.abort();
|
|
372
|
+
clearTimeout(clickTimer);
|
|
373
|
+
press = null;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function openSurface(cdk, motion, fidelity, content, config, extra) {
|
|
378
|
+
let ref;
|
|
379
|
+
const dismissible = config.dismissible ?? true;
|
|
380
|
+
const cdkRef = cdk.open(content, {
|
|
381
|
+
data: config.data,
|
|
382
|
+
role: config.role ?? "dialog",
|
|
383
|
+
ariaLabel: config.label ?? null,
|
|
384
|
+
autoFocus: config.autoFocus ?? "first-tabbable",
|
|
385
|
+
restoreFocus: true,
|
|
386
|
+
ariaModal: true,
|
|
387
|
+
disableClose: true,
|
|
388
|
+
hasBackdrop: true,
|
|
389
|
+
backdropClass: "hy-backdrop",
|
|
390
|
+
panelClass: extra.panelClass,
|
|
391
|
+
positionStrategy: extra.positionStrategy,
|
|
392
|
+
width: extra.width,
|
|
393
|
+
maxWidth: extra.maxWidth,
|
|
394
|
+
height: extra.height,
|
|
395
|
+
providers: (dialogRef) => {
|
|
396
|
+
ref = new HyDialogRef(dialogRef);
|
|
397
|
+
return [{
|
|
398
|
+
provide: HyDialogRef,
|
|
399
|
+
useValue: ref
|
|
400
|
+
}, {
|
|
401
|
+
provide: HY_DIALOG_DATA,
|
|
402
|
+
useValue: config.data
|
|
403
|
+
}];
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
const hyRef = ref ?? new HyDialogRef(cdkRef);
|
|
407
|
+
const container = hyRef.containerElement;
|
|
408
|
+
if (container) {
|
|
409
|
+
container.classList.add("hy-glass");
|
|
410
|
+
container.dataset["material"] = fidelity.tier() === "low" ? "solid" : config.material ?? "frosted";
|
|
411
|
+
container.dataset["thickness"] = "thick";
|
|
412
|
+
if (extra.sheet && !motion.reduced()) {
|
|
413
|
+
const driver = driveSheet(container, cdkRef.overlayRef.backdropElement, extra.sheet, {
|
|
414
|
+
dismissible,
|
|
415
|
+
close: () => hyRef.close(),
|
|
416
|
+
cancelClose: () => hyRef.cancelClose()
|
|
417
|
+
});
|
|
418
|
+
hyRef.exit = driver.exit;
|
|
419
|
+
cdkRef.closed.subscribe(() => driver.destroy());
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if (dismissible) {
|
|
423
|
+
cdkRef.backdropClick.subscribe(() => hyRef.close());
|
|
424
|
+
cdkRef.keydownEvents.pipe(filter((e) => e.key === "Escape" && !e.defaultPrevented)).subscribe((e) => {
|
|
425
|
+
e.preventDefault();
|
|
426
|
+
hyRef.close();
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
return hyRef;
|
|
430
|
+
}
|
|
431
|
+
const MAX_WIDTH = {
|
|
432
|
+
sm: "26rem",
|
|
433
|
+
md: "36rem",
|
|
434
|
+
lg: "52rem",
|
|
435
|
+
full: "72rem"
|
|
436
|
+
};
|
|
437
|
+
var HyConfirmDialog = class HyConfirmDialog {
|
|
438
|
+
data = inject(HY_DIALOG_DATA);
|
|
439
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
440
|
+
minVersion: "12.0.0",
|
|
441
|
+
version: "22.2.3",
|
|
442
|
+
ngImport: i0,
|
|
443
|
+
type: HyConfirmDialog,
|
|
444
|
+
deps: [],
|
|
445
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
446
|
+
});
|
|
447
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
448
|
+
minVersion: "17.0.0",
|
|
449
|
+
version: "22.2.3",
|
|
450
|
+
type: HyConfirmDialog,
|
|
451
|
+
isStandalone: true,
|
|
452
|
+
selector: "hy-confirm-dialog",
|
|
453
|
+
ngImport: i0,
|
|
454
|
+
template: "<h2 hyDialogTitle>{{ data.title }}</h2>\r\n@if (data.message) {\r\n <p hyDialogContent>{{ data.message }}</p>\r\n}\r\n<div hyDialogActions>\r\n <button hyButton variant=\"ghost\" tone=\"neutral\" [hyDialogClose]=\"false\">\r\n {{ data.cancelLabel ?? 'Cancel' }}\r\n </button>\r\n <button hyButton [tone]=\"data.tone ?? 'primary'\" [hyDialogClose]=\"true\">\r\n {{ data.confirmLabel ?? 'Confirm' }}\r\n </button>\r\n</div>\r\n",
|
|
455
|
+
dependencies: [
|
|
456
|
+
{
|
|
457
|
+
kind: "directive",
|
|
458
|
+
type: HyDialogTitle,
|
|
459
|
+
selector: "[hyDialogTitle]"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
kind: "directive",
|
|
463
|
+
type: HyDialogContent,
|
|
464
|
+
selector: "[hyDialogContent]"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
kind: "directive",
|
|
468
|
+
type: HyDialogActions,
|
|
469
|
+
selector: "[hyDialogActions]"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
kind: "directive",
|
|
473
|
+
type: HyDialogClose,
|
|
474
|
+
selector: "button[hyDialogClose]",
|
|
475
|
+
inputs: ["hyDialogClose"]
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
kind: "component",
|
|
479
|
+
type: HyButton,
|
|
480
|
+
selector: "button[hyButton], a[hyButton]",
|
|
481
|
+
inputs: [
|
|
482
|
+
"variant",
|
|
483
|
+
"size",
|
|
484
|
+
"tone",
|
|
485
|
+
"iconOnly",
|
|
486
|
+
"loading",
|
|
487
|
+
"disabled"
|
|
488
|
+
]
|
|
489
|
+
}
|
|
490
|
+
],
|
|
491
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
492
|
+
});
|
|
493
|
+
};
|
|
494
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
495
|
+
minVersion: "12.0.0",
|
|
496
|
+
version: "22.2.3",
|
|
497
|
+
ngImport: i0,
|
|
498
|
+
type: HyConfirmDialog,
|
|
499
|
+
decorators: [{
|
|
500
|
+
type: Component,
|
|
501
|
+
args: [{
|
|
502
|
+
selector: "hy-confirm-dialog",
|
|
503
|
+
imports: [HY_DIALOG_PARTS, HyButton],
|
|
504
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
505
|
+
template: "<h2 hyDialogTitle>{{ data.title }}</h2>\r\n@if (data.message) {\r\n <p hyDialogContent>{{ data.message }}</p>\r\n}\r\n<div hyDialogActions>\r\n <button hyButton variant=\"ghost\" tone=\"neutral\" [hyDialogClose]=\"false\">\r\n {{ data.cancelLabel ?? 'Cancel' }}\r\n </button>\r\n <button hyButton [tone]=\"data.tone ?? 'primary'\" [hyDialogClose]=\"true\">\r\n {{ data.confirmLabel ?? 'Confirm' }}\r\n </button>\r\n</div>\r\n"
|
|
506
|
+
}]
|
|
507
|
+
}]
|
|
508
|
+
});
|
|
509
|
+
var HyDialog = class HyDialog {
|
|
510
|
+
cdk = inject(Dialog);
|
|
511
|
+
motion = inject(HyMotion);
|
|
512
|
+
fidelity = inject(HyFidelity);
|
|
513
|
+
open(content, config = {}) {
|
|
514
|
+
const size = config.size ?? "md";
|
|
515
|
+
return openSurface(this.cdk, this.motion, this.fidelity, content, config, {
|
|
516
|
+
panelClass: ["hy-dialog-pane", `hy-dialog--${size}`],
|
|
517
|
+
maxWidth: MAX_WIDTH[size]
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
async confirm(options) {
|
|
521
|
+
return await this.open(HyConfirmDialog, {
|
|
522
|
+
data: options,
|
|
523
|
+
size: "sm",
|
|
524
|
+
role: "alertdialog"
|
|
525
|
+
}).closed === true;
|
|
526
|
+
}
|
|
527
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
528
|
+
minVersion: "12.0.0",
|
|
529
|
+
version: "22.2.3",
|
|
530
|
+
ngImport: i0,
|
|
531
|
+
type: HyDialog,
|
|
532
|
+
deps: [],
|
|
533
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
534
|
+
});
|
|
535
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
536
|
+
minVersion: "12.0.0",
|
|
537
|
+
version: "22.2.3",
|
|
538
|
+
ngImport: i0,
|
|
539
|
+
type: HyDialog,
|
|
540
|
+
providedIn: "root"
|
|
541
|
+
});
|
|
542
|
+
};
|
|
543
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
544
|
+
minVersion: "12.0.0",
|
|
545
|
+
version: "22.2.3",
|
|
546
|
+
ngImport: i0,
|
|
547
|
+
type: HyDialog,
|
|
548
|
+
decorators: [{
|
|
549
|
+
type: Injectable,
|
|
550
|
+
args: [{ providedIn: "root" }]
|
|
551
|
+
}]
|
|
552
|
+
});
|
|
553
|
+
var HyDrawer = class HyDrawer {
|
|
554
|
+
cdk = inject(Dialog);
|
|
555
|
+
motion = inject(HyMotion);
|
|
556
|
+
fidelity = inject(HyFidelity);
|
|
557
|
+
injector = inject(Injector);
|
|
558
|
+
open(content, config = {}) {
|
|
559
|
+
const side = config.side ?? "end";
|
|
560
|
+
const position = createGlobalPositionStrategy(this.injector);
|
|
561
|
+
if (side === "bottom") position.bottom("0").centerHorizontally();
|
|
562
|
+
else if (side === "start") position.start("0").top("0");
|
|
563
|
+
else position.end("0").top("0");
|
|
564
|
+
return openSurface(this.cdk, this.motion, this.fidelity, content, config, {
|
|
565
|
+
panelClass: ["hy-drawer-pane", `hy-drawer--${side}`],
|
|
566
|
+
positionStrategy: position,
|
|
567
|
+
width: side === "bottom" ? "100%" : config.size ?? "min(24rem, 100vw - 2.5rem)",
|
|
568
|
+
height: side === "bottom" ? config.size ?? "auto" : "100%",
|
|
569
|
+
sheet: side
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
573
|
+
minVersion: "12.0.0",
|
|
574
|
+
version: "22.2.3",
|
|
575
|
+
ngImport: i0,
|
|
576
|
+
type: HyDrawer,
|
|
577
|
+
deps: [],
|
|
578
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
579
|
+
});
|
|
580
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
581
|
+
minVersion: "12.0.0",
|
|
582
|
+
version: "22.2.3",
|
|
583
|
+
ngImport: i0,
|
|
584
|
+
type: HyDrawer,
|
|
585
|
+
providedIn: "root"
|
|
586
|
+
});
|
|
587
|
+
};
|
|
588
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
589
|
+
minVersion: "12.0.0",
|
|
590
|
+
version: "22.2.3",
|
|
591
|
+
ngImport: i0,
|
|
592
|
+
type: HyDrawer,
|
|
593
|
+
decorators: [{
|
|
594
|
+
type: Injectable,
|
|
595
|
+
args: [{ providedIn: "root" }]
|
|
596
|
+
}]
|
|
597
|
+
});
|
|
598
|
+
export { HY_DIALOG_DATA, HY_DIALOG_PARTS, HyDialog, HyDialogActions, HyDialogClose, HyDialogContent, HyDialogRef, HyDialogTitle, HyDrawer };
|
|
599
|
+
|
|
600
|
+
//# sourceMappingURL=hyalo-angular-dialog.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyalo-angular-dialog.mjs","names":["i1.HyDialogTitle","i1.HyDialogContent","i1.HyDialogActions","i1.HyDialogClose"],"sources":["../../../projects/hyalo/dialog/dialog-ref.ts","../../../projects/hyalo/dialog/dialog-parts.ts","../../../projects/hyalo/dialog/sheet.ts","../../../projects/hyalo/dialog/open-surface.ts","../../../projects/hyalo/dialog/dialog.ts","../../../projects/hyalo/dialog/dialog.html","../../../projects/hyalo/dialog/drawer.ts"],"sourcesContent":["import { DialogRef } from '@angular/cdk/dialog';\r\nimport { InjectionToken } from '@angular/core';\r\nimport { firstValueFrom } from 'rxjs';\r\nimport { MOTION } from '@hyalo/angular/motion';\r\n\r\n/** Data passed to a dialog or drawer through `open(..., { data })`. */\r\nexport const HY_DIALOG_DATA = new InjectionToken<unknown>('HY_DIALOG_DATA');\r\n\r\n/**\r\n * Handle to an open dialog or drawer. Inject it in the content component to\r\n * close it, or keep the one `open()` returns.\r\n */\r\nexport class HyDialogRef<R = unknown> {\r\n private closing = false;\r\n\r\n /** Resolves with the result once the surface has closed. */\r\n readonly closed: Promise<R | undefined>;\r\n\r\n /**\r\n * @internal Set by surfaces that drive their own exit, like a sheet on a\r\n * spring. Calls `finish` once the surface is out of view.\r\n */\r\n exit: ((finish: () => void) => void) | null = null;\r\n\r\n /** @internal */\r\n constructor(private readonly cdkRef: DialogRef<R>) {\r\n this.closed = firstValueFrom(cdkRef.closed, { defaultValue: undefined });\r\n }\r\n\r\n /** Id of the dialog container element. */\r\n get id(): string {\r\n return this.cdkRef.id;\r\n }\r\n\r\n /** The element with `role=\"dialog\"`. */\r\n get containerElement(): HTMLElement | null {\r\n return this.cdkRef.overlayRef.overlayElement?.querySelector('.cdk-dialog-container') ?? null;\r\n }\r\n\r\n /**\r\n * Plays the exit animation, then closes. With reduced motion the exit is\r\n * a short fade. Calling it again while the animation runs does nothing.\r\n */\r\n close(result?: R): void {\r\n if (this.closing) return;\r\n this.closing = true;\r\n if (this.exit) {\r\n this.exit(() => this.cdkRef.close(result));\r\n return;\r\n }\r\n const pane = this.cdkRef.overlayRef.overlayElement;\r\n const backdrop = this.cdkRef.overlayRef.backdropElement;\r\n // The animation runs on the panel inside the pane.\r\n const panel = this.containerElement;\r\n pane.dataset['state'] = 'closing';\r\n backdrop?.setAttribute('data-state', 'closing');\r\n // The timeout is a safety net in case animationend never fires.\r\n let done = false;\r\n const finish = (): void => {\r\n if (done) return;\r\n done = true;\r\n pane.removeEventListener('animationend', onEnd);\r\n this.cdkRef.close(result);\r\n };\r\n // Ignore animations that bubble up from the content, like a button ripple.\r\n const onEnd = (event: Event): void => {\r\n if (event.target === pane || event.target === panel) finish();\r\n };\r\n pane.addEventListener('animationend', onEnd);\r\n setTimeout(finish, MOTION.settle.duration * 1000 + 80);\r\n }\r\n\r\n /**\r\n * @internal A sheet grabbed while it was closing stays open, and a later\r\n * `close()` works again.\r\n */\r\n cancelClose(): void {\r\n this.closing = false;\r\n }\r\n}\r\n","import { Directive, ElementRef, afterNextRender, inject, input } from '@angular/core';\r\nimport { injectId } from '@hyalo/angular/core';\r\n\r\nimport { HyDialogRef } from './dialog-ref';\r\n\r\n/**\r\n * The dialog or drawer heading. Its id becomes the container's\r\n * `aria-labelledby`, so screen readers announce it on open.\r\n */\r\n@Directive({\r\n selector: '[hyDialogTitle]',\r\n host: { class: 'hy-dialog__title', '[id]': 'id' },\r\n})\r\nexport class HyDialogTitle {\r\n protected readonly id = injectId('dialog-title');\r\n\r\n constructor() {\r\n const el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\r\n afterNextRender(() =>\r\n el.closest('[role=\"dialog\"], [role=\"alertdialog\"]')?.setAttribute('aria-labelledby', this.id),\r\n );\r\n }\r\n}\r\n\r\n/** The scrollable body. */\r\n@Directive({ selector: '[hyDialogContent]', host: { class: 'hy-dialog__content' } })\r\nexport class HyDialogContent {}\r\n\r\n/** The button row at the bottom. Primary action goes last. */\r\n@Directive({ selector: '[hyDialogActions]', host: { class: 'hy-dialog__actions' } })\r\nexport class HyDialogActions {}\r\n\r\n/** Closes the surrounding dialog or drawer with an optional result. */\r\n@Directive({\r\n selector: 'button[hyDialogClose]',\r\n host: { type: 'button', '(click)': 'ref?.close(hyDialogClose())' },\r\n})\r\nexport class HyDialogClose {\r\n protected readonly ref = inject(HyDialogRef, { optional: true });\r\n /** The result to close with. A bare attribute closes with `undefined`. */\r\n readonly hyDialogClose = input<unknown, unknown>(undefined, {\r\n transform: (value) => (value === '' ? undefined : value),\r\n });\r\n}\r\n\r\n/** Everything needed to lay out dialog or drawer content. */\r\nexport const HY_DIALOG_PARTS = [\r\n HyDialogTitle,\r\n HyDialogContent,\r\n HyDialogActions,\r\n HyDialogClose,\r\n] as const;\r\n","import { HySpring, HyVelocityTracker, project, rubberband, SPRINGS } from '@hyalo/angular/motion';\r\nimport type { HyDrawerSide } from './drawer';\r\n\r\n/** Movement before a press turns into a drag, in px. */\r\nconst SLOP = 10;\r\n/** Presses on these stay presses: they never start a drag. */\r\nconst INTERACTIVE =\r\n 'button, a[href], input, select, textarea, label, summary, [contenteditable], [role=\"slider\"], [tabindex]:not([tabindex=\"-1\"])';\r\n\r\n/** @internal What a drawer needs from its HyDialogRef. */\r\nexport interface HySheetHost {\r\n readonly dismissible: boolean;\r\n close(): void;\r\n cancelClose(): void;\r\n}\r\n\r\n/**\r\n * @internal Puts a drawer or bottom sheet on a spring and lets people drag\r\n * it toward its edge to close it.\r\n *\r\n * - Enter and exit run on the same spring, so the panel can be grabbed at\r\n * any moment, even while it is closing, and it follows from where it is.\r\n * - The drag tracks the pointer 1:1. Pulling the wrong way rubber-bands.\r\n * - On release the flick is projected forward, and the panel springs to\r\n * whichever end the projection lands nearer, carrying the finger's speed.\r\n * - The backdrop dims in step with how open the panel is.\r\n *\r\n * Returns the exit animation and its lifecycle cleanup.\r\n */\r\nexport function driveSheet(\r\n panel: HTMLElement,\r\n backdrop: HTMLElement | null,\r\n side: HyDrawerSide,\r\n host: HySheetHost,\r\n): { exit: (finish: () => void) => void; destroy: () => void } {\r\n const lifetime = new (panel.ownerDocument.defaultView?.AbortController ?? AbortController)();\r\n let disposed = false;\r\n let resize: ResizeObserver | undefined;\r\n let clickTimer: ReturnType<typeof setTimeout> | undefined;\r\n const vertical = side === 'bottom';\r\n const rtl = getComputedStyle(panel).direction === 'rtl';\r\n // +1 when closing moves toward larger x or y.\r\n const sign = vertical ? 1 : (side === 'end') !== rtl ? 1 : -1;\r\n // Extra travel so the shadow is gone too.\r\n const size = (): number => (vertical ? panel.offsetHeight : panel.offsetWidth) + 32;\r\n\r\n panel.classList.add('hy-sheet-driven');\r\n if (backdrop) backdrop.style.transition = 'none';\r\n\r\n /** `offset` is how far the panel has moved out, in px. 0 is open. */\r\n const paint = (offset: number): void => {\r\n const full = size();\r\n // Past the open position, and past closed when it may not close, the\r\n // panel resists instead of following.\r\n let shown = offset < 0 ? rubberband(offset, full) : offset;\r\n if (!host.dismissible && offset > 0) shown = rubberband(offset, full);\r\n const px = `${shown * sign}px`;\r\n panel.style.translate = vertical ? `0 ${px}` : `${px} 0`;\r\n if (backdrop) backdrop.style.opacity = String(Math.min(1, Math.max(0, 1 - shown / full)));\r\n };\r\n\r\n const spring = new HySpring(0, paint);\r\n // Start out of view without measuring yet; the content has not rendered.\r\n panel.style.translate = vertical ? '0 100%' : `${sign * 100}% 0`;\r\n if (backdrop) backdrop.style.opacity = '0';\r\n let enterFrame = requestAnimationFrame(() => {\r\n enterFrame = 0;\r\n spring.set(size());\r\n spring.to(0, SPRINGS.settle);\r\n });\r\n\r\n let closing = false;\r\n const exit = (finish: () => void): void => {\r\n cancelAnimationFrame(enterFrame);\r\n enterFrame = 0;\r\n // A hidden page runs no animation frames, so the spring would never\r\n // arrive and `closed` would never resolve.\r\n if (disposed || panel.ownerDocument.hidden) {\r\n spring.stop();\r\n finish();\r\n return;\r\n }\r\n closing = true;\r\n spring.to(size(), { ...SPRINGS.settle, onRest: finish });\r\n };\r\n\r\n // Touch scrolling and our drag must not fight. Side drawers drag across\r\n // the scroll direction. A sheet only takes vertical touches when its\r\n // content cannot scroll; otherwise it is dragged by the grabber.\r\n if (vertical) {\r\n const grabber = panel.ownerDocument.createElement('div');\r\n grabber.className = 'hy-drawer__grabber';\r\n grabber.setAttribute('aria-hidden', 'true');\r\n panel.prepend(grabber);\r\n if (typeof ResizeObserver === 'function') {\r\n resize = new ResizeObserver(() => {\r\n panel.style.touchAction = panel.scrollHeight > panel.clientHeight + 1 ? '' : 'none';\r\n });\r\n resize.observe(panel);\r\n }\r\n }\r\n\r\n interface Press {\r\n readonly id: number;\r\n x: number;\r\n readonly y: number;\r\n from: number;\r\n dragging: boolean;\r\n }\r\n let press: Press | null = null;\r\n const tracker = new HyVelocityTracker();\r\n const along = (e: PointerEvent): number => (vertical ? e.clientY : e.clientX) * sign;\r\n const across = (e: PointerEvent): number => (vertical ? e.clientX : e.clientY);\r\n\r\n const grab = (p: Press, e: PointerEvent): void => {\r\n p.dragging = true;\r\n p.x = along(e);\r\n p.from = spring.value;\r\n spring.stop();\r\n if (closing) {\r\n // Taken back mid-exit: the sheet stays, and close() can run again.\r\n closing = false;\r\n host.cancelClose();\r\n }\r\n tracker.reset();\r\n tracker.add(spring.value);\r\n try {\r\n panel.setPointerCapture(e.pointerId);\r\n } catch {\r\n // The pointer is already gone, as when it lifted on the same frame.\r\n }\r\n panel.dataset['dragging'] = '';\r\n panel.ownerDocument.getSelection()?.removeAllRanges();\r\n };\r\n\r\n panel.addEventListener(\r\n 'pointerdown',\r\n (e) => {\r\n if (e.button !== 0 || !e.isPrimary) return;\r\n const target = e.target as Element;\r\n const onGrabber = !!target.closest('.hy-drawer__grabber');\r\n if (!onGrabber && target.closest(INTERACTIVE)) return;\r\n if (vertical && !onGrabber && panel.scrollTop > 0) return;\r\n const p: Press = {\r\n id: e.pointerId,\r\n x: along(e),\r\n y: across(e),\r\n from: spring.value,\r\n dragging: false,\r\n };\r\n press = p;\r\n // A panel already in motion is caught right away, with no slop.\r\n if (spring.running) grab(p, e);\r\n },\r\n { signal: lifetime.signal },\r\n );\r\n\r\n panel.addEventListener(\r\n 'pointermove',\r\n (e) => {\r\n if (!press || e.pointerId !== press.id) return;\r\n const moved = along(e) - press.x;\r\n if (!press.dragging) {\r\n const cross = Math.abs(across(e) - press.y);\r\n if (cross > SLOP && cross > Math.abs(moved)) {\r\n press = null;\r\n return;\r\n }\r\n if (Math.abs(moved) < SLOP) return;\r\n grab(press, e);\r\n return;\r\n }\r\n const offset = press.from + moved;\r\n tracker.add(offset);\r\n spring.set(offset);\r\n },\r\n { signal: lifetime.signal },\r\n );\r\n\r\n const swallow = (click: Event): void => {\r\n click.stopPropagation();\r\n click.preventDefault();\r\n };\r\n const release = (e: PointerEvent): void => {\r\n if (!press || e.pointerId !== press.id) return;\r\n const wasDragging = press.dragging;\r\n press = null;\r\n if (!wasDragging) return;\r\n delete panel.dataset['dragging'];\r\n // A drag must not end in a click on whatever is under the pointer.\r\n panel.addEventListener('click', swallow, {\r\n capture: true,\r\n once: true,\r\n signal: lifetime.signal,\r\n });\r\n clearTimeout(clickTimer);\r\n clickTimer = setTimeout(() => panel.removeEventListener('click', swallow, { capture: true }));\r\n\r\n const velocity = e.type === 'pointercancel' ? 0 : tracker.velocity();\r\n const full = size();\r\n const landing = spring.value + project(velocity);\r\n // A clear flick decides by its direction, a slow release by where it lands.\r\n const out = Math.abs(velocity) > 400 ? velocity > 0 : landing > full / 2;\r\n spring.velocity = velocity;\r\n if (out && host.dismissible) host.close();\r\n else spring.to(0, SPRINGS.settle);\r\n };\r\n panel.addEventListener('pointerup', release, { signal: lifetime.signal });\r\n panel.addEventListener('pointercancel', release, { signal: lifetime.signal });\r\n\r\n return {\r\n exit,\r\n destroy: () => {\r\n if (disposed) return;\r\n disposed = true;\r\n cancelAnimationFrame(enterFrame);\r\n spring.stop();\r\n resize?.disconnect();\r\n lifetime.abort();\r\n clearTimeout(clickTimer);\r\n press = null;\r\n },\r\n };\r\n}\r\n","import { Dialog, type DialogConfig } from '@angular/cdk/dialog';\r\nimport type { ComponentType } from '@angular/cdk/portal';\r\nimport type { PositionStrategy } from '@angular/cdk/overlay';\r\nimport type { TemplateRef } from '@angular/core';\r\nimport { filter } from 'rxjs';\r\nimport type { HyFidelity, HyMaterial } from '@hyalo/angular/core';\r\nimport type { HyMotion } from '@hyalo/angular/motion';\r\nimport { HY_DIALOG_DATA, HyDialogRef } from './dialog-ref';\r\nimport type { HyDrawerSide } from './drawer';\r\nimport { driveSheet } from './sheet';\r\n\r\n/** Options shared by dialogs and drawers. */\r\nexport interface HySurfaceConfig<D> {\r\n /** Passed to the content as `HY_DIALOG_DATA`. */\r\n readonly data?: D;\r\n /** Accessible name, when the content has no `hyDialogTitle`. */\r\n readonly label?: string;\r\n /** Close on Escape and backdrop click. Defaults to true. */\r\n readonly dismissible?: boolean;\r\n /** Glass material of the panel. */\r\n readonly material?: HyMaterial;\r\n /** Where focus goes on open. Defaults to the first tabbable element. */\r\n readonly autoFocus?: DialogConfig['autoFocus'];\r\n /** `alertdialog` for messages that need an answer. */\r\n readonly role?: 'dialog' | 'alertdialog';\r\n}\r\n\r\n/** @internal Opens a CDK dialog wrapped in a HyDialogRef. */\r\nexport function openSurface<R, D>(\r\n cdk: Dialog,\r\n motion: HyMotion,\r\n fidelity: HyFidelity,\r\n content: ComponentType<unknown> | TemplateRef<unknown>,\r\n config: HySurfaceConfig<D>,\r\n extra: {\r\n panelClass: string[];\r\n positionStrategy?: PositionStrategy;\r\n width?: string;\r\n maxWidth?: string;\r\n height?: string;\r\n /** Drawers and sheets run on a spring and can be dragged closed. */\r\n sheet?: HyDrawerSide;\r\n },\r\n): HyDialogRef<R> {\r\n let ref: HyDialogRef<R> | undefined;\r\n const dismissible = config.dismissible ?? true;\r\n\r\n const cdkRef = cdk.open<R, D, unknown>(content, {\r\n data: config.data,\r\n role: config.role ?? 'dialog',\r\n ariaLabel: config.label ?? null,\r\n autoFocus: config.autoFocus ?? 'first-tabbable',\r\n restoreFocus: true,\r\n ariaModal: true,\r\n // Closing is handled here so the exit animation can play first.\r\n disableClose: true,\r\n hasBackdrop: true,\r\n backdropClass: 'hy-backdrop',\r\n panelClass: extra.panelClass,\r\n positionStrategy: extra.positionStrategy,\r\n width: extra.width,\r\n maxWidth: extra.maxWidth,\r\n height: extra.height,\r\n providers: (dialogRef) => {\r\n ref = new HyDialogRef<R>(dialogRef);\r\n return [\r\n { provide: HyDialogRef, useValue: ref },\r\n { provide: HY_DIALOG_DATA, useValue: config.data },\r\n ];\r\n },\r\n });\r\n\r\n const hyRef = ref ?? new HyDialogRef<R>(cdkRef);\r\n const container = hyRef.containerElement;\r\n if (container) {\r\n container.classList.add('hy-glass');\r\n container.dataset['material'] =\r\n fidelity.tier() === 'low' ? 'solid' : (config.material ?? 'frosted');\r\n // Dialogs and sheets are the largest glass on the page, so the thickest.\r\n container.dataset['thickness'] = 'thick';\r\n // With reduced motion the CSS cross-fade runs instead of the spring.\r\n if (extra.sheet && !motion.reduced()) {\r\n const driver = driveSheet(container, cdkRef.overlayRef.backdropElement, extra.sheet, {\r\n dismissible,\r\n close: () => hyRef.close(),\r\n cancelClose: () => hyRef.cancelClose(),\r\n });\r\n hyRef.exit = driver.exit;\r\n cdkRef.closed.subscribe(() => driver.destroy());\r\n }\r\n }\r\n if (dismissible) {\r\n cdkRef.backdropClick.subscribe(() => hyRef.close());\r\n cdkRef.keydownEvents\r\n .pipe(filter((e) => e.key === 'Escape' && !e.defaultPrevented))\r\n .subscribe((e) => {\r\n e.preventDefault();\r\n hyRef.close();\r\n });\r\n }\r\n return hyRef;\r\n}\r\n","import { Dialog } from '@angular/cdk/dialog';\r\nimport type { ComponentType } from '@angular/cdk/portal';\r\nimport { ChangeDetectionStrategy, Component, Injectable, TemplateRef, inject } from '@angular/core';\r\nimport { HyButton } from '@hyalo/angular/button';\r\n\r\nimport { HyFidelity, type HyTone } from '@hyalo/angular/core';\r\nimport { HyMotion } from '@hyalo/angular/motion';\r\n\r\nimport { HY_DIALOG_DATA, HyDialogRef } from './dialog-ref';\r\nimport { HY_DIALOG_PARTS } from './dialog-parts';\r\nimport { openSurface, type HySurfaceConfig } from './open-surface';\r\n\r\n/** Dialog width. `full` fills the screen on small viewports. */\r\nexport type HyDialogSize = 'sm' | 'md' | 'lg' | 'full';\r\n\r\n// Set inline because the CDK pane's own max-width sits outside our cascade layers.\r\nconst MAX_WIDTH: Record<HyDialogSize, string> = {\r\n sm: '26rem',\r\n md: '36rem',\r\n lg: '52rem',\r\n full: '72rem',\r\n};\r\n\r\n/** Options for {@link HyDialog.open}. */\r\nexport interface HyDialogConfig<D = unknown> extends HySurfaceConfig<D> {\r\n readonly size?: HyDialogSize;\r\n}\r\n\r\n/** Options for {@link HyDialog.confirm}. */\r\nexport interface HyConfirmOptions {\r\n readonly title: string;\r\n readonly message?: string;\r\n readonly confirmLabel?: string;\r\n readonly cancelLabel?: string;\r\n /** Use `danger` for destructive actions. */\r\n readonly tone?: HyTone;\r\n}\r\n\r\n@Component({\r\n selector: 'hy-confirm-dialog',\r\n imports: [HY_DIALOG_PARTS, HyButton],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n templateUrl: './dialog.html',\r\n})\r\nclass HyConfirmDialog {\r\n protected readonly data = inject(HY_DIALOG_DATA) as HyConfirmOptions;\r\n}\r\n\r\n/**\r\n * Opens modal dialogs. Focus is trapped inside while open and returns to\r\n * the element that opened it. Escape and a backdrop click close it unless\r\n * `dismissible` is false.\r\n *\r\n * ```ts\r\n * const ref = this.dialog.open(EditAddress, { data: address, size: 'md' });\r\n * const saved = await ref.closed;\r\n *\r\n * if (await this.dialog.confirm({ title: 'Delete this draft?', tone: 'danger', confirmLabel: 'Delete' })) {\r\n * ...\r\n * }\r\n * ```\r\n *\r\n * In the content component, inject `HyDialogRef` to close and\r\n * `HY_DIALOG_DATA` to read the data. Lay it out with `hyDialogTitle`,\r\n * `hyDialogContent` and `hyDialogActions`.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class HyDialog {\r\n private readonly cdk = inject(Dialog);\r\n private readonly motion = inject(HyMotion);\r\n private readonly fidelity = inject(HyFidelity);\r\n\r\n /** Opens a component or template as a dialog. */\r\n open<R = unknown, D = unknown>(\r\n content: ComponentType<unknown> | TemplateRef<unknown>,\r\n config: HyDialogConfig<D> = {},\r\n ): HyDialogRef<R> {\r\n const size = config.size ?? 'md';\r\n return openSurface<R, D>(this.cdk, this.motion, this.fidelity, content, config, {\r\n panelClass: ['hy-dialog-pane', `hy-dialog--${size}`],\r\n maxWidth: MAX_WIDTH[size],\r\n });\r\n }\r\n\r\n /** Asks a yes or no question. Resolves to true only when confirmed. */\r\n async confirm(options: HyConfirmOptions): Promise<boolean> {\r\n const ref = this.open<boolean, HyConfirmOptions>(HyConfirmDialog, {\r\n data: options,\r\n size: 'sm',\r\n role: 'alertdialog',\r\n });\r\n return (await ref.closed) === true;\r\n }\r\n}\r\n","<h2 hyDialogTitle>{{ data.title }}</h2>\r\n@if (data.message) {\r\n <p hyDialogContent>{{ data.message }}</p>\r\n}\r\n<div hyDialogActions>\r\n <button hyButton variant=\"ghost\" tone=\"neutral\" [hyDialogClose]=\"false\">\r\n {{ data.cancelLabel ?? 'Cancel' }}\r\n </button>\r\n <button hyButton [tone]=\"data.tone ?? 'primary'\" [hyDialogClose]=\"true\">\r\n {{ data.confirmLabel ?? 'Confirm' }}\r\n </button>\r\n</div>\r\n","import { Dialog } from '@angular/cdk/dialog';\r\nimport { createGlobalPositionStrategy } from '@angular/cdk/overlay';\r\nimport type { ComponentType } from '@angular/cdk/portal';\r\nimport { Injectable, Injector, TemplateRef, inject } from '@angular/core';\r\nimport { HyFidelity } from '@hyalo/angular/core';\r\nimport { HyMotion } from '@hyalo/angular/motion';\r\nimport type { HyDialogRef } from './dialog-ref';\r\nimport { openSurface, type HySurfaceConfig } from './open-surface';\r\n\r\n/**\r\n * Which edge the drawer slides from. `start` and `end` follow the text\r\n * direction, so `end` is the right edge in LTR and the left edge in RTL.\r\n * `bottom` gives a sheet, handy on phones.\r\n */\r\nexport type HyDrawerSide = 'start' | 'end' | 'bottom';\r\n\r\n/** Options for {@link HyDrawer.open}. */\r\nexport interface HyDrawerConfig<D = unknown> extends HySurfaceConfig<D> {\r\n readonly side?: HyDrawerSide;\r\n /** Any CSS length. Width for side drawers, height for the bottom sheet. */\r\n readonly size?: string;\r\n}\r\n\r\n/**\r\n * Opens a modal drawer: navigation on phones, a cart, filters. It behaves\r\n * like a dialog (focus trap, Escape, backdrop, focus restore) and uses the\r\n * same content parts and `HyDialogRef`.\r\n *\r\n * It runs on a spring and follows the pointer: drag it toward its edge, or\r\n * flick it, to close it, and grab it again while it moves. A bottom sheet\r\n * shows a grabber. With reduced motion it cross-fades instead.\r\n *\r\n * ```ts\r\n * this.drawer.open(CartPanel, { side: 'end', label: 'Cart' });\r\n * ```\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class HyDrawer {\r\n private readonly cdk = inject(Dialog);\r\n private readonly motion = inject(HyMotion);\r\n private readonly fidelity = inject(HyFidelity);\r\n private readonly injector = inject(Injector);\r\n\r\n /** Opens a component or template in a drawer. */\r\n open<R = unknown, D = unknown>(\r\n content: ComponentType<unknown> | TemplateRef<unknown>,\r\n config: HyDrawerConfig<D> = {},\r\n ): HyDialogRef<R> {\r\n const side = config.side ?? 'end';\r\n const position = createGlobalPositionStrategy(this.injector);\r\n if (side === 'bottom') position.bottom('0').centerHorizontally();\r\n else if (side === 'start') position.start('0').top('0');\r\n else position.end('0').top('0');\r\n\r\n return openSurface<R, D>(this.cdk, this.motion, this.fidelity, content, config, {\r\n panelClass: ['hy-drawer-pane', `hy-drawer--${side}`],\r\n positionStrategy: position,\r\n width: side === 'bottom' ? '100%' : (config.size ?? 'min(24rem, 100vw - 2.5rem)'),\r\n height: side === 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