@universal-material/web 3.0.37 → 3.0.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universal-material/web",
3
- "version": "3.0.37",
3
+ "version": "3.0.38",
4
4
  "description": "Material web components",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../src/text-field/text-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAW,MAAM,KAAK,CAAC;AAUpE,OAAO,mBAAmB,CAAC;AAE3B,QAAA,MAAM,uBAAuB,oBAAoB,CAAC;AAKlD,QAAA,MAAM,aAAa,6DAKG,CAAC;AAEvB,qBACa,WAAY,SAAQ,aAAa;;IAC5C,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAEtC,OAAgB,MAAM,4BAAwB;IAE9C,OAAgB,iBAAiB,EAAE,cAAc,CAG/C;IAEU,OAAO,wBAAmC;IAC1C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACX,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B,QAAQ,UAAS;IACjB,OAAO,UAAS;IAI1D,IAAI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;IAED,IAAI,CAAC,uBAAuB,CAAC,IAAI,MAAM,GAAG,SAAS,CAElD;IACD,IAAI,CAAC,uBAAuB,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAEtD;IAED,IACI,KAAK,IAGQ,MA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,KAAK,EAAE,MAAM,EAGtB;IAGe,KAAK,EAAG,gBAAgB,CAAC;;IAOhC,KAAK;cAIK,MAAM,IAAI,kBAAkB;CA8ChD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
@@ -121,10 +121,10 @@ __decorate([
121
121
  property({ reflect: true })
122
122
  ], UmTextField.prototype, "placeholder", void 0);
123
123
  __decorate([
124
- property({ attribute: supportingTextAttribute })
124
+ property({ attribute: 'supporting-text' })
125
125
  ], UmTextField.prototype, "supportingText", void 0);
126
126
  __decorate([
127
- property({ attribute: errorTextAttribute })
127
+ property({ attribute: 'error-text' })
128
128
  ], UmTextField.prototype, "errorText", void 0);
