@abp/ng.cms-kit 10.2.0-rc.1 → 10.2.0-rc.3
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.
|
@@ -14,7 +14,7 @@ import { PageModule, PageComponent } from '@abp/ng.components/page';
|
|
|
14
14
|
import { ToasterService, ConfirmationService, Confirmation, DateTimeAdapter, FormInputComponent, ButtonComponent, ModalComponent, ModalCloseDirective } from '@abp/ng.theme.shared';
|
|
15
15
|
import { PageAdminService, PageStatus, BlogPostAdminService, CommentAdminService, commentApproveStateOptions, CommentApproveState, TagAdminService, BlogAdminService, BlogFeatureAdminService, BlogPostStatus, MediaDescriptorAdminService, EntityTagAdminService, MenuItemAdminService, GlobalResourceAdminService, pageStatusOptions } from '@abp/ng.cms-kit/proxy';
|
|
16
16
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
17
|
-
import { tap, switchMap, debounceTime, distinctUntilChanged,
|
|
17
|
+
import { tap, finalize, switchMap, debounceTime, distinctUntilChanged, map } from 'rxjs/operators';
|
|
18
18
|
import * as i2$1 from '@ngx-validate/core';
|
|
19
19
|
import { NgxValidateCoreModule } from '@ngx-validate/core';
|
|
20
20
|
import { prepareSlugFromControl, CodeMirrorEditorComponent, ToastuiEditorComponent, dasharize } from '@abp/ng.cms-kit';
|
|
@@ -778,6 +778,7 @@ class BlogModalComponent {
|
|
|
778
778
|
this.destroyRef = inject(DestroyRef);
|
|
779
779
|
this.selected = input(...(ngDevMode ? [undefined, { debugName: "selected" }] : []));
|
|
780
780
|
this.visibleChange = output();
|
|
781
|
+
this.modalBusy = false;
|
|
781
782
|
}
|
|
782
783
|
ngOnInit() {
|
|
783
784
|
this.buildForm();
|
|
@@ -791,6 +792,10 @@ class BlogModalComponent {
|
|
|
791
792
|
this.visibleChange.emit({ visible, refresh });
|
|
792
793
|
}
|
|
793
794
|
save() {
|
|
795
|
+
if (this.modalBusy) {
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
this.modalBusy = true;
|
|
794
799
|
if (!this.form.valid) {
|
|
795
800
|
return;
|
|
796
801
|
}
|
|
@@ -803,13 +808,13 @@ class BlogModalComponent {
|
|
|
803
808
|
...this.form.value,
|
|
804
809
|
});
|
|
805
810
|
}
|
|
806
|
-
observable$.subscribe(() => {
|
|
811
|
+
observable$.pipe(finalize(() => (this.modalBusy = false))).subscribe(() => {
|
|
807
812
|
this.onVisibleChange(false, true);
|
|
808
813
|
this.toasterService.success('AbpUi::SavedSuccessfully');
|
|
809
814
|
});
|
|
810
815
|
}
|
|
811
816
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: BlogModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
812
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: BlogModalComponent, isStandalone: true, selector: "abp-blog-modal", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<abp-modal [visible]=\"true\" (visibleChange)=\"onVisibleChange($event)\">\r\n <ng-template #abpHeader>\r\n <h3>\r\n {{ (selected()?.id ? 'AbpUi::Edit' : 'AbpUi::New') | abpLocalization }}\r\n </h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n @if (form) {\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected()\" />\r\n </form>\r\n } @else {\r\n <div class=\"text-center\">\r\n <i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i>\r\n </div>\r\n }\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">\r\n {{ 'AbpUi::Save' | abpLocalization }}\r\n </abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "component", type: ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: NgxValidateCoreModule }, { kind: "directive", type: i2$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }] }); }
|
|
817
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: BlogModalComponent, isStandalone: true, selector: "abp-blog-modal", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<abp-modal [visible]=\"true\" (visibleChange)=\"onVisibleChange($event)\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>\r\n {{ (selected()?.id ? 'AbpUi::Edit' : 'AbpUi::New') | abpLocalization }}\r\n </h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n @if (form) {\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected()\" />\r\n </form>\r\n } @else {\r\n <div class=\"text-center\">\r\n <i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i>\r\n </div>\r\n }\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">\r\n {{ 'AbpUi::Save' | abpLocalization }}\r\n </abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "component", type: ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: NgxValidateCoreModule }, { kind: "directive", type: i2$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }] }); }
|
|
813
818
|
}
|
|
814
819
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: BlogModalComponent, decorators: [{
|
|
815
820
|
type: Component,
|
|
@@ -822,7 +827,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
822
827
|
ModalComponent,
|
|
823
828
|
ModalCloseDirective,
|
|
824
829
|
ButtonComponent,
|
|
825
|
-
], template: "<abp-modal [visible]=\"true\" (visibleChange)=\"onVisibleChange($event)\">\r\n <ng-template #abpHeader>\r\n <h3>\r\n {{ (selected()?.id ? 'AbpUi::Edit' : 'AbpUi::New') | abpLocalization }}\r\n </h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n @if (form) {\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected()\" />\r\n </form>\r\n } @else {\r\n <div class=\"text-center\">\r\n <i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i>\r\n </div>\r\n }\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">\r\n {{ 'AbpUi::Save' | abpLocalization }}\r\n </abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
830
|
+
], template: "<abp-modal [visible]=\"true\" (visibleChange)=\"onVisibleChange($event)\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>\r\n {{ (selected()?.id ? 'AbpUi::Edit' : 'AbpUi::New') | abpLocalization }}\r\n </h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n @if (form) {\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected()\" />\r\n </form>\r\n } @else {\r\n <div class=\"text-center\">\r\n <i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i>\r\n </div>\r\n }\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">\r\n {{ 'AbpUi::Save' | abpLocalization }}\r\n </abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
826
831
|
}], propDecorators: { selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }] } });
|
|
827
832
|
|
|
828
833
|
class BlogFeaturesModalComponent {
|