@mediusinc/mng-commons 7.4.0 → 8.0.0-rc.2
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/README.md +74 -62
- package/fesm2022/mediusinc-mng-commons-core.mjs +159 -302
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-filter.mjs +3 -9
- package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form-api.mjs +4 -4
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +285 -203
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs +2 -5
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +1 -0
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/{mediusinc-mng-commons-table-column-toggle.component-BS5xvoDR.mjs → mediusinc-mng-commons-table-column-toggle.component-BHIzrUZz.mjs} +14 -12
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-BHIzrUZz.mjs.map +1 -0
- package/fesm2022/{mediusinc-mng-commons-table-mediusinc-mng-commons-table-BfEYZG7s.mjs → mediusinc-mng-commons-table-mediusinc-mng-commons-table-BPgwJRZk.mjs} +558 -522
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-BPgwJRZk.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-table.mjs +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +10 -75
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +460 -326
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
- package/i18n/en.json +1 -1
- package/i18n/sl.json +2 -2
- package/package.json +11 -24
- package/types/mediusinc-mng-commons-core.d.ts +55 -115
- package/types/mediusinc-mng-commons-filter.d.ts +4 -8
- package/types/mediusinc-mng-commons-form-api.d.ts +7 -7
- package/types/mediusinc-mng-commons-form.d.ts +11 -11
- package/types/mediusinc-mng-commons-table-api.d.ts +2 -2
- package/types/mediusinc-mng-commons-table.d.ts +21 -25
- package/types/mediusinc-mng-commons-tableview-api.d.ts +9 -51
- package/types/mediusinc-mng-commons-tableview.d.ts +9 -15
- package/fesm2022/mediusinc-mng-commons-model-class.mjs +0 -97
- package/fesm2022/mediusinc-mng-commons-model-class.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-table-api-class.mjs +0 -204
- package/fesm2022/mediusinc-mng-commons-table-api-class.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-BS5xvoDR.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-BfEYZG7s.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs +0 -374
- package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs.map +0 -1
- package/model/class/README.md +0 -8
- package/table/api/class/README.md +0 -10
- package/tableview/api/class/README.md +0 -13
- package/types/mediusinc-mng-commons-model-class.d.ts +0 -25
- package/types/mediusinc-mng-commons-table-api-class.d.ts +0 -77
- package/types/mediusinc-mng-commons-tableview-api-class.d.ts +0 -141
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { SelectItem, MenuItem, SortMeta, MessageService, ToastMessageOptions } from '
|
|
1
|
+
import * as _openng_optimus_ui_api from '@openng/optimus-ui/api';
|
|
2
|
+
import { SelectItem, MenuItem, SortMeta, MessageService, ToastMessageOptions } from '@openng/optimus-ui/api';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { ElementRef, Signal, TemplateRef, InjectionToken, PipeTransform, OnDestroy, Provider } from '@angular/core';
|
|
5
|
+
import { Popover } from '@openng/optimus-ui/popover';
|
|
5
6
|
import * as _mediusinc_mng_commons_core from '@mediusinc/mng-commons/core';
|
|
6
7
|
import { FilterMatchModeExtendedType, FilterState, FilterMatchMode, ILookupDataProvider, TemplateDirective, DataListParams, DataListResult, CommonsSerializationConfig, CommonsModuleConfig, CommonsFeature } from '@mediusinc/mng-commons/core';
|
|
7
8
|
import * as _mediusinc_mng_commons_filter from '@mediusinc/mng-commons/filter';
|
|
@@ -10,11 +11,10 @@ import { ModelDescriptor } from '@mediusinc/mng-commons/model';
|
|
|
10
11
|
import { getCurrencySymbol } from '@angular/common';
|
|
11
12
|
import { ColumnDisplayTypeEnum, ColumnDescriptor, TablePaginationModeEnum, ITableDataProvider, TableDescriptorInst, SortDescriptor, TableLayoutPreferences, TableLoadEvent, TableCellClickEvent, TableFilterChangeEvent, TableSearchChangeEvent, TableSortChangeEvent, TableReloadEvent } from '@mediusinc/mng-commons/table/api';
|
|
12
13
|
import { NgForm } from '@angular/forms';
|
|
13
|
-
import { Popover } from 'primeng/popover';
|
|
14
14
|
import * as _mediusinc_mng_commons_table from '@mediusinc/mng-commons/table';
|
|
15
|
-
import { Table, TableColumnReorderEvent, TableRowReorderEvent, TableCheckbox, TableRadioButton, TableLazyLoadEvent, TableFilterEvent, TablePageEvent } from '
|
|
16
|
-
import { MultiSelectChangeEvent } from '
|
|
17
|
-
import {
|
|
15
|
+
import { Table, TableColumnReorderEvent, TableRowReorderEvent, TableCheckbox, TableRadioButton, TableLazyLoadEvent, TableFilterEvent, TablePageEvent } from '@openng/optimus-ui/table';
|
|
16
|
+
import { MultiSelectChangeEvent } from '@openng/optimus-ui/multiselect';
|
|
17
|
+
import { Optimus } from '@openng/optimus-ui/config';
|
|
18
18
|
import { LookupDataProviderInst } from '@mediusinc/mng-commons/form/api';
|
|
19
19
|
import { TranslateService } from '@ngx-translate/core';
|
|
20
20
|
import { ReplaySubject, Observable } from 'rxjs';
|
|
@@ -48,7 +48,7 @@ interface FilterDateConfig {
|
|
|
48
48
|
showTime?: boolean;
|
|
49
49
|
showSeconds?: boolean;
|
|
50
50
|
showMilliseconds?: boolean;
|
|
51
|
-
|
|
51
|
+
optimusTimePicker?: boolean;
|
|
52
52
|
timeSelectInterval?: number;
|
|
53
53
|
timeSelect?: boolean;
|
|
54
54
|
}
|
|
@@ -74,9 +74,9 @@ declare class FilterService {
|
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Cannot be on push change detection strategy because of filter updates triggered from route which causes to force update values in force metadata
|
|
77
|
-
* and these must be propagated through to this component and beyond to
|
|
77
|
+
* and these must be propagated through to this component and beyond to Optimus UI.
|
|
78
78
|
*/
|
|
79
|
-
declare class TableFilterComponent
|
|
79
|
+
declare class TableFilterComponent {
|
|
80
80
|
#private;
|
|
81
81
|
readonly lookupTypeDropdown: FilterLookupTypeEnum;
|
|
82
82
|
readonly lookupTypeAutocomplete: FilterLookupTypeEnum;
|
|
@@ -89,14 +89,14 @@ declare class TableFilterComponent implements OnDestroy {
|
|
|
89
89
|
readonly showTitleAsPlaceholder: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
90
90
|
protected readonly descriptorAsLookup: _angular_core.Signal<FilterLookupDescriptor<any, any, any, any, string | number | symbol, string | number | symbol> | undefined>;
|
|
91
91
|
private readonly icon;
|
|
92
|
-
protected readonly matchModes: _angular_core.Signal<
|
|
92
|
+
protected readonly matchModes: _angular_core.Signal<_openng_optimus_ui_api.SelectItem<any>[]>;
|
|
93
93
|
protected readonly isInputDisabled: _angular_core.Signal<boolean>;
|
|
94
|
-
protected readonly overlayVisible: _angular_core.WritableSignal<boolean>;
|
|
95
94
|
protected readonly isMultiselect: _angular_core.Signal<boolean>;
|
|
96
95
|
protected readonly placeholderKey: _angular_core.Signal<string>;
|
|
97
96
|
protected readonly booleanOptions: BooleanFilterDropdownItem[];
|
|
97
|
+
protected popover: _angular_core.Signal<Popover | undefined>;
|
|
98
|
+
protected popoverContent: _angular_core.Signal<ElementRef<any> | undefined>;
|
|
98
99
|
constructor();
|
|
99
|
-
ngOnDestroy(): void;
|
|
100
100
|
protected onTextModelChange(event: Event): void;
|
|
101
101
|
protected onTextMultiModelChange(value: string[] | null | undefined): void;
|
|
102
102
|
protected onTextInputEnterKeyDown(event: Event): void;
|
|
@@ -111,12 +111,8 @@ declare class TableFilterComponent implements OnDestroy {
|
|
|
111
111
|
protected onMatchModeKeyDown(event: KeyboardEvent): void;
|
|
112
112
|
protected onCaseSensitivityToggle(): void;
|
|
113
113
|
protected clear(): void;
|
|
114
|
-
protected toggleMenu(event: Event): void;
|
|
115
|
-
protected onToggleButtonKeyDown(event: KeyboardEvent): void;
|
|
116
|
-
protected onEscape(): void;
|
|
117
|
-
protected onContentClick(): void;
|
|
118
|
-
protected onOverlayAnimationStart(event: any): void;
|
|
119
|
-
protected onOverlayAnimationEnd(event: any): void;
|
|
114
|
+
protected toggleMenu(event: Event, icon: HTMLButtonElement): void;
|
|
115
|
+
protected onToggleButtonKeyDown(event: KeyboardEvent, icon: HTMLButtonElement): void;
|
|
120
116
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableFilterComponent, never>;
|
|
121
117
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableFilterComponent, "mng-table-filter", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "model": { "alias": "model"; "required": true; "isSignal": true; }; "showFilterIcon": { "alias": "showFilterIcon"; "required": false; "isSignal": true; }; "showTitleAsPlaceholder": { "alias": "showTitleAsPlaceholder"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
122
118
|
}
|
|
@@ -354,7 +350,7 @@ declare class TableDataService<Item> extends ADataListService<Item> {
|
|
|
354
350
|
readonly params: Signal<DataListParams<string, string> | undefined>;
|
|
355
351
|
readonly sortStates: Signal<SortMeta[] | undefined>;
|
|
356
352
|
readonly filterStates: Signal<Record<string, FilterState>>;
|
|
357
|
-
readonly
|
|
353
|
+
readonly optimusFilterStates: Signal<{
|
|
358
354
|
[x: string]: FilterState;
|
|
359
355
|
}>;
|
|
360
356
|
readonly searchState: Signal<{
|
|
@@ -371,13 +367,13 @@ declare class TableDataService<Item> extends ADataListService<Item> {
|
|
|
371
367
|
readonly selectedItems: _angular_core.WritableSignal<Item[]>;
|
|
372
368
|
constructor();
|
|
373
369
|
setDataSources(arrayItems: Signal<Item[] | undefined>, dataListResult: Signal<DataListResult<Item> | undefined>, dataProvider: Signal<ITableDataProvider<Item, any, any, any> | undefined>, manualLoading: Signal<boolean | undefined>): void;
|
|
374
|
-
|
|
370
|
+
setOptimusTable(cmp?: Table<Item>): void;
|
|
375
371
|
fetchWithDataProvider(paramsList: DataListParams, onErrorFn: (error: Error) => void): boolean;
|
|
376
372
|
setParams(params: DataListParams): void;
|
|
377
373
|
/**
|
|
378
|
-
* Updates
|
|
374
|
+
* Updates the Optimus UI component with new filters and triggers data reload (if lazy load) or inline filtering.
|
|
379
375
|
* Usually setting the params should trigger the cycle to load data and calculate other states (sort, filter, search, etc.) from params.
|
|
380
|
-
* In case of
|
|
376
|
+
* In case of Optimus UI inline filtering, the internal state must be updated first and the states must subsequently be updated via callback functions.
|
|
381
377
|
*
|
|
382
378
|
* @param filters - { [fieldName]: FilterState | undefined } where:
|
|
383
379
|
* - fieldName = column field identifier
|
|
@@ -560,7 +556,7 @@ declare class TableComponent<Item = any, Service = undefined, Sorts = any, Filte
|
|
|
560
556
|
sortChange: _angular_core.OutputEmitterRef<TableSortChangeEvent>;
|
|
561
557
|
readonly templates: _angular_core.InputSignal<TableTemplateDirective<"footer" | "header" | "columnCustomLast" | "rowExpandContent" | "columnHeader" | "headerTitleRowRight" | "headerTitle">[]>;
|
|
562
558
|
readonly contentTemplates: Signal<readonly TableTemplateDirective<"footer" | "header" | "columnCustomLast" | "rowExpandContent" | "columnHeader" | "headerTitleRowRight" | "headerTitle">[]>;
|
|
563
|
-
readonly
|
|
559
|
+
readonly optimusTable: Signal<Table<Item> | undefined>;
|
|
564
560
|
readonly rowSelectCheckboxes: Signal<readonly TableCheckbox[]>;
|
|
565
561
|
readonly rowSelectRadioButtons: Signal<readonly TableRadioButton[]>;
|
|
566
562
|
headerTemplate: Signal<TemplateRef<TableTemplateContext> | null>;
|
|
@@ -600,7 +596,7 @@ declare class TableComponent<Item = any, Service = undefined, Sorts = any, Filte
|
|
|
600
596
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableComponent<any, any, any, any>, "mng-table", never, { "descriptorInput": { "alias": "descriptor"; "required": true; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "result": { "alias": "result"; "required": false; "isSignal": true; }; "loadingInput": { "alias": "loading"; "required": false; "isSignal": true; }; "dataProvider": { "alias": "dataProvider"; "required": false; "isSignal": true; }; "queryParamPrepend": { "alias": "queryParamPrepend"; "required": false; "isSignal": true; }; "useQueryParams": { "alias": "useQueryParams"; "required": false; "isSignal": true; }; "cellClickEnabled": { "alias": "cellClickEnabled"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "selectionEnabled": { "alias": "selectionEnabled"; "required": false; "isSignal": true; }; "rowReorderEnabledInput": { "alias": "rowReorderEnabled"; "required": false; "isSignal": true; }; "featureConfig": { "alias": "featureConfig"; "required": false; "isSignal": true; }; "columnLastMinWidth": { "alias": "columnLastMinWidth"; "required": false; "isSignal": true; }; "globalFilterFieldsInput": { "alias": "globalFilterFields"; "required": false; "isSignal": true; }; "templates": { "alias": "templates"; "required": false; "isSignal": true; }; }, { "tableLoad": "tableLoad"; "cellClick": "cellClick"; "selectionChange": "selectionChange"; "rowReorder": "rowReorder"; "filterChange": "filterChange"; "searchChange": "searchChange"; "sortChange": "sortChange"; }, ["contentTemplates"], never, true, never>;
|
|
601
597
|
}
|
|
602
598
|
|
|
603
|
-
declare function filterGenerateMatchModeOptions(
|
|
599
|
+
declare function filterGenerateMatchModeOptions(optimusConfig: Optimus, descriptor: FilterDescriptor<any, any> | undefined, cmpSerCfg?: CommonsSerializationConfig): SelectItem[];
|
|
604
600
|
/**
|
|
605
601
|
* Gets the default match mode for a filter.
|
|
606
602
|
*
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InputSignal, OutputEmitterRef, Type, InputSignalWithTransform, WritableSignal, Injector, InjectionToken } from '@angular/core';
|
|
3
|
-
import { ButtonSeverity } from '
|
|
3
|
+
import { ButtonSeverity } from '@openng/optimus-ui/button';
|
|
4
4
|
import * as _mediusinc_mng_commons_core from '@mediusinc/mng-commons/core';
|
|
5
|
-
import { IdType, ActionData, ActionParameters, GetterFn,
|
|
5
|
+
import { IdType, ActionData, ActionParameters, GetterFn, OptimusMessageSeverityType, ServiceClassType, ILookupDataProvider, ILookupDescriptor, LookupDataProviderLookupFnType, LookupDataProviderCacheOpts, EnumValue, EnumConstantType, ItemOrObservable, ArrayItemType, ITableviewDescriptor, ITableDescriptor, CommonPropsObjType3, IEditorDescriptor, IDataProvider, Nullable, IActionDescriptor, APermissions, ServiceClassOptType, Undefined, DataProviderInst, StyleSizeEnum, DataListResult, ACommonsErrorBase, ICommonsActionError, CommonsErrorBaseOptions, ClassFunctionKeysWithParamAndReturnType, ClassFunctionKeyParam1ObjKeyExtendsOfTargetType, CommonsRouteData } from '@mediusinc/mng-commons/core';
|
|
6
6
|
import { IActionButtonDescriptor, InputTrimType, EmptyValueType } from '@mediusinc/mng-commons/form/api';
|
|
7
7
|
import { EnumDescriptor, TypeDescriptor, ModelDescriptor, ModelDescriptorCreateOpts } from '@mediusinc/mng-commons/model';
|
|
8
|
-
import { ToastMessageOptions, Confirmation } from '
|
|
8
|
+
import { ToastMessageOptions, Confirmation } from '@openng/optimus-ui/api';
|
|
9
9
|
import * as rxjs from 'rxjs';
|
|
10
10
|
import { Observable, Subject } from 'rxjs';
|
|
11
|
-
import { DynamicDialogRef } from '
|
|
11
|
+
import { DynamicDialogRef } from '@openng/optimus-ui/dynamicdialog';
|
|
12
12
|
import * as _mediusinc_mng_commons_table_api from '@mediusinc/mng-commons/table/api';
|
|
13
13
|
import { TableDescriptorInst, ITableDataProvider, TableDataProviderGetAllFnType, IColumnsManageInterface, ColumnDescriptor, TableDynamicDescriptorInst, TableReloadEvent, TableDataProviderInst, TableDataProviderGetAllEagerFnType } from '@mediusinc/mng-commons/table/api';
|
|
14
14
|
import { AbstractControl, FormGroup, FormControl, UntypedFormGroup } from '@angular/forms';
|
|
@@ -290,12 +290,6 @@ declare abstract class AFieldDescriptor<FieldModel, EditorModel, FieldValue = Fi
|
|
|
290
290
|
* @param useModelBase If set to true, label will be appended to model's i18n base path.
|
|
291
291
|
*/
|
|
292
292
|
withLabel(label: string | null, useModelBase?: boolean): this;
|
|
293
|
-
/**
|
|
294
|
-
* Set label to empty string.
|
|
295
|
-
*
|
|
296
|
-
* @deprecated Use `withLabel('')` instead.
|
|
297
|
-
*/
|
|
298
|
-
withEmptyLabel(): this;
|
|
299
293
|
withPlaceholder(placeholder: string): this;
|
|
300
294
|
withHelpText(helpText: string): this;
|
|
301
295
|
/**
|
|
@@ -455,7 +449,7 @@ interface FieldActionResult {
|
|
|
455
449
|
}
|
|
456
450
|
interface FieldActionResultMessage {
|
|
457
451
|
content: string;
|
|
458
|
-
severity?:
|
|
452
|
+
severity?: OptimusMessageSeverityType;
|
|
459
453
|
}
|
|
460
454
|
|
|
461
455
|
type FieldActionRunFnType<EditorModel, ParentEditorModel = undefined> = (ctx: FieldActionContext<EditorModel, ParentEditorModel>) => void | FieldActionResult | Observable<FieldActionResult>;
|
|
@@ -523,16 +517,8 @@ declare class FieldLookupDescriptor<FieldModel, EditorModel, Service = any, Fiel
|
|
|
523
517
|
get optionsTrackProperty(): string | undefined;
|
|
524
518
|
get dataProvider(): ILookupDataProvider<FieldModel, Service, Sorts, Filters>;
|
|
525
519
|
get inlineSearch(): boolean | undefined;
|
|
526
|
-
/**
|
|
527
|
-
* @deprecated Use `allowInput` instead.
|
|
528
|
-
*/
|
|
529
|
-
get dropdownAllowInput(): boolean | undefined;
|
|
530
520
|
get allowInput(): boolean | undefined;
|
|
531
521
|
get autocompleteOpenOnFocus(): boolean | undefined;
|
|
532
|
-
/**
|
|
533
|
-
* @deprecated Use `inlineSearch` instead.
|
|
534
|
-
*/
|
|
535
|
-
get autocompleteInlineSearch(): boolean | undefined;
|
|
536
522
|
get autocompleteAutoClear(): boolean | undefined;
|
|
537
523
|
get autocompleteSelectFirst(): boolean | undefined;
|
|
538
524
|
get dropdownClassName(): string;
|
|
@@ -694,7 +680,7 @@ type FieldInputDatePickerDisplayOptsType = {
|
|
|
694
680
|
showTime?: boolean;
|
|
695
681
|
showSeconds?: boolean;
|
|
696
682
|
showMilliseconds?: boolean;
|
|
697
|
-
|
|
683
|
+
optimusTimePicker?: boolean;
|
|
698
684
|
timeSelectInterval?: number;
|
|
699
685
|
timeSelect?: boolean;
|
|
700
686
|
};
|
|
@@ -781,7 +767,7 @@ declare class FieldInputDescriptor<EditorModel, FieldModel = FieldInputDescripto
|
|
|
781
767
|
private _datePickerShowTime?;
|
|
782
768
|
private _datePickerShowSeconds?;
|
|
783
769
|
private _datePickerShowMilliseconds?;
|
|
784
|
-
private
|
|
770
|
+
private _datePickerOptimusTimePicker?;
|
|
785
771
|
private _datePickerTimeSelectInterval?;
|
|
786
772
|
private _datePickerTimeSelect?;
|
|
787
773
|
private _datePickerValueUtc?;
|
|
@@ -833,7 +819,7 @@ declare class FieldInputDescriptor<EditorModel, FieldModel = FieldInputDescripto
|
|
|
833
819
|
get datePickerShowTime(): boolean | undefined;
|
|
834
820
|
get datePickerShowSeconds(): boolean | undefined;
|
|
835
821
|
get datePickerShowMilliseconds(): boolean | undefined;
|
|
836
|
-
get
|
|
822
|
+
get datePickerOptimusTimePicker(): boolean | undefined;
|
|
837
823
|
get datePickerTimeSelect(): boolean | undefined;
|
|
838
824
|
get datePickerTimeSelectInterval(): number | undefined;
|
|
839
825
|
get datePickerValueUtc(): boolean | undefined;
|
|
@@ -1391,10 +1377,6 @@ interface IFormEditorComponent<Item, ParentItem = any> {
|
|
|
1391
1377
|
[K in keyof Item]: AbstractControl<Item[K]>;
|
|
1392
1378
|
}>;
|
|
1393
1379
|
get formUnsafe(): UntypedFormGroup;
|
|
1394
|
-
/**
|
|
1395
|
-
* @deprecated, will be removed in next version.
|
|
1396
|
-
*/
|
|
1397
|
-
get formlyInitialItem(): any;
|
|
1398
1380
|
get formlyOptions(): FormlyFormOptions & CommonsFormlyFormOptions<Item>;
|
|
1399
1381
|
get formlyFields(): FormlyFieldConfig[];
|
|
1400
1382
|
/**
|
|
@@ -1682,7 +1664,7 @@ declare class ActionDescriptorInst<Item, Service = any, RunInputItem = Item, Run
|
|
|
1682
1664
|
withComponent(component: Type<IActionComponent<Item>>): this;
|
|
1683
1665
|
withComponentFromDi(injectionToken: InjectionToken<Type<any>>): this;
|
|
1684
1666
|
withPositionTableviewCategories(positionTableviewCategories: string[]): this;
|
|
1685
|
-
withI18nBase(base:
|
|
1667
|
+
withI18nBase(base: string): this;
|
|
1686
1668
|
withSubactionsAsMenu(subactionsAsMenu?: boolean): this;
|
|
1687
1669
|
withSubactions(...subactions: Array<ActionDescriptorInst<Item, any, RunInputItem, any>>): this;
|
|
1688
1670
|
copyFieldsTo(descriptor: ActionDescriptorInst<Item, Service, RunInputItem, RunReturnItem, ValidationInputItem>): ActionDescriptorInst<Item, Service, RunInputItem, RunReturnItem, ValidationInputItem>;
|
|
@@ -1862,18 +1844,6 @@ declare class ActionEditorDescriptorInst<Item, Service = any, EditorItem = Item,
|
|
|
1862
1844
|
get editorTitle(): string | null | undefined;
|
|
1863
1845
|
get editorTitleParams(): any;
|
|
1864
1846
|
get editorDescriptor(): EditorDescriptorInst<EditorItem, ParentEditorItem>;
|
|
1865
|
-
/**
|
|
1866
|
-
* @deprecated Use dialogConfig instead.
|
|
1867
|
-
*/
|
|
1868
|
-
get dialogSize(): StyleSizeEnum | undefined;
|
|
1869
|
-
/**
|
|
1870
|
-
* @deprecated Use dialogConfig instead.
|
|
1871
|
-
*/
|
|
1872
|
-
get dialogClassName(): string | undefined;
|
|
1873
|
-
/**
|
|
1874
|
-
* @deprecated Use dialogConfig instead.
|
|
1875
|
-
*/
|
|
1876
|
-
get dialogIsMaximizable(): boolean | undefined;
|
|
1877
1847
|
get dialogConfig(): DialogOptsType;
|
|
1878
1848
|
get fetchNotificationOnSuccess(): boolean | ActionNotificationType | undefined;
|
|
1879
1849
|
get fetchNotificationOnError(): boolean | ActionNotificationType | undefined;
|
|
@@ -1890,18 +1860,6 @@ declare class ActionEditorDescriptorInst<Item, Service = any, EditorItem = Item,
|
|
|
1890
1860
|
get resubmitRefetch(): boolean;
|
|
1891
1861
|
get unsavedChangesConfirmation(): boolean;
|
|
1892
1862
|
withEditorTitle(title: string | null, params?: any): this;
|
|
1893
|
-
/**
|
|
1894
|
-
* @deprecated Use withDialogConfig instead.
|
|
1895
|
-
*/
|
|
1896
|
-
withDialogSize(size?: StyleSizeEnum): this;
|
|
1897
|
-
/**
|
|
1898
|
-
* @deprecated Use withDialogConfig instead.
|
|
1899
|
-
*/
|
|
1900
|
-
withDialogClassName(className: string): this;
|
|
1901
|
-
/**
|
|
1902
|
-
* @deprecated Use withDialogConfig instead.
|
|
1903
|
-
*/
|
|
1904
|
-
withDialogMaximizable(isMaximizable?: boolean): this;
|
|
1905
1863
|
withDialogConfig(opts: DialogOptsType): this;
|
|
1906
1864
|
withRunFunction(fn: ActionEditorRunFnType<Item, ParentEditorItem, Service, EditorItem, SubmitReturnItem>): this;
|
|
1907
1865
|
withFetchFunction(fn: ActionEditorRunFnType<Item, ParentEditorItem, Service, FetchInputItem, EditorItem>): this;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as _mediusinc_mng_commons_form_api from '@mediusinc/mng-commons/form/api';
|
|
2
|
-
import { LookupDataProviderInst,
|
|
2
|
+
import { LookupDataProviderInst, OptimusButtonStyleProps } from '@mediusinc/mng-commons/form/api';
|
|
3
3
|
import * as _angular_router from '@angular/router';
|
|
4
4
|
import { ActivatedRoute, CanDeactivateFn, Router, DefaultExport, Route } from '@angular/router';
|
|
5
5
|
import * as _angular_core from '@angular/core';
|
|
6
6
|
import { Injector, OnDestroy, InputSignal, InputSignalWithTransform, WritableSignal, Provider, OnInit, AfterViewInit, ElementRef, Type, InjectionToken, DestroyRef, ChangeDetectorRef } from '@angular/core';
|
|
7
|
-
import { Confirmation, ToastMessageOptions, MenuItem, MessageService, ConfirmationService } from '
|
|
8
|
-
import { Menu } from '
|
|
7
|
+
import { Confirmation, ToastMessageOptions, MenuItem, MessageService, ConfirmationService } from '@openng/optimus-ui/api';
|
|
8
|
+
import { Menu } from '@openng/optimus-ui/menu';
|
|
9
9
|
import * as _mediusinc_mng_commons_core from '@mediusinc/mng-commons/core';
|
|
10
10
|
import { IDataProvider, ActionParameters, ICommonsError, IdType, ActionData, DataListParams, CommonsService, DataListResult, I18nMissingTranslationStrategy, ParametrizePipe, LoggerService, Nullable, KeyofAndOfType, RouteBuilder, APermissions, CommonsFeature } from '@mediusinc/mng-commons/core';
|
|
11
11
|
import * as _mediusinc_mng_commons_tableview_api from '@mediusinc/mng-commons/tableview/api';
|
|
12
|
-
import { IViewContainer, ActionDescriptorInst, EditorResetEvent, ViewContainerEditorCloseEvent, IActionContext, IActionInstance, IActionEditorComponent, ActionInstanceStateEnum, ActionExecutionError, ActionLinkDescriptorInst, IActionComponent, IFormEditorComponent, EditorDescriptorInst, CommonsFormlyFormOptions, FormValue, FormEditorGetFormValueOpts, FormEditorResetFormModelOpts, FormEditorSubmitEvent, FormEditorSetFieldValueOpts, FormEditorPatchFieldValueOpts, FormEditorResetFieldValueOpts, ActionEditorDescriptorInst, ActionActivationTriggerEnum, ActionEditorSubmitTypeEnum, IActionEditorContext, ActionNotificationType, DataProviderExecutor, ActionContextValidation, RunFetchFromDataProviderReasonType, AGenericFieldDescriptor, CommonsFormlyFieldConfig, CommonsFormlyFormState, AFieldDescriptor, FieldActionDescriptor, FieldActionResultMessage, FieldLookupDescriptor, FieldInputDescriptor, AFieldGroupDescriptor, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputTypeEnum, FieldLookupConfig, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidationDescriptor, CommonsFormlyValidation, FieldInputDatePickerDynamicMinMaxFnType,
|
|
13
|
-
import { DynamicDialogRef, DynamicDialogConfig, DialogService } from '
|
|
12
|
+
import { IViewContainer, ActionDescriptorInst, EditorResetEvent, ViewContainerEditorCloseEvent, IActionContext, IActionInstance, IActionEditorComponent, ActionInstanceStateEnum, ActionExecutionError, ActionLinkDescriptorInst, IActionComponent, IFormEditorComponent, EditorDescriptorInst, CommonsFormlyFormOptions, FormValue, FormEditorGetFormValueOpts, FormEditorResetFormModelOpts, FormEditorSubmitEvent, FormEditorSetFieldValueOpts, FormEditorPatchFieldValueOpts, FormEditorResetFieldValueOpts, ActionEditorDescriptorInst, ActionActivationTriggerEnum, ActionEditorSubmitTypeEnum, IActionEditorContext, ActionNotificationType, DataProviderExecutor, ActionContextValidation, RunFetchFromDataProviderReasonType, AGenericFieldDescriptor, CommonsFormlyFieldConfig, CommonsFormlyFormState, AFieldDescriptor, FieldActionDescriptor, FieldActionResultMessage, FieldLookupDescriptor, FieldInputDescriptor, AFieldGroupDescriptor, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputTypeEnum, FieldLookupConfig, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidationDescriptor, CommonsFormlyValidation, FieldValidator, FieldInputDatePickerDynamicMinMaxFnType, EditorDescriptorNestedObjectWrapper, TableviewDescriptorType, TableviewDescriptorInst, FieldLookupProviderType, TableviewInput, ITableviewDataProvider, TableviewRouteData } from '@mediusinc/mng-commons/tableview/api';
|
|
13
|
+
import { DynamicDialogRef, DynamicDialogConfig, DialogService } from '@openng/optimus-ui/dynamicdialog';
|
|
14
14
|
import * as rxjs from 'rxjs';
|
|
15
15
|
import { Observable, Subscription, ReplaySubject, BehaviorSubject } from 'rxjs';
|
|
16
16
|
import { TableReloadEvent, TableDescriptorInst, ITableDataProvider, TableLoadEvent, TableCellClickEvent } from '@mediusinc/mng-commons/table/api';
|
|
@@ -18,7 +18,7 @@ import * as _mediusinc_mng_commons_tableview from '@mediusinc/mng-commons/tablev
|
|
|
18
18
|
import * as _ngx_formly_core from '@ngx-formly/core';
|
|
19
19
|
import { FormlyFormOptions, FormlyFieldConfig, FieldType, FieldWrapper, FormlyConfig, ConfigOption } from '@ngx-formly/core';
|
|
20
20
|
import { FormGroup, AbstractControl, UntypedFormGroup, FormControl, FormArray, ValidationErrors } from '@angular/forms';
|
|
21
|
-
import { TableRowReorderEvent } from '
|
|
21
|
+
import { TableRowReorderEvent } from '@openng/optimus-ui/table';
|
|
22
22
|
import { TableTemplateDirective, TableFeatureConfig, TableComponent } from '@mediusinc/mng-commons/table';
|
|
23
23
|
import { TranslateService } from '@ngx-translate/core';
|
|
24
24
|
import { ModelDescriptor, TypeDescriptor } from '@mediusinc/mng-commons/model';
|
|
@@ -176,7 +176,7 @@ declare class ActionComponent<Item = any, Service = undefined> implements OnDest
|
|
|
176
176
|
route: _angular_core.Signal<ActivatedRoute>;
|
|
177
177
|
routeData: _angular_core.Signal<_angular_router.Data | undefined>;
|
|
178
178
|
private routePermissions;
|
|
179
|
-
buttonStyles: _angular_core.Signal<_mediusinc_mng_commons_form_api.
|
|
179
|
+
buttonStyles: _angular_core.Signal<_mediusinc_mng_commons_form_api.OptimusButtonStyleProps>;
|
|
180
180
|
subactions: _angular_core.WritableSignal<MenuItem[]>;
|
|
181
181
|
private subactionSubscriptions;
|
|
182
182
|
private instance?;
|
|
@@ -216,7 +216,6 @@ declare class FormEditorService<Item, ParentItem = any> implements IFormEditorCo
|
|
|
216
216
|
get formUnsafe(): UntypedFormGroup;
|
|
217
217
|
get formlyOptions(): FormlyFormOptions & CommonsFormlyFormOptions<Item>;
|
|
218
218
|
get formlyFields(): FormlyFieldConfig[];
|
|
219
|
-
get formlyInitialItem(): any;
|
|
220
219
|
get itemInput(): Item | undefined;
|
|
221
220
|
get formInitialValue(): FormValue<Item>;
|
|
222
221
|
submit(): void;
|
|
@@ -274,7 +273,7 @@ declare class FormEditorComponent<Item = any, ParentItem = any> implements IForm
|
|
|
274
273
|
private setterFields;
|
|
275
274
|
readonly formMessages: _angular_core.WritableSignal<ToastMessageOptions[]>;
|
|
276
275
|
protected readonly formMessagesTypeNarrowed: _angular_core.Signal<{
|
|
277
|
-
severity: _mediusinc_mng_commons_core.
|
|
276
|
+
severity: _mediusinc_mng_commons_core.OptimusMessageSeverityType | undefined;
|
|
278
277
|
text: string | undefined;
|
|
279
278
|
icon: string | undefined;
|
|
280
279
|
}[]>;
|
|
@@ -294,11 +293,6 @@ declare class FormEditorComponent<Item = any, ParentItem = any> implements IForm
|
|
|
294
293
|
get formlyFields(): FormlyFieldConfig<_ngx_formly_core.FormlyFieldProps & {
|
|
295
294
|
[additionalProperties: string]: any;
|
|
296
295
|
}>[];
|
|
297
|
-
/**
|
|
298
|
-
* @deprecated, use
|
|
299
|
-
* Only used for form initialization. Further changes should be done using {resetFormModel}.
|
|
300
|
-
*/
|
|
301
|
-
get formlyInitialItem(): {};
|
|
302
296
|
get itemInput(): Item | undefined;
|
|
303
297
|
get formInitialValue(): FormValue<Item>;
|
|
304
298
|
constructor();
|
|
@@ -931,7 +925,7 @@ declare abstract class ACommonsFormlyFieldType<Model, EditorModel, Descriptor ex
|
|
|
931
925
|
}
|
|
932
926
|
|
|
933
927
|
declare class FormlyFieldActionComponent<EditorModel> extends ACommonsFormlyFieldType<void, EditorModel, FieldActionDescriptor<EditorModel>> implements OnInit, OnDestroy {
|
|
934
|
-
protected buttonStyle: _angular_core.WritableSignal<
|
|
928
|
+
protected buttonStyle: _angular_core.WritableSignal<OptimusButtonStyleProps>;
|
|
935
929
|
protected actionMessage: _angular_core.WritableSignal<FieldActionResultMessage | undefined>;
|
|
936
930
|
private resultSubscription?;
|
|
937
931
|
ngOnInit(): void;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { DataProviderInst, TypeRegistry, findReflectTypeName } from '@mediusinc/mng-commons/core';
|
|
2
|
-
import { ModelDescriptor, TypeDescriptor } from '@mediusinc/mng-commons/model';
|
|
3
|
-
|
|
4
|
-
function dataProviderFromClass(type, serviceType) {
|
|
5
|
-
return new DataProviderInst(serviceType);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function findClassIdAttribute(classType) {
|
|
9
|
-
if (!classType)
|
|
10
|
-
return null;
|
|
11
|
-
const attrDef = getClassAttributeDef(classType);
|
|
12
|
-
if (!attrDef) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
let idAttribute = findAttributeByTypeAndName(attrDef, ['string', 'number'], 'id', 'uuid', 'code', 'sifra');
|
|
16
|
-
if (!idAttribute) {
|
|
17
|
-
// if no id or code, take the first attribute
|
|
18
|
-
idAttribute = attrDef[0];
|
|
19
|
-
}
|
|
20
|
-
return idAttribute?.name ?? null;
|
|
21
|
-
}
|
|
22
|
-
function findClassTitleAttribute(classType) {
|
|
23
|
-
if (!classType)
|
|
24
|
-
return null;
|
|
25
|
-
const attrDef = getClassAttributeDef(classType);
|
|
26
|
-
if (!attrDef) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
let titleAttribute = findAttributeByTypeAndName(attrDef, ['string'], 'name', 'ime', 'title', 'naziv');
|
|
30
|
-
if (!titleAttribute) {
|
|
31
|
-
// if no name or title, take the first attribute
|
|
32
|
-
titleAttribute = attrDef[0];
|
|
33
|
-
}
|
|
34
|
-
return titleAttribute?.name ?? null;
|
|
35
|
-
}
|
|
36
|
-
function getClassAttributeDef(classType) {
|
|
37
|
-
if (!classType)
|
|
38
|
-
return null;
|
|
39
|
-
const attrDefByFn = classType.getAttributeTypeMap?.();
|
|
40
|
-
if (attrDefByFn)
|
|
41
|
-
return attrDefByFn;
|
|
42
|
-
const attrDefByProp = classType.attributeTypeMap;
|
|
43
|
-
if (attrDefByProp)
|
|
44
|
-
return attrDefByProp;
|
|
45
|
-
const attrByObjSer = TypeRegistry.get().findAttributesDefinitionByClassType(classType);
|
|
46
|
-
if (attrByObjSer)
|
|
47
|
-
return attrByObjSer;
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
function findAttributeByTypeAndName(attributes, types, ...names) {
|
|
51
|
-
for (const name of names) {
|
|
52
|
-
const attribute = attributes.find(a => types.some(t => t === a.type) && a.name === name);
|
|
53
|
-
if (attribute) {
|
|
54
|
-
return attribute;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
class ModelClassDescriptor extends ModelDescriptor {
|
|
61
|
-
constructor(_type, idProperty, titleProperty, i18nBaseKey) {
|
|
62
|
-
super(idProperty, titleProperty, i18nBaseKey);
|
|
63
|
-
this._classType = _type;
|
|
64
|
-
}
|
|
65
|
-
get classType() {
|
|
66
|
-
return this._classType;
|
|
67
|
-
}
|
|
68
|
-
copy() {
|
|
69
|
-
return new ModelClassDescriptor(this._classType, this._idProperty, this._titleProperty, this._i18nBaseKey);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function modelClass(type, opts) {
|
|
73
|
-
let idProperty = opts?.id;
|
|
74
|
-
if (!idProperty && type) {
|
|
75
|
-
idProperty = findClassIdAttribute(type) ?? undefined;
|
|
76
|
-
}
|
|
77
|
-
let titleProp = opts?.title;
|
|
78
|
-
if (!titleProp && type) {
|
|
79
|
-
titleProp = findClassTitleAttribute(type) ?? undefined;
|
|
80
|
-
}
|
|
81
|
-
const i18nBaseKey = opts?.i18nBase != null ? (typeof opts?.i18nBase === 'string' ? opts.i18nBase : findReflectTypeName(opts.i18nBase)) : findReflectTypeName(type);
|
|
82
|
-
return new ModelClassDescriptor(type, idProperty, titleProp, i18nBaseKey ?? undefined);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
86
|
-
function typeFromClass(type) {
|
|
87
|
-
return new TypeDescriptor();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// data providers
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Generated bundle index. Do not edit.
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
export { ModelClassDescriptor, dataProviderFromClass, findClassIdAttribute, findClassTitleAttribute, getClassAttributeDef, modelClass, typeFromClass };
|
|
97
|
-
//# sourceMappingURL=mediusinc-mng-commons-model-class.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mediusinc-mng-commons-model-class.mjs","sources":["../../model/class/src/data-providers/base-from-class-data-provider.factory.ts","../../model/class/src/helpers/model.ts","../../model/class/src/descriptors/model-class.descriptor.ts","../../model/class/src/descriptors/type-class.descriptor.ts","../../model/class/src/index.ts","../../model/class/src/mediusinc-mng-commons-model-class.ts"],"sourcesContent":["import {ClassType, DataProviderInst, ServiceClassType} from '@mediusinc/mng-commons/core';\n\nexport function dataProviderFromClass<Model>(type: ClassType<Model>): DataProviderInst<Model, undefined, undefined>;\nexport function dataProviderFromClass<Model, Service = any>(\n type: ClassType<Model>,\n ServiceClass: ServiceClassType<Service>\n): DataProviderInst<Model, Service, ServiceClassType<Service>>;\nexport function dataProviderFromClass<Model, Service = any, ServiceClass = ServiceClassType<Service>>(type: ClassType<Model>, serviceType?: ServiceClass) {\n return new DataProviderInst<Model, Service, ServiceClass>(serviceType as ServiceClass);\n}\n","import {ClassAttributeDef, ClassType, TypeRegistry} from '@mediusinc/mng-commons/core';\n\nexport function findClassIdAttribute<T>(classType?: ClassType<T>): string | null {\n if (!classType) return null;\n\n const attrDef = getClassAttributeDef(classType);\n if (!attrDef) {\n return null;\n }\n\n let idAttribute = findAttributeByTypeAndName(attrDef, ['string', 'number'], 'id', 'uuid', 'code', 'sifra');\n if (!idAttribute) {\n // if no id or code, take the first attribute\n idAttribute = attrDef[0];\n }\n\n return idAttribute?.name ?? null;\n}\n\nexport function findClassTitleAttribute<T>(classType?: ClassType<T>): string | null {\n if (!classType) return null;\n\n const attrDef = getClassAttributeDef(classType);\n if (!attrDef) {\n return null;\n }\n\n let titleAttribute = findAttributeByTypeAndName(attrDef, ['string'], 'name', 'ime', 'title', 'naziv');\n if (!titleAttribute) {\n // if no name or title, take the first attribute\n titleAttribute = attrDef[0];\n }\n\n return titleAttribute?.name ?? null;\n}\n\nexport function getClassAttributeDef<T>(classType?: ClassType<T>) {\n if (!classType) return null;\n const attrDefByFn = (classType as any).getAttributeTypeMap?.() as Array<ClassAttributeDef> | undefined;\n if (attrDefByFn) return attrDefByFn;\n const attrDefByProp = (classType as any).attributeTypeMap as Array<ClassAttributeDef> | undefined;\n if (attrDefByProp) return attrDefByProp;\n const attrByObjSer = TypeRegistry.get().findAttributesDefinitionByClassType(classType);\n if (attrByObjSer) return attrByObjSer;\n return null;\n}\n\nfunction findAttributeByTypeAndName(attributes: ClassAttributeDef[], types: string[], ...names: string[]): ClassAttributeDef | null {\n for (const name of names) {\n const attribute = attributes.find(a => types.some(t => t === a.type) && a.name === name);\n if (attribute) {\n return attribute;\n }\n }\n return null;\n}\n","import {ClassType, IModelDescriptor, findReflectTypeName} from '@mediusinc/mng-commons/core';\nimport {ModelDescriptor, ModelDescriptorCreateOpts} from '@mediusinc/mng-commons/model';\n\nimport {findClassIdAttribute, findClassTitleAttribute} from '../helpers/model';\n\nexport class ModelClassDescriptor<Model> extends ModelDescriptor<Model> implements IModelDescriptor<Model> {\n private readonly _classType: ClassType<Model>;\n\n public constructor(_type: ClassType<Model>, idProperty?: string, titleProperty?: string | ((item: Model) => string), i18nBaseKey?: string) {\n super(idProperty, titleProperty, i18nBaseKey);\n this._classType = _type;\n }\n\n public get classType() {\n return this._classType;\n }\n\n public override copy(): ModelClassDescriptor<Model> {\n return new ModelClassDescriptor<Model>(this._classType, this._idProperty, this._titleProperty, this._i18nBaseKey);\n }\n}\n\nexport type ModelClassDescriptorCreateOpts<Model> = Omit<ModelDescriptorCreateOpts<Model>, 'i18nBase'> & {\n i18nBase?: string | ClassType<unknown>;\n};\n\nexport function modelClass<Model>(type: ClassType<Model>, opts?: ModelClassDescriptorCreateOpts<Model>): ModelClassDescriptor<Model> {\n let idProperty = opts?.id as string | undefined;\n if (!idProperty && type) {\n idProperty = findClassIdAttribute(type as unknown as ClassType<Model>) ?? undefined;\n }\n let titleProp = opts?.title as string | ((item: Model) => string) | undefined;\n if (!titleProp && type) {\n titleProp = findClassTitleAttribute(type as unknown as ClassType<Model>) ?? undefined;\n }\n const i18nBaseKey =\n opts?.i18nBase != null ? (typeof opts?.i18nBase === 'string' ? opts.i18nBase : findReflectTypeName(opts.i18nBase)) : findReflectTypeName(type as ClassType<Model>);\n return new ModelClassDescriptor<Model>(type, idProperty, titleProp, i18nBaseKey ?? undefined);\n}\n","import {ClassType} from '@mediusinc/mng-commons/core';\nimport {TypeDescriptor} from '@mediusinc/mng-commons/model';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function typeFromClass<Type>(type: ClassType<Type>): TypeDescriptor<Type> {\n return new TypeDescriptor<Type>();\n}\n","// data providers\nexport * from './data-providers/base-from-class-data-provider.factory';\n\n// descriptors\nexport * from './descriptors/model-class.descriptor';\nexport * from './descriptors/type-class.descriptor';\n\n// helpers\nexport * from './helpers/model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAOM,SAAU,qBAAqB,CAAiE,IAAsB,EAAE,WAA0B,EAAA;AACpJ,IAAA,OAAO,IAAI,gBAAgB,CAA+B,WAA2B,CAAC;AAC1F;;ACPM,SAAU,oBAAoB,CAAI,SAAwB,EAAA;AAC5D,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,IAAI;AAE3B,IAAA,MAAM,OAAO,GAAG,oBAAoB,CAAC,SAAS,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE;AACV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