@daffodil/storefront 0.0.0-PLACEHOLDER

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.
@@ -0,0 +1,460 @@
1
+ import * as i0 from '@angular/core';
2
+ import { output, model, input, ViewChild, Optional, ChangeDetectionStrategy, Component, computed, effect, signal, viewChild, booleanAttribute, Input, Self } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { UntypedFormControl, ReactiveFormsModule, Validators } from '@angular/forms';
5
+ import { Subject, merge, of, map, tap } from 'rxjs';
6
+ import { takeUntil } from 'rxjs/operators';
7
+ import * as i2 from '@daffodil/design/form-field';
8
+ import { DaffFormFieldControl } from '@daffodil/design/form-field';
9
+ import { DaffInputComponent } from '@daffodil/design/input';
10
+ import { coerceNumberProperty } from '@angular/cdk/coercion';
11
+ import { DaffNativeSelectComponent } from '@daffodil/design/native-select';
12
+
13
+ class DaffSfQuantityInputComponent {
14
+ /**
15
+ * @docs-private
16
+ */
17
+ get focused() {
18
+ return this.input.focused;
19
+ }
20
+ get value() {
21
+ return this.ngControl?.control.value || this.quantity();
22
+ }
23
+ set value(value) {
24
+ if (value === 0 || Number.isNaN(value)) {
25
+ value = this.value;
26
+ }
27
+ const val = Math.max(Math.min(Math.round(value), this.max()), this.min());
28
+ this.ngControl?.control.patchValue(val);
29
+ this._inputControl.patchValue(val);
30
+ this.quantity.set(val);
31
+ this.changeDetectorRef.markForCheck();
32
+ }
33
+ constructor(ngControl, changeDetectorRef) {
34
+ this.ngControl = ngControl;
35
+ this.changeDetectorRef = changeDetectorRef;
36
+ /**
37
+ * Event emitted when the quantity input gains focus
38
+ */
39
+ this.focusChange = output();
40
+ /**
41
+ * Event emitted when the quantity input loses focus
42
+ */
43
+ this.blurChange = output();
44
+ /**
45
+ * Event emitted when the quantity input's value changes
46
+ */
47
+ this.valueChange = output();
48
+ this.quantity = model(...(ngDevMode ? [undefined, { debugName: "quantity" }] : []));
49
+ /**
50
+ * The minimum number for the quantity input field
51
+ */
52
+ this.min = input(1, ...(ngDevMode ? [{ debugName: "min" }] : []));
53
+ /**
54
+ * The maximum number for the quantity input field
55
+ */
56
+ this.max = input(10, ...(ngDevMode ? [{ debugName: "max" }] : []));
57
+ /**
58
+ * A new control for the nested native input.
59
+ * We don't bind the native input directly to the inherited form control
60
+ * to avoid triggering updates on the input event.
61
+ * Instead, we listen for the change event and manually patch form control values.
62
+ */
63
+ this._inputControl = new UntypedFormControl();
64
+ this._destroyed = new Subject();
65
+ }
66
+ /**
67
+ * @docs-private
68
+ */
69
+ ngOnInit() {
70
+ this._inputControl.patchValue(this.ngControl?.control.value ?? this.quantity());
71
+ this.setInputDisabled();
72
+ this.ngControl?.statusChanges.pipe(takeUntil(this._destroyed)).subscribe((s) => {
73
+ this.setInputDisabled();
74
+ });
75
+ }
76
+ ngOnDestroy() {
77
+ this._destroyed.next(true);
78
+ }
79
+ focus() {
80
+ this.input.focus();
81
+ }
82
+ /**
83
+ * Callback function fired when the value changes.
84
+ * Used to pass the value back up to the ngControl.
85
+ */
86
+ onValueChange(event) {
87
+ if (event.target instanceof HTMLInputElement) {
88
+ this.value = event.target.valueAsNumber;
89
+ }
90
+ this.valueChange.emit(this.value);
91
+ }
92
+ setInputDisabled() {
93
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
94
+ this.ngControl?.disabled
95
+ ? this._inputControl.disable()
96
+ : this._inputControl.enable();
97
+ }
98
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSfQuantityInputComponent, deps: [{ token: i1.NgControl, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
99
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.18", type: DaffSfQuantityInputComponent, isStandalone: true, selector: "daff-sf-quantity-input", inputs: { quantity: { classPropertyName: "quantity", publicName: "quantity", 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 } }, outputs: { focusChange: "focusChange", blurChange: "blurChange", valueChange: "valueChange", quantity: "quantityChange" }, viewQueries: [{ propertyName: "input", first: true, predicate: DaffInputComponent, descendants: true }], ngImport: i0, template: "<input daff-input\n type=\"number\"\n [attr.max]=\"max()\"\n [attr.min]=\"min()\"\n [attr.step]=\"1\"\n (change)=\"onValueChange($event)\"\n (focus)=\"focusChange.emit()\" \n (blur)=\"blurChange.emit()\"\n [formControl]=\"_inputControl\"\n>\n", dependencies: [{ kind: "component", type: DaffInputComponent, selector: "input[daff-input]", inputs: ["disabled", "required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
100
+ }
101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSfQuantityInputComponent, decorators: [{
102
+ type: Component,
103
+ args: [{ selector: 'daff-sf-quantity-input', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
104
+ DaffInputComponent,
105
+ ReactiveFormsModule,
106
+ ], template: "<input daff-input\n type=\"number\"\n [attr.max]=\"max()\"\n [attr.min]=\"min()\"\n [attr.step]=\"1\"\n (change)=\"onValueChange($event)\"\n (focus)=\"focusChange.emit()\" \n (blur)=\"blurChange.emit()\"\n [formControl]=\"_inputControl\"\n>\n" }]
107
+ }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
108
+ type: Optional
109
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { input: [{
110
+ type: ViewChild,
111
+ args: [DaffInputComponent]
112
+ }], focusChange: [{ type: i0.Output, args: ["focusChange"] }], blurChange: [{ type: i0.Output, args: ["blurChange"] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], quantity: [{ type: i0.Input, args: [{ isSignal: true, alias: "quantity", required: false }] }, { type: i0.Output, args: ["quantityChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }] } });
113
+
114
+ /**
115
+ * @docs-private
116
+ *
117
+ * Create an array of numbers from min to max, not including max.
118
+ */
119
+ const makeValueArray = (min, max, increment) => Array(max - min).fill(0).map((x, i) => (i * increment) + min);
120
+ class DaffSfQuantitySelectComponent {
121
+ constructor() {
122
+ /**
123
+ * A new control for the nested native select.
124
+ * We don't bind the native select directly to the inherited form control
125
+ * to avoid triggering updates on the input event.
126
+ * Instead, we listen for the change event and manually patch form control values.
127
+ */
128
+ this._selectControl = new UntypedFormControl();
129
+ /**
130
+ * The minimum number selectable. Defaults to 1.
131
+ */
132
+ this.min = input(1, ...(ngDevMode ? [{ debugName: "min" }] : []));
133
+ /**
134
+ * The maximum number selectable. Defaults to 10.
135
+ */
136
+ this.max = input(10, ...(ngDevMode ? [{ debugName: "max" }] : []));
137
+ /**
138
+ * Property used to determine whether or not the select is
139
+ * used in a situation where the `max` isn't a true max.
140
+ */
141
+ this.extendable = input(true, ...(ngDevMode ? [{ debugName: "extendable" }] : []));
142
+ /**
143
+ * Event emitted when the quantity select gains focus
144
+ */
145
+ this.focusChange = output();
146
+ /**
147
+ * Event emitted when the quantity select loses focus
148
+ */
149
+ this.blurChange = output();
150
+ /**
151
+ * Event emitted when the quantiy select's value changes
152
+ */
153
+ this.valueChange = output();
154
+ this.quantity = input(...(ngDevMode ? [undefined, { debugName: "quantity" }] : []));
155
+ this.disabled = input(...(ngDevMode ? [undefined, { debugName: "disabled" }] : []));
156
+ /**
157
+ * An input for easily making options for the `select`.
158
+ */
159
+ this.valueArray = computed(() => makeValueArray(this.min(), this.max(), 1), ...(ngDevMode ? [{ debugName: "valueArray" }] : []));
160
+ effect(() => {
161
+ const value = this.quantity();
162
+ this._selectControl.patchValue(value);
163
+ });
164
+ effect(() => {
165
+ if (this.disabled()) {
166
+ this._selectControl.disable();
167
+ }
168
+ else {
169
+ this._selectControl.enable();
170
+ }
171
+ });
172
+ }
173
+ get focused() {
174
+ return this.select?.focused;
175
+ }
176
+ focus() {
177
+ this.select?.focus();
178
+ }
179
+ /**
180
+ * @docs-private
181
+ *
182
+ * Callback function fired when the value changes.
183
+ * Used to pass the value back up to the ngControl.
184
+ */
185
+ onValueChange(event) {
186
+ const val = coerceNumberProperty(event.target.value);
187
+ this.valueChange.emit(val);
188
+ }
189
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSfQuantitySelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
190
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffSfQuantitySelectComponent, isStandalone: true, selector: "daff-sf-quantity-select", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, extendable: { classPropertyName: "extendable", publicName: "extendable", isSignal: true, isRequired: false, transformFunction: null }, quantity: { classPropertyName: "quantity", publicName: "quantity", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { focusChange: "focusChange", blurChange: "blurChange", valueChange: "valueChange" }, viewQueries: [{ propertyName: "select", first: true, predicate: DaffNativeSelectComponent, descendants: true }], ngImport: i0, template: "<select daff-native-select\n [formControl]=\"_selectControl\"\n (focus)=\"focusChange.emit()\" \n (blur)=\"blurChange.emit()\"\n (change)=\"onValueChange($event)\"\n>\n @for (item of valueArray(); track item) {\n <option [value]=\"item\">{{ item }}</option>\n }\n @if (extendable()) {\n <option [value]=\"max()\">{{ max() }}+</option>\n } @else {\n <option [value]=\"max()\">{{ max() }}</option>\n }\n</select>\n", dependencies: [{ kind: "component", type: DaffNativeSelectComponent, selector: "select[daff-native-select]", inputs: ["disabled", "required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
191
+ }
192
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSfQuantitySelectComponent, decorators: [{
193
+ type: Component,
194
+ args: [{ selector: 'daff-sf-quantity-select', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
195
+ DaffNativeSelectComponent,
196
+ ReactiveFormsModule,
197
+ ], template: "<select daff-native-select\n [formControl]=\"_selectControl\"\n (focus)=\"focusChange.emit()\" \n (blur)=\"blurChange.emit()\"\n (change)=\"onValueChange($event)\"\n>\n @for (item of valueArray(); track item) {\n <option [value]=\"item\">{{ item }}</option>\n }\n @if (extendable()) {\n <option [value]=\"max()\">{{ max() }}+</option>\n } @else {\n <option [value]=\"max()\">{{ max() }}</option>\n }\n</select>\n" }]
198
+ }], ctorParameters: () => [], propDecorators: { select: [{
199
+ type: ViewChild,
200
+ args: [DaffNativeSelectComponent]
201
+ }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], extendable: [{ type: i0.Input, args: [{ isSignal: true, alias: "extendable", required: false }] }], focusChange: [{ type: i0.Output, args: ["focusChange"] }], blurChange: [{ type: i0.Output, args: ["blurChange"] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], quantity: [{ type: i0.Input, args: [{ isSignal: true, alias: "quantity", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
202
+
203
+ class DaffSfQuantityFieldComponent extends DaffFormFieldControl {
204
+ /** @docs-private */
205
+ get controlType() {
206
+ return this._showInputField() ? 'native-input' : 'native-select';
207
+ }
208
+ /**
209
+ * @docs-private
210
+ *
211
+ * Implemented as part of DaffFormFieldControl.
212
+ */
213
+ get focused() {
214
+ return this.select()?.focused || this.input()?.focused;
215
+ }
216
+ ;
217
+ /**
218
+ * @docs-private
219
+ *
220
+ * Implemented as part of DaffFormFieldControl.
221
+ */
222
+ get disabled() {
223
+ return this.ngControl?.disabled ?? this._disabled;
224
+ }
225
+ set disabled(value) {
226
+ this._disabled = value;
227
+ }
228
+ /**
229
+ * @docs-private
230
+ *
231
+ * Implemented as part of DaffFormFieldControl.
232
+ */
233
+ get required() {
234
+ return this.ngControl?.control?.hasValidator(Validators.required) ?? this._required;
235
+ }
236
+ set required(value) {
237
+ this._required = value;
238
+ }
239
+ /**
240
+ * @docs-private
241
+ *
242
+ * Returns the lesser of max and selectMax.
243
+ */
244
+ get _maxFloor() {
245
+ return Math.min(this.max(), this.selectMax());
246
+ }
247
+ constructor(ngControl, cd, formField) {
248
+ super(ngControl);
249
+ this.ngControl = ngControl;
250
+ this.cd = cd;
251
+ this.formField = formField;
252
+ /**
253
+ * @docs-private
254
+ */
255
+ this.quantity = signal(1, ...(ngDevMode ? [{ debugName: "quantity" }] : []));
256
+ /**
257
+ * @docs-private
258
+ */
259
+ this._inputHasBeenShown = signal(false, ...(ngDevMode ? [{ debugName: "_inputHasBeenShown" }] : []));
260
+ /**
261
+ * @docs-private
262
+ */
263
+ this._showInputField = computed(() => {
264
+ this.quantity();
265
+ return this._inputHasBeenShown() || this.quantity() >= this.selectMax();
266
+ }, ...(ngDevMode ? [{ debugName: "_showInputField" }] : []));
267
+ /**
268
+ * @docs-private
269
+ */
270
+ this._showSelectField = computed(() => !this._showInputField(), ...(ngDevMode ? [{ debugName: "_showSelectField" }] : []));
271
+ /**
272
+ * @docs-private
273
+ */
274
+ this.input = viewChild(DaffSfQuantityInputComponent, ...(ngDevMode ? [{ debugName: "input" }] : []));
275
+ /**
276
+ * @docs-private
277
+ */
278
+ this.select = viewChild(DaffSfQuantitySelectComponent, ...(ngDevMode ? [{ debugName: "select" }] : []));
279
+ /**
280
+ * The minimum valid value of the quantity field.
281
+ * Must be greater than or equal to 1.
282
+ */
283
+ this.min = input(1, ...(ngDevMode ? [{ debugName: "min" }] : []));
284
+ /**
285
+ * The maximum valid value of the quantity field.
286
+ * Must be greater than `min`.
287
+ */
288
+ this.max = input(500, ...(ngDevMode ? [{ debugName: "max" }] : []));
289
+ /**
290
+ * The maximum number allowed before the field switches from a dropdown to an input.
291
+ * When the value reaches this number, an input field is shown instead of a select.
292
+ * Default is 10.
293
+ */
294
+ this.selectMax = input(10, ...(ngDevMode ? [{ debugName: "selectMax" }] : []));
295
+ this._disabled = false;
296
+ this._required = false;
297
+ this._destroyed = new Subject();
298
+ this._focusSetWhenSwitching = false;
299
+ if (this.ngControl != null) {
300
+ this.ngControl.valueAccessor = this;
301
+ }
302
+ if (!this.formField) {
303
+ throw new Error('DaffSfQuantityFieldComponent needs to be used with the DaffFormFieldComponent.');
304
+ }
305
+ effect(() => {
306
+ if (this.quantity() >= this.selectMax()) {
307
+ this._inputHasBeenShown.set(true);
308
+ }
309
+ });
310
+ effect(() => {
311
+ if (this._inputHasBeenShown() && this.select()?.focused) {
312
+ this._focusSetWhenSwitching = true;
313
+ }
314
+ if (this._focusSetWhenSwitching && this.input()) {
315
+ this.input().focus();
316
+ this._focusSetWhenSwitching = false;
317
+ }
318
+ });
319
+ }
320
+ /**
321
+ * @docs-private
322
+ */
323
+ ngOnInit() {
324
+ this.stateChanges = merge(this._stateChanges.asObservable(), this.ngControl ? this.ngControl.statusChanges : of(undefined)).pipe(map(() => this.state), tap((state) => this.disabled = state.disabled));
325
+ if (this.ngControl?.statusChanges) {
326
+ this.ngControl.statusChanges.pipe(takeUntil(this._destroyed)).subscribe(() => {
327
+ this.emitState();
328
+ });
329
+ }
330
+ if (this.ngControl?.valueChanges) {
331
+ this.ngControl.valueChanges.pipe(takeUntil(this._destroyed)).subscribe((value) => {
332
+ this.quantity.set(value);
333
+ this.cd.markForCheck();
334
+ });
335
+ }
336
+ }
337
+ onChange(quantity) { }
338
+ ;
339
+ onTouched(quantity) { }
340
+ ;
341
+ /**
342
+ * @docs-private
343
+ */
344
+ writeValue(quantity) {
345
+ this.quantity.set(quantity);
346
+ this.cd.markForCheck();
347
+ }
348
+ /**
349
+ * @docs-private
350
+ */
351
+ registerOnChange(fn) {
352
+ this.onChange = fn;
353
+ }
354
+ /**
355
+ * @docs-private
356
+ */
357
+ registerOnTouched(fn) {
358
+ this.onTouched = fn;
359
+ }
360
+ /**
361
+ * @docs-private
362
+ */
363
+ setDisabledState(isDisabled) {
364
+ this.disabled = isDisabled;
365
+ this.cd.markForCheck();
366
+ }
367
+ /**
368
+ * @docs-private
369
+ *
370
+ * Implemented as part of DaffFormFieldControl.
371
+ */
372
+ focus() {
373
+ if (this.select()) {
374
+ this.select().focus();
375
+ }
376
+ if (this.input()) {
377
+ this.input().focus();
378
+ }
379
+ this.emitState();
380
+ }
381
+ /**
382
+ * @docs-private
383
+ *
384
+ * Called when child components gain focus
385
+ */
386
+ _onChildFocus() {
387
+ this.onTouched(this.value);
388
+ this.emitState();
389
+ }
390
+ /**
391
+ * @docs-private
392
+ *
393
+ * Called when child components lose focus
394
+ */
395
+ _onChildBlur() {
396
+ this.onTouched(this.value);
397
+ this.emitState(true);
398
+ }
399
+ /**
400
+ * @docs-private
401
+ *
402
+ * Called when child components change value
403
+ */
404
+ _onChildValueChange(value) {
405
+ this.quantity.set(value);
406
+ this.onChange(value);
407
+ this.cd.markForCheck();
408
+ }
409
+ /**
410
+ * Implemented as part of DaffFormFieldControl.
411
+ */
412
+ get value() {
413
+ return this.quantity();
414
+ }
415
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSfQuantityFieldComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }, { token: i2.DaffFormFieldComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
416
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffSfQuantityFieldComponent, isStandalone: true, selector: "daff-sf-quantity-field", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, selectMax: { classPropertyName: "selectMax", publicName: "selectMax", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: booleanAttribute } }, providers: [
417
+ {
418
+ provide: DaffFormFieldControl,
419
+ useExisting: DaffSfQuantityFieldComponent,
420
+ },
421
+ ], viewQueries: [{ propertyName: "input", first: true, predicate: DaffSfQuantityInputComponent, descendants: true, isSignal: true }, { propertyName: "select", first: true, predicate: DaffSfQuantitySelectComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (_showSelectField()) {\n <daff-sf-quantity-select\n [min]=\"min()\"\n [max]=\"_maxFloor\"\n [quantity]=\"quantity()\"\n [disabled]=\"disabled\"\n [extendable]=\"max() > selectMax()\"\n (focusChange)=\"_onChildFocus()\"\n (blurChange)=\"_onChildBlur()\"\n (valueChange)=\"_onChildValueChange($event)\">\n </daff-sf-quantity-select>\n}\n@if (_showInputField()) {\n <daff-sf-quantity-input\n [min]=\"min()\"\n [max]=\"max()\"\n [quantity]=\"quantity()\"\n (focusChange)=\"_onChildFocus()\"\n (blurChange)=\"_onChildBlur()\"\n (valueChange)=\"_onChildValueChange($event)\">\n </daff-sf-quantity-input>\n}\n", dependencies: [{ kind: "component", type: DaffSfQuantityInputComponent, selector: "daff-sf-quantity-input", inputs: ["quantity", "min", "max"], outputs: ["focusChange", "blurChange", "valueChange", "quantityChange"] }, { kind: "component", type: DaffSfQuantitySelectComponent, selector: "daff-sf-quantity-select", inputs: ["min", "max", "extendable", "quantity", "disabled"], outputs: ["focusChange", "blurChange", "valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
422
+ }
423
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSfQuantityFieldComponent, decorators: [{
424
+ type: Component,
425
+ args: [{ selector: 'daff-sf-quantity-field', providers: [
426
+ {
427
+ provide: DaffFormFieldControl,
428
+ useExisting: DaffSfQuantityFieldComponent,
429
+ },
430
+ ], changeDetection: ChangeDetectionStrategy.OnPush, imports: [
431
+ DaffSfQuantityInputComponent,
432
+ DaffSfQuantitySelectComponent,
433
+ ], template: "@if (_showSelectField()) {\n <daff-sf-quantity-select\n [min]=\"min()\"\n [max]=\"_maxFloor\"\n [quantity]=\"quantity()\"\n [disabled]=\"disabled\"\n [extendable]=\"max() > selectMax()\"\n (focusChange)=\"_onChildFocus()\"\n (blurChange)=\"_onChildBlur()\"\n (valueChange)=\"_onChildValueChange($event)\">\n </daff-sf-quantity-select>\n}\n@if (_showInputField()) {\n <daff-sf-quantity-input\n [min]=\"min()\"\n [max]=\"max()\"\n [quantity]=\"quantity()\"\n (focusChange)=\"_onChildFocus()\"\n (blurChange)=\"_onChildBlur()\"\n (valueChange)=\"_onChildValueChange($event)\">\n </daff-sf-quantity-input>\n}\n" }]
434
+ }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
435
+ type: Optional
436
+ }, {
437
+ type: Self
438
+ }] }, { type: i0.ChangeDetectorRef }, { type: i2.DaffFormFieldComponent, decorators: [{
439
+ type: Optional
440
+ }] }], propDecorators: { input: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DaffSfQuantityInputComponent), { isSignal: true }] }], select: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DaffSfQuantitySelectComponent), { isSignal: true }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], selectMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectMax", required: false }] }], disabled: [{
441
+ type: Input,
442
+ args: [{ transform: booleanAttribute }]
443
+ }], required: [{
444
+ type: Input,
445
+ args: [{ transform: booleanAttribute }]
446
+ }] } });
447
+
448
+ /**
449
+ * @docs-private
450
+ */
451
+ const DAFF_SF_QUANTITY_FIELD_COMPONENTS = [
452
+ DaffSfQuantityFieldComponent,
453
+ ];
454
+
455
+ /**
456
+ * Generated bundle index. Do not edit.
457
+ */
458
+
459
+ export { DAFF_SF_QUANTITY_FIELD_COMPONENTS, DaffSfQuantityFieldComponent };
460
+ //# sourceMappingURL=daffodil-storefront-quantity-field.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daffodil-storefront-quantity-field.mjs","sources":["../../../libs/storefront/quantity-field/src/quantity-input/quantity-input.component.ts","../../../libs/storefront/quantity-field/src/quantity-input/quantity-input.component.html","../../../libs/storefront/quantity-field/src/quantity-select/quantity-select.component.ts","../../../libs/storefront/quantity-field/src/quantity-select/quantity-select.component.html","../../../libs/storefront/quantity-field/src/quantity-field.component.ts","../../../libs/storefront/quantity-field/src/quantity-field.component.html","../../../libs/storefront/quantity-field/src/quantity-field.ts","../../../libs/storefront/quantity-field/src/daffodil-storefront-quantity-field.ts"],"sourcesContent":["import {\n Component,\n output,\n ViewChild,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n OnInit,\n OnDestroy,\n Optional,\n input,\n model,\n} from '@angular/core';\nimport {\n UntypedFormControl,\n NgControl,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n selector: 'daff-sf-quantity-input',\n templateUrl: './quantity-input.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DaffInputComponent,\n ReactiveFormsModule,\n ],\n})\nexport class DaffSfQuantityInputComponent implements OnInit, OnDestroy {\n @ViewChild(DaffInputComponent) input: DaffInputComponent;\n\n /**\n * Event emitted when the quantity input gains focus\n */\n focusChange = output<void>();\n\n /**\n * Event emitted when the quantity input loses focus\n */\n blurChange = output<void>();\n\n /**\n * Event emitted when the quantity input's value changes\n */\n valueChange = output<number>();\n\n quantity = model<number>();\n\n /**\n * The minimum number for the quantity input field\n */\n min = input(1);\n\n /**\n * The maximum number for the quantity input field\n */\n max = input(10);\n\n /**\n * @docs-private\n */\n get focused() {\n return this.input.focused;\n }\n\n /**\n * A new control for the nested native input.\n * We don't bind the native input directly to the inherited form control\n * to avoid triggering updates on the input event.\n * Instead, we listen for the change event and manually patch form control values.\n */\n _inputControl = new UntypedFormControl();\n\n _destroyed = new Subject();\n\n get value(): number {\n return this.ngControl?.control.value || this.quantity();\n }\n set value(value: number) {\n if (value === 0 || Number.isNaN(value)) {\n value = this.value;\n }\n const val = Math.max(Math.min(Math.round(value), this.max()), this.min());\n this.ngControl?.control.patchValue(val);\n this._inputControl.patchValue(val);\n this.quantity.set(val);\n this.changeDetectorRef.markForCheck();\n }\n\n constructor(\n @Optional() public ngControl: NgControl,\n private changeDetectorRef: ChangeDetectorRef,\n ) {}\n\n /**\n * @docs-private\n */\n ngOnInit() {\n this._inputControl.patchValue(this.ngControl?.control.value ?? this.quantity());\n this.setInputDisabled();\n this.ngControl?.statusChanges.pipe(\n takeUntil(this._destroyed),\n ).subscribe((s) => {\n this.setInputDisabled();\n });\n }\n\n ngOnDestroy() {\n this._destroyed.next(true);\n }\n\n focus() {\n this.input.focus();\n }\n\n /**\n * Callback function fired when the value changes.\n * Used to pass the value back up to the ngControl.\n */\n onValueChange(event: Event) {\n if(event.target instanceof HTMLInputElement) {\n this.value = event.target.valueAsNumber;\n }\n\n this.valueChange.emit(this.value);\n }\n\n private setInputDisabled() {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n this.ngControl?.disabled\n ? this._inputControl.disable()\n : this._inputControl.enable();\n }\n}\n","<input daff-input\n type=\"number\"\n [attr.max]=\"max()\"\n [attr.min]=\"min()\"\n [attr.step]=\"1\"\n (change)=\"onValueChange($event)\"\n (focus)=\"focusChange.emit()\" \n (blur)=\"blurChange.emit()\"\n [formControl]=\"_inputControl\"\n>\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n ChangeDetectionStrategy,\n ViewChild,\n input,\n output,\n effect,\n computed,\n} from '@angular/core';\nimport {\n ReactiveFormsModule,\n UntypedFormControl,\n} from '@angular/forms';\n\nimport { DaffNativeSelectComponent } from '@daffodil/design/native-select';\n\n/**\n * @docs-private\n *\n * Create an array of numbers from min to max, not including max.\n */\nexport const makeValueArray = (min: number, max: number, increment: number) =>\n Array(max - min).fill(0).map((x, i) => (i * increment) + min);\n\n@Component({\n selector: 'daff-sf-quantity-select',\n templateUrl: './quantity-select.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DaffNativeSelectComponent,\n ReactiveFormsModule,\n ],\n})\nexport class DaffSfQuantitySelectComponent {\n @ViewChild(DaffNativeSelectComponent) select: DaffNativeSelectComponent;\n\n /**\n * A new control for the nested native select.\n * We don't bind the native select directly to the inherited form control\n * to avoid triggering updates on the input event.\n * Instead, we listen for the change event and manually patch form control values.\n */\n _selectControl = new UntypedFormControl();\n\n /**\n * The minimum number selectable. Defaults to 1.\n */\n min = input(1);\n\n /**\n * The maximum number selectable. Defaults to 10.\n */\n max = input(10);\n\n /**\n * Property used to determine whether or not the select is\n * used in a situation where the `max` isn't a true max.\n */\n extendable = input(true);\n\n /**\n * Event emitted when the quantity select gains focus\n */\n focusChange = output<void>();\n\n /**\n * Event emitted when the quantity select loses focus\n */\n blurChange = output<void>();\n\n /**\n * Event emitted when the quantiy select's value changes\n */\n valueChange = output<number>();\n\n quantity = input();\n\n disabled = input();\n\n constructor() {\n effect(() => {\n const value = this.quantity();\n this._selectControl.patchValue(value);\n });\n\n effect(() => {\n if(this.disabled()) {\n this._selectControl.disable();\n } else {\n this._selectControl.enable();\n }\n });\n }\n\n /**\n * An input for easily making options for the `select`.\n */\n valueArray = computed(() => makeValueArray(this.min(), this.max(), 1));\n\n get focused() {\n return this.select?.focused;\n }\n\n focus() {\n this.select?.focus();\n }\n\n /**\n * @docs-private\n *\n * Callback function fired when the value changes.\n * Used to pass the value back up to the ngControl.\n */\n onValueChange(event: Event) {\n const val = coerceNumberProperty((<HTMLSelectElement>event.target).value);\n\n this.valueChange.emit(val);\n }\n}\n","<select daff-native-select\n [formControl]=\"_selectControl\"\n (focus)=\"focusChange.emit()\" \n (blur)=\"blurChange.emit()\"\n (change)=\"onValueChange($event)\"\n>\n @for (item of valueArray(); track item) {\n <option [value]=\"item\">{{ item }}</option>\n }\n @if (extendable()) {\n <option [value]=\"max()\">{{ max() }}+</option>\n } @else {\n <option [value]=\"max()\">{{ max() }}</option>\n }\n</select>\n","import {\n Component,\n Input,\n ChangeDetectionStrategy,\n Optional,\n Self,\n ChangeDetectorRef,\n booleanAttribute,\n OnInit,\n input,\n signal,\n computed,\n effect,\n viewChild,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NgControl,\n Validators,\n} from '@angular/forms';\nimport {\n Subject,\n merge,\n of,\n map,\n tap,\n} from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport {\n DaffFormFieldComponent,\n DaffFormFieldControl,\n} from '@daffodil/design/form-field';\n\nimport { DaffSfQuantityInputComponent } from './quantity-input/quantity-input.component';\nimport { DaffSfQuantitySelectComponent } from './quantity-select/quantity-select.component';\n\n@Component({\n selector: 'daff-sf-quantity-field',\n templateUrl: './quantity-field.component.html',\n providers: [\n {\n provide: DaffFormFieldControl,\n useExisting: DaffSfQuantityFieldComponent,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DaffSfQuantityInputComponent,\n DaffSfQuantitySelectComponent,\n ],\n})\nexport class DaffSfQuantityFieldComponent extends DaffFormFieldControl<number> implements ControlValueAccessor, DaffFormFieldControl<number>, OnInit {\n\n /**\n * @docs-private\n */\n quantity = signal<number>(1);\n\n /**\n * @docs-private\n */\n _inputHasBeenShown = signal(false);\n\n /**\n * @docs-private\n */\n _showInputField = computed(() => {\n this.quantity();\n\n return this._inputHasBeenShown() || this.quantity() >= this.selectMax();\n });\n\n /**\n * @docs-private\n */\n _showSelectField = computed(() => !this._showInputField());\n\n /** @docs-private */\n get controlType() {\n return this._showInputField() ? 'native-input' : 'native-select';\n }\n\n /**\n * @docs-private\n */\n input = viewChild(DaffSfQuantityInputComponent);\n\n /**\n * @docs-private\n */\n select = viewChild(DaffSfQuantitySelectComponent);\n\n /**\n * The minimum valid value of the quantity field.\n * Must be greater than or equal to 1.\n */\n min = input(1);\n\n /**\n * The maximum valid value of the quantity field.\n * Must be greater than `min`.\n */\n max = input(500);\n\n /**\n * The maximum number allowed before the field switches from a dropdown to an input.\n * When the value reaches this number, an input field is shown instead of a select.\n * Default is 10.\n */\n selectMax = input(10);\n\n /**\n * @docs-private\n *\n * Implemented as part of DaffFormFieldControl.\n */\n get focused() {\n return this.select()?.focused || this.input()?.focused;\n };\n\n private _disabled = false;\n\n /**\n * @docs-private\n *\n * Implemented as part of DaffFormFieldControl.\n */\n @Input({ transform: booleanAttribute })\n get disabled(): boolean {\n return this.ngControl?.disabled ?? this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = value;\n }\n\n private _required = false;\n\n /**\n * @docs-private\n *\n * Implemented as part of DaffFormFieldControl.\n */\n @Input({ transform: booleanAttribute })\n get required(): boolean {\n return this.ngControl?.control?.hasValidator(Validators.required) ?? this._required;\n }\n set required(value: boolean) {\n this._required = value;\n }\n\n _destroyed = new Subject<boolean>();\n\n /**\n * @docs-private\n *\n * Returns the lesser of max and selectMax.\n */\n get _maxFloor(): number {\n return Math.min(this.max(), this.selectMax());\n }\n\n private _focusSetWhenSwitching = false;\n\n constructor(\n @Optional() @Self() public ngControl: NgControl,\n private cd: ChangeDetectorRef,\n @Optional() private formField: DaffFormFieldComponent,\n ) {\n super(ngControl);\n\n if (this.ngControl != null) {\n this.ngControl.valueAccessor = this;\n }\n\n if(!this.formField) {\n throw new Error('DaffSfQuantityFieldComponent needs to be used with the DaffFormFieldComponent.');\n }\n\n effect(() => {\n if(this.quantity() >= this.selectMax()){\n this._inputHasBeenShown.set(true);\n }\n });\n\n effect(() => {\n if(this._inputHasBeenShown() && this.select()?.focused) {\n this._focusSetWhenSwitching = true;\n }\n\n if(this._focusSetWhenSwitching && this.input()) {\n this.input().focus();\n this._focusSetWhenSwitching = false;\n }\n });\n }\n\n /**\n * @docs-private\n */\n ngOnInit() {\n this.stateChanges = merge(\n this._stateChanges.asObservable(),\n this.ngControl ? this.ngControl.statusChanges : of(undefined),\n ).pipe(\n map(() => this.state),\n tap((state) => this.disabled = state.disabled),\n );\n\n if (this.ngControl?.statusChanges) {\n this.ngControl.statusChanges.pipe(\n takeUntil(this._destroyed),\n ).subscribe(() => {\n this.emitState();\n });\n }\n\n if (this.ngControl?.valueChanges) {\n this.ngControl.valueChanges.pipe(\n takeUntil(this._destroyed),\n ).subscribe((value) => {\n this.quantity.set(value);\n this.cd.markForCheck();\n });\n }\n }\n\n private onChange(quantity: number): void {};\n private onTouched(quantity: number): void {};\n\n /**\n * @docs-private\n */\n writeValue(quantity: number): void {\n this.quantity.set(quantity);\n this.cd.markForCheck();\n }\n\n /**\n * @docs-private\n */\n registerOnChange(fn: (quantity: number) => void): void {\n this.onChange = fn;\n }\n\n /**\n * @docs-private\n */\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /**\n * @docs-private\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.cd.markForCheck();\n }\n\n /**\n * @docs-private\n *\n * Implemented as part of DaffFormFieldControl.\n */\n focus() {\n if (this.select()) {\n this.select().focus();\n }\n if (this.input()) {\n this.input().focus();\n }\n this.emitState();\n }\n\n /**\n * @docs-private\n *\n * Called when child components gain focus\n */\n _onChildFocus() {\n this.onTouched(this.value);\n this.emitState();\n }\n\n /**\n * @docs-private\n *\n * Called when child components lose focus\n */\n _onChildBlur() {\n this.onTouched(this.value);\n this.emitState(true);\n }\n\n /**\n * @docs-private\n *\n * Called when child components change value\n */\n _onChildValueChange(value: number) {\n this.quantity.set(value);\n this.onChange(value);\n\n this.cd.markForCheck();\n }\n\n /**\n * Implemented as part of DaffFormFieldControl.\n */\n get value(): number {\n return this.quantity();\n }\n}\n","@if (_showSelectField()) {\n <daff-sf-quantity-select\n [min]=\"min()\"\n [max]=\"_maxFloor\"\n [quantity]=\"quantity()\"\n [disabled]=\"disabled\"\n [extendable]=\"max() > selectMax()\"\n (focusChange)=\"_onChildFocus()\"\n (blurChange)=\"_onChildBlur()\"\n (valueChange)=\"_onChildValueChange($event)\">\n </daff-sf-quantity-select>\n}\n@if (_showInputField()) {\n <daff-sf-quantity-input\n [min]=\"min()\"\n [max]=\"max()\"\n [quantity]=\"quantity()\"\n (focusChange)=\"_onChildFocus()\"\n (blurChange)=\"_onChildBlur()\"\n (valueChange)=\"_onChildValueChange($event)\">\n </daff-sf-quantity-input>\n}\n","import { DaffSfQuantityFieldComponent } from './quantity-field.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_SF_QUANTITY_FIELD_COMPONENTS = <const> [\n DaffSfQuantityFieldComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MA+Ba,4BAA4B,CAAA;AA8BvC;;AAEG;AACH,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO;IAC3B;AAYA,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;IACzD;IACA,IAAI,KAAK,CAAC,KAAa,EAAA;QACrB,IAAI,KAAK,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;AACtC,YAAA,KAAK,GAAG,IAAI,CAAC,KAAK;QACpB;AACA,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;QACzE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;AACvC,QAAA,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC;AAClC,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;AACtB,QAAA,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE;IACvC;IAEA,WAAA,CACqB,SAAoB,EAC/B,iBAAoC,EAAA;QADzB,IAAA,CAAA,SAAS,GAAT,SAAS;QACpB,IAAA,CAAA,iBAAiB,GAAjB,iBAAiB;AA5D3B;;AAEG;QACH,IAAA,CAAA,WAAW,GAAG,MAAM,EAAQ;AAE5B;;AA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A,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA;sBAqC/C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAerC,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;;AE7IxC;;AAEG;AACI,MAAM,iCAAiC,GAAW;IACvD,4BAA4B;;;ACN9B;;AAEG;;;;"}
@@ -0,0 +1,50 @@
1
+ import * as i0 from '@angular/core';
2
+ import { computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { toSignal } from '@angular/core/rxjs-interop';
4
+ import { FaIconComponent } from '@fortawesome/angular-fontawesome';
5
+ import { faMoon, faSun } from '@fortawesome/free-solid-svg-icons';
6
+ import * as i1 from '@daffodil/design';
7
+ import { DaffTheme } from '@daffodil/design';
8
+ import { DaffIconButtonComponent } from '@daffodil/design/button';
9
+
10
+ /** @docs-private */
11
+ const TOGGLE_TO_LIGHT_LABEL = 'Switch to light mode';
12
+ /** @docs-private */
13
+ const TOGGLE_TO_DARK_LABEL = 'Switch to dark mode';
14
+ /**
15
+ * DaffSfThemeToggleComponent renders a button that toggles the active
16
+ * theme between light and dark.
17
+ */
18
+ class DaffSfThemeToggleComponent {
19
+ constructor(themeService) {
20
+ this.themeService = themeService;
21
+ /** @docs-private */
22
+ this.theme = toSignal(this.themeService.getTheme());
23
+ /** @docs-private */
24
+ this.ariaLabel = computed(() => this.theme() === DaffTheme.Light ? TOGGLE_TO_DARK_LABEL : TOGGLE_TO_LIGHT_LABEL, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
25
+ /** @docs-private */
26
+ this.icon = computed(() => this.theme() === DaffTheme.Light ? faMoon : faSun, ...(ngDevMode ? [{ debugName: "icon" }] : []));
27
+ }
28
+ /** @docs-private */
29
+ toggleTheme() {
30
+ this.themeService.switchTheme();
31
+ }
32
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSfThemeToggleComponent, deps: [{ token: i1.DaffThemingService }], target: i0.ɵɵFactoryTarget.Component }); }
33
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffSfThemeToggleComponent, isStandalone: true, selector: "daff-sf-theme-toggle", host: { attributes: { "aria-live": "polite" } }, ngImport: i0, template: "<button type=\"button\" daff-icon-button color=\"theme-contrast\" (click)=\"toggleTheme()\" [attr.aria-label]=\"ariaLabel()\">\n <fa-icon [icon]=\"icon()\"></fa-icon>\n</button>\n", dependencies: [{ kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }, { kind: "component", type: DaffIconButtonComponent, selector: "button[daff-icon-button],a[daff-icon-button]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
34
+ }
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSfThemeToggleComponent, decorators: [{
36
+ type: Component,
37
+ args: [{ selector: 'daff-sf-theme-toggle', changeDetection: ChangeDetectionStrategy.OnPush, host: {
38
+ 'aria-live': 'polite',
39
+ }, imports: [
40
+ FaIconComponent,
41
+ DaffIconButtonComponent,
42
+ ], template: "<button type=\"button\" daff-icon-button color=\"theme-contrast\" (click)=\"toggleTheme()\" [attr.aria-label]=\"ariaLabel()\">\n <fa-icon [icon]=\"icon()\"></fa-icon>\n</button>\n" }]
43
+ }], ctorParameters: () => [{ type: i1.DaffThemingService }] });
44
+
45
+ /**
46
+ * Generated bundle index. Do not edit.
47
+ */
48
+
49
+ export { DaffSfThemeToggleComponent };
50
+ //# sourceMappingURL=daffodil-storefront-theme-toggle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daffodil-storefront-theme-toggle.mjs","sources":["../../../libs/storefront/theme-toggle/src/theme-toggle.component.ts","../../../libs/storefront/theme-toggle/src/theme-toggle.component.html","../../../libs/storefront/theme-toggle/src/daffodil-storefront-theme-toggle.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faMoon,\n faSun,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport {\n DaffTheme,\n DaffThemingService,\n} from '@daffodil/design';\nimport { DaffIconButtonComponent } from '@daffodil/design/button';\n\n/** @docs-private */\nexport const TOGGLE_TO_LIGHT_LABEL = 'Switch to light mode';\n/** @docs-private */\nexport const TOGGLE_TO_DARK_LABEL = 'Switch to dark mode';\n\n/**\n * DaffSfThemeToggleComponent renders a button that toggles the active\n * theme between light and dark.\n */\n@Component({\n selector: 'daff-sf-theme-toggle',\n templateUrl: './theme-toggle.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'aria-live': 'polite',\n },\n imports: [\n FaIconComponent,\n DaffIconButtonComponent,\n ],\n})\nexport class DaffSfThemeToggleComponent {\n /** @docs-private */\n theme = toSignal(this.themeService.getTheme());\n\n /** @docs-private */\n ariaLabel = computed(() => this.theme() === DaffTheme.Light ? TOGGLE_TO_DARK_LABEL : TOGGLE_TO_LIGHT_LABEL);\n\n /** @docs-private */\n icon = computed(() => this.theme() === DaffTheme.Light ? faMoon : faSun);\n\n constructor(private themeService: DaffThemingService) { }\n\n /** @docs-private */\n toggleTheme() {\n this.themeService.switchTheme();\n }\n}\n","<button type=\"button\" daff-icon-button color=\"theme-contrast\" (click)=\"toggleTheme()\" [attr.aria-label]=\"ariaLabel()\">\n <fa-icon [icon]=\"icon()\"></fa-icon>\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAkBA;AACO,MAAM,qBAAqB,GAAG,sBAAsB;AAC3D;AACO,MAAM,oBAAoB,GAAG,qBAAqB;AAEzD;;;AAGG;MAaU,0BAA0B,CAAA;AAUrC,IAAA,WAAA,CAAoB,YAAgC,EAAA;QAAhC,IAAA,CAAA,YAAY,GAAZ,YAAY;;QARhC,IAAA,CAAA,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;;QAG9C,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,KAAK,SAAS,CAAC,KAAK,GAAG,oBAAoB,GAAG,qBAAqB,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC;;QAG3G,IAAA,CAAA,IAAI,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,KAAK,SAAS,CAAC,KAAK,GAAG,MAAM,GAAG,KAAK,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC;IAEhB;;IAGxD,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE;IACjC;+GAfW,0BAA0B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECvCvC,sLAGA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDgCI,eAAe,ybACf,uBAAuB,EAAA,QAAA,EAAA,8CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAGd,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAZtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,sBAAsB,EAAA,eAAA,EAEf,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,WAAW,EAAE,QAAQ;qBACtB,EAAA,OAAA,EACQ;wBACP,eAAe;wBACf,uBAAuB;AACxB,qBAAA,EAAA,QAAA,EAAA,sLAAA,EAAA;;;AErCH;;AAEG;;;;"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ //# sourceMappingURL=daffodil-storefront.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daffodil-storefront.mjs","sources":["../../../libs/storefront/src/daffodil-storefront.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;AAEG"}
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { };