prlg-ui 1.8.143 → 1.8.145

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.
@@ -4655,7 +4655,7 @@ const As = /* @__PURE__ */ W({
4655
4655
  }), ki = /* @__PURE__ */ ue(As, [["__scopeId", "data-v-a004643e"]]), Os = {
4656
4656
  key: 0,
4657
4657
  class: "otp__label"
4658
- }, Bs = { key: 0 }, Ds = { class: "otp__wrapper" }, Es = ["id", "onUpdate:modelValue", "disabled", "readonly", "onInput", "onKeydown", "onPaste", "onFocus", "onBlur"], Ls = {
4658
+ }, Bs = { key: 0 }, Ds = { class: "otp__wrapper" }, Es = ["id", "onUpdate:modelValue", "disabled", "readonly", "inputmode", "onInput", "onKeydown", "onPaste", "onFocus", "onBlur"], Ls = {
4659
4659
  key: 1,
4660
4660
  class: "otp__error"
4661
4661
  }, $i = /* @__PURE__ */ W({
@@ -4669,7 +4669,8 @@ const As = /* @__PURE__ */ W({
4669
4669
  errorText: {},
4670
4670
  required: { type: Boolean, default: !1 },
4671
4671
  size: { default: "default" },
4672
- variant: { default: "outlined" }
4672
+ variant: { default: "outlined" },
4673
+ inputmode: { default: "text" }
4673
4674
  }, {
4674
4675
  modelValue: { default: "" },
4675
4676
  modelModifiers: {}
@@ -4677,12 +4678,22 @@ const As = /* @__PURE__ */ W({
4677
4678
  emits: /* @__PURE__ */ ae(["change", "complete", "focus", "blur"], ["update:modelValue"]),
4678
4679
  setup(e, { emit: l }) {
4679
4680
  const t = e, n = l, o = ie(e, "modelValue"), i = M([]), a = M([]), s = P(() => t.length);
4680
- J(() => o.value, (g) => {
4681
- a.value = g.split("").concat(Array(Math.max(0, s.value - g.length)).fill(""));
4682
- }, { immediate: !0 }), J(a, (g) => {
4683
- const C = g.join("").slice(0, s.value);
4684
- C !== o.value && (o.value = C, n("change", C), C.length === s.value && C.replace(/\s/g, "").length === s.value && n("complete", C));
4685
- }, { deep: !0 });
4681
+ J(
4682
+ () => o.value,
4683
+ (g) => {
4684
+ a.value = g.split("").concat(
4685
+ Array(Math.max(0, s.value - g.length)).fill("")
4686
+ );
4687
+ },
4688
+ { immediate: !0 }
4689
+ ), J(
4690
+ a,
4691
+ (g) => {
4692
+ const C = g.join("").slice(0, s.value);
4693
+ C !== o.value && (o.value = C, n("change", C), C.length === s.value && C.replace(/\s/g, "").length === s.value && n("complete", C));
4694
+ },
4695
+ { deep: !0 }
4696
+ );
4686
4697
  const u = P(() => [
4687
4698
  "otp",
4688
4699
  `otp--${t.size}`,
@@ -4706,7 +4717,10 @@ const As = /* @__PURE__ */ W({
4706
4717
  E.forEach((O, A) => {
4707
4718
  g + A < s.value && (a.value[g + A] = O);
4708
4719
  });
4709
- const V = Math.min(g + E.length, s.value - 1);
4720
+ const V = Math.min(
4721
+ g + E.length,
4722
+ s.value - 1
4723
+ );
4710
4724
  fe(() => {
4711
4725
  i.value[V]?.focus();
4712
4726
  });
@@ -4735,6 +4749,8 @@ const As = /* @__PURE__ */ W({
4735
4749
  maxlength: "1",
4736
4750
  disabled: g.disabled,
4737
4751
  readonly: g.readonly,
4752
+ inputmode: g.inputmode,
4753
+ pattern: "[0-9]*",
4738
4754
  onInput: (V) => r(E, V),
4739
4755
  onKeydown: (V) => c(E, V),
4740
4756
  onPaste: (V) => v(E, V),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prlg-ui",
3
3
  "private": false,
4
- "version": "1.8.143",
4
+ "version": "1.8.145",
5
5
  "type": "module",
6
6
  "main": "dist/prlg-ui.umd.js",
7
7
  "module": "dist/prlg-ui.es.js",