@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/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//
|
|
5
|
-
"mappings": ";;
|
|
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,SAAS,YAAY;AACrB,SAAS,mBAAmB,4BAA4B;AAIjD,MAAM,wBAAwB,qBAAqB;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,YAAY,KAAK,UAAU,IAAI;AAAA,EACxC;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spinner{to{transform:rotate(1turn)}}@keyframes substrate-button-activate{0%{transform:scale(1)}50%{transform:scale(.95)}to{transform:scale(1)}}substrate-button{display:inline-block;min-width:8rem;user-select:none}substrate-button.substrate-loading{pointer-events:none}substrate-button.substrate-loading button{color:transparent;pointer-events:none;transition:all .3s ease}:is(substrate-button.substrate-loading button):hover{color:transparent}:is(substrate-button.substrate-loading button):after{animation:spinner .6s linear infinite;background:transparent;border-radius:50%;border-right:2px solid transparent;border-top:2px solid #000;box-sizing:border-box;content:"";height:16px;inset:0;margin:auto;position:absolute;width:16px}substrate-button[aria-disabled=true],substrate-button[aria-disabled=true] button{background-color:transparent;user-select:none}button.substrate-button{appearance:none;background-color:var(--substrate-button-background,transparent);border:1px solid #000;color:var(--substrate-button-text,var(--substrate-primary,#36393d));font-family:var(--substrate-font,"Gill Sans","Gill Sans MT",Calibri,"Trebuchet MS",sans-serif);padding:.5em 1em;position:relative
|
|
2
|
-
/*# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spinner{to{transform:rotate(1turn)}}@keyframes substrate-button-activate{0%{transform:scale(1)}50%{transform:scale(.95)}to{transform:scale(1)}}substrate-button{display:inline-block;min-width:8rem;user-select:none}substrate-button.substrate-loading{pointer-events:none}substrate-button.substrate-loading button{color:transparent;pointer-events:none;transition:all .3s ease}:is(substrate-button.substrate-loading button):hover{color:transparent}:is(substrate-button.substrate-loading button):after{animation:spinner .6s linear infinite;background:transparent;border-radius:50%;border-right:2px solid transparent;border-top:2px solid #000;box-sizing:border-box;content:"";height:16px;inset:0;margin:auto;position:absolute;width:16px}substrate-button[aria-disabled=true],substrate-button[aria-disabled=true] button{background-color:transparent;user-select:none}button.substrate-button{appearance:none;background-color:var(--substrate-button-background,transparent);border:1px solid #000;color:var(--substrate-button-text,var(--substrate-primary,#36393d));font-family:var(--substrate-font,"Gill Sans","Gill Sans MT",Calibri,"Trebuchet MS",sans-serif);padding:.5em 1em;position:relative}button.substrate-button:active{background-color:var(--substrate-button-background-disabled,#f7f7f5);color:var(--substrate-medium,#999da0)}button.substrate-button:disabled{opacity:.4;pointer-events:none}button.substrate-button:not([disabled]):active{animation-duration:.2s;animation-name:substrate-button-activate;transition-timing-function:ease}
|
|
2
|
+
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbmRleC5jc3MiXSwibmFtZXMiOltd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YXRlKDM2MGRlZyk7XG4gICAgfVxufVxuXG5Aa2V5ZnJhbWVzIHNwaW5uZXIge1xuICAgIHRvIHt0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpO31cbn1cblxuQGtleWZyYW1lcyBzdWJzdHJhdGUtYnV0dG9uLWFjdGl2YXRlIHtcbiAgICAwJSB7XG4gICAgICAgIHRyYW5zZm9ybTogc2NhbGUoMSk7XG4gICAgfVxuXG4gICAgNTAlIHtcbiAgICAgICAgdHJhbnNmb3JtOiBzY2FsZSgwLjk1KTtcbiAgICB9XG5cbiAgICAxMDAlIHtcbiAgICAgICAgdHJhbnNmb3JtOiBzY2FsZSgxKTtcbiAgICB9XG59XG5cbnN1YnN0cmF0ZS1idXR0b24ge1xuICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICB1c2VyLXNlbGVjdDogbm9uZTtcbiAgICBtaW4td2lkdGg6IDhyZW07XG5cbiAgICAmLnN1YnN0cmF0ZS1sb2FkaW5nIHtcbiAgICAgICAgcG9pbnRlci1ldmVudHM6IG5vbmU7XG5cbiAgICAgICAgJiBidXR0b24ge1xuICAgICAgICAgICAgY29sb3I6IHRyYW5zcGFyZW50O1xuICAgICAgICAgICAgdHJhbnNpdGlvbjogYWxsIDAuM3MgZWFzZTtcbiAgICAgICAgICAgIHBvaW50ZXItZXZlbnRzOiBub25lO1xuXG4gICAgICAgICAgICAmOmhvdmVyIHtcbiAgICAgICAgICAgICAgICBjb2xvcjogdHJhbnNwYXJlbnQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICY6OmFmdGVyIHtcbiAgICAgICAgICAgICAgICBjb250ZW50OiBcIlwiO1xuICAgICAgICAgICAgICAgIGJhY2tncm91bmQ6IHRyYW5zcGFyZW50O1xuICAgICAgICAgICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgICAgICAgICAgIHdpZHRoOiAxNnB4O1xuICAgICAgICAgICAgICAgIGhlaWdodDogMTZweDtcbiAgICAgICAgICAgICAgICBpbnNldDogMDtcbiAgICAgICAgICAgICAgICBtYXJnaW46IGF1dG87XG4gICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNTAlO1xuICAgICAgICAgICAgICAgIGJvcmRlci10b3A6IDJweCBzb2xpZCBibGFjaztcbiAgICAgICAgICAgICAgICBib3JkZXItcmlnaHQ6IDJweCBzb2xpZCB0cmFuc3BhcmVudDtcbiAgICAgICAgICAgICAgICBhbmltYXRpb246IHNwaW5uZXIgMC42cyBsaW5lYXIgaW5maW5pdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAgJlthcmlhLWRpc2FibGVkPVwidHJ1ZVwiXSB7XG4gICAgICAgIHVzZXItc2VsZWN0OiBub25lO1xuICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDtcblxuICAgICAgICAmIGJ1dHRvbiB7XG4gICAgICAgICAgICB1c2VyLXNlbGVjdDogbm9uZTtcbiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50XG4gICAgICAgIH1cbiAgICB9XG59XG4gIFxuYnV0dG9uLnN1YnN0cmF0ZS1idXR0b24ge1xuICAgIGJvcmRlcjogMXB4IHNvbGlkIGJsYWNrO1xuICAgIGNvbG9yOiB2YXIoLS1zdWJzdHJhdGUtYnV0dG9uLXRleHQsIHZhcigtLXN1YnN0cmF0ZS1wcmltYXJ5LCAjMzYzOTNkKSk7XG4gICAgZm9udC1mYW1pbHk6IHZhcigtLXN1YnN0cmF0ZS1mb250LCAnR2lsbCBTYW5zJywgJ0dpbGwgU2FucyBNVCcsIENhbGlicmksICdUcmVidWNoZXQgTVMnLCBzYW5zLXNlcmlmKTtcbiAgICBwYWRkaW5nOiAwLjVlbSAxZW07XG4gICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgIGJhY2tncm91bmQtY29sb3I6IHZhcigtLXN1YnN0cmF0ZS1idXR0b24tYmFja2dyb3VuZCwgdHJhbnNwYXJlbnQpO1xuICAgIGFwcGVhcmFuY2U6IG5vbmU7XG5cbiAgICAmOmFjdGl2ZSB7XG4gICAgICAgIGNvbG9yOiB2YXIoLS1zdWJzdHJhdGUtbWVkaXVtLCAjOTk5ZGEwKTtcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tc3Vic3RyYXRlLWJ1dHRvbi1iYWNrZ3JvdW5kLWRpc2FibGVkLCAjZjdmN2Y1KTtcbiAgICB9XG5cbiAgICAmOmRpc2FibGVkIHtcbiAgICAgICAgcG9pbnRlci1ldmVudHM6IG5vbmU7XG4gICAgICAgIG9wYWNpdHk6IDAuNDtcbiAgICB9XG5cbiAgICAmOm5vdChbZGlzYWJsZWRdKSB7XG4gICAgICAgICY6YWN0aXZlIHtcbiAgICAgICAgICAgIGFuaW1hdGlvbi1kdXJhdGlvbjogLjJzO1xuICAgICAgICAgICAgYW5pbWF0aW9uLW5hbWU6IHN1YnN0cmF0ZS1idXR0b24tYWN0aXZhdGU7XG4gICAgICAgICAgICB0cmFuc2l0aW9uLXRpbWluZy1mdW5jdGlvbjogZWFzZTtcbiAgICAgICAgfVxuICAgIH1cbn0iXX0= */
|
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var c=Object.defineProperty;var n=(s,t)=>c(s,"name",{value:t,configurable:!0});function d(s,t){let{type:e,autofocus:r,tabindex:i,disabled:b,classes:a}=s,o=new Set(a);o.add("substrate-button");let l=Array.from(o);return`<button ${[l.length?`class="${l.filter(Boolean).join(" ")}"`:"",b?"disabled":"",r?"autofocus":"",e?`type="${e}"`:"",i?`tabindex="${i}"`:'tabindex="0"','role="button"'].filter(Boolean).join(" ")}>
|
|
2
|
+
${t}
|
|
3
|
+
</button>`}n(d,"html");var u=class s extends HTMLElement{static{n(this,"SubstrateButton")}static observedAttributes=["autofocus","disabled","spinning"];static TAG="substrate-button";_isSpinning;constructor(){super(),this.getAttribute("disabled")!==null&&setTimeout(()=>{this.disabled=!0},0),this.autofocus=this.getAttribute("autofocus")!==null,this._isSpinning=this.getAttribute("spinning")!==null}get form(){return this.button?.form}get disabled(){return!!this.button?.hasAttribute("disabled")}set disabled(t){t?(this.button?.setAttribute("disabled",""),this.button?.setAttribute("aria-disabled","true")):(this._removeAttribute("disabled"),this.button?.setAttribute("aria-disabled","false"))}get type(){return this.button?.getAttribute("type")}get tabindex(){let t=this.button?.getAttribute("tabindex");return t?parseInt(t):0}get spinning(){return this._isSpinning}set spinning(t){t?this.setAttribute("spinning",""):this.removeAttribute("spinning")}set type(t){this._setAttribute("type",t)}get autofocus(){return!!this.button?.hasAttribute("autofocus")}set autofocus(t){t?this._setAttribute("autofocus",t):this._removeAttribute("autofocus")}_setAttribute(t,e){if(e===!1)this._removeAttribute(t),this.button?.removeAttribute(t);else{if(e===!0)return this.button?.setAttribute(t,"");if(e===null)return this._removeAttribute(t);this.button?.setAttribute(t,e)}}_removeAttribute(t){this.removeAttribute(t),this.button?.removeAttribute(t)}get button(){return this.querySelector("button")}handleChange_autofocus(t,e){this._setAttribute("autofocus",e)}handleChange_disabled(t,e){this.disabled=e!==null,e===null?this.button?.removeAttribute("disabled"):this.button?.setAttribute("disabled",""+e)}handleChange_spinning(t,e){e!==null?this.classList.add("substrate-loading"):this.classList.remove("substrate-loading")}attributeChangedCallback(t,e,r){let i=this[`handleChange_${t}`];i&&i.call(this,e,r)}connectedCallback(){this.render()}static define(){if("customElements"in window)return customElements.define(s.TAG||"substrate-button",s)}render(){}};var h=class s extends u{static{n(this,"SubstrateButton")}static define(){if("customElements"in window)return customElements.define(s.TAG||"substrate-button",s)}connectedCallback(){this.render()}render(){let{type:t,autofocus:e,tabindex:r,disabled:i}=this,b=["substrate-button",this.getAttribute("class")],a=this.innerHTML,o={classes:b.filter(Boolean),disabled:i,autofocus:e,tabindex:r,type:t};this.innerHTML=d(o,a)}};export{h as SubstrateButton};
|
|
2
4
|
//# sourceMappingURL=index.min.js.map
|
package/dist/index.min.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["// for docuement.querySelector\ndeclare global {\n interface HTMLElementTagNameMap {\n 'substrate-button': SubstrateButton\n }\n}\n\nexport 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 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[] = ['substrate-button']\n\n const btnProps = ([\n `class=\"${classes.join(' ')}\"`,\n disabled ? 'disabled' : '',\n autofocus ? 'autofocus' : '',\n type ? `type=\"${this.type}\"` : '',\n tabindex ? `tabindex=\"${tabindex}\"` : 'tabindex=\"0\"',\n 'role=\"button\"'\n ]).filter(Boolean).join(' ')\n\n this.innerHTML = `<button ${btnProps}>${this.innerHTML}</button>`\n }\n}\n"],
|
|
5
|
-
"mappings": "+EAOO,
|
|
6
|
-
"names": ["SubstrateButton", "_SubstrateButton", "__name", "disabledValue", "i", "value", "name", "_oldValue", "newValue", "_old", "_", "oldValue", "handler", "type", "autofocus", "tabindex", "disabled", "btnProps"]
|
|
3
|
+
"sources": ["../src/html.ts", "../src/client.ts", "../src/index.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", "// for docuement.querySelector\ndeclare global {\n interface HTMLElementTagNameMap {\n 'substrate-button': SubstrateButton\n }\n}\n\n/**\n * This is the lightweight version for browsers + server-side rendering.\n */\nexport 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 // connect event listeners\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 // noop\n }\n}\n\n", "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": "+EAOO,SAASA,EAAMC,EAAsBC,EAAoB,CAC5D,GAAM,CACF,KAAAC,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,EACA,QAAAC,CACJ,EAAIN,EAEEO,EAAW,IAAI,IAA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AMD,EAAUH,CAAQ,CACrD,CAEA,mBAAqB,CAEjB,KAAK,OAAO,CAChB,CAEA,OAAO,QAAU,CACb,GAAM,mBAAoB,OAE1B,OAAO,eAAe,OAClBP,EAAgB,KAAO,mBACvBA,CACJ,CACJ,CAEA,QAAU,CAEV,CACJ,EC1KO,IAAMY,EAAN,MAAMC,UAAwBD,CAAqB,CAL1D,MAK0D,CAAAE,EAAA,wBACtD,OAAO,QAAU,CACb,GAAM,mBAAoB,OAE1B,OAAO,eAAe,OAClBD,EAAgB,KAAO,mBACvBA,CACJ,CACJ,CAEA,mBAA0B,CACtB,KAAK,OAAO,CAChB,CAEA,QAAU,CACN,GAAM,CACF,KAAAE,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,CACJ,EAAI,KAEEC,EAA0B,CAC5B,mBACA,KAAK,aAAa,OAAO,CAC7B,EACMC,EAAO,KAAK,UAEZC,EAAW,CACb,QAASF,EAAQ,OAAO,OAAO,EAC/B,SAAAD,EACA,UAAAF,EACA,SAAAC,EACA,KAAAF,CACJ,EAEA,KAAK,UAAYO,EAAKD,EAAUD,CAAI,CACxC,CACJ",
|
|
6
|
+
"names": ["html", "attrs", "textContent", "type", "autofocus", "tabindex", "disabled", "classes", "_classes", "arr", "__name", "SubstrateButton", "_SubstrateButton", "__name", "disabledValue", "i", "value", "name", "_oldValue", "newValue", "_old", "_", "oldValue", "handler", "SubstrateButton", "_SubstrateButton", "__name", "type", "autofocus", "tabindex", "disabled", "classes", "text", "btnProps", "html"]
|
|
7
7
|
}
|
package/dist/meta.json
CHANGED
|
@@ -1,30 +1,89 @@
|
|
|
1
1
|
{
|
|
2
2
|
"inputs": {
|
|
3
|
+
"src/client.ts": {
|
|
4
|
+
"bytes": 5036,
|
|
5
|
+
"imports": [],
|
|
6
|
+
"format": "esm"
|
|
7
|
+
},
|
|
8
|
+
"src/html.ts": {
|
|
9
|
+
"bytes": 843,
|
|
10
|
+
"imports": [],
|
|
11
|
+
"format": "esm"
|
|
12
|
+
},
|
|
3
13
|
"src/index.ts": {
|
|
4
|
-
"bytes":
|
|
14
|
+
"bytes": 6810,
|
|
5
15
|
"imports": [],
|
|
6
16
|
"format": "esm"
|
|
7
17
|
}
|
|
8
18
|
},
|
|
9
19
|
"outputs": {
|
|
20
|
+
"dist/client.js.map": {
|
|
21
|
+
"imports": [],
|
|
22
|
+
"exports": [],
|
|
23
|
+
"inputs": {},
|
|
24
|
+
"bytes": 7805
|
|
25
|
+
},
|
|
26
|
+
"dist/client.js": {
|
|
27
|
+
"imports": [],
|
|
28
|
+
"exports": [
|
|
29
|
+
"SubstrateButton"
|
|
30
|
+
],
|
|
31
|
+
"entryPoint": "src/client.ts",
|
|
32
|
+
"inputs": {
|
|
33
|
+
"src/client.ts": {
|
|
34
|
+
"bytesInOutput": 3870
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"bytes": 4064
|
|
38
|
+
},
|
|
39
|
+
"dist/html.js.map": {
|
|
40
|
+
"imports": [],
|
|
41
|
+
"exports": [],
|
|
42
|
+
"inputs": {},
|
|
43
|
+
"bytes": 1477
|
|
44
|
+
},
|
|
45
|
+
"dist/html.js": {
|
|
46
|
+
"imports": [],
|
|
47
|
+
"exports": [
|
|
48
|
+
"html"
|
|
49
|
+
],
|
|
50
|
+
"entryPoint": "src/html.ts",
|
|
51
|
+
"inputs": {
|
|
52
|
+
"src/html.ts": {
|
|
53
|
+
"bytesInOutput": 623
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"bytes": 804
|
|
57
|
+
},
|
|
10
58
|
"dist/index.js.map": {
|
|
11
59
|
"imports": [],
|
|
12
60
|
"exports": [],
|
|
13
61
|
"inputs": {},
|
|
14
|
-
"bytes":
|
|
62
|
+
"bytes": 7716
|
|
15
63
|
},
|
|
16
64
|
"dist/index.js": {
|
|
17
|
-
"imports": [
|
|
65
|
+
"imports": [
|
|
66
|
+
{
|
|
67
|
+
"path": "./html.js",
|
|
68
|
+
"kind": "import-statement",
|
|
69
|
+
"external": true
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"path": "./client.js",
|
|
73
|
+
"kind": "import-statement",
|
|
74
|
+
"external": true
|
|
75
|
+
}
|
|
76
|
+
],
|
|
18
77
|
"exports": [
|
|
19
78
|
"SubstrateButton"
|
|
20
79
|
],
|
|
21
80
|
"entryPoint": "src/index.ts",
|
|
22
81
|
"inputs": {
|
|
23
82
|
"src/index.ts": {
|
|
24
|
-
"bytesInOutput":
|
|
83
|
+
"bytesInOutput": 839
|
|
25
84
|
}
|
|
26
85
|
},
|
|
27
|
-
"bytes":
|
|
86
|
+
"bytes": 1032
|
|
28
87
|
}
|
|
29
88
|
}
|
|
30
89
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@substrate-system/button",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"description": "A button component with a visual \"loading\" state",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"require": "./dist/index.cjs"
|
|
15
15
|
},
|
|
16
16
|
"./min": "./dist/index.min.js",
|
|
17
|
+
"./min/*": "./dist/*.min.js",
|
|
18
|
+
"./client": {
|
|
19
|
+
"import": "./dist/client.js",
|
|
20
|
+
"require": "./dist/client.cjs"
|
|
21
|
+
},
|
|
17
22
|
"./css": "./dist/index.css",
|
|
18
23
|
"./css/min": "./dist/index.min.css",
|
|
19
24
|
"./*": {
|