@dereekb/dbx-form 8.6.0 → 8.7.1
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/lib/formly/config/validation.mjs +6 -6
- package/esm2020/lib/formly/field/field.mjs +27 -2
- package/esm2020/lib/formly/field/value/hidden.field.mjs +1 -1
- package/esm2020/lib/formly/field/value/index.mjs +2 -1
- package/esm2020/lib/formly/field/value/number/index.mjs +3 -0
- package/esm2020/lib/formly/field/value/number/number.field.mjs +23 -0
- package/esm2020/lib/formly/field/value/number/number.field.module.mjs +18 -0
- package/esm2020/lib/formly/field/value/text/text.field.mjs +1 -1
- package/esm2020/lib/formly/field/value/value.module.mjs +5 -4
- package/esm2020/lib/formly/formly.directive.mjs +1 -1
- package/esm2020/lib/formly/template/available.mjs +1 -1
- package/esm2020/lib/validator/number.mjs +23 -1
- package/fesm2015/dereekb-dbx-form.mjs +183 -107
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +191 -110
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/formly/field/field.d.ts +23 -1
- package/lib/formly/field/value/hidden.field.d.ts +1 -1
- package/lib/formly/field/value/index.d.ts +1 -0
- package/lib/formly/field/value/number/index.d.ts +2 -0
- package/lib/formly/field/value/number/number.field.d.ts +13 -0
- package/lib/formly/field/value/number/number.field.module.d.ts +8 -0
- package/lib/formly/field/value/text/text.field.d.ts +4 -4
- package/lib/formly/field/value/value.module.d.ts +3 -2
- package/lib/formly/formly.directive.d.ts +1 -1
- package/lib/formly/template/available.d.ts +1 -1
- package/lib/validator/number.d.ts +8 -0
- package/package.json +3 -3
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AsyncValidatorFn, ValidatorFn } from '@angular/forms';
|
|
2
|
+
import { FilterKeyValueTuplesInput, GeneralFilterFromPOJOFunction, ArrayOrValue, Maybe } from '@dereekb/util';
|
|
2
3
|
import { FormlyFieldConfig, FormlyFieldProps } from '@ngx-formly/core';
|
|
4
|
+
import { ValidationMessageOption } from '@ngx-formly/core/lib/models';
|
|
3
5
|
export interface FieldConfig {
|
|
4
6
|
key: string;
|
|
5
7
|
required?: boolean;
|
|
@@ -48,3 +50,23 @@ export declare function disableFormlyFieldAutofillAttributes(): {
|
|
|
48
50
|
name: string;
|
|
49
51
|
autocomplete: string;
|
|
50
52
|
};
|
|
53
|
+
export declare type FormlyMessageProperties = {
|
|
54
|
+
[messageProperties: string]: ValidationMessageOption['message'];
|
|
55
|
+
};
|
|
56
|
+
export interface ValidatorsForFieldConfigInput {
|
|
57
|
+
validators?: ArrayOrValue<ValidatorFn>;
|
|
58
|
+
asyncValidators?: ArrayOrValue<AsyncValidatorFn>;
|
|
59
|
+
messages?: Maybe<FormlyMessageProperties>;
|
|
60
|
+
}
|
|
61
|
+
export declare type ValidatorsForFieldConfig = {
|
|
62
|
+
validation?: {
|
|
63
|
+
messages?: FormlyMessageProperties;
|
|
64
|
+
};
|
|
65
|
+
validators?: {
|
|
66
|
+
validation: ValidatorFn[];
|
|
67
|
+
};
|
|
68
|
+
asyncValidators?: {
|
|
69
|
+
validation: AsyncValidatorFn[];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export declare function validatorsForFieldConfig(input: ValidatorsForFieldConfigInput): Maybe<ValidatorsForFieldConfig>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormlyFieldConfig } from '@ngx-formly/core
|
|
1
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
2
2
|
import { LabeledFieldConfig } from '../field';
|
|
3
3
|
export declare type HiddenFieldConfig = Pick<LabeledFieldConfig, 'key' | 'required'>;
|
|
4
4
|
export declare function hiddenField({ key, required }: HiddenFieldConfig): FormlyFieldConfig;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
2
|
+
import { AttributesFieldConfig, LabeledFieldConfig, DescriptionFieldConfig } from '../../field';
|
|
3
|
+
export interface NumberFieldNumberConfig {
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
enforceStep?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare type NumberFieldInputType = 'number';
|
|
10
|
+
export interface NumberFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, NumberFieldNumberConfig, AttributesFieldConfig {
|
|
11
|
+
inputType?: NumberFieldInputType;
|
|
12
|
+
}
|
|
13
|
+
export declare function numberField(config: NumberFieldConfig): FormlyFieldConfig;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@ngx-formly/material";
|
|
3
|
+
import * as i2 from "../../wrapper/form.wrapper.module";
|
|
4
|
+
export declare class DbxFormFormlyNumberFieldModule {
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyNumberFieldModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyNumberFieldModule, never, [typeof i1.FormlyMaterialModule], [typeof i2.DbxFormFormlyWrapperModule]>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyNumberFieldModule>;
|
|
8
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { FormlyFieldConfig } from '@ngx-formly/core
|
|
2
|
-
import { AttributesFieldConfig, LabeledFieldConfig } from '../../field';
|
|
1
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
2
|
+
import { AttributesFieldConfig, LabeledFieldConfig, DescriptionFieldConfig } from '../../field';
|
|
3
3
|
export interface TextFieldLengthConfig {
|
|
4
4
|
minLength?: number;
|
|
5
5
|
maxLength?: number;
|
|
6
6
|
}
|
|
7
7
|
export declare type TextFieldInputType = 'text' | 'password' | 'email';
|
|
8
|
-
export interface TextFieldConfig extends LabeledFieldConfig, TextFieldLengthConfig, AttributesFieldConfig {
|
|
8
|
+
export interface TextFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, TextFieldLengthConfig, AttributesFieldConfig {
|
|
9
9
|
inputType?: TextFieldInputType;
|
|
10
10
|
pattern?: string | RegExp;
|
|
11
11
|
}
|
|
12
12
|
export declare function textField(config: TextFieldConfig): FormlyFieldConfig;
|
|
13
|
-
export interface TextAreaFieldConfig extends LabeledFieldConfig, TextFieldLengthConfig, AttributesFieldConfig {
|
|
13
|
+
export interface TextAreaFieldConfig extends LabeledFieldConfig, DescriptionFieldConfig, TextFieldLengthConfig, AttributesFieldConfig {
|
|
14
14
|
rows?: number;
|
|
15
15
|
}
|
|
16
16
|
export declare function textAreaField(config: TextAreaFieldConfig): FormlyFieldConfig;
|
|
@@ -5,9 +5,10 @@ import * as i3 from "./boolean/boolean.field.module";
|
|
|
5
5
|
import * as i4 from "./date/date.field.module";
|
|
6
6
|
import * as i5 from "./enum/enum.field.module";
|
|
7
7
|
import * as i6 from "./phone/phone.field.module";
|
|
8
|
-
import * as i7 from "./
|
|
8
|
+
import * as i7 from "./number/number.field.module";
|
|
9
|
+
import * as i8 from "./text/text.field.module";
|
|
9
10
|
export declare class DbxFormFormlyValueModule {
|
|
10
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFormFormlyValueModule, never>;
|
|
11
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyValueModule, never, [typeof i1.CommonModule], [typeof i2.DbxFormFormlyArrayFieldModule, typeof i3.DbxFormFormlyBooleanFieldModule, typeof i4.DbxFormFormlyDateFieldModule, typeof i5.DbxFormFormlyEnumFieldModule, typeof i6.DbxFormFormlyPhoneFieldModule, typeof i7.DbxFormFormlyTextFieldModule]>;
|
|
12
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxFormFormlyValueModule, never, [typeof i1.CommonModule], [typeof i2.DbxFormFormlyArrayFieldModule, typeof i3.DbxFormFormlyBooleanFieldModule, typeof i4.DbxFormFormlyDateFieldModule, typeof i5.DbxFormFormlyEnumFieldModule, typeof i6.DbxFormFormlyPhoneFieldModule, typeof i7.DbxFormFormlyNumberFieldModule, typeof i8.DbxFormFormlyTextFieldModule]>;
|
|
12
13
|
static ɵinj: i0.ɵɵInjectorDeclaration<DbxFormFormlyValueModule>;
|
|
13
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { FormlyFieldConfig } from '@ngx-formly/core
|
|
2
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
3
3
|
import { OnInit, OnDestroy } from '@angular/core';
|
|
4
4
|
import { DbxFormlyContext } from './formly.context';
|
|
5
5
|
import { Maybe } from '@dereekb/util';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormlyFieldConfig } from '@ngx-formly/core
|
|
1
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
2
2
|
import { FieldValueIsAvailableValidatorConfig } from '../../validator/available';
|
|
3
3
|
import { TextFieldConfig } from '../field/value/text/text.field';
|
|
4
4
|
export interface TextAvailableFieldConfig extends TextFieldConfig, Omit<FieldValueIsAvailableValidatorConfig<string>, 'message'> {
|
|
@@ -7,3 +7,11 @@ import { ValidatorFn } from '@angular/forms';
|
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
9
|
export declare function isInRange(min?: number, max?: number): ValidatorFn;
|
|
10
|
+
export declare const IS_DIVISIBLE_BY_VALIDATION_KEY = "isDivisibleBy";
|
|
11
|
+
export interface IsDivisibleByError {
|
|
12
|
+
value: number;
|
|
13
|
+
nearest: number;
|
|
14
|
+
divisor: number;
|
|
15
|
+
message: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function isDivisibleBy(divisor: number): ValidatorFn;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-form",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.7.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^13.0.0",
|
|
6
6
|
"@angular/core": "^13.0.0",
|
|
7
|
-
"@dereekb/dbx-core": "8.
|
|
7
|
+
"@dereekb/dbx-core": "8.7.1",
|
|
8
8
|
"@angular/material": "^13.0.0",
|
|
9
|
-
"@dereekb/dbx-web": "8.
|
|
9
|
+
"@dereekb/dbx-web": "8.7.1",
|
|
10
10
|
"@angular/forms": "^13.0.0",
|
|
11
11
|
"@ngx-formly/core": "6.0.0-beta.3",
|
|
12
12
|
"@ngx-formly/material": "6.0.0-beta.3",
|