@universal-material/web 3.0.92 → 3.0.94
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/app-bar/top-app-bar.d.ts +8 -3
- package/app-bar/top-app-bar.d.ts.map +1 -1
- package/app-bar/top-app-bar.js +65 -27
- package/app-bar/top-app-bar.js.map +1 -1
- package/app-bar/top-app-bar.styles.d.ts.map +1 -1
- package/app-bar/top-app-bar.styles.js +35 -5
- package/app-bar/top-app-bar.styles.js.map +1 -1
- package/custom-elements.json +3354 -1472
- package/field/field-base.d.ts +2 -0
- package/field/field-base.d.ts.map +1 -1
- package/field/field-base.js +13 -3
- package/field/field-base.js.map +1 -1
- package/field/field-base.styles.d.ts.map +1 -1
- package/field/field-base.styles.js +14 -6
- package/field/field-base.styles.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/shared/char-count-text-field/native-text-field-wrapper.d.ts +14 -0
- package/shared/char-count-text-field/native-text-field-wrapper.d.ts.map +1 -0
- package/shared/char-count-text-field/native-text-field-wrapper.js +54 -0
- package/shared/char-count-text-field/native-text-field-wrapper.js.map +1 -0
- package/shared/text-field-base/text-field-base.d.ts +1 -1
- package/shared/text-field-base/text-field-base.d.ts.map +1 -1
- package/shared/text-field-base/text-field-base.js +1 -0
- package/shared/text-field-base/text-field-base.js.map +1 -1
- package/text-area/text-area.d.ts +15 -0
- package/text-area/text-area.d.ts.map +1 -0
- package/text-area/text-area.js +51 -0
- package/text-area/text-area.js.map +1 -0
- package/text-area/text-area.styles.d.ts +2 -0
- package/text-area/text-area.styles.d.ts.map +1 -0
- package/text-area/text-area.styles.js +39 -0
- package/text-area/text-area.styles.js.map +1 -0
- package/text-field/text-field.d.ts +2 -7
- package/text-field/text-field.d.ts.map +1 -1
- package/text-field/text-field.js +9 -31
- package/text-field/text-field.js.map +1 -1
- package/text-field/text-field.styles.d.ts.map +1 -1
- package/text-field/text-field.styles.js +14 -0
- package/text-field/text-field.styles.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../src/text-field/text-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;AAMxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../src/text-field/text-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;AAMxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8DAA8D,CAAC;AAGxG,qBACa,WAAY,SAAQ,wBAAwB;IACvD,OAAgB,MAAM,EAAE,cAAc,CAAoC;IAE9D,IAAI,EAAE,MAAM,CAAU;IACM,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,cAAc,EAAG,MAAM,CAAC;IAE9C,KAAK,EAAG,gBAAgB,CAAC;cAEtB,aAAa,IAAI,kBAAkB;CA2BvD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
package/text-field/text-field.js
CHANGED
|
@@ -8,29 +8,14 @@ import { html, nothing } from 'lit';
|
|
|
8
8
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
9
9
|
import { live } from 'lit/directives/live.js';
|
|
10
10
|
import { styles } from './text-field.styles.js';
|
|
11
|
+
import { UmNativeTextFieldWrapper } from '../shared/char-count-text-field/native-text-field-wrapper.js';
|
|
11
12
|
import { UmTextFieldBase } from '../shared/text-field-base/text-field-base.js';
|
|
12
|
-
let UmTextField = class UmTextField extends
|
|
13
|
+
let UmTextField = class UmTextField extends UmNativeTextFieldWrapper {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
15
|
-
this.#value = '';
|
|
16
16
|
this.type = 'text';
|
|
17
17
|
}
|
|
18
|
-
static { this.styles = [
|
|
19
|
-
UmTextFieldBase.styles,
|
|
20
|
-
styles
|
|
21
|
-
]; }
|
|
22
|
-
#value;
|
|
23
|
-
get value() {
|
|
24
|
-
return this.#value;
|
|
25
|
-
}
|
|
26
|
-
set value(value) {
|
|
27
|
-
this.#value = value;
|
|
28
|
-
this.empty = !value;
|
|
29
|
-
this.elementInternals.setFormValue(value);
|
|
30
|
-
}
|
|
31
|
-
focus() {
|
|
32
|
-
this.input.focus();
|
|
33
|
-
}
|
|
18
|
+
static { this.styles = [UmTextFieldBase.styles, styles]; }
|
|
34
19
|
renderControl() {
|
|
35
20
|
return html `
|
|
36
21
|
<slot class="prefix" name="prefix">
|
|
@@ -44,25 +29,21 @@ let UmTextField = class UmTextField extends UmTextFieldBase {
|
|
|
44
29
|
aria-labelledby="label"
|
|
45
30
|
aria-describedBy="supporting-text"
|
|
46
31
|
?disabled=${this.disabled}
|
|
47
|
-
placeholder=${this.placeholder || nothing}
|
|
48
32
|
spellcheck=${this.spellcheck}
|
|
49
33
|
autocomplete=${this.autocomplete}
|
|
50
34
|
autocapitalize=${this.autocapitalize}
|
|
51
35
|
role=${this.role}
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
maxlength=${this.maxlength ?? nothing}
|
|
37
|
+
.placeholder=${this.placeholder}
|
|
38
|
+
.value=${live(this._value)}
|
|
39
|
+
@input=${this._handleInput} />
|
|
54
40
|
</div>
|
|
55
41
|
<slot class="suffix" name="suffix">
|
|
56
42
|
<span>${this.suffixText}</span>
|
|
57
|
-
</slot
|
|
58
|
-
|
|
59
|
-
#handleInput() {
|
|
60
|
-
this.value = this.input.value;
|
|
43
|
+
</slot>
|
|
44
|
+
`;
|
|
61
45
|
}
|
|
62
46
|
};
|
|
63
|
-
__decorate([
|
|
64
|
-
property()
|
|
65
|
-
], UmTextField.prototype, "value", null);
|
|
66
47
|
__decorate([
|
|
67
48
|
property()
|
|
68
49
|
], UmTextField.prototype, "type", void 0);
|
|
@@ -72,9 +53,6 @@ __decorate([
|
|
|
72
53
|
__decorate([
|
|
73
54
|
property({ attribute: 'suffix-text' })
|
|
74
55
|
], UmTextField.prototype, "suffixText", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
property({ reflect: true })
|
|
77
|
-
], UmTextField.prototype, "autocomplete", void 0);
|
|
78
56
|
__decorate([
|
|
79
57
|
property({ reflect: true })
|
|
80
58
|
], UmTextField.prototype, "autocapitalize", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../src/text-field/text-field.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,IAAI,EAAsB,OAAO,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAGxE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,
|
|
1
|
+
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../src/text-field/text-field.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,IAAI,EAAsB,OAAO,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8DAA8D,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAGxE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,wBAAwB;IAAlD;;QAGO,SAAI,GAAW,MAAM,CAAC;IAkCpC,CAAC;aApCiB,WAAM,GAAmB,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,AAAnD,CAAoD;IASvD,aAAa;QAC9B,OAAO,IAAI,CAAA;;gBAEC,IAAI,CAAC,UAAU;;;;iBAId,IAAI,CAAC,IAAI;;eAEX,IAAI,CAAC,EAAE,IAAI,OAAO;;;sBAGX,IAAI,CAAC,QAAQ;uBACZ,IAAI,CAAC,UAAU;yBACb,IAAI,CAAC,YAAY;2BACf,IAAI,CAAC,cAAc;iBAC7B,IAAI,CAAC,IAAI;sBACJ,IAAI,CAAC,SAAS,IAAI,OAAO;yBACtB,IAAI,CAAC,WAAW;mBACtB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;mBACjB,IAAI,CAAC,YAAY;;;gBAGpB,IAAI,CAAC,UAAU;;KAE1B,CAAC;IACJ,CAAC;;AAjCW;IAAX,QAAQ,EAAE;yCAAuB;AACM;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CAAgC;AAC/B;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CAAgC;AACjC;IAArC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAkC;AAE9C;IAAf,KAAK,CAAC,OAAO,CAAC;0CAA0B;AAR9B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAqCvB","sourcesContent":["import { CSSResultGroup } from '@lit/reactive-element/css-tag';\nimport { html, HTMLTemplateResult, nothing } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { live } from 'lit/directives/live.js';\n\nimport { styles } from './text-field.styles.js';\n\nimport { UmNativeTextFieldWrapper } from '../shared/char-count-text-field/native-text-field-wrapper.js';\nimport { UmTextFieldBase } from '../shared/text-field-base/text-field-base.js';\n\n@customElement('u-text-field')\nexport class UmTextField extends UmNativeTextFieldWrapper {\n static override styles: CSSResultGroup = [UmTextFieldBase.styles, styles];\n\n @property() type: string = 'text';\n @property({ attribute: 'prefix-text' }) prefixText: string | undefined;\n @property({ attribute: 'suffix-text' }) suffixText: string | undefined;\n @property({ reflect: true }) override autocapitalize!: string;\n\n @query('input') input!: HTMLInputElement;\n\n protected override renderControl(): HTMLTemplateResult {\n return html`\n <slot class=\"prefix\" name=\"prefix\">\n <span>${this.prefixText}</span>\n </slot>\n <div class=\"input\">\n <input\n type=${this.type}\n part=\"input\"\n id=${this.id || nothing}\n aria-labelledby=\"label\"\n aria-describedBy=\"supporting-text\"\n ?disabled=${this.disabled}\n spellcheck=${this.spellcheck}\n autocomplete=${this.autocomplete}\n autocapitalize=${this.autocapitalize}\n role=${this.role}\n maxlength=${this.maxlength ?? nothing}\n .placeholder=${this.placeholder}\n .value=${live(this._value)}\n @input=${this._handleInput} />\n </div>\n <slot class=\"suffix\" name=\"suffix\">\n <span>${this.suffixText}</span>\n </slot>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-text-field': UmTextField;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.styles.d.ts","sourceRoot":"","sources":["../../src/text-field/text-field.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"text-field.styles.d.ts","sourceRoot":"","sources":["../../src/text-field/text-field.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAsClB,CAAC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
export const styles = css `
|
|
3
|
+
.prefix::slotted(*),
|
|
4
|
+
.prefix span,
|
|
5
|
+
.suffix::slotted(*),
|
|
6
|
+
.suffix span {
|
|
7
|
+
transition: opacity 150ms 100ms;
|
|
8
|
+
}
|
|
3
9
|
.prefix span:empty,
|
|
4
10
|
.suffix span:empty {
|
|
5
11
|
display: none;
|
|
@@ -23,5 +29,13 @@ export const styles = css `
|
|
|
23
29
|
:host([disabled]) .suffix span, :host([disabled]) .suffix::slotted(*) {
|
|
24
30
|
color: var(--u-text-field-suffix-color, var(--u-text-field-affix-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-field-disabled-opacity, 0.38))));
|
|
25
31
|
}
|
|
32
|
+
|
|
33
|
+
:host([empty]:not(:focus-within)) .container:not(.no-label) .suffix::slotted(*),
|
|
34
|
+
:host([empty]:not(:focus-within)) .container:not(.no-label) .suffix span,
|
|
35
|
+
:host([empty]:not(:focus-within)) .container:not(.no-label) .prefix::slotted(*),
|
|
36
|
+
:host([empty]:not(:focus-within)) .container:not(.no-label) .prefix span {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transition: opacity 150ms;
|
|
39
|
+
}
|
|
26
40
|
`;
|
|
27
41
|
//# sourceMappingURL=text-field.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.styles.js","sourceRoot":"","sources":["../../src/text-field/text-field.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"text-field.styles.js","sourceRoot":"","sources":["../../src/text-field/text-field.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n .prefix::slotted(*),\n .prefix span,\n .suffix::slotted(*),\n .suffix span {\n transition: opacity 150ms 100ms;\n }\n .prefix span:empty,\n .suffix span:empty {\n display: none;\n }\n\n .prefix::slotted(*),\n .prefix span {\n color: var(--u-field-prefix-color, var(--u-field-affix-color, var(--u-color-on-surface-variant, rgb(73, 69, 79))));\n margin-inline-end: var(--u-prefix-margin, var(--u-affix-margin, 2px));\n }\n\n .suffix::slotted(*),\n .suffix span {\n color: var(--u-field-suffix-color, var(--u-field-affix-color, var(--u-color-on-surface-variant, rgb(73, 69, 79))));\n margin-inline-start: var(--u-suffix-margin, var(--u-affix-margin, 2px));\n }\n\n :host([disabled]) .prefix span, :host([disabled]) .prefix::slotted(*) {\n color: var(--u-text-field-prefix-color, var(--u-text-field-affix-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-field-disabled-opacity, 0.38))));\n }\n :host([disabled]) .suffix span, :host([disabled]) .suffix::slotted(*) {\n color: var(--u-text-field-suffix-color, var(--u-text-field-affix-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-field-disabled-opacity, 0.38))));\n }\n\n :host([empty]:not(:focus-within)) .container:not(.no-label) .suffix::slotted(*),\n :host([empty]:not(:focus-within)) .container:not(.no-label) .suffix span,\n :host([empty]:not(:focus-within)) .container:not(.no-label) .prefix::slotted(*),\n :host([empty]:not(:focus-within)) .container:not(.no-label) .prefix span {\n opacity: 0;\n transition: opacity 150ms;\n }\n`;\n"]}
|