@substrate-system/input 0.0.18 → 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/LICENSE +94 -25
- package/README.md +58 -27
- package/dist/index.cjs +128 -144
- package/dist/index.cjs.map +3 -3
- package/dist/index.css +29 -3
- package/dist/index.d.ts +31 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +128 -144
- package/dist/index.js.map +2 -2
- package/dist/index.min.css +1 -2
- package/dist/index.min.js +18 -1
- package/dist/index.min.js.map +4 -4
- package/dist/meta.json +32 -21
- package/dist/util.cjs +112 -0
- package/dist/util.cjs.map +7 -0
- package/dist/util.d.ts +3 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +92 -0
- package/dist/util.js.map +7 -0
- package/dist/util.min.js +2 -0
- package/dist/util.min.js.map +7 -0
- package/package.json +24 -48
- package/dist/html.cjs +0 -30
- package/dist/html.cjs.map +0 -7
- package/dist/html.d.ts +0 -18
- package/dist/html.d.ts.map +0 -1
- package/dist/html.js +0 -11
- package/dist/html.js.map +0 -7
- package/dist/html.min.js +0 -2
- package/dist/html.min.js.map +0 -7
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 { WebComponent } from '@substrate-system/web-component'\nimport { define } from '@substrate-system/web-component/util'\nimport { ARIA_ATTRIBUTES, INPUT_ATTRIBUTES } from './util'\n\n// for document.querySelector\ndeclare global {\n interface HTMLElementTagNameMap {\n 'substrate-input': SubstrateInput\n }\n}\n\nexport class SubstrateInput extends WebComponent.create('substrate-input') {\n static TAG = 'substrate-input'\n static INPUT_ATTRIBUTES = INPUT_ATTRIBUTES\n static ARIA_ATTRIBUTES = ARIA_ATTRIBUTES\n\n static observedAttributes = (['label', 'id'])\n .concat(SubstrateInput.INPUT_ATTRIBUTES)\n .concat(SubstrateInput.ARIA_ATTRIBUTES)\n\n inputId:string|null = null\n inputAriaAttributes:Record<string, string> = {}\n ignoredAriaCallbackNames:Set<string> = new Set()\n ignoredIdCallback = false\n generatedInputId = `substrate-input-${Math.random().toString(36).slice(2, 10)}`\n\n handleChange_label (_oldValue, _newValue) {\n this.render()\n }\n\n handleChange_aria (\n name:string,\n _oldValue:string|null,\n newValue:string|null\n ) {\n if (this.ignoredAriaCallbackNames.has(name)) {\n this.ignoredAriaCallbackNames.delete(name)\n return\n }\n\n if (newValue === null) {\n delete this.inputAriaAttributes[name]\n this.querySelector('input')?.removeAttribute(name)\n return\n }\n\n this.inputAriaAttributes[name] = newValue\n this.querySelector('input')?.setAttribute(name, newValue)\n\n if (this.hasAttribute(name)) {\n this.ignoredAriaCallbackNames.add(name)\n this.removeAttribute(name)\n }\n }\n\n handleChange_id (_oldValue:string|null, newValue:string|null) {\n if (this.ignoredIdCallback) {\n this.ignoredIdCallback = false\n return\n }\n\n if (newValue === null) {\n this.inputId = null\n this.querySelector('input')?.removeAttribute('id')\n return\n }\n\n this.inputId = newValue\n this.querySelector('input')?.setAttribute('id', newValue)\n\n if (this.hasAttribute('id')) {\n this.ignoredIdCallback = true\n this.removeAttribute('id')\n }\n }\n\n handleChange_inputAttribute (name:string, newValue:string|null) {\n const input = this.querySelector('input')\n if (!input) return\n\n if (newValue === null) {\n input.removeAttribute(name)\n return\n }\n\n input.setAttribute(name, newValue)\n }\n\n async attributeChangedCallback (\n name:string,\n oldValue:string,\n newValue:string\n ) {\n if (name === 'id') {\n this.handleChange_id(oldValue, newValue)\n return\n }\n\n if (name.startsWith('aria-')) {\n this.handleChange_aria(name, oldValue, newValue)\n return\n }\n\n if (SubstrateInput.INPUT_ATTRIBUTES.includes(name)) {\n this.handleChange_inputAttribute(name, newValue)\n return\n }\n\n if (this[`handleChange_${name}`]) {\n this[`handleChange_${name}`](oldValue, newValue)\n }\n }\n\n connectedCallback () {\n this.render()\n }\n\n getInputIdForRender () {\n return this.inputId || this.generatedInputId\n }\n\n set label (value:string|null) {\n if (value === null) {\n this.removeAttribute('label')\n return\n }\n this.setAttribute('label', value)\n }\n\n get label ():string|null {\n return this.getAttribute('label')\n }\n\n render () {\n const label = this.getAttribute('label')\n const hostId = this.getAttribute('id')\n const hostAriaAttributes = Array.from(this.attributes)\n .filter(attr => attr.name.startsWith('aria-'))\n\n if (hostId !== null) {\n this.inputId = hostId\n }\n\n for (const attr of hostAriaAttributes) {\n this.inputAriaAttributes[attr.name] = attr.value\n }\n\n const name = this.getAttribute('name')\n const attrs = Array.from(this.attributes)\n .filter(attr =>\n attr.name !== 'label' &&\n attr.name !== 'id' &&\n !attr.name.startsWith('aria-')\n )\n .map(attr => attr.name + (attr.value === '' ?\n '' :\n ('=' + `\"${attr.value}\"`))\n )\n .join(' ')\n\n const classes = (this.getAttribute('class') ?? '').split(' ')\n .concat(['substrate', 'input', name || ''])\n .filter(Boolean)\n .join(' ')\n\n const inputId = this.getInputIdForRender()\n const renderedIdAttribute = `id=\"${inputId}\"`\n const ariaAttributes = Object.entries(this.inputAriaAttributes)\n .map(([attrName, attrValue]) => {\n return (attrName + (attrValue === '' ?\n '' :\n ('=' + `\"${attrValue}\"`)))\n })\n .join(' ')\n\n this.innerHTML = label ? `\n <div class=\"${classes}\">\n <label class=\"label-content\" for=\"${inputId}\">${label}</label>\n <input\n ${renderedIdAttribute}\n ${ariaAttributes}\n ${attrs}\n />\n </div>\n ` : `\n <div class=\"${classes}\">\n <input\n ${renderedIdAttribute}\n ${ariaAttributes}\n ${attrs}\n />\n </div>\n `\n\n if (this.hasAttribute('id')) {\n this.ignoredIdCallback = true\n this.removeAttribute('id')\n }\n for (const attr of hostAriaAttributes) {\n this.ignoredAriaCallbackNames.add(attr.name)\n this.removeAttribute(attr.name)\n }\n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ACd,KAAK;AAAA;AAAA;AAAA;AAKX,QAAI,KAAK,aAAa,IAAI,GAAG;AACzB,WAAK,oBAAoB;AACzB,WAAK,gBAAgB,IAAI;AAAA,IAC7B;AACA,eAAW,QAAQ,oBAAoB;AACnC,WAAK,yBAAyB,IAAI,KAAK,IAAI;AAC3C,WAAK,gBAAgB,KAAK,IAAI;AAAA,IAClC;AAAA,EACJ;AACJ;AAAA,IAEA,oBAAO,eAAe,KAAK,cAAc;",
|
|
6
|
+
"names": ["import_util"]
|
|
7
7
|
}
|
package/dist/index.css
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
|
-
input {
|
|
2
|
-
|
|
1
|
+
substrate-input {
|
|
2
|
+
display: block;
|
|
3
|
+
|
|
4
|
+
& .substrate.input {
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
align-items: center;
|
|
7
|
+
min-width: 100%;
|
|
8
|
+
display: flex;
|
|
9
|
+
|
|
10
|
+
& .label-content {
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
& input {
|
|
15
|
+
border: 1px solid;
|
|
16
|
+
border-radius: 0;
|
|
17
|
+
outline: 1px solid #0000;
|
|
18
|
+
width: 100%;
|
|
19
|
+
padding: 1rem 1rem .8rem;
|
|
20
|
+
transition: all .2s;
|
|
21
|
+
|
|
22
|
+
&:focus {
|
|
23
|
+
outline: 1px solid;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
3
27
|
}
|
|
4
28
|
|
|
5
|
-
|
|
29
|
+
substrate-input:not(:defined) {
|
|
30
|
+
visibility: hidden;
|
|
31
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,45 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { WebComponent } from '@substrate-system/web-component';
|
|
2
|
+
declare global {
|
|
3
|
+
interface HTMLElementTagNameMap {
|
|
4
|
+
'substrate-input': SubstrateInput;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
declare const SubstrateInput_base: typeof WebComponent & {
|
|
8
|
+
new (...args: any[]): WebComponent;
|
|
9
|
+
TAG: string;
|
|
10
|
+
define: typeof WebComponent.define;
|
|
11
|
+
event: typeof WebComponent.event;
|
|
12
|
+
};
|
|
13
|
+
export declare class SubstrateInput extends SubstrateInput_base {
|
|
3
14
|
static TAG: string;
|
|
4
|
-
static
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
set disabled(disabledValue: boolean);
|
|
18
|
-
/**
|
|
19
|
-
* Handle 'example' attribute changes
|
|
20
|
-
* @see {@link https://gomakethings.com/how-to-detect-when-attributes-change-on-a-web-component/#organizing-your-code Go Make Things article}
|
|
21
|
-
*
|
|
22
|
-
* @param {string|null} _oldValue The old attribute value
|
|
23
|
-
* @param {string|null} newValue The new attribute value
|
|
24
|
-
*/
|
|
25
|
-
handleChange_disabled(_oldValue: string, newValue: string): void;
|
|
26
|
-
/**
|
|
27
|
-
* Runs when the value of an attribute is changed
|
|
28
|
-
*
|
|
29
|
-
* @param {string} name The attribute name
|
|
30
|
-
* @param {string} oldValue The old attribute value
|
|
31
|
-
* @param {string} newValue The new attribute value
|
|
32
|
-
*/
|
|
33
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
15
|
+
static INPUT_ATTRIBUTES: string[];
|
|
16
|
+
static ARIA_ATTRIBUTES: string[];
|
|
17
|
+
static observedAttributes: string[];
|
|
18
|
+
inputId: string | null;
|
|
19
|
+
inputAriaAttributes: Record<string, string>;
|
|
20
|
+
ignoredAriaCallbackNames: Set<string>;
|
|
21
|
+
ignoredIdCallback: boolean;
|
|
22
|
+
generatedInputId: string;
|
|
23
|
+
handleChange_label(_oldValue: any, _newValue: any): void;
|
|
24
|
+
handleChange_aria(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
25
|
+
handleChange_id(_oldValue: string | null, newValue: string | null): void;
|
|
26
|
+
handleChange_inputAttribute(name: string, newValue: string | null): void;
|
|
27
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): Promise<void>;
|
|
34
28
|
connectedCallback(): void;
|
|
35
|
-
|
|
36
|
-
set
|
|
37
|
-
get
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Set attributes on the internal input element.
|
|
41
|
-
*/
|
|
42
|
-
_setAttribute(name: string, value: boolean | string | null): void;
|
|
43
|
-
render(): string | void;
|
|
29
|
+
getInputIdForRender(): string;
|
|
30
|
+
set label(value: string | null);
|
|
31
|
+
get label(): string | null;
|
|
32
|
+
render(): void;
|
|
44
33
|
}
|
|
34
|
+
export {};
|
|
45
35
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAK9D,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,iBAAiB,EAAE,cAAc,CAAA;KACpC;CACJ;;;;;;;AAED,qBAAa,cAAe,SAAQ,mBAAsC;IACtE,MAAM,CAAC,GAAG,SAAoB;IAC9B,MAAM,CAAC,gBAAgB,WAAmB;IAC1C,MAAM,CAAC,eAAe,WAAkB;IAExC,MAAM,CAAC,kBAAkB,WAEkB;IAE3C,OAAO,EAAC,MAAM,GAAC,IAAI,CAAO;IAC1B,mBAAmB,EAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAK;IAC/C,wBAAwB,EAAC,GAAG,CAAC,MAAM,CAAC,CAAY;IAChD,iBAAiB,UAAQ;IACzB,gBAAgB,SAA+D;IAE/E,kBAAkB,CAAE,SAAS,KAAA,EAAE,SAAS,KAAA;IAIxC,iBAAiB,CACb,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,MAAM,GAAC,IAAI,EACrB,QAAQ,EAAC,MAAM,GAAC,IAAI;IAsBxB,eAAe,CAAE,SAAS,EAAC,MAAM,GAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,GAAC,IAAI;IAqB5D,2BAA2B,CAAE,IAAI,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,GAAC,IAAI;IAYxD,wBAAwB,CAC1B,IAAI,EAAC,MAAM,EACX,QAAQ,EAAC,MAAM,EACf,QAAQ,EAAC,MAAM;IAsBnB,iBAAiB;IAIjB,mBAAmB;IAInB,IAAI,KAAK,CAAE,KAAK,EAAC,MAAM,GAAC,IAAI,EAM3B;IAED,IAAI,KAAK,IAAI,MAAM,GAAC,IAAI,CAEvB;IAED,MAAM;CAsET"}
|
package/dist/index.js
CHANGED
|
@@ -1,168 +1,152 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
3
|
+
import { WebComponent } from "@substrate-system/web-component";
|
|
4
|
+
import { define } from "@substrate-system/web-component/util";
|
|
5
|
+
import { ARIA_ATTRIBUTES, INPUT_ATTRIBUTES } from "./util";
|
|
6
|
+
class SubstrateInput extends WebComponent.create("substrate-input") {
|
|
4
7
|
static {
|
|
5
|
-
__name(this, "
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
static
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (disabled !== null) {
|
|
19
|
-
setTimeout(() => {
|
|
20
|
-
this.disabled = true;
|
|
21
|
-
}, 0);
|
|
22
|
-
}
|
|
23
|
-
setTimeout(() => {
|
|
24
|
-
const attr = this.getAttribute("value");
|
|
25
|
-
if (attr) this.value = attr;
|
|
26
|
-
const type = this.getAttribute("type");
|
|
27
|
-
if (type) this.type = type;
|
|
28
|
-
}, 0);
|
|
29
|
-
}
|
|
30
|
-
get input() {
|
|
31
|
-
return this.querySelector("input");
|
|
32
|
-
}
|
|
33
|
-
get tabindex() {
|
|
34
|
-
const i = this.input?.getAttribute("tabindex");
|
|
35
|
-
if (!i) return 0;
|
|
36
|
-
return parseInt(i);
|
|
37
|
-
}
|
|
38
|
-
get name() {
|
|
39
|
-
return this.getAttribute("name");
|
|
40
|
-
}
|
|
41
|
-
get placeholder() {
|
|
42
|
-
return this.getAttribute("placeholder");
|
|
43
|
-
}
|
|
44
|
-
get autocomplete() {
|
|
45
|
-
return this.getAttribute("autocomplete");
|
|
46
|
-
}
|
|
47
|
-
set name(newName) {
|
|
48
|
-
this.setAttribute("name", newName);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Remove from `this` element and also child.
|
|
52
|
-
*/
|
|
53
|
-
_removeAttribute(name) {
|
|
54
|
-
this.removeAttribute(name);
|
|
55
|
-
this.input?.removeAttribute(name);
|
|
8
|
+
__name(this, "SubstrateInput");
|
|
9
|
+
}
|
|
10
|
+
static TAG = "substrate-input";
|
|
11
|
+
static INPUT_ATTRIBUTES = INPUT_ATTRIBUTES;
|
|
12
|
+
static ARIA_ATTRIBUTES = ARIA_ATTRIBUTES;
|
|
13
|
+
static observedAttributes = ["label", "id"].concat(SubstrateInput.INPUT_ATTRIBUTES).concat(SubstrateInput.ARIA_ATTRIBUTES);
|
|
14
|
+
inputId = null;
|
|
15
|
+
inputAriaAttributes = {};
|
|
16
|
+
ignoredAriaCallbackNames = /* @__PURE__ */ new Set();
|
|
17
|
+
ignoredIdCallback = false;
|
|
18
|
+
generatedInputId = `substrate-input-${Math.random().toString(36).slice(2, 10)}`;
|
|
19
|
+
handleChange_label(_oldValue, _newValue) {
|
|
20
|
+
this.render();
|
|
56
21
|
}
|
|
57
|
-
|
|
58
|
-
|
|
22
|
+
handleChange_aria(name, _oldValue, newValue) {
|
|
23
|
+
if (this.ignoredAriaCallbackNames.has(name)) {
|
|
24
|
+
this.ignoredAriaCallbackNames.delete(name);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (newValue === null) {
|
|
28
|
+
delete this.inputAriaAttributes[name];
|
|
29
|
+
this.querySelector("input")?.removeAttribute(name);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.inputAriaAttributes[name] = newValue;
|
|
33
|
+
this.querySelector("input")?.setAttribute(name, newValue);
|
|
34
|
+
if (this.hasAttribute(name)) {
|
|
35
|
+
this.ignoredAriaCallbackNames.add(name);
|
|
36
|
+
this.removeAttribute(name);
|
|
37
|
+
}
|
|
59
38
|
}
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
this.
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
this.
|
|
39
|
+
handleChange_id(_oldValue, newValue) {
|
|
40
|
+
if (this.ignoredIdCallback) {
|
|
41
|
+
this.ignoredIdCallback = false;
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (newValue === null) {
|
|
45
|
+
this.inputId = null;
|
|
46
|
+
this.querySelector("input")?.removeAttribute("id");
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.inputId = newValue;
|
|
50
|
+
this.querySelector("input")?.setAttribute("id", newValue);
|
|
51
|
+
if (this.hasAttribute("id")) {
|
|
52
|
+
this.ignoredIdCallback = true;
|
|
53
|
+
this.removeAttribute("id");
|
|
67
54
|
}
|
|
68
55
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
*/
|
|
76
|
-
handleChange_disabled(_oldValue, newValue) {
|
|
77
|
-
if (!this.input) {
|
|
78
|
-
setTimeout(() => {
|
|
79
|
-
if (newValue === null || newValue === "null") {
|
|
80
|
-
this.disabled = false;
|
|
81
|
-
} else {
|
|
82
|
-
this.disabled = true;
|
|
83
|
-
}
|
|
84
|
-
}, 0);
|
|
85
|
-
} else {
|
|
86
|
-
if (newValue === null || newValue === "null") {
|
|
87
|
-
this.disabled = false;
|
|
88
|
-
} else {
|
|
89
|
-
this.disabled = true;
|
|
90
|
-
}
|
|
56
|
+
handleChange_inputAttribute(name, newValue) {
|
|
57
|
+
const input = this.querySelector("input");
|
|
58
|
+
if (!input) return;
|
|
59
|
+
if (newValue === null) {
|
|
60
|
+
input.removeAttribute(name);
|
|
61
|
+
return;
|
|
91
62
|
}
|
|
63
|
+
input.setAttribute(name, newValue);
|
|
92
64
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
65
|
+
async attributeChangedCallback(name, oldValue, newValue) {
|
|
66
|
+
if (name === "id") {
|
|
67
|
+
this.handleChange_id(oldValue, newValue);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (name.startsWith("aria-")) {
|
|
71
|
+
this.handleChange_aria(name, oldValue, newValue);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (SubstrateInput.INPUT_ATTRIBUTES.includes(name)) {
|
|
75
|
+
this.handleChange_inputAttribute(name, newValue);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (this[`handleChange_${name}`]) {
|
|
79
|
+
this[`handleChange_${name}`](oldValue, newValue);
|
|
80
|
+
}
|
|
104
81
|
}
|
|
105
82
|
connectedCallback() {
|
|
106
83
|
this.render();
|
|
107
84
|
}
|
|
108
|
-
|
|
109
|
-
return this.
|
|
85
|
+
getInputIdForRender() {
|
|
86
|
+
return this.inputId || this.generatedInputId;
|
|
110
87
|
}
|
|
111
|
-
set
|
|
112
|
-
|
|
88
|
+
set label(value) {
|
|
89
|
+
if (value === null) {
|
|
90
|
+
this.removeAttribute("label");
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
this.setAttribute("label", value);
|
|
113
94
|
}
|
|
114
|
-
get
|
|
115
|
-
return this.
|
|
95
|
+
get label() {
|
|
96
|
+
return this.getAttribute("label");
|
|
116
97
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
98
|
+
render() {
|
|
99
|
+
const label = this.getAttribute("label");
|
|
100
|
+
const hostId = this.getAttribute("id");
|
|
101
|
+
const hostAriaAttributes = Array.from(this.attributes).filter((attr) => attr.name.startsWith("aria-"));
|
|
102
|
+
if (hostId !== null) {
|
|
103
|
+
this.inputId = hostId;
|
|
121
104
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
* Set attributes on the internal input element.
|
|
125
|
-
*/
|
|
126
|
-
_setAttribute(name, value) {
|
|
127
|
-
if (!value) {
|
|
128
|
-
return this._removeAttribute(name);
|
|
105
|
+
for (const attr of hostAriaAttributes) {
|
|
106
|
+
this.inputAriaAttributes[attr.name] = attr.value;
|
|
129
107
|
}
|
|
130
|
-
|
|
131
|
-
|
|
108
|
+
const name = this.getAttribute("name");
|
|
109
|
+
const attrs = Array.from(this.attributes).filter(
|
|
110
|
+
(attr) => attr.name !== "label" && attr.name !== "id" && !attr.name.startsWith("aria-")
|
|
111
|
+
).map(
|
|
112
|
+
(attr) => attr.name + (attr.value === "" ? "" : `="${attr.value}"`)
|
|
113
|
+
).join(" ");
|
|
114
|
+
const classes = (this.getAttribute("class") ?? "").split(" ").concat(["substrate", "input", name || ""]).filter(Boolean).join(" ");
|
|
115
|
+
const inputId = this.getInputIdForRender();
|
|
116
|
+
const renderedIdAttribute = `id="${inputId}"`;
|
|
117
|
+
const ariaAttributes = Object.entries(this.inputAriaAttributes).map(([attrName, attrValue]) => {
|
|
118
|
+
return attrName + (attrValue === "" ? "" : `="${attrValue}"`);
|
|
119
|
+
}).join(" ");
|
|
120
|
+
this.innerHTML = label ? `
|
|
121
|
+
<div class="${classes}">
|
|
122
|
+
<label class="label-content" for="${inputId}">${label}</label>
|
|
123
|
+
<input
|
|
124
|
+
${renderedIdAttribute}
|
|
125
|
+
${ariaAttributes}
|
|
126
|
+
${attrs}
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
` : `
|
|
130
|
+
<div class="${classes}">
|
|
131
|
+
<input
|
|
132
|
+
${renderedIdAttribute}
|
|
133
|
+
${ariaAttributes}
|
|
134
|
+
${attrs}
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
`;
|
|
138
|
+
if (this.hasAttribute("id")) {
|
|
139
|
+
this.ignoredIdCallback = true;
|
|
140
|
+
this.removeAttribute("id");
|
|
141
|
+
}
|
|
142
|
+
for (const attr of hostAriaAttributes) {
|
|
143
|
+
this.ignoredAriaCallbackNames.add(attr.name);
|
|
144
|
+
this.removeAttribute(attr.name);
|
|
132
145
|
}
|
|
133
|
-
this.input?.setAttribute(name, value);
|
|
134
|
-
}
|
|
135
|
-
render() {
|
|
136
|
-
const {
|
|
137
|
-
type,
|
|
138
|
-
autofocus,
|
|
139
|
-
tabindex,
|
|
140
|
-
disabled,
|
|
141
|
-
value,
|
|
142
|
-
name,
|
|
143
|
-
placeholder,
|
|
144
|
-
autocomplete
|
|
145
|
-
} = this;
|
|
146
|
-
if (!name) throw new Error("not name");
|
|
147
|
-
const classes = ["substrate-input"];
|
|
148
|
-
const btn = !!(this.type === "submit" || this.type === "button");
|
|
149
|
-
const props = [
|
|
150
|
-
`class="${classes.filter(Boolean).join(" ")}"`,
|
|
151
|
-
disabled ? "disabled" : "",
|
|
152
|
-
disabled ? 'aria-disabled="true"' : 'aria-disabled="false"',
|
|
153
|
-
autofocus ? "autofocus" : "",
|
|
154
|
-
type ? `type="${this.type}"` : "",
|
|
155
|
-
tabindex ? `tabindex="${tabindex}"` : 'tabindex="0"',
|
|
156
|
-
btn ? 'role="button"' : "",
|
|
157
|
-
value ? `value="${value}"` : "",
|
|
158
|
-
name ? `name="${name}"` : "",
|
|
159
|
-
autocomplete ? `autocomplete="${autocomplete}"` : "",
|
|
160
|
-
placeholder ? `placeholder="${placeholder}"` : ""
|
|
161
|
-
].filter(Boolean).join(" ");
|
|
162
|
-
return `<input ${props} />`;
|
|
163
146
|
}
|
|
164
147
|
}
|
|
148
|
+
define(SubstrateInput.TAG, SubstrateInput);
|
|
165
149
|
export {
|
|
166
|
-
|
|
150
|
+
SubstrateInput
|
|
167
151
|
};
|
|
168
152
|
//# sourceMappingURL=index.js.map
|
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 { WebComponent } from '@substrate-system/web-component'\nimport { define } from '@substrate-system/web-component/util'\nimport { ARIA_ATTRIBUTES, INPUT_ATTRIBUTES } from './util'\n\n// for document.querySelector\ndeclare global {\n interface HTMLElementTagNameMap {\n 'substrate-input': SubstrateInput\n }\n}\n\nexport class SubstrateInput extends WebComponent.create('substrate-input') {\n static TAG = 'substrate-input'\n static INPUT_ATTRIBUTES = INPUT_ATTRIBUTES\n static ARIA_ATTRIBUTES = ARIA_ATTRIBUTES\n\n static observedAttributes = (['label', 'id'])\n .concat(SubstrateInput.INPUT_ATTRIBUTES)\n .concat(SubstrateInput.ARIA_ATTRIBUTES)\n\n inputId:string|null = null\n inputAriaAttributes:Record<string, string> = {}\n ignoredAriaCallbackNames:Set<string> = new Set()\n ignoredIdCallback = false\n generatedInputId = `substrate-input-${Math.random().toString(36).slice(2, 10)}`\n\n handleChange_label (_oldValue, _newValue) {\n this.render()\n }\n\n handleChange_aria (\n name:string,\n _oldValue:string|null,\n newValue:string|null\n ) {\n if (this.ignoredAriaCallbackNames.has(name)) {\n this.ignoredAriaCallbackNames.delete(name)\n return\n }\n\n if (newValue === null) {\n delete this.inputAriaAttributes[name]\n this.querySelector('input')?.removeAttribute(name)\n return\n }\n\n this.inputAriaAttributes[name] = newValue\n this.querySelector('input')?.setAttribute(name, newValue)\n\n if (this.hasAttribute(name)) {\n this.ignoredAriaCallbackNames.add(name)\n this.removeAttribute(name)\n }\n }\n\n handleChange_id (_oldValue:string|null, newValue:string|null) {\n if (this.ignoredIdCallback) {\n this.ignoredIdCallback = false\n return\n }\n\n if (newValue === null) {\n this.inputId = null\n this.querySelector('input')?.removeAttribute('id')\n return\n }\n\n this.inputId = newValue\n this.querySelector('input')?.setAttribute('id', newValue)\n\n if (this.hasAttribute('id')) {\n this.ignoredIdCallback = true\n this.removeAttribute('id')\n }\n }\n\n handleChange_inputAttribute (name:string, newValue:string|null) {\n const input = this.querySelector('input')\n if (!input) return\n\n if (newValue === null) {\n input.removeAttribute(name)\n return\n }\n\n input.setAttribute(name, newValue)\n }\n\n async attributeChangedCallback (\n name:string,\n oldValue:string,\n newValue:string\n ) {\n if (name === 'id') {\n this.handleChange_id(oldValue, newValue)\n return\n }\n\n if (name.startsWith('aria-')) {\n this.handleChange_aria(name, oldValue, newValue)\n return\n }\n\n if (SubstrateInput.INPUT_ATTRIBUTES.includes(name)) {\n this.handleChange_inputAttribute(name, newValue)\n return\n }\n\n if (this[`handleChange_${name}`]) {\n this[`handleChange_${name}`](oldValue, newValue)\n }\n }\n\n connectedCallback () {\n this.render()\n }\n\n getInputIdForRender () {\n return this.inputId || this.generatedInputId\n }\n\n set label (value:string|null) {\n if (value === null) {\n this.removeAttribute('label')\n return\n }\n this.setAttribute('label', value)\n }\n\n get label ():string|null {\n return this.getAttribute('label')\n }\n\n render () {\n const label = this.getAttribute('label')\n const hostId = this.getAttribute('id')\n const hostAriaAttributes = Array.from(this.attributes)\n .filter(attr => attr.name.startsWith('aria-'))\n\n if (hostId !== null) {\n this.inputId = hostId\n }\n\n for (const attr of hostAriaAttributes) {\n this.inputAriaAttributes[attr.name] = attr.value\n }\n\n const name = this.getAttribute('name')\n const attrs = Array.from(this.attributes)\n .filter(attr =>\n attr.name !== 'label' &&\n attr.name !== 'id' &&\n !attr.name.startsWith('aria-')\n )\n .map(attr => attr.name + (attr.value === '' ?\n '' :\n ('=' + `\"${attr.value}\"`))\n )\n .join(' ')\n\n const classes = (this.getAttribute('class') ?? '').split(' ')\n .concat(['substrate', 'input', name || ''])\n .filter(Boolean)\n .join(' ')\n\n const inputId = this.getInputIdForRender()\n const renderedIdAttribute = `id=\"${inputId}\"`\n const ariaAttributes = Object.entries(this.inputAriaAttributes)\n .map(([attrName, attrValue]) => {\n return (attrName + (attrValue === '' ?\n '' :\n ('=' + `\"${attrValue}\"`)))\n })\n .join(' ')\n\n this.innerHTML = label ? `\n <div class=\"${classes}\">\n <label class=\"label-content\" for=\"${inputId}\">${label}</label>\n <input\n ${renderedIdAttribute}\n ${ariaAttributes}\n ${attrs}\n />\n </div>\n ` : `\n <div class=\"${classes}\">\n <input\n ${renderedIdAttribute}\n ${ariaAttributes}\n ${attrs}\n />\n </div>\n `\n\n if (this.hasAttribute('id')) {\n this.ignoredIdCallback = true\n this.removeAttribute('id')\n }\n for (const attr of hostAriaAttributes) {\n this.ignoredAriaCallbackNames.add(attr.name)\n this.removeAttribute(attr.name)\n }\n }\n}\n\ndefine(SubstrateInput.TAG, SubstrateInput)\n"],
|
|
5
|
+
"mappings": ";;AAAA,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AACvB,SAAS,iBAAiB,wBAAwB;AAS3C,MAAM,uBAAuB,aAAa,OAAO,iBAAiB,EAAE;AAAA,EAX3E,OAW2E;AAAA;AAAA;AAAA,EACvE,OAAO,MAAM;AAAA,EACb,OAAO,mBAAmB;AAAA,EAC1B,OAAO,kBAAkB;AAAA,EAEzB,OAAO,qBAAsB,CAAC,SAAS,IAAI,EACtC,OAAO,eAAe,gBAAgB,EACtC,OAAO,eAAe,eAAe;AAAA,EAE1C,UAAsB;AAAA,EACtB,sBAA6C,CAAC;AAAA,EAC9C,2BAAuC,oBAAI,IAAI;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W5ncyI6IkFBQUEsTUFDSSxrRUFDSiIsImZpbGUiOiJzcmMvaW5kZXguY3NzIiwic291cmNlc0NvbnRlbnQiOlsiaW5wdXQge1xuICAgIGZvbnQtZmFtaWx5OiAnR2lsbCBTYW5zJywgJ0dpbGwgU2FucyBNVCcsIENhbGlicmksICdUcmVidWNoZXQgTVMnLCBzYW5zLXNlcmlmO1xufVxuIl19 */
|
|
1
|
+
substrate-input{display:block;& .substrate.input{flex-wrap:wrap;align-items:center;min-width:100%;display:flex;& .label-content{width:100%}& input{border:1px solid;border-radius:0;outline:1px solid #0000;width:100%;padding:1rem 1rem .8rem;transition:all .2s;&:focus{outline:1px solid}}}}substrate-input:not(:defined){visibility:hidden}
|