intelica-library-components 1.1.160 → 1.1.162
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.
|
@@ -6164,10 +6164,28 @@ class Shared {
|
|
|
6164
6164
|
});
|
|
6165
6165
|
}
|
|
6166
6166
|
async embedDashboard(command, container, options) {
|
|
6167
|
-
container
|
|
6167
|
+
container.replaceChildren();
|
|
6168
6168
|
const embedUrl = await firstValueFrom(this.getEmbedUrl(command));
|
|
6169
6169
|
await this.createEmbedContext(embedUrl, container, options);
|
|
6170
6170
|
}
|
|
6171
|
+
async embedDashboardInteractive(command, container, options) {
|
|
6172
|
+
container.replaceChildren();
|
|
6173
|
+
const embedUrl = await firstValueFrom(this.getEmbedUrl({ ...command, parameters: undefined }));
|
|
6174
|
+
const embeddingContext = await createEmbeddingContext();
|
|
6175
|
+
const sdkParameters = command.parameters
|
|
6176
|
+
? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values }))
|
|
6177
|
+
: undefined;
|
|
6178
|
+
return await embeddingContext.embedDashboard({
|
|
6179
|
+
url: embedUrl,
|
|
6180
|
+
container,
|
|
6181
|
+
...(options?.height && { height: options.height }),
|
|
6182
|
+
...(options?.width && { width: options.width }),
|
|
6183
|
+
}, sdkParameters ? { parameters: sdkParameters } : undefined);
|
|
6184
|
+
}
|
|
6185
|
+
async setDashboardParameters(dashboard, parameters) {
|
|
6186
|
+
const sdkParameters = Object.entries(parameters).map(([Name, Values]) => ({ Name, Values }));
|
|
6187
|
+
await dashboard.setParameters(sdkParameters);
|
|
6188
|
+
}
|
|
6171
6189
|
async createEmbedVisualContext(embedUrl, container, options) {
|
|
6172
6190
|
const embeddingContext = await createEmbeddingContext();
|
|
6173
6191
|
await embeddingContext.embedVisual({
|
|
@@ -6252,6 +6270,75 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImpo
|
|
|
6252
6270
|
args: ['visualContainer']
|
|
6253
6271
|
}], dashboardIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: false }] }], parametersInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }], heightInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], isLoadingChange: [{ type: i0.Output, args: ["isLoadingChange"] }] } });
|
|
6254
6272
|
|
|
6273
|
+
class DashboardQsInteractiveComponent {
|
|
6274
|
+
sharedService = inject(Shared);
|
|
6275
|
+
route = inject(ActivatedRoute);
|
|
6276
|
+
containers;
|
|
6277
|
+
dashboardIdInput = input(undefined, ...(ngDevMode ? [{ debugName: "dashboardIdInput", alias: 'dashboardId' }] : [{ alias: 'dashboardId' }]));
|
|
6278
|
+
parametersInput = input(undefined, ...(ngDevMode ? [{ debugName: "parametersInput", alias: 'parameters' }] : [{ alias: 'parameters' }]));
|
|
6279
|
+
heightInput = input(undefined, ...(ngDevMode ? [{ debugName: "heightInput", alias: 'height' }] : [{ alias: 'height' }]));
|
|
6280
|
+
routeData = toSignal(this.route.data, { initialValue: this.route.snapshot.data });
|
|
6281
|
+
dashboardId = computed(() => this.dashboardIdInput() ?? this.routeData()['dashboardId'], ...(ngDevMode ? [{ debugName: "dashboardId" }] : []));
|
|
6282
|
+
parameters = computed(() => this.parametersInput() ?? this.routeData()['parameters'], ...(ngDevMode ? [{ debugName: "parameters" }] : []));
|
|
6283
|
+
height = computed(() => this.heightInput() ?? this.routeData()['height'], ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
6284
|
+
isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
6285
|
+
isLoadingChange = output();
|
|
6286
|
+
viewReady = signal(false, ...(ngDevMode ? [{ debugName: "viewReady" }] : []));
|
|
6287
|
+
dashboardRef = null;
|
|
6288
|
+
lastEmbeddedId = undefined;
|
|
6289
|
+
constructor() {
|
|
6290
|
+
effect(() => {
|
|
6291
|
+
this.isLoadingChange.emit(this.isLoading());
|
|
6292
|
+
});
|
|
6293
|
+
effect(() => {
|
|
6294
|
+
const id = this.dashboardId();
|
|
6295
|
+
console.log('🟢 firstEmbed effect', { id, viewReady: this.viewReady(), lastEmbeddedId: this.lastEmbeddedId });
|
|
6296
|
+
if (!this.viewReady() || !id)
|
|
6297
|
+
return;
|
|
6298
|
+
if (id === this.lastEmbeddedId)
|
|
6299
|
+
return;
|
|
6300
|
+
this.lastEmbeddedId = id;
|
|
6301
|
+
this.firstEmbed(id);
|
|
6302
|
+
});
|
|
6303
|
+
effect(() => {
|
|
6304
|
+
const params = this.parameters();
|
|
6305
|
+
console.log('🟠 params effect', { params, hasRef: !!this.dashboardRef });
|
|
6306
|
+
if (!this.dashboardRef || !params)
|
|
6307
|
+
return;
|
|
6308
|
+
this.sharedService.setDashboardParameters(this.dashboardRef, params)
|
|
6309
|
+
.then(r => console.log('🟠 setParameters OK', r))
|
|
6310
|
+
.catch(e => console.error('🟠 setParameters ERR', e));
|
|
6311
|
+
});
|
|
6312
|
+
}
|
|
6313
|
+
ngAfterViewInit() {
|
|
6314
|
+
this.viewReady.set(true);
|
|
6315
|
+
}
|
|
6316
|
+
async firstEmbed(dashboardId) {
|
|
6317
|
+
const container = this.containers.first?.nativeElement;
|
|
6318
|
+
if (!container)
|
|
6319
|
+
return;
|
|
6320
|
+
this.isLoading.set(true);
|
|
6321
|
+
try {
|
|
6322
|
+
this.dashboardRef = await this.sharedService.embedDashboardInteractive({ dashboardId, parameters: this.parameters() }, container, { height: this.height() ?? `${window.innerHeight - 50}px` });
|
|
6323
|
+
}
|
|
6324
|
+
catch (error) {
|
|
6325
|
+
console.error('Error embedding dashboard:', error);
|
|
6326
|
+
}
|
|
6327
|
+
finally {
|
|
6328
|
+
this.isLoading.set(false);
|
|
6329
|
+
}
|
|
6330
|
+
}
|
|
6331
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsInteractiveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6332
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.23", type: DashboardQsInteractiveComponent, isStandalone: true, selector: "intelica-dashboard-qs-interactive", inputs: { dashboardIdInput: { classPropertyName: "dashboardIdInput", publicName: "dashboardId", isSignal: true, isRequired: false, transformFunction: null }, parametersInput: { classPropertyName: "parametersInput", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, heightInput: { classPropertyName: "heightInput", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isLoadingChange: "isLoadingChange" }, viewQueries: [{ propertyName: "containers", predicate: ["visualContainer"], descendants: true }], ngImport: i0, template: "<div #visualContainer [style.height]=\"height()\" [class.hidden]=\"isLoading()\"></div>\n" });
|
|
6333
|
+
}
|
|
6334
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsInteractiveComponent, decorators: [{
|
|
6335
|
+
type: Component,
|
|
6336
|
+
args: [{ selector: 'intelica-dashboard-qs-interactive', imports: [], template: "<div #visualContainer [style.height]=\"height()\" [class.hidden]=\"isLoading()\"></div>\n" }]
|
|
6337
|
+
}], ctorParameters: () => [], propDecorators: { containers: [{
|
|
6338
|
+
type: ViewChildren,
|
|
6339
|
+
args: ['visualContainer']
|
|
6340
|
+
}], dashboardIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: false }] }], parametersInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }], heightInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], isLoadingChange: [{ type: i0.Output, args: ["isLoadingChange"] }] } });
|
|
6341
|
+
|
|
6255
6342
|
class CheckboxFilterDirective extends FilterDirective {
|
|
6256
6343
|
constructor() {
|
|
6257
6344
|
super(FilterTypeEnum.Checkbox);
|
|
@@ -9133,5 +9220,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImpo
|
|
|
9133
9220
|
* Generated bundle index. Do not edit.
|
|
9134
9221
|
*/
|
|
9135
9222
|
|
|
9136
|
-
export { ALERT_DEFAULTS, ALERT_ICON_OVERRIDES, ALERT_ICON_PATHS, ALERT_TYPE_CONFIG, ActionDirective, ActionsMenuComponent, AddFavoritesComponent, AlertButtonMode, AlertService, AlertType, BreadCrumbComponent, ButtonSplitComponent, CheckboxFilterDirective, ClientContextSelector, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DATEPICKER_BUTTON_TYPES, DashboardQsComponent, DataDirective, DateFilterDirective, DateModeOptions, DatepickerComponent, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFavoriteService, GlobalFeatureFlagService, GlobalMenuService, GlobalTermService, GoogleTaskManagerService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaSessionService, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, NotificationJobService, NotificationOrchestratorService, NotificationService, NotificationSignalRService, OrderConstants, PageInformation, PageRootChildGuard, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RequestCacheService, ResponseHeadersInterceptor, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SetsesioninformationComponent, Shared, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TitleComponent, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
|
|
9223
|
+
export { ALERT_DEFAULTS, ALERT_ICON_OVERRIDES, ALERT_ICON_PATHS, ALERT_TYPE_CONFIG, ActionDirective, ActionsMenuComponent, AddFavoritesComponent, AlertButtonMode, AlertService, AlertType, BreadCrumbComponent, ButtonSplitComponent, CheckboxFilterDirective, ClientContextSelector, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DATEPICKER_BUTTON_TYPES, DashboardQsComponent, DashboardQsInteractiveComponent, DataDirective, DateFilterDirective, DateModeOptions, DatepickerComponent, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFavoriteService, GlobalFeatureFlagService, GlobalMenuService, GlobalTermService, GoogleTaskManagerService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaSessionService, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, NotificationJobService, NotificationOrchestratorService, NotificationService, NotificationSignalRService, OrderConstants, PageInformation, PageRootChildGuard, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RequestCacheService, ResponseHeadersInterceptor, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SetsesioninformationComponent, Shared, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TitleComponent, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
|
|
9137
9224
|
//# sourceMappingURL=intelica-library-components.mjs.map
|