@wirekyt/angular 0.0.13 → 0.0.15
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/dist/fesm2022/wirekyt-angular-dialog.mjs +532 -0
- package/dist/fesm2022/wirekyt-angular-dialog.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-download-trigger.mjs +83 -0
- package/dist/fesm2022/wirekyt-angular-download-trigger.mjs.map +1 -0
- package/dist/package.json +9 -1
- package/dist/types/wirekyt-angular-checkbox.d.ts +1 -1
- package/dist/types/wirekyt-angular-color-picker.d.ts +1 -1
- package/dist/types/wirekyt-angular-combobox.d.ts +1 -1
- package/dist/types/wirekyt-angular-date-picker.d.ts +1 -1
- package/dist/types/wirekyt-angular-dialog.d.ts +142 -0
- package/dist/types/wirekyt-angular-dialog.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-download-trigger.d.ts +35 -0
- package/dist/types/wirekyt-angular-download-trigger.d.ts.map +1 -0
- package/package.json +10 -2
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import * as dialog from '@wirekyt/dom/machines/dialog';
|
|
2
|
+
export { anatomy as dialogAnatomy } from '@wirekyt/dom/machines/dialog';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken, inject, input, model, booleanAttribute, output, EnvironmentInjector, Injector, forwardRef, Directive, computed, DestroyRef, Renderer2, ElementRef, TemplateRef, ViewContainerRef, effect, untracked } from '@angular/core';
|
|
5
|
+
import { injectLocale, injectEnvironment, createId, useMachine, buildRootCarrier, bindProps } from '@wirekyt/angular';
|
|
6
|
+
import { PresenceBase, PRESENCE_CONTEXT, injectPresenceContext, usePresence } from '@wirekyt/angular/presence';
|
|
7
|
+
|
|
8
|
+
const DIALOG_CONTEXT = new InjectionToken("WIREKYT.DIALOG_CONTEXT");
|
|
9
|
+
function injectDialogContext() {
|
|
10
|
+
return inject(DIALOG_CONTEXT);
|
|
11
|
+
}
|
|
12
|
+
const DIALOG_CONTEXT_CARRIER = new InjectionToken("WIREKYT.DIALOG_CONTEXT_CARRIER");
|
|
13
|
+
function injectDialogContextCarrier() {
|
|
14
|
+
return inject(DIALOG_CONTEXT_CARRIER);
|
|
15
|
+
}
|
|
16
|
+
const DIALOG_RENDER_STRATEGY_CONTEXT = new InjectionToken("WIREKYT.DIALOG_RENDER_STRATEGY_CONTEXT");
|
|
17
|
+
function injectDialogRenderStrategyContext() {
|
|
18
|
+
return inject(DIALOG_RENDER_STRATEGY_CONTEXT);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function useDialog(options) {
|
|
22
|
+
const locale = injectLocale();
|
|
23
|
+
const environment = injectEnvironment();
|
|
24
|
+
const fallbackId = createId();
|
|
25
|
+
return useMachine({
|
|
26
|
+
machine: dialog.machine,
|
|
27
|
+
context: () => {
|
|
28
|
+
const props = options.context();
|
|
29
|
+
return {
|
|
30
|
+
...props,
|
|
31
|
+
dir: locale.dir,
|
|
32
|
+
getRootNode: environment.getRootNode,
|
|
33
|
+
id: props.id ?? fallbackId,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
connect: (service, normalize) => dialog.connect(service, normalize),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
class DialogRoot extends PresenceBase {
|
|
41
|
+
id = input(undefined, /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
43
|
+
ids = input(undefined, /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "ids" }] : /* istanbul ignore next */ []));
|
|
45
|
+
ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
46
|
+
open = model(undefined, /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
48
|
+
defaultOpen = input(false, { ...(ngDevMode ? { debugName: "defaultOpen" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
49
|
+
modal = input(true, { ...(ngDevMode ? { debugName: "modal" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
50
|
+
closeOnInteractOutside = input(true, { ...(ngDevMode ? { debugName: "closeOnInteractOutside" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
51
|
+
closeOnEscape = input(true, { ...(ngDevMode ? { debugName: "closeOnEscape" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
52
|
+
preventScroll = input(true, { ...(ngDevMode ? { debugName: "preventScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
53
|
+
trapFocus = input(true, { ...(ngDevMode ? { debugName: "trapFocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
54
|
+
restoreFocus = input(true, { ...(ngDevMode ? { debugName: "restoreFocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
55
|
+
initialFocusEl = input(undefined, /* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [{ debugName: "initialFocusEl" }] : /* istanbul ignore next */ []));
|
|
57
|
+
finalFocusEl = input(undefined, /* @ts-ignore */
|
|
58
|
+
...(ngDevMode ? [{ debugName: "finalFocusEl" }] : /* istanbul ignore next */ []));
|
|
59
|
+
persistentElements = input(undefined, /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "persistentElements" }] : /* istanbul ignore next */ []));
|
|
61
|
+
role = input(undefined, /* @ts-ignore */
|
|
62
|
+
...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
63
|
+
triggerValue = model(undefined, /* @ts-ignore */
|
|
64
|
+
...(ngDevMode ? [{ debugName: "triggerValue" }] : /* istanbul ignore next */ []));
|
|
65
|
+
defaultTriggerValue = input(undefined, /* @ts-ignore */
|
|
66
|
+
...(ngDevMode ? [{ debugName: "defaultTriggerValue" }] : /* istanbul ignore next */ []));
|
|
67
|
+
escapeKeyDown = output();
|
|
68
|
+
focusOutside = output();
|
|
69
|
+
interactOutside = output();
|
|
70
|
+
pointerDownOutside = output();
|
|
71
|
+
requestDismiss = output();
|
|
72
|
+
openChangeDetails = output();
|
|
73
|
+
triggerValueChangeDetails = output();
|
|
74
|
+
machine = useDialog({
|
|
75
|
+
context: () => ({
|
|
76
|
+
id: this.id(),
|
|
77
|
+
ids: this.ids(),
|
|
78
|
+
"aria-label": this.ariaLabel(),
|
|
79
|
+
open: this.open(),
|
|
80
|
+
defaultOpen: this.defaultOpen(),
|
|
81
|
+
modal: this.modal(),
|
|
82
|
+
closeOnInteractOutside: this.closeOnInteractOutside(),
|
|
83
|
+
closeOnEscape: this.closeOnEscape(),
|
|
84
|
+
preventScroll: this.preventScroll(),
|
|
85
|
+
trapFocus: this.trapFocus(),
|
|
86
|
+
restoreFocus: this.restoreFocus(),
|
|
87
|
+
initialFocusEl: this.initialFocusEl(),
|
|
88
|
+
finalFocusEl: this.finalFocusEl(),
|
|
89
|
+
persistentElements: this.persistentElements(),
|
|
90
|
+
role: this.role(),
|
|
91
|
+
triggerValue: this.triggerValue(),
|
|
92
|
+
defaultTriggerValue: this.defaultTriggerValue(),
|
|
93
|
+
onOpenChange: (details) => {
|
|
94
|
+
if (this.open() !== details.open) {
|
|
95
|
+
this.open.set(details.open);
|
|
96
|
+
}
|
|
97
|
+
this.openChangeDetails.emit(details);
|
|
98
|
+
},
|
|
99
|
+
onTriggerValueChange: (details) => {
|
|
100
|
+
if (this.triggerValue() !== details.value) {
|
|
101
|
+
this.triggerValue.set(details.value);
|
|
102
|
+
}
|
|
103
|
+
this.triggerValueChangeDetails.emit(details);
|
|
104
|
+
},
|
|
105
|
+
onEscapeKeyDown: (event) => this.escapeKeyDown.emit(event),
|
|
106
|
+
onFocusOutside: (event) => this.focusOutside.emit(event),
|
|
107
|
+
onInteractOutside: (event) => this.interactOutside.emit(event),
|
|
108
|
+
onPointerDownOutside: (event) => this.pointerDownOutside.emit(event),
|
|
109
|
+
onRequestDismiss: (event) => this.requestDismiss.emit(event),
|
|
110
|
+
}),
|
|
111
|
+
});
|
|
112
|
+
state = this.machine.state;
|
|
113
|
+
api = this.machine.api;
|
|
114
|
+
service = this.machine.service;
|
|
115
|
+
send = this.machine.send;
|
|
116
|
+
presence = this.createPresence(() => this.api().open);
|
|
117
|
+
contextCarrier = buildRootCarrier({
|
|
118
|
+
providers: [
|
|
119
|
+
{ provide: PRESENCE_CONTEXT, useValue: this.presence },
|
|
120
|
+
{ provide: DIALOG_RENDER_STRATEGY_CONTEXT, useValue: this },
|
|
121
|
+
],
|
|
122
|
+
root: this,
|
|
123
|
+
rootToken: DIALOG_CONTEXT,
|
|
124
|
+
originInjector: inject(Injector),
|
|
125
|
+
environmentInjector: inject(EnvironmentInjector),
|
|
126
|
+
});
|
|
127
|
+
getContextCarrier() {
|
|
128
|
+
return this.contextCarrier;
|
|
129
|
+
}
|
|
130
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogRoot, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
131
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: DialogRoot, isStandalone: true, selector: "[dialogRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ids: { classPropertyName: "ids", publicName: "ids", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, closeOnInteractOutside: { classPropertyName: "closeOnInteractOutside", publicName: "closeOnInteractOutside", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, preventScroll: { classPropertyName: "preventScroll", publicName: "preventScroll", isSignal: true, isRequired: false, transformFunction: null }, trapFocus: { classPropertyName: "trapFocus", publicName: "trapFocus", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, initialFocusEl: { classPropertyName: "initialFocusEl", publicName: "initialFocusEl", isSignal: true, isRequired: false, transformFunction: null }, finalFocusEl: { classPropertyName: "finalFocusEl", publicName: "finalFocusEl", isSignal: true, isRequired: false, transformFunction: null }, persistentElements: { classPropertyName: "persistentElements", publicName: "persistentElements", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, triggerValue: { classPropertyName: "triggerValue", publicName: "triggerValue", isSignal: true, isRequired: false, transformFunction: null }, defaultTriggerValue: { classPropertyName: "defaultTriggerValue", publicName: "defaultTriggerValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", triggerValue: "triggerValueChange", escapeKeyDown: "escapeKeyDown", focusOutside: "focusOutside", interactOutside: "interactOutside", pointerDownOutside: "pointerDownOutside", requestDismiss: "requestDismiss", openChangeDetails: "openChangeDetails", triggerValueChangeDetails: "triggerValueChangeDetails" }, providers: [
|
|
132
|
+
{
|
|
133
|
+
provide: PRESENCE_CONTEXT,
|
|
134
|
+
useFactory: (root) => root.presence,
|
|
135
|
+
deps: [forwardRef(() => DialogRoot)],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
provide: DIALOG_RENDER_STRATEGY_CONTEXT,
|
|
139
|
+
useExisting: forwardRef(() => DialogRoot),
|
|
140
|
+
},
|
|
141
|
+
{ provide: DIALOG_CONTEXT, useExisting: forwardRef(() => DialogRoot) },
|
|
142
|
+
{
|
|
143
|
+
provide: DIALOG_CONTEXT_CARRIER,
|
|
144
|
+
useFactory: (root) => root.getContextCarrier(),
|
|
145
|
+
deps: [forwardRef(() => DialogRoot)],
|
|
146
|
+
},
|
|
147
|
+
], exportAs: ["dialogRoot"], usesInheritance: true, ngImport: i0 });
|
|
148
|
+
}
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogRoot, decorators: [{
|
|
150
|
+
type: Directive,
|
|
151
|
+
args: [{
|
|
152
|
+
selector: "[dialogRoot]",
|
|
153
|
+
standalone: true,
|
|
154
|
+
exportAs: "dialogRoot",
|
|
155
|
+
providers: [
|
|
156
|
+
{
|
|
157
|
+
provide: PRESENCE_CONTEXT,
|
|
158
|
+
useFactory: (root) => root.presence,
|
|
159
|
+
deps: [forwardRef(() => DialogRoot)],
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
provide: DIALOG_RENDER_STRATEGY_CONTEXT,
|
|
163
|
+
useExisting: forwardRef(() => DialogRoot),
|
|
164
|
+
},
|
|
165
|
+
{ provide: DIALOG_CONTEXT, useExisting: forwardRef(() => DialogRoot) },
|
|
166
|
+
{
|
|
167
|
+
provide: DIALOG_CONTEXT_CARRIER,
|
|
168
|
+
useFactory: (root) => root.getContextCarrier(),
|
|
169
|
+
deps: [forwardRef(() => DialogRoot)],
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
}]
|
|
173
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ids: [{ type: i0.Input, args: [{ isSignal: true, alias: "ids", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], closeOnInteractOutside: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnInteractOutside", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], preventScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "preventScroll", required: false }] }], trapFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "trapFocus", required: false }] }], restoreFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "restoreFocus", required: false }] }], initialFocusEl: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFocusEl", required: false }] }], finalFocusEl: [{ type: i0.Input, args: [{ isSignal: true, alias: "finalFocusEl", required: false }] }], persistentElements: [{ type: i0.Input, args: [{ isSignal: true, alias: "persistentElements", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], triggerValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerValue", required: false }] }, { type: i0.Output, args: ["triggerValueChange"] }], defaultTriggerValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultTriggerValue", required: false }] }], escapeKeyDown: [{ type: i0.Output, args: ["escapeKeyDown"] }], focusOutside: [{ type: i0.Output, args: ["focusOutside"] }], interactOutside: [{ type: i0.Output, args: ["interactOutside"] }], pointerDownOutside: [{ type: i0.Output, args: ["pointerDownOutside"] }], requestDismiss: [{ type: i0.Output, args: ["requestDismiss"] }], openChangeDetails: [{ type: i0.Output, args: ["openChangeDetails"] }], triggerValueChangeDetails: [{ type: i0.Output, args: ["triggerValueChangeDetails"] }] } });
|
|
174
|
+
|
|
175
|
+
class DialogRootProvider extends PresenceBase {
|
|
176
|
+
value = input.required(/* @ts-ignore */
|
|
177
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
178
|
+
state = computed(() => this.value().state(), /* @ts-ignore */
|
|
179
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
180
|
+
api = computed(() => this.value().api(), /* @ts-ignore */
|
|
181
|
+
...(ngDevMode ? [{ debugName: "api" }] : /* istanbul ignore next */ []));
|
|
182
|
+
send = (event) => this.value().send(event);
|
|
183
|
+
get service() {
|
|
184
|
+
return this.value().service;
|
|
185
|
+
}
|
|
186
|
+
presence = this.createPresence(() => {
|
|
187
|
+
try {
|
|
188
|
+
return this.api().open;
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
contextCarrier = buildRootCarrier({
|
|
195
|
+
providers: [
|
|
196
|
+
{ provide: PRESENCE_CONTEXT, useValue: this.presence },
|
|
197
|
+
{ provide: DIALOG_RENDER_STRATEGY_CONTEXT, useValue: this },
|
|
198
|
+
],
|
|
199
|
+
root: this,
|
|
200
|
+
rootToken: DIALOG_CONTEXT,
|
|
201
|
+
originInjector: inject(Injector),
|
|
202
|
+
environmentInjector: inject(EnvironmentInjector),
|
|
203
|
+
});
|
|
204
|
+
getContextCarrier() {
|
|
205
|
+
return this.contextCarrier;
|
|
206
|
+
}
|
|
207
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogRootProvider, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
208
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: DialogRootProvider, isStandalone: true, selector: "[dialogRootProvider]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
209
|
+
{
|
|
210
|
+
provide: PRESENCE_CONTEXT,
|
|
211
|
+
useFactory: (provider) => provider.presence,
|
|
212
|
+
deps: [forwardRef(() => DialogRootProvider)],
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
provide: DIALOG_RENDER_STRATEGY_CONTEXT,
|
|
216
|
+
useExisting: forwardRef(() => DialogRootProvider),
|
|
217
|
+
},
|
|
218
|
+
{ provide: DIALOG_CONTEXT, useExisting: forwardRef(() => DialogRootProvider) },
|
|
219
|
+
{
|
|
220
|
+
provide: DIALOG_CONTEXT_CARRIER,
|
|
221
|
+
useFactory: (provider) => provider.getContextCarrier(),
|
|
222
|
+
deps: [forwardRef(() => DialogRootProvider)],
|
|
223
|
+
},
|
|
224
|
+
], exportAs: ["dialogRootProvider"], usesInheritance: true, ngImport: i0 });
|
|
225
|
+
}
|
|
226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogRootProvider, decorators: [{
|
|
227
|
+
type: Directive,
|
|
228
|
+
args: [{
|
|
229
|
+
selector: "[dialogRootProvider]",
|
|
230
|
+
standalone: true,
|
|
231
|
+
exportAs: "dialogRootProvider",
|
|
232
|
+
providers: [
|
|
233
|
+
{
|
|
234
|
+
provide: PRESENCE_CONTEXT,
|
|
235
|
+
useFactory: (provider) => provider.presence,
|
|
236
|
+
deps: [forwardRef(() => DialogRootProvider)],
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
provide: DIALOG_RENDER_STRATEGY_CONTEXT,
|
|
240
|
+
useExisting: forwardRef(() => DialogRootProvider),
|
|
241
|
+
},
|
|
242
|
+
{ provide: DIALOG_CONTEXT, useExisting: forwardRef(() => DialogRootProvider) },
|
|
243
|
+
{
|
|
244
|
+
provide: DIALOG_CONTEXT_CARRIER,
|
|
245
|
+
useFactory: (provider) => provider.getContextCarrier(),
|
|
246
|
+
deps: [forwardRef(() => DialogRootProvider)],
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
}]
|
|
250
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
251
|
+
|
|
252
|
+
class DialogTrigger {
|
|
253
|
+
value = input(undefined, /* @ts-ignore */
|
|
254
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
255
|
+
constructor() {
|
|
256
|
+
const context = injectDialogContext();
|
|
257
|
+
const presence = injectPresenceContext();
|
|
258
|
+
bindProps({
|
|
259
|
+
elementRef: inject(ElementRef),
|
|
260
|
+
renderer: inject(Renderer2),
|
|
261
|
+
destroyRef: inject(DestroyRef),
|
|
262
|
+
props: () => {
|
|
263
|
+
const props = context.api().getTriggerProps({ value: this.value() });
|
|
264
|
+
return {
|
|
265
|
+
...props,
|
|
266
|
+
"aria-controls": presence.unmounted() ? undefined : props["aria-controls"],
|
|
267
|
+
};
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
272
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: DialogTrigger, isStandalone: true, selector: "[dialogTrigger]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["dialogTrigger"], ngImport: i0 });
|
|
273
|
+
}
|
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogTrigger, decorators: [{
|
|
275
|
+
type: Directive,
|
|
276
|
+
args: [{
|
|
277
|
+
selector: "[dialogTrigger]",
|
|
278
|
+
standalone: true,
|
|
279
|
+
exportAs: "dialogTrigger",
|
|
280
|
+
}]
|
|
281
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
|
|
282
|
+
|
|
283
|
+
class DialogBackdrop {
|
|
284
|
+
constructor() {
|
|
285
|
+
const context = injectDialogContext();
|
|
286
|
+
const renderStrategy = injectDialogRenderStrategyContext();
|
|
287
|
+
const presence = usePresence({
|
|
288
|
+
context: () => ({
|
|
289
|
+
present: context.api().open,
|
|
290
|
+
lazyMount: renderStrategy.lazyMount(),
|
|
291
|
+
unmountOnExit: renderStrategy.unmountOnExit(),
|
|
292
|
+
}),
|
|
293
|
+
});
|
|
294
|
+
const template = inject((TemplateRef), { optional: true });
|
|
295
|
+
const container = inject(ViewContainerRef);
|
|
296
|
+
const host = inject(ElementRef);
|
|
297
|
+
const elementRef = template ? { nativeElement: null } : host;
|
|
298
|
+
let view;
|
|
299
|
+
effect(() => {
|
|
300
|
+
const unmounted = presence.unmounted();
|
|
301
|
+
if (template) {
|
|
302
|
+
if (unmounted) {
|
|
303
|
+
elementRef.nativeElement = null;
|
|
304
|
+
container.clear();
|
|
305
|
+
view = undefined;
|
|
306
|
+
}
|
|
307
|
+
else if (!view) {
|
|
308
|
+
view = container.createEmbeddedView(template);
|
|
309
|
+
elementRef.nativeElement =
|
|
310
|
+
view.rootNodes.find((node) => node.nodeType === 1) ?? null;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
untracked(() => presence.setNode(elementRef.nativeElement));
|
|
314
|
+
});
|
|
315
|
+
bindProps({
|
|
316
|
+
elementRef,
|
|
317
|
+
renderer: inject(Renderer2),
|
|
318
|
+
destroyRef: inject(DestroyRef),
|
|
319
|
+
props: () => {
|
|
320
|
+
presence.unmounted();
|
|
321
|
+
return { ...context.api().getBackdropProps(), ...presence.getPresenceProps() };
|
|
322
|
+
},
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogBackdrop, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
326
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: DialogBackdrop, isStandalone: true, selector: "[dialogBackdrop]", exportAs: ["dialogBackdrop"], ngImport: i0 });
|
|
327
|
+
}
|
|
328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogBackdrop, decorators: [{
|
|
329
|
+
type: Directive,
|
|
330
|
+
args: [{
|
|
331
|
+
selector: "[dialogBackdrop]",
|
|
332
|
+
standalone: true,
|
|
333
|
+
exportAs: "dialogBackdrop",
|
|
334
|
+
}]
|
|
335
|
+
}], ctorParameters: () => [] });
|
|
336
|
+
|
|
337
|
+
class DialogPositioner {
|
|
338
|
+
constructor() {
|
|
339
|
+
const context = injectDialogContext();
|
|
340
|
+
const presence = injectPresenceContext();
|
|
341
|
+
const template = inject((TemplateRef), { optional: true });
|
|
342
|
+
const container = inject(ViewContainerRef);
|
|
343
|
+
const host = inject(ElementRef);
|
|
344
|
+
const elementRef = template ? { nativeElement: null } : host;
|
|
345
|
+
let view;
|
|
346
|
+
effect(() => {
|
|
347
|
+
const unmounted = presence.unmounted();
|
|
348
|
+
if (template) {
|
|
349
|
+
if (unmounted) {
|
|
350
|
+
elementRef.nativeElement = null;
|
|
351
|
+
container.clear();
|
|
352
|
+
view = undefined;
|
|
353
|
+
}
|
|
354
|
+
else if (!view) {
|
|
355
|
+
view = container.createEmbeddedView(template);
|
|
356
|
+
elementRef.nativeElement =
|
|
357
|
+
view.rootNodes.find((node) => node.nodeType === 1) ?? null;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
bindProps({
|
|
362
|
+
elementRef,
|
|
363
|
+
renderer: inject(Renderer2),
|
|
364
|
+
destroyRef: inject(DestroyRef),
|
|
365
|
+
props: () => {
|
|
366
|
+
const unmounted = presence.unmounted();
|
|
367
|
+
return { ...context.api().getPositionerProps(), hidden: unmounted };
|
|
368
|
+
},
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogPositioner, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
372
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: DialogPositioner, isStandalone: true, selector: "[dialogPositioner]", exportAs: ["dialogPositioner"], ngImport: i0 });
|
|
373
|
+
}
|
|
374
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogPositioner, decorators: [{
|
|
375
|
+
type: Directive,
|
|
376
|
+
args: [{
|
|
377
|
+
selector: "[dialogPositioner]",
|
|
378
|
+
standalone: true,
|
|
379
|
+
exportAs: "dialogPositioner",
|
|
380
|
+
}]
|
|
381
|
+
}], ctorParameters: () => [] });
|
|
382
|
+
|
|
383
|
+
class DialogContent {
|
|
384
|
+
constructor() {
|
|
385
|
+
const context = injectDialogContext();
|
|
386
|
+
const presence = injectPresenceContext();
|
|
387
|
+
const template = inject((TemplateRef), { optional: true });
|
|
388
|
+
const container = inject(ViewContainerRef);
|
|
389
|
+
const host = inject(ElementRef);
|
|
390
|
+
const elementRef = template ? { nativeElement: null } : host;
|
|
391
|
+
let view;
|
|
392
|
+
effect(() => {
|
|
393
|
+
const unmounted = presence.unmounted();
|
|
394
|
+
if (template) {
|
|
395
|
+
if (unmounted) {
|
|
396
|
+
elementRef.nativeElement = null;
|
|
397
|
+
container.clear();
|
|
398
|
+
view = undefined;
|
|
399
|
+
}
|
|
400
|
+
else if (!view) {
|
|
401
|
+
view = container.createEmbeddedView(template);
|
|
402
|
+
elementRef.nativeElement =
|
|
403
|
+
view.rootNodes.find((node) => node.nodeType === 1) ?? null;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
untracked(() => presence.setNode(elementRef.nativeElement));
|
|
407
|
+
});
|
|
408
|
+
bindProps({
|
|
409
|
+
elementRef,
|
|
410
|
+
renderer: inject(Renderer2),
|
|
411
|
+
destroyRef: inject(DestroyRef),
|
|
412
|
+
props: () => {
|
|
413
|
+
presence.unmounted();
|
|
414
|
+
return { ...context.api().getContentProps(), ...presence.getPresenceProps() };
|
|
415
|
+
},
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
419
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: DialogContent, isStandalone: true, selector: "[dialogContent]", exportAs: ["dialogContent"], ngImport: i0 });
|
|
420
|
+
}
|
|
421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogContent, decorators: [{
|
|
422
|
+
type: Directive,
|
|
423
|
+
args: [{
|
|
424
|
+
selector: "[dialogContent]",
|
|
425
|
+
standalone: true,
|
|
426
|
+
exportAs: "dialogContent",
|
|
427
|
+
}]
|
|
428
|
+
}], ctorParameters: () => [] });
|
|
429
|
+
|
|
430
|
+
class DialogTitle {
|
|
431
|
+
constructor() {
|
|
432
|
+
const context = injectDialogContext();
|
|
433
|
+
bindProps({
|
|
434
|
+
elementRef: inject(ElementRef),
|
|
435
|
+
renderer: inject(Renderer2),
|
|
436
|
+
destroyRef: inject(DestroyRef),
|
|
437
|
+
props: () => context.api().getTitleProps(),
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
441
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: DialogTitle, isStandalone: true, selector: "[dialogTitle]", exportAs: ["dialogTitle"], ngImport: i0 });
|
|
442
|
+
}
|
|
443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogTitle, decorators: [{
|
|
444
|
+
type: Directive,
|
|
445
|
+
args: [{
|
|
446
|
+
selector: "[dialogTitle]",
|
|
447
|
+
standalone: true,
|
|
448
|
+
exportAs: "dialogTitle",
|
|
449
|
+
}]
|
|
450
|
+
}], ctorParameters: () => [] });
|
|
451
|
+
|
|
452
|
+
class DialogDescription {
|
|
453
|
+
constructor() {
|
|
454
|
+
const context = injectDialogContext();
|
|
455
|
+
bindProps({
|
|
456
|
+
elementRef: inject(ElementRef),
|
|
457
|
+
renderer: inject(Renderer2),
|
|
458
|
+
destroyRef: inject(DestroyRef),
|
|
459
|
+
props: () => context.api().getDescriptionProps(),
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
463
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: DialogDescription, isStandalone: true, selector: "[dialogDescription]", exportAs: ["dialogDescription"], ngImport: i0 });
|
|
464
|
+
}
|
|
465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogDescription, decorators: [{
|
|
466
|
+
type: Directive,
|
|
467
|
+
args: [{
|
|
468
|
+
selector: "[dialogDescription]",
|
|
469
|
+
standalone: true,
|
|
470
|
+
exportAs: "dialogDescription",
|
|
471
|
+
}]
|
|
472
|
+
}], ctorParameters: () => [] });
|
|
473
|
+
|
|
474
|
+
class DialogCloseTrigger {
|
|
475
|
+
constructor() {
|
|
476
|
+
const context = injectDialogContext();
|
|
477
|
+
bindProps({
|
|
478
|
+
elementRef: inject(ElementRef),
|
|
479
|
+
renderer: inject(Renderer2),
|
|
480
|
+
destroyRef: inject(DestroyRef),
|
|
481
|
+
props: () => context.api().getCloseTriggerProps(),
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogCloseTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
485
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: DialogCloseTrigger, isStandalone: true, selector: "[dialogCloseTrigger]", exportAs: ["dialogCloseTrigger"], ngImport: i0 });
|
|
486
|
+
}
|
|
487
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogCloseTrigger, decorators: [{
|
|
488
|
+
type: Directive,
|
|
489
|
+
args: [{
|
|
490
|
+
selector: "[dialogCloseTrigger]",
|
|
491
|
+
standalone: true,
|
|
492
|
+
exportAs: "dialogCloseTrigger",
|
|
493
|
+
}]
|
|
494
|
+
}], ctorParameters: () => [] });
|
|
495
|
+
|
|
496
|
+
class DialogContext {
|
|
497
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
498
|
+
void context;
|
|
499
|
+
return true;
|
|
500
|
+
}
|
|
501
|
+
dialog = injectDialogContext();
|
|
502
|
+
templateRef = inject(TemplateRef);
|
|
503
|
+
viewContainer = inject(ViewContainerRef);
|
|
504
|
+
constructor() {
|
|
505
|
+
const view = this.viewContainer.createEmbeddedView(this.templateRef, {
|
|
506
|
+
$implicit: this.dialog.api,
|
|
507
|
+
api: this.dialog.api,
|
|
508
|
+
});
|
|
509
|
+
effect(() => {
|
|
510
|
+
this.dialog.api();
|
|
511
|
+
view.detectChanges();
|
|
512
|
+
});
|
|
513
|
+
inject(DestroyRef).onDestroy(() => view.destroy());
|
|
514
|
+
}
|
|
515
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogContext, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
516
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: DialogContext, isStandalone: true, selector: "[dialogContext]", exportAs: ["dialogContext"], ngImport: i0 });
|
|
517
|
+
}
|
|
518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DialogContext, decorators: [{
|
|
519
|
+
type: Directive,
|
|
520
|
+
args: [{
|
|
521
|
+
selector: "[dialogContext]",
|
|
522
|
+
standalone: true,
|
|
523
|
+
exportAs: "dialogContext",
|
|
524
|
+
}]
|
|
525
|
+
}], ctorParameters: () => [] });
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Generated bundle index. Do not edit.
|
|
529
|
+
*/
|
|
530
|
+
|
|
531
|
+
export { DIALOG_CONTEXT, DIALOG_CONTEXT_CARRIER, DialogBackdrop, DialogCloseTrigger, DialogContent, DialogContext, DialogDescription, DialogPositioner, DialogRoot, DialogRootProvider, DialogTitle, DialogTrigger, injectDialogContext, injectDialogContextCarrier, useDialog };
|
|
532
|
+
//# sourceMappingURL=wirekyt-angular-dialog.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirekyt-angular-dialog.mjs","sources":["../../src/components/dialog/use-context.ts","../../src/components/dialog/use.ts","../../src/components/dialog/root.ts","../../src/components/dialog/root-provider.ts","../../src/components/dialog/trigger.ts","../../src/components/dialog/backdrop.ts","../../src/components/dialog/positioner.ts","../../src/components/dialog/content.ts","../../src/components/dialog/title.ts","../../src/components/dialog/description.ts","../../src/components/dialog/close-trigger.ts","../../src/components/dialog/context.ts","../../src/components/dialog/wirekyt-angular-dialog.ts"],"sourcesContent":["import type { ContextCarrier } from \"@wirekyt/angular\";\n\nimport { InjectionToken, inject, type Signal } from \"@angular/core\";\n\nimport type { UseDialogReturn } from \"./use\";\n\nexport const DIALOG_CONTEXT = new InjectionToken<UseDialogReturn>(\"WIREKYT.DIALOG_CONTEXT\");\n\nexport function injectDialogContext(): UseDialogReturn {\n return inject(DIALOG_CONTEXT);\n}\n\nexport const DIALOG_CONTEXT_CARRIER = new InjectionToken<ContextCarrier<UseDialogReturn>>(\n \"WIREKYT.DIALOG_CONTEXT_CARRIER\",\n);\n\nexport function injectDialogContextCarrier(): ContextCarrier<UseDialogReturn> {\n return inject(DIALOG_CONTEXT_CARRIER);\n}\n\nexport interface DialogRenderStrategyContext {\n readonly lazyMount: Signal<boolean>;\n readonly unmountOnExit: Signal<boolean>;\n}\n\nexport const DIALOG_RENDER_STRATEGY_CONTEXT = new InjectionToken<DialogRenderStrategyContext>(\n \"WIREKYT.DIALOG_RENDER_STRATEGY_CONTEXT\",\n);\n\nexport function injectDialogRenderStrategyContext(): DialogRenderStrategyContext {\n return inject(DIALOG_RENDER_STRATEGY_CONTEXT);\n}\n","import type { Machine } from \"@wirekyt/dom\";\n\nimport {\n createId,\n injectEnvironment,\n injectLocale,\n useMachine,\n type UseMachineReturn,\n} from \"@wirekyt/angular\";\nimport * as dialog from \"@wirekyt/dom/machines/dialog\";\n\ntype OptionalId<T extends { id: string }> = Omit<T, \"id\"> & { id?: string };\n\nexport interface UseDialogProps extends OptionalId<Omit<dialog.Props, \"dir\" | \"getRootNode\">> {}\n\nexport type UseDialogReturn = UseMachineReturn<dialog.Service[\"state\"], dialog.Api, dialog.Service>;\n\nexport interface UseDialogOptions {\n context: () => UseDialogProps;\n}\n\ntype DialogContext = Record<string, unknown>;\ntype DialogSchema = dialog.Machine extends Machine<infer TSchema> ? TSchema : never;\n\nexport function useDialog(options: UseDialogOptions): UseDialogReturn {\n const locale = injectLocale();\n const environment = injectEnvironment();\n const fallbackId = createId();\n\n return useMachine<DialogSchema, dialog.Api>({\n machine: dialog.machine,\n context: () => {\n const props = options.context();\n return {\n ...props,\n dir: locale.dir,\n getRootNode: environment.getRootNode,\n id: props.id ?? fallbackId,\n } as DialogContext;\n },\n connect: (service, normalize) => dialog.connect(service, normalize),\n });\n}\n","import type * as dialog from \"@wirekyt/dom/machines/dialog\";\n\nimport {\n Directive,\n EnvironmentInjector,\n Injector,\n type ProviderToken,\n booleanAttribute,\n forwardRef,\n inject,\n input,\n model,\n output,\n type InputSignal,\n type InputSignalWithTransform,\n type ModelSignal,\n type OutputEmitterRef,\n type Signal,\n} from \"@angular/core\";\nimport { buildRootCarrier, type ContextCarrier } from \"@wirekyt/angular\";\nimport { PRESENCE_CONTEXT, PresenceBase } from \"@wirekyt/angular/presence\";\n\nimport type {\n DialogElementIds,\n DialogFocusOutsideEvent,\n DialogInteractOutsideEvent,\n DialogPointerDownOutsideEvent,\n DialogOpenChangeDetails,\n DialogTriggerValueChangeDetails,\n} from \"./types\";\n\nimport { useDialog, type UseDialogReturn } from \"./use\";\nimport {\n DIALOG_CONTEXT,\n DIALOG_CONTEXT_CARRIER,\n DIALOG_RENDER_STRATEGY_CONTEXT,\n} from \"./use-context\";\n\n@Directive({\n selector: \"[dialogRoot]\",\n standalone: true,\n exportAs: \"dialogRoot\",\n providers: [\n {\n provide: PRESENCE_CONTEXT,\n useFactory: (root: DialogRoot) => root.presence,\n deps: [forwardRef(() => DialogRoot)],\n },\n {\n provide: DIALOG_RENDER_STRATEGY_CONTEXT,\n useExisting: forwardRef(() => DialogRoot),\n },\n { provide: DIALOG_CONTEXT, useExisting: forwardRef(() => DialogRoot) },\n {\n provide: DIALOG_CONTEXT_CARRIER,\n useFactory: (root: DialogRoot) => root.getContextCarrier(),\n deps: [forwardRef(() => DialogRoot)],\n },\n ],\n})\nexport class DialogRoot extends PresenceBase implements UseDialogReturn {\n readonly id: InputSignal<string | undefined> = input<string | undefined>(undefined);\n readonly ids: InputSignal<Partial<DialogElementIds> | undefined> = input<\n Partial<DialogElementIds> | undefined\n >(undefined);\n readonly ariaLabel: InputSignal<string | undefined> = input<string | undefined>(undefined, {\n alias: \"aria-label\",\n });\n readonly open: ModelSignal<boolean | undefined> = model<boolean | undefined>(undefined);\n readonly defaultOpen: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n readonly modal: InputSignalWithTransform<boolean, unknown> = input(true, {\n transform: booleanAttribute,\n });\n readonly closeOnInteractOutside: InputSignalWithTransform<boolean, unknown> = input(true, {\n transform: booleanAttribute,\n });\n readonly closeOnEscape: InputSignalWithTransform<boolean, unknown> = input(true, {\n transform: booleanAttribute,\n });\n readonly preventScroll: InputSignalWithTransform<boolean, unknown> = input(true, {\n transform: booleanAttribute,\n });\n readonly trapFocus: InputSignalWithTransform<boolean, unknown> = input(true, {\n transform: booleanAttribute,\n });\n readonly restoreFocus: InputSignalWithTransform<boolean, unknown> = input(true, {\n transform: booleanAttribute,\n });\n readonly initialFocusEl: InputSignal<(() => HTMLElement | null) | undefined> = input<\n (() => HTMLElement | null) | undefined\n >(undefined);\n readonly finalFocusEl: InputSignal<(() => HTMLElement | null) | undefined> = input<\n (() => HTMLElement | null) | undefined\n >(undefined);\n readonly persistentElements: InputSignal<(() => Element | null)[] | undefined> = input<\n (() => Element | null)[] | undefined\n >(undefined);\n readonly role: InputSignal<\"dialog\" | \"alertdialog\" | undefined> = input<\n \"dialog\" | \"alertdialog\" | undefined\n >(undefined);\n readonly triggerValue: ModelSignal<string | null | undefined> = model<string | null | undefined>(\n undefined,\n );\n readonly defaultTriggerValue: InputSignal<string | null | undefined> = input<\n string | null | undefined\n >(undefined);\n\n readonly escapeKeyDown: OutputEmitterRef<KeyboardEvent> = output<KeyboardEvent>();\n readonly focusOutside: OutputEmitterRef<DialogFocusOutsideEvent> =\n output<DialogFocusOutsideEvent>();\n readonly interactOutside: OutputEmitterRef<DialogInteractOutsideEvent> =\n output<DialogInteractOutsideEvent>();\n readonly pointerDownOutside: OutputEmitterRef<DialogPointerDownOutsideEvent> =\n output<DialogPointerDownOutsideEvent>();\n readonly requestDismiss: OutputEmitterRef<\n CustomEvent<{\n originalLayer: HTMLElement;\n targetLayer: HTMLElement | undefined;\n originalIndex: number;\n targetIndex: number;\n }>\n > = output<\n CustomEvent<{\n originalLayer: HTMLElement;\n targetLayer: HTMLElement | undefined;\n originalIndex: number;\n targetIndex: number;\n }>\n >();\n readonly openChangeDetails: OutputEmitterRef<DialogOpenChangeDetails> =\n output<DialogOpenChangeDetails>();\n readonly triggerValueChangeDetails: OutputEmitterRef<DialogTriggerValueChangeDetails> =\n output<DialogTriggerValueChangeDetails>();\n\n private readonly machine = useDialog({\n context: () => ({\n id: this.id(),\n ids: this.ids(),\n \"aria-label\": this.ariaLabel(),\n open: this.open(),\n defaultOpen: this.defaultOpen(),\n modal: this.modal(),\n closeOnInteractOutside: this.closeOnInteractOutside(),\n closeOnEscape: this.closeOnEscape(),\n preventScroll: this.preventScroll(),\n trapFocus: this.trapFocus(),\n restoreFocus: this.restoreFocus(),\n initialFocusEl: this.initialFocusEl(),\n finalFocusEl: this.finalFocusEl(),\n persistentElements: this.persistentElements(),\n role: this.role(),\n triggerValue: this.triggerValue(),\n defaultTriggerValue: this.defaultTriggerValue(),\n onOpenChange: (details) => {\n if (this.open() !== details.open) {\n this.open.set(details.open);\n }\n this.openChangeDetails.emit(details);\n },\n onTriggerValueChange: (details: DialogTriggerValueChangeDetails) => {\n if (this.triggerValue() !== details.value) {\n this.triggerValue.set(details.value);\n }\n this.triggerValueChangeDetails.emit(details);\n },\n onEscapeKeyDown: (event) => this.escapeKeyDown.emit(event),\n onFocusOutside: (event) => this.focusOutside.emit(event),\n onInteractOutside: (event) => this.interactOutside.emit(event),\n onPointerDownOutside: (event) => this.pointerDownOutside.emit(event),\n onRequestDismiss: (event) => this.requestDismiss.emit(event),\n }),\n });\n\n readonly state: Signal<dialog.Service[\"state\"]> = this.machine.state;\n readonly api: Signal<dialog.Api> = this.machine.api;\n readonly service: dialog.Service = this.machine.service;\n readonly send: dialog.Service[\"send\"] = this.machine.send;\n readonly presence = this.createPresence(() => this.api().open);\n\n protected readonly contextCarrier: ContextCarrier<DialogRoot> = buildRootCarrier<DialogRoot>({\n providers: [\n { provide: PRESENCE_CONTEXT, useValue: this.presence },\n { provide: DIALOG_RENDER_STRATEGY_CONTEXT, useValue: this },\n ],\n root: this,\n rootToken: DIALOG_CONTEXT as ProviderToken<DialogRoot>,\n originInjector: inject(Injector),\n environmentInjector: inject(EnvironmentInjector),\n });\n\n getContextCarrier(): ContextCarrier<DialogRoot> {\n return this.contextCarrier;\n }\n}\n","import type * as dialog from \"@wirekyt/dom/machines/dialog\";\n\nimport {\n Directive,\n EnvironmentInjector,\n Injector,\n type InputSignal,\n type ProviderToken,\n type Signal,\n computed,\n forwardRef,\n inject,\n input,\n} from \"@angular/core\";\nimport { buildRootCarrier, type ContextCarrier } from \"@wirekyt/angular\";\nimport { PRESENCE_CONTEXT, PresenceBase } from \"@wirekyt/angular/presence\";\n\nimport type { UseDialogReturn } from \"./use\";\n\nimport {\n DIALOG_CONTEXT,\n DIALOG_CONTEXT_CARRIER,\n DIALOG_RENDER_STRATEGY_CONTEXT,\n} from \"./use-context\";\n\n@Directive({\n selector: \"[dialogRootProvider]\",\n standalone: true,\n exportAs: \"dialogRootProvider\",\n providers: [\n {\n provide: PRESENCE_CONTEXT,\n useFactory: (provider: DialogRootProvider) => provider.presence,\n deps: [forwardRef(() => DialogRootProvider)],\n },\n {\n provide: DIALOG_RENDER_STRATEGY_CONTEXT,\n useExisting: forwardRef(() => DialogRootProvider),\n },\n { provide: DIALOG_CONTEXT, useExisting: forwardRef(() => DialogRootProvider) },\n {\n provide: DIALOG_CONTEXT_CARRIER,\n useFactory: (provider: DialogRootProvider) => provider.getContextCarrier(),\n deps: [forwardRef(() => DialogRootProvider)],\n },\n ],\n})\nexport class DialogRootProvider extends PresenceBase implements UseDialogReturn {\n readonly value: InputSignal<UseDialogReturn> = input.required<UseDialogReturn>();\n readonly state: Signal<dialog.Service[\"state\"]> = computed(() => this.value().state());\n readonly api: Signal<dialog.Api> = computed(() => this.value().api());\n readonly send: dialog.Service[\"send\"] = (event) => this.value().send(event);\n\n get service(): dialog.Service {\n return this.value().service;\n }\n\n readonly presence = this.createPresence(() => {\n try {\n return this.api().open;\n } catch {\n return false;\n }\n });\n\n protected readonly contextCarrier: ContextCarrier<DialogRootProvider> =\n buildRootCarrier<DialogRootProvider>({\n providers: [\n { provide: PRESENCE_CONTEXT, useValue: this.presence },\n { provide: DIALOG_RENDER_STRATEGY_CONTEXT, useValue: this },\n ],\n root: this,\n rootToken: DIALOG_CONTEXT as ProviderToken<DialogRootProvider>,\n originInjector: inject(Injector),\n environmentInjector: inject(EnvironmentInjector),\n });\n\n getContextCarrier(): ContextCarrier<DialogRootProvider> {\n return this.contextCarrier;\n }\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n inject,\n input,\n type InputSignal,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\nimport { injectPresenceContext } from \"@wirekyt/angular/presence\";\n\nimport { injectDialogContext } from \"./use-context\";\n\n@Directive({\n selector: \"[dialogTrigger]\",\n standalone: true,\n exportAs: \"dialogTrigger\",\n})\nexport class DialogTrigger {\n readonly value: InputSignal<string | undefined> = input<string | undefined>(undefined);\n\n constructor() {\n const context = injectDialogContext();\n const presence = injectPresenceContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => {\n const props = context.api().getTriggerProps({ value: this.value() });\n return {\n ...props,\n \"aria-controls\": presence.unmounted() ? undefined : props[\"aria-controls\"],\n };\n },\n });\n }\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Renderer2,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n untracked,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\nimport { usePresence } from \"@wirekyt/angular/presence\";\n\nimport { injectDialogContext, injectDialogRenderStrategyContext } from \"./use-context\";\n\n@Directive({\n selector: \"[dialogBackdrop]\",\n standalone: true,\n exportAs: \"dialogBackdrop\",\n})\nexport class DialogBackdrop {\n constructor() {\n const context = injectDialogContext();\n const renderStrategy = injectDialogRenderStrategyContext();\n const presence = usePresence({\n context: () => ({\n present: context.api().open,\n lazyMount: renderStrategy.lazyMount(),\n unmountOnExit: renderStrategy.unmountOnExit(),\n }),\n });\n const template = inject(TemplateRef<unknown>, { optional: true });\n const container = inject(ViewContainerRef);\n const host = inject(ElementRef);\n const elementRef = template ? { nativeElement: null as HTMLElement | null } : host;\n let view: EmbeddedViewRef<unknown> | undefined;\n\n effect(() => {\n const unmounted = presence.unmounted();\n if (template) {\n if (unmounted) {\n elementRef.nativeElement = null;\n container.clear();\n view = undefined;\n } else if (!view) {\n view = container.createEmbeddedView(template);\n elementRef.nativeElement =\n view.rootNodes.find((node: Node) => node.nodeType === 1) ?? null;\n }\n }\n untracked(() => presence.setNode(elementRef.nativeElement));\n });\n\n bindProps({\n elementRef,\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => {\n presence.unmounted();\n return { ...context.api().getBackdropProps(), ...presence.getPresenceProps() };\n },\n });\n }\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Renderer2,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\nimport { injectPresenceContext } from \"@wirekyt/angular/presence\";\n\nimport { injectDialogContext } from \"./use-context\";\n\n@Directive({\n selector: \"[dialogPositioner]\",\n standalone: true,\n exportAs: \"dialogPositioner\",\n})\nexport class DialogPositioner {\n constructor() {\n const context = injectDialogContext();\n const presence = injectPresenceContext();\n const template = inject(TemplateRef<unknown>, { optional: true });\n const container = inject(ViewContainerRef);\n const host = inject(ElementRef);\n const elementRef = template ? { nativeElement: null as HTMLElement | null } : host;\n let view: EmbeddedViewRef<unknown> | undefined;\n\n effect(() => {\n const unmounted = presence.unmounted();\n if (template) {\n if (unmounted) {\n elementRef.nativeElement = null;\n container.clear();\n view = undefined;\n } else if (!view) {\n view = container.createEmbeddedView(template);\n elementRef.nativeElement =\n view.rootNodes.find((node: Node) => node.nodeType === 1) ?? null;\n }\n }\n });\n\n bindProps({\n elementRef,\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => {\n const unmounted = presence.unmounted();\n return { ...context.api().getPositionerProps(), hidden: unmounted };\n },\n });\n }\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Renderer2,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n untracked,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\nimport { injectPresenceContext } from \"@wirekyt/angular/presence\";\n\nimport { injectDialogContext } from \"./use-context\";\n\n@Directive({\n selector: \"[dialogContent]\",\n standalone: true,\n exportAs: \"dialogContent\",\n})\nexport class DialogContent {\n constructor() {\n const context = injectDialogContext();\n const presence = injectPresenceContext();\n const template = inject(TemplateRef<unknown>, { optional: true });\n const container = inject(ViewContainerRef);\n const host = inject(ElementRef);\n const elementRef = template ? { nativeElement: null as HTMLElement | null } : host;\n let view: EmbeddedViewRef<unknown> | undefined;\n\n effect(() => {\n const unmounted = presence.unmounted();\n if (template) {\n if (unmounted) {\n elementRef.nativeElement = null;\n container.clear();\n view = undefined;\n } else if (!view) {\n view = container.createEmbeddedView(template);\n elementRef.nativeElement =\n view.rootNodes.find((node: Node) => node.nodeType === 1) ?? null;\n }\n }\n untracked(() => presence.setNode(elementRef.nativeElement));\n });\n\n bindProps({\n elementRef,\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => {\n presence.unmounted();\n return { ...context.api().getContentProps(), ...presence.getPresenceProps() };\n },\n });\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectDialogContext } from \"./use-context\";\n\n@Directive({\n selector: \"[dialogTitle]\",\n standalone: true,\n exportAs: \"dialogTitle\",\n})\nexport class DialogTitle {\n constructor() {\n const context = injectDialogContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => context.api().getTitleProps(),\n });\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectDialogContext } from \"./use-context\";\n\n@Directive({\n selector: \"[dialogDescription]\",\n standalone: true,\n exportAs: \"dialogDescription\",\n})\nexport class DialogDescription {\n constructor() {\n const context = injectDialogContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => context.api().getDescriptionProps(),\n });\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectDialogContext } from \"./use-context\";\n\n@Directive({\n selector: \"[dialogCloseTrigger]\",\n standalone: true,\n exportAs: \"dialogCloseTrigger\",\n})\nexport class DialogCloseTrigger {\n constructor() {\n const context = injectDialogContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => context.api().getCloseTriggerProps(),\n });\n }\n}\n","import {\n DestroyRef,\n Directive,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n} from \"@angular/core\";\n\nimport type { UseDialogReturn } from \"./use\";\n\nimport { injectDialogContext } from \"./use-context\";\n\nexport interface DialogContextTemplate {\n $implicit: UseDialogReturn[\"api\"];\n api: UseDialogReturn[\"api\"];\n}\n\n@Directive({\n selector: \"[dialogContext]\",\n standalone: true,\n exportAs: \"dialogContext\",\n})\nexport class DialogContext {\n static ngTemplateContextGuard(\n _directive: DialogContext,\n context: unknown,\n ): context is DialogContextTemplate {\n void context;\n return true;\n }\n\n private readonly dialog = injectDialogContext();\n private readonly templateRef = inject<TemplateRef<DialogContextTemplate>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n constructor() {\n const view = this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: this.dialog.api,\n api: this.dialog.api,\n });\n\n effect(() => {\n this.dialog.api();\n view.detectChanges();\n });\n\n inject(DestroyRef).onDestroy(() => view.destroy());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAMa,cAAc,GAAG,IAAI,cAAc,CAAkB,wBAAwB;SAE1E,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC;AAC/B;MAEa,sBAAsB,GAAG,IAAI,cAAc,CACtD,gCAAgC;SAGlB,0BAA0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IAAI,CAAC,MAAM,CAAC,GAAG;AAC1B,YAAA,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG;AACrB,SAAA,CAAC;QAEF,MAAM,CAAC,MAAK;AACV,YAAA,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;YACjB,IAAI,CAAC,aAAa,EAAE;AACtB,QAAA,CAAC,CAAC;AAEF,QAAA,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACpD;uGAzBW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,eAAe;AAC1B,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ErrorHandler, input, Directive } from '@angular/core';
|
|
3
|
+
import { injectEnvironment } from '@wirekyt/angular';
|
|
4
|
+
import { downloadFile } from '@wirekyt/dom/file-utils';
|
|
5
|
+
|
|
6
|
+
function useDownload(options) {
|
|
7
|
+
const environment = injectEnvironment();
|
|
8
|
+
const errorHandler = inject(ErrorHandler);
|
|
9
|
+
const download = () => {
|
|
10
|
+
const root = environment.getRootNode();
|
|
11
|
+
if (!root)
|
|
12
|
+
return;
|
|
13
|
+
const win = resolveWindow(root);
|
|
14
|
+
if (!win)
|
|
15
|
+
return;
|
|
16
|
+
const { data, fileName, mimeType } = options.context();
|
|
17
|
+
const saveToDisk = (value) => {
|
|
18
|
+
downloadFile({
|
|
19
|
+
file: value,
|
|
20
|
+
name: fileName,
|
|
21
|
+
type: mimeType,
|
|
22
|
+
win: win,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
if (typeof data !== "function") {
|
|
26
|
+
saveToDisk(data);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const result = data();
|
|
30
|
+
if (result instanceof Promise) {
|
|
31
|
+
result.then(saveToDisk).catch((error) => {
|
|
32
|
+
errorHandler.handleError(error);
|
|
33
|
+
});
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
saveToDisk(result);
|
|
37
|
+
};
|
|
38
|
+
return { download };
|
|
39
|
+
}
|
|
40
|
+
function resolveWindow(root) {
|
|
41
|
+
if ("defaultView" in root)
|
|
42
|
+
return root.defaultView;
|
|
43
|
+
return root.ownerDocument.defaultView;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
class DownloadTrigger {
|
|
47
|
+
fileName = input.required(/* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "fileName" }] : /* istanbul ignore next */ []));
|
|
49
|
+
mimeType = input.required(/* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "mimeType" }] : /* istanbul ignore next */ []));
|
|
51
|
+
data = input.required(/* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
53
|
+
download = useDownload({
|
|
54
|
+
context: () => ({
|
|
55
|
+
fileName: this.fileName(),
|
|
56
|
+
mimeType: this.mimeType(),
|
|
57
|
+
data: this.data(),
|
|
58
|
+
}),
|
|
59
|
+
}).download;
|
|
60
|
+
onClick(event) {
|
|
61
|
+
if (event.defaultPrevented)
|
|
62
|
+
return;
|
|
63
|
+
this.download();
|
|
64
|
+
}
|
|
65
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DownloadTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
66
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: DownloadTrigger, isStandalone: true, selector: "[downloadTrigger]", inputs: { fileName: { classPropertyName: "fileName", publicName: "fileName", isSignal: true, isRequired: true, transformFunction: null }, mimeType: { classPropertyName: "mimeType", publicName: "mimeType", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "onClick($event)" } }, exportAs: ["downloadTrigger"], ngImport: i0 });
|
|
67
|
+
}
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DownloadTrigger, decorators: [{
|
|
69
|
+
type: Directive,
|
|
70
|
+
args: [{
|
|
71
|
+
selector: "[downloadTrigger]",
|
|
72
|
+
standalone: true,
|
|
73
|
+
exportAs: "downloadTrigger",
|
|
74
|
+
host: { type: "button", "(click)": "onClick($event)" },
|
|
75
|
+
}]
|
|
76
|
+
}], propDecorators: { fileName: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileName", required: true }] }], mimeType: [{ type: i0.Input, args: [{ isSignal: true, alias: "mimeType", required: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Generated bundle index. Do not edit.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
export { DownloadTrigger, useDownload };
|
|
83
|
+
//# sourceMappingURL=wirekyt-angular-download-trigger.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirekyt-angular-download-trigger.mjs","sources":["../../src/components/download-trigger/use.ts","../../src/components/download-trigger/download-trigger.ts","../../src/components/download-trigger/wirekyt-angular-download-trigger.ts"],"sourcesContent":["import { ErrorHandler, inject } from \"@angular/core\";\nimport { injectEnvironment } from \"@wirekyt/angular\";\nimport { downloadFile } from \"@wirekyt/dom/file-utils\";\n\nimport type { DownloadableData, UseDownloadOptions, UseDownloadReturn } from \"./types\";\n\nexport function useDownload(options: UseDownloadOptions): UseDownloadReturn {\n const environment = injectEnvironment();\n const errorHandler = inject(ErrorHandler);\n\n const download = (): void => {\n const root = environment.getRootNode();\n if (!root) return;\n\n const win = resolveWindow(root);\n if (!win) return;\n\n const { data, fileName, mimeType } = options.context();\n const saveToDisk = (value: DownloadableData): void => {\n downloadFile({\n file: value,\n name: fileName,\n type: mimeType,\n win: win as Window & typeof globalThis,\n });\n };\n\n if (typeof data !== \"function\") {\n saveToDisk(data);\n return;\n }\n\n const result = data();\n if (result instanceof Promise) {\n result.then(saveToDisk).catch((error: unknown) => {\n errorHandler.handleError(error);\n });\n return;\n }\n\n saveToDisk(result);\n };\n\n return { download };\n}\n\nfunction resolveWindow(root: Document | ShadowRoot): Window | null {\n if (\"defaultView\" in root) return root.defaultView;\n return root.ownerDocument.defaultView;\n}\n","import type { MaybePromise } from \"@wirekyt/angular\";\nimport type { FileMimeType } from \"@wirekyt/dom/file-utils\";\n\nimport { Directive, input } from \"@angular/core\";\n\nimport { useDownload } from \"./use\";\n\ntype DownloadData = string | Blob | File | (() => MaybePromise<string | Blob | File>);\n\n@Directive({\n selector: \"[downloadTrigger]\",\n standalone: true,\n exportAs: \"downloadTrigger\",\n host: { type: \"button\", \"(click)\": \"onClick($event)\" },\n})\nexport class DownloadTrigger {\n readonly fileName = input.required<string>();\n readonly mimeType = input.required<FileMimeType>();\n readonly data = input.required<DownloadData>();\n\n private readonly download = useDownload({\n context: () => ({\n fileName: this.fileName(),\n mimeType: this.mimeType(),\n data: this.data(),\n }),\n }).download;\n\n onClick(event: MouseEvent): void {\n if (event.defaultPrevented) return;\n this.download();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAMM,SAAU,WA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EAAA,OAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAN3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,iBAAiB;oBAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE;AACvD,iBAAA;;;ACdD;;AAEG;;;;"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirekyt/angular",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Angular adapter for Wirekyt",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -66,6 +66,14 @@
|
|
|
66
66
|
"types": "./types/wirekyt-angular-date-picker.d.ts",
|
|
67
67
|
"default": "./fesm2022/wirekyt-angular-date-picker.mjs"
|
|
68
68
|
},
|
|
69
|
+
"./dialog": {
|
|
70
|
+
"types": "./types/wirekyt-angular-dialog.d.ts",
|
|
71
|
+
"default": "./fesm2022/wirekyt-angular-dialog.mjs"
|
|
72
|
+
},
|
|
73
|
+
"./download-trigger": {
|
|
74
|
+
"types": "./types/wirekyt-angular-download-trigger.d.ts",
|
|
75
|
+
"default": "./fesm2022/wirekyt-angular-download-trigger.mjs"
|
|
76
|
+
},
|
|
69
77
|
"./field": {
|
|
70
78
|
"types": "./types/wirekyt-angular-field.d.ts",
|
|
71
79
|
"default": "./fesm2022/wirekyt-angular-field.mjs"
|
|
@@ -7,7 +7,7 @@ import * as i0 from '@angular/core';
|
|
|
7
7
|
import { Signal, InputSignal, ModelSignal, InputSignalWithTransform, OutputEmitterRef, InjectionToken } from '@angular/core';
|
|
8
8
|
import { ControlValueAccessor } from '@angular/forms';
|
|
9
9
|
|
|
10
|
-
declare const checkboxAnatomy: _wirekyt_dom_anatomy.AnatomyInstance<"root" | "label" | "
|
|
10
|
+
declare const checkboxAnatomy: _wirekyt_dom_anatomy.AnatomyInstance<"root" | "label" | "indicator" | "control" | "group">;
|
|
11
11
|
|
|
12
12
|
type OptionalId<T extends {
|
|
13
13
|
id: string;
|
|
@@ -9,7 +9,7 @@ import { PresenceBase } from '@wirekyt/angular/presence';
|
|
|
9
9
|
import { ControlValueAccessor } from '@angular/forms';
|
|
10
10
|
import { ColorStringFormat } from '@wirekyt/dom/color-utils';
|
|
11
11
|
|
|
12
|
-
declare const colorPickerAnatomy: _wirekyt_dom_anatomy.Anatomy<"root" | "
|
|
12
|
+
declare const colorPickerAnatomy: _wirekyt_dom_anatomy.Anatomy<"root" | "label" | "content" | "area" | "valueText" | "control" | "trigger" | "positioner" | "areaThumb" | "areaBackground" | "channelSlider" | "channelSliderLabel" | "channelSliderTrack" | "channelSliderThumb" | "channelSliderValueText" | "channelInput" | "transparencyGrid" | "swatchGroup" | "swatchTrigger" | "swatchIndicator" | "swatch" | "eyeDropperTrigger" | "formatTrigger" | "formatSelect">;
|
|
13
13
|
|
|
14
14
|
declare class ColorPickerArea {
|
|
15
15
|
readonly xChannel: InputSignal<colorPicker.ColorChannel | undefined>;
|
|
@@ -13,7 +13,7 @@ import { PresenceBase } from '@wirekyt/angular/presence';
|
|
|
13
13
|
import { ControlValueAccessor } from '@angular/forms';
|
|
14
14
|
import * as _wirekyt_angular_combobox from '@wirekyt/angular/combobox';
|
|
15
15
|
|
|
16
|
-
declare const comboboxAnatomy: _wirekyt_dom_anatomy.AnatomyInstance<"root" | "
|
|
16
|
+
declare const comboboxAnatomy: _wirekyt_dom_anatomy.AnatomyInstance<"root" | "label" | "item" | "itemText" | "list" | "content" | "input" | "control" | "trigger" | "itemIndicator" | "clearTrigger" | "positioner" | "itemGroup" | "itemGroupLabel" | "empty">;
|
|
17
17
|
|
|
18
18
|
type ComboboxSchema<T extends CollectionItem = CollectionItem> = Machine<T> extends Machine$1<infer S> ? S : never;
|
|
19
19
|
|
|
@@ -9,7 +9,7 @@ import * as _wirekyt_angular_presence from '@wirekyt/angular/presence';
|
|
|
9
9
|
import { PresenceBase } from '@wirekyt/angular/presence';
|
|
10
10
|
import { ControlValueAccessor } from '@angular/forms';
|
|
11
11
|
|
|
12
|
-
declare const datePickerAnatomy: _wirekyt_dom_anatomy.AnatomyInstance<"root" | "
|
|
12
|
+
declare const datePickerAnatomy: _wirekyt_dom_anatomy.AnatomyInstance<"root" | "label" | "content" | "input" | "table" | "view" | "control" | "prevTrigger" | "nextTrigger" | "trigger" | "clearTrigger" | "positioner" | "tableHeader" | "tableBody" | "tableRow" | "viewTrigger" | "monthSelect" | "yearSelect" | "presetTrigger" | "rangeText" | "tableCell" | "tableCellTrigger" | "tableHead" | "viewControl" | "valueText">;
|
|
13
13
|
|
|
14
14
|
type OptionalId<T extends {
|
|
15
15
|
id?: string | undefined;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import * as dialog from '@wirekyt/dom/machines/dialog';
|
|
2
|
+
import { ElementIds, FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent, OpenChangeDetails, TriggerValueChangeDetails } from '@wirekyt/dom/machines/dialog';
|
|
3
|
+
export { Api as DialogApi, ElementIds as DialogElementIds, FocusOutsideEvent as DialogFocusOutsideEvent, InteractOutsideEvent as DialogInteractOutsideEvent, Machine as DialogMachine, Props as DialogMachineProps, OpenChangeDetails as DialogOpenChangeDetails, PointerDownOutsideEvent as DialogPointerDownOutsideEvent, Service as DialogService, TriggerProps as DialogTriggerProps, TriggerValueChangeDetails as DialogTriggerValueChangeDetails, anatomy as dialogAnatomy } from '@wirekyt/dom/machines/dialog';
|
|
4
|
+
import { UseMachineReturn, ContextCarrier } from '@wirekyt/angular';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { InjectionToken, InputSignal, ModelSignal, InputSignalWithTransform, OutputEmitterRef, Signal } from '@angular/core';
|
|
7
|
+
import * as _wirekyt_angular_presence from '@wirekyt/angular/presence';
|
|
8
|
+
import { PresenceBase } from '@wirekyt/angular/presence';
|
|
9
|
+
|
|
10
|
+
type OptionalId<T extends {
|
|
11
|
+
id: string;
|
|
12
|
+
}> = Omit<T, "id"> & {
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
interface UseDialogProps extends OptionalId<Omit<dialog.Props, "dir" | "getRootNode">> {
|
|
16
|
+
}
|
|
17
|
+
type UseDialogReturn = UseMachineReturn<dialog.Service["state"], dialog.Api, dialog.Service>;
|
|
18
|
+
interface UseDialogOptions {
|
|
19
|
+
context: () => UseDialogProps;
|
|
20
|
+
}
|
|
21
|
+
declare function useDialog(options: UseDialogOptions): UseDialogReturn;
|
|
22
|
+
|
|
23
|
+
declare const DIALOG_CONTEXT: InjectionToken<UseDialogReturn>;
|
|
24
|
+
declare function injectDialogContext(): UseDialogReturn;
|
|
25
|
+
declare const DIALOG_CONTEXT_CARRIER: InjectionToken<ContextCarrier<UseDialogReturn>>;
|
|
26
|
+
declare function injectDialogContextCarrier(): ContextCarrier<UseDialogReturn>;
|
|
27
|
+
|
|
28
|
+
declare class DialogRoot extends PresenceBase implements UseDialogReturn {
|
|
29
|
+
readonly id: InputSignal<string | undefined>;
|
|
30
|
+
readonly ids: InputSignal<Partial<ElementIds> | undefined>;
|
|
31
|
+
readonly ariaLabel: InputSignal<string | undefined>;
|
|
32
|
+
readonly open: ModelSignal<boolean | undefined>;
|
|
33
|
+
readonly defaultOpen: InputSignalWithTransform<boolean, unknown>;
|
|
34
|
+
readonly modal: InputSignalWithTransform<boolean, unknown>;
|
|
35
|
+
readonly closeOnInteractOutside: InputSignalWithTransform<boolean, unknown>;
|
|
36
|
+
readonly closeOnEscape: InputSignalWithTransform<boolean, unknown>;
|
|
37
|
+
readonly preventScroll: InputSignalWithTransform<boolean, unknown>;
|
|
38
|
+
readonly trapFocus: InputSignalWithTransform<boolean, unknown>;
|
|
39
|
+
readonly restoreFocus: InputSignalWithTransform<boolean, unknown>;
|
|
40
|
+
readonly initialFocusEl: InputSignal<(() => HTMLElement | null) | undefined>;
|
|
41
|
+
readonly finalFocusEl: InputSignal<(() => HTMLElement | null) | undefined>;
|
|
42
|
+
readonly persistentElements: InputSignal<(() => Element | null)[] | undefined>;
|
|
43
|
+
readonly role: InputSignal<"dialog" | "alertdialog" | undefined>;
|
|
44
|
+
readonly triggerValue: ModelSignal<string | null | undefined>;
|
|
45
|
+
readonly defaultTriggerValue: InputSignal<string | null | undefined>;
|
|
46
|
+
readonly escapeKeyDown: OutputEmitterRef<KeyboardEvent>;
|
|
47
|
+
readonly focusOutside: OutputEmitterRef<FocusOutsideEvent>;
|
|
48
|
+
readonly interactOutside: OutputEmitterRef<InteractOutsideEvent>;
|
|
49
|
+
readonly pointerDownOutside: OutputEmitterRef<PointerDownOutsideEvent>;
|
|
50
|
+
readonly requestDismiss: OutputEmitterRef<CustomEvent<{
|
|
51
|
+
originalLayer: HTMLElement;
|
|
52
|
+
targetLayer: HTMLElement | undefined;
|
|
53
|
+
originalIndex: number;
|
|
54
|
+
targetIndex: number;
|
|
55
|
+
}>>;
|
|
56
|
+
readonly openChangeDetails: OutputEmitterRef<OpenChangeDetails>;
|
|
57
|
+
readonly triggerValueChangeDetails: OutputEmitterRef<TriggerValueChangeDetails>;
|
|
58
|
+
private readonly machine;
|
|
59
|
+
readonly state: Signal<dialog.Service["state"]>;
|
|
60
|
+
readonly api: Signal<dialog.Api>;
|
|
61
|
+
readonly service: dialog.Service;
|
|
62
|
+
readonly send: dialog.Service["send"];
|
|
63
|
+
readonly presence: _wirekyt_angular_presence.UsePresenceReturn;
|
|
64
|
+
protected readonly contextCarrier: ContextCarrier<DialogRoot>;
|
|
65
|
+
getContextCarrier(): ContextCarrier<DialogRoot>;
|
|
66
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogRoot, never>;
|
|
67
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogRoot, "[dialogRoot]", ["dialogRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "ids": { "alias": "ids"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "defaultOpen": { "alias": "defaultOpen"; "required": false; "isSignal": true; }; "modal": { "alias": "modal"; "required": false; "isSignal": true; }; "closeOnInteractOutside": { "alias": "closeOnInteractOutside"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "preventScroll": { "alias": "preventScroll"; "required": false; "isSignal": true; }; "trapFocus": { "alias": "trapFocus"; "required": false; "isSignal": true; }; "restoreFocus": { "alias": "restoreFocus"; "required": false; "isSignal": true; }; "initialFocusEl": { "alias": "initialFocusEl"; "required": false; "isSignal": true; }; "finalFocusEl": { "alias": "finalFocusEl"; "required": false; "isSignal": true; }; "persistentElements": { "alias": "persistentElements"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "triggerValue": { "alias": "triggerValue"; "required": false; "isSignal": true; }; "defaultTriggerValue": { "alias": "defaultTriggerValue"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "triggerValue": "triggerValueChange"; "escapeKeyDown": "escapeKeyDown"; "focusOutside": "focusOutside"; "interactOutside": "interactOutside"; "pointerDownOutside": "pointerDownOutside"; "requestDismiss": "requestDismiss"; "openChangeDetails": "openChangeDetails"; "triggerValueChangeDetails": "triggerValueChangeDetails"; }, never, never, true, never>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare class DialogRootProvider extends PresenceBase implements UseDialogReturn {
|
|
71
|
+
readonly value: InputSignal<UseDialogReturn>;
|
|
72
|
+
readonly state: Signal<dialog.Service["state"]>;
|
|
73
|
+
readonly api: Signal<dialog.Api>;
|
|
74
|
+
readonly send: dialog.Service["send"];
|
|
75
|
+
get service(): dialog.Service;
|
|
76
|
+
readonly presence: _wirekyt_angular_presence.UsePresenceReturn;
|
|
77
|
+
protected readonly contextCarrier: ContextCarrier<DialogRootProvider>;
|
|
78
|
+
getContextCarrier(): ContextCarrier<DialogRootProvider>;
|
|
79
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogRootProvider, never>;
|
|
80
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogRootProvider, "[dialogRootProvider]", ["dialogRootProvider"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare class DialogTrigger {
|
|
84
|
+
readonly value: InputSignal<string | undefined>;
|
|
85
|
+
constructor();
|
|
86
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogTrigger, never>;
|
|
87
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogTrigger, "[dialogTrigger]", ["dialogTrigger"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare class DialogBackdrop {
|
|
91
|
+
constructor();
|
|
92
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogBackdrop, never>;
|
|
93
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogBackdrop, "[dialogBackdrop]", ["dialogBackdrop"], {}, {}, never, never, true, never>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare class DialogPositioner {
|
|
97
|
+
constructor();
|
|
98
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogPositioner, never>;
|
|
99
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogPositioner, "[dialogPositioner]", ["dialogPositioner"], {}, {}, never, never, true, never>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare class DialogContent {
|
|
103
|
+
constructor();
|
|
104
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogContent, never>;
|
|
105
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogContent, "[dialogContent]", ["dialogContent"], {}, {}, never, never, true, never>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare class DialogTitle {
|
|
109
|
+
constructor();
|
|
110
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogTitle, never>;
|
|
111
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogTitle, "[dialogTitle]", ["dialogTitle"], {}, {}, never, never, true, never>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare class DialogDescription {
|
|
115
|
+
constructor();
|
|
116
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogDescription, never>;
|
|
117
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogDescription, "[dialogDescription]", ["dialogDescription"], {}, {}, never, never, true, never>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
declare class DialogCloseTrigger {
|
|
121
|
+
constructor();
|
|
122
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogCloseTrigger, never>;
|
|
123
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogCloseTrigger, "[dialogCloseTrigger]", ["dialogCloseTrigger"], {}, {}, never, never, true, never>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface DialogContextTemplate {
|
|
127
|
+
$implicit: UseDialogReturn["api"];
|
|
128
|
+
api: UseDialogReturn["api"];
|
|
129
|
+
}
|
|
130
|
+
declare class DialogContext {
|
|
131
|
+
static ngTemplateContextGuard(_directive: DialogContext, context: unknown): context is DialogContextTemplate;
|
|
132
|
+
private readonly dialog;
|
|
133
|
+
private readonly templateRef;
|
|
134
|
+
private readonly viewContainer;
|
|
135
|
+
constructor();
|
|
136
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogContext, never>;
|
|
137
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogContext, "[dialogContext]", ["dialogContext"], {}, {}, never, never, true, never>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export { DIALOG_CONTEXT, DIALOG_CONTEXT_CARRIER, DialogBackdrop, DialogCloseTrigger, DialogContent, DialogContext, DialogDescription, DialogPositioner, DialogRoot, DialogRootProvider, DialogTitle, DialogTrigger, injectDialogContext, injectDialogContextCarrier, useDialog };
|
|
141
|
+
export type { DialogContextTemplate, UseDialogOptions, UseDialogProps, UseDialogReturn };
|
|
142
|
+
//# sourceMappingURL=wirekyt-angular-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirekyt-angular-dialog.d.ts","sources":["../../src/components/dialog/use.ts","../../src/components/dialog/use-context.ts","../../src/components/dialog/root.ts","../../src/components/dialog/root-provider.ts","../../src/components/dialog/trigger.ts","../../src/components/dialog/backdrop.ts","../../src/components/dialog/positioner.ts","../../src/components/dialog/content.ts","../../src/components/dialog/title.ts","../../src/components/dialog/description.ts","../../src/components/dialog/close-trigger.ts","../../src/components/dialog/context.ts"],"mappings":";;;;;;;;;AAWA,KAAK,UAAU;;AAAyB,KAAI,IAAI;;;AAE1C,UAAW,cAAe,SAAQ,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;AAA4B;AAE1F,KAAM,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO;UAEjF,gBAAgB;mBAChB,cAAc;AAC9B;AAKD,iBAAgB,SAAS,UAAU,gBAAgB,GAAG,eAAe;;AClBrE,cAAa,cAAc,EAAA,cAAA,CAAA,eAAA;AAE3B,iBAAgB,mBAAmB,IAAI,eAAe;AAItD,cAAa,sBAAsB,EAAA,cAAA,CAAA,cAAA,CAAA,eAAA;AAInC,iBAAgB,0BAA0B,IAAI,cAAc,CAAC,eAAe;;ACsB5E,cAsBa,UAAW,SAAQ,YAAa,YAAW,eAAe;iBACxD,WAAW;AACxB,kBAAc,WAAW,CAAC,OAAO,CAACA,UA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ClED,cAKa,aAAa;oBACR,WAAW;;yCADhB,aAAa;2CAAb,aAAa;AAmBzB;;ACrBD,cAKa,cAAc;;yCAAd,cAAc;2CAAd,cAAc;AA2C1B;;ACjDD,cAKa,gBAAgB;;yCAAhB,gBAAgB;2CAAhB,gBAAgB;AAmC5B;;ACvCD,cAKa,aAAa;;yCAAb,aAAa;2CAAb,aAAa;AAoCzB;;ACrDD,cAKa,WAAW;;yCAAX,WAAW;2CAAX,WAAW;AAUvB;;ACfD,cAKa,iBAAiB;;yCAAjB,iBAAiB;2CAAjB,iBAAiB;AAU7B;;ACfD,cAKa,kBAAkB;;yCAAlB,kBAAkB;2CAAlB,kBAAkB;AAU9B;;UCPgB,qBAAqB;AACpC,eAAW,eAAe;AAC1B,SAAK,eAAe;AACrB;AAED,cAKa,aAAa;AACxB,8CACc,aAAa,gCAEb,qBAAqB;AAKnC;AACA;AACA;;yCAXW,aAAa;2CAAb,aAAa;AA0BzB;;;;","names":["DialogElementIds","DialogFocusOutsideEvent","DialogInteractOutsideEvent","DialogPointerDownOutsideEvent","DialogOpenChangeDetails","DialogTriggerValueChangeDetails"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { MaybePromise } from '@wirekyt/angular';
|
|
3
|
+
import { FileMimeType } from '@wirekyt/dom/file-utils';
|
|
4
|
+
|
|
5
|
+
type DownloadData = string | Blob | File | (() => MaybePromise<string | Blob | File>);
|
|
6
|
+
declare class DownloadTrigger {
|
|
7
|
+
readonly fileName: _angular_core.InputSignal<string>;
|
|
8
|
+
readonly mimeType: _angular_core.InputSignal<FileMimeType>;
|
|
9
|
+
readonly data: _angular_core.InputSignal<DownloadData>;
|
|
10
|
+
private readonly download;
|
|
11
|
+
onClick(event: MouseEvent): void;
|
|
12
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DownloadTrigger, never>;
|
|
13
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DownloadTrigger, "[downloadTrigger]", ["downloadTrigger"], { "fileName": { "alias": "fileName"; "required": true; "isSignal": true; }; "mimeType": { "alias": "mimeType"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type DownloadableData = string | Blob | File;
|
|
17
|
+
interface UseDownloadProps {
|
|
18
|
+
fileName: string;
|
|
19
|
+
mimeType: FileMimeType;
|
|
20
|
+
data: DownloadableData | (() => MaybePromise<DownloadableData>);
|
|
21
|
+
}
|
|
22
|
+
interface UseDownloadOptions {
|
|
23
|
+
context: () => UseDownloadProps;
|
|
24
|
+
}
|
|
25
|
+
interface UseDownloadReturn {
|
|
26
|
+
download: () => void;
|
|
27
|
+
}
|
|
28
|
+
interface DownloadTriggerProps extends UseDownloadProps {
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare function useDownload(options: UseDownloadOptions): UseDownloadReturn;
|
|
32
|
+
|
|
33
|
+
export { DownloadTrigger, useDownload };
|
|
34
|
+
export type { DownloadTriggerProps, DownloadableData, UseDownloadOptions, UseDownloadProps, UseDownloadReturn };
|
|
35
|
+
//# sourceMappingURL=wirekyt-angular-download-trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirekyt-angular-download-trigger.d.ts","sources":["../../src/components/download-trigger/download-trigger.ts","../../src/components/download-trigger/types.ts","../../src/components/download-trigger/use.ts"],"mappings":";;;;AAOA,KAAK,YAAY,YAAY,IAAI,GAAG,IAAI,UAAU,YAAY,UAAU,IAAI,GAAG,IAAI;AAEnF,cAMa,eAAe;uBACT,aAAA,CAAA,WAAA;uBACA,aAAA,CAAA,WAAA,CAAA,YAAA;mBACJ,aAAA,CAAA,WAAA,CAAA,YAAA;AAEb;AAQA,mBAAe,UAAU;oDAbd,eAAe;sDAAf,eAAe;AAiB3B;;AC7BK,KAAM,gBAAgB,YAAY,IAAI,GAAG,IAAI;UAElC,gBAAgB;;cAErB,YAAY;UAChB,gBAAgB,UAAU,YAAY,CAAC,gBAAgB;AAC9D;UAEgB,kBAAkB;mBAClB,gBAAgB;AAChC;UAEgB,iBAAiB;;AAEjC;AAEK,UAAW,oBAAqB,SAAQ,gBAAgB;AAAG;;ACbjE,iBAAgB,WAAW,UAAU,kBAAkB,GAAG,iBAAiB;;;;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirekyt/angular",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Angular adapter for Wirekyt",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -66,6 +66,14 @@
|
|
|
66
66
|
"types": "./dist/types/wirekyt-angular-date-picker.d.ts",
|
|
67
67
|
"default": "./dist/fesm2022/wirekyt-angular-date-picker.mjs"
|
|
68
68
|
},
|
|
69
|
+
"./dialog": {
|
|
70
|
+
"types": "./dist/types/wirekyt-angular-dialog.d.ts",
|
|
71
|
+
"default": "./dist/fesm2022/wirekyt-angular-dialog.mjs"
|
|
72
|
+
},
|
|
73
|
+
"./download-trigger": {
|
|
74
|
+
"types": "./dist/types/wirekyt-angular-download-trigger.d.ts",
|
|
75
|
+
"default": "./dist/fesm2022/wirekyt-angular-download-trigger.mjs"
|
|
76
|
+
},
|
|
69
77
|
"./field": {
|
|
70
78
|
"types": "./dist/types/wirekyt-angular-field.d.ts",
|
|
71
79
|
"default": "./dist/fesm2022/wirekyt-angular-field.mjs"
|
|
@@ -87,7 +95,7 @@
|
|
|
87
95
|
"dependencies": {
|
|
88
96
|
"@internationalized/date": "^3.12.3",
|
|
89
97
|
"@internationalized/number": "^3.6.7",
|
|
90
|
-
"@wirekyt/dom": "0.0.
|
|
98
|
+
"@wirekyt/dom": "0.0.15",
|
|
91
99
|
"tslib": "^2.8.1"
|
|
92
100
|
},
|
|
93
101
|
"peerDependencies": {
|