@osovitny/anatoly 2.14.21 → 2.14.22
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/esm2020/lib/ui/forms/components/urlslug/urlslug.component.mjs +17 -9
- package/fesm2015/osovitny-anatoly.mjs +15 -7
- package/fesm2015/osovitny-anatoly.mjs.map +1 -1
- package/fesm2020/osovitny-anatoly.mjs +15 -7
- package/fesm2020/osovitny-anatoly.mjs.map +1 -1
- package/lib/ui/forms/components/urlslug/urlslug.component.d.ts +3 -2
- package/package.json +1 -1
|
@@ -3890,28 +3890,34 @@ class UrlSlugComponent extends BaseEditComponent {
|
|
|
3890
3890
|
constructor() {
|
|
3891
3891
|
super();
|
|
3892
3892
|
//Inputs
|
|
3893
|
-
this.title = 'Permalink';
|
|
3893
|
+
this.title = 'Permalink:';
|
|
3894
3894
|
this.isTitleVisible = true;
|
|
3895
|
+
//Outputs
|
|
3896
|
+
this.generating = new EventEmitter();
|
|
3895
3897
|
}
|
|
3896
3898
|
ngOnInit() {
|
|
3897
3899
|
this.setWatchers();
|
|
3898
3900
|
}
|
|
3899
3901
|
setWatchers() {
|
|
3900
|
-
|
|
3901
|
-
this.
|
|
3902
|
-
|
|
3902
|
+
if (this.watchedControlName) {
|
|
3903
|
+
this.formGroup.get(this.watchedControlName).valueChanges.subscribe(val => {
|
|
3904
|
+
this.generateUrlSlug();
|
|
3905
|
+
});
|
|
3906
|
+
}
|
|
3903
3907
|
}
|
|
3904
3908
|
generateUrlSlug() {
|
|
3905
3909
|
let name = this.getFormValue(this.watchedControlName);
|
|
3906
3910
|
let slugedText = Utils.slugify(name);
|
|
3907
|
-
|
|
3911
|
+
let event = { urlSlug: slugedText };
|
|
3912
|
+
this.generating.emit(event);
|
|
3913
|
+
this.setFormValue(this.controlName, event.urlSlug);
|
|
3908
3914
|
}
|
|
3909
3915
|
}
|
|
3910
3916
|
UrlSlugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UrlSlugComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3911
|
-
UrlSlugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: UrlSlugComponent, selector: "anatoly-forms-urlslug", inputs: { title: "title", isTitleVisible: "isTitleVisible", controlName: "controlName", controlTitle: "controlTitle", class: "class", watchedControlName: "watchedControlName", urlPrefix: "urlPrefix" }, usesInheritance: true, ngImport: i0, template: "<div [formGroup]='formGroup' class=\"{'has-error': isControlInvalid(controlName)}
|
|
3917
|
+
UrlSlugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: UrlSlugComponent, selector: "anatoly-forms-urlslug", inputs: { title: "title", isTitleVisible: "isTitleVisible", controlName: "controlName", controlTitle: "controlTitle", class: "class", watchedControlName: "watchedControlName", urlPrefix: "urlPrefix" }, outputs: { generating: "generating" }, usesInheritance: true, ngImport: i0, template: "<div [formGroup]='formGroup' class=\"d-flex permalink form-group {'has-error': isControlInvalid(controlName)} {{class}}\">\r\n <label *ngIf='isTitleVisible' class='col-form-label'> {{ title }} <span> {{ urlPrefix }} </span></label>\r\n <input [formControlName]='controlName' type='text' placeholder='Type url slug here' class='form-control' (generating)='generateUrlSlug()'/>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n [controlName]='controlName'\r\n [controlTitle]='controlTitle'>\r\n </anatoly-item-validation-summary>\r\n</div>\r\n\r\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$5.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: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$5.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NativeElementDirective, selector: "[formControl], [formControlName]" }, { kind: "component", type: ItemValidationSummaryComponent, selector: "anatoly-item-validation-summary", inputs: ["controlName", "controlTitle"] }] });
|
|
3912
3918
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UrlSlugComponent, decorators: [{
|
|
3913
3919
|
type: Component,
|
|
3914
|
-
args: [{ selector: 'anatoly-forms-urlslug', template: "<div [formGroup]='formGroup' class=\"{'has-error': isControlInvalid(controlName)}
|
|
3920
|
+
args: [{ selector: 'anatoly-forms-urlslug', template: "<div [formGroup]='formGroup' class=\"d-flex permalink form-group {'has-error': isControlInvalid(controlName)} {{class}}\">\r\n <label *ngIf='isTitleVisible' class='col-form-label'> {{ title }} <span> {{ urlPrefix }} </span></label>\r\n <input [formControlName]='controlName' type='text' placeholder='Type url slug here' class='form-control' (generating)='generateUrlSlug()'/>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n [controlName]='controlName'\r\n [controlTitle]='controlTitle'>\r\n </anatoly-item-validation-summary>\r\n</div>\r\n\r\n" }]
|
|
3915
3921
|
}], ctorParameters: function () { return []; }, propDecorators: { title: [{
|
|
3916
3922
|
type: Input
|
|
3917
3923
|
}], isTitleVisible: [{
|
|
@@ -3926,6 +3932,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
|
|
|
3926
3932
|
type: Input
|
|
3927
3933
|
}], urlPrefix: [{
|
|
3928
3934
|
type: Input
|
|
3935
|
+
}], generating: [{
|
|
3936
|
+
type: Output
|
|
3929
3937
|
}] } });
|
|
3930
3938
|
|
|
3931
3939
|
/*
|