@asgardeo/react 0.6.1 → 0.6.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/cjs/index.js +16 -20
- package/dist/cjs/index.js.map +2 -2
- package/dist/index.js +16 -20
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -7468,13 +7468,6 @@ var generateId = (prefix) => {
|
|
|
7468
7468
|
return `${prefix}_${suffix}`;
|
|
7469
7469
|
};
|
|
7470
7470
|
var getInputVariant = (type, name) => {
|
|
7471
|
-
const lowerName = name.toLowerCase();
|
|
7472
|
-
if (lowerName.includes("password")) {
|
|
7473
|
-
return "PASSWORD";
|
|
7474
|
-
}
|
|
7475
|
-
if (lowerName.includes("email")) {
|
|
7476
|
-
return "EMAIL";
|
|
7477
|
-
}
|
|
7478
7471
|
switch (type.toLowerCase()) {
|
|
7479
7472
|
case "email":
|
|
7480
7473
|
return "EMAIL";
|
|
@@ -7501,15 +7494,19 @@ var getInputPlaceholder = (name, type, t) => {
|
|
|
7501
7494
|
return placeholder;
|
|
7502
7495
|
};
|
|
7503
7496
|
var convertSimpleInputToComponent = (input, t) => {
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7497
|
+
let fieldType = input.type;
|
|
7498
|
+
if (input.name.toLowerCase().includes("password") && input.type.toLowerCase() === "string") {
|
|
7499
|
+
fieldType = "password";
|
|
7500
|
+
}
|
|
7501
|
+
const variant = getInputVariant(fieldType, input.name);
|
|
7502
|
+
const label = getInputLabel(input.name, fieldType, t);
|
|
7503
|
+
const placeholder = getInputPlaceholder(input.name, fieldType, t);
|
|
7507
7504
|
return {
|
|
7508
7505
|
id: generateId("input"),
|
|
7509
7506
|
type: import_browser49.EmbeddedFlowComponentType.Input,
|
|
7510
7507
|
variant,
|
|
7511
7508
|
config: {
|
|
7512
|
-
type:
|
|
7509
|
+
type: fieldType,
|
|
7513
7510
|
label,
|
|
7514
7511
|
placeholder,
|
|
7515
7512
|
required: input.required,
|
|
@@ -7520,7 +7517,8 @@ var convertSimpleInputToComponent = (input, t) => {
|
|
|
7520
7517
|
};
|
|
7521
7518
|
};
|
|
7522
7519
|
var convertActionToComponent = (action, t) => {
|
|
7523
|
-
const
|
|
7520
|
+
const normalizedId = action.id.replace(/_auth$/, "");
|
|
7521
|
+
const i18nKey = `elements.buttons.${normalizedId}`;
|
|
7524
7522
|
let text = t(i18nKey);
|
|
7525
7523
|
if (!text || text === i18nKey) {
|
|
7526
7524
|
text = action.id.replace(/_/g, " ");
|
|
@@ -8280,13 +8278,6 @@ var generateId2 = (prefix) => {
|
|
|
8280
8278
|
return `${prefix}_${suffix}`;
|
|
8281
8279
|
};
|
|
8282
8280
|
var getInputVariant2 = (type, name) => {
|
|
8283
|
-
const lowerName = name.toLowerCase();
|
|
8284
|
-
if (lowerName.includes("password")) {
|
|
8285
|
-
return "PASSWORD";
|
|
8286
|
-
}
|
|
8287
|
-
if (lowerName.includes("email")) {
|
|
8288
|
-
return "EMAIL";
|
|
8289
|
-
}
|
|
8290
8281
|
switch (type.toLowerCase()) {
|
|
8291
8282
|
case "email":
|
|
8292
8283
|
return "EMAIL";
|
|
@@ -8313,6 +8304,10 @@ var getInputPlaceholder2 = (name, type, t) => {
|
|
|
8313
8304
|
return placeholder;
|
|
8314
8305
|
};
|
|
8315
8306
|
var convertSimpleInputToComponent2 = (input, t) => {
|
|
8307
|
+
let fieldType = input.type;
|
|
8308
|
+
if (input.name.toLowerCase().includes("password") && input.type.toLowerCase() === "string") {
|
|
8309
|
+
fieldType = "password";
|
|
8310
|
+
}
|
|
8316
8311
|
const variant = getInputVariant2(input.type, input.name);
|
|
8317
8312
|
const label = getInputLabel2(input.name, input.type, t);
|
|
8318
8313
|
const placeholder = getInputPlaceholder2(input.name, input.type, t);
|
|
@@ -8332,7 +8327,8 @@ var convertSimpleInputToComponent2 = (input, t) => {
|
|
|
8332
8327
|
};
|
|
8333
8328
|
};
|
|
8334
8329
|
var convertActionToComponent2 = (action, t) => {
|
|
8335
|
-
const
|
|
8330
|
+
const normalizedId = action.id.replace(/_auth$/, "");
|
|
8331
|
+
const i18nKey = `elements.buttons.${normalizedId}`;
|
|
8336
8332
|
let text = t(i18nKey);
|
|
8337
8333
|
if (!text || text === i18nKey) {
|
|
8338
8334
|
text = action.id.replace(/_/g, " ");
|