@bravura/ui 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -3
- package/README.md +1 -1
- package/bundles/bravura-ui-discrete-input.umd.js +738 -0
- package/bundles/bravura-ui-discrete-input.umd.js.map +1 -0
- package/bundles/bravura-ui-form-field.umd.js +9 -2
- package/bundles/bravura-ui-form-field.umd.js.map +1 -1
- package/bundles/bravura-ui-radio-panel.umd.js +11 -3
- package/bundles/bravura-ui-radio-panel.umd.js.map +1 -1
- package/bundles/bravura-ui-selection-panel.umd.js +47 -8
- package/bundles/bravura-ui-selection-panel.umd.js.map +1 -1
- package/discrete-input/bravura-ui-discrete-input.d.ts +5 -0
- package/discrete-input/discrete-input.component.d.ts +138 -0
- package/discrete-input/discrete-input.module.d.ts +11 -0
- package/discrete-input/package.json +10 -0
- package/discrete-input/public-api.d.ts +2 -0
- package/esm2015/discrete-input/bravura-ui-discrete-input.js +5 -0
- package/esm2015/discrete-input/discrete-input.component.js +333 -0
- package/esm2015/discrete-input/discrete-input.module.js +20 -0
- package/esm2015/discrete-input/public-api.js +3 -0
- package/esm2015/form-field/form-field.component.js +11 -4
- package/esm2015/radio-panel/radio-panel.directive.js +13 -5
- package/esm2015/selection-panel/selection-panel-item.component.js +22 -3
- package/esm2015/selection-panel/selection-panel.directive.js +20 -3
- package/fesm2015/bravura-ui-discrete-input.js +355 -0
- package/fesm2015/bravura-ui-discrete-input.js.map +1 -0
- package/fesm2015/bravura-ui-form-field.js +10 -3
- package/fesm2015/bravura-ui-form-field.js.map +1 -1
- package/fesm2015/bravura-ui-radio-panel.js +11 -3
- package/fesm2015/bravura-ui-radio-panel.js.map +1 -1
- package/fesm2015/bravura-ui-selection-panel.js +41 -6
- package/fesm2015/bravura-ui-selection-panel.js.map +1 -1
- package/form-field/form-field.component.d.ts +2 -0
- package/package.json +1 -1
- package/radio-panel/radio-panel.directive.d.ts +8 -3
- package/selection-panel/selection-panel-item.component.d.ts +7 -0
- package/selection-panel/selection-panel.directive.d.ts +12 -3
- package/theme/_ui-theme.scss +6 -3
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ElementRef, Component, Optional, Inject, Self, Input, ViewChildren, NgModule } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
6
|
+
import * as i2 from '@angular/forms';
|
|
7
|
+
import { FormArray, FormGroup, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import * as i3 from '@angular/material/core';
|
|
9
|
+
import { mixinErrorState } from '@angular/material/core';
|
|
10
|
+
import * as i5 from '@angular/material/form-field';
|
|
11
|
+
import { MAT_FORM_FIELD, MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';
|
|
12
|
+
import { Subject } from 'rxjs';
|
|
13
|
+
import * as i1 from '@angular/cdk/a11y';
|
|
14
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
15
|
+
|
|
16
|
+
// Boilerplate for applying mixins to form field control for error state checking.
|
|
17
|
+
/** @ignore */
|
|
18
|
+
const _DiscreteInputBase = mixinErrorState(class {
|
|
19
|
+
constructor(
|
|
20
|
+
/** @ignore */ _defaultErrorStateMatcher,
|
|
21
|
+
/** @ignore */ _parentForm,
|
|
22
|
+
/** @ignore */ _parentFormGroup,
|
|
23
|
+
/** @ignore */ ngControl) {
|
|
24
|
+
this._defaultErrorStateMatcher = _defaultErrorStateMatcher;
|
|
25
|
+
this._parentForm = _parentForm;
|
|
26
|
+
this._parentFormGroup = _parentFormGroup;
|
|
27
|
+
this.ngControl = ngControl;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Custom `MatFormFieldControl` with an individual input box for each character, suitable for fixed-length fields,
|
|
32
|
+
* such as secondary PIN inputs, TFNs, or BSB code etc.
|
|
33
|
+
*
|
|
34
|
+
* Accessibility features are not yet fully implemented.
|
|
35
|
+
*
|
|
36
|
+
* Example:
|
|
37
|
+
*
|
|
38
|
+
* ```html
|
|
39
|
+
* <mat-form-field>
|
|
40
|
+
* <bui-discrete-input></bui-discrete-input>
|
|
41
|
+
* </mat-form-field>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
class DiscreteInputComponent extends _DiscreteInputBase {
|
|
46
|
+
constructor(_focusMonitor, _elementRef, formField, control, _parentForm, _parentFormGroup, _defaultErrorStateMatcher) {
|
|
47
|
+
super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, control);
|
|
48
|
+
this._focusMonitor = _focusMonitor;
|
|
49
|
+
this._elementRef = _elementRef;
|
|
50
|
+
/** The type of input boxes */
|
|
51
|
+
this.type = 'text';
|
|
52
|
+
/** Input boxes are separated in groups. This specifies the characters displayed between two groups. */
|
|
53
|
+
this.separator = ' ';
|
|
54
|
+
/** @ignore */ this.id = `bui-discrete-input-${DiscreteInputComponent.nextId++}`;
|
|
55
|
+
this._sizeSpec = [];
|
|
56
|
+
this._required = false;
|
|
57
|
+
this._disabled = false;
|
|
58
|
+
this._separatorPos = [];
|
|
59
|
+
/** @ignore */ this.onChange = (_) => { };
|
|
60
|
+
/** @ignore */ this.onTouched = () => { };
|
|
61
|
+
/** @ignore */ this.errorState = false;
|
|
62
|
+
this.parts = new FormArray([]);
|
|
63
|
+
this.group = new FormGroup({ parts: this.parts });
|
|
64
|
+
this.sizeSpec = [2, 2, 2];
|
|
65
|
+
this._formField = formField;
|
|
66
|
+
this.focused = false;
|
|
67
|
+
this.stateChanges = new Subject();
|
|
68
|
+
this.ngControl = control;
|
|
69
|
+
if (this.ngControl != null) {
|
|
70
|
+
this.ngControl.valueAccessor = this;
|
|
71
|
+
}
|
|
72
|
+
this._focusMonitor.monitor(this._elementRef, true).subscribe(origin => {
|
|
73
|
+
if (this.focused && !origin) {
|
|
74
|
+
this.onTouched();
|
|
75
|
+
}
|
|
76
|
+
this.focused = !!origin;
|
|
77
|
+
this.stateChanges.next();
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/** @ignore */
|
|
81
|
+
get shouldLabelFloat() {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
/** @ignore */
|
|
85
|
+
get empty() {
|
|
86
|
+
return this.parts.controls.every(c => !c.value);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Defines the length and grouping of the input.
|
|
90
|
+
* @default [2, 2, 2]
|
|
91
|
+
*/
|
|
92
|
+
get sizeSpec() {
|
|
93
|
+
return this._sizeSpec;
|
|
94
|
+
}
|
|
95
|
+
set sizeSpec(spec) {
|
|
96
|
+
let size = 0;
|
|
97
|
+
this._separatorPos = [];
|
|
98
|
+
spec.forEach((n, i) => {
|
|
99
|
+
size += n;
|
|
100
|
+
if (i < spec.length - 1) {
|
|
101
|
+
this._separatorPos.push(size);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
if (size !== this.parts.length) {
|
|
105
|
+
const v = this.value;
|
|
106
|
+
this.parts.clear({ emitEvent: false });
|
|
107
|
+
for (let i = 0; i < size; i++) {
|
|
108
|
+
this.parts.setControl(i, new FormControl(null, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]));
|
|
109
|
+
}
|
|
110
|
+
this.value = v;
|
|
111
|
+
this._sizeSpec = spec;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/** The placeholder for this control. */
|
|
115
|
+
get placeholder() {
|
|
116
|
+
return this._placeholder;
|
|
117
|
+
}
|
|
118
|
+
set placeholder(value) {
|
|
119
|
+
this._placeholder = value;
|
|
120
|
+
this.stateChanges.next();
|
|
121
|
+
}
|
|
122
|
+
/** Whether the control is required. */
|
|
123
|
+
get required() {
|
|
124
|
+
return this._required;
|
|
125
|
+
}
|
|
126
|
+
set required(value) {
|
|
127
|
+
this._required = coerceBooleanProperty(value);
|
|
128
|
+
this.stateChanges.next();
|
|
129
|
+
}
|
|
130
|
+
/** Whether the control is disabled. */
|
|
131
|
+
get disabled() {
|
|
132
|
+
return this._disabled;
|
|
133
|
+
}
|
|
134
|
+
set disabled(value) {
|
|
135
|
+
this._disabled = coerceBooleanProperty(value);
|
|
136
|
+
this._disabled ? this.parts.disable() : this.parts.enable();
|
|
137
|
+
this.stateChanges.next();
|
|
138
|
+
}
|
|
139
|
+
/** The value of the control. */
|
|
140
|
+
get value() {
|
|
141
|
+
return this.parts.controls
|
|
142
|
+
.map(c => c.value)
|
|
143
|
+
.filter(c => c)
|
|
144
|
+
.join('');
|
|
145
|
+
}
|
|
146
|
+
set value(v) {
|
|
147
|
+
var _a;
|
|
148
|
+
v = v || '';
|
|
149
|
+
for (let i = 0; i < this.parts.controls.length; i++) {
|
|
150
|
+
(_a = this.parts.controls[i]) === null || _a === void 0 ? void 0 : _a.setValue(v[i]);
|
|
151
|
+
}
|
|
152
|
+
this.stateChanges.next();
|
|
153
|
+
}
|
|
154
|
+
/** @ignore */
|
|
155
|
+
get _colorSuffix() {
|
|
156
|
+
var _a;
|
|
157
|
+
return this.errorState ? 'warn' : ((_a = this._formField) === null || _a === void 0 ? void 0 : _a.color) || 'primary';
|
|
158
|
+
}
|
|
159
|
+
/** @ignore */
|
|
160
|
+
ngOnDestroy() {
|
|
161
|
+
this.stateChanges.complete();
|
|
162
|
+
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
163
|
+
}
|
|
164
|
+
/** @ignore */
|
|
165
|
+
setDescribedByIds(ids) {
|
|
166
|
+
const controlElement = this._elementRef.nativeElement.querySelector('.bui-discrete-input-container');
|
|
167
|
+
controlElement.setAttribute('aria-describedby', ids.join(' '));
|
|
168
|
+
}
|
|
169
|
+
/** @ignore */
|
|
170
|
+
onContainerClick() {
|
|
171
|
+
const l = this.parts.controls.length;
|
|
172
|
+
for (let i = 0; i < l; i++) {
|
|
173
|
+
if (this.parts.controls[i].invalid || i === l - 1) {
|
|
174
|
+
this._focusMonitor.focusVia(this.inputParts.get(i), 'program');
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/** @ignore */
|
|
180
|
+
writeValue(v) {
|
|
181
|
+
this.value = v;
|
|
182
|
+
}
|
|
183
|
+
/** @ignore */
|
|
184
|
+
registerOnChange(fn) {
|
|
185
|
+
this.onChange = fn;
|
|
186
|
+
}
|
|
187
|
+
/** @ignore */
|
|
188
|
+
registerOnTouched(fn) {
|
|
189
|
+
this.onTouched = fn;
|
|
190
|
+
}
|
|
191
|
+
/** @ignore */
|
|
192
|
+
setDisabledState(isDisabled) {
|
|
193
|
+
this.disabled = isDisabled;
|
|
194
|
+
}
|
|
195
|
+
/** @ignore */
|
|
196
|
+
_handleInput(control, index) {
|
|
197
|
+
let v = control.value && control.value[0];
|
|
198
|
+
control.setValue(v);
|
|
199
|
+
const nextElement = this.inputParts.get(index + 1);
|
|
200
|
+
if (!control.errors && nextElement) {
|
|
201
|
+
this._focusPart(nextElement);
|
|
202
|
+
}
|
|
203
|
+
this.onChange(this.value);
|
|
204
|
+
}
|
|
205
|
+
/** @ignore */
|
|
206
|
+
_handleBeforeInput(index, event) {
|
|
207
|
+
const v = event.data;
|
|
208
|
+
if (this.accept && v && !new RegExp(`[${this.accept}]`).test(v)) {
|
|
209
|
+
event.preventDefault();
|
|
210
|
+
event.stopPropagation();
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const inp = this.inputParts.get(index).nativeElement;
|
|
214
|
+
if (v && inp.value) {
|
|
215
|
+
inp.value = '';
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/** @ignore */
|
|
219
|
+
_focusPart(elemRef) {
|
|
220
|
+
this._focusMonitor.focusVia(elemRef, 'program');
|
|
221
|
+
}
|
|
222
|
+
/** @ignore */
|
|
223
|
+
_consumeKey(event) {
|
|
224
|
+
event.stopPropagation();
|
|
225
|
+
event.preventDefault();
|
|
226
|
+
}
|
|
227
|
+
/** @ignore */
|
|
228
|
+
_leftArrow(index, event) {
|
|
229
|
+
this._consumeKey(event);
|
|
230
|
+
const prevElement = this.inputParts.get(index - 1);
|
|
231
|
+
if (prevElement) {
|
|
232
|
+
this._focusPart(prevElement);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/** @ignore */
|
|
236
|
+
_rightArrow(index, event) {
|
|
237
|
+
this._consumeKey(event);
|
|
238
|
+
const nextElement = this.inputParts.get(index + 1);
|
|
239
|
+
if (nextElement) {
|
|
240
|
+
this._focusPart(nextElement);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/** @ignore */
|
|
244
|
+
_handleBackspace(control, index) {
|
|
245
|
+
const prevElement = index && this.inputParts.get(index - 1);
|
|
246
|
+
if (!control.value && prevElement) {
|
|
247
|
+
this._focusMonitor.focusVia(prevElement, 'program');
|
|
248
|
+
}
|
|
249
|
+
else if (control.value) {
|
|
250
|
+
control.setValue('');
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/** @ignore */
|
|
254
|
+
_onPaste(event) {
|
|
255
|
+
var _a;
|
|
256
|
+
let text = (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text');
|
|
257
|
+
if (text) {
|
|
258
|
+
if (this.accept) {
|
|
259
|
+
text = text.replace(new RegExp(`[^${this.accept}]`, 'gi'), '');
|
|
260
|
+
}
|
|
261
|
+
this.value = text;
|
|
262
|
+
this.onChange(this.value);
|
|
263
|
+
}
|
|
264
|
+
event.preventDefault();
|
|
265
|
+
this.onContainerClick();
|
|
266
|
+
}
|
|
267
|
+
/** @ignore */
|
|
268
|
+
_separatorRequired(index) {
|
|
269
|
+
return this._separatorPos.includes(index + 1);
|
|
270
|
+
}
|
|
271
|
+
/** @ignore */
|
|
272
|
+
_placeholderAt(index) {
|
|
273
|
+
return this._placeholder && this._placeholder[index];
|
|
274
|
+
}
|
|
275
|
+
/** @ignore */
|
|
276
|
+
ngDoCheck() {
|
|
277
|
+
if (this.ngControl) {
|
|
278
|
+
// We need to re-evaluate this on every change detection cycle, because there are some
|
|
279
|
+
// error triggers that we can't subscribe to (e.g. parent form submissions). This means
|
|
280
|
+
// that whatever logic is in here has to be super lean or we risk destroying the performance.
|
|
281
|
+
this.updateErrorState();
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/** @ignore */
|
|
286
|
+
DiscreteInputComponent.nextId = 0;
|
|
287
|
+
DiscreteInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: DiscreteInputComponent, deps: [{ token: i1.FocusMonitor }, { token: i0.ElementRef }, { token: MAT_FORM_FIELD, optional: true }, { token: i2.NgControl, optional: true, self: true }, { token: i2.NgForm, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: i3.ErrorStateMatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
288
|
+
DiscreteInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: DiscreteInputComponent, selector: "bui-discrete-input", inputs: { type: "type", separator: "separator", accept: "accept", userAriaDescribedBy: ["aria-describedby", "userAriaDescribedBy"], sizeSpec: "sizeSpec", placeholder: "placeholder", required: "required", disabled: "disabled", value: "value" }, host: { classAttribute: "bui-discrete-input" }, providers: [{ provide: MatFormFieldControl, useExisting: DiscreteInputComponent }], viewQueries: [{ propertyName: "inputParts", predicate: ["part"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<div\n\trole=\"group\"\n\tclass=\"bui-discrete-input-container\"\n\t[formGroup]=\"group\"\n\t[attr.aria-labelledby]=\"_formField?.getLabelId()\"\n>\n\t<ng-container [formArrayName]=\"'parts'\">\n\t\t<ng-template ngFor [ngForOf]=\"parts.controls\" let-p let-i=\"index\">\n\t\t\t<input\n\t\t\t\tclass=\"bui-discrete-input-element bui-outline-{{ _colorSuffix }}\"\n\t\t\t\t[formControlName]=\"i\"\n\t\t\t\tsize=\"1\"\n\t\t\t\tmaxLength=\"1\"\n\t\t\t\t[attr.aria-label]=\"'character ' + (i + 1)\"\n\t\t\t\t(input)=\"_handleInput(p, i)\"\n\t\t\t\t(beforeinput)=\"_handleBeforeInput(i, $event)\"\n\t\t\t\t(keydown.backspace)=\"_handleBackspace(p, i)\"\n\t\t\t\t(keydown.arrowup)=\"_consumeKey($event)\"\n\t\t\t\t(keydown.arrowdown)=\"_consumeKey($event)\"\n\t\t\t\t(keydown.arrowleft)=\"_leftArrow(i, $event)\"\n\t\t\t\t(keydown.arrowright)=\"_rightArrow(i, $event)\"\n\t\t\t\t[attr.placeholder]=\"_placeholderAt(i)\"\n\t\t\t\t#part\n\t\t\t\t(click)=\"$event.stopPropagation()\"\n\t\t\t\t(paste)=\"_onPaste($event)\"\n\t\t\t\t[type]=\"['text', 'number', 'password'].includes(type) ? type : 'text'\"\n\t\t\t\tautocapitalize=\"none\"\n\t\t\t/>\n\t\t\t<span *ngIf=\"_separatorRequired(i)\" class=\"bui-discrete-input-spacer\">{{ separator }}</span>\n\t\t</ng-template>\n\t</ng-container>\n</div>\n", styles: [".bui-discrete-input-container{display:flex;align-items:center}.bui-discrete-input-element{border:1px solid rgba(128,128,128,.4);border-radius:3px;background:none;padding:0;text-align:center;width:1.5em;height:1.5em;font-size:inherit;color:currentColor;caret-color:auto}.bui-discrete-input-element:not(:last-child){margin-right:.25em}.bui-discrete-input-element:focus-visible{outline-style:solid;outline-width:2px;outline-offset:-1px}.bui-discrete-input-element[type=number]::-webkit-inner-spin-button,.bui-discrete-input-element[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.bui-discrete-input-spacer{margin-right:.25em;vertical-align:middle}\n"], directives: [{ type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: DiscreteInputComponent, decorators: [{
|
|
290
|
+
type: Component,
|
|
291
|
+
args: [{
|
|
292
|
+
selector: 'bui-discrete-input',
|
|
293
|
+
templateUrl: 'discrete-input.component.html',
|
|
294
|
+
styleUrls: ['discrete-input.component.scss'],
|
|
295
|
+
providers: [{ provide: MatFormFieldControl, useExisting: DiscreteInputComponent }],
|
|
296
|
+
host: {
|
|
297
|
+
class: 'bui-discrete-input'
|
|
298
|
+
}
|
|
299
|
+
}]
|
|
300
|
+
}], ctorParameters: function () { return [{ type: i1.FocusMonitor }, { type: i0.ElementRef }, { type: i5.MatFormField, decorators: [{
|
|
301
|
+
type: Optional
|
|
302
|
+
}, {
|
|
303
|
+
type: Inject,
|
|
304
|
+
args: [MAT_FORM_FIELD]
|
|
305
|
+
}] }, { type: i2.NgControl, decorators: [{
|
|
306
|
+
type: Optional
|
|
307
|
+
}, {
|
|
308
|
+
type: Self
|
|
309
|
+
}] }, { type: i2.NgForm, decorators: [{
|
|
310
|
+
type: Optional
|
|
311
|
+
}] }, { type: i2.FormGroupDirective, decorators: [{
|
|
312
|
+
type: Optional
|
|
313
|
+
}] }, { type: i3.ErrorStateMatcher }]; }, propDecorators: { type: [{
|
|
314
|
+
type: Input
|
|
315
|
+
}], separator: [{
|
|
316
|
+
type: Input
|
|
317
|
+
}], accept: [{
|
|
318
|
+
type: Input
|
|
319
|
+
}], userAriaDescribedBy: [{
|
|
320
|
+
type: Input,
|
|
321
|
+
args: ['aria-describedby']
|
|
322
|
+
}], inputParts: [{
|
|
323
|
+
type: ViewChildren,
|
|
324
|
+
args: ['part', { read: ElementRef }]
|
|
325
|
+
}], sizeSpec: [{
|
|
326
|
+
type: Input
|
|
327
|
+
}], placeholder: [{
|
|
328
|
+
type: Input
|
|
329
|
+
}], required: [{
|
|
330
|
+
type: Input
|
|
331
|
+
}], disabled: [{
|
|
332
|
+
type: Input
|
|
333
|
+
}], value: [{
|
|
334
|
+
type: Input
|
|
335
|
+
}] } });
|
|
336
|
+
|
|
337
|
+
class DiscreteInputModule {
|
|
338
|
+
}
|
|
339
|
+
DiscreteInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: DiscreteInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
340
|
+
DiscreteInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: DiscreteInputModule, declarations: [DiscreteInputComponent], imports: [CommonModule, MatFormFieldModule, ReactiveFormsModule, A11yModule] });
|
|
341
|
+
DiscreteInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: DiscreteInputModule, imports: [[CommonModule, MatFormFieldModule, ReactiveFormsModule, A11yModule]] });
|
|
342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: DiscreteInputModule, decorators: [{
|
|
343
|
+
type: NgModule,
|
|
344
|
+
args: [{
|
|
345
|
+
declarations: [DiscreteInputComponent],
|
|
346
|
+
imports: [CommonModule, MatFormFieldModule, ReactiveFormsModule, A11yModule]
|
|
347
|
+
}]
|
|
348
|
+
}] });
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Generated bundle index. Do not edit.
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
export { DiscreteInputComponent, DiscreteInputModule };
|
|
355
|
+
//# sourceMappingURL=bravura-ui-discrete-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bravura-ui-discrete-input.js","sources":["../../../projects/ui/discrete-input/discrete-input.component.ts","../../../projects/ui/discrete-input/discrete-input.component.html","../../../projects/ui/discrete-input/discrete-input.module.ts","../../../projects/ui/discrete-input/bravura-ui-discrete-input.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n\tComponent,\n\tElementRef,\n\tInject,\n\tInput,\n\tOnDestroy,\n\tOptional,\n\tQueryList,\n\tSelf,\n\tViewChildren\n} from '@angular/core';\nimport {\n\tAbstractControl,\n\tControlValueAccessor,\n\tFormArray,\n\tFormControl,\n\tFormGroup,\n\tFormGroupDirective,\n\tNgControl,\n\tNgForm,\n\tValidators\n} from '@angular/forms';\nimport { ErrorStateMatcher, mixinErrorState } from '@angular/material/core';\nimport { MatFormField, MatFormFieldControl, MAT_FORM_FIELD } from '@angular/material/form-field';\nimport { Subject } from 'rxjs';\n\n// Boilerplate for applying mixins to form field control for error state checking.\n/** @ignore */\nconst _DiscreteInputBase = mixinErrorState(\n\tclass {\n\t\tconstructor(\n\t\t\t/** @ignore */ public _defaultErrorStateMatcher: ErrorStateMatcher,\n\t\t\t/** @ignore */ public _parentForm: NgForm,\n\t\t\t/** @ignore */ public _parentFormGroup: FormGroupDirective,\n\t\t\t/** @ignore */ public ngControl: NgControl\n\t\t) {}\n\t}\n);\n\n/**\n * Custom `MatFormFieldControl` with an individual input box for each character, suitable for fixed-length fields,\n * such as secondary PIN inputs, TFNs, or BSB code etc.\n *\n * Accessibility features are not yet fully implemented.\n *\n * Example:\n *\n * ```html\n * <mat-form-field>\n * <bui-discrete-input></bui-discrete-input>\n * </mat-form-field>\n * ```\n *\n */\n@Component({\n\tselector: 'bui-discrete-input',\n\ttemplateUrl: 'discrete-input.component.html',\n\tstyleUrls: ['discrete-input.component.scss'],\n\tproviders: [{ provide: MatFormFieldControl, useExisting: DiscreteInputComponent }],\n\thost: {\n\t\tclass: 'bui-discrete-input'\n\t}\n})\nexport class DiscreteInputComponent\n\textends _DiscreteInputBase\n\timplements MatFormFieldControl<string>, ControlValueAccessor, OnDestroy\n{\n\t/** @ignore */\n\tstatic nextId = 0;\n\n\t/** @ignore */\n\tstatic ngAcceptInputType_disabled: boolean | string | null | undefined;\n\t/** @ignore */\n\tstatic ngAcceptInputType_required: boolean | string | null | undefined;\n\n\t/** @ignore */ parts: FormArray;\n\t/** @ignore */ group: FormGroup;\n\t/** Emits whenever the component state changes. */\n\tstateChanges: Subject<void>;\n\t/** Whether the control is focused. */\n\tfocused: boolean;\n\n\t/** The type of input boxes */\n\t@Input()\n\ttype: 'text' | 'number' | 'password' = 'text';\n\n\t/** Input boxes are separated in groups. This specifies the characters displayed between two groups. */\n\t@Input()\n\tseparator = ' ';\n\n\t/**\n\t * A list of characters accepted in the inputs, for example `0-9`, `a-zA-Z0-9`\n\t * @example '0-9'\n\t */\n\t@Input()\n\taccept?: string;\n\n\t/** @ignore */ id = `bui-discrete-input-${DiscreteInputComponent.nextId++}`;\n\n\t/** Value of aria-describedby that should be merged with the described-by ids which are set by the form-field. */\n\t@Input('aria-describedby') userAriaDescribedBy?: string;\n\n\t@ViewChildren('part', { read: ElementRef }) private inputParts!: QueryList<ElementRef<HTMLInputElement>>;\n\n\t/**@ignore */\n\t_formField: MatFormField;\n\n\t/**@ignore */\n\tngControl: NgControl;\n\n\tprivate _sizeSpec: number[] = [];\n\n\tprivate _required = false;\n\n\tprivate _placeholder?: string;\n\tprivate _disabled = false;\n\tprivate _separatorPos: number[] = [];\n\n\t/** @ignore */ onChange = (_: any) => {};\n\t/** @ignore */ onTouched = () => {};\n\n\t/** @ignore */\n\tget shouldLabelFloat() {\n\t\treturn true;\n\t}\n\n\t/** @ignore */\n\tget empty() {\n\t\treturn this.parts.controls.every(c => !c.value);\n\t}\n\n\t/**\n\t * Defines the length and grouping of the input.\n\t * @default [2, 2, 2]\n\t */\n\t@Input()\n\tget sizeSpec(): number[] {\n\t\treturn this._sizeSpec;\n\t}\n\tset sizeSpec(spec: number[]) {\n\t\tlet size = 0;\n\t\tthis._separatorPos = [];\n\t\tspec.forEach((n, i) => {\n\t\t\tsize += n;\n\t\t\tif (i < spec.length - 1) {\n\t\t\t\tthis._separatorPos.push(size);\n\t\t\t}\n\t\t});\n\t\tif (size !== this.parts.length) {\n\t\t\tconst v = this.value;\n\t\t\tthis.parts.clear({ emitEvent: false });\n\t\t\tfor (let i = 0; i < size; i++) {\n\t\t\t\tthis.parts.setControl(\n\t\t\t\t\ti,\n\t\t\t\t\tnew FormControl(null, [Validators.required, Validators.minLength(1), Validators.maxLength(1)])\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.value = v;\n\t\t\tthis._sizeSpec = spec;\n\t\t}\n\t}\n\n\t/** The placeholder for this control. */\n\t@Input()\n\tget placeholder(): string {\n\t\treturn this._placeholder!;\n\t}\n\tset placeholder(value: string) {\n\t\tthis._placeholder = value;\n\t\tthis.stateChanges.next();\n\t}\n\n\t/** Whether the control is required. */\n\t@Input()\n\tget required(): boolean {\n\t\treturn this._required;\n\t}\n\tset required(value: boolean) {\n\t\tthis._required = coerceBooleanProperty(value);\n\t\tthis.stateChanges.next();\n\t}\n\n\t/** Whether the control is disabled. */\n\t@Input()\n\tget disabled(): boolean {\n\t\treturn this._disabled;\n\t}\n\tset disabled(value: boolean) {\n\t\tthis._disabled = coerceBooleanProperty(value);\n\t\tthis._disabled ? this.parts.disable() : this.parts.enable();\n\t\tthis.stateChanges.next();\n\t}\n\n\t/** The value of the control. */\n\t@Input()\n\tget value(): string {\n\t\treturn this.parts.controls\n\t\t\t.map(c => c.value)\n\t\t\t.filter(c => c)\n\t\t\t.join('');\n\t}\n\tset value(v: string) {\n\t\tv = v || '';\n\t\tfor (let i = 0; i < this.parts.controls.length; i++) {\n\t\t\tthis.parts.controls[i]?.setValue(v[i]);\n\t\t}\n\t\tthis.stateChanges.next();\n\t}\n\n\t/** @ignore */\n\tget _colorSuffix(): string {\n\t\treturn this.errorState ? 'warn' : this._formField?.color || 'primary';\n\t}\n\n\tconstructor(\n\t\tprivate _focusMonitor: FocusMonitor,\n\t\tprivate _elementRef: ElementRef<HTMLElement>,\n\t\t@Optional() @Inject(MAT_FORM_FIELD) formField: MatFormField,\n\t\t@Optional() @Self() control: NgControl,\n\t\t@Optional() _parentForm: NgForm,\n\t\t@Optional() _parentFormGroup: FormGroupDirective,\n\t\t_defaultErrorStateMatcher: ErrorStateMatcher\n\t) {\n\t\tsuper(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, control);\n\t\tthis.parts = new FormArray([]);\n\t\tthis.group = new FormGroup({ parts: this.parts });\n\t\tthis.sizeSpec = [2, 2, 2];\n\t\tthis._formField = formField;\n\t\tthis.focused = false;\n\t\tthis.stateChanges = new Subject<void>();\n\n\t\tthis.ngControl = control;\n\t\tif (this.ngControl != null) {\n\t\t\tthis.ngControl.valueAccessor = this;\n\t\t}\n\n\t\tthis._focusMonitor.monitor(this._elementRef, true).subscribe(origin => {\n\t\t\tif (this.focused && !origin) {\n\t\t\t\tthis.onTouched();\n\t\t\t}\n\t\t\tthis.focused = !!origin;\n\t\t\tthis.stateChanges.next();\n\t\t});\n\t}\n\n\t/** @ignore */ errorState = false;\n\t/** @ignore */ controlType?: string | undefined;\n\t/** @ignore */ autofilled?: boolean | undefined;\n\n\t/** @ignore */\n\tngOnDestroy() {\n\t\tthis.stateChanges.complete();\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/** @ignore */\n\tsetDescribedByIds(ids: string[]) {\n\t\tconst controlElement = this._elementRef.nativeElement.querySelector('.bui-discrete-input-container');\n\t\tcontrolElement!.setAttribute('aria-describedby', ids.join(' '));\n\t}\n\n\t/** @ignore */\n\tonContainerClick() {\n\t\tconst l = this.parts.controls.length;\n\t\tfor (let i = 0; i < l; i++) {\n\t\t\tif (this.parts.controls[i].invalid || i === l - 1) {\n\t\t\t\tthis._focusMonitor.focusVia(this.inputParts.get(i)!, 'program');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @ignore */\n\twriteValue(v: string): void {\n\t\tthis.value = v;\n\t}\n\n\t/** @ignore */\n\tregisterOnChange(fn: any): void {\n\t\tthis.onChange = fn;\n\t}\n\n\t/** @ignore */\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\t/** @ignore */\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/** @ignore */\n\t_handleInput(control: AbstractControl, index: number): void {\n\t\tlet v = control.value && control.value[0];\n\t\tcontrol.setValue(v);\n\t\tconst nextElement = this.inputParts.get(index + 1);\n\t\tif (!control.errors && nextElement) {\n\t\t\tthis._focusPart(nextElement);\n\t\t}\n\n\t\tthis.onChange(this.value);\n\t}\n\n\t/** @ignore */\n\t_handleBeforeInput(index: number, event: InputEvent): void {\n\t\tconst v = event.data;\n\t\tif (this.accept && v && !new RegExp(`[${this.accept}]`).test(v)) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\treturn;\n\t\t}\n\t\tconst inp = this.inputParts.get(index)!.nativeElement;\n\t\tif (v && inp.value) {\n\t\t\tinp.value = '';\n\t\t}\n\t}\n\n\t/** @ignore */\n\t_focusPart(elemRef: ElementRef<HTMLInputElement>) {\n\t\tthis._focusMonitor.focusVia(elemRef, 'program');\n\t}\n\n\t/** @ignore */\n\t_consumeKey(event: Event) {\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\t}\n\n\t/** @ignore */\n\t_leftArrow(index: number, event: Event) {\n\t\tthis._consumeKey(event);\n\t\tconst prevElement = this.inputParts.get(index - 1);\n\t\tif (prevElement) {\n\t\t\tthis._focusPart(prevElement);\n\t\t}\n\t}\n\n\t/** @ignore */\n\t_rightArrow(index: number, event: Event) {\n\t\tthis._consumeKey(event);\n\t\tconst nextElement = this.inputParts.get(index + 1);\n\t\tif (nextElement) {\n\t\t\tthis._focusPart(nextElement);\n\t\t}\n\t}\n\n\t/** @ignore */\n\t_handleBackspace(control: AbstractControl, index: number): void {\n\t\tconst prevElement = index && this.inputParts.get(index - 1);\n\t\tif (!control.value && prevElement) {\n\t\t\tthis._focusMonitor.focusVia(prevElement, 'program');\n\t\t} else if (control.value) {\n\t\t\tcontrol.setValue('');\n\t\t}\n\t}\n\n\t/** @ignore */\n\t_onPaste(event: ClipboardEvent) {\n\t\tlet text = event.clipboardData?.getData('text');\n\t\tif (text) {\n\t\t\tif (this.accept) {\n\t\t\t\ttext = text.replace(new RegExp(`[^${this.accept}]`, 'gi'), '');\n\t\t\t}\n\t\t\tthis.value = text;\n\t\t\tthis.onChange(this.value);\n\t\t}\n\t\tevent.preventDefault();\n\t\tthis.onContainerClick();\n\t}\n\n\t/** @ignore */\n\t_separatorRequired(index: number) {\n\t\treturn this._separatorPos.includes(index + 1);\n\t}\n\n\t/** @ignore */\n\t_placeholderAt(index: number) {\n\t\treturn this._placeholder && this._placeholder[index];\n\t}\n\n\t/** @ignore */\n\tngDoCheck() {\n\t\tif (this.ngControl) {\n\t\t\t// We need to re-evaluate this on every change detection cycle, because there are some\n\t\t\t// error triggers that we can't subscribe to (e.g. parent form submissions). This means\n\t\t\t// that whatever logic is in here has to be super lean or we risk destroying the performance.\n\t\t\tthis.updateErrorState();\n\t\t}\n\t}\n}\n","<div\n\trole=\"group\"\n\tclass=\"bui-discrete-input-container\"\n\t[formGroup]=\"group\"\n\t[attr.aria-labelledby]=\"_formField?.getLabelId()\"\n>\n\t<ng-container [formArrayName]=\"'parts'\">\n\t\t<ng-template ngFor [ngForOf]=\"parts.controls\" let-p let-i=\"index\">\n\t\t\t<input\n\t\t\t\tclass=\"bui-discrete-input-element bui-outline-{{ _colorSuffix }}\"\n\t\t\t\t[formControlName]=\"i\"\n\t\t\t\tsize=\"1\"\n\t\t\t\tmaxLength=\"1\"\n\t\t\t\t[attr.aria-label]=\"'character ' + (i + 1)\"\n\t\t\t\t(input)=\"_handleInput(p, i)\"\n\t\t\t\t(beforeinput)=\"_handleBeforeInput(i, $event)\"\n\t\t\t\t(keydown.backspace)=\"_handleBackspace(p, i)\"\n\t\t\t\t(keydown.arrowup)=\"_consumeKey($event)\"\n\t\t\t\t(keydown.arrowdown)=\"_consumeKey($event)\"\n\t\t\t\t(keydown.arrowleft)=\"_leftArrow(i, $event)\"\n\t\t\t\t(keydown.arrowright)=\"_rightArrow(i, $event)\"\n\t\t\t\t[attr.placeholder]=\"_placeholderAt(i)\"\n\t\t\t\t#part\n\t\t\t\t(click)=\"$event.stopPropagation()\"\n\t\t\t\t(paste)=\"_onPaste($event)\"\n\t\t\t\t[type]=\"['text', 'number', 'password'].includes(type) ? type : 'text'\"\n\t\t\t\tautocapitalize=\"none\"\n\t\t\t/>\n\t\t\t<span *ngIf=\"_separatorRequired(i)\" class=\"bui-discrete-input-spacer\">{{ separator }}</span>\n\t\t</ng-template>\n\t</ng-container>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DiscreteInputComponent } from './discrete-input.component';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { A11yModule } from '@angular/cdk/a11y';\n\n@NgModule({\n\tdeclarations: [DiscreteInputComponent],\n\timports: [CommonModule, MatFormFieldModule, ReactiveFormsModule, A11yModule]\n})\nexport class DiscreteInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA4BA;AACA;AACA,MAAM,kBAAkB,GAAG,eA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AAE,oBAAoB;oBAC9B,WAAW,EAAE,+BAA+B;oBAC5C,SAAS,EAAE,CAAC,+BAA+B,CAAC;oBAC5C,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,wBAAwB,EAAE,CAAC;oBAClF,IAAI,EAAE;wBACL,KAAK,EAAE,oBAAoB;qBAC3B;iBACD;;0BA2JE,QAAQ;;0BAAI,MAAM;2BAAC,cAAc;;0BACjC,QAAQ;;0BAAI,IAAI;;0BAChB,QAAQ;;0BACR,QAAQ;4EAxIV,IAAI;sBADH,KAAK;gBAKN,SAAS;sBADR,KAAK;gBAQN,MAAM;sBADL,KAAK;gBAMqB,mBAAmB;sBAA7C,KAAK;uBAAC,kBAAkB;gBAE2B,UAAU;sBAA7D,YAAY;uBAAC,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAkCtC,QAAQ;sBADX,KAAK;gBA6BF,WAAW;sBADd,KAAK;gBAWF,QAAQ;sBADX,KAAK;gBAWF,QAAQ;sBADX,KAAK;gBAYF,KAAK;sBADR,KAAK;;;MEzLM,mBAAmB;;gHAAnB,mBAAmB;iHAAnB,mBAAmB,iBAHhB,sBAAsB,aAC3B,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,UAAU;iHAE/D,mBAAmB,YAFtB,CAAC,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,UAAU,CAAC;2FAEhE,mBAAmB;kBAJ/B,QAAQ;mBAAC;oBACT,YAAY,EAAE,CAAC,sBAAsB,CAAC;oBACtC,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,UAAU,CAAC;iBAC5E;;;ACVD;;;;;;"}
|
|
@@ -3,7 +3,7 @@ import { ObserversModule } from '@angular/cdk/observers';
|
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
6
|
+
import { forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, HostListener, NgModule } from '@angular/core';
|
|
7
7
|
import { MatFormField, MAT_FORM_FIELD, matFormFieldAnimations, MatFormFieldModule } from '@angular/material/form-field';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -46,9 +46,13 @@ class FormFieldComponent extends MatFormField {
|
|
|
46
46
|
_enhancedAppearance() {
|
|
47
47
|
return this.appearance === 'detach' || this.appearance === 'bound';
|
|
48
48
|
}
|
|
49
|
+
/** @ignore */
|
|
50
|
+
_hostClicked(event) {
|
|
51
|
+
this._control.onContainerClick && this._control.onContainerClick(event);
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
54
|
FormFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FormFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
51
|
-
FormFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: FormFieldComponent, selector: "bui-form-field", inputs: { color: "color" }, host: { properties: { "class.mat-form-field-appearance-standard": "appearance == \"standard\"", "class.mat-form-field-appearance-fill": "appearance == \"fill\"", "class.mat-form-field-appearance-outline": "appearance == \"outline\"", "class.mat-form-field-appearance-detach": "appearance == \"detach\"", "class.mat-form-field-appearance-bound": "appearance == \"bound\"", "class.mat-form-field-appearance-legacy": "appearance == \"legacy\"", "class.mat-form-field-invalid": "_control.errorState", "class.mat-form-field-can-float": "_canLabelFloat()", "class.mat-form-field-should-float": "_shouldLabelFloat()", "class.mat-form-field-has-label": "_hasFloatingLabel()", "class.mat-form-field-hide-placeholder": "_hideControlPlaceholder()", "class.mat-form-field-disabled": "_control.disabled", "class.mat-form-field-autofilled": "_control.autofilled", "class.mat-focused": "_control.focused", "class.ng-untouched": "_shouldForward(\"untouched\")", "class.ng-touched": "_shouldForward(\"touched\")", "class.ng-pristine": "_shouldForward(\"pristine\")", "class.ng-dirty": "_shouldForward(\"dirty\")", "class.ng-valid": "_shouldForward(\"valid\")", "class.ng-invalid": "_shouldForward(\"invalid\")", "class.ng-pending": "_shouldForward(\"pending\")", "class._mat-animation-noopable": "!_animationsEnabled" }, classAttribute: "mat-form-field bui-form-field" }, providers: [{ provide: MAT_FORM_FIELD, useExisting: forwardRef(() => FormFieldComponent) }], exportAs: ["buiFormField"], usesInheritance: true, ngImport: i0, template: "<div class=\"mat-form-field-wrapper\">\n\t<div
|
|
55
|
+
FormFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: FormFieldComponent, selector: "bui-form-field", inputs: { color: "color" }, host: { listeners: { "click": "_hostClicked($event)" }, properties: { "class.mat-form-field-appearance-standard": "appearance == \"standard\"", "class.mat-form-field-appearance-fill": "appearance == \"fill\"", "class.mat-form-field-appearance-outline": "appearance == \"outline\"", "class.mat-form-field-appearance-detach": "appearance == \"detach\"", "class.mat-form-field-appearance-bound": "appearance == \"bound\"", "class.mat-form-field-appearance-legacy": "appearance == \"legacy\"", "class.mat-form-field-invalid": "_control.errorState", "class.mat-form-field-can-float": "_canLabelFloat()", "class.mat-form-field-should-float": "_shouldLabelFloat()", "class.mat-form-field-has-label": "_hasFloatingLabel()", "class.mat-form-field-hide-placeholder": "_hideControlPlaceholder()", "class.mat-form-field-disabled": "_control.disabled", "class.mat-form-field-autofilled": "_control.autofilled", "class.mat-focused": "_control.focused", "class.ng-untouched": "_shouldForward(\"untouched\")", "class.ng-touched": "_shouldForward(\"touched\")", "class.ng-pristine": "_shouldForward(\"pristine\")", "class.ng-dirty": "_shouldForward(\"dirty\")", "class.ng-valid": "_shouldForward(\"valid\")", "class.ng-invalid": "_shouldForward(\"invalid\")", "class.ng-pending": "_shouldForward(\"pending\")", "class._mat-animation-noopable": "!_animationsEnabled" }, classAttribute: "mat-form-field bui-form-field" }, providers: [{ provide: MAT_FORM_FIELD, useExisting: forwardRef(() => FormFieldComponent) }], exportAs: ["buiFormField"], usesInheritance: true, ngImport: i0, template: "<div class=\"mat-form-field-wrapper\">\n\t<div class=\"mat-form-field-flex {{ _borderClass() }}\" #connectionContainer>\n\t\t<!-- Outline used for outline appearance. -->\n\t\t<ng-container *ngIf=\"appearance == 'outline'\">\n\t\t\t<div class=\"mat-form-field-outline\">\n\t\t\t\t<div class=\"mat-form-field-outline-start\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-gap\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-end\"></div>\n\t\t\t</div>\n\t\t\t<div class=\"mat-form-field-outline mat-form-field-outline-thick\">\n\t\t\t\t<div class=\"mat-form-field-outline-start\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-gap\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-end\"></div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<div class=\"mat-form-field-prefix\" *ngIf=\"_prefixChildren.length\">\n\t\t\t<ng-content select=\"[matPrefix]\"></ng-content>\n\t\t</div>\n\n\t\t<div class=\"{{ _enhancedAppearance() ? 'bui-form-field-infix' : 'mat-form-field-infix' }}\" #inputContainer>\n\t\t\t<ng-content></ng-content>\n\n\t\t\t<span class=\"mat-form-field-label-wrapper\">\n\t\t\t\t<!-- We add aria-owns as a workaround for an issue in JAWS & NVDA where the label isn't\n\t\t\t read if it comes before the control in the DOM. -->\n\t\t\t\t<label\n\t\t\t\t\tclass=\"mat-form-field-label\"\n\t\t\t\t\t(cdkObserveContent)=\"updateOutlineGap()\"\n\t\t\t\t\t[cdkObserveContentDisabled]=\"appearance != 'outline'\"\n\t\t\t\t\t[id]=\"_labelId\"\n\t\t\t\t\t[attr.for]=\"_control.id\"\n\t\t\t\t\t[attr.aria-owns]=\"_control.id\"\n\t\t\t\t\t[class.mat-empty]=\"_control.empty && !_shouldAlwaysFloat()\"\n\t\t\t\t\t[class.mat-form-field-empty]=\"_control.empty && !_shouldAlwaysFloat()\"\n\t\t\t\t\t[class.mat-accent]=\"color == 'accent'\"\n\t\t\t\t\t[class.mat-warn]=\"color == 'warn'\"\n\t\t\t\t\t#label\n\t\t\t\t\t*ngIf=\"_hasFloatingLabel()\"\n\t\t\t\t\t[ngSwitch]=\"_hasLabel()\"\n\t\t\t\t>\n\t\t\t\t\t<!-- @breaking-change 8.0.0 remove in favor of mat-label element an placeholder attr. -->\n\t\t\t\t\t<ng-container *ngSwitchCase=\"false\">\n\t\t\t\t\t\t<ng-content select=\"mat-placeholder\"></ng-content>\n\t\t\t\t\t\t<span>{{ _control.placeholder }}</span>\n\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t<ng-content select=\"mat-label\" *ngSwitchCase=\"true\"></ng-content>\n\n\t\t\t\t\t<!-- @breaking-change 8.0.0 remove `mat-placeholder-required` class -->\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"mat-placeholder-required mat-form-field-required-marker\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t*ngIf=\"!hideRequiredMarker && _control.required && !_control.disabled\"\n\t\t\t\t\t\t> *</span\n\t\t\t\t\t>\n\t\t\t\t</label>\n\t\t\t</span>\n\t\t</div>\n\n\t\t<div class=\"mat-form-field-suffix\" *ngIf=\"_suffixChildren.length\">\n\t\t\t<ng-content select=\"[matSuffix]\"></ng-content>\n\t\t</div>\n\t\t<div *ngIf=\"_enhancedAppearance()\" class=\"bui-form-field-right-filler\"></div>\n\t</div>\n\n\t<!-- Underline used for legacy, standard, and box appearances. -->\n\t<div class=\"mat-form-field-underline\" #underline *ngIf=\"appearance != 'outline'\">\n\t\t<span\n\t\t\tclass=\"mat-form-field-ripple\"\n\t\t\t[class.mat-accent]=\"color == 'accent'\"\n\t\t\t[class.mat-warn]=\"color == 'warn'\"\n\t\t></span>\n\t</div>\n\n\t<div class=\"mat-form-field-subscript-wrapper\" [ngSwitch]=\"_getDisplayedMessages()\" (click)=\"$event.stopPropagation()\">\n\t\t<div *ngSwitchCase=\"'error'\" [@transitionMessages]=\"_subscriptAnimationState\">\n\t\t\t<ng-content select=\"mat-error\"></ng-content>\n\t\t</div>\n\n\t\t<div class=\"mat-form-field-hint-wrapper\" *ngSwitchCase=\"'hint'\" [@transitionMessages]=\"_subscriptAnimationState\">\n\t\t\t<!-- TODO(mmalerba): use an actual <mat-hint> once all selectors are switched to mat-* -->\n\t\t\t<div *ngIf=\"hintLabel\" [id]=\"_hintLabelId\" class=\"mat-hint\">{{ hintLabel }}</div>\n\t\t\t<ng-content select=\"mat-hint:not([align='end'])\"></ng-content>\n\t\t\t<div class=\"mat-form-field-hint-spacer\"></div>\n\t\t\t<ng-content select=\"mat-hint[align='end']\"></ng-content>\n\t\t</div>\n\t</div>\n</div>\n", styles: [".bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex{padding:.5em;align-items:center;border-radius:4px;border-style:solid}.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex:not(.bui-form-field-border-thick):not(:hover),.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex.bui-form-field-border-disabled{border-width:1px;margin:1px}.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex:not(.bui-form-field-border-thick):not(:hover) .bui-form-field-right-filler,.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex.bui-form-field-border-disabled .bui-form-field-right-filler{width:2px}.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex.bui-form-field-border-disabled{border-color:#80808033;border-style:dotted}.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex.bui-form-field-border-default{border-color:#80808066}.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex.bui-form-field-border-thick,.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex.bui-border-emphasis:hover{border-width:2px}.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex.bui-form-field-border-thick .bui-form-field-right-filler,.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex.bui-border-emphasis:hover .bui-form-field-right-filler{width:0}.bui-form-field.mat-form-field-appearance-detach,.bui-form-field.mat-form-field-appearance-bound{padding-top:.75em}.bui-form-field.mat-form-field-appearance-detach .mat-form-field-wrapper,.bui-form-field.mat-form-field-appearance-bound .mat-form-field-wrapper{padding-top:.5em}.bui-form-field.mat-form-field-appearance-detach .bui-form-field-infix,.bui-form-field.mat-form-field-appearance-bound .bui-form-field-infix{flex-grow:1}.bui-form-field.mat-form-field-appearance-detach .mat-form-field-label,.bui-form-field.mat-form-field-appearance-bound .mat-form-field-label{font-size:1.125em}.bui-form-field.mat-form-field-appearance-detach .mat-form-field-flex,.bui-form-field.mat-form-field-appearance-bound .mat-form-field-flex{align-items:center}.bui-form-field.mat-form-field-appearance-detach .mat-form-field-flex{padding:.125em 0;align-items:center}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2.CdkObserveContent, selector: "[cdkObserveContent]", inputs: ["cdkObserveContentDisabled", "debounce"], outputs: ["cdkObserveContent"], exportAs: ["cdkObserveContent"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], animations: [matFormFieldAnimations.transitionMessages], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
52
56
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
53
57
|
type: Component,
|
|
54
58
|
args: [{
|
|
@@ -87,7 +91,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImpor
|
|
|
87
91
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
88
92
|
providers: [{ provide: MAT_FORM_FIELD, useExisting: forwardRef(() => FormFieldComponent) }]
|
|
89
93
|
}]
|
|
90
|
-
}]
|
|
94
|
+
}], propDecorators: { _hostClicked: [{
|
|
95
|
+
type: HostListener,
|
|
96
|
+
args: ['click', ['$event']]
|
|
97
|
+
}] } });
|
|
91
98
|
FormFieldComponent.ɵcmp.styles.push(MatFormField.ɵcmp.styles);
|
|
92
99
|
|
|
93
100
|
class FormFieldModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bravura-ui-form-field.js","sources":["../../../projects/ui/form-field/form-field.component.ts","../../../projects/ui/form-field/form-field.component.html","../../../projects/ui/form-field/form-field.module.ts","../../../projects/ui/form-field/bravura-ui-form-field.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, forwardRef, ViewEncapsulation } from '@angular/core';\r\nimport { MatFormField, matFormFieldAnimations, MAT_FORM_FIELD } from '@angular/material/form-field';\r\n\r\n/**\r\n * Container for form controls that applies Material Design styling and behavior.\r\n *\r\n * This component extends Angular Material's [mat-form-field](https://material.angular.io/components/form-field) and provides two additional appearances\r\n * `bound` and `detach`. `bound` renders the label outside the outlined area of the field, while `detach` remove the borders all together. `detach`\r\n * is generally used with form controls that render their own borders.\r\n */\r\n@Component({\r\n\tselector: 'bui-form-field',\r\n\texportAs: 'buiFormField',\r\n\ttemplateUrl: 'form-field.component.html',\r\n\tstyleUrls: ['./form-field.component.scss'],\r\n\tanimations: [matFormFieldAnimations.transitionMessages],\r\n\thost: {\r\n\t\tclass: 'mat-form-field bui-form-field',\r\n\t\t'[class.mat-form-field-appearance-standard]': 'appearance == \"standard\"',\r\n\t\t'[class.mat-form-field-appearance-fill]': 'appearance == \"fill\"',\r\n\t\t'[class.mat-form-field-appearance-outline]': 'appearance == \"outline\"',\r\n\t\t'[class.mat-form-field-appearance-detach]': 'appearance == \"detach\"',\r\n\t\t'[class.mat-form-field-appearance-bound]': 'appearance == \"bound\"',\r\n\t\t'[class.mat-form-field-appearance-legacy]': 'appearance == \"legacy\"',\r\n\t\t'[class.mat-form-field-invalid]': '_control.errorState',\r\n\t\t'[class.mat-form-field-can-float]': '_canLabelFloat()',\r\n\t\t'[class.mat-form-field-should-float]': '_shouldLabelFloat()',\r\n\t\t'[class.mat-form-field-has-label]': '_hasFloatingLabel()',\r\n\t\t'[class.mat-form-field-hide-placeholder]': '_hideControlPlaceholder()',\r\n\t\t'[class.mat-form-field-disabled]': '_control.disabled',\r\n\t\t'[class.mat-form-field-autofilled]': '_control.autofilled',\r\n\t\t'[class.mat-focused]': '_control.focused',\r\n\t\t'[class.ng-untouched]': '_shouldForward(\"untouched\")',\r\n\t\t'[class.ng-touched]': '_shouldForward(\"touched\")',\r\n\t\t'[class.ng-pristine]': '_shouldForward(\"pristine\")',\r\n\t\t'[class.ng-dirty]': '_shouldForward(\"dirty\")',\r\n\t\t'[class.ng-valid]': '_shouldForward(\"valid\")',\r\n\t\t'[class.ng-invalid]': '_shouldForward(\"invalid\")',\r\n\t\t'[class.ng-pending]': '_shouldForward(\"pending\")',\r\n\t\t'[class._mat-animation-noopable]': '!_animationsEnabled'\r\n\t},\r\n\tinputs: ['color'],\r\n\tencapsulation: ViewEncapsulation.None,\r\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\r\n\tproviders: [{ provide: MAT_FORM_FIELD, useExisting: forwardRef(() => FormFieldComponent) }]\r\n})\r\nexport class FormFieldComponent extends MatFormField {\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\t_shouldAlwaysFloat(): boolean {\r\n\t\treturn super._shouldAlwaysFloat() || this._enhancedAppearance();\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\t_borderClass(): string {\r\n\t\tif ((this.appearance as any) !== 'bound') {\r\n\t\t\treturn 'bui-form-field-flex-default';\r\n\t\t}\r\n\t\tif (this._control.disabled) {\r\n\t\t\treturn 'bui-form-field-border-disabled';\r\n\t\t} else if (this._control.errorState) {\r\n\t\t\treturn 'bui-border-warn bui-form-field-border-thick';\r\n\t\t} else if (this._control.focused) {\r\n\t\t\treturn `bui-border-${this.color || 'primary'} bui-form-field-border-thick`;\r\n\t\t} else {\r\n\t\t\treturn 'bui-form-field-border-default bui-border-emphasis';\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\t_enhancedAppearance() {\r\n\t\treturn (this.appearance as any) === 'detach' || (this.appearance as any) === 'bound';\r\n\t}\r\n}\r\n\r\n(FormFieldComponent as any).ɵcmp.styles.push((MatFormField as any).ɵcmp.styles);\r\n","<div class=\"mat-form-field-wrapper\">\n\t<div\n\t\tclass=\"mat-form-field-flex {{ _borderClass() }}\"\n\t\t#connectionContainer\n\t\t(click)=\"_control.onContainerClick && _control.onContainerClick($event)\"\n\t>\n\t\t<!-- Outline used for outline appearance. -->\n\t\t<ng-container *ngIf=\"appearance == 'outline'\">\n\t\t\t<div class=\"mat-form-field-outline\">\n\t\t\t\t<div class=\"mat-form-field-outline-start\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-gap\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-end\"></div>\n\t\t\t</div>\n\t\t\t<div class=\"mat-form-field-outline mat-form-field-outline-thick\">\n\t\t\t\t<div class=\"mat-form-field-outline-start\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-gap\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-end\"></div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<div class=\"mat-form-field-prefix\" *ngIf=\"_prefixChildren.length\">\n\t\t\t<ng-content select=\"[matPrefix]\"></ng-content>\n\t\t</div>\n\n\t\t<div class=\"{{ _enhancedAppearance() ? 'bui-form-field-infix' : 'mat-form-field-infix' }}\" #inputContainer>\n\t\t\t<ng-content></ng-content>\n\n\t\t\t<span class=\"mat-form-field-label-wrapper\">\n\t\t\t\t<!-- We add aria-owns as a workaround for an issue in JAWS & NVDA where the label isn't\n\t\t\t read if it comes before the control in the DOM. -->\n\t\t\t\t<label\n\t\t\t\t\tclass=\"mat-form-field-label\"\n\t\t\t\t\t(cdkObserveContent)=\"updateOutlineGap()\"\n\t\t\t\t\t[cdkObserveContentDisabled]=\"appearance != 'outline'\"\n\t\t\t\t\t[id]=\"_labelId\"\n\t\t\t\t\t[attr.for]=\"_control.id\"\n\t\t\t\t\t[attr.aria-owns]=\"_control.id\"\n\t\t\t\t\t[class.mat-empty]=\"_control.empty && !_shouldAlwaysFloat()\"\n\t\t\t\t\t[class.mat-form-field-empty]=\"_control.empty && !_shouldAlwaysFloat()\"\n\t\t\t\t\t[class.mat-accent]=\"color == 'accent'\"\n\t\t\t\t\t[class.mat-warn]=\"color == 'warn'\"\n\t\t\t\t\t#label\n\t\t\t\t\t*ngIf=\"_hasFloatingLabel()\"\n\t\t\t\t\t[ngSwitch]=\"_hasLabel()\"\n\t\t\t\t>\n\t\t\t\t\t<!-- @breaking-change 8.0.0 remove in favor of mat-label element an placeholder attr. -->\n\t\t\t\t\t<ng-container *ngSwitchCase=\"false\">\n\t\t\t\t\t\t<ng-content select=\"mat-placeholder\"></ng-content>\n\t\t\t\t\t\t<span>{{ _control.placeholder }}</span>\n\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t<ng-content select=\"mat-label\" *ngSwitchCase=\"true\"></ng-content>\n\n\t\t\t\t\t<!-- @breaking-change 8.0.0 remove `mat-placeholder-required` class -->\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"mat-placeholder-required mat-form-field-required-marker\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t*ngIf=\"!hideRequiredMarker && _control.required && !_control.disabled\"\n\t\t\t\t\t\t> *</span\n\t\t\t\t\t>\n\t\t\t\t</label>\n\t\t\t</span>\n\t\t</div>\n\n\t\t<div class=\"mat-form-field-suffix\" *ngIf=\"_suffixChildren.length\">\n\t\t\t<ng-content select=\"[matSuffix]\"></ng-content>\n\t\t</div>\n\t\t<div *ngIf=\"_enhancedAppearance()\" class=\"bui-form-field-right-filler\"></div>\n\t</div>\n\n\t<!-- Underline used for legacy, standard, and box appearances. -->\n\t<div class=\"mat-form-field-underline\" #underline *ngIf=\"appearance != 'outline'\">\n\t\t<span\n\t\t\tclass=\"mat-form-field-ripple\"\n\t\t\t[class.mat-accent]=\"color == 'accent'\"\n\t\t\t[class.mat-warn]=\"color == 'warn'\"\n\t\t></span>\n\t</div>\n\n\t<div class=\"mat-form-field-subscript-wrapper\" [ngSwitch]=\"_getDisplayedMessages()\">\n\t\t<div *ngSwitchCase=\"'error'\" [@transitionMessages]=\"_subscriptAnimationState\">\n\t\t\t<ng-content select=\"mat-error\"></ng-content>\n\t\t</div>\n\n\t\t<div class=\"mat-form-field-hint-wrapper\" *ngSwitchCase=\"'hint'\" [@transitionMessages]=\"_subscriptAnimationState\">\n\t\t\t<!-- TODO(mmalerba): use an actual <mat-hint> once all selectors are switched to mat-* -->\n\t\t\t<div *ngIf=\"hintLabel\" [id]=\"_hintLabelId\" class=\"mat-hint\">{{ hintLabel }}</div>\n\t\t\t<ng-content select=\"mat-hint:not([align='end'])\"></ng-content>\n\t\t\t<div class=\"mat-form-field-hint-spacer\"></div>\n\t\t\t<ng-content select=\"mat-hint[align='end']\"></ng-content>\n\t\t</div>\n\t</div>\n</div>\n","import { ObserversModule } from '@angular/cdk/observers';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormFieldComponent } from './form-field.component';\n\n@NgModule({\n\tdeclarations: [FormFieldComponent],\n\timports: [CommonModule, MatFormFieldModule, ObserversModule],\n\texports: [FormFieldComponent, MatFormFieldModule]\n})\nexport class FormFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;;;;;MA2Ca,kBAAmB,SAAQ,YAAY;;;;IAInD,kBAAkB;QACjB,OAAO,KAAK,CAAC,kBAAkB,EAAE,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAChE;;;;IAKD,YAAY;QACX,IAAK,IAAI,CAAC,UAAkB,KAAK,OAAO,EAAE;YACzC,OAAO,6BAA6B,CAAC;SACrC;QACD,IA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BACtE,iCAAiC,EAAE,mBAAmB;wBACtD,mCAAmC,EAAE,qBAAqB;wBAC1D,qBAAqB,EAAE,kBAAkB;wBACzC,sBAAsB,EAAE,6BAA6B;wBACrD,oBAAoB,EAAE,2BAA2B;wBACjD,qBAAqB,EAAE,4BAA4B;wBACnD,kBAAkB,EAAE,yBAAyB;wBAC7C,kBAAkB,EAAE,yBAAyB;wBAC7C,oBAAoB,EAAE,2BAA2B;wBACjD,oBAAoB,EAAE,2BAA2B;wBACjD,iCAAiC,EAAE,qBAAqB;qBACxD;oBACD,MAAM,EAAE,CAAC,OAAO,CAAC;oBACjB,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,CAAC,wBAAwB,CAAC,EAAE,CAAC;iBAC3F;;AAmCA,kBAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,YAAoB,CAAC,IAAI,CAAC,MAAM,CAAC;;MErElE,eAAe;;4GAAf,eAAe;6GAAf,eAAe,iBAJZ,kBAAkB,aACvB,YAAY,EAAE,kBAAkB,EAAE,eAAe,aACjD,kBAAkB,EAAE,kBAAkB;6GAEpC,eAAe,YAHlB,CAAC,YAAY,EAAE,kBAAkB,EAAE,eAAe,CAAC,EAC9B,kBAAkB;2FAEpC,eAAe;kBAL3B,QAAQ;mBAAC;oBACT,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,eAAe,CAAC;oBAC5D,OAAO,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;iBACjD;;;ACVD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"bravura-ui-form-field.js","sources":["../../../projects/ui/form-field/form-field.component.ts","../../../projects/ui/form-field/form-field.component.html","../../../projects/ui/form-field/form-field.module.ts","../../../projects/ui/form-field/bravura-ui-form-field.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, forwardRef, HostListener, ViewEncapsulation } from '@angular/core';\nimport { MatFormField, matFormFieldAnimations, MAT_FORM_FIELD } from '@angular/material/form-field';\n\n/**\n * Container for form controls that applies Material Design styling and behavior.\n *\n * This component extends Angular Material's [mat-form-field](https://material.angular.io/components/form-field) and provides two additional appearances\n * `bound` and `detach`. `bound` renders the label outside the outlined area of the field, while `detach` remove the borders all together. `detach`\n * is generally used with form controls that render their own borders.\n */\n@Component({\n\tselector: 'bui-form-field',\n\texportAs: 'buiFormField',\n\ttemplateUrl: 'form-field.component.html',\n\tstyleUrls: ['./form-field.component.scss'],\n\tanimations: [matFormFieldAnimations.transitionMessages],\n\thost: {\n\t\tclass: 'mat-form-field bui-form-field',\n\t\t'[class.mat-form-field-appearance-standard]': 'appearance == \"standard\"',\n\t\t'[class.mat-form-field-appearance-fill]': 'appearance == \"fill\"',\n\t\t'[class.mat-form-field-appearance-outline]': 'appearance == \"outline\"',\n\t\t'[class.mat-form-field-appearance-detach]': 'appearance == \"detach\"',\n\t\t'[class.mat-form-field-appearance-bound]': 'appearance == \"bound\"',\n\t\t'[class.mat-form-field-appearance-legacy]': 'appearance == \"legacy\"',\n\t\t'[class.mat-form-field-invalid]': '_control.errorState',\n\t\t'[class.mat-form-field-can-float]': '_canLabelFloat()',\n\t\t'[class.mat-form-field-should-float]': '_shouldLabelFloat()',\n\t\t'[class.mat-form-field-has-label]': '_hasFloatingLabel()',\n\t\t'[class.mat-form-field-hide-placeholder]': '_hideControlPlaceholder()',\n\t\t'[class.mat-form-field-disabled]': '_control.disabled',\n\t\t'[class.mat-form-field-autofilled]': '_control.autofilled',\n\t\t'[class.mat-focused]': '_control.focused',\n\t\t'[class.ng-untouched]': '_shouldForward(\"untouched\")',\n\t\t'[class.ng-touched]': '_shouldForward(\"touched\")',\n\t\t'[class.ng-pristine]': '_shouldForward(\"pristine\")',\n\t\t'[class.ng-dirty]': '_shouldForward(\"dirty\")',\n\t\t'[class.ng-valid]': '_shouldForward(\"valid\")',\n\t\t'[class.ng-invalid]': '_shouldForward(\"invalid\")',\n\t\t'[class.ng-pending]': '_shouldForward(\"pending\")',\n\t\t'[class._mat-animation-noopable]': '!_animationsEnabled'\n\t},\n\tinputs: ['color'],\n\tencapsulation: ViewEncapsulation.None,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tproviders: [{ provide: MAT_FORM_FIELD, useExisting: forwardRef(() => FormFieldComponent) }]\n})\nexport class FormFieldComponent extends MatFormField {\n\t/**\n\t * @ignore\n\t */\n\t_shouldAlwaysFloat(): boolean {\n\t\treturn super._shouldAlwaysFloat() || this._enhancedAppearance();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\t_borderClass(): string {\n\t\tif ((this.appearance as any) !== 'bound') {\n\t\t\treturn 'bui-form-field-flex-default';\n\t\t}\n\t\tif (this._control.disabled) {\n\t\t\treturn 'bui-form-field-border-disabled';\n\t\t} else if (this._control.errorState) {\n\t\t\treturn 'bui-border-warn bui-form-field-border-thick';\n\t\t} else if (this._control.focused) {\n\t\t\treturn `bui-border-${this.color || 'primary'} bui-form-field-border-thick`;\n\t\t} else {\n\t\t\treturn 'bui-form-field-border-default bui-border-emphasis';\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\t_enhancedAppearance() {\n\t\treturn (this.appearance as any) === 'detach' || (this.appearance as any) === 'bound';\n\t}\n\n\t/** @ignore */\n\t@HostListener('click', ['$event'])\n\t_hostClicked(event: MouseEvent) {\n\t\tthis._control.onContainerClick && this._control.onContainerClick(event);\n\t}\n}\n\n(FormFieldComponent as any).ɵcmp.styles.push((MatFormField as any).ɵcmp.styles);\n","<div class=\"mat-form-field-wrapper\">\n\t<div class=\"mat-form-field-flex {{ _borderClass() }}\" #connectionContainer>\n\t\t<!-- Outline used for outline appearance. -->\n\t\t<ng-container *ngIf=\"appearance == 'outline'\">\n\t\t\t<div class=\"mat-form-field-outline\">\n\t\t\t\t<div class=\"mat-form-field-outline-start\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-gap\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-end\"></div>\n\t\t\t</div>\n\t\t\t<div class=\"mat-form-field-outline mat-form-field-outline-thick\">\n\t\t\t\t<div class=\"mat-form-field-outline-start\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-gap\"></div>\n\t\t\t\t<div class=\"mat-form-field-outline-end\"></div>\n\t\t\t</div>\n\t\t</ng-container>\n\n\t\t<div class=\"mat-form-field-prefix\" *ngIf=\"_prefixChildren.length\">\n\t\t\t<ng-content select=\"[matPrefix]\"></ng-content>\n\t\t</div>\n\n\t\t<div class=\"{{ _enhancedAppearance() ? 'bui-form-field-infix' : 'mat-form-field-infix' }}\" #inputContainer>\n\t\t\t<ng-content></ng-content>\n\n\t\t\t<span class=\"mat-form-field-label-wrapper\">\n\t\t\t\t<!-- We add aria-owns as a workaround for an issue in JAWS & NVDA where the label isn't\n\t\t\t read if it comes before the control in the DOM. -->\n\t\t\t\t<label\n\t\t\t\t\tclass=\"mat-form-field-label\"\n\t\t\t\t\t(cdkObserveContent)=\"updateOutlineGap()\"\n\t\t\t\t\t[cdkObserveContentDisabled]=\"appearance != 'outline'\"\n\t\t\t\t\t[id]=\"_labelId\"\n\t\t\t\t\t[attr.for]=\"_control.id\"\n\t\t\t\t\t[attr.aria-owns]=\"_control.id\"\n\t\t\t\t\t[class.mat-empty]=\"_control.empty && !_shouldAlwaysFloat()\"\n\t\t\t\t\t[class.mat-form-field-empty]=\"_control.empty && !_shouldAlwaysFloat()\"\n\t\t\t\t\t[class.mat-accent]=\"color == 'accent'\"\n\t\t\t\t\t[class.mat-warn]=\"color == 'warn'\"\n\t\t\t\t\t#label\n\t\t\t\t\t*ngIf=\"_hasFloatingLabel()\"\n\t\t\t\t\t[ngSwitch]=\"_hasLabel()\"\n\t\t\t\t>\n\t\t\t\t\t<!-- @breaking-change 8.0.0 remove in favor of mat-label element an placeholder attr. -->\n\t\t\t\t\t<ng-container *ngSwitchCase=\"false\">\n\t\t\t\t\t\t<ng-content select=\"mat-placeholder\"></ng-content>\n\t\t\t\t\t\t<span>{{ _control.placeholder }}</span>\n\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t<ng-content select=\"mat-label\" *ngSwitchCase=\"true\"></ng-content>\n\n\t\t\t\t\t<!-- @breaking-change 8.0.0 remove `mat-placeholder-required` class -->\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"mat-placeholder-required mat-form-field-required-marker\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t*ngIf=\"!hideRequiredMarker && _control.required && !_control.disabled\"\n\t\t\t\t\t\t> *</span\n\t\t\t\t\t>\n\t\t\t\t</label>\n\t\t\t</span>\n\t\t</div>\n\n\t\t<div class=\"mat-form-field-suffix\" *ngIf=\"_suffixChildren.length\">\n\t\t\t<ng-content select=\"[matSuffix]\"></ng-content>\n\t\t</div>\n\t\t<div *ngIf=\"_enhancedAppearance()\" class=\"bui-form-field-right-filler\"></div>\n\t</div>\n\n\t<!-- Underline used for legacy, standard, and box appearances. -->\n\t<div class=\"mat-form-field-underline\" #underline *ngIf=\"appearance != 'outline'\">\n\t\t<span\n\t\t\tclass=\"mat-form-field-ripple\"\n\t\t\t[class.mat-accent]=\"color == 'accent'\"\n\t\t\t[class.mat-warn]=\"color == 'warn'\"\n\t\t></span>\n\t</div>\n\n\t<div class=\"mat-form-field-subscript-wrapper\" [ngSwitch]=\"_getDisplayedMessages()\" (click)=\"$event.stopPropagation()\">\n\t\t<div *ngSwitchCase=\"'error'\" [@transitionMessages]=\"_subscriptAnimationState\">\n\t\t\t<ng-content select=\"mat-error\"></ng-content>\n\t\t</div>\n\n\t\t<div class=\"mat-form-field-hint-wrapper\" *ngSwitchCase=\"'hint'\" [@transitionMessages]=\"_subscriptAnimationState\">\n\t\t\t<!-- TODO(mmalerba): use an actual <mat-hint> once all selectors are switched to mat-* -->\n\t\t\t<div *ngIf=\"hintLabel\" [id]=\"_hintLabelId\" class=\"mat-hint\">{{ hintLabel }}</div>\n\t\t\t<ng-content select=\"mat-hint:not([align='end'])\"></ng-content>\n\t\t\t<div class=\"mat-form-field-hint-spacer\"></div>\n\t\t\t<ng-content select=\"mat-hint[align='end']\"></ng-content>\n\t\t</div>\n\t</div>\n</div>\n","import { ObserversModule } from '@angular/cdk/observers';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormFieldComponent } from './form-field.component';\n\n@NgModule({\n\tdeclarations: [FormFieldComponent],\n\timports: [CommonModule, MatFormFieldModule, ObserversModule],\n\texports: [FormFieldComponent, MatFormFieldModule]\n})\nexport class FormFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;;;;;MA2Ca,kBAAmB,SAAQ,YAAY;;;;IAInD,kBAAkB;QACjB,OAAO,KAAK,CAAC,kBAAkB,EAAE,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAChE;;;;IAKD,YAAY;QACX,IAAK,IAAI,CAAC,UAAkB,KAAK,OAAO,EAAE;YACzC,OAAO,6BAA6B,CAAC;SACrC;QACD,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YAC3B,OAAO,gCAAgC,CAAC;SACxC;aAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;YACpC,OAAO,6CAA6C,CAAC;SACrD;aAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;YACjC,OAAO,cAAc,IAAI,CAAC,KAAK,IAAI,SAAS,8BAA8B,CAAC;SAC3E;aAAM;YACN,OAAO,mDAAmD,CAAC;SAC3D;KACD;;;;IAKD,mBAAmB;QAClB,OAAQ,IAAI,CAAC,UAAkB,KAAK,QAAQ,IAAK,IAAI,CAAC,UAAkB,KAAK,OAAO,CAAC;KACrF;;IAID,YAAY,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CAAiC,EAAE,qBAAqB;qBACxD;oBACD,MAAM,EAAE,CAAC,OAAO,CAAC;oBACjB,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,CAAC,wBAAwB,CAAC,EAAE,CAAC;iBAC3F;8BAoCA,YAAY;sBADX,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;AAMjC,kBAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,YAAoB,CAAC,IAAI,CAAC,MAAM,CAAC;;ME3ElE,eAAe;;4GAAf,eAAe;6GAAf,eAAe,iBAJZ,kBAAkB,aACvB,YAAY,EAAE,kBAAkB,EAAE,eAAe,aACjD,kBAAkB,EAAE,kBAAkB;6GAEpC,eAAe,YAHlB,CAAC,YAAY,EAAE,kBAAkB,EAAE,eAAe,CAAC,EAC9B,kBAAkB;2FAEpC,eAAe;kBAL3B,QAAQ;mBAAC;oBACT,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,eAAe,CAAC;oBAC5D,OAAO,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;iBACjD;;;ACVD;;;;;;"}
|
|
@@ -92,16 +92,22 @@ class RadioPanelDirective extends MatRadioGroup {
|
|
|
92
92
|
constructor(cd) {
|
|
93
93
|
super(cd);
|
|
94
94
|
}
|
|
95
|
+
/** @ignore */
|
|
96
|
+
ngOnChanges(changes) {
|
|
97
|
+
if (changes.color && this._radios) {
|
|
98
|
+
this._radios.forEach(item => item._markForCheck());
|
|
99
|
+
}
|
|
100
|
+
}
|
|
95
101
|
}
|
|
96
102
|
RadioPanelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: RadioPanelDirective, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
97
|
-
RadioPanelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.4", type: RadioPanelDirective, selector: "bui-radio-panel", host: { attributes: { "role": "radiogroup" }, classAttribute: "bui-radio-panel" }, providers: [
|
|
103
|
+
RadioPanelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.4", type: RadioPanelDirective, selector: "bui-radio-panel", inputs: { color: "color" }, host: { attributes: { "role": "radiogroup" }, classAttribute: "bui-radio-panel" }, providers: [
|
|
98
104
|
{
|
|
99
105
|
provide: NG_VALUE_ACCESSOR,
|
|
100
106
|
useExisting: forwardRef(() => RadioPanelDirective),
|
|
101
107
|
multi: true
|
|
102
108
|
},
|
|
103
109
|
{ provide: MAT_RADIO_GROUP, useExisting: forwardRef(() => RadioPanelDirective) }
|
|
104
|
-
], queries: [{ propertyName: "_radios", predicate: RadioPanelItemComponent, descendants: true }], exportAs: ["buiRadioPanel"], usesInheritance: true, ngImport: i0 });
|
|
110
|
+
], queries: [{ propertyName: "_radios", predicate: RadioPanelItemComponent, descendants: true }], exportAs: ["buiRadioPanel"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
105
111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: RadioPanelDirective, decorators: [{
|
|
106
112
|
type: Directive,
|
|
107
113
|
args: [{
|
|
@@ -122,7 +128,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImpor
|
|
|
122
128
|
class: 'bui-radio-panel'
|
|
123
129
|
}
|
|
124
130
|
}]
|
|
125
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: {
|
|
131
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { color: [{
|
|
132
|
+
type: Input
|
|
133
|
+
}], _radios: [{
|
|
126
134
|
type: ContentChildren,
|
|
127
135
|
args: [RadioPanelItemComponent, { descendants: true }]
|
|
128
136
|
}] } });
|