ag-studio-angular 1.1.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ag-studio-angular.mjs +18 -27
- package/fesm2022/ag-studio-angular.mjs.map +1 -1
- package/index.d.ts +248 -5
- package/package.json +3 -4
- package/esm2022/ag-studio-angular.mjs +0 -5
- package/esm2022/lib/ag-studio.component.mjs +0 -350
- package/esm2022/lib/ag-studio.module.mjs +0 -16
- package/esm2022/lib/angularFrameworkComponentWrapper.mjs +0 -107
- package/esm2022/lib/angularFrameworkOverrides.mjs +0 -74
- package/esm2022/lib/interfaces.mjs +0 -2
- package/esm2022/public-api.mjs +0 -6
- package/lib/ag-studio.component.d.ts +0 -172
- package/lib/ag-studio.module.d.ts +0 -7
- package/lib/angularFrameworkComponentWrapper.d.ts +0 -25
- package/lib/angularFrameworkOverrides.d.ts +0 -29
- package/lib/interfaces.d.ts +0 -31
- package/public-api.d.ts +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ViewContainerRef, Component, Injectable, NgZone, EventEmitter, booleanAttribute, Output, Input, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
3
|
import { _BaseComponentWrapper, _VanillaFrameworkOverrides, _combineAttributesAndStudioProperties, _createStudio, _processPropertyChanges, _BOOLEAN_MIXED_STUDIO_PROPERTIES } from 'ag-studio';
|
|
4
|
-
import { _removeFromParent } from 'ag-
|
|
4
|
+
import { _removeFromParent } from 'ag-stack';
|
|
5
5
|
|
|
6
6
|
// To speed up the removal of custom components we create a number of shards to contain them.
|
|
7
7
|
// Removing a single component calls a function within Angular called removeFromArray.
|
|
@@ -10,14 +10,15 @@ class AgComponentContainer {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
this.vcr = inject(ViewContainerRef);
|
|
12
12
|
}
|
|
13
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
14
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
13
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AgComponentContainer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.21", type: AgComponentContainer, isStandalone: false, selector: "ag-component-container", ngImport: i0, template: '', isInline: true }); }
|
|
15
15
|
}
|
|
16
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AgComponentContainer, decorators: [{
|
|
17
17
|
type: Component,
|
|
18
18
|
args: [{
|
|
19
19
|
selector: 'ag-component-container',
|
|
20
20
|
template: '',
|
|
21
|
+
standalone: false,
|
|
21
22
|
}]
|
|
22
23
|
}] });
|
|
23
24
|
const NUM_SHARDS = 16;
|
|
@@ -45,10 +46,10 @@ class AngularFrameworkComponentWrapper extends _BaseComponentWrapper {
|
|
|
45
46
|
const container = this.compShards.get(shardIdx);
|
|
46
47
|
return container.instance.vcr.createComponent(componentType);
|
|
47
48
|
}
|
|
48
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
49
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
49
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AngularFrameworkComponentWrapper, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
50
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AngularFrameworkComponentWrapper }); }
|
|
50
51
|
}
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AngularFrameworkComponentWrapper, decorators: [{
|
|
52
53
|
type: Injectable
|
|
53
54
|
}] });
|
|
54
55
|
class DynamicAgNg2Component {
|
|
@@ -170,16 +171,14 @@ class AngularFrameworkOverrides extends _VanillaFrameworkOverrides {
|
|
|
170
171
|
runOutsideAngular(callback, source) {
|
|
171
172
|
return this.runOutside(callback, source);
|
|
172
173
|
}
|
|
173
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
174
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
174
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AngularFrameworkOverrides, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
175
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AngularFrameworkOverrides }); }
|
|
175
176
|
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
177
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AngularFrameworkOverrides, decorators: [{
|
|
177
178
|
type: Injectable
|
|
178
179
|
}], ctorParameters: () => [{ type: i0.NgZone }] });
|
|
179
180
|
|
|
180
|
-
/* eslint-disable no-duplicate-imports */
|
|
181
181
|
// False positive lint error, ElementRef and co can't be type imports
|
|
182
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
183
182
|
class AgStudio {
|
|
184
183
|
constructor(elementDef, _viewContainerRef, _angularFrameworkOverrides, _frameworkCompWrapper) {
|
|
185
184
|
this._viewContainerRef = _viewContainerRef;
|
|
@@ -299,12 +298,6 @@ class AgStudio {
|
|
|
299
298
|
/** Data-layer configuration. Controls behaviours such as export row limits.
|
|
300
299
|
*/
|
|
301
300
|
this.dataOptions = undefined;
|
|
302
|
-
/** @deprecated v1.1 Use `widgets` to customise the widget configurations and available widgets,
|
|
303
|
-
* and `page` to customise the page setup form.
|
|
304
|
-
*
|
|
305
|
-
* Overrides for the layout and widget configs.
|
|
306
|
-
*/
|
|
307
|
-
this.overrides = undefined;
|
|
308
301
|
/** Configure which panels are displayed and on which side.
|
|
309
302
|
*/
|
|
310
303
|
this.panels = undefined;
|
|
@@ -425,10 +418,10 @@ class AgStudio {
|
|
|
425
418
|
}
|
|
426
419
|
}
|
|
427
420
|
}
|
|
428
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
429
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "
|
|
421
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AgStudio, deps: [{ token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: AngularFrameworkOverrides }, { token: AngularFrameworkComponentWrapper }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
422
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.3.21", type: AgStudio, isStandalone: true, selector: "ag-studio", inputs: { studioProperties: "studioProperties", modules: "modules", tabIndex: "tabIndex", enableRtl: ["enableRtl", "enableRtl", booleanAttribute], popupParent: "popupParent", theme: "theme", loadThemeGoogleFonts: ["loadThemeGoogleFonts", "loadThemeGoogleFonts", booleanAttribute], themeCssLayer: "themeCssLayer", styleNonce: "styleNonce", themeStyleContainer: "themeStyleContainer", getDocument: "getDocument", suppressTouch: ["suppressTouch", "suppressTouch", booleanAttribute], localeText: "localeText", getLocaleText: "getLocaleText", studioId: "studioId", context: "context", initialState: "initialState", data: "data", mode: "mode", layout: "layout", ai: "ai", dataOptions: "dataOptions", panels: "panels", page: "page", widgets: "widgets", components: "components" }, outputs: { stateUpdated: "stateUpdated", apiReady: "apiReady", studioReady: "studioReady", errorRaised: "errorRaised" }, providers: [AngularFrameworkOverrides, AngularFrameworkComponentWrapper], usesOnChanges: true, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
|
|
430
423
|
}
|
|
431
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AgStudio, decorators: [{
|
|
432
425
|
type: Component,
|
|
433
426
|
args: [{
|
|
434
427
|
selector: 'ag-studio',
|
|
@@ -485,8 +478,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
485
478
|
type: Input
|
|
486
479
|
}], dataOptions: [{
|
|
487
480
|
type: Input
|
|
488
|
-
}], overrides: [{
|
|
489
|
-
type: Input
|
|
490
481
|
}], panels: [{
|
|
491
482
|
type: Input
|
|
492
483
|
}], page: [{
|
|
@@ -520,11 +511,11 @@ function getValueOrCoercedValue(key, valueToUse) {
|
|
|
520
511
|
}
|
|
521
512
|
|
|
522
513
|
class AgStudioModule {
|
|
523
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
524
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
525
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
514
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AgStudioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
515
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.21", ngImport: i0, type: AgStudioModule, imports: [AgStudio], exports: [AgStudio] }); }
|
|
516
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AgStudioModule }); }
|
|
526
517
|
}
|
|
527
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: AgStudioModule, decorators: [{
|
|
528
519
|
type: NgModule,
|
|
529
520
|
args: [{
|
|
530
521
|
imports: [AgStudio],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ag-studio-angular.mjs","sources":["../../../projects/ag-studio-angular/src/lib/angularFrameworkComponentWrapper.ts","../../../projects/ag-studio-angular/src/lib/angularFrameworkOverrides.ts","../../../projects/ag-studio-angular/src/lib/ag-studio.component.ts","../../../projects/ag-studio-angular/src/lib/ag-studio.module.ts","../../../projects/ag-studio-angular/src/ag-studio-angular.ts"],"sourcesContent":["import type { ComponentRef } from '@angular/core';\nimport { Component, Injectable, ViewContainerRef, inject } from '@angular/core';\nimport type { _FrameworkComponentWrapper, _WrappableInterface } from 'ag-studio';\nimport { _BaseComponentWrapper } from 'ag-studio';\n\nimport { _removeFromParent } from 'ag-grid-enterprise';\n\nimport type { AngularFrameworkOverrides } from './angularFrameworkOverrides';\nimport type { AgCustomComponent } from './interfaces';\n\n// To speed up the removal of custom components we create a number of shards to contain them.\n// Removing a single component calls a function within Angular called removeFromArray.\n// This is a lot faster if the array is smaller.\n@Component({\n selector: 'ag-component-container',\n template: '',\n})\nexport class AgComponentContainer {\n public vcr = inject(ViewContainerRef);\n}\nconst NUM_SHARDS = 16;\nlet shardIdx = 0;\n\nfunction createComponentContainers(vcr: ViewContainerRef): Map<number, ComponentRef<AgComponentContainer>> {\n const containerMap = new Map<number, ComponentRef<AgComponentContainer>>();\n for (let i = 0; i < NUM_SHARDS; i++) {\n const container = vcr.createComponent(AgComponentContainer);\n containerMap.set(i, container);\n _removeFromParent(container.location.nativeElement);\n }\n return containerMap;\n}\n\n@Injectable()\nexport class AngularFrameworkComponentWrapper\n extends _BaseComponentWrapper<_WrappableInterface>\n implements _FrameworkComponentWrapper\n{\n private viewContainerRef: ViewContainerRef;\n private frameworkOverrides: AngularFrameworkOverrides;\n private compShards: Map<number, ComponentRef<AgComponentContainer>>;\n\n setViewContainerRef(viewContainerRef: ViewContainerRef, angularFrameworkOverrides: AngularFrameworkOverrides) {\n this.viewContainerRef = viewContainerRef;\n this.frameworkOverrides = angularFrameworkOverrides;\n }\n\n protected createWrapper(OriginalConstructor: { new (): any }): _WrappableInterface {\n this.compShards ??= createComponentContainers(this.viewContainerRef);\n return new DynamicAgNg2Component(this.frameworkOverrides, this, OriginalConstructor);\n }\n\n createComponent<T>(componentType: { new (...args: any[]): T }): ComponentRef<T> {\n shardIdx = (shardIdx + 1) % NUM_SHARDS;\n const container = this.compShards.get(shardIdx)!;\n return container.instance.vcr.createComponent(componentType);\n }\n}\n\nclass DynamicAgNg2Component<P> implements _WrappableInterface {\n private _eGui: HTMLElement;\n private _componentRef: ComponentRef<AgCustomComponent<P>>;\n private _frameworkComponentInstance: any; // the user's component - for accessing methods they create\n\n constructor(\n private frameworkOverrides: AngularFrameworkOverrides,\n private frameworkCompWrapper: AngularFrameworkComponentWrapper,\n private OriginalConstructor: { new (): any }\n ) {}\n\n init(params: P): Promise<any> {\n return new Promise((resolve) => {\n this.frameworkOverrides.runInsideAngular(() => {\n this._init(params).then((result) => {\n this._componentRef.changeDetectorRef.detectChanges();\n resolve(result);\n });\n });\n });\n }\n\n private async _init(params: P): Promise<any> {\n this._componentRef = this.frameworkCompWrapper.createComponent(this.OriginalConstructor);\n const instance = this._componentRef.instance;\n this._frameworkComponentInstance = instance;\n this._eGui = this._componentRef.location.nativeElement;\n // Angular appends the component to the DOM, so remove it\n _removeFromParent(this._eGui);\n\n return instance.agInit?.(params);\n }\n\n async refresh(params: P): Promise<any> {\n return this.frameworkOverrides.runInsideAngular(() => this._frameworkComponentInstance.refresh?.(params));\n }\n\n getGui(): HTMLElement {\n return this._eGui;\n }\n\n /** `getGui()` returns the `ng-component` element. This returns the actual root element. */\n getRootElement(): HTMLElement {\n return this._eGui.firstChild as HTMLElement;\n }\n\n destroy(): void {\n if (typeof this._frameworkComponentInstance?.destroy === 'function') {\n this._frameworkComponentInstance.destroy();\n }\n this._componentRef?.destroy();\n }\n\n getFrameworkComponentInstance(): any {\n return this._frameworkComponentInstance;\n }\n\n hasMethod(name: string): boolean {\n return this._frameworkComponentInstance[name] != null;\n }\n\n callMethod(name: string, args: IArguments): any {\n return this.frameworkOverrides.runInsideAngular(() => this._frameworkComponentInstance[name](...args));\n }\n\n addMethod(name: string, callback: (...args: any[]) => any): void {\n (this as any)[name] = callback;\n }\n}\n","import { Injectable, NgZone } from '@angular/core';\nimport { _VanillaFrameworkOverrides } from 'ag-studio';\n\nimport type { FrameworkOverridesIncomingSource } from 'ag-grid-enterprise';\n\n@Injectable()\nexport class AngularFrameworkOverrides extends _VanillaFrameworkOverrides {\n override readonly batchFrameworkComps: boolean = true;\n\n // Flag used to control Zone behaviour when running tests as many test features rely on Zone.\n private readonly isRunningWithinTestZone: boolean = false;\n\n private readonly runOutside: <T>(callback: () => T, source?: FrameworkOverridesIncomingSource) => T;\n\n constructor(private readonly _ngZone: NgZone) {\n super('angular');\n\n this.isRunningWithinTestZone =\n (globalThis as any)?.AG_STUDIO_UNDER_TEST ?? !!(globalThis as any)?.Zone?.AsyncTestZoneSpec;\n\n if (!this._ngZone) {\n this.runOutside = (callback) => callback();\n } else if (this.isRunningWithinTestZone) {\n this.runOutside = (callback, source) => {\n if (source === 'resize-observer' || source === 'popupPositioning') {\n // ensure resize observer callbacks are run outside of Angular even under test due to Jest not supporting ResizeObserver\n // which means it just loops continuously with a setTimeout with no way to flush the queue or have fixture.whenStable() resolve.\n return this._ngZone.runOutsideAngular(callback);\n }\n // When under test run inside Angular so that tests can use fixture.whenStable() to wait for async operations to complete.\n return callback();\n };\n } else {\n this.runOutside = (callback) => this._ngZone.runOutsideAngular(callback);\n }\n }\n\n // Make all events run outside Angular as they often trigger the setup of event listeners\n // By having the event listeners outside Angular we can avoid triggering change detection\n // This also means that if a user calls an AG Studio API method from within their component\n // the internal side effects will not trigger change detection. Without this the events would\n // run inside Angular and trigger change detection as the source of the event was within the angular zone.\n override wrapIncoming: <T>(callback: () => T, source?: FrameworkOverridesIncomingSource) => T = (\n callback,\n source\n ) => this.runOutside(callback, source);\n\n /**\n * The shouldWrapOutgoing property is used to determine if events should be run outside of Angular or not.\n * If an event handler is registered outside of Angular then we should not wrap the event handler\n * with runInsideAngular() as the user may not have wanted this.\n * This is also used to not wrap internal event listeners that are registered with RowNodes and Columns.\n */\n get shouldWrapOutgoing() {\n return this._ngZone && NgZone.isInAngularZone();\n }\n\n /**\n * Make sure that any code that is executed outside of AG Studio is running within the Angular zone.\n * This means users can update templates and use binding without having to do anything extra.\n */\n override wrapOutgoing: <T>(callback: () => T) => T = (callback) => this.runInsideAngular(callback);\n\n override isFrameworkComponent(comp: any): boolean {\n if (!comp) {\n return false;\n }\n const prototype = comp.prototype;\n return prototype && 'agInit' in prototype;\n }\n\n runInsideAngular<T>(callback: () => T): T {\n if (!this._ngZone || NgZone.isInAngularZone()) {\n return callback();\n }\n\n // Check for _ngZone existence as it is not present when Zoneless\n return this._ngZone.run(callback);\n }\n\n runOutsideAngular<T>(callback: () => T, source?: FrameworkOverridesIncomingSource): T {\n return this.runOutside(callback, source);\n }\n}\n","/* eslint-disable no-duplicate-imports */\n// False positive lint error, ElementRef and co can't be type imports\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n ViewContainerRef,\n ViewEncapsulation,\n booleanAttribute,\n} from '@angular/core';\nimport type { AgDefaultRegistry, AgStudioApi, AgStudioModule, AgStudioProperties, _StudioParams } from 'ag-studio';\nimport {\n _BOOLEAN_MIXED_STUDIO_PROPERTIES,\n _combineAttributesAndStudioProperties,\n _createStudio,\n _processPropertyChanges,\n} from 'ag-studio';\n// @START_IMPORTS@\nimport type {\n AgAiAssistant,\n AgDataEngine,\n AgDataOptions,\n AgDataSourcesDefinition,\n AgPageConfig,\n AgPageLayoutState,\n AgPanelConfig,\n AgReportState,\n AgStudioApiReadyEvent,\n AgStudioErrorRaisedEvent,\n AgStudioGetLocaleTextParams,\n AgStudioLocaleText,\n AgStudioMode,\n AgStudioOverrides,\n AgStudioReadyEvent,\n AgStudioStateUpdatedEvent,\n AgStudioTheme,\n AgWidgetsConfig,\n} from 'ag-studio';\n\n// @END_IMPORTS@\n\nimport { AngularFrameworkComponentWrapper } from './angularFrameworkComponentWrapper';\nimport { AngularFrameworkOverrides } from './angularFrameworkOverrides';\nimport type { AgRegistry } from './interfaces';\n\n@Component({\n selector: 'ag-studio',\n standalone: true,\n template: '',\n providers: [AngularFrameworkOverrides, AngularFrameworkComponentWrapper],\n // tell angular we don't want view encapsulation, we don't want a shadow root\n encapsulation: ViewEncapsulation.None,\n})\nexport class AgStudio<TRegistry extends AgRegistry = AgDefaultRegistry> implements AfterViewInit, OnChanges, OnDestroy {\n // not intended for user to interact with. so putting _ in so if user gets reference\n // to this object, they kind'a know it's not part of the agreed interface\n private readonly _nativeElement: any;\n private _initialised = false;\n private _destroyed = false;\n\n // in order to ensure firing of apiReady is deterministic\n private _holdEvents = true;\n private _resolveFullyReady: () => void;\n private readonly _fullyReady: Promise<void> = new Promise((resolve) => {\n this._resolveFullyReady = resolve;\n });\n\n /** Studio Api available after onApiReady event has fired. */\n api: AgStudioApi<TRegistry>;\n\n constructor(\n elementDef: ElementRef,\n private readonly _viewContainerRef: ViewContainerRef,\n private readonly _angularFrameworkOverrides: AngularFrameworkOverrides,\n private readonly _frameworkCompWrapper: AngularFrameworkComponentWrapper\n ) {\n this._nativeElement = elementDef.nativeElement;\n // NOSONAR\n this._fullyReady.then(() => {\n // Register the status flag reset before any events are fired\n // so that we can swap to synchronous event firing as soon as the studio is ready\n this._holdEvents = false;\n });\n }\n\n ngAfterViewInit(): void {\n // Run the setup outside of angular so all the event handlers that are created do not trigger change detection\n this._angularFrameworkOverrides.runOutsideAngular(() => {\n this._frameworkCompWrapper.setViewContainerRef(this._viewContainerRef, this._angularFrameworkOverrides);\n\n // Get all the inputs that are valid AgStudioProperties\n const studioPropertiesKeys = Object.keys(this).filter(\n (key) =>\n !(\n key.startsWith('_') ||\n key == 'studioProperties' ||\n key == 'modules' ||\n this[key as keyof AgStudio] instanceof EventEmitter\n )\n );\n\n const coercedStudioProperties = {} as AgStudioProperties<TRegistry>;\n for (const key of studioPropertiesKeys) {\n const valueToUse = getValueOrCoercedValue(key, this[key as keyof AgStudio]);\n coercedStudioProperties[key as keyof AgStudioProperties] = valueToUse;\n }\n\n const mergedStudioProperties = _combineAttributesAndStudioProperties(\n this.studioProperties,\n coercedStudioProperties,\n studioPropertiesKeys\n );\n\n const studioParams: _StudioParams = {\n globalListener: this.globalListener.bind(this),\n frameworkOverrides: this._angularFrameworkOverrides,\n setThemeOnRootDiv: true,\n modules: this.modules,\n providedBeanInstances: {\n frameworkCompWrapper: this._frameworkCompWrapper,\n },\n };\n\n const api = _createStudio(this._nativeElement, mergedStudioProperties, studioParams);\n if (api) {\n this.api = api;\n }\n\n this._initialised = true;\n\n // sometimes, especially in large client apps apiReady can fire before ngAfterViewInit\n // this ties these together so that apiReady will always fire after agStudio's ngAfterViewInit\n // the actual containing component's ngAfterViewInit will fire just after agStudio's\n this._resolveFullyReady();\n });\n }\n\n public ngOnChanges(changes: any): void {\n if (this._initialised) {\n // Run the changes outside of angular so any event handlers that are created do not trigger change detection\n this._angularFrameworkOverrides.runOutsideAngular(() => {\n const studioProperties: AgStudioProperties<TRegistry> = {};\n for (const key of Object.keys(changes)) {\n const value = changes[key];\n studioProperties[key as keyof AgStudioProperties] = value.currentValue;\n }\n _processPropertyChanges(studioProperties, this.api);\n });\n }\n }\n\n public ngOnDestroy(): void {\n if (this._initialised) {\n // need to do this before the destroy, so we know not to emit any events\n // while tearing down the studio.\n this._destroyed = true;\n // could be null if studio failed to initialise\n this.api?.destroy();\n }\n }\n\n // we'll emit the emit if a user is listening for a given event either on the component via normal angular binding\n // or via studioProperties\n protected isEmitterUsed(eventType: string): boolean {\n const emitter = <EventEmitter<any>>(<any>this)[eventType];\n // For RxJs compatibility we need to check for observed v7+ or observers v6\n const emitterAny = emitter as any;\n const hasEmitter = emitterAny?.observed ?? emitterAny?.observers?.length > 0;\n\n // apiReady => onApiReady\n const asEventName = `on${eventType.charAt(0).toUpperCase()}${eventType.substring(1)}`;\n const hasStudioPropertyListener = !!this.studioProperties && !!(this.studioProperties as any)[asEventName];\n\n return hasEmitter || hasStudioPropertyListener;\n }\n\n private globalListener(eventType: string, event: any): void {\n // if we are tearing down, don't emit angular events, as this causes\n // problems with the angular router\n if (this._destroyed) {\n return;\n }\n\n // generically look up the eventType\n const emitter = <EventEmitter<any>>(<any>this)[eventType];\n if (emitter && this.isEmitterUsed(eventType)) {\n // Make sure we emit within the angular zone, so change detection works properly\n const fireEmitter = () => this._angularFrameworkOverrides.runInsideAngular(() => emitter.emit(event));\n\n if (this._holdEvents) {\n // if the user is listening to events, wait for ngAfterViewInit to fire first, then emit the studio events\n this._fullyReady.then(() => fireEmitter());\n } else {\n fireEmitter();\n }\n }\n }\n\n /** Provided an initial studioProperties configuration to the component. If a property is specified in both studioProperties and via component binding the component binding takes precedence. */\n @Input() public studioProperties: AgStudioProperties<TRegistry> | undefined;\n /**\n * Used to register AG Studio Modules directly with this instance of Studio.\n */\n @Input() public modules: AgStudioModule[] | undefined;\n\n // @START@\n /** Change this value to set the tabIndex order of Studio within your application.\n * @default 0\n * @initial\n */\n @Input() public tabIndex: number | undefined = undefined;\n /** Set to `true` to operate Studio in RTL (Right to Left) mode.\n * @default false\n * @initial\n */\n @Input({ transform: booleanAttribute }) public enableRtl: boolean | undefined = undefined;\n /** DOM element to use as the popup parent for Studio popups (context menus, etc.).\n */\n @Input() public popupParent: HTMLElement | null | undefined = undefined;\n /** Theme to apply to Studio.\n *\n * @default studioTheme\n */\n @Input() public theme: AgStudioTheme | undefined = undefined;\n /** If your theme uses a font that is available on Google Fonts, pass true to load it from Google's CDN.\n */\n @Input({ transform: booleanAttribute }) public loadThemeGoogleFonts: boolean | undefined = undefined;\n /** The CSS layer that this theme should be rendered onto. When specified,\n * Studio CSS will be wrapped in a `@layer ${themeCssLayer} { ... }` block.\n *\n * NOTE: when specifying `themeCssLayer` we recommend setting\n * `themeStyleContainer` to `document.body` to ensure that Studio CSS\n * comes after your application CSS, allowing your application to set the\n * order of layers.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@layer\n */\n @Input() public themeCssLayer: string | undefined = undefined;\n /** The nonce attribute to set on style elements added to the document by\n * themes. If \"foo\" is passed to this property, Studio can use the Content\n * Security Policy `style-src 'nonce-foo'`, instead of the less secure\n * `style-src 'unsafe-inline'`.\n *\n * Note: CSP nonces are global to a page, where a page has multiple Studio components,\n * every one must have the same styleNonce set.\n */\n @Input() public styleNonce: string | undefined = undefined;\n /** An element to insert style elements into when injecting styles into the\n * Studio. Styles are inserted at the start of the element.\n *\n * If undefined, styles will be added to the document head for Studio components\n * rendered in the main document fragment, or to Studio wrapper element\n * for other Studio components (e.g. those rendered in a shadow DOM or detached from the\n * document).\n *\n * @initial\n */\n @Input() public themeStyleContainer: (HTMLElement | (() => HTMLElement | void)) | undefined = undefined;\n /** Allows overriding what `document` is used.\n * Use this when you want Studio to use a different `document` than the one available on the global scope.\n * This can happen if docking out components (something which Electron supports).\n */\n @Input() public getDocument: (() => Document) | undefined = undefined;\n /** Disables touch support (but does not remove the browser's efforts to simulate mouse events on touch).\n * @default false\n * @initial\n */\n @Input({ transform: booleanAttribute }) public suppressTouch: boolean | undefined = undefined;\n /** A map of key->value pairs for localising text within Studio.\n * @initial\n */\n @Input() public localeText: AgStudioLocaleText | undefined = undefined;\n /** A callback for localising text within Studio.\n * @initial\n */\n @Input() public getLocaleText: ((params: AgStudioGetLocaleTextParams) => string) | undefined = undefined;\n /** Provide a custom `studioId` for this instance of Studio. Value will be set on the root DOM node using the attribute `studio-id` as well as being accessible via the `api.getStudioId()` method.\n * @initial\n */\n @Input() public studioId: string | undefined = undefined;\n /** Provides a context object that is provided to different callbacks Studio uses. Used for passing additional information to the callbacks used by your application.\n * @initial\n */\n @Input() public context: any = undefined;\n /** Initial state for Studio. Only read once on initialization. Can be used in conjunction with `api.getState()` to save and restore Studio state.\n * @initial\n */\n @Input() public initialState: AgReportState<TRegistry> | undefined = undefined;\n /** Defines the data sources used by Studio.\n *\n * If updated after initially being set, only changes to synchronous data will be processed.\n * Any other changes will be ignored (e.g. adding/removing data sources, updating fields, etc.)\n */\n @Input() public data: AgDataSourcesDefinition | AgDataEngine | undefined = undefined;\n /** Which mode Studio is in.\n * @default 'view'\n */\n @Input() public mode: AgStudioMode | undefined = undefined;\n /** Default layout styling.\n */\n @Input() public layout: Partial<AgPageLayoutState> | undefined = undefined;\n /** AI Assistant configuration.\n *\n * NOTE: The **AI Assistant** is an experimental feature. Behaviour will be\n * slightly different depending on the LLM being used, and results can vary across queries.\n *\n * @initial\n */\n @Input() public ai: AgAiAssistant | undefined = undefined;\n /** Data-layer configuration. Controls behaviours such as export row limits.\n */\n @Input() public dataOptions: AgDataOptions | undefined = undefined;\n /** @deprecated v1.1 Use `widgets` to customise the widget configurations and available widgets,\n * and `page` to customise the page setup form.\n *\n * Overrides for the layout and widget configs.\n */\n @Input() public overrides: AgStudioOverrides | undefined = undefined;\n /** Configure which panels are displayed and on which side.\n */\n @Input() public panels: AgPanelConfig | undefined = undefined;\n /** Configure page (e.g. page setup form in page tab of edit panel).\n */\n @Input() public page: (AgPageConfig | ((config: AgPageConfig) => AgPageConfig)) | undefined = undefined;\n @Input() public widgets:\n | (AgWidgetsConfig<TRegistry> | ((widgets: AgWidgetsConfig<TRegistry>) => AgWidgetsConfig<TRegistry>))\n | undefined = undefined;\n /** Custom components (e.g. custom widget components) keyed by ID.\n * Used to share components which can then be referenced directly by key in the definitions.\n */\n @Input() public components: TRegistry['components'] | undefined = undefined;\n\n /** State has been updated.\n */\n @Output() public stateUpdated: EventEmitter<AgStudioStateUpdatedEvent> =\n new EventEmitter<AgStudioStateUpdatedEvent>();\n /** The API has been initialised and is ready for most calls. The data engine has not been initialised yet, and the UI is not ready.\n */\n @Output() public apiReady: EventEmitter<AgStudioApiReadyEvent> = new EventEmitter<AgStudioApiReadyEvent>();\n /** The data engine has been initialised, and the UI has been created, but may not be fully rendered yet.\n */\n @Output() public studioReady: EventEmitter<AgStudioReadyEvent> = new EventEmitter<AgStudioReadyEvent>();\n /** An error has occurred within Studio.\n */\n @Output() public errorRaised: EventEmitter<AgStudioErrorRaisedEvent> = new EventEmitter<AgStudioErrorRaisedEvent>();\n\n // @END@\n}\n\nconst booleanMixedStudioProperties = new Set<string>(_BOOLEAN_MIXED_STUDIO_PROPERTIES);\n/**\n * Used to support the user setting combined boolean and string / object properties\n * as plain HTML attributes and us correctly mapping that to true.\n * For example cellSection can be boolean or an object\n */\nfunction getValueOrCoercedValue(key: string, valueToUse: any): any {\n if (booleanMixedStudioProperties.has(key)) {\n // Handle plain HTML boolean attributes and convert them to boolean values\n // Also handle the false string case to match Angular boolean attributes\n return valueToUse === '' ? true : valueToUse === 'false' ? false : valueToUse;\n }\n return valueToUse;\n}\n","import { NgModule } from '@angular/core';\n\nimport { AgStudio } from './ag-studio.component';\n\n@NgModule({\n imports: [AgStudio],\n exports: [AgStudio],\n})\nexport class AgStudioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.AngularFrameworkOverrides","i2.AngularFrameworkComponentWrapper"],"mappings":";;;;;AAUA;AACA;AACA;MAKa,oBAAoB,CAAA;AAJjC,IAAA,WAAA,GAAA;AAKW,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,IAAA;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AAQ,CAAC;oBACnB,OAAO,EAAE,CAAC,QAAQ,CAAC;AACtB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ag-studio-angular.mjs","sources":["../../../projects/ag-studio-angular/src/lib/angularFrameworkComponentWrapper.ts","../../../projects/ag-studio-angular/src/lib/angularFrameworkOverrides.ts","../../../projects/ag-studio-angular/src/lib/ag-studio.component.ts","../../../projects/ag-studio-angular/src/lib/ag-studio.module.ts","../../../projects/ag-studio-angular/src/ag-studio-angular.ts"],"sourcesContent":["import type { ComponentRef } from '@angular/core';\nimport { Component, Injectable, ViewContainerRef, inject } from '@angular/core';\nimport { _removeFromParent } from 'ag-stack';\nimport type { _FrameworkComponentWrapper, _WrappableInterface } from 'ag-studio';\nimport { _BaseComponentWrapper } from 'ag-studio';\n\nimport type { AngularFrameworkOverrides } from './angularFrameworkOverrides';\nimport type { AgCustomComponent } from './interfaces';\n\n// To speed up the removal of custom components we create a number of shards to contain them.\n// Removing a single component calls a function within Angular called removeFromArray.\n// This is a lot faster if the array is smaller.\n@Component({\n selector: 'ag-component-container',\n template: '',\n standalone: false,\n})\nexport class AgComponentContainer {\n public vcr = inject(ViewContainerRef);\n}\nconst NUM_SHARDS = 16;\nlet shardIdx = 0;\n\nfunction createComponentContainers(vcr: ViewContainerRef): Map<number, ComponentRef<AgComponentContainer>> {\n const containerMap = new Map<number, ComponentRef<AgComponentContainer>>();\n for (let i = 0; i < NUM_SHARDS; i++) {\n const container = vcr.createComponent(AgComponentContainer);\n containerMap.set(i, container);\n _removeFromParent(container.location.nativeElement);\n }\n return containerMap;\n}\n\n@Injectable()\nexport class AngularFrameworkComponentWrapper\n extends _BaseComponentWrapper<_WrappableInterface>\n implements _FrameworkComponentWrapper\n{\n private viewContainerRef: ViewContainerRef;\n private frameworkOverrides: AngularFrameworkOverrides;\n private compShards: Map<number, ComponentRef<AgComponentContainer>>;\n\n setViewContainerRef(viewContainerRef: ViewContainerRef, angularFrameworkOverrides: AngularFrameworkOverrides) {\n this.viewContainerRef = viewContainerRef;\n this.frameworkOverrides = angularFrameworkOverrides;\n }\n\n protected createWrapper(OriginalConstructor: { new (): any }): _WrappableInterface {\n this.compShards ??= createComponentContainers(this.viewContainerRef);\n return new DynamicAgNg2Component(this.frameworkOverrides, this, OriginalConstructor);\n }\n\n createComponent<T>(componentType: { new (...args: any[]): T }): ComponentRef<T> {\n shardIdx = (shardIdx + 1) % NUM_SHARDS;\n const container = this.compShards.get(shardIdx)!;\n return container.instance.vcr.createComponent(componentType);\n }\n}\n\nclass DynamicAgNg2Component<P> implements _WrappableInterface {\n private _eGui: HTMLElement;\n private _componentRef: ComponentRef<AgCustomComponent<P>>;\n private _frameworkComponentInstance: any; // the user's component - for accessing methods they create\n\n constructor(\n private frameworkOverrides: AngularFrameworkOverrides,\n private frameworkCompWrapper: AngularFrameworkComponentWrapper,\n private OriginalConstructor: { new (): any }\n ) {}\n\n init(params: P): Promise<any> {\n return new Promise((resolve) => {\n this.frameworkOverrides.runInsideAngular(() => {\n this._init(params).then((result) => {\n this._componentRef.changeDetectorRef.detectChanges();\n resolve(result);\n });\n });\n });\n }\n\n private async _init(params: P): Promise<any> {\n this._componentRef = this.frameworkCompWrapper.createComponent(this.OriginalConstructor);\n const instance = this._componentRef.instance;\n this._frameworkComponentInstance = instance;\n this._eGui = this._componentRef.location.nativeElement;\n // Angular appends the component to the DOM, so remove it\n _removeFromParent(this._eGui);\n\n return instance.agInit?.(params);\n }\n\n async refresh(params: P): Promise<any> {\n return this.frameworkOverrides.runInsideAngular(() => this._frameworkComponentInstance.refresh?.(params));\n }\n\n getGui(): HTMLElement {\n return this._eGui;\n }\n\n /** `getGui()` returns the `ng-component` element. This returns the actual root element. */\n getRootElement(): HTMLElement {\n return this._eGui.firstChild as HTMLElement;\n }\n\n destroy(): void {\n if (typeof this._frameworkComponentInstance?.destroy === 'function') {\n this._frameworkComponentInstance.destroy();\n }\n this._componentRef?.destroy();\n }\n\n getFrameworkComponentInstance(): any {\n return this._frameworkComponentInstance;\n }\n\n hasMethod(name: string): boolean {\n return this._frameworkComponentInstance[name] != null;\n }\n\n callMethod(name: string, args: IArguments): any {\n return this.frameworkOverrides.runInsideAngular(() => this._frameworkComponentInstance[name](...args));\n }\n\n addMethod(name: string, callback: (...args: any[]) => any): void {\n (this as any)[name] = callback;\n }\n}\n","import { Injectable, NgZone } from '@angular/core';\nimport type { FrameworkOverridesIncomingSource } from 'ag-stack';\nimport { _VanillaFrameworkOverrides } from 'ag-studio';\n\n@Injectable()\nexport class AngularFrameworkOverrides extends _VanillaFrameworkOverrides {\n override readonly batchFrameworkComps: boolean = true;\n\n // Flag used to control Zone behaviour when running tests as many test features rely on Zone.\n private readonly isRunningWithinTestZone: boolean = false;\n\n private readonly runOutside: <T>(callback: () => T, source?: FrameworkOverridesIncomingSource) => T;\n\n constructor(private readonly _ngZone: NgZone) {\n super('angular');\n\n this.isRunningWithinTestZone =\n (globalThis as any)?.AG_STUDIO_UNDER_TEST ?? !!(globalThis as any)?.Zone?.AsyncTestZoneSpec;\n\n if (!this._ngZone) {\n this.runOutside = (callback) => callback();\n } else if (this.isRunningWithinTestZone) {\n this.runOutside = (callback, source) => {\n if (source === 'resize-observer' || source === 'popupPositioning') {\n // ensure resize observer callbacks are run outside of Angular even under test due to Jest not supporting ResizeObserver\n // which means it just loops continuously with a setTimeout with no way to flush the queue or have fixture.whenStable() resolve.\n return this._ngZone.runOutsideAngular(callback);\n }\n // When under test run inside Angular so that tests can use fixture.whenStable() to wait for async operations to complete.\n return callback();\n };\n } else {\n this.runOutside = (callback) => this._ngZone.runOutsideAngular(callback);\n }\n }\n\n // Make all events run outside Angular as they often trigger the setup of event listeners\n // By having the event listeners outside Angular we can avoid triggering change detection\n // This also means that if a user calls an AG Studio API method from within their component\n // the internal side effects will not trigger change detection. Without this the events would\n // run inside Angular and trigger change detection as the source of the event was within the angular zone.\n override wrapIncoming: <T>(callback: () => T, source?: FrameworkOverridesIncomingSource) => T = (\n callback,\n source\n ) => this.runOutside(callback, source);\n\n /**\n * The shouldWrapOutgoing property is used to determine if events should be run outside of Angular or not.\n * If an event handler is registered outside of Angular then we should not wrap the event handler\n * with runInsideAngular() as the user may not have wanted this.\n * This is also used to not wrap internal event listeners that are registered with RowNodes and Columns.\n */\n get shouldWrapOutgoing() {\n return this._ngZone && NgZone.isInAngularZone();\n }\n\n /**\n * Make sure that any code that is executed outside of AG Studio is running within the Angular zone.\n * This means users can update templates and use binding without having to do anything extra.\n */\n override wrapOutgoing: <T>(callback: () => T) => T = (callback) => this.runInsideAngular(callback);\n\n override isFrameworkComponent(comp: any): boolean {\n if (!comp) {\n return false;\n }\n const prototype = comp.prototype;\n return prototype && 'agInit' in prototype;\n }\n\n runInsideAngular<T>(callback: () => T): T {\n if (!this._ngZone || NgZone.isInAngularZone()) {\n return callback();\n }\n\n // Check for _ngZone existence as it is not present when Zoneless\n return this._ngZone.run(callback);\n }\n\n runOutsideAngular<T>(callback: () => T, source?: FrameworkOverridesIncomingSource): T {\n return this.runOutside(callback, source);\n }\n}\n","// False positive lint error, ElementRef and co can't be type imports\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n ViewContainerRef,\n ViewEncapsulation,\n booleanAttribute,\n} from '@angular/core';\nimport type { AgStudioApi, AgStudioModule, AgStudioProperties, _StudioParams } from 'ag-studio';\nimport {\n _BOOLEAN_MIXED_STUDIO_PROPERTIES,\n _combineAttributesAndStudioProperties,\n _createStudio,\n _processPropertyChanges,\n} from 'ag-studio';\n// @START_IMPORTS@\nimport type {\n AgAiAssistant,\n AgDataEngine,\n AgDataOptions,\n AgDataSourcesDefinition,\n AgDefaultRegistry,\n AgPageConfig,\n AgPageLayoutState,\n AgPanelConfig,\n AgReportState,\n AgStudioApiReadyEvent,\n AgStudioErrorRaisedEvent,\n AgStudioGetLocaleTextParams,\n AgStudioLocaleText,\n AgStudioMode,\n AgStudioReadyEvent,\n AgStudioStateUpdatedEvent,\n AgStudioTheme,\n AgWidgetsConfig,\n} from 'ag-studio';\n\n// @END_IMPORTS@\n\nimport { AngularFrameworkComponentWrapper } from './angularFrameworkComponentWrapper';\nimport { AngularFrameworkOverrides } from './angularFrameworkOverrides';\nimport type { AgRegistry } from './interfaces';\n\n@Component({\n selector: 'ag-studio',\n standalone: true,\n template: '',\n providers: [AngularFrameworkOverrides, AngularFrameworkComponentWrapper],\n // tell angular we don't want view encapsulation, we don't want a shadow root\n encapsulation: ViewEncapsulation.None,\n})\nexport class AgStudio<TRegistry extends AgRegistry = AgDefaultRegistry> implements AfterViewInit, OnChanges, OnDestroy {\n // not intended for user to interact with. so putting _ in so if user gets reference\n // to this object, they kind'a know it's not part of the agreed interface\n private readonly _nativeElement: any;\n private _initialised = false;\n private _destroyed = false;\n\n // in order to ensure firing of apiReady is deterministic\n private _holdEvents = true;\n private _resolveFullyReady: () => void;\n private readonly _fullyReady: Promise<void> = new Promise((resolve) => {\n this._resolveFullyReady = resolve;\n });\n\n /** Studio Api available after onApiReady event has fired. */\n api: AgStudioApi<TRegistry>;\n\n constructor(\n elementDef: ElementRef,\n private readonly _viewContainerRef: ViewContainerRef,\n private readonly _angularFrameworkOverrides: AngularFrameworkOverrides,\n private readonly _frameworkCompWrapper: AngularFrameworkComponentWrapper\n ) {\n this._nativeElement = elementDef.nativeElement;\n // NOSONAR\n this._fullyReady.then(() => {\n // Register the status flag reset before any events are fired\n // so that we can swap to synchronous event firing as soon as the studio is ready\n this._holdEvents = false;\n });\n }\n\n ngAfterViewInit(): void {\n // Run the setup outside of angular so all the event handlers that are created do not trigger change detection\n this._angularFrameworkOverrides.runOutsideAngular(() => {\n this._frameworkCompWrapper.setViewContainerRef(this._viewContainerRef, this._angularFrameworkOverrides);\n\n // Get all the inputs that are valid AgStudioProperties\n const studioPropertiesKeys = Object.keys(this).filter(\n (key) =>\n !(\n key.startsWith('_') ||\n key == 'studioProperties' ||\n key == 'modules' ||\n this[key as keyof AgStudio] instanceof EventEmitter\n )\n );\n\n const coercedStudioProperties = {} as AgStudioProperties<TRegistry>;\n for (const key of studioPropertiesKeys) {\n const valueToUse = getValueOrCoercedValue(key, this[key as keyof AgStudio]);\n coercedStudioProperties[key as keyof AgStudioProperties] = valueToUse;\n }\n\n const mergedStudioProperties = _combineAttributesAndStudioProperties(\n this.studioProperties,\n coercedStudioProperties,\n studioPropertiesKeys\n );\n\n const studioParams: _StudioParams = {\n globalListener: this.globalListener.bind(this),\n frameworkOverrides: this._angularFrameworkOverrides,\n setThemeOnRootDiv: true,\n modules: this.modules,\n providedBeanInstances: {\n frameworkCompWrapper: this._frameworkCompWrapper,\n },\n };\n\n const api = _createStudio(this._nativeElement, mergedStudioProperties, studioParams);\n if (api) {\n this.api = api;\n }\n\n this._initialised = true;\n\n // sometimes, especially in large client apps apiReady can fire before ngAfterViewInit\n // this ties these together so that apiReady will always fire after agStudio's ngAfterViewInit\n // the actual containing component's ngAfterViewInit will fire just after agStudio's\n this._resolveFullyReady();\n });\n }\n\n public ngOnChanges(changes: any): void {\n if (this._initialised) {\n // Run the changes outside of angular so any event handlers that are created do not trigger change detection\n this._angularFrameworkOverrides.runOutsideAngular(() => {\n const studioProperties: AgStudioProperties<TRegistry> = {};\n for (const key of Object.keys(changes)) {\n const value = changes[key];\n studioProperties[key as keyof AgStudioProperties] = value.currentValue;\n }\n _processPropertyChanges(studioProperties, this.api);\n });\n }\n }\n\n public ngOnDestroy(): void {\n if (this._initialised) {\n // need to do this before the destroy, so we know not to emit any events\n // while tearing down the studio.\n this._destroyed = true;\n // could be null if studio failed to initialise\n this.api?.destroy();\n }\n }\n\n // we'll emit the emit if a user is listening for a given event either on the component via normal angular binding\n // or via studioProperties\n protected isEmitterUsed(eventType: string): boolean {\n const emitter = <EventEmitter<any>>(<any>this)[eventType];\n // For RxJs compatibility we need to check for observed v7+ or observers v6\n const emitterAny = emitter as any;\n const hasEmitter = emitterAny?.observed ?? emitterAny?.observers?.length > 0;\n\n // apiReady => onApiReady\n const asEventName = `on${eventType.charAt(0).toUpperCase()}${eventType.substring(1)}`;\n const hasStudioPropertyListener = !!this.studioProperties && !!(this.studioProperties as any)[asEventName];\n\n return hasEmitter || hasStudioPropertyListener;\n }\n\n private globalListener(eventType: string, event: any): void {\n // if we are tearing down, don't emit angular events, as this causes\n // problems with the angular router\n if (this._destroyed) {\n return;\n }\n\n // generically look up the eventType\n const emitter = <EventEmitter<any>>(<any>this)[eventType];\n if (emitter && this.isEmitterUsed(eventType)) {\n // Make sure we emit within the angular zone, so change detection works properly\n const fireEmitter = () => this._angularFrameworkOverrides.runInsideAngular(() => emitter.emit(event));\n\n if (this._holdEvents) {\n // if the user is listening to events, wait for ngAfterViewInit to fire first, then emit the studio events\n this._fullyReady.then(() => fireEmitter());\n } else {\n fireEmitter();\n }\n }\n }\n\n /** Provided an initial studioProperties configuration to the component. If a property is specified in both studioProperties and via component binding the component binding takes precedence. */\n @Input() public studioProperties: AgStudioProperties<TRegistry> | undefined;\n /**\n * Used to register AG Studio Modules directly with this instance of Studio.\n */\n @Input() public modules: AgStudioModule[] | undefined;\n\n // @START@\n /** Change this value to set the tabIndex order of Studio within your application.\n * @default 0\n * @initial\n */\n @Input() public tabIndex: number | undefined = undefined;\n /** Set to `true` to operate Studio in RTL (Right to Left) mode.\n * @default false\n * @initial\n */\n @Input({ transform: booleanAttribute }) public enableRtl: boolean | undefined = undefined;\n /** DOM element to use as the popup parent for Studio popups (context menus, etc.).\n */\n @Input() public popupParent: HTMLElement | null | undefined = undefined;\n /** Theme to apply to Studio.\n *\n * @default studioTheme\n */\n @Input() public theme: AgStudioTheme | undefined = undefined;\n /** If your theme uses a font that is available on Google Fonts, pass true to load it from Google's CDN.\n */\n @Input({ transform: booleanAttribute }) public loadThemeGoogleFonts: boolean | undefined = undefined;\n /** The CSS layer that this theme should be rendered onto. When specified,\n * Studio CSS will be wrapped in a `@layer ${themeCssLayer} { ... }` block.\n *\n * NOTE: when specifying `themeCssLayer` we recommend setting\n * `themeStyleContainer` to `document.body` to ensure that Studio CSS\n * comes after your application CSS, allowing your application to set the\n * order of layers.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@layer\n */\n @Input() public themeCssLayer: string | undefined = undefined;\n /** The nonce attribute to set on style elements added to the document by\n * themes. If \"foo\" is passed to this property, Studio can use the Content\n * Security Policy `style-src 'nonce-foo'`, instead of the less secure\n * `style-src 'unsafe-inline'`.\n *\n * Note: CSP nonces are global to a page, where a page has multiple Studio components,\n * every one must have the same styleNonce set.\n */\n @Input() public styleNonce: string | undefined = undefined;\n /** An element to insert style elements into when injecting styles into the\n * Studio. Styles are inserted at the start of the element.\n *\n * If undefined, styles will be added to the document head for Studio components\n * rendered in the main document fragment, or to Studio wrapper element\n * for other Studio components (e.g. those rendered in a shadow DOM or detached from the\n * document).\n *\n * @initial\n */\n @Input() public themeStyleContainer: (HTMLElement | (() => HTMLElement | void)) | undefined = undefined;\n /** Allows overriding what `document` is used.\n * Use this when you want Studio to use a different `document` than the one available on the global scope.\n * This can happen if docking out components (something which Electron supports).\n */\n @Input() public getDocument: (() => Document) | undefined = undefined;\n /** Disables touch support (but does not remove the browser's efforts to simulate mouse events on touch).\n * @default false\n * @initial\n */\n @Input({ transform: booleanAttribute }) public suppressTouch: boolean | undefined = undefined;\n /** A map of key->value pairs for localising text within Studio.\n * @initial\n */\n @Input() public localeText: AgStudioLocaleText | undefined = undefined;\n /** A callback for localising text within Studio.\n * @initial\n */\n @Input() public getLocaleText: ((params: AgStudioGetLocaleTextParams) => string) | undefined = undefined;\n /** Provide a custom `studioId` for this instance of Studio. Value will be set on the root DOM node using the attribute `studio-id` as well as being accessible via the `api.getStudioId()` method.\n * @initial\n */\n @Input() public studioId: string | undefined = undefined;\n /** Provides a context object that is provided to different callbacks Studio uses. Used for passing additional information to the callbacks used by your application.\n * @initial\n */\n @Input() public context: any = undefined;\n /** Initial state for Studio. Only read once on initialization. Can be used in conjunction with `api.getState()` to save and restore Studio state.\n * @initial\n */\n @Input() public initialState: AgReportState<TRegistry> | undefined = undefined;\n /** Defines the data sources used by Studio.\n *\n * If updated after initially being set, only changes to synchronous data will be processed.\n * Any other changes will be ignored (e.g. adding/removing data sources, updating fields, etc.)\n */\n @Input() public data: AgDataSourcesDefinition<TRegistry> | AgDataEngine | undefined = undefined;\n /** Which mode Studio is in.\n * @default 'view'\n */\n @Input() public mode: AgStudioMode | undefined = undefined;\n /** Default layout styling.\n */\n @Input() public layout: Partial<AgPageLayoutState> | undefined = undefined;\n /** AI Assistant configuration.\n *\n * NOTE: The **AI Assistant** is an experimental feature. Behaviour will be\n * slightly different depending on the LLM being used, and results can vary across queries.\n *\n * @initial\n */\n @Input() public ai: AgAiAssistant | undefined = undefined;\n /** Data-layer configuration. Controls behaviours such as export row limits.\n */\n @Input() public dataOptions: AgDataOptions | undefined = undefined;\n /** Configure which panels are displayed and on which side.\n */\n @Input() public panels: AgPanelConfig | undefined = undefined;\n /** Configure page (e.g. page setup form in page tab of edit panel).\n */\n @Input() public page: (AgPageConfig | ((config: AgPageConfig) => AgPageConfig)) | undefined = undefined;\n @Input() public widgets:\n | (AgWidgetsConfig<TRegistry> | ((widgets: AgWidgetsConfig<AgDefaultRegistry>) => AgWidgetsConfig<TRegistry>))\n | undefined = undefined;\n /** Custom components (e.g. custom widget components) keyed by ID.\n * Used to share components which can then be referenced directly by key in the definitions.\n */\n @Input() public components: TRegistry['components'] | undefined = undefined;\n\n /** State has been updated.\n */\n @Output() public stateUpdated: EventEmitter<AgStudioStateUpdatedEvent> =\n new EventEmitter<AgStudioStateUpdatedEvent>();\n /** The API has been initialised and is ready for most calls. The data engine has not been initialised yet, and the UI is not ready.\n */\n @Output() public apiReady: EventEmitter<AgStudioApiReadyEvent> = new EventEmitter<AgStudioApiReadyEvent>();\n /** The data engine has been initialised, and the UI has been created, but may not be fully rendered yet.\n */\n @Output() public studioReady: EventEmitter<AgStudioReadyEvent> = new EventEmitter<AgStudioReadyEvent>();\n /** An error has occurred within Studio.\n */\n @Output() public errorRaised: EventEmitter<AgStudioErrorRaisedEvent> = new EventEmitter<AgStudioErrorRaisedEvent>();\n\n // @END@\n}\n\nconst booleanMixedStudioProperties = new Set<string>(_BOOLEAN_MIXED_STUDIO_PROPERTIES);\n/**\n * Used to support the user setting combined boolean and string / object properties\n * as plain HTML attributes and us correctly mapping that to true.\n * For example cellSection can be boolean or an object\n */\nfunction getValueOrCoercedValue(key: string, valueToUse: any): any {\n if (booleanMixedStudioProperties.has(key)) {\n // Handle plain HTML boolean attributes and convert them to boolean values\n // Also handle the false string case to match Angular boolean attributes\n return valueToUse === '' ? true : valueToUse === 'false' ? false : valueToUse;\n }\n return valueToUse;\n}\n","import { NgModule } from '@angular/core';\n\nimport { AgStudio } from './ag-studio.component';\n\n@NgModule({\n imports: [AgStudio],\n exports: [AgStudio],\n})\nexport class AgStudioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.AngularFrameworkOverrides","i2.AngularFrameworkComponentWrapper"],"mappings":";;;;;AASA;AACA;AACA;MAMa,oBAAoB,CAAA;AALjC,IAAA,WAAA,GAAA;AAMW,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,IAAA;+GAFY,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,oBAAoB,mFAHnB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;4FAGH,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,QAAQ,EAAE,EAAE;AACZ,oB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.d.ts
CHANGED
|
@@ -1,5 +1,248 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { NgZone, ViewContainerRef, ComponentRef, Type, AfterViewInit, OnChanges, OnDestroy, ElementRef, EventEmitter } from '@angular/core';
|
|
3
|
+
import { _VanillaFrameworkOverrides, _BaseComponentWrapper, _WrappableInterface, _FrameworkComponentWrapper, AgMaybePromise, AgBaseRegistry, AgBaseWidgetDefinition, AgWidgetRegistry, AgDefaultWidgetType, AgTypeScriptComponent, AgWidgetParams, AgWidgetData, AgWidgetDataFormat, AgDefaultRegistry, AgStudioApi, AgStudioProperties, AgStudioModule as AgStudioModule$1, AgStudioTheme, AgStudioLocaleText, AgStudioGetLocaleTextParams, AgReportState, AgDataSourcesDefinition, AgDataEngine, AgStudioMode, AgPageLayoutState, AgAiAssistant, AgDataOptions, AgPanelConfig, AgPageConfig, AgWidgetsConfig, AgStudioStateUpdatedEvent, AgStudioApiReadyEvent, AgStudioReadyEvent, AgStudioErrorRaisedEvent } from 'ag-studio';
|
|
4
|
+
import { FrameworkOverridesIncomingSource } from 'ag-stack';
|
|
5
|
+
|
|
6
|
+
declare class AngularFrameworkOverrides extends _VanillaFrameworkOverrides {
|
|
7
|
+
private readonly _ngZone;
|
|
8
|
+
readonly batchFrameworkComps: boolean;
|
|
9
|
+
private readonly isRunningWithinTestZone;
|
|
10
|
+
private readonly runOutside;
|
|
11
|
+
constructor(_ngZone: NgZone);
|
|
12
|
+
wrapIncoming: <T>(callback: () => T, source?: FrameworkOverridesIncomingSource) => T;
|
|
13
|
+
/**
|
|
14
|
+
* The shouldWrapOutgoing property is used to determine if events should be run outside of Angular or not.
|
|
15
|
+
* If an event handler is registered outside of Angular then we should not wrap the event handler
|
|
16
|
+
* with runInsideAngular() as the user may not have wanted this.
|
|
17
|
+
* This is also used to not wrap internal event listeners that are registered with RowNodes and Columns.
|
|
18
|
+
*/
|
|
19
|
+
get shouldWrapOutgoing(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Make sure that any code that is executed outside of AG Studio is running within the Angular zone.
|
|
22
|
+
* This means users can update templates and use binding without having to do anything extra.
|
|
23
|
+
*/
|
|
24
|
+
wrapOutgoing: <T>(callback: () => T) => T;
|
|
25
|
+
isFrameworkComponent(comp: any): boolean;
|
|
26
|
+
runInsideAngular<T>(callback: () => T): T;
|
|
27
|
+
runOutsideAngular<T>(callback: () => T, source?: FrameworkOverridesIncomingSource): T;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFrameworkOverrides, never>;
|
|
29
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AngularFrameworkOverrides>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare class AgComponentContainer {
|
|
33
|
+
vcr: ViewContainerRef;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AgComponentContainer, never>;
|
|
35
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AgComponentContainer, "ag-component-container", never, {}, {}, never, never, false, never>;
|
|
36
|
+
}
|
|
37
|
+
declare class AngularFrameworkComponentWrapper extends _BaseComponentWrapper<_WrappableInterface> implements _FrameworkComponentWrapper {
|
|
38
|
+
private viewContainerRef;
|
|
39
|
+
private frameworkOverrides;
|
|
40
|
+
private compShards;
|
|
41
|
+
setViewContainerRef(viewContainerRef: ViewContainerRef, angularFrameworkOverrides: AngularFrameworkOverrides): void;
|
|
42
|
+
protected createWrapper(OriginalConstructor: {
|
|
43
|
+
new (): any;
|
|
44
|
+
}): _WrappableInterface;
|
|
45
|
+
createComponent<T>(componentType: {
|
|
46
|
+
new (...args: any[]): T;
|
|
47
|
+
}): ComponentRef<T>;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFrameworkComponentWrapper, never>;
|
|
49
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AngularFrameworkComponentWrapper>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface AgCustomComponent<TParams, TReturn = void> {
|
|
53
|
+
/** Called once on initialisation with params for rendering this component. */
|
|
54
|
+
agInit(params: TParams): AgMaybePromise<TReturn>;
|
|
55
|
+
/** Called for every subsequent params update. */
|
|
56
|
+
refresh?(params: TParams): AgMaybePromise<TReturn>;
|
|
57
|
+
}
|
|
58
|
+
interface AgWidgetDefinition<TWidgetType extends string = string, TIn extends AgWidgetData<unknown, AgWidgetDataFormat<unknown>> = any, TOut extends AgWidgetData<unknown, AgWidgetDataFormat<unknown>> = TIn, TOptions = unknown> extends AgBaseWidgetDefinition<TWidgetType, TIn, TOut, TOptions> {
|
|
59
|
+
/**
|
|
60
|
+
* Custom component. Either:
|
|
61
|
+
* - A `string` that matches a custom component in the studio `components` property
|
|
62
|
+
* - A custom Angular component class
|
|
63
|
+
* - A custom TypeScript component (no Angular; working directly with the DOM)
|
|
64
|
+
*/
|
|
65
|
+
comp: string | Type<AgCustomComponent<AgWidgetParams<TOut>>> | (new () => AgTypeScriptComponent<AgWidgetParams<TOut>>);
|
|
66
|
+
}
|
|
67
|
+
type StringCompWidgetType<TDef extends AgBaseWidgetDefinition> = TDef['comp'] extends string ? TDef : never;
|
|
68
|
+
type ExtractStateFromDef<TDef> = TDef extends AgWidgetDefinition<any, any, infer TState> ? TState : never;
|
|
69
|
+
type MatchingDef<TDef, TWidgetType> = TDef extends {
|
|
70
|
+
id: TWidgetType;
|
|
71
|
+
} ? TDef : never;
|
|
72
|
+
type WidgetCustomComp<TParams> = Type<AgCustomComponent<TParams>> | (new () => AgTypeScriptComponent<TParams>);
|
|
73
|
+
type AgCustomComponentDefs<TRegistry extends AgBaseRegistry> = {
|
|
74
|
+
[K in Exclude<StringCompWidgetType<AgWidgetRegistry<TRegistry>>['comp'], AgDefaultWidgetType>]?: WidgetCustomComp<AgWidgetParams<ExtractStateFromDef<MatchingDef<AgWidgetRegistry<TRegistry>, K>>>>;
|
|
75
|
+
};
|
|
76
|
+
interface AgRegistry extends AgBaseRegistry {
|
|
77
|
+
widgets: readonly AgWidgetDefinition[];
|
|
78
|
+
components: AgCustomComponentDefs<this>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare class AgStudio<TRegistry extends AgRegistry = AgDefaultRegistry> implements AfterViewInit, OnChanges, OnDestroy {
|
|
82
|
+
private readonly _viewContainerRef;
|
|
83
|
+
private readonly _angularFrameworkOverrides;
|
|
84
|
+
private readonly _frameworkCompWrapper;
|
|
85
|
+
private readonly _nativeElement;
|
|
86
|
+
private _initialised;
|
|
87
|
+
private _destroyed;
|
|
88
|
+
private _holdEvents;
|
|
89
|
+
private _resolveFullyReady;
|
|
90
|
+
private readonly _fullyReady;
|
|
91
|
+
/** Studio Api available after onApiReady event has fired. */
|
|
92
|
+
api: AgStudioApi<TRegistry>;
|
|
93
|
+
constructor(elementDef: ElementRef, _viewContainerRef: ViewContainerRef, _angularFrameworkOverrides: AngularFrameworkOverrides, _frameworkCompWrapper: AngularFrameworkComponentWrapper);
|
|
94
|
+
ngAfterViewInit(): void;
|
|
95
|
+
ngOnChanges(changes: any): void;
|
|
96
|
+
ngOnDestroy(): void;
|
|
97
|
+
protected isEmitterUsed(eventType: string): boolean;
|
|
98
|
+
private globalListener;
|
|
99
|
+
/** Provided an initial studioProperties configuration to the component. If a property is specified in both studioProperties and via component binding the component binding takes precedence. */
|
|
100
|
+
studioProperties: AgStudioProperties<TRegistry> | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Used to register AG Studio Modules directly with this instance of Studio.
|
|
103
|
+
*/
|
|
104
|
+
modules: AgStudioModule$1[] | undefined;
|
|
105
|
+
/** Change this value to set the tabIndex order of Studio within your application.
|
|
106
|
+
* @default 0
|
|
107
|
+
* @initial
|
|
108
|
+
*/
|
|
109
|
+
tabIndex: number | undefined;
|
|
110
|
+
/** Set to `true` to operate Studio in RTL (Right to Left) mode.
|
|
111
|
+
* @default false
|
|
112
|
+
* @initial
|
|
113
|
+
*/
|
|
114
|
+
enableRtl: boolean | undefined;
|
|
115
|
+
/** DOM element to use as the popup parent for Studio popups (context menus, etc.).
|
|
116
|
+
*/
|
|
117
|
+
popupParent: HTMLElement | null | undefined;
|
|
118
|
+
/** Theme to apply to Studio.
|
|
119
|
+
*
|
|
120
|
+
* @default studioTheme
|
|
121
|
+
*/
|
|
122
|
+
theme: AgStudioTheme | undefined;
|
|
123
|
+
/** If your theme uses a font that is available on Google Fonts, pass true to load it from Google's CDN.
|
|
124
|
+
*/
|
|
125
|
+
loadThemeGoogleFonts: boolean | undefined;
|
|
126
|
+
/** The CSS layer that this theme should be rendered onto. When specified,
|
|
127
|
+
* Studio CSS will be wrapped in a `@layer ${themeCssLayer} { ... }` block.
|
|
128
|
+
*
|
|
129
|
+
* NOTE: when specifying `themeCssLayer` we recommend setting
|
|
130
|
+
* `themeStyleContainer` to `document.body` to ensure that Studio CSS
|
|
131
|
+
* comes after your application CSS, allowing your application to set the
|
|
132
|
+
* order of layers.
|
|
133
|
+
*
|
|
134
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/@layer
|
|
135
|
+
*/
|
|
136
|
+
themeCssLayer: string | undefined;
|
|
137
|
+
/** The nonce attribute to set on style elements added to the document by
|
|
138
|
+
* themes. If "foo" is passed to this property, Studio can use the Content
|
|
139
|
+
* Security Policy `style-src 'nonce-foo'`, instead of the less secure
|
|
140
|
+
* `style-src 'unsafe-inline'`.
|
|
141
|
+
*
|
|
142
|
+
* Note: CSP nonces are global to a page, where a page has multiple Studio components,
|
|
143
|
+
* every one must have the same styleNonce set.
|
|
144
|
+
*/
|
|
145
|
+
styleNonce: string | undefined;
|
|
146
|
+
/** An element to insert style elements into when injecting styles into the
|
|
147
|
+
* Studio. Styles are inserted at the start of the element.
|
|
148
|
+
*
|
|
149
|
+
* If undefined, styles will be added to the document head for Studio components
|
|
150
|
+
* rendered in the main document fragment, or to Studio wrapper element
|
|
151
|
+
* for other Studio components (e.g. those rendered in a shadow DOM or detached from the
|
|
152
|
+
* document).
|
|
153
|
+
*
|
|
154
|
+
* @initial
|
|
155
|
+
*/
|
|
156
|
+
themeStyleContainer: (HTMLElement | (() => HTMLElement | void)) | undefined;
|
|
157
|
+
/** Allows overriding what `document` is used.
|
|
158
|
+
* Use this when you want Studio to use a different `document` than the one available on the global scope.
|
|
159
|
+
* This can happen if docking out components (something which Electron supports).
|
|
160
|
+
*/
|
|
161
|
+
getDocument: (() => Document) | undefined;
|
|
162
|
+
/** Disables touch support (but does not remove the browser's efforts to simulate mouse events on touch).
|
|
163
|
+
* @default false
|
|
164
|
+
* @initial
|
|
165
|
+
*/
|
|
166
|
+
suppressTouch: boolean | undefined;
|
|
167
|
+
/** A map of key->value pairs for localising text within Studio.
|
|
168
|
+
* @initial
|
|
169
|
+
*/
|
|
170
|
+
localeText: AgStudioLocaleText | undefined;
|
|
171
|
+
/** A callback for localising text within Studio.
|
|
172
|
+
* @initial
|
|
173
|
+
*/
|
|
174
|
+
getLocaleText: ((params: AgStudioGetLocaleTextParams) => string) | undefined;
|
|
175
|
+
/** Provide a custom `studioId` for this instance of Studio. Value will be set on the root DOM node using the attribute `studio-id` as well as being accessible via the `api.getStudioId()` method.
|
|
176
|
+
* @initial
|
|
177
|
+
*/
|
|
178
|
+
studioId: string | undefined;
|
|
179
|
+
/** Provides a context object that is provided to different callbacks Studio uses. Used for passing additional information to the callbacks used by your application.
|
|
180
|
+
* @initial
|
|
181
|
+
*/
|
|
182
|
+
context: any;
|
|
183
|
+
/** Initial state for Studio. Only read once on initialization. Can be used in conjunction with `api.getState()` to save and restore Studio state.
|
|
184
|
+
* @initial
|
|
185
|
+
*/
|
|
186
|
+
initialState: AgReportState<TRegistry> | undefined;
|
|
187
|
+
/** Defines the data sources used by Studio.
|
|
188
|
+
*
|
|
189
|
+
* If updated after initially being set, only changes to synchronous data will be processed.
|
|
190
|
+
* Any other changes will be ignored (e.g. adding/removing data sources, updating fields, etc.)
|
|
191
|
+
*/
|
|
192
|
+
data: AgDataSourcesDefinition<TRegistry> | AgDataEngine | undefined;
|
|
193
|
+
/** Which mode Studio is in.
|
|
194
|
+
* @default 'view'
|
|
195
|
+
*/
|
|
196
|
+
mode: AgStudioMode | undefined;
|
|
197
|
+
/** Default layout styling.
|
|
198
|
+
*/
|
|
199
|
+
layout: Partial<AgPageLayoutState> | undefined;
|
|
200
|
+
/** AI Assistant configuration.
|
|
201
|
+
*
|
|
202
|
+
* NOTE: The **AI Assistant** is an experimental feature. Behaviour will be
|
|
203
|
+
* slightly different depending on the LLM being used, and results can vary across queries.
|
|
204
|
+
*
|
|
205
|
+
* @initial
|
|
206
|
+
*/
|
|
207
|
+
ai: AgAiAssistant | undefined;
|
|
208
|
+
/** Data-layer configuration. Controls behaviours such as export row limits.
|
|
209
|
+
*/
|
|
210
|
+
dataOptions: AgDataOptions | undefined;
|
|
211
|
+
/** Configure which panels are displayed and on which side.
|
|
212
|
+
*/
|
|
213
|
+
panels: AgPanelConfig | undefined;
|
|
214
|
+
/** Configure page (e.g. page setup form in page tab of edit panel).
|
|
215
|
+
*/
|
|
216
|
+
page: (AgPageConfig | ((config: AgPageConfig) => AgPageConfig)) | undefined;
|
|
217
|
+
widgets: (AgWidgetsConfig<TRegistry> | ((widgets: AgWidgetsConfig<AgDefaultRegistry>) => AgWidgetsConfig<TRegistry>)) | undefined;
|
|
218
|
+
/** Custom components (e.g. custom widget components) keyed by ID.
|
|
219
|
+
* Used to share components which can then be referenced directly by key in the definitions.
|
|
220
|
+
*/
|
|
221
|
+
components: TRegistry['components'] | undefined;
|
|
222
|
+
/** State has been updated.
|
|
223
|
+
*/
|
|
224
|
+
stateUpdated: EventEmitter<AgStudioStateUpdatedEvent>;
|
|
225
|
+
/** The API has been initialised and is ready for most calls. The data engine has not been initialised yet, and the UI is not ready.
|
|
226
|
+
*/
|
|
227
|
+
apiReady: EventEmitter<AgStudioApiReadyEvent>;
|
|
228
|
+
/** The data engine has been initialised, and the UI has been created, but may not be fully rendered yet.
|
|
229
|
+
*/
|
|
230
|
+
studioReady: EventEmitter<AgStudioReadyEvent>;
|
|
231
|
+
/** An error has occurred within Studio.
|
|
232
|
+
*/
|
|
233
|
+
errorRaised: EventEmitter<AgStudioErrorRaisedEvent>;
|
|
234
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AgStudio<any>, never>;
|
|
235
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AgStudio<any>, "ag-studio", never, { "studioProperties": { "alias": "studioProperties"; "required": false; }; "modules": { "alias": "modules"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "enableRtl": { "alias": "enableRtl"; "required": false; }; "popupParent": { "alias": "popupParent"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "loadThemeGoogleFonts": { "alias": "loadThemeGoogleFonts"; "required": false; }; "themeCssLayer": { "alias": "themeCssLayer"; "required": false; }; "styleNonce": { "alias": "styleNonce"; "required": false; }; "themeStyleContainer": { "alias": "themeStyleContainer"; "required": false; }; "getDocument": { "alias": "getDocument"; "required": false; }; "suppressTouch": { "alias": "suppressTouch"; "required": false; }; "localeText": { "alias": "localeText"; "required": false; }; "getLocaleText": { "alias": "getLocaleText"; "required": false; }; "studioId": { "alias": "studioId"; "required": false; }; "context": { "alias": "context"; "required": false; }; "initialState": { "alias": "initialState"; "required": false; }; "data": { "alias": "data"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "ai": { "alias": "ai"; "required": false; }; "dataOptions": { "alias": "dataOptions"; "required": false; }; "panels": { "alias": "panels"; "required": false; }; "page": { "alias": "page"; "required": false; }; "widgets": { "alias": "widgets"; "required": false; }; "components": { "alias": "components"; "required": false; }; }, { "stateUpdated": "stateUpdated"; "apiReady": "apiReady"; "studioReady": "studioReady"; "errorRaised": "errorRaised"; }, never, never, true, never>;
|
|
236
|
+
static ngAcceptInputType_enableRtl: unknown;
|
|
237
|
+
static ngAcceptInputType_loadThemeGoogleFonts: unknown;
|
|
238
|
+
static ngAcceptInputType_suppressTouch: unknown;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare class AgStudioModule {
|
|
242
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AgStudioModule, never>;
|
|
243
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AgStudioModule, never, [typeof AgStudio], [typeof AgStudio]>;
|
|
244
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AgStudioModule>;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export { AgComponentContainer, AgStudio, AgStudioModule, AngularFrameworkComponentWrapper, AngularFrameworkOverrides };
|
|
248
|
+
export type { AgCustomComponent, AgCustomComponentDefs, AgRegistry, AgWidgetDefinition };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ag-studio-angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "AG Studio Angular Component",
|
|
5
5
|
"license": "Commercial",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"@angular/core": ">= 18.0.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"ag-
|
|
11
|
+
"ag-stack": "~36.0.0",
|
|
12
|
+
"ag-studio": "2.0.1",
|
|
12
13
|
"tslib": "^2.3.0"
|
|
13
14
|
},
|
|
14
15
|
"bugs": {
|
|
@@ -23,8 +24,6 @@
|
|
|
23
24
|
},
|
|
24
25
|
".": {
|
|
25
26
|
"types": "./index.d.ts",
|
|
26
|
-
"esm2022": "./esm2022/ag-studio-angular.mjs",
|
|
27
|
-
"esm": "./esm2022/ag-studio-angular.mjs",
|
|
28
27
|
"default": "./fesm2022/ag-studio-angular.mjs"
|
|
29
28
|
}
|
|
30
29
|
},
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWctc3R1ZGlvLWFuZ3VsYXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9hZy1zdHVkaW8tYW5ndWxhci9zcmMvYWctc3R1ZGlvLWFuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|