@daffodil/design 0.94.1 → 0.95.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/README.md +1 -2
  2. package/accordion/src/accordion-theme.scss +4 -4
  3. package/article/README.md +4 -27
  4. package/article/src/article-theme.scss +14 -14
  5. package/badge/src/badge-theme.scss +0 -6
  6. package/button/README.md +0 -4
  7. package/button/src/button/basic/button-theme.scss +17 -42
  8. package/button/src/button/button-base.scss +12 -3
  9. package/button/src/button/flat/flat-theme.scss +14 -12
  10. package/button/src/button/icon/icon-theme.scss +19 -40
  11. package/button/src/button/stroked/stroked-theme.scss +22 -36
  12. package/card/src/card/stroked/stroked-theme.scss +1 -1
  13. package/card/src/card-base.scss +0 -1
  14. package/fesm2022/daffodil-design-accordion.mjs +285 -188
  15. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  16. package/fesm2022/daffodil-design-article.mjs +578 -340
  17. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  18. package/fesm2022/daffodil-design-badge.mjs +166 -84
  19. package/fesm2022/daffodil-design-badge.mjs.map +1 -1
  20. package/fesm2022/daffodil-design-beacon.mjs +109 -47
  21. package/fesm2022/daffodil-design-beacon.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-breadcrumb.mjs +384 -277
  23. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-button.mjs +541 -408
  25. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-callout.mjs +349 -224
  27. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-card.mjs +496 -327
  29. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-checkbox.mjs +373 -313
  31. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-container.mjs +103 -60
  33. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  34. package/fesm2022/daffodil-design-form-field.mjs +441 -352
  35. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-form.mjs +155 -57
  37. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-hero.mjs +349 -234
  39. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-image-lite.mjs +60 -0
  41. package/fesm2022/daffodil-design-image-lite.mjs.map +1 -0
  42. package/fesm2022/daffodil-design-image.mjs +245 -107
  43. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-input.mjs +217 -164
  45. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-list.mjs +308 -170
  47. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-media-gallery.mjs +351 -278
  49. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-menu.mjs +525 -417
  51. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  52. package/fesm2022/daffodil-design-modal.mjs +680 -450
  53. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  54. package/fesm2022/daffodil-design-native-select.mjs +175 -166
  55. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  56. package/fesm2022/daffodil-design-navbar.mjs +145 -68
  57. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  58. package/fesm2022/daffodil-design-notification.mjs +376 -226
  59. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-paginator.mjs +296 -192
  61. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-progress-bar.mjs +243 -157
  63. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  64. package/fesm2022/daffodil-design-radio.mjs +382 -300
  65. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  66. package/fesm2022/daffodil-design-select.mjs +424 -364
  67. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  68. package/fesm2022/daffodil-design-sidebar.mjs +874 -887
  69. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  70. package/fesm2022/daffodil-design-spinner.mjs +156 -99
  71. package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
  72. package/fesm2022/daffodil-design-switch.mjs +176 -106
  73. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  74. package/fesm2022/daffodil-design-tabs.mjs +685 -427
  75. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  76. package/fesm2022/daffodil-design-tag.mjs +251 -133
  77. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  78. package/fesm2022/daffodil-design-testing.mjs +4 -16
  79. package/fesm2022/daffodil-design-testing.mjs.map +1 -1
  80. package/fesm2022/daffodil-design-text-snippet.mjs +140 -54
  81. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  82. package/fesm2022/daffodil-design-textarea.mjs +170 -150
  83. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  84. package/fesm2022/daffodil-design-toast.mjs +658 -481
  85. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  86. package/fesm2022/daffodil-design-tree.mjs +456 -469
  87. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  88. package/fesm2022/daffodil-design-youtube-player.mjs +168 -115
  89. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  90. package/fesm2022/daffodil-design.mjs +1628 -1650
  91. package/fesm2022/daffodil-design.mjs.map +1 -1
  92. package/form-field/README.md +0 -4
  93. package/form-field/src/form-field-theme.scss +12 -4
  94. package/image/README.md +4 -0
  95. package/image-lite/README.md +58 -0
  96. package/image-lite/src/image-theme.scss +18 -0
  97. package/list/src/list-base.scss +3 -4
  98. package/list/src/list-theme.scss +6 -5
  99. package/media-gallery/README.md +1 -1
  100. package/media-gallery/src/media-gallery-theme.scss +3 -3
  101. package/menu/src/menu-theme.scss +6 -2
  102. package/notification/src/notification-theme.scss +10 -10
  103. package/package.json +1 -1
  104. package/scss/global.scss +17 -11
  105. package/scss/theme.scss +2 -18
  106. package/scss/theming/_get-palette.scss +0 -3
  107. package/scss/theming/_index.scss +0 -1
  108. package/scss/theming/_light-dark.scss +2 -2
  109. package/scss/theming/_theme-css-variables.scss +1 -1
  110. package/scss/theming/create-theme/_create-theme.scss +2 -2
  111. package/scss/theming/get-font-colors/_get-font-colors.scss +7 -25
  112. package/scss/theming/get-font-colors/_get-font-colors.spec.scss +0 -12
  113. package/scss/typography/_classes.scss +0 -6
  114. package/scss/typography/_index.scss +0 -1
  115. package/scss/typography/mixins/_sizes.scss +0 -1
  116. package/scss/typography/utilities/_variables.scss +3 -0
  117. package/select/src/select-theme.scss +10 -14
  118. package/switch/src/switch-theme.scss +2 -2
  119. package/tabs/src/tabs-theme.scss +4 -4
  120. package/types/daffodil-design-accordion.d.ts +92 -67
  121. package/types/daffodil-design-article.d.ts +49 -56
  122. package/types/daffodil-design-badge.d.ts +56 -33
  123. package/types/daffodil-design-beacon.d.ts +35 -14
  124. package/types/daffodil-design-breadcrumb.d.ts +89 -85
  125. package/types/daffodil-design-button.d.ts +128 -146
  126. package/types/daffodil-design-callout.d.ts +55 -39
  127. package/types/daffodil-design-card.d.ts +66 -56
  128. package/types/daffodil-design-checkbox.d.ts +211 -167
  129. package/types/daffodil-design-container.d.ts +17 -16
  130. package/types/daffodil-design-form-field.d.ts +273 -240
  131. package/types/daffodil-design-form.d.ts +21 -21
  132. package/types/daffodil-design-hero.d.ts +55 -39
  133. package/types/daffodil-design-image-lite.d.ts +17 -0
  134. package/types/daffodil-design-image.d.ts +89 -55
  135. package/types/daffodil-design-input.d.ts +86 -72
  136. package/types/daffodil-design-list.d.ts +49 -43
  137. package/types/daffodil-design-media-gallery.d.ts +176 -148
  138. package/types/daffodil-design-menu.d.ts +177 -169
  139. package/types/daffodil-design-modal.d.ts +205 -205
  140. package/types/daffodil-design-native-select.d.ts +94 -84
  141. package/types/daffodil-design-navbar.d.ts +34 -24
  142. package/types/daffodil-design-notification.d.ts +82 -67
  143. package/types/daffodil-design-paginator.d.ts +140 -118
  144. package/types/daffodil-design-progress-bar.d.ts +92 -74
  145. package/types/daffodil-design-radio.d.ts +183 -144
  146. package/types/daffodil-design-select.d.ts +207 -178
  147. package/types/daffodil-design-sidebar.d.ts +270 -253
  148. package/types/daffodil-design-spinner.d.ts +49 -36
  149. package/types/daffodil-design-switch.d.ts +77 -46
  150. package/types/daffodil-design-tabs.d.ts +248 -198
  151. package/types/daffodil-design-tag.d.ts +91 -56
  152. package/types/daffodil-design-testing.d.ts +1 -3
  153. package/types/daffodil-design-text-snippet.d.ts +48 -37
  154. package/types/daffodil-design-textarea.d.ts +88 -79
  155. package/types/daffodil-design-toast.d.ts +175 -183
  156. package/types/daffodil-design-tree.d.ts +186 -169
  157. package/types/daffodil-design-youtube-player.d.ts +56 -52
  158. package/types/daffodil-design.d.ts +614 -695
  159. package/button/src/button/raised/raised-theme.scss +0 -92
  160. package/button/src/button/underline/underline-theme.scss +0 -141
  161. package/fesm2022/daffodil-design-link-set.mjs +0 -160
  162. package/fesm2022/daffodil-design-link-set.mjs.map +0 -1
  163. package/fesm2022/daffodil-design-quantity-field.mjs +0 -364
  164. package/fesm2022/daffodil-design-quantity-field.mjs.map +0 -1
  165. package/link-set/README.md +0 -86
  166. package/quantity-field/README.md +0 -63
  167. package/scss/theming/_configure-theme.scss +0 -120
  168. package/scss/typography/mixins/_font-weight.scss +0 -14
  169. package/types/daffodil-design-link-set.d.ts +0 -72
  170. package/types/daffodil-design-quantity-field.d.ts +0 -171
