SUPPORT-8916: added custom component
This commit is contained in:
parent
68445726bc
commit
aa0fc88f6b
4 changed files with 151 additions and 1 deletions
|
|
@ -0,0 +1,31 @@
|
|||
<div [id]="getObjectId()"
|
||||
class="form-group dropdown">
|
||||
<label [ngbTooltip]="tooltip | emptyIfNull"
|
||||
[hidden]="!label" class="control-label">
|
||||
<span>{{label}}<span *ngIf="isRequired()" class="alarm"> *</span></span>
|
||||
</label>
|
||||
<div class="component-float">
|
||||
<div class="dropdown-content" (mouseout)="onDropdownMouseOut()">
|
||||
<input [type]="typeAsString"
|
||||
class="form-control"
|
||||
[name]="name"
|
||||
[masked-input]="mask"
|
||||
[regexMask]="regexMask"
|
||||
[un-mask-value]="unMaskValue"
|
||||
[casing]="casingValue"
|
||||
[placeholder]="placeholder | emptyIfNull"
|
||||
[maxlength]="allowMoreSymbols ? null : maxLength"
|
||||
[maxLengthAllowingMoreSymbols]="allowMoreSymbols ? maxLength : null"
|
||||
[minlength]="minLength"
|
||||
[(ngModel)]="internalValue"
|
||||
#model="ngModel"
|
||||
[disabled]="!isEnabled()"
|
||||
[ngStyle]="style"
|
||||
[required]="isRequired()"
|
||||
[pattern]="pattern"
|
||||
[title]="getValueForTooltip()"
|
||||
(focus)="onFocus()"
|
||||
(blur)="onBlur()">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import {TextFieldGridEditor} from "@webbpm/base-package";
|
||||
import {ChangeDetectionStrategy, Component} from "@angular/core";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'text-field-ervu-grid-editor',
|
||||
templateUrl: './../../../../../src/resources/template/account_applications/component/grid/ErvuAccountTextFieldGridEditor.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ErvuAccountTextFieldGridEditor extends TextFieldGridEditor{
|
||||
|
||||
onBlur() {
|
||||
super.onBlur();
|
||||
if (this.getValue() && !this.isValueValid()) {
|
||||
this.clearValue();
|
||||
this.cd.markForCheck();
|
||||
}
|
||||
}
|
||||
|
||||
protected isValueValid() {
|
||||
if (this.pattern) {
|
||||
const regex = new RegExp(this.pattern);
|
||||
return regex.test(this.getValue());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -27,6 +27,7 @@ import {NewPasswordComponent} from "./component/new-password.component";
|
|||
import {AppProgressIndicationComponent} from "./component/app-progress-indication.component";
|
||||
import {AppProgressIndicationService} from "./service/app-progress-indication.service";
|
||||
import {VBoxLoadValues} from "../../account_applications/component/container/VBoxLoadValues";
|
||||
import {ErvuAccountTextFieldGridEditor} from "../../account_applications/component/grid/ErvuAccountTextFieldGridEditor";
|
||||
|
||||
registerLocaleData(localeRu);
|
||||
export const DIRECTIVES = [
|
||||
|
|
@ -42,7 +43,8 @@ export const DIRECTIVES = [
|
|||
forwardRef(() => ResetPasswordComponent),
|
||||
forwardRef(() => NewPasswordComponent),
|
||||
forwardRef(() => AppProgressIndicationComponent),
|
||||
forwardRef(() => VBoxLoadValues)
|
||||
forwardRef(() => VBoxLoadValues),
|
||||
forwardRef(() => ErvuAccountTextFieldGridEditor)
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
|
|
|||
|
|
@ -2727,6 +2727,8 @@
|
|||
</properties>
|
||||
</scripts>
|
||||
<scripts id="e83fada5-9370-43cf-a757-f60760fa9397">
|
||||
<enabled>false</enabled>
|
||||
<expanded>false</expanded>
|
||||
<properties>
|
||||
<entry>
|
||||
<key>casing</key>
|
||||
|
|
@ -2837,6 +2839,93 @@
|
|||
<value>
|
||||
<simple>{"schema":"public","table":"link_user_application_ip_address","entity":"link_user_application_ip_address","name":"ip_address"}</simple>
|
||||
</value>
|
||||
</entry>
|
||||
</properties>
|
||||
</scripts>
|
||||
<scripts id="62021741-c2b5-4bf4-bf74-c1f5f688307e">
|
||||
<classRef type="TS">
|
||||
<className>ErvuAccountTextFieldGridEditor</className>
|
||||
<packageName>account_applications.component.grid</packageName>
|
||||
</classRef>
|
||||
<enabled>true</enabled>
|
||||
<expanded>true</expanded>
|
||||
<properties>
|
||||
<entry>
|
||||
<key>cssClasses</key>
|
||||
<value>
|
||||
<item id="255fcea2-f068-4026-943c-2537985f145a" removed="false">
|
||||
<value>
|
||||
<simple>"long-value-input"</simple>
|
||||
</value>
|
||||
</item>
|
||||
<item id="d1473c01-d47c-4f0f-a7b2-2d98a6e6dc04" removed="false">
|
||||
<value>
|
||||
<simple>"width-full"</simple>
|
||||
</value>
|
||||
</item>
|
||||
<item id="69595237-dd03-4a48-bcfc-b4418b14ba88" removed="true"/>
|
||||
<item id="e8f8b40f-3307-4a4f-b181-b3febcfbe1e8" removed="true"/>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>label</key>
|
||||
<value>
|
||||
<simple>null</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>mask</key>
|
||||
<value>
|
||||
<simple>"9[9][9].9[9][9].9[9][9].9[9][9]"</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>minLength</key>
|
||||
<value>
|
||||
<simple>null</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>pattern</key>
|
||||
<value>
|
||||
<simple>"^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$"</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>patternErrorMessage</key>
|
||||
<value>
|
||||
<simple>null</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>placeholder</key>
|
||||
<value>
|
||||
<simple>"0.0.0.0"</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>regexMask</key>
|
||||
<value>
|
||||
<simple>false</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>required</key>
|
||||
<value>
|
||||
<simple>true</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>tooltip</key>
|
||||
<value>
|
||||
<simple>null</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>unMaskValue</key>
|
||||
<value>
|
||||
<simple>false</simple>
|
||||
</value>
|
||||
</entry>
|
||||
</properties>
|
||||
</scripts>
|
||||
|
|
@ -2875,6 +2964,7 @@
|
|||
<componentRootId>dd4cd434-7c4a-46d6-85dc-ef991a460d8f</componentRootId>
|
||||
<name>Hbox</name>
|
||||
<container>true</container>
|
||||
<expanded>false</expanded>
|
||||
<childrenReordered>false</childrenReordered>
|
||||
<scripts id="bf098f19-480e-44e4-9084-aa42955c4d0f">
|
||||
<properties>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue