@mediusinc/mng-commons 5.0.1-rc.0 → 5.1.0-rc.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.
Files changed (61) hide show
  1. package/core/descriptors/model.descriptor.d.ts +1 -1
  2. package/core/error/error-helpers.d.ts +18 -1
  3. package/core/i18n/i18n-type.d.ts +0 -9
  4. package/core/services/commons-configuration.service.d.ts +12 -0
  5. package/esm2022/core/descriptors/model.descriptor.mjs +1 -1
  6. package/esm2022/core/error/error-helpers.mjs +20 -1
  7. package/esm2022/core/i18n/i18n-type.mjs +1 -34
  8. package/esm2022/core/services/commons-configuration.service.mjs +16 -1
  9. package/esm2022/model/descriptors/model.descriptor.mjs +1 -1
  10. package/esm2022/model/helpers/i18n.mjs +7 -10
  11. package/esm2022/table/api/descriptors/table.descriptor.mjs +2 -2
  12. package/esm2022/tableview/api/editor/models/field-action-context.model.mjs +1 -1
  13. package/esm2022/tableview/api/editor/models/form-editor.interface.mjs +1 -1
  14. package/esm2022/tableview/api/editor/models/formly-field.model.mjs +1 -1
  15. package/esm2022/tableview/api/editor/models/formly-options.model.mjs +2 -0
  16. package/esm2022/tableview/api/index.mjs +2 -1
  17. package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +9 -4
  18. package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +4 -5
  19. package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +8 -10
  20. package/esm2022/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.mjs +4 -4
  21. package/esm2022/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.mjs +5 -5
  22. package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +8 -9
  23. package/esm2022/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +5 -5
  24. package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +5 -4
  25. package/esm2022/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.mjs +4 -5
  26. package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +5 -5
  27. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +7 -8
  28. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +4 -5
  29. package/esm2022/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +4 -3
  30. package/esm2022/tableview/editor/components/formly/fields/formly-field-type.abstract.component.mjs +23 -0
  31. package/fesm2022/mediusinc-mng-commons-core.mjs +96 -95
  32. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
  33. package/fesm2022/mediusinc-mng-commons-model.mjs +7 -10
  34. package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
  35. package/fesm2022/mediusinc-mng-commons-table-api.mjs +1 -1
  36. package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
  37. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  38. package/fesm2022/mediusinc-mng-commons-tableview.mjs +59 -46
  39. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
  40. package/model/descriptors/model.descriptor.d.ts +3 -3
  41. package/model/helpers/i18n.d.ts +1 -3
  42. package/package.json +1 -1
  43. package/tableview/api/editor/models/field-action-context.model.d.ts +3 -3
  44. package/tableview/api/editor/models/form-editor.interface.d.ts +1 -8
  45. package/tableview/api/editor/models/formly-options.model.d.ts +15 -0
  46. package/tableview/api/index.d.ts +1 -0
  47. package/tableview/editor/components/editor/form-editor.component.d.ts +3 -11
  48. package/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.d.ts +3 -4
  49. package/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +3 -7
  50. package/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.d.ts +3 -4
  51. package/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.d.ts +3 -4
  52. package/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +3 -6
  53. package/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +3 -4
  54. package/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.d.ts +3 -4
  55. package/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.d.ts +5 -6
  56. package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +3 -4
  57. package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +3 -4
  58. package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +3 -4
  59. package/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +2 -3
  60. package/tableview/editor/components/formly/fields/formly-field-type.abstract.component.d.ts +12 -0
  61. package/version-info.json +6 -6
@@ -6,7 +6,7 @@ export declare class ModelDescriptor<Model, ModelClass = ClassOptType<Model>> im
6
6
  private _i18nBaseKey;
7
7
  private _idProperty?;
8
8
  private _titleProperty?;
9
- constructor(type: ModelClass, idProperty?: string, titleProperty?: string, i18nBaseKey?: string | ClassType<any>);
9
+ constructor(type: ModelClass, idProperty?: string, titleProperty?: string | ((item: Model) => string), i18nBaseKey?: string | ClassType<any>);
10
10
  /**
11
11
  * @deprecated Use standalone {model()} instead.
12
12
  */
