@social-mail/social-mail-client 1.2.147 → 1.2.149
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/content/json/countries.json +1577 -0
- package/dist/admin/AdminAppIndex.pack.js +559 -54
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +60 -9
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/controls/countries/CountrySelect.d.ts +4 -0
- package/dist/common/controls/countries/CountrySelect.d.ts.map +1 -0
- package/dist/common/controls/countries/CountrySelect.js +49 -0
- package/dist/common/controls/countries/CountrySelect.js.map +1 -0
- package/dist/common/controls/phone-editor/PhoneEditor.d.ts +5 -0
- package/dist/common/controls/phone-editor/PhoneEditor.d.ts.map +1 -0
- package/dist/common/controls/phone-editor/PhoneEditor.js +25 -0
- package/dist/common/controls/phone-editor/PhoneEditor.js.map +1 -0
- package/dist/common/form/AppForm.d.ts +3 -0
- package/dist/common/form/AppForm.d.ts.map +1 -0
- package/dist/common/form/AppForm.js +41 -0
- package/dist/common/form/AppForm.js.map +1 -0
- package/dist/common/pages/user/forgot/ForgotPassword.d.ts +24 -0
- package/dist/common/pages/user/forgot/ForgotPassword.d.ts.map +1 -0
- package/dist/common/pages/user/forgot/ForgotPassword.js +219 -0
- package/dist/common/pages/user/forgot/ForgotPassword.js.map +1 -0
- package/dist/common/pages/user/login/LoginPage.d.ts +3 -0
- package/dist/common/pages/user/login/LoginPage.d.ts.map +1 -1
- package/dist/common/pages/user/login/LoginPage.js +88 -35
- package/dist/common/pages/user/login/LoginPage.js.map +1 -1
- package/dist/common/pages/user/multi-factor/MultiFactorSetupPage.d.ts.map +1 -1
- package/dist/common/pages/user/multi-factor/MultiFactorSetupPage.js +8 -8
- package/dist/common/pages/user/multi-factor/MultiFactorSetupPage.js.map +1 -1
- package/dist/common/pages/user/multi-factor/SetupMultiFactorPage.d.ts.map +1 -1
- package/dist/common/pages/user/multi-factor/SetupMultiFactorPage.js +6 -6
- package/dist/common/pages/user/multi-factor/SetupMultiFactorPage.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.js +8 -4
- package/dist/public/channel/ChannelView.pack.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.min.js +3 -3
- package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
- package/dist/site-editor/blocks/Billboard.js +4 -2
- package/dist/site-editor/blocks/Billboard.js.map +1 -1
- package/dist/site-editor/blocks/OutlineText.d.ts +2 -0
- package/dist/site-editor/blocks/OutlineText.d.ts.map +1 -0
- package/dist/site-editor/blocks/OutlineText.js +37 -0
- package/dist/site-editor/blocks/OutlineText.js.map +1 -0
- package/dist/site-editor/drag-drop/DragDropHelper.d.ts.map +1 -1
- package/dist/site-editor/drag-drop/DragDropHelper.js +6 -0
- package/dist/site-editor/drag-drop/DragDropHelper.js.map +1 -1
- package/dist/site-editor/editor/HtmlPageEditor.d.ts.map +1 -1
- package/dist/site-editor/editor/HtmlPageEditor.js +5 -3
- package/dist/site-editor/editor/HtmlPageEditor.js.map +1 -1
- package/dist/site-editor/editor/SelectedElement.js +1 -1
- package/dist/site-editor/editor/SelectedElement.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +565 -60
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +61 -10
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/node_modules/@web-atoms/core/dist/services/FetchBuilder.d.ts.map +1 -1
- package/node_modules/@web-atoms/core/dist/services/FetchBuilder.js +2 -1
- package/node_modules/@web-atoms/core/dist/services/FetchBuilder.js.map +1 -1
- package/node_modules/@web-atoms/core/dist/services/http/JsonError.d.ts.map +1 -1
- package/node_modules/@web-atoms/core/dist/services/http/JsonError.js +5 -2
- package/node_modules/@web-atoms/core/dist/services/http/JsonError.js.map +1 -1
- package/node_modules/@web-atoms/core/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@web-atoms/core/package.json +1 -1
- package/node_modules/@web-atoms/core/src/services/FetchBuilder.ts +5 -1
- package/node_modules/@web-atoms/core/src/services/http/JsonError.ts +3 -2
- package/node_modules/@web-atoms/module-loader/package.json +1 -1
- package/node_modules/@web-atoms/module-loader/umd/src/AmdLoader.ts +1 -1
- package/node_modules/@web-atoms/module-loader/umd.js +1 -1
- package/node_modules/@web-atoms/module-loader/umd.js.map +1 -1
- package/package.json +3 -3
- package/src/common/controls/countries/CountrySelect.tsx +39 -0
- package/src/common/controls/phone-editor/PhoneEditor.tsx +12 -0
- package/src/common/form/AppForm.tsx +30 -0
- package/src/common/pages/user/forgot/ForgotPassword.tsx +229 -0
- package/src/common/pages/user/login/LoginPage.tsx +89 -20
- package/src/common/pages/user/multi-factor/MultiFactorSetupPage.tsx +9 -8
- package/src/common/pages/user/multi-factor/SetupMultiFactorPage.tsx +5 -4
- package/src/site-editor/blocks/Billboard.tsx +3 -3
- package/src/site-editor/blocks/OutlineText.tsx +27 -0
- package/src/site-editor/drag-drop/DragDropHelper.ts +6 -0
- package/src/site-editor/editor/HtmlPageEditor.tsx +2 -0
- package/src/site-editor/editor/SelectedElement.tsx +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CountrySelect.d.ts","sourceRoot":"","sources":["../../../../src/common/controls/countries/CountrySelect.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,aAAa,iBAIZ,CAAA;AAEd,eAAO,MAAM,aAAa,gBAAuB,MAAM,oBACiB,CAAC;AAEzE,eAAO,MAAM,gBAAgB,gBAAuB,MAAM,oBAUzD,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-controls/dist/basic/DropDown", "@web-atoms/core/dist/services/FetchBuilder", "@web-atoms/core/dist/core/types"], function (_export, _context) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var __awaiter, Bind, XNode, DropDown, FetchBuilder, UMD, countriesPromise, loadCountries, CountrySelect, isdForCountry, formatForCountry;
|
|
5
|
+
return {
|
|
6
|
+
setters: [function (_tslib) {
|
|
7
|
+
__awaiter = _tslib.__awaiter;
|
|
8
|
+
}, function (_webAtomsCoreDistCoreBind) {
|
|
9
|
+
Bind = _webAtomsCoreDistCoreBind.default;
|
|
10
|
+
}, function (_webAtomsCoreDistCoreXNode) {
|
|
11
|
+
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
12
|
+
}, function (_webAtomsWebControlsDistBasicDropDown) {
|
|
13
|
+
DropDown = _webAtomsWebControlsDistBasicDropDown.default;
|
|
14
|
+
}, function (_webAtomsCoreDistServicesFetchBuilder) {
|
|
15
|
+
FetchBuilder = _webAtomsCoreDistServicesFetchBuilder.default;
|
|
16
|
+
}, function (_webAtomsCoreDistCoreTypes) {
|
|
17
|
+
UMD = _webAtomsCoreDistCoreTypes.UMD;
|
|
18
|
+
}],
|
|
19
|
+
execute: function () {
|
|
20
|
+
;
|
|
21
|
+
loadCountries = () => countriesPromise !== null && countriesPromise !== void 0 ? countriesPromise : countriesPromise = FetchBuilder.get(UMD.resolvePath("@social-mail/social-mail-client/content/json/countries.json")).responseAsJson();
|
|
22
|
+
_export("CountrySelect", CountrySelect = a => XNode.create(DropDown, Object.assign({
|
|
23
|
+
labelPath: item => {
|
|
24
|
+
var _a;
|
|
25
|
+
return ((_a = item.isdCode) === null || _a === void 0 ? void 0 : _a.startsWith("+")) ? item.isdCode : `+${item.isdCode} ${item.value}`;
|
|
26
|
+
},
|
|
27
|
+
valuePath: item => item.value,
|
|
28
|
+
items: Bind.oneTimeAsync(() => loadCountries())
|
|
29
|
+
}, a)));
|
|
30
|
+
_export("isdForCountry", isdForCountry = countryCode => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
return (yield loadCountries()).find(x => x.value === countryCode).isdCode;
|
|
32
|
+
}));
|
|
33
|
+
_export("formatForCountry", formatForCountry = countryCode => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
const countries = yield loadCountries();
|
|
35
|
+
const country = countries.find(c => c.value === countryCode);
|
|
36
|
+
if (country) {
|
|
37
|
+
const {
|
|
38
|
+
phoneFormat
|
|
39
|
+
} = country;
|
|
40
|
+
if (phoneFormat && phoneFormat !== "0.0") {
|
|
41
|
+
return phoneFormat;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return "####.####.####";
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=CountrySelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Bind","_webAtomsCoreDistCoreBind","default","_webAtomsCoreDistCoreXNode","XNode","_webAtomsWebControlsDistBasicDropDown","DropDown","_webAtomsCoreDistServicesFetchBuilder","FetchBuilder","_webAtomsCoreDistCoreTypes","UMD","execute","loadCountries","countriesPromise","get","resolvePath","responseAsJson","_export","CountrySelect","a","create","Object","assign","labelPath","item","_a","isdCode","startsWith","value","valuePath","items","oneTimeAsync","isdForCountry","countryCode","__awaiter","find","x","formatForCountry","countries","country","c","phoneFormat"],"sources":["../../../../src/common/controls/countries/CountrySelect.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;MAAOA,IAAI,GAAAC,yBAAA,CAAAC,OAAA;IAAA,aAAAC,0BAAA;MACJC,KAAK,GAAAD,0BAAA,CAAAD,OAAA;IAAA,aAAAG,qCAAA;MACLC,QAAQ,GAAAD,qCAAA,CAAAH,OAAA;IAAA,aAAAK,qCAAA;MACRC,YAAY,GAAAD,qCAAA,CAAAL,OAAA;IAAA,aAAAO,0BAAA;MACVC,GAAG,GAAAD,0BAAA,CAAHC,GAAG;IAAA;IAAAC,OAAA,WAAAA,CAAA;MAQX;MAIKC,aAAa,GAAGA,CAAA,KAAMC,gBAAgB,aAAhBA,gBAAgB,cAAhBA,gBAAgB,GAAhBA,gBAAgB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version":3,"file":"PhoneEditor.d.ts","sourceRoot":"","sources":["../../../../src/common/controls/phone-editor/PhoneEditor.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG5E,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAChD,SAAS,CAAC,SAAS,IAAI,IAAI;CAM9B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
System.register(["@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/web/controls/AtomControl", "../countries/CountrySelect"], function (_export, _context) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var XNode, AtomControl, CountrySelect, PhoneEditor;
|
|
5
|
+
_export("default", void 0);
|
|
6
|
+
return {
|
|
7
|
+
setters: [function (_webAtomsCoreDistCoreXNode) {
|
|
8
|
+
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
9
|
+
}, function (_webAtomsCoreDistWebControlsAtomControl) {
|
|
10
|
+
AtomControl = _webAtomsCoreDistWebControlsAtomControl.AtomControl;
|
|
11
|
+
}, function (_countriesCountrySelect) {
|
|
12
|
+
CountrySelect = _countriesCountrySelect.CountrySelect;
|
|
13
|
+
}],
|
|
14
|
+
execute: function () {
|
|
15
|
+
_export("default", PhoneEditor = class PhoneEditor extends AtomControl {
|
|
16
|
+
preCreate() {
|
|
17
|
+
this.render(XNode.create("div", {
|
|
18
|
+
"data-layout": "row"
|
|
19
|
+
}, XNode.create(CountrySelect, null)));
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=PhoneEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PhoneEditor","_export","setters","_webAtomsCoreDistCoreXNode","XNode","default","_webAtomsCoreDistWebControlsAtomControl","AtomControl","_countriesCountrySelect","CountrySelect","execute","preCreate","render","create"],"sources":["../../../../src/common/controls/phone-editor/PhoneEditor.tsx"],"sourcesContent":[null],"mappings":";;;yCAIqBA,WAAY;EAAAC,OAAA;EAAA;IAAAC,OAAA,aAAAC,0BAAA;MAJ1BC,KAAK,GAAAD,0BAAA,CAAAE,OAAA;IAAA,aAAAC,uCAAA;MACHC,WAAW,GAAAD,uCAAA,CAAXC,WAAW;IAAA,aAAAC,uBAAA;MACXC,aAAa,GAAAD,uBAAA,CAAbC,aAAa;IAAA;IAAAC,OAAA,WAAAA,CAAA;MAAAT,OAAA,YAEDD,WAAY,GAAnB,MAAOA,WAAY,SAAQO,WAAW;QACtCI,SAASA,CAAA;UACf,IAAI,CAACC,MAAM,CAACR,KAAA,CAAAS,MAAA;YAAA,eAAiB;UAAK,GAC9BT,KAAA,CAAAS,MAAA,CAACJ,aAAa,OACR,CACJ,CAAC;QACX;OACH;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppForm.d.ts","sourceRoot":"","sources":["../../../src/common/form/AppForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,iCAAiC,CAAC;AAuBpD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,KAAA,EAAE,GAAI,KAAK,EAAE,KAAK,EAAE,OAMpD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
System.register(["@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/styled", "@web-atoms/web-controls/dist/basic/Form"], function (_export, _context) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var XNode, styled, Form;
|
|
5
|
+
function AppForm(a, ...nodes) {
|
|
6
|
+
return XNode.create(Form, Object.assign({
|
|
7
|
+
"data-app-form": "app-form"
|
|
8
|
+
}, a), ...nodes);
|
|
9
|
+
}
|
|
10
|
+
_export("default", AppForm);
|
|
11
|
+
return {
|
|
12
|
+
setters: [function (_webAtomsCoreDistCoreXNode) {
|
|
13
|
+
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
14
|
+
}, function (_webAtomsCoreDistStyleStyled) {
|
|
15
|
+
styled = _webAtomsCoreDistStyleStyled.default;
|
|
16
|
+
}, function (_webAtomsWebControlsDistBasicForm) {
|
|
17
|
+
Form = _webAtomsWebControlsDistBasicForm.default;
|
|
18
|
+
}],
|
|
19
|
+
execute: function () {
|
|
20
|
+
styled.css`
|
|
21
|
+
padding: 10px;
|
|
22
|
+
border: solid 1px lightgray;
|
|
23
|
+
border-radius: 10px;
|
|
24
|
+
gap: 10px;
|
|
25
|
+
|
|
26
|
+
& h1, & h2, &h3, &h4, &h5, &h6 {
|
|
27
|
+
margin-block-start: 20px;
|
|
28
|
+
margin-block-end: 20px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
& input {
|
|
32
|
+
outline: none;
|
|
33
|
+
border: none;
|
|
34
|
+
border-bottom: solid 1px #80808080;
|
|
35
|
+
min-width: 250px;
|
|
36
|
+
}
|
|
37
|
+
`.installGlobal("[data-app-form=app-form]");
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=AppForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AppForm","a","nodes","XNode","create","Form","Object","assign","_export","setters","_webAtomsCoreDistCoreXNode","default","_webAtomsCoreDistStyleStyled","styled","_webAtomsWebControlsDistBasicForm","execute","css","installGlobal"],"sources":["../../../src/common/form/AppForm.tsx"],"sourcesContent":[null],"mappings":";;;;EAuBc,SAAUA,OAAOA,CAACC,CAAC,EAAE,GAAIC,KAAc;IACjD,OAAOC,KAAA,CAAAC,MAAA,CAACC,IAAI,EAAAC,MAAA,CAAAC,MAAA;MAAA,iBACM;IAAU,GAClBN,CAAC,MACDC,KAAK,CACR;EACX;EAACM,OAAA,YANuBR,OAAO;EAAA;IAAAS,OAAA,aAAAC,0BAAA;MAvBxBP,KAAK,GAAAO,0BAAA,CAAAC,OAAA;IAAA,aAAAC,4BAAA;MACLC,MAAM,GAAAD,4BAAA,CAAAD,OAAA;IAAA,aAAAG,iCAAA;MACNT,IAAI,GAAAS,iCAAA,CAAAH,OAAA;IAAA;IAAAI,OAAA,WAAAA,CAAA;MAEPF,MAAM,CAACG,GAAI;;;;;;;;;;;;;;;;;KAiBV,CAACC,aAAa,CAAC,0BAA0B,CAAC;IAAC;EAAA;AAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ContentPage } from "@web-atoms/web-controls/dist/mobile-app/MobileApp";
|
|
2
|
+
interface IVerification {
|
|
3
|
+
id?: string;
|
|
4
|
+
code?: string;
|
|
5
|
+
verified?: string;
|
|
6
|
+
}
|
|
7
|
+
export default class ForgotPassword extends ContentPage {
|
|
8
|
+
model: {
|
|
9
|
+
username: string;
|
|
10
|
+
password: string;
|
|
11
|
+
passwordAgain: string;
|
|
12
|
+
phoneNumber: string;
|
|
13
|
+
country: string;
|
|
14
|
+
phoneNumberText: string;
|
|
15
|
+
captcha: IVerification;
|
|
16
|
+
phone: IVerification;
|
|
17
|
+
};
|
|
18
|
+
init(): Promise<void>;
|
|
19
|
+
resetPassword(): Promise<void>;
|
|
20
|
+
askCode(): void;
|
|
21
|
+
askPasswords(): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=ForgotPassword.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForgotPassword.d.ts","sourceRoot":"","sources":["../../../../../src/common/pages/user/forgot/ForgotPassword.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AA4BhF,UAAU,aAAa;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;IAEnD,KAAK,EAAE;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,eAAe,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,aAAa,CAAC;QACvB,KAAK,EAAE,aAAa,CAAC;KACxB,CAaC;IAEI,IAAI;IAyDJ,aAAa;IAyDnB,OAAO;IAqBP,YAAY;CA4Bf"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/styled", "@web-atoms/web-controls/dist/basic/Form", "@web-atoms/web-controls/dist/basic/FormField", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "../../../controls/countries/CountrySelect", "@web-atoms/web-controls/dist/basic/MaskedInput", "@web-atoms/core/dist/services/FetchBuilder", "@web-atoms/core/dist/view-model/Action", "@web-atoms/core/dist/web/services/PopupService", "@web-atoms/web-controls/dist/basic/PasswordBox"], function (_export, _context) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var __awaiter, __decorate, __metadata, Bind, XNode, styled, Form, FormField, ContentPage, CountrySelect, formatForCountry, isdForCountry, MaskedInput, FetchBuilder, Action, PopupService, PasswordBox, ForgotPassword, css;
|
|
5
|
+
_export("default", void 0);
|
|
6
|
+
return {
|
|
7
|
+
setters: [function (_tslib) {
|
|
8
|
+
__awaiter = _tslib.__awaiter;
|
|
9
|
+
__decorate = _tslib.__decorate;
|
|
10
|
+
__metadata = _tslib.__metadata;
|
|
11
|
+
}, function (_webAtomsCoreDistCoreBind) {
|
|
12
|
+
Bind = _webAtomsCoreDistCoreBind.default;
|
|
13
|
+
}, function (_webAtomsCoreDistCoreXNode) {
|
|
14
|
+
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
15
|
+
}, function (_webAtomsCoreDistStyleStyled) {
|
|
16
|
+
styled = _webAtomsCoreDistStyleStyled.default;
|
|
17
|
+
}, function (_webAtomsWebControlsDistBasicForm) {
|
|
18
|
+
Form = _webAtomsWebControlsDistBasicForm.default;
|
|
19
|
+
}, function (_webAtomsWebControlsDistBasicFormField) {
|
|
20
|
+
FormField = _webAtomsWebControlsDistBasicFormField.default;
|
|
21
|
+
}, function (_webAtomsWebControlsDistMobileAppMobileApp) {
|
|
22
|
+
ContentPage = _webAtomsWebControlsDistMobileAppMobileApp.ContentPage;
|
|
23
|
+
}, function (_controlsCountriesCountrySelect) {
|
|
24
|
+
CountrySelect = _controlsCountriesCountrySelect.CountrySelect;
|
|
25
|
+
formatForCountry = _controlsCountriesCountrySelect.formatForCountry;
|
|
26
|
+
isdForCountry = _controlsCountriesCountrySelect.isdForCountry;
|
|
27
|
+
}, function (_webAtomsWebControlsDistBasicMaskedInput) {
|
|
28
|
+
MaskedInput = _webAtomsWebControlsDistBasicMaskedInput.default;
|
|
29
|
+
}, function (_webAtomsCoreDistServicesFetchBuilder) {
|
|
30
|
+
FetchBuilder = _webAtomsCoreDistServicesFetchBuilder.default;
|
|
31
|
+
}, function (_webAtomsCoreDistViewModelAction) {
|
|
32
|
+
Action = _webAtomsCoreDistViewModelAction.default;
|
|
33
|
+
}, function (_webAtomsCoreDistWebServicesPopupService) {
|
|
34
|
+
PopupService = _webAtomsCoreDistWebServicesPopupService.default;
|
|
35
|
+
}, function (_webAtomsWebControlsDistBasicPasswordBox) {
|
|
36
|
+
PasswordBox = _webAtomsWebControlsDistBasicPasswordBox.default;
|
|
37
|
+
}],
|
|
38
|
+
execute: function () {
|
|
39
|
+
css = styled.css`
|
|
40
|
+
& [data-border=frame] {
|
|
41
|
+
padding: 10px;
|
|
42
|
+
border-radius: 10px;
|
|
43
|
+
gap: 10px;
|
|
44
|
+
|
|
45
|
+
& h3 {
|
|
46
|
+
margin-block-start: 20px;
|
|
47
|
+
margin-block-end: 20px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
& input {
|
|
51
|
+
outline: none;
|
|
52
|
+
border: none;
|
|
53
|
+
border-bottom: solid 1px #80808080;
|
|
54
|
+
min-width: 250px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`.installLocal();
|
|
58
|
+
_export("default", ForgotPassword = class ForgotPassword extends ContentPage {
|
|
59
|
+
constructor() {
|
|
60
|
+
super(...arguments);
|
|
61
|
+
this.model = {
|
|
62
|
+
username: "",
|
|
63
|
+
password: "",
|
|
64
|
+
passwordAgain: "",
|
|
65
|
+
phoneNumber: "",
|
|
66
|
+
country: "US",
|
|
67
|
+
phoneNumberText: "",
|
|
68
|
+
phone: {
|
|
69
|
+
code: ""
|
|
70
|
+
},
|
|
71
|
+
captcha: {
|
|
72
|
+
code: ""
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
init() {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
this.hideToolbar = true;
|
|
79
|
+
this.title = "Reset Password";
|
|
80
|
+
const {
|
|
81
|
+
id
|
|
82
|
+
} = yield FetchBuilder.put("/api/users/captcha").responseAsJson();
|
|
83
|
+
this.model.captcha.id = id;
|
|
84
|
+
this.render(XNode.create("div", {
|
|
85
|
+
class: css
|
|
86
|
+
}, XNode.create("div", {
|
|
87
|
+
"data-layout": "center-all"
|
|
88
|
+
}, XNode.create(Form, {
|
|
89
|
+
"data-border": "frame"
|
|
90
|
+
}, XNode.create("h3", null, "To reset password, enter following."), XNode.create(FormField, {
|
|
91
|
+
label: "Username"
|
|
92
|
+
}, XNode.create("input", {
|
|
93
|
+
autofocus: true,
|
|
94
|
+
value: Bind.twoWaysImmediate(() => this.model.username)
|
|
95
|
+
})), XNode.create(FormField, {
|
|
96
|
+
label: "Phone Number"
|
|
97
|
+
}, XNode.create("div", {
|
|
98
|
+
"data-layout": "row"
|
|
99
|
+
}, XNode.create(CountrySelect, {
|
|
100
|
+
value: Bind.twoWaysImmediate(() => this.model.country)
|
|
101
|
+
}), XNode.create(MaskedInput, {
|
|
102
|
+
"data-mask": Bind.oneWayAsync(() => formatForCountry(this.model.country)),
|
|
103
|
+
value: Bind.twoWaysImmediate(() => this.model.phoneNumberText)
|
|
104
|
+
}))), XNode.create(FormField, {
|
|
105
|
+
label: "Captcha"
|
|
106
|
+
}, XNode.create("img", {
|
|
107
|
+
src: `/api/users/captcha/${id}`
|
|
108
|
+
})), XNode.create(FormField, {
|
|
109
|
+
label: "Enter 5 Digit Code"
|
|
110
|
+
}, XNode.create("input", {
|
|
111
|
+
type: "tel",
|
|
112
|
+
value: Bind.twoWaysImmediate(() => this.model.captcha.code)
|
|
113
|
+
})), XNode.create("div", {
|
|
114
|
+
"data-layout": "row"
|
|
115
|
+
}, XNode.create("button", {
|
|
116
|
+
"data-layout": "go-button",
|
|
117
|
+
"data-submit-event": "ask-code"
|
|
118
|
+
}, "Next"))))));
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
resetPassword() {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
const {
|
|
124
|
+
model
|
|
125
|
+
} = this;
|
|
126
|
+
if (model.phone.verified) {
|
|
127
|
+
if (!model.password) {
|
|
128
|
+
throw new Error("Password is required");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (model.password) {
|
|
132
|
+
if (model.password.length < 7) {
|
|
133
|
+
throw new Error("Password is cannot be less than 7 characters");
|
|
134
|
+
}
|
|
135
|
+
if (/\s/i.test(model.password)) {
|
|
136
|
+
throw new Error("Password must not any whitespace characters");
|
|
137
|
+
}
|
|
138
|
+
if (model.passwordAgain !== model.password) {
|
|
139
|
+
throw new Error("Passwords do not match");
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const isdCode = yield isdForCountry(model.country);
|
|
143
|
+
const phoneNumber = model.phoneNumberText.replace(/[^0-9]/g, "");
|
|
144
|
+
model.phoneNumber = isdCode.startsWith("+") ? isdCode + phoneNumber : `+${isdCode}${phoneNumber}`;
|
|
145
|
+
const {
|
|
146
|
+
userID,
|
|
147
|
+
phone,
|
|
148
|
+
captcha
|
|
149
|
+
} = yield FetchBuilder.post("/api/users/password/reset/").jsonBody(this.model).responseAsJson();
|
|
150
|
+
if (captcha === null || captcha === void 0 ? void 0 : captcha.verified) {
|
|
151
|
+
model.captcha.verified = captcha.verified;
|
|
152
|
+
}
|
|
153
|
+
if (userID) {
|
|
154
|
+
yield PopupService.alert({
|
|
155
|
+
message: "Password has been reset successully, please login with your new password."
|
|
156
|
+
});
|
|
157
|
+
location.href = "/";
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (phone.verified) {
|
|
161
|
+
this.model.phone.verified = phone.verified;
|
|
162
|
+
this.askPasswords();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (phone.id) {
|
|
166
|
+
this.model.phone.id = phone.id;
|
|
167
|
+
}
|
|
168
|
+
this.askCode();
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
askCode() {
|
|
172
|
+
this.renderer = XNode.create("div", {
|
|
173
|
+
class: css
|
|
174
|
+
}, XNode.create("div", {
|
|
175
|
+
"data-layout": "center-all"
|
|
176
|
+
}, XNode.create(Form, {
|
|
177
|
+
"data-border": "frame"
|
|
178
|
+
}, XNode.create("h3", null, "Enter verification code."), XNode.create(FormField, {
|
|
179
|
+
label: "Code"
|
|
180
|
+
}, XNode.create("input", {
|
|
181
|
+
type: "tel",
|
|
182
|
+
value: Bind.twoWaysImmediate(() => this.model.phone.code)
|
|
183
|
+
})), XNode.create("div", {
|
|
184
|
+
"data-layout": "row"
|
|
185
|
+
}, XNode.create("button", {
|
|
186
|
+
"data-layout": "go-button",
|
|
187
|
+
"data-submit-event": "ask-code"
|
|
188
|
+
}, "Next")))));
|
|
189
|
+
}
|
|
190
|
+
askPasswords() {
|
|
191
|
+
this.renderer = XNode.create("div", {
|
|
192
|
+
class: css
|
|
193
|
+
}, XNode.create("div", {
|
|
194
|
+
"data-layout": "center-all"
|
|
195
|
+
}, XNode.create(Form, {
|
|
196
|
+
"data-border": "frame"
|
|
197
|
+
}, XNode.create("h3", null, "Enter new password."), XNode.create(FormField, {
|
|
198
|
+
label: "Password"
|
|
199
|
+
}, XNode.create(PasswordBox, {
|
|
200
|
+
value: Bind.twoWaysImmediate(() => this.model.password)
|
|
201
|
+
})), XNode.create(FormField, {
|
|
202
|
+
label: "Password Again"
|
|
203
|
+
}, XNode.create(PasswordBox, {
|
|
204
|
+
value: Bind.twoWaysImmediate(() => this.model.passwordAgain)
|
|
205
|
+
})), XNode.create("div", {
|
|
206
|
+
"data-layout": "row"
|
|
207
|
+
}, XNode.create("button", {
|
|
208
|
+
"data-layout": "go-button",
|
|
209
|
+
"data-submit-event": "ask-code"
|
|
210
|
+
}, "Next")))));
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
__decorate([Action({
|
|
214
|
+
onEvent: "ask-code"
|
|
215
|
+
}), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], ForgotPassword.prototype, "resetPassword", null);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
//# sourceMappingURL=ForgotPassword.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ForgotPassword","css","_export","setters","_tslib","Bind","_webAtomsCoreDistCoreBind","default","_webAtomsCoreDistCoreXNode","XNode","_webAtomsCoreDistStyleStyled","styled","_webAtomsWebControlsDistBasicForm","Form","_webAtomsWebControlsDistBasicFormField","FormField","_webAtomsWebControlsDistMobileAppMobileApp","ContentPage","_controlsCountriesCountrySelect","CountrySelect","formatForCountry","isdForCountry","_webAtomsWebControlsDistBasicMaskedInput","MaskedInput","_webAtomsCoreDistServicesFetchBuilder","FetchBuilder","_webAtomsCoreDistViewModelAction","Action","_webAtomsCoreDistWebServicesPopupService","PopupService","_webAtomsWebControlsDistBasicPasswordBox","PasswordBox","execute","installLocal","constructor","model","username","password","passwordAgain","phoneNumber","country","phoneNumberText","phone","code","captcha","init","hideToolbar","title","id","put","responseAsJson","render","create","class","label","autofocus","value","twoWaysImmediate","oneWayAsync","src","type","resetPassword","verified","Error","length","test","isdCode","replace","startsWith","userID","post","jsonBody","alert","message","location","href","askPasswords","askCode","renderer","__decorate","onEvent"],"sources":["../../../../../src/common/pages/user/forgot/ForgotPassword.tsx"],"sourcesContent":[null],"mappings":";;;0MAuCqBA,cAAe,EAAAC,GAAA;EAAAC,OAAA;EAAA;IAAAC,OAAA,aAAAC,MAAA;;;;;MAvC7BC,IAAI,GAAAC,yBAAA,CAAAC,OAAA;IAAA,aAAAC,0BAAA;MACJC,KAAK,GAAAD,0BAAA,CAAAD,OAAA;IAAA,aAAAG,4BAAA;MACLC,MAAM,GAAAD,4BAAA,CAAAH,OAAA;IAAA,aAAAK,iCAAA;MACNC,IAAI,GAAAD,iCAAA,CAAAL,OAAA;IAAA,aAAAO,sCAAA;MACJC,SAAS,GAAAD,sCAAA,CAAAP,OAAA;IAAA,aAAAS,0CAAA;MACPC,WAAW,GAAAD,0CAAA,CAAXC,WAAW;IAAA,aAAAC,+BAAA;MACXC,aAAa,GAAAD,+BAAA,CAAbC,aAAa;MAAEC,gBAAgB,GAAAF,+BAAA,CAAhBE,gBAAgB;MAAEC,aAAa,GAAAH,+BAAA,CAAbG,aAAa;IAAA,aAAAC,wCAAA;MAChDC,WAAW,GAAAD,wCAAA,CAAAf,OAAA;IAAA,aAAAiB,qCAAA;MACXC,YAAY,GAAAD,qCAAA,CAAAjB,OAAA;IAAA,aAAAmB,gCAAA;MACZC,MAAM,GAAAD,gCAAA,CAAAnB,OAAA;IAAA,aAAAqB,wCAAA;MACNC,YAAY,GAAAD,wCAAA,CAAArB,OAAA;IAAA,aAAAuB,wCAAA;MACZC,WAAW,GAAAD,wCAAA,CAAAvB,OAAA;IAAA;IAAAyB,OAAA,WAAAA,CAAA;MAEZ/B,GAAG,GAAGU,MAAM,CAACV,GAAI;;;;;;;;;;;;;;;;;;CAkBtB,CAACgC,YAAY,EAA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Z5B,KAAA,CAAA2C,MAAA,CAACrC,SAAS;YAACuC,KAAK,EAAC;UAAgB,GAC7B7C,KAAA,CAAA2C,MAAA,CAACrB,WAAW;YACRyB,KAAK,EAAEnD,IAAI,CAACoD,gBAAgB,CAAC,MAAM,IAAI,CAACtB,KAAK,CAACG,aAAa;UAAC,EAC1D,CACE,EACZ7B,KAAA,CAAA2C,MAAA;YAAA,eAAiB;UAAK,GAClB3C,KAAA,CAAA2C,MAAA;YAAA,eACgB,WAAW;YAAA,qBACL;UAAU,UAAc,CAC5C,CAEH,CACL,CACJ;QACV;OAEH;MA1GS2B,UAAA,EADLpD,MAAM,CAAC;QAAEqD,OAAO,EAAE;MAAU,CAAC,CAAC,E,qKAwD9B;IAAA;EAAA;AAAA"}
|
|
@@ -6,6 +6,9 @@ export default class LoginPage extends ContentPage {
|
|
|
6
6
|
private authType;
|
|
7
7
|
init(): Promise<void>;
|
|
8
8
|
login(): Promise<void>;
|
|
9
|
+
showAuthenticator(): void;
|
|
10
|
+
showOTP(): void;
|
|
9
11
|
showChangePassword(): Promise<void>;
|
|
12
|
+
forgotPassword(): Promise<void>;
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=LoginPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginPage.d.ts","sourceRoot":"","sources":["../../../../../src/common/pages/user/login/LoginPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"LoginPage.d.ts","sourceRoot":"","sources":["../../../../../src/common/pages/user/login/LoginPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AA+BhF,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAAW;IAG9C,OAAO,CAAC,WAAW,CAAe;IAElC,OAAO,CAAC,KAAK,CAAgB;IAE7B,OAAO,CAAC,QAAQ,CAAC,CAAc;IAE/B,OAAO,CAAC,QAAQ,CAAU;IAEpB,IAAI;IAmDJ,KAAK;IAgBX,iBAAiB;IA0BjB,OAAO;IA2BD,kBAAkB;IAyClB,cAAc;CAUvB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "@web-atoms/web-controls/dist/basic/
|
|
1
|
+
System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "@web-atoms/web-controls/dist/basic/FormField", "../../../../model/model", "@web-atoms/core/dist/core/Bind", "@web-atoms/web-controls/dist/basic/PasswordBox", "@web-atoms/core/dist/view-model/Action", "@web-atoms/core/dist/core/InjectProperty", "../../../../services/LoginService", "../../../controls/password/PasswordStrength", "../../../validators/Validators", "../../../controls/buttons/IconButton", "@web-atoms/web-controls/dist/PageNavigator", "../forgot/ForgotPassword", "@web-atoms/core/dist/web/services/PopupService", "../../../form/AppForm"], function (_export, _context) {
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
var __awaiter, __decorate, __metadata, XNode, ContentPage,
|
|
4
|
+
var __awaiter, __decorate, __metadata, XNode, ContentPage, FormField, LoginSession, Bind, PasswordBox, Action, InjectProperty, LoginService, PasswordStrength, Validators, SaveIconTextButton, PageNavigator, ForgotPassword, PopupService, AppForm, LoginPage, authTypes;
|
|
5
5
|
_export("default", void 0);
|
|
6
6
|
return {
|
|
7
7
|
setters: [function (_tslib) {
|
|
@@ -12,8 +12,6 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-con
|
|
|
12
12
|
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
13
13
|
}, function (_webAtomsWebControlsDistMobileAppMobileApp) {
|
|
14
14
|
ContentPage = _webAtomsWebControlsDistMobileAppMobileApp.ContentPage;
|
|
15
|
-
}, function (_webAtomsWebControlsDistBasicForm) {
|
|
16
|
-
Form = _webAtomsWebControlsDistBasicForm.default;
|
|
17
15
|
}, function (_webAtomsWebControlsDistBasicFormField) {
|
|
18
16
|
FormField = _webAtomsWebControlsDistBasicFormField.default;
|
|
19
17
|
}, function (_modelModel) {
|
|
@@ -32,10 +30,16 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-con
|
|
|
32
30
|
PasswordStrength = _controlsPasswordPasswordStrength.default;
|
|
33
31
|
}, function (_validatorsValidators) {
|
|
34
32
|
Validators = _validatorsValidators.Validators;
|
|
35
|
-
}, function (_webAtomsWebControlsDistBasicToggleButtonBar) {
|
|
36
|
-
ToggleButtonBar = _webAtomsWebControlsDistBasicToggleButtonBar.default;
|
|
37
33
|
}, function (_controlsButtonsIconButton) {
|
|
38
34
|
SaveIconTextButton = _controlsButtonsIconButton.SaveIconTextButton;
|
|
35
|
+
}, function (_webAtomsWebControlsDistPageNavigator) {
|
|
36
|
+
PageNavigator = _webAtomsWebControlsDistPageNavigator.default;
|
|
37
|
+
}, function (_forgotForgotPassword) {
|
|
38
|
+
ForgotPassword = _forgotForgotPassword.default;
|
|
39
|
+
}, function (_webAtomsCoreDistWebServicesPopupService) {
|
|
40
|
+
PopupService = _webAtomsCoreDistWebServicesPopupService.default;
|
|
41
|
+
}, function (_formAppForm) {
|
|
42
|
+
AppForm = _formAppForm.default;
|
|
39
43
|
}],
|
|
40
44
|
execute: function () {
|
|
41
45
|
authTypes = [{
|
|
@@ -53,6 +57,14 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-con
|
|
|
53
57
|
}
|
|
54
58
|
init() {
|
|
55
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
this.footerRenderer = () => XNode.create("div", {
|
|
61
|
+
"data-layout": "row"
|
|
62
|
+
}, XNode.create("a", {
|
|
63
|
+
target: "_blank",
|
|
64
|
+
"data-margin-left": "auto",
|
|
65
|
+
href: "https://socialmail.me"
|
|
66
|
+
}, "Social Mail"));
|
|
67
|
+
this.hideToolbar = true;
|
|
56
68
|
this.model = LoginSession.create({});
|
|
57
69
|
this.model.userName = "";
|
|
58
70
|
this.model.checkPassword = "";
|
|
@@ -60,19 +72,27 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-con
|
|
|
60
72
|
this.model.oneTimePassword = "";
|
|
61
73
|
this.render(XNode.create("div", null, XNode.create("div", {
|
|
62
74
|
"data-layout": "center-all"
|
|
63
|
-
}, XNode.create(
|
|
75
|
+
}, XNode.create(AppForm, null, XNode.create("h3", null, "Sign in to continue"), XNode.create(FormField, {
|
|
64
76
|
label: "Username"
|
|
65
77
|
}, XNode.create("input", {
|
|
78
|
+
autofocus: true,
|
|
66
79
|
value: Bind.twoWaysImmediate(() => this.model.userName)
|
|
67
80
|
})), XNode.create(FormField, {
|
|
68
81
|
label: "Password"
|
|
69
82
|
}, XNode.create(PasswordBox, {
|
|
70
83
|
value: Bind.twoWaysImmediate(() => this.model.checkPassword)
|
|
71
|
-
})), XNode.create("div",
|
|
84
|
+
})), XNode.create("div", {
|
|
85
|
+
"data-layout": "row"
|
|
86
|
+
}, XNode.create("button", {
|
|
72
87
|
"data-layout": "accent-button",
|
|
73
88
|
"data-submit-event": "login",
|
|
74
89
|
text: "Login"
|
|
75
|
-
}))
|
|
90
|
+
})), XNode.create("div", {
|
|
91
|
+
"data-layout": "row"
|
|
92
|
+
}, XNode.create("span", {
|
|
93
|
+
"data-click-event": "forgot-password",
|
|
94
|
+
"data-layout": "link"
|
|
95
|
+
}, "Forgot password?"))))));
|
|
76
96
|
});
|
|
77
97
|
}
|
|
78
98
|
login() {
|
|
@@ -85,40 +105,59 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-con
|
|
|
85
105
|
yield this.showChangePassword();
|
|
86
106
|
return;
|
|
87
107
|
}
|
|
88
|
-
this.
|
|
89
|
-
"data-layout": "center-all"
|
|
90
|
-
}, XNode.create(Form, null, XNode.create(FormField, {
|
|
91
|
-
label: "Enter"
|
|
92
|
-
}, XNode.create(ToggleButtonBar, {
|
|
93
|
-
items: authTypes,
|
|
94
|
-
value: Bind.twoWays(() => this.authType)
|
|
95
|
-
})), XNode.create(FormField, {
|
|
96
|
-
label: "Code",
|
|
97
|
-
"style-display": Bind.oneWay(() => this.authType === "totp")
|
|
98
|
-
}, XNode.create("input", {
|
|
99
|
-
type: "tel",
|
|
100
|
-
value: Bind.twoWaysImmediate(() => this.model.timeToken)
|
|
101
|
-
})), XNode.create(FormField, {
|
|
102
|
-
label: "One Time Password",
|
|
103
|
-
"style-display": Bind.oneWay(() => this.authType !== "totp")
|
|
104
|
-
}, XNode.create("input", {
|
|
105
|
-
type: "tel",
|
|
106
|
-
value: Bind.twoWaysImmediate(() => this.model.oneTimePassword)
|
|
107
|
-
})), XNode.create("div", {
|
|
108
|
-
"data-layout": "command-row"
|
|
109
|
-
}, XNode.create(SaveIconTextButton, {
|
|
110
|
-
"event-click": () => this.login(),
|
|
111
|
-
text: "Go"
|
|
112
|
-
}))));
|
|
108
|
+
this.showAuthenticator();
|
|
113
109
|
});
|
|
114
110
|
}
|
|
111
|
+
showAuthenticator() {
|
|
112
|
+
this.renderer = XNode.create("div", {
|
|
113
|
+
"data-layout": "center-all"
|
|
114
|
+
}, XNode.create(AppForm, null, XNode.create("h4", null, "Enter Authenticator Code"), XNode.create(FormField, {
|
|
115
|
+
label: "Code"
|
|
116
|
+
}, XNode.create("input", {
|
|
117
|
+
autofocus: true,
|
|
118
|
+
type: "tel",
|
|
119
|
+
value: Bind.twoWaysImmediate(() => this.model.timeToken)
|
|
120
|
+
})), XNode.create("div", {
|
|
121
|
+
"data-layout": "row"
|
|
122
|
+
}, XNode.create("button", {
|
|
123
|
+
"event-click": () => this.showOTP(),
|
|
124
|
+
"data-layout": "link"
|
|
125
|
+
}, "Enter One Time Password instead.")), XNode.create("div", {
|
|
126
|
+
"data-layout": "command-row"
|
|
127
|
+
}, XNode.create(SaveIconTextButton, {
|
|
128
|
+
"event-click": () => this.login(),
|
|
129
|
+
text: "Go"
|
|
130
|
+
}))));
|
|
131
|
+
}
|
|
132
|
+
showOTP() {
|
|
133
|
+
this.renderer = XNode.create("div", {
|
|
134
|
+
"data-layout": "center-all"
|
|
135
|
+
}, XNode.create(AppForm, null, XNode.create("h4", null, "Enter One Time Password"), XNode.create(FormField, {
|
|
136
|
+
label: "Password"
|
|
137
|
+
}, XNode.create("input", {
|
|
138
|
+
autofocus: true,
|
|
139
|
+
type: "tel",
|
|
140
|
+
value: Bind.twoWaysImmediate(() => this.model.oneTimePassword)
|
|
141
|
+
})), XNode.create("div", {
|
|
142
|
+
"data-layout": "row"
|
|
143
|
+
}, XNode.create("button", {
|
|
144
|
+
"event-click": () => this.showAuthenticator(),
|
|
145
|
+
"data-layout": "link"
|
|
146
|
+
}, "Enter Authenticator Code instad.")), XNode.create("div", {
|
|
147
|
+
"data-layout": "command-row"
|
|
148
|
+
}, XNode.create(SaveIconTextButton, {
|
|
149
|
+
"event-click": () => this.login(),
|
|
150
|
+
text: "Go"
|
|
151
|
+
}))));
|
|
152
|
+
}
|
|
115
153
|
showChangePassword() {
|
|
116
154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
155
|
this.model.newPassword = "";
|
|
118
156
|
this.renderer = XNode.create("div", null, XNode.create("div", {
|
|
119
157
|
"data-layout": "center-all"
|
|
120
|
-
}, XNode.create(
|
|
158
|
+
}, XNode.create(AppForm, null, XNode.create("div", null, "Update your password, your one time password is expired."), XNode.create(FormField, {
|
|
121
159
|
label: "Password",
|
|
160
|
+
autofocus: true,
|
|
122
161
|
required: true,
|
|
123
162
|
error: Bind.oneWay(() => Validators.isValidPassword(this.password) ? "" : "Password must contain one symbol, one number and should be minimum 7 characters")
|
|
124
163
|
}, XNode.create(PasswordBox, {
|
|
@@ -139,11 +178,25 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/web-con
|
|
|
139
178
|
})))));
|
|
140
179
|
});
|
|
141
180
|
}
|
|
181
|
+
forgotPassword() {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
+
if (/socialmail\.me/i.test(location.href)) {
|
|
184
|
+
PageNavigator.openPage(ForgotPassword);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
yield PopupService.alert({
|
|
188
|
+
message: "Please contact your administrator"
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
}
|
|
142
192
|
});
|
|
143
193
|
__decorate([InjectProperty, __metadata("design:type", LoginService)], LoginPage.prototype, "userService", void 0);
|
|
144
194
|
__decorate([Action({
|
|
145
195
|
onEvent: "login"
|
|
146
196
|
}), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], LoginPage.prototype, "login", null);
|
|
197
|
+
__decorate([Action({
|
|
198
|
+
onEvent: "forgot-password"
|
|
199
|
+
}), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], LoginPage.prototype, "forgotPassword", null);
|
|
147
200
|
}
|
|
148
201
|
};
|
|
149
202
|
});
|