SUPPORT-9089: return base FileUpload
This commit is contained in:
parent
6581f5aa85
commit
659fa15181
7 changed files with 33 additions and 788 deletions
|
|
@ -1,53 +0,0 @@
|
|||
import {FileUpload, InputControl} from "@webbpm/base-package";
|
||||
import {ChangeDetectionStrategy, Component} from "@angular/core";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'temp-file-upload',
|
||||
templateUrl: './../../../../../src/resources/template/account_applications/component/field/TemporaryFileUpload.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class TemporaryFileUpload extends FileUpload {
|
||||
|
||||
onChange() {
|
||||
this.updateValidationState();
|
||||
super.onChange();
|
||||
}
|
||||
|
||||
private updateValidationState() {
|
||||
if (this.isRequired()) {
|
||||
if (this.hasValidModel()) {
|
||||
this.addCssClass('wb-valid');
|
||||
this.removeCssClass('wb-invalid');
|
||||
this.removeCustomValidationMessage(InputControl.ERROR_MESSAGES['required'])
|
||||
}
|
||||
else {
|
||||
this.addCssClass('wb-invalid');
|
||||
this.removeCssClass('wb-valid');
|
||||
this.addCustomValidationMessage(InputControl.ERROR_MESSAGES['required']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
markAsTouched() {
|
||||
this.removeCssClass('wb-untouched');
|
||||
this.addCssClass('wb-touched');
|
||||
this.modelTouched = true;
|
||||
}
|
||||
|
||||
markAsUnTouched() {
|
||||
this.addCssClass('wb-untouched');
|
||||
this.removeCssClass('wb-touched');
|
||||
this.modelTouched = false;
|
||||
}
|
||||
|
||||
actionOnInvalid() {
|
||||
this.updateValidationState();
|
||||
}
|
||||
|
||||
clearValidateMessages() {
|
||||
if(this.hasValidModel()){
|
||||
this.setCustomValidationMessages([]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,7 +25,6 @@ import {DropdownTreeViewComponent}from "../../account_applications/component/fie
|
|||
import {DropdownTreeviewSelectComponent} from "../../account_applications/component/external/ngx-treeview/dropdown-treeview-select/dropdown-treeview-select.component";
|
||||
import {TreeviewModule} from "ngx-treeview";
|
||||
import {ErvuStaticGrid} from "../../account_applications/component/grid/ErvuStaticGrid";
|
||||
import {TemporaryFileUpload} from "../../account_applications/component/field/TemporaryFileUpload";
|
||||
import {AuthorizationService} from "./service/authorization.service";
|
||||
|
||||
registerLocaleData(localeRu);
|
||||
|
|
@ -38,8 +37,7 @@ export const DIRECTIVES = [
|
|||
forwardRef(() => DropdownTreeViewComponent),
|
||||
forwardRef(() => DropdownTreeviewSelectComponent),
|
||||
forwardRef(() => ErvuAccountTextFieldGridEditor),
|
||||
forwardRef(() => ErvuStaticGrid),
|
||||
forwardRef(() => TemporaryFileUpload)
|
||||
forwardRef(() => ErvuStaticGrid)
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue