@posiwise/user-module 0.0.152 → 0.0.153
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.
|
@@ -3006,35 +3006,36 @@ class EditSocialLinksComponent extends AppBaseComponent {
|
|
|
3006
3006
|
{ key: 'facebook', labelKey: 'User.Profile.SocialLinks.Label.Facebook', icon: 'facebook', placeholder: 'https://www.facebook.com/nickname' },
|
|
3007
3007
|
{ key: 'youtube', labelKey: 'User.Profile.SocialLinks.Label.YouTube', icon: 'youtube', placeholder: 'https://www.youtube.com/nickname' },
|
|
3008
3008
|
{ key: 'instagram', labelKey: 'User.Profile.SocialLinks.Label.Instagram', icon: 'instagram', placeholder: 'https://www.instagram.com/nickname' },
|
|
3009
|
-
{ key: 'skype', labelKey: 'User.Profile.SocialLinks.Label.Skype', icon: 'skype', placeholder: 'https://www.skype.com/nickname' },
|
|
3010
3009
|
{ key: 'github', labelKey: 'User.Profile.SocialLinks.Label.Github', icon: 'github', placeholder: 'https://github.com/nickname' },
|
|
3011
|
-
{ key: 'gitlab', labelKey: 'User.Profile.SocialLinks.Label.Gitlab', icon: 'gitlab', placeholder: 'https://gitlab.com/nickname' },
|
|
3012
|
-
{ key: 'bitbucket', labelKey: 'User.Profile.SocialLinks.Label.Bitbucket', icon: 'bitbucket', placeholder: 'https://bitbucket.org/nickname' },
|
|
3013
3010
|
{ key: 'stackoverflow', labelKey: 'User.Profile.SocialLinks.Label.Stackoverflow', icon: 'stackoverflow', placeholder: 'http://stackoverflow.com/users/nickname' }
|
|
3014
3011
|
];
|
|
3015
3012
|
this.form = this.fb.group({
|
|
3016
3013
|
user_id: 0,
|
|
3017
|
-
youtube: ['', this.urlValidator('youtube')],
|
|
3018
|
-
skype: ['', this.urlValidator('skype')],
|
|
3019
3014
|
linkedin: ['', this.urlValidator('linkedin')],
|
|
3020
3015
|
twitter: ['', this.urlValidator('twitter')],
|
|
3021
|
-
instagram: ['', this.urlValidator('instagram')],
|
|
3022
3016
|
facebook: ['', this.urlValidator('facebook')],
|
|
3023
|
-
|
|
3017
|
+
youtube: ['', this.urlValidator('youtube')],
|
|
3018
|
+
instagram: ['', this.urlValidator('instagram')],
|
|
3024
3019
|
github: ['', this.urlValidator('github')],
|
|
3025
|
-
|
|
3026
|
-
gitlab: ['', this.urlValidator('gitlab')]
|
|
3020
|
+
stackoverflow: ['', this.urlValidator('stackoverflow')]
|
|
3027
3021
|
});
|
|
3028
3022
|
}
|
|
3029
3023
|
urlValidator(social) {
|
|
3030
3024
|
return (control) => {
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3025
|
+
if (!control.value) {
|
|
3026
|
+
return null;
|
|
3027
|
+
}
|
|
3028
|
+
try {
|
|
3029
|
+
const parsed = new URL(control.value);
|
|
3030
|
+
if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {
|
|
3031
|
+
return { urlMalformed: { value: control.value } };
|
|
3032
|
+
}
|
|
3033
|
+
const host = parsed.hostname.toLowerCase();
|
|
3034
|
+
return host.includes(social) ? null : { urlMalformed: { value: control.value } };
|
|
3035
|
+
}
|
|
3036
|
+
catch {
|
|
3037
|
+
return { urlMalformed: { value: control.value } };
|
|
3036
3038
|
}
|
|
3037
|
-
return null;
|
|
3038
3039
|
};
|
|
3039
3040
|
}
|
|
3040
3041
|
ngOnInit() {
|
|
@@ -3045,8 +3046,8 @@ class EditSocialLinksComponent extends AppBaseComponent {
|
|
|
3045
3046
|
this.form.patchValue(this.links);
|
|
3046
3047
|
this.modalService.open(this.content, {
|
|
3047
3048
|
centered: true,
|
|
3048
|
-
size: '
|
|
3049
|
-
windowClass: 'modal-holder'
|
|
3049
|
+
size: 'md',
|
|
3050
|
+
windowClass: 'modal-holder edit-social-links-modal'
|
|
3050
3051
|
});
|
|
3051
3052
|
}
|
|
3052
3053
|
onSaveDetail() {
|
|
@@ -3068,7 +3069,7 @@ class EditSocialLinksComponent extends AppBaseComponent {
|
|
|
3068
3069
|
});
|
|
3069
3070
|
}
|
|
3070
3071
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: EditSocialLinksComponent, deps: [{ token: i0.Injector }, { token: i1$1.NgbModal }, { token: i2.UntypedFormBuilder }, { token: i1$2.ProfileService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3071
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
3072
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: EditSocialLinksComponent, isStandalone: false, selector: "pw-edit-social-links", inputs: { links: "links", userId: "userId" }, outputs: { saveEvent: "saveEvent" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #content\n let-modal>\n <div class=\"modal-header edit-social-links-header\">\n <h4 class=\"modal-title edit-social-links__title\"\n id=\"modal-basic-title\">{{ 'User.Profile.SocialLinks.Title' | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"modal-body edit-social-links-body\">\n <form [formGroup]=\"form\"\n class=\"edit-social-links\"\n (ngSubmit)=\"onSaveDetail()\">\n <p class=\"edit-social-links__intro\">\n {{ 'User.Profile.SocialLinks.Description' | transloco }}\n </p>\n\n <div class=\"edit-social-links__stack\">\n @for (social of socialNetworks; track social.key) {\n <div class=\"edit-social-links__field\">\n <label [for]=\"'external-portfolio-' + social.key\"\n class=\"edit-social-links__label\">\n <span class=\"edit-social-links__chip\">\n <img [src]=\"'/assets/img/icons/social/' + social.icon + '.svg'\"\n width=\"18\"\n height=\"18\"\n alt=\"\" />\n </span>\n <span class=\"edit-social-links__label-text\">{{ social.labelKey | transloco }}</span>\n </label>\n <input type=\"url\"\n [id]=\"'external-portfolio-' + social.key\"\n [name]=\"social.key\"\n [formControlName]=\"social.key\"\n class=\"form-control edit-social-links__input\"\n [placeholder]=\"social.placeholder\"\n autocomplete=\"url\" />\n </div>\n }\n </div>\n </form>\n </div>\n <div class=\"modal-footer edit-social-links-footer\">\n <button type=\"button\"\n class=\"btn edit-social-links__cancel\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary edit-social-links__save\"\n (click)=\"onSaveDetail()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n", styles: ["::ng-deep .edit-social-links-modal .modal-dialog{max-width:720px}::ng-deep .edit-social-links-modal .modal-content{border:none;border-radius:12px;box-shadow:0 20px 50px #0f172a2e}::ng-deep .edit-social-links-modal .edit-social-links-header{padding:1.25rem 1.5rem;border-bottom:1px solid #e2e8f0;align-items:center}::ng-deep .edit-social-links-modal .edit-social-links__title{font-size:1.0625rem!important;font-weight:500!important;color:#0f172a!important;letter-spacing:-.01em!important;text-transform:none!important;margin:0!important}::ng-deep .edit-social-links-modal .edit-social-links-body{padding:1.5rem}::ng-deep .edit-social-links-modal .edit-social-links__intro{color:#64748b;font-size:.875rem;line-height:1.55;margin:0 0 1.5rem}::ng-deep .edit-social-links-modal .edit-social-links__stack{display:grid;grid-template-columns:1fr;gap:1rem 1.25rem}@media(min-width:576px){::ng-deep .edit-social-links-modal .edit-social-links__stack{grid-template-columns:1fr 1fr}}::ng-deep .edit-social-links-modal .edit-social-links__field{display:flex;flex-direction:column}::ng-deep .edit-social-links-modal .edit-social-links__label{display:flex;align-items:center;gap:.625rem;margin-bottom:.5rem;color:#0f172a!important;font-size:.875rem!important;font-weight:500!important;letter-spacing:0!important;text-transform:none!important}::ng-deep .edit-social-links-modal .edit-social-links__chip{flex:0 0 32px;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;background:#f1f5f9;border-radius:8px}::ng-deep .edit-social-links-modal .edit-social-links__chip img{width:18px;height:18px;display:block}::ng-deep .edit-social-links-modal .edit-social-links__label-text{line-height:1}::ng-deep .edit-social-links-modal .edit-social-links__input{height:44px;border-radius:8px;border-color:#cbd5e1;font-size:.9375rem;padding:0 .875rem;transition:border-color .15s ease,box-shadow .15s ease}::ng-deep .edit-social-links-modal .edit-social-links__input:focus{border-color:var(--first, #2563eb);box-shadow:0 0 0 3px #2563eb1f}::ng-deep .edit-social-links-modal .edit-social-links__input::placeholder{color:#94a3b8}::ng-deep .edit-social-links-modal .edit-social-links-footer{padding:1rem 1.5rem;border-top:1px solid #e2e8f0;gap:.5rem}::ng-deep .edit-social-links-modal .edit-social-links__cancel{background:transparent;border:none;color:#64748b;font-weight:500;padding:.5rem 1rem}::ng-deep .edit-social-links-modal .edit-social-links__cancel:hover,::ng-deep .edit-social-links-modal .edit-social-links__cancel:focus{background:transparent;color:#0f172a;box-shadow:none}::ng-deep .edit-social-links-modal .edit-social-links__save{background:var(--first, #2563eb);border-color:var(--first, #2563eb);font-weight:600;padding:.5rem 1.5rem;border-radius:8px}\n"], dependencies: [{ kind: "directive", type: i3.ButtonBusyDirective, selector: "[buttonBusy]", inputs: ["buttonBusy", "busyText"] }, { kind: "directive", type: i3.LazyImgDirective, selector: "img" }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i8$2.TranslocoPipe, name: "transloco" }] }); }
|
|
3072
3073
|
}
|
|
3073
3074
|
__decorate([
|
|
3074
3075
|
ValidateForm('form'),
|
|
@@ -3078,7 +3079,7 @@ __decorate([
|
|
|
3078
3079
|
], EditSocialLinksComponent.prototype, "onSaveDetail", null);
|
|
3079
3080
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: EditSocialLinksComponent, decorators: [{
|
|
3080
3081
|
type: Component,
|
|
3081
|
-
args: [{ selector: 'pw-edit-social-links', standalone: false, template: "<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">
|
|
3082
|
+
args: [{ selector: 'pw-edit-social-links', standalone: false, template: "<ng-template #content\n let-modal>\n <div class=\"modal-header edit-social-links-header\">\n <h4 class=\"modal-title edit-social-links__title\"\n id=\"modal-basic-title\">{{ 'User.Profile.SocialLinks.Title' | transloco }}</h4>\n <button type=\"button\"\n class=\"btn-close\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"modal-body edit-social-links-body\">\n <form [formGroup]=\"form\"\n class=\"edit-social-links\"\n (ngSubmit)=\"onSaveDetail()\">\n <p class=\"edit-social-links__intro\">\n {{ 'User.Profile.SocialLinks.Description' | transloco }}\n </p>\n\n <div class=\"edit-social-links__stack\">\n @for (social of socialNetworks; track social.key) {\n <div class=\"edit-social-links__field\">\n <label [for]=\"'external-portfolio-' + social.key\"\n class=\"edit-social-links__label\">\n <span class=\"edit-social-links__chip\">\n <img [src]=\"'/assets/img/icons/social/' + social.icon + '.svg'\"\n width=\"18\"\n height=\"18\"\n alt=\"\" />\n </span>\n <span class=\"edit-social-links__label-text\">{{ social.labelKey | transloco }}</span>\n </label>\n <input type=\"url\"\n [id]=\"'external-portfolio-' + social.key\"\n [name]=\"social.key\"\n [formControlName]=\"social.key\"\n class=\"form-control edit-social-links__input\"\n [placeholder]=\"social.placeholder\"\n autocomplete=\"url\" />\n </div>\n }\n </div>\n </form>\n </div>\n <div class=\"modal-footer edit-social-links-footer\">\n <button type=\"button\"\n class=\"btn edit-social-links__cancel\"\n (click)=\"modal.close()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary edit-social-links__save\"\n (click)=\"onSaveDetail()\">{{ 'Button.Save' | transloco }}</button>\n </div>\n</ng-template>\n", styles: ["::ng-deep .edit-social-links-modal .modal-dialog{max-width:720px}::ng-deep .edit-social-links-modal .modal-content{border:none;border-radius:12px;box-shadow:0 20px 50px #0f172a2e}::ng-deep .edit-social-links-modal .edit-social-links-header{padding:1.25rem 1.5rem;border-bottom:1px solid #e2e8f0;align-items:center}::ng-deep .edit-social-links-modal .edit-social-links__title{font-size:1.0625rem!important;font-weight:500!important;color:#0f172a!important;letter-spacing:-.01em!important;text-transform:none!important;margin:0!important}::ng-deep .edit-social-links-modal .edit-social-links-body{padding:1.5rem}::ng-deep .edit-social-links-modal .edit-social-links__intro{color:#64748b;font-size:.875rem;line-height:1.55;margin:0 0 1.5rem}::ng-deep .edit-social-links-modal .edit-social-links__stack{display:grid;grid-template-columns:1fr;gap:1rem 1.25rem}@media(min-width:576px){::ng-deep .edit-social-links-modal .edit-social-links__stack{grid-template-columns:1fr 1fr}}::ng-deep .edit-social-links-modal .edit-social-links__field{display:flex;flex-direction:column}::ng-deep .edit-social-links-modal .edit-social-links__label{display:flex;align-items:center;gap:.625rem;margin-bottom:.5rem;color:#0f172a!important;font-size:.875rem!important;font-weight:500!important;letter-spacing:0!important;text-transform:none!important}::ng-deep .edit-social-links-modal .edit-social-links__chip{flex:0 0 32px;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;background:#f1f5f9;border-radius:8px}::ng-deep .edit-social-links-modal .edit-social-links__chip img{width:18px;height:18px;display:block}::ng-deep .edit-social-links-modal .edit-social-links__label-text{line-height:1}::ng-deep .edit-social-links-modal .edit-social-links__input{height:44px;border-radius:8px;border-color:#cbd5e1;font-size:.9375rem;padding:0 .875rem;transition:border-color .15s ease,box-shadow .15s ease}::ng-deep .edit-social-links-modal .edit-social-links__input:focus{border-color:var(--first, #2563eb);box-shadow:0 0 0 3px #2563eb1f}::ng-deep .edit-social-links-modal .edit-social-links__input::placeholder{color:#94a3b8}::ng-deep .edit-social-links-modal .edit-social-links-footer{padding:1rem 1.5rem;border-top:1px solid #e2e8f0;gap:.5rem}::ng-deep .edit-social-links-modal .edit-social-links__cancel{background:transparent;border:none;color:#64748b;font-weight:500;padding:.5rem 1rem}::ng-deep .edit-social-links-modal .edit-social-links__cancel:hover,::ng-deep .edit-social-links-modal .edit-social-links__cancel:focus{background:transparent;color:#0f172a;box-shadow:none}::ng-deep .edit-social-links-modal .edit-social-links__save{background:var(--first, #2563eb);border-color:var(--first, #2563eb);font-weight:600;padding:.5rem 1.5rem;border-radius:8px}\n"] }]
|
|
3082
3083
|
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1$1.NgbModal }, { type: i2.UntypedFormBuilder }, { type: i1$2.ProfileService }, { type: i0.ChangeDetectorRef }], propDecorators: { content: [{
|
|
3083
3084
|
type: ViewChild,
|
|
3084
3085
|
args: ['content', { static: true }]
|