@justeattakeaway/pie-text-input 0.27.2 → 0.27.3

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.
@@ -153,7 +153,8 @@
153
153
  "text": "TextInputProps['name']"
154
154
  },
155
155
  "privacy": "public",
156
- "attribute": "name"
156
+ "attribute": "name",
157
+ "reflects": true
157
158
  },
158
159
  {
159
160
  "kind": "field",
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { LitElement as ht, nothing as Nt, html as pt, unsafeCSS as Lt } from "lit";
2
- import { property as u, query as ft } from "lit/decorators.js";
3
- import { ifDefined as f } from "lit/directives/if-defined.js";
1
+ import { LitElement as ft, nothing as Nt, html as pt, unsafeCSS as Lt } from "lit";
2
+ import { property as u, query as ht } from "lit/decorators.js";
3
+ import { ifDefined as h } from "lit/directives/if-defined.js";
4
4
  import { classMap as $t } from "lit/directives/class-map.js";
5
5
  import { live as mt } from "lit/directives/live.js";
6
6
  import { FormControlMixin as Ot, RtlMixin as Rt, wrapNativeEvent as Pt, validPropertyValues as Z, defineCustomElement as _t } from "@justeattakeaway/pie-webc-core";
7
7
  import "@justeattakeaway/pie-assistive-text";
8
- var Ht = Object.defineProperty, Dt = (v, l, h, x) => {
8
+ var Ht = Object.defineProperty, Dt = (v, l, f, x) => {
9
9
  for (var s = void 0, g = v.length - 1, E; g >= 0; g--)
10
- (E = v[g]) && (s = E(l, h, s) || s);
11
- return s && Ht(l, h, s), s;
10
+ (E = v[g]) && (s = E(l, f, s) || s);
11
+ return s && Ht(l, f, s), s;
12
12
  };
13
- class gt extends ht {
13
+ class gt extends ft {
14
14
  constructor() {
15
- super(...arguments), this.v = "0.27.2";
15
+ super(...arguments), this.v = "0.27.3";
16
16
  }
17
17
  }
18
18
  Dt([
@@ -28,7 +28,7 @@ const zt = "*,*:after,*:before{box-sizing:inherit}.c-textInput{--input-padding-b
28
28
  };
29
29
  (function() {
30
30
  (function(v) {
31
- const l = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), C = {
31
+ const l = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), C = {
32
32
  ariaAtomic: "aria-atomic",
33
33
  ariaAutoComplete: "aria-autocomplete",
34
34
  ariaBusy: "aria-busy",
@@ -338,13 +338,13 @@ const zt = "*,*:after,*:before{box-sizing:inherit}.c-textInput{--input-padding-b
338
338
  if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
339
339
  throw new TypeError("Illegal constructor");
340
340
  const a = t.getRootNode(), i = new Mt();
341
- this.states = new J(t), l.set(this, t), h.set(this, i), s.set(t, this), B(t, this), bt(t, this), Object.seal(this), a instanceof DocumentFragment && yt(a);
341
+ this.states = new J(t), l.set(this, t), f.set(this, i), s.set(t, this), B(t, this), bt(t, this), Object.seal(this), a instanceof DocumentFragment && yt(a);
342
342
  }
343
343
  checkValidity() {
344
344
  const t = l.get(this);
345
345
  if (M(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
346
346
  return !0;
347
- const a = h.get(this);
347
+ const a = f.get(this);
348
348
  if (!a.valid) {
349
349
  const i = new Event("invalid", {
350
350
  bubbles: !1,
@@ -396,7 +396,7 @@ const zt = "*,*:after,*:before{box-sizing:inherit}.c-textInput{--input-padding-b
396
396
  if (M(n, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
397
397
  throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
398
398
  L.set(this, i);
399
- const o = h.get(this), r = {};
399
+ const o = f.get(this), r = {};
400
400
  for (const k in t)
401
401
  r[k] = t[k];
402
402
  Object.keys(r).length === 0 && kt(o);
@@ -417,7 +417,7 @@ const zt = "*,*:after,*:before{box-sizing:inherit}.c-textInput{--input-padding-b
417
417
  }
418
418
  get validity() {
419
419
  const t = l.get(this);
420
- return M(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), h.get(this);
420
+ return M(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), f.get(this);
421
421
  }
422
422
  get willValidate() {
423
423
  const t = l.get(this);
@@ -495,18 +495,18 @@ const zt = "*,*:after,*:before{box-sizing:inherit}.c-textInput{--input-padding-b
495
495
  return !!customElements.polyfillWrapFlushCallback || (Vt() ? typeof window < "u" && !window.CustomStateSet && Q(HTMLElement.prototype.attachInternals) : ut(!1)), v.forceCustomStateSetPolyfill = Q, v.forceElementInternalsPolyfill = ut, Object.defineProperty(v, "__esModule", { value: !0 }), v;
496
496
  })({});
497
497
  })();
498
- var Ut = Object.defineProperty, d = (v, l, h, x) => {
498
+ var Ut = Object.defineProperty, d = (v, l, f, x) => {
499
499
  for (var s = void 0, g = v.length - 1, E; g >= 0; g--)
500
- (E = v[g]) && (s = E(l, h, s) || s);
501
- return s && Ut(l, h, s), s;
500
+ (E = v[g]) && (s = E(l, f, s) || s);
501
+ return s && Ut(l, f, s), s;
502
502
  };
503
503
  const q = "pie-text-input", Y = "assistive-text", W = class W extends Ot(Rt(gt)) {
504
504
  constructor() {
505
505
  super(...arguments), this.type = w.type, this.value = w.value, this.disabled = w.disabled, this.readonly = w.readonly, this.status = w.status, this.size = w.size, this.required = !1, this.handleInput = (l) => {
506
506
  this.value = l.target.value, this._internals.setFormValue(this.value);
507
507
  }, this.handleChange = (l) => {
508
- const h = Pt(l);
509
- this.dispatchEvent(h);
508
+ const f = Pt(l);
509
+ this.dispatchEvent(f);
510
510
  };
511
511
  }
512
512
  /**
@@ -541,7 +541,7 @@ const q = "pie-text-input", Y = "assistive-text", W = class W extends Ot(Rt(gt))
541
541
  render() {
542
542
  const {
543
543
  assistiveText: l,
544
- autocomplete: h,
544
+ autocomplete: f,
545
545
  autoFocus: x,
546
546
  disabled: s,
547
547
  inputmode: g,
@@ -577,25 +577,25 @@ const q = "pie-text-input", Y = "assistive-text", W = class W extends Ot(Rt(gt))
577
577
  <slot name="leadingIcon"></slot>
578
578
  <slot name="leadingText"></slot>
579
579
  <input
580
- type=${f(C)}
580
+ type=${h(C)}
581
581
  .value=${mt(B)}
582
- name=${f(S)}
582
+ name=${h(S)}
583
583
  ?disabled=${mt(s)}
584
- pattern=${f(N)}
585
- step=${f(L)}
586
- minlength=${f(F)}
587
- maxlength=${f(E)}
588
- min=${f(y)}
589
- max=${f(V)}
590
- autocomplete=${f(h)}
584
+ pattern=${h(N)}
585
+ step=${h(L)}
586
+ minlength=${h(F)}
587
+ maxlength=${h(E)}
588
+ min=${h(y)}
589
+ max=${h(V)}
590
+ autocomplete=${h(f)}
591
591
  ?autofocus=${x}
592
- inputmode=${f(g)}
593
- placeholder=${f($)}
592
+ inputmode=${h(g)}
593
+ placeholder=${h($)}
594
594
  ?readonly=${T}
595
595
  ?required=${R}
596
- aria-describedby=${f(l ? Y : void 0)}
596
+ aria-describedby=${h(l ? Y : void 0)}
597
597
  aria-invalid=${I === "error" ? "true" : "false"}
598
- aria-errormessage="${f(I === "error" ? Y : void 0)}"
598
+ aria-errormessage="${h(I === "error" ? Y : void 0)}"
599
599
  @input=${this.handleInput}
600
600
  @change=${this.handleChange}
601
601
  data-test-id="pie-text-input">
@@ -609,14 +609,14 @@ const q = "pie-text-input", Y = "assistive-text", W = class W extends Ot(Rt(gt))
609
609
  ${l ? pt`
610
610
  <pie-assistive-text
611
611
  id="${Y}"
612
- variant=${f(I)}
612
+ variant=${h(I)}
613
613
  data-test-id="pie-text-input-assistive-text">
614
614
  ${l}
615
615
  </pie-assistive-text>
616
616
  ` : Nt}`;
617
617
  }
618
618
  };
619
- W.shadowRootOptions = { ...ht.shadowRootOptions, delegatesFocus: !0 }, W.styles = Lt(zt);
619
+ W.shadowRootOptions = { ...ft.shadowRootOptions, delegatesFocus: !0 }, W.styles = Lt(zt);
620
620
  let c = W;
621
621
  d([
622
622
  u({ type: String, reflect: !0 }),
@@ -626,7 +626,7 @@ d([
626
626
  u({ type: String })
627
627
  ], c.prototype, "value");
628
628
  d([
629
- u({ type: String })
629
+ u({ type: String, reflect: !0 })
630
630
  ], c.prototype, "name");
631
631
  d([
632
632
  u({ type: Boolean, reflect: !0 })
@@ -682,10 +682,10 @@ d([
682
682
  u({ type: Boolean })
683
683
  ], c.prototype, "required");
684
684
  d([
685
- ft("input")
685
+ ht("input")
686
686
  ], c.prototype, "input");
687
687
  d([
688
- ft("input")
688
+ ht("input")
689
689
  ], c.prototype, "focusTarget");
690
690
  _t(q, c);
691
691
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-text-input",
3
3
  "description": "PIE Design System Input built using Web Components",
4
- "version": "0.27.2",
4
+ "version": "0.27.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
package/src/index.ts CHANGED
@@ -44,7 +44,7 @@ export class PieTextInput extends FormControlMixin(RtlMixin(PieElement)) impleme
44
44
  @property({ type: String })
45
45
  public value = defaultProps.value;
46
46
 
47
- @property({ type: String })
47
+ @property({ type: String, reflect: true })
48
48
  public name: TextInputProps['name'];
49
49
 
50
50
  @property({ type: Boolean, reflect: true })