129
129
  __decorate([
130
130
  property({ attribute: 'prefix-text' })
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../src/text-field/text-field.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,OAAO,mBAAmB,CAAC;AAE3B,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAClD,MAAM,kBAAkB,GAAG,YAAY,CAAC;AACxC,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAC1C,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAE1C,MAAM,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E,IAAI;CACrB,AAHgC,CAG/B;AAEU;IAAX,QAAQ,EAAE;4CAA2C;AAC1C;IAAX,QAAQ,EAAE;0CAA2B;AAC1B;IAAX,QAAQ,EAAE;4CAA6B;AACb;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;gDAAiC;AACX;IAA/C,QAAQ,CAAC,EAAC,SAAS,EAAE,uBAAuB,EAAC,CAAC;mDAAoC;AACxC;IAA1C,QAAQ,CAAC,EAAC,SAAS,EAAE,kBAAkB,EAAC,CAAC;8CAA+B;AACnC;IAArC,QAAQ,CAAC,EAAC,SAAS,EAAE,aAAa,EAAC,CAAC;+CAAgC;AAC/B;IAArC,QAAQ,CAAC,EAAC,SAAS,EAAE,aAAa,EAAC,CAAC;+CAAgC;AAE3B;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CAAkB;AACjB;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAAiB;AAgB1D;IADC,QAAQ,EAAE;wCAGV;AAOe;IAAf,KAAK,CAAC,OAAO,CAAC;0CAA0B;AA7C9B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAsGvB","sourcesContent":["import { html, HTMLTemplateResult, LitElement, nothing } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { live } from 'lit/directives/live.js';\n\nimport { styles as baseStyles } from '../shared/base.styles.js';\nimport { styles } from './text-field.styles.js';\n\nimport { config } from '../config.js';\nimport { mixinAttributeProperties } from '../shared/mixin-attribute-properties.js';\n\nimport '../field/field.js';\n\nconst supportingTextAttribute = 'supporting-text';\nconst errorTextAttribute = 'error-text';\nconst prefixTextAttribute = 'prefix-text';\nconst suffixTextAttribute = 'suffix-text';\n\nconst textFieldBase = mixinAttributeProperties(\n LitElement,\n supportingTextAttribute,\n errorTextAttribute,\n prefixTextAttribute,\n suffixTextAttribute);\n\n@customElement('u-text-field')\nexport class UmTextField extends textFieldBase {\n static readonly formAssociated = true;\n\n static override styles = [baseStyles, styles];\n\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n @property() variant = config.fields.defaultAppearance;\n @property() label: string | undefined;\n @property() counter: string | undefined;\n @property({reflect: true}) placeholder: string | undefined;\n @property({attribute: supportingTextAttribute}) supportingText: string | undefined;\n @property({attribute: errorTextAttribute}) errorText: string | undefined;\n @property({attribute: 'prefix-text'}) prefixText: string | undefined;\n @property({attribute: 'suffix-text'}) suffixText: string | undefined;\n\n @property({type: Boolean, reflect: true}) disabled = false;\n @property({type: Boolean, reflect: true}) invalid = false;\n\n #value: string = '';\n\n get form(): HTMLFormElement | null {\n return this.#elementInternals.form;\n }\n\n get [supportingTextAttribute](): string | undefined {\n return this.supportingText;\n }\n set [supportingTextAttribute](value: string | undefined) {\n this.supportingText = value;\n }\n\n @property()\n get value() {\n return this.#value;\n }\n set value(value: string) {\n this.#value = value;\n this.#elementInternals.setFormValue(value);\n }\n\n readonly #elementInternals: ElementInternals;\n @query('input') input!: HTMLInputElement;\n\n constructor() {\n super();\n this.#elementInternals = this.attachInternals();\n }\n\n override focus() {\n this.input.focus();\n }\n\n protected override render(): HTMLTemplateResult {\n const label = this.label\n ? html`<label slot=\"label\" id=\"label\">${this.label}</label>`\n : html`<slot slot=\"label\" name=\"label\"></slot>`;\n\n const supportingText = this.supportingText\n ? html`<span slot=\"supporting-text\">${this.supportingText}</span>`\n : html`<slot slot=\"supporting-text\" name=\"supporting-text\"></slot>`;\n\n const errorText = this.errorText\n ? html`<span slot=\"error-text\">${this.errorText}</span>`\n : html`<slot slot=\"error-text\" name=\"error-text\"></slot>`;\n const prefix = html`<span class=\"prefix\" slot=\"prefix\">${this.prefixText || html`<slot name=\"prefix\"></slot>`}</span>`;\n const suffix = html`<span class=\"suffix\" slot=\"suffix\">${this.suffixText || html`<slot name=\"suffix\"></slot>`}</span>`;\n const counter = this.counter\n ? html`<span slot=\"counter\">${this.counter}</span>`\n : html`<slot slot=\"counter\" name=\"counter\"></slot>`;\n\n return html`\n <u-field\n .variant=${this.variant}\n ?invalid=${this.invalid}\n ?disabled=${this.disabled}\n ?empty=${!this.#value}>\n ${label}\n <slot slot=\"leading-icon\" name=\"leading-icon\"></slot>\n ${prefix}\n <input\n part=\"input\"\n id=${this.id || nothing}\n aria-labelledby=\"label\"\n ?disabled=${this.disabled}\n placeholder=${this.placeholder || nothing}\n .value=${live(this.#value)}\n @input=${this.#handleInput} />\n ${suffix}\n <slot slot=\"trailing-icon\" name=\"trailing-icon\"></slot>\n ${supportingText}\n ${errorText}\n ${counter}\n </u-field>`;\n }\n\n #handleInput() {\n this.value = this.input.value;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-text-field': UmTextField;\n }\n}\n"]}
1
+ {"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../src/text-field/text-field.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,OAAO,mBAAmB,CAAC;AAE3B,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAClD,MAAM,kBAAkB,GAAG,YAAY,CAAC;AACxC,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAC1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AClD,GAAG,UAAU,CAAC,iBAAiB;IAC/B,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAEU;IAAX,QAAQ,EAAE;4CAA2C;AAC1C;IAAX,QAAQ,EAAE;0CAA2B;AAC1B;IAAX,QAAQ,EAAE;4CAA6B;AACb;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;gDAAiC;AACjB;IAAzC,QAAQ,CAAC,EAAC,SAAS,EAAE,iBAAiB,EAAC,CAAC;mDAAoC;AACxC;IAApC,QAAQ,CAAC,EAAC,SAAS,EAAE,YAAY,EAAC,CAAC;8CAA+B;AAC7B;IAArC,QAAQ,CAAC,EAAC,SAAS,EAAE,aAAa,EAAC,CAAC;+CAAgC;AAC/B;IAArC,QAAQ,CAAC,EAAC,SAAS,EAAE,aAAa,EAAC,CAAC;+CAAgC;AAE3B;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CAAkB;AACjB;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAAiB;AAgB1D;IADC,QAAQ,EAAE;wCAGV;AAOe;IAAf,KAAK,CAAC,OAAO,CAAC;0CAA0B;AA7C9B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAsGvB","sourcesContent":["import { html, HTMLTemplateResult, LitElement, nothing } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { live } from 'lit/directives/live.js';\n\nimport { styles as baseStyles } from '../shared/base.styles.js';\nimport { styles } from './text-field.styles.js';\n\nimport { config } from '../config.js';\nimport { mixinAttributeProperties } from '../shared/mixin-attribute-properties.js';\n\nimport '../field/field.js';\n\nconst supportingTextAttribute = 'supporting-text';\nconst errorTextAttribute = 'error-text';\nconst prefixTextAttribute = 'prefix-text';\nconst suffixTextAttribute = 'suffix-text';\n\nconst textFieldBase = mixinAttributeProperties(\n LitElement,\n supportingTextAttribute,\n errorTextAttribute,\n prefixTextAttribute,\n suffixTextAttribute);\n\n@customElement('u-text-field')\nexport class UmTextField extends textFieldBase {\n static readonly formAssociated = true;\n\n static override styles = [baseStyles, styles];\n\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n @property() variant = config.fields.defaultAppearance;\n @property() label: string | undefined;\n @property() counter: string | undefined;\n @property({reflect: true}) placeholder: string | undefined;\n @property({attribute: 'supporting-text'}) supportingText: string | undefined;\n @property({attribute: 'error-text'}) errorText: string | undefined;\n @property({attribute: 'prefix-text'}) prefixText: string | undefined;\n @property({attribute: 'suffix-text'}) suffixText: string | undefined;\n\n @property({type: Boolean, reflect: true}) disabled = false;\n @property({type: Boolean, reflect: true}) invalid = false;\n\n #value: string = '';\n\n get form(): HTMLFormElement | null {\n return this.#elementInternals.form;\n }\n\n get [supportingTextAttribute](): string | undefined {\n return this.supportingText;\n }\n set [supportingTextAttribute](value: string | undefined) {\n this.supportingText = value;\n }\n\n @property()\n get value() {\n return this.#value;\n }\n set value(value: string) {\n this.#value = value;\n this.#elementInternals.setFormValue(value);\n }\n\n readonly #elementInternals: ElementInternals;\n @query('input') input!: HTMLInputElement;\n\n constructor() {\n super();\n this.#elementInternals = this.attachInternals();\n }\n\n override focus() {\n this.input.focus();\n }\n\n protected override render(): HTMLTemplateResult {\n const label = this.label\n ? html`<label slot=\"label\" id=\"label\">${this.label}</label>`\n : html`<slot slot=\"label\" name=\"label\"></slot>`;\n\n const supportingText = this.supportingText\n ? html`<span slot=\"supporting-text\">${this.supportingText}</span>`\n : html`<slot slot=\"supporting-text\" name=\"supporting-text\"></slot>`;\n\n const errorText = this.errorText\n ? html`<span slot=\"error-text\">${this.errorText}</span>`\n : html`<slot slot=\"error-text\" name=\"error-text\"></slot>`;\n const prefix = html`<span class=\"prefix\" slot=\"prefix\">${this.prefixText || html`<slot name=\"prefix\"></slot>`}</span>`;\n const suffix = html`<span class=\"suffix\" slot=\"suffix\">${this.suffixText || html`<slot name=\"suffix\"></slot>`}</span>`;\n const counter = this.counter\n ? html`<span slot=\"counter\">${this.counter}</span>`\n : html`<slot slot=\"counter\" name=\"counter\"></slot>`;\n\n return html`\n <u-field\n .variant=${this.variant}\n ?invalid=${this.invalid}\n ?disabled=${this.disabled}\n ?empty=${!this.#value}>\n ${label}\n <slot slot=\"leading-icon\" name=\"leading-icon\"></slot>\n ${prefix}\n <input\n part=\"input\"\n id=${this.id || nothing}\n aria-labelledby=\"label\"\n ?disabled=${this.disabled}\n placeholder=${this.placeholder || nothing}\n .value=${live(this.#value)}\n @input=${this.#handleInput} />\n ${suffix}\n <slot slot=\"trailing-icon\" name=\"trailing-icon\"></slot>\n ${supportingText}\n ${errorText}\n ${counter}\n </u-field>`;\n }\n\n #handleInput() {\n this.value = this.input.value;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-text-field': UmTextField;\n }\n}\n"]}