xt-components 0.4.7 → 0.5.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 +150 -111
- package/fesm2022/xt-components.mjs.map +1 -1
- package/index.d.ts +512 -3
- package/package.json +13 -13
- package/globals.d.ts +0 -10
- package/lib/angular/message-handler.d.ts +0 -7
- package/lib/angular/xt-resolver.service.d.ts +0 -39
- package/lib/angular/xt-tokens.d.ts +0 -7
- package/lib/output/xt-base-input.d.ts +0 -5
- package/lib/output/xt-base-output.d.ts +0 -5
- package/lib/plugin/xt-plugin-info.d.ts +0 -19
- package/lib/registry/xt-plugin-registry.d.ts +0 -34
- package/lib/render/xt-render-sub.component.d.ts +0 -28
- package/lib/render/xt-render.component.d.ts +0 -36
- package/lib/resolver/xt-registry-resolver.d.ts +0 -11
- package/lib/resolver/xt-resolver.d.ts +0 -5
- package/lib/store/store-support.d.ts +0 -60
- package/lib/test/store-test-helper.d.ts +0 -36
- package/lib/test/xt-test-helper-components.d.ts +0 -71
- package/lib/test/xt-unit-test-helper.d.ts +0 -2
- package/lib/type/type-helper.d.ts +0 -4
- package/lib/xt-component.d.ts +0 -22
- package/lib/xt-composite/xt-composite.component.d.ts +0 -21
- package/lib/xt-context.d.ts +0 -86
- package/lib/xt-resolved-component.d.ts +0 -8
- package/lib/xt-simple/xt-simple.component.d.ts +0 -44
- package/public-api.d.ts +0 -19
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { XtComponentInfo, XtPluginInfo } from '../plugin/xt-plugin-info';
|
|
2
|
-
import { Type } from '@angular/core';
|
|
3
|
-
import { XtComponent } from '../xt-component';
|
|
4
|
-
export declare class XtPluginRegistry {
|
|
5
|
-
pluginRegistry: Map<string, XtPluginInfo>;
|
|
6
|
-
componentRegistry: Map<string, XtComponentInfo<any>>;
|
|
7
|
-
componentByTypeCache: Map<string, XtComponentInfo<any>[]>;
|
|
8
|
-
listComponents: import("@angular/core").WritableSignal<XtComponentInfo<any>[]>;
|
|
9
|
-
listPlugins: import("@angular/core").WritableSignal<XtPluginInfo[]>;
|
|
10
|
-
/**
|
|
11
|
-
* The component can manage any standard javascript primitives types. That's usually the default whenever we don't know any particular type
|
|
12
|
-
* string
|
|
13
|
-
* number
|
|
14
|
-
* bigint
|
|
15
|
-
* boolean
|
|
16
|
-
* undefined
|
|
17
|
-
* null
|
|
18
|
-
* symbol is not managed
|
|
19
|
-
* Date, while an object and not a primitive, is managed
|
|
20
|
-
*/
|
|
21
|
-
static readonly ANY_PRIMITIVE_TYPE = "ANY_PRIMITIVE_TYPE";
|
|
22
|
-
/**
|
|
23
|
-
* 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)
|
|
24
|
-
*/
|
|
25
|
-
static readonly ANY_OBJECT_TYPE = "ANY_OBJECT_TYPE";
|
|
26
|
-
static readonly ANY_PRIMITIVE_SET = "ANY_PRIMITIVE_SET";
|
|
27
|
-
static readonly ANY_OBJECT_SET = "ANY_OBJECT_SET";
|
|
28
|
-
registerPlugin(info: XtPluginInfo): void;
|
|
29
|
-
registerComponent<T>(info: XtComponentInfo<T>): void;
|
|
30
|
-
findComponentsForType<T>(valueType: string | null | undefined, value?: T): XtComponentInfo<any>[];
|
|
31
|
-
static registry(): XtPluginRegistry;
|
|
32
|
-
findComponentInfo(type: Type<XtComponent<any>>): XtComponentInfo<any> | null;
|
|
33
|
-
getComponentInfo(type: Type<XtComponent<any>>): XtComponentInfo<any>;
|
|
34
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { AfterViewInit, Signal, Type } from '@angular/core';
|
|
2
|
-
import { NgComponentOutlet } from '@angular/common';
|
|
3
|
-
import { XtContext } from '../xt-context';
|
|
4
|
-
import { XtComponent, XtComponentOutput } from '../xt-component';
|
|
5
|
-
import { XtResolverService } from '../angular/xt-resolver.service';
|
|
6
|
-
import { XtBaseOutput } from '../output/xt-base-output';
|
|
7
|
-
import { XtBaseInput } from '../output/xt-base-input';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
/**
|
|
10
|
-
* Dynamically render a component that will display the given subValue.
|
|
11
|
-
* To be used only inside an XtSimpleComponent or XtCompositeComponent
|
|
12
|
-
*/
|
|
13
|
-
export declare class XtRenderSubComponent<T> implements AfterViewInit {
|
|
14
|
-
context: import("@angular/core").InputSignal<XtContext<T>>;
|
|
15
|
-
componentType: import("@angular/core").InputSignal<Type<XtComponent<T>> | undefined>;
|
|
16
|
-
outputsObject: XtBaseOutput;
|
|
17
|
-
inputs: import("@angular/core").InputSignal<XtBaseInput | undefined>;
|
|
18
|
-
outputs: import("@angular/core").OutputEmitterRef<XtComponentOutput>;
|
|
19
|
-
outlet: Signal<NgComponentOutlet<any>>;
|
|
20
|
-
resolverService: XtResolverService;
|
|
21
|
-
type: Signal<Type<XtComponent<T>> | null>;
|
|
22
|
-
/**
|
|
23
|
-
* Transfers the input and outputs from the host to the rendered component
|
|
24
|
-
*/
|
|
25
|
-
ngAfterViewInit(): void;
|
|
26
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<XtRenderSubComponent<any>, never>;
|
|
27
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<XtRenderSubComponent<any>, "xt-render-sub", never, { "context": { "alias": "context"; "required": true; "isSignal": true; }; "componentType": { "alias": "componentType"; "required": false; "isSignal": true; }; "inputs": { "alias": "inputs"; "required": false; "isSignal": true; }; }, { "outputs": "outputs"; }, never, never, true, never>;
|
|
28
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { AfterViewInit, Signal, Type } from '@angular/core';
|
|
2
|
-
import { NgComponentOutlet } from '@angular/common';
|
|
3
|
-
import { XtComponent, XtComponentOutput } from '../xt-component';
|
|
4
|
-
import { XtContext, XtDisplayMode } from '../xt-context';
|
|
5
|
-
import { FormGroup } from '@angular/forms';
|
|
6
|
-
import { XtResolverService } from '../angular/xt-resolver.service';
|
|
7
|
-
import { XtBaseOutput } from '../output/xt-base-output';
|
|
8
|
-
import { XtBaseInput } from '../output/xt-base-input';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
/**
|
|
11
|
-
* Offers a nice and easy to dynamically embed a component.
|
|
12
|
-
* You set the type, the display mode, and either the value or the formgroup & subName to use.
|
|
13
|
-
* XtRender will then instantiate the component, bind it to the value or form, and display it.
|
|
14
|
-
*/
|
|
15
|
-
export declare class XtRenderComponent<T> implements AfterViewInit {
|
|
16
|
-
resolverService: XtResolverService;
|
|
17
|
-
componentType: import("@angular/core").InputSignal<Type<XtComponent<T>> | undefined>;
|
|
18
|
-
displayMode: import("@angular/core").InputSignal<XtDisplayMode>;
|
|
19
|
-
valueType: import("@angular/core").InputSignal<string | undefined>;
|
|
20
|
-
value: import("@angular/core").ModelSignal<T | undefined>;
|
|
21
|
-
formGroup: import("@angular/core").InputSignal<FormGroup<any> | undefined>;
|
|
22
|
-
subName: import("@angular/core").InputSignal<string | undefined>;
|
|
23
|
-
outputsObject: XtBaseOutput;
|
|
24
|
-
inputs: import("@angular/core").InputSignal<XtBaseInput | undefined>;
|
|
25
|
-
outputs: import("@angular/core").OutputEmitterRef<XtComponentOutput>;
|
|
26
|
-
outlet: Signal<NgComponentOutlet<any>>;
|
|
27
|
-
constructor();
|
|
28
|
-
context: Signal<XtContext<any>>;
|
|
29
|
-
type: Signal<Type<XtComponent<T>> | null>;
|
|
30
|
-
/**
|
|
31
|
-
* Transfers the input and outputs from the host to the rendered component
|
|
32
|
-
*/
|
|
33
|
-
ngAfterViewInit(): void;
|
|
34
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<XtRenderComponent<any>, never>;
|
|
35
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<XtRenderComponent<any>, "xt-render", never, { "componentType": { "alias": "componentType"; "required": false; "isSignal": true; }; "displayMode": { "alias": "displayMode"; "required": true; "isSignal": true; }; "valueType": { "alias": "valueType"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; "subName": { "alias": "subName"; "required": false; "isSignal": true; }; "inputs": { "alias": "inputs"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "outputs": "outputs"; }, never, never, true, never>;
|
|
36
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { XtPluginRegistry } from "../registry/xt-plugin-registry";
|
|
2
|
-
import { XtTypeResolver } from "xt-type";
|
|
3
|
-
import { XtContext } from "../xt-context";
|
|
4
|
-
import { XtResolvedComponent } from "../xt-resolved-component";
|
|
5
|
-
import { XtResolver } from "./xt-resolver";
|
|
6
|
-
export declare class XtRegistryResolver implements XtResolver {
|
|
7
|
-
registry: XtPluginRegistry;
|
|
8
|
-
typeResolver: XtTypeResolver;
|
|
9
|
-
constructor(registry: XtPluginRegistry, typeResolver: XtTypeResolver);
|
|
10
|
-
resolve<T>(baseContext: XtContext<T>, subName?: string): XtResolvedComponent | null;
|
|
11
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wrapper around xt-store manager: You can use it to check if xt-store is included or not, and decide what to do
|
|
3
|
-
*
|
|
4
|
-
* This allow plugins to potentially use xt-store whenever included in the applications running the plugin
|
|
5
|
-
*/
|
|
6
|
-
import { Observable } from 'rxjs';
|
|
7
|
-
export declare class StoreSupport {
|
|
8
|
-
protected static testStoreManager?: IStoreManager;
|
|
9
|
-
static isStoreManagerAvailable(): boolean;
|
|
10
|
-
static getStoreManager(): IStoreManager;
|
|
11
|
-
static setTestStoreManager(testStoreManager: IStoreManager): void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Interface definition for xt-store component.
|
|
15
|
-
* We re-define them here to avoid importing xt-store in all plugins that don't need it.
|
|
16
|
-
*/
|
|
17
|
-
export interface IDataTransformer<T> {
|
|
18
|
-
/**
|
|
19
|
-
* Enable transformation of data right after it has been loaded from the store
|
|
20
|
-
* @param source
|
|
21
|
-
*/
|
|
22
|
-
postLoadingTransformation(source: any[]): T[];
|
|
23
|
-
}
|
|
24
|
-
export interface IDocumentInfo {
|
|
25
|
-
documentName: string;
|
|
26
|
-
isUrl: boolean;
|
|
27
|
-
documentId?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface IStoreProvider<T> {
|
|
30
|
-
storeEntity(name: string, entity: T): Promise<T>;
|
|
31
|
-
/**
|
|
32
|
-
* Rejects the promise if the entity is not found
|
|
33
|
-
* @param name
|
|
34
|
-
* @param key
|
|
35
|
-
*/
|
|
36
|
-
safeLoadEntity(name: string, key: any): Promise<T>;
|
|
37
|
-
loadEntity(name: string, key: any): Promise<T | undefined>;
|
|
38
|
-
deleteEntity(name: string, key: any): Promise<boolean>;
|
|
39
|
-
searchEntities(name: string, ...criteria: any[]): Observable<Array<T>>;
|
|
40
|
-
searchAndPrepareEntities(name: string, sort?: any, groupBy?: any, transformer?: IDataTransformer<T>, ...criteria: any[]): Observable<any>;
|
|
41
|
-
canStoreDocument(): boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Upload one document to a server store and returns the url or the id needed to retrieve them.
|
|
44
|
-
* @param toStore
|
|
45
|
-
* @param position
|
|
46
|
-
*/
|
|
47
|
-
storeDocument(toStore: File): Promise<IDocumentInfo>;
|
|
48
|
-
/**
|
|
49
|
-
* Upload documents to a server store and returns the url or the id needed to retrieve them.
|
|
50
|
-
* @param toStore
|
|
51
|
-
* @param position
|
|
52
|
-
*/
|
|
53
|
-
storeDocuments(toStore: File[]): Observable<IDocumentInfo>;
|
|
54
|
-
}
|
|
55
|
-
export interface IStoreManager {
|
|
56
|
-
getProvider<T = never>(name?: string): IStoreProvider<T> | undefined;
|
|
57
|
-
getProviderSafe<T = never>(name?: string): IStoreProvider<T>;
|
|
58
|
-
getDefaultProvider<T = never>(): IStoreProvider<T> | undefined;
|
|
59
|
-
getDefaultProviderSafe<T = never>(): IStoreProvider<T>;
|
|
60
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { IDataTransformer, IDocumentInfo, IStoreManager, IStoreProvider } from '../store/store-support';
|
|
3
|
-
/**
|
|
4
|
-
* A very light and not 100% compatible storemanager in case you are not using xt-store.
|
|
5
|
-
* It can emulate XtStoreManager to some extends for doing some tests
|
|
6
|
-
*/
|
|
7
|
-
export declare class StoreTestHelper {
|
|
8
|
-
static ensureTestProviderOnly(): void;
|
|
9
|
-
}
|
|
10
|
-
export declare class TestStoreManager implements IStoreManager {
|
|
11
|
-
protected defaultProvider: TestStoreProvider<never>;
|
|
12
|
-
getProvider<T = never>(name?: string): IStoreProvider<T> | undefined;
|
|
13
|
-
getProviderSafe<T = never>(name?: string): IStoreProvider<T>;
|
|
14
|
-
getDefaultProvider<T = never>(): IStoreProvider<T> | undefined;
|
|
15
|
-
getDefaultProviderSafe<T = never>(): IStoreProvider<T>;
|
|
16
|
-
}
|
|
17
|
-
export declare class TestStoreProvider<T = never> implements IStoreProvider<T> {
|
|
18
|
-
protected data: Map<string, Map<string, any>>;
|
|
19
|
-
protected getOrCreateArray(name: string): Map<string, any>;
|
|
20
|
-
protected extractKey(value: any): string;
|
|
21
|
-
storeEntity(name: string, entity: T): Promise<T>;
|
|
22
|
-
safeLoadEntity(name: string, key: any): Promise<T>;
|
|
23
|
-
loadEntity(name: string, key: any): Promise<T | undefined>;
|
|
24
|
-
deleteEntity(name: string, key: any): Promise<boolean>;
|
|
25
|
-
searchEntities(name: string, ...criteria: any[]): Observable<T[]>;
|
|
26
|
-
searchAndPrepareEntities(name: string, sort?: any, groupBy?: any, transformer?: IDataTransformer<T> | undefined, ...criteria: any[]): Observable<any>;
|
|
27
|
-
canStoreDocument(): boolean;
|
|
28
|
-
storeDocument(toStore: File): Promise<IDocumentInfo>;
|
|
29
|
-
storeDocuments(toStore: File[]): Observable<IDocumentInfo>;
|
|
30
|
-
}
|
|
31
|
-
export declare class TestDocumentInfo implements IDocumentInfo {
|
|
32
|
-
documentName: string;
|
|
33
|
-
isUrl: boolean;
|
|
34
|
-
documentId?: string;
|
|
35
|
-
constructor(documentName: string, isUrl: boolean, documentId?: string);
|
|
36
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Type } from '@angular/core';
|
|
2
|
-
import { AbstractControl, FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
-
import { XtComponent } from '../xt-component';
|
|
4
|
-
import { XtBaseContext, XtDisplayMode } from '../xt-context';
|
|
5
|
-
import { XtResolverService } from '../angular/xt-resolver.service';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Component that can be used to bootstrap tests.
|
|
9
|
-
* Just set the value and component type, and it will be injected in your test.
|
|
10
|
-
*/
|
|
11
|
-
export declare class HostTestSimpleComponent {
|
|
12
|
-
type: import("@angular/core").InputSignal<Type<XtComponent<any>>>;
|
|
13
|
-
displayMode: import("@angular/core").InputSignal<XtDisplayMode>;
|
|
14
|
-
value: import("@angular/core").InputSignal<any>;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HostTestSimpleComponent, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HostTestSimpleComponent, "test-host", never, { "type": { "alias": "type"; "required": true; "isSignal": true; }; "displayMode": { "alias": "displayMode"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Same as HostTestSimpleComponent but it includes everything in a form.
|
|
20
|
-
* Just set the component type, the formGroup and the component name, and your component will be run.
|
|
21
|
-
* You can as well easily read and set the value.
|
|
22
|
-
*/
|
|
23
|
-
export declare class HostTestFormComponent {
|
|
24
|
-
builder: FormBuilder;
|
|
25
|
-
type: import("@angular/core").InputSignal<Type<XtComponent<any>>>;
|
|
26
|
-
controlName: import("@angular/core").InputSignal<string>;
|
|
27
|
-
formDescription: import("@angular/core").InputSignal<any>;
|
|
28
|
-
formGroup: import("@angular/core").InputSignal<FormGroup<any> | undefined>;
|
|
29
|
-
createdFormGroup: FormGroup | null;
|
|
30
|
-
computedFormGroup(): FormGroup<any>;
|
|
31
|
-
patchValue(newVal: any): void;
|
|
32
|
-
retrieveValue(): any;
|
|
33
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HostTestFormComponent, never>;
|
|
34
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HostTestFormComponent, "test-form-host", never, { "type": { "alias": "type"; "required": true; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": true; "isSignal": true; }; "formDescription": { "alias": "formDescription"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Component that can be used to test your component based on the type it handles
|
|
38
|
-
* Just set the type hierarchy to register, the value, and it will instantiate the right component in your plugin
|
|
39
|
-
*/
|
|
40
|
-
export declare class HostTestTypedComponent {
|
|
41
|
-
displayMode: import("@angular/core").InputSignal<XtDisplayMode>;
|
|
42
|
-
value: import("@angular/core").InputSignal<any>;
|
|
43
|
-
valueType: import("@angular/core").InputSignal<string | undefined>;
|
|
44
|
-
context: import("@angular/core").Signal<XtBaseContext<unknown>>;
|
|
45
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HostTestTypedComponent, never>;
|
|
46
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HostTestTypedComponent, "test-typed-host", never, { "displayMode": { "alias": "displayMode"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "valueType": { "alias": "valueType"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Same as HostTestSimpleComponent but it includes everything in a form.
|
|
50
|
-
* Just set the component type, the formGroup and the component name, and your component will be run.
|
|
51
|
-
* You can as well easily read and set the value.
|
|
52
|
-
*/
|
|
53
|
-
export declare class HostTestTypedFormComponent {
|
|
54
|
-
builder: FormBuilder;
|
|
55
|
-
resolver: XtResolverService;
|
|
56
|
-
static readonly CONTROL_NAME = "ForTest";
|
|
57
|
-
valueType: import("@angular/core").InputSignal<string | undefined>;
|
|
58
|
-
controlName: import("@angular/core").InputSignal<string | undefined>;
|
|
59
|
-
formDescription: import("@angular/core").InputSignal<any>;
|
|
60
|
-
formGroup: import("@angular/core").InputSignal<FormGroup<any> | undefined>;
|
|
61
|
-
parentFormGroup: FormGroup<{
|
|
62
|
-
[x: string]: AbstractControl<any, any>;
|
|
63
|
-
}>;
|
|
64
|
-
createdFormGroup: FormGroup | null;
|
|
65
|
-
computedFormGroup: import("@angular/core").Signal<FormGroup<any>>;
|
|
66
|
-
subContext: import("@angular/core").Signal<XtBaseContext<any>>;
|
|
67
|
-
patchValue(controlName: string, newVal: any): void;
|
|
68
|
-
retrieveValue(controlName: string): any;
|
|
69
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HostTestTypedFormComponent, never>;
|
|
70
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HostTestTypedFormComponent, "test-typed-form-host", never, { "valueType": { "alias": "valueType"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "formDescription": { "alias": "formDescription"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
71
|
-
}
|
package/lib/xt-component.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { InputSignal, OutputEmitterRef } from '@angular/core';
|
|
2
|
-
import { XtContext } from './xt-context';
|
|
3
|
-
import { FormGroup } from '@angular/forms';
|
|
4
|
-
export type XtComponent<T = any> = {
|
|
5
|
-
context: InputSignal<XtContext<T>>;
|
|
6
|
-
inputsObject?: XtComponentInput;
|
|
7
|
-
outputsObject?: XtComponentOutput;
|
|
8
|
-
inputs?: InputSignal<XtComponentInput>;
|
|
9
|
-
outputs?: OutputEmitterRef<XtComponentOutput>;
|
|
10
|
-
isInForm(): boolean;
|
|
11
|
-
formControlName(): string | undefined;
|
|
12
|
-
formGroup(): FormGroup;
|
|
13
|
-
formGroupIfAny(): FormGroup | undefined;
|
|
14
|
-
};
|
|
15
|
-
export type XtOutputType = 'valueSelected';
|
|
16
|
-
export type XtInputType = 'valueSelected';
|
|
17
|
-
export type XtComponentOutput = {
|
|
18
|
-
[key in XtOutputType]: OutputEmitterRef<any> | undefined;
|
|
19
|
-
};
|
|
20
|
-
export type XtComponentInput = {
|
|
21
|
-
[key in XtInputType]: InputSignal<any> | undefined;
|
|
22
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { XtSimpleComponent } from '../xt-simple/xt-simple.component';
|
|
2
|
-
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import { XtResolverService } from '../angular/xt-resolver.service';
|
|
4
|
-
import { XtContext } from '../xt-context';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class XtCompositeComponent<T = any> extends XtSimpleComponent<T> {
|
|
7
|
-
resolverService: XtResolverService;
|
|
8
|
-
formGroupIfAny: import("@angular/core").Signal<FormGroup<any> | undefined>;
|
|
9
|
-
/**
|
|
10
|
-
* We need to create a new form group to manage the sub elements.
|
|
11
|
-
*/
|
|
12
|
-
formGroup: import("@angular/core").Signal<FormGroup<any>>;
|
|
13
|
-
/**
|
|
14
|
-
* Helper function to calculate the sub context
|
|
15
|
-
* @param subName
|
|
16
|
-
* @param subType
|
|
17
|
-
*/
|
|
18
|
-
subContext(subName: string, subType?: string): XtContext<any>;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<XtCompositeComponent<any>, never>;
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<XtCompositeComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
21
|
-
}
|
package/lib/xt-context.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { FormGroup } from '@angular/forms';
|
|
2
|
-
import { XtTypeResolver } from 'xt-type';
|
|
3
|
-
import { Signal, WritableSignal } from '@angular/core';
|
|
4
|
-
/**
|
|
5
|
-
* A XtContext provides all the necessary information for an ng-extended component to operate. It is passed from parent to child component and pass
|
|
6
|
-
* - The display mode - View, Inline view or Edit
|
|
7
|
-
* - The value, either directly as a signal or in a formgroup when editing.
|
|
8
|
-
* - The valueType, necessary to find the right ng-extended component to display
|
|
9
|
-
*
|
|
10
|
-
* To do this, it maintains a hierarchy of context and subContexts by name.
|
|
11
|
-
*/
|
|
12
|
-
export type XtContext<T> = {
|
|
13
|
-
displayMode: XtDisplayMode;
|
|
14
|
-
subName?: string;
|
|
15
|
-
parentFormGroup?: FormGroup;
|
|
16
|
-
localFormGroup?: FormGroup;
|
|
17
|
-
parentContext?: XtContext<any>;
|
|
18
|
-
isInForm(): boolean;
|
|
19
|
-
formGroup(): FormGroup | undefined;
|
|
20
|
-
formControlNameOrNull(): string | null;
|
|
21
|
-
formControlValue(): any | null;
|
|
22
|
-
subValue(subName?: string): T | null | undefined;
|
|
23
|
-
subContext(subName: string | undefined | null, subType?: string, typeResolver?: XtTypeResolver | null): XtContext<any>;
|
|
24
|
-
elementSetContext(subElement: any): XtContext<any>;
|
|
25
|
-
displayValue: Signal<T | null>;
|
|
26
|
-
setDisplayValue(newValue: T | null | undefined, type?: string): XtContext<T>;
|
|
27
|
-
setFormValue(newValue: T | null | undefined, markAsDirty?: boolean): boolean;
|
|
28
|
-
value(): T | null | undefined;
|
|
29
|
-
valueType?: string;
|
|
30
|
-
toString(): string;
|
|
31
|
-
};
|
|
32
|
-
export type XtDisplayMode = 'INLINE_VIEW' | 'FULL_VIEW' | 'FULL_EDITABLE' | 'LIST_VIEW';
|
|
33
|
-
export declare class XtBaseContext<T> implements XtContext<T> {
|
|
34
|
-
displayMode: XtDisplayMode;
|
|
35
|
-
/**
|
|
36
|
-
* When editable, the value is stored in a parent formGroup
|
|
37
|
-
*/
|
|
38
|
-
subName?: string;
|
|
39
|
-
parentFormGroup?: FormGroup<any>;
|
|
40
|
-
/**
|
|
41
|
-
* When the context is a child, it potentially needs to update its parent value
|
|
42
|
-
*/
|
|
43
|
-
parentContext?: XtBaseContext<any>;
|
|
44
|
-
/**
|
|
45
|
-
* All child contexts are kept in this map
|
|
46
|
-
*/
|
|
47
|
-
protected childContexts?: Map<string, XtBaseContext<any>>;
|
|
48
|
-
/**
|
|
49
|
-
* localFormGroup exists only for composite components: it's children are all gathered in a form group
|
|
50
|
-
*/
|
|
51
|
-
localFormGroup?: FormGroup<any>;
|
|
52
|
-
/**
|
|
53
|
-
* When not managed by a form, the value is here
|
|
54
|
-
*/
|
|
55
|
-
nonFormValue?: WritableSignal<T | null>;
|
|
56
|
-
valueType?: string;
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
* @param displayMode
|
|
60
|
-
* @param readOnly
|
|
61
|
-
* @param parentGroup
|
|
62
|
-
* @param controlName
|
|
63
|
-
*/
|
|
64
|
-
constructor(displayMode: XtDisplayMode, subName?: string, parentGroup?: FormGroup, parentContext?: XtBaseContext<any>);
|
|
65
|
-
setDisplayValue(newValue: T | null | undefined, type?: string, updateParent?: boolean): XtBaseContext<T>;
|
|
66
|
-
displayValue: Signal<T | null>;
|
|
67
|
-
isInForm(): boolean;
|
|
68
|
-
formControlNameOrNull(): string | null;
|
|
69
|
-
value(): T | null | undefined;
|
|
70
|
-
subValue(subsubName?: string): any | null | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* Enable child contexts to update its own value in the parent context whenever it's value changes
|
|
73
|
-
*/
|
|
74
|
-
protected updateSubDisplayValue(subName: string, subValue: any): void;
|
|
75
|
-
formControlValue(): T | null | undefined;
|
|
76
|
-
setFormValue(newValue: T | null | undefined, markAsDirty?: boolean): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Returns the context associated with a specific element in a set.
|
|
79
|
-
* Value must be an array.
|
|
80
|
-
* @param elementIndex
|
|
81
|
-
*/
|
|
82
|
-
elementSetContext(elementIndex: number): XtContext<any>;
|
|
83
|
-
subContext(subName: string | undefined | null, subType?: string, typeResolver?: XtTypeResolver | null): XtContext<any>;
|
|
84
|
-
formGroup(): FormGroup | undefined;
|
|
85
|
-
toString(): string;
|
|
86
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { XtComponentInfo } from './plugin/xt-plugin-info';
|
|
2
|
-
export declare class XtResolvedComponent {
|
|
3
|
-
componentName: string;
|
|
4
|
-
componentClass: any;
|
|
5
|
-
outputs: boolean;
|
|
6
|
-
constructor(componantName: string, componentClass: any, outputs?: boolean);
|
|
7
|
-
static from(info: XtComponentInfo<any>): XtResolvedComponent;
|
|
8
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import { XtContext } from '../xt-context';
|
|
4
|
-
import { XtComponent, XtComponentOutput } from '../xt-component';
|
|
5
|
-
import { XtBaseOutput } from '../output/xt-base-output';
|
|
6
|
-
import { XtBaseInput } from '../output/xt-base-input';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
/**
|
|
9
|
-
* An XtSimpleComponent just displays the given value or element in a form.
|
|
10
|
-
* If you need to dynamically embed other XtComponents to display sub elements, then please use the XtCompositeComponent
|
|
11
|
-
*/
|
|
12
|
-
export declare class XtSimpleComponent<T = any> implements XtComponent<T>, OnInit {
|
|
13
|
-
context: import("@angular/core").InputSignal<XtContext<T>>;
|
|
14
|
-
outputsObject: XtBaseOutput;
|
|
15
|
-
inputsObject: XtBaseInput;
|
|
16
|
-
outputs: import("@angular/core").OutputEmitterRef<XtComponentOutput>;
|
|
17
|
-
isInForm: import("@angular/core").Signal<boolean>;
|
|
18
|
-
formControlNameIfAny: import("@angular/core").Signal<string | undefined>;
|
|
19
|
-
formGroupIfAny: import("@angular/core").Signal<FormGroup<any> | undefined>;
|
|
20
|
-
formGroup: import("@angular/core").Signal<FormGroup<any>>;
|
|
21
|
-
/**
|
|
22
|
-
* Returns the component form name, which is for now the subName
|
|
23
|
-
*/
|
|
24
|
-
componentNameInForm: import("@angular/core").Signal<string>;
|
|
25
|
-
constructor();
|
|
26
|
-
ngOnInit(): void;
|
|
27
|
-
manageFormControl<T>(ctrlName: string): AbstractControl<T> | undefined;
|
|
28
|
-
safelyGetSubName: import("@angular/core").Signal<string>;
|
|
29
|
-
/**
|
|
30
|
-
* Returns the form control name and create a form control behind the scene
|
|
31
|
-
*/
|
|
32
|
-
formControlName: import("@angular/core").Signal<string>;
|
|
33
|
-
formControl: import("@angular/core").Signal<AbstractControl<any, any>>;
|
|
34
|
-
componentDescriptor(): string;
|
|
35
|
-
getValue: import("@angular/core").Signal<T | null | undefined>;
|
|
36
|
-
displayValue: import("@angular/core").Signal<T | null>;
|
|
37
|
-
/**
|
|
38
|
-
* This is where components can assign their output() and input() into the XtComponent inputs and outputs member
|
|
39
|
-
* @protected
|
|
40
|
-
*/
|
|
41
|
-
protected setupInputOutput(): void;
|
|
42
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<XtSimpleComponent<any>, never>;
|
|
43
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<XtSimpleComponent<any>, "ng-component", never, { "context": { "alias": "context"; "required": true; "isSignal": true; }; }, { "outputs": "outputs"; }, never, never, true, never>;
|
|
44
|
-
}
|
package/public-api.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from './lib/xt-component';
|
|
2
|
-
export * from './lib/xt-context';
|
|
3
|
-
export * from './lib/xt-resolved-component';
|
|
4
|
-
export * from './lib/resolver/xt-resolver';
|
|
5
|
-
export * from './lib/registry/xt-plugin-registry';
|
|
6
|
-
export * from './lib/plugin/xt-plugin-info';
|
|
7
|
-
export * from './globals';
|
|
8
|
-
export * from './lib/angular/xt-tokens';
|
|
9
|
-
export * from './lib/angular/xt-resolver.service';
|
|
10
|
-
export * from './lib/render/xt-render.component';
|
|
11
|
-
export * from './lib/render/xt-render-sub.component';
|
|
12
|
-
export * from './lib/xt-simple/xt-simple.component';
|
|
13
|
-
export * from './lib/xt-composite/xt-composite.component';
|
|
14
|
-
export * from './lib/angular/message-handler';
|
|
15
|
-
export * from './lib/store/store-support';
|
|
16
|
-
export * from './lib/type/type-helper';
|
|
17
|
-
export * from './lib/test/xt-unit-test-helper';
|
|
18
|
-
export * from './lib/test/xt-test-helper-components';
|
|
19
|
-
export * from './lib/test/store-test-helper';
|