@posiwise/user-module 0.0.152 → 0.0.154
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.
|
@@ -3001,40 +3001,76 @@ class EditSocialLinksComponent extends AppBaseComponent {
|
|
|
3001
3001
|
this.saveEvent = new EventEmitter();
|
|
3002
3002
|
this.buttonBusy = false;
|
|
3003
3003
|
this.socialNetworks = [
|
|
3004
|
-
{
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
{
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3004
|
+
{
|
|
3005
|
+
key: 'linkedin',
|
|
3006
|
+
labelKey: 'User.Profile.SocialLinks.Label.LinkedIn',
|
|
3007
|
+
icon: 'linkedin',
|
|
3008
|
+
placeholder: 'https://linkedin.com/in/nickname'
|
|
3009
|
+
},
|
|
3010
|
+
{
|
|
3011
|
+
key: 'twitter',
|
|
3012
|
+
labelKey: 'User.Profile.SocialLinks.Label.Twitter',
|
|
3013
|
+
icon: 'twitter',
|
|
3014
|
+
placeholder: 'https://twitter.com/nickname'
|
|
3015
|
+
},
|
|
3016
|
+
{
|
|
3017
|
+
key: 'facebook',
|
|
3018
|
+
labelKey: 'User.Profile.SocialLinks.Label.Facebook',
|
|
3019
|
+
icon: 'facebook',
|
|
3020
|
+
placeholder: 'https://www.facebook.com/nickname'
|
|
3021
|
+
},
|
|
3022
|
+
{
|
|
3023
|
+
key: 'youtube',
|
|
3024
|
+
labelKey: 'User.Profile.SocialLinks.Label.YouTube',
|
|
3025
|
+
icon: 'youtube',
|
|
3026
|
+
placeholder: 'https://www.youtube.com/nickname'
|
|
3027
|
+
},
|
|
3028
|
+
{
|
|
3029
|
+
key: 'instagram',
|
|
3030
|
+
labelKey: 'User.Profile.SocialLinks.Label.Instagram',
|
|
3031
|
+
icon: 'instagram',
|
|
3032
|
+
placeholder: 'https://www.instagram.com/nickname'
|
|
3033
|
+
},
|
|
3034
|
+
{
|
|
3035
|
+
key: 'github',
|
|
3036
|
+
labelKey: 'User.Profile.SocialLinks.Label.Github',
|
|
3037
|
+
icon: 'github',
|
|
3038
|
+
placeholder: 'https://github.com/nickname'
|
|
3039
|
+
},
|
|
3040
|
+
{
|
|
3041
|
+
key: 'stackoverflow',
|
|
3042
|
+
labelKey: 'User.Profile.SocialLinks.Label.Stackoverflow',
|
|
3043
|
+
icon: 'stackoverflow',
|
|
3044
|
+
placeholder: 'http://stackoverflow.com/users/nickname'
|
|
3045
|
+
}
|
|
3014
3046
|
];
|
|
3015
3047
|
this.form = this.fb.group({
|
|
3016
3048
|
user_id: 0,
|
|
3017
|
-
youtube: ['', this.urlValidator('youtube')],
|
|
3018
|
-
skype: ['', this.urlValidator('skype')],
|
|
3019
3049
|
linkedin: ['', this.urlValidator('linkedin')],
|
|
3020
3050
|
twitter: ['', this.urlValidator('twitter')],
|
|
3021
|
-
instagram: ['', this.urlValidator('instagram')],
|
|
3022
3051
|
facebook: ['', this.urlValidator('facebook')],
|
|
3023
|
-
|
|
3052
|
+
youtube: ['', this.urlValidator('youtube')],
|
|
3053
|
+
instagram: ['', this.urlValidator('instagram')],
|
|
3024
3054
|
github: ['', this.urlValidator('github')],
|
|
3025
|
-
|
|
3026
|
-
gitlab: ['', this.urlValidator('gitlab')]
|
|
3055
|
+
stackoverflow: ['', this.urlValidator('stackoverflow')]
|
|
3027
3056
|
});
|
|
3028
3057
|
}
|
|
3029
3058
|
urlValidator(social) {
|
|
3030
3059
|
return (control) => {
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3060
|
+
if (!control.value) {
|
|
3061
|
+
return null;
|
|
3062
|
+
}
|
|
3063
|
+
try {
|
|
3064
|
+
const parsed = new URL(control.value);
|
|
3065
|
+
if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {
|
|
3066
|
+
return { urlMalformed: { value: control.value } };
|
|
3067
|
+
}
|
|
3068
|
+
const host = parsed.hostname.toLowerCase();
|
|
3069
|
+
return host.includes(social) ? null : { urlMalformed: { value: control.value } };
|
|
3070
|
+
}
|
|
3071
|
+
catch {
|
|
3072
|
+
return { urlMalformed: { value: control.value } };
|
|
3036
3073
|
}
|
|
3037
|
-
return null;
|
|
3038
3074
|
};
|
|
3039
3075
|
}
|
|
3040
3076
|
ngOnInit() {
|
|
@@ -3045,8 +3081,8 @@ class EditSocialLinksComponent extends AppBaseComponent {
|
|
|
3045
3081
|
this.form.patchValue(this.links);
|
|
3046
3082
|
this.modalService.open(this.content, {
|
|
3047
3083
|
centered: true,
|
|
3048
|
-
size: '
|
|
3049
|
-
windowClass: 'modal-holder'
|
|
3084
|
+
size: 'md',
|
|
3085
|
+
windowClass: 'modal-holder edit-social-links-modal'
|
|
3050
3086
|
});
|
|
3051
3087
|
}
|
|
3052
3088
|
onSaveDetail() {
|
|
@@ -3068,7 +3104,7 @@ class EditSocialLinksComponent extends AppBaseComponent {
|
|
|
3068
3104
|
});
|
|
3069
3105
|
}
|
|
3070
3106
|
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: "
|
|
3107
|
+
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
3108
|
}
|
|
3073
3109
|
__decorate([
|
|
3074
3110
|
ValidateForm('form'),
|
|
@@ -3078,7 +3114,7 @@ __decorate([
|
|
|
3078
3114
|
], EditSocialLinksComponent.prototype, "onSaveDetail", null);
|
|
3079
3115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: EditSocialLinksComponent, decorators: [{
|
|
3080
3116
|
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\">
|
|
3117
|
+
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
3118
|
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1$1.NgbModal }, { type: i2.UntypedFormBuilder }, { type: i1$2.ProfileService }, { type: i0.ChangeDetectorRef }], propDecorators: { content: [{
|
|
3083
3119
|
type: ViewChild,
|
|
3084
3120
|
args: ['content', { static: true }]
|