@social-mail/social-mail-client 1.2.271 → 1.2.273
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/pwa/images/logo-128-1.png +0 -0
- package/content/pwa/images/logo-144-1.png +0 -0
- package/content/pwa/images/logo-192-1.png +0 -0
- package/content/pwa/images/logo-512-1.png +0 -0
- package/content/pwa/images/logo-72-1.png +0 -0
- package/content/pwa/manifest.json +5 -5
- package/dist/admin/AdminAppIndex.pack.js +5 -2
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/pages/user/login/LoginPage.d.ts.map +1 -1
- package/dist/common/pages/user/login/LoginPage.js +5 -2
- package/dist/common/pages/user/login/LoginPage.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +5 -2
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +1 -1
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common/pages/user/login/LoginPage.tsx +2 -0
- package/content/pwa/images/logo-128.png +0 -0
- package/content/pwa/images/logo-144.png +0 -0
- package/content/pwa/images/logo-192.png +0 -0
- package/content/pwa/images/logo-512.png +0 -0
- package/content/pwa/images/logo-72.png +0 -0
|
@@ -4686,7 +4686,7 @@ html, body {
|
|
|
4686
4686
|
min-width: 250px;
|
|
4687
4687
|
}
|
|
4688
4688
|
}
|
|
4689
|
-
`.installLocal();_export("default",ForgotPassword=class ForgotPassword extends ContentPage{constructor(){super(...arguments);this.model={username:"",password:"",passwordAgain:"",phoneNumber:"",country:"US",phoneNumberText:"",phone:{code:""},captcha:{code:""}}}init(){return __awaiter(this,void 0,void 0,(function*(){this.hideToolbar=true;this.title="Reset Password";const{id}=yield FetchBuilder.put(apiPath("/api/users/captcha")).responseAsJson();this.model.captcha.id=id;this.render(XNode.create("div",{class:css},XNode.create("div",{"data-layout":"center-all"},XNode.create(Form,{"data-border":"frame"},XNode.create("h3",null,"To reset password, enter following."),XNode.create(FormField,{label:"Username"},XNode.create("input",{autofocus:true,value:Bind.twoWaysImmediate((()=>this.model.username))})),XNode.create(FormField,{label:"Phone Number"},XNode.create("div",{"data-layout":"row"},XNode.create(CountrySelect,{value:Bind.twoWaysImmediate((()=>this.model.country))}),XNode.create(MaskedInput,{"data-mask":Bind.oneWayAsync((()=>formatForCountry(this.model.country))),value:Bind.twoWaysImmediate((()=>this.model.phoneNumberText))}))),XNode.create(FormField,{label:"Captcha"},XNode.create("img",{src:apiPath(`/api/users/captcha/${id}`)})),XNode.create(FormField,{label:"Enter 5 Digit Code"},XNode.create("input",{type:"tel",value:Bind.twoWaysImmediate((()=>this.model.captcha.code))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"data-layout":"go-button","data-submit-event":"ask-code"},"Next"))))))}))}resetPassword(){return __awaiter(this,void 0,void 0,(function*(){const{model}=this;if(model.phone.verified){if(!model.password){throw new Error("Password is required")}}if(model.password){if(model.password.length<7){throw new Error("Password is cannot be less than 7 characters")}if(/\s/i.test(model.password)){throw new Error("Password must not any whitespace characters")}if(model.passwordAgain!==model.password){throw new Error("Passwords do not match")}}const isdCode=yield isdForCountry(model.country);const phoneNumber=model.phoneNumberText.replace(/[^0-9]/g,"");model.phoneNumber=isdCode.startsWith("+")?isdCode+phoneNumber:`+${isdCode}${phoneNumber}`;const{userID,phone,captcha}=yield FetchBuilder.post(apiPath("/api/users/password/reset/")).jsonBody(this.model).responseAsJson();if(captcha===null||captcha===void 0?void 0:captcha.verified){model.captcha.verified=captcha.verified}if(userID){yield PopupService.alert({message:"Password has been reset successfully, please login with your new password."});location.href="/";return}if(phone.verified){this.model.phone.verified=phone.verified;this.askPasswords();return}if(phone.id){this.model.phone.id=phone.id}this.askCode()}))}askCode(){this.renderer=XNode.create("div",{class:css},XNode.create("div",{"data-layout":"center-all"},XNode.create(Form,{"data-border":"frame"},XNode.create("h3",null,"Enter verification code."),XNode.create(FormField,{label:"Code"},XNode.create("input",{type:"tel",value:Bind.twoWaysImmediate((()=>this.model.phone.code))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"data-layout":"go-button","data-submit-event":"ask-code"},"Next")))))}askPasswords(){this.renderer=XNode.create("div",{class:css},XNode.create("div",{"data-layout":"center-all"},XNode.create(Form,{"data-border":"frame"},XNode.create("h3",null,"Enter new password."),XNode.create(FormField,{label:"Password"},XNode.create(PasswordBox,{value:Bind.twoWaysImmediate((()=>this.model.password))})),XNode.create(FormField,{label:"Password Again"},XNode.create(PasswordBox,{value:Bind.twoWaysImmediate((()=>this.model.passwordAgain))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"data-layout":"go-button","data-submit-event":"ask-code"},"Next")))))}});__decorate([Action({onEvent:"ask-code"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],ForgotPassword.prototype,"resetPassword",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/pages/user/forgot/ForgotPassword");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","../../../../web/commands/AppCommands"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,XNode,ContentPage,FormField,LoginSession,Bind,PasswordBox,Action,InjectProperty,LoginService,PasswordStrength,Validators,SaveIconTextButton,PageNavigator,ForgotPassword,PopupService,AppForm,AppCommands,LoginPage,isSocialMail;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsWebControlsDistMobileAppMobileApp){ContentPage=_webAtomsWebControlsDistMobileAppMobileApp.ContentPage},function(_webAtomsWebControlsDistBasicFormField){FormField=_webAtomsWebControlsDistBasicFormField.default},function(_modelModel){LoginSession=_modelModel.LoginSession},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_webAtomsWebControlsDistBasicPasswordBox){PasswordBox=_webAtomsWebControlsDistBasicPasswordBox.default},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_webAtomsCoreDistCoreInjectProperty){InjectProperty=_webAtomsCoreDistCoreInjectProperty.default},function(_servicesLoginService){LoginService=_servicesLoginService.default},function(_controlsPasswordPasswordStrength){PasswordStrength=_controlsPasswordPasswordStrength.default},function(_validatorsValidators){Validators=_validatorsValidators.Validators},function(_controlsButtonsIconButton){SaveIconTextButton=_controlsButtonsIconButton.SaveIconTextButton},function(_webAtomsWebControlsDistPageNavigator){PageNavigator=_webAtomsWebControlsDistPageNavigator.default},function(_forgotForgotPassword){ForgotPassword=_forgotForgotPassword.default},function(_webAtomsCoreDistWebServicesPopupService){PopupService=_webAtomsCoreDistWebServicesPopupService.default},function(_formAppForm){AppForm=_formAppForm.default},function(_webCommandsAppCommands){AppCommands=_webCommandsAppCommands.default}],execute:function(){isSocialMail=/socialmail\.(me|in)/i.test(location.href)||/\d+.\d+.\d+.\d+/i.test(location.href);_export("default",LoginPage=class LoginPage extends ContentPage{constructor(){super(...arguments);this.password=""}init(){return __awaiter(this,void 0,void 0,(function*(){this.footerRenderer=()=>XNode.create("div",{"data-layout":"row"},XNode.create("a",{target:"_blank","data-margin-left":"auto",href:"https://socialmail.me"},"Social Mail"));this.hideToolbar=true;this.model=LoginSession.create({});this.model.userName="";this.model.checkPassword="";this.model.timeToken="";this.model.oneTimePassword="";this.render(XNode.create("div",null,XNode.create("div",{"data-layout":"center-all"},XNode.create(AppForm,null,XNode.create("h3",null,"Sign in to continue"),XNode.create(FormField,{label:"Username"},XNode.create("input",{autofocus:true,value:Bind.twoWaysImmediate((()=>this.model.userName))})),XNode.create(FormField,{label:"Password"},XNode.create(PasswordBox,{value:Bind.twoWaysImmediate((()=>this.model.checkPassword))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"data-layout":"accent-button","data-submit-event":"login",text:"Login"})),isSocialMail&&XNode.create("div",{"data-layout":"row"},XNode.create("span",{"data-click-event":"forgot-password","data-layout":"link"},"Forgot password?")),isSocialMail&&XNode.create("div",{"data-layout":"row"},XNode.create("a",{"data-click-event":"route",href:AppCommands.signup.displayRoute({})},"Sign Up"))))))}))}login(){return __awaiter(this,void 0,void 0,(function*(){const status=yield this.userService.login(this.model);if(!status){return}if(status==="change-password"){yield this.showChangePassword();return}this.showAuthenticator()}))}showAuthenticator(){this.renderer=XNode.create("div",{"data-layout":"center-all"},XNode.create(AppForm,null,XNode.create("h4",null,"Enter Authenticator Code"),XNode.create(FormField,{label:"Code"},XNode.create("input",{autofocus:true,type:"tel",value:Bind.twoWaysImmediate((()=>this.model.timeToken))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"event-click":()=>this.showOTP(),"data-layout":"link"},"Enter One Time Password instead.")),XNode.create("div",{"data-layout":"command-row"},XNode.create(SaveIconTextButton,{"event-click":()=>this.login(),text:"Go"}))))}showOTP(){this.renderer=XNode.create("div",{"data-layout":"center-all"},XNode.create(AppForm,null,XNode.create("h4",null,"Enter One Time Password"),XNode.create(FormField,{label:"Password"},XNode.create("input",{autofocus:true,type:"tel",value:Bind.twoWaysImmediate((()=>this.model.oneTimePassword))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"event-click":()=>this.showAuthenticator(),"data-layout":"link"},"Enter Authenticator Code instad.")),XNode.create("div",{"data-layout":"command-row"},XNode.create(SaveIconTextButton,{"event-click":()=>this.login(),text:"Go"}))))}showChangePassword(){return __awaiter(this,void 0,void 0,(function*(){this.model.newPassword="";this.renderer=XNode.create("div",null,XNode.create("div",{"data-layout":"center-all"},XNode.create(AppForm,null,XNode.create("div",null,"Update your password, your one time password is expired."),XNode.create(FormField,{label:"Password",autofocus:true,required:true,error:Bind.oneWay((()=>Validators.isValidPassword(this.password)?"":"Password must contain one symbol, one number and should be minimum 7 characters"))},XNode.create(PasswordBox,{value:Bind.twoWaysImmediate((()=>this.password))})),XNode.create(PasswordStrength,{password:Bind.oneWay((()=>this.password))}),XNode.create(FormField,{label:"Password Again",required:true,error:Bind.oneWay((()=>this.model.newPassword!==this.password?"Passwords do not match":""))},XNode.create(PasswordBox,{value:Bind.twoWaysImmediate((()=>this.model.newPassword))})),XNode.create("div",{"data-layout":"command-row"},XNode.create("button",{"data-submit-event":"login",text:"Change Password & Login"})))))}))}forgotPassword(){return __awaiter(this,void 0,void 0,(function*(){if(isSocialMail){PageNavigator.openPage(ForgotPassword);return}yield PopupService.alert({message:"Please contact your administrator"})}))}});__decorate([InjectProperty,__metadata("design:type",LoginService)],LoginPage.prototype,"userService",void 0);__decorate([Action({onEvent:"login"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],LoginPage.prototype,"login",null);__decorate([Action({onEvent:"forgot-password"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],LoginPage.prototype,"forgotPassword",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/pages/user/login/LoginPage");System.register(["tslib","@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/style/styled"],(function(_export,_context){"use strict";var __rest,XNode,styled;function MenuItem(_a){var{label,icon=void 0,click=undefined,title=label,description=void 0,href="",commandLink="",target=undefined,bell=void 0,bellTitle=void 0,bellClick=void 0}=_a,a=__rest(_a,["label","icon","click","title","description","href","commandLink","target","bell","bellTitle","bellClick"]);return href||commandLink?XNode.create("a",Object.assign({"data-layout":"menu-item","data-text-decoration":"none",title,"data-click-event":commandLink?"route":void 0,href:href||commandLink,target,"event-click":click},a),icon&&XNode.create("i",{class:icon}),XNode.create("span",{text:label}),description&&XNode.create("small",{text:description}),bell!==void 0&&XNode.create("i",Object.assign({"data-element":"badge",title:bellTitle,class:bell?"fad fa-bell":"fad fa-bell-slash"},typeof bellClick==="string"?{"data-click-event":bellClick}:{"data-click-event":"none","event-click":bellClick}))):XNode.create("div",Object.assign({title,"data-layout":"menu-item","event-click":click},a),icon&&XNode.create("i",{class:icon}),XNode.create("span",{text:label}),description&&XNode.create("small",{text:description}),bell!==void 0&&XNode.create("i",{"data-click-event":bellClick,"data-element":"badge",title:bellTitle,class:bell?"fad fa-bell":"fad fa-bell-slash"}))}_export("default",MenuItem);return{setters:[function(_tslib){__rest=_tslib.__rest},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default}],execute:function(){styled.css`
|
|
4689
|
+
`.installLocal();_export("default",ForgotPassword=class ForgotPassword extends ContentPage{constructor(){super(...arguments);this.model={username:"",password:"",passwordAgain:"",phoneNumber:"",country:"US",phoneNumberText:"",phone:{code:""},captcha:{code:""}}}init(){return __awaiter(this,void 0,void 0,(function*(){this.hideToolbar=true;this.title="Reset Password";const{id}=yield FetchBuilder.put(apiPath("/api/users/captcha")).responseAsJson();this.model.captcha.id=id;this.render(XNode.create("div",{class:css},XNode.create("div",{"data-layout":"center-all"},XNode.create(Form,{"data-border":"frame"},XNode.create("h3",null,"To reset password, enter following."),XNode.create(FormField,{label:"Username"},XNode.create("input",{autofocus:true,value:Bind.twoWaysImmediate((()=>this.model.username))})),XNode.create(FormField,{label:"Phone Number"},XNode.create("div",{"data-layout":"row"},XNode.create(CountrySelect,{value:Bind.twoWaysImmediate((()=>this.model.country))}),XNode.create(MaskedInput,{"data-mask":Bind.oneWayAsync((()=>formatForCountry(this.model.country))),value:Bind.twoWaysImmediate((()=>this.model.phoneNumberText))}))),XNode.create(FormField,{label:"Captcha"},XNode.create("img",{src:apiPath(`/api/users/captcha/${id}`)})),XNode.create(FormField,{label:"Enter 5 Digit Code"},XNode.create("input",{type:"tel",value:Bind.twoWaysImmediate((()=>this.model.captcha.code))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"data-layout":"go-button","data-submit-event":"ask-code"},"Next"))))))}))}resetPassword(){return __awaiter(this,void 0,void 0,(function*(){const{model}=this;if(model.phone.verified){if(!model.password){throw new Error("Password is required")}}if(model.password){if(model.password.length<7){throw new Error("Password is cannot be less than 7 characters")}if(/\s/i.test(model.password)){throw new Error("Password must not any whitespace characters")}if(model.passwordAgain!==model.password){throw new Error("Passwords do not match")}}const isdCode=yield isdForCountry(model.country);const phoneNumber=model.phoneNumberText.replace(/[^0-9]/g,"");model.phoneNumber=isdCode.startsWith("+")?isdCode+phoneNumber:`+${isdCode}${phoneNumber}`;const{userID,phone,captcha}=yield FetchBuilder.post(apiPath("/api/users/password/reset/")).jsonBody(this.model).responseAsJson();if(captcha===null||captcha===void 0?void 0:captcha.verified){model.captcha.verified=captcha.verified}if(userID){yield PopupService.alert({message:"Password has been reset successfully, please login with your new password."});location.href="/";return}if(phone.verified){this.model.phone.verified=phone.verified;this.askPasswords();return}if(phone.id){this.model.phone.id=phone.id}this.askCode()}))}askCode(){this.renderer=XNode.create("div",{class:css},XNode.create("div",{"data-layout":"center-all"},XNode.create(Form,{"data-border":"frame"},XNode.create("h3",null,"Enter verification code."),XNode.create(FormField,{label:"Code"},XNode.create("input",{type:"tel",value:Bind.twoWaysImmediate((()=>this.model.phone.code))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"data-layout":"go-button","data-submit-event":"ask-code"},"Next")))))}askPasswords(){this.renderer=XNode.create("div",{class:css},XNode.create("div",{"data-layout":"center-all"},XNode.create(Form,{"data-border":"frame"},XNode.create("h3",null,"Enter new password."),XNode.create(FormField,{label:"Password"},XNode.create(PasswordBox,{value:Bind.twoWaysImmediate((()=>this.model.password))})),XNode.create(FormField,{label:"Password Again"},XNode.create(PasswordBox,{value:Bind.twoWaysImmediate((()=>this.model.passwordAgain))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"data-layout":"go-button","data-submit-event":"ask-code"},"Next")))))}});__decorate([Action({onEvent:"ask-code"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],ForgotPassword.prototype,"resetPassword",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/pages/user/forgot/ForgotPassword");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","../../../../web/commands/AppCommands","@web-atoms/date-time/dist/DateTime"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,XNode,ContentPage,FormField,LoginSession,Bind,PasswordBox,Action,InjectProperty,LoginService,PasswordStrength,Validators,SaveIconTextButton,PageNavigator,ForgotPassword,PopupService,AppForm,AppCommands,DateTime,LoginPage,isSocialMail;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsWebControlsDistMobileAppMobileApp){ContentPage=_webAtomsWebControlsDistMobileAppMobileApp.ContentPage},function(_webAtomsWebControlsDistBasicFormField){FormField=_webAtomsWebControlsDistBasicFormField.default},function(_modelModel){LoginSession=_modelModel.LoginSession},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_webAtomsWebControlsDistBasicPasswordBox){PasswordBox=_webAtomsWebControlsDistBasicPasswordBox.default},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_webAtomsCoreDistCoreInjectProperty){InjectProperty=_webAtomsCoreDistCoreInjectProperty.default},function(_servicesLoginService){LoginService=_servicesLoginService.default},function(_controlsPasswordPasswordStrength){PasswordStrength=_controlsPasswordPasswordStrength.default},function(_validatorsValidators){Validators=_validatorsValidators.Validators},function(_controlsButtonsIconButton){SaveIconTextButton=_controlsButtonsIconButton.SaveIconTextButton},function(_webAtomsWebControlsDistPageNavigator){PageNavigator=_webAtomsWebControlsDistPageNavigator.default},function(_forgotForgotPassword){ForgotPassword=_forgotForgotPassword.default},function(_webAtomsCoreDistWebServicesPopupService){PopupService=_webAtomsCoreDistWebServicesPopupService.default},function(_formAppForm){AppForm=_formAppForm.default},function(_webCommandsAppCommands){AppCommands=_webCommandsAppCommands.default},function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default}],execute:function(){isSocialMail=/socialmail\.(me|in)/i.test(location.href)||/\d+.\d+.\d+.\d+/i.test(location.href);_export("default",LoginPage=class LoginPage extends ContentPage{constructor(){super(...arguments);this.password=""}init(){return __awaiter(this,void 0,void 0,(function*(){this.footerRenderer=()=>XNode.create("div",{"data-layout":"row"},XNode.create("a",{target:"_blank","data-margin-left":"auto",href:"https://socialmail.me"},"Social Mail"));this.hideToolbar=true;this.model=LoginSession.create({});this.model.userName="";this.model.checkPassword="";this.model.timeToken="";this.model.oneTimePassword="";this.render(XNode.create("div",null,XNode.create("div",{"data-layout":"center-all"},XNode.create(AppForm,null,XNode.create("h3",null,"Sign in to continue"),XNode.create(FormField,{label:"Username"},XNode.create("input",{autofocus:true,value:Bind.twoWaysImmediate((()=>this.model.userName))})),XNode.create(FormField,{label:"Password"},XNode.create(PasswordBox,{value:Bind.twoWaysImmediate((()=>this.model.checkPassword))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"data-layout":"accent-button","data-submit-event":"login",text:"Login"})),isSocialMail&&XNode.create("div",{"data-layout":"row"},XNode.create("span",{"data-click-event":"forgot-password","data-layout":"link"},"Forgot password?")),isSocialMail&&XNode.create("div",{"data-layout":"row"},XNode.create("a",{"data-click-event":"route",href:AppCommands.signup.displayRoute({})},"Sign Up"))))))}))}login(){return __awaiter(this,void 0,void 0,(function*(){this.model.dateUpdated=DateTime.now;const status=yield this.userService.login(this.model);if(!status){return}if(status==="change-password"){yield this.showChangePassword();return}this.showAuthenticator()}))}showAuthenticator(){this.renderer=XNode.create("div",{"data-layout":"center-all"},XNode.create(AppForm,null,XNode.create("h4",null,"Enter Authenticator Code"),XNode.create(FormField,{label:"Code"},XNode.create("input",{autofocus:true,type:"tel",value:Bind.twoWaysImmediate((()=>this.model.timeToken))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"event-click":()=>this.showOTP(),"data-layout":"link"},"Enter One Time Password instead.")),XNode.create("div",{"data-layout":"command-row"},XNode.create(SaveIconTextButton,{"event-click":()=>this.login(),text:"Go"}))))}showOTP(){this.renderer=XNode.create("div",{"data-layout":"center-all"},XNode.create(AppForm,null,XNode.create("h4",null,"Enter One Time Password"),XNode.create(FormField,{label:"Password"},XNode.create("input",{autofocus:true,type:"tel",value:Bind.twoWaysImmediate((()=>this.model.oneTimePassword))})),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"event-click":()=>this.showAuthenticator(),"data-layout":"link"},"Enter Authenticator Code instad.")),XNode.create("div",{"data-layout":"command-row"},XNode.create(SaveIconTextButton,{"event-click":()=>this.login(),text:"Go"}))))}showChangePassword(){return __awaiter(this,void 0,void 0,(function*(){this.model.newPassword="";this.renderer=XNode.create("div",null,XNode.create("div",{"data-layout":"center-all"},XNode.create(AppForm,null,XNode.create("div",null,"Update your password, your one time password is expired."),XNode.create(FormField,{label:"Password",autofocus:true,required:true,error:Bind.oneWay((()=>Validators.isValidPassword(this.password)?"":"Password must contain one symbol, one number and should be minimum 7 characters"))},XNode.create(PasswordBox,{value:Bind.twoWaysImmediate((()=>this.password))})),XNode.create(PasswordStrength,{password:Bind.oneWay((()=>this.password))}),XNode.create(FormField,{label:"Password Again",required:true,error:Bind.oneWay((()=>this.model.newPassword!==this.password?"Passwords do not match":""))},XNode.create(PasswordBox,{value:Bind.twoWaysImmediate((()=>this.model.newPassword))})),XNode.create("div",{"data-layout":"command-row"},XNode.create("button",{"data-submit-event":"login",text:"Change Password & Login"})))))}))}forgotPassword(){return __awaiter(this,void 0,void 0,(function*(){if(isSocialMail){PageNavigator.openPage(ForgotPassword);return}yield PopupService.alert({message:"Please contact your administrator"})}))}});__decorate([InjectProperty,__metadata("design:type",LoginService)],LoginPage.prototype,"userService",void 0);__decorate([Action({onEvent:"login"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],LoginPage.prototype,"login",null);__decorate([Action({onEvent:"forgot-password"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],LoginPage.prototype,"forgotPassword",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/pages/user/login/LoginPage");System.register(["tslib","@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/style/styled"],(function(_export,_context){"use strict";var __rest,XNode,styled;function MenuItem(_a){var{label,icon=void 0,click=undefined,title=label,description=void 0,href="",commandLink="",target=undefined,bell=void 0,bellTitle=void 0,bellClick=void 0}=_a,a=__rest(_a,["label","icon","click","title","description","href","commandLink","target","bell","bellTitle","bellClick"]);return href||commandLink?XNode.create("a",Object.assign({"data-layout":"menu-item","data-text-decoration":"none",title,"data-click-event":commandLink?"route":void 0,href:href||commandLink,target,"event-click":click},a),icon&&XNode.create("i",{class:icon}),XNode.create("span",{text:label}),description&&XNode.create("small",{text:description}),bell!==void 0&&XNode.create("i",Object.assign({"data-element":"badge",title:bellTitle,class:bell?"fad fa-bell":"fad fa-bell-slash"},typeof bellClick==="string"?{"data-click-event":bellClick}:{"data-click-event":"none","event-click":bellClick}))):XNode.create("div",Object.assign({title,"data-layout":"menu-item","event-click":click},a),icon&&XNode.create("i",{class:icon}),XNode.create("span",{text:label}),description&&XNode.create("small",{text:description}),bell!==void 0&&XNode.create("i",{"data-click-event":bellClick,"data-element":"badge",title:bellTitle,class:bell?"fad fa-bell":"fad fa-bell-slash"}))}_export("default",MenuItem);return{setters:[function(_tslib){__rest=_tslib.__rest},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default}],execute:function(){styled.css`
|
|
4690
4690
|
display: grid;
|
|
4691
4691
|
grid-template-columns: auto 1fr auto;
|
|
4692
4692
|
grid-template-rows: 1fr auto;
|