@mediusinc/mng-commons 5.1.0 → 5.2.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.
- package/core/components/notification/notification-wrapper.component.d.ts +3 -1
- package/core/error/error-helpers.d.ts +5 -0
- package/core/error/error.model.d.ts +6 -0
- package/core/helpers/route.d.ts +1 -1
- package/core/models/menu.model.d.ts +2 -1
- package/core/router/route-builder.d.ts +0 -1
- package/core/security/permission.service.d.ts +13 -5
- package/core/security/permissions.model.d.ts +27 -2
- package/esm2022/core/components/notification/notification-wrapper.component.mjs +6 -5
- package/esm2022/core/error/error-helpers.mjs +8 -1
- package/esm2022/core/error/error.model.mjs +2 -1
- package/esm2022/core/models/menu.model.mjs +1 -1
- package/esm2022/core/router/route-builder.mjs +1 -24
- package/esm2022/core/rxjs/map-data-list-result-operator.mjs +4 -1
- package/esm2022/core/security/permission.guard.mjs +2 -2
- package/esm2022/core/security/permission.service.mjs +65 -15
- package/esm2022/core/security/permissions.model.mjs +1 -1
- package/esm2022/form/components/date-range/date-range.component.mjs +9 -3
- package/esm2022/form/components/number-range/number-range.component.mjs +106 -0
- package/esm2022/form/index.mjs +2 -1
- package/esm2022/model/helpers/i18n.mjs +2 -2
- package/esm2022/table/api/descriptors/table.descriptor.mjs +11 -1
- package/esm2022/table/components/column-filter-full/column-filter-full.component.mjs +72 -10
- package/esm2022/table/components/table/table.component.mjs +15 -12
- package/esm2022/table/helpers/notification.mjs +2 -2
- package/esm2022/table/services/data-list.service.mjs +9 -3
- package/esm2022/tableview/action/components/action/action.component.mjs +6 -7
- package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +7 -3
- package/esm2022/tableview/action/components/table/action-table.component.mjs +8 -3
- package/esm2022/tableview/action/helpers/i18n.mjs +4 -4
- package/esm2022/tableview/action/models/execution/action-context.model.mjs +9 -1
- package/esm2022/tableview/action/services/action-executor.service.mjs +74 -14
- package/esm2022/tableview/api/action/descriptors/action-descriptor.factory.mjs +2 -2
- package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +2 -1
- package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +1 -1
- package/esm2022/tableview/api/action/models/action-descriptor.types.mjs +1 -1
- package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +2 -3
- package/esm2022/tableview/api/editor/models/form-editor.event.mjs +2 -1
- package/esm2022/tableview/api/editor/models/form-editor.interface.mjs +1 -1
- package/esm2022/tableview/api/editor/models/formly-options.model.mjs +1 -1
- package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +16 -10
- package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +2 -6
- package/esm2022/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.mjs +2 -3
- package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +2 -6
- package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +2 -3
- package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +3 -4
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +21 -9
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +17 -6
- package/esm2022/tableview/editor/components/formly/fields/formly-field-type.abstract.component.mjs +18 -3
- package/esm2022/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +12 -4
- package/esm2022/tableview/editor/services/form-editor.service.mjs +3 -3
- package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +2 -2
- package/fesm2022/mediusinc-mng-commons-core.mjs +82 -42
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +109 -3
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +10 -0
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table.mjs +94 -23
- package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +4 -3
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +172 -62
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/form/components/date-range/date-range.component.d.ts +4 -2
- package/form/components/number-range/number-range.component.d.ts +30 -0
- package/form/index.d.ts +1 -0
- package/i18n/en.json +1 -1
- package/i18n/sl.json +1 -1
- package/package.json +7 -7
- package/table/api/descriptors/table.descriptor.d.ts +3 -0
- package/table/components/column-filter-full/column-filter-full.component.d.ts +3 -2
- package/table/components/table/table.component.d.ts +7 -2
- package/table/services/data-list.service.d.ts +5 -2
- package/tableview/action/components/action/action.component.d.ts +1 -2
- package/tableview/action/components/editor/action-editor.component.d.ts +1 -1
- package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +7 -5
- package/tableview/action/components/localization/data-language-dropdown.component.d.ts +1 -1
- package/tableview/action/components/table/action-table.component.d.ts +8 -4
- package/tableview/action/models/execution/action-context.model.d.ts +7 -0
- package/tableview/action/services/action-executor.service.d.ts +1 -1
- package/tableview/action/services/view-container.service.d.ts +1 -1
- package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +2 -2
- package/tableview/api/action/descriptors/action.descriptor.d.ts +38 -38
- package/tableview/api/action/models/action-descriptor.types.d.ts +2 -2
- package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +1 -1
- package/tableview/api/editor/models/form-editor.event.d.ts +4 -0
- package/tableview/api/editor/models/form-editor.interface.d.ts +4 -1
- package/tableview/api/editor/models/formly-options.model.d.ts +4 -4
- package/tableview/editor/components/editor/form-editor.component.d.ts +6 -2
- package/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +0 -1
- package/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.d.ts +0 -1
- package/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +0 -1
- package/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.d.ts +0 -1
- package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +0 -1
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +3 -1
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +3 -1
- package/tableview/editor/components/formly/fields/formly-field-type.abstract.component.d.ts +5 -1
- package/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +1 -0
- package/tableview/editor/services/form-editor.service.d.ts +2 -2
- package/tableview/tableview/components/tableview/tableview.component.d.ts +4 -4
- package/version-info.json +6 -6
|
@@ -215,7 +215,7 @@ function getI18nForModel(translate, model, keyPath, customKey, item, fallbackKey
|
|
|
215
215
|
}
|
|
216
216
|
function getI18nModelParams(translate, model, item, params = {}) {
|
|
217
217
|
const i18nParams = getI18nTypeParams(translate, model?.i18nBaseKey, item, params);
|
|
218
|
-
return populateI18nModelParams(model?.idProperty, model?.titleProperty, i18nParams);
|
|
218
|
+
return populateI18nModelParams(model?.idProperty, model?.titleProperty, item, i18nParams);
|
|
219
219
|
}
|
|
220
220
|
function getI18nModelParamsAsync(translate, model, item, params = {}) {
|
|
221
221
|
return getI18nTypeParamsAsync(translate, model?.i18nBaseKey, item, params).pipe(map(i18nParams => populateI18nModelParams(model?.idProperty, model?.titleProperty, item, i18nParams)));
|
|
@@ -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 | ((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,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,WAAW,GAAA;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;KAC5B;AAED,IAAA,IAAW,WAAW,GAAA;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;KAC5B;AACJ,CAAA;AAEe,SAAA,SAAS,CAAO,KAAW,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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;;;;"}
|
|
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, 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) => 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,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;AACp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a,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;;;;"}
|
|
@@ -633,6 +633,8 @@ class TableDescriptorInst {
|
|
|
633
633
|
// row expand
|
|
634
634
|
this._rowExpandable = false;
|
|
635
635
|
this._rowExpandableColSpan = 100;
|
|
636
|
+
// row reorder
|
|
637
|
+
this._rowReorderable = false;
|
|
636
638
|
this._model = model;
|
|
637
639
|
this._trackProperty = this._model.idProperty;
|
|
638
640
|
this._autoGenerated = autoGenerated;
|
|
@@ -721,6 +723,9 @@ class TableDescriptorInst {
|
|
|
721
723
|
get localizationLocaleProperty() {
|
|
722
724
|
return this._localizationLocaleProperty;
|
|
723
725
|
}
|
|
726
|
+
get rowReorderable() {
|
|
727
|
+
return this._rowReorderable;
|
|
728
|
+
}
|
|
724
729
|
get rowExpandable() {
|
|
725
730
|
return this._rowExpandable;
|
|
726
731
|
}
|
|
@@ -1071,6 +1076,10 @@ class TableDescriptorInst {
|
|
|
1071
1076
|
}
|
|
1072
1077
|
return this;
|
|
1073
1078
|
}
|
|
1079
|
+
withRowReorderable(reordable = true) {
|
|
1080
|
+
this._rowReorderable = reordable;
|
|
1081
|
+
return this;
|
|
1082
|
+
}
|
|
1074
1083
|
copyFieldsTo(obj) {
|
|
1075
1084
|
obj._title = this._title;
|
|
1076
1085
|
obj._hideHeader = this._hideHeader;
|
|
@@ -1094,6 +1103,7 @@ class TableDescriptorInst {
|
|
|
1094
1103
|
obj._rowExpandable = this._rowExpandable;
|
|
1095
1104
|
obj._rowExpandableColSpan = this._rowExpandableColSpan;
|
|
1096
1105
|
obj._rowExpandableProperty = this._rowExpandableProperty;
|
|
1106
|
+
obj._rowReorderable = this._rowReorderable;
|
|
1097
1107
|
}
|
|
1098
1108
|
copy() {
|
|
1099
1109
|
const descriptor = new TableDescriptorInst(this.model.copy());
|