@wirekyt/angular 0.0.34 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/fesm2022/wirekyt-angular-json-tree-view.mjs +0 -5
  2. package/dist/fesm2022/wirekyt-angular-json-tree-view.mjs.map +1 -1
  3. package/dist/fesm2022/wirekyt-angular-listbox.mjs +627 -0
  4. package/dist/fesm2022/wirekyt-angular-listbox.mjs.map +1 -0
  5. package/dist/fesm2022/wirekyt-angular-menu.mjs +0 -6
  6. package/dist/fesm2022/wirekyt-angular-menu.mjs.map +1 -1
  7. package/dist/fesm2022/wirekyt-angular-number-input.mjs +467 -0
  8. package/dist/fesm2022/wirekyt-angular-number-input.mjs.map +1 -0
  9. package/dist/fesm2022/wirekyt-angular-password-input.mjs +437 -0
  10. package/dist/fesm2022/wirekyt-angular-password-input.mjs.map +1 -0
  11. package/dist/fesm2022/wirekyt-angular-pin-input.mjs +485 -0
  12. package/dist/fesm2022/wirekyt-angular-pin-input.mjs.map +1 -0
  13. package/dist/fesm2022/wirekyt-angular-progress.mjs +337 -0
  14. package/dist/fesm2022/wirekyt-angular-progress.mjs.map +1 -0
  15. package/dist/fesm2022/wirekyt-angular-qr-code.mjs +0 -11
  16. package/dist/fesm2022/wirekyt-angular-qr-code.mjs.map +1 -1
  17. package/dist/fesm2022/wirekyt-angular-radio-group.mjs +461 -0
  18. package/dist/fesm2022/wirekyt-angular-radio-group.mjs.map +1 -0
  19. package/dist/fesm2022/wirekyt-angular-rating-group.mjs +435 -0
  20. package/dist/fesm2022/wirekyt-angular-rating-group.mjs.map +1 -0
  21. package/dist/fesm2022/wirekyt-angular-scroll-area.mjs +276 -0
  22. package/dist/fesm2022/wirekyt-angular-scroll-area.mjs.map +1 -0
  23. package/dist/fesm2022/wirekyt-angular-segment-group.mjs +506 -0
  24. package/dist/fesm2022/wirekyt-angular-segment-group.mjs.map +1 -0
  25. package/dist/fesm2022/wirekyt-angular-signature-pad.mjs +382 -0
  26. package/dist/fesm2022/wirekyt-angular-signature-pad.mjs.map +1 -0
  27. package/dist/fesm2022/wirekyt-angular-slider.mjs +574 -0
  28. package/dist/fesm2022/wirekyt-angular-slider.mjs.map +1 -0
  29. package/dist/fesm2022/wirekyt-angular-splitter.mjs +303 -0
  30. package/dist/fesm2022/wirekyt-angular-splitter.mjs.map +1 -0
  31. package/dist/fesm2022/wirekyt-angular-steps.mjs +465 -0
  32. package/dist/fesm2022/wirekyt-angular-steps.mjs.map +1 -0
  33. package/dist/fesm2022/wirekyt-angular-swap.mjs +192 -0
  34. package/dist/fesm2022/wirekyt-angular-swap.mjs.map +1 -0
  35. package/dist/fesm2022/wirekyt-angular-switch.mjs +340 -0
  36. package/dist/fesm2022/wirekyt-angular-switch.mjs.map +1 -0
  37. package/dist/fesm2022/wirekyt-angular-tags-input.mjs +645 -0
  38. package/dist/fesm2022/wirekyt-angular-tags-input.mjs.map +1 -0
  39. package/dist/fesm2022/wirekyt-angular-timer.mjs +294 -0
  40. package/dist/fesm2022/wirekyt-angular-timer.mjs.map +1 -0
  41. package/dist/fesm2022/wirekyt-angular-toggle-group.mjs +194 -0
  42. package/dist/fesm2022/wirekyt-angular-toggle-group.mjs.map +1 -0
  43. package/dist/fesm2022/wirekyt-angular-toggle.mjs +170 -0
  44. package/dist/fesm2022/wirekyt-angular-toggle.mjs.map +1 -0
  45. package/dist/fesm2022/wirekyt-angular-tour.mjs +806 -0
  46. package/dist/fesm2022/wirekyt-angular-tour.mjs.map +1 -0
  47. package/dist/package.json +81 -1
  48. package/dist/types/wirekyt-angular-checkbox.d.ts +1 -1
  49. package/dist/types/wirekyt-angular-color-picker.d.ts +1 -1
  50. package/dist/types/wirekyt-angular-combobox.d.ts +1 -1
  51. package/dist/types/wirekyt-angular-date-picker.d.ts +1 -1
  52. package/dist/types/wirekyt-angular-json-tree-view.d.ts +0 -5
  53. package/dist/types/wirekyt-angular-json-tree-view.d.ts.map +1 -1
  54. package/dist/types/wirekyt-angular-listbox.d.ts +206 -0
  55. package/dist/types/wirekyt-angular-listbox.d.ts.map +1 -0
  56. package/dist/types/wirekyt-angular-menu.d.ts +0 -23
  57. package/dist/types/wirekyt-angular-menu.d.ts.map +1 -1
  58. package/dist/types/wirekyt-angular-number-input.d.ts +143 -0
  59. package/dist/types/wirekyt-angular-number-input.d.ts.map +1 -0
  60. package/dist/types/wirekyt-angular-password-input.d.ts +124 -0
  61. package/dist/types/wirekyt-angular-password-input.d.ts.map +1 -0
  62. package/dist/types/wirekyt-angular-pin-input.d.ts +131 -0
  63. package/dist/types/wirekyt-angular-pin-input.d.ts.map +1 -0
  64. package/dist/types/wirekyt-angular-progress.d.ts +129 -0
  65. package/dist/types/wirekyt-angular-progress.d.ts.map +1 -0
  66. package/dist/types/wirekyt-angular-qr-code.d.ts +0 -11
  67. package/dist/types/wirekyt-angular-qr-code.d.ts.map +1 -1
  68. package/dist/types/wirekyt-angular-radio-group.d.ts +149 -0
  69. package/dist/types/wirekyt-angular-radio-group.d.ts.map +1 -0
  70. package/dist/types/wirekyt-angular-rating-group.d.ts +136 -0
  71. package/dist/types/wirekyt-angular-rating-group.d.ts.map +1 -0
  72. package/dist/types/wirekyt-angular-scroll-area.d.ts +106 -0
  73. package/dist/types/wirekyt-angular-scroll-area.d.ts.map +1 -0
  74. package/dist/types/wirekyt-angular-segment-group.d.ts +152 -0
  75. package/dist/types/wirekyt-angular-segment-group.d.ts.map +1 -0
  76. package/dist/types/wirekyt-angular-signature-pad.d.ts +120 -0
  77. package/dist/types/wirekyt-angular-signature-pad.d.ts.map +1 -0
  78. package/dist/types/wirekyt-angular-slider.d.ts +176 -0
  79. package/dist/types/wirekyt-angular-slider.d.ts.map +1 -0
  80. package/dist/types/wirekyt-angular-splitter.d.ts +116 -0
  81. package/dist/types/wirekyt-angular-splitter.d.ts.map +1 -0
  82. package/dist/types/wirekyt-angular-steps.d.ts +160 -0
  83. package/dist/types/wirekyt-angular-steps.d.ts.map +1 -0
  84. package/dist/types/wirekyt-angular-swap.d.ts +86 -0
  85. package/dist/types/wirekyt-angular-swap.d.ts.map +1 -0
  86. package/dist/types/wirekyt-angular-switch.d.ts +110 -0
  87. package/dist/types/wirekyt-angular-switch.d.ts.map +1 -0
  88. package/dist/types/wirekyt-angular-tags-input.d.ts +193 -0
  89. package/dist/types/wirekyt-angular-tags-input.d.ts.map +1 -0
  90. package/dist/types/wirekyt-angular-timer.d.ts +109 -0
  91. package/dist/types/wirekyt-angular-timer.d.ts.map +1 -0
  92. package/dist/types/wirekyt-angular-toggle-group.d.ts +81 -0
  93. package/dist/types/wirekyt-angular-toggle-group.d.ts.map +1 -0
  94. package/dist/types/wirekyt-angular-toggle.d.ts +69 -0
  95. package/dist/types/wirekyt-angular-toggle.d.ts.map +1 -0
  96. package/dist/types/wirekyt-angular-tour.d.ts +209 -0
  97. package/dist/types/wirekyt-angular-tour.d.ts.map +1 -0
  98. package/package.json +82 -3
