@substrate-system/button 0.0.17 → 0.0.20
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/README.md +69 -31
- package/dist/client.cjs +163 -0
- package/dist/client.cjs.map +7 -0
- package/dist/client.d.ts +58 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +144 -0
- package/dist/client.js.map +7 -0
- package/dist/client.min.js +2 -0
- package/dist/client.min.js.map +7 -0
- package/dist/html.cjs +49 -0
- package/dist/html.cjs.map +7 -0
- package/dist/html.d.ts +9 -0
- package/dist/html.d.ts.map +1 -0
- package/dist/html.js +30 -0
- package/dist/html.js.map +7 -0
- package/dist/html.min.js +4 -0
- package/dist/html.min.js.map +7 -0
- package/dist/index.cjs +20 -136
- package/dist/index.cjs.map +3 -3
- package/dist/index.css +1 -2
- package/dist/index.d.ts +3 -51
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -136
- package/dist/index.js.map +2 -2
- package/dist/index.min.css +2 -2
- package/dist/index.min.js +3 -1
- package/dist/index.min.js.map +4 -4
- package/dist/meta.json +64 -5
- package/package.json +6 -1
package/dist/html.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type Attrs = {
|
|
2
|
+
type: string | null;
|
|
3
|
+
autofocus: boolean;
|
|
4
|
+
tabindex: string | number;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
classes: string[] | Set<string>;
|
|
7
|
+
};
|
|
8
|
+
export declare function html(attrs: Partial<Attrs>, textContent: string): string;
|
|
9
|
+
//# sourceMappingURL=html.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../src/html.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAChB,IAAI,EAAC,MAAM,GAAC,IAAI,CAAC;IACjB,SAAS,EAAC,OAAO,CAAC;IAClB,QAAQ,EAAC,MAAM,GAAC,MAAM,CAAC;IACvB,QAAQ,EAAC,OAAO,CAAC;IACjB,OAAO,EAAC,MAAM,EAAE,GAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CAChC,CAAA;AACD,wBAAgB,IAAI,CAAE,KAAK,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE,WAAW,EAAC,MAAM,UAyB7D"}
|
package/dist/html.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
function html(attrs, textContent) {
|
|
4
|
+
const {
|
|
5
|
+
type,
|
|
6
|
+
autofocus,
|
|
7
|
+
tabindex,
|
|
8
|
+
disabled,
|
|
9
|
+
classes
|
|
10
|
+
} = attrs;
|
|
11
|
+
const _classes = new Set(classes);
|
|
12
|
+
_classes.add("substrate-button");
|
|
13
|
+
const arr = Array.from(_classes);
|
|
14
|
+
const btnProps = [
|
|
15
|
+
arr.length ? `class="${arr.filter(Boolean).join(" ")}"` : "",
|
|
16
|
+
disabled ? "disabled" : "",
|
|
17
|
+
autofocus ? "autofocus" : "",
|
|
18
|
+
type ? `type="${type}"` : "",
|
|
19
|
+
tabindex ? `tabindex="${tabindex}"` : 'tabindex="0"',
|
|
20
|
+
'role="button"'
|
|
21
|
+
].filter(Boolean).join(" ");
|
|
22
|
+
return `<button ${btnProps}>
|
|
23
|
+
${textContent}
|
|
24
|
+
</button>`;
|
|
25
|
+
}
|
|
26
|
+
__name(html, "html");
|
|
27
|
+
export {
|
|
28
|
+
html
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=html.js.map
|
package/dist/html.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/html.ts"],
|
|
4
|
+
"sourcesContent": ["export type Attrs = {\n type:string|null;\n autofocus:boolean;\n tabindex:string|number;\n disabled:boolean;\n classes:string[]|Set<string>;\n}\nexport function html (attrs:Partial<Attrs>, textContent:string) {\n const {\n type,\n autofocus,\n tabindex,\n disabled,\n classes\n } = attrs\n\n const _classes = new Set(classes)\n _classes.add('substrate-button')\n const arr = Array.from(_classes)\n\n const btnProps = ([\n arr.length ? `class=\"${arr.filter(Boolean).join(' ')}\"` : '',\n disabled ? 'disabled' : '',\n autofocus ? 'autofocus' : '',\n type ? `type=\"${type}\"` : '',\n tabindex ? `tabindex=\"${tabindex}\"` : 'tabindex=\"0\"',\n 'role=\"button\"'\n ]).filter(Boolean).join(' ')\n\n return `<button ${btnProps}>\n ${textContent}\n </button>`\n}\n"],
|
|
5
|
+
"mappings": ";;AAOO,SAAS,KAAM,OAAsB,aAAoB;AAC5D,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,IAAI;AAEJ,QAAM,WAAW,IAAI,IAAI,OAAO;AAChC,WAAS,IAAI,kBAAkB;AAC/B,QAAM,MAAM,MAAM,KAAK,QAAQ;AAE/B,QAAM,WAAY;AAAA,IACd,IAAI,SAAS,UAAU,IAAI,OAAO,OAAO,EAAE,KAAK,GAAG,CAAC,MAAM;AAAA,IAC1D,WAAW,aAAa;AAAA,IACxB,YAAY,cAAc;AAAA,IAC1B,OAAO,SAAS,IAAI,MAAM;AAAA,IAC1B,WAAW,aAAa,QAAQ,MAAM;AAAA,IACtC;AAAA,EACJ,EAAG,OAAO,OAAO,EAAE,KAAK,GAAG;AAE3B,SAAO,WAAW,QAAQ;AAAA,UACpB,WAAW;AAAA;AAErB;AAzBgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/html.min.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var u=Object.defineProperty;var r=(t,n)=>u(t,"name",{value:n,configurable:!0});function p(t,n){let{type:s,autofocus:l,tabindex:o,disabled:i,classes:b}=t,e=new Set(b);e.add("substrate-button");let a=Array.from(e);return`<button ${[a.length?`class="${a.filter(Boolean).join(" ")}"`:"",i?"disabled":"",l?"autofocus":"",s?`type="${s}"`:"",o?`tabindex="${o}"`:'tabindex="0"','role="button"'].filter(Boolean).join(" ")}>
|
|
2
|
+
${n}
|
|
3
|
+
</button>`}r(p,"html");export{p as html};
|
|
4
|
+
//# sourceMappingURL=html.min.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/html.ts"],
|
|
4
|
+
"sourcesContent": ["export type Attrs = {\n type:string|null;\n autofocus:boolean;\n tabindex:string|number;\n disabled:boolean;\n classes:string[]|Set<string>;\n}\nexport function html (attrs:Partial<Attrs>, textContent:string) {\n const {\n type,\n autofocus,\n tabindex,\n disabled,\n classes\n } = attrs\n\n const _classes = new Set(classes)\n _classes.add('substrate-button')\n const arr = Array.from(_classes)\n\n const btnProps = ([\n arr.length ? `class=\"${arr.filter(Boolean).join(' ')}\"` : '',\n disabled ? 'disabled' : '',\n autofocus ? 'autofocus' : '',\n type ? `type=\"${type}\"` : '',\n tabindex ? `tabindex=\"${tabindex}\"` : 'tabindex=\"0\"',\n 'role=\"button\"'\n ]).filter(Boolean).join(' ')\n\n return `<button ${btnProps}>\n ${textContent}\n </button>`\n}\n"],
|
|
5
|
+
"mappings": "+EAOO,SAASA,EAAMC,EAAsBC,EAAoB,CAC5D,GAAM,CACF,KAAAC,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,EACA,QAAAC,CACJ,EAAIN,EAEEO,EAAW,IAAI,IAAID,CAAO,EAChCC,EAAS,IAAI,kBAAkB,EAC/B,IAAMC,EAAM,MAAM,KAAKD,CAAQ,EAW/B,MAAO,WATW,CACdC,EAAI,OAAS,UAAUA,EAAI,OAAO,OAAO,EAAE,KAAK,GAAG,CAAC,IAAM,GAC1DH,EAAW,WAAa,GACxBF,EAAY,YAAc,GAC1BD,EAAO,SAASA,CAAI,IAAM,GAC1BE,EAAW,aAAaA,CAAQ,IAAM,eACtC,eACJ,EAAG,OAAO,OAAO,EAAE,KAAK,GAAG,CAED;AAAA,UACpBH,CAAW;AAAA,cAErB,CAzBgBQ,EAAAV,EAAA",
|
|
6
|
+
"names": ["html", "attrs", "textContent", "type", "autofocus", "tabindex", "disabled", "classes", "_classes", "arr", "__name"]
|
|
7
|
+
}
|
package/dist/index.cjs
CHANGED
|
@@ -22,141 +22,22 @@ __export(index_exports, {
|
|
|
22
22
|
SubstrateButton: () => SubstrateButton
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(index_exports);
|
|
25
|
-
|
|
25
|
+
var import_html = require("./html.js");
|
|
26
|
+
var import_client = require("./client.js");
|
|
27
|
+
class SubstrateButton extends import_client.SubstrateButton {
|
|
26
28
|
static {
|
|
27
29
|
__name(this, "SubstrateButton");
|
|
28
30
|
}
|
|
29
|
-
// for `attributeChangedCallback`
|
|
30
|
-
static observedAttributes = ["autofocus", "disabled", "spinning"];
|
|
31
|
-
static tag = "substrate-button";
|
|
32
|
-
_isSpinning;
|
|
33
|
-
constructor() {
|
|
34
|
-
super();
|
|
35
|
-
const disabled = this.getAttribute("disabled");
|
|
36
|
-
if (disabled !== null) {
|
|
37
|
-
setTimeout(() => {
|
|
38
|
-
this.disabled = true;
|
|
39
|
-
}, 0);
|
|
40
|
-
}
|
|
41
|
-
this.autofocus = this.getAttribute("autofocus") !== null;
|
|
42
|
-
this._isSpinning = this.getAttribute("spinning") !== null;
|
|
43
|
-
}
|
|
44
|
-
get form() {
|
|
45
|
-
return this.button?.form;
|
|
46
|
-
}
|
|
47
|
-
get disabled() {
|
|
48
|
-
return !!this.button?.hasAttribute("disabled");
|
|
49
|
-
}
|
|
50
|
-
set disabled(disabledValue) {
|
|
51
|
-
if (!disabledValue) {
|
|
52
|
-
this._removeAttribute("disabled");
|
|
53
|
-
this.button?.setAttribute("aria-disabled", "false");
|
|
54
|
-
} else {
|
|
55
|
-
this.button?.setAttribute("disabled", "");
|
|
56
|
-
this.button?.setAttribute("aria-disabled", "true");
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
get type() {
|
|
60
|
-
return this.button?.getAttribute("type");
|
|
61
|
-
}
|
|
62
|
-
get tabindex() {
|
|
63
|
-
const i = this.button?.getAttribute("tabindex");
|
|
64
|
-
if (!i) return 0;
|
|
65
|
-
return parseInt(i);
|
|
66
|
-
}
|
|
67
|
-
get spinning() {
|
|
68
|
-
return this._isSpinning;
|
|
69
|
-
}
|
|
70
|
-
set spinning(value) {
|
|
71
|
-
if (value) this.setAttribute("spinning", "");
|
|
72
|
-
else this.removeAttribute("spinning");
|
|
73
|
-
}
|
|
74
|
-
set type(value) {
|
|
75
|
-
this._setAttribute("type", value);
|
|
76
|
-
}
|
|
77
|
-
get autofocus() {
|
|
78
|
-
return !!this.button?.hasAttribute("autofocus");
|
|
79
|
-
}
|
|
80
|
-
set autofocus(value) {
|
|
81
|
-
if (value) {
|
|
82
|
-
this._setAttribute("autofocus", value);
|
|
83
|
-
} else {
|
|
84
|
-
this._removeAttribute("autofocus");
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Set attributes on the internal button element.
|
|
89
|
-
*/
|
|
90
|
-
_setAttribute(name, value) {
|
|
91
|
-
if (value === false) {
|
|
92
|
-
this._removeAttribute(name);
|
|
93
|
-
this.button?.removeAttribute(name);
|
|
94
|
-
} else {
|
|
95
|
-
if (value === true) {
|
|
96
|
-
return this.button?.setAttribute(name, "");
|
|
97
|
-
}
|
|
98
|
-
if (value === null) {
|
|
99
|
-
return this._removeAttribute(name);
|
|
100
|
-
}
|
|
101
|
-
this.button?.setAttribute(name, value);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Remove from `this` and also button child.
|
|
106
|
-
*/
|
|
107
|
-
_removeAttribute(name) {
|
|
108
|
-
this.removeAttribute(name);
|
|
109
|
-
this.button?.removeAttribute(name);
|
|
110
|
-
}
|
|
111
|
-
get button() {
|
|
112
|
-
return this.querySelector("button");
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Handle 'autofocus' attribute changes
|
|
116
|
-
* @see {@link https://gomakethings.com/how-to-detect-when-attributes-change-on-a-web-component/#organizing-your-code Go Make Things article}
|
|
117
|
-
*
|
|
118
|
-
* @param {string} oldValue The old attribute value
|
|
119
|
-
* @param {string} newValue The new attribute value
|
|
120
|
-
*/
|
|
121
|
-
handleChange_autofocus(_oldValue, newValue) {
|
|
122
|
-
this._setAttribute("autofocus", newValue);
|
|
123
|
-
}
|
|
124
|
-
handleChange_disabled(_old, newValue) {
|
|
125
|
-
this.disabled = newValue !== null;
|
|
126
|
-
if (newValue === null) this.button?.removeAttribute("disabled");
|
|
127
|
-
else this.button?.setAttribute("disabled", "" + newValue);
|
|
128
|
-
}
|
|
129
|
-
handleChange_spinning(_, newValue) {
|
|
130
|
-
if (newValue !== null) {
|
|
131
|
-
this.classList.add("substrate-loading");
|
|
132
|
-
} else {
|
|
133
|
-
this.classList.remove("substrate-loading");
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Runs when the value of an attribute is changed.
|
|
138
|
-
*
|
|
139
|
-
* Should add methods to this class like `handleChange_class`, to
|
|
140
|
-
* listen for changes to `class` attribute.
|
|
141
|
-
*
|
|
142
|
-
* @param {string} name The attribute name
|
|
143
|
-
* @param {string} oldValue The old attribute value
|
|
144
|
-
* @param {string} newValue The new attribute value
|
|
145
|
-
*/
|
|
146
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
147
|
-
const handler = this[`handleChange_${name}`];
|
|
148
|
-
handler && handler.call(this, oldValue, newValue);
|
|
149
|
-
}
|
|
150
|
-
connectedCallback() {
|
|
151
|
-
this.render();
|
|
152
|
-
}
|
|
153
31
|
static define() {
|
|
154
32
|
if (!("customElements" in window)) return;
|
|
155
33
|
return customElements.define(
|
|
156
|
-
SubstrateButton.
|
|
34
|
+
SubstrateButton.TAG || "substrate-button",
|
|
157
35
|
SubstrateButton
|
|
158
36
|
);
|
|
159
37
|
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
this.render();
|
|
40
|
+
}
|
|
160
41
|
render() {
|
|
161
42
|
const {
|
|
162
43
|
type,
|
|
@@ -164,16 +45,19 @@ class SubstrateButton extends HTMLElement {
|
|
|
164
45
|
tabindex,
|
|
165
46
|
disabled
|
|
166
47
|
} = this;
|
|
167
|
-
const classes = [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
48
|
+
const classes = [
|
|
49
|
+
"substrate-button",
|
|
50
|
+
this.getAttribute("class")
|
|
51
|
+
];
|
|
52
|
+
const text = this.innerHTML;
|
|
53
|
+
const btnProps = {
|
|
54
|
+
classes: classes.filter(Boolean),
|
|
55
|
+
disabled,
|
|
56
|
+
autofocus,
|
|
57
|
+
tabindex,
|
|
58
|
+
type
|
|
59
|
+
};
|
|
60
|
+
this.innerHTML = (0, import_html.html)(btnProps, text);
|
|
177
61
|
}
|
|
178
62
|
}
|
|
179
63
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import { html } from './html.js'\nimport { SubstrateButton as SubstrateButtonLight } from './client.js'\n// import Debug from '@substrate-system/debug'\n// const debug = Debug()\n\nexport class SubstrateButton extends SubstrateButtonLight {\n static define () {\n if (!('customElements' in window)) return\n\n return customElements.define(\n SubstrateButton.TAG || 'substrate-button',\n SubstrateButton\n )\n }\n\n connectedCallback ():void {\n this.render()\n }\n\n render () {\n const {\n type,\n autofocus,\n tabindex,\n disabled,\n } = this\n\n const classes:(string|null)[] = [\n 'substrate-button',\n this.getAttribute('class')\n ]\n const text = this.innerHTML\n\n const btnProps = {\n classes: classes.filter(Boolean),\n disabled,\n autofocus,\n tabindex,\n type,\n }\n\n this.innerHTML = html(btnProps, text)\n }\n}\n\n// export class SubstrateButton extends HTMLElement {\n// // for `attributeChangedCallback`\n// static observedAttributes = ['autofocus', 'disabled', 'spinning']\n// static TAG = 'substrate-button'\n// _isSpinning:boolean\n\n// constructor () {\n// super()\n// const disabled = this.getAttribute('disabled')\n// if (disabled !== null) {\n// setTimeout(() => {\n// // need to wait for it to render\n// this.disabled = true\n// }, 0)\n// }\n// this.autofocus = (this.getAttribute('autofocus') !== null)\n// this._isSpinning = (this.getAttribute('spinning') !== null)\n// }\n\n// get form ():HTMLFormElement|undefined|null {\n// return this.button?.form\n// }\n\n// get disabled ():boolean {\n// return !!(this.button?.hasAttribute('disabled'))\n// }\n\n// set disabled (disabledValue:boolean) {\n// if (!disabledValue) {\n// this._removeAttribute('disabled')\n// this.button?.setAttribute('aria-disabled', 'false')\n// } else {\n// this.button?.setAttribute('disabled', '')\n// this.button?.setAttribute('aria-disabled', 'true')\n// }\n// }\n\n// get type ():string|null|undefined {\n// return this.button?.getAttribute('type')\n// }\n\n// get tabindex ():number {\n// const i = this.button?.getAttribute('tabindex')\n// if (!i) return 0\n// return parseInt(i)\n// }\n\n// get spinning ():boolean {\n// return this._isSpinning\n// }\n\n// set spinning (value:boolean) {\n// if (value) this.setAttribute('spinning', '')\n// else this.removeAttribute('spinning')\n// }\n\n// set type (value:string) {\n// this._setAttribute('type', value)\n// }\n\n// get autofocus ():boolean {\n// return !!(this.button?.hasAttribute('autofocus'))\n// }\n\n// set autofocus (value:boolean) {\n// if (value) {\n// this._setAttribute('autofocus', value)\n// } else {\n// this._removeAttribute('autofocus')\n// }\n// }\n\n// /**\n// * Set attributes on the internal button element.\n// */\n// _setAttribute (name:string, value:boolean|string|null):void {\n// if (value === false) {\n// // false means remove the attribute\n// this._removeAttribute(name)\n// this.button?.removeAttribute(name)\n// } else {\n// if (value === true) {\n// // true means set the attribute with no value\n// return this.button?.setAttribute(name, '')\n// }\n\n// if (value === null) {\n// // null means remove\n// return this._removeAttribute(name)\n// }\n\n// // else, set value to a string\n// this.button?.setAttribute(name, value)\n// }\n// }\n\n// /**\n// * Remove from `this` and also button child.\n// */\n// _removeAttribute (name:string) {\n// this.removeAttribute(name)\n// this.button?.removeAttribute(name)\n// }\n\n// get button ():HTMLButtonElement|null {\n// return this.querySelector('button')\n// }\n\n// /**\n// * Handle 'autofocus' attribute changes\n// * @see {@link https://gomakethings.com/how-to-detect-when-attributes-change-on-a-web-component/#organizing-your-code Go Make Things article}\n// *\n// * @param {string} oldValue The old attribute value\n// * @param {string} newValue The new attribute value\n// */\n// handleChange_autofocus (_oldValue:string, newValue:string) {\n// this._setAttribute('autofocus', newValue)\n// }\n\n// handleChange_disabled (_old, newValue:boolean|string) {\n// this.disabled = (newValue !== null)\n// if (newValue === null) this.button?.removeAttribute('disabled')\n// else this.button?.setAttribute('disabled', '' + newValue)\n// }\n\n// handleChange_spinning (_, newValue:boolean) {\n// if (newValue !== null) {\n// this.classList.add('substrate-loading')\n// } else {\n// this.classList.remove('substrate-loading')\n// }\n// }\n\n// /**\n// * Runs when the value of an attribute is changed.\n// *\n// * Should add methods to this class like `handleChange_class`, to\n// * listen for changes to `class` attribute.\n// *\n// * @param {string} name The attribute name\n// * @param {string} oldValue The old attribute value\n// * @param {string} newValue The new attribute value\n// */\n// attributeChangedCallback (name:string, oldValue:string, newValue:string) {\n// const handler = this[`handleChange_${name}`];\n// (handler && handler.call(this, oldValue, newValue))\n// }\n\n// connectedCallback () {\n// debug('this.inner', this.innerHTML)\n// this.render()\n// }\n\n// static define () {\n// if (!('customElements' in window)) return\n\n// return customElements.define(\n// SubstrateButton.TAG || 'substrate-button',\n// SubstrateButton\n// )\n// }\n\n// render () {\n// const {\n// type,\n// autofocus,\n// tabindex,\n// disabled,\n// } = this\n\n// const classes:(string|null)[] = [\n// 'substrate-button',\n// this.getAttribute('class')\n// ]\n// const text = this.innerHTML\n\n// const btnProps = {\n// classes: classes.filter(Boolean),\n// disabled,\n// autofocus,\n// tabindex,\n// type,\n// }\n\n// this.innerHTML = html(btnProps, text)\n// }\n// }\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AACrB,oBAAwD;AAIjD,MAAM,wBAAwB,cAAAA,gBAAqB;AAAA,EAL1D,OAK0D;AAAA;AAAA;AAAA,EACtD,OAAO,SAAU;AACb,QAAI,EAAE,oBAAoB,QAAS;AAEnC,WAAO,eAAe;AAAA,MAClB,gBAAgB,OAAO;AAAA,MACvB;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,oBAA0B;AACtB,SAAK,OAAO;AAAA,EAChB;AAAA,EAEA,SAAU;AACN,UAAM;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ,IAAI;AAEJ,UAAM,UAA0B;AAAA,MAC5B;AAAA,MACA,KAAK,aAAa,OAAO;AAAA,IAC7B;AACA,UAAM,OAAO,KAAK;AAElB,UAAM,WAAW;AAAA,MACb,SAAS,QAAQ,OAAO,OAAO;AAAA,MAC/B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAEA,SAAK,gBAAY,kBAAK,UAAU,IAAI;AAAA,EACxC;AACJ;",
|
|
6
|
+
"names": ["SubstrateButtonLight"]
|
|
7
7
|
}
|
package/dist/index.css
CHANGED
|
@@ -74,7 +74,6 @@ substrate-button[aria-disabled="true"] button {
|
|
|
74
74
|
button.substrate-button {
|
|
75
75
|
border: 1px solid black;
|
|
76
76
|
color: var(--substrate-button-text, var(--substrate-primary, #36393d));
|
|
77
|
-
width: 100%;
|
|
78
77
|
font-family: var(--substrate-font, 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif);
|
|
79
78
|
padding: 0.5em 1em;
|
|
80
79
|
position: relative;
|
|
@@ -97,4 +96,4 @@ button.substrate-button:not([disabled]):active {
|
|
|
97
96
|
animation-name: substrate-button-activate;
|
|
98
97
|
transition-timing-function: ease;
|
|
99
98
|
}
|
|
100
|
-
/*# sourceMappingURL=data:application/json;base64,
|
|
99
|
+
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbmRleC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7SUFDSTtRQUNJLHVCQUF1QjtJQUMzQjs7SUFFQTtRQUNJLHlCQUF5QjtJQUM3QjtBQUNKOztBQUVBO0lBQ0ksSUFBSSx5QkFBeUIsQ0FBQztBQUNsQzs7QUFFQTtJQUNJO1FBQ0ksbUJBQW1CO0lBQ3ZCOztJQUVBO1FBQ0ksc0JBQXNCO0lBQzFCOztJQUVBO1FBQ0ksbUJBQW1CO0lBQ3ZCO0FBQ0o7O0FBRUE7SUFDSSxxQkFBcUI7SUFDckIsaUJBQWlCO0lBQ2pCLGVBQWU7QUF3Q25COztBQXRDSTtRQUNJLG9CQUFvQjtJQTBCeEI7O0FBeEJJO1lBQ0ksa0JBQWtCO1lBQ2xCLHlCQUF5QjtZQUN6QixvQkFBb0I7UUFvQnhCOztBQWxCSTtnQkFDSSxrQkFBa0I7WUFDdEI7O0FBRUE7Z0JBQ0ksV0FBVztnQkFDWCx1QkFBdUI7Z0JBQ3ZCLHNCQUFzQjtnQkFDdEIsa0JBQWtCO2dCQUNsQixXQUFXO2dCQUNYLFlBQVk7Z0JBQ1osUUFBUTtnQkFDUixZQUFZO2dCQUNaLGtCQUFrQjtnQkFDbEIsMkJBQTJCO2dCQUMzQixtQ0FBbUM7Z0JBQ25DLHVDQUF1QztZQUMzQzs7QUFJUDtRQUNHLGlCQUFpQjtRQUNqQiw2QkFBNkI7SUFNakM7O0FBSkk7WUFDSSxpQkFBaUI7WUFDakI7UUFDSjs7QUFJUjtJQUNJLHVCQUF1QjtJQUN2QixzRUFBc0U7SUFDdEUsb0dBQW9HO0lBQ3BHLGtCQUFrQjtJQUNsQixrQkFBa0I7SUFDbEIsaUVBQWlFO0lBQ2pFLGdCQUFnQjtBQW1CcEI7O0FBakJJO1FBQ0ksdUNBQXVDO1FBQ3ZDLHNFQUFzRTtJQUMxRTs7QUFFQTtRQUNJLG9CQUFvQjtRQUNwQixZQUFZO0lBQ2hCOztBQUdJO1lBQ0ksdUJBQXVCO1lBQ3ZCLHlDQUF5QztZQUN6QyxnQ0FBZ0M7UUFDcEMiLCJmaWxlIjoic3JjL2luZGV4LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIkBrZXlmcmFtZXMgc3BpbiB7XG4gICAgZnJvbSB7XG4gICAgICAgIHRyYW5zZm9ybTogcm90YXRlKDBkZWcpO1xuICAgIH1cblxuICAgIHRvIHtcbiAgICAgICAgdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTtcbiAgICB9XG59XG5cbkBrZXlmcmFtZXMgc3Bpbm5lciB7XG4gICAgdG8ge3RyYW5zZm9ybTogcm90YXRlKDM2MGRlZyk7fVxufVxuXG5Aa2V5ZnJhbWVzIHN1YnN0cmF0ZS1idXR0b24tYWN0aXZhdGUge1xuICAgIDAlIHtcbiAgICAgICAgdHJhbnNmb3JtOiBzY2FsZSgxKTtcbiAgICB9XG5cbiAgICA1MCUge1xuICAgICAgICB0cmFuc2Zvcm06IHNjYWxlKDAuOTUpO1xuICAgIH1cblxuICAgIDEwMCUge1xuICAgICAgICB0cmFuc2Zvcm06IHNjYWxlKDEpO1xuICAgIH1cbn1cblxuc3Vic3RyYXRlLWJ1dHRvbiB7XG4gICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICAgIHVzZXItc2VsZWN0OiBub25lO1xuICAgIG1pbi13aWR0aDogOHJlbTtcblxuICAgICYuc3Vic3RyYXRlLWxvYWRpbmcge1xuICAgICAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcblxuICAgICAgICAmIGJ1dHRvbiB7XG4gICAgICAgICAgICBjb2xvcjogdHJhbnNwYXJlbnQ7XG4gICAgICAgICAgICB0cmFuc2l0aW9uOiBhbGwgMC4zcyBlYXNlO1xuICAgICAgICAgICAgcG9pbnRlci1ldmVudHM6IG5vbmU7XG5cbiAgICAgICAgICAgICY6aG92ZXIge1xuICAgICAgICAgICAgICAgIGNvbG9yOiB0cmFuc3BhcmVudDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJjo6YWZ0ZXIge1xuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFwiXCI7XG4gICAgICAgICAgICAgICAgYmFja2dyb3VuZDogdHJhbnNwYXJlbnQ7XG4gICAgICAgICAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgICAgICAgICAgICAgd2lkdGg6IDE2cHg7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxNnB4O1xuICAgICAgICAgICAgICAgIGluc2V0OiAwO1xuICAgICAgICAgICAgICAgIG1hcmdpbjogYXV0bztcbiAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiA1MCU7XG4gICAgICAgICAgICAgICAgYm9yZGVyLXRvcDogMnB4IHNvbGlkIGJsYWNrO1xuICAgICAgICAgICAgICAgIGJvcmRlci1yaWdodDogMnB4IHNvbGlkIHRyYW5zcGFyZW50O1xuICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogc3Bpbm5lciAwLjZzIGxpbmVhciBpbmZpbml0ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgICAmW2FyaWEtZGlzYWJsZWQ9XCJ0cnVlXCJdIHtcbiAgICAgICAgdXNlci1zZWxlY3Q6IG5vbmU7XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50O1xuXG4gICAgICAgICYgYnV0dG9uIHtcbiAgICAgICAgICAgIHVzZXItc2VsZWN0OiBub25lO1xuICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnRcbiAgICAgICAgfVxuICAgIH1cbn1cbiAgXG5idXR0b24uc3Vic3RyYXRlLWJ1dHRvbiB7XG4gICAgYm9yZGVyOiAxcHggc29saWQgYmxhY2s7XG4gICAgY29sb3I6IHZhcigtLXN1YnN0cmF0ZS1idXR0b24tdGV4dCwgdmFyKC0tc3Vic3RyYXRlLXByaW1hcnksICMzNjM5M2QpKTtcbiAgICBmb250LWZhbWlseTogdmFyKC0tc3Vic3RyYXRlLWZvbnQsICdHaWxsIFNhbnMnLCAnR2lsbCBTYW5zIE1UJywgQ2FsaWJyaSwgJ1RyZWJ1Y2hldCBNUycsIHNhbnMtc2VyaWYpO1xuICAgIHBhZGRpbmc6IDAuNWVtIDFlbTtcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tc3Vic3RyYXRlLWJ1dHRvbi1iYWNrZ3JvdW5kLCB0cmFuc3BhcmVudCk7XG4gICAgYXBwZWFyYW5jZTogbm9uZTtcblxuICAgICY6YWN0aXZlIHtcbiAgICAgICAgY29sb3I6IHZhcigtLXN1YnN0cmF0ZS1tZWRpdW0sICM5OTlkYTApO1xuICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1zdWJzdHJhdGUtYnV0dG9uLWJhY2tncm91bmQtZGlzYWJsZWQsICNmN2Y3ZjUpO1xuICAgIH1cblxuICAgICY6ZGlzYWJsZWQge1xuICAgICAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcbiAgICAgICAgb3BhY2l0eTogMC40O1xuICAgIH1cblxuICAgICY6bm90KFtkaXNhYmxlZF0pIHtcbiAgICAgICAgJjphY3RpdmUge1xuICAgICAgICAgICAgYW5pbWF0aW9uLWR1cmF0aW9uOiAuMnM7XG4gICAgICAgICAgICBhbmltYXRpb24tbmFtZTogc3Vic3RyYXRlLWJ1dHRvbi1hY3RpdmF0ZTtcbiAgICAgICAgICAgIHRyYW5zaXRpb24tdGltaW5nLWZ1bmN0aW9uOiBlYXNlO1xuICAgICAgICB9XG4gICAgfVxufSJdfQ== */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,55 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
'substrate-button': SubstrateButton;
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
export declare class SubstrateButton extends HTMLElement {
|
|
7
|
-
static observedAttributes: string[];
|
|
8
|
-
static tag: string;
|
|
9
|
-
_isSpinning: boolean;
|
|
10
|
-
constructor();
|
|
11
|
-
get form(): HTMLFormElement | undefined | null;
|
|
12
|
-
get disabled(): boolean;
|
|
13
|
-
set disabled(disabledValue: boolean);
|
|
14
|
-
get type(): string | null | undefined;
|
|
15
|
-
get tabindex(): number;
|
|
16
|
-
get spinning(): boolean;
|
|
17
|
-
set spinning(value: boolean);
|
|
18
|
-
set type(value: string);
|
|
19
|
-
get autofocus(): boolean;
|
|
20
|
-
set autofocus(value: boolean);
|
|
21
|
-
/**
|
|
22
|
-
* Set attributes on the internal button element.
|
|
23
|
-
*/
|
|
24
|
-
_setAttribute(name: string, value: boolean | string | null): void;
|
|
25
|
-
/**
|
|
26
|
-
* Remove from `this` and also button child.
|
|
27
|
-
*/
|
|
28
|
-
_removeAttribute(name: string): void;
|
|
29
|
-
get button(): HTMLButtonElement | null;
|
|
30
|
-
/**
|
|
31
|
-
* Handle 'autofocus' attribute changes
|
|
32
|
-
* @see {@link https://gomakethings.com/how-to-detect-when-attributes-change-on-a-web-component/#organizing-your-code Go Make Things article}
|
|
33
|
-
*
|
|
34
|
-
* @param {string} oldValue The old attribute value
|
|
35
|
-
* @param {string} newValue The new attribute value
|
|
36
|
-
*/
|
|
37
|
-
handleChange_autofocus(_oldValue: string, newValue: string): void;
|
|
38
|
-
handleChange_disabled(_old: any, newValue: boolean | string): void;
|
|
39
|
-
handleChange_spinning(_: any, newValue: boolean): void;
|
|
40
|
-
/**
|
|
41
|
-
* Runs when the value of an attribute is changed.
|
|
42
|
-
*
|
|
43
|
-
* Should add methods to this class like `handleChange_class`, to
|
|
44
|
-
* listen for changes to `class` attribute.
|
|
45
|
-
*
|
|
46
|
-
* @param {string} name The attribute name
|
|
47
|
-
* @param {string} oldValue The old attribute value
|
|
48
|
-
* @param {string} newValue The new attribute value
|
|
49
|
-
*/
|
|
50
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
51
|
-
connectedCallback(): void;
|
|
1
|
+
import { SubstrateButton as SubstrateButtonLight } from './client.js';
|
|
2
|
+
export declare class SubstrateButton extends SubstrateButtonLight {
|
|
52
3
|
static define(): void;
|
|
4
|
+
connectedCallback(): void;
|
|
53
5
|
render(): void;
|
|
54
6
|
}
|
|
55
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAIrE,qBAAa,eAAgB,SAAQ,oBAAoB;IACrD,MAAM,CAAC,MAAM;IASb,iBAAiB,IAAI,IAAI;IAIzB,MAAM;CAwBT"}
|
package/dist/index.js
CHANGED
|
@@ -1,140 +1,21 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
3
|
+
import { html } from "./html.js";
|
|
4
|
+
import { SubstrateButton as SubstrateButtonLight } from "./client.js";
|
|
5
|
+
class SubstrateButton extends SubstrateButtonLight {
|
|
4
6
|
static {
|
|
5
7
|
__name(this, "SubstrateButton");
|
|
6
8
|
}
|
|
7
|
-
// for `attributeChangedCallback`
|
|
8
|
-
static observedAttributes = ["autofocus", "disabled", "spinning"];
|
|
9
|
-
static tag = "substrate-button";
|
|
10
|
-
_isSpinning;
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
const disabled = this.getAttribute("disabled");
|
|
14
|
-
if (disabled !== null) {
|
|
15
|
-
setTimeout(() => {
|
|
16
|
-
this.disabled = true;
|
|
17
|
-
}, 0);
|
|
18
|
-
}
|
|
19
|
-
this.autofocus = this.getAttribute("autofocus") !== null;
|
|
20
|
-
this._isSpinning = this.getAttribute("spinning") !== null;
|
|
21
|
-
}
|
|
22
|
-
get form() {
|
|
23
|
-
return this.button?.form;
|
|
24
|
-
}
|
|
25
|
-
get disabled() {
|
|
26
|
-
return !!this.button?.hasAttribute("disabled");
|
|
27
|
-
}
|
|
28
|
-
set disabled(disabledValue) {
|
|
29
|
-
if (!disabledValue) {
|
|
30
|
-
this._removeAttribute("disabled");
|
|
31
|
-
this.button?.setAttribute("aria-disabled", "false");
|
|
32
|
-
} else {
|
|
33
|
-
this.button?.setAttribute("disabled", "");
|
|
34
|
-
this.button?.setAttribute("aria-disabled", "true");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
get type() {
|
|
38
|
-
return this.button?.getAttribute("type");
|
|
39
|
-
}
|
|
40
|
-
get tabindex() {
|
|
41
|
-
const i = this.button?.getAttribute("tabindex");
|
|
42
|
-
if (!i) return 0;
|
|
43
|
-
return parseInt(i);
|
|
44
|
-
}
|
|
45
|
-
get spinning() {
|
|
46
|
-
return this._isSpinning;
|
|
47
|
-
}
|
|
48
|
-
set spinning(value) {
|
|
49
|
-
if (value) this.setAttribute("spinning", "");
|
|
50
|
-
else this.removeAttribute("spinning");
|
|
51
|
-
}
|
|
52
|
-
set type(value) {
|
|
53
|
-
this._setAttribute("type", value);
|
|
54
|
-
}
|
|
55
|
-
get autofocus() {
|
|
56
|
-
return !!this.button?.hasAttribute("autofocus");
|
|
57
|
-
}
|
|
58
|
-
set autofocus(value) {
|
|
59
|
-
if (value) {
|
|
60
|
-
this._setAttribute("autofocus", value);
|
|
61
|
-
} else {
|
|
62
|
-
this._removeAttribute("autofocus");
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Set attributes on the internal button element.
|
|
67
|
-
*/
|
|
68
|
-
_setAttribute(name, value) {
|
|
69
|
-
if (value === false) {
|
|
70
|
-
this._removeAttribute(name);
|
|
71
|
-
this.button?.removeAttribute(name);
|
|
72
|
-
} else {
|
|
73
|
-
if (value === true) {
|
|
74
|
-
return this.button?.setAttribute(name, "");
|
|
75
|
-
}
|
|
76
|
-
if (value === null) {
|
|
77
|
-
return this._removeAttribute(name);
|
|
78
|
-
}
|
|
79
|
-
this.button?.setAttribute(name, value);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Remove from `this` and also button child.
|
|
84
|
-
*/
|
|
85
|
-
_removeAttribute(name) {
|
|
86
|
-
this.removeAttribute(name);
|
|
87
|
-
this.button?.removeAttribute(name);
|
|
88
|
-
}
|
|
89
|
-
get button() {
|
|
90
|
-
return this.querySelector("button");
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Handle 'autofocus' attribute changes
|
|
94
|
-
* @see {@link https://gomakethings.com/how-to-detect-when-attributes-change-on-a-web-component/#organizing-your-code Go Make Things article}
|
|
95
|
-
*
|
|
96
|
-
* @param {string} oldValue The old attribute value
|
|
97
|
-
* @param {string} newValue The new attribute value
|
|
98
|
-
*/
|
|
99
|
-
handleChange_autofocus(_oldValue, newValue) {
|
|
100
|
-
this._setAttribute("autofocus", newValue);
|
|
101
|
-
}
|
|
102
|
-
handleChange_disabled(_old, newValue) {
|
|
103
|
-
this.disabled = newValue !== null;
|
|
104
|
-
if (newValue === null) this.button?.removeAttribute("disabled");
|
|
105
|
-
else this.button?.setAttribute("disabled", "" + newValue);
|
|
106
|
-
}
|
|
107
|
-
handleChange_spinning(_, newValue) {
|
|
108
|
-
if (newValue !== null) {
|
|
109
|
-
this.classList.add("substrate-loading");
|
|
110
|
-
} else {
|
|
111
|
-
this.classList.remove("substrate-loading");
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Runs when the value of an attribute is changed.
|
|
116
|
-
*
|
|
117
|
-
* Should add methods to this class like `handleChange_class`, to
|
|
118
|
-
* listen for changes to `class` attribute.
|
|
119
|
-
*
|
|
120
|
-
* @param {string} name The attribute name
|
|
121
|
-
* @param {string} oldValue The old attribute value
|
|
122
|
-
* @param {string} newValue The new attribute value
|
|
123
|
-
*/
|
|
124
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
125
|
-
const handler = this[`handleChange_${name}`];
|
|
126
|
-
handler && handler.call(this, oldValue, newValue);
|
|
127
|
-
}
|
|
128
|
-
connectedCallback() {
|
|
129
|
-
this.render();
|
|
130
|
-
}
|
|
131
9
|
static define() {
|
|
132
10
|
if (!("customElements" in window)) return;
|
|
133
11
|
return customElements.define(
|
|
134
|
-
SubstrateButton.
|
|
12
|
+
SubstrateButton.TAG || "substrate-button",
|
|
135
13
|
SubstrateButton
|
|
136
14
|
);
|
|
137
15
|
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
this.render();
|
|
18
|
+
}
|
|
138
19
|
render() {
|
|
139
20
|
const {
|
|
140
21
|
type,
|
|
@@ -142,16 +23,19 @@ class SubstrateButton extends HTMLElement {
|
|
|
142
23
|
tabindex,
|
|
143
24
|
disabled
|
|
144
25
|
} = this;
|
|
145
|
-
const classes = [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
26
|
+
const classes = [
|
|
27
|
+
"substrate-button",
|
|
28
|
+
this.getAttribute("class")
|
|
29
|
+
];
|
|
30
|
+
const text = this.innerHTML;
|
|
31
|
+
const btnProps = {
|
|
32
|
+
classes: classes.filter(Boolean),
|
|
33
|
+
disabled,
|
|
34
|
+
autofocus,
|
|
35
|
+
tabindex,
|
|
36
|
+
type
|
|
37
|
+
};
|
|
38
|
+
this.innerHTML = html(btnProps, text);
|
|
155
39
|
}
|
|
156
40
|
}
|
|
157
41
|
export {
|