@mediusinc/mng-commons 2.0.0-rc.7 → 2.0.0-rc.9

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.
@@ -46,7 +46,7 @@ export declare class EditorDescriptor<T> {
46
46
  static fromModelWithAttributes<T>(modelType: ClassType<T>, attributes: TableviewAttributeDef[], idProperty?: string, titleProperty?: string, tableEditorType?: TableviewEditorTypeEnum): EditorDescriptor<T>;
47
47
  get model(): ModelDescriptor<T>;
48
48
  get tabs(): FieldTabGroupDescriptor<T>[];
49
- get fields(): AFieldDescriptor<any, T>[];
49
+ get fields(): AFieldDescriptor<any, T, any>[];
50
50
  get tableviewEditorType(): TableviewEditorTypeEnum;
51
51
  get disabled(): boolean;
52
52
  get isLocalized(): boolean;
@@ -56,7 +56,7 @@ export declare class EditorDescriptor<T> {
56
56
  get localeLookup(): ((queryParam?: MediusQueryParam | undefined, service?: any, search?: string | undefined) => Observable<string[]>) | undefined;
57
57
  createTabGroup(name: string, title?: string): FieldTabGroupDescriptor<T>;
58
58
  createFieldGroup(name: string, title?: string | null): FieldGroupDescriptor<T>;
59
- addFieldDescriptor<FT>(field: AFieldDescriptor<FT, T>): this;
59
+ addFieldDescriptor<FT, FVT = FT>(field: AFieldDescriptor<FT, T, FVT>): this;
60
60
  addField(property: string): FieldInputDescriptor<T>;
61
61
  /**
62
62
  * removes filed if exists in descriptor
@@ -24,7 +24,7 @@ export declare abstract class AGenericFieldDescriptor<ET> {
24
24
  get config(): FieldConfig;
25
25
  withConfig(config: FieldConfig): this;
26
26
  }
27
- export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescriptor<ET> {
27
+ export declare abstract class AFieldDescriptor<T, ET, VT = T> extends AGenericFieldDescriptor<ET> {
28
28
  protected readonly _property: string;
29
29
  protected _label?: string | null;
30
30
  protected _placeholder?: string;
@@ -32,9 +32,9 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
32
32
  protected _required: boolean;
33
33
  protected _requiredHideLabelMarker: boolean;
34
34
  protected _disabled: boolean;
35
- protected _defaultValue?: T;
36
- protected _getter?: (item: ET) => T;
37
- protected _setter?: (item: ET, value: T) => void;
35
+ protected _defaultValue?: VT;
36
+ protected _getter?: (item: ET) => VT;
37
+ protected _setter?: (item: ET, value: VT) => void;
38
38
  protected _validations: Array<FieldValidationDescriptor>;
39
39
  protected _asyncValidations: Array<FieldValidationDescriptor>;
40
40
  protected _requiredExpression?: string | ((field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
@@ -56,9 +56,9 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
56
56
  get required(): boolean;
57
57
  get requiredHideLabelMarker(): boolean;
58
58
  get disabled(): boolean;
59
- get defaultValue(): T | undefined;
60
- get getter(): ((item: ET) => T) | undefined;
61
- get setter(): ((item: ET, value: T) => void) | undefined;
59
+ get defaultValue(): VT | undefined;
60
+ get getter(): ((item: ET) => VT) | undefined;
61
+ get setter(): ((item: ET, value: VT) => void) | undefined;
62
62
  get validations(): FieldValidationDescriptor[];
63
63
  get asyncValidations(): FieldValidationDescriptor[];
64
64
  get requiredExpression(): string | ((field?: FormlyFieldConfig<import("@ngx-formly/core").FormlyFieldProps & {
@@ -79,16 +79,16 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
79
79
  get isSizeSmall(): boolean;
80
80
  get isSizeLarge(): boolean;
81
81
  get isLocalized(): boolean;
82
- abstract copy(): AFieldDescriptor<T, ET>;
82
+ abstract copy(): AFieldDescriptor<T, ET, VT>;
83
83
  withLabel(label: string | null): this;
84
84
  withPlaceholder(placeholder: string): this;
85
85
  withHelpText(helpText: string): this;
86
86
  withRequired(required?: boolean, requiredExpression?: string | ((field?: FormlyFieldConfig) => boolean) | Observable<boolean>, hideLabelMarker?: boolean): this;
87
87
  withDisabled(disabled?: boolean, disabledExpression?: string | ((field?: FormlyFieldConfig) => boolean) | Observable<boolean>): this;
88
88
  withHidden(hiddenExpression: string | ((field?: FormlyFieldConfig) => boolean) | Observable<boolean>): this;
89
- withDefaultValue(defaultValue: T): this;
90
- withGetter(getter: (item: ET) => T): this;
91
- withSetter(setter: (item: ET, value: T) => void): this;
89
+ withDefaultValue(defaultValue: VT): this;
90
+ withGetter(getter: (item: ET) => VT): this;
91
+ withSetter(setter: (item: ET, value: VT) => void): this;
92
92
  withValidation(name: string, validator?: MngFieldValidator, message?: MngFieldValidationMessage): this;
93
93
  withAsyncValidation(name: string, asyncValidator?: MngFieldAsyncValidator, message?: MngFieldValidationMessage): this;
94
94
  withClassName(className: string, labelClassName?: string, inputClassName?: string, fieldClassName?: string): this;
@@ -101,7 +101,7 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
101
101
  localized(tableview?: TableviewDescriptor<T>): this;
102
102
  nextEvent(type: MngFormFieldEventTypeEnum, cmpType: Type<any>, cmpInstance: any, data?: MngFormFieldEventData<T, ET>): void;
103
103
  get events$(): Observable<MngFormFieldEvent<T, ET>>;
104
- protected copyFieldsTo(obj: AFieldDescriptor<T, ET>): void;
104
+ protected copyFieldsTo(obj: AFieldDescriptor<T, ET, VT>): void;
105
105
  }
106
106
  export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string | string[] | number | boolean | Date | File | File[], ET> {
107
107
  private _fieldType;
@@ -267,7 +267,7 @@ export declare class FieldLookupEnumDescriptor<ET> extends FieldLookupDescriptor
267
267
  asAutocomplete(openOnFocus?: boolean): this;
268
268
  copy(): FieldLookupEnumDescriptor<ET>;
269
269
  }
270
- export declare class FieldManyToManyEditorDescriptor<T, ET> extends AFieldDescriptor<T, ET> {
270
+ export declare class FieldManyToManyEditorDescriptor<T, ET> extends AFieldDescriptor<T, ET, T[]> {
271
271
  private readonly _mainTableDescriptor;
272
272
  private readonly _lookupTableDescriptor;
273
273
  private _fieldType;
@@ -291,7 +291,7 @@ export declare class FieldManyToManyEditorDescriptor<T, ET> extends AFieldDescri
291
291
  withLookupExclude(filterProperty: string, valueProperty: string, hasLookupExclude?: boolean): this;
292
292
  copy(): FieldManyToManyEditorDescriptor<T, ET>;
293
293
  }
294
- export declare class FieldManyEditorDescriptor<T, ET> extends AFieldDescriptor<T, ET> {
294
+ export declare class FieldManyEditorDescriptor<T, ET> extends AFieldDescriptor<T, ET, T[]> {
295
295
  private readonly _tableviewDescriptor;
296
296
  private _fieldType;
297
297
  private _fieldActions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "2.0.0-rc.7",
3
+ "version": "2.0.0-rc.9",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^15.2.6",
6
6
  "@angular/core": "^15.2.6",