ngx-rs-ant 0.12.1 → 0.12.2
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/fesm2020/ngx-rs-ant.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import * as i2 from 'devextreme-angular/ui/number-box';
|
|
|
8
8
|
import * as i2$1 from 'devextreme-angular/ui/draggable';
|
|
9
9
|
import * as i3$2 from '@angular/forms';
|
|
10
10
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
11
|
-
import { DevExtremeModule, DxDataGridComponent } from 'devextreme-angular';
|
|
11
|
+
import { DevExtremeModule, DxDataGridComponent, DxValidationGroupComponent } from 'devextreme-angular';
|
|
12
12
|
import { HelperUtils, DevUIModule } from 'ng-devui';
|
|
13
13
|
import * as i1$1 from '@angular/common/http';
|
|
14
14
|
import CustomStore from 'devextreme/data/custom_store';
|
|
@@ -1562,10 +1562,7 @@ class FormComponent {
|
|
|
1562
1562
|
});
|
|
1563
1563
|
}
|
|
1564
1564
|
submitForm($event) {
|
|
1565
|
-
|
|
1566
|
-
if (!result.isValid) { // TODO 异步校验可能存在问题,需进一步确认
|
|
1567
|
-
this.submitCallback.emit({ success: false });
|
|
1568
|
-
result.brokenRules[0].validator.element().scrollIntoView();
|
|
1565
|
+
if (!this.validate()) {
|
|
1569
1566
|
return;
|
|
1570
1567
|
}
|
|
1571
1568
|
this.service.createOrUpdate(this.tenant, this.className, {
|
|
@@ -1575,15 +1572,26 @@ class FormComponent {
|
|
|
1575
1572
|
this.submitCallback.emit(response);
|
|
1576
1573
|
});
|
|
1577
1574
|
}
|
|
1575
|
+
validate() {
|
|
1576
|
+
const result = this.validator.instance.validate();
|
|
1577
|
+
if (!result.isValid) { // TODO 异步校验可能存在问题,需进一步确认
|
|
1578
|
+
this.submitCallback.emit({ success: false });
|
|
1579
|
+
// @ts-ignore
|
|
1580
|
+
result.brokenRules[0].validator.element().scrollIntoView();
|
|
1581
|
+
console.log(result);
|
|
1582
|
+
return false;
|
|
1583
|
+
}
|
|
1584
|
+
return true;
|
|
1585
|
+
}
|
|
1578
1586
|
submit() {
|
|
1579
1587
|
this.formSubmitter.instance.element().click();
|
|
1580
1588
|
}
|
|
1581
1589
|
}
|
|
1582
1590
|
FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, deps: [{ token: FormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1583
|
-
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>\n <dx-validation-group *ngIf=\"model\">\n <rs-box-container [config]=\"config\" [model]=\"model\"></rs-box-container>\n <dx-button #formSubmitter [visible]=\"false\" (onClick)=\"submitForm($event)\" [useSubmitBehavior]=\"true\"></dx-button>\n </dx-validation-group>\n</form>\n", styles: ["form{display:flex;flex-flow:row nowrap}form dx-validation-group{width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["editMode", "config", "model", "tabViewContainerRef"] }, { kind: "component", type: i2$3.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "component", type: i6.DxValidationGroupComponent, selector: "dx-validation-group", inputs: ["elementAttr", "height", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "elementAttrChange", "heightChange", "widthChange"] }] });
|
|
1591
|
+
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: "validator", first: true, predicate: DxValidationGroupComponent, descendants: true }, { propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], ngImport: i0, template: "<form>\n <dx-validation-group *ngIf=\"model\">\n <rs-box-container [config]=\"config\" [model]=\"model\"></rs-box-container>\n <dx-button #formSubmitter [visible]=\"false\" (onClick)=\"submitForm($event)\" [useSubmitBehavior]=\"true\"></dx-button>\n </dx-validation-group>\n</form>\n", styles: [":host{padding:12px 24px 20px}:host form{display:flex;flex-flow:row nowrap}:host form dx-validation-group{width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["editMode", "config", "model", "tabViewContainerRef"] }, { kind: "component", type: i2$3.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "component", type: i6.DxValidationGroupComponent, selector: "dx-validation-group", inputs: ["elementAttr", "height", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "elementAttrChange", "heightChange", "widthChange"] }] });
|
|
1584
1592
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, decorators: [{
|
|
1585
1593
|
type: Component,
|
|
1586
|
-
args: [{ selector: 'rs-form', providers: [FormService], template: "<form>\n <dx-validation-group *ngIf=\"model\">\n <rs-box-container [config]=\"config\" [model]=\"model\"></rs-box-container>\n <dx-button #formSubmitter [visible]=\"false\" (onClick)=\"submitForm($event)\" [useSubmitBehavior]=\"true\"></dx-button>\n </dx-validation-group>\n</form>\n", styles: ["form{display:flex;flex-flow:row nowrap}form dx-validation-group{width:100%}\n"] }]
|
|
1594
|
+
args: [{ selector: 'rs-form', providers: [FormService], template: "<form>\n <dx-validation-group *ngIf=\"model\">\n <rs-box-container [config]=\"config\" [model]=\"model\"></rs-box-container>\n <dx-button #formSubmitter [visible]=\"false\" (onClick)=\"submitForm($event)\" [useSubmitBehavior]=\"true\"></dx-button>\n </dx-validation-group>\n</form>\n", styles: [":host{padding:12px 24px 20px}:host form{display:flex;flex-flow:row nowrap}:host form dx-validation-group{width:100%}\n"] }]
|
|
1587
1595
|
}], ctorParameters: function () { return [{ type: FormService }]; }, propDecorators: { tenant: [{
|
|
1588
1596
|
type: Input
|
|
1589
1597
|
}], className: [{
|
|
@@ -1594,6 +1602,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1594
1602
|
type: Input
|
|
1595
1603
|
}], template: [{
|
|
1596
1604
|
type: Input
|
|
1605
|
+
}], validator: [{
|
|
1606
|
+
type: ViewChild,
|
|
1607
|
+
args: [DxValidationGroupComponent]
|
|
1597
1608
|
}], formSubmitter: [{
|
|
1598
1609
|
type: ViewChild,
|
|
1599
1610
|
args: ['formSubmitter']
|