@aws-amplify/ui-vue 4.2.1 → 4.2.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.
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ function _sfc_render$3(_ctx, _cache) {
46
46
  renderSlot(_ctx.$slots, "default")
47
47
  ]);
48
48
  }
49
- var __unplugin_components_2 = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$3]]);
49
+ var __unplugin_components_2$1 = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$3]]);
50
50
  const _hoisted_1$c = ["type", "data-fullwidth", "data-size", "data-fontWeight", "data-variation", "data-loading", "data-disabled", "disabled"];
51
51
  const _sfc_main$v = /* @__PURE__ */ defineComponent({
52
52
  __name: "amplify-button",
@@ -726,6 +726,33 @@ const getErrors = (errors) => {
726
726
  return [errors];
727
727
  }
728
728
  };
729
+ const censorAllButFirstAndLast = (value) => {
730
+ const split = value.trim().split("");
731
+ for (let i = 0; i < split.length; i++) {
732
+ if (i > 0 && i < split.length - 1) {
733
+ split[i] = "*";
734
+ }
735
+ }
736
+ return split.join("");
737
+ };
738
+ const censorPhoneNumber = (val) => {
739
+ if (val.length < 4) {
740
+ return val;
741
+ }
742
+ const split = val.split("");
743
+ for (let i = 0; i < split.length - 4; i++) {
744
+ split[i] = "*";
745
+ }
746
+ return split.join("");
747
+ };
748
+ const censorEmail = (val) => {
749
+ const splitEmail = val.split("@");
750
+ const censoredName = censorAllButFirstAndLast(splitEmail[0]);
751
+ return `${censoredName}@${splitEmail[1]}`;
752
+ };
753
+ const censorContactMethod = (type, value) => {
754
+ return type === "Phone Number" ? censorPhoneNumber(value) : censorEmail(value);
755
+ };
729
756
  const hasSpecialChars = (password) => ALLOWED_SPECIAL_CHARACTERS.some((char) => password.includes(char));
730
757
  const getTotpCodeURL = (issuer, username, secret) => encodeURI(`otpauth://totp/${issuer}:${username}?secret=${secret}&issuer=${issuer}`);
731
758
  function trimValues(values, ...ignored) {
@@ -829,6 +856,7 @@ const enDict$1 = {
829
856
  "Confirm Password": "Confirm Password",
830
857
  "Confirm Sign Up": "Confirm Sign Up",
831
858
  "Confirm SMS Code": "Confirm SMS Code",
859
+ "Confirm MFA Code": "Confirm MFA Code",
832
860
  "Confirm TOTP Code": "Confirm TOTP Code",
833
861
  Confirm: "Confirm",
834
862
  "Confirmation Code": "Confirmation Code",
@@ -1970,7 +1998,7 @@ const heDict$1 = {
1970
1998
  "Enter your Email": "\u05D4\u05DB\u05E0\u05E1 \u05D0\u05EA \u05D4\u05DE\u05D9\u05D9\u05DC \u05E9\u05DC\u05DA",
1971
1999
  "Enter your phone number": "\u05D4\u05DB\u05E0\u05E1 \u05D0\u05EA \u05DE\u05E1\u05E4\u05E8 \u05D4\u05D8\u05DC\u05E4\u05D5\u05DF \u05E9\u05DC\u05DA",
1972
2000
  "Enter your username": "\u05D4\u05DB\u05E0\u05E1 \u05D0\u05EA \u05E9\u05DD \u05D4\u05DE\u05EA\u05DE\u05E9 \u05E9\u05DC\u05DA",
1973
- "Forgot your password?": "\u05E9\u05D7\u05DB\u05EA \u05E1\u05D9\u05E1\u05DE\u05D0 ?",
2001
+ "Forgot your password?": "\u05E9\u05DB\u05D7\u05EA \u05E1\u05D9\u05E1\u05DE\u05D0 ?",
1974
2002
  "Hide password": "\u05D4\u05E1\u05EA\u05E8 \u05E1\u05D9\u05E1\u05DE\u05D0",
1975
2003
  Loading: "\u05D8\u05D5\u05E2\u05DF",
1976
2004
  "New password": "\u05E1\u05D9\u05E1\u05DE\u05D0 \u05D7\u05D3\u05E9\u05D4",
@@ -2098,6 +2126,7 @@ const defaultTexts$1 = {
2098
2126
  CONFIRM_RESET_PASSWORD_HEADING: "Reset your Password",
2099
2127
  CONFIRM_SIGNUP_HEADING: "Confirm Sign Up",
2100
2128
  CONFIRM_SMS: "Confirm SMS Code",
2129
+ CONFIRM_MFA_DEFAULT: "Confirm MFA Code",
2101
2130
  CONFIRM_TOTP: "Confirm TOTP Code",
2102
2131
  CONFIRM: "Confirm",
2103
2132
  CONFIRMATION_CODE: "Confirmation Code",
@@ -2391,7 +2420,7 @@ const getChallengeText = (challengeName) => {
2391
2420
  case "SOFTWARE_TOKEN_MFA":
2392
2421
  return translate(DefaultTexts.CONFIRM_TOTP);
2393
2422
  default:
2394
- throw new Error(`${translate("Unexpected challengeName encountered in ConfirmSignIn:")} ${challengeName}`);
2423
+ return translate(DefaultTexts.CONFIRM_MFA_DEFAULT);
2395
2424
  }
2396
2425
  };
2397
2426
  const getDeliveryMessageText = (codeDeliveryDetails) => {
@@ -9581,6 +9610,7 @@ function createAuthenticatorMachine(options) {
9581
9610
  ]),
9582
9611
  setActorDoneData: assign$1({
9583
9612
  actorDoneData: (context, event2) => ({
9613
+ challengeName: event2.data.challengeName,
9584
9614
  codeDeliveryDetails: event2.data.codeDeliveryDetails,
9585
9615
  missingAttributes: event2.data.missingAttributes,
9586
9616
  remoteError: event2.data.remoteError,
@@ -9914,7 +9944,7 @@ const _hoisted_4$5 = /* @__PURE__ */ createElementVNode("svg", {
9914
9944
  }, [
9915
9945
  /* @__PURE__ */ createElementVNode("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })
9916
9946
  ], -1);
9917
- const _sfc_main$u = {
9947
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
9918
9948
  __name: "base-alert",
9919
9949
  setup(__props) {
9920
9950
  const show = ref(true);
@@ -9947,7 +9977,7 @@ const _sfc_main$u = {
9947
9977
  ])) : createCommentVNode("", true);
9948
9978
  };
9949
9979
  }
9950
- };
9980
+ });
9951
9981
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
9952
9982
  __name: "base-field-set",
9953
9983
  setup(__props) {
@@ -10162,7 +10192,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
10162
10192
  return (_ctx, _cache) => {
10163
10193
  const _component_base_label = __unplugin_components_0;
10164
10194
  const _component_base_input = _sfc_main$s;
10165
- const _component_base_wrapper = __unplugin_components_2;
10195
+ const _component_base_wrapper = __unplugin_components_2$1;
10166
10196
  return openBlock(), createBlock(_component_base_wrapper, {
10167
10197
  class: normalizeClass([
10168
10198
  unref(ComponentClassName).Flex,
@@ -10206,7 +10236,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
10206
10236
  placeholder: unref(placeholderValue),
10207
10237
  type: showHideType.value,
10208
10238
  "aria-invalid": unref(hasError),
10209
- "aria-describedBy": __props.describedBy
10239
+ "aria-describedBy": __props.describedBy,
10240
+ autocapitalize: "off"
10210
10241
  }), null, 16, ["modelValue", "class", "id", "name", "autocomplete", "required", "placeholder", "type", "aria-invalid", "aria-describedBy"])
10211
10242
  ];
10212
10243
  }),
@@ -10315,7 +10346,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
10315
10346
  return (_ctx, _cache) => {
10316
10347
  const _component_base_label = __unplugin_components_0;
10317
10348
  const _component_base_select = _sfc_main$p;
10318
- const _component_base_wrapper = __unplugin_components_2;
10349
+ const _component_base_wrapper = __unplugin_components_2$1;
10319
10350
  const _component_base_input = _sfc_main$s;
10320
10351
  return openBlock(), createBlock(_component_base_wrapper, { class: "amplify-flex amplify-field amplify-textfield amplify-phonenumberfield" }, {
10321
10352
  default: withCtx(() => [
@@ -10385,7 +10416,8 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
10385
10416
  type: __props.type,
10386
10417
  placeholder: unref(placeholder),
10387
10418
  "aria-invalid": __props.hasError,
10388
- "aria-describedBy": __props.describedBy
10419
+ "aria-describedBy": __props.describedBy,
10420
+ autocapitalize: "off"
10389
10421
  }, null, 8, ["id", "autocomplete", "name", "required", "type", "placeholder", "aria-invalid", "aria-describedBy"])
10390
10422
  ];
10391
10423
  }),
@@ -10593,7 +10625,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
10593
10625
  const signInWithGoogle = computed(() => getSignInWithFederationText2(route, "google"));
10594
10626
  const orText = computed(() => getOrText());
10595
10627
  return (_ctx, _cache) => {
10596
- const _component_base_wrapper = __unplugin_components_2;
10628
+ const _component_base_wrapper = __unplugin_components_2$1;
10597
10629
  return unref(shouldShowFederatedSignIn) ? (openBlock(), createBlock(_component_base_wrapper, {
10598
10630
  key: 0,
10599
10631
  class: "amplify-flex amplify-authenticator__federated-buttons"
@@ -10676,7 +10708,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
10676
10708
  const _component_base_field_set = _sfc_main$t;
10677
10709
  const _component_base_alert = _sfc_main$u;
10678
10710
  const _component_amplify_button = _sfc_main$v;
10679
- const _component_base_wrapper = __unplugin_components_2;
10711
+ const _component_base_wrapper = __unplugin_components_2$1;
10680
10712
  const _component_base_form = _sfc_main$x;
10681
10713
  const _component_base_footer = _sfc_main$y;
10682
10714
  return renderSlot(_ctx.$slots, "signInSlotI", normalizeProps(guardReactiveProps(_ctx.$attrs)), () => [
@@ -10803,7 +10835,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
10803
10835
  const _component_base_field_set = _sfc_main$t;
10804
10836
  const _component_base_alert = _sfc_main$u;
10805
10837
  const _component_amplify_button = _sfc_main$v;
10806
- const _component_base_wrapper = __unplugin_components_2;
10838
+ const _component_base_wrapper = __unplugin_components_2$1;
10807
10839
  const _component_base_form = _sfc_main$x;
10808
10840
  const _component_base_footer = _sfc_main$y;
10809
10841
  return renderSlot(_ctx.$slots, "signUpSlotI", normalizeProps(guardReactiveProps(_ctx.$attrs)), () => [
@@ -10871,7 +10903,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
10871
10903
  });
10872
10904
  const _sfc_main$g = {};
10873
10905
  function _sfc_render$1(_ctx, _cache) {
10874
- const _component_base_wrapper = __unplugin_components_2;
10906
+ const _component_base_wrapper = __unplugin_components_2$1;
10875
10907
  return openBlock(), createBlock(_component_base_wrapper, {
10876
10908
  tabindex: "0",
10877
10909
  "aria-orientation": "horizontal",
@@ -10916,7 +10948,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
10916
10948
  };
10917
10949
  }
10918
10950
  });
10919
- const VERSION = "4.2.1";
10951
+ const VERSION = "4.2.3";
10920
10952
  const _sfc_main$e = {};
10921
10953
  function _sfc_render(_ctx, _cache) {
10922
10954
  return renderSlot(_ctx.$slots, "textI", normalizeProps(guardReactiveProps(_ctx.$attrs)), () => [
@@ -10925,7 +10957,7 @@ function _sfc_render(_ctx, _cache) {
10925
10957
  ], 16)
10926
10958
  ]);
10927
10959
  }
10928
- var __unplugin_components_3 = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render]]);
10960
+ var __unplugin_components_2 = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render]]);
10929
10961
  const _sfc_main$d = defineComponent({
10930
10962
  props: {
10931
10963
  level: {
@@ -10977,12 +11009,12 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
10977
11009
  };
10978
11010
  return (_ctx, _cache) => {
10979
11011
  const _component_base_heading = _sfc_main$d;
10980
- const _component_base_text = __unplugin_components_3;
11012
+ const _component_base_text = __unplugin_components_2;
10981
11013
  const _component_base_field_set = _sfc_main$t;
10982
11014
  const _component_base_alert = _sfc_main$u;
10983
11015
  const _component_amplify_button = _sfc_main$v;
10984
11016
  const _component_base_footer = _sfc_main$y;
10985
- const _component_base_wrapper = __unplugin_components_2;
11017
+ const _component_base_wrapper = __unplugin_components_2$1;
10986
11018
  const _component_base_form = _sfc_main$x;
10987
11019
  return renderSlot(_ctx.$slots, "confirmSignUpSlotI", normalizeProps(guardReactiveProps(_ctx.$attrs)), () => [
10988
11020
  createVNode(_component_base_wrapper, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
@@ -11094,7 +11126,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11094
11126
  };
11095
11127
  return (_ctx, _cache) => {
11096
11128
  const _component_base_heading = _sfc_main$d;
11097
- const _component_base_wrapper = __unplugin_components_2;
11129
+ const _component_base_wrapper = __unplugin_components_2$1;
11098
11130
  const _component_base_alert = _sfc_main$u;
11099
11131
  const _component_amplify_button = _sfc_main$v;
11100
11132
  const _component_base_footer = _sfc_main$y;
@@ -13241,7 +13273,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
13241
13273
  };
13242
13274
  return (_ctx, _cache) => {
13243
13275
  const _component_base_heading = _sfc_main$d;
13244
- const _component_base_wrapper = __unplugin_components_2;
13276
+ const _component_base_wrapper = __unplugin_components_2$1;
13245
13277
  const _component_base_alert = _sfc_main$u;
13246
13278
  const _component_amplify_button = _sfc_main$v;
13247
13279
  const _component_base_footer = _sfc_main$y;
@@ -13400,7 +13432,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
13400
13432
  }
13401
13433
  return (_ctx, _cache) => {
13402
13434
  const _component_base_heading = _sfc_main$d;
13403
- const _component_base_wrapper = __unplugin_components_2;
13435
+ const _component_base_wrapper = __unplugin_components_2$1;
13404
13436
  const _component_base_alert = _sfc_main$u;
13405
13437
  const _component_amplify_button = _sfc_main$v;
13406
13438
  const _component_base_footer = _sfc_main$y;
@@ -13524,7 +13556,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
13524
13556
  const _component_base_alert = _sfc_main$u;
13525
13557
  const _component_amplify_button = _sfc_main$v;
13526
13558
  const _component_base_footer = _sfc_main$y;
13527
- const _component_base_wrapper = __unplugin_components_2;
13559
+ const _component_base_wrapper = __unplugin_components_2$1;
13528
13560
  const _component_base_form = _sfc_main$x;
13529
13561
  return renderSlot(_ctx.$slots, "forgotPasswordSlotI", normalizeProps(guardReactiveProps(_ctx.$attrs)), () => [
13530
13562
  createVNode(_component_base_form, mergeProps(_ctx.$attrs, {
@@ -13635,7 +13667,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13635
13667
  }
13636
13668
  return (_ctx, _cache) => {
13637
13669
  const _component_base_heading = _sfc_main$d;
13638
- const _component_base_wrapper = __unplugin_components_2;
13670
+ const _component_base_wrapper = __unplugin_components_2$1;
13639
13671
  const _component_base_alert = _sfc_main$u;
13640
13672
  const _component_amplify_button = _sfc_main$v;
13641
13673
  const _component_base_footer = _sfc_main$y;
@@ -13750,9 +13782,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
13750
13782
  return (_ctx, _cache) => {
13751
13783
  const _component_base_heading = _sfc_main$d;
13752
13784
  const _component_base_label = __unplugin_components_0;
13785
+ const _component_base_text = __unplugin_components_2;
13753
13786
  const _component_base_input = _sfc_main$s;
13754
- const _component_base_text = __unplugin_components_3;
13755
- const _component_base_wrapper = __unplugin_components_2;
13787
+ const _component_base_wrapper = __unplugin_components_2$1;
13756
13788
  const _component_base_alert = _sfc_main$u;
13757
13789
  const _component_amplify_button = _sfc_main$v;
13758
13790
  const _component_base_footer = _sfc_main$y;
@@ -13799,35 +13831,35 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
13799
13831
  }, {
13800
13832
  default: withCtx(() => [
13801
13833
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(unverifiedUserAttributes), (value, key) => {
13802
- return openBlock(), createBlock(_component_base_label, {
13803
- class: "amplify-flex amplify-radio",
13804
- "data-amplify-verify-label": "",
13805
- id: "verify",
13806
- key: value
13807
- }, {
13808
- default: withCtx(() => [
13809
- createVNode(_component_base_input, {
13810
- class: "amplify-input amplify-field-group__control amplify-visually-hidden amplify-radio__input",
13811
- "aria-invalid": "false",
13812
- "data-amplify-verify-input": "",
13813
- id: "verify",
13814
- name: "unverifiedAttr",
13815
- type: "radio",
13816
- value: key
13817
- }, null, 8, ["value"]),
13818
- createVNode(_component_base_text, {
13819
- class: "amplify-flex amplify-radio__button",
13820
- "aria-hidden": "true"
13821
- }),
13822
- createVNode(_component_base_text, { class: "amplify-text amplify-radio__label" }, {
13823
- default: withCtx(() => [
13824
- createTextVNode(toDisplayString(unref(defaultFormFieldOptions)[key].label), 1)
13825
- ]),
13826
- _: 2
13827
- }, 1024)
13828
- ]),
13829
- _: 2
13830
- }, 1024);
13834
+ return openBlock(), createElementBlock(Fragment, { key: value }, [
13835
+ value ? (openBlock(), createBlock(_component_base_label, {
13836
+ key: 0,
13837
+ class: "amplify-flex amplify-radio",
13838
+ "data-amplify-verify-label": ""
13839
+ }, {
13840
+ default: withCtx(() => [
13841
+ createVNode(_component_base_text, { class: "amplify-text amplify-radio__label" }, {
13842
+ default: withCtx(() => [
13843
+ createTextVNode(toDisplayString(unref(translate)(unref(defaultFormFieldOptions)[key].label)) + ": " + toDisplayString(unref(censorContactMethod)(unref(defaultFormFieldOptions)[key].label, value)), 1)
13844
+ ]),
13845
+ _: 2
13846
+ }, 1024),
13847
+ createVNode(_component_base_input, {
13848
+ class: "amplify-input amplify-field-group__control amplify-visually-hidden amplify-radio__input",
13849
+ "aria-invalid": "false",
13850
+ "data-amplify-verify-input": "",
13851
+ name: "unverifiedAttr",
13852
+ type: "radio",
13853
+ value: key
13854
+ }, null, 8, ["value"]),
13855
+ createVNode(_component_base_text, {
13856
+ class: "amplify-flex amplify-radio__button",
13857
+ "aria-hidden": "true"
13858
+ })
13859
+ ]),
13860
+ _: 2
13861
+ }, 1024)) : createCommentVNode("", true)
13862
+ ], 64);
13831
13863
  }), 128))
13832
13864
  ]),
13833
13865
  _: 1
@@ -13911,7 +13943,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13911
13943
  };
13912
13944
  return (_ctx, _cache) => {
13913
13945
  const _component_base_heading = _sfc_main$d;
13914
- const _component_base_wrapper = __unplugin_components_2;
13946
+ const _component_base_wrapper = __unplugin_components_2$1;
13915
13947
  const _component_base_alert = _sfc_main$u;
13916
13948
  const _component_amplify_button = _sfc_main$v;
13917
13949
  const _component_base_footer = _sfc_main$y;
@@ -14342,7 +14374,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
14342
14374
  return (_ctx, _cache) => {
14343
14375
  const _component_base_label = __unplugin_components_0;
14344
14376
  const _component_base_input = _sfc_main$s;
14345
- const _component_base_wrapper = __unplugin_components_2;
14377
+ const _component_base_wrapper = __unplugin_components_2$1;
14346
14378
  return openBlock(), createElementBlock(Fragment, null, [
14347
14379
  createVNode(_component_base_label, {
14348
14380
  class: normalizeClass(["amplify-label", { "amplify-visually-hidden": __props.hideLabel }]),