@osovitny/anatoly 2.14.22 → 2.14.23
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 +15 -7
- package/fesm2015/osovitny-anatoly.mjs +14 -6
- package/fesm2015/osovitny-anatoly.mjs.map +1 -1
- package/fesm2020/osovitny-anatoly.mjs +14 -6
- package/fesm2020/osovitny-anatoly.mjs.map +1 -1
- package/lib/ui/forms/components/urlslug/urlslug.component.d.ts +5 -2
- package/package.json +1 -1
|
@@ -3892,6 +3892,7 @@ class UrlSlugComponent extends BaseEditComponent {
|
|
|
3892
3892
|
//Inputs
|
|
3893
3893
|
this.title = 'Permalink:';
|
|
3894
3894
|
this.isTitleVisible = true;
|
|
3895
|
+
this.isButtonVisible = true;
|
|
3895
3896
|
//Outputs
|
|
3896
3897
|
this.generating = new EventEmitter();
|
|
3897
3898
|
}
|
|
@@ -3901,27 +3902,34 @@ class UrlSlugComponent extends BaseEditComponent {
|
|
|
3901
3902
|
setWatchers() {
|
|
3902
3903
|
if (this.watchedControlName) {
|
|
3903
3904
|
this.formGroup.get(this.watchedControlName).valueChanges.subscribe(val => {
|
|
3904
|
-
this.
|
|
3905
|
+
let text = this.getFormValue(this.watchedControlName);
|
|
3906
|
+
this.generateUrlSlug(text);
|
|
3905
3907
|
});
|
|
3906
3908
|
}
|
|
3907
3909
|
}
|
|
3908
|
-
generateUrlSlug() {
|
|
3909
|
-
let
|
|
3910
|
-
let slugedText = Utils.slugify(name);
|
|
3910
|
+
generateUrlSlug(text) {
|
|
3911
|
+
let slugedText = Utils.slugify(text);
|
|
3911
3912
|
let event = { urlSlug: slugedText };
|
|
3912
3913
|
this.generating.emit(event);
|
|
3913
3914
|
this.setFormValue(this.controlName, event.urlSlug);
|
|
3915
|
+
this.hrefGo = `${event.urlSlug}`;
|
|
3916
|
+
}
|
|
3917
|
+
onUrlSlugChange() {
|
|
3918
|
+
let text = this.getFormValue(this.controlName);
|
|
3919
|
+
this.generateUrlSlug(text);
|
|
3914
3920
|
}
|
|
3915
3921
|
}
|
|
3916
3922
|
UrlSlugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UrlSlugComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
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' (
|
|
3923
|
+
UrlSlugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: UrlSlugComponent, selector: "anatoly-forms-urlslug", inputs: { title: "title", isTitleVisible: "isTitleVisible", isButtonVisible: "isButtonVisible", 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' (keyup)=onUrlSlugChange()/>\r\n <a *ngIf=\"isButtonVisible\" href=\"{{urlPrefix}}{{hrefGo}}\" target=\"_blank\" class=\"btn btn-outline-primary\">Go</a>\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"] }] });
|
|
3918
3924
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UrlSlugComponent, decorators: [{
|
|
3919
3925
|
type: Component,
|
|
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' (
|
|
3926
|
+
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' (keyup)=onUrlSlugChange()/>\r\n <a *ngIf=\"isButtonVisible\" href=\"{{urlPrefix}}{{hrefGo}}\" target=\"_blank\" class=\"btn btn-outline-primary\">Go</a>\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" }]
|
|
3921
3927
|
}], ctorParameters: function () { return []; }, propDecorators: { title: [{
|
|
3922
3928
|
type: Input
|
|
3923
3929
|
}], isTitleVisible: [{
|
|
3924
3930
|
type: Input
|
|
3931
|
+
}], isButtonVisible: [{
|
|
3932
|
+
type: Input
|
|
3925
3933
|
}], controlName: [{
|
|
3926
3934
|
type: Input
|
|
3927
3935
|
}], controlTitle: [{
|