@digital-realty/ix-field 0.0.1 → 0.0.2

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/dist/IxField.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { LitElement } from 'lit';
2
1
  import '@material/web/field/filled-field.js';
3
2
  import '@material/web/field/outlined-field.js';
3
+ import { LitElement } from 'lit';
4
4
  export declare class IxField extends LitElement {
5
+ static styles: import("lit").CSSResult;
5
6
  filled: boolean;
6
7
  disabled: boolean;
7
8
  error: boolean;
@@ -25,5 +26,5 @@ export declare class IxField extends LitElement {
25
26
  private input;
26
27
  connectedCallback(): void;
27
28
  private handleSlotInput;
28
- protected render(): import("lit-html").TemplateResult<2 | 1>;
29
+ protected render(): import("lit").TemplateResult<2 | 1>;
29
30
  }
package/dist/IxField.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { __decorate } from "tslib";
2
- import { LitElement } from 'lit';
3
- import { html as staticHtml, literal } from 'lit/static-html.js';
4
2
  import '@material/web/field/filled-field.js';
5
3
  import '@material/web/field/outlined-field.js';
4
+ import { LitElement, css } from 'lit';
6
5
  import { property } from 'lit/decorators.js';
6
+ import { literal, html as staticHtml } from 'lit/static-html.js';
7
7
  export class IxField extends LitElement {
8
8
  constructor() {
9
9
  super(...arguments);
@@ -57,6 +57,7 @@ export class IxField extends LitElement {
57
57
  max=${this.max}
58
58
  ?has-start=${this.hasStart}
59
59
  ?has-end=${this.hasEnd}
60
+ class="field"
60
61
  >
61
62
  <slot name="start" slot="start"></slot>
62
63
  <slot
@@ -67,6 +68,11 @@ export class IxField extends LitElement {
67
68
  </${tag}>`;
68
69
  }
69
70
  }
71
+ IxField.styles = css `
72
+ .field {
73
+ display: block;
74
+ }
75
+ `;
70
76
  __decorate([
71
77
  property({ type: Boolean })
72
78
  ], IxField.prototype, "filled", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"IxField.js","sourceRoot":"","sources":["../src/IxField.ts"],"names":[],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EAAE,CAAC;0CAAgB;AAE1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCAAY;AAEX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCAAU;AAKgB;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;yCAAkB;AAKnB;IAAlD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;uCAAgB","sourcesContent":["import { LitElement } from 'lit';\nimport { html as staticHtml, StaticValue, literal } from 'lit/static-html.js';\nimport '@material/web/field/filled-field.js';\nimport '@material/web/field/outlined-field.js';\nimport { property } from 'lit/decorators.js';\n\nexport class IxField extends LitElement {\n @property({ type: Boolean }) filled = false;\n\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ type: Boolean }) error = false;\n\n @property({ type: Boolean }) focused = false;\n\n @property() label = '';\n\n @property({ type: Boolean }) populated = false;\n\n @property({ type: Boolean }) required = false;\n\n @property({ type: Boolean }) resizable = false;\n\n @property({ attribute: 'supporting-text' }) supportingText = '';\n\n @property({ attribute: 'error-text' }) errorText = '';\n\n @property({ type: Number }) count = -1;\n\n @property({ type: Number }) max = -1;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({ type: Boolean, attribute: 'has-start' }) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({ type: Boolean, attribute: 'has-end' }) hasEnd = false;\n\n private input: HTMLInputElement | null = null;\n\n override connectedCallback() {\n super.connectedCallback();\n this.input = this.querySelector('input, textarea') as HTMLInputElement;\n this.handleSlotInput();\n }\n\n private handleSlotInput() {\n const length = this.input?.value?.length;\n this.count = length !== undefined ? length : this.count;\n }\n\n protected override render() {\n const tag: StaticValue = this.filled\n ? literal`md-filled-field`\n : literal`md-outlined-field`;\n\n return staticHtml`<${tag}\n ?disabled=${this.disabled}\n ?error=${this.error}\n error-text=${this.errorText}\n ?focused=${this.focused}\n label=${this.label}\n supporting-text=${this.supportingText}\n ?populated=${this.populated}\n ?required=${this.required}\n ?resizable=${this.resizable}\n count=${this.count}\n max=${this.max}\n ?has-start=${this.hasStart}\n ?has-end=${this.hasEnd}\n >\n <slot name=\"start\" slot=\"start\"></slot>\n <slot\n @input=${this.handleSlotInput}\n ></slot>\n <slot name=\"end\" slot=\"end\"></slot>\n <slot name=\"aria-describedby\" slot=\"aria-describedby\"></slot>\n </${tag}>`;\n }\n}\n"]}
1
+ {"version":3,"file":"IxField.js","sourceRoot":"","sources":["../src/IxField.ts"],"names":[],"mappings":";AAAA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAe,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE9E,MAAM,OAAO,OAAQ,SAAQ,UAAU;IAAvC;;QAO+B,WAAM,GAAG,KAAK,CAAC;QAEA,aAAQ,GAAG,KAAK,CAAC;QAEhC,UAAK,GAAG,KAAK,CAAC;QAEd,YAAO,GAAG,KAAK,CAAC;QAEjC,UAAK,GAAG,EAAE,CAAC;QAEM,cAAS,GAAG,KAAK,CAAC;QAElB,aAAQ,GAAG,KAAK,CAAC;QAEjB,cAAS,GAAG,KAAK,CAAC;QAEH,mBAAc,GAAG,EAAE,CAAC;QAEzB,cAAS,GAAG,EAAE,CAAC;QAE1B,UAAK,GAAG,CAAC,CAAC,CAAC;QAEX,QAAG,GAAG,CAAC,CAAC,CAAC;QAErC;;WAEG;QACkD,aAAQ,GAAG,KAAK,CAAC;QAEtE;;WAEG;QACgD,WAAM,GAAG,KAAK,CAAC;QAE1D,UAAK,GAA4B,IAAI,CAAC;IA0ChD,CAAC;IAxCU,iBAAiB;Q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AC;sCAAe;AAEd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAiB;AAEjC;IAAX,QAAQ,EAAE;sCAAY;AAEM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAAmB;AAElB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAAkB;AAEjB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAAmB;AAEH;IAA3C,QAAQ,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;+CAAqB;AAEzB;IAAtC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;0CAAgB;AAE1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCAAY;AAEX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCAAU;AAKgB;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;yCAAkB;AAKnB;IAAlD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;uCAAgB","sourcesContent":["import '@material/web/field/filled-field.js';\nimport '@material/web/field/outlined-field.js';\nimport { LitElement, css } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { StaticValue, literal, html as staticHtml } from 'lit/static-html.js';\n\nexport class IxField extends LitElement {\n static override styles = css`\n .field {\n display: block;\n }\n `;\n\n @property({ type: Boolean }) filled = false;\n\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ type: Boolean }) error = false;\n\n @property({ type: Boolean }) focused = false;\n\n @property() label = '';\n\n @property({ type: Boolean }) populated = false;\n\n @property({ type: Boolean }) required = false;\n\n @property({ type: Boolean }) resizable = false;\n\n @property({ attribute: 'supporting-text' }) supportingText = '';\n\n @property({ attribute: 'error-text' }) errorText = '';\n\n @property({ type: Number }) count = -1;\n\n @property({ type: Number }) max = -1;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({ type: Boolean, attribute: 'has-start' }) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({ type: Boolean, attribute: 'has-end' }) hasEnd = false;\n\n private input: HTMLInputElement | null = null;\n\n override connectedCallback() {\n super.connectedCallback();\n this.input = this.querySelector('input, textarea') as HTMLInputElement;\n this.handleSlotInput();\n }\n\n private handleSlotInput() {\n const length = this.input?.value?.length;\n this.count = length !== undefined ? length : this.count;\n }\n\n protected override render() {\n const tag: StaticValue = this.filled\n ? literal`md-filled-field`\n : literal`md-outlined-field`;\n\n return staticHtml`<${tag}\n ?disabled=${this.disabled}\n ?error=${this.error}\n error-text=${this.errorText}\n ?focused=${this.focused}\n label=${this.label}\n supporting-text=${this.supportingText}\n ?populated=${this.populated}\n ?required=${this.required}\n ?resizable=${this.resizable}\n count=${this.count}\n max=${this.max}\n ?has-start=${this.hasStart}\n ?has-end=${this.hasEnd}\n class=\"field\"\n >\n <slot name=\"start\" slot=\"start\"></slot>\n <slot\n @input=${this.handleSlotInput}\n ></slot>\n <slot name=\"end\" slot=\"end\"></slot>\n <slot name=\"aria-describedby\" slot=\"aria-describedby\"></slot>\n </${tag}>`;\n }\n}\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent ix-field following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "Digital Realty",
6
- "version": "0.0.1",
6
+ "version": "0.0.2",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -95,5 +95,5 @@
95
95
  "README.md",
96
96
  "LICENSE"
97
97
  ],
98
- "gitHead": "d57dedc86cbf4e58a5f01445702dc5f540317d00"
98
+ "gitHead": "3f03e0e887e1a3fdbeeba66e270abbb74ae7a95b"
99
99
  }