@anglr/common 11.2.0-beta.20220301105549 → 11.2.0
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/changelog.md +7 -0
- package/es2015/forms/src/misc/formModel/decorators/formArrayChild.decorator.js +11 -0
- package/es2015/forms/src/misc/formModel/decorators/formArrayChild.decorator.js.map +1 -0
- package/es2015/forms/src/misc/formModel/decorators/index.js +1 -0
- package/es2015/forms/src/misc/formModel/decorators/index.js.map +1 -1
- package/es2015/forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.js +1 -1
- package/es2015/forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.js.map +1 -1
- package/es2020/forms/src/misc/formModel/decorators/formArrayChild.decorator.js +11 -0
- package/es2020/forms/src/misc/formModel/decorators/formArrayChild.decorator.js.map +1 -0
- package/es2020/forms/src/misc/formModel/decorators/index.js +1 -0
- package/es2020/forms/src/misc/formModel/decorators/index.js.map +1 -1
- package/es2020/forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.js +1 -1
- package/es2020/forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.js.map +1 -1
- package/forms/src/misc/formModel/decorators/formArrayChild.decorator.d.ts +7 -0
- package/forms/src/misc/formModel/decorators/formArrayChild.decorator.d.ts.map +1 -0
- package/forms/src/misc/formModel/decorators/index.d.ts +1 -0
- package/forms/src/misc/formModel/decorators/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/version.bak +1 -1
package/changelog.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Version 11.2.0 (2022-03-01)
|
|
4
4
|
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
- fixed `ModelPropertyMetadata` decorator metadata merging (previously multiple usages of decorator caused rewriting values with default value)
|
|
8
|
+
|
|
5
9
|
### Features
|
|
6
10
|
|
|
7
11
|
- new `PositionToDirective` directive, that sets position of attached element relative to provided element
|
|
@@ -32,6 +36,9 @@
|
|
|
32
36
|
- requires `@floating-ui/dom` package of minimal version `0.3.1`
|
|
33
37
|
- new `FloatingUiDomPosition` service that is used for positioning two elements against each other, using floating-ui dom implementation
|
|
34
38
|
- new `FLOATING_UI_POSITION` provider for floating ui position implementation
|
|
39
|
+
- *subpackage* `@anglr/common/forms`
|
|
40
|
+
- **Form Model Builder**
|
|
41
|
+
- new `FormArrayChild` decorator which defines child type for FormArray
|
|
35
42
|
|
|
36
43
|
## Version 11.1.0 (2022-02-22)
|
|
37
44
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ModelPropertyMetadata } from './modelPropertyMetadata.decorator';
|
|
2
|
+
/**
|
|
3
|
+
* Defines child type for FormArray
|
|
4
|
+
* @param childType - Type of child that should be created inside FormArray
|
|
5
|
+
*/
|
|
6
|
+
export function FormArrayChild(childType) {
|
|
7
|
+
return ModelPropertyMetadata({
|
|
8
|
+
childType: childType
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=formArrayChild.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formArrayChild.decorator.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/formArrayChild.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,qBAAqB,EAAC,MAAM,mCAAmC,CAAC;AAExE;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,SAA+D;IAE1F,OAAO,qBAAqB,CAC5B;QACI,SAAS,EAAE,SAAS;KACvB,CAAC,CAAC;AACP,CAAC","sourcesContent":["import {FormArray, FormControl, FormGroup} from '@angular/forms';\n\nimport {ModelPropertyMetadata} from './modelPropertyMetadata.decorator';\n\n/**\n * Defines child type for FormArray\n * @param childType - Type of child that should be created inside FormArray\n */\nexport function FormArrayChild(childType: typeof FormGroup|typeof FormArray|typeof FormControl): PropertyDecorator\n{\n return ModelPropertyMetadata(\n {\n childType: childType\n });\n}"]}
|
|
@@ -2,6 +2,7 @@ export * from './asyncValidator.decorator';
|
|
|
2
2
|
export * from './controlOptions.decorator';
|
|
3
3
|
export * from './disabled.decorator';
|
|
4
4
|
export * from './email.decorator';
|
|
5
|
+
export * from './formArrayChild.decorator';
|
|
5
6
|
export * from './formArrayProperty.decorator';
|
|
6
7
|
export * from './formGroupAsyncValidator.decorator';
|
|
7
8
|
export * from './formGroupProperty.decorator';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './asyncValidator.decorator';\nexport * from './controlOptions.decorator';\nexport * from './disabled.decorator';\nexport * from './email.decorator';\nexport * from './formArrayProperty.decorator';\nexport * from './formGroupAsyncValidator.decorator';\nexport * from './formGroupProperty.decorator';\nexport * from './formGroupValidator.decorator';\nexport * from './invalidateOnChange.decorator';\nexport * from './maxLength.decorator';\nexport * from './maxValue.decorator';\nexport * from './minLength.decorator';\nexport * from './minValue.decorator';\nexport * from './modelPropertyMetadata.decorator';\nexport * from './number.decorator';\nexport * from './pattern.decorator';\nexport * from './required.decorator';\nexport * from './requiredIf.decorator';\nexport * from './validator.decorator';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './asyncValidator.decorator';\nexport * from './controlOptions.decorator';\nexport * from './disabled.decorator';\nexport * from './email.decorator';\nexport * from './formArrayChild.decorator';\nexport * from './formArrayProperty.decorator';\nexport * from './formGroupAsyncValidator.decorator';\nexport * from './formGroupProperty.decorator';\nexport * from './formGroupValidator.decorator';\nexport * from './invalidateOnChange.decorator';\nexport * from './maxLength.decorator';\nexport * from './maxValue.decorator';\nexport * from './minLength.decorator';\nexport * from './minValue.decorator';\nexport * from './modelPropertyMetadata.decorator';\nexport * from './number.decorator';\nexport * from './pattern.decorator';\nexport * from './required.decorator';\nexport * from './requiredIf.decorator';\nexport * from './validator.decorator';\n"]}
|
|
@@ -20,7 +20,7 @@ export function ModelPropertyMetadata(metadata) {
|
|
|
20
20
|
const originValidators = (_b = (_a = trgt.ɵControlsMetadata[propertyKey]) === null || _a === void 0 ? void 0 : _a.validators) !== null && _b !== void 0 ? _b : [];
|
|
21
21
|
const originAsyncValidators = (_d = (_c = trgt.ɵControlsMetadata[propertyKey]) === null || _c === void 0 ? void 0 : _c.asyncValidators) !== null && _d !== void 0 ? _d : [];
|
|
22
22
|
//merge all other values
|
|
23
|
-
trgt.ɵControlsMetadata[propertyKey] = Object.assign(Object.assign(Object.assign({}, trgt.ɵControlsMetadata[propertyKey]),
|
|
23
|
+
trgt.ɵControlsMetadata[propertyKey] = Object.assign(Object.assign(Object.assign({}, ɵDefaultPropertyMetadata), trgt.ɵControlsMetadata[propertyKey]), metadata);
|
|
24
24
|
//merge validators
|
|
25
25
|
const propertyMetadata = trgt.ɵControlsMetadata[propertyKey];
|
|
26
26
|
propertyMetadata.validators =
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelPropertyMetadata.decorator.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACe,QAA+C;IAE/F,OAAO,UAAS,MAAc,EAAE,WAA0B;;QAEtD,MAAM,IAAI,GAAG,MAAwC,CAAC;QAEtD,IAAG,CAAC,IAAI,CAAC,iBAAiB,EAC1B;YACI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAyB,mBAAmB,CAAC,EAC/E;gBACI,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;SACN;QAED,yBAAyB;QACzB,MAAM,gBAAgB,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,0CAAE,UAAU,mCAAI,EAAE,CAAC;QAC/F,MAAM,qBAAqB,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,0CAAE,eAAe,mCAAI,EAAE,CAAC;QAEzG,wBAAwB;QACxB,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,iDAE5C,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,GACnD,
|
|
1
|
+
{"version":3,"file":"modelPropertyMetadata.decorator.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACe,QAA+C;IAE/F,OAAO,UAAS,MAAc,EAAE,WAA0B;;QAEtD,MAAM,IAAI,GAAG,MAAwC,CAAC;QAEtD,IAAG,CAAC,IAAI,CAAC,iBAAiB,EAC1B;YACI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAyB,mBAAmB,CAAC,EAC/E;gBACI,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;SACN;QAED,yBAAyB;QACzB,MAAM,gBAAgB,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,0CAAE,UAAU,mCAAI,EAAE,CAAC;QAC/F,MAAM,qBAAqB,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,0CAAE,eAAe,mCAAI,EAAE,CAAC;QAEzG,wBAAwB;QACxB,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,iDAE5C,wBAAwB,GACxB,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,GACnD,QAAQ,CACd,CAAC;QAEF,kBAAkB;QAClB,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,CAAC;QAE7E,gBAAgB,CAAC,UAAU;YAC3B;gBACI,GAAG,gBAAgB;gBACnB,GAAG,gBAAgB,CAAC,UAAU;aACjC,CAAC;QAEF,gBAAgB,CAAC,eAAe;YAChC;gBACI,GAAG,qBAAqB;gBACxB,GAAG,gBAAgB,CAAC,eAAe;aACtC,CAAC;IACN,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {Dictionary, nameof} from '@jscrpt/common';\n\nimport {ModelDecoratorMetadata} from '../interfaces/modelDecoratorMetadata';\nimport {ModelPropertyDecoratorMetadata} from '../interfaces/modelPropertyDecoratorMetadata';\nimport {ɵDefaultPropertyMetadata} from '../misc/defaults';\n\n/**\n * Defines metadata for model property\n * @param metadata - Metadata for model property, used for creating form\n */\nexport function ModelPropertyMetadata<TArgs extends Dictionary<any> = any,\n TModel = any>(metadata: ModelPropertyDecoratorMetadata<TArgs>): PropertyDecorator\n{\n return function(target: Object, propertyKey: string|symbol): void\n {\n const trgt = target as ModelDecoratorMetadata<TModel>;\n\n if(!trgt.ɵControlsMetadata)\n {\n Object.defineProperty(trgt, nameof<ModelDecoratorMetadata>('ɵControlsMetadata'),\n {\n value: {},\n writable: false,\n enumerable: false,\n configurable: false\n });\n }\n\n //keep current validators\n const originValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.validators ?? [];\n const originAsyncValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.asyncValidators ?? [];\n\n //merge all other values\n trgt.ɵControlsMetadata[propertyKey as keyof TModel] = \n {\n ...ɵDefaultPropertyMetadata,\n ...trgt.ɵControlsMetadata[propertyKey as keyof TModel],\n ...metadata\n };\n\n //merge validators\n const propertyMetadata = trgt.ɵControlsMetadata[propertyKey as keyof TModel];\n\n propertyMetadata.validators =\n [\n ...originValidators,\n ...propertyMetadata.validators,\n ];\n\n propertyMetadata.asyncValidators =\n [\n ...originAsyncValidators,\n ...propertyMetadata.asyncValidators,\n ];\n };\n}"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ModelPropertyMetadata } from './modelPropertyMetadata.decorator';
|
|
2
|
+
/**
|
|
3
|
+
* Defines child type for FormArray
|
|
4
|
+
* @param childType - Type of child that should be created inside FormArray
|
|
5
|
+
*/
|
|
6
|
+
export function FormArrayChild(childType) {
|
|
7
|
+
return ModelPropertyMetadata({
|
|
8
|
+
childType: childType
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=formArrayChild.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formArrayChild.decorator.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/formArrayChild.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,qBAAqB,EAAC,MAAM,mCAAmC,CAAC;AAExE;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,SAA+D;IAE1F,OAAO,qBAAqB,CAC5B;QACI,SAAS,EAAE,SAAS;KACvB,CAAC,CAAC;AACP,CAAC","sourcesContent":["import {FormArray, FormControl, FormGroup} from '@angular/forms';\n\nimport {ModelPropertyMetadata} from './modelPropertyMetadata.decorator';\n\n/**\n * Defines child type for FormArray\n * @param childType - Type of child that should be created inside FormArray\n */\nexport function FormArrayChild(childType: typeof FormGroup|typeof FormArray|typeof FormControl): PropertyDecorator\n{\n return ModelPropertyMetadata(\n {\n childType: childType\n });\n}"]}
|
|
@@ -2,6 +2,7 @@ export * from './asyncValidator.decorator';
|
|
|
2
2
|
export * from './controlOptions.decorator';
|
|
3
3
|
export * from './disabled.decorator';
|
|
4
4
|
export * from './email.decorator';
|
|
5
|
+
export * from './formArrayChild.decorator';
|
|
5
6
|
export * from './formArrayProperty.decorator';
|
|
6
7
|
export * from './formGroupAsyncValidator.decorator';
|
|
7
8
|
export * from './formGroupProperty.decorator';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './asyncValidator.decorator';\nexport * from './controlOptions.decorator';\nexport * from './disabled.decorator';\nexport * from './email.decorator';\nexport * from './formArrayProperty.decorator';\nexport * from './formGroupAsyncValidator.decorator';\nexport * from './formGroupProperty.decorator';\nexport * from './formGroupValidator.decorator';\nexport * from './invalidateOnChange.decorator';\nexport * from './maxLength.decorator';\nexport * from './maxValue.decorator';\nexport * from './minLength.decorator';\nexport * from './minValue.decorator';\nexport * from './modelPropertyMetadata.decorator';\nexport * from './number.decorator';\nexport * from './pattern.decorator';\nexport * from './required.decorator';\nexport * from './requiredIf.decorator';\nexport * from './validator.decorator';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './asyncValidator.decorator';\nexport * from './controlOptions.decorator';\nexport * from './disabled.decorator';\nexport * from './email.decorator';\nexport * from './formArrayChild.decorator';\nexport * from './formArrayProperty.decorator';\nexport * from './formGroupAsyncValidator.decorator';\nexport * from './formGroupProperty.decorator';\nexport * from './formGroupValidator.decorator';\nexport * from './invalidateOnChange.decorator';\nexport * from './maxLength.decorator';\nexport * from './maxValue.decorator';\nexport * from './minLength.decorator';\nexport * from './minValue.decorator';\nexport * from './modelPropertyMetadata.decorator';\nexport * from './number.decorator';\nexport * from './pattern.decorator';\nexport * from './required.decorator';\nexport * from './requiredIf.decorator';\nexport * from './validator.decorator';\n"]}
|
|
@@ -21,8 +21,8 @@ export function ModelPropertyMetadata(metadata) {
|
|
|
21
21
|
//merge all other values
|
|
22
22
|
trgt.ɵControlsMetadata[propertyKey] =
|
|
23
23
|
{
|
|
24
|
-
...trgt.ɵControlsMetadata[propertyKey],
|
|
25
24
|
...ɵDefaultPropertyMetadata,
|
|
25
|
+
...trgt.ɵControlsMetadata[propertyKey],
|
|
26
26
|
...metadata
|
|
27
27
|
};
|
|
28
28
|
//merge validators
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelPropertyMetadata.decorator.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACe,QAA+C;IAE/F,OAAO,UAAS,MAAc,EAAE,WAA0B;QAEtD,MAAM,IAAI,GAAG,MAAwC,CAAC;QAEtD,IAAG,CAAC,IAAI,CAAC,iBAAiB,EAC1B;YACI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAyB,mBAAmB,CAAC,EAC/E;gBACI,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;SACN;QAED,yBAAyB;QACzB,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,EAAE,UAAU,IAAI,EAAE,CAAC;QAC/F,MAAM,qBAAqB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,EAAE,eAAe,IAAI,EAAE,CAAC;QAEzG,wBAAwB;QACxB,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC;YACnD;gBACI,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC;gBACtD,GAAG,
|
|
1
|
+
{"version":3,"file":"modelPropertyMetadata.decorator.js","sourceRoot":"","sources":["../../../../../../forms/src/misc/formModel/decorators/modelPropertyMetadata.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACe,QAA+C;IAE/F,OAAO,UAAS,MAAc,EAAE,WAA0B;QAEtD,MAAM,IAAI,GAAG,MAAwC,CAAC;QAEtD,IAAG,CAAC,IAAI,CAAC,iBAAiB,EAC1B;YACI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAyB,mBAAmB,CAAC,EAC/E;gBACI,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;SACN;QAED,yBAAyB;QACzB,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,EAAE,UAAU,IAAI,EAAE,CAAC;QAC/F,MAAM,qBAAqB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,EAAE,eAAe,IAAI,EAAE,CAAC;QAEzG,wBAAwB;QACxB,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC;YACnD;gBACI,GAAG,wBAAwB;gBAC3B,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC;gBACtD,GAAG,QAAQ;aACd,CAAC;QAEF,kBAAkB;QAClB,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAA2B,CAAC,CAAC;QAE7E,gBAAgB,CAAC,UAAU;YAC3B;gBACI,GAAG,gBAAgB;gBACnB,GAAG,gBAAgB,CAAC,UAAU;aACjC,CAAC;QAEF,gBAAgB,CAAC,eAAe;YAChC;gBACI,GAAG,qBAAqB;gBACxB,GAAG,gBAAgB,CAAC,eAAe;aACtC,CAAC;IACN,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {Dictionary, nameof} from '@jscrpt/common';\n\nimport {ModelDecoratorMetadata} from '../interfaces/modelDecoratorMetadata';\nimport {ModelPropertyDecoratorMetadata} from '../interfaces/modelPropertyDecoratorMetadata';\nimport {ɵDefaultPropertyMetadata} from '../misc/defaults';\n\n/**\n * Defines metadata for model property\n * @param metadata - Metadata for model property, used for creating form\n */\nexport function ModelPropertyMetadata<TArgs extends Dictionary<any> = any,\n TModel = any>(metadata: ModelPropertyDecoratorMetadata<TArgs>): PropertyDecorator\n{\n return function(target: Object, propertyKey: string|symbol): void\n {\n const trgt = target as ModelDecoratorMetadata<TModel>;\n\n if(!trgt.ɵControlsMetadata)\n {\n Object.defineProperty(trgt, nameof<ModelDecoratorMetadata>('ɵControlsMetadata'),\n {\n value: {},\n writable: false,\n enumerable: false,\n configurable: false\n });\n }\n\n //keep current validators\n const originValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.validators ?? [];\n const originAsyncValidators = trgt.ɵControlsMetadata[propertyKey as keyof TModel]?.asyncValidators ?? [];\n\n //merge all other values\n trgt.ɵControlsMetadata[propertyKey as keyof TModel] = \n {\n ...ɵDefaultPropertyMetadata,\n ...trgt.ɵControlsMetadata[propertyKey as keyof TModel],\n ...metadata\n };\n\n //merge validators\n const propertyMetadata = trgt.ɵControlsMetadata[propertyKey as keyof TModel];\n\n propertyMetadata.validators =\n [\n ...originValidators,\n ...propertyMetadata.validators,\n ];\n\n propertyMetadata.asyncValidators =\n [\n ...originAsyncValidators,\n ...propertyMetadata.asyncValidators,\n ];\n };\n}"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
|
2
|
+
/**
|
|
3
|
+
* Defines child type for FormArray
|
|
4
|
+
* @param childType - Type of child that should be created inside FormArray
|
|
5
|
+
*/
|
|
6
|
+
export declare function FormArrayChild(childType: typeof FormGroup | typeof FormArray | typeof FormControl): PropertyDecorator;
|
|
7
|
+
//# sourceMappingURL=formArrayChild.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formArrayChild.decorator.d.ts","sourceRoot":"","sources":["formArrayChild.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAIjE;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,OAAO,SAAS,GAAC,OAAO,SAAS,GAAC,OAAO,WAAW,GAAG,iBAAiB,CAMjH"}
|
|
@@ -2,6 +2,7 @@ export * from './asyncValidator.decorator';
|
|
|
2
2
|
export * from './controlOptions.decorator';
|
|
3
3
|
export * from './disabled.decorator';
|
|
4
4
|
export * from './email.decorator';
|
|
5
|
+
export * from './formArrayChild.decorator';
|
|
5
6
|
export * from './formArrayProperty.decorator';
|
|
6
7
|
export * from './formGroupAsyncValidator.decorator';
|
|
7
8
|
export * from './formGroupProperty.decorator';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
|
package/package.json
CHANGED
package/version.bak
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
11.2.0
|
|
1
|
+
11.2.0
|