infinity-forge 12.4.0 → 12.4.1
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/ui/components/change-password/index.d.ts +1 -0
- package/dist/ui/components/change-password/index.js +110 -0
- package/dist/ui/components/change-password/index.js.map +1 -0
- package/dist/ui/components/change-password/styles.d.ts +1 -0
- package/dist/ui/components/change-password/styles.js +14 -0
- package/dist/ui/components/change-password/styles.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ChangePassword(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
+
function step(op) {
|
|
49
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
52
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
+
switch (op[0]) {
|
|
54
|
+
case 0: case 1: t = op; break;
|
|
55
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
+
default:
|
|
59
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
+
if (t[2]) _.ops.pop();
|
|
64
|
+
_.trys.pop(); continue;
|
|
65
|
+
}
|
|
66
|
+
op = body.call(thisArg, _);
|
|
67
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
|
+
exports.ChangePassword = ChangePassword;
|
|
73
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
74
|
+
var ui_1 = require("../../../ui/index.js");
|
|
75
|
+
var system_1 = require("../../../system/index.js");
|
|
76
|
+
var S = __importStar(require("./styles.js"));
|
|
77
|
+
function ChangePassword() {
|
|
78
|
+
var _this = this;
|
|
79
|
+
var createToast = (0, ui_1.useToast)().createToast;
|
|
80
|
+
var user = (0, system_1.useAuthAdmin)().user;
|
|
81
|
+
var isGoogleUser = (user === null || user === void 0 ? void 0 : user.externalRef) === 'google';
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)(S.ChangePassword, { children: [isGoogleUser && ((0, jsx_runtime_1.jsx)("div", { className: 'google', children: (0, jsx_runtime_1.jsx)("h3", { className: 'font-16-regular manrope', children: "Voc\u00EA realizou o acesso pela sua conta google" }) })), !isGoogleUser && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(ui_1.FormHandler, { disableEnterKeySubmitForm: true, cleanFieldsOnSubmit: false, button: { text: 'Salvar' }, schema: {
|
|
83
|
+
password: ui_1.schema.required(),
|
|
84
|
+
newPassword: ui_1.schema.password(),
|
|
85
|
+
confirmNewPassword: ui_1.schema.confirmPassword({
|
|
86
|
+
refField: 'newPassword',
|
|
87
|
+
message: function (value) { return 'As senhas não são iguais'; },
|
|
88
|
+
}),
|
|
89
|
+
}, onSucess: function (formData) { return __awaiter(_this, void 0, void 0, function () {
|
|
90
|
+
var error_1;
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
switch (_a.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
_a.trys.push([0, 2, , 3]);
|
|
95
|
+
return [4 /*yield*/, (0, ui_1.api)({ url: 'Account/user/password', method: 'post', body: formData })];
|
|
96
|
+
case 1:
|
|
97
|
+
_a.sent();
|
|
98
|
+
createToast({ message: 'Senha alterada com sucesso', status: 'success' });
|
|
99
|
+
return [3 /*break*/, 3];
|
|
100
|
+
case 2:
|
|
101
|
+
error_1 = _a.sent();
|
|
102
|
+
console.error(error_1);
|
|
103
|
+
createToast({ message: 'Erro ao alterar senha', status: 'error' });
|
|
104
|
+
return [3 /*break*/, 3];
|
|
105
|
+
case 3: return [2 /*return*/];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}); }, children: [(0, jsx_runtime_1.jsx)(ui_1.InputPassword, { name: 'password', label: 'Senha atual', placeholder: 'Digite sua senha atual' }), (0, jsx_runtime_1.jsx)(ui_1.InputPassword, { name: 'newPassword', label: 'Nova senha', placeholder: 'Digite sua nova senha' }), (0, jsx_runtime_1.jsx)(ui_1.InputPassword, { name: 'confirmNewPassword', label: 'Confirme a sua nova senha', placeholder: 'Confirme sua nova senha' })] }) }))] }));
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/components/change-password/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wCAmDC;;AAzDD,2BAAwE;AAExE,mCAAuC;AAEvC,0CAA6B;AAE7B,SAAgB,cAAc;IAA9B,iBAmDC;IAlDS,IAAA,WAAW,GAAK,IAAA,aAAQ,GAAE,YAAf,CAAe;IAE1B,IAAA,IAAI,GAAK,IAAA,qBAAY,GAAE,KAAnB,CAAmB;IAC/B,IAAM,YAAY,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,MAAK,QAAQ,CAAA;IAEnD,OAAO,CACL,wBAAC,CAAC,CAAC,cAAc,eACd,YAAY,IAAI,CACf,gCAAK,SAAS,EAAC,QAAQ,YACrB,+BAAI,SAAS,EAAC,yBAAyB,kEAAkD,GACrF,CACP,EAEA,CAAC,YAAY,IAAI,CAChB,0CACE,wBAAC,gBAAW,IACV,yBAAyB,QACzB,mBAAmB,EAAE,KAAK,EAC1B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAC1B,MAAM,EAAE;wBACN,QAAQ,EAAE,WAAM,CAAC,QAAQ,EAAE;wBAC3B,WAAW,EAAE,WAAM,CAAC,QAAQ,EAAE;wBAC9B,kBAAkB,EAAE,WAAM,CAAC,eAAe,CAAC;4BACzC,QAAQ,EAAE,aAAa;4BACvB,OAAO,EAAE,UAAC,KAAK,IAAK,OAAA,0BAA0B,EAA1B,CAA0B;yBAC/C,CAAC;qBACH,EACD,QAAQ,EAAE,UAAO,QAAQ;;;;;;oCAErB,qBAAM,IAAA,QAAG,EAAC,EAAE,GAAG,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAA;;oCAA3E,SAA2E,CAAA;oCAE3E,WAAW,CAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAA;;;;oCAEzE,OAAO,CAAC,KAAK,CAAC,OAAK,CAAC,CAAA;oCACpB,WAAW,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;;;;;yBAErE,aAED,uBAAC,kBAAa,IAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,aAAa,EAAC,WAAW,EAAC,wBAAwB,GAAG,EAC1F,uBAAC,kBAAa,IAAC,IAAI,EAAC,aAAa,EAAC,KAAK,EAAC,YAAY,EAAC,WAAW,EAAC,uBAAuB,GAAG,EAC3F,uBAAC,kBAAa,IACZ,IAAI,EAAC,oBAAoB,EACzB,KAAK,EAAC,2BAA2B,EACjC,WAAW,EAAC,yBAAyB,GACrC,IACU,GACV,CACP,IACgB,CACpB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ChangePassword: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ChangePassword = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
exports.ChangePassword = (0, styled_components_1.default)('div')(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .conntent_form_infinity_forge {\n display: flex;\n flex-direction: column;\n gap: 2rem;\n }\n\n .form-button {\n max-width: 230px;\n margin-top: 3rem;\n margin-left: auto;\n }\n\n @media only screen and (max-width: 1024px) {\n .conntent_form_infinity_forge {\n gap: 0.8rem;\n }\n }\n"], ["\n .conntent_form_infinity_forge {\n display: flex;\n flex-direction: column;\n gap: 2rem;\n }\n\n .form-button {\n max-width: 230px;\n margin-top: 3rem;\n margin-left: auto;\n }\n\n @media only screen and (max-width: 1024px) {\n .conntent_form_infinity_forge {\n gap: 0.8rem;\n }\n }\n"])));
|
|
13
|
+
var templateObject_1;
|
|
14
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/ui/components/change-password/styles.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,wEAAsC;AAEzB,QAAA,cAAc,GAAG,IAAA,2BAAM,EAAC,KAAK,CAAC,sYAAA,mUAkB1C,KAAA"}
|