@asgardeo/react 0.21.3 → 0.21.4
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/cjs/index.js +36 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/index.js +36 -4
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -5335,6 +5335,16 @@ var createField = (config) => {
|
|
|
5335
5335
|
autoComplete: "email"
|
|
5336
5336
|
}
|
|
5337
5337
|
);
|
|
5338
|
+
case import_browser36.FieldType.Tel:
|
|
5339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5340
|
+
TextField_default,
|
|
5341
|
+
{
|
|
5342
|
+
...commonProps,
|
|
5343
|
+
type: "tel",
|
|
5344
|
+
onChange: (e) => onChange(e.target.value),
|
|
5345
|
+
autoComplete: "tel"
|
|
5346
|
+
}
|
|
5347
|
+
);
|
|
5338
5348
|
case import_browser36.FieldType.Date:
|
|
5339
5349
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DatePicker_default, { ...commonProps, onChange: (e) => onChange(e.target.value) });
|
|
5340
5350
|
case import_browser36.FieldType.Checkbox: {
|
|
@@ -8870,6 +8880,8 @@ var getFieldType = (variant) => {
|
|
|
8870
8880
|
switch (variant) {
|
|
8871
8881
|
case import_browser53.EmbeddedFlowComponentTypeV2.EmailInput:
|
|
8872
8882
|
return import_browser53.FieldType.Email;
|
|
8883
|
+
case import_browser53.EmbeddedFlowComponentTypeV2.PhoneInput:
|
|
8884
|
+
return import_browser53.FieldType.Tel;
|
|
8873
8885
|
case import_browser53.EmbeddedFlowComponentTypeV2.PasswordInput:
|
|
8874
8886
|
return import_browser53.FieldType.Password;
|
|
8875
8887
|
case import_browser53.EmbeddedFlowComponentTypeV2.TextInput:
|
|
@@ -8918,7 +8930,8 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8918
8930
|
switch (component.type) {
|
|
8919
8931
|
case import_browser53.EmbeddedFlowComponentTypeV2.TextInput:
|
|
8920
8932
|
case import_browser53.EmbeddedFlowComponentTypeV2.PasswordInput:
|
|
8921
|
-
case import_browser53.EmbeddedFlowComponentTypeV2.EmailInput:
|
|
8933
|
+
case import_browser53.EmbeddedFlowComponentTypeV2.EmailInput:
|
|
8934
|
+
case import_browser53.EmbeddedFlowComponentTypeV2.PhoneInput: {
|
|
8922
8935
|
const identifier = component.ref;
|
|
8923
8936
|
const value = formValues[identifier] || "";
|
|
8924
8937
|
const isTouched = touchedFields[identifier] || false;
|
|
@@ -8938,6 +8951,25 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8938
8951
|
});
|
|
8939
8952
|
return (0, import_react69.cloneElement)(field, { key });
|
|
8940
8953
|
}
|
|
8954
|
+
case import_browser53.EmbeddedFlowComponentTypeV2.OtpInput: {
|
|
8955
|
+
const identifier = component.ref;
|
|
8956
|
+
const value = formValues[identifier] || "";
|
|
8957
|
+
const isTouched = touchedFields[identifier] || false;
|
|
8958
|
+
const error = isTouched ? formErrors[identifier] : void 0;
|
|
8959
|
+
const field = createField({
|
|
8960
|
+
className: options.inputClassName,
|
|
8961
|
+
error,
|
|
8962
|
+
label: resolve(component.label) || "",
|
|
8963
|
+
name: identifier,
|
|
8964
|
+
onBlur: () => options.onInputBlur?.(identifier),
|
|
8965
|
+
onChange: (newValue) => onInputChange(identifier, newValue),
|
|
8966
|
+
placeholder: resolve(component.placeholder) || "",
|
|
8967
|
+
required: component.required || false,
|
|
8968
|
+
type: import_browser53.FieldType.Otp,
|
|
8969
|
+
value
|
|
8970
|
+
});
|
|
8971
|
+
return (0, import_react69.cloneElement)(field, { key });
|
|
8972
|
+
}
|
|
8941
8973
|
case import_browser53.EmbeddedFlowComponentTypeV2.Action: {
|
|
8942
8974
|
const actionId = component.id;
|
|
8943
8975
|
const eventType = component.eventType || "";
|
|
@@ -9318,7 +9350,7 @@ var BaseSignInContent2 = ({
|
|
|
9318
9350
|
const fields = [];
|
|
9319
9351
|
const processComponents = (comps) => {
|
|
9320
9352
|
comps.forEach((component) => {
|
|
9321
|
-
if (component.type === "TEXT_INPUT" || component.type === "PASSWORD_INPUT" || component.type === "EMAIL_INPUT") {
|
|
9353
|
+
if (component.type === "TEXT_INPUT" || component.type === "PASSWORD_INPUT" || component.type === "EMAIL_INPUT" || component.type === "PHONE_INPUT" || component.type === "OTP_INPUT") {
|
|
9322
9354
|
const identifier = component.ref;
|
|
9323
9355
|
fields.push({
|
|
9324
9356
|
initialValue: "",
|
|
@@ -12299,7 +12331,7 @@ var BaseInviteUser = ({
|
|
|
12299
12331
|
const errors = {};
|
|
12300
12332
|
const validateComponents = (comps) => {
|
|
12301
12333
|
comps.forEach((comp) => {
|
|
12302
|
-
if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT") && comp.required && comp.ref) {
|
|
12334
|
+
if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT" || comp.type === "PHONE_INPUT" || comp.type === "OTP_INPUT") && comp.required && comp.ref) {
|
|
12303
12335
|
const value = formValues[comp.ref];
|
|
12304
12336
|
if (!value || value.trim() === "") {
|
|
12305
12337
|
errors[comp.ref] = `${comp.label || comp.ref} is required`;
|
|
@@ -12758,7 +12790,7 @@ var BaseAcceptInvite = ({
|
|
|
12758
12790
|
const errors = {};
|
|
12759
12791
|
const validateComponents = (comps) => {
|
|
12760
12792
|
comps.forEach((comp) => {
|
|
12761
|
-
if ((comp.type === "PASSWORD_INPUT" || comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT") && comp.required && comp.ref) {
|
|
12793
|
+
if ((comp.type === "PASSWORD_INPUT" || comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "PHONE_INPUT" || comp.type === "OTP_INPUT") && comp.required && comp.ref) {
|
|
12762
12794
|
const value = formValues[comp.ref];
|
|
12763
12795
|
if (!value || value.trim() === "") {
|
|
12764
12796
|
errors[comp.ref] = t("validations.required.field.error");
|