@@ -1,364 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Input, ViewChild, ChangeDetectionStrategy, Component, Optional, Self, NgModule } from '@angular/core';
4
- import { coerceNumberProperty } from '@angular/cdk/coercion';
5
- import * as i1 from '@angular/forms';
6
- import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
7
- import { DaffFormFieldControl } from '@daffodil/design/form-field';
8
- import { Subject } from 'rxjs';
9
- import { takeUntil } from 'rxjs/operators';
10
- import { DaffInputComponent } from '@daffodil/design/input';
11
- import { DaffNativeSelectComponent } from '@daffodil/design/native-select';
12
-
13
- class DaffQuantityInputComponent {
14
- get focused() {
15
- return this.input?.focused;
16
- }
17
- get value() {
18
- return this.ngControl.control.value;
19
- }
20
- set value(value) {
21
- const val = Math.min(Math.round(coerceNumberProperty(value)), this.max);
22
- this.ngControl.control.patchValue(val);
23
- this._inputControl.patchValue(val);
24
- this.changeDetectorRef.markForCheck();
25
- }
26
- get disabled() {
27
- return this.ngControl.control.disabled;
28
- }
29
- constructor(ngControl, changeDetectorRef) {
30
- this.ngControl = ngControl;
31
- this.changeDetectorRef = changeDetectorRef;
32
- /**
33
- * @docs
34
- * The minimum number for the quantity input field
35
- */
36
- this.min = 1;
37
- /**
38
- * @docs
39
- * The maximum number for the quantity input field
40
- */
41
- this.max = 10;
42
- /**
43
- * A new control for the nested native input.
44
- * We don't bind the native input directly to the inherited form control
45
- * to avoid triggering updates on the input event.
46
- * Instead, we listen for the change event and manually patch form control values.
47
- */
48
- this._inputControl = new UntypedFormControl();
49
- this._destroyed = new Subject();
50
- }
51
- /**
52
- * @docs-private
53
- */
54
- ngOnInit() {
55
- this._inputControl.patchValue(this.ngControl.control.value);
56
- this.setInputDisabled();
57
- this.ngControl.statusChanges.pipe(takeUntil(this._destroyed)).subscribe(() => {
58
- this.setInputDisabled();
59
- });
60
- }
61
- ngOnDestroy() {
62
- this._destroyed.next(true);
63
- }
64
- focus() {
65
- this.input.focus();
66
- }
67
- onFocus() {
68
- this.ngControl.control.markAsTouched();
69
- }
70
- onBlur() {
71
- if (this.value === null || this.value === undefined) {
72
- this.value = 1;
73
- this.changeDetectorRef.markForCheck();
74
- }
75
- }
76
- /**
77
- * Callback function fired when the value changes.
78
- * Used to pass the value back up to the ngControl.
79
- */
80
- onValueChange(e) {
81
- this.value = e.target.value;
82
- }
83
- setInputDisabled() {
84
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
85
- this.ngControl.disabled
86
- ? this._inputControl.disable()
87
- : this._inputControl.enable();
88
- }
89
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQuantityInputComponent, deps: [{ token: i1.NgControl }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
90
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: DaffQuantityInputComponent, isStandalone: true, selector: "daff-quantity-input", inputs: { min: "min", max: "max" }, 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 (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (change)=\"onValueChange($event)\"\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 }); }
91
- }
92
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQuantityInputComponent, decorators: [{
93
- type: Component,
94
- args: [{ selector: 'daff-quantity-input', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
95
- DaffInputComponent,
96
- ReactiveFormsModule,
97
- ], template: "<input daff-input\n type=\"number\"\n [attr.max]=\"max\"\n [attr.min]=\"min\"\n [attr.step]=\"1\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (change)=\"onValueChange($event)\"\n [formControl]=\"_inputControl\"\n>\n" }]
98
- }], ctorParameters: () => [{ type: i1.NgControl }, { type: i0.ChangeDetectorRef }], propDecorators: { input: [{
99
- type: ViewChild,
100
- args: [DaffInputComponent]
101
- }], min: [{
102
- type: Input
103
- }], max: [{
104
- type: Input
105
- }] } });
106
-
107
- /**
108
- * Create an array of numbers from min to max, not including max.
109
- */
110
- const makeValueArray = (min, max, increment) => Array(max - min).fill(0).map((x, i) => (i * increment) + min);
111
- class DaffQuantitySelectComponent {
112
- get value() {
113
- return this._value;
114
- }
115
- set value(value) {
116
- this._value = value;
117
- this.ngControl.control.patchValue(this._value);
118
- this.changeDetectorRef.markForCheck();
119
- }
120
- constructor(ngControl, changeDetectorRef) {
121
- this.ngControl = ngControl;
122
- this.changeDetectorRef = changeDetectorRef;
123
- /**
124
- * @docs
125
- * The minimum number selectable.
126
- */
127
- this.min = 1;
128
- /**
129
- * @docs
130
- * The maximum number selectable;
131
- */
132
- this.max = 10;
133
- /**
134
- * @docs
135
- * Property used to determine whether or not the DaffQuantitySelectComponent is
136
- * used in a situation whether the `max` isn't a true max.
137
- */
138
- this.extendable = true;
139
- /**
140
- * The amount to increment between "min" and "max".
141
- */
142
- this.increment = 1;
143
- this._value = 1;
144
- }
145
- /**
146
- * Callback function fired when the value changes.
147
- * Used to pass the value back up to the ngControl.
148
- */
149
- onValueChange(e) {
150
- this.value = e.target.value;
151
- }
152
- get focused() {
153
- return this.select.focused;
154
- }
155
- focus() {
156
- this.select.focus();
157
- }
158
- onFocus() {
159
- this.ngControl.control.markAsTouched();
160
- }
161
- /**
162
- * A helper function for easily making options for the `select`.
163
- */
164
- get valueArray() {
165
- return makeValueArray(this.min, this.max, this.increment);
166
- }
167
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQuantitySelectComponent, deps: [{ token: i1.NgControl }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
168
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffQuantitySelectComponent, isStandalone: true, selector: "daff-quantity-select", inputs: { min: "min", max: "max", extendable: "extendable" }, viewQueries: [{ propertyName: "select", first: true, predicate: DaffNativeSelectComponent, descendants: true }], ngImport: i0, template: "<select daff-native-select\n [formControl]=\"ngControl.control\"\n (focus)=\"onFocus()\"\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 }); }
169
- }
170
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQuantitySelectComponent, decorators: [{
171
- type: Component,
172
- args: [{ selector: 'daff-quantity-select', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
173
- DaffNativeSelectComponent,
174
- ReactiveFormsModule,
175
- ], template: "<select daff-native-select\n [formControl]=\"ngControl.control\"\n (focus)=\"onFocus()\"\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" }]
176
- }], ctorParameters: () => [{ type: i1.NgControl }, { type: i0.ChangeDetectorRef }], propDecorators: { select: [{
177
- type: ViewChild,
178
- args: [DaffNativeSelectComponent]
179
- }], min: [{
180
- type: Input
181
- }], max: [{
182
- type: Input
183
- }], extendable: [{
184
- type: Input
185
- }] } });
186
-
187
- /**
188
- * @deprecated in favor of DaffSfQuantityFieldComponent. Deprecated in version 0.92.0. Will be removed in version 0.95.0.
189
- */
190
- class DaffQuantityFieldComponent extends DaffFormFieldControl {
191
- get focused() {
192
- return !!(this.input?.focused || this.select?.focused);
193
- }
194
- get quantity() {
195
- return this._quantity;
196
- }
197
- set quantity(value) {
198
- this._quantity = coerceNumberProperty(value, 1);
199
- }
200
- /**
201
- * Returns the lesser of max and selectMax.
202
- */
203
- get _maxFloor() {
204
- return Math.min(this.max, this.selectMax);
205
- }
206
- get controlType() {
207
- // TODO: use enum
208
- return this.showInputField
209
- ? 'native-input'
210
- : 'native-select';
211
- }
212
- get showInputField() {
213
- const ret = this._inputHasBeenShown || (this.ngControl
214
- ? this.ngControl.value >= this.selectMax
215
- : this.quantity >= this.selectMax);
216
- if (ret) {
217
- this._inputHasBeenShown = true;
218
- }
219
- return ret;
220
- }
221
- get showSelectField() {
222
- return !this.showInputField;
223
- }
224
- constructor(ngControl, cd) {
225
- super(ngControl);
226
- this.ngControl = ngControl;
227
- this.cd = cd;
228
- /**
229
- * @docs
230
- * The minimum valid value of the quantity field.
231
- * Must be greater than or equal to 1.
232
- */
233
- this.min = 1;
234
- /**
235
- * @docs
236
- * The maximum valid value of the quantity field.
237
- * Must be greater than min.
238
- */
239
- this.max = 500;
240
- /**
241
- * @docs
242
- * The range of numbers acceptable in a quantity dropdown
243
- * before it becomes an input element.
244
- */
245
- this.selectMax = 10;
246
- this.id = '';
247
- /**
248
- * @docs-private
249
- *
250
- * TODO: Update functionality to match other control during refactor.
251
- */
252
- this.disabled = false;
253
- /**
254
- * @docs-private
255
- * TODO: Update functionality to match other control during refactor.
256
- */
257
- this.required = false;
258
- this._quantity = 1;
259
- this._inputHasBeenShown = false;
260
- if (this.ngControl != null) {
261
- this.ngControl.valueAccessor = this;
262
- }
263
- }
264
- onChange(quantity) { }
265
- ;
266
- onTouched(quantity) { }
267
- ;
268
- writeValue(quantity) {
269
- this.quantity = quantity;
270
- this.cd.markForCheck();
271
- }
272
- registerOnChange(fn) {
273
- this.onChange = fn;
274
- }
275
- registerOnTouched(fn) {
276
- this.onTouched = fn;
277
- }
278
- setDisabledState(isDisabled) {
279
- this.disabled = isDisabled;
280
- }
281
- focus() {
282
- if (this.select) {
283
- this.select.focus();
284
- }
285
- if (this.input) {
286
- this.input.focus();
287
- }
288
- }
289
- get value() {
290
- if (this.select) {
291
- return this.select.value;
292
- }
293
- if (this.input) {
294
- return this.input.value;
295
- }
296
- }
297
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQuantityFieldComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
298
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffQuantityFieldComponent, isStandalone: true, selector: "daff-quantity-field", inputs: { min: "min", max: "max", selectMax: "selectMax", id: "id" }, providers: [
299
- {
300
- provide: DaffFormFieldControl,
301
- useExisting: DaffQuantityFieldComponent,
302
- },
303
- ], viewQueries: [{ propertyName: "input", first: true, predicate: DaffQuantityInputComponent, descendants: true }, { propertyName: "select", first: true, predicate: DaffQuantitySelectComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "@if (showSelectField) {\n <daff-quantity-select\n [min]=\"min\"\n [max]=\"_maxFloor\"\n [extendable]=\"max > selectMax\"\n [id]=\"id\">\n </daff-quantity-select>\n}\n@if (showInputField) {\n <daff-quantity-input\n [min]=\"min\"\n [max]=\"max\"\n [id]=\"id\">\n </daff-quantity-input>\n}\n", dependencies: [{ kind: "component", type: DaffQuantityInputComponent, selector: "daff-quantity-input", inputs: ["min", "max"] }, { kind: "component", type: DaffQuantitySelectComponent, selector: "daff-quantity-select", inputs: ["min", "max", "extendable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
304
- }
305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQuantityFieldComponent, decorators: [{
306
- type: Component,
307
- args: [{ selector: 'daff-quantity-field', providers: [
308
- {
309
- provide: DaffFormFieldControl,
310
- useExisting: DaffQuantityFieldComponent,
311
- },
312
- ], changeDetection: ChangeDetectionStrategy.OnPush, imports: [
313
- DaffQuantityInputComponent,
314
- DaffQuantitySelectComponent,
315
- ], template: "@if (showSelectField) {\n <daff-quantity-select\n [min]=\"min\"\n [max]=\"_maxFloor\"\n [extendable]=\"max > selectMax\"\n [id]=\"id\">\n </daff-quantity-select>\n}\n@if (showInputField) {\n <daff-quantity-input\n [min]=\"min\"\n [max]=\"max\"\n [id]=\"id\">\n </daff-quantity-input>\n}\n" }]
316
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
317
- type: Optional
318
- }, {
319
- type: Self
320
- }] }, { type: i0.ChangeDetectorRef }], propDecorators: { input: [{
321
- type: ViewChild,
322
- args: [DaffQuantityInputComponent]
323
- }], select: [{
324
- type: ViewChild,
325
- args: [DaffQuantitySelectComponent]
326
- }], min: [{
327
- type: Input
328
- }], max: [{
329
- type: Input
330
- }], selectMax: [{
331
- type: Input
332
- }], id: [{
333
- type: Input
334
- }] } });
335
-
336
- /**
337
- * @deprecated in favor of DaffSfQuantityFieldComponent. Deprecated in version 0.92.0. Will be removed in version 0.95.0.
338
- */
339
- class DaffQuantityFieldModule {
340
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQuantityFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
341
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffQuantityFieldModule, imports: [CommonModule,
342
- DaffQuantityFieldComponent], exports: [DaffQuantityFieldComponent] }); }
343
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQuantityFieldModule, imports: [CommonModule,
344
- DaffQuantityFieldComponent] }); }
345
- }
346
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQuantityFieldModule, decorators: [{
347
- type: NgModule,
348
- args: [{
349
- imports: [
350
- CommonModule,
351
- DaffQuantityFieldComponent,
352
- ],
353
- exports: [
354
- DaffQuantityFieldComponent,
355
- ],
356
- }]
357
- }] });
358
-
359
- /**
360
- * Generated bundle index. Do not edit.
361
- */
362
-
363
- export { DaffQuantityFieldComponent, DaffQuantityFieldModule };
364
- //# sourceMappingURL=daffodil-design-quantity-field.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"daffodil-design-quantity-field.mjs","sources":["../../../libs/design/quantity-field/src/quantity-input/quantity-input.component.ts","../../../libs/design/quantity-field/src/quantity-input/quantity-input.component.html","../../../libs/design/quantity-field/src/quantity-select/quantity-select.component.ts","../../../libs/design/quantity-field/src/quantity-select/quantity-select.component.html","../../../libs/design/quantity-field/src/quantity-field.component.ts","../../../libs/design/quantity-field/src/quantity-field.component.html","../../../libs/design/quantity-field/src/quantity-field.module.ts","../../../libs/design/quantity-field/src/daffodil-design-quantity-field.ts"],"sourcesContent":["import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n Input,\n ViewChild,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n OnInit,\n OnDestroy,\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-quantity-input',\n templateUrl: './quantity-input.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DaffInputComponent,\n ReactiveFormsModule,\n ],\n})\nexport class DaffQuantityInputComponent implements OnInit, OnDestroy {\n @ViewChild(DaffInputComponent) input: DaffInputComponent;\n\n /**\n * @docs\n * The minimum number for the quantity input field\n */\n @Input() min = 1;\n\n /**\n * @docs\n * The maximum number for the quantity input field\n */\n @Input() max = 10;\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 get focused(): boolean {\n return this.input?.focused;\n }\n\n _destroyed = new Subject();\n\n get value() {\n return this.ngControl.control.value;\n }\n set value(value) {\n const val = Math.min(Math.round(coerceNumberProperty(value)), this.max);\n this.ngControl.control.patchValue(val);\n this._inputControl.patchValue(val);\n this.changeDetectorRef.markForCheck();\n }\n\n get disabled() {\n return this.ngControl.control.disabled;\n }\n\n constructor(\n public ngControl: NgControl,\n private changeDetectorRef: ChangeDetectorRef,\n ) {}\n\n /**\n * @docs-private\n */\n ngOnInit() {\n this._inputControl.patchValue(this.ngControl.control.value);\n this.setInputDisabled();\n this.ngControl.statusChanges.pipe(\n takeUntil(this._destroyed),\n ).subscribe(() => {\n this.setInputDisabled();\n });\n }\n\n ngOnDestroy() {\n this._destroyed.next(true);\n }\n\n focus() {\n this.input.focus();\n }\n\n onFocus() {\n this.ngControl.control.markAsTouched();\n }\n\n onBlur() {\n if (this.value === null || this.value === undefined) {\n this.value = 1;\n this.changeDetectorRef.markForCheck();\n }\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(e: any) {\n this.value = e.target.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 (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (change)=\"onValueChange($event)\"\n [formControl]=\"_inputControl\"\n>\n","import {\n Component,\n Input,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n ViewChild,\n} from '@angular/core';\nimport {\n NgControl,\n ReactiveFormsModule,\n} from '@angular/forms';\n\nimport { DaffNativeSelectComponent } from '@daffodil/design/native-select';\n\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-quantity-select',\n templateUrl: './quantity-select.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DaffNativeSelectComponent,\n ReactiveFormsModule,\n ],\n})\nexport class DaffQuantitySelectComponent {\n\n @ViewChild(DaffNativeSelectComponent) select: DaffNativeSelectComponent;\n\n /**\n * @docs\n * The minimum number selectable.\n */\n @Input() min = 1;\n\n /**\n * @docs\n * The maximum number selectable;\n */\n @Input() max = 10;\n\n /**\n * @docs\n * Property used to determine whether or not the DaffQuantitySelectComponent is\n * used in a situation whether the `max` isn't a true max.\n */\n @Input() extendable = true;\n\n /**\n * The amount to increment between \"min\" and \"max\".\n */\n private increment = 1;\n\n _value = 1;\n\n get value() {\n return this._value;\n }\n set value(value) {\n this._value = value;\n this.ngControl.control.patchValue(this._value);\n this.changeDetectorRef.markForCheck();\n }\n\n constructor(public ngControl: NgControl, private changeDetectorRef: ChangeDetectorRef) {}\n\n /**\n * Callback function fired when the value changes.\n * Used to pass the value back up to the ngControl.\n */\n onValueChange(e) {\n this.value = e.target.value;\n }\n\n get focused(): boolean {\n return this.select.focused;\n }\n\n focus() {\n this.select.focus();\n }\n\n onFocus() {\n this.ngControl.control.markAsTouched();\n }\n\n /**\n * A helper function for easily making options for the `select`.\n */\n get valueArray() {\n return makeValueArray(this.min, this.max, this.increment);\n }\n}\n","<select daff-native-select\n [formControl]=\"ngControl.control\"\n (focus)=\"onFocus()\"\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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n Input,\n ChangeDetectionStrategy,\n Optional,\n Self,\n ViewChild,\n ChangeDetectorRef,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NgControl,\n} from '@angular/forms';\n\nimport { DaffFormFieldControl } from '@daffodil/design/form-field';\n\nimport { DaffQuantityInputComponent } from './quantity-input/quantity-input.component';\nimport { DaffQuantitySelectComponent } from './quantity-select/quantity-select.component';\n\n/**\n * @deprecated in favor of DaffSfQuantityFieldComponent. Deprecated in version 0.92.0. Will be removed in version 0.95.0.\n */\n@Component({\n selector: 'daff-quantity-field',\n templateUrl: './quantity-field.component.html',\n providers: [\n {\n provide: DaffFormFieldControl,\n\n useExisting: DaffQuantityFieldComponent,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DaffQuantityInputComponent,\n DaffQuantitySelectComponent,\n ],\n})\nexport class DaffQuantityFieldComponent extends DaffFormFieldControl<number> implements ControlValueAccessor, DaffFormFieldControl<number> {\n\n @ViewChild(DaffQuantityInputComponent) input: DaffQuantityInputComponent;\n @ViewChild(DaffQuantitySelectComponent) select: DaffQuantitySelectComponent;\n\n /**\n * @docs\n * The minimum valid value of the quantity field.\n * Must be greater than or equal to 1.\n */\n @Input() min = 1;\n\n /**\n * @docs\n * The maximum valid value of the quantity field.\n * Must be greater than min.\n */\n @Input() max = 500;\n\n /**\n * @docs\n * The range of numbers acceptable in a quantity dropdown\n * before it becomes an input element.\n */\n @Input() selectMax = 10;\n\n @Input() id = '';\n\n get focused(): boolean {\n return !!(this.input?.focused || this.select?.focused);\n }\n\n /**\n * @docs-private\n *\n * TODO: Update functionality to match other control during refactor.\n */\n disabled = false;\n\n /**\n * @docs-private\n * TODO: Update functionality to match other control during refactor.\n */\n required = false;\n\n private _quantity = 1;\n private _inputHasBeenShown = false;\n\n get quantity() {\n return this._quantity;\n }\n set quantity(value: number) {\n this._quantity = coerceNumberProperty(value, 1);\n }\n\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 get controlType() {\n // TODO: use enum\n return this.showInputField\n ? 'native-input'\n : 'native-select';\n }\n\n get showInputField(): boolean {\n const ret = this._inputHasBeenShown || (this.ngControl\n ? this.ngControl.value >= this.selectMax\n : this.quantity >= this.selectMax);\n\n if (ret) {\n this._inputHasBeenShown = true;\n }\n\n return ret;\n }\n\n get showSelectField(): boolean {\n return !this.showInputField;\n }\n\n constructor(\n @Optional() @Self() public ngControl: NgControl,\n private cd: ChangeDetectorRef,\n ) {\n super(ngControl);\n\n if (this.ngControl != null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n private onChange(quantity: number): void {};\n private onTouched(quantity: number): void {};\n\n writeValue(quantity: number): void {\n this.quantity = quantity;\n this.cd.markForCheck();\n }\n\n registerOnChange(fn: (quantity: number) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n focus() {\n if(this.select) {\n this.select.focus();\n }\n if(this.input) {\n this.input.focus();\n }\n }\n\n get value() {\n if(this.select) {\n return this.select.value;\n }\n if(this.input) {\n return this.input.value;\n }\n }\n}\n","@if (showSelectField) {\n <daff-quantity-select\n [min]=\"min\"\n [max]=\"_maxFloor\"\n [extendable]=\"max > selectMax\"\n [id]=\"id\">\n </daff-quantity-select>\n}\n@if (showInputField) {\n <daff-quantity-input\n [min]=\"min\"\n [max]=\"max\"\n [id]=\"id\">\n </daff-quantity-input>\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffQuantityFieldComponent } from './quantity-field.component';\n\n/**\n * @deprecated in favor of DaffSfQuantityFieldComponent. Deprecated in version 0.92.0. Will be removed in version 0.95.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffQuantityFieldComponent,\n ],\n exports: [\n DaffQuantityFieldComponent,\n ],\n})\nexport class DaffQuantityFieldModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MA6Ba,0BAA0B,CAAA;AAuBrC,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,KAAK,EAAE,OAAO;IAC5B;AAIA,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK;IACrC;IACA,IAAI,KAAK,CAAC,KAAK,EAAA;QACb,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;QACvE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;AACtC,QAAA,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC;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A0B;AAC3B,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
@@ -1,86 +0,0 @@
1
- # Link Set
2
- Link set is a component for displaying two or more link set items.
3
-
4
- ## Usage
5
-
6
- ### Within a standalone component
7
- To use link set in a standalone component, import `DAFF_LINK_SET_COMPONENTS` directly into your custom component:
8
-
9
- ```ts
10
- import { DAFF_LINK_SET_COMPONENTS } from '@daffodil/design/link-set';
11
-
12
- @Component({
13
- selector: 'custom-component',
14
- templateUrl: './custom-component.component.html',
15
- imports: [
16
- DAFF_LINK_SET_COMPONENTS,
17
- ],
18
- })
19
- export class CustomComponent {}
20
- ```
21
-
22
- ### Within a module (deprecated)
23
- To use link set in a module, import `DaffLinkSetModule` into your custom module:
24
-
25
- ```ts
26
- import { NgModule } from '@angular/core';
27
- import { DaffLinkSetModule } from '@daffodil/design/link-set';
28
- import { CustomComponent } from './custom.component';
29
-
30
- @NgModule({
31
- declarations: [
32
- CustomComponent,
33
- ],
34
- exports: [
35
- CustomComponent,
36
- ],
37
- imports: [
38
- DaffLinkSetModule,
39
- ],
40
- })
41
- export class CustomComponentModule { }
42
- ```
43
-
44
- > This method is deprecated. It's recommended to update all custom components to standalone.
45
-
46
- ## Supported Content Types
47
- A `<daff-link-set>` transcludes:
48
- * `[daffLinkSetHeading]`
49
- * `[daffLinkSetSubheading]`
50
- * `[daff-link-set-item]` component
51
-
52
- ### Heading
53
- A link set heading is used by adding `[daffLinkSetHeading]` to any tag. This is used to define the heading of a top level link set.
54
-
55
- ### Subheading
56
- A link set subheading is used by adding `[daffLinkSetSubheading]` to any tag. This is helpful to define the heading of a nested link set that is not actionable.
57
-
58
- ### Styling links within a link set
59
- Use the `[daff-link-set-item]` component to style links within a link set.
60
-
61
- ### Example
62
- ```
63
- <h4>Default Link Set</h4>
64
- <daff-link-set class="docs-link-set">
65
- <a href="#" daff-link-set-item daffLinkSetHeading>Link Set Heading</a>
66
- <a href="#" daff-link-set-item>Link</a>
67
- <a href="#" daff-link-set-item>Link</a>
68
- <a href="#" daff-link-set-item>Link</a>
69
- </daff-link-set>
70
-
71
- <h4>Nested Link Set</h4>
72
- <daff-link-set>
73
- <a href="#" daff-link-set-item daffLinkSetHeading>Link Set Heading</a>
74
- <a href="#" daff-link-set-item>Link</a>
75
- <div daffLinkSetSubheading>Link Set Subheading</div>
76
- <daff-link-set>
77
- <a href="#" daff-link-set-item>Link</a>
78
- <a href="#" daff-link-set-item>Link</a>
79
- <a href="#" daff-link-set-item>Link</a>
80
- <a href="#" daff-link-set-item>Link</a>
81
- </daff-link-set>
82
- <a href="#" daff-link-set-item>Link</a>
83
- <a href="#" daff-link-set-item>Link</a>
84
- <a href="#" daff-link-set-item>Link</a>
85
- </daff-link-set>
86
- ```
@@ -1,63 +0,0 @@
1
- # Quantity Field
2
- Quantity field is a form control element that switches between a native select and input element.
3
-
4
- ## Overview
5
- Quantity field is intended for use with cart items and product quantities. The maximum number accepted in a quantity select is configurable and set to 10 by default. It will switch to a quantity input if 10+ is selected.
6
-
7
- <daff-docs-example-viewer example="basic-quantity-field"></daff-docs-example-viewer>
8
-
9
- ## Usage
10
-
11
- ### Within a standalone component
12
- To use form field in a standalone component, import `DaffQuantityFieldComponent` directly into your custom component:
13
-
14
- ```ts
15
- import { DaffQuantityFieldComponent } from '@daffodil/design/quantity-field';
16
-
17
- @Component({
18
- selector: 'custom-component',
19
- templateUrl: './custom-component.component.html',
20
- imports: [
21
- DaffQuantityFieldComponent,
22
- ],
23
- })
24
- export class CustomComponent {}
25
- ```
26
-
27
- ### Within a module (deprecated)
28
- To use form field in a module, import `DaffQuantityFieldModule` into your custom module:
29
-
30
- ```ts
31
- import { NgModule } from '@angular/core';
32
- import { DaffQuantityFieldModule } from '@daffodil/design/quantity-field';
33
- import { CustomComponent } from './custom.component';
34
-
35
- @NgModule({
36
- declarations: [
37
- CustomComponent,
38
- ],
39
- exports: [
40
- CustomComponent,
41
- ],
42
- imports: [
43
- DaffQuantityFieldModule,
44
- ],
45
- })
46
- export class CustomComponentModule { }
47
- ```
48
-
49
- > This method is deprecated. It's recommended to update all custom components to standalone.
50
-
51
- ## Range Limits
52
- The default allowed range of numbers is 1 to 500. This can be changed by passing in the desired min and max values as inputs. Note that this does not validate the actual input. It merely informs the select which options it should generate and sets the input's min and max attributes. See [input#min](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number#min) and [input#max](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number#max) for more information.
53
-
54
- ## Disabled quantity field
55
- <daff-docs-example-viewer example="disabled-quantity-field"></daff-docs-example-viewer>
56
-
57
- ## Custom Select Max Value (15)
58
- The maximum value at which the field will switch to using an input is configurable.
59
- <daff-docs-example-viewer example="select-max-quantity-field"></daff-docs-example-viewer>
60
-
61
- ## Custom Range Limits (5 - 50)
62
- Custom range limits is the absolute minimum and maximum values can be specified.
63
- <daff-docs-example-viewer example="custom-range-quantity-field"></daff-docs-example-viewer>