@@ -19,7 +19,7 @@ export declare class ModelDescriptor<Model, ModelClass = ClassOptType<Model>> im
19
19
  get typeName(): string | undefined;
20
20
  get i18nBaseKey(): string;
21
21
  get idProperty(): string | undefined;
22
- get titleProperty(): string | undefined;
22
+ get titleProperty(): string | ((item: Model) => string) | undefined;
23
23
  withIdProperty(property: keyof Model): this;
24
24
  withIdPropertyUnsafe(property: string): this;
25
25
  withTitleProperty(property: keyof Model): this;
@@ -29,7 +29,7 @@ export declare class ModelDescriptor<Model, ModelClass = ClassOptType<Model>> im
29
29
  }
30
30
  export type ModelDescriptorCreateOpts<Model> = {
31
31
  id?: keyof Model;
32
- title?: keyof Model;
32
+ title?: keyof Model | ((item: Model) => string);
33
33
  i18nBase?: string | ClassType<any>;
34
34
  };
35
35
  export declare function model<Model>(): ModelDescriptor<Model, undefined>;
@@ -3,8 +3,6 @@ import { Observable } from 'rxjs';
3
3
  import { KeyOfType } from '@mediusinc/mng-commons/core';
4
4
  import { ModelDescriptor } from '../descriptors/model.descriptor';
5
5
  export declare function getI18nForModel(translate: TranslateService, model: ModelDescriptor<any>, keyPath: string, customKey?: string, item?: any, fallbackKey?: string, params?: any): string | null;
6
- export declare function getI18nModelName(translate: TranslateService, model: ModelDescriptor<any>, singular?: boolean): string | null;
7
- export declare function getI18nModelNameAsync(translate: TranslateService, model: ModelDescriptor<any>, singular?: boolean): Observable<string | null>;
8
6
  export declare function getI18nModelParams(translate: TranslateService, model?: ModelDescriptor<any>, item?: any, params?: any): any;
9
7
  export declare function getI18nModelParamsAsync(translate: TranslateService, model?: ModelDescriptor<any>, item?: any, params?: any): Observable<any>;
10
- export declare function populateI18nModelParams(idProperty?: KeyOfType, titleProperty?: KeyOfType, item?: any, params?: any): any;
8
+ export declare function populateI18nModelParams(idProperty?: KeyOfType, titleProperty?: KeyOfType | ((item: any) => string), item?: any, params?: any): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "5.0.1-rc.0",
3
+ "version": "5.1.0-rc.0",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^17.3.0",
6
6
  "@angular/common": "^17.3.0",
@@ -1,8 +1,8 @@
1
1
  import { AbstractControl, FormControl, FormGroup } from '@angular/forms';
2
- import { FormlyFormOptions } from '@ngx-formly/core';
3
2
  import { FieldActionDescriptor } from '../descriptors/field-action.descriptor';
4
3
  import { IFormEditorComponent } from './form-editor.interface';
5
4
  import { CommonsFormlyFieldProps } from './formly-field.model';
5
+ import { CommonsFormlyFormOptions, CommonsFormlyFormState } from './formly-options.model';
6
6
  export interface FieldActionContext<EditorModel, ParentEditorModel = undefined> {
7
7
  descriptor: FieldActionDescriptor<EditorModel>;
8
8
  formEditorComponent: IFormEditorComponent<EditorModel, ParentEditorModel>;
@@ -12,9 +12,9 @@ export interface FieldActionContext<EditorModel, ParentEditorModel = undefined>
12
12
  form: FormGroup<{
13
13
  [K in keyof EditorModel]: AbstractControl<EditorModel[K]>;
14
14
  }>;
15
- options: FormlyFormOptions;
15
+ options: CommonsFormlyFormOptions<EditorModel>;
16
16
  props: CommonsFormlyFieldProps<void, EditorModel, ParentEditorModel>;
17
- formState: any;
17
+ formState: CommonsFormlyFormState<EditorModel>;
18
18
  };
19
19
  }
