@mediusinc/mng-commons-data-api 5.5.0-rc.0 → 5.5.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -124,4 +124,4 @@ export function filterValueSuggestionLookupProvider(service, lookupFn) {
124
124
  }));
125
125
  }
126
126
  }
127
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJpYy1maWx0ZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vdGFibGV2aWV3L3NyYy9maWx0ZXIvZ2VuZXJpYy1maWx0ZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBQyxVQUFVLEVBQW1CLE1BQU0sTUFBTSxDQUFDO0FBRWxELE9BQU8sRUFBNkYsWUFBWSxFQUFFLGNBQWMsRUFBQyxNQUFNLDZCQUE2QixDQUFDO0FBQ3JLLE9BQU8sRUFBa0UsY0FBYyxFQUFDLE1BQU0sK0JBQStCLENBQUM7QUFDOUgsT0FBTyxFQUF5Qiw2QkFBNkIsRUFBQyxNQUFNLGlDQUFpQyxDQUFDO0FBT3RHOzs7Ozs7O0dBT0c7QUFDSCxNQUFNLFVBQVUsK0JBQStCLENBQzNDLFlBQXFCLEVBQ3JCLElBQW9DO0lBRXBDLElBQUksVUFBaUMsQ0FBQztJQUN0QyxJQUFJLFVBQWlFLENBQUM7SUFFdEUsUUFBUSxZQUFZLEVBQUUsV0FBVyxFQUFFLEVBQUUsQ0FBQztRQUNsQyxLQUFLLE1BQU07WUFDUCxVQUFVLEdBQUcsY0FBYyxDQUFDLElBQUksQ0FBQztZQUNqQyxVQUFVLEdBQUcsSUFBSSxFQUFFLFFBQVE7Z0JBQ3ZCLENBQUMsQ0FBQyxJQUFJLENBQUMsUUFBUTtnQkFDZixDQUFDLENBQUM7b0JBQ0ksYUFBYSxFQUFFLFlB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BvcHRzLmRhdGVPcHRzXG4gICAgICAgICAgICAgICAgOiB7XG4gICAgICAgICAgICAgICAgICAgICAgZGlzcGxheUZvcm1hdDogJ2RkLk1NLllZWVknLFxuICAgICAgICAgICAgICAgICAgICAgIGFwcGx5RnJvbURpc3BsYXlGb3JtYXQ6IHRydWVcbiAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnZGF0ZXRpbWUnOlxuICAgICAgICBjYXNlICdkYXRlX3RpbWUnOlxuICAgICAgICBjYXNlICdkYXRlLXRpbWUnOlxuICAgICAgICAgICAgZmlsdGVyVHlwZSA9IEZpbHRlclR5cGVFbnVtLkRhdGU7XG4gICAgICAgICAgICByZXR1cm5PcHRzID0gb3B0cz8uZGF0ZU9wdHMgPyBvcHRzLmRhdGVPcHRzIDoge2Rpc3BsYXlGb3JtYXQ6ICdkZC5NTS5ZWVlZIEhIOm1tJywgYXBwbHlGcm9tRGlzcGxheUZvcm1hdDogdHJ1ZX07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnc3RyaW5nJzpcbiAgICAgICAgY2FzZSAndGV4dCc6XG4gICAgICAgICAgICBmaWx0ZXJUeXBlID0gRmlsdGVyVHlwZUVudW0uU3RyaW5nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgJ2VudW0nOlxuICAgICAgICAgICAgZmlsdGVyVHlwZSA9IEZpbHRlclR5cGVFbnVtLkxvb2t1cEVudW07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnYm9vbGVhbic6XG4gICAgICAgIGNhc2UgJ2Jvb2wnOlxuICAgICAgICAgICAgZmlsdGVyVHlwZSA9IEZpbHRlclR5cGVFbnVtLkJvb2xlYW47XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnZmxvYXQnOlxuICAgICAgICBjYXNlICdkb3VibGUnOlxuICAgICAgICBjYXNlICdkZWNpbWFsJzpcb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gICAgfSlcbiAgICAgICAgKTtcbiAgICB9XG59XG4iXX0=
@@ -1 +1 @@
1
- {"version":3,"file":"mediusinc-mng-commons-data-api-tableview.mjs","sources":["../../tableview/src/tableview-get-all-params-create.ts","../../tableview/src/schema/enum-from-schema.ts","../../tableview/src/schema/internal/common-from-schema.ts","../../tableview/src/schema/columns-from-schema.ts","../../tableview/src/schema/fields-from-schema.ts","../../tableview/src/filter/generic-filters.ts","../../tableview/src/mediusinc-mng-commons-data-api-tableview.ts"],"sourcesContent":["import {Injector, inject} from '@angular/core';\n\nimport {Observable} from 'rxjs';\n\nimport {\n ApiServiceGetAllFilterType,\n ExtractGetAllParamsFilterType,\n ExtractGetAllParamsSortType,\n GetAllParamsDefaultWoFiltersType,\n apiServiceGetAll\n} from '@mediusinc/mng-commons-data-api';\nimport {ClassFunctionKeysWithAnyArgsAndReturnType, ServiceClassType} from '@mediusinc/mng-commons/core';\nimport {ModelDescriptor, TypeDescriptor} from '@mediusinc/mng-commons/model';\nimport {TableviewDataProviderInst, TableviewDescriptorInst, TableviewInputBuilder} from '@mediusinc/mng-commons/tableview/api';\n\n/**\n * Creates a tableview with a given model, service and sorts/filters extracted from Data API Get All request params, service, and optional build function.\n *\n * @param {ModelDescriptor<Model>} model - The model descriptor.\n * @param {ServiceClassType<Service>} service - The class type of the service.\n * @param {TypeDescriptor<RequestParam>} params - The request param of get all request. Filters and sorts will be taken from here.\n * @param {(builder: TableviewBuilder) => void} [buildFn] - The optional callback function to customize the tableview using the prepared builder.\n *\n * @returns A tableview instance with descriptor, data provider and actions.\n */\nexport function tableviewWithGetAllParams<\n Model,\n Service,\n RequestParam extends GetAllParamsDefaultWoFiltersType,\n Sorts = ExtractGetAllParamsSortType<RequestParam>,\n Filters extends keyof any = ExtractGetAllParamsFilterType<RequestParam>\n>(\n model: ModelDescriptor<Model>,\n service: ServiceClassType<Service>,\n params: TypeDescriptor<RequestParam>,\n buildFn?: (\n builder: TableviewInputBuilder<Model, Service, TableviewDescriptorInst<Model, Sorts, Filters>, TableviewDataProviderInst<Model, Service, Sorts, Filters>, Sorts, Filters>\n ) => void\n) {\n const builder = new TableviewInputBuilder<\n Model,\n Service,\n TableviewDescriptorInst<Model, Sorts, Filters>,\n TableviewDataProviderInst<Model, Service, Sorts, Filters>,\n Sorts,\n Filters\n >(new TableviewDescriptorInst<Model, Sorts, Filters>(model), new TableviewDataProviderInst<Model, Service, Sorts, Filters>(undefined, service), inject(Injector));\n buildFn?.(builder);\n return builder.build();\n}\n\n/**\n * Creates a tableview with a given model, service and sorts/filters from API service's provided getAll function.\n *\n * @param {ModelDescriptor<Model>} model - The model descriptor.\n * @param {ServiceClassType<Service>} service - The class type of the service.\n * @param {GetAllFn} getAllFn - The function from service for executing getAll requests. Filters and sorts will be taken from here.\n * @param {(builder: TableviewBuilder) => void} [buildFn] - The optional callback function to customize the tableview using the prepared builder.\n *\n * @returns A tableview instance with descriptor, data provider and actions.\n */\nexport function tableviewWithApiServiceGetAll<\n Model,\n Service,\n GetAllFn extends ClassFunctionKeysWithAnyArgsAndReturnType<Service, Observable<{data?: any[]; totalCount?: number}>>,\n RequestParams extends GetAllParamsDefaultWoFiltersType = ApiServiceGetAllFilterType<Service, GetAllFn>,\n Sorts = ExtractGetAllParamsSortType<RequestParams>,\n Filters extends keyof any = ExtractGetAllParamsFilterType<RequestParams>\n>(\n model: ModelDescriptor<Model>,\n service: ServiceClassType<Service>,\n getAllFn: GetAllFn,\n buildFn?: (\n builder: TableviewInputBuilder<Model, Service, TableviewDescriptorInst<Model, Sorts, Filters>, TableviewDataProviderInst<Model, Service, Sorts, Filters>, Sorts, Filters>\n ) => void\n) {\n const builder = new TableviewInputBuilder<\n Model,\n Service,\n TableviewDescriptorInst<Model, Sorts, Filters>,\n TableviewDataProviderInst<Model, Service, Sorts, Filters>,\n Sorts,\n Filters\n >(new TableviewDescriptorInst<Model, Sorts, Filters>(model), new TableviewDataProviderInst<Model, Service, Sorts, Filters>(undefined, service), inject(Injector));\n builder.withAdjustDataProvider(dataProvider => dataProvider.withGetAll((params, service) => apiServiceGetAll(service, getAllFn as any, params)));\n buildFn?.(builder);\n return builder.build();\n}\n","import {SchemaEnum} from '@mediusinc/mng-commons-data-api';\nimport {EnumDescriptor, enumModelGeneric} from '@mediusinc/mng-commons/model';\n\n/**\n * <em>Experimental:</em> Emulates an enum model object from enum schema.\n *\n * @experimental\n *\n * @param {SchemaEnum<Enum>} enumSchema - The schema of the enum.\n *\n * @returns {EnumDescriptor<Enum>} - The generated enum model descriptor.\n */\nexport function enumModelFromSchema<Enum>(enumSchema: SchemaEnum<Enum>): EnumDescriptor<Enum> {\n const enumObj: Record<string | number, string | number> = {};\n enumSchema.values\n .map((v, idx) => ({value: v, constant: enumSchema.constants[idx]}))\n .forEach(({value, constant}) => {\n const valueAsStrOrInt = value as unknown as string | number;\n enumObj[constant] = valueAsStrOrInt;\n if (typeof valueAsStrOrInt === 'number' && enumObj[valueAsStrOrInt] == null) enumObj[valueAsStrOrInt] = constant;\n });\n return enumModelGeneric<Enum>(enumObj, enumSchema.name.replace(/\\d+$/, ''));\n}\n","export function fromSchemaFilterNonArrayProperties<Model>(propertySchemas: Record<keyof Model, any>): (keyof Model)[] {\n return (Object.keys(propertySchemas) as (keyof Model)[]).filter(key => {\n const propertySchema = propertySchemas[key];\n return ['number', 'string', 'boolean', 'date', 'date-time', 'enum', 'object'].includes(propertySchema.type);\n });\n}\n","import {SchemaEnum, SchemaModel, SchemaProperty} from '@mediusinc/mng-commons-data-api';\nimport {GetterFn} from '@mediusinc/mng-commons/core';\nimport {EnumDescriptor} from '@mediusinc/mng-commons/model';\nimport {ColumnDescriptor, TableDescriptorInst} from '@mediusinc/mng-commons/table/api';\nimport {TableviewDescriptorInst} from '@mediusinc/mng-commons/tableview/api';\n\nimport {enumModelFromSchema} from './enum-from-schema';\nimport {fromSchemaFilterNonArrayProperties} from './internal/common-from-schema';\n\ntype ColumnType = 'number' | 'currency' | 'boolean' | 'string' | 'text' | 'textarea' | 'date' | 'date-time' | 'enum' | 'object';\n\ntype ColumnFromSchemaCommonOptsType<Model> = {\n currencyProperty?: keyof Model;\n currency?: string;\n currencyDisplay?: 'symbol' | 'code' | 'name';\n dateFormat?: string;\n dateTimeFormat?: string;\n numberMinIntegerDigits?: number;\n numberMinFractionDigits?: number;\n numberMaxFractionDigits?: number;\n};\n\ntype ColumnsFromSchemaOptsType<Model = any> = ColumnFromSchemaCommonOptsType<Model> & {\n columnTypes?: Partial<Record<keyof Model, ColumnType>>;\n enumModels?: Partial<Record<keyof Model, EnumDescriptor<any>>>;\n enumSchemas?: Partial<Record<keyof Model, SchemaEnum<any>>>;\n getters?: {[K in keyof Model]?: GetterFn<Model[K], Model>};\n};\n\ntype ColumnFromSchemaOptsType<Column = any, Model = any, Enum = any> = ColumnFromSchemaCommonOptsType<Model> & {\n columnType?: ColumnType;\n getter?: GetterFn<Column, Model>;\n enumModel?: EnumDescriptor<Enum>;\n enumSchema?: SchemaEnum<Enum>;\n};\n\nconst defaultGetter: GetterFn<unknown> = value => {\n if (typeof value === 'object') {\n const valueObj = value as object;\n return (\n valueObj['title' as keyof object] ??\n valueObj['name' as keyof object] ??\n valueObj['naziv' as keyof object] ??\n valueObj['code' as keyof object] ??\n valueObj['sifra' as keyof object] ??\n valueObj['id' as keyof object] ??\n valueObj['uuid' as keyof object] ??\n valueObj[Object.keys(valueObj)[0] as keyof object]\n );\n } else {\n return value;\n }\n};\n\n/**\n * <em>Experimental:</em> Builder for adding columns to table.\n *\n * @experimental\n */\nexport class SchemaColumnsBuilder<Model, SchModel = Model> {\n constructor(\n private readonly descriptor: TableviewDescriptorInst<Model, any, any, any> | TableDescriptorInst<Model, any, any>,\n private readonly schema: SchemaModel<SchModel>,\n private opts?: ColumnsFromSchemaOptsType<SchModel>\n ) {}\n\n private mergeColumnsOpts(property: any, opts?: ColumnsFromSchemaOptsType) {\n return <ColumnFromSchemaOptsType>{\n ...this.opts,\n columnType: this.opts?.columnTypes?.[property as keyof object],\n getter: opts?.getters?.[property] ?? this.opts?.getters?.[property as keyof object],\n enumModel: opts?.enumModels?.[property] ?? this.opts?.enumModels?.[property as keyof object],\n enumSchema: opts?.enumSchemas?.[property] ?? this.opts?.enumSchemas?.[property as keyof object],\n ...opts\n };\n }\n\n private mergeColumnOpts(property: any, opts?: ColumnFromSchemaOptsType) {\n return <ColumnFromSchemaOptsType>{\n ...this.opts,\n columnType: this.opts?.columnTypes?.[property as keyof object],\n getter: this.opts?.getters?.[property as keyof object],\n enumModel: this.opts?.enumModels?.[property as keyof object],\n enumSchema: this.opts?.enumSchemas?.[property as keyof object],\n ...opts\n };\n }\n\n /**\n * <em>Experimental:</em> Adds a single column via {addColumnFromSchema}.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the column for.\n * @param {ColumnFromSchemaOptsType<SchModel[Property], SchModel, any, Model>} opts - Additional options.\n *\n * @return {ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]>} The added column descriptor.\n */\n public add<Property extends Extract<keyof Model, keyof SchModel>>(\n property: Property,\n opts?: ColumnFromSchemaOptsType<SchModel[Property], SchModel, any>\n ): ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]> {\n return addColumnFromSchema(\n this.descriptor,\n property,\n this.schema.properties[property],\n this.mergeColumnOpts(property, opts) as ColumnFromSchemaOptsType<Model[Property], Model, any> | undefined\n ) as unknown as ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]>;\n }\n\n /**\n * <em>Experimental:</em> Adds all columns from the non-array schema properties via {addColumnFromSchema}.\n *\n * @experimental\n *\n * @param {ColumnsFromSchemaOptsType<SchModel>} opts - Additional options.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAddAll(opts?: ColumnsFromSchemaOptsType<SchModel>): this {\n this.addColumns(undefined, opts);\n return this;\n }\n\n /**\n * <em>Experimental:</em> Adds columns for properties via {addColumnFromSchema}.\n *\n * @experimental\n *\n * @param {ColumnsFromSchemaOptsType<SchModel>} opts - Additional options.\n * @param {...Property[]} properties - Properties to add columns for. If non provided, all non-array properties from schema will be added.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAdd<Property extends Extract<keyof Model, keyof SchModel>>(opts: ColumnsFromSchemaOptsType<SchModel>, ...properties: Property[]): this;\n /**\n * <em>Experimental:</em> Adds columns for properties via {addColumnFromSchema}.\n *\n * @experimental\n *\n * @param {...Property[]} properties - Properties to add columns for. If non provided, all non-array properties from schema will be added.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAdd<Property extends Extract<keyof Model, keyof SchModel>>(...properties: Property[]): this;\n public withAdd<Property extends Extract<keyof Model, keyof SchModel>>(propOrOpts: ColumnsFromSchemaOptsType<SchModel> | Property, ...properties: Property[]): this {\n if (typeof propOrOpts === 'object') {\n this.addColumns(properties.length === 0 ? undefined : properties, propOrOpts);\n } else {\n this.addColumns([propOrOpts, ...properties]);\n }\n return this;\n }\n\n /**\n * <em>Experimental:</em> Adds a single column via {addColumnFromSchema} where property schema is manually provided.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the column for.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n * @param {ColumnFromSchemaOptsType} opts - Additional options.\n *\n * @return {ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]>} The added column descriptor.\n */\n public addFromSchema<Property extends keyof Model>(\n property: Property,\n schemaProperty: SchemaProperty,\n opts?: ColumnFromSchemaOptsType<Model[Property], Model>\n ): ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]> {\n return addColumnFromSchema(\n this.descriptor,\n property,\n schemaProperty,\n this.mergeColumnOpts(property, opts) as ColumnFromSchemaOptsType<Model[Property], Model, any> | undefined\n );\n }\n\n private addColumns<Property extends Extract<keyof Model, keyof SchModel>>(properties?: Property[], opts?: ColumnsFromSchemaOptsType<SchModel>) {\n const addProperties = properties ?? fromSchemaFilterNonArrayProperties<SchModel>(this.schema.properties);\n\n if (addProperties) {\n addProperties.forEach(property => {\n addColumnFromSchema(\n this.descriptor,\n property as any,\n this.schema.properties[property],\n this.mergeColumnsOpts(property as unknown as keyof Model, opts) as ColumnFromSchemaOptsType<Model[Property], Model, any> | undefined\n );\n });\n }\n }\n}\n\n/**\n * <em>Experimental:</em> Creates builder for adding columns to descriptor based on provided model schema.\n *\n * @experimental\n *\n * @param {TableviewDescriptorInst<Model, any, any, any> | TableDescriptorInst<Model, any, any>} descriptor - Descriptor to add columns to.\n * @param {SchemaModel<SchModel>} schema - The schema with metadata about properties for fields.\n * @param {ColumnsFromSchemaOptsType<SchModel>} [opts] - Additional options.\n *\n * @return {SchemaColumnsBuilder<Model, SchModel>} - The column schema builder instance.\n */\nexport function columnsFromSchema<Model, SchModel = Model>(\n descriptor: TableviewDescriptorInst<Model, any, any, any> | TableDescriptorInst<Model, any, any>,\n schema: SchemaModel<SchModel>,\n opts?: ColumnsFromSchemaOptsType<SchModel>\n): SchemaColumnsBuilder<Model, SchModel> {\n return new SchemaColumnsBuilder<Model, SchModel>(descriptor, schema, opts);\n}\n\n/**\n * <em>Experimental:</em> Adds a column to table descriptor based on the given schema property and options.\n *\n * @param {TableviewDescriptorInst<Model, any, any, any> | TableDescriptorInst<Model, any, any>} descriptor - The table view descriptor or table descriptor to add the column to.\n * @param {Property} property - The property key of the model to create the column for.\n * @param {SchemaProperty} propertySchema - The schema property for the property.\n * @param {ColumnFromSchemaOptsType<Model[Property], Model, any, Model>} [opts] - The options for the column.\n *\n * @return {ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]>} - The added column descriptor.\n */\nexport function addColumnFromSchema<Property extends keyof Model, Model>(\n descriptor: TableviewDescriptorInst<Model, any, any, any> | TableDescriptorInst<Model, any, any>,\n property: Property,\n propertySchema: SchemaProperty,\n opts?: ColumnFromSchemaOptsType<Model[Property], Model, any>\n): ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]> {\n const propertyType = opts?.columnType ?? propertySchema?.type;\n\n const column = descriptor.addColumn(property);\n\n // Handle different property types\n switch (propertyType) {\n case 'number':\n column.asNumber({\n minFractionDigits: opts?.numberMinFractionDigits,\n maxFractionDigits: opts?.numberMaxFractionDigits,\n minIntegerDigits: opts?.numberMinIntegerDigits\n });\n break;\n case 'boolean':\n column.asBoolean(undefined, undefined, true);\n break;\n case 'date':\n column.asDate(opts?.dateFormat ?? 'dd.MM.YYYY');\n break;\n case 'enum':\n // eslint-disable-next-line no-case-declarations\n const enumModel = opts?.enumSchema ? enumModelFromSchema(opts.enumSchema) : opts?.enumModel;\n if (enumModel) {\n column.asEnumUnsafe(enumModel);\n }\n break;\n case 'date-time':\n column.asDate(opts?.dateTimeFormat ?? 'dd.MM.YYYY HH:mm');\n break;\n case 'currency':\n column.asCurrency({\n currency: opts?.currency,\n currencyDisplay: opts?.currencyDisplay,\n currencyProperty: opts?.currencyProperty,\n minFractionDigits: opts?.numberMinFractionDigits,\n maxFractionDigits: opts?.numberMaxFractionDigits,\n minIntegerDigits: opts?.numberMinIntegerDigits\n });\n break;\n case 'object':\n column.withGetter(defaultGetter);\n break;\n }\n\n // Add optional filter, sort and getters\n if (opts?.getter) column.withGetter(opts?.getter);\n\n return column;\n}\n","import {SchemaEnum, SchemaModel, SchemaProperty} from '@mediusinc/mng-commons-data-api';\nimport {ArrayItemType, CommonsInternalError, KeyofAndOfType, fromAngularDateFormatToPrime} from '@mediusinc/mng-commons/core';\nimport {EnumDescriptor, TypeDescriptor} from '@mediusinc/mng-commons/model';\nimport {ITableDataProvider, TableDescriptorInst} from '@mediusinc/mng-commons/table/api';\nimport {\n AFieldDescriptor,\n EditorDescriptorInst,\n FieldInputDescriptor,\n FieldLookupDescriptor,\n FieldLookupEnumDescriptor,\n FieldLookupProviderType,\n FieldManyEditorDescriptor,\n FieldManyToManyEditorDescriptor,\n TableviewDescriptorInst\n} from '@mediusinc/mng-commons/tableview/api';\n\nimport {enumModelFromSchema} from './enum-from-schema';\nimport {fromSchemaFilterNonArrayProperties} from './internal/common-from-schema';\n\ntype FieldInputType = 'number' | 'currency' | 'boolean' | 'string' | 'text' | 'textarea' | 'date' | 'date-time' | 'enum' | 'hidden';\n\ntype FromSchemaCommonOptsType<Model> = {\n dateFormat?: string;\n dateTimeFormat?: string;\n textareaRows?: number;\n numberUseGrouping?: boolean;\n numberStep?: number;\n numberMinFractionDigits?: number;\n numberMaxFractionDigits?: number;\n currency?: string;\n currencyProperty?: keyof Model;\n currencyDisplay?: 'symbol' | 'code' | 'name';\n};\n\ntype FieldsFromSchemaOptsType<Model = any> = FromSchemaCommonOptsType<Model> & {\n fieldTypes?: Partial<Record<keyof Model, FieldInputType>>;\n enumModels?: Partial<Record<keyof Model, EnumDescriptor<any>>>;\n enumSchemas?: Partial<Record<keyof Model, SchemaEnum<any>>>;\n};\n\ntype FieldInputFromSchemaOptsType<Model = any, Enum = any> = FromSchemaCommonOptsType<Model> & {\n fieldType?: FieldInputType;\n enumSchema?: SchemaEnum<Enum>;\n enumModel?: EnumDescriptor<Enum>;\n};\n\n/**\n * <em>Experimental:</em> Builder for adding fields to editor.\n *\n * @experimental\n */\nexport class SchemaFieldsBuilder<Model, Parent = unknown, SchModel = Model> {\n constructor(\n private readonly descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>,\n private readonly schema: SchemaModel<SchModel>,\n private opts?: FieldsFromSchemaOptsType<SchModel>\n ) {}\n\n private mergeFieldsInputOpts(property: any, opts?: FieldsFromSchemaOptsType) {\n return <FieldInputFromSchemaOptsType>{\n ...this.opts,\n fieldType: opts?.fieldTypes?.[property] ?? this.opts?.fieldTypes?.[property as keyof object],\n enumModel: opts?.enumModels?.[property] ?? this.opts?.enumModels?.[property as keyof object],\n enumSchema: opts?.enumSchemas?.[property] ?? this.opts?.enumSchemas?.[property as keyof object],\n ...opts\n };\n }\n\n private mergeFieldInputOpts(property: any, opts?: FieldInputFromSchemaOptsType) {\n return <FieldInputFromSchemaOptsType>{\n ...this.opts,\n fieldType: this.opts?.fieldTypes?.[property as keyof object],\n enumModel: this.opts?.enumModels?.[property as keyof object],\n enumSchema: this.opts?.enumSchemas?.[property as keyof object],\n ...opts\n };\n }\n\n /**\n * <em>Experimental:</em> Adds a single input field via {addFieldInputFromSchema}.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the field for.\n * @param {FieldInputFromSchemaOptsType<SchModel>} opts - Additional options.\n *\n * @return {FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>} The added field descriptor.\n */\n public add<Property extends Extract<keyof Model, keyof SchModel>>(\n property: Property,\n opts?: FieldInputFromSchemaOptsType<SchModel>\n ): FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent> {\n return addFieldInputFromSchema(\n this.descriptor,\n property,\n this.schema.properties[property],\n this.mergeFieldInputOpts(property, opts) as FieldInputFromSchemaOptsType<Model, any> | undefined\n );\n }\n\n /**\n * <em>Experimental:</em> Adds all input fields for the non-array properties via {addFieldInputFromSchema}.\n *\n * @experimental\n *\n * @param {FieldsFromSchemaOptsType<SchModel>} opts - Additional options.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAddAll(opts?: FieldsFromSchemaOptsType<SchModel>): this {\n this.addFields(undefined, opts);\n return this;\n }\n\n /**\n * <em>Experimental:</em> Adds input fields for properties via {addFieldInputFromSchema}.\n *\n * @experimental\n *\n * @param {FieldsFromSchemaOptsType<SchModel>} opts - Additional options.\n * @param {...Property[]} properties - Properties to add fields for. If non provided, all non-array properties from schema will be added.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAdd<PropertyKey extends Extract<keyof Model, keyof SchModel>>(opts: FieldsFromSchemaOptsType<SchModel>, ...properties: PropertyKey[]): this;\n /**\n * <em>Experimental:</em> Adds fields for properties via {addFieldInputFromSchema}.\n *\n * @experimental\n *\n * @param {...Property[]} properties - Properties to add fields for. If non provided, all non-array properties from schema will be added.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAdd<PropertyKey extends Extract<keyof Model, keyof SchModel>>(...properties: PropertyKey[]): this;\n public withAdd<PropertyKey extends Extract<keyof Model, keyof SchModel>>(propOrOpts: FieldsFromSchemaOptsType<SchModel> | PropertyKey, ...properties: PropertyKey[]): this {\n if (typeof propOrOpts === 'object') {\n this.addFields(properties.length === 0 ? undefined : properties, propOrOpts);\n } else {\n this.addFields(propOrOpts === undefined ? properties : [propOrOpts, ...properties]);\n }\n return this;\n }\n\n private addFields<Property extends Extract<keyof Model, keyof SchModel>>(properties?: Property[], opts?: FieldsFromSchemaOptsType<SchModel>) {\n const addProperties = properties ?? fromSchemaFilterNonArrayProperties(this.schema.properties);\n\n addProperties.forEach(property => {\n addFieldInputFromSchema(\n this.descriptor,\n property as unknown as keyof Model,\n this.schema.properties[property],\n this.mergeFieldsInputOpts(property, opts) as FieldInputFromSchemaOptsType<Model, any> | undefined\n );\n });\n }\n\n /**\n * <em>Experimental:</em> Adds a single input field via {addFieldInputFromSchema} where property schema is manually provided.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the field for.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n * @param {FieldInputFromSchemaOptsType<Model>} opts - Additional options.\n *\n * @return {FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>} The added field descriptor.\n */\n public addFromSchema<Property extends keyof Model>(\n property: Property,\n schemaProperty: SchemaProperty,\n opts?: FieldInputFromSchemaOptsType<Model>\n ): FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent> {\n return addFieldInputFromSchema(this.descriptor, property, schemaProperty, this.mergeFieldInputOpts(property, opts) as FieldInputFromSchemaOptsType<Model, any> | undefined);\n }\n\n /**\n * <em>Experimental:</em> Adds an enum lookup field via {addFieldEnumLookupFromSchema}.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the enum lookup field for.\n * @param {SchemaEnum<Enum> | EnumDescriptor<Enum>} [enumOpt] - The enum schema or the enum model descriptor. If non provided, builder opts will be checked.\n *\n * @returns {FieldLookupEnumDescriptor<Enum, Model, Parent>} - The added field descriptor.\n *\n * @throws {CommonsInternalError} - If no enum metadata is found for the property either from parameter or from builder's opts.\n */\n public addEnum<Property extends Extract<keyof Model, keyof SchModel>, Enum>(\n property: Property,\n enumOpt?: SchemaEnum<Enum> | EnumDescriptor<Enum>\n ): FieldLookupEnumDescriptor<Enum, Model, Parent> {\n if (!enumOpt) {\n enumOpt = this.opts?.enumModels?.[property] ?? this.opts?.enumSchemas?.[property];\n }\n if (!enumOpt) {\n throw new CommonsInternalError(`Enum lookup field for property ${property as string} cannot be added because enum metadata was not provided.`);\n }\n return addFieldEnumLookupFromSchema<Model, Parent, Enum>(this.descriptor, property, enumOpt, this.schema.properties[property]);\n }\n\n /**\n * <em>Experimental:</em> Adds an enum lookup field via {addFieldEnumLookupFromSchema} where property schema is manually provided.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the enum lookup field for.\n * @param {SchemaEnum<Enum> | EnumDescriptor<Enum>} [enumOpt] - The enum schema or the enum model descriptor. If non provided, builder opts will be checked.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @returns {FieldLookupEnumDescriptor<Enum, Model, Parent>} - The added field descriptor.\n *\n * @throws {CommonsInternalError} - If no enum metadata is found for the property either from parameter or from builder's opts.\n */\n public addEnumFromSchema<Property extends keyof Model, Enum>(\n property: Property,\n enumOpt: SchemaEnum<Enum> | EnumDescriptor<Enum> | undefined,\n schemaProperty: SchemaProperty\n ): FieldLookupEnumDescriptor<Enum, Model, Parent> {\n if (!enumOpt) {\n enumOpt = this.opts?.enumModels?.[property] ?? this.opts?.enumSchemas?.[property];\n }\n if (!enumOpt) {\n throw new CommonsInternalError(`Enum lookup field for property ${property as string} cannot be added because enum metadata was not provided.`);\n }\n return addFieldEnumLookupFromSchema(this.descriptor, property, enumOpt, schemaProperty);\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field.\n * {EditorDescriptorInt.addFieldLookup} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n *\n * @return The created lookup field.\n */\n public addLookup<Property extends Extract<keyof Model, keyof SchModel>, LookupModel = NonNullable<Model[Property]>>(property: Property) {\n const field = this.descriptor.addFieldLookup<Property, LookupModel>(property);\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldLookup} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created lookup field.\n */\n public addLookupFromSchema<Property extends keyof Model>(property: Property, schemaProperty: SchemaProperty) {\n const field = this.descriptor.addFieldLookup(property);\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field.\n * {EditorDescriptorInt.addFieldLookupWithOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.\n * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.\n *\n * @return The created lookup field.\n */\n public addLookupWithOptionsValueProperty<\n Property extends Extract<keyof Model, keyof SchModel>,\n LookupModel,\n LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>\n >(property: Property, type: TypeDescriptor<LookupModel>, lookupOptionsValueProperty: LookupValueProperty) {\n const field = this.descriptor.addFieldLookupWithOptionsValueProperty(property, type, lookupOptionsValueProperty);\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldLookupWithOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.\n * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created lookup field.\n */\n public addLookupWithOptionsValuePropertyFromSchema<Property extends keyof Model, LookupModel, LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>>(\n property: Property,\n type: TypeDescriptor<LookupModel>,\n lookupOptionsValueProperty: LookupValueProperty,\n schemaProperty: SchemaProperty\n ) {\n const field = this.descriptor.addFieldLookupWithOptionsValueProperty(property, type, lookupOptionsValueProperty);\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field.\n * {EditorDescriptorInt.addFieldLookupWithProvider} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.\n *\n * @return The created lookup field.\n */\n public addLookupWithProvider<Property extends Extract<keyof Model, keyof SchModel>, Service, LookupModel = NonNullable<Model[Property]>>(\n property: Property,\n provider: FieldLookupProviderType<LookupModel, Service>\n ) {\n const field = this.descriptor.addFieldLookupWithProvider(property, provider);\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldLookupWithProvider} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created lookup field.\n */\n public addLookupWithProviderFromSchema<Property extends keyof Model, Service, LookupModel = NonNullable<Model[Property]>>(\n property: Property,\n provider: FieldLookupProviderType<LookupModel, Service>,\n schemaProperty: SchemaProperty\n ) {\n const field = this.descriptor.addFieldLookupWithProvider(property, provider);\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field.\n * {EditorDescriptorInt.addFieldLookupWithProviderAndOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.\n * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.\n * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.\n *\n * @return The created lookup field.\n */\n addLookupWithProviderAndOptionsValueProperty<\n Property extends Extract<keyof Model, keyof SchModel>,\n Service,\n LookupModel,\n LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>,\n FieldValue = Model[Property]\n >(\n property: Property,\n provider: FieldLookupProviderType<LookupModel, Service>,\n type: TypeDescriptor<LookupModel>,\n lookupOptionsValueProperty: LookupValueProperty\n ): FieldLookupDescriptor<LookupModel, Model, Service, FieldValue, Parent> {\n const field = this.descriptor.addFieldLookupWithProviderAndOptionsValueProperty(property, provider, type, lookupOptionsValueProperty);\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field as FieldLookupDescriptor<LookupModel, Model, Service, FieldValue, Parent>;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldLookupWithProviderAndOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.\n * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.\n * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created lookup field.\n */\n addLookupWithProviderAndOptionsValuePropertyFromSchema<\n Property extends keyof Model,\n Service,\n LookupModel,\n LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>,\n FieldValue = Model[Property]\n >(\n property: Property,\n provider: FieldLookupProviderType<LookupModel, Service>,\n type: TypeDescriptor<LookupModel>,\n lookupOptionsValueProperty: LookupValueProperty,\n schemaProperty: SchemaProperty\n ): FieldLookupDescriptor<LookupModel, Model, Service, FieldValue, Parent> {\n const field = this.descriptor.addFieldLookupWithProviderAndOptionsValueProperty(property, provider, type, lookupOptionsValueProperty);\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field as FieldLookupDescriptor<LookupModel, Model, Service, FieldValue, Parent>;\n }\n\n /**\n * <em>Experimental:</em> Adds a one-to-many editor field.\n * {EditorDescriptorInt.addFieldManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the many editor field for.\n * @param {TableviewDescriptorInst<FieldModel, any, any, Model>} tableviewDescriptor - Tableview descriptor.\n *\n * @return The created one-to-many editor field.\n */\n addManyEditor<Property extends Extract<keyof Model, keyof SchModel>, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(\n property: Property,\n tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, Model>\n ): FieldManyEditorDescriptor<FieldModel, Model, FieldValue, Parent> {\n const field = this.descriptor.addFieldManyEditor<Property, FieldModel, FieldValue>(property, tableviewDescriptor);\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds an one-to-many editor field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the many editor field for.\n * @param {TableviewDescriptorInst<FieldModel, any, any, Model>} tableviewDescriptor - Tableview descriptor.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created one-to-many editor field.\n */\n addManyEditorFromSchema<Property extends keyof Model, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(\n property: Property,\n tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, Model>,\n schemaProperty: SchemaProperty\n ): FieldManyEditorDescriptor<FieldModel, Model, FieldValue, Parent> {\n const field = this.descriptor.addFieldManyEditor<Property, FieldModel, FieldValue>(property, tableviewDescriptor);\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a many-to-many editor field.\n * {EditorDescriptorInt.addFieldManyToManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the many editor field for.\n * @param {TableDescriptorInst<FieldModel>} mainTableDescriptor - Main table descriptor.\n * @param {TableDescriptorInst<FieldModel>} lookupTableDescriptor - Lookup table descriptor.\n * @param {ITableDataProvider<FieldModel, ServiceType>} lookupDataProvider - Lookup data provider.\n *\n * @return The created many-to-many editor field.\n */\n addManyToManyEditor<Property extends Extract<keyof Model, keyof SchModel>, ServiceType, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(\n property: Property,\n mainTableDescriptor: TableDescriptorInst<FieldModel>,\n lookupTableDescriptor: TableDescriptorInst<FieldModel>,\n lookupDataProvider: ITableDataProvider<FieldModel, ServiceType>\n ): FieldManyToManyEditorDescriptor<FieldModel, Model, ServiceType, FieldValue, Parent> {\n const field = this.descriptor.addFieldManyToManyEditor<Property, ServiceType, FieldModel, FieldValue>(\n property,\n mainTableDescriptor,\n lookupTableDescriptor,\n lookupDataProvider\n );\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a many-to-many editor field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldManyToManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the many editor field for.\n * @param {TableDescriptorInst<FieldModel>} mainTableDescriptor - Main table descriptor.\n * @param {TableDescriptorInst<FieldModel>} lookupTableDescriptor - Lookup table descriptor.\n * @param {ITableDataProvider<FieldModel, ServiceType>} lookupDataProvider - Lookup data provider.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created many-to-many editor field.\n */\n addManyToManyEditorFromSchema<Property extends keyof Model, ServiceType, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(\n property: Property,\n mainTableDescriptor: TableDescriptorInst<FieldModel>,\n lookupTableDescriptor: TableDescriptorInst<FieldModel>,\n lookupDataProvider: ITableDataProvider<FieldModel, ServiceType>,\n schemaProperty: SchemaProperty\n ): FieldManyToManyEditorDescriptor<FieldModel, Model, ServiceType, FieldValue, Parent> {\n const field = this.descriptor.addFieldManyToManyEditor<Property, ServiceType, FieldModel, FieldValue>(\n property,\n mainTableDescriptor,\n lookupTableDescriptor,\n lookupDataProvider\n );\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field;\n }\n}\n\n/**\n * <em>Experimental:</em> Creates builder for adding fields to descriptor based on provided model schema.\n *\n * @experimental\n *\n * @param {TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>} descriptor - Descriptor to add fields to.\n * @param {SchemaModel<SchModel>} schema - The schema with metadata about properties for fields.\n * @param {FieldsFromSchemaOptsType<SchModel>} [opts] - Additional options.\n *\n * @return {SchemaFieldsBuilder<Model, Parent, SchModel>} - The SchemaFieldsBuilder object containing the extracted fields.\n */\nexport function fieldsFromSchema<Model, Parent = unknown, SchModel = Model>(\n descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>,\n schema: SchemaModel<SchModel>,\n opts?: FieldsFromSchemaOptsType<SchModel>\n): SchemaFieldsBuilder<Model, Parent, SchModel> {\n return new SchemaFieldsBuilder<Model, Parent, SchModel>(descriptor, schema, opts);\n}\n\n/**\n * <em>Experimental:</em> Adds a field input to editor descriptor based on the given schema property and options.\n *\n * @experimental\n *\n * @param {TableviewDescriptorInst | EditorDescriptorInst} descriptor - Descriptor to add field to.\n * @param {keyof Model} property - The property of the model.\n * @param {SchemaProperty} propertySchema - The property's schema for the field.\n * @param {FieldInputFromSchemaOptsType<Model>} [opts] - Additional options.\n *\n * @return {FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>} - The generated field input descriptor.\n */\nexport function addFieldInputFromSchema<Property extends keyof Model, Model, Parent = unknown>(\n descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>,\n property: Property,\n propertySchema: SchemaProperty,\n opts?: FieldInputFromSchemaOptsType<Model>\n): FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent> {\n const propertyType = opts?.fieldType ?? propertySchema.type;\n\n const field = new FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>(property as string);\n if (descriptor instanceof TableviewDescriptorInst) {\n descriptor.detailsEditor.addFieldDescriptor(field);\n descriptor.editEditor.addFieldDescriptor(field);\n descriptor.addEditor.addFieldDescriptor(field);\n } else {\n descriptor.addFieldDescriptor(field);\n }\n\n // Handle different property types\n switch (propertyType as FieldInputType) {\n case 'number':\n field.asNumber();\n break;\n case 'currency':\n field.asCurrency({\n currency: opts?.currency,\n currencyDisplay: opts?.currencyDisplay,\n currencyProperty: opts?.currencyProperty\n });\n break;\n case 'boolean':\n field.asSwitch();\n break;\n case 'text':\n case 'string':\n field.asText();\n break;\n case 'textarea':\n field.asTextarea();\n break;\n case 'date':\n field.asDatePicker({format: opts?.dateFormat ? fromAngularDateFormatToPrime(opts.dateFormat) : undefined});\n break;\n case 'date-time':\n field.asDatePicker({showTime: true, format: opts?.dateTimeFormat ? fromAngularDateFormatToPrime(opts.dateTimeFormat) : undefined});\n break;\n case 'enum':\n // eslint-disable-next-line no-case-declarations\n const enumModel = opts?.enumSchema ? enumModelFromSchema(opts.enumSchema) : opts?.enumModel;\n if (enumModel) {\n field.asRadioFromEnum(enumModel);\n } else {\n field.asText();\n }\n break;\n case 'hidden':\n field.asHidden();\n break;\n }\n\n // Handle different property validations\n if (propertyType === 'number' || propertyType === 'currency') {\n field.withNumberValidation({\n min: propertySchema.exclusiveMinimum && propertySchema.minimum != undefined ? propertySchema.minimum + (propertySchema.isInteger ? 1 : 0.0001) : propertySchema.minimum,\n max: propertySchema.exclusiveMaximum && propertySchema.maximum != undefined ? propertySchema.maximum - (propertySchema.isInteger ? 1 : 0.0001) : propertySchema.maximum,\n step: opts?.numberStep\n });\n if (opts?.numberUseGrouping) {\n field.withNumberGrouping();\n }\n if (opts?.numberMinFractionDigits != null || opts?.numberMaxFractionDigits != null) {\n field.withNumberFractions({\n minFractionDigits: opts?.numberMinFractionDigits,\n maxFractionDigits: opts?.numberMaxFractionDigits\n });\n }\n }\n\n if (propertyType === 'string' || propertyType === 'textarea' || propertyType === 'text') {\n field.withTextValidation({\n minLength: propertySchema.minLength,\n maxLength: propertySchema.maxLength,\n pattern: propertySchema.pattern ? new RegExp(propertySchema.pattern.slice(1, -1)) : undefined\n });\n\n if (propertyType === 'textarea' && opts?.textareaRows != null) {\n field.withTextareaRows(opts.textareaRows);\n }\n if (propertyType !== 'textarea' && propertySchema.isEmail) {\n field.withTextValidationEmail();\n }\n }\n\n setFieldBasicOptionsFromSchema(field, propertySchema);\n\n return field;\n}\n\n/**\n * <em>Experimental:</em> Adds a field enum lookup to editor descriptor based on the given schema property and options.\n *\n * @experimental\n *\n * @param {TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>} descriptor - Descriptor to add field to.\n * @param {keyof Model} property - The property of the model.\n * @param {SchemaEnum<Enum> | EnumDescriptor<Enum>} enumOpt - The enum schema or enum model descriptor.\n * @param {SchemaProperty} propertySchema - The property's schema for the field.\n *\n * @returns {FieldLookupEnum<Enum>} - The field with enumeration values.\n */\nexport function addFieldEnumLookupFromSchema<Model, Parent = unknown, Enum = any>(\n descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>,\n property: keyof Model,\n enumOpt: SchemaEnum<Enum> | EnumDescriptor<Enum>,\n propertySchema: SchemaProperty\n) {\n const enumDescriptor = enumOpt instanceof EnumDescriptor ? enumOpt : enumModelFromSchema(enumOpt);\n const field = descriptor.addFieldLookupEnumUnsafe<Enum>(property as string, enumDescriptor);\n setFieldBasicOptionsFromSchema(field, propertySchema);\n return field;\n}\n\n/**\n * <em>Experimental:</em> Sets basic options for a field based on a given property schema.\n *\n * @param {AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>} field - The field to set options for.\n * @param {SchemaProperty} propertySchema - The property schema to base the options on.\n */\nexport function setFieldBasicOptionsFromSchema<FieldModel = any, EditorModel = any, FieldValue = FieldModel, ParentEditorModel = undefined>(\n field: AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>,\n propertySchema: SchemaProperty\n): void {\n if (propertySchema.required) field.withRequired();\n if (propertySchema.isReadOnly) field.withDisabled();\n}\n","import {Type} from '@angular/core';\n\nimport {Observable, OperatorFunction} from 'rxjs';\n\nimport {ClassFunctionKeysWithParamAndReturnType, ClassFunctionKeysWithReturnType, ItemOrObservable, toObservable, valueToDefined} from '@mediusinc/mng-commons/core';\nimport {FilterDateOptsType, FilterGenericProperty, FilterNumberOptsType, FilterTypeEnum} from '@mediusinc/mng-commons/filter';\nimport {LookupDataProviderInst, lookupDataProviderWithService} from '@mediusinc/mng-commons/form/api';\n\nexport interface FilterGenericPropertyOptsType {\n numberOpts?: FilterNumberOptsType;\n dateOpts?: FilterDateOptsType;\n}\n\n/**\n * Maps a property type to its corresponding filter type enum and applies default\n * filter options if no custom options are provided. If the property type is not recognized,\n * it returns a filter type value of null.\n *\n * @param propertyType - The property type to convert.\n * @param [opts] - The custom options to use for conversion.\n */\nexport function convertPropertyTypeToFilterType(\n propertyType?: string,\n opts?: FilterGenericPropertyOptsType\n): {filterType: FilterTypeEnum | null; opts?: FilterDateOptsType | FilterNumberOptsType} {\n let filterType: FilterTypeEnum | null;\n let returnOpts: FilterDateOptsType | FilterNumberOptsType | undefined;\n\n switch (propertyType?.toLowerCase()) {\n case 'date':\n filterType = FilterTypeEnum.Date;\n returnOpts = opts?.dateOpts\n ? opts.dateOpts\n : {\n displayFormat: 'dd.MM.YYYY',\n applyFromDisplayFormat: true\n };\n break;\n case 'datetime':\n case 'date_time':\n case 'date-time':\n filterType = FilterTypeEnum.Date;\n returnOpts = opts?.dateOpts ? opts.dateOpts : {displayFormat: 'dd.MM.YYYY HH:mm', applyFromDisplayFormat: true};\n break;\n case 'string':\n case 'text':\n filterType = FilterTypeEnum.String;\n break;\n case 'enum':\n filterType = FilterTypeEnum.LookupEnum;\n break;\n case 'boolean':\n case 'bool':\n filterType = FilterTypeEnum.Boolean;\n break;\n case 'float':\n case 'double':\n case 'decimal':\n filterType = FilterTypeEnum.Number;\n returnOpts = opts?.numberOpts ? opts.numberOpts : {displayFormat: '1.1-30'};\n break;\n case 'integer':\n case 'int':\n case 'long':\n filterType = FilterTypeEnum.Number;\n returnOpts = opts?.numberOpts;\n break;\n default:\n filterType = null;\n }\n\n return {filterType, opts: returnOpts};\n}\n\ntype FilterGenericPropertiesMetadataType = {[key: string]: string | undefined};\n\n/**\n * Converts an object of properties and types into an array of filterable properties with the corresponding filter types and options.\n * @param properties - The object containing the properties.\n * @param [opts] - Custom filter options.\n */\nexport function convertPropertyToFilterGenericProperties(properties: FilterGenericPropertiesMetadataType, opts?: FilterGenericPropertyOptsType): FilterGenericProperty[] {\n return Object.keys(properties).reduce<Array<FilterGenericProperty>>((filterableProperties, key) => {\n const {filterType, opts: filterOpts} = convertPropertyTypeToFilterType(properties[key], opts);\n if (filterType !== null) {\n filterableProperties.push({\n property: key,\n type: filterType,\n opts: filterOpts\n });\n }\n return filterableProperties;\n }, []);\n}\n\n/**\n * Maps an Observable of properties to filter generic properties.\n */\nexport function mapToFilterGenericProperties(opts?: FilterGenericPropertyOptsType): OperatorFunction<FilterGenericPropertiesMetadataType, FilterGenericProperty[]> {\n return function <Item>(source: Observable<FilterGenericPropertiesMetadataType>): Observable<FilterGenericProperty[]> {\n return new Observable(subscriber => {\n return source.subscribe({\n next(value) {\n subscriber.next(convertPropertyToFilterGenericProperties(value, opts));\n },\n error: err => {\n subscriber.error(err);\n }\n });\n });\n };\n}\n\ntype FilterPropertyLookupFnType<Service> = (service: Service) => ItemOrObservable<FilterGenericPropertiesMetadataType>;\n\n/**\n * Creates a data provider for generic filter properties that can be used with the TableDescriptor's generic filter functionality.\n *\n * @param serviceType - The service to fetch the properties from.\n * @param lookupFn - The name of the service function to call for properties or function impl returning properties.\n * @param [opts] - Optional custom options for filter descriptors, such as date and number formatting.\n */\nexport function filterPropertyLookupProvider<Service>(\n serviceType: Type<Service>,\n lookupFn: FilterPropertyLookupFnType<Service> | ClassFunctionKeysWithReturnType<Service, Observable<FilterGenericPropertiesMetadataType>>,\n opts?: FilterGenericPropertyOptsType\n) {\n if (typeof lookupFn === 'function') {\n return lookupDataProviderWithService<Service, FilterGenericProperty>(serviceType).withLookup((_, service) =>\n toObservable(lookupFn(service)).pipe(mapToFilterGenericProperties(opts))\n );\n } else {\n return lookupDataProviderWithService<Service, FilterGenericProperty>(serviceType).withLookup((_, service) =>\n (service as any)[lookupFn]().pipe(mapToFilterGenericProperties(opts))\n );\n }\n}\n\ntype FilterValueSuggestionLookupFnType<Service> = (service: Service, field: string, search?: string) => ItemOrObservable<string[]>;\n\n/**\n * Creates a data provider for generic filter value suggestions that can be used with the TableDescriptor's generic filter functionality.\n *\n * @param service - The service to use for suggesting filter values.\n * @param lookupFn - The function name of the service to call for suggestion or function impl returning suggestions.\n */\nexport function filterValueSuggestionLookupProvider<Service>(\n service: Type<Service>,\n lookupFn: FilterValueSuggestionLookupFnType<Service> | ClassFunctionKeysWithParamAndReturnType<Service, {field: string; text?: string}, Observable<string[]>>\n): LookupDataProviderInst<string, Service, string, 'field'> {\n if (typeof lookupFn === 'function') {\n return lookupDataProviderWithService<Service, string, string, 'field'>(service).withLookup((params, service, search?) =>\n lookupFn(service, valueToDefined(params?.filters?.['field']?.value) as string, search)\n );\n } else {\n return lookupDataProviderWithService<Service, string, string, 'field'>(service).withLookup((params, service, search?) =>\n (service as any)[lookupFn]({\n field: valueToDefined(params?.filters?.['field']?.value).toString(),\n text: search\n })\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAeA;;;;;;;;;AASG;AACG,SAAU,yBAAyB,CAOrC,KAA6B,EAC7B,OAAkC,EAClC,MAAoC,EACpC,OAES,EAAA;IAET,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAOvC,IAAI,uBAAuB,CAAwB,KAAK,CAAC,EAAE,IAAI,yBAAyB,CAAiC,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAClK,IAAA,OAAO,GAAG,OAAO,CAAC,CAAC;AACnB,IAAA,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;;;;AASG;AACG,SAAU,6BAA6B,CAQzC,KAA6B,EAC7B,OAAkC,EAClC,QAAkB,EAClB,OAES,EAAA;IAET,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAOvC,IAAI,uBAAuB,CAAwB,KAAK,CAAC,EAAE,IAAI,yBAAyB,CAAiC,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAClK,IAAA,OAAO,CAAC,sBAAsB,CAAC,YAAY,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,OAAO,KAAK,gBAAgB,CAAC,OAAO,EAAE,QAAe,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AACjJ,IAAA,OAAO,GAAG,OAAO,CAAC,CAAC;AACnB,IAAA,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC;AAC3B;;ACpFA;;;;;;;;AAQG;AACG,SAAU,mBAAmB,CAAO,UAA4B,E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AO,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAO,KAC/G,OAAe,CAAC,QAAQ,CAAC,CAAC;AACvB,YAAA,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE;AACnE,YAAA,IAAI,EAAE,MAAM;AACf,SAAA,CAAC,CACL,CAAC;KACL;AACL;;AClKA;;AAEG;;;;"}
1
+ {"version":3,"file":"mediusinc-mng-commons-data-api-tableview.mjs","sources":["../../tableview/src/tableview-get-all-params-create.ts","../../tableview/src/schema/enum-from-schema.ts","../../tableview/src/schema/internal/common-from-schema.ts","../../tableview/src/schema/columns-from-schema.ts","../../tableview/src/schema/fields-from-schema.ts","../../tableview/src/filter/generic-filters.ts","../../tableview/src/mediusinc-mng-commons-data-api-tableview.ts"],"sourcesContent":["import {Injector, inject} from '@angular/core';\n\nimport {Observable} from 'rxjs';\n\nimport {\n ApiServiceGetAllFilterType,\n ExtractGetAllParamsFilterType,\n ExtractGetAllParamsSortType,\n GetAllParamsDefaultWoFiltersType,\n apiServiceGetAll\n} from '@mediusinc/mng-commons-data-api';\nimport {ClassFunctionKeysWithAnyArgsAndReturnType, ServiceClassType} from '@mediusinc/mng-commons/core';\nimport {ModelDescriptor, TypeDescriptor} from '@mediusinc/mng-commons/model';\nimport {TableviewDataProviderInst, TableviewDescriptorInst, TableviewInputBuilder} from '@mediusinc/mng-commons/tableview/api';\n\n/**\n * Creates a tableview with a given model, service and sorts/filters extracted from Data API Get All request params, service, and optional build function.\n *\n * @param {ModelDescriptor<Model>} model - The model descriptor.\n * @param {ServiceClassType<Service>} service - The class type of the service.\n * @param {TypeDescriptor<RequestParam>} params - The request param of get all request. Filters and sorts will be taken from here.\n * @param {(builder: TableviewBuilder) => void} [buildFn] - The optional callback function to customize the tableview using the prepared builder.\n *\n * @returns A tableview instance with descriptor, data provider and actions.\n */\nexport function tableviewWithGetAllParams<\n Model,\n Service,\n RequestParam extends GetAllParamsDefaultWoFiltersType,\n Sorts = ExtractGetAllParamsSortType<RequestParam>,\n Filters extends keyof any = ExtractGetAllParamsFilterType<RequestParam>\n>(\n model: ModelDescriptor<Model>,\n service: ServiceClassType<Service>,\n params: TypeDescriptor<RequestParam>,\n buildFn?: (\n builder: TableviewInputBuilder<Model, Service, TableviewDescriptorInst<Model, Sorts, Filters>, TableviewDataProviderInst<Model, Service, Sorts, Filters>, Sorts, Filters>\n ) => void\n) {\n const builder = new TableviewInputBuilder<\n Model,\n Service,\n TableviewDescriptorInst<Model, Sorts, Filters>,\n TableviewDataProviderInst<Model, Service, Sorts, Filters>,\n Sorts,\n Filters\n >(new TableviewDescriptorInst<Model, Sorts, Filters>(model), new TableviewDataProviderInst<Model, Service, Sorts, Filters>(undefined, service), inject(Injector));\n buildFn?.(builder);\n return builder.build();\n}\n\n/**\n * Creates a tableview with a given model, service and sorts/filters from API service's provided getAll function.\n *\n * @param {ModelDescriptor<Model>} model - The model descriptor.\n * @param {ServiceClassType<Service>} service - The class type of the service.\n * @param {GetAllFn} getAllFn - The function from service for executing getAll requests. Filters and sorts will be taken from here.\n * @param {(builder: TableviewBuilder) => void} [buildFn] - The optional callback function to customize the tableview using the prepared builder.\n *\n * @returns A tableview instance with descriptor, data provider and actions.\n */\nexport function tableviewWithApiServiceGetAll<\n Model,\n Service,\n GetAllFn extends ClassFunctionKeysWithAnyArgsAndReturnType<Service, Observable<{data?: any[]; totalCount?: number}>>,\n RequestParams extends GetAllParamsDefaultWoFiltersType = ApiServiceGetAllFilterType<Service, GetAllFn>,\n Sorts = ExtractGetAllParamsSortType<RequestParams>,\n Filters extends keyof any = ExtractGetAllParamsFilterType<RequestParams>\n>(\n model: ModelDescriptor<Model>,\n service: ServiceClassType<Service>,\n getAllFn: GetAllFn,\n buildFn?: (\n builder: TableviewInputBuilder<Model, Service, TableviewDescriptorInst<Model, Sorts, Filters>, TableviewDataProviderInst<Model, Service, Sorts, Filters>, Sorts, Filters>\n ) => void\n) {\n const builder = new TableviewInputBuilder<\n Model,\n Service,\n TableviewDescriptorInst<Model, Sorts, Filters>,\n TableviewDataProviderInst<Model, Service, Sorts, Filters>,\n Sorts,\n Filters\n >(new TableviewDescriptorInst<Model, Sorts, Filters>(model), new TableviewDataProviderInst<Model, Service, Sorts, Filters>(undefined, service), inject(Injector));\n builder.withAdjustDataProvider(dataProvider => dataProvider.withGetAll((params, service) => apiServiceGetAll(service, getAllFn as any, params)));\n buildFn?.(builder);\n return builder.build();\n}\n","import {SchemaEnum} from '@mediusinc/mng-commons-data-api';\nimport {EnumDescriptor, enumModelGeneric} from '@mediusinc/mng-commons/model';\n\n/**\n * <em>Experimental:</em> Emulates an enum model object from enum schema.\n *\n * @experimental\n *\n * @param {SchemaEnum<Enum>} enumSchema - The schema of the enum.\n *\n * @returns {EnumDescriptor<Enum>} - The generated enum model descriptor.\n */\nexport function enumModelFromSchema<Enum>(enumSchema: SchemaEnum<Enum>): EnumDescriptor<Enum> {\n const enumObj: Record<string | number, string | number> = {};\n enumSchema.values\n .map((v, idx) => ({value: v, constant: enumSchema.constants[idx]}))\n .forEach(({value, constant}) => {\n const valueAsStrOrInt = value as unknown as string | number;\n enumObj[constant] = valueAsStrOrInt;\n if (typeof valueAsStrOrInt === 'number' && enumObj[valueAsStrOrInt] == null) enumObj[valueAsStrOrInt] = constant;\n });\n return enumModelGeneric<Enum>(enumObj, enumSchema.name.replace(/\\d+$/, ''));\n}\n","export function fromSchemaFilterNonArrayProperties<Model>(propertySchemas: Record<keyof Model, any>): (keyof Model)[] {\n return (Object.keys(propertySchemas) as (keyof Model)[]).filter(key => {\n const propertySchema = propertySchemas[key];\n return ['number', 'string', 'boolean', 'date', 'date-time', 'enum', 'object'].includes(propertySchema.type);\n });\n}\n","import {SchemaEnum, SchemaModel, SchemaProperty} from '@mediusinc/mng-commons-data-api';\nimport {GetterFn} from '@mediusinc/mng-commons/core';\nimport {EnumDescriptor} from '@mediusinc/mng-commons/model';\nimport {ColumnDescriptor, TableDescriptorInst} from '@mediusinc/mng-commons/table/api';\nimport {TableviewDescriptorInst} from '@mediusinc/mng-commons/tableview/api';\n\nimport {enumModelFromSchema} from './enum-from-schema';\nimport {fromSchemaFilterNonArrayProperties} from './internal/common-from-schema';\n\ntype ColumnType = 'number' | 'currency' | 'boolean' | 'string' | 'text' | 'textarea' | 'date' | 'date-time' | 'enum' | 'object';\n\ntype ColumnFromSchemaCommonOptsType<Model> = {\n currencyProperty?: keyof Model;\n currency?: string;\n currencyDisplay?: 'symbol' | 'code' | 'name';\n dateFormat?: string;\n dateTimeFormat?: string;\n numberMinIntegerDigits?: number;\n numberMinFractionDigits?: number;\n numberMaxFractionDigits?: number;\n};\n\ntype ColumnsFromSchemaOptsType<Model = any> = ColumnFromSchemaCommonOptsType<Model> & {\n columnTypes?: Partial<Record<keyof Model, ColumnType>>;\n enumModels?: Partial<Record<keyof Model, EnumDescriptor<any>>>;\n enumSchemas?: Partial<Record<keyof Model, SchemaEnum<any>>>;\n getters?: {[K in keyof Model]?: GetterFn<Model[K], Model>};\n};\n\ntype ColumnFromSchemaOptsType<Column = any, Model = any, Enum = any> = ColumnFromSchemaCommonOptsType<Model> & {\n columnType?: ColumnType;\n getter?: GetterFn<Column, Model>;\n enumModel?: EnumDescriptor<Enum>;\n enumSchema?: SchemaEnum<Enum>;\n};\n\nconst defaultGetter: GetterFn<unknown> = value => {\n if (typeof value === 'object') {\n const valueObj = value as object;\n return (\n valueObj['title' as keyof object] ??\n valueObj['name' as keyof object] ??\n valueObj['naziv' as keyof object] ??\n valueObj['code' as keyof object] ??\n valueObj['sifra' as keyof object] ??\n valueObj['id' as keyof object] ??\n valueObj['uuid' as keyof object] ??\n valueObj[Object.keys(valueObj)[0] as keyof object]\n );\n } else {\n return value;\n }\n};\n\n/**\n * <em>Experimental:</em> Builder for adding columns to table.\n *\n * @experimental\n */\nexport class SchemaColumnsBuilder<Model, SchModel = Model> {\n constructor(\n private readonly descriptor: TableviewDescriptorInst<Model, any, any, any> | TableDescriptorInst<Model, any, any>,\n private readonly schema: SchemaModel<SchModel>,\n private opts?: ColumnsFromSchemaOptsType<SchModel>\n ) {}\n\n private mergeColumnsOpts(property: any, opts?: ColumnsFromSchemaOptsType) {\n return <ColumnFromSchemaOptsType>{\n ...this.opts,\n columnType: this.opts?.columnTypes?.[property as keyof object],\n getter: opts?.getters?.[property] ?? this.opts?.getters?.[property as keyof object],\n enumModel: opts?.enumModels?.[property] ?? this.opts?.enumModels?.[property as keyof object],\n enumSchema: opts?.enumSchemas?.[property] ?? this.opts?.enumSchemas?.[property as keyof object],\n ...opts\n };\n }\n\n private mergeColumnOpts(property: any, opts?: ColumnFromSchemaOptsType) {\n return <ColumnFromSchemaOptsType>{\n ...this.opts,\n columnType: this.opts?.columnTypes?.[property as keyof object],\n getter: this.opts?.getters?.[property as keyof object],\n enumModel: this.opts?.enumModels?.[property as keyof object],\n enumSchema: this.opts?.enumSchemas?.[property as keyof object],\n ...opts\n };\n }\n\n /**\n * <em>Experimental:</em> Adds a single column via {addColumnFromSchema}.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the column for.\n * @param {ColumnFromSchemaOptsType<SchModel[Property], SchModel, any, Model>} opts - Additional options.\n *\n * @return {ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]>} The added column descriptor.\n */\n public add<Property extends Extract<keyof Model, keyof SchModel>>(\n property: Property,\n opts?: ColumnFromSchemaOptsType<SchModel[Property], SchModel, any>\n ): ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]> {\n return addColumnFromSchema(\n this.descriptor,\n property,\n this.schema.properties[property],\n this.mergeColumnOpts(property, opts) as ColumnFromSchemaOptsType<Model[Property], Model, any> | undefined\n ) as unknown as ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]>;\n }\n\n /**\n * <em>Experimental:</em> Adds all columns from the non-array schema properties via {addColumnFromSchema}.\n *\n * @experimental\n *\n * @param {ColumnsFromSchemaOptsType<SchModel>} opts - Additional options.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAddAll(opts?: ColumnsFromSchemaOptsType<SchModel>): this {\n this.addColumns(undefined, opts);\n return this;\n }\n\n /**\n * <em>Experimental:</em> Adds columns for properties via {addColumnFromSchema}.\n *\n * @experimental\n *\n * @param {ColumnsFromSchemaOptsType<SchModel>} opts - Additional options.\n * @param {...Property[]} properties - Properties to add columns for. If non provided, all non-array properties from schema will be added.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAdd<Property extends Extract<keyof Model, keyof SchModel>>(opts: ColumnsFromSchemaOptsType<SchModel>, ...properties: Property[]): this;\n /**\n * <em>Experimental:</em> Adds columns for properties via {addColumnFromSchema}.\n *\n * @experimental\n *\n * @param {...Property[]} properties - Properties to add columns for. If non provided, all non-array properties from schema will be added.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAdd<Property extends Extract<keyof Model, keyof SchModel>>(...properties: Property[]): this;\n public withAdd<Property extends Extract<keyof Model, keyof SchModel>>(propOrOpts: ColumnsFromSchemaOptsType<SchModel> | Property, ...properties: Property[]): this {\n if (typeof propOrOpts === 'object') {\n this.addColumns(properties.length === 0 ? undefined : properties, propOrOpts);\n } else {\n this.addColumns([propOrOpts, ...properties]);\n }\n return this;\n }\n\n /**\n * <em>Experimental:</em> Adds a single column via {addColumnFromSchema} where property schema is manually provided.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the column for.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n * @param {ColumnFromSchemaOptsType} opts - Additional options.\n *\n * @return {ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]>} The added column descriptor.\n */\n public addFromSchema<Property extends keyof Model>(\n property: Property,\n schemaProperty: SchemaProperty,\n opts?: ColumnFromSchemaOptsType<Model[Property], Model>\n ): ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]> {\n return addColumnFromSchema(\n this.descriptor,\n property,\n schemaProperty,\n this.mergeColumnOpts(property, opts) as ColumnFromSchemaOptsType<Model[Property], Model, any> | undefined\n );\n }\n\n private addColumns<Property extends Extract<keyof Model, keyof SchModel>>(properties?: Property[], opts?: ColumnsFromSchemaOptsType<SchModel>) {\n const addProperties = properties ?? fromSchemaFilterNonArrayProperties<SchModel>(this.schema.properties);\n\n if (addProperties) {\n addProperties.forEach(property => {\n addColumnFromSchema(\n this.descriptor,\n property as any,\n this.schema.properties[property],\n this.mergeColumnsOpts(property as unknown as keyof Model, opts) as ColumnFromSchemaOptsType<Model[Property], Model, any> | undefined\n );\n });\n }\n }\n}\n\n/**\n * <em>Experimental:</em> Creates builder for adding columns to descriptor based on provided model schema.\n *\n * @experimental\n *\n * @param {TableviewDescriptorInst<Model, any, any, any> | TableDescriptorInst<Model, any, any>} descriptor - Descriptor to add columns to.\n * @param {SchemaModel<SchModel>} schema - The schema with metadata about properties for fields.\n * @param {ColumnsFromSchemaOptsType<SchModel>} [opts] - Additional options.\n *\n * @return {SchemaColumnsBuilder<Model, SchModel>} - The column schema builder instance.\n */\nexport function columnsFromSchema<Model, SchModel = Model>(\n descriptor: TableviewDescriptorInst<Model, any, any, any> | TableDescriptorInst<Model, any, any>,\n schema: SchemaModel<SchModel>,\n opts?: ColumnsFromSchemaOptsType<SchModel>\n): SchemaColumnsBuilder<Model, SchModel> {\n return new SchemaColumnsBuilder<Model, SchModel>(descriptor, schema, opts);\n}\n\n/**\n * <em>Experimental:</em> Adds a column to table descriptor based on the given schema property and options.\n *\n * @param {TableviewDescriptorInst<Model, any, any, any> | TableDescriptorInst<Model, any, any>} descriptor - The table view descriptor or table descriptor to add the column to.\n * @param {Property} property - The property key of the model to create the column for.\n * @param {SchemaProperty} propertySchema - The schema property for the property.\n * @param {ColumnFromSchemaOptsType<Model[Property], Model, any, Model>} [opts] - The options for the column.\n *\n * @return {ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]>} - The added column descriptor.\n */\nexport function addColumnFromSchema<Property extends keyof Model, Model>(\n descriptor: TableviewDescriptorInst<Model, any, any, any> | TableDescriptorInst<Model, any, any>,\n property: Property,\n propertySchema: SchemaProperty,\n opts?: ColumnFromSchemaOptsType<Model[Property], Model, any>\n): ColumnDescriptor<NonNullable<Model[Property]>, Model, Model[Property]> {\n const propertyType = opts?.columnType ?? propertySchema?.type;\n\n const column = descriptor.addColumn(property);\n\n // Handle different property types\n switch (propertyType) {\n case 'number':\n column.asNumber({\n minFractionDigits: opts?.numberMinFractionDigits,\n maxFractionDigits: opts?.numberMaxFractionDigits,\n minIntegerDigits: opts?.numberMinIntegerDigits\n });\n break;\n case 'boolean':\n column.asBoolean(undefined, undefined, true);\n break;\n case 'date':\n column.asDate(opts?.dateFormat ?? 'dd.MM.YYYY');\n break;\n case 'enum':\n // eslint-disable-next-line no-case-declarations\n const enumModel = opts?.enumSchema ? enumModelFromSchema(opts.enumSchema) : opts?.enumModel;\n if (enumModel) {\n column.asEnumUnsafe(enumModel);\n }\n break;\n case 'date-time':\n column.asDate(opts?.dateTimeFormat ?? 'dd.MM.YYYY HH:mm');\n break;\n case 'currency':\n column.asCurrency({\n currency: opts?.currency,\n currencyDisplay: opts?.currencyDisplay,\n currencyProperty: opts?.currencyProperty,\n minFractionDigits: opts?.numberMinFractionDigits,\n maxFractionDigits: opts?.numberMaxFractionDigits,\n minIntegerDigits: opts?.numberMinIntegerDigits\n });\n break;\n case 'object':\n column.withGetter(defaultGetter);\n break;\n }\n\n // Add optional filter, sort and getters\n if (opts?.getter) column.withGetter(opts?.getter);\n\n return column;\n}\n","import {SchemaEnum, SchemaModel, SchemaProperty} from '@mediusinc/mng-commons-data-api';\nimport {ArrayItemType, CommonsInternalError, KeyofAndOfType, fromAngularDateFormatToPrime} from '@mediusinc/mng-commons/core';\nimport {EnumDescriptor, TypeDescriptor} from '@mediusinc/mng-commons/model';\nimport {ITableDataProvider, TableDescriptorInst} from '@mediusinc/mng-commons/table/api';\nimport {\n AFieldDescriptor,\n EditorDescriptorInst,\n FieldInputDescriptor,\n FieldLookupDescriptor,\n FieldLookupEnumDescriptor,\n FieldLookupProviderType,\n FieldManyEditorDescriptor,\n FieldManyToManyEditorDescriptor,\n TableviewDescriptorInst\n} from '@mediusinc/mng-commons/tableview/api';\n\nimport {enumModelFromSchema} from './enum-from-schema';\nimport {fromSchemaFilterNonArrayProperties} from './internal/common-from-schema';\n\ntype FieldInputType = 'number' | 'currency' | 'boolean' | 'string' | 'text' | 'textarea' | 'date' | 'date-time' | 'enum' | 'hidden';\n\ntype FromSchemaCommonOptsType<Model> = {\n dateFormat?: string;\n dateTimeFormat?: string;\n textareaRows?: number;\n numberUseGrouping?: boolean;\n numberStep?: number;\n numberMinFractionDigits?: number;\n numberMaxFractionDigits?: number;\n currency?: string;\n currencyProperty?: keyof Model;\n currencyDisplay?: 'symbol' | 'code' | 'name';\n};\n\ntype FieldsFromSchemaOptsType<Model = any> = FromSchemaCommonOptsType<Model> & {\n fieldTypes?: Partial<Record<keyof Model, FieldInputType>>;\n enumModels?: Partial<Record<keyof Model, EnumDescriptor<any>>>;\n enumSchemas?: Partial<Record<keyof Model, SchemaEnum<any>>>;\n};\n\ntype FieldInputFromSchemaOptsType<Model = any, Enum = any> = FromSchemaCommonOptsType<Model> & {\n fieldType?: FieldInputType;\n enumSchema?: SchemaEnum<Enum>;\n enumModel?: EnumDescriptor<Enum>;\n};\n\n/**\n * <em>Experimental:</em> Builder for adding fields to editor.\n *\n * @experimental\n */\nexport class SchemaFieldsBuilder<Model, Parent = unknown, SchModel = Model> {\n constructor(\n private readonly descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>,\n private readonly schema: SchemaModel<SchModel>,\n private opts?: FieldsFromSchemaOptsType<SchModel>\n ) {}\n\n private mergeFieldsInputOpts(property: any, opts?: FieldsFromSchemaOptsType) {\n return <FieldInputFromSchemaOptsType>{\n ...this.opts,\n fieldType: opts?.fieldTypes?.[property] ?? this.opts?.fieldTypes?.[property as keyof object],\n enumModel: opts?.enumModels?.[property] ?? this.opts?.enumModels?.[property as keyof object],\n enumSchema: opts?.enumSchemas?.[property] ?? this.opts?.enumSchemas?.[property as keyof object],\n ...opts\n };\n }\n\n private mergeFieldInputOpts(property: any, opts?: FieldInputFromSchemaOptsType) {\n return <FieldInputFromSchemaOptsType>{\n ...this.opts,\n fieldType: this.opts?.fieldTypes?.[property as keyof object],\n enumModel: this.opts?.enumModels?.[property as keyof object],\n enumSchema: this.opts?.enumSchemas?.[property as keyof object],\n ...opts\n };\n }\n\n /**\n * <em>Experimental:</em> Adds a single input field via {addFieldInputFromSchema}.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the field for.\n * @param {FieldInputFromSchemaOptsType<SchModel>} opts - Additional options.\n *\n * @return {FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>} The added field descriptor.\n */\n public add<Property extends Extract<keyof Model, keyof SchModel>>(\n property: Property,\n opts?: FieldInputFromSchemaOptsType<SchModel>\n ): FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent> {\n return addFieldInputFromSchema(\n this.descriptor,\n property,\n this.schema.properties[property],\n this.mergeFieldInputOpts(property, opts) as FieldInputFromSchemaOptsType<Model, any> | undefined\n );\n }\n\n /**\n * <em>Experimental:</em> Adds all input fields for the non-array properties via {addFieldInputFromSchema}.\n *\n * @experimental\n *\n * @param {FieldsFromSchemaOptsType<SchModel>} opts - Additional options.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAddAll(opts?: FieldsFromSchemaOptsType<SchModel>): this {\n this.addFields(undefined, opts);\n return this;\n }\n\n /**\n * <em>Experimental:</em> Adds input fields for properties via {addFieldInputFromSchema}.\n *\n * @experimental\n *\n * @param {FieldsFromSchemaOptsType<SchModel>} opts - Additional options.\n * @param {...Property[]} properties - Properties to add fields for. If non provided, all non-array properties from schema will be added.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAdd<PropertyKey extends Extract<keyof Model, keyof SchModel>>(opts: FieldsFromSchemaOptsType<SchModel>, ...properties: PropertyKey[]): this;\n /**\n * <em>Experimental:</em> Adds fields for properties via {addFieldInputFromSchema}.\n *\n * @experimental\n *\n * @param {...Property[]} properties - Properties to add fields for. If non provided, all non-array properties from schema will be added.\n *\n * @return {this} - The current instance of the builder.\n */\n public withAdd<PropertyKey extends Extract<keyof Model, keyof SchModel>>(...properties: PropertyKey[]): this;\n public withAdd<PropertyKey extends Extract<keyof Model, keyof SchModel>>(propOrOpts: FieldsFromSchemaOptsType<SchModel> | PropertyKey, ...properties: PropertyKey[]): this {\n if (typeof propOrOpts === 'object') {\n this.addFields(properties.length === 0 ? undefined : properties, propOrOpts);\n } else {\n this.addFields(propOrOpts === undefined ? properties : [propOrOpts, ...properties]);\n }\n return this;\n }\n\n private addFields<Property extends Extract<keyof Model, keyof SchModel>>(properties?: Property[], opts?: FieldsFromSchemaOptsType<SchModel>) {\n const addProperties = properties ?? fromSchemaFilterNonArrayProperties(this.schema.properties);\n\n addProperties.forEach(property => {\n addFieldInputFromSchema(\n this.descriptor,\n property as unknown as keyof Model,\n this.schema.properties[property],\n this.mergeFieldsInputOpts(property, opts) as FieldInputFromSchemaOptsType<Model, any> | undefined\n );\n });\n }\n\n /**\n * <em>Experimental:</em> Adds a single input field via {addFieldInputFromSchema} where property schema is manually provided.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the field for.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n * @param {FieldInputFromSchemaOptsType<Model>} opts - Additional options.\n *\n * @return {FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>} The added field descriptor.\n */\n public addFromSchema<Property extends keyof Model>(\n property: Property,\n schemaProperty: SchemaProperty,\n opts?: FieldInputFromSchemaOptsType<Model>\n ): FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent> {\n return addFieldInputFromSchema(this.descriptor, property, schemaProperty, this.mergeFieldInputOpts(property, opts) as FieldInputFromSchemaOptsType<Model, any> | undefined);\n }\n\n /**\n * <em>Experimental:</em> Adds an enum lookup field via {addFieldEnumLookupFromSchema}.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the enum lookup field for.\n * @param {SchemaEnum<Enum> | EnumDescriptor<Enum>} [enumOpt] - The enum schema or the enum model descriptor. If non provided, builder opts will be checked.\n *\n * @returns {FieldLookupEnumDescriptor<Enum, Model, Parent>} - The added field descriptor.\n *\n * @throws {CommonsInternalError} - If no enum metadata is found for the property either from parameter or from builder's opts.\n */\n public addEnum<Property extends Extract<keyof Model, keyof SchModel>, Enum>(\n property: Property,\n enumOpt?: SchemaEnum<Enum> | EnumDescriptor<Enum>\n ): FieldLookupEnumDescriptor<Enum, Model, Parent> {\n if (!enumOpt) {\n enumOpt = this.opts?.enumModels?.[property] ?? this.opts?.enumSchemas?.[property];\n }\n if (!enumOpt) {\n throw new CommonsInternalError(`Enum lookup field for property ${property as string} cannot be added because enum metadata was not provided.`);\n }\n return addFieldEnumLookupFromSchema<Model, Parent, Enum>(this.descriptor, property, enumOpt, this.schema.properties[property]);\n }\n\n /**\n * <em>Experimental:</em> Adds an enum lookup field via {addFieldEnumLookupFromSchema} where property schema is manually provided.\n *\n * @experimental\n *\n * @param {Property} property - The property to add the enum lookup field for.\n * @param {SchemaEnum<Enum> | EnumDescriptor<Enum>} [enumOpt] - The enum schema or the enum model descriptor. If non provided, builder opts will be checked.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @returns {FieldLookupEnumDescriptor<Enum, Model, Parent>} - The added field descriptor.\n *\n * @throws {CommonsInternalError} - If no enum metadata is found for the property either from parameter or from builder's opts.\n */\n public addEnumFromSchema<Property extends keyof Model, Enum>(\n property: Property,\n enumOpt: SchemaEnum<Enum> | EnumDescriptor<Enum> | undefined,\n schemaProperty: SchemaProperty\n ): FieldLookupEnumDescriptor<Enum, Model, Parent> {\n if (!enumOpt) {\n enumOpt = this.opts?.enumModels?.[property] ?? this.opts?.enumSchemas?.[property];\n }\n if (!enumOpt) {\n throw new CommonsInternalError(`Enum lookup field for property ${property as string} cannot be added because enum metadata was not provided.`);\n }\n return addFieldEnumLookupFromSchema(this.descriptor, property, enumOpt, schemaProperty);\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field.\n * {EditorDescriptorInt.addFieldLookup} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n *\n * @return The created lookup field.\n */\n public addLookup<Property extends Extract<keyof Model, keyof SchModel>, LookupModel = NonNullable<Model[Property]>>(property: Property) {\n const field = this.descriptor.addFieldLookup<Property, LookupModel>(property);\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldLookup} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created lookup field.\n */\n public addLookupFromSchema<Property extends keyof Model>(property: Property, schemaProperty: SchemaProperty) {\n const field = this.descriptor.addFieldLookup(property);\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field.\n * {EditorDescriptorInt.addFieldLookupWithOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.\n * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.\n *\n * @return The created lookup field.\n */\n public addLookupWithOptionsValueProperty<\n Property extends Extract<keyof Model, keyof SchModel>,\n LookupModel,\n LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>\n >(property: Property, type: TypeDescriptor<LookupModel>, lookupOptionsValueProperty: LookupValueProperty) {\n const field = this.descriptor.addFieldLookupWithOptionsValueProperty(property, type, lookupOptionsValueProperty);\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldLookupWithOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.\n * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created lookup field.\n */\n public addLookupWithOptionsValuePropertyFromSchema<Property extends keyof Model, LookupModel, LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>>(\n property: Property,\n type: TypeDescriptor<LookupModel>,\n lookupOptionsValueProperty: LookupValueProperty,\n schemaProperty: SchemaProperty\n ) {\n const field = this.descriptor.addFieldLookupWithOptionsValueProperty(property, type, lookupOptionsValueProperty);\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field.\n * {EditorDescriptorInt.addFieldLookupWithProvider} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.\n *\n * @return The created lookup field.\n */\n public addLookupWithProvider<Property extends Extract<keyof Model, keyof SchModel>, Service, LookupModel = NonNullable<Model[Property]>>(\n property: Property,\n provider: FieldLookupProviderType<LookupModel, Service>\n ) {\n const field = this.descriptor.addFieldLookupWithProvider(property, provider);\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldLookupWithProvider} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created lookup field.\n */\n public addLookupWithProviderFromSchema<Property extends keyof Model, Service, LookupModel = NonNullable<Model[Property]>>(\n property: Property,\n provider: FieldLookupProviderType<LookupModel, Service>,\n schemaProperty: SchemaProperty\n ) {\n const field = this.descriptor.addFieldLookupWithProvider(property, provider);\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field.\n * {EditorDescriptorInt.addFieldLookupWithProviderAndOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.\n * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.\n * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.\n *\n * @return The created lookup field.\n */\n addLookupWithProviderAndOptionsValueProperty<\n Property extends Extract<keyof Model, keyof SchModel>,\n Service,\n LookupModel,\n LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>,\n FieldValue = Model[Property]\n >(\n property: Property,\n provider: FieldLookupProviderType<LookupModel, Service>,\n type: TypeDescriptor<LookupModel>,\n lookupOptionsValueProperty: LookupValueProperty\n ): FieldLookupDescriptor<LookupModel, Model, Service, FieldValue, Parent> {\n const field = this.descriptor.addFieldLookupWithProviderAndOptionsValueProperty(property, provider, type, lookupOptionsValueProperty);\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field as FieldLookupDescriptor<LookupModel, Model, Service, FieldValue, Parent>;\n }\n\n /**\n * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldLookupWithProviderAndOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the lookup field for.\n * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.\n * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.\n * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created lookup field.\n */\n addLookupWithProviderAndOptionsValuePropertyFromSchema<\n Property extends keyof Model,\n Service,\n LookupModel,\n LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>,\n FieldValue = Model[Property]\n >(\n property: Property,\n provider: FieldLookupProviderType<LookupModel, Service>,\n type: TypeDescriptor<LookupModel>,\n lookupOptionsValueProperty: LookupValueProperty,\n schemaProperty: SchemaProperty\n ): FieldLookupDescriptor<LookupModel, Model, Service, FieldValue, Parent> {\n const field = this.descriptor.addFieldLookupWithProviderAndOptionsValueProperty(property, provider, type, lookupOptionsValueProperty);\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field as FieldLookupDescriptor<LookupModel, Model, Service, FieldValue, Parent>;\n }\n\n /**\n * <em>Experimental:</em> Adds a one-to-many editor field.\n * {EditorDescriptorInt.addFieldManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the many editor field for.\n * @param {TableviewDescriptorInst<FieldModel, any, any, Model>} tableviewDescriptor - Tableview descriptor.\n *\n * @return The created one-to-many editor field.\n */\n addManyEditor<Property extends Extract<keyof Model, keyof SchModel>, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(\n property: Property,\n tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, Model>\n ): FieldManyEditorDescriptor<FieldModel, Model, FieldValue, Parent> {\n const field = this.descriptor.addFieldManyEditor<Property, FieldModel, FieldValue>(property, tableviewDescriptor);\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds an one-to-many editor field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the many editor field for.\n * @param {TableviewDescriptorInst<FieldModel, any, any, Model>} tableviewDescriptor - Tableview descriptor.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created one-to-many editor field.\n */\n addManyEditorFromSchema<Property extends keyof Model, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(\n property: Property,\n tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, Model>,\n schemaProperty: SchemaProperty\n ): FieldManyEditorDescriptor<FieldModel, Model, FieldValue, Parent> {\n const field = this.descriptor.addFieldManyEditor<Property, FieldModel, FieldValue>(property, tableviewDescriptor);\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a many-to-many editor field.\n * {EditorDescriptorInt.addFieldManyToManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the many editor field for.\n * @param {TableDescriptorInst<FieldModel>} mainTableDescriptor - Main table descriptor.\n * @param {TableDescriptorInst<FieldModel>} lookupTableDescriptor - Lookup table descriptor.\n * @param {ITableDataProvider<FieldModel, ServiceType>} lookupDataProvider - Lookup data provider.\n *\n * @return The created many-to-many editor field.\n */\n addManyToManyEditor<Property extends Extract<keyof Model, keyof SchModel>, ServiceType, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(\n property: Property,\n mainTableDescriptor: TableDescriptorInst<FieldModel>,\n lookupTableDescriptor: TableDescriptorInst<FieldModel>,\n lookupDataProvider: ITableDataProvider<FieldModel, ServiceType>\n ): FieldManyToManyEditorDescriptor<FieldModel, Model, ServiceType, FieldValue, Parent> {\n const field = this.descriptor.addFieldManyToManyEditor<Property, ServiceType, FieldModel, FieldValue>(\n property,\n mainTableDescriptor,\n lookupTableDescriptor,\n lookupDataProvider\n );\n setFieldBasicOptionsFromSchema(field, this.schema.properties[property]);\n return field;\n }\n\n /**\n * <em>Experimental:</em> Adds a many-to-many editor field where property schema is manually provided.\n * {EditorDescriptorInt.addFieldManyToManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.\n *\n * @experimental\n *\n * @param {Property} property - The property to create the many editor field for.\n * @param {TableDescriptorInst<FieldModel>} mainTableDescriptor - Main table descriptor.\n * @param {TableDescriptorInst<FieldModel>} lookupTableDescriptor - Lookup table descriptor.\n * @param {ITableDataProvider<FieldModel, ServiceType>} lookupDataProvider - Lookup data provider.\n * @param {SchemaProperty} schemaProperty - Manually provided schema property.\n *\n * @return The created many-to-many editor field.\n */\n addManyToManyEditorFromSchema<Property extends keyof Model, ServiceType, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(\n property: Property,\n mainTableDescriptor: TableDescriptorInst<FieldModel>,\n lookupTableDescriptor: TableDescriptorInst<FieldModel>,\n lookupDataProvider: ITableDataProvider<FieldModel, ServiceType>,\n schemaProperty: SchemaProperty\n ): FieldManyToManyEditorDescriptor<FieldModel, Model, ServiceType, FieldValue, Parent> {\n const field = this.descriptor.addFieldManyToManyEditor<Property, ServiceType, FieldModel, FieldValue>(\n property,\n mainTableDescriptor,\n lookupTableDescriptor,\n lookupDataProvider\n );\n setFieldBasicOptionsFromSchema(field, schemaProperty);\n return field;\n }\n}\n\n/**\n * <em>Experimental:</em> Creates builder for adding fields to descriptor based on provided model schema.\n *\n * @experimental\n *\n * @param {TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>} descriptor - Descriptor to add fields to.\n * @param {SchemaModel<SchModel>} schema - The schema with metadata about properties for fields.\n * @param {FieldsFromSchemaOptsType<SchModel>} [opts] - Additional options.\n *\n * @return {SchemaFieldsBuilder<Model, Parent, SchModel>} - The SchemaFieldsBuilder object containing the extracted fields.\n */\nexport function fieldsFromSchema<Model, Parent = unknown, SchModel = Model>(\n descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>,\n schema: SchemaModel<SchModel>,\n opts?: FieldsFromSchemaOptsType<SchModel>\n): SchemaFieldsBuilder<Model, Parent, SchModel> {\n return new SchemaFieldsBuilder<Model, Parent, SchModel>(descriptor, schema, opts);\n}\n\n/**\n * <em>Experimental:</em> Adds a field input to editor descriptor based on the given schema property and options.\n *\n * @experimental\n *\n * @param {TableviewDescriptorInst | EditorDescriptorInst} descriptor - Descriptor to add field to.\n * @param {keyof Model} property - The property of the model.\n * @param {SchemaProperty} propertySchema - The property's schema for the field.\n * @param {FieldInputFromSchemaOptsType<Model>} [opts] - Additional options.\n *\n * @return {FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>} - The generated field input descriptor.\n */\nexport function addFieldInputFromSchema<Property extends keyof Model, Model, Parent = unknown>(\n descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>,\n property: Property,\n propertySchema: SchemaProperty,\n opts?: FieldInputFromSchemaOptsType<Model>\n): FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent> {\n const propertyType = opts?.fieldType ?? propertySchema.type;\n\n const field = new FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>(property as string);\n if (descriptor instanceof TableviewDescriptorInst) {\n descriptor.detailsEditor.addFieldDescriptor(field);\n descriptor.editEditor.addFieldDescriptor(field);\n descriptor.addEditor.addFieldDescriptor(field);\n } else {\n descriptor.addFieldDescriptor(field);\n }\n\n // Handle different property types\n switch (propertyType as FieldInputType) {\n case 'number':\n field.asNumber();\n break;\n case 'currency':\n field.asCurrency({\n currency: opts?.currency,\n currencyDisplay: opts?.currencyDisplay,\n currencyProperty: opts?.currencyProperty\n });\n break;\n case 'boolean':\n field.asSwitch();\n break;\n case 'text':\n case 'string':\n field.asText();\n break;\n case 'textarea':\n field.asTextarea();\n break;\n case 'date':\n field.asDatePicker({format: opts?.dateFormat ? fromAngularDateFormatToPrime(opts.dateFormat) : undefined});\n break;\n case 'date-time':\n field.asDatePicker({showTime: true, format: opts?.dateTimeFormat ? fromAngularDateFormatToPrime(opts.dateTimeFormat) : undefined});\n break;\n case 'enum':\n // eslint-disable-next-line no-case-declarations\n const enumModel = opts?.enumSchema ? enumModelFromSchema(opts.enumSchema) : opts?.enumModel;\n if (enumModel) {\n field.asRadioFromEnum(enumModel);\n } else {\n field.asText();\n }\n break;\n case 'hidden':\n field.asHidden();\n break;\n }\n\n // Handle different property validations\n if (propertyType === 'number' || propertyType === 'currency') {\n field.withNumberValidation({\n min: propertySchema.exclusiveMinimum && propertySchema.minimum != undefined ? propertySchema.minimum + (propertySchema.isInteger ? 1 : 0.0001) : propertySchema.minimum,\n max: propertySchema.exclusiveMaximum && propertySchema.maximum != undefined ? propertySchema.maximum - (propertySchema.isInteger ? 1 : 0.0001) : propertySchema.maximum,\n step: opts?.numberStep\n });\n if (opts?.numberUseGrouping) {\n field.withNumberGrouping();\n }\n if (opts?.numberMinFractionDigits != null || opts?.numberMaxFractionDigits != null) {\n field.withNumberFractions({\n minFractionDigits: opts?.numberMinFractionDigits,\n maxFractionDigits: opts?.numberMaxFractionDigits\n });\n }\n }\n\n if (propertyType === 'string' || propertyType === 'textarea' || propertyType === 'text') {\n field.withTextValidation({\n minLength: propertySchema.minLength,\n maxLength: propertySchema.maxLength,\n pattern: propertySchema.pattern ? new RegExp(propertySchema.pattern.slice(1, -1)) : undefined\n });\n\n if (propertyType === 'textarea' && opts?.textareaRows != null) {\n field.withTextareaRows(opts.textareaRows);\n }\n if (propertyType !== 'textarea' && propertySchema.isEmail) {\n field.withTextValidationEmail();\n }\n }\n\n setFieldBasicOptionsFromSchema(field, propertySchema);\n\n return field;\n}\n\n/**\n * <em>Experimental:</em> Adds a field enum lookup to editor descriptor based on the given schema property and options.\n *\n * @experimental\n *\n * @param {TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>} descriptor - Descriptor to add field to.\n * @param {keyof Model} property - The property of the model.\n * @param {SchemaEnum<Enum> | EnumDescriptor<Enum>} enumOpt - The enum schema or enum model descriptor.\n * @param {SchemaProperty} propertySchema - The property's schema for the field.\n *\n * @returns {FieldLookupEnum<Enum>} - The field with enumeration values.\n */\nexport function addFieldEnumLookupFromSchema<Model, Parent = unknown, Enum = any>(\n descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model, Parent>,\n property: keyof Model,\n enumOpt: SchemaEnum<Enum> | EnumDescriptor<Enum>,\n propertySchema: SchemaProperty\n) {\n const enumDescriptor = enumOpt instanceof EnumDescriptor ? enumOpt : enumModelFromSchema(enumOpt);\n const field = descriptor.addFieldLookupEnumUnsafe<Enum>(property as string, enumDescriptor);\n setFieldBasicOptionsFromSchema(field, propertySchema);\n return field;\n}\n\n/**\n * <em>Experimental:</em> Sets basic options for a field based on a given property schema.\n *\n * @param {AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>} field - The field to set options for.\n * @param {SchemaProperty} propertySchema - The property schema to base the options on.\n */\nexport function setFieldBasicOptionsFromSchema<FieldModel = any, EditorModel = any, FieldValue = FieldModel, ParentEditorModel = undefined>(\n field: AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>,\n propertySchema: SchemaProperty\n): void {\n if (propertySchema.required) field.withRequired();\n if (propertySchema.isReadOnly) field.withDisabled();\n}\n","import {Type} from '@angular/core';\n\nimport {Observable, OperatorFunction} from 'rxjs';\n\nimport {ClassFunctionKeysWithParamAndReturnType, ClassFunctionKeysWithReturnType, ItemOrObservable, toObservable, valueToDefined} from '@mediusinc/mng-commons/core';\nimport {FilterDateOptsType, FilterGenericProperty, FilterNumberOptsType, FilterTypeEnum} from '@mediusinc/mng-commons/filter';\nimport {LookupDataProviderInst, lookupDataProviderWithService} from '@mediusinc/mng-commons/form/api';\n\nexport interface FilterGenericPropertyOptsType {\n numberOpts?: FilterNumberOptsType;\n dateOpts?: FilterDateOptsType;\n}\n\n/**\n * Maps a property type to its corresponding filter type enum and applies default\n * filter options if no custom options are provided. If the property type is not recognized,\n * it returns a filter type value of null.\n *\n * @param propertyType - The property type to convert.\n * @param [opts] - The custom options to use for conversion.\n */\nexport function convertPropertyTypeToFilterType(\n propertyType?: string,\n opts?: FilterGenericPropertyOptsType\n): {filterType: FilterTypeEnum | null; opts?: FilterDateOptsType | FilterNumberOptsType} {\n let filterType: FilterTypeEnum | null;\n let returnOpts: FilterDateOptsType | FilterNumberOptsType | undefined;\n\n switch (propertyType?.toLowerCase()) {\n case 'date':\n filterType = FilterTypeEnum.Date;\n returnOpts = opts?.dateOpts\n ? opts.dateOpts\n : {\n displayFormat: 'dd.MM.YYYY',\n applyFromDisplayFormat: true\n };\n break;\n case 'datetime':\n case 'date_time':\n case 'date-time':\n filterType = FilterTypeEnum.Date;\n returnOpts = opts?.dateOpts ? opts.dateOpts : {displayFormat: 'dd.MM.YYYY HH:mm', applyFromDisplayFormat: true};\n break;\n case 'string':\n case 'text':\n filterType = FilterTypeEnum.String;\n break;\n case 'enum':\n filterType = FilterTypeEnum.LookupEnum;\n break;\n case 'boolean':\n case 'bool':\n filterType = FilterTypeEnum.Boolean;\n break;\n case 'float':\n case 'double':\n case 'decimal':\n filterType = FilterTypeEnum.Number;\n returnOpts = opts?.numberOpts ? opts.numberOpts : {displayFormat: '1.1-30'};\n break;\n case 'integer':\n case 'int':\n case 'long':\n filterType = FilterTypeEnum.Number;\n returnOpts = opts?.numberOpts;\n break;\n default:\n filterType = null;\n }\n\n return {filterType, opts: returnOpts};\n}\n\ntype FilterGenericPropertiesMetadataType = {[key: string]: string | undefined};\n\n/**\n * Converts an object of properties and types into an array of filterable properties with the corresponding filter types and options.\n * @param properties - The object containing the properties.\n * @param [opts] - Custom filter options.\n */\nexport function convertPropertyToFilterGenericProperties(properties: FilterGenericPropertiesMetadataType, opts?: FilterGenericPropertyOptsType): FilterGenericProperty[] {\n return Object.keys(properties).reduce<Array<FilterGenericProperty>>((filterableProperties, key) => {\n const {filterType, opts: filterOpts} = convertPropertyTypeToFilterType(properties[key], opts);\n if (filterType !== null) {\n filterableProperties.push({\n property: key,\n type: filterType,\n opts: filterOpts\n });\n }\n return filterableProperties;\n }, []);\n}\n\n/**\n * Maps an Observable of properties to filter generic properties.\n */\nexport function mapToFilterGenericProperties(opts?: FilterGenericPropertyOptsType): OperatorFunction<FilterGenericPropertiesMetadataType, FilterGenericProperty[]> {\n return function (source: Observable<FilterGenericPropertiesMetadataType>): Observable<FilterGenericProperty[]> {\n return new Observable(subscriber => {\n return source.subscribe({\n next(value) {\n subscriber.next(convertPropertyToFilterGenericProperties(value, opts));\n },\n error: err => {\n subscriber.error(err);\n }\n });\n });\n };\n}\n\ntype FilterPropertyLookupFnType<Service> = (service: Service) => ItemOrObservable<FilterGenericPropertiesMetadataType>;\n\n/**\n * Creates a data provider for generic filter properties that can be used with the TableDescriptor's generic filter functionality.\n *\n * @param serviceType - The service to fetch the properties from.\n * @param lookupFn - The name of the service function to call for properties or function impl returning properties.\n * @param [opts] - Optional custom options for filter descriptors, such as date and number formatting.\n */\nexport function filterPropertyLookupProvider<Service>(\n serviceType: Type<Service>,\n lookupFn: FilterPropertyLookupFnType<Service> | ClassFunctionKeysWithReturnType<Service, Observable<FilterGenericPropertiesMetadataType>>,\n opts?: FilterGenericPropertyOptsType\n) {\n if (typeof lookupFn === 'function') {\n return lookupDataProviderWithService<Service, FilterGenericProperty>(serviceType).withLookup((_, service) =>\n toObservable(lookupFn(service)).pipe(mapToFilterGenericProperties(opts))\n );\n } else {\n return lookupDataProviderWithService<Service, FilterGenericProperty>(serviceType).withLookup((_, service) =>\n (service as any)[lookupFn]().pipe(mapToFilterGenericProperties(opts))\n );\n }\n}\n\ntype FilterValueSuggestionLookupFnType<Service> = (service: Service, field: string, search?: string) => ItemOrObservable<string[]>;\n\n/**\n * Creates a data provider for generic filter value suggestions that can be used with the TableDescriptor's generic filter functionality.\n *\n * @param service - The service to use for suggesting filter values.\n * @param lookupFn - The function name of the service to call for suggestion or function impl returning suggestions.\n */\nexport function filterValueSuggestionLookupProvider<Service>(\n service: Type<Service>,\n lookupFn: FilterValueSuggestionLookupFnType<Service> | ClassFunctionKeysWithParamAndReturnType<Service, {field: string; text?: string}, Observable<string[]>>\n): LookupDataProviderInst<string, Service, string, 'field'> {\n if (typeof lookupFn === 'function') {\n return lookupDataProviderWithService<Service, string, string, 'field'>(service).withLookup((params, service, search?) =>\n lookupFn(service, valueToDefined(params?.filters?.['field']?.value) as string, search)\n );\n } else {\n return lookupDataProviderWithService<Service, string, string, 'field'>(service).withLookup((params, service, search?) =>\n (service as any)[lookupFn]({\n field: valueToDefined(params?.filters?.['field']?.value).toString(),\n text: search\n })\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAeA;;;;;;;;;AASG;AACG,SAAU,yBAAyB,CAOrC,KAA6B,EAC7B,OAAkC,EAClC,MAAoC,EACpC,OAES,EAAA;IAET,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAOvC,IAAI,uBAAuB,CAAwB,KAAK,CAAC,EAAE,IAAI,yBAAyB,CAAiC,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjK,IAAA,OAAO,GAAG,OAAO,CAAC;AAClB,IAAA,OAAO,OAAO,CAAC,KAAK,EAAE;AAC1B;AAEA;;;;;;;;;AASG;AACG,SAAU,6BAA6B,CAQzC,KAA6B,EAC7B,OAAkC,EAClC,QAAkB,EAClB,OAES,EAAA;IAET,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAOvC,IAAI,uBAAuB,CAAwB,KAAK,CAAC,EAAE,IAAI,yBAAyB,CAAiC,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjK,IAAA,OAAO,CAAC,sBAAsB,CAAC,YAAY,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,OAAO,KAAK,gBAAgB,CAAC,OAAO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G,OAAe,CAAC,QAAQ,CAAC,CAAC;AACvB,YAAA,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE;AACnE,YAAA,IAAI,EAAE;AACT,SAAA,CAAC,CACL;;AAET;;AClKA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"mediusinc-mng-commons-data-api.mjs","sources":["../../src/lib/helpers/get-all-params.ts","../../src/index.ts","../../src/mediusinc-mng-commons-data-api.ts"],"sourcesContent":["import {Observable} from 'rxjs';\n\nimport {\n ClassFunctionKeysWithParamAndReturnType,\n CommonsInternalError,\n DataListFilter,\n DataListParams,\n DataListResult,\n FilterMatchMode,\n dataListParamsFilterToUrlQuery,\n dataListParamsFiltersToUrlQuery,\n dataListParamsSortToUrlQuery,\n mapToDataList\n} from '@mediusinc/mng-commons/core';\n\nimport {\n GetAllParamsFilterMatchType,\n GetAllParamsFilterType,\n GetAllParamsType,\n GetAllParamsUrlQueryType,\n GetAllParamsUrlQueryWithFiltersInKeyType\n} from '../models/request-params.model';\n\n/**\n * Converts a filter match mode to its corresponding enum value.\n *\n * @param {string} matchMode - The filter match mode from data list filter to convert.\n * @returns {GetAllParamsFilterMatchType} - The converted enum value.\n * @throws {CommonsInternalError} - If the filter match mode is not supported.\n */\nexport function toGetAllParamsFilterMatchMode(matchMode: string): GetAllParamsFilterMatchType {\n switch (matchMode) {\n case FilterMatchMode.Equals:\n return 'EQUALS';\n case FilterMatchMode.NotEquals:\n return 'NOT_EQUALS';\n case FilterMatchMode.Contains:\n return 'CONTAINS';\n case FilterMatchMode.NotContains:\n return 'NOT_CONTAINS';\n case FilterMatchMode.In:\n return 'IN';\n case FilterMatchMode.NotIn:\n return 'NOT_IN';\n case FilterMatchMode.StartsWith:\n return 'STARTS_WITH';\n case FilterMatchMode.EndsWith:\n return 'ENDS_WITH';\n case FilterMatchMode.LessThan:\n return 'LESS_THAN';\n case FilterMatchMode.LessThanOrEqualTo:\n return 'LESS_THAN_OR_EQUAL_TO';\n case FilterMatchMode.GreaterThan:\n return 'GREATER_THAN';\n case FilterMatchMode.GreaterThanOrEqualTo:\n return 'GREATER_THAN_OR_EQUAL_TO';\n case FilterMatchMode.Between:\n return 'BETWEEN';\n case FilterMatchMode.Exists:\n return 'EXISTS';\n case FilterMatchMode.DoesNotExist:\n return 'DOES_NOT_EXIST';\n default:\n throw new CommonsInternalError(`Filter match type '${matchMode}' not supported.`);\n }\n}\n\nfunction toGetAllParamsAsUrlQueryCommon<Sorts, Filters extends keyof any>(params: DataListParams<Sorts, Filters>): GetAllParamsUrlQueryType<Filters> {\n const res = {} as GetAllParamsUrlQueryType<Filters>;\n\n if (params.offset != null) {\n res.offset = params.offset;\n }\n if (params.limit != null) {\n res.limit = params.limit;\n }\n\n if (params.search != null && params.search !== '') {\n let caseSensitivityOption = 'ci';\n\n if (params.filters?.['global' as Filters]?.caseSensitive === true) {\n caseSensitivityOption = 'cs';\n }\n\n res.globalFilter = `${caseSensitivityOption}:${params.search}`;\n }\n\n if (Array.isArray(params.sort) && params.sort.length > 0) {\n res.sort = dataListParamsSortToUrlQuery(params as DataListParams);\n }\n\n return res;\n}\n\n/**\n * Converts given parameters of a DataListParams object into a get all request param object with values as URL query string representation.\n *\n * @param {DataListParams} params - The parameters to convert.\n * @typeparam Sorts - The type of the sorting options for the data list.\n * @typeparam Filters - The type of the filters for the data list.\n * @returns {GetAllParamsUrlQueryType<Filters>} - Get all request param object with values as URL query string representation.\n */\nexport function toGetAllParamsAsUrlQuery<Sorts, Filters extends keyof any>(params: DataListParams<Sorts, Filters>): GetAllParamsUrlQueryType<Filters> {\n const res = toGetAllParamsAsUrlQueryCommon(params);\n\n if (params.filters) {\n Object.keys(params.filters).forEach(key => {\n res[key as Filters] = dataListParamsFiltersToUrlQuery(params, key as Filters) as any;\n });\n }\n\n return res;\n}\n\n/**\n * Converts given parameters of a DataListParams object into a get all request param object with values as URL query string representation.\n *\n * @param {DataListParams} params - The parameters to convert.\n * @param {FilterKey} filterKey - Property key for filter object.\n * @typeparam Sorts - The type of the sorting options for the data list.\n * @typeparam Filters - The type of the filters for the data list.\n * @typeparam FilterKey - The type representing property key where filters will be put to.\n * @returns {GetAllParamsUrlQueryWithFiltersInKeyType<FilterKey, Filters>} - Get all request param object with values as URL query string representation.\n */\nexport function toGetAllParamsAsUrlQueryWithFiltersInProperty<Sorts, Filters extends keyof any, FilterKey extends string | number | symbol = 'filters'>(\n params: DataListParams<Sorts, Filters>,\n filterKey: FilterKey = 'filters' as FilterKey\n): GetAllParamsUrlQueryWithFiltersInKeyType<FilterKey, Filters> {\n const res = toGetAllParamsAsUrlQueryCommon(params) as GetAllParamsUrlQueryWithFiltersInKeyType<FilterKey, Filters>;\n\n if (params.filters && Object.keys(params.filters).length > 0) {\n (res as any)[filterKey] = {};\n Object.keys(params.filters).forEach(key => {\n (res as any)[filterKey][key as Filters] = dataListParamsFiltersToUrlQuery(params, key as Filters) as any;\n });\n }\n\n return res;\n}\n\n/**\n * Converts given parameters of a DataListParams object into a get all request param object with values as objects for POST requests.\n *\n * @param {DataListParams} params - The parameters to convert.\n * @typeparam Sorts - The type of the sorting options for the data list.\n * @typeparam Filters - The type of the filters for the data list.\n * @returns {GetAllParamsType<Sorts, Filters>} - Get all request param object with values as objects for POST requests.\n */\nexport function toGetAllParams<Sorts, Filters extends keyof any>(params: DataListParams<Sorts, Filters>): GetAllParamsType<Sorts, Filters> {\n const res = {} as GetAllParamsType<Sorts, Filters>;\n\n if (params.offset != null) {\n res.offset = params.offset;\n }\n if (params.limit != null) {\n res.limit = params.limit;\n }\n\n if (params.search != null) {\n res.globalFilter = {\n value: params.search\n };\n }\n\n if (Array.isArray(params.sort) && params.sort.length > 0) {\n res.sort = params.sort.map(s => ({\n property: s.property,\n direction: s.ascending === true || s.ascending == null ? 'ASCENDING' : 'DESCENDING'\n }));\n }\n\n if (params.filters) {\n Object.keys(params.filters).forEach(key => {\n const paramsFilter = params.filters![key as Filters]!;\n if (!paramsFilter.matchMode) {\n return;\n }\n\n let value = Array.isArray(paramsFilter.value) ? undefined : paramsFilter.value;\n let values = Array.isArray(paramsFilter.value) ? paramsFilter.value : undefined;\n\n if (paramsFilter.matchMode === FilterMatchMode.Exists || paramsFilter.matchMode === FilterMatchMode.DoesNotExist) {\n value = undefined;\n values = undefined;\n } else if (paramsFilter.matchMode === FilterMatchMode.In || paramsFilter.matchMode === FilterMatchMode.NotIn) {\n if (values == null || values.length === 0) {\n throw new CommonsInternalError(`Filter with mode ${paramsFilter.matchMode} must have values in array, but has ${values}`);\n }\n } else if (paramsFilter.matchMode === FilterMatchMode.Between) {\n if (values == null || values.length !== 2) {\n throw new CommonsInternalError(`Filter with mode ${paramsFilter.matchMode} must have 2 values in array, but has ${values}`);\n }\n } else if (paramsFilter.value == null) {\n return;\n }\n\n const caseSensitivity = paramsFilter.caseSensitive ? 'CASE_SENSITIVE' : paramsFilter.caseSensitive === false ? 'CASE_INSENSITIVE' : undefined;\n const filter = <GetAllParamsFilterType<any>>{\n filterMatchType: toGetAllParamsFilterMatchMode(paramsFilter.matchMode)\n };\n\n if (value != null) {\n filter.value = value;\n }\n if (values != null && Array.isArray(values) && values.length > 0) {\n filter.values = values;\n }\n if (caseSensitivity != null) {\n filter.caseSensitivity = caseSensitivity;\n }\n\n (res as any)[key as Filters] = filter;\n });\n }\n\n return res;\n}\n\n/**\n * Converts DataListParams to sort query URL representation.\n *\n * @param {DataListParams} params - The params object with sort property to convert.\n * @returns {string | undefined} - The formatted sort query URL param or undefined.\n */\nexport function toGetAllSortAsQueryUrl(params?: DataListParams<any, any>): string | undefined {\n return dataListParamsSortToUrlQuery(params);\n}\n\n/**\n * Converts a DataListFilter object to a query URL string.\n *\n * @param {DataListFilter} filter - The filter object from params to convert.\n * @returns {string|undefined} - The formatted filter query URL param or undefined.\n */\nexport function toGetAllFilterAsQueryUrl(filter?: DataListFilter): string | undefined {\n return dataListParamsFilterToUrlQuery(filter);\n}\n\n/**\n * Executes the \"getAll\" on API service with request parameters.\n * Get all is expected to be executed via GET method using params as URL queries.\n *\n * @param {Service} service - The API service instance.\n * @param {Function} getAllFn - The \"getAll\" function on provided service instance.\n * @param {Object} params - The data list params.\n * @returns {Observable<<DataListResult<Item>>>} An observable with data list result.\n */\nexport function executeGetAll<Service, Item, Sorts, Filters extends keyof any>(\n service: Service,\n getAllFn: (requestParameters: GetAllParamsUrlQueryType<Filters>) => Observable<{data?: Item[]; totalCount?: number}>,\n params: DataListParams<Sorts, Filters>\n): Observable<DataListResult<Item>> {\n return getAllFn.bind(service)(toGetAllParamsAsUrlQuery(params)).pipe(mapToDataList<Item>());\n}\n\n/**\n * Executes the \"getAll\" on API service with request parameters.\n * Get all is expected to be executed via GET method using params as URL queries.\n *\n * @param {Service} service - The API service instance.\n * @param {Function} getAllFn - The \"getAll\" function on provided service.\n * @param {Object} params - The data list params.\n * @returns {Observable<<DataListResult<Item>>>} An observable with data list result.\n */\nexport function apiServiceGetAll<Service, Item, Sorts, Filters extends keyof any>(\n service: Service,\n fn: ClassFunctionKeysWithParamAndReturnType<Service, GetAllParamsUrlQueryType<Filters>, Observable<{data?: Item[]; totalCount?: number}>>,\n params: DataListParams<Sorts, Filters>\n): Observable<DataListResult<Item>> {\n return (service as any)[fn](toGetAllParamsAsUrlQuery(params)).pipe(mapToDataList<Item>());\n}\n\n/**\n * Executes the \"getAll\" on API service with request parameters.\n * Get all is expected to be executed via POST method using params as object in body of request.\n *\n * @param {Service} service - The API service instance.\n * @param {Function} getAllFn - The \"getAll\" function on provided service instance.\n * @param {Object} params - The data list params.\n * @returns {Observable<<DataListResult<Item>>>} An observable with data list result.\n */\nexport function executeGetAllAsPost<Service, Item, Sorts, Filters extends keyof any>(\n service: Service,\n getAllFn: (requestParameters: GetAllParamsType<Sorts, Filters>) => Observable<{data?: Item[]; totalCount?: number}>,\n params: DataListParams<Sorts, Filters>\n): Observable<DataListResult<Item>> {\n return getAllFn.bind(service)(toGetAllParams(params)).pipe(mapToDataList<Item>());\n}\n","// helpers\nexport * from './lib/helpers/get-all-params';\n\n// models\nexport * from './lib/models/api-version.model';\nexport * from './lib/models/request-params.model';\nexport * from './lib/models/schema.model';\n\n// types\nexport * from './lib/types/extract-get-all-params.type';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAuBA;;;;;;AAMG;AACG,SAAU,6BAA6B,CAAC,SAAiB,EAAA;IAC3D,QAAQ,SAAS;QACb,KAAK,eAAe,CAAC,MAAM;AACvB,YAAA,OAAO,QAAQ,CAAC;QACpB,KAAK,eAAe,CAAC,SAAS;AAC1B,YAAA,OAAO,YAAY,CAAC;QACxB,KAAK,eAAe,CAAC,QAAQ;AACzB,YAAA,OAAO,UAAU,CAAC;QACtB,KAAK,eAAe,CAAC,WAAW;AAC5B,YAAA,OAAO,cAAc,CAAC;QAC1B,KAAK,eAAe,CAAC,EAAE;AACnB,YAAA,OAAO,IAAI,CAAC;QAChB,KAAK,eAAe,CAAC,KAAK;AACtB,YAAA,OAAO,QAAQ,CAAC;QACpB,KAAK,eAAe,CAAC,UAAU;AAC3B,YAAA,OAAO,aAAa,CAAC;QACzB,KAAK,eAAe,CAAC,QAAQ;AACzB,YAAA,OAAO,WAAW,CAAC;QACvB,KAAK,eAAe,CAAC,QAAQ;AACzB,YAAA,OAAO,WAAW,CAAC;QACvB,KAAK,eAAe,CAAC,iBAAiB;AAClC,YAAA,OAAO,uBAAuB,CAAC;QACnC,KAAK,eAAe,CAAC,WAAW;AAC5B,YAAA,OAAO,cAAc,CAAC;QAC1B,KAAK,eAAe,CAAC,oBAAoB;AACrC,YAAA,OAAO,0BAA0B,CAAC;QACtC,KAAK,eAAe,CAAC,OAAO;AACxB,YAAA,OAAO,SAAS,CAAC;QACrB,KAAK,eAAe,CAAC,MAAM;AACvB,YAAA,OAAO,QAAQ,CAAC;QACpB,KAAK,eAAe,CAAC,YAAY;AAC7B,YAAA,OAAO,gBAAgB,CA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O,GAAG,CAAC;AACf,CAAC;AAED;;;;;AAKG;AACG,SAAU,sBAAsB,CAAC,MAAiC,EAAA;AACpE,IAAA,OAAO,4BAA4B,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED;;;;;AAKG;AACG,SAAU,wBAAwB,CAAC,MAAuB,EAAA;AAC5D,IAAA,OAAO,8BAA8B,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;AAQG;SACa,aAAa,CACzB,OAAgB,EAChB,QAAoH,EACpH,MAAsC,EAAA;AAEtC,IAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAQ,CAAC,CAAC;AAChG,CAAC;AAED;;;;;;;;AAQG;SACa,gBAAgB,CAC5B,OAAgB,EAChB,EAAyI,EACzI,MAAsC,EAAA;AAEtC,IAAA,OAAQ,OAAe,CAAC,EAAE,CAAC,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAQ,CAAC,CAAC;AAC9F,CAAC;AAED;;;;;;;;AAQG;SACa,mBAAmB,CAC/B,OAAgB,EAChB,QAAmH,EACnH,MAAsC,EAAA;AAEtC,IAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAQ,CAAC,CAAC;AACtF;;AC/RA;;ACAA;;AAEG;;;;"}
1
+ {"version":3,"file":"mediusinc-mng-commons-data-api.mjs","sources":["../../src/lib/helpers/get-all-params.ts","../../src/index.ts","../../src/mediusinc-mng-commons-data-api.ts"],"sourcesContent":["import {Observable} from 'rxjs';\n\nimport {\n ClassFunctionKeysWithParamAndReturnType,\n CommonsInternalError,\n DataListFilter,\n DataListParams,\n DataListResult,\n FilterMatchMode,\n dataListParamsFilterToUrlQuery,\n dataListParamsFiltersToUrlQuery,\n dataListParamsSortToUrlQuery,\n mapToDataList\n} from '@mediusinc/mng-commons/core';\n\nimport {\n GetAllParamsFilterMatchType,\n GetAllParamsFilterType,\n GetAllParamsType,\n GetAllParamsUrlQueryType,\n GetAllParamsUrlQueryWithFiltersInKeyType\n} from '../models/request-params.model';\n\n/**\n * Converts a filter match mode to its corresponding enum value.\n *\n * @param {string} matchMode - The filter match mode from data list filter to convert.\n * @returns {GetAllParamsFilterMatchType} - The converted enum value.\n * @throws {CommonsInternalError} - If the filter match mode is not supported.\n */\nexport function toGetAllParamsFilterMatchMode(matchMode: string): GetAllParamsFilterMatchType {\n switch (matchMode) {\n case FilterMatchMode.Equals:\n return 'EQUALS';\n case FilterMatchMode.NotEquals:\n return 'NOT_EQUALS';\n case FilterMatchMode.Contains:\n return 'CONTAINS';\n case FilterMatchMode.NotContains:\n return 'NOT_CONTAINS';\n case FilterMatchMode.In:\n return 'IN';\n case FilterMatchMode.NotIn:\n return 'NOT_IN';\n case FilterMatchMode.StartsWith:\n return 'STARTS_WITH';\n case FilterMatchMode.EndsWith:\n return 'ENDS_WITH';\n case FilterMatchMode.LessThan:\n return 'LESS_THAN';\n case FilterMatchMode.LessThanOrEqualTo:\n return 'LESS_THAN_OR_EQUAL_TO';\n case FilterMatchMode.GreaterThan:\n return 'GREATER_THAN';\n case FilterMatchMode.GreaterThanOrEqualTo:\n return 'GREATER_THAN_OR_EQUAL_TO';\n case FilterMatchMode.Between:\n return 'BETWEEN';\n case FilterMatchMode.Exists:\n return 'EXISTS';\n case FilterMatchMode.DoesNotExist:\n return 'DOES_NOT_EXIST';\n default:\n throw new CommonsInternalError(`Filter match type '${matchMode}' not supported.`);\n }\n}\n\nfunction toGetAllParamsAsUrlQueryCommon<Sorts, Filters extends keyof any>(params: DataListParams<Sorts, Filters>): GetAllParamsUrlQueryType<Filters> {\n const res = {} as GetAllParamsUrlQueryType<Filters>;\n\n if (params.offset != null) {\n res.offset = params.offset;\n }\n if (params.limit != null) {\n res.limit = params.limit;\n }\n\n if (params.search != null && params.search !== '') {\n let caseSensitivityOption = 'ci';\n\n if (params.filters?.['global' as Filters]?.caseSensitive === true) {\n caseSensitivityOption = 'cs';\n }\n\n res.globalFilter = `${caseSensitivityOption}:${params.search}`;\n }\n\n if (Array.isArray(params.sort) && params.sort.length > 0) {\n res.sort = dataListParamsSortToUrlQuery(params as DataListParams);\n }\n\n return res;\n}\n\n/**\n * Converts given parameters of a DataListParams object into a get all request param object with values as URL query string representation.\n *\n * @param {DataListParams} params - The parameters to convert.\n * @typeparam Sorts - The type of the sorting options for the data list.\n * @typeparam Filters - The type of the filters for the data list.\n * @returns {GetAllParamsUrlQueryType<Filters>} - Get all request param object with values as URL query string representation.\n */\nexport function toGetAllParamsAsUrlQuery<Sorts, Filters extends keyof any>(params: DataListParams<Sorts, Filters>): GetAllParamsUrlQueryType<Filters> {\n const res = toGetAllParamsAsUrlQueryCommon(params);\n\n if (params.filters) {\n Object.keys(params.filters).forEach(key => {\n res[key as Filters] = dataListParamsFiltersToUrlQuery(params, key as Filters) as any;\n });\n }\n\n return res;\n}\n\n/**\n * Converts given parameters of a DataListParams object into a get all request param object with values as URL query string representation.\n *\n * @param {DataListParams} params - The parameters to convert.\n * @param {FilterKey} filterKey - Property key for filter object.\n * @typeparam Sorts - The type of the sorting options for the data list.\n * @typeparam Filters - The type of the filters for the data list.\n * @typeparam FilterKey - The type representing property key where filters will be put to.\n * @returns {GetAllParamsUrlQueryWithFiltersInKeyType<FilterKey, Filters>} - Get all request param object with values as URL query string representation.\n */\nexport function toGetAllParamsAsUrlQueryWithFiltersInProperty<Sorts, Filters extends keyof any, FilterKey extends string | number | symbol = 'filters'>(\n params: DataListParams<Sorts, Filters>,\n filterKey: FilterKey = 'filters' as FilterKey\n): GetAllParamsUrlQueryWithFiltersInKeyType<FilterKey, Filters> {\n const res = toGetAllParamsAsUrlQueryCommon(params) as GetAllParamsUrlQueryWithFiltersInKeyType<FilterKey, Filters>;\n\n if (params.filters && Object.keys(params.filters).length > 0) {\n (res as any)[filterKey] = {};\n Object.keys(params.filters).forEach(key => {\n (res as any)[filterKey][key as Filters] = dataListParamsFiltersToUrlQuery(params, key as Filters) as any;\n });\n }\n\n return res;\n}\n\n/**\n * Converts given parameters of a DataListParams object into a get all request param object with values as objects for POST requests.\n *\n * @param {DataListParams} params - The parameters to convert.\n * @typeparam Sorts - The type of the sorting options for the data list.\n * @typeparam Filters - The type of the filters for the data list.\n * @returns {GetAllParamsType<Sorts, Filters>} - Get all request param object with values as objects for POST requests.\n */\nexport function toGetAllParams<Sorts, Filters extends keyof any>(params: DataListParams<Sorts, Filters>): GetAllParamsType<Sorts, Filters> {\n const res = {} as GetAllParamsType<Sorts, Filters>;\n\n if (params.offset != null) {\n res.offset = params.offset;\n }\n if (params.limit != null) {\n res.limit = params.limit;\n }\n\n if (params.search != null) {\n res.globalFilter = {\n value: params.search\n };\n }\n\n if (Array.isArray(params.sort) && params.sort.length > 0) {\n res.sort = params.sort.map(s => ({\n property: s.property,\n direction: s.ascending === true || s.ascending == null ? 'ASCENDING' : 'DESCENDING'\n }));\n }\n\n if (params.filters) {\n Object.keys(params.filters).forEach(key => {\n const paramsFilter = params.filters![key as Filters]!;\n if (!paramsFilter.matchMode) {\n return;\n }\n\n let value = Array.isArray(paramsFilter.value) ? undefined : paramsFilter.value;\n let values = Array.isArray(paramsFilter.value) ? paramsFilter.value : undefined;\n\n if (paramsFilter.matchMode === FilterMatchMode.Exists || paramsFilter.matchMode === FilterMatchMode.DoesNotExist) {\n value = undefined;\n values = undefined;\n } else if (paramsFilter.matchMode === FilterMatchMode.In || paramsFilter.matchMode === FilterMatchMode.NotIn) {\n if (values == null || values.length === 0) {\n throw new CommonsInternalError(`Filter with mode ${paramsFilter.matchMode} must have values in array, but has ${values}`);\n }\n } else if (paramsFilter.matchMode === FilterMatchMode.Between) {\n if (values == null || values.length !== 2) {\n throw new CommonsInternalError(`Filter with mode ${paramsFilter.matchMode} must have 2 values in array, but has ${values}`);\n }\n } else if (paramsFilter.value == null) {\n return;\n }\n\n const caseSensitivity = paramsFilter.caseSensitive ? 'CASE_SENSITIVE' : paramsFilter.caseSensitive === false ? 'CASE_INSENSITIVE' : undefined;\n const filter = <GetAllParamsFilterType<any>>{\n filterMatchType: toGetAllParamsFilterMatchMode(paramsFilter.matchMode)\n };\n\n if (value != null) {\n filter.value = value;\n }\n if (values != null && Array.isArray(values) && values.length > 0) {\n filter.values = values;\n }\n if (caseSensitivity != null) {\n filter.caseSensitivity = caseSensitivity;\n }\n\n (res as any)[key as Filters] = filter;\n });\n }\n\n return res;\n}\n\n/**\n * Converts DataListParams to sort query URL representation.\n *\n * @param {DataListParams} params - The params object with sort property to convert.\n * @returns {string | undefined} - The formatted sort query URL param or undefined.\n */\nexport function toGetAllSortAsQueryUrl(params?: DataListParams<any, any>): string | undefined {\n return dataListParamsSortToUrlQuery(params);\n}\n\n/**\n * Converts a DataListFilter object to a query URL string.\n *\n * @param {DataListFilter} filter - The filter object from params to convert.\n * @returns {string|undefined} - The formatted filter query URL param or undefined.\n */\nexport function toGetAllFilterAsQueryUrl(filter?: DataListFilter): string | undefined {\n return dataListParamsFilterToUrlQuery(filter);\n}\n\n/**\n * Executes the \"getAll\" on API service with request parameters.\n * Get all is expected to be executed via GET method using params as URL queries.\n *\n * @param {Service} service - The API service instance.\n * @param {Function} getAllFn - The \"getAll\" function on provided service instance.\n * @param {Object} params - The data list params.\n * @returns {Observable<<DataListResult<Item>>>} An observable with data list result.\n */\nexport function executeGetAll<Service, Item, Sorts, Filters extends keyof any>(\n service: Service,\n getAllFn: (requestParameters: GetAllParamsUrlQueryType<Filters>) => Observable<{data?: Item[]; totalCount?: number}>,\n params: DataListParams<Sorts, Filters>\n): Observable<DataListResult<Item>> {\n return getAllFn.bind(service)(toGetAllParamsAsUrlQuery(params)).pipe(mapToDataList<Item>());\n}\n\n/**\n * Executes the \"getAll\" on API service with request parameters.\n * Get all is expected to be executed via GET method using params as URL queries.\n *\n * @param {Service} service - The API service instance.\n * @param {Function} getAllFn - The \"getAll\" function on provided service.\n * @param {Object} params - The data list params.\n * @returns {Observable<<DataListResult<Item>>>} An observable with data list result.\n */\nexport function apiServiceGetAll<Service, Item, Sorts, Filters extends keyof any>(\n service: Service,\n fn: ClassFunctionKeysWithParamAndReturnType<Service, GetAllParamsUrlQueryType<Filters>, Observable<{data?: Item[]; totalCount?: number}>>,\n params: DataListParams<Sorts, Filters>\n): Observable<DataListResult<Item>> {\n return (service as any)[fn](toGetAllParamsAsUrlQuery(params)).pipe(mapToDataList<Item>());\n}\n\n/**\n * Executes the \"getAll\" on API service with request parameters.\n * Get all is expected to be executed via POST method using params as object in body of request.\n *\n * @param {Service} service - The API service instance.\n * @param {Function} getAllFn - The \"getAll\" function on provided service instance.\n * @param {Object} params - The data list params.\n * @returns {Observable<<DataListResult<Item>>>} An observable with data list result.\n */\nexport function executeGetAllAsPost<Service, Item, Sorts, Filters extends keyof any>(\n service: Service,\n getAllFn: (requestParameters: GetAllParamsType<Sorts, Filters>) => Observable<{data?: Item[]; totalCount?: number}>,\n params: DataListParams<Sorts, Filters>\n): Observable<DataListResult<Item>> {\n return getAllFn.bind(service)(toGetAllParams(params)).pipe(mapToDataList<Item>());\n}\n","// helpers\nexport * from './lib/helpers/get-all-params';\n\n// models\nexport * from './lib/models/api-version.model';\nexport * from './lib/models/request-params.model';\nexport * from './lib/models/schema.model';\n\n// types\nexport * from './lib/types/extract-get-all-params.type';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAuBA;;;;;;AAMG;AACG,SAAU,6BAA6B,CAAC,SAAiB,EAAA;IAC3D,QAAQ,SAAS;QACb,KAAK,eAAe,CAAC,MAAM;AACvB,YAAA,OAAO,QAAQ;QACnB,KAAK,eAAe,CAAC,SAAS;AAC1B,YAAA,OAAO,YAAY;QACvB,KAAK,eAAe,CAAC,QAAQ;AACzB,YAAA,OAAO,UAAU;QACrB,KAAK,eAAe,CAAC,WAAW;AAC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usinc/mng-commons-data-api",
3
- "version": "5.5.0-rc.0",
3
+ "version": "5.5.0-rc.1",
4
4
  "peerDependencies": {
5
5
  "@angular/core": "^17.3.0 || ^18.0.0",
6
- "@mediusinc/mng-commons": "~5.5.0-rc.0"
6
+ "@mediusinc/mng-commons": "~5.5.0-rc.1"
7
7
  },
8
8
  "dependencies": {
9
- "tslib": "^2.3.0"
9
+ "tslib": "^2.8.1"
10
10
  },
11
11
  "publishConfig": {
12
12
  "directory": "dist"
package/version-info.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons-data-api",
3
- "version": "5.5.0-rc.0",
3
+ "version": "5.5.0-rc.1",
4
4
  "tag": "v5.4.0-rc.7",
5
- "distance": 5,
6
- "hash": "4f490c8b",
5
+ "distance": 21,
6
+ "hash": "8c9a8e96",
7
7
  "dirty": true,
8
- "semver": "5.4.0-rc.7+5.g4f490c8b.dirty",
8
+ "semver": "5.4.0-rc.7+21.g8c9a8e96.dirty",
9
9
  "buildTimestamp": null,
10
- "raw": "v5.4.0-rc.7-5-4f490c8b-dirty"
10
+ "raw": "v5.4.0-rc.7-21-8c9a8e96-dirty"
11
11
  }