1/*! 2 * pivot v1.2.0 3 * FCSA Pivot Design System 4 * https://careers.fcsamerica.com/ 5 */ 6/** 7 * 8 */ 9class FormAssociationController { 10 constructor(host) { 11 this.nativeErrorText = null; 12 this.handleInvalid = (event) => { 13 event.preventDefault(); // stops native bubble validation message 14 this.nativeErrorText = this.internals.validationMessage; 15 this.host.requestUpdate(); 16 }; 17 this.host = host; 18 this.internals = host.attachInternals(); 19 host.addController(this); 20 } 21 hostConnected() { 22 this.host.addEventListener("invalid", this.handleInvalid); 23 } 24 hostDisconnected() { 25 this.host.removeEventListener("invalid", this.handleInvalid); 26 } 27 setValidity(flags, message, anchor) { 28 this.internals.setValidity(flags, message, anchor); 29 // Clear error message as soon as the field becomes valid again 30 if (this.internals.validity.valid && this.nativeErrorText) { 31 this.nativeErrorText = null; 32 this.internals.states.delete("invalid"); 33 this.host.requestUpdate(); 34 } 35 } 36 checkValidity() { 37 return this.internals.checkValidity(); 38 } 39 reportValidity() { 40 return this.internals.reportValidity(); 41 } 42 formDisabledCallback(disabled) { 43 this.host.toggleAttribute("pivot-disabled", disabled); 44 } 45 get validity() { 46 return this.internals.validity; 47 } 48 get validationMessage() { 49 return this.internals.validationMessage; 50 } 51 get willValidate() { 52 return this.internals.willValidate; 53 } 54 setFormValue(value) { 55 this.internals.setFormValue(value); 56 } 57} 58 59export { FormAssociationController }; 60//# sourceMappingURL=form-association-controller.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.