6 lines
1.2 KiB
JavaScript
6 lines
1.2 KiB
JavaScript
"use strict";const s=require("./class-map-DV5418hw.js"),l=require("./element-internals-OOm6rgx-.js");/**
|
|
* @license
|
|
* Copyright 2023 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/const a=Symbol("getFormValue"),n=Symbol("getFormState");function d(o){class r extends o{get form(){return this[l.internals].form}get labels(){return this[l.internals].labels}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}attributeChangedCallback(e,t,i){if(e==="name"||e==="disabled"){const u=e==="disabled"?t!==null:t;this.requestUpdate(e,u);return}super.attributeChangedCallback(e,t,i)}requestUpdate(e,t,i){super.requestUpdate(e,t,i),this[l.internals].setFormValue(this[a](),this[n]())}[a](){throw new Error("Implement [getFormValue]")}[n](){return this[a]()}formDisabledCallback(e){this.disabled=e}}return r.formAssociated=!0,s.__decorate([s.n({noAccessor:!0})],r.prototype,"name",null),s.__decorate([s.n({type:Boolean,noAccessor:!0})],r.prototype,"disabled",null),r}exports.getFormState=n;exports.getFormValue=a;exports.mixinFormAssociated=d;
|