ngx-rs-ant 0.6.0 → 0.6.6
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/box-container/box-item/item-blank/item-blank.component.mjs +3 -3
- package/esm2020/form/form.component.mjs +10 -6
- package/fesm2015/ngx-rs-ant.mjs +9 -5
- package/fesm2015/ngx-rs-ant.mjs.map +1 -1
- package/fesm2020/ngx-rs-ant.mjs +9 -5
- package/fesm2020/ngx-rs-ant.mjs.map +1 -1
- package/form/form.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -10,11 +10,11 @@ export class ItemBlankComponent {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
ItemBlankComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemBlankComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
-
ItemBlankComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ItemBlankComponent, selector: "rs-item-blank", outputs: { dropItem: "dropItem" }, ngImport: i0, template: "<div\n dDroppable\n [dropScope]=\"'
|
|
13
|
+
ItemBlankComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ItemBlankComponent, selector: "rs-item-blank", outputs: { dropItem: "dropItem" }, ngImport: i0, template: "<div\n dDroppable\n [dropScope]=\"['page', 'form']\"\n dragOverClass=\"active\"\n (dropEvent)=\"dropEvent($event)\"\n>\n <span>\u62D6\u62FD\u7EC4\u4EF6\u5230\u6B64\u5904</span>\n</div>\n", styles: [":host{flex:1;margin:16px;border:1px solid var(--devui-dividing-line, #f2f2f3);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AQMAAAAAMksxAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAZQTFRF8fHxAAAAMCd7XAAAAAJ0Uk5T/wDltzBKAAABJUlEQVR4nFVSy23EIBCdAiKxBaxCC1tBaGk7YG/OjZYSOQptLKKB8Y0D8ssbjBPl9gQz7wfigQbgQxygEXjIAjwDcJEV+PbYb1KAlNDusgE+Q1Va3EPFptJDjwVVZfcNiqwCV9BiIlhW9DdPkEn5GggKRV4igVL2AYJGpc8TFAMa5lXhzHuc69dwEO6DkBI9OhNVii60ERu3VxrjRUVRet7DsMoUbpgny+LRb5b0K2C/CAWejCxCSYVl9wcQSaMEzuRRArcqebzxcMCnUcKQsBKiiVoJoR1+4DfWSodILCGa5zXTvKWo5L5ars0C/iuh003F7GecbG62YVujunzypDqZTcsK76HF2UYP41HM4WoO7eEWNLUUyaHf/3L9JvXnBwjzS/wAoXR0PDbjCSUAAAAASUVORK5CYII=) repeat var(--devui-unavailable, #f5f5f5);display:flex;flex-flow:row nowrap;justify-content:center;pointer-events:all}:host div{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div span{text-align:center;-webkit-user-select:none;user-select:none}:host div.active{background-color:var(--devui-waiting, #beccfa)}:host.plugin-hover>div{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i1.DroppableDirective, selector: "[dDroppable]", inputs: ["dragOverClass", "dropScope", "placeholderTag", "placeholderStyle", "placeholderText", "allowDropOnItem", "dragOverItemClass", "nestingTargetRect", "switchWhileCrossEdge", "defaultDropPosition", "dropSortCountSelector", "dropSortVirtualScrollOption"], outputs: ["dragEnterEvent", "dragOverEvent", "dragLeaveEvent", "dropEvent"] }] });
|
|
14
14
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemBlankComponent, decorators: [{
|
|
15
15
|
type: Component,
|
|
16
|
-
args: [{ selector: 'rs-item-blank', template: "<div\n dDroppable\n [dropScope]=\"'
|
|
16
|
+
args: [{ selector: 'rs-item-blank', template: "<div\n dDroppable\n [dropScope]=\"['page', 'form']\"\n dragOverClass=\"active\"\n (dropEvent)=\"dropEvent($event)\"\n>\n <span>\u62D6\u62FD\u7EC4\u4EF6\u5230\u6B64\u5904</span>\n</div>\n", styles: [":host{flex:1;margin:16px;border:1px solid var(--devui-dividing-line, #f2f2f3);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AQMAAAAAMksxAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAZQTFRF8fHxAAAAMCd7XAAAAAJ0Uk5T/wDltzBKAAABJUlEQVR4nFVSy23EIBCdAiKxBaxCC1tBaGk7YG/OjZYSOQptLKKB8Y0D8ssbjBPl9gQz7wfigQbgQxygEXjIAjwDcJEV+PbYb1KAlNDusgE+Q1Va3EPFptJDjwVVZfcNiqwCV9BiIlhW9DdPkEn5GggKRV4igVL2AYJGpc8TFAMa5lXhzHuc69dwEO6DkBI9OhNVii60ERu3VxrjRUVRet7DsMoUbpgny+LRb5b0K2C/CAWejCxCSYVl9wcQSaMEzuRRArcqebzxcMCnUcKQsBKiiVoJoR1+4DfWSodILCGa5zXTvKWo5L5ars0C/iuh003F7GecbG62YVujunzypDqZTcsK76HF2UYP41HM4WoO7eEWNLUUyaHf/3L9JvXnBwjzS/wAoXR0PDbjCSUAAAAASUVORK5CYII=) repeat var(--devui-unavailable, #f5f5f5);display:flex;flex-flow:row nowrap;justify-content:center;pointer-events:all}:host div{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div span{text-align:center;-webkit-user-select:none;user-select:none}:host div.active{background-color:var(--devui-waiting, #beccfa)}:host.plugin-hover>div{pointer-events:none}\n"] }]
|
|
17
17
|
}], propDecorators: { dropItem: [{
|
|
18
18
|
type: Output
|
|
19
19
|
}] } });
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXRlbS1ibGFuay5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmN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MgSXRlbUJsYW5rQ29tcG9uZW50IHtcbiAgQE91dHB1dCgpXG4gIGRyb3BJdGVtID0gbmV3IEV2ZW50RW1pdHRlcigpO1xuXG4gIGRyb3BFdmVudCgkZXZlbnQ6IGFueSkge1xuICAgIHRoaXMuZHJvcEl0ZW0uZW1pdCgkZXZlbnQuZHJhZ0RhdGEpO1xuICB9XG59XG4iLCI8ZGl2XG4gIGREcm9wcGFibGVcbiAgW2Ryb3BTY29wZV09XCJbJ3BhZ2UnLCAnZm9ybSddXCJcbiAgZHJhZ092ZXJDbGFzcz1cImFjdGl2ZVwiXG4gIChkcm9wRXZlbnQpPVwiZHJvcEV2ZW50KCRldmVudClcIlxuPlxuICA8c3Bhbj7mi5bmi73nu4Tku7bliLDmraTlpIQ8L3NwYW4+XG48L2Rpdj5cbiJdfQ==
|
|
@@ -6,32 +6,36 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
import * as i1 from "./form.service";
|
|
7
7
|
import * as i2 from "@angular/common";
|
|
8
8
|
import * as i3 from "ng-devui/form";
|
|
9
|
-
import * as i4 from "
|
|
10
|
-
import * as i5 from "
|
|
9
|
+
import * as i4 from "ng-devui/loading";
|
|
10
|
+
import * as i5 from "@angular/forms";
|
|
11
|
+
import * as i6 from "../box-container/box-container.component";
|
|
11
12
|
export class FormComponent {
|
|
12
13
|
constructor(service) {
|
|
13
14
|
this.service = service;
|
|
14
15
|
this.layoutDirection = FormLayout.Vertical;
|
|
15
16
|
this.formGroup = new UntypedFormGroup({});
|
|
16
17
|
this.submitCallback = new EventEmitter();
|
|
18
|
+
this.loading = false;
|
|
17
19
|
}
|
|
18
20
|
ngOnInit() {
|
|
19
21
|
this.service.getFormTemplateConfig(this.tenant, this.className, this.template).subscribe((response) => {
|
|
20
22
|
this.config = response.data.template;
|
|
21
23
|
if (this.copyOid || this.oid) {
|
|
24
|
+
this.loading = true;
|
|
22
25
|
const attributes = Object.keys(this.formGroup.controls);
|
|
23
26
|
this.service.getOne(this.tenant, this.className, this.copyOid || this.oid, attributes).subscribe((response) => {
|
|
24
27
|
if (this.copyOid) {
|
|
25
28
|
delete response.data.oid;
|
|
26
29
|
}
|
|
27
30
|
this.formGroup.patchValue(response.data);
|
|
31
|
+
this.loading = false;
|
|
28
32
|
});
|
|
29
33
|
}
|
|
30
34
|
});
|
|
31
35
|
}
|
|
32
36
|
submitForm($event) {
|
|
33
37
|
if (!$event.valid) {
|
|
34
|
-
this.submitCallback.emit();
|
|
38
|
+
this.submitCallback.emit({ success: false });
|
|
35
39
|
return;
|
|
36
40
|
}
|
|
37
41
|
this.service.createOrUpdate(this.tenant, this.className, {
|
|
@@ -46,10 +50,10 @@ export class FormComponent {
|
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, deps: [{ token: i1.FormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
49
|
-
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template" }, outputs: { submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], ngImport: i0, template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.FormDirective, selector: "[dForm]", inputs: ["layout", "labelSize", "labelAlign", "dFeedbackType", "dHasFeedback"], outputs: ["dSubmit"], exportAs: ["dForm"] }, { kind: "directive", type: i3.DFormSubmitDirective, selector: "[dFormSubmit]", inputs: ["dFormSubmit", "dFormSubmitData"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type:
|
|
53
|
+
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template" }, outputs: { submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], ngImport: i0, template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\"\n dLoading [loading]=\"loading\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.FormDirective, selector: "[dForm]", inputs: ["layout", "labelSize", "labelAlign", "dFeedbackType", "dHasFeedback"], outputs: ["dSubmit"], exportAs: ["dForm"] }, { kind: "directive", type: i3.DFormSubmitDirective, selector: "[dFormSubmit]", inputs: ["dFormSubmit", "dFormSubmitData"] }, { kind: "directive", type: i4.LoadingDirective, selector: "[dLoading]", inputs: ["backdrop", "message", "positionType", "showLoading", "view", "zIndex", "loading", "loadingStyle", "loadingTemplateRef"], exportAs: ["dLoading"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i6.BoxContainerComponent, selector: "rs-box-container", inputs: ["editMode", "config", "formGroup", "tabViewContainerRef"] }] });
|
|
50
54
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, decorators: [{
|
|
51
55
|
type: Component,
|
|
52
|
-
args: [{ selector: 'rs-form', providers: [FormService], template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n" }]
|
|
56
|
+
args: [{ selector: 'rs-form', providers: [FormService], template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\"\n dLoading [loading]=\"loading\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n" }]
|
|
53
57
|
}], ctorParameters: function () { return [{ type: i1.FormService }]; }, propDecorators: { tenant: [{
|
|
54
58
|
type: Input
|
|
55
59
|
}], className: [{
|
|
@@ -66,4 +70,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
66
70
|
}], submitCallback: [{
|
|
67
71
|
type: Output
|
|
68
72
|
}] } });
|
|
69
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
73
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtcnMtYW50L3NyYy9mb3JtL2Zvcm0uY29tcG9uZW50L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uZm9ybVN1Ym1pdHRlci5uYXRpdmVFbGVtZW50LmNsaWNrKCk7XG4gIH1cbn1cbiIsIjxmb3JtIGRGb3JtIFtmb3JtR3JvdXBdPVwiZm9ybUdyb3VwXCIgW2xheW91dF09XCJsYXlvdXREaXJlY3Rpb25cIiAoZFN1Ym1pdCk9XCJzdWJtaXRGb3JtKCRldmVudClcIlxuICAgICAgZExvYWRpbmcgW2xvYWRpbmddPVwibG9hZGluZ1wiPlxuICA8bmctY29udGFpbmVyICpuZ0lmPVwiY29uZmlnXCI+XG4gICAgPHJzLWJveC1jb250YWluZXIgW2NvbmZpZ109XCJjb25maWdcIiBbZm9ybUdyb3VwXT1cImZvcm1Hcm91cFwiPjwvcnMtYm94LWNvbnRhaW5lcj5cbiAgPC9uZy1jb250YWluZXI+XG4gIDxidXR0b24gI2Zvcm1TdWJtaXR0ZXIgZEZvcm1TdWJtaXQ9XCJjbGlja1wiPjwvYnV0dG9uPlxuPC9mb3JtPlxuIl19
|
package/fesm2015/ngx-rs-ant.mjs
CHANGED
|
@@ -18,6 +18,7 @@ import * as i5$1 from 'devextreme-angular/core';
|
|
|
18
18
|
import * as i2$1 from 'ng-devui/button';
|
|
19
19
|
import * as i3$1 from 'ng-devui/form';
|
|
20
20
|
import * as i4$1 from 'ng-devui/text-input';
|
|
21
|
+
import * as i4$2 from 'ng-devui/loading';
|
|
21
22
|
|
|
22
23
|
class DividerLineComponent {
|
|
23
24
|
get _style() {
|
|
@@ -397,10 +398,10 @@ class ItemBlankComponent {
|
|
|
397
398
|
}
|
|
398
399
|
}
|
|
399
400
|
ItemBlankComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemBlankComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
400
|
-
ItemBlankComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ItemBlankComponent, selector: "rs-item-blank", outputs: { dropItem: "dropItem" }, ngImport: i0, template: "<div\n dDroppable\n [dropScope]=\"'
|
|
401
|
+
ItemBlankComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ItemBlankComponent, selector: "rs-item-blank", outputs: { dropItem: "dropItem" }, ngImport: i0, template: "<div\n dDroppable\n [dropScope]=\"['page', 'form']\"\n dragOverClass=\"active\"\n (dropEvent)=\"dropEvent($event)\"\n>\n <span>\u62D6\u62FD\u7EC4\u4EF6\u5230\u6B64\u5904</span>\n</div>\n", styles: [":host{flex:1;margin:16px;border:1px solid var(--devui-dividing-line, #f2f2f3);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AQMAAAAAMksxAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAZQTFRF8fHxAAAAMCd7XAAAAAJ0Uk5T/wDltzBKAAABJUlEQVR4nFVSy23EIBCdAiKxBaxCC1tBaGk7YG/OjZYSOQptLKKB8Y0D8ssbjBPl9gQz7wfigQbgQxygEXjIAjwDcJEV+PbYb1KAlNDusgE+Q1Va3EPFptJDjwVVZfcNiqwCV9BiIlhW9DdPkEn5GggKRV4igVL2AYJGpc8TFAMa5lXhzHuc69dwEO6DkBI9OhNVii60ERu3VxrjRUVRet7DsMoUbpgny+LRb5b0K2C/CAWejCxCSYVl9wcQSaMEzuRRArcqebzxcMCnUcKQsBKiiVoJoR1+4DfWSodILCGa5zXTvKWo5L5ars0C/iuh003F7GecbG62YVujunzypDqZTcsK76HF2UYP41HM4WoO7eEWNLUUyaHf/3L9JvXnBwjzS/wAoXR0PDbjCSUAAAAASUVORK5CYII=) repeat var(--devui-unavailable, #f5f5f5);display:flex;flex-flow:row nowrap;justify-content:center;pointer-events:all}:host div{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div span{text-align:center;-webkit-user-select:none;user-select:none}:host div.active{background-color:var(--devui-waiting, #beccfa)}:host.plugin-hover>div{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i1$1.DroppableDirective, selector: "[dDroppable]", inputs: ["dragOverClass", "dropScope", "placeholderTag", "placeholderStyle", "placeholderText", "allowDropOnItem", "dragOverItemClass", "nestingTargetRect", "switchWhileCrossEdge", "defaultDropPosition", "dropSortCountSelector", "dropSortVirtualScrollOption"], outputs: ["dragEnterEvent", "dragOverEvent", "dragLeaveEvent", "dropEvent"] }] });
|
|
401
402
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ItemBlankComponent, decorators: [{
|
|
402
403
|
type: Component,
|
|
403
|
-
args: [{ selector: 'rs-item-blank', template: "<div\n dDroppable\n [dropScope]=\"'
|
|
404
|
+
args: [{ selector: 'rs-item-blank', template: "<div\n dDroppable\n [dropScope]=\"['page', 'form']\"\n dragOverClass=\"active\"\n (dropEvent)=\"dropEvent($event)\"\n>\n <span>\u62D6\u62FD\u7EC4\u4EF6\u5230\u6B64\u5904</span>\n</div>\n", styles: [":host{flex:1;margin:16px;border:1px solid var(--devui-dividing-line, #f2f2f3);background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AQMAAAAAMksxAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAZQTFRF8fHxAAAAMCd7XAAAAAJ0Uk5T/wDltzBKAAABJUlEQVR4nFVSy23EIBCdAiKxBaxCC1tBaGk7YG/OjZYSOQptLKKB8Y0D8ssbjBPl9gQz7wfigQbgQxygEXjIAjwDcJEV+PbYb1KAlNDusgE+Q1Va3EPFptJDjwVVZfcNiqwCV9BiIlhW9DdPkEn5GggKRV4igVL2AYJGpc8TFAMa5lXhzHuc69dwEO6DkBI9OhNVii60ERu3VxrjRUVRet7DsMoUbpgny+LRb5b0K2C/CAWejCxCSYVl9wcQSaMEzuRRArcqebzxcMCnUcKQsBKiiVoJoR1+4DfWSodILCGa5zXTvKWo5L5ars0C/iuh003F7GecbG62YVujunzypDqZTcsK76HF2UYP41HM4WoO7eEWNLUUyaHf/3L9JvXnBwjzS/wAoXR0PDbjCSUAAAAASUVORK5CYII=) repeat var(--devui-unavailable, #f5f5f5);display:flex;flex-flow:row nowrap;justify-content:center;pointer-events:all}:host div{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div span{text-align:center;-webkit-user-select:none;user-select:none}:host div.active{background-color:var(--devui-waiting, #beccfa)}:host.plugin-hover>div{pointer-events:none}\n"] }]
|
|
404
405
|
}], propDecorators: { dropItem: [{
|
|
405
406
|
type: Output
|
|
406
407
|
}] } });
|
|
@@ -993,24 +994,27 @@ class FormComponent {
|
|
|
993
994
|
this.layoutDirection = FormLayout.Vertical;
|
|
994
995
|
this.formGroup = new UntypedFormGroup({});
|
|
995
996
|
this.submitCallback = new EventEmitter();
|
|
997
|
+
this.loading = false;
|
|
996
998
|
}
|
|
997
999
|
ngOnInit() {
|
|
998
1000
|
this.service.getFormTemplateConfig(this.tenant, this.className, this.template).subscribe((response) => {
|
|
999
1001
|
this.config = response.data.template;
|
|
1000
1002
|
if (this.copyOid || this.oid) {
|
|
1003
|
+
this.loading = true;
|
|
1001
1004
|
const attributes = Object.keys(this.formGroup.controls);
|
|
1002
1005
|
this.service.getOne(this.tenant, this.className, this.copyOid || this.oid, attributes).subscribe((response) => {
|
|
1003
1006
|
if (this.copyOid) {
|
|
1004
1007
|
delete response.data.oid;
|
|
1005
1008
|
}
|
|
1006
1009
|
this.formGroup.patchValue(response.data);
|
|
1010
|
+
this.loading = false;
|
|
1007
1011
|
});
|
|
1008
1012
|
}
|
|
1009
1013
|
});
|
|
1010
1014
|
}
|
|
1011
1015
|
submitForm($event) {
|
|
1012
1016
|
if (!$event.valid) {
|
|
1013
|
-
this.submitCallback.emit();
|
|
1017
|
+
this.submitCallback.emit({ success: false });
|
|
1014
1018
|
return;
|
|
1015
1019
|
}
|
|
1016
1020
|
this.service.createOrUpdate(this.tenant, this.className, Object.assign({ oid: this.oid }, this.formGroup.value)).subscribe((response) => {
|
|
@@ -1022,10 +1026,10 @@ class FormComponent {
|
|
|
1022
1026
|
}
|
|
1023
1027
|
}
|
|
1024
1028
|
FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, deps: [{ token: FormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1025
|
-
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template" }, outputs: { submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], ngImport: i0, template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.FormDirective, selector: "[dForm]", inputs: ["layout", "labelSize", "labelAlign", "dFeedbackType", "dHasFeedback"], outputs: ["dSubmit"], exportAs: ["dForm"] }, { kind: "directive", type: i3$1.DFormSubmitDirective, selector: "[dFormSubmit]", inputs: ["dFormSubmit", "dFormSubmitData"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["editMode", "config", "formGroup", "tabViewContainerRef"] }] });
|
|
1029
|
+
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template" }, outputs: { submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], ngImport: i0, template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\"\n dLoading [loading]=\"loading\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.FormDirective, selector: "[dForm]", inputs: ["layout", "labelSize", "labelAlign", "dFeedbackType", "dHasFeedback"], outputs: ["dSubmit"], exportAs: ["dForm"] }, { kind: "directive", type: i3$1.DFormSubmitDirective, selector: "[dFormSubmit]", inputs: ["dFormSubmit", "dFormSubmitData"] }, { kind: "directive", type: i4$2.LoadingDirective, selector: "[dLoading]", inputs: ["backdrop", "message", "positionType", "showLoading", "view", "zIndex", "loading", "loadingStyle", "loadingTemplateRef"], exportAs: ["dLoading"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["editMode", "config", "formGroup", "tabViewContainerRef"] }] });
|
|
1026
1030
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, decorators: [{
|
|
1027
1031
|
type: Component,
|
|
1028
|
-
args: [{ selector: 'rs-form', providers: [FormService], template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n" }]
|
|
1032
|
+
args: [{ selector: 'rs-form', providers: [FormService], template: "<form dForm [formGroup]=\"formGroup\" [layout]=\"layoutDirection\" (dSubmit)=\"submitForm($event)\"\n dLoading [loading]=\"loading\">\n <ng-container *ngIf=\"config\">\n <rs-box-container [config]=\"config\" [formGroup]=\"formGroup\"></rs-box-container>\n </ng-container>\n <button #formSubmitter dFormSubmit=\"click\"></button>\n</form>\n" }]
|
|
1029
1033
|
}], ctorParameters: function () { return [{ type: FormService }]; }, propDecorators: { tenant: [{
|
|
1030
1034
|
type: Input
|
|
1031
1035
|
}], className: [{
|