20
20
  export interface FieldActionResult {
@@ -3,14 +3,7 @@ import { AbstractControl, FormGroup, UntypedFormGroup } from '@angular/forms';
3
3
  import { FormlyFieldConfig, FormlyFormOptions } from '@ngx-formly/core';
4
4
  import { Message } from 'primeng/api';
5
5
  import { EditorDescriptorInst } from '../descriptors/editor.descriptor';
6
- export interface CommonsFormlyFormOptions<Item> {
7
- formState?: {
8
- descriptor?: EditorDescriptorInst<Item>;
9
- add: boolean;
10
- edit: boolean;
11
- disabled: boolean;
12
- };
13
- }
6
+ import { CommonsFormlyFormOptions } from './formly-options.model';
14
7
  export type FormEditorResetFormModelOpts = {
15
8
  markAsPristine?: boolean;
16
9
  };
@@ -0,0 +1,15 @@
1
+ import { FormlyFormOptions } from '@ngx-formly/core';
2
+ import { Observable } from 'rxjs';
3
+ import { EditorDescriptorInst } from '../descriptors/editor.descriptor';
4
+ export type CommonsFormlyFormOptions<Item> = FormlyFormOptions & {
5
+ formState?: CommonsFormlyFormState<Item>;
6
+ };
7
+ export type CommonsFormlyFormState<Item> = {
8
+ descriptor?: EditorDescriptorInst<Item>;
9
+ add: boolean;
10
+ edit: boolean;
11
+ disabled: boolean;
12
+ disabled$: Observable<boolean>;
13
+ submittedOn?: number;
14
+ [key: string]: any;
15
+ };
@@ -44,6 +44,7 @@ export * from './editor/models/form-editor.event';
44
44
  export * from './editor/models/form-editor.interface';
45
45
  export * from './editor/models/formly-custom-field.model';
46
46
  export * from './editor/models/formly-field.model';
47
+ export * from './editor/models/formly-options.model';
47
48
  export * from './editor/models/radio.model';
48
49
  export * from './tableview/data-providers/tableview.data-provider';
49
50
  export * from './tableview/data-providers/tableview-data-provider.factory';
@@ -1,17 +1,9 @@
1
1
  import { ElementRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { AbstractControl, FormGroup, UntypedFormGroup } from '@angular/forms';
3
- import { FormlyFieldConfig, FormlyFormOptions } from '@ngx-formly/core';
3
+ import { FormlyFieldConfig } from '@ngx-formly/core';
4
4
  import { Message } from 'primeng/api';
5
- import { EditorDescriptorInst, FormEditorResetFormModelOpts, FormEditorSubmitEvent, IFormEditorComponent } from '@mediusinc/mng-commons/tableview/api';
5
+ import { CommonsFormlyFormOptions, EditorDescriptorInst, FormEditorResetFormModelOpts, FormEditorSubmitEvent, IFormEditorComponent } from '@mediusinc/mng-commons/tableview/api';
6
6
  import * as i0 from "@angular/core";
7
- type CommonsFormlyFormOptions<Item> = FormlyFormOptions & {
8
- formState?: {
9
- descriptor?: EditorDescriptorInst<Item>;
10
- add: boolean;
11
- edit: boolean;
12
- disabled: boolean;
13
- };
14
- };
15
7
  export declare class FormEditorComponent<Item = any, ParentItem = any> implements IFormEditorComponent<Item, ParentItem>, OnInit, OnDestroy {
16
8
  private readonly formlyConfig;
17
9
  private readonly translateService;
@@ -26,6 +18,7 @@ export declare class FormEditorComponent<Item = any, ParentItem = any> implement
26
18
  formSubmit: import("@angular/core").OutputEmitterRef<FormEditorSubmitEvent<Item>>;
27
19
  submitButtonElementRef: import("@angular/core").Signal<ElementRef<any> | undefined>;
28
20
  private readonly _form;
21
+ private readonly _formlyStateDisabledSubject;
29
22
  private readonly _formlyOptions;
30
23
  private _formlyFields;
31
24
  private _formlyInitialItem;
@@ -65,4 +58,3 @@ export declare class FormEditorComponent<Item = any, ParentItem = any> implement
65
58
  static ɵfac: i0.ɵɵFactoryDeclaration<FormEditorComponent<any, any>, never>;
66
59
  static ɵcmp: i0.ɵɵComponentDeclaration<FormEditorComponent<any, any>, "mng-form-editor", never, { "descriptor": { "alias": "descriptor"; "required": true; "isSignal": true; }; "submitLoading": { "alias": "submitLoading"; "required": false; "isSignal": true; }; "item": { "alias": "item"; "required": false; "isSignal": true; }; "isFormDisabled": { "alias": "isFormDisabled"; "required": false; "isSignal": true; }; }, { "formSubmit": "formSubmit"; }, never, never, true, never>;
67
60
  }
68
- export {};
@@ -1,9 +1,8 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
- import { FieldType } from '@ngx-formly/core';
3
- import { CommonsFormlyFieldConfig, FieldActionDescriptor, FieldActionResultMessage } from '@mediusinc/mng-commons/tableview/api';
2
+ import { FieldActionDescriptor, FieldActionResultMessage } from '@mediusinc/mng-commons/tableview/api';
3
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
4
4
  import * as i0 from "@angular/core";
5
- export declare class FormlyFieldActionComponent<EditorModel> extends FieldType<CommonsFormlyFieldConfig> implements OnInit, OnDestroy {
6
- descriptor: FieldActionDescriptor<EditorModel>;
5
+ export declare class FormlyFieldActionComponent<EditorModel> extends ACommonsFormlyFieldType<EditorModel, EditorModel, FieldActionDescriptor<EditorModel>> implements OnInit, OnDestroy {
7
6
  buttonClass: string;
8
7
  actionMessage?: FieldActionResultMessage;
9
8
  private resultSubscription?;
@@ -1,13 +1,9 @@
1
1
  import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
2
- import { FormControl } from '@angular/forms';
3
- import { FieldType } from '@ngx-formly/core';
4
- import { CommonsFormlyFieldConfig, FieldLookupDescriptor } from '@mediusinc/mng-commons/tableview/api';
2
+ import { FieldLookupDescriptor } from '@mediusinc/mng-commons/tableview/api';
3
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
5
4
  import * as i0 from "@angular/core";
6
- export declare class FormlyFieldAutocompleteComponent<T, ET> extends FieldType<CommonsFormlyFieldConfig> implements OnInit, AfterViewInit, OnDestroy {
5
+ export declare class FormlyFieldAutocompleteComponent<T, ET> extends ACommonsFormlyFieldType<T, ET, FieldLookupDescriptor<T, ET>> implements OnInit, AfterViewInit, OnDestroy {
7
6
  private readonly destroyRef;
8
- aFormControl: FormControl;
9
- descriptor: FieldLookupDescriptor<T, ET>;
10
- private subscriptions;
11
7
  ngOnInit(): void;
12
8
  ngAfterViewInit(): void;
13
9
  ngOnDestroy(): void;
@@ -1,9 +1,8 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { FieldType } from '@ngx-formly/core';
3
- import { CommonsFormlyFieldConfig, FieldInputDescriptor } from '@mediusinc/mng-commons/tableview/api';
2
+ import { FieldInputDescriptor } from '@mediusinc/mng-commons/tableview/api';
3
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
4
4
  import * as i0 from "@angular/core";
5
- export declare class FormlyFieldCustomComponent<ET> extends FieldType<CommonsFormlyFieldConfig> implements OnInit {
6
- descriptor: FieldInputDescriptor<ET>;
5
+ export declare class FormlyFieldCustomComponent<ET> extends ACommonsFormlyFieldType<any, ET, FieldInputDescriptor<ET>> implements OnInit {
7
6
  inputs: Record<string, any>;
8
7
  ngOnInit(): void;
9
8
  static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFieldCustomComponent<any>, never>;
@@ -1,11 +1,10 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { FormControl } from '@angular/forms';
3
- import { FieldType } from '@ngx-formly/core';
4
- import { CommonsFormlyFieldConfig, FieldInputDescriptor } from '@mediusinc/mng-commons/tableview/api';
3
+ import { FieldInputDescriptor } from '@mediusinc/mng-commons/tableview/api';
4
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
5
5
  import * as i0 from "@angular/core";
6
- export declare class FormlyFieldDatepickerComponent<ET> extends FieldType<CommonsFormlyFieldConfig> implements OnInit, OnDestroy {
6
+ export declare class FormlyFieldDatepickerComponent<ET> extends ACommonsFormlyFieldType<any, ET, FieldInputDescriptor<ET>> implements OnInit, OnDestroy {
7
7
  dpFormControl: FormControl<any>;
8
- descriptor: FieldInputDescriptor<ET>;
9
8
  styleClass: import("@angular/core").WritableSignal<string>;
10
9
  private readonly moduleConfig;
11
10
  private destroyRef;
@@ -1,12 +1,9 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
- import { FormControl } from '@angular/forms';
3
- import { FieldType } from '@ngx-formly/core';
4
- import { CommonsFormlyFieldConfig, FieldLookupDescriptor } from '@mediusinc/mng-commons/tableview/api';
2
+ import { FieldLookupDescriptor } from '@mediusinc/mng-commons/tableview/api';
3
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
5
4
  import * as i0 from "@angular/core";
6
- export declare class FormlyFieldDropdownComponent<T, ET> extends FieldType<CommonsFormlyFieldConfig> implements OnInit, OnDestroy {
5
+ export declare class FormlyFieldDropdownComponent<T, ET> extends ACommonsFormlyFieldType<T, ET, FieldLookupDescriptor<T, ET>> implements OnInit, OnDestroy {
7
6
  private readonly destroyRef;
8
- dFormControl: FormControl;
9
- descriptor: FieldLookupDescriptor<T, ET>;
10
7
  ngOnInit(): void;
11
8
  ngOnDestroy(): void;
12
9
  static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFieldDropdownComponent<any, any>, never>;
@@ -1,11 +1,10 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { FieldType } from '@ngx-formly/core';
3
- import { CommonsFormlyFieldConfig, FieldGroupDescriptor, FieldGroupTypeEnum } from '@mediusinc/mng-commons/tableview/api';
2
+ import { FieldGroupDescriptor, FieldGroupTypeEnum } from '@mediusinc/mng-commons/tableview/api';
3
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
4
4
  import * as i0 from "@angular/core";
5
- export declare class FormlyFieldFieldsetComponent<ET> extends FieldType<CommonsFormlyFieldConfig> implements OnInit {
5
+ export declare class FormlyFieldFieldsetComponent<ET> extends ACommonsFormlyFieldType<ET, ET, FieldGroupDescriptor<ET>> implements OnInit {
6
6
  readonly typeFieldset = FieldGroupTypeEnum.Fieldset;
7
7
  readonly typeLogical = FieldGroupTypeEnum.Logical;
8
- descriptor?: FieldGroupDescriptor<ET>;
9
8
  ngOnInit(): void;
10
9
  static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFieldFieldsetComponent<any>, never>;
11
10
  static ɵcmp: i0.ɵɵComponentDeclaration<FormlyFieldFieldsetComponent<any>, "mng-formly-field-fieldset", never, {}, {}, never, never, true, never>;
@@ -1,10 +1,10 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { FormArray, FormControl } from '@angular/forms';
3
- import { FieldType } from '@ngx-formly/core';
4
- import { CommonsFormlyFieldConfig, FieldInputDescriptor, FieldInputTypeEnum } from '@mediusinc/mng-commons/tableview/api';
3
+ import { FieldInputDescriptor, FieldInputTypeEnum } from '@mediusinc/mng-commons/tableview/api';
5
4
  import { FormEditorComponent } from '../../../editor/form-editor.component';
5
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
6
6
  import * as i0 from "@angular/core";
7
- export declare class FormlyFieldInputComponent<ET> extends FieldType<CommonsFormlyFieldConfig> implements OnInit, OnDestroy {
7
+ export declare class FormlyFieldInputComponent<ET> extends ACommonsFormlyFieldType<any, ET, FieldInputDescriptor<ET>> implements OnInit, OnDestroy {
8
8
  readonly NUMBER_MIN_SAFE: number;
9
9
  readonly NUMBER_MAX_SAFE: number;
10
10
  readonly DESC_INPUT_TYPE_IMAGE_FILE = FieldInputTypeEnum.ImageFile;
@@ -13,7 +13,6 @@ export declare class FormlyFieldInputComponent<ET> extends FieldType<CommonsForm
13
13
  private readonly formBuilder;
14
14
  private readonly translateService;
15
15
  iFormControl: FormControl;
16
- descriptor: FieldInputDescriptor<ET>;
17
16
  numberFieldMode: 'decimal' | 'currency';
18
17
  currency?: string;
19
18
  private files;
@@ -1,11 +1,10 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { FieldType } from '@ngx-formly/core';
3
- import { CommonsFormlyFieldConfig } from '@mediusinc/mng-commons/tableview/api';
2
+ import { FieldInputDescriptor } from '@mediusinc/mng-commons/tableview/api';
3
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
4
4
  import * as i0 from "@angular/core";
5
- export declare class FormlyFieldLabelComponent<ET> extends FieldType<CommonsFormlyFieldConfig> implements OnInit {
5
+ export declare class FormlyFieldLabelComponent extends ACommonsFormlyFieldType<any, any, FieldInputDescriptor<any>> implements OnInit {
6
6
  className: string;
7
- private descriptor;
8
7
  ngOnInit(): void;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFieldLabelComponent<any>, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<FormlyFieldLabelComponent<any>, "mng-formly-field-label", never, {}, {}, never, never, true, never>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFieldLabelComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormlyFieldLabelComponent, "mng-formly-field-label", never, {}, {}, never, never, true, never>;
11
10
  }
@@ -1,18 +1,17 @@
1
1
  import { AfterViewInit, Injector, OnDestroy, OnInit } from '@angular/core';
2
2
  import { FormControl } from '@angular/forms';
3
- import { FieldType } from '@ngx-formly/core';
4
3
  import { Message } from 'primeng/api';
5
4
  import { Observable, Subject } from 'rxjs';
6
5
  import { DataListResult } from '@mediusinc/mng-commons/core';
7
6
  import { TableComponent } from '@mediusinc/mng-commons/table';
8
- import { CommonsFormlyFieldConfig, FieldLookupConfig, FieldLookupDescriptor } from '@mediusinc/mng-commons/tableview/api';
7
+ import { FieldLookupConfig, FieldLookupDescriptor } from '@mediusinc/mng-commons/tableview/api';
8
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
9
9
  import * as i0 from "@angular/core";
10
- export declare class FormlyFieldLookupDialogComponent<T, ET> extends FieldType<CommonsFormlyFieldConfig> implements OnInit, AfterViewInit, OnDestroy {
10
+ export declare class FormlyFieldLookupDialogComponent<T, ET> extends ACommonsFormlyFieldType<T, ET, FieldLookupDescriptor<T, ET>> implements OnInit, AfterViewInit, OnDestroy {
11
11
  private injector;
12
12
  table?: TableComponent;
13
13
  private readonly destroyRef;
14
14
  private readonly logger;
15
- descriptor: FieldLookupDescriptor<T, ET>;
16
15
  config: FieldLookupConfig;
17
16
  fieldLabelFormControl: FormControl;
18
17
  addItemsSubject: Subject<DataListResult<T>>;
@@ -1,12 +1,11 @@
1
1
  import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
2
- import { FieldType } from '@ngx-formly/core';
3
2
  import { Observable, Subject } from 'rxjs';
4
- import { ActionDescriptorInst, CommonsFormlyFieldConfig, FieldManyEditorDescriptor } from '@mediusinc/mng-commons/tableview/api';
3
+ import { ActionDescriptorInst, FieldManyEditorDescriptor } from '@mediusinc/mng-commons/tableview/api';
4
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
5
5
  import * as i0 from "@angular/core";
6
- export declare class FormlyFieldTableDialogFormComponent<T = any, ET = any> extends FieldType<CommonsFormlyFieldConfig> implements OnInit, AfterViewInit, OnDestroy {
6
+ export declare class FormlyFieldTableDialogFormComponent<T = any, ET = any> extends ACommonsFormlyFieldType<T, ET, FieldManyEditorDescriptor<T, ET>> implements OnInit, AfterViewInit, OnDestroy {
7
7
  private readonly injector;
8
8
  private readonly destroyRef;
9
- descriptor: FieldManyEditorDescriptor<T, ET>;
10
9
  itemsSubject: Subject<Array<T>>;
11
10
  items$: Observable<Array<T>>;
12
11
  actions: Array<ActionDescriptorInst<T>>;
@@ -1,15 +1,14 @@
1
1
  import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
2
- import { FieldType } from '@ngx-formly/core';
3
2
  import { Observable, Subject } from 'rxjs';
4
3
  import { DataListResult } from '@mediusinc/mng-commons/core';
5
4
  import { TableComponent } from '@mediusinc/mng-commons/table';
6
- import { CommonsFormlyFieldConfig, FieldManyToManyEditorDescriptor } from '@mediusinc/mng-commons/tableview/api';
5
+ import { FieldManyToManyEditorDescriptor } from '@mediusinc/mng-commons/tableview/api';
6
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
7
7
  import * as i0 from "@angular/core";
8
- export declare class FormlyFieldTableDialogMultiselectComponent extends FieldType<CommonsFormlyFieldConfig> implements OnInit, AfterViewInit, OnDestroy {
8
+ export declare class FormlyFieldTableDialogMultiselectComponent extends ACommonsFormlyFieldType<any, any, FieldManyToManyEditorDescriptor<any, any>> implements OnInit, AfterViewInit, OnDestroy {
9
9
  private readonly injector;
10
10
  private readonly destroyRef;
11
11
  private readonly logger;
12
- descriptor: FieldManyToManyEditorDescriptor<any, any>;
13
12
  itemsSubject: Subject<Array<any>>;
14
13
  itemsAsync: Observable<Array<any>>;
15
14
  addItemsSubject: Subject<DataListResult>;
@@ -1,7 +1,6 @@
1
- import { FieldType } from '@ngx-formly/core';
2
- import { CommonsFormlyFieldConfig } from '@mediusinc/mng-commons/tableview/api';
1
+ import { ACommonsFormlyFieldType } from '../formly-field-type.abstract.component';
3
2
  import * as i0 from "@angular/core";
4
- export declare class FormlyFieldTabsComponent extends FieldType<CommonsFormlyFieldConfig> {
3
+ export declare class FormlyFieldTabsComponent extends ACommonsFormlyFieldType<any, any, never> {
5
4
  static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFieldTabsComponent, never>;
6
5
  static ɵcmp: i0.ɵɵComponentDeclaration<FormlyFieldTabsComponent, "mng-formly-field-tabs", never, {}, {}, never, never, true, never>;
7
6
  }
@@ -0,0 +1,12 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { FieldType } from '@ngx-formly/core';
3
+ import { AFieldDescriptor, CommonsFormlyFieldConfig, CommonsFormlyFormOptions, CommonsFormlyFormState } from '@mediusinc/mng-commons/tableview/api';
4
+ import * as i0 from "@angular/core";
5
+ export declare abstract class ACommonsFormlyFieldType<Model, EditorModel, Descriptor = AFieldDescriptor<Model, EditorModel>> extends FieldType<CommonsFormlyFieldConfig> implements OnInit {
6
+ get descriptor(): Descriptor;
7
+ get options(): CommonsFormlyFormOptions<Model>;
8
+ get formState(): CommonsFormlyFormState<Model>;
9
+ ngOnInit(): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<ACommonsFormlyFieldType<any, any, any>, never>;
11
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ACommonsFormlyFieldType<any, any, any>, never, never, {}, {}, never, never, false, never>;
12
+ }
package/version-info.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "5.0.1-rc.0",
4
- "tag": "v5.0.1-rc.0",
5
- "distance": 0,
6
- "hash": "99dfa907",
3
+ "version": "5.1.0-rc.0",
4
+ "tag": "v5.0.0-rc.4",
5
+ "distance": 14,
6
+ "hash": "584b4cac",
7
7
  "dirty": true,
8
- "semver": "5.0.1-rc.0+0.g99dfa907.dirty",
8
+ "semver": "5.0.0-rc.4+14.g584b4cac.dirty",
9
9
  "buildTimestamp": null,
10
- "raw": "v5.0.1-rc.0-99dfa907-dirty"
10
+ "raw": "v5.0.0-rc.4-14-584b4cac-dirty"
11
11
  }