@@ -0,0 +1,337 @@
1
+ import * as progress from '@wirekyt/dom/machines/progress';
2
+ export { anatomy as progressAnatomy } from '@wirekyt/dom/machines/progress';
3
+ import * as i0 from '@angular/core';
4
+ import { InjectionToken, inject, input, model, output, DestroyRef, Renderer2, ElementRef, forwardRef, Directive, computed, signal, effect, TemplateRef, ViewContainerRef } from '@angular/core';
5
+ import { injectLocale, injectEnvironment, createId, useMachine, bindProps } from '@wirekyt/angular';
6
+
7
+ const PROGRESS_CONTEXT = new InjectionToken("WIREKYT.PROGRESS_CONTEXT");
8
+ function injectProgressContext() {
9
+ return inject(PROGRESS_CONTEXT);
10
+ }
11
+
12
+ function useProgress(options) {
13
+ const locale = injectLocale();
14
+ const environment = injectEnvironment();
15
+ const fallbackId = createId();
16
+ return useMachine({
17
+ machine: progress.machine,
18
+ context: () => {
19
+ const props = options.context();
20
+ const context = {
21
+ ...props,
22
+ dir: locale.dir,
23
+ id: props.id ?? fallbackId,
24
+ locale: props.locale ?? locale.locale,
25
+ getRootNode: environment.getRootNode,
26
+ };
27
+ return context;
28
+ },
29
+ connect: (service, normalize) => progress.connect(service, normalize),
30
+ });
31
+ }
32
+
33
+ class ProgressRoot {
34
+ id = input(undefined, /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
36
+ ids = input(undefined, /* @ts-ignore */
37
+ ...(ngDevMode ? [{ debugName: "ids" }] : /* istanbul ignore next */ []));
38
+ value = model(undefined, /* @ts-ignore */
39
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
40
+ defaultValue = input(undefined, /* @ts-ignore */
41
+ ...(ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []));
42
+ min = input(undefined, /* @ts-ignore */
43
+ ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
44
+ max = input(undefined, /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
46
+ orientation = input(undefined, /* @ts-ignore */
47
+ ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
48
+ formatOptions = input(undefined, /* @ts-ignore */
49
+ ...(ngDevMode ? [{ debugName: "formatOptions" }] : /* istanbul ignore next */ []));
50
+ translations = input(undefined, /* @ts-ignore */
51
+ ...(ngDevMode ? [{ debugName: "translations" }] : /* istanbul ignore next */ []));
52
+ locale = input(undefined, /* @ts-ignore */
53
+ ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
54
+ valueDetailsChange = output();
55
+ machine = useProgress({
56
+ context: () => ({
57
+ id: this.id(),
58
+ ids: this.ids(),
59
+ value: this.value(),
60
+ defaultValue: this.defaultValue(),
61
+ min: this.min(),
62
+ max: this.max(),
63
+ orientation: this.orientation(),
64
+ formatOptions: this.formatOptions(),
65
+ translations: this.translations(),
66
+ locale: this.locale(),
67
+ onValueChange: (details) => {
68
+ this.value.set(details.value);
69
+ this.valueDetailsChange.emit(details);
70
+ },
71
+ }),
72
+ });
73
+ state = this.machine.state;
74
+ api = this.machine.api;
75
+ service = this.machine.service;
76
+ send = this.machine.send;
77
+ constructor() {
78
+ bindProps({
79
+ elementRef: inject(ElementRef),
80
+ renderer: inject(Renderer2),
81
+ destroyRef: inject(DestroyRef),
82
+ props: () => this.api().getRootProps(),
83
+ });
84
+ }
85
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive });
86
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ProgressRoot, isStandalone: true, selector: "[progress-root]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ids: { classPropertyName: "ids", publicName: "ids", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, formatOptions: { classPropertyName: "formatOptions", publicName: "formatOptions", isSignal: true, isRequired: false, transformFunction: null }, translations: { classPropertyName: "translations", publicName: "translations", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", valueDetailsChange: "valueDetailsChange" }, providers: [{ provide: PROGRESS_CONTEXT, useExisting: forwardRef(() => ProgressRoot) }], exportAs: ["progressRoot"], ngImport: i0 });
87
+ }
88
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressRoot, decorators: [{
89
+ type: Directive,
90
+ args: [{
91
+ selector: "[progress-root]",
92
+ standalone: true,
93
+ exportAs: "progressRoot",
94
+ providers: [{ provide: PROGRESS_CONTEXT, useExisting: forwardRef(() => ProgressRoot) }],
95
+ }]
96
+ }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ids: [{ type: i0.Input, args: [{ isSignal: true, alias: "ids", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], formatOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatOptions", required: false }] }], translations: [{ type: i0.Input, args: [{ isSignal: true, alias: "translations", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], valueDetailsChange: [{ type: i0.Output, args: ["valueDetailsChange"] }] } });
97
+
98
+ class ProgressRootProvider {
99
+ value = input.required(/* @ts-ignore */
100
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
101
+ state = computed(() => this.value().state(), /* @ts-ignore */
102
+ ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
103
+ api = computed(() => this.value().api(), /* @ts-ignore */
104
+ ...(ngDevMode ? [{ debugName: "api" }] : /* istanbul ignore next */ []));
105
+ send = (event) => this.value().send(event);
106
+ get service() {
107
+ return this.value().service;
108
+ }
109
+ constructor() {
110
+ bindProps({
111
+ elementRef: inject(ElementRef),
112
+ renderer: inject(Renderer2),
113
+ destroyRef: inject(DestroyRef),
114
+ props: () => this.api().getRootProps(),
115
+ });
116
+ }
117
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressRootProvider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
118
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ProgressRootProvider, isStandalone: true, selector: "[progress-root-provider]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{ provide: PROGRESS_CONTEXT, useExisting: forwardRef(() => ProgressRootProvider) }], exportAs: ["progressRootProvider"], ngImport: i0 });
119
+ }
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressRootProvider, decorators: [{
121
+ type: Directive,
122
+ args: [{
123
+ selector: "[progress-root-provider]",
124
+ standalone: true,
125
+ exportAs: "progressRootProvider",
126
+ providers: [{ provide: PROGRESS_CONTEXT, useExisting: forwardRef(() => ProgressRootProvider) }],
127
+ }]
128
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
129
+
130
+ function applyProgressPartProps(props) {
131
+ bindProps({
132
+ elementRef: inject(ElementRef),
133
+ renderer: inject(Renderer2),
134
+ destroyRef: inject(DestroyRef),
135
+ props,
136
+ });
137
+ }
138
+
139
+ class ProgressLabel {
140
+ constructor() {
141
+ const context = injectProgressContext();
142
+ applyProgressPartProps(() => context.api().getLabelProps());
143
+ }
144
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
145
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ProgressLabel, isStandalone: true, selector: "[progress-label]", exportAs: ["progressLabel"], ngImport: i0 });
146
+ }
147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressLabel, decorators: [{
148
+ type: Directive,
149
+ args: [{
150
+ selector: "[progress-label]",
151
+ standalone: true,
152
+ exportAs: "progressLabel",
153
+ }]
154
+ }], ctorParameters: () => [] });
155
+
156
+ class ProgressTrack {
157
+ constructor() {
158
+ const context = injectProgressContext();
159
+ applyProgressPartProps(() => context.api().getTrackProps());
160
+ }
161
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressTrack, deps: [], target: i0.ɵɵFactoryTarget.Directive });
162
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ProgressTrack, isStandalone: true, selector: "[progress-track]", exportAs: ["progressTrack"], ngImport: i0 });
163
+ }
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressTrack, decorators: [{
165
+ type: Directive,
166
+ args: [{
167
+ selector: "[progress-track]",
168
+ standalone: true,
169
+ exportAs: "progressTrack",
170
+ }]
171
+ }], ctorParameters: () => [] });
172
+
173
+ class ProgressRange {
174
+ constructor() {
175
+ const context = injectProgressContext();
176
+ applyProgressPartProps(() => context.api().getRangeProps());
177
+ }
178
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressRange, deps: [], target: i0.ɵɵFactoryTarget.Directive });
179
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ProgressRange, isStandalone: true, selector: "[progress-range]", exportAs: ["progressRange"], ngImport: i0 });
180
+ }
181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressRange, decorators: [{
182
+ type: Directive,
183
+ args: [{
184
+ selector: "[progress-range]",
185
+ standalone: true,
186
+ exportAs: "progressRange",
187
+ }]
188
+ }], ctorParameters: () => [] });
189
+
190
+ class ProgressValueText {
191
+ context = injectProgressContext();
192
+ elementRef = inject(ElementRef);
193
+ renderer = inject(Renderer2);
194
+ ownsTextContent = signal(false, /* @ts-ignore */
195
+ ...(ngDevMode ? [{ debugName: "ownsTextContent" }] : /* istanbul ignore next */ []));
196
+ percentAsString = computed(() => this.context.api().percentAsString, /* @ts-ignore */
197
+ ...(ngDevMode ? [{ debugName: "percentAsString" }] : /* istanbul ignore next */ []));
198
+ valueAsString = computed(() => this.context.api().valueAsString, /* @ts-ignore */
199
+ ...(ngDevMode ? [{ debugName: "valueAsString" }] : /* istanbul ignore next */ []));
200
+ constructor() {
201
+ applyProgressPartProps(() => this.context.api().getValueTextProps());
202
+ effect(() => {
203
+ if (!this.ownsTextContent())
204
+ return;
205
+ this.renderer.setProperty(this.elementRef.nativeElement, "textContent", this.percentAsString());
206
+ });
207
+ }
208
+ ngAfterContentInit() {
209
+ this.ownsTextContent.set(hasOnlyWhitespaceContent(this.elementRef.nativeElement));
210
+ }
211
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressValueText, deps: [], target: i0.ɵɵFactoryTarget.Directive });
212
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ProgressValueText, isStandalone: true, selector: "[progress-value-text]", exportAs: ["progressValueText"], ngImport: i0 });
213
+ }
214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressValueText, decorators: [{
215
+ type: Directive,
216
+ args: [{
217
+ selector: "[progress-value-text]",
218
+ standalone: true,
219
+ exportAs: "progressValueText",
220
+ }]
221
+ }], ctorParameters: () => [] });
222
+ function hasOnlyWhitespaceContent(element) {
223
+ return element.firstElementChild === null && (element.textContent?.trim() ?? "") === "";
224
+ }
225
+
226
+ class ProgressView {
227
+ state = input.required(/* @ts-ignore */
228
+ ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
229
+ constructor() {
230
+ const context = injectProgressContext();
231
+ bindProps({
232
+ elementRef: inject(ElementRef),
233
+ renderer: inject(Renderer2),
234
+ destroyRef: inject(DestroyRef),
235
+ props: () => context.api().getViewProps({ state: this.state() }),
236
+ });
237
+ }
238
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressView, deps: [], target: i0.ɵɵFactoryTarget.Directive });
239
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ProgressView, isStandalone: true, selector: "[progress-view]", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["progressView"], ngImport: i0 });
240
+ }
241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressView, decorators: [{
242
+ type: Directive,
243
+ args: [{
244
+ selector: "[progress-view]",
245
+ standalone: true,
246
+ exportAs: "progressView",
247
+ }]
248
+ }], ctorParameters: () => [], propDecorators: { state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }] } });
249
+
250
+ class ProgressCircle {
251
+ constructor() {
252
+ const context = injectProgressContext();
253
+ applyProgressPartProps(() => context.api().getCircleProps());
254
+ }
255
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressCircle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
256
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ProgressCircle, isStandalone: true, selector: "svg[progress-circle]", exportAs: ["progressCircle"], ngImport: i0 });
257
+ }
258
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressCircle, decorators: [{
259
+ type: Directive,
260
+ args: [{
261
+ selector: "svg[progress-circle]",
262
+ standalone: true,
263
+ exportAs: "progressCircle",
264
+ }]
265
+ }], ctorParameters: () => [] });
266
+
267
+ class ProgressCircleTrack {
268
+ constructor() {
269
+ const context = injectProgressContext();
270
+ applyProgressPartProps(() => context.api().getCircleTrackProps());
271
+ }
272
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressCircleTrack, deps: [], target: i0.ɵɵFactoryTarget.Directive });
273
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ProgressCircleTrack, isStandalone: true, selector: "circle[progress-circle-track]", exportAs: ["progressCircleTrack"], ngImport: i0 });
274
+ }
275
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressCircleTrack, decorators: [{
276
+ type: Directive,
277
+ args: [{
278
+ selector: "circle[progress-circle-track]",
279
+ standalone: true,
280
+ exportAs: "progressCircleTrack",
281
+ }]
282
+ }], ctorParameters: () => [] });
283
+
284
+ class ProgressCircleRange {
285
+ constructor() {
286
+ const context = injectProgressContext();
287
+ applyProgressPartProps(() => context.api().getCircleRangeProps());
288
+ }
289
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressCircleRange, deps: [], target: i0.ɵɵFactoryTarget.Directive });
290
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ProgressCircleRange, isStandalone: true, selector: "circle[progress-circle-range]", exportAs: ["progressCircleRange"], ngImport: i0 });
291
+ }
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressCircleRange, decorators: [{
293
+ type: Directive,
294
+ args: [{
295
+ selector: "circle[progress-circle-range]",
296
+ standalone: true,
297
+ exportAs: "progressCircleRange",
298
+ }]
299
+ }], ctorParameters: () => [] });
300
+
301
+ class ProgressContext {
302
+ static ngTemplateContextGuard(_directive, context) {
303
+ void context;
304
+ return true;
305
+ }
306
+ progress = injectProgressContext();
307
+ templateRef = inject(TemplateRef);
308
+ viewContainer = inject(ViewContainerRef);
309
+ constructor() {
310
+ const view = this.viewContainer.createEmbeddedView(this.templateRef, {
311
+ $implicit: this.progress.api,
312
+ api: this.progress.api,
313
+ });
314
+ effect(() => {
315
+ this.progress.api();
316
+ view.detectChanges();
317
+ });
318
+ inject(DestroyRef).onDestroy(() => view.destroy());
319
+ }
320
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressContext, deps: [], target: i0.ɵɵFactoryTarget.Directive });
321
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ProgressContext, isStandalone: true, selector: "[progress-context]", exportAs: ["progressContext"], ngImport: i0 });
322
+ }
323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ProgressContext, decorators: [{
324
+ type: Directive,
325
+ args: [{
326
+ selector: "[progress-context]",
327
+ standalone: true,
328
+ exportAs: "progressContext",
329
+ }]
330
+ }], ctorParameters: () => [] });
331
+
332
+ /**
333
+ * Generated bundle index. Do not edit.
334
+ */
335
+
336
+ export { PROGRESS_CONTEXT, ProgressCircle, ProgressCircleRange, ProgressCircleTrack, ProgressContext, ProgressLabel, ProgressRange, ProgressRoot, ProgressRootProvider, ProgressTrack, ProgressValueText, ProgressView, injectProgressContext, useProgress };
337
+ //# sourceMappingURL=wirekyt-angular-progress.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wirekyt-angular-progress.mjs","sources":["../../src/components/progress/use-context.ts","../../src/components/progress/use.ts","../../src/components/progress/root.ts","../../src/components/progress/root-provider.ts","../../src/components/progress/apply-part-props.ts","../../src/components/progress/label.ts","../../src/components/progress/track.ts","../../src/components/progress/range.ts","../../src/components/progress/value-text.ts","../../src/components/progress/view.ts","../../src/components/progress/circle.ts","../../src/components/progress/circle-track.ts","../../src/components/progress/circle-range.ts","../../src/components/progress/context.ts","../../src/components/progress/wirekyt-angular-progress.ts"],"sourcesContent":["import { InjectionToken, inject } from \"@angular/core\";\n\nimport type { UseProgressReturn } from \"./use\";\n\nexport const PROGRESS_CONTEXT = new InjectionToken<UseProgressReturn>(\"WIREKYT.PROGRESS_CONTEXT\");\n\nexport function injectProgressContext(): UseProgressReturn {\n return inject(PROGRESS_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 progress from \"@wirekyt/dom/machines/progress\";\n\ntype OptionalId<T extends { id: string }> = Omit<T, \"id\"> & { id?: string };\n\nexport interface UseProgressProps extends OptionalId<Omit<progress.Props, \"dir\" | \"getRootNode\">> {}\n\nexport type UseProgressReturn = UseMachineReturn<\n progress.Service[\"state\"],\n progress.Api,\n progress.Service\n>;\n\nexport interface UseProgressOptions {\n context: () => UseProgressProps;\n}\n\ntype ProgressSchema = progress.Machine extends Machine<infer TSchema> ? TSchema : never;\ntype ProgressContext = Record<string, unknown>;\n\nexport function useProgress(options: UseProgressOptions): UseProgressReturn {\n const locale = injectLocale();\n const environment = injectEnvironment();\n const fallbackId = createId();\n\n return useMachine<ProgressSchema, progress.Api>({\n machine: progress.machine,\n context: () => {\n const props = options.context();\n const context = {\n ...props,\n dir: locale.dir,\n id: props.id ?? fallbackId,\n locale: props.locale ?? locale.locale,\n getRootNode: environment.getRootNode,\n };\n return context as ProgressContext;\n },\n connect: (service, normalize) => progress.connect(service, normalize),\n });\n}\n","import type * as progress from \"@wirekyt/dom/machines/progress\";\n\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n type InputSignal,\n type ModelSignal,\n type OutputEmitterRef,\n type Signal,\n forwardRef,\n inject,\n input,\n model,\n output,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport type {\n ProgressElementIds,\n ProgressIntlTranslations,\n ProgressValueChangeDetails,\n} from \"./types\";\n\nimport { useProgress, type UseProgressReturn } from \"./use\";\nimport { PROGRESS_CONTEXT } from \"./use-context\";\n\n@Directive({\n selector: \"[progress-root]\",\n standalone: true,\n exportAs: \"progressRoot\",\n providers: [{ provide: PROGRESS_CONTEXT, useExisting: forwardRef(() => ProgressRoot) }],\n})\nexport class ProgressRoot implements UseProgressReturn {\n readonly id: InputSignal<string | undefined> = input<string | undefined>(undefined);\n readonly ids: InputSignal<Partial<ProgressElementIds> | undefined> = input<\n Partial<ProgressElementIds> | undefined\n >(undefined);\n readonly value: ModelSignal<number | null | undefined> = model<number | null | undefined>(\n undefined,\n );\n readonly defaultValue: InputSignal<number | null | undefined> = input<number | null | undefined>(\n undefined,\n );\n readonly min: InputSignal<number | undefined> = input<number | undefined>(undefined);\n readonly max: InputSignal<number | undefined> = input<number | undefined>(undefined);\n readonly orientation: InputSignal<\"horizontal\" | \"vertical\" | undefined> = input<\n \"horizontal\" | \"vertical\" | undefined\n >(undefined);\n readonly formatOptions: InputSignal<Intl.NumberFormatOptions | undefined> = input<\n Intl.NumberFormatOptions | undefined\n >(undefined);\n readonly translations: InputSignal<ProgressIntlTranslations | undefined> = input<\n ProgressIntlTranslations | undefined\n >(undefined);\n readonly locale: InputSignal<string | undefined> = input<string | undefined>(undefined);\n readonly valueDetailsChange: OutputEmitterRef<ProgressValueChangeDetails> =\n output<ProgressValueChangeDetails>();\n\n private readonly machine = useProgress({\n context: () => ({\n id: this.id(),\n ids: this.ids(),\n value: this.value(),\n defaultValue: this.defaultValue(),\n min: this.min(),\n max: this.max(),\n orientation: this.orientation(),\n formatOptions: this.formatOptions(),\n translations: this.translations(),\n locale: this.locale(),\n onValueChange: (details) => {\n this.value.set(details.value);\n this.valueDetailsChange.emit(details);\n },\n }),\n });\n\n readonly state: Signal<progress.Service[\"state\"]> = this.machine.state;\n readonly api: Signal<progress.Api> = this.machine.api;\n readonly service: progress.Service = this.machine.service;\n readonly send: progress.Service[\"send\"] = this.machine.send;\n\n constructor() {\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => this.api().getRootProps(),\n });\n }\n}\n","import type * as progress from \"@wirekyt/dom/machines/progress\";\n\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n type InputSignal,\n type Signal,\n computed,\n forwardRef,\n inject,\n input,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport type { UseProgressReturn } from \"./use\";\n\nimport { PROGRESS_CONTEXT } from \"./use-context\";\n\n@Directive({\n selector: \"[progress-root-provider]\",\n standalone: true,\n exportAs: \"progressRootProvider\",\n providers: [{ provide: PROGRESS_CONTEXT, useExisting: forwardRef(() => ProgressRootProvider) }],\n})\nexport class ProgressRootProvider implements UseProgressReturn {\n readonly value: InputSignal<UseProgressReturn> = input.required<UseProgressReturn>();\n readonly state: Signal<progress.Service[\"state\"]> = computed(() => this.value().state());\n readonly api: Signal<progress.Api> = computed(() => this.value().api());\n readonly send: progress.Service[\"send\"] = (event) => this.value().send(event);\n\n get service(): progress.Service {\n return this.value().service;\n }\n\n constructor() {\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => this.api().getRootProps(),\n });\n }\n}\n","import { DestroyRef, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\ntype ProgressPartProps = Record<string, unknown>;\n\nexport function applyProgressPartProps(props: () => ProgressPartProps | undefined): void {\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props,\n });\n}\n","import { Directive } from \"@angular/core\";\n\nimport { applyProgressPartProps } from \"./apply-part-props\";\nimport { injectProgressContext } from \"./use-context\";\n\n@Directive({\n selector: \"[progress-label]\",\n standalone: true,\n exportAs: \"progressLabel\",\n})\nexport class ProgressLabel {\n constructor() {\n const context = injectProgressContext();\n applyProgressPartProps(() => context.api().getLabelProps());\n }\n}\n","import { Directive } from \"@angular/core\";\n\nimport { applyProgressPartProps } from \"./apply-part-props\";\nimport { injectProgressContext } from \"./use-context\";\n\n@Directive({\n selector: \"[progress-track]\",\n standalone: true,\n exportAs: \"progressTrack\",\n})\nexport class ProgressTrack {\n constructor() {\n const context = injectProgressContext();\n applyProgressPartProps(() => context.api().getTrackProps());\n }\n}\n","import { Directive } from \"@angular/core\";\n\nimport { applyProgressPartProps } from \"./apply-part-props\";\nimport { injectProgressContext } from \"./use-context\";\n\n@Directive({\n selector: \"[progress-range]\",\n standalone: true,\n exportAs: \"progressRange\",\n})\nexport class ProgressRange {\n constructor() {\n const context = injectProgressContext();\n applyProgressPartProps(() => context.api().getRangeProps());\n }\n}\n","import {\n Directive,\n ElementRef,\n Renderer2,\n computed,\n effect,\n inject,\n signal,\n type AfterContentInit,\n type Signal,\n} from \"@angular/core\";\n\nimport { applyProgressPartProps } from \"./apply-part-props\";\nimport { injectProgressContext } from \"./use-context\";\n\n@Directive({\n selector: \"[progress-value-text]\",\n standalone: true,\n exportAs: \"progressValueText\",\n})\nexport class ProgressValueText implements AfterContentInit {\n private readonly context = injectProgressContext();\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly ownsTextContent = signal(false);\n\n readonly percentAsString: Signal<string> = computed(() => this.context.api().percentAsString);\n readonly valueAsString: Signal<string> = computed(() => this.context.api().valueAsString);\n\n constructor() {\n applyProgressPartProps(() => this.context.api().getValueTextProps());\n\n effect(() => {\n if (!this.ownsTextContent()) return;\n this.renderer.setProperty(\n this.elementRef.nativeElement,\n \"textContent\",\n this.percentAsString(),\n );\n });\n }\n\n ngAfterContentInit(): void {\n this.ownsTextContent.set(hasOnlyWhitespaceContent(this.elementRef.nativeElement));\n }\n}\n\nfunction hasOnlyWhitespaceContent(element: HTMLElement): boolean {\n return element.firstElementChild === null && (element.textContent?.trim() ?? \"\") === \"\";\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n type InputSignal,\n inject,\n input,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport type { ProgressViewProps } from \"./types\";\n\nimport { injectProgressContext } from \"./use-context\";\n\n@Directive({\n selector: \"[progress-view]\",\n standalone: true,\n exportAs: \"progressView\",\n})\nexport class ProgressView {\n readonly state: InputSignal<ProgressViewProps[\"state\"]> =\n input.required<ProgressViewProps[\"state\"]>();\n\n constructor() {\n const context = injectProgressContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => context.api().getViewProps({ state: this.state() }),\n });\n }\n}\n","import { Directive } from \"@angular/core\";\n\nimport { applyProgressPartProps } from \"./apply-part-props\";\nimport { injectProgressContext } from \"./use-context\";\n\n@Directive({\n selector: \"svg[progress-circle]\",\n standalone: true,\n exportAs: \"progressCircle\",\n})\nexport class ProgressCircle {\n constructor() {\n const context = injectProgressContext();\n applyProgressPartProps(() => context.api().getCircleProps());\n }\n}\n","import { Directive } from \"@angular/core\";\n\nimport { applyProgressPartProps } from \"./apply-part-props\";\nimport { injectProgressContext } from \"./use-context\";\n\n@Directive({\n selector: \"circle[progress-circle-track]\",\n standalone: true,\n exportAs: \"progressCircleTrack\",\n})\nexport class ProgressCircleTrack {\n constructor() {\n const context = injectProgressContext();\n applyProgressPartProps(() => context.api().getCircleTrackProps());\n }\n}\n","import { Directive } from \"@angular/core\";\n\nimport { applyProgressPartProps } from \"./apply-part-props\";\nimport { injectProgressContext } from \"./use-context\";\n\n@Directive({\n selector: \"circle[progress-circle-range]\",\n standalone: true,\n exportAs: \"progressCircleRange\",\n})\nexport class ProgressCircleRange {\n constructor() {\n const context = injectProgressContext();\n applyProgressPartProps(() => context.api().getCircleRangeProps());\n }\n}\n","import {\n DestroyRef,\n Directive,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n} from \"@angular/core\";\n\nimport type { UseProgressReturn } from \"./use\";\n\nimport { injectProgressContext } from \"./use-context\";\n\nexport interface ProgressContextTemplate {\n $implicit: UseProgressReturn[\"api\"];\n api: UseProgressReturn[\"api\"];\n}\n\n@Directive({\n selector: \"[progress-context]\",\n standalone: true,\n exportAs: \"progressContext\",\n})\nexport class ProgressContext {\n static ngTemplateContextGuard(\n _directive: ProgressContext,\n context: unknown,\n ): context is ProgressContextTemplate {\n void context;\n return true;\n }\n\n private readonly progress = injectProgressContext();\n private readonly templateRef = inject<TemplateRef<ProgressContextTemplate>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n constructor() {\n const view = this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: this.progress.api,\n api: this.progress.api,\n });\n\n effect(() => {\n this.progress.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":";;;;;;MAIa,gBAAgB,GAAG,IAAI,cAAc,CAAoB,0BAA0B;SAEhF,qBAAqB,GAAA;AACnC,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC;AACjC;;ACoBM,SAAU,WAAW,CAAC,OAA2B,EAAA;AACrD,IAAA,MAAM,MAAM,GAAG,YAAY,EAAE;AAC7B,IAAA,MAAM,WAAW,GAAG,iBAAiB,EAAE;AACvC,IAAA,MAAM,UAAU,GAAG,QAAQ,EAAE;AAE7B,IAAA,OAAO,UAAU,CAA+B;QAC9C,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,OAAO,EAAE,MAAK;AACZ,YAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE;AAC/B,YAAA,MAAM,OAAO,GAAG;AACd,gBAAA,GAAG,KAAK;gBACR,GAAG,EAAE,MAAM,CAAC,GAAG;AACf,gBAAA,EAAE,EAAE,KAAK,CAAC,EAAE,IAAI,UAAU;AAC1B,gBAAA,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM;gBACrC,WAAW,EAAE,WAAW,CAAC,WAAW;aACrC;AACD,YAAA,OAAO,OAA0B;QACnC,CAAC;AACD,QAAA,O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AG,EAAE;YACnB,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,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,iBAAiB;AAC5B,iBAAA;;;ACtBD;;AAEG;;;;"}
@@ -29,25 +29,18 @@ function useQrCode(options) {
29
29
  }
