xt-components 0.6.3 → 0.7.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/fesm2022/xt-components.mjs +908 -317
- package/fesm2022/xt-components.mjs.map +1 -1
- package/package.json +15 -14
- package/types/xt-components.d.ts +1367 -0
- package/index.d.ts +0 -667
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xt-components.mjs","sources":["../../../projects/xt-components/src/lib/registry/xt-plugin-registry.ts","../../../projects/xt-components/src/lib/xt-context.ts","../../../projects/xt-components/src/lib/xt-resolved-component.ts","../../../projects/xt-components/src/globals.ts","../../../projects/xt-components/src/lib/angular/xt-tokens.ts","../../../projects/xt-components/src/lib/resolver/xt-registry-resolver.ts","../../../projects/xt-components/src/lib/action/xt-action.ts","../../../projects/xt-components/src/lib/test/store-test-helper.ts","../../../projects/xt-components/src/lib/store/store-support.ts","../../../projects/xt-components/src/lib/angular/xt-resolver.service.ts","../../../projects/xt-components/src/lib/output/xt-base-output.ts","../../../projects/xt-components/src/lib/render/xt-render.component.ts","../../../projects/xt-components/src/lib/render/xt-render.component.html","../../../projects/xt-components/src/lib/render/xt-render-sub.component.ts","../../../projects/xt-components/src/lib/render/xt-render-sub.component.html","../../../projects/xt-components/src/lib/output/xt-base-input.ts","../../../projects/xt-components/src/lib/xt-simple/xt-simple.component.ts","../../../projects/xt-components/src/lib/xt-composite/xt-composite.component.ts","../../../projects/xt-components/src/lib/angular/xt-message-handler.service.ts","../../../projects/xt-components/src/lib/type/type-helper.ts","../../../projects/xt-components/src/lib/test/xt-unit-test-helper.ts","../../../projects/xt-components/src/lib/test/xt-test-helper-components.ts","../../../projects/xt-components/src/public-api.ts","../../../projects/xt-components/src/xt-components.ts"],"sourcesContent":["import { XtActionHandlerInfo, XtActionInfo, XtComponentInfo, XtPluginInfo } from '../plugin/xt-plugin-info';\nimport { signal, Type } from '@angular/core';\nimport { XtComponent } from '../xt-component';\n\nexport class XtPluginRegistry {\n\n pluginRegistry = new Map<string, XtPluginInfo> ();\n componentRegistry = new Map<string, XtComponentInfo<any>> ();\n componentByTypeCache = new Map<string, XtComponentInfo<any>[]> ();\n protected actionByTypeRegistry = new Map<string, Map<string, XtActionInfo<any>>> ();\n\n listComponents = signal(new Array<XtComponentInfo<any>>());\n listPlugins = signal(new Array<XtPluginInfo>());\n\n /**\n * The component can manage any standard javascript primitives types. That's usually the default whenever we don't know any particular type\n * string\n * number\n * bigint\n * boolean\n * undefined\n * null\n * symbol is not managed\n * Date, while an object and not a primitive, is managed\n */\n public static readonly ANY_PRIMITIVE_TYPE=\"ANY_PRIMITIVE_TYPE\";\n /**\n * The components can manage any composite javascript type. Default when no type has been defined and it's a user defined javascript object (not a data type)\n */\n public static readonly ANY_OBJECT_TYPE=\"ANY_OBJECT_TYPE\";\n\n public static readonly ANY_PRIMITIVE_SET = \"ANY_PRIMITIVE_SET\";\n\n public static readonly ANY_OBJECT_SET = \"ANY_OBJECT_SET\";\n\n /**\n * Whenever a component can handle any type of reference to a single entity or to multiple entities.\n */\n public static readonly ANY_SINGLE_REFERENCE = \"ANY_SINGLE_REFERENCE\";\n\n public static readonly ANY_MULTIPLE_REFERENCE = \"ANY_MULTIPLE_REFERENCE\";\n\n registerPlugin (info:XtPluginInfo) {\n this.pluginRegistry.set (info.name, info);\n\n if (info.components != null) {\n let updated=false;\n for (const comp of info.components) {\n updated=true;\n this.registerComponent (comp);\n }\n if (updated) this.componentByTypeCache.clear(); // Force recalculation of type\n }\n\n if( info.actionHandlers!=null) {\n for (const handler of info.actionHandlers) {\n this.registerActionHandler (handler);\n }\n }\n\n this.listPlugins.update((array) => {\n let found=false;\n for (let i=0; i<array.length; i++) {\n if (array[i].name==info.name) {\n found=true;\n array[i] = info;\n }\n }\n if( !found)\n array.push(info);\n return [...array]; // You have to send another value, not just update the existing one.\n });\n\n }\n\n registerComponent<T> (info:XtComponentInfo<T>) {\n this.componentRegistry.set (info.componentName, info);\n this.listComponents.update((array) => {\n let found=false;\n for (let i=0; i<array.length; i++) {\n if (array[i].componentName==info.componentName) {\n found=true;\n array[i] = info;\n }\n }\n if( !found)\n array.push(info);\n return array;\n });\n }\n\n findComponentsForType<T> (valueType:string|null|undefined, value?:T): XtComponentInfo<any>[] {\n let originalType=valueType;\n //console.debug('Finding type from '+valueType+' with value ',value);\n // We don't know the value type, let's try to guess if it's a primitive or object based on the value\n if ( valueType == null) {\n valueType = XtPluginRegistry.ANY_OBJECT_TYPE;\n if ((value == null) || (typeof value != 'object')) {\n valueType=XtPluginRegistry.ANY_PRIMITIVE_TYPE;\n } else if (value instanceof Date) {\n valueType=XtPluginRegistry.ANY_PRIMITIVE_TYPE;\n }\n\n if (Array.isArray(value)) {\n valueType = (valueType===XtPluginRegistry.ANY_PRIMITIVE_TYPE)?XtPluginRegistry.ANY_PRIMITIVE_SET:XtPluginRegistry.ANY_OBJECT_SET;\n }\n } else { // originalType has been defined.\n if (Array.isArray(value)) {\n valueType=valueType.endsWith('[]')?valueType:valueType+'[]';\n originalType=valueType;\n }\n }\n //console.debug('Type found is '+valueType);\n\n let ret = this.componentByTypeCache.get(valueType);\n if (ret == null) {\n ret = new Array<XtComponentInfo<any>> ()\n for (const comp of this.componentRegistry) {\n const info=comp[1];\n if (info.typesHandled.includes (valueType)) {\n ret.push(info);\n }\n }\n\n if ((ret.length == 0) && (originalType!=null)) {\n // Couldn't find a specific component, let's try the generic ones, so we don't pass any type\n ret = this.findComponentsForType(null, value);\n // Cache the component only if we were able to assert its type.\n // If no type has been given and value is null, then we cannot assess the real type\n if (value!=null) {\n this.componentByTypeCache.set(originalType, ret);\n }\n } else {\n // Cache the component only if we were able to assert its type.\n // If no type has been given and value is null, then we cannot assess the real type\n if ((value!=null) || (originalType!=null)) {\n this.componentByTypeCache.set(originalType ?? valueType, ret);\n }\n }\n\n }\n return ret;\n }\n\n public static registry (): XtPluginRegistry {\n return XT_REGISTRY;\n }\n\n findComponentInfo(type: Type<XtComponent<any>>): XtComponentInfo<any>|null {\n // Search for the component registered with this class\n for (const info of this.componentRegistry.values()) {\n if (info.componentClass==type) {\n return info;\n }\n }\n return null;\n }\n\n getComponentInfo(type: Type<XtComponent<any>>): XtComponentInfo<any> {\n const ret= this.findComponentInfo(type);\n if (ret==null) {throw new Error (\"No component found with class \"+type);}\n return ret;\n }\n\n registerActionHandler<T>(handlerInfo:XtActionHandlerInfo<T>) {\n for (const type of handlerInfo.types) {\n const handlers = handlerInfo.actions;\n for (const actionName of Object.keys(handlers)) {\n let exist = this.actionByTypeRegistry.get(type);\n if (exist==null) {\n exist = new Map();\n this.actionByTypeRegistry.set(type, exist);\n }\n exist.set(actionName, handlers[actionName]);\n }\n }\n }\n\n findActionInfo<T>(type:string, actionName:string):XtActionInfo<T>|undefined {\n const handlers=this.actionByTypeRegistry.get(type);\n if (handlers!=null) {\n return handlers.get(actionName);\n }\n return undefined;\n }\n\n listActionInfos<T> (type:string): {name:string, info: XtActionInfo<T>}[] {\n const handlers=this.actionByTypeRegistry.get(type);\n if (handlers!=null) {\n return Array.from(handlers.entries()).map(([name,info]) => {\n return {name:name,info:info};\n });\n }\n else return []\n }\n}\n","import { FormGroup } from '@angular/forms';\nimport { isTypeReference, XtBaseTypeReference, XtTypeHierarchy, XtTypeReference, XtTypeResolver } from 'xt-type';\nimport { computed, Signal, signal, WritableSignal } from '@angular/core';\nimport { XtAction } from './action/xt-action';\nimport { XtPluginRegistry } from './registry/xt-plugin-registry';\n\n/**\n * A XtContext provides all the necessary information for an ng-extended component to operate. It is passed from parent to child component and pass\n * - The display mode - View, Inline view or Edit\n * - The value, either directly as a signal or in a formgroup when editing.\n * - The valueType, necessary to find the right ng-extended component to display\n *\n * To do this, it maintains a hierarchy of context and subContexts by name.\n */\nexport type XtContext<T> = {\n\n displayMode: XtDisplayMode;\n\n subName?: string; // The subName in the parentFormGroup and parentContext\n parentFormGroup?: FormGroup;\n localFormGroup?: FormGroup;\n\n /**\n * When the value in the context is a reference to another type\n */\n reference?:XtTypeReference\n\n /**\n * If it's a reference, we keep the context referenced\n */\n referencedContext?:XtContext<any>;\n\n /**\n * creates the referencedContext by using this referenced value\n * @param val\n *\n updateReferencedContext(val: any, valueType?:string): void;*/\n\n /**\n * Signal when all the asynchronously defined subreferences are resolved.\n *\n subReferencesResolved: WritableSignal<boolean>;\n*/\n\n // A parentContext if defined\n parentContext?:XtContext<any>;\n\n isInForm (): boolean;\n\n formGroup () : FormGroup | undefined;\n\n formControlNameOrNull():string|null;\n\n formControlValue (): any | null;\n\n subValue (subName?:string):T | null | undefined;\n\n subContext(subName: string | undefined | null, subType?:string, typeResolver?: XtTypeResolver | null): XtContext<any>;\n\n elementSetContext(subElement: any): XtContext<any>;\n\n displayValue: Signal<T|null>;\n\n setDisplayValue (newValue:T|null|undefined, type?:string): XtContext<T>;\n\n setFormValue (newValue:T|null|undefined, markAsDirty?:boolean): boolean;\n\n value(): T | null | undefined;\n\n valueType?:string;\n\n toString (): string;\n\n listActions: WritableSignal<XtAction<T>[] | null>;\n\n isReference ():boolean;\n\n setReferenceInfo (ref:XtTypeReference):void;\n\n}\n\nexport type XtDisplayMode = 'INLINE_VIEW'|'FULL_VIEW'|'FULL_EDITABLE'|'LIST_VIEW';\n\nexport class XtBaseContext<T> implements XtContext<T>{\n displayMode: XtDisplayMode = 'FULL_VIEW';\n\n /**\n * When editable, the value is stored in a parent formGroup\n */\n subName?: string;\n parentFormGroup?: FormGroup<any>;\n\n /**\n * When the context is a child, it potentially needs to update its parent value\n */\n parentContext?:XtBaseContext<any>;\n\n /**\n * All child contexts are kept in this map\n */\n protected childContexts?:Map<string, XtBaseContext<any>>;\n\n /**\n * localFormGroup exists only for composite components: it's children are all gathered in a form group\n */\n localFormGroup?: FormGroup<any>;\n\n /**\n * When not managed by a form, the value is here\n */\n nonFormValue?: WritableSignal<T|null>;\n\n valueType?:string;\n\n /**\n * When the value in the context is a reference to another type\n */\n reference?:XtTypeReference;\n\n /**\n * If it's a reference, we keep the context referenced\n *\n referencedContext?:XtContext<any>;*/\n\n //subReferencesResolved = signal(false);\n\n /**\n * Keeps track of all the possible actions for this context\n * @protected\n */\n listActions = signal<XtAction<T>[]|null>(null);\n\n /**\n *\n * @param displayMode\n * @param readOnly\n * @param parentGroup\n * @param controlName\n */\n\n constructor (displayMode: XtDisplayMode, subName?: string, parentGroup?: FormGroup, parentContext?:XtBaseContext<any>)\n {\n this.displayMode=displayMode;\n this.parentFormGroup=parentGroup;\n this.parentContext=parentContext;\n this.subName=subName;\n if ((parentGroup!=null) && (subName!=null)) {\n const subControl=parentGroup.get(subName);\n // If it's a form group, then it should be set as localFormGroup\n if ((subControl as FormGroup)?.controls!=null) {\n this.localFormGroup=subControl as FormGroup;\n }\n }\n }\n\n setDisplayValue (newValue:T|null|undefined, type?:string, updateParent:boolean=true): XtBaseContext<T> {\n if (newValue!==undefined){\n const oldValue = this.nonFormValue?this.nonFormValue():null;\n if (this.nonFormValue==null) {\n if ((this.childContexts!=null) && (this.childContexts.size>0)) throw new Error ('An XtContext with no values cannot have children ',{cause:this});\n this.nonFormValue=signal(newValue);\n }else {\n this.nonFormValue.set(newValue);\n }\n\n // Change the children values if needed\n if (this.childContexts!=null) {\n if (newValue==null) {\n for (const [subName, child] of this.childContexts) {\n child.setDisplayValue(null, undefined, false);\n }\n\n } else if (oldValue!=null) {\n for (const [subName, child] of this.childContexts) {\n if (newValue[subName as keyof T]!=oldValue[subName as keyof T]) {\n // The value has changed, let's update\n child.setDisplayValue(newValue[subName as keyof T], undefined, false);\n }\n }\n }\n }\n\n if ((updateParent) && (this.subName!=null))\n this.parentContext?.updateSubDisplayValue(this.subName,newValue);\n }\n\n if (type!==undefined)\n this.valueType = type;\n return this;\n }\n\n displayValue = computed( ()=> {\n if (this.nonFormValue!==undefined) {\n return this.nonFormValue();\n } else {\n throw new Error (\"Cannot display a value that does not exist. Are you sure you're not using Reactive Form with this context? \"+ this.toString());\n }\n });\n\n isInForm (): boolean {\n return (this.formGroup()!=null);\n }\n\n formControlNameOrNull():string|null {\n return this.subName??null;\n }\n\n value ():T | null | undefined {\n if (this.nonFormValue!=null)\n return this.nonFormValue()??this.formControlValue();\n else\n return this.formControlValue();\n }\n\n subValue (subsubName?:string):any | null | undefined {\n const value = this.nonFormValue?this.nonFormValue():this.formControlValue();\n if ((subsubName != null) && (value != null)) {\n return value[subsubName as keyof typeof value];\n }else {\n return value;\n }\n }\n\n /**\n * Enable child contexts to update its own value in the parent context whenever it's value changes\n */\n protected updateSubDisplayValue (subName:string, subValue:any): void {\n if (this.nonFormValue!=null) {\n let newValue = this.nonFormValue();\n if (newValue==null) {\n const newValue = {} as T;\n newValue[subName as keyof T]=subValue\n this.nonFormValue.set(newValue);\n } else {\n newValue[subName as keyof T] = subValue; // Discretly update the subValue without triggering parent signal\n }\n } else {\n throw new Error (\"No nonFormValue to update subDisplayValue\"+this.toString());\n }\n }\n\n formControlValue (): T | null | undefined {\n let ret:T|undefined|null=undefined;\n if (this.isInForm()) {\n if (this.subName!=null) {\n //console.debug (\"formControlValue parentGroup value is \", this.parentFormGroup?.value);\n ret=this.parentFormGroup?.value[this.subName];\n } else {\n ret= this.parentFormGroup?.value;\n }\n } else {\n ret= undefined;\n }\n //console.debug(\"formControlValue of \"+this.subName+ \" is \",ret);\n return ret;\n }\n\n setFormValue (newValue:T|null|undefined, markAsDirty=false): boolean {\n if (this.isInForm()) {\n if (this.subName!=null) {\n const control=this.parentFormGroup?.get(this.subName);\n if (control!=null) {\n control.setValue(newValue);\n if (markAsDirty) {\n control.markAsDirty();\n }\n return true;\n } else {\n // Supports setting values without a child form control\n const value=this.parentFormGroup?.getRawValue();\n if (value!=null) {\n if (newValue!==undefined)\n value[this.subName]=newValue;\n else\n delete value[this.subName];\n }\n }\n }\n }\n return false;\n }\n\n\n /**\n * Returns the context associated with a specific element in a set.\n * Value must be an array.\n * @param elementIndex\n */\n elementSetContext(elementIndex:number): XtContext<any> {\n const value = this.value();\n\n if (!Array.isArray(this.value())) {\n throw new Error (\"The value must be an Array / Set to create a subElement context.\")\n }\n\n const indexKey = elementIndex.toString();\n let ret = this.childContexts?.get(indexKey);\n\n if( ret==null) {\n ret = new XtBaseContext<T>(this.displayMode, undefined, undefined, this);\n ret.setDisplayValue((value as any[])[elementIndex]);\n\n if (this.valueType != null) {\n // Convert potential array type into single type\n ret.valueType = this.valueType.endsWith('[]') ? this.valueType.substring(0, this.valueType.length - 2) : this.valueType;\n }\n if( this.childContexts==null) this.childContexts=new Map<string, XtBaseContext<any>>();\n this.childContexts?.set(indexKey, ret);\n }\n return ret;\n }\n\n subContext(subName: string | undefined | null, subType?:string, typeResolver?:XtTypeResolver | null): XtContext<any> {\n if ((subName==null) || (subName.length==0)) {\n return this;\n } else if (this.childContexts?.has(subName)) {\n return this.childContexts?.get(subName)!;\n }else {\n let subValue:WritableSignal<any|null> | null = null;\n let currentGroup = this.formGroup();\n // Recalculate parentGroup and formControlName and value if needed.\n if (currentGroup==null){\n let curValue = this.nonFormValue;\n if (curValue!=null){\n if (curValue()!=null) {\n subValue = signal ((curValue() as any)[subName]);\n }\n }\n if (subValue==null) {\n subValue = signal (null);\n }\n }\n\n const ret = new XtBaseContext<T> (this.displayMode, subName, currentGroup, this);\n if( subValue!=null) ret.nonFormValue=subValue;\n\n if (subType!=null) {\n ret.valueType=subType;\n } else if ((this.valueType!=null) && (typeResolver!=null)) {\n const subType = typeResolver.findType(this.valueType, subName, this.value());\n if( subType!=null) {\n if (isTypeReference(subType)) {\n if( subType.type== XtBaseTypeReference.UNRESOLVED_TYPE) throw new Error (\"You must resolve all reference types before using them in a context. Missing type \"+subType.type+\" for subName \"+subName+\" in valueType \"+this.valueType+\" of context \"+this.toString())\n\n ret.valueType=subType.toType;\n ret.reference=subType;\n if (this.displayMode=='LIST_VIEW') ret.displayMode='INLINE_VIEW'; // We display a reference as inline in a list\n else if (this.displayMode=='FULL_EDITABLE') {\n // We don't edit directly references, we simply enable selection of them.\n ret.valueType=(subType.referenceType=='ONE-TO-MANY')?XtPluginRegistry.ANY_MULTIPLE_REFERENCE:XtPluginRegistry.ANY_SINGLE_REFERENCE;\n }\n } else {\n ret.valueType=(subType as XtTypeHierarchy).type;\n }\n }\n //ret.valueType=typeResolver.findTypeName(this.valueType, subName, this.value())??undefined;\n }\n\n if (this.childContexts==null) this.childContexts=new Map<string, XtBaseContext<any>>();\n this.childContexts.set(subName, ret);\n return ret;\n }\n }\n\n formGroup (): FormGroup|undefined {\n return this.localFormGroup??this.parentFormGroup;\n }\n\n isReference ():boolean {\n return (this.reference!=null);\n }\n\n setReferenceInfo (reference:XtTypeReference):void {\n this.reference=reference;\n //this.subReferencesResolved.set(this.reference!=null);\n }\n\n /**\n * creates the referencedContext by using this referenced value\n * @param val\n *\n updateReferencedContext(val: any, valueType?:string): void {\n if (!this.isReference()) throw new Error ('This context '+this.toString()+' is not a reference.');\n\n if( this.referencedContext==null) {\n let refDisplayMode = 'INLINE_VIEW' as XtDisplayMode;\n if (this.displayMode=='FULL_VIEW') refDisplayMode = 'FULL_VIEW';\n this.referencedContext = new XtBaseContext(refDisplayMode);\n }\n this.referencedContext.setDisplayValue(val);\n if( valueType!=null) this.referencedContext.valueType=valueType;\n }*/\n\n toString():string {\n let ret='XtContext named ';\n ret += this.subName??'None';\n ret += ' with type ';\n ret += this.valueType??'None';\n ret +=' with value ';\n ret += this.nonFormValue?this.nonFormValue():this.formControlValue();\n if (this.isReference()) {\n ret +=' referencing ';\n ret += this.reference?.type\n }\n return ret;\n }\n}\n","import { XtComponentInfo } from './plugin/xt-plugin-info';\n\nexport class XtResolvedComponent {\n componentName: string;\n componentClass: any;\n outputs:boolean;\n\n constructor (componantName:string, componentClass:any, outputs:boolean=false) {\n this.componentName = componantName;\n this.componentClass = componentClass;\n this.outputs = outputs;\n }\n\n public static from (info:XtComponentInfo<any>): XtResolvedComponent {\n const ret = new XtResolvedComponent(info.componentName, info.componentClass);\n if ( (info.outputs!=null) && (info.outputs.length>0)){\n ret.outputs=true;\n }\n return ret;\n }\n}\n","/**\n * The global plugin registry.\n * Plugins will register to this when loaded.\n */\nimport { XtPluginRegistry } from './lib/registry/xt-plugin-registry';\n\ndeclare global {\n\n var XT_REGISTRY:XtPluginRegistry;\n}\n\nexport function initXtPluginRegistry () {\n if (globalThis.XT_REGISTRY==null) {\n globalThis.XT_REGISTRY = new XtPluginRegistry();\n }\n}\n\nexport function xtPluginRegistry (): XtPluginRegistry {\n if (globalThis.XT_REGISTRY==null) {\n initXtPluginRegistry();\n }\n return globalThis.XT_REGISTRY;\n}\n","import { InjectionToken } from \"@angular/core\";\nimport { XtResolver } from \"../resolver/xt-resolver\";\nimport { XtPluginRegistry } from \"../registry/xt-plugin-registry\";\nimport { XtTypeResolver } from \"xt-type\";\nimport { xtPluginRegistry } from '../../globals';\n\nexport const XT_RESOLVER_TOKEN = new InjectionToken<XtResolver> ('Enable providing a custom component resolver.');\n\nexport const XT_TYPE_RESOLVER_TOKEN = new InjectionToken<XtTypeResolver> ('Enable providing a custom type resolver.');\n\nexport const XT_REGISTRY_TOKEN = new InjectionToken<XtPluginRegistry> (\"Injects the Plugin Registry right into your angular component\",\n {\n factory: () => {\n return xtPluginRegistry();\n }\n }\n )\n","import { XtPluginRegistry } from \"../registry/xt-plugin-registry\";\nimport { isTypeReference, XtTypeResolver } from \"xt-type\";\nimport { XtContext } from \"../xt-context\";\nimport { XtResolvedComponent } from \"../xt-resolved-component\";\nimport { XtResolver } from \"./xt-resolver\";\n\nexport class XtRegistryResolver implements XtResolver {\n\n registry:XtPluginRegistry;\n typeResolver: XtTypeResolver;\n\n constructor (registry:XtPluginRegistry, typeResolver:XtTypeResolver) {\n this.registry = registry;\n this.typeResolver = typeResolver;\n }\n\n resolve<T>(baseContext: XtContext<T>, subName?:string): XtResolvedComponent | null {\n let typeToFind = baseContext.valueType;\n\n const typeInfo = this.typeResolver.findType(baseContext.valueType, subName);\n // If it's a type reference, we find the component of the referenced type\n if (isTypeReference(typeInfo)) {\n if (baseContext.displayMode=='FULL_EDITABLE') {\n typeToFind = XtPluginRegistry.ANY_SINGLE_REFERENCE;\n }else {\n typeToFind =typeInfo.toType;\n }\n }\n\n const ret= this.registry.findComponentsForType (typeToFind, baseContext.subValue(subName));\n if (ret!=null && ret.length>0) {\n return XtResolvedComponent.from( ret[0]);\n }\n return null;\n }\n\n}\n","import { signal } from '@angular/core';\nimport { XtActionInfo } from '../plugin/xt-plugin-info';\n\nexport class XtAction<T> {\n name: string;\n info: XtActionInfo<T>;\n enabled = signal<boolean>(false);\n\n constructor(name: string, info: XtActionInfo<T>, enabled?: boolean) {\n this.name = name;\n this.info = info;\n if (enabled!=null) {\n this.enabled.set(enabled);\n }\n }\n}\n","import { from, Observable } from 'rxjs';\nimport {\n IDataTransformer,\n IDocumentInfo,\n IStoreCriteria,\n IStoreCriteriaOperator,\n IStoreManager,\n IStoreProvider,\n StoreSupport\n} from '../store/store-support';\n\n/**\n * A very light and not 100% compatible storemanager in case you are not using xt-store.\n * It can emulate XtStoreManager to some extends for doing some tests\n */\nexport class StoreTestHelper {\n public static ensureTestProviderOnly() {\n StoreSupport.setTestStoreManager(new TestStoreManager());\n }\n}\n\nexport class TestStoreManager implements IStoreManager {\n protected defaultProvider= new TestStoreProvider();\n\n getProvider<T = never>(name?: string): IStoreProvider<T> | undefined {\n return this.defaultProvider;\n }\n\n getProviderSafe<T = never>(name?: string): IStoreProvider<T> {\n return this.defaultProvider;\n }\n\n getDefaultProvider<T = never>(): IStoreProvider<T> | undefined {\n return this.defaultProvider;\n }\n\n getDefaultProviderSafe<T = never>(): IStoreProvider<T> {\n return this.defaultProvider;\n }\n\n newStoreCriteria(name: string, value: any, operator: IStoreCriteriaOperator): IStoreCriteria {\n return new TestStoreCriteria(name, value, operator);\n }\n\n}\n\nexport class TestStoreProvider<T = never> implements IStoreProvider<T> {\n protected data = new Map<string, Map<string,any>> ();\n\n protected getOrCreateArray (name: string): Map<string,T> {\n let ret=this.data.get(name);\n if (ret==null) {\n ret = new Map<string, T>();\n this.data.set(name, ret);\n }\n return ret;\n }\n\n protected extractKey (value: any, create?:boolean):string {\n if (value._id!=null) return value._id; // ManagedData key\n else if (value.id!=null) return value.id;\n else {\n if (create===true) {\n const newId = Math.random().toString(36).substring(2, 8);\n value._id=newId;\n return newId;\n }\n return value.toString();\n }\n }\n\n storeEntity(name: string, entity: T): Promise<T> {\n this.getOrCreateArray(name).set(this.extractKey(entity, true), entity);\n return Promise.resolve(entity);\n }\n\n safeLoadEntity(name: string, key: any): Promise<T> {\n const ret = this.getOrCreateArray(name).get(key);\n if (ret==null) {\n throw new Error (\"No entity named \"+name+\" with key \"+key);\n }\n return Promise.resolve(ret);\n }\n\n loadEntity(name: string, key: any): Promise<T | undefined> {\n return Promise.resolve(this.getOrCreateArray(name).get(key));\n }\n\n deleteEntity(name: string, key: any): Promise<boolean> {\n return Promise.resolve( this.getOrCreateArray(name).delete(key));\n }\n\n searchEntities(name: string, ...criteria: TestStoreCriteria[]): Observable<T[]> {\n // No criteria defined, just send the full list\n const ret=new Array<T>();\n if( (criteria==null)||(criteria.length==0)) {\n for (const toAdd of this.getOrCreateArray(name).values()) {\n ret.push(toAdd);\n }\n } else {\n for (const toAdd of this.getOrCreateArray(name).values()) {\n let canAdd=true;\n for (const criter of criteria) {\n if (!criter.filter(toAdd)) {\n canAdd=false;\n break;\n }\n }\n if( canAdd) ret.push(toAdd);\n }\n\n }\n return from([ret]);\n }\n\n searchAndPrepareEntities(name: string, sort?: any, groupBy?: any, transformer?: IDataTransformer<T> | undefined, ...criteria: any[]): Observable<any> {\n throw new Error('Method not implemented.');\n }\n canStoreDocument(): boolean {\n return true;\n }\n storeDocument(toStore: File): Promise<IDocumentInfo> {\n const ret = new TestDocumentInfo(toStore.name, true,URL.createObjectURL(toStore));\n return Promise.resolve(ret);\n }\n\n storeDocuments(toStore: File[]): Observable<IDocumentInfo> {\n throw new Error('Method not implemented.');\n }\n\n}\n\nexport class TestDocumentInfo implements IDocumentInfo {\n documentName: string;\n isUrl: boolean;\n documentId?: string;\n\n constructor(documentName: string, isUrl: boolean,documentId?: string) {\n this.documentId = documentId;\n this.documentName = documentName;\n this.isUrl = isUrl;\n }\n}\n\nexport class TestStoreCriteria implements IStoreCriteria {\n name: string;\n value: any;\n operator: '='|'<='|'<';\n\n constructor(\n name: string,\n value: any,\n operator?: IStoreCriteriaOperator\n ) {\n this.name = name;\n this.value = value;\n if (!operator) this.operator = '=';\n else {\n this.operator = operator;\n }\n }\n\n filter (toFilter:any): boolean {\n const testValue=toFilter[this.name];\n switch (this.operator) {\n case '=':\n return testValue == this.value;\n case '<':\n return (testValue as number)<(this.value as number);\n case '<=':\n return (testValue as number)<(this.value as number);\n default:\n return true;\n }\n }\n}\n","/**\n * Wrapper around xt-store manager: You can use it to check if xt-store is included or not, and decide what to do\n *\n * This allows plugins to potentially use xt-store whenever included in the applications running the plugin\n */\nimport { Observable } from 'rxjs';\nimport { TestStoreCriteria } from '../test/store-test-helper';\n\nexport class StoreSupport {\n\n protected static testStoreManager?: IStoreManager;\n\n static isStoreManagerAvailable () {\n if (this.testStoreManager!=null) return true;\n return ((globalThis as any).xtStoreManager!=undefined);\n }\n\n static getStoreManager (): IStoreManager {\n return this.testStoreManager??((globalThis as any).xtStoreManager());\n }\n\n static setTestStoreManager (testStoreManager:IStoreManager): void {\n StoreSupport.testStoreManager = testStoreManager;\n }\n\n static newStoreCriteria (name:string, value:any, operator?:IStoreCriteriaOperator): IStoreCriteria {\n return new TestStoreCriteria(name, value, operator);\n }\n\n}\n\n/**\n * Interface definition for xt-store component.\n * We re-define them here to avoid importing xt-store in all plugins that don't need it.\n */\n\n\nexport interface IDataTransformer<T> {\n /**\n * Enable transformation of data right after it has been loaded from the store\n * @param source\n */\n postLoadingTransformation (source:any[]): T[];\n\n}\n\nexport interface IDocumentInfo {\n documentName: string;\n isUrl: boolean;\n documentId?: string;\n}\n\nexport type IStoreCriteriaOperator = '='|'<'|'<=';\n\nexport interface IStoreCriteria {\n name: string;\n value: any;\n operator: IStoreCriteriaOperator;\n}\n\nexport interface IStoreProvider<T> {\n storeEntity( name:string, entity: T): Promise<T>;\n\n /**\n * Rejects the promise if the entity is not found\n * @param name\n * @param key\n */\n safeLoadEntity( name: string, key: any): Promise<T>;\n loadEntity( name: string, key: any): Promise<T|undefined>;\n\n deleteEntity(name:string, key: any): Promise<boolean>;\n\n searchEntities(\n name: string,\n ...criteria: IStoreCriteria[]\n ): Observable<Array<T>>;\n\n searchAndPrepareEntities(\n name: string,\n sort?:any,\n groupBy?:any,\n transformer?: IDataTransformer<T>,\n ...criteria: any[]\n ): Observable<any>;\n\n canStoreDocument(): boolean;\n\n /**\n * Upload one document to a server store and returns the url or the id needed to retrieve them.\n * @param toStore\n * @param position\n */\n storeDocument(\n toStore: File\n ): Promise<IDocumentInfo>;\n\n /**\n * Upload documents to a server store and returns the url or the id needed to retrieve them.\n * @param toStore\n * @param position\n */\n storeDocuments(\n toStore: File[]\n ): Observable<IDocumentInfo>;\n\n\n}\n\nexport interface IStoreManager {\n getProvider<T=never>(name?: string): IStoreProvider<T> | undefined;\n getProviderSafe<T=never>(name?: string): IStoreProvider<T>;\n\n getDefaultProvider<T=never>(): IStoreProvider<T> | undefined;\n\n getDefaultProviderSafe<T=never>(): IStoreProvider<T>;\n\n newStoreCriteria (name:string, value:any, operator: IStoreCriteriaOperator): IStoreCriteria;\n}\n","import { computed, inject, Injectable, Type } from '@angular/core';\nimport { XtContext } from '../xt-context';\nimport { XtRegistryResolver } from '../resolver/xt-registry-resolver';\nimport { XT_REGISTRY_TOKEN, XT_RESOLVER_TOKEN, XT_TYPE_RESOLVER_TOKEN } from './xt-tokens';\nimport { XtResolvedComponent } from '../xt-resolved-component';\nimport {\n ManagedDataHandler,\n MappingHelper,\n XtSpecialFieldsHelper,\n XtTypeHandler,\n XtTypeInfo,\n xtTypeManager,\n XtTypeResolver,\n XtUpdatableTypeResolver\n} from 'xt-type';\nimport { XtComponentInfo, XtPluginInfo, XtTypeHandlerInfo } from '../plugin/xt-plugin-info';\nimport { XtResolver } from '../resolver/xt-resolver';\nimport { XtComponent } from '../xt-component';\nimport { loadRemoteModule } from '@angular-architects/native-federation';\nimport { XtAction } from '../action/xt-action';\nimport { XtActionHandler, XtActionResult } from '../action/xt-action-handler';\nimport { IStoreManager, StoreSupport } from '../store/store-support';\nimport { firstValueFrom, Observable } from 'rxjs';\n\n/**\n * An all in one helper class, enabling manipulation of the context, with data and type associated with it.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class XtResolverService {\n\n pluginRegistry = inject (XT_REGISTRY_TOKEN);\n\n protected baseResolver = inject (XT_RESOLVER_TOKEN, {optional:true});\n protected baseTypeResolver = inject (XT_TYPE_RESOLVER_TOKEN, {optional:true});\n\n resolver:XtResolver;\n typeResolver:XtTypeResolver;\n\n constructor() {\n if (this.baseTypeResolver==null) {\n this.typeResolver = xtTypeManager();\n } else this.typeResolver=this.baseTypeResolver;\n\n if (this.baseResolver==null) {\n this.resolver=new XtRegistryResolver (this.pluginRegistry, this.typeResolver);\n } else this.resolver=this.baseResolver;\n\n }\n\n findBestComponent<T> (baseContext: XtContext<T>, subName?:string) : XtResolvedComponent{\n const ret= this.resolver.resolve(baseContext, subName);\n if (ret!=null) return ret;\n else throw new Error (\"No components found for this context \"+ baseContext.toString());\n }\n\n findTypeOf<T> (baseContext:XtContext<T>, subName?:string, value?:T): string | null | undefined {\n const ret = this.typeResolver.findTypeName (baseContext.valueType, subName, value);\n return ret;\n }\n\n findTypeHandlerOf<T> (baseContext:XtContext<T>, subName?:string, value?:T): {typeName?:string | null, handler?:XtTypeHandler<any>} {\n let ret:{typeName?:string | null, handler?:XtTypeHandler<any>} = {typeName:undefined, handler:undefined};\n if (baseContext.isReference()){\n ret = this.typeResolver.findTypeHandler(baseContext.reference!.toType, false, undefined, value);\n }else {\n ret = this.typeResolver.findTypeHandler(baseContext.valueType, false, subName, value);\n }\n return ret;\n }\n\n listSubNamesOf<T> (baseContext:XtContext<T>, value?:T): string[] {\n return this.typeResolver.listSubNames(baseContext.valueType, value);\n }\n\n listSubNamesOfType<T> (valueType:string, value?:T): string[] {\n return this.typeResolver.listSubNames(valueType, value);\n }\n\n registerPlugin (info:XtPluginInfo) {\n this.pluginRegistry.registerPlugin (info);\n this.registerTypes (info.types, info.typeHandlers);\n }\n\n registerTypes (types:XtTypeInfo|undefined, handlers?:XtTypeHandlerInfo<any>[]): void {\n if ((types !=null) && (this.typeResolver.canUpdate())) {\n\n for (const newType in types) {\n let handler=this.handlerDefinedFor (newType, handlers);\n if (handler==null) {\n handler = new ManagedDataHandler();\n }\n (this.typeResolver as XtUpdatableTypeResolver).addRootType (newType, types[newType], handler);\n }\n }\n }\n\n\n /**\n * Calculates all the possible actions for a given context\n * @param context\n * @param onlyVisible\n */\n possibleActions<T> (context:XtContext<T>, onlyVisible:boolean=true): Array<XtAction<T>> {\n const existingActions = context.listActions();\n if (existingActions!=null) {\n return existingActions;\n }\n\n if (context.valueType!=null) {\n const actionInfos = this.pluginRegistry.listActionInfos<T>(context.valueType);\n const actions = actionInfos.map((info) => {\n const ret = new XtAction(info.name,info.info, true);\n return ret;\n });\n context.listActions.set(actions);\n return actions;\n }\n return [];\n }\n\n /**\n * Finds the possible action with the given name for the current type, and runs it in the current value.\n * If the action is not possible in this context, try a parent context\n * @param actionName\n */\n async runAction<T> (context: XtContext<T>, actionName:string, storeMgr?:any): Promise<XtActionResult<any>> {\n let handler: XtActionHandler<T> |null = null;\n for (const action of this.possibleActions(context,false)) {\n if (action.name==actionName) {\n const handlerClass=action.info.handlerClass;\n handler=new handlerClass ();\n break;\n }\n }\n\n if (handler!=null) {\n return handler.runAction(context, actionName, this, storeMgr);\n } else {\n // Couldn't find the handler, let's see if we can have that up the context chain\n if (context.parentContext!=null) {\n return this.runAction(context.parentContext, actionName); // Run the parent without any store indication, as it most probably is different\n } else {\n return Promise.reject(\"Cannot find action \"+actionName+\" for context \"+this.toString());\n }\n }\n }\n\n\n protected handlerDefinedFor(newType: string, handlers: XtTypeHandlerInfo<any>[] | undefined):any {\n for (const handler of handlers ?? []) {\n if (handler.typesHandled.includes(newType)) {\n return new handler.handlerClass ();\n }\n }\n return null;\n }\n\n getComponentInfo<T>(type: Type<XtComponent<T>>):XtResolvedComponent {\n return XtResolvedComponent.from(this.pluginRegistry.getComponentInfo (type));\n }\n\n findComponentInfo<T>(type: Type<XtComponent<T>>):XtResolvedComponent|null {\n const ret=this.pluginRegistry.findComponentInfo (type);\n if (ret==null) return null;\n else return XtResolvedComponent.from(ret);\n }\n\n public listComponents = computed<Array<XtComponentInfo<any>>>(() => {\n return this.pluginRegistry.listComponents();\n });\n\n public listPlugins = computed<Array<XtPluginInfo>>(() => {\n return this.pluginRegistry.listPlugins();\n });\n\n /**\n * Dynamically load a register a plugin from the given url\n * The plugin must export at least a Register entrypoint that will be called right after loading..\n * @param url\n * @returns a Promise with the module loaded and already registered.\n */\n loadPlugin (url:URL|string):Promise<any> {\n return loadRemoteModule({\n remoteEntry: url.toString(),\n exposedModule: './Register'\n }).then((module:any) => {\n const pluginName = module.registerPlugin(this);\n // Transform the configured Uris to real urls\n const pluginConfig=this.pluginRegistry.pluginRegistry.get(pluginName);\n if (pluginConfig?.uriLogo!=null) {\n let urlString = url.toString();\n const lastSlash = urlString.lastIndexOf('/');\n urlString = urlString.substring(0, lastSlash+1)+pluginConfig?.uriLogo;\n pluginConfig.uriLogo=urlString;\n }\n return module;\n });\n\n }\n\n /**\n * Based on the type & value of the element, find which property is on its type and returns it's value\n * @param context\n * @param subPropertyType\n * @param value\n */\n findSubPropertyWithType<T> (context: XtContext<T>, subPropertyType:string, value:T): any {\n const subKeys = this.typeResolver.findSubPropertiesWithType (context.valueType, subPropertyType);\n if ((subKeys!=null)&&(subKeys.length==1)) {\n return value[subKeys[0] as keyof T];\n } else if (subKeys.length>1) {\n // Let's pickup the first\n return value[subKeys[0] as keyof T];\n } else {\n return undefined;\n }\n }\n\n /**\n * Creates a duplicate of an object, using our knowledge on its type given by the context\n * @param context\n * @param value\n */\n safeDuplicate<T> (context: XtContext<T>, value:T): T {\n\n const typeHandler = this.typeResolver.findTypeHandler(context.valueType, false, undefined, value);\n\n if (typeHandler.handler!=null) {\n return typeHandler.handler.safeDuplicate (value);\n }\n return structuredClone(value);\n }\n\n resolveMappingOf<U, T> (context: XtContext<T>, targetType:string, value?:T): MappingHelper<U, T> | undefined {\n if (context.valueType!=null) {\n const typeHandler = this.typeResolver.findTypeHandler<T>(targetType, false, undefined, value);\n\n if (typeHandler.handler!=null) {\n const ret = typeHandler.handler.getOrCreateMappingFrom<U>(context.valueType, this.typeResolver);\n if( ret != null) {\n return ret;\n }\n }\n }\n return undefined;\n }\n\n async resolveReferencedValue<T,U> (context: XtContext<T>, storeMgr: IStoreManager): Promise<U | U[] | null | undefined> {\n if (!context.isReference()) return undefined;\n const ref= context.reference!;\n const storeProvider = storeMgr.getProvider<U> (ref.type);\n if (storeProvider == null) {\n throw new Error ('No Store provider found for type '+ref.type);\n }\n\n const ret= await firstValueFrom(storeProvider.searchEntities(ref.toType, storeMgr.newStoreCriteria(ref.field, context.value(),'=')));\n if (ret.length == 0) return null;\n if (ref.referenceType=='MANY-TO-ONE') {\n if (ret.length > 1) throw new Error('Multiple values for many to one relation between ' + context.valueType + ' and ' + ref.type + ' with value ' + context.value());\n return ret[0];\n } else if (ref.referenceType=='ONE-TO-MANY') {\n return ret;\n }\n return undefined;\n }\n\n resolvePendingReferences () {\n (this.typeResolver as XtUpdatableTypeResolver).resolveAllTypeReferences();\n }\n\n /**\n * Calculates the values that can be referenced by the reference & value of this context\n * @param context\n */\n findPossibleReferences<T, U> (context:XtContext<T>): Observable<U[]> {\n if (!context.isReference()) throw new Error('Cannot find possible references of this non reference context'+context.toString());\n const reference = context.reference!;\n const store =StoreSupport.getStoreManager().getProviderSafe<U>(reference.toType);\n return store.searchEntities(reference.toType );\n }\n\n/* async loadAllReferencesForContext<T> (context:XtContext<T>, storeMgr: IStoreManager): Promise<void> {\n const refs =this.typeResolver.listReferences(context.valueType);\n const promises:Promise<void>[]=[];\n for (const ref of Object.keys(refs)) {\n const subContext= context.subContext(ref, undefined, this.typeResolver);\n promises.push(this.resolveReferencedValue(subContext, storeMgr).then ((value) => {\n subContext.updateReferencedContext(value);\n }));\n }\n\n if( promises.length>0) {\n return Promise.all(promises).then((values) => {\n context.subReferencesResolved.set(true);\n return;\n });\n } else {\n return Promise.resolve().then (() => {\n context.subReferencesResolved.set(true);\n });\n }\n\n }\n*/\n\n}\n","import { OutputEmitterRef } from '@angular/core';\nimport { XtComponentOutput } from '../xt-component';\n\nexport class XtBaseOutput implements XtComponentOutput {\n valueSelected: OutputEmitterRef<any> | undefined;\n\n}\n","import {\n AfterViewInit,\n Component,\n computed,\n inject,\n input,\n model,\n output,\n Signal,\n Type,\n viewChild\n} from '@angular/core';\nimport { NgComponentOutlet } from '@angular/common';\nimport { XtComponent, XtComponentOutput, XtInputType, XtOutputType } from '../xt-component';\nimport { XtBaseContext, XtContext, XtDisplayMode } from '../xt-context';\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { XtResolverService } from '../angular/xt-resolver.service';\nimport { XtResolvedComponent } from '../xt-resolved-component';\nimport { XtBaseOutput } from '../output/xt-base-output';\nimport { XtBaseInput } from '../output/xt-base-input';\nimport { isTypeReference } from 'xt-type';\n\n/**\n * Offers a nice and easy to dynamically embed a component.\n * You set the type, the display mode, and either the value or the formgroup & subName to use.\n * XtRender will then instantiate the component, bind it to the value or form, and display it.\n */\n@Component({\n selector: 'xt-render',\n standalone: true,\n imports: [\n NgComponentOutlet,\n ReactiveFormsModule\n ],\n templateUrl: './xt-render.component.html',\n styleUrl: './xt-render.component.css'\n})\nexport class XtRenderComponent<T> implements AfterViewInit {\n resolverService = inject(XtResolverService);\n\n componentType = input<Type<XtComponent<T>>> ();\n displayMode = input.required<XtDisplayMode> ();\n valueType = input<string> ();\n\n // Either we set the value directly\n value= model<T> ();\n // Or we are inside a Form\n formGroup=input<FormGroup>();\n subName= input<string>();\n\n outputsObject = new XtBaseOutput();\n\n inputs = input<XtBaseInput>();\n outputs = output<XtComponentOutput>();\n\n outlet = viewChild.required(NgComponentOutlet);\n\n constructor() {\n\n }\n\n\n context: Signal<XtContext<any>> = computed(() => {\n let form = this.formGroup();\n\n const ret= new XtBaseContext<any>(this.displayMode(), this.subName(), form);\n ret.valueType=this.valueType();\n const typeInfo = this.resolverService.typeResolver.findType(ret.valueType);\n if( isTypeReference(typeInfo)) {\n ret.setReferenceInfo(typeInfo);\n }\n if (!ret.isInForm()) {\n const subName = this.subName();\n const value = this.value();\n if ( (subName == null) || (value == null)) {\n ret.setDisplayValue(value);\n } else {\n ret.setDisplayValue(value[subName as keyof typeof value]);\n }\n }\n return ret as XtContext<T>;\n });\n\n realContext = computed(() => {\n let ret = this.context();\n /*if ((ret.isReference())&& (ret.referencedContext!=null)) {\n ret = ret.referencedContext;\n }*/\n return ret;\n });\n\n\n type:Signal<Type<XtComponent<T>>|null> = computed( () => {\n //console.debug(\"Calculating type in XtRenderSubComponent\");\n\n let type=this.componentType();\n let compFound:XtResolvedComponent|null = null;\n if (type==null) {\n //console.debug('XtRender, using component set '+ type);\n //compFound = this.resolverService.findComponentInfo (type);\n //} else {\n compFound= this.resolverService.findBestComponent(this.realContext());\n //console.debug('XtRender, found component ',compFound.componentName);\n type= compFound.componentClass;\n }\n\n return type??null;\n });\n\n /**\n * Transfers the input and outputs from the host to the rendered component\n */\n ngAfterViewInit() {\n const instance=this.outlet().componentInstance as XtComponent;\n if (instance?.outputsObject!=null) {\n let hasOneOutput = false;\n for (const key of Object.keys(instance.outputsObject) as XtOutputType[] ) {\n this.outputsObject[key] = instance.outputsObject[key];\n hasOneOutput=true;\n }\n if (hasOneOutput) {\n this.outputs.emit(this.outputsObject);\n }\n }\n const inputs = this.inputs();\n if ((inputs!=null) && (instance?.inputsObject!=null)) {\n for (const key of Object.keys(inputs) as XtInputType[] ) {\n instance.inputsObject[key] = inputs[key];\n }\n\n }\n\n }\n\n}\n","<ng-container *ngComponentOutlet=\"type(); inputs: {context:context ()}\" />\n","import { AfterViewInit, Component, computed, inject, input, output, Signal, Type, viewChild } from '@angular/core';\nimport { NgComponentOutlet } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { XtContext } from '../xt-context';\nimport { XtComponent, XtComponentInput, XtComponentOutput, XtInputType, XtOutputType } from '../xt-component';\nimport { XtResolverService } from '../angular/xt-resolver.service';\nimport { XtResolvedComponent } from '../xt-resolved-component';\nimport { XtBaseOutput } from '../output/xt-base-output';\nimport { XtBaseInput } from '../output/xt-base-input';\n\n/**\n * Dynamically render a component that will display the given subValue.\n * To be used only inside an XtSimpleComponent or XtCompositeComponent\n */\n@Component({\n selector: 'xt-render-sub',\n standalone: true,\n imports: [\n NgComponentOutlet,\n ReactiveFormsModule\n ],\n templateUrl: './xt-render-sub.component.html',\n styleUrl: './xt-render-sub.component.css'\n})\nexport class XtRenderSubComponent<T> implements AfterViewInit {\n context = input.required<XtContext<T>> ();\n componentType = input<Type<XtComponent<T>>> ();\n\n outputsObject = new XtBaseOutput();\n\n inputs = input<XtBaseInput>();\n outputs = output<XtComponentOutput>();\n\n outlet = viewChild.required(NgComponentOutlet);\n\n resolverService = inject(XtResolverService);\n\n realContext = computed(() => {\n let ret = this.context();\n /*if ((ret.isReference()) && (ret.referencedContext!=null)) {\n ret = ret.referencedContext;\n }*/\n return ret;\n });\n\n type:Signal<Type<XtComponent<T>>|null> = computed( () => {\n //console.debug(\"Calculating type in XtRenderSubComponent\");\n\n let type=this.componentType();\n let compFound:XtResolvedComponent|null = null;\n if (type==null) {\n //console.debug('XtRender, using component set '+ type);\n //compFound = this.resolverService.findComponentInfo (type);\n //} else {\n compFound= this.resolverService.findBestComponent(this.realContext());\n //console.debug('XtRender, found component ',compFound.componentName);\n type= compFound.componentClass;\n }\n\n return type??null;\n\n });\n\n /**\n * Transfers the input and outputs from the host to the rendered component\n */\n ngAfterViewInit() {\n const instance=this.outlet().componentInstance as XtComponent;\n if (instance?.outputsObject!=null) {\n let hasOneOutput = false;\n for (const key of Object.keys(instance.outputsObject) as XtOutputType[] ) {\n this.outputsObject[key] = instance.outputsObject[key];\n hasOneOutput=true;\n }\n if (hasOneOutput) {\n this.outputs.emit(this.outputsObject);\n }\n }\n const inputs = this.inputs();\n if ((inputs!=null) && (instance?.inputsObject!=null)) {\n for (const key of Object.keys(inputs) as XtInputType[] ) {\n instance.inputsObject[key] = inputs[key];\n }\n\n }\n\n\n }\n\n}\n","{{componentType()}}\n<ng-container *ngComponentOutlet=\"type(); inputs: {context:realContext ()}\" />\n","import { InputSignal } from '@angular/core';\nimport { XtComponentInput } from '../xt-component';\n\nexport class XtBaseInput implements XtComponentInput {\n valueSelected: InputSignal<any>|undefined;\n}\n","import { Component, computed, input, OnInit, output } from '@angular/core';\nimport { AbstractControl, FormControl, FormGroup } from '@angular/forms';\nimport { XtContext } from '../xt-context';\nimport { XtComponent, XtComponentOutput } from '../xt-component';\nimport { XtBaseOutput } from '../output/xt-base-output';\nimport { XtBaseInput } from '../output/xt-base-input';\n\n/**\n * An XtSimpleComponent just displays the given value or element in a form.\n * If you need to dynamically embed other XtComponents to display sub elements, then please use the XtCompositeComponent\n */\n@Component({\n standalone: true,\n imports: [],\n template: ''\n})\nexport class XtSimpleComponent<T = any> implements XtComponent<T>, OnInit{\n context = input.required<XtContext<T>>();\n outputsObject = new XtBaseOutput();\n inputsObject = new XtBaseInput();\n outputs=output<XtComponentOutput>();\n\n isInForm = computed<boolean> ( () => {\n return this.context()?.isInForm()??false;\n });\n\n formControlNameIfAny = computed<string | undefined> (() => {\n return this.context()?.subName;\n });\n\n formGroupIfAny = computed<FormGroup | undefined> (() => {\n return this.context()?.formGroup();\n })\n\n formGroup = computed<FormGroup> (() => {\n const ret= this.context()?.formGroup();\n if (ret==null) throw new Error ('No form groups in this component of type '+this.componentDescriptor());\n return ret;\n });\n\n /**\n * Returns the component form name, which is for now the subName\n */\n componentNameInForm=computed<string> ( () => {\n return this.safelyGetSubName();\n });\n\n constructor() {\n }\n\n ngOnInit(): void {\n this.setupInputOutput();\n if (Object.keys(this.outputsObject).length > 0) {\n // At least one output has been defined\n this.outputs.emit(this.outputsObject);\n }\n }\n\n manageFormControl<T> (ctrlName:string, create:boolean=true): AbstractControl<T>|undefined {\n const formGroup = this.formGroupIfAny();\n if (formGroup==null) {\n // You can call manageFormControl even in not a form, it just get ignored\n //console.debug('FormGroup is undefined when declaring managedcontrol '+ctrlName);\n return undefined;\n } else {\n let ctrl=formGroup.get(ctrlName);\n if ((create) && (ctrl==null)) {\n ctrl = new FormControl<T|undefined>(undefined);\n formGroup.setControl(ctrlName, ctrl);\n }\n return ctrl??undefined;\n }\n }\n\n safelyGetSubName = computed<string>(() => {\n const ret = this.context()?.subName;\n if (ret==null) throw new Error ('This component has no name in the form '+this.componentDescriptor());\n return ret;\n });\n\n /**\n * Returns the form control name and create a form control behind the scene\n */\n formControlName = computed<string> (() => {\n const ret = this.safelyGetSubName();\n\n //this.manageFormControl<any>(ret); // Don't create anything at this point. It's a computed value.\n return ret;\n });\n\n formControl = computed<AbstractControl<any>> (() => {\n const subName = this.safelyGetSubName();\n const formControl= this.manageFormControl(subName, false);\n if (formControl==null) throw new Error (\"Calling formControl for subName \"+subName+\" when none exist.\");\n return formControl;\n});\n\n componentDescriptor (): string {\n return \"Component with type \"+this.constructor.name+\" with context \"+this.context().toString();\n }\n\n getValue= computed (()=> {\n return this.context().value();\n });\n\n displayValue = computed (() => {\n return this.context().displayValue();\n });\n\n /**\n * This is where components can assign their output() and input() into the XtComponent inputs and outputs member\n * @protected\n */\n protected setupInputOutput () {\n // Nothing to do here\n }\n}\n","import { Component, computed, inject } from '@angular/core';\nimport { XtSimpleComponent } from '../xt-simple/xt-simple.component';\nimport { FormGroup } from '@angular/forms';\nimport { XtResolverService } from '../angular/xt-resolver.service';\nimport { XtContext } from '../xt-context';\n\n@Component({\n standalone: true,\n imports: [],\n template: '',\n styleUrl: './xt-composite.component.css'\n})\nexport class XtCompositeComponent<T = any> extends XtSimpleComponent<T> {\n\n resolverService = inject(XtResolverService);\n\n override formGroupIfAny = computed<FormGroup | undefined> (() => {\n const context = this.context();\n if (context==null) return undefined;\n let ret= context.localFormGroup;\n if ((ret==null) && (context.parentFormGroup!=null) && (context.subName!=null)) {\n if (context.parentFormGroup.contains(context.subName)) {\n context.localFormGroup = context.parentFormGroup.get(context.subName) as FormGroup;\n } else {\n context.localFormGroup= new FormGroup ({});\n context.parentFormGroup.addControl(context.subName, context.localFormGroup);\n }\n ret=context.localFormGroup;\n }\n return ret;\n })\n\n /**\n * We need to create a new form group to manage the sub elements.\n */\n override formGroup = computed<FormGroup> (() => {\n const ret= this.formGroupIfAny();\n if (ret==null) throw new Error ('No form groups in this component of type '+this.componentDescriptor());\n return ret;\n });\n\n /**\n * Helper function to calculate the sub context\n * @param subName\n * @param subType\n */\n subContext (subName:string, subType?:string):XtContext<any> {\n this.formGroupIfAny(); // Ensure the context is properly initialized\n return this.context().subContext(subName, subType, this.resolverService.typeResolver);\n }\n\n}\n","import { Injectable } from \"@angular/core\";\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class XtMessageHandler {\n errorOccurred (error:any, errorMsg?:string) {\n console.error(errorMsg, error);\n }\n\n warningOccurred (warningMsg?:string) {\n console.warn(warningMsg);\n }\n\n}\n","import { FormControl, FormGroup } from '@angular/forms';\nimport { isPrimitive, isTypeReference, XtTypeHierarchy, XtTypeReference, XtTypeResolver } from 'xt-type';\n\nexport function attachToFormGroup(formGroup: FormGroup, controlName:string, value:any, valueType?:string, resolver?:XtTypeResolver) {\n // If it's a single value, just create the control\n if (((value!=null) && (isPrimitive(value))\n || (resolver?.isPrimitiveType(valueType)))) {\n const simpleControl = new FormControl(value);\n formGroup.addControl(controlName, simpleControl);\n } else {\n const complexGroup = new FormGroup({});\n updateFormGroupWithValue(complexGroup, value, valueType, resolver);\n formGroup.addControl(controlName, complexGroup);\n }\n}\n\nexport function updateFormGroupWithValue(formGroup: FormGroup, value:{[key:string]:any}, valueType?:string, resolver?:XtTypeResolver) {\n\n const toDelete = new Set<string>(Object.keys(formGroup.controls));\n // We merge the properties of the value if any, with the properties of the model\n const keySet = new Set<string>((value!=null)?Object.keys(value):null);\n if( ((valueType!=null) && (resolver!=null))) {\n const modelSubName = resolver.listSubNames(valueType, value);\n for (const sub of modelSubName) {\n keySet.add(sub);\n }\n }\n\n for (const valueKey of keySet) {\n const subValue=(value!=null)?value[valueKey]:undefined;\n const subType=resolver?.findType(valueType, valueKey, subValue)??undefined;\n const subTypeName = isTypeReference(subType) ? subType.toType : subType?.type;\n const primitive = (resolver!=null)?resolver?.isPrimitiveType(subType, subValue): isPrimitive(subValue);\n if (toDelete.delete(valueKey)) {\n // Already a control\n const oldControl = formGroup.get(valueKey)!;\n // Is it the right type ?\n if ((primitive) || (isTypeReference(subType))) {\n // Must be an FormControl2\n if ((oldControl as any).controls === undefined) {\n // It's ok, just set the value\n oldControl.setValue(subValue);\n } else {\n formGroup.setControl(valueKey, new FormControl(subValue));\n }\n } else {\n // Must be a FormGroup\n if ((oldControl as any).controls === undefined) {\n const newFormGroup = new FormGroup({});\n formGroup.setControl(valueKey, newFormGroup);\n updateFormGroupWithValue(newFormGroup, subValue, subTypeName, resolver);\n } else {\n // It was already a formgroup, so just update it\n if (subValue!==undefined)\n updateFormGroupWithValue(oldControl as FormGroup, subValue, subTypeName, resolver);\n else {\n // Just remove the control as there is no value to set\n formGroup.removeControl(valueKey);\n }\n }\n }\n } else {\n if ((primitive) || (isTypeReference(subType))) {\n formGroup.addControl(valueKey, new FormControl(subValue));\n } else {\n const newFormGroup = new FormGroup({});\n formGroup.addControl(valueKey, newFormGroup);\n updateFormGroupWithValue(newFormGroup, subValue, subTypeName, resolver);\n }\n }\n }\n\n // Delete controls that are no more used\n for (const delName of toDelete) {\n formGroup.removeControl(delName);\n }\n}\n","import { XtResolverService } from '../angular/xt-resolver.service';\nimport { inject } from '@angular/core';\n\nexport class XtUnitTestHelper {\n/* public static registerComponent<T> (name:string, compClass:T, type:string){\n this.resolverService.pluginRegistry.registerComponent({\n componentName:name,\n componentClass: compClass,\n typesHandled: [type]\n });\n }\n*/\n}\n","import { Component, computed, inject, input, OnInit, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { XtRenderComponent } from '../render/xt-render.component';\nimport { XtComponent } from '../xt-component';\nimport { XtBaseContext, XtDisplayMode } from '../xt-context';\nimport { XtRenderSubComponent } from '../render/xt-render-sub.component';\nimport { XtResolverService } from '../angular/xt-resolver.service';\nimport { xtTypeManager } from 'xt-type';\nimport { updateFormGroupWithValue } from '../type/type-helper';\n/**\n * Component that can be used to bootstrap tests.\n * Just set the value and component type, and it will be injected in your test.\n */\n@Component({\n selector:'test-host',\n standalone:true,\n imports: [CommonModule, XtRenderComponent],\n template: '<h1>Test Simple Component</h1> <xt-render [componentType]=\"type()\" [displayMode]=\"displayMode()\" [value]=\"value()\" ></xt-render> '\n\n})\nexport class HostTestSimpleComponent {\n type = input.required<Type<XtComponent<any>>>();\n displayMode = input<XtDisplayMode> ('FULL_VIEW');\n value = input<any|undefined> (undefined);\n\n}\n\n/**\n * Same as HostTestSimpleComponent but it includes everything in a form.\n * Just set the component type, the formGroup and the component name, and your component will be run.\n * You can as well easily read and set the value.\n */\n@Component({\n selector:'test-form-host',\n standalone:true,\n imports: [CommonModule, XtRenderComponent, ReactiveFormsModule],\n template: '<h1>Test Form Component</h1> <form [formGroup]=\"computedFormGroup()\"> <xt-render [componentType]=\"type()\" displayMode=\"FULL_EDITABLE\" [subName]=\"controlName()\" [formGroup]=\"computedFormGroup()\"></xt-render></form>'\n})\nexport class HostTestFormComponent {\n builder = inject(FormBuilder);\n type = input.required<Type<XtComponent<any>>>();\n controlName = input.required<string>();\n // You can send the description to be used in a FormBuilder to create the formgroup;\n formDescription = input<any> ({ });\n // Or set the FormGroup directly\n formGroup= input<FormGroup>();\n\n// parentFormGroup = this.builder.group<{[keys:string]: AbstractControl}>({});\n createdFormGroup: FormGroup|null = null;\n\n computedFormGroup () {\n if( this.createdFormGroup==null) {\n const formGroup=this.formGroup();\n this.createdFormGroup=formGroup??generateFormGroup(this.formDescription());\n }\n // this.parentFormGroup.addControl(this.controlName()??HostTestTypedFormComponent.CONTROL_NAME, this.createdFormGroup);\n return this.createdFormGroup;\n }\n\n patchValue (newVal:any) {\n const patch:{[key:string]:any}={};\n patch[this.controlName()]=newVal;\n if (this.createdFormGroup!=null)\n this.createdFormGroup.patchValue(patch);\n else throw new Error (\"FormGroup not yet created. Did you set formGroup or formDescription property ?\");\n }\n\n retrieveValue (): any {\n if (this.createdFormGroup!=null)\n return this.createdFormGroup.value[this.controlName()];\n else throw new Error (\"FormGroup not yet created. Did you set formGroup or formDescription property ?\");\n }\n}\n\n/**\n * Component that can be used to test your component based on the type it handles\n * Just set the type hierarchy to register, the value, and it will instantiate the right component in your plugin\n */\n@Component({\n selector:'test-typed-host',\n standalone:true,\n imports: [CommonModule, XtRenderSubComponent],\n template: '<h1>Test Typed Component</h1> <xt-render-sub [context]=\"context()\" ></xt-render-sub> '\n\n})\nexport class HostTestTypedComponent {\n\n displayMode = input<XtDisplayMode> ('FULL_VIEW');\n value = input<any> ();\n valueType = input<string> ();\n\n context = computed( () => {\n const ret = new XtBaseContext(this.displayMode());\n\n ret.valueType=this.valueType();\n ret.setDisplayValue(this.value());\n return ret;\n });\n}\n\n/**\n * Same as HostTestSimpleComponent but it includes everything in a form.\n * Just set the component type, the formGroup and the component name, and your component will be run.\n * You can as well easily read and set the value.\n */\n@Component({\n selector:'test-typed-form-host',\n standalone:true,\n imports: [CommonModule, ReactiveFormsModule, XtRenderSubComponent],\n template: '<h1>Test Typed Form Component</h1> <form [formGroup]=\"parentFormGroup\"> <xt-render-sub [context]=\"subContext()\"></xt-render-sub></form>'\n})\nexport class HostTestTypedFormComponent implements OnInit{\n builder = inject(FormBuilder);\n resolver = inject(XtResolverService);\n\n static readonly CONTROL_NAME='ForTest';\n\n valueType = input<string> ();\n controlName = input<string>();\n // You can send the description to be used in a FormBuilder to create the formgroup;\n formDescription = input<any> (null);\n // Or set the FormGroup directly\n formGroup= input<FormGroup>();\n\n parentFormGroup = this.builder.group<{[keys:string]: AbstractControl}>({});\n\n createdFormGroup: FormGroup|null = null;\n\n ngOnInit(): void {\n this.computeFormGroup();\n }\n\n computeFormGroup () {\n if( this.createdFormGroup==null) {\n const formGroup=this.formGroup();\n if( this.formDescription()!=null) {\n this.createdFormGroup=formGroup??generateFormGroup(this.formDescription());\n } else {\n this.createdFormGroup=this.builder.group({});\n if (this.valueType()!=null) {\n updateFormGroupWithValue(this.createdFormGroup, {}, this.valueType(), this.resolver.typeResolver);\n }\n }\n this.parentFormGroup.addControl(this.controlName()??HostTestTypedFormComponent.CONTROL_NAME, this.createdFormGroup);\n }\n return this.createdFormGroup;\n };\n\n subContext () {\n this.computeFormGroup(); // Make sure the subformgroups are created\n\n const ctrlName = this.controlName();\n let ret:XtBaseContext<any>|null = null;\n if (ctrlName==null){\n ret = new XtBaseContext('FULL_EDITABLE', HostTestTypedFormComponent.CONTROL_NAME, this.parentFormGroup);\n }\n else{\n ret = new XtBaseContext('FULL_EDITABLE', ctrlName, this.createdFormGroup!);\n }\n ret.valueType=this.valueType();\n\n return ret;\n };\n\n patchValue (controlName:string, newVal:any) {\n const patch:{[key:string]:any}={};\n patch[controlName]=newVal;\n this.computeFormGroup().patchValue(patch);\n }\n\n retrieveValue (controlName:string): any {\n return this.computeFormGroup().value[controlName];\n }\n\n}\n\nfunction generateFormGroup(formDescription: any):FormGroup {\n if (typeof formDescription != 'object') {\n throw new Error ('Form Description should be an object of values');\n }\n return generateFormControl(formDescription) as FormGroup;\n}\n\nfunction generateFormControl(formDescription: any): AbstractControl {\n\n if (formDescription==null) {\n return new FormControl(formDescription);\n }\n\n if (Array.isArray(formDescription)){\n const retArray = new FormArray<AbstractControl>([]);\n for (const val of formDescription) {\n retArray.push(generateFormControl(val), {emitEvent:false});\n }\n return retArray;\n }\n\n if ((typeof formDescription=='object')&&(!(formDescription instanceof Date))) {\n const retObject=new FormGroup({});\n for (const key of Object.keys(formDescription)) {\n retObject.addControl(key, generateFormControl(formDescription[key]));\n }\n return retObject;\n }\n return new FormControl(formDescription);\n}\n","/*\n * Public API Surface of xt-components\n */\n\nexport * from './lib/xt-component';\nexport * from './lib/xt-context';\nexport * from './lib/xt-resolved-component';\nexport * from './lib/resolver/xt-resolver';\nexport * from './lib/registry/xt-plugin-registry'\nexport * from './lib/plugin/xt-plugin-info'\nexport * from './lib/action/xt-action-handler';\nexport * from './globals';\n\nexport * from './lib/angular/xt-tokens';\nexport * from './lib/angular/xt-resolver.service';\n\nexport * from './lib/render/xt-render.component';\nexport * from './lib/render/xt-render-sub.component';\nexport * from './lib/xt-simple/xt-simple.component';\nexport * from './lib/xt-composite/xt-composite.component';\n\nexport * from './lib/angular/xt-message-handler.service';\nexport * from './lib/store/store-support';\nexport * from './lib/type/type-helper';\nexport * from './lib/test/xt-unit-test-helper';\nexport * from './lib/test/xt-test-helper-components';\nexport * from './lib/test/store-test-helper';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAIa,gBAAgB,CAAA;AAA7B,IAAA,WAAA,GAAA;AAEI,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,GAAG,EAAyB;AACjD,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,GAAG,EAAiC;AAC5D,QAAA,IAAA,CAAA,oBAAoB,GAAG,IAAI,GAAG,EAAmC;AACvD,QAAA,IAAA,CAAA,oBAAoB,GAAG,IAAI,GAAG,EAA2C;AAEnF,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,IAAI,KAAK,EAAwB,0DAAC;AAC1D,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,IAAI,KAAK,EAAgB,uDAAC;IAuLnD;AArLE;;;;;;;;;;AAUG;aACoB,IAAA,CAAA,kBAAkB,GAAC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AA,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,mBAAmB,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;QACtE;AACA,QAAA,OAAO,SAAS;IAClB;AACA,IAAA,OAAO,IAAI,WAAW,CAAC,eAAe,CAAC;AACzC;;AC9MA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"xt-components.mjs","sources":["../../../projects/xt-components/src/lib/registry/xt-plugin-registry.ts","../../../projects/xt-components/src/lib/xt-context.ts","../../../projects/xt-components/src/lib/xt-resolved-component.ts","../../../projects/xt-components/src/lib/workflow/xt-workflow.ts","../../../projects/xt-components/src/globals.ts","../../../projects/xt-components/src/lib/angular/xt-tokens.ts","../../../projects/xt-components/src/lib/resolver/xt-registry-resolver.ts","../../../projects/xt-components/src/lib/action/xt-action.ts","../../../projects/xt-components/src/lib/store/store-support.ts","../../../projects/xt-components/src/lib/angular/xt-resolver.service.ts","../../../projects/xt-components/src/lib/output/xt-base-output.ts","../../../projects/xt-components/src/lib/render/xt-render.component.ts","../../../projects/xt-components/src/lib/render/xt-render.component.html","../../../projects/xt-components/src/lib/render/xt-render-sub.component.ts","../../../projects/xt-components/src/lib/render/xt-render-sub.component.html","../../../projects/xt-components/src/lib/output/xt-base-input.ts","../../../projects/xt-components/src/lib/xt-simple/xt-simple.component.ts","../../../projects/xt-components/src/lib/xt-composite/xt-composite.component.ts","../../../projects/xt-components/src/lib/output/xt-base-model.ts","../../../projects/xt-components/src/lib/angular/xt-message-handler.service.ts","../../../projects/xt-components/src/lib/type/type-helper.ts","../../../projects/xt-components/src/lib/test/xt-unit-test-helper.ts","../../../projects/xt-components/src/lib/test/xt-test-helper-components.ts","../../../projects/xt-components/src/lib/test/store-test-helper.ts","../../../projects/xt-components/src/public-api.ts","../../../projects/xt-components/src/xt-components.ts"],"sourcesContent":["import {\n XtActionHandlerInfo,\n XtActionInfo,\n XtComponentInfo,\n XtPluginInfo,\n XtWorkflowInfo\n} from '../plugin/xt-plugin-info';\nimport { signal, Type } from '@angular/core';\nimport { XtComponent } from '../xt-component';\nimport { XtWorkflow } from '../workflow/xt-workflow';\n\n/**\n * Maintain the list of plugins loaded, with their components and actions\n *\n */\nexport class XtPluginRegistry {\n\n /** Map of all registered plugins by name */\n pluginRegistry = new Map<string, XtPluginInfo> ();\n /** Map of all registered components by component name */\n componentRegistry = new Map<string, XtComponentInfo<any>> ();\n /** Cache of components found by value type */\n componentByTypeCache = new Map<string, XtComponentInfo<any>[]> ();\n /** Map of all registered workflows by name */\n protected workflowRegistry = new Map<string, XtWorkflowInfo<any>> ();\n /** Map of actions registered by type, then by action name */\n protected actionByTypeRegistry = new Map<string, Map<string, XtActionInfo<any>>> ();\n\n /** Signal listing all registered component infos */\n listComponents = signal(new Array<XtComponentInfo<any>>());\n /** Signal listing all registered plugin infos */\n listPlugins = signal(new Array<XtPluginInfo>());\n\n /**\n * The component can manage any standard javascript primitives types. That's usually the default whenever we don't know any particular type\n * string\n * number\n * bigint\n * boolean\n * undefined\n * null\n * symbol is not managed\n * Date, while an object and not a primitive, is managed\n */\n public static readonly ANY_PRIMITIVE_TYPE=\"ANY_PRIMITIVE_TYPE\";\n /**\n * The components can manage any composite javascript type. Default when no type has been defined and it's a user defined javascript object (not a data type)\n */\n public static readonly ANY_OBJECT_TYPE=\"ANY_OBJECT_TYPE\";\n\n /** Components can manage any set of primitive types */\n public static readonly ANY_PRIMITIVE_SET = \"ANY_PRIMITIVE_SET\";\n\n /** Components can manage any set of object types */\n public static readonly ANY_OBJECT_SET = \"ANY_OBJECT_SET\";\n\n /**\n * Whenever a component can handle any type of reference to a single entity or to multiple entities.\n */\n public static readonly ANY_SINGLE_REFERENCE = \"ANY_SINGLE_REFERENCE\";\n\n /** Whenever a component can handle any type of reference to multiple entities */\n public static readonly ANY_MULTIPLE_REFERENCE = \"ANY_MULTIPLE_REFERENCE\";\n\n /**\n * Registers a plugin with its components, actions, and workflows\n * @param info - The plugin information to register\n */\n registerPlugin (info:XtPluginInfo) {\n this.pluginRegistry.set (info.name, info);\n\n if (info.components != null) {\n let updated=false;\n for (const comp of info.components) {\n updated=true;\n this.registerComponent (comp);\n }\n if (updated) this.componentByTypeCache.clear(); // Force recalculation of type\n }\n\n if( info.actionHandlers!=null) {\n for (const handler of info.actionHandlers) {\n this.registerActionHandler (handler);\n }\n }\n\n if (info.workflows!=null) {\n for (const wfw of info.workflows) {\n this.registerWorkflow (wfw);\n }\n }\n\n // Updates the signal which list all plugins\n this.listPlugins.update((array) => {\n let found=false;\n for (let i=0; i<array.length; i++) {\n if (array[i].name==info.name) {\n found=true;\n array[i] = info;\n }\n }\n if( !found)\n array.push(info);\n return [...array]; // You have to send another value, not just update the existing one.\n });\n\n }\n\n /**\n * Registers a workflow component\n * @param info - The workflow information to register\n */\n registerWorkflow<T extends XtWorkflow> (info:XtWorkflowInfo<T>) {\n this.workflowRegistry.set(info.name, info);\n }\n\n /**\n * Registers a component in the component registry\n * @param info - The component information to register\n */\n registerComponent<T> (info:XtComponentInfo<T>) {\n this.componentRegistry.set (info.componentName, info);\n this.listComponents.update((array) => {\n let found=false;\n for (let i=0; i<array.length; i++) {\n if (array[i].componentName==info.componentName) {\n found=true;\n array[i] = info;\n }\n }\n if( !found)\n array.push(info);\n return array;\n });\n }\n\n /**\n * Finds components that can handle the given value type\n * @param valueType - The value type to search for, or null/undefined to infer from the value\n * @param value - The optional value to infer the type from\n * @returns An array of matching component infos\n */\n findComponentsForType<T> (valueType:string|null|undefined, value?:T): XtComponentInfo<any>[] {\n let originalType=valueType;\n //console.debug('Finding type from '+valueType+' with value ',value);\n // We don't know the value type, let's try to guess if it's a primitive or object based on the value\n if ( valueType == null) {\n valueType = XtPluginRegistry.ANY_OBJECT_TYPE;\n if ((value == null) || (typeof value != 'object')) {\n valueType=XtPluginRegistry.ANY_PRIMITIVE_TYPE;\n } else if (value instanceof Date) {\n valueType=XtPluginRegistry.ANY_PRIMITIVE_TYPE;\n }\n\n if (Array.isArray(value)) {\n valueType = (valueType===XtPluginRegistry.ANY_PRIMITIVE_TYPE)?XtPluginRegistry.ANY_PRIMITIVE_SET:XtPluginRegistry.ANY_OBJECT_SET;\n }\n } else { // originalType has been defined.\n if (Array.isArray(value)) {\n valueType=valueType.endsWith('[]')?valueType:valueType+'[]';\n originalType=valueType;\n }\n }\n //console.debug('Type found is '+valueType);\n\n let ret = this.componentByTypeCache.get(valueType);\n if (ret == null) {\n ret = new Array<XtComponentInfo<any>> ()\n for (const comp of this.componentRegistry) {\n const info=comp[1];\n if (info.typesHandled.includes (valueType)) {\n ret.push(info);\n }\n }\n\n if ((ret.length == 0) && (originalType!=null)) {\n // Couldn't find a specific component, let's try the generic ones, so we don't pass any type\n ret = this.findComponentsForType(null, value);\n // Cache the component only if we were able to assert its type.\n // If no type has been given and value is null, then we cannot assess the real type\n if (value!=null) {\n this.componentByTypeCache.set(originalType, ret);\n }\n } else {\n // Cache the component only if we were able to assert its type.\n // If no type has been given and value is null, then we cannot assess the real type\n if ((value!=null) || (originalType!=null)) {\n this.componentByTypeCache.set(originalType ?? valueType, ret);\n }\n }\n\n }\n return ret;\n }\n\n /**\n * Returns the global singleton plugin registry\n * @returns The global XtPluginRegistry instance\n */\n public static registry (): XtPluginRegistry {\n return XT_REGISTRY;\n }\n\n /**\n * Finds component info for the given component class type\n * @param type - The component class type to search for\n * @returns The component info or null if not found\n */\n findComponentInfo(type: Type<XtComponent<any>>): XtComponentInfo<any>|null {\n // Search for the component registered with this class\n for (const info of this.componentRegistry.values()) {\n if (info.componentClass==type) {\n return info;\n }\n }\n return null;\n }\n\n /**\n * Gets component info for the given component class type, throwing if not found\n * @param type - The component class type to search for\n * @returns The component info\n * @throws Error if no component is found with the given class\n */\n getComponentInfo(type: Type<XtComponent<any>>): XtComponentInfo<any> {\n const ret= this.findComponentInfo(type);\n if (ret==null) {throw new Error (\"No component found with class \"+type);}\n return ret;\n }\n\n /**\n * Finds all the workflow components that can handle the given workflow type\n * @param type\n */\n listWorkflowsForType (type:string): XtWorkflowInfo<any>[] {\n const ret = [] as XtWorkflowInfo<any>[];\n for (const info of this.workflowRegistry.values()) {\n const index=info.workflowsHandled.findIndex((val)=>val==type);\n if (index>=0) {\n ret.push(info);\n }\n }\n return ret;\n }\n\n /**\n * Finds workflow info by name\n * @param name - The workflow name to search for\n * @returns The workflow info or undefined if not found\n */\n findWorkflowInfo (name:string): XtWorkflowInfo<any>|undefined {\n return this.workflowRegistry.get(name);\n }\n\n /**\n * Registers action handlers grouped by type\n * @param handlerInfo - The action handler information to register\n */\n registerActionHandler<T>(handlerInfo:XtActionHandlerInfo<T>) {\n for (const type of handlerInfo.types) {\n const handlers = handlerInfo.actions;\n for (const actionName of Object.keys(handlers)) {\n let exist = this.actionByTypeRegistry.get(type);\n if (exist==null) {\n exist = new Map();\n this.actionByTypeRegistry.set(type, exist);\n }\n exist.set(actionName, handlers[actionName]);\n }\n }\n }\n\n /**\n * Finds action info for the given type and action name\n * @param type - The type to look up\n * @param actionName - The action name to find\n * @returns The action info or undefined if not found\n */\n findActionInfo<T>(type:string, actionName:string):XtActionInfo<T>|undefined {\n const handlers=this.actionByTypeRegistry.get(type);\n if (handlers!=null) {\n return handlers.get(actionName);\n }\n return undefined;\n }\n\n /**\n * Lists all action infos registered for the given type\n * @param type - The type to list actions for\n * @returns An array of action name and info pairs\n */\n listActionInfos<T> (type:string): {name:string, info: XtActionInfo<T>}[] {\n const handlers=this.actionByTypeRegistry.get(type);\n if (handlers!=null) {\n return Array.from(handlers.entries()).map(([name,info]) => {\n return {name:name,info:info};\n });\n }\n else return []\n }\n}\n","import { FormGroup } from '@angular/forms';\nimport { isTypeReference, XtBaseTypeReference, XtTypeHierarchy, XtTypeReference, XtTypeResolver } from 'xt-type';\nimport { computed, Signal, signal, WritableSignal } from '@angular/core';\nimport { XtAction } from './action/xt-action';\nimport { XtPluginRegistry } from './registry/xt-plugin-registry';\n\n/**\n * A XtContext provides all the necessary information for an ng-extended component to operate. It is passed from parent to child component and pass\n * - The display mode - View, Inline view or Edit\n * - The value, either directly as a signal or in a formgroup when editing.\n * - The valueType, necessary to find the right ng-extended component to display\n *\n * To do this, it maintains a hierarchy of context and subContexts by name.\n */\nexport type XtContext<T> = {\n\n displayMode: XtDisplayMode;\n\n subName?: string; // The subName in the parentFormGroup and parentContext\n parentFormGroup?: FormGroup;\n localFormGroup?: FormGroup;\n\n /**\n * When the value in the context is a reference to another type\n */\n reference?:XtTypeReference\n\n /**\n * If it's a reference, we keep the context referenced\n */\n referencedContext?:XtContext<any>;\n\n /**\n * creates the referencedContext by using this referenced value\n * @param val\n *\n updateReferencedContext(val: any, valueType?:string): void;*/\n\n /**\n * Signal when all the asynchronously defined subreferences are resolved.\n *\n subReferencesResolved: WritableSignal<boolean>;\n*/\n\n // A parentContext if defined\n parentContext?:XtContext<any>;\n\n isInForm (): boolean;\n\n formGroup () : FormGroup | undefined;\n\n formControlNameOrNull():string|null;\n\n formControlValue (): any | null;\n\n subValue (subName?:string):T | null | undefined;\n\n subContext(subName: string | undefined | null, subType?:string, typeResolver?: XtTypeResolver | null): XtContext<any>;\n\n elementSetContext(subElement: any): XtContext<any>;\n\n displayValue: Signal<T|null>;\n\n setDisplayValue (newValue:T|null|undefined, type?:string): XtContext<T>;\n\n setFormValue (newValue:T|null|undefined, markAsDirty?:boolean): boolean;\n\n value(): T | null | undefined;\n\n valueType?:string;\n\n toString (): string;\n\n listActions: WritableSignal<XtAction<T>[] | null>;\n\n isReference ():boolean;\n\n setReferenceInfo (ref:XtTypeReference):void;\n\n}\n\n/** Display modes controlling how a value is presented: inline, full view, editable, or list. */\nexport type XtDisplayMode = 'INLINE_VIEW'|'FULL_VIEW'|'FULL_EDITABLE'|'LIST_VIEW';\n\n/**\n * Base implementation of the XtContext interface.\n * Manages display mode, form integration, child context hierarchy, and value tracking\n * for an ng-extended component.\n */\nexport class XtBaseContext<T> implements XtContext<T>{\n /** The current display mode for this context. Defaults to FULL_VIEW. */\n displayMode: XtDisplayMode = 'FULL_VIEW';\n\n /**\n * When editable, the value is stored in a parent formGroup\n */\n subName?: string;\n /** The parent FormGroup when this context is a child within a reactive form. */\n parentFormGroup?: FormGroup<any>;\n\n /**\n * When the context is a child, it potentially needs to update its parent value\n */\n parentContext?:XtBaseContext<any>;\n\n /**\n * All child contexts are kept in this map\n */\n protected childContexts?:Map<string, XtBaseContext<any>>;\n\n /**\n * localFormGroup exists only for composite components: it's children are all gathered in a form group\n */\n localFormGroup?: FormGroup<any>;\n\n /**\n * When not managed by a form, the value is here\n */\n nonFormValue?: WritableSignal<T|null>;\n\n /** The type identifier for the value contained in this context. */\n valueType?:string;\n\n /**\n * When the value in the context is a reference to another type\n */\n reference?:XtTypeReference;\n\n /**\n * If it's a reference, we keep the context referenced\n *\n referencedContext?:XtContext<any>;*/\n\n //subReferencesResolved = signal(false);\n\n /**\n * Keeps track of all the possible actions for this context\n * @protected\n */\n listActions = signal<XtAction<T>[]|null>(null);\n\n /**\n * Creates a new XtBaseContext instance.\n * @param displayMode - The display mode for this context\n * @param subName - Optional sub-name used within a parent form group\n * @param parentGroup - Optional parent FormGroup for reactive form integration\n * @param parentContext - Optional parent context for hierarchy management\n */\n constructor (displayMode: XtDisplayMode, subName?: string, parentGroup?: FormGroup, parentContext?:XtBaseContext<any>)\n {\n this.displayMode=displayMode;\n this.parentFormGroup=parentGroup;\n this.parentContext=parentContext;\n this.subName=subName;\n if ((parentGroup!=null) && (subName!=null)) {\n const subControl=parentGroup.get(subName);\n // If it's a form group, then it should be set as localFormGroup\n if ((subControl as FormGroup)?.controls!=null) {\n this.localFormGroup=subControl as FormGroup;\n }\n }\n }\n\n /**\n * Sets the display value for this context when not managed by a reactive form.\n * Propagates changes to child contexts and optionally notifies the parent context.\n * @param newValue - The new value to set\n * @param type - Optional type identifier to assign\n * @param updateParent - Whether to propagate the change to the parent context (default true)\n * @returns This context instance for chaining\n */\n setDisplayValue (newValue:T|null|undefined, type?:string, updateParent:boolean=true): XtBaseContext<T> {\n if (newValue!==undefined){\n const oldValue = this.nonFormValue?this.nonFormValue():null;\n if (this.nonFormValue==null) {\n if ((this.childContexts!=null) && (this.childContexts.size>0)) throw new Error ('An XtContext with no values cannot have children ',{cause:this});\n this.nonFormValue=signal(newValue);\n }else {\n this.nonFormValue.set(newValue);\n }\n\n // Change the children values if needed\n if (this.childContexts!=null) {\n if (newValue==null) {\n for (const [subName, child] of this.childContexts) {\n child.setDisplayValue(null, undefined, false);\n }\n\n } else if (oldValue!=null) {\n for (const [subName, child] of this.childContexts) {\n if (newValue[subName as keyof T]!=oldValue[subName as keyof T]) {\n // The value has changed, let's update\n child.setDisplayValue(newValue[subName as keyof T], undefined, false);\n }\n }\n }\n }\n\n if ((updateParent) && (this.subName!=null))\n this.parentContext?.updateSubDisplayValue(this.subName,newValue);\n }\n\n if (type!==undefined)\n this.valueType = type;\n return this;\n }\n\n /** Computed signal that returns the current display value from non-form storage. */\n displayValue = computed( ()=> {\n if (this.nonFormValue!==undefined) {\n return this.nonFormValue();\n } else {\n throw new Error (\"Cannot display a value that does not exist. Are you sure you're not using Reactive Form with this context? \"+ this.toString());\n }\n });\n\n /**\n * Checks whether this context is bound to a reactive form group.\n * @returns True if a form group exists\n */\n isInForm (): boolean {\n return (this.formGroup()!=null);\n }\n\n /**\n * Returns the sub-name used as the form control name, or null if not in a form.\n * @returns The sub-name or null\n */\n formControlNameOrNull():string|null {\n return this.subName??null;\n }\n\n /**\n * Returns the current value from either the non-form signal or the form control.\n * @returns The current value, or null/undefined\n */\n value ():T | null | undefined {\n if (this.nonFormValue!=null)\n return this.nonFormValue()??this.formControlValue();\n else\n return this.formControlValue();\n }\n\n /**\n * Returns a sub-value by name from the current value object.\n * @param subsubName - Optional sub-key to retrieve from the value object\n * @returns The sub-value or the full value if no key is given\n */\n subValue (subsubName?:string):any | null | undefined {\n const value = this.nonFormValue?this.nonFormValue():this.formControlValue();\n if ((subsubName != null) && (value != null)) {\n return value[subsubName as keyof typeof value];\n }else {\n return value;\n }\n }\n\n /**\n * Enable child contexts to update its own value in the parent context whenever it's value changes\n */\n protected updateSubDisplayValue (subName:string, subValue:any): void {\n if (this.nonFormValue!=null) {\n let newValue = this.nonFormValue();\n if (newValue==null) {\n const newValue = {} as T;\n newValue[subName as keyof T]=subValue\n this.nonFormValue.set(newValue);\n } else {\n newValue[subName as keyof T] = subValue; // Discretly update the subValue without triggering parent signal\n }\n } else {\n throw new Error (\"No nonFormValue to update subDisplayValue\"+this.toString());\n }\n }\n\n /**\n * Retrieves the value from the parent form group for this context's sub-name.\n * @returns The form control value, or undefined if not in a form\n */\n formControlValue (): T | null | undefined {\n let ret:T|undefined|null=undefined;\n if (this.isInForm()) {\n if (this.subName!=null) {\n //console.debug (\"formControlValue parentGroup value is \", this.parentFormGroup?.value);\n ret=this.parentFormGroup?.value[this.subName];\n } else {\n ret= this.parentFormGroup?.value;\n }\n } else {\n ret= undefined;\n }\n //console.debug(\"formControlValue of \"+this.subName+ \" is \",ret);\n return ret;\n }\n\n /**\n * Sets the value in the parent form group for this context's sub-name.\n * @param newValue - The new value to set on the form control\n * @param markAsDirty - Whether to mark the control as dirty (default false)\n * @returns True if the value was successfully set\n */\n setFormValue (newValue:T|null|undefined, markAsDirty=false): boolean {\n if (this.isInForm()) {\n if (this.subName!=null) {\n const control=this.parentFormGroup?.get(this.subName);\n if (control!=null) {\n control.setValue(newValue);\n if (markAsDirty) {\n control.markAsDirty();\n }\n return true;\n } else {\n // Supports setting values without a child form control\n const value=this.parentFormGroup?.getRawValue();\n if (value!=null) {\n if (newValue!==undefined)\n value[this.subName]=newValue;\n else\n delete value[this.subName];\n }\n }\n }\n }\n return false;\n }\n\n\n /**\n * Returns the context associated with a specific element in a set.\n * Value must be an array.\n * @param elementIndex\n */\n elementSetContext(elementIndex:number): XtContext<any> {\n const value = this.value();\n\n if (!Array.isArray(this.value())) {\n throw new Error (\"The value must be an Array / Set to create a subElement context.\")\n }\n\n const indexKey = elementIndex.toString();\n let ret = this.childContexts?.get(indexKey);\n\n if( ret==null) {\n ret = new XtBaseContext<T>(this.displayMode, undefined, undefined, this);\n ret.setDisplayValue((value as any[])[elementIndex]);\n\n if (this.valueType != null) {\n // Convert potential array type into single type\n ret.valueType = this.valueType.endsWith('[]') ? this.valueType.substring(0, this.valueType.length - 2) : this.valueType;\n }\n if( this.childContexts==null) this.childContexts=new Map<string, XtBaseContext<any>>();\n this.childContexts?.set(indexKey, ret);\n }\n return ret;\n }\n\n /**\n * Returns or creates a child context for the given sub-name.\n * Resolves type information and references when a typeResolver is provided.\n * @param subName - The sub-name for the child context\n * @param subType - Optional type hint for the child\n * @param typeResolver - Optional type resolver for resolving sub-types and references\n * @returns The child XtContext\n */\n subContext(subName: string | undefined | null, subType?:string, typeResolver?:XtTypeResolver | null): XtContext<any> {\n if ((subName==null) || (subName.length==0)) {\n return this;\n } else if (this.childContexts?.has(subName)) {\n return this.childContexts?.get(subName)!;\n }else {\n let subValue:WritableSignal<any|null> | null = null;\n let currentGroup = this.formGroup();\n // Recalculate parentGroup and formControlName and value if needed.\n if (currentGroup==null){\n let curValue = this.nonFormValue;\n if (curValue!=null){\n if (curValue()!=null) {\n subValue = signal ((curValue() as any)[subName]);\n }\n }\n if (subValue==null) {\n subValue = signal (null);\n }\n }\n\n const ret = new XtBaseContext<T> (this.displayMode, subName, currentGroup, this);\n if( subValue!=null) ret.nonFormValue=subValue;\n\n if (subType!=null) {\n ret.valueType=subType;\n } else if ((this.valueType!=null) && (typeResolver!=null)) {\n const subType = typeResolver.findType(this.valueType, subName, this.value());\n if( subType!=null) {\n if (isTypeReference(subType)) {\n if( subType.type== XtBaseTypeReference.UNRESOLVED_TYPE) throw new Error (\"You must resolve all reference types before using them in a context. Missing type \"+subType.type+\" for subName \"+subName+\" in valueType \"+this.valueType+\" of context \"+this.toString())\n\n ret.valueType=subType.toType;\n ret.reference=subType;\n if (this.displayMode=='LIST_VIEW') ret.displayMode='INLINE_VIEW'; // We display a reference as inline in a list\n else if (this.displayMode=='FULL_EDITABLE') {\n // We don't edit directly references, we simply enable selection of them.\n ret.valueType=(subType.referenceType=='ONE-TO-MANY')?XtPluginRegistry.ANY_MULTIPLE_REFERENCE:XtPluginRegistry.ANY_SINGLE_REFERENCE;\n }\n } else {\n ret.valueType=(subType as XtTypeHierarchy).type;\n }\n }\n //ret.valueType=typeResolver.findTypeName(this.valueType, subName, this.value())??undefined;\n }\n\n if (this.childContexts==null) this.childContexts=new Map<string, XtBaseContext<any>>();\n this.childContexts.set(subName, ret);\n return ret;\n }\n }\n\n /**\n * Returns the available form group, preferring localFormGroup over parentFormGroup.\n * @returns The form group or undefined\n */\n formGroup (): FormGroup|undefined {\n return this.localFormGroup??this.parentFormGroup;\n }\n\n /**\n * Checks whether this context holds a reference to another type.\n * @returns True if a reference is set\n */\n isReference ():boolean {\n return (this.reference!=null);\n }\n\n /**\n * Sets the type reference information for this context.\n * @param reference - The type reference to set\n */\n setReferenceInfo (reference:XtTypeReference):void {\n this.reference=reference;\n //this.subReferencesResolved.set(this.reference!=null);\n }\n\n /**\n * creates the referencedContext by using this referenced value\n * @param val\n *\n updateReferencedContext(val: any, valueType?:string): void {\n if (!this.isReference()) throw new Error ('This context '+this.toString()+' is not a reference.');\n\n if( this.referencedContext==null) {\n let refDisplayMode = 'INLINE_VIEW' as XtDisplayMode;\n if (this.displayMode=='FULL_VIEW') refDisplayMode = 'FULL_VIEW';\n this.referencedContext = new XtBaseContext(refDisplayMode);\n }\n this.referencedContext.setDisplayValue(val);\n if( valueType!=null) this.referencedContext.valueType=valueType;\n }*/\n\n /**\n * Returns a string representation of this context, including its name, type, value, and reference info.\n * @returns A human-readable description of the context\n */\n toString():string {\n let ret='XtContext named ';\n ret += this.subName??'None';\n ret += ' with type ';\n ret += this.valueType??'None';\n ret +=' with value ';\n ret += this.nonFormValue?this.nonFormValue():this.formControlValue();\n if (this.isReference()) {\n ret +=' referencing ';\n ret += this.reference?.type\n }\n return ret;\n }\n}\n","import { XtComponentInfo } from './plugin/xt-plugin-info';\n\n/**\n * Represents a resolved component with its name, class reference, and output capability.\n * Created by the resolver to indicate which XtComponent should be used for a given context.\n */\nexport class XtResolvedComponent {\n /** The registered name of the resolved component. */\n componentName: string;\n /** The Angular component class reference. */\n componentClass: any;\n /** Whether the component emits any outputs. */\n outputs:boolean;\n\n /**\n * Creates a new XtResolvedComponent instance.\n * @param componentName - The registered component name\n * @param componentClass - The Angular component class\n * @param outputs - Whether the component has outputs (default false)\n */\n constructor (componentName:string, componentClass:any, outputs:boolean=false) {\n this.componentName = componentName;\n this.componentClass = componentClass;\n this.outputs = outputs;\n }\n\n /**\n * Creates an XtResolvedComponent from an XtComponentInfo.\n * @param info - The component info from the plugin registry\n * @returns A new XtResolvedComponent instance\n */\n public static from (info:XtComponentInfo<any>): XtResolvedComponent {\n const ret = new XtResolvedComponent(info.componentName, info.componentClass);\n if ( (info.outputs!=null) && (info.outputs.length>0)){\n ret.outputs=true;\n }\n return ret;\n }\n}\n","/**\n * Just declare a type marker for Workflows\n */\n\nexport type XtWorkflow = {\n\n}\n","/**\n * The global plugin registry.\n * Plugins will register to this when loaded.\n */\nimport { XtPluginRegistry } from './lib/registry/xt-plugin-registry';\n\ndeclare global {\n\n var XT_REGISTRY:XtPluginRegistry;\n}\n\nexport function initXtPluginRegistry () {\n if (globalThis.XT_REGISTRY==null) {\n globalThis.XT_REGISTRY = new XtPluginRegistry();\n }\n}\n\nexport function xtPluginRegistry (): XtPluginRegistry {\n if (globalThis.XT_REGISTRY==null) {\n initXtPluginRegistry();\n }\n return globalThis.XT_REGISTRY;\n}\n","import { InjectionToken } from \"@angular/core\";\nimport { XtResolver } from \"../resolver/xt-resolver\";\nimport { XtPluginRegistry } from \"../registry/xt-plugin-registry\";\nimport { XtTypeResolver } from \"xt-type\";\nimport { xtPluginRegistry } from '../../globals';\n\n/** Injection token for providing a custom component resolver */\nexport const XT_RESOLVER_TOKEN = new InjectionToken<XtResolver> ('Enable providing a custom component resolver.');\n\n/** Injection token for providing a custom type resolver */\nexport const XT_TYPE_RESOLVER_TOKEN = new InjectionToken<XtTypeResolver> ('Enable providing a custom type resolver.');\n\n/** Injection token for providing the plugin registry with a default factory */\nexport const XT_REGISTRY_TOKEN = new InjectionToken<XtPluginRegistry> (\"Injects the Plugin Registry right into your angular component\",\n {\n factory: () => {\n return xtPluginRegistry();\n }\n }\n )\n","import { XtPluginRegistry } from \"../registry/xt-plugin-registry\";\nimport { isTypeReference, XtTypeResolver } from \"xt-type\";\nimport { XtContext } from \"../xt-context\";\nimport { XtResolvedComponent } from \"../xt-resolved-component\";\nimport { XtResolver } from \"./xt-resolver\";\n\n/** Resolves components by looking them up in the plugin registry based on context type */\nexport class XtRegistryResolver implements XtResolver {\n\n /** The plugin registry to search in */\n registry:XtPluginRegistry;\n /** The type resolver for type hierarchy lookups */\n typeResolver: XtTypeResolver;\n\n /**\n * Creates a new XtRegistryResolver\n * @param registry - The plugin registry to use for component lookups\n * @param typeResolver - The type resolver for type hierarchy information\n */\n constructor (registry:XtPluginRegistry, typeResolver:XtTypeResolver) {\n this.registry = registry;\n this.typeResolver = typeResolver;\n }\n\n /**\n * Resolves a component for the given context and optional subName\n * @param baseContext - The context containing type and value information\n * @param subName - Optional sub-name for nested property resolution\n * @returns The resolved component info or null if no component matches\n */\n resolve<T>(baseContext: XtContext<T>, subName?:string): XtResolvedComponent | null {\n let typeToFind = baseContext.valueType;\n\n const typeInfo = this.typeResolver.findType(baseContext.valueType, subName);\n // If it's a type reference, we find the component of the referenced type\n if (isTypeReference(typeInfo)) {\n if (baseContext.displayMode=='FULL_EDITABLE') {\n typeToFind = XtPluginRegistry.ANY_SINGLE_REFERENCE;\n }else {\n typeToFind =typeInfo.toType;\n }\n }\n\n const ret= this.registry.findComponentsForType (typeToFind, baseContext.subValue(subName));\n if (ret!=null && ret.length>0) {\n return XtResolvedComponent.from( ret[0]);\n }\n return null;\n }\n\n}\n","import { signal } from '@angular/core';\nimport { XtActionInfo } from '../plugin/xt-plugin-info';\n\n/** Represents a registered action with its metadata and enabled state */\nexport class XtAction<T> {\n /** The unique name of the action */\n name: string;\n /** Metadata describing the action */\n info: XtActionInfo<T>;\n /** Signal indicating whether the action is currently enabled */\n enabled = signal<boolean>(false);\n\n /**\n * Creates a new XtAction instance\n * @param name - The unique name of the action\n * @param info - Metadata describing the action\n * @param enabled - Whether the action is initially enabled (defaults to false)\n */\n constructor(name: string, info: XtActionInfo<T>, enabled?: boolean) {\n this.name = name;\n this.info = info;\n if (enabled!=null) {\n this.enabled.set(enabled);\n }\n }\n}\n","/**\n * Wrapper around xt-store manager: You can use it to check if xt-store is included or not, and decide what to do\n *\n * This allows plugins to potentially use xt-store whenever included in the applications running the plugin\n */\nimport { Observable } from 'rxjs';\nimport { TestStoreCriteria } from '../test/store-test-helper';\n\nexport class StoreSupport {\n\n /** Optional test store manager override for testing */\n protected static testStoreManager?: IStoreManager;\n\n /**\n * Checks if a store manager is available (either test or global)\n * @returns true if a store manager is available\n */\n static isStoreManagerAvailable () {\n if (this.testStoreManager!=null) return true;\n return ((globalThis as any).xtStoreManager!=undefined);\n }\n\n /**\n * Gets the current store manager (test or global)\n * @returns The IStoreManager instance\n */\n static getStoreManager (): IStoreManager {\n return this.testStoreManager??((globalThis as any).xtStoreManager());\n }\n\n /**\n * Sets a test store manager for testing purposes\n * @param testStoreManager - The test store manager to use\n */\n static setTestStoreManager (testStoreManager:IStoreManager): void {\n StoreSupport.testStoreManager = testStoreManager;\n }\n\n /**\n * Creates a new store criteria for filtering\n * @param name - The property name to filter on\n * @param value - The value to filter by\n * @param operator - The comparison operator (defaults to '=')\n * @returns A new IStoreCriteria instance\n */\n static newStoreCriteria<T = any> (name:keyof T, value:any, operator?:IStoreCriteriaOperator): IStoreCriteria<T> {\n if (operator==null) operator='=';\n return StoreSupport.getStoreManager().newStoreCriteria(name, value, operator);\n }\n\n}\n\n/**\n * Interface definition for xt-store component.\n * We re-define them here to avoid importing xt-store in all plugins that don't need it.\n */\n\n\n/** Interface for transforming data after it has been loaded from the store */\nexport interface IDataTransformer<T> {\n /**\n * Enable transformation of data right after it has been loaded from the store\n * @param source\n */\n postLoadingTransformation (source:any[]): T[];\n\n}\n\n/** Information about a stored document */\nexport interface IDocumentInfo {\n /** The name of the document */\n documentName: string;\n /** Whether the document is accessible via URL */\n isUrl: boolean;\n /** Optional document identifier */\n documentId?: string;\n}\n\n/** Supported operators for store criteria comparisons */\nexport type IStoreCriteriaOperator = '='|'<'|'<=';\n\n/** Criteria for filtering store queries */\nexport interface IStoreCriteria<T> {\n /** The property name to filter on */\n name: keyof T;\n /** The value to filter by */\n value: any;\n /** The comparison operator */\n operator: IStoreCriteriaOperator;\n}\n\n/** Sort criteria for store queries */\nexport type ISortBy<T> ={\n by:keyof T,\n direction: ISortByDirection\n}\n\n/** Sort direction options */\nexport enum ISortByDirection {\n /** No sorting */\n None = \"None\",\n /** Sort in ascending order */\n Ascending = \"Ascending\",\n /** Sort in descending order */\n Descending = \"Descending\"\n}\n\n/** Interface for a store provider that handles CRUD operations on entities */\nexport interface IStoreProvider<T> {\n /**\n * Stores an entity in the data store\n * @param name - The entity/collection name\n * @param entity - The entity to store\n * @returns A promise that resolves to the stored entity\n */\n storeEntity( name:string, entity: T): Promise<T>;\n\n /**\n * Rejects the promise if the entity is not found\n * @param name\n * @param key\n */\n /**\n * Rejects the promise if the entity is not found\n * @param name - The entity/collection name\n * @param key - The entity key/ID\n */\n safeLoadEntity( name: string, key: any): Promise<T>;\n /**\n * Loads an entity from the data store\n * @param name - The entity/collection name\n * @param key - The entity key/ID\n * @returns A promise that resolves to the entity or undefined if not found\n */\n loadEntity( name: string, key: any): Promise<T|undefined>;\n\n /**\n * Deletes an entity from the data store\n * @param name - The entity/collection name\n * @param key - The entity key/ID\n * @returns A promise that resolves to true if deletion was successful\n */\n deleteEntity(name:string, key: any): Promise<boolean>;\n\n /**\n * Searches for entities matching the given criteria\n * @param name - The entity/collection name\n * @param criteria - Filter criteria to apply\n * @returns An observable emitting matching entities\n */\n searchEntities(\n name: string,\n ...criteria: IStoreCriteria<T>[]\n ): Observable<Array<T>>;\n\n /**\n * Searches for entities and optionally sorts, groups, and transforms the results\n * @param name - The entity/collection name\n * @param sort - Optional sort criteria\n * @param groupBy - Optional grouping configuration\n * @param transformer - Optional data transformer\n * @param criteria - Additional filter criteria\n * @returns An observable emitting the processed results\n */\n searchAndPrepareEntities(\n name: string,\n sort?:ISortBy<T>,\n groupBy?:any,\n transformer?: IDataTransformer<T>,\n ...criteria: any[]\n ): Observable<any>;\n\n /**\n * Checks whether this provider can store documents\n * @returns true if document storage is supported\n */\n canStoreDocument(): boolean;\n\n /**\n * Upload one document to a server store and returns the url or the id needed to retrieve them.\n * @param toStore - The file to upload\n */\n storeDocument(\n toStore: File\n ): Promise<IDocumentInfo>;\n\n /**\n * Upload documents to a server store and returns the url or the id needed to retrieve them.\n * @param toStore - The files to upload\n */\n storeDocuments(\n toStore: File[]\n ): Observable<IDocumentInfo>;\n\n\n}\n\n/** Interface for a store manager that provides access to store providers */\nexport interface IStoreManager {\n /**\n * Gets a store provider by name\n * @param name - Optional provider name (defaults to the default provider)\n * @returns The store provider or undefined if not found\n */\n getProvider<T=never>(name?: string): IStoreProvider<T> | undefined;\n /**\n * Gets a store provider by name, throwing if not found\n * @param name - Optional provider name (defaults to the default provider)\n * @returns The store provider\n * @throws Error if no provider is found\n */\n getProviderSafe<T=never>(name?: string): IStoreProvider<T>;\n\n /**\n * Gets the default store provider\n * @returns The default provider or undefined if none is set\n */\n getDefaultProvider<T=never>(): IStoreProvider<T> | undefined;\n\n /**\n * Gets the default store provider, throwing if not found\n * @returns The default store provider\n * @throws Error if no default provider is set\n */\n getDefaultProviderSafe<T=never>(): IStoreProvider<T>;\n\n /**\n * Creates a new store criteria instance\n * @param name - The property name to filter on\n * @param value - The value to filter by\n * @param operator - The comparison operator\n * @returns A new IStoreCriteria instance\n */\n newStoreCriteria<T=never> (name:keyof T, value:any, operator: IStoreCriteriaOperator): IStoreCriteria<T>;\n}\n","import { computed, inject, Injectable, Type } from '@angular/core';\nimport { XtContext } from '../xt-context';\nimport { XtRegistryResolver } from '../resolver/xt-registry-resolver';\nimport { XT_REGISTRY_TOKEN, XT_RESOLVER_TOKEN, XT_TYPE_RESOLVER_TOKEN } from './xt-tokens';\nimport { XtResolvedComponent } from '../xt-resolved-component';\nimport {\n ManagedDataHandler,\n MappingHelper,\n XtTypeHandler,\n XtTypeInfo,\n xtTypeManager,\n XtTypeResolver,\n XtUpdatableTypeResolver\n} from 'xt-type';\nimport { XtComponentInfo, XtPluginInfo, XtTypeHandlerInfo } from '../plugin/xt-plugin-info';\nimport { XtResolver } from '../resolver/xt-resolver';\nimport { XtComponent } from '../xt-component';\nimport { XtAction } from '../action/xt-action';\nimport { XtActionHandler, XtActionResult } from '../action/xt-action-handler';\nimport { IStoreManager, StoreSupport } from '../store/store-support';\nimport { firstValueFrom, Observable } from 'rxjs';\n\n/**\n * An all in one helper class, enabling manipulation of the context, with data and type associated with it.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class XtResolverService {\n\n /** Injected plugin registry for component and type registration. */\n pluginRegistry = inject (XT_REGISTRY_TOKEN);\n\n /** Optional base resolver injected via DI token. */\n protected baseResolver = inject (XT_RESOLVER_TOKEN, {optional:true});\n /** Optional base type resolver injected via DI token. */\n protected baseTypeResolver = inject (XT_TYPE_RESOLVER_TOKEN, {optional:true});\n\n /** The resolver used to find components for a given context. */\n resolver:XtResolver;\n /** The type resolver for type hierarchy and reference resolution. */\n typeResolver:XtTypeResolver;\n\n constructor() {\n if (this.baseTypeResolver==null) {\n this.typeResolver = xtTypeManager();\n } else this.typeResolver=this.baseTypeResolver;\n\n if (this.baseResolver==null) {\n this.resolver=new XtRegistryResolver (this.pluginRegistry, this.typeResolver);\n } else this.resolver=this.baseResolver;\n\n }\n\n /**\n * Finds the best matching component for the given context and optional sub-name.\n * @param baseContext - The context to resolve against\n * @param subName - Optional sub-name for nested resolution\n * @returns The resolved component descriptor\n */\n findBestComponent<T> (baseContext: XtContext<T>, subName?:string) : XtResolvedComponent{\n const ret= this.resolver.resolve(baseContext, subName);\n if (ret!=null) return ret;\n else throw new Error (\"No components found for this context \"+ baseContext.toString());\n }\n\n /**\n * Resolves the type name for the given context and optional sub-name.\n * @param baseContext - The context to query\n * @param subName - Optional sub-name for nested type resolution\n * @param value - Optional value for type inference\n * @returns The type name, or null/undefined\n */\n findTypeOf<T> (baseContext:XtContext<T>, subName?:string, value?:T): string | null | undefined {\n const ret = this.typeResolver.findTypeName (baseContext.valueType, subName, value);\n return ret;\n }\n\n /**\n * Finds the type handler for the given context, resolving references if necessary.\n * @param baseContext - The context to query\n * @param subName - Optional sub-name for nested resolution\n * @param value - Optional value for handler inference\n * @returns An object with the type name and its handler\n */\n findTypeHandlerOf<T> (baseContext:XtContext<T>, subName?:string, value?:T): {typeName?:string | null, handler?:XtTypeHandler<any>} {\n let ret:{typeName?:string | null, handler?:XtTypeHandler<any>} = {typeName:undefined, handler:undefined};\n if (baseContext.isReference()){\n ret = this.typeResolver.findTypeHandler(baseContext.reference!.toType, false, undefined, value);\n }else {\n ret = this.typeResolver.findTypeHandler(baseContext.valueType, false, subName, value);\n }\n return ret;\n }\n\n /**\n * Lists the sub-names defined by the type of the given context.\n * @param baseContext - The context to query\n * @param value - Optional value for type inference\n * @returns An array of sub-name strings\n */\n listSubNamesOf<T> (baseContext:XtContext<T>, value?:T): string[] {\n return this.typeResolver.listSubNames(baseContext.valueType, value);\n }\n\n /**\n * Lists the sub-names defined by a given value type string.\n * @param valueType - The type string to query\n * @param value - Optional value for type inference\n * @returns An array of sub-name strings\n */\n listSubNamesOfType<T> (valueType:string, value?:T): string[] {\n return this.typeResolver.listSubNames(valueType, value);\n }\n\n /**\n * Registers a full plugin including its types and type handlers.\n * @param info - The plugin information to register\n */\n registerPlugin (info:XtPluginInfo) {\n this.pluginRegistry.registerPlugin (info);\n this.registerTypes (info.types, info.typeHandlers);\n }\n\n /**\n * Registers type definitions and optional type handlers with the type resolver.\n * @param types - The type definitions to register\n * @param handlers - Optional type handler definitions\n */\n registerTypes (types:XtTypeInfo|undefined, handlers?:XtTypeHandlerInfo<any>[]): void {\n if ((types !=null) && (this.typeResolver.canUpdate())) {\n\n for (const newType in types) {\n let handler=this.handlerDefinedFor (newType, handlers);\n if (handler==null) {\n handler = new ManagedDataHandler();\n }\n (this.typeResolver as XtUpdatableTypeResolver).addRootType (newType, types[newType], handler);\n }\n }\n }\n\n\n /**\n * Calculates all the possible actions for a given context\n * @param context\n * @param onlyVisible\n */\n possibleActions<T> (context:XtContext<T>, onlyVisible:boolean=true): Array<XtAction<T>> {\n const existingActions = context.listActions();\n if (existingActions!=null) {\n return existingActions;\n }\n\n if (context.valueType!=null) {\n const actionInfos = this.pluginRegistry.listActionInfos<T>(context.valueType);\n const actions = actionInfos.map((info) => {\n const ret = new XtAction(info.name,info.info, true);\n return ret;\n });\n context.listActions.set(actions);\n return actions;\n }\n return [];\n }\n\n /**\n * Finds the possible action with the given name for the current type, and runs it in the current value.\n * If the action is not possible in this context, try a parent context\n * @param actionName\n */\n async runAction<T> (context: XtContext<T>, actionName:string, storeMgr?:any): Promise<XtActionResult<any>> {\n let handler: XtActionHandler<T> |null = null;\n for (const action of this.possibleActions(context,false)) {\n if (action.name==actionName) {\n const handlerClass=action.info.handlerClass;\n handler=new handlerClass ();\n break;\n }\n }\n\n if (handler!=null) {\n return handler.runAction(context, actionName, this, storeMgr);\n } else {\n // Couldn't find the handler, let's see if we can have that up the context chain\n if (context.parentContext!=null) {\n return this.runAction(context.parentContext, actionName); // Run the parent without any store indication, as it most probably is different\n } else {\n return Promise.reject(\"Cannot find action \"+actionName+\" for context \"+this.toString());\n }\n }\n }\n\n\n /**\n * Checks if a handler is defined for the given type among the provided handler infos.\n * @param newType - The type to check\n * @param handlers - The handler definitions to search\n * @returns A handler instance or null\n */\n protected handlerDefinedFor(newType: string, handlers: XtTypeHandlerInfo<any>[] | undefined):any {\n for (const handler of handlers ?? []) {\n if (handler.typesHandled.includes(newType)) {\n return new handler.handlerClass ();\n }\n }\n return null;\n }\n\n /**\n * Gets the resolved component info for a given component type.\n * @param type - The component type class\n * @returns The resolved component descriptor\n */\n getComponentInfo<T>(type: Type<XtComponent<T>>):XtResolvedComponent {\n return XtResolvedComponent.from(this.pluginRegistry.getComponentInfo (type));\n }\n\n /**\n * Finds the resolved component info for a given component type, returning null if not found.\n * @param type - The component type class\n * @returns The resolved component descriptor or null\n */\n findComponentInfo<T>(type: Type<XtComponent<T>>):XtResolvedComponent|null {\n const ret=this.pluginRegistry.findComponentInfo (type);\n if (ret==null) return null;\n else return XtResolvedComponent.from(ret);\n }\n\n /** Computed signal that lists all registered components. */\n public listComponents = computed<Array<XtComponentInfo<any>>>(() => {\n return this.pluginRegistry.listComponents();\n });\n\n /** Computed signal that lists all registered plugins. */\n public listPlugins = computed<Array<XtPluginInfo>>(() => {\n return this.pluginRegistry.listPlugins();\n });\n\n /**\n * Dynamically load a register a plugin from the given url\n * The plugin must export at least a Register entrypoint that will be called right after loading..\n * @returns a Promise with the module loaded and already registered.\n * @param module\n */\n registerPluginModule (module: {registerPlugin : (resolver:XtResolverService) => string}, url:URL|string):boolean {\n\n const pluginName = module.registerPlugin(this);\n // Transform the configured Uris to real urls\n const pluginConfig=this.pluginRegistry.pluginRegistry.get(pluginName);\n if (pluginConfig?.uriLogo!=null) {\n let urlString = url.toString();\n const lastSlash = urlString.lastIndexOf('/');\n urlString = urlString.substring(0, lastSlash+1)+pluginConfig?.uriLogo;\n pluginConfig.uriLogo=urlString;\n }\n return true;\n }\n\n /**\n * Based on the type & value of the element, find which property is on its type and returns it's value\n * @param context\n * @param subPropertyType\n * @param value\n */\n findSubPropertyWithType<T> (context: XtContext<T>, subPropertyType:string, value:T): any {\n const subKeys = this.typeResolver.findSubPropertiesWithType (context.valueType, subPropertyType);\n if ((subKeys!=null)&&(subKeys.length==1)) {\n return value[subKeys[0] as keyof T];\n } else if (subKeys.length>1) {\n // Let's pickup the first\n return value[subKeys[0] as keyof T];\n } else {\n return undefined;\n }\n }\n\n /**\n * Creates a duplicate of an object, using our knowledge on its type given by the context\n * @param context\n * @param value\n */\n safeDuplicate<T> (context: XtContext<T>, value:T): T {\n\n const typeHandler = this.typeResolver.findTypeHandler(context.valueType, false, undefined, value);\n\n if (typeHandler.handler!=null) {\n return typeHandler.handler.safeDuplicate (value);\n }\n return structuredClone(value);\n }\n\n /**\n * Resolves a mapping helper from the context's value type to a target type.\n * @param context - The source context\n * @param targetType - The target type to map to\n * @param value - Optional value for handler inference\n * @returns A MappingHelper if a mapping exists, otherwise undefined\n */\n resolveMappingOf<U, T> (context: XtContext<T>, targetType:string, value?:T): MappingHelper<U, T> | undefined {\n if (context.valueType!=null) {\n const typeHandler = this.typeResolver.findTypeHandler<T>(targetType, false, undefined, value);\n\n if (typeHandler.handler!=null) {\n const ret = typeHandler.handler.getOrCreateMappingFrom<U>(context.valueType, this.typeResolver);\n if( ret != null) {\n return ret;\n }\n }\n }\n return undefined;\n }\n\n /**\n * Resolves the referenced value for a context that holds a type reference, using the provided store manager.\n * @param context - The context with a reference to resolve\n * @param storeMgr - The store manager for entity lookup\n * @returns The resolved referenced value(s), or null/undefined\n */\n async resolveReferencedValue<T,U> (context: XtContext<T>, storeMgr: IStoreManager): Promise<U | U[] | null | undefined> {\n if (!context.isReference()) return undefined;\n const ref= context.reference!;\n const storeProvider = storeMgr.getProvider<U> (ref.type);\n if (storeProvider == null) {\n throw new Error ('No Store provider found for type '+ref.type);\n }\n\n const ret= await firstValueFrom(storeProvider.searchEntities(ref.toType, storeMgr.newStoreCriteria(ref.field as keyof U, context.value(),'=')));\n if (ret.length == 0) return null;\n if (ref.referenceType=='MANY-TO-ONE') {\n if (ret.length > 1) throw new Error('Multiple values for many to one relation between ' + context.valueType + ' and ' + ref.type + ' with value ' + context.value());\n return ret[0];\n } else if (ref.referenceType=='ONE-TO-MANY') {\n return ret;\n }\n return undefined;\n }\n\n /**\n * Resolves all pending type references in the type resolver.\n */\n resolvePendingReferences () {\n (this.typeResolver as XtUpdatableTypeResolver).resolveAllTypeReferences();\n }\n\n /**\n * Calculates the values that can be referenced by the reference & value of this context\n * @param context\n */\n findPossibleReferences<T, U> (context:XtContext<T>): Observable<U[]> {\n if (!context.isReference()) throw new Error('Cannot find possible references of this non reference context'+context.toString());\n const reference = context.reference!;\n const store =StoreSupport.getStoreManager().getProviderSafe<U>(reference.toType);\n return store.searchEntities(reference.toType );\n }\n\n/* async loadAllReferencesForContext<T> (context:XtContext<T>, storeMgr: IStoreManager): Promise<void> {\n const refs =this.typeResolver.listReferences(context.valueType);\n const promises:Promise<void>[]=[];\n for (const ref of Object.keys(refs)) {\n const subContext= context.subContext(ref, undefined, this.typeResolver);\n promises.push(this.resolveReferencedValue(subContext, storeMgr).then ((value) => {\n subContext.updateReferencedContext(value);\n }));\n }\n\n if( promises.length>0) {\n return Promise.all(promises).then((values) => {\n context.subReferencesResolved.set(true);\n return;\n });\n } else {\n return Promise.resolve().then (() => {\n context.subReferencesResolved.set(true);\n });\n }\n\n }\n*/\n\n}\n","import { OutputEmitterRef } from '@angular/core';\nimport { XtComponentOutput } from '../xt-component';\n\n/** Default implementation of XtComponentOutput */\nexport class XtBaseOutput implements XtComponentOutput {\n /** Output emitter for when a value is selected */\n valueSelected: OutputEmitterRef<any> | undefined;\n\n}\n","import {\n AfterViewInit,\n Component,\n computed,\n inject,\n input,\n model,\n output, signal,\n Signal,\n Type,\n viewChild\n} from '@angular/core';\nimport { NgComponentOutlet } from '@angular/common';\nimport {\n XtComponent,\n XtComponentModel,\n XtComponentOutput,\n XtInputType,\n XtModelType,\n XtOutputType\n} from '../xt-component';\nimport { XtBaseContext, XtContext, XtDisplayMode } from '../xt-context';\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { XtResolverService } from '../angular/xt-resolver.service';\nimport { XtResolvedComponent } from '../xt-resolved-component';\nimport { XtBaseOutput } from '../output/xt-base-output';\nimport { XtBaseInput } from '../output/xt-base-input';\nimport { isTypeReference } from 'xt-type';\nimport { XtBaseModel } from '../output/xt-base-model';\n\n/**\n * Offers a nice and easy to dynamically embed a component.\n * You set the type, the display mode, and either the value or the formgroup & subName to use.\n * XtRender will then instantiate the component, bind it to the value or form, and display it.\n */\n@Component({\n selector: 'xt-render',\n standalone: true,\n imports: [\n NgComponentOutlet,\n ReactiveFormsModule\n ],\n templateUrl: './xt-render.component.html',\n styleUrl: './xt-render.component.css'\n})\nexport class XtRenderComponent<T> implements AfterViewInit {\n /** Injected resolver service for finding the best component */\n resolverService = inject(XtResolverService);\n\n /** Optional explicit component type to render */\n componentType = input<Type<XtComponent<T>>> ();\n /** The display mode (e.g. EDIT, VIEW, etc.) */\n displayMode = input.required<XtDisplayMode> ();\n /** The value type identifier used for component resolution */\n valueType = input<string> ();\n\n /** The value to display/edit (used when not inside a form) */\n value= model<T> ();\n /** The parent form group (used when inside a form) */\n formGroup=input<FormGroup>();\n /** The sub-name within the form group */\n subName= input<string>();\n\n /** Object holding the output emitters from the rendered component */\n outputsObject = new XtBaseOutput();\n\n /** Inputs to pass through to the rendered component */\n inputs = input<XtBaseInput>();\n /** Emits the outputs from the rendered component */\n outputs = output<XtComponentOutput>();\n /** Model signals to pass through to the rendered component */\n models = input<XtComponentModel> ();\n\n /** Reference to the NgComponentOutlet used to dynamically render the component */\n outlet = viewChild.required(NgComponentOutlet);\n\n constructor() {\n\n }\n\n /** Computed context derived from display mode, form group, value, and value type */\n context: Signal<XtContext<any>> = computed(() => {\n let form = this.formGroup();\n\n const ret= new XtBaseContext<any>(this.displayMode(), this.subName(), form);\n ret.valueType=this.valueType();\n const typeInfo = this.resolverService.typeResolver.findType(ret.valueType);\n if( isTypeReference(typeInfo)) {\n ret.setReferenceInfo(typeInfo);\n }\n if (!ret.isInForm()) {\n const subName = this.subName();\n const value = this.value();\n if ( (subName == null) || (value == null)) {\n ret.setDisplayValue(value);\n } else {\n ret.setDisplayValue(value[subName as keyof typeof value]);\n }\n }\n return ret as XtContext<T>;\n });\n\n /** Computed context that resolves references (if any) */\n realContext = computed(() => {\n let ret = this.context();\n /*if ((ret.isReference())&& (ret.referencedContext!=null)) {\n ret = ret.referencedContext;\n }*/\n return ret;\n });\n\n\n /** Computed component type to render, resolved from the context if not explicitly set */\n type:Signal<Type<XtComponent<T>>|null> = computed( () => {\n //console.debug(\"Calculating type in XtRenderSubComponent\");\n\n let type=this.componentType();\n let compFound:XtResolvedComponent|null = null;\n if (type==null) {\n //console.debug('XtRender, using component set '+ type);\n //compFound = this.resolverService.findComponentInfo (type);\n //} else {\n compFound= this.resolverService.findBestComponent(this.realContext());\n //console.debug('XtRender, found component ',compFound.componentName);\n type= compFound.componentClass;\n }\n\n return type??null;\n });\n\n /**\n * Transfers the input and outputs from the host to the rendered component\n */\n ngAfterViewInit() {\n const instance=this.outlet().componentInstance as XtComponent;\n if (instance?.outputsObject!=null) {\n let hasOneOutput = false;\n for (const key of Object.keys(instance.outputsObject) as XtOutputType[] ) {\n this.outputsObject[key] = instance.outputsObject[key];\n hasOneOutput=true;\n }\n if (hasOneOutput) {\n this.outputs.emit(this.outputsObject);\n }\n }\n\n const inputs = this.inputs();\n if ((inputs!=null) && (instance?.inputsObject!=null)) {\n for (const key of Object.keys(inputs) as XtInputType[] ) {\n instance.inputsObject[key] = inputs[key];\n }\n\n }\n\n }\n\n}\n","<ng-container *ngComponentOutlet=\"type(); inputs: {context:context (), models:models()}\" />\n","import {\n AfterViewInit,\n Component,\n computed,\n inject,\n input,\n model,\n output,\n Signal,\n Type,\n viewChild\n} from '@angular/core';\nimport { NgComponentOutlet } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { XtContext } from '../xt-context';\nimport {\n XtComponent,\n XtComponentInput,\n XtComponentModel,\n XtComponentOutput,\n XtInputType, XtModelType,\n XtOutputType\n} from '../xt-component';\nimport { XtResolverService } from '../angular/xt-resolver.service';\nimport { XtResolvedComponent } from '../xt-resolved-component';\nimport { XtBaseOutput } from '../output/xt-base-output';\nimport { XtBaseInput } from '../output/xt-base-input';\nimport { XtBaseModel } from '../output/xt-base-model';\n\n/**\n * Dynamically render a component that will display the given subValue.\n * To be used only inside an XtSimpleComponent or XtCompositeComponent\n */\n@Component({\n selector: 'xt-render-sub',\n standalone: true,\n imports: [\n NgComponentOutlet,\n ReactiveFormsModule\n ],\n templateUrl: './xt-render-sub.component.html',\n styleUrl: './xt-render-sub.component.css'\n})\nexport class XtRenderSubComponent<T> implements AfterViewInit {\n /** The context containing display mode, form group, and value for the sub-component */\n context = input.required<XtContext<T>> ();\n /** Optional explicit component type to render */\n componentType = input<Type<XtComponent<T>>> ();\n\n /** Object holding the output emitters from the rendered sub-component */\n outputsObject = new XtBaseOutput();\n\n /** Inputs to pass through to the rendered sub-component */\n inputs = input<XtBaseInput>();\n /** Emits the outputs from the rendered sub-component */\n outputs = output<XtComponentOutput>();\n /** Model signals to pass through to the rendered sub-component */\n models = input<XtComponentModel> ();\n\n /** Reference to the NgComponentOutlet used to dynamically render the sub-component */\n outlet = viewChild.required(NgComponentOutlet);\n\n /** Injected resolver service for finding the best component */\n resolverService = inject(XtResolverService);\n\n /** Computed context that resolves references (if any) */\n realContext = computed(() => {\n let ret = this.context();\n /*if ((ret.isReference()) && (ret.referencedContext!=null)) {\n ret = ret.referencedContext;\n }*/\n return ret;\n });\n\n /** Computed component type to render, resolved from the context if not explicitly set */\n type:Signal<Type<XtComponent<T>>|null> = computed( () => {\n //console.debug(\"Calculating type in XtRenderSubComponent\");\n\n let type=this.componentType();\n let compFound:XtResolvedComponent|null = null;\n if (type==null) {\n //console.debug('XtRender, using component set '+ type);\n //compFound = this.resolverService.findComponentInfo (type);\n //} else {\n compFound= this.resolverService.findBestComponent(this.realContext());\n //console.debug('XtRender, found component ',compFound.componentName);\n type= compFound.componentClass;\n }\n\n return type??null;\n\n });\n\n /**\n * Transfers the input and outputs from the host to the rendered component\n */\n ngAfterViewInit() {\n const instance=this.outlet().componentInstance as XtComponent;\n if (instance?.outputsObject!=null) {\n let hasOneOutput = false;\n for (const key of Object.keys(instance.outputsObject) as XtOutputType[] ) {\n this.outputsObject[key] = instance.outputsObject[key];\n hasOneOutput=true;\n }\n if (hasOneOutput) {\n this.outputs.emit(this.outputsObject);\n }\n }\n\n const inputs = this.inputs();\n if ((inputs!=null) && (instance?.inputsObject!=null)) {\n for (const key of Object.keys(inputs) as XtInputType[] ) {\n instance.inputsObject[key] = inputs[key];\n }\n\n }\n\n\n }\n\n}\n","{{componentType()}}\n<ng-container *ngComponentOutlet=\"type(); inputs: {context:realContext (), models:models()}\" />\n","import { InputSignal } from '@angular/core';\nimport { XtComponentInput } from '../xt-component';\nimport { ISortBy, IStoreCriteria } from '../store/store-support';\n\n/** Default implementation of XtComponentInput */\nexport class XtBaseInput implements XtComponentInput {\n /** Input signal for the value selected by the user */\n valueSelected: InputSignal<any>|undefined;\n}\n","import { Component, computed, input, model, OnInit, output } from '@angular/core';\nimport { AbstractControl, FormControl, FormGroup } from '@angular/forms';\nimport { XtContext } from '../xt-context';\nimport { XtComponent, XtComponentModel, XtComponentOutput } from '../xt-component';\nimport { XtBaseOutput } from '../output/xt-base-output';\nimport { XtBaseInput } from '../output/xt-base-input';\nimport { XtBaseModel } from '../output/xt-base-model';\n\n/**\n * An XtSimpleComponent just displays the given value or element in a form.\n * If you need to dynamically embed other XtComponents to display sub elements, then please use the XtCompositeComponent\n */\n@Component({\n standalone: true,\n imports: [],\n template: ''\n})\nexport class XtSimpleComponent<T = any> implements XtComponent<T>, OnInit{\n /** Required input signal providing the XtContext for this component. */\n context = input.required<XtContext<T>>();\n /** Object holding the base output definitions for this component. */\n outputsObject = new XtBaseOutput();\n /** Object holding the base input definitions for this component. */\n inputsObject = new XtBaseInput();\n\n /** Output emitter that publishes the component's output map. */\n outputs=output<XtComponentOutput>();\n /** Input signal accepting model bindings for two-way data flow. */\n models=input<XtComponentModel>();\n\n /** Computed signal indicating whether this component is inside a reactive form. */\n isInForm = computed<boolean> ( () => {\n return this.context()?.isInForm()??false;\n });\n\n /** Computed signal returning the form control name, if any. */\n formControlNameIfAny = computed<string | undefined> (() => {\n return this.context()?.subName;\n });\n\n /** Computed signal returning the form group if one exists, or undefined. */\n formGroupIfAny = computed<FormGroup | undefined> (() => {\n return this.context()?.formGroup();\n })\n\n /** Computed signal returning the form group, throwing if none exists. */\n formGroup = computed<FormGroup> (() => {\n const ret= this.context()?.formGroup();\n if (ret==null) throw new Error ('No form groups in this component of type '+this.componentDescriptor());\n return ret;\n });\n\n /**\n * Returns the component form name, which is for now the subName\n */\n componentNameInForm=computed<string> ( () => {\n return this.safelyGetSubName();\n });\n\n constructor() {\n }\n\n /**\n * Angular lifecycle hook. Sets up input/output bindings and emits outputs\n * if any output objects have been defined.\n */\n ngOnInit(): void {\n this.setupInputOutput();\n if (Object.keys(this.outputsObject).length > 0) {\n // At least one output has been defined\n this.outputs.emit(this.outputsObject);\n }\n }\n\n /**\n * Manages a form control within the component's form group, optionally creating it if it does not exist.\n * Can be safely called even when no form group is available.\n * @param ctrlName - The name of the form control\n * @param create - Whether to create the control if it does not exist (default true)\n * @returns The AbstractControl, or undefined if no form group is available\n */\n manageFormControl<T> (ctrlName:string, create:boolean=true): AbstractControl<T>|undefined {\n const formGroup = this.formGroupIfAny();\n if (formGroup==null) {\n // You can call manageFormControl even in not a form, it just get ignored\n //console.debug('FormGroup is undefined when declaring managedcontrol '+ctrlName);\n return undefined;\n } else {\n let ctrl=formGroup.get(ctrlName);\n if ((create) && (ctrl==null)) {\n ctrl = new FormControl<T|undefined>(undefined);\n formGroup.setControl(ctrlName, ctrl);\n }\n return ctrl??undefined;\n }\n }\n\n /** Computed signal that safely returns the sub-name, throwing if it is null. */\n safelyGetSubName = computed<string>(() => {\n const ret = this.context()?.subName;\n if (ret==null) throw new Error ('This component has no name in the form '+this.componentDescriptor());\n return ret;\n });\n\n /**\n * Computed signal returning the form control name for this component.\n */\n formControlName = computed<string> (() => {\n const ret = this.safelyGetSubName();\n\n //this.manageFormControl<any>(ret); // Don't create anything at this point. It's a computed value.\n return ret;\n });\n\n /** Computed signal that retrieves the existing AbstractControl for this component's sub-name. */\n formControl = computed<AbstractControl<any>> (() => {\n const subName = this.safelyGetSubName();\n const formControl= this.manageFormControl(subName, false);\n if (formControl==null) throw new Error (\"Calling formControl for subName \"+subName+\" when none exist.\");\n return formControl;\n});\n\n /**\n * Returns a human-readable descriptor for this component.\n * @returns A string describing the component type and context\n */\n componentDescriptor (): string {\n return \"Component with type \"+this.constructor.name+\" with context \"+this.context().toString();\n }\n\n /** Computed signal exposing the raw value from the context. */\n getValue= computed (()=> {\n return this.context().value();\n });\n\n /** Computed signal exposing the display value from the context. */\n displayValue = computed (() => {\n return this.context().displayValue();\n });\n\n /**\n * This is where components can assign their output() and input() into the XtComponent inputs and outputs member\n * @protected\n */\n protected setupInputOutput () {\n // Nothing to do here\n }\n}\n","import { Component, computed, inject } from '@angular/core';\nimport { XtSimpleComponent } from '../xt-simple/xt-simple.component';\nimport { FormGroup } from '@angular/forms';\nimport { XtResolverService } from '../angular/xt-resolver.service';\nimport { XtContext } from '../xt-context';\n\n/**\n * A composite XtComponent that manages a form group for its sub-elements.\n * Extends XtSimpleComponent to provide context-based form group management\n * and sub-context resolution for nested components.\n * Selector: not directly used (abstract base via template).\n */\n@Component({\n standalone: true,\n imports: [],\n template: '',\n styleUrl: './xt-composite.component.css'\n})\nexport class XtCompositeComponent<T = any> extends XtSimpleComponent<T> {\n\n /** Injected service for resolving components and type information. */\n resolverService = inject(XtResolverService);\n\n /**\n * Computes the local form group for this composite, creating one from the parent form group if it does not exist.\n * Overrides the base implementation to manage a dedicated form group for sub-elements.\n */\n override formGroupIfAny = computed<FormGroup | undefined> (() => {\n const context = this.context();\n if (context==null) return undefined;\n let ret= context.localFormGroup;\n if ((ret==null) && (context.parentFormGroup!=null) && (context.subName!=null)) {\n if (context.parentFormGroup.contains(context.subName)) {\n context.localFormGroup = context.parentFormGroup.get(context.subName) as FormGroup;\n } else {\n context.localFormGroup= new FormGroup ({});\n context.parentFormGroup.addControl(context.subName, context.localFormGroup);\n }\n ret=context.localFormGroup;\n }\n return ret;\n })\n\n /**\n * We need to create a new form group to manage the sub elements.\n */\n override formGroup = computed<FormGroup> (() => {\n const ret= this.formGroupIfAny();\n if (ret==null) throw new Error ('No form groups in this component of type '+this.componentDescriptor());\n return ret;\n });\n\n /**\n * Helper function to calculate the sub context for a named child element.\n * @param subName - The name of the sub-element\n * @param subType - Optional type hint for the sub-element\n * @returns The sub-context for the given child\n */\n subContext (subName:string, subType?:string):XtContext<any> {\n this.formGroupIfAny(); // Ensure the context is properly initialized\n return this.context().subContext(subName, subType, this.resolverService.typeResolver);\n }\n\n}\n","import { ModelSignal } from '@angular/core';\nimport { XtComponentModel } from '../xt-component';\nimport { ISortBy, IStoreCriteria } from '../store/store-support';\n\n/** Default implementation of XtComponentModel */\nexport class XtBaseModel<T> implements XtComponentModel {\n /** Model signal for the currently selected value */\n valueSelected?: ModelSignal<T|null> | undefined;\n /** Model signal for sort criteria */\n sortBy?: ModelSignal<ISortBy<T>[]> | undefined;\n /** Model signal for filter criteria */\n filterBy?: ModelSignal<IStoreCriteria<T>[]> | undefined;\n\n}\n","import { Injectable } from \"@angular/core\";\n\n\n@Injectable({\n providedIn: 'root'\n})\n/** Service for handling error and warning messages throughout the application */\nexport class XtMessageHandler {\n /**\n * Handles an error occurrence by logging it to the console\n * @param error - The error object\n * @param errorMsg - Optional custom error message\n */\n errorOccurred (error:any, errorMsg?:string) {\n console.error(errorMsg, error);\n }\n\n /**\n * Handles a warning occurrence by logging it to the console\n * @param warningMsg - Optional warning message\n */\n warningOccurred (warningMsg?:string) {\n console.warn(warningMsg);\n }\n\n}\n","import { FormControl, FormGroup } from '@angular/forms';\nimport { isPrimitive, isTypeReference, XtTypeHierarchy, XtTypeReference, XtTypeResolver } from 'xt-type';\n\n/**\n * Attaches a value to a form group by creating either a FormControl or nested FormGroup based on the value type\n * @param formGroup - The form group to attach to\n * @param controlName - The control name within the form group\n * @param value - The value to attach\n * @param valueType - Optional type identifier for type resolution\n * @param resolver - Optional type resolver for determining if the value is primitive\n */\nexport function attachToFormGroup(formGroup: FormGroup, controlName:string, value:any, valueType?:string, resolver?:XtTypeResolver) {\n // If it's a single value, just create the control\n if (((value!=null) && (isPrimitive(value))\n || (resolver?.isPrimitiveType(valueType)))) {\n const simpleControl = new FormControl(value);\n formGroup.setControl(controlName, simpleControl);\n } else {\n const complexGroup = new FormGroup({});\n updateFormGroupWithValue(complexGroup, value, valueType, resolver);\n formGroup.setControl(controlName, complexGroup);\n }\n}\n\n/**\n * Updates a form group with the properties from a value object, adding, updating, or removing controls as needed\n * @param formGroup - The form group to update\n * @param value - The value object containing the properties to sync\n * @param valueType - Optional type identifier for type resolution\n * @param resolver - Optional type resolver for determining property types\n */\nexport function updateFormGroupWithValue(formGroup: FormGroup, value:{[key:string]:any}, valueType?:string, resolver?:XtTypeResolver) {\n\n const toDelete = new Set<string>(Object.keys(formGroup.controls));\n // We merge the properties of the value if any, with the properties of the model\n const keySet = new Set<string>((value!=null)?Object.keys(value):null);\n if( ((valueType!=null) && (resolver!=null))) {\n const modelSubName = resolver.listSubNames(valueType, value);\n for (const sub of modelSubName) {\n keySet.add(sub);\n }\n }\n\n for (const valueKey of keySet) {\n const subValue=(value!=null)?value[valueKey]:undefined;\n const subType=resolver?.findType(valueType, valueKey, subValue)??undefined;\n const subTypeName = isTypeReference(subType) ? subType.toType : subType?.type;\n const primitive = (resolver!=null)?resolver?.isPrimitiveType(subType, subValue): isPrimitive(subValue);\n if (toDelete.delete(valueKey)) {\n // Already a control\n const oldControl = formGroup.get(valueKey)!;\n // Is it the right type ?\n if ((primitive) || (isTypeReference(subType))) {\n // Must be an FormControl2\n if ((oldControl as any).controls === undefined) {\n // It's ok, just set the value\n oldControl.setValue(subValue);\n } else {\n formGroup.setControl(valueKey, new FormControl(subValue));\n }\n } else {\n // Must be a FormGroup\n if ((oldControl as any).controls === undefined) {\n const newFormGroup = new FormGroup({});\n formGroup.setControl(valueKey, newFormGroup);\n updateFormGroupWithValue(newFormGroup, subValue, subTypeName, resolver);\n } else {\n // It was already a formgroup, so just update it\n if (subValue!==undefined)\n updateFormGroupWithValue(oldControl as FormGroup, subValue, subTypeName, resolver);\n else {\n // Just remove the control as there is no value to set\n formGroup.removeControl(valueKey);\n }\n }\n }\n } else {\n if ((primitive) || (isTypeReference(subType))) {\n formGroup.addControl(valueKey, new FormControl(subValue));\n } else {\n const newFormGroup = new FormGroup({});\n formGroup.addControl(valueKey, newFormGroup);\n updateFormGroupWithValue(newFormGroup, subValue, subTypeName, resolver);\n }\n }\n }\n\n // Delete controls that are no more used\n for (const delName of toDelete) {\n formGroup.removeControl(delName);\n }\n}\n","import { XtResolverService } from '../angular/xt-resolver.service';\nimport { inject } from '@angular/core';\nimport { delay, find, lastValueFrom, range } from 'rxjs';\n\n/**\n * Helper class to ease unit testing\n */\nexport class XtUnitTestHelper {\n/* public static registerComponent<T> (name:string, compClass:T, type:string){\n this.resolverService.pluginRegistry.registerComponent({\n componentName:name,\n componentClass: compClass,\n typesHandled: [type]\n });\n }\n*/\n /**\n * Asynchronously wait for test function to return true. By default try 20 times with a delay of 50ms\n * @param test\n * @param tries\n * @param timer\n */\n public static async waitFor(test: () => boolean, tries:number=20, timer:number=50): Promise<void> {\n await lastValueFrom(range(0, tries).pipe(\n delay(timer),\n find( test)\n ));\n }\n\n}\n","import { Component, computed, inject, input, OnInit, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { XtRenderComponent } from '../render/xt-render.component';\nimport { XtComponent } from '../xt-component';\nimport { XtBaseContext, XtDisplayMode } from '../xt-context';\nimport { XtRenderSubComponent } from '../render/xt-render-sub.component';\nimport { XtResolverService } from '../angular/xt-resolver.service';\nimport { xtTypeManager } from 'xt-type';\nimport { updateFormGroupWithValue } from '../type/type-helper';\n/**\n * Component that can be used to bootstrap tests.\n * Just set the value and component type, and it will be injected in your test.\n */\n@Component({\n selector:'test-host',\n standalone:true,\n imports: [CommonModule, XtRenderComponent],\n template: '<h1>Test Simple Component</h1> <xt-render [componentType]=\"type()\" [displayMode]=\"displayMode()\" [value]=\"value()\" ></xt-render> '\n\n})\nexport class HostTestSimpleComponent {\n /** Required input for the component type to render. */\n type = input.required<Type<XtComponent<any>>>();\n /** Input for the display mode. Defaults to FULL_VIEW. */\n displayMode = input<XtDisplayMode> ('FULL_VIEW');\n /** Input for the value to pass to the rendered component. */\n value = input<any|undefined> (undefined);\n\n}\n\n/**\n * Same as HostTestSimpleComponent but it includes everything in a form.\n * Just set the component type, the formGroup and the component name, and your component will be run.\n * You can as well easily read and set the value.\n */\n@Component({\n selector:'test-form-host',\n standalone:true,\n imports: [CommonModule, XtRenderComponent, ReactiveFormsModule],\n template: '<h1>Test Form Component</h1> <form [formGroup]=\"parentFormGroup\"> <xt-render [componentType]=\"type()\" displayMode=\"FULL_EDITABLE\" [subName]=\"controlName()\" [formGroup]=\"createdFormGroup()\"></xt-render></form>'\n})\nexport class HostTestFormComponent {\n /** Injected FormBuilder for creating form groups. */\n builder = inject(FormBuilder);\n /** Required input for the component type to render. */\n type = input.required<Type<XtComponent<any>>>();\n /** Required input for the form control name. */\n controlName = input.required<string>();\n /** Input for the form description object used to generate the form group. */\n formDescription = input<any> ({ });\n /** Input to provide an existing FormGroup directly. */\n formGroup= input<FormGroup>();\n\n /** The parent FormGroup that contains the component's form group. */\n parentFormGroup = this.builder.group<{ [keys: string]: AbstractControl }>({});\n\n /** Computed signal returning the created form group. */\n createdFormGroup = computed<FormGroup>(() => {\n return this.computeFormGroup();\n });\n\n /**\n * Computes the form group from the input, either using a provided form group or generating one from the form description.\n * @returns The created FormGroup\n */\n protected computeFormGroup ():FormGroup {\n const formGroup=this.formGroup();\n let createdFormGroup=formGroup??generateFormGroup(this.formDescription());\n this.parentFormGroup.addControl(this.controlName() ?? HostTestTypedFormComponent.CONTROL_NAME, createdFormGroup);\n return createdFormGroup;\n }\n\n /**\n * Patches the component's form control with a new value.\n * @param newVal - The value to patch\n */\n patchValue (newVal:any) {\n const patch:{[key:string]:any}={};\n patch[this.controlName()]=newVal;\n const createdFormGroup=this.createdFormGroup();\n createdFormGroup.patchValue(patch);\n }\n\n /**\n * Retrieves the current value from the component's form control.\n * @returns The current form value\n */\n retrieveValue (): any {\n const createdFormGroup=this.createdFormGroup();\n return createdFormGroup.value[this.controlName()];\n }\n}\n\n/**\n * Component that can be used to test your component based on the type it handles\n * Just set the type hierarchy to register, the value, and it will instantiate the right component in your plugin\n */\n@Component({\n selector:'test-typed-host',\n standalone:true,\n imports: [CommonModule, XtRenderSubComponent],\n template: '<h1>Test Typed Component</h1> <xt-render-sub [context]=\"context()\" ></xt-render-sub> '\n\n})\nexport class HostTestTypedComponent {\n\n /** Input for the display mode. Defaults to FULL_VIEW. */\n displayMode = input<XtDisplayMode> ('FULL_VIEW');\n /** Input for the value to display. */\n value = input<any> ();\n /** Input for the value type string used for context creation. */\n valueType = input<string> ();\n\n /** Computed signal that creates the XtBaseContext from the input values. */\n context = computed( () => {\n const ret = new XtBaseContext(this.displayMode());\n\n ret.valueType=this.valueType();\n ret.setDisplayValue(this.value());\n return ret;\n });\n}\n\n/**\n * Same as HostTestSimpleComponent but it includes everything in a form.\n * Just set the component type, the formGroup and the component name, and your component will be run.\n * You can as well easily read and set the value.\n */\n@Component({\n selector:'test-typed-form-host',\n standalone:true,\n imports: [CommonModule, ReactiveFormsModule, XtRenderSubComponent],\n template: '<h1>Test Typed Form Component</h1> <form [formGroup]=\"parentFormGroup\"> <xt-render-sub [context]=\"subContext()\"></xt-render-sub></form>'\n})\nexport class HostTestTypedFormComponent implements OnInit {\n /** Injected FormBuilder for creating form groups. */\n builder = inject(FormBuilder);\n /** Injected resolver service for type resolution. */\n resolver = inject(XtResolverService);\n\n /** Default control name used if none is provided. */\n static readonly CONTROL_NAME = 'ForTest';\n\n /** Input for the value type string. */\n valueType = input<string>();\n /** Input for the form control name. */\n controlName = input<string>();\n /** Input for the form description used to generate the form group. */\n formDescription = input<any>(null);\n /** Input to provide an existing FormGroup directly. */\n formGroup = input<FormGroup>();\n\n /** The parent FormGroup that contains the component's form group. */\n parentFormGroup = this.builder.group<{ [keys: string]: AbstractControl }>({});\n\n /** Computed signal returning the created form group. */\n createdFormGroup = computed<FormGroup>(() => {\n return this.computeFormGroup();\n });\n\n ngOnInit(): void {\n }\n\n /**\n * Computes the form group from inputs, generating one from description or type if needed.\n * @returns The created FormGroup\n */\n protected computeFormGroup(): FormGroup {\n let createdFormGroup = null;\n const formGroup = this.formGroup();\n if (this.formDescription() != null) {\n createdFormGroup = formGroup ?? generateFormGroup(this.formDescription());\n } else {\n createdFormGroup = this.builder.group({});\n if (this.valueType() != null) {\n updateFormGroupWithValue(createdFormGroup, {}, this.valueType(), this.resolver.typeResolver);\n }\n }\n this.parentFormGroup.addControl(this.controlName() ?? HostTestTypedFormComponent.CONTROL_NAME, createdFormGroup);\n return createdFormGroup;\n }\n\n /** Computed signal that builds the XtBaseContext from form group and control name. */\n subContext= computed(()=> {\n const ctrlName = this.controlName();\n const createdFormGroup = this.createdFormGroup();\n let ret:XtBaseContext<any>|null = null;\n if (ctrlName==null){\n ret = new XtBaseContext('FULL_EDITABLE', HostTestTypedFormComponent.CONTROL_NAME, this.parentFormGroup);\n }\n else{\n ret = new XtBaseContext('FULL_EDITABLE', ctrlName, createdFormGroup);\n }\n ret.valueType=this.valueType();\n\n return ret;\n });\n\n /**\n * Patches a form control with a new value.\n * @param controlName - The name of the control to patch\n * @param newVal - The value to set\n */\n patchValue (controlName:string, newVal:any) {\n const patch:{[key:string]:any}={};\n patch[controlName]=newVal;\n this.createdFormGroup().patchValue(patch);\n }\n\n /**\n * Retrieves the current value from a form control.\n * @param controlName - The name of the control to read\n * @returns The current form value\n */\n retrieveValue (controlName:string): any {\n return this.createdFormGroup().value[controlName];\n }\n\n}\n\n/**\n * Generates a FormGroup from a form description object.\n * @param formDescription - The description object used to build the form group\n * @returns A FormGroup instance\n */\nfunction generateFormGroup(formDescription: any):FormGroup {\n if (typeof formDescription != 'object') {\n throw new Error ('Form Description should be an object of values');\n }\n return generateFormControl(formDescription) as FormGroup;\n}\n\n/**\n * Recursively generates an AbstractControl from a form description value.\n * Handles null, arrays, objects (as FormGroup), and primitive values (as FormControl).\n * @param formDescription - The value to convert into a form control\n * @returns An AbstractControl instance\n */\nfunction generateFormControl(formDescription: any): AbstractControl {\n\n if (formDescription==null) {\n return new FormControl(formDescription);\n }\n\n if (Array.isArray(formDescription)){\n const retArray = new FormArray<AbstractControl>([]);\n for (const val of formDescription) {\n retArray.push(generateFormControl(val), {emitEvent:false});\n }\n return retArray;\n }\n\n if ((typeof formDescription=='object')&&(!(formDescription instanceof Date))) {\n const retObject=new FormGroup({});\n for (const key of Object.keys(formDescription)) {\n retObject.addControl(key, generateFormControl(formDescription[key]));\n }\n return retObject;\n }\n return new FormControl(formDescription);\n}\n","import { from, Observable } from 'rxjs';\nimport {\n IDataTransformer,\n IDocumentInfo,\n IStoreCriteria,\n IStoreCriteriaOperator,\n IStoreManager,\n IStoreProvider,\n StoreSupport\n} from '../store/store-support';\n\n/**\n * A very light and not 100% compatible storemanager in case you are not using xt-store.\n * It can emulate XtStoreManager to some extends for doing some tests\n */\nexport class StoreTestHelper {\n /**\n * Sets a TestStoreManager as the test store manager in StoreSupport.\n * Call this in test setup to use the in-memory store provider.\n */\n public static ensureTestProviderOnly() {\n StoreSupport.setTestStoreManager(new TestStoreManager());\n }\n}\n\n/**\n * A test implementation of IStoreManager that always returns a single TestStoreProvider.\n * Used to emulate xt-store for unit testing purposes.\n */\nexport class TestStoreManager implements IStoreManager {\n /** The default provider returned for all store operations. */\n protected defaultProvider= new TestStoreProvider();\n\n /**\n * Returns the default test store provider.\n * @param name - Ignored; always returns the same provider\n * @returns The default TestStoreProvider\n */\n getProvider<T = never>(name?: string): IStoreProvider<T> | undefined {\n return this.defaultProvider;\n }\n\n /**\n * Returns the default test store provider (safe variant).\n * @param name - Ignored; always returns the same provider\n * @returns The default TestStoreProvider\n */\n getProviderSafe<T = never>(name?: string): IStoreProvider<T> {\n return this.defaultProvider;\n }\n\n /**\n * Returns the default test store provider.\n * @returns The default TestStoreProvider or undefined\n */\n getDefaultProvider<T = never>(): IStoreProvider<T> | undefined {\n return this.defaultProvider;\n }\n\n /**\n * Returns the default test store provider (safe variant).\n * @returns The default TestStoreProvider\n */\n getDefaultProviderSafe<T = never>(): IStoreProvider<T> {\n return this.defaultProvider;\n }\n\n /**\n * Creates a new TestStoreCriteria instance.\n * @param name - The field name for the criteria\n * @param value - The value to match\n * @param operator - The comparison operator\n * @returns A new TestStoreCriteria\n */\n newStoreCriteria<T=any>(name: keyof T, value: any, operator: IStoreCriteriaOperator): IStoreCriteria<T> {\n return new TestStoreCriteria(name, value, operator);\n }\n\n}\n\n/**\n * A test implementation of IStoreProvider that stores entities in an in-memory map.\n * Supports basic CRUD and filtering operations for unit testing.\n */\nexport class TestStoreProvider<T = never> implements IStoreProvider<T> {\n /** In-memory data store, keyed by entity type name then by entity key. */\n protected data = new Map<string, Map<string,any>> ();\n\n /**\n * Gets or creates a named entity map within the data store.\n * @param name - The entity type name\n * @returns The map of entities for the given type\n */\n protected getOrCreateArray (name: string): Map<string,T> {\n let ret=this.data.get(name);\n if (ret==null) {\n ret = new Map<string, T>();\n this.data.set(name, ret);\n }\n return ret;\n }\n\n /**\n * Extracts a unique key from a value object, using _id, id, or generating a new one.\n * @param value - The value to extract the key from\n * @param create - Whether to generate a new key if none exists\n * @returns The extracted or generated key string\n */\n protected extractKey (value: any, create?:boolean):string {\n if (value._id!=null) return value._id; // ManagedData key\n else if (value.id!=null) return value.id;\n else {\n if (create===true) {\n const newId = Math.random().toString(36).substring(2, 8);\n value._id=newId;\n return newId;\n }\n return value.toString();\n }\n }\n\n /**\n * Stores an entity in the in-memory data store.\n * @param name - The entity type name\n * @param entity - The entity to store\n * @returns A promise resolving to the stored entity\n */\n storeEntity(name: string, entity: T): Promise<T> {\n this.getOrCreateArray(name).set(this.extractKey(entity, true), entity);\n return Promise.resolve(entity);\n }\n\n /**\n * Loads an entity by key, throwing if not found.\n * @param name - The entity type name\n * @param key - The entity key\n * @returns A promise resolving to the entity\n */\n safeLoadEntity(name: string, key: any): Promise<T> {\n const ret = this.getOrCreateArray(name).get(key);\n if (ret==null) {\n throw new Error (\"No entity named \"+name+\" with key \"+key);\n }\n return Promise.resolve(ret);\n }\n\n /**\n * Loads an entity by key, returning undefined if not found.\n * @param name - The entity type name\n * @param key - The entity key\n * @returns A promise resolving to the entity or undefined\n */\n loadEntity(name: string, key: any): Promise<T | undefined> {\n return Promise.resolve(this.getOrCreateArray(name).get(key));\n }\n\n /**\n * Deletes an entity by key.\n * @param name - The entity type name\n * @param key - The entity key\n * @returns A promise resolving to true if deleted, false otherwise\n */\n deleteEntity(name: string, key: any): Promise<boolean> {\n return Promise.resolve( this.getOrCreateArray(name).delete(key));\n }\n\n /**\n * Searches entities by optional criteria. Returns all entities if no criteria provided.\n * @param name - The entity type name\n * @param criteria - Optional filter criteria\n * @returns An observable of matching entities\n */\n searchEntities(name: string, ...criteria: IStoreCriteria<T>[]): Observable<T[]> {\n // No criteria defined, just send the full list\n const ret=new Array<T>();\n if( (criteria==null)||(criteria.length==0)) {\n for (const toAdd of this.getOrCreateArray(name).values()) {\n ret.push(toAdd);\n }\n } else {\n for (const toAdd of this.getOrCreateArray(name).values()) {\n let canAdd=true;\n for (const criter of criteria as TestStoreCriteria<T>[]) {\n if (!criter.filter(toAdd)) {\n canAdd=false;\n break;\n }\n }\n if( canAdd) ret.push(toAdd);\n }\n\n }\n return from([ret]);\n }\n\n /**\n * Search and prepare entities with sorting, grouping, and transformation (not implemented).\n */\n searchAndPrepareEntities(name: string, sort?: any, groupBy?: any, transformer?: IDataTransformer<T> | undefined, ...criteria: any[]): Observable<any> {\n throw new Error('Method not implemented.');\n }\n /**\n * Indicates that this provider supports document storage.\n * @returns True\n */\n canStoreDocument(): boolean {\n return true;\n }\n /**\n * Stores a document file and returns its document info.\n * @param toStore - The file to store\n * @returns A promise resolving to the document info\n */\n storeDocument(toStore: File): Promise<IDocumentInfo> {\n const ret = new TestDocumentInfo(toStore.name, true,URL.createObjectURL(toStore));\n return Promise.resolve(ret);\n }\n\n /**\n * Stores multiple document files (not implemented).\n */\n storeDocuments(toStore: File[]): Observable<IDocumentInfo> {\n throw new Error('Method not implemented.');\n }\n\n}\n\n/**\n * A test implementation of IDocumentInfo for testing document storage operations.\n */\nexport class TestDocumentInfo implements IDocumentInfo {\n /** The name of the stored document. */\n documentName: string;\n /** Whether the document is referenced by URL. */\n isUrl: boolean;\n /** Optional document identifier. */\n documentId?: string;\n\n /**\n * Creates a new TestDocumentInfo instance.\n * @param documentName - The document name\n * @param isUrl - Whether the document is a URL\n * @param documentId - Optional document identifier\n */\n constructor(documentName: string, isUrl: boolean,documentId?: string) {\n this.documentId = documentId;\n this.documentName = documentName;\n this.isUrl = isUrl;\n }\n}\n\n/**\n * A test implementation of IStoreCriteria that filters entities by field comparison.\n */\nexport class TestStoreCriteria<T=any> implements IStoreCriteria<T> {\n /** The field name to filter on. */\n name: keyof T;\n /** The value to compare against. */\n value: any;\n /** The comparison operator (=, <=, <). */\n operator: '='|'<='|'<';\n\n /**\n * Creates a new TestStoreCriteria instance.\n * @param name - The field name to filter on\n * @param value - The value to compare against\n * @param operator - The comparison operator (default '=')\n */\n constructor(\n name: keyof T,\n value: any,\n operator?: IStoreCriteriaOperator\n ) {\n this.name = name;\n this.value = value;\n if (!operator) this.operator = '=';\n else {\n this.operator = operator;\n }\n }\n\n /**\n * Filters an entity by comparing its field value against the criteria value.\n * @param toFilter - The entity to test\n * @returns True if the entity matches the criteria\n */\n filter (toFilter:any): boolean {\n const testValue=toFilter[this.name];\n switch (this.operator) {\n case '=':\n return testValue == this.value;\n case '<':\n return (testValue as number)<(this.value as number);\n case '<=':\n return (testValue as number)<(this.value as number);\n default:\n return true;\n }\n }\n}\n","/*\n * Public API Surface of xt-components\n */\n\nexport * from './lib/xt-component';\nexport * from './lib/xt-context';\nexport * from './lib/xt-resolved-component';\nexport * from './lib/resolver/xt-resolver';\nexport * from './lib/registry/xt-plugin-registry'\nexport * from './lib/plugin/xt-plugin-info'\nexport * from './lib/action/xt-action-handler';\nexport * from './lib/workflow/xt-workflow';\nexport * from './globals';\n\nexport * from './lib/angular/xt-tokens';\nexport * from './lib/angular/xt-resolver.service';\n\nexport * from './lib/render/xt-render.component';\nexport * from './lib/render/xt-render-sub.component';\nexport * from './lib/xt-simple/xt-simple.component';\nexport * from './lib/xt-composite/xt-composite.component';\n\nexport * from './lib/output/xt-base-model';\nexport * from './lib/output/xt-base-output';\nexport * from './lib/output/xt-base-input';\n\nexport * from './lib/angular/xt-message-handler.service';\nexport * from './lib/store/store-support';\nexport * from './lib/type/type-helper';\nexport * from './lib/test/xt-unit-test-helper';\nexport * from './lib/test/xt-test-helper-components';\nexport * from './lib/test/store-test-helper';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAWA;;;AAGG;MACU,gBAAgB,CAAA;AAA7B,IAAA,WAAA,GAAA;;AAGI,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,GAAG,EAAyB;;AAEjD,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,GAAG,EAAiC;;AAE5D,QAAA,IAAA,CAAA,oBAAoB,GAAG,IAAI,GAAG,EAAmC;;AAEvD,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,GAAG,EAAgC;;AAE1D,QAAA,IAAA,CAAA,oBAAoB,GAAG,IAAI,GAAG,EAA2C;;AAGnF,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,IAAI,KAAK,EAAwB,qFAAC;;AAE1D,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,IAAI,KAAK,EAAgB,kFAAC;IA6QnD;AA3QE;;;;;;;;;;AAUG;aACoB,IAAA,CAAA,kBAAkB,GAAC,oBAAD,CAAsB;AAC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