@mediusinc/mng-commons 5.0.1 → 5.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/descriptors/model.descriptor.d.ts +1 -1
- package/core/error/error-helpers.d.ts +18 -1
- package/core/i18n/i18n-type.d.ts +0 -9
- package/core/services/commons-configuration.service.d.ts +12 -0
- package/esm2022/core/descriptors/model.descriptor.mjs +1 -1
- package/esm2022/core/error/error-helpers.mjs +20 -1
- package/esm2022/core/i18n/i18n-type.mjs +1 -34
- package/esm2022/core/services/commons-configuration.service.mjs +16 -1
- package/esm2022/model/descriptors/model.descriptor.mjs +1 -1
- package/esm2022/model/helpers/i18n.mjs +7 -10
- package/esm2022/table/api/descriptors/table.descriptor.mjs +2 -2
- package/esm2022/tableview/api/editor/models/field-action-context.model.mjs +1 -1
- package/esm2022/tableview/api/editor/models/form-editor.interface.mjs +1 -1
- package/esm2022/tableview/api/editor/models/formly-field.model.mjs +1 -1
- package/esm2022/tableview/api/editor/models/formly-options.model.mjs +2 -0
- package/esm2022/tableview/api/index.mjs +2 -1
- package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +9 -4
- package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +4 -5
- package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +8 -10
- package/esm2022/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.mjs +4 -4
- package/esm2022/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.mjs +5 -5
- package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +8 -9
- package/esm2022/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +5 -5
- package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +5 -4
- package/esm2022/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.mjs +4 -5
- package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +5 -5
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +7 -8
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +4 -5
- package/esm2022/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +4 -3
- package/esm2022/tableview/editor/components/formly/fields/formly-field-type.abstract.component.mjs +23 -0
- package/fesm2022/mediusinc-mng-commons-core.mjs +96 -95
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs +7 -10
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +59 -46
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/model/descriptors/model.descriptor.d.ts +3 -3
- package/model/helpers/i18n.d.ts +1 -3
- package/package.json +1 -1
- package/tableview/api/editor/models/field-action-context.model.d.ts +3 -3
- package/tableview/api/editor/models/form-editor.interface.d.ts +1 -8
- package/tableview/api/editor/models/formly-options.model.d.ts +15 -0
- package/tableview/api/index.d.ts +1 -0
- package/tableview/editor/components/editor/form-editor.component.d.ts +3 -11
- package/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.d.ts +3 -4
- package/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +3 -7
- package/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.d.ts +3 -4
- package/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.d.ts +3 -4
- package/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +3 -6
- package/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +3 -4
- package/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.d.ts +3 -4
- package/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.d.ts +5 -6
- package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +3 -4
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +3 -4
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +3 -4
- package/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +2 -3
- package/tableview/editor/components/formly/fields/formly-field-type.abstract.component.d.ts +12 -0
- package/version-info.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataProviderInst, findReflectEnumName, TypeRegistry, findReflectTypeName, CommonsInternalError, getI18n,
|
|
1
|
+
import { DataProviderInst, findReflectEnumName, TypeRegistry, findReflectTypeName, CommonsInternalError, getI18n, getI18nTypeParams, getI18nTypeParamsAsync, getI18nTypeKeyBasePath } from '@mediusinc/mng-commons/core';
|
|
2
2
|
import { map } from 'rxjs/operators';
|
|
3
3
|
|
|
4
4
|
function dataProvider(type, serviceType) {
|
|
@@ -213,15 +213,9 @@ function getI18nForModel(translate, model, keyPath, customKey, item, fallbackKey
|
|
|
213
213
|
const i18nParams = getI18nModelParams(translate, model, item, params);
|
|
214
214
|
return getI18n(translate, i18nParams, ...keys);
|
|
215
215
|
}
|
|
216
|
-
function getI18nModelName(translate, model, singular) {
|
|
217
|
-
return getI18nTypeName(translate, model.i18nBaseKey, singular);
|
|
218
|
-
}
|
|
219
|
-
function getI18nModelNameAsync(translate, model, singular) {
|
|
220
|
-
return getI18nTypeNameAsync(translate, model.i18nBaseKey, singular);
|
|
221
|
-
}
|
|
222
216
|
function getI18nModelParams(translate, model, item, params = {}) {
|
|
223
217
|
const i18nParams = getI18nTypeParams(translate, model?.i18nBaseKey, item, params);
|
|
224
|
-
return populateI18nModelParams(model?.idProperty, model?.titleProperty,
|
|
218
|
+
return populateI18nModelParams(model?.idProperty, model?.titleProperty, i18nParams);
|
|
225
219
|
}
|
|
226
220
|
function getI18nModelParamsAsync(translate, model, item, params = {}) {
|
|
227
221
|
return getI18nTypeParamsAsync(translate, model?.i18nBaseKey, item, params).pipe(map(i18nParams => populateI18nModelParams(model?.idProperty, model?.titleProperty, item, i18nParams)));
|
|
@@ -232,7 +226,10 @@ function populateI18nModelParams(idProperty, titleProperty, item, params = {}) {
|
|
|
232
226
|
if (idProperty && item[idProperty]) {
|
|
233
227
|
paramsRes.itemId = item[idProperty];
|
|
234
228
|
}
|
|
235
|
-
if (titleProperty
|
|
229
|
+
if (typeof titleProperty === 'function') {
|
|
230
|
+
paramsRes.itemTitle = titleProperty(item);
|
|
231
|
+
}
|
|
232
|
+
else if (titleProperty && item[titleProperty]) {
|
|
236
233
|
paramsRes.itemTitle = item[titleProperty];
|
|
237
234
|
}
|
|
238
235
|
}
|
|
@@ -257,5 +254,5 @@ function getKeysByPriority(model, keyPath, customKey, fallbackKey) {
|
|
|
257
254
|
* Generated bundle index. Do not edit.
|
|
258
255
|
*/
|
|
259
256
|
|
|
260
|
-
export { EnumDescriptor, ModelDescriptor, TypeDescriptor, dataProvider, dataProviderFromModel, enumModel, enumModelGeneric, findClassIdAttribute, findClassTitleAttribute, getClassAttributeDef, getI18nForModel,
|
|
257
|
+
export { EnumDescriptor, ModelDescriptor, TypeDescriptor, dataProvider, dataProviderFromModel, enumModel, enumModelGeneric, findClassIdAttribute, findClassTitleAttribute, getClassAttributeDef, getI18nForModel, getI18nModelParams, getI18nModelParamsAsync, model, populateI18nModelParams, trySetLookupItemsProperties, type, typeClass };
|
|
261
258
|
//# sourceMappingURL=mediusinc-mng-commons-model.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediusinc-mng-commons-model.mjs","sources":["../../model/src/data-providers/base-from-type-data-provider.factory.ts","../../model/src/descriptors/enum.descriptor.ts","../../model/src/helpers/model.ts","../../model/src/descriptors/type.descriptor.ts","../../model/src/descriptors/model.descriptor.ts","../../model/src/helpers/i18n.ts","../../model/src/index.ts","../../model/src/mediusinc-mng-commons-model.ts"],"sourcesContent":["import {ClassType, DataProviderInst, ServiceClassType} from '@mediusinc/mng-commons/core';\n\nimport {ModelDescriptor} from '../descriptors/model.descriptor';\nimport {TypeDescriptor} from '../descriptors/type.descriptor';\n\nexport function dataProvider<Model>(): DataProviderInst<Model, undefined, undefined, undefined>;\nexport function dataProvider<Model>(type: TypeDescriptor<Model>): DataProviderInst<Model, undefined, undefined, undefined>;\nexport function dataProvider<Model, Service = any>(\n type: TypeDescriptor<Model>,\n serviceType: ServiceClassType<Service>\n): DataProviderInst<Model, Service, undefined, ServiceClassType<Service>>;\nexport function dataProvider<Model, Service = any, ServiceClass = ServiceClassType<Service>>(type?: TypeDescriptor<Model>, serviceType?: ServiceClass) {\n return new DataProviderInst<Model, Service, undefined, ServiceClass>(undefined, serviceType as ServiceClass);\n}\n\nexport function dataProviderFromModel<Model, ModelClass = ClassType<Model>>(model: ModelDescriptor<Model, ModelClass>): DataProviderInst<Model, undefined, ModelClass, undefined>;\nexport function dataProviderFromModel<Model, Service = any, ModelClass = ClassType<Model>>(\n model: ModelDescriptor<Model, ModelClass>,\n ServiceClass: ServiceClassType<Service>\n): DataProviderInst<Model, Service, ModelClass, ServiceClassType<Service>>;\nexport function dataProviderFromModel<Model, Service = any, ModelClass = ClassType<Model>, ServiceClass = ServiceClassType<Service>>(\n model: ModelDescriptor<Model, ModelClass>,\n serviceType?: ServiceClass\n) {\n return new DataProviderInst<Model, Service, ClassType<Model>, ServiceClass>(model.type as ClassType<Model>, serviceType as ServiceClass);\n}\n","import {EnumType, findReflectEnumName} from '@mediusinc/mng-commons/core';\n\nexport class EnumDescriptor<Enum> {\n private readonly _value: Enum;\n private readonly _type: EnumType;\n private readonly _nameAsValue;\n private readonly _i18nBaseKey: string | null;\n\n public constructor(value: Enum, type: EnumType, i18nBaseKey?: string | null, nameAsValue = false) {\n this._value = value;\n this._type = type;\n this._nameAsValue = nameAsValue;\n\n if (typeof i18nBaseKey === 'undefined') {\n i18nBaseKey = findReflectEnumName(type);\n }\n this._i18nBaseKey = i18nBaseKey;\n }\n\n public get type() {\n return this._type;\n }\n\n public get i18nBaseKey() {\n return this._i18nBaseKey;\n }\n\n public get nameAsValue() {\n return this._nameAsValue;\n }\n}\n\nexport function enumModel<Enum>(value: Enum, type: EnumType, i18nBaseKey: string | undefined | null = null, nameAsValue = false) {\n return new EnumDescriptor<Enum>(value, type, i18nBaseKey, nameAsValue);\n}\n\nexport function enumModelGeneric(type: EnumType, i18nBaseKey: string | undefined | null = null, nameAsValue = false) {\n return new EnumDescriptor<any>(undefined, type, i18nBaseKey, nameAsValue);\n}\n","import {ClassAttributeDef, ClassType, ILookupDescriptor, TypeRegistry} from '@mediusinc/mng-commons/core';\n\nexport function findClassIdAttribute<T>(classType?: ClassType<T>): string | null {\n if (!classType) return null;\n\n const attrDef = getClassAttributeDef(classType);\n if (!attrDef) {\n return null;\n }\n\n let idAttribute = findAttributeByTypeAndName(attrDef, ['string', 'number'], 'id', 'uuid', 'code', 'sifra');\n if (!idAttribute) {\n // if no id or code, take the first attribute\n idAttribute = attrDef[0];\n }\n\n return idAttribute?.name ?? null;\n}\n\nexport function findClassTitleAttribute<T>(classType?: ClassType<T>): string | null {\n if (!classType) return null;\n\n const attrDef = getClassAttributeDef(classType);\n if (!attrDef) {\n return null;\n }\n\n let titleAttribute = findAttributeByTypeAndName(attrDef, ['string'], 'name', 'ime', 'title', 'naziv');\n if (!titleAttribute) {\n // if no name or title, take the first attribute\n titleAttribute = attrDef[0];\n }\n\n return titleAttribute?.name ?? null;\n}\n\nexport function getClassAttributeDef<T>(classType?: ClassType<T>) {\n if (!classType) return null;\n const attrDefByFn = (classType as any).getAttributeTypeMap?.() as Array<ClassAttributeDef> | undefined;\n if (attrDefByFn) return attrDefByFn;\n const attrDefByProp = (classType as any).attributeTypeMap as Array<ClassAttributeDef> | undefined;\n if (attrDefByProp) return attrDefByProp;\n const attrByObjSer = TypeRegistry.get().findAttributesDefinitionByClassType(classType);\n if (attrByObjSer) return attrByObjSer;\n return null;\n}\n\nfunction findAttributeByTypeAndName(attributes: ClassAttributeDef[], types: string[], ...names: string[]): ClassAttributeDef | null {\n for (const name of names) {\n const attribute = attributes.find(a => types.some(t => t === a.type) && a.name === name);\n if (attribute) {\n return attribute;\n }\n }\n return null;\n}\n\nexport function trySetLookupItemsProperties<T>(lookup: ILookupDescriptor<T>, idAsTrack = true) {\n if (lookup.dataProvider.classType) {\n if (!lookup.optionsValueProperty && !lookup.optionsTrackProperty) {\n const idProperty = findClassIdAttribute(lookup.dataProvider.classType) ?? undefined;\n if (idProperty && !lookup.optionsValueProperty && !lookup.optionsTrackProperty) {\n if (idAsTrack) {\n lookup.withOptionsTrackPropertyUnsafe(idProperty);\n }\n }\n }\n if (!lookup.optionsLabelProperty) {\n const labelProperty = findClassTitleAttribute(lookup.dataProvider.classType);\n if (labelProperty) {\n lookup.withOptionsLabelPropertyUnsafe(labelProperty);\n }\n }\n }\n}\n","import {ClassType} from '@mediusinc/mng-commons/core';\n\nexport class TypeDescriptor<Type> {\n private readonly _classType?: ClassType<Type>;\n\n public constructor(classType?: ClassType<Type>) {\n this._classType = classType;\n }\n\n public get classType() {\n return this._classType;\n }\n}\n\nexport function type<Type>(): TypeDescriptor<Type> {\n return new TypeDescriptor<Type>();\n}\n\nexport function typeClass<Type>(type: ClassType<Type>): TypeDescriptor<Type> {\n return new TypeDescriptor<Type>(type);\n}\n","import {ClassOptType, ClassType, CommonsInternalError, IModelDescriptor, findReflectTypeName} from '@mediusinc/mng-commons/core';\n\nimport {findClassIdAttribute, findClassTitleAttribute} from '../helpers/model';\nimport {TypeDescriptor} from './type.descriptor';\n\nexport class ModelDescriptor<Model, ModelClass = ClassOptType<Model>> implements IModelDescriptor<Model, ModelClass> {\n private readonly _type: ModelClass;\n private readonly _typeName?: string;\n private _i18nBaseKey: string;\n private _idProperty?: string;\n private _titleProperty?: string;\n\n public constructor(type: ModelClass, idProperty?: string, titleProperty?: string, i18nBaseKey?: string | ClassType<any>) {\n this._type = type;\n this._typeName = findReflectTypeName(type as ClassType<Model>) ?? undefined;\n this._idProperty = idProperty;\n this._titleProperty = titleProperty;\n if (!this._idProperty && type) {\n this._idProperty = findClassIdAttribute(type as unknown as ClassType<Model>) ?? undefined;\n }\n if (!this._titleProperty && type) {\n this._titleProperty = findClassTitleAttribute(type as unknown as ClassType<Model>) ?? undefined;\n }\n this._i18nBaseKey = (typeof i18nBaseKey === 'string' || typeof i18nBaseKey === 'undefined' ? i18nBaseKey : findReflectTypeName(i18nBaseKey)) ?? this._typeName ?? '';\n }\n\n /**\n * @deprecated Use standalone {model()} instead.\n */\n public static create<Model>(idProperty?: keyof Model, titleProperty?: keyof Model, i18nBaseKey?: string | ClassType<unknown>): ModelDescriptor<Model, undefined> {\n return new ModelDescriptor(undefined, idProperty as string, titleProperty as string, i18nBaseKey);\n }\n\n /**\n * @deprecated Use standalone {model()} instead.\n */\n public static fromClass<Model>(\n type: ClassType<Model>,\n idProperty?: keyof Model,\n titleProperty?: keyof Model,\n i18nBaseKey?: string | ClassType<unknown>\n ): ModelDescriptor<Model, ClassType<Model>> {\n return new ModelDescriptor(type, idProperty as string, titleProperty as string, i18nBaseKey);\n }\n\n public get type() {\n return this._type;\n }\n\n public get typeName() {\n return this._typeName;\n }\n\n public get i18nBaseKey() {\n return this._i18nBaseKey;\n }\n\n public get idProperty() {\n return this._idProperty;\n }\n\n public get titleProperty() {\n return this._titleProperty;\n }\n\n public withIdProperty(property: keyof Model): this {\n this._idProperty = property as string;\n return this;\n }\n\n public withIdPropertyUnsafe(property: string): this {\n this._idProperty = property;\n return this;\n }\n\n public withTitleProperty(property: keyof Model): this {\n this._titleProperty = property as string;\n return this;\n }\n\n public withTitlePropertyUnsafe(property: string): this {\n this._titleProperty = property;\n return this;\n }\n\n public withI18nBase(base: ClassType<any> | string): this {\n if (typeof base !== 'string') {\n const typeName = findReflectTypeName(base);\n if (!typeName) {\n throw new CommonsInternalError(`Could not find define i18nBaseKey for ${base} on model ${this.typeName}`);\n }\n base = typeName;\n }\n this._i18nBaseKey = base;\n return this;\n }\n\n public copy(): ModelDescriptor<Model, ModelClass> {\n return new ModelDescriptor<Model, ModelClass>(this._type, this._idProperty, this._titleProperty, this._i18nBaseKey);\n }\n}\n\nexport type ModelDescriptorCreateOpts<Model> = {\n id?: keyof Model;\n title?: keyof Model;\n i18nBase?: string | ClassType<any>;\n};\n\nexport function model<Model>(): ModelDescriptor<Model, undefined>;\nexport function model<Model>(opts: ModelDescriptorCreateOpts<Model>): ModelDescriptor<Model, undefined>;\nexport function model<Model>(type: TypeDescriptor<Model>, opts?: ModelDescriptorCreateOpts<Model>): ModelDescriptor<Model, undefined>;\nexport function model<Model>(clazz: ClassType<Model>, opts?: ModelDescriptorCreateOpts<Model>): ModelDescriptor<Model, ClassType<Model>>;\nexport function model<Model>(typeOrClassOrOpts?: ClassType<Model> | TypeDescriptor<Model> | ModelDescriptorCreateOpts<Model>, opts?: ModelDescriptorCreateOpts<Model>) {\n if (typeOrClassOrOpts == null) {\n return new ModelDescriptor<Model, undefined>(undefined);\n } else if (typeOrClassOrOpts instanceof TypeDescriptor) {\n return new ModelDescriptor<Model, undefined>(undefined, opts?.id as string, opts?.title as string, opts?.i18nBase);\n } else if (typeof typeOrClassOrOpts === 'function') {\n return new ModelDescriptor<Model, ClassType<Model>>(typeOrClassOrOpts as ClassType<Model>, opts?.id as string, opts?.title as string, opts?.i18nBase);\n } else {\n const typeOrClassAsOpts = typeOrClassOrOpts as ModelDescriptorCreateOpts<Model>;\n return new ModelDescriptor<Model, undefined>(undefined, typeOrClassAsOpts?.id as string, typeOrClassAsOpts?.title as string, typeOrClassAsOpts?.i18nBase);\n }\n}\n","import {TranslateService} from '@ngx-translate/core';\nimport {Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {KeyOfType, getI18n, getI18nTypeKeyBasePath, getI18nTypeName, getI18nTypeNameAsync, getI18nTypeParams, getI18nTypeParamsAsync} from '@mediusinc/mng-commons/core';\n\nimport {ModelDescriptor} from '../descriptors/model.descriptor';\n\nexport function getI18nForModel(\n translate: TranslateService,\n model: ModelDescriptor<any>,\n keyPath: string,\n customKey?: string,\n item?: any,\n fallbackKey?: string,\n params?: any\n): string | null {\n const keys = getKeysByPriority(model, keyPath, customKey, fallbackKey);\n const i18nParams = getI18nModelParams(translate, model, item, params);\n return getI18n(translate, i18nParams, ...keys);\n}\n\nexport function getI18nModelName(translate: TranslateService, model: ModelDescriptor<any>, singular?: boolean): string | null {\n return getI18nTypeName(translate, model.i18nBaseKey, singular);\n}\n\nexport function getI18nModelNameAsync(translate: TranslateService, model: ModelDescriptor<any>, singular?: boolean): Observable<string | null> {\n return getI18nTypeNameAsync(translate, model.i18nBaseKey, singular);\n}\n\nexport function getI18nModelParams(translate: TranslateService, model?: ModelDescriptor<any>, item?: any, params: any = {}): any {\n const i18nParams = getI18nTypeParams(translate, model?.i18nBaseKey, item, params);\n return populateI18nModelParams(model?.idProperty, model?.titleProperty, item, i18nParams);\n}\n\nexport function getI18nModelParamsAsync(translate: TranslateService, model?: ModelDescriptor<any>, item?: any, params: any = {}): Observable<any> {\n return getI18nTypeParamsAsync(translate, model?.i18nBaseKey, item, params).pipe(\n map(i18nParams => populateI18nModelParams(model?.idProperty, model?.titleProperty, item, i18nParams))\n );\n}\n\nexport function populateI18nModelParams(idProperty?: KeyOfType, titleProperty?: KeyOfType, item?: any, params: any = {}): any {\n const paramsRes = {...params, itemId: '', itemTitle: ''};\n if (item) {\n if (idProperty && item[idProperty]) {\n paramsRes.itemId = item[idProperty];\n }\n if (titleProperty && item[titleProperty]) {\n paramsRes.itemTitle = item[titleProperty];\n }\n }\n return paramsRes;\n}\n\nfunction getKeysByPriority(model: ModelDescriptor<any>, keyPath: string, customKey?: string, fallbackKey?: string) {\n const keys = [];\n if (customKey) {\n keys.push(customKey);\n }\n const modelActionKey = getI18nTypeKeyBasePath(model.i18nBaseKey, ...keyPath);\n keys.push(modelActionKey);\n if (fallbackKey) {\n keys.push(fallbackKey);\n }\n return keys;\n}\n","// data providers\nexport * from './data-providers/base-from-type-data-provider.factory';\n\n// descriptors\nexport * from './descriptors/enum.descriptor';\nexport * from './descriptors/model.descriptor';\nexport * from './descriptors/type.descriptor';\n\n// helpers\nexport * from './helpers/i18n';\nexport * from './helpers/model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAWgB,SAAA,YAAY,CAAiE,IAA4B,EAAE,WAA0B,EAAA;AACjJ,IAAA,OAAO,IAAI,gBAAgB,CAA0C,SAAS,EAAE,WAA2B,CAAC,CAAC;AACjH,CAAC;AAOe,SAAA,qBAAqB,CACjC,KAAyC,EACzC,WAA0B,EAAA;IAE1B,OAAO,IAAI,gBAAgB,CAAiD,KAAK,CAAC,IAAwB,EAAE,WAA2B,CAAC,CAAC;AAC7I;;MCvBa,cAAc,CAAA;IAMvB,WAAmB,CAAA,KAAW,EAAE,IAAc,EAAE,WAA2B,EAAE,WAAW,GAAG,KAAK,EAAA;AAC5F,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;AACpB,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;AAClB,QAAA,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;AAEhC,QAAA,IAAI,OAAO,WAAW,KAAK,WAAW,EAAE;AACpC,YAAA,WAAW,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;SAC3C;AACD,QAAA,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;KACnC;AAED,IAAA,IAAW,IAAI,GAAA;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;KACrB;AAED,IAAA,IAAW,WA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AC,CAAC;SACvC;AACD,QAAA,IAAI,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE;AACtC,YAAA,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;SAC7C;KACJ;AACD,IAAA,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,iBAAiB,CAAC,KAA2B,EAAE,OAAe,EAAE,SAAkB,EAAE,WAAoB,EAAA;IAC7G,MAAM,IAAI,GAAG,EAAE,CAAC;IAChB,IAAI,SAAS,EAAE;AACX,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACxB;IACD,MAAM,cAAc,GAAG,sBAAsB,CAAC,KAAK,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,CAAC;AAC7E,IAAA,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC1B,IAAI,WAAW,EAAE;AACb,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KAC1B;AACD,IAAA,OAAO,IAAI,CAAC;AAChB;;ACjEA;;ACAA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mediusinc-mng-commons-model.mjs","sources":["../../model/src/data-providers/base-from-type-data-provider.factory.ts","../../model/src/descriptors/enum.descriptor.ts","../../model/src/helpers/model.ts","../../model/src/descriptors/type.descriptor.ts","../../model/src/descriptors/model.descriptor.ts","../../model/src/helpers/i18n.ts","../../model/src/index.ts","../../model/src/mediusinc-mng-commons-model.ts"],"sourcesContent":["import {ClassType, DataProviderInst, ServiceClassType} from '@mediusinc/mng-commons/core';\n\nimport {ModelDescriptor} from '../descriptors/model.descriptor';\nimport {TypeDescriptor} from '../descriptors/type.descriptor';\n\nexport function dataProvider<Model>(): DataProviderInst<Model, undefined, undefined, undefined>;\nexport function dataProvider<Model>(type: TypeDescriptor<Model>): DataProviderInst<Model, undefined, undefined, undefined>;\nexport function dataProvider<Model, Service = any>(\n type: TypeDescriptor<Model>,\n serviceType: ServiceClassType<Service>\n): DataProviderInst<Model, Service, undefined, ServiceClassType<Service>>;\nexport function dataProvider<Model, Service = any, ServiceClass = ServiceClassType<Service>>(type?: TypeDescriptor<Model>, serviceType?: ServiceClass) {\n return new DataProviderInst<Model, Service, undefined, ServiceClass>(undefined, serviceType as ServiceClass);\n}\n\nexport function dataProviderFromModel<Model, ModelClass = ClassType<Model>>(model: ModelDescriptor<Model, ModelClass>): DataProviderInst<Model, undefined, ModelClass, undefined>;\nexport function dataProviderFromModel<Model, Service = any, ModelClass = ClassType<Model>>(\n model: ModelDescriptor<Model, ModelClass>,\n ServiceClass: ServiceClassType<Service>\n): DataProviderInst<Model, Service, ModelClass, ServiceClassType<Service>>;\nexport function dataProviderFromModel<Model, Service = any, ModelClass = ClassType<Model>, ServiceClass = ServiceClassType<Service>>(\n model: ModelDescriptor<Model, ModelClass>,\n serviceType?: ServiceClass\n) {\n return new DataProviderInst<Model, Service, ClassType<Model>, ServiceClass>(model.type as ClassType<Model>, serviceType as ServiceClass);\n}\n","import {EnumType, findReflectEnumName} from '@mediusinc/mng-commons/core';\n\nexport class EnumDescriptor<Enum> {\n private readonly _value: Enum;\n private readonly _type: EnumType;\n private readonly _nameAsValue;\n private readonly _i18nBaseKey: string | null;\n\n public constructor(value: Enum, type: EnumType, i18nBaseKey?: string | null, nameAsValue = false) {\n this._value = value;\n this._type = type;\n this._nameAsValue = nameAsValue;\n\n if (typeof i18nBaseKey === 'undefined') {\n i18nBaseKey = findReflectEnumName(type);\n }\n this._i18nBaseKey = i18nBaseKey;\n }\n\n public get type() {\n return this._type;\n }\n\n public get i18nBaseKey() {\n return this._i18nBaseKey;\n }\n\n public get nameAsValue() {\n return this._nameAsValue;\n }\n}\n\nexport function enumModel<Enum>(value: Enum, type: EnumType, i18nBaseKey: string | undefined | null = null, nameAsValue = false) {\n return new EnumDescriptor<Enum>(value, type, i18nBaseKey, nameAsValue);\n}\n\nexport function enumModelGeneric(type: EnumType, i18nBaseKey: string | undefined | null = null, nameAsValue = false) {\n return new EnumDescriptor<any>(undefined, type, i18nBaseKey, nameAsValue);\n}\n","import {ClassAttributeDef, ClassType, ILookupDescriptor, TypeRegistry} from '@mediusinc/mng-commons/core';\n\nexport function findClassIdAttribute<T>(classType?: ClassType<T>): string | null {\n if (!classType) return null;\n\n const attrDef = getClassAttributeDef(classType);\n if (!attrDef) {\n return null;\n }\n\n let idAttribute = findAttributeByTypeAndName(attrDef, ['string', 'number'], 'id', 'uuid', 'code', 'sifra');\n if (!idAttribute) {\n // if no id or code, take the first attribute\n idAttribute = attrDef[0];\n }\n\n return idAttribute?.name ?? null;\n}\n\nexport function findClassTitleAttribute<T>(classType?: ClassType<T>): string | null {\n if (!classType) return null;\n\n const attrDef = getClassAttributeDef(classType);\n if (!attrDef) {\n return null;\n }\n\n let titleAttribute = findAttributeByTypeAndName(attrDef, ['string'], 'name', 'ime', 'title', 'naziv');\n if (!titleAttribute) {\n // if no name or title, take the first attribute\n titleAttribute = attrDef[0];\n }\n\n return titleAttribute?.name ?? null;\n}\n\nexport function getClassAttributeDef<T>(classType?: ClassType<T>) {\n if (!classType) return null;\n const attrDefByFn = (classType as any).getAttributeTypeMap?.() as Array<ClassAttributeDef> | undefined;\n if (attrDefByFn) return attrDefByFn;\n const attrDefByProp = (classType as any).attributeTypeMap as Array<ClassAttributeDef> | undefined;\n if (attrDefByProp) return attrDefByProp;\n const attrByObjSer = TypeRegistry.get().findAttributesDefinitionByClassType(classType);\n if (attrByObjSer) return attrByObjSer;\n return null;\n}\n\nfunction findAttributeByTypeAndName(attributes: ClassAttributeDef[], types: string[], ...names: string[]): ClassAttributeDef | null {\n for (const name of names) {\n const attribute = attributes.find(a => types.some(t => t === a.type) && a.name === name);\n if (attribute) {\n return attribute;\n }\n }\n return null;\n}\n\nexport function trySetLookupItemsProperties<T>(lookup: ILookupDescriptor<T>, idAsTrack = true) {\n if (lookup.dataProvider.classType) {\n if (!lookup.optionsValueProperty && !lookup.optionsTrackProperty) {\n const idProperty = findClassIdAttribute(lookup.dataProvider.classType) ?? undefined;\n if (idProperty && !lookup.optionsValueProperty && !lookup.optionsTrackProperty) {\n if (idAsTrack) {\n lookup.withOptionsTrackPropertyUnsafe(idProperty);\n }\n }\n }\n if (!lookup.optionsLabelProperty) {\n const labelProperty = findClassTitleAttribute(lookup.dataProvider.classType);\n if (labelProperty) {\n lookup.withOptionsLabelPropertyUnsafe(labelProperty);\n }\n }\n }\n}\n","import {ClassType} from '@mediusinc/mng-commons/core';\n\nexport class TypeDescriptor<Type> {\n private readonly _classType?: ClassType<Type>;\n\n public constructor(classType?: ClassType<Type>) {\n this._classType = classType;\n }\n\n public get classType() {\n return this._classType;\n }\n}\n\nexport function type<Type>(): TypeDescriptor<Type> {\n return new TypeDescriptor<Type>();\n}\n\nexport function typeClass<Type>(type: ClassType<Type>): TypeDescriptor<Type> {\n return new TypeDescriptor<Type>(type);\n}\n","import {ClassOptType, ClassType, CommonsInternalError, IModelDescriptor, findReflectTypeName} from '@mediusinc/mng-commons/core';\n\nimport {findClassIdAttribute, findClassTitleAttribute} from '../helpers/model';\nimport {TypeDescriptor} from './type.descriptor';\n\nexport class ModelDescriptor<Model, ModelClass = ClassOptType<Model>> implements IModelDescriptor<Model, ModelClass> {\n private readonly _type: ModelClass;\n private readonly _typeName?: string;\n private _i18nBaseKey: string;\n private _idProperty?: string;\n private _titleProperty?: string | ((item: Model) => string);\n\n public constructor(type: ModelClass, idProperty?: string, titleProperty?: string | ((item: Model) => string), i18nBaseKey?: string | ClassType<any>) {\n this._type = type;\n this._typeName = findReflectTypeName(type as ClassType<Model>) ?? undefined;\n this._idProperty = idProperty;\n this._titleProperty = titleProperty;\n if (!this._idProperty && type) {\n this._idProperty = findClassIdAttribute(type as unknown as ClassType<Model>) ?? undefined;\n }\n if (!this._titleProperty && type) {\n this._titleProperty = findClassTitleAttribute(type as unknown as ClassType<Model>) ?? undefined;\n }\n this._i18nBaseKey = (typeof i18nBaseKey === 'string' || typeof i18nBaseKey === 'undefined' ? i18nBaseKey : findReflectTypeName(i18nBaseKey)) ?? this._typeName ?? '';\n }\n\n /**\n * @deprecated Use standalone {model()} instead.\n */\n public static create<Model>(idProperty?: keyof Model, titleProperty?: keyof Model, i18nBaseKey?: string | ClassType<unknown>): ModelDescriptor<Model, undefined> {\n return new ModelDescriptor(undefined, idProperty as string, titleProperty as string, i18nBaseKey);\n }\n\n /**\n * @deprecated Use standalone {model()} instead.\n */\n public static fromClass<Model>(\n type: ClassType<Model>,\n idProperty?: keyof Model,\n titleProperty?: keyof Model,\n i18nBaseKey?: string | ClassType<unknown>\n ): ModelDescriptor<Model, ClassType<Model>> {\n return new ModelDescriptor(type, idProperty as string, titleProperty as string, i18nBaseKey);\n }\n\n public get type() {\n return this._type;\n }\n\n public get typeName() {\n return this._typeName;\n }\n\n public get i18nBaseKey() {\n return this._i18nBaseKey;\n }\n\n public get idProperty() {\n return this._idProperty;\n }\n\n public get titleProperty() {\n return this._titleProperty;\n }\n\n public withIdProperty(property: keyof Model): this {\n this._idProperty = property as string;\n return this;\n }\n\n public withIdPropertyUnsafe(property: string): this {\n this._idProperty = property;\n return this;\n }\n\n public withTitleProperty(property: keyof Model): this {\n this._titleProperty = property as string;\n return this;\n }\n\n public withTitlePropertyUnsafe(property: string): this {\n this._titleProperty = property;\n return this;\n }\n\n public withI18nBase(base: ClassType<any> | string): this {\n if (typeof base !== 'string') {\n const typeName = findReflectTypeName(base);\n if (!typeName) {\n throw new CommonsInternalError(`Could not find define i18nBaseKey for ${base} on model ${this.typeName}`);\n }\n base = typeName;\n }\n this._i18nBaseKey = base;\n return this;\n }\n\n public copy(): ModelDescriptor<Model, ModelClass> {\n return new ModelDescriptor<Model, ModelClass>(this._type, this._idProperty, this._titleProperty, this._i18nBaseKey);\n }\n}\n\nexport type ModelDescriptorCreateOpts<Model> = {\n id?: keyof Model;\n title?: keyof Model | ((item: Model) => string);\n i18nBase?: string | ClassType<any>;\n};\n\nexport function model<Model>(): ModelDescriptor<Model, undefined>;\nexport function model<Model>(opts: ModelDescriptorCreateOpts<Model>): ModelDescriptor<Model, undefined>;\nexport function model<Model>(type: TypeDescriptor<Model>, opts?: ModelDescriptorCreateOpts<Model>): ModelDescriptor<Model, undefined>;\nexport function model<Model>(clazz: ClassType<Model>, opts?: ModelDescriptorCreateOpts<Model>): ModelDescriptor<Model, ClassType<Model>>;\nexport function model<Model>(typeOrClassOrOpts?: ClassType<Model> | TypeDescriptor<Model> | ModelDescriptorCreateOpts<Model>, opts?: ModelDescriptorCreateOpts<Model>) {\n if (typeOrClassOrOpts == null) {\n return new ModelDescriptor<Model, undefined>(undefined);\n } else if (typeOrClassOrOpts instanceof TypeDescriptor) {\n return new ModelDescriptor<Model, undefined>(undefined, opts?.id as string, opts?.title as string, opts?.i18nBase);\n } else if (typeof typeOrClassOrOpts === 'function') {\n return new ModelDescriptor<Model, ClassType<Model>>(typeOrClassOrOpts as ClassType<Model>, opts?.id as string, opts?.title as string, opts?.i18nBase);\n } else {\n const typeOrClassAsOpts = typeOrClassOrOpts as ModelDescriptorCreateOpts<Model>;\n return new ModelDescriptor<Model, undefined>(undefined, typeOrClassAsOpts?.id as string, typeOrClassAsOpts?.title as string, typeOrClassAsOpts?.i18nBase);\n }\n}\n","import {TranslateService} from '@ngx-translate/core';\nimport {Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {KeyOfType, getI18n, getI18nTypeKeyBasePath, getI18nTypeParams, getI18nTypeParamsAsync} from '@mediusinc/mng-commons/core';\n\nimport {ModelDescriptor} from '../descriptors/model.descriptor';\n\nexport function getI18nForModel(\n translate: TranslateService,\n model: ModelDescriptor<any>,\n keyPath: string,\n customKey?: string,\n item?: any,\n fallbackKey?: string,\n params?: any\n): string | null {\n const keys = getKeysByPriority(model, keyPath, customKey, fallbackKey);\n const i18nParams = getI18nModelParams(translate, model, item, params);\n return getI18n(translate, i18nParams, ...keys);\n}\n\nexport function getI18nModelParams(translate: TranslateService, model?: ModelDescriptor<any>, item?: any, params: any = {}): any {\n const i18nParams = getI18nTypeParams(translate, model?.i18nBaseKey, item, params);\n return populateI18nModelParams(model?.idProperty, model?.titleProperty, i18nParams);\n}\n\nexport function getI18nModelParamsAsync(translate: TranslateService, model?: ModelDescriptor<any>, item?: any, params: any = {}): Observable<any> {\n return getI18nTypeParamsAsync(translate, model?.i18nBaseKey, item, params).pipe(\n map(i18nParams => populateI18nModelParams(model?.idProperty, model?.titleProperty, item, i18nParams))\n );\n}\n\nexport function populateI18nModelParams(idProperty?: KeyOfType, titleProperty?: KeyOfType | ((item: any) => string), item?: any, params: any = {}): any {\n const paramsRes = {...params, itemId: '', itemTitle: ''};\n if (item) {\n if (idProperty && item[idProperty]) {\n paramsRes.itemId = item[idProperty];\n }\n if (typeof titleProperty === 'function') {\n paramsRes.itemTitle = titleProperty(item);\n } else if (titleProperty && item[titleProperty]) {\n paramsRes.itemTitle = item[titleProperty];\n }\n }\n return paramsRes;\n}\n\nfunction getKeysByPriority(model: ModelDescriptor<any>, keyPath: string, customKey?: string, fallbackKey?: string) {\n const keys = [];\n if (customKey) {\n keys.push(customKey);\n }\n const modelActionKey = getI18nTypeKeyBasePath(model.i18nBaseKey, ...keyPath);\n keys.push(modelActionKey);\n if (fallbackKey) {\n keys.push(fallbackKey);\n }\n return keys;\n}\n","// data providers\nexport * from './data-providers/base-from-type-data-provider.factory';\n\n// descriptors\nexport * from './descriptors/enum.descriptor';\nexport * from './descriptors/model.descriptor';\nexport * from './descriptors/type.descriptor';\n\n// helpers\nexport * from './helpers/i18n';\nexport * from './helpers/model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAWgB,SAAA,YAAY,CAAiE,IAA4B,EAAE,WAA0B,EAAA;AACjJ,IAAA,OAAO,IAAI,gBAAgB,CAA0C,SAAS,EAAE,WAA2B,CAAC,CAAC;AACjH,CAAC;AAOe,SAAA,qBAAqB,CACjC,KAAyC,EACzC,WAA0B,EAAA;IAE1B,OAAO,IAAI,gBAAgB,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I,IAAA,MAAM,SAAS,GAAG,EAAC,GAAG,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAC,CAAC;IACzD,IAAI,IAAI,EAAE;AACN,QAAA,IAAI,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,EAAE;AAChC,YAAA,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;SACvC;AACD,QAAA,IAAI,OAAO,aAAa,KAAK,UAAU,EAAE;AACrC,YAAA,SAAS,CAAC,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;SAC7C;AAAM,aAAA,IAAI,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE;AAC7C,YAAA,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;SAC7C;KACJ;AACD,IAAA,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,iBAAiB,CAAC,KAA2B,EAAE,OAAe,EAAE,SAAkB,EAAE,WAAoB,EAAA;IAC7G,MAAM,IAAI,GAAG,EAAE,CAAC;IAChB,IAAI,SAAS,EAAE;AACX,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACxB;IACD,MAAM,cAAc,GAAG,sBAAsB,CAAC,KAAK,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,CAAC;AAC7E,IAAA,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC1B,IAAI,WAAW,EAAE;AACb,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KAC1B;AACD,IAAA,OAAO,IAAI,CAAC;AAChB;;AC3DA;;ACAA;;AAEG;;;;"}
|
|
@@ -1111,7 +1111,7 @@ class TableDynamicDescriptorInst extends TableDescriptorInst {
|
|
|
1111
1111
|
this._sortColumnMode = TableDynamicColumnsModeEnum.EXCLUDE;
|
|
1112
1112
|
this._filterColumnMode = TableDynamicColumnsModeEnum.EXCLUDE;
|
|
1113
1113
|
this._columns = [];
|
|
1114
|
-
if (model.titleProperty) {
|
|
1114
|
+
if (typeof model.titleProperty === 'string') {
|
|
1115
1115
|
this.withTitle(model.titleProperty);
|
|
1116
1116
|
}
|
|
1117
1117
|
}
|