30
30
 
31
31
  class QrCodeRoot {
32
- /** The unique identifier of the QR code. */
33
32
  id = input(undefined, /* @ts-ignore */
34
33
  ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
35
- /** The ids of the QR code elements. Useful for composition. */
36
34
  ids = input(undefined, /* @ts-ignore */
37
35
  ...(ngDevMode ? [{ debugName: "ids" }] : /* istanbul ignore next */ []));
38
- /** The controlled value to encode. */
39
36
  value = model(undefined, /* @ts-ignore */
40
37
  ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
41
- /** The initial value to encode when uncontrolled. */
42
38
  defaultValue = input(undefined, /* @ts-ignore */
43
39
  ...(ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []));
44
- /** The QR code encoding options. */
45
40
  encoding = input(undefined, /* @ts-ignore */
46
41
  ...(ngDevMode ? [{ debugName: "encoding" }] : /* istanbul ignore next */ []));
47
- /** The pixel size of the QR code. */
48
42
  pixelSize = input(undefined, /* @ts-ignore */
49
43
  ...(ngDevMode ? [{ debugName: "pixelSize" }] : /* istanbul ignore next */ []));
50
- /** Details emitted when the encoded value changes. */
51
44
  valueDetailsChange = output();
52
45
  machine = useQrCode({
53
46
  context: () => ({
@@ -90,7 +83,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
90
83
  }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ids: [{ type: i0.Input, args: [{ isSignal: true, alias: "ids", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], encoding: [{ type: i0.Input, args: [{ isSignal: true, alias: "encoding", required: false }] }], pixelSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pixelSize", required: false }] }], valueDetailsChange: [{ type: i0.Output, args: ["valueDetailsChange"] }] } });
91
84
 
92
85
  class QrCodeRootProvider {
93
- /** The QR code machine returned by useQrCode(). */
94
86
  value = input.required(/* @ts-ignore */
95
87
  ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
96
88
  state = computed(() => this.value().state(), /* @ts-ignore */
@@ -235,13 +227,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
235
227
  }], ctorParameters: () => [] });
236
228
 
237
229
  class QrCodeDownloadTrigger {
238
- /** The mime type of the image. */
239
230
  mimeType = input.required(/* @ts-ignore */
240
231
  ...(ngDevMode ? [{ debugName: "mimeType" }] : /* istanbul ignore next */ []));
241
- /** The quality of the image. */
242
232
  quality = input(undefined, /* @ts-ignore */
243
233
  ...(ngDevMode ? [{ debugName: "quality" }] : /* istanbul ignore next */ []));
244
- /** The name of the file. */
245
234
  fileName = input.required(/* @ts-ignore */
246
235
  ...(ngDevMode ? [{ debugName: "fileName" }] : /* istanbul ignore next */ []));
247
236
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"wirekyt-angular-qr-code.mjs","sources":["../../src/components/qr-code/use-context.ts","../../src/components/qr-code/use.ts","../../src/components/qr-code/root.ts","../../src/components/qr-code/root-provider.ts","../../src/components/qr-code/svg-props.ts","../../src/components/qr-code/frame.ts","../../src/components/qr-code/pattern.ts","../../src/components/qr-code/overlay.ts","../../src/components/qr-code/download-trigger.ts","../../src/components/qr-code/context.ts","../../src/components/qr-code/wirekyt-angular-qr-code.ts"],"sourcesContent":["import { InjectionToken, inject } from \"@angular/core\";\n\nimport type { UseQrCodeReturn } from \"./use\";\n\nexport const QR_CODE_CONTEXT = new InjectionToken<UseQrCodeReturn>(\"WIREKYT.QR_CODE_CONTEXT\");\n\nexport function injectQrCodeContext(): UseQrCodeReturn {\n return inject(QR_CODE_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 qrCode from \"@wirekyt/dom/machines/qr-code\";\n\ntype OptionalId<T extends { id: string }> = Omit<T, \"id\"> & { id?: string };\n\nexport interface UseQrCodeProps extends OptionalId<Omit<qrCode.Props, \"dir\" | \"getRootNode\">> {}\n\nexport type UseQrCodeReturn = UseMachineReturn<qrCode.Service[\"state\"], qrCode.Api, qrCode.Service>;\n\nexport interface UseQrCodeOptions {\n context: () => UseQrCodeProps;\n}\n\ntype QrCodeContext = Record<string, unknown>;\ntype QrCodeSchema = qrCode.Machine extends Machine<infer TSchema> ? TSchema : never;\n\nexport function useQrCode(options: UseQrCodeOptions): UseQrCodeReturn {\n const locale = injectLocale();\n const environment = injectEnvironment();\n const fallbackId = createId();\n\n return useMachine<QrCodeSchema, qrCode.Api>({\n machine: qrCode.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 QrCodeContext;\n },\n connect: (service, normalize) => qrCode.connect(service, normalize),\n });\n}\n","import type * as qrCode from \"@wirekyt/dom/machines/qr-code\";\n\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n forwardRef,\n inject,\n input,\n model,\n output,\n type InputSignal,\n type ModelSignal,\n type OutputEmitterRef,\n type Signal,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport type { QrCodeElementIds, QrCodeGenerateOptions, QrCodeValueChangeDetails } from \"./types\";\n\nimport { useQrCode, type UseQrCodeReturn } from \"./use\";\nimport { QR_CODE_CONTEXT } from \"./use-context\";\n\n@Directive({\n selector: \"[qr-code-root]\",\n standalone: true,\n exportAs: \"qrCodeRoot\",\n providers: [{ provide: QR_CODE_CONTEXT, useExisting: forwardRef(() => QrCodeRoot) }],\n})\nexport class QrCodeRoot implements UseQrCodeReturn {\n /** The unique identifier of the QR code. */\n readonly id: InputSignal<string | undefined> = input<string | undefined>(undefined);\n /** The ids of the QR code elements. Useful for composition. */\n readonly ids: InputSignal<QrCodeElementIds | undefined> = input<QrCodeElementIds | undefined>(\n undefined,\n );\n /** The controlled value to encode. */\n readonly value: ModelSignal<string | undefined> = model<string | undefined>(undefined);\n /** The initial value to encode when uncontrolled. */\n readonly defaultValue: InputSignal<string | undefined> = input<string | undefined>(undefined);\n /** The QR code encoding options. */\n readonly encoding: InputSignal<QrCodeGenerateOptions | undefined> = input<\n QrCodeGenerateOptions | undefined\n >(undefined);\n /** The pixel size of the QR code. */\n readonly pixelSize: InputSignal<number | undefined> = input<number | undefined>(undefined);\n /** Details emitted when the encoded value changes. */\n readonly valueDetailsChange: OutputEmitterRef<QrCodeValueChangeDetails> =\n output<QrCodeValueChangeDetails>();\n\n private readonly machine = useQrCode({\n context: () => ({\n id: this.id(),\n ids: this.ids(),\n value: this.value(),\n defaultValue: this.defaultValue(),\n encoding: this.encoding(),\n pixelSize: this.pixelSize(),\n onValueChange: (details) => {\n if (this.value() !== details.value) this.value.set(details.value);\n this.valueDetailsChange.emit(details);\n },\n }),\n });\n\n readonly state: Signal<qrCode.Service[\"state\"]> = this.machine.state;\n readonly api: Signal<qrCode.Api> = this.machine.api;\n readonly service: qrCode.Service = this.machine.service;\n readonly send: qrCode.Service[\"send\"] = this.machine.send;\n\n constructor() {\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => this.api().getRootProps(),\n });\n }\n}\n","import type * as qrCode from \"@wirekyt/dom/machines/qr-code\";\n\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n type InputSignal,\n type Signal,\n computed,\n forwardRef,\n inject,\n input,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport type { UseQrCodeReturn } from \"./use\";\n\nimport { QR_CODE_CONTEXT } from \"./use-context\";\n\n@Directive({\n selector: \"[qr-code-root-provider]\",\n standalone: true,\n exportAs: \"qrCodeRootProvider\",\n providers: [{ provide: QR_CODE_CONTEXT, useExisting: forwardRef(() => QrCodeRootProvider) }],\n})\nexport class QrCodeRootProvider implements UseQrCodeReturn {\n /** The QR code machine returned by useQrCode(). */\n readonly value: InputSignal<UseQrCodeReturn> = input.required<UseQrCodeReturn>();\n readonly state: Signal<qrCode.Service[\"state\"]> = computed(() => this.value().state());\n readonly api: Signal<qrCode.Api> = computed(() => this.value().api());\n readonly send: qrCode.Service[\"send\"] = (event) => this.value().send(event);\n\n get service(): qrCode.Service {\n return this.value().service;\n }\n\n resolveValue(): UseQrCodeReturn {\n return this.value();\n }\n\n constructor() {\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => this.api().getRootProps(),\n });\n }\n}\n","import { type DestroyRef, type ElementRef, type Renderer2, effect } from \"@angular/core\";\n\nconst SVG_ATTRIBUTE_KEYS = new Set([\"d\", \"viewBox\", \"xmlns\"]);\n\nexport function omitQrCodeSvgAttributes(props: Record<string, unknown>): Record<string, unknown> {\n const next = { ...props };\n for (const key of SVG_ATTRIBUTE_KEYS) {\n delete next[key];\n }\n return next;\n}\n\nexport function applyQrCodeSvgAttributes(\n elementRef: ElementRef<SVGElement>,\n renderer: Renderer2,\n destroyRef: DestroyRef,\n props: () => Record<string, unknown> | undefined,\n): void {\n const applied = new Set<string>();\n\n effect(() => {\n const next = props() ?? {};\n for (const key of SVG_ATTRIBUTE_KEYS) {\n const value = next[key];\n if (value == null || value === false) {\n if (applied.has(key)) {\n renderer.removeAttribute(elementRef.nativeElement, key);\n applied.delete(key);\n }\n continue;\n }\n renderer.setAttribute(elementRef.nativeElement, key, String(value));\n applied.add(key);\n }\n });\n\n destroyRef.onDestroy(() => {\n for (const key of applied) {\n renderer.removeAttribute(elementRef.nativeElement, key);\n }\n applied.clear();\n });\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { applyQrCodeSvgAttributes, omitQrCodeSvgAttributes } from \"./svg-props\";\nimport { injectQrCodeContext } from \"./use-context\";\n\n@Directive({\n selector: \"svg[qr-code-frame]\",\n standalone: true,\n exportAs: \"qrCodeFrame\",\n})\nexport class QrCodeFrame {\n constructor() {\n const context = injectQrCodeContext();\n const elementRef = inject<ElementRef<SVGSVGElement>>(ElementRef);\n const renderer = inject(Renderer2);\n const destroyRef = inject(DestroyRef);\n const props = () => context.api().getFrameProps() as Record<string, unknown>;\n\n bindProps({\n elementRef: elementRef as unknown as ElementRef<HTMLElement>,\n renderer,\n destroyRef,\n props: () => omitQrCodeSvgAttributes(props()),\n });\n applyQrCodeSvgAttributes(\n elementRef as unknown as ElementRef<SVGElement>,\n renderer,\n destroyRef,\n props,\n );\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { applyQrCodeSvgAttributes, omitQrCodeSvgAttributes } from \"./svg-props\";\nimport { injectQrCodeContext } from \"./use-context\";\n\n@Directive({\n selector: \"path[qr-code-pattern]\",\n standalone: true,\n exportAs: \"qrCodePattern\",\n})\nexport class QrCodePattern {\n constructor() {\n const context = injectQrCodeContext();\n const elementRef = inject<ElementRef<SVGPathElement>>(ElementRef);\n const renderer = inject(Renderer2);\n const destroyRef = inject(DestroyRef);\n const props = () => context.api().getPatternProps() as Record<string, unknown>;\n\n bindProps({\n elementRef: elementRef as unknown as ElementRef<HTMLElement>,\n renderer,\n destroyRef,\n props: () => omitQrCodeSvgAttributes(props()),\n });\n applyQrCodeSvgAttributes(\n elementRef as unknown as ElementRef<SVGElement>,\n renderer,\n destroyRef,\n props,\n );\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectQrCodeContext } from \"./use-context\";\n\n@Directive({\n selector: \"[qr-code-overlay]\",\n standalone: true,\n exportAs: \"qrCodeOverlay\",\n})\nexport class QrCodeOverlay {\n constructor() {\n const context = injectQrCodeContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => context.api().getOverlayProps(),\n });\n }\n}\n","import type { DataUrlType } from \"@wirekyt/dom/dom-query\";\n\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n inject,\n input,\n type InputSignal,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectQrCodeContext } from \"./use-context\";\n\n@Directive({\n selector: \"button[qr-code-download-trigger]\",\n standalone: true,\n exportAs: \"qrCodeDownloadTrigger\",\n})\nexport class QrCodeDownloadTrigger {\n /** The mime type of the image. */\n readonly mimeType: InputSignal<DataUrlType> = input.required<DataUrlType>();\n /** The quality of the image. */\n readonly quality: InputSignal<number | undefined> = input<number | undefined>(undefined);\n /** The name of the file. */\n readonly fileName: InputSignal<string> = input.required<string>();\n\n constructor() {\n const context = injectQrCodeContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () =>\n context.api().getDownloadTriggerProps({\n mimeType: this.mimeType(),\n quality: this.quality(),\n fileName: this.fileName(),\n }),\n });\n }\n}\n","import {\n DestroyRef,\n Directive,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n} from \"@angular/core\";\n\nimport type { UseQrCodeReturn } from \"./use\";\n\nimport { injectQrCodeContext } from \"./use-context\";\n\nexport interface QrCodeContextTemplate {\n $implicit: UseQrCodeReturn[\"api\"];\n api: UseQrCodeReturn[\"api\"];\n}\n\n@Directive({\n selector: \"[qr-code-context]\",\n standalone: true,\n exportAs: \"qrCodeContext\",\n})\nexport class QrCodeContext {\n static ngTemplateContextGuard(\n _directive: QrCodeContext,\n context: unknown,\n ): context is QrCodeContextTemplate {\n void context;\n return true;\n }\n\n private readonly qrCode = injectQrCodeContext();\n private readonly templateRef = inject<TemplateRef<QrCodeContextTemplate>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n constructor() {\n const view = this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: this.qrCode.api,\n api: this.qrCode.api,\n });\n\n effect(() => {\n this.qrCode.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":";;;;;;MAIa,eAAe,GAAG,IAAI,cAAc,CAAkB,yBAAyB;SAE5E,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,eAAe,CAAC;AAChC;;ACgBM,SAAU,SAAS,CAAC,OAAyB,EAAA;AACjD,IAAA,MAAM,MAAM,GAAG,YAAY,EAAE;AAC7B,IAAA,MAAM,WAAW,GAAG,iBAAiB,EAAE;AACvC,IAAA,MAAM,UAAU,GAAG,QAAQ,EAAE;AAE7B,IAAA,OAAO,UAAU,CAA2B;QAC1C,OA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OAAO,IAAI;IACb;IAEiB,MAAM,GAAG,mBAAmB,EAAE;AAC9B,IAAA,WAAW,GAAG,MAAM,CAAqC,WAAW,CAAC;AACrE,IAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAEzD,IAAA,WAAA,GAAA;QACE,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,EAAE;AACnE,YAAA,SAAS,EAAE,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,mBAAA,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,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,eAAe;AAC1B,iBAAA;;;ACtBD;;AAEG;;;;"}
1
+ {"version":3,"file":"wirekyt-angular-qr-code.mjs","sources":["../../src/components/qr-code/use-context.ts","../../src/components/qr-code/use.ts","../../src/components/qr-code/root.ts","../../src/components/qr-code/root-provider.ts","../../src/components/qr-code/svg-props.ts","../../src/components/qr-code/frame.ts","../../src/components/qr-code/pattern.ts","../../src/components/qr-code/overlay.ts","../../src/components/qr-code/download-trigger.ts","../../src/components/qr-code/context.ts","../../src/components/qr-code/wirekyt-angular-qr-code.ts"],"sourcesContent":["import { InjectionToken, inject } from \"@angular/core\";\n\nimport type { UseQrCodeReturn } from \"./use\";\n\nexport const QR_CODE_CONTEXT = new InjectionToken<UseQrCodeReturn>(\"WIREKYT.QR_CODE_CONTEXT\");\n\nexport function injectQrCodeContext(): UseQrCodeReturn {\n return inject(QR_CODE_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 qrCode from \"@wirekyt/dom/machines/qr-code\";\n\ntype OptionalId<T extends { id: string }> = Omit<T, \"id\"> & { id?: string };\n\nexport interface UseQrCodeProps extends OptionalId<Omit<qrCode.Props, \"dir\" | \"getRootNode\">> {}\n\nexport type UseQrCodeReturn = UseMachineReturn<qrCode.Service[\"state\"], qrCode.Api, qrCode.Service>;\n\nexport interface UseQrCodeOptions {\n context: () => UseQrCodeProps;\n}\n\ntype QrCodeContext = Record<string, unknown>;\ntype QrCodeSchema = qrCode.Machine extends Machine<infer TSchema> ? TSchema : never;\n\nexport function useQrCode(options: UseQrCodeOptions): UseQrCodeReturn {\n const locale = injectLocale();\n const environment = injectEnvironment();\n const fallbackId = createId();\n\n return useMachine<QrCodeSchema, qrCode.Api>({\n machine: qrCode.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 QrCodeContext;\n },\n connect: (service, normalize) => qrCode.connect(service, normalize),\n });\n}\n","import type * as qrCode from \"@wirekyt/dom/machines/qr-code\";\n\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n forwardRef,\n inject,\n input,\n model,\n output,\n type InputSignal,\n type ModelSignal,\n type OutputEmitterRef,\n type Signal,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport type { QrCodeElementIds, QrCodeGenerateOptions, QrCodeValueChangeDetails } from \"./types\";\n\nimport { useQrCode, type UseQrCodeReturn } from \"./use\";\nimport { QR_CODE_CONTEXT } from \"./use-context\";\n\n@Directive({\n selector: \"[qr-code-root]\",\n standalone: true,\n exportAs: \"qrCodeRoot\",\n providers: [{ provide: QR_CODE_CONTEXT, useExisting: forwardRef(() => QrCodeRoot) }],\n})\nexport class QrCodeRoot implements UseQrCodeReturn {\n readonly id: InputSignal<string | undefined> = input<string | undefined>(undefined);\n readonly ids: InputSignal<QrCodeElementIds | undefined> = input<QrCodeElementIds | undefined>(\n undefined,\n );\n readonly value: ModelSignal<string | undefined> = model<string | undefined>(undefined);\n readonly defaultValue: InputSignal<string | undefined> = input<string | undefined>(undefined);\n readonly encoding: InputSignal<QrCodeGenerateOptions | undefined> = input<\n QrCodeGenerateOptions | undefined\n >(undefined);\n readonly pixelSize: InputSignal<number | undefined> = input<number | undefined>(undefined);\n readonly valueDetailsChange: OutputEmitterRef<QrCodeValueChangeDetails> =\n output<QrCodeValueChangeDetails>();\n\n private readonly machine = useQrCode({\n context: () => ({\n id: this.id(),\n ids: this.ids(),\n value: this.value(),\n defaultValue: this.defaultValue(),\n encoding: this.encoding(),\n pixelSize: this.pixelSize(),\n onValueChange: (details) => {\n if (this.value() !== details.value) this.value.set(details.value);\n this.valueDetailsChange.emit(details);\n },\n }),\n });\n\n readonly state: Signal<qrCode.Service[\"state\"]> = this.machine.state;\n readonly api: Signal<qrCode.Api> = this.machine.api;\n readonly service: qrCode.Service = this.machine.service;\n readonly send: qrCode.Service[\"send\"] = this.machine.send;\n\n constructor() {\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => this.api().getRootProps(),\n });\n }\n}\n","import type * as qrCode from \"@wirekyt/dom/machines/qr-code\";\n\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n type InputSignal,\n type Signal,\n computed,\n forwardRef,\n inject,\n input,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport type { UseQrCodeReturn } from \"./use\";\n\nimport { QR_CODE_CONTEXT } from \"./use-context\";\n\n@Directive({\n selector: \"[qr-code-root-provider]\",\n standalone: true,\n exportAs: \"qrCodeRootProvider\",\n providers: [{ provide: QR_CODE_CONTEXT, useExisting: forwardRef(() => QrCodeRootProvider) }],\n})\nexport class QrCodeRootProvider implements UseQrCodeReturn {\n readonly value: InputSignal<UseQrCodeReturn> = input.required<UseQrCodeReturn>();\n readonly state: Signal<qrCode.Service[\"state\"]> = computed(() => this.value().state());\n readonly api: Signal<qrCode.Api> = computed(() => this.value().api());\n readonly send: qrCode.Service[\"send\"] = (event) => this.value().send(event);\n\n get service(): qrCode.Service {\n return this.value().service;\n }\n\n resolveValue(): UseQrCodeReturn {\n return this.value();\n }\n\n constructor() {\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => this.api().getRootProps(),\n });\n }\n}\n","import { type DestroyRef, type ElementRef, type Renderer2, effect } from \"@angular/core\";\n\nconst SVG_ATTRIBUTE_KEYS = new Set([\"d\", \"viewBox\", \"xmlns\"]);\n\nexport function omitQrCodeSvgAttributes(props: Record<string, unknown>): Record<string, unknown> {\n const next = { ...props };\n for (const key of SVG_ATTRIBUTE_KEYS) {\n delete next[key];\n }\n return next;\n}\n\nexport function applyQrCodeSvgAttributes(\n elementRef: ElementRef<SVGElement>,\n renderer: Renderer2,\n destroyRef: DestroyRef,\n props: () => Record<string, unknown> | undefined,\n): void {\n const applied = new Set<string>();\n\n effect(() => {\n const next = props() ?? {};\n for (const key of SVG_ATTRIBUTE_KEYS) {\n const value = next[key];\n if (value == null || value === false) {\n if (applied.has(key)) {\n renderer.removeAttribute(elementRef.nativeElement, key);\n applied.delete(key);\n }\n continue;\n }\n renderer.setAttribute(elementRef.nativeElement, key, String(value));\n applied.add(key);\n }\n });\n\n destroyRef.onDestroy(() => {\n for (const key of applied) {\n renderer.removeAttribute(elementRef.nativeElement, key);\n }\n applied.clear();\n });\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { applyQrCodeSvgAttributes, omitQrCodeSvgAttributes } from \"./svg-props\";\nimport { injectQrCodeContext } from \"./use-context\";\n\n@Directive({\n selector: \"svg[qr-code-frame]\",\n standalone: true,\n exportAs: \"qrCodeFrame\",\n})\nexport class QrCodeFrame {\n constructor() {\n const context = injectQrCodeContext();\n const elementRef = inject<ElementRef<SVGSVGElement>>(ElementRef);\n const renderer = inject(Renderer2);\n const destroyRef = inject(DestroyRef);\n const props = () => context.api().getFrameProps() as Record<string, unknown>;\n\n bindProps({\n elementRef: elementRef as unknown as ElementRef<HTMLElement>,\n renderer,\n destroyRef,\n props: () => omitQrCodeSvgAttributes(props()),\n });\n applyQrCodeSvgAttributes(\n elementRef as unknown as ElementRef<SVGElement>,\n renderer,\n destroyRef,\n props,\n );\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { applyQrCodeSvgAttributes, omitQrCodeSvgAttributes } from \"./svg-props\";\nimport { injectQrCodeContext } from \"./use-context\";\n\n@Directive({\n selector: \"path[qr-code-pattern]\",\n standalone: true,\n exportAs: \"qrCodePattern\",\n})\nexport class QrCodePattern {\n constructor() {\n const context = injectQrCodeContext();\n const elementRef = inject<ElementRef<SVGPathElement>>(ElementRef);\n const renderer = inject(Renderer2);\n const destroyRef = inject(DestroyRef);\n const props = () => context.api().getPatternProps() as Record<string, unknown>;\n\n bindProps({\n elementRef: elementRef as unknown as ElementRef<HTMLElement>,\n renderer,\n destroyRef,\n props: () => omitQrCodeSvgAttributes(props()),\n });\n applyQrCodeSvgAttributes(\n elementRef as unknown as ElementRef<SVGElement>,\n renderer,\n destroyRef,\n props,\n );\n }\n}\n","import { DestroyRef, Directive, ElementRef, Renderer2, inject } from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectQrCodeContext } from \"./use-context\";\n\n@Directive({\n selector: \"[qr-code-overlay]\",\n standalone: true,\n exportAs: \"qrCodeOverlay\",\n})\nexport class QrCodeOverlay {\n constructor() {\n const context = injectQrCodeContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () => context.api().getOverlayProps(),\n });\n }\n}\n","import type { DataUrlType } from \"@wirekyt/dom/dom-query\";\n\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n inject,\n input,\n type InputSignal,\n} from \"@angular/core\";\nimport { bindProps } from \"@wirekyt/angular\";\n\nimport { injectQrCodeContext } from \"./use-context\";\n\n@Directive({\n selector: \"button[qr-code-download-trigger]\",\n standalone: true,\n exportAs: \"qrCodeDownloadTrigger\",\n})\nexport class QrCodeDownloadTrigger {\n readonly mimeType: InputSignal<DataUrlType> = input.required<DataUrlType>();\n readonly quality: InputSignal<number | undefined> = input<number | undefined>(undefined);\n readonly fileName: InputSignal<string> = input.required<string>();\n\n constructor() {\n const context = injectQrCodeContext();\n bindProps({\n elementRef: inject(ElementRef),\n renderer: inject(Renderer2),\n destroyRef: inject(DestroyRef),\n props: () =>\n context.api().getDownloadTriggerProps({\n mimeType: this.mimeType(),\n quality: this.quality(),\n fileName: this.fileName(),\n }),\n });\n }\n}\n","import {\n DestroyRef,\n Directive,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n} from \"@angular/core\";\n\nimport type { UseQrCodeReturn } from \"./use\";\n\nimport { injectQrCodeContext } from \"./use-context\";\n\nexport interface QrCodeContextTemplate {\n $implicit: UseQrCodeReturn[\"api\"];\n api: UseQrCodeReturn[\"api\"];\n}\n\n@Directive({\n selector: \"[qr-code-context]\",\n standalone: true,\n exportAs: \"qrCodeContext\",\n})\nexport class QrCodeContext {\n static ngTemplateContextGuard(\n _directive: QrCodeContext,\n context: unknown,\n ): context is QrCodeContextTemplate {\n void context;\n return true;\n }\n\n private readonly qrCode = injectQrCodeContext();\n private readonly templateRef = inject<TemplateRef<QrCodeContextTemplate>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n constructor() {\n const view = this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: this.qrCode.api,\n api: this.qrCode.api,\n });\n\n effect(() => {\n this.qrCode.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":";;;;;;MAIa,eAAe,GAAG,IAAI,cAAc,CAAkB,yBAAyB;SAE5E,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,eAAe,CAAC;AAChC;;ACgBM,SAAU,SAAS,CAAC,OAAyB,EAAA;AACjD,IAAA,MAAM,MAAM,GAAG,YAAY,EAAE;AAC7B,IAAA,MAAM,WAAW,GAAG,iBAAiB,EAAE;AACvC,IAAA,MAAM,UAAU,GAAG,QAAQ,EAAE;AAE7B,IAAA,OAAO,UAAU,CAA2B;QAC1C,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAK;AACZ,YAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE;YAC/B,OAAO;AACL,gBAAA,GAAG,KAAK;gBACR,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,WAAW,EAAE,WAAW,CAAC,WAAW;AACpC,gBAAA,EAAE,EAAE,KAAK,CAAC,EAAE,IAAI,UAAU;aACV;QACpB,CAAC;AACD,QAAA,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,KAAK,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC;AACpE,KAAA,CAAC;AACJ;;MCZa,UAAU,CAAA;IACZ,EAAE,GAAoC,KAAK,C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