@sisense/sdk-ui-angular 2.20.0 → 2.21.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/dist/esm2020/lib/components/dashboard/dashboard.component.mjs +3 -3
- package/dist/esm2020/lib/components/widgets/widget.component.mjs +3 -3
- package/dist/esm2020/lib/helpers/chart-props-preact-translator.mjs +22 -0
- package/dist/esm2020/lib/helpers/dashboard-props-preact-translator.mjs +8 -8
- package/dist/esm2020/lib/helpers/widget-props-preact-translator.mjs +25 -5
- package/dist/esm2020/lib/services/angular-component-adapter.mjs +100 -0
- package/dist/esm2020/lib/services/custom-widgets.service.mjs +26 -6
- package/dist/esm2020/lib/services/dashboard.service.mjs +4 -4
- package/dist/esm2020/lib/services/formula.service.mjs +102 -0
- package/dist/esm2020/lib/services/index.mjs +2 -1
- package/dist/esm2020/lib/services/widget.service.mjs +4 -4
- package/dist/esm2020/lib/types/custom-widget-component-props.mjs +2 -0
- package/dist/esm2020/lib/types/index.mjs +2 -1
- package/dist/esm2020/lib/utilities/dashboard-helpers.mjs +9 -8
- package/dist/esm2020/lib/utilities/dashboard-model-translator.mjs +3 -2
- package/dist/esm2020/lib/utilities/widget-model-translator.mjs +10 -8
- package/dist/esm2020/version.mjs +2 -2
- package/dist/fesm2015/sisense-sdk-ui-angular.mjs +276 -36
- package/dist/fesm2015/sisense-sdk-ui-angular.mjs.map +1 -1
- package/dist/fesm2020/sisense-sdk-ui-angular.mjs +292 -38
- package/dist/fesm2020/sisense-sdk-ui-angular.mjs.map +1 -1
- package/dist/lib/helpers/chart-props-preact-translator.d.ts +5 -0
- package/dist/lib/helpers/dashboard-props-preact-translator.d.ts +2 -2
- package/dist/lib/helpers/widget-props-preact-translator.d.ts +7 -4
- package/dist/lib/services/angular-component-adapter.d.ts +55 -0
- package/dist/lib/services/custom-widgets.service.d.ts +2 -1
- package/dist/lib/services/formula.service.d.ts +73 -0
- package/dist/lib/services/index.d.ts +1 -0
- package/dist/lib/types/custom-widget-component-props.d.ts +73 -0
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/package.json +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Optional, Inject, NgModule, EventEmitter, Component, ViewChild, Input, Output, createComponent } from '@angular/core';
|
|
3
|
-
import { DataObserver, CustomThemeProvider, CustomSisenseContextProvider, CustomWidgetsProviderAdapter, createClientApplication, getDefaultThemeSettings, getThemeSettingsByOid, ComponentAdapter, Chart, TabberButtonsWidget,
|
|
2
|
+
import { InjectionToken, Injectable, Optional, Inject, NgModule, EventEmitter, Component, ViewChild, Input, Output, reflectComponentType, createComponent } from '@angular/core';
|
|
3
|
+
import { DataObserver, CustomThemeProvider, CustomSisenseContextProvider, CustomWidgetsProviderAdapter, createClientApplication, getDefaultThemeSettings, getThemeSettingsByOid, ComponentAdapter, Chart, TabberButtonsWidget, createElement, ExternalComponentAdapterElement, getDashboardModel, getDashboardModels, HookAdapter, useComposedDashboardInternal, createHookApiFacade, useGetFilterMembers, useGetSharedFormulaInternal, getHierarchyModels, executeQuery, executeQueryByWidgetId, executePivotQuery, useExecuteCsvQueryInternal, useExecuteCustomWidgetQueryInternal, getWidgetModel, useJtdWidget, PivotTable, Table, ContextMenu, createWrapperElement, Dashboard, DashboardById, DrilldownBreadcrumbs, CriteriaFilterTile, DateRangeFilterTile, FilterTile, FiltersPanel, MemberFilterTile, RelativeDateFilterTile, ChartWidget, DrilldownWidget, createWrapperElementHandler, createComponentRenderer, PivotTableWidget, TableWidget, Widget, WidgetById, dashboardModelTranslator as dashboardModelTranslator$1, dashboardHelpers as dashboardHelpers$1, widgetModelTranslator as widgetModelTranslator$1 } from '@sisense/sdk-ui-preact';
|
|
4
4
|
export { boxWhiskerProcessResult, extractDimensionsAndMeasures } from '@sisense/sdk-ui-preact';
|
|
5
5
|
import { ReplaySubject, firstValueFrom, concat, of, BehaviorSubject, skip } from 'rxjs';
|
|
6
6
|
import { __decorate } from 'tslib';
|
|
@@ -285,7 +285,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
285
285
|
args: [SISENSE_CONTEXT_CONFIG_TOKEN]
|
|
286
286
|
}] }]; } });
|
|
287
287
|
|
|
288
|
-
var packageVersion = '2.
|
|
288
|
+
var packageVersion = '2.21.0';
|
|
289
289
|
|
|
290
290
|
class DecoratorsModule {
|
|
291
291
|
constructor(sisenseContextService) {
|
|
@@ -2053,6 +2053,105 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2053
2053
|
type: Output
|
|
2054
2054
|
}] } });
|
|
2055
2055
|
|
|
2056
|
+
/**
|
|
2057
|
+
* Adapter class that manages the lifecycle of an Angular component
|
|
2058
|
+
* rendered within a Preact context. This provides efficient updates
|
|
2059
|
+
* by reusing the component instance instead of recreating it on every
|
|
2060
|
+
* props change.
|
|
2061
|
+
*
|
|
2062
|
+
* This pattern mirrors how `ComponentAdapter` works for regular Preact
|
|
2063
|
+
* components, ensuring consistent behavior between regular widgets
|
|
2064
|
+
* and custom Angular widgets.
|
|
2065
|
+
*
|
|
2066
|
+
* Implements ExternalComponentAdapter interface to be compatible with
|
|
2067
|
+
* the ExternalComponentAdapterElement in sdk-ui-preact.
|
|
2068
|
+
*
|
|
2069
|
+
* @internal
|
|
2070
|
+
*/
|
|
2071
|
+
class AngularComponentAdapter {
|
|
2072
|
+
constructor(dynamicRenderer, componentClass) {
|
|
2073
|
+
this.dynamicRenderer = dynamicRenderer;
|
|
2074
|
+
this.componentClass = componentClass;
|
|
2075
|
+
this.componentRef = null;
|
|
2076
|
+
this.element = null;
|
|
2077
|
+
this.isDestroyed = false;
|
|
2078
|
+
// Extract input names from component metadata (supports both property names and aliases)
|
|
2079
|
+
const mirror = reflectComponentType(componentClass);
|
|
2080
|
+
this.inputNames = new Set(mirror?.inputs.flatMap((input) => [input.propName, input.templateName]) ?? []);
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Mounts the Angular component into the container element.
|
|
2084
|
+
* This should only be called once when the Preact wrapper mounts.
|
|
2085
|
+
*
|
|
2086
|
+
* @param container - The DOM element to mount the Angular component into
|
|
2087
|
+
* @param props - Initial props to pass to the component
|
|
2088
|
+
*/
|
|
2089
|
+
mount(container, props) {
|
|
2090
|
+
if (this.componentRef || this.isDestroyed) {
|
|
2091
|
+
return;
|
|
2092
|
+
}
|
|
2093
|
+
const rendered = this.dynamicRenderer.renderComponent(this.componentClass, props);
|
|
2094
|
+
container.appendChild(rendered.element);
|
|
2095
|
+
this.componentRef = rendered.componentRef;
|
|
2096
|
+
this.element = rendered.element;
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* Updates the props on the existing Angular component instance.
|
|
2100
|
+
* Uses ComponentRef.setInput() for @Input properties to ensure proper
|
|
2101
|
+
* change detection, OnPush component marking, and ngOnChanges lifecycle
|
|
2102
|
+
* hook execution. Uses direct assignment for non-input properties
|
|
2103
|
+
* (e.g., event callbacks).
|
|
2104
|
+
*
|
|
2105
|
+
* @param props - New props to apply to the component
|
|
2106
|
+
*/
|
|
2107
|
+
update(props) {
|
|
2108
|
+
if (!this.componentRef || this.isDestroyed) {
|
|
2109
|
+
return;
|
|
2110
|
+
}
|
|
2111
|
+
let hasDirectAssignments = false;
|
|
2112
|
+
Object.keys(props).forEach((key) => {
|
|
2113
|
+
const value = props[key];
|
|
2114
|
+
if (this.inputNames.has(key)) {
|
|
2115
|
+
// Use setInput() for @Input properties - triggers ngOnChanges and marks OnPush as dirty
|
|
2116
|
+
this.componentRef.setInput(key, value);
|
|
2117
|
+
}
|
|
2118
|
+
else {
|
|
2119
|
+
// Direct assignment for non-input properties (e.g., callbacks)
|
|
2120
|
+
this.componentRef.instance[key] = value;
|
|
2121
|
+
hasDirectAssignments = true;
|
|
2122
|
+
}
|
|
2123
|
+
});
|
|
2124
|
+
// Trigger change detection only if we had direct assignments
|
|
2125
|
+
if (hasDirectAssignments) {
|
|
2126
|
+
this.componentRef.changeDetectorRef.detectChanges();
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Destroys the Angular component and cleans up resources.
|
|
2131
|
+
* This should be called when the Preact wrapper unmounts.
|
|
2132
|
+
*/
|
|
2133
|
+
destroy() {
|
|
2134
|
+
if (this.isDestroyed) {
|
|
2135
|
+
return;
|
|
2136
|
+
}
|
|
2137
|
+
this.isDestroyed = true;
|
|
2138
|
+
if (this.componentRef) {
|
|
2139
|
+
this.componentRef.destroy();
|
|
2140
|
+
this.componentRef = null;
|
|
2141
|
+
}
|
|
2142
|
+
if (this.element && this.element.parentNode) {
|
|
2143
|
+
this.element.parentNode.removeChild(this.element);
|
|
2144
|
+
}
|
|
2145
|
+
this.element = null;
|
|
2146
|
+
}
|
|
2147
|
+
/**
|
|
2148
|
+
* Returns whether the adapter has an active component instance.
|
|
2149
|
+
*/
|
|
2150
|
+
isActive() {
|
|
2151
|
+
return this.componentRef !== null && !this.isDestroyed;
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2056
2155
|
/**
|
|
2057
2156
|
* Service for rendering components dynamically.
|
|
2058
2157
|
*
|
|
@@ -2115,13 +2214,32 @@ class CustomWidgetsService {
|
|
|
2115
2214
|
* @param customWidget - The custom widget component class to register.
|
|
2116
2215
|
*/
|
|
2117
2216
|
registerCustomWidget(customWidgetType, customWidget) {
|
|
2118
|
-
const
|
|
2119
|
-
|
|
2120
|
-
|
|
2217
|
+
const dynamicRenderer = this.dynamicRenderer;
|
|
2218
|
+
/**
|
|
2219
|
+
* Factory function that creates an adapter for the Angular component.
|
|
2220
|
+
* This is called once per component mount by the ExternalComponentAdapterElement.
|
|
2221
|
+
*/
|
|
2222
|
+
const createAdapter = () => {
|
|
2223
|
+
return new AngularComponentAdapter(dynamicRenderer, customWidget);
|
|
2224
|
+
};
|
|
2225
|
+
/**
|
|
2226
|
+
* Preact wrapper component that manages the Angular component lifecycle.
|
|
2227
|
+
* Uses ExternalComponentAdapterElement (which uses hooks internally in the correct Preact context)
|
|
2228
|
+
* to ensure the Angular component is:
|
|
2229
|
+
* - Created once on mount
|
|
2230
|
+
* - Updated in-place on props changes (preserving state)
|
|
2231
|
+
* - Properly destroyed on unmount
|
|
2232
|
+
*/
|
|
2233
|
+
const CustomWidgetWrapper = (props) => {
|
|
2234
|
+
const adapterElementProps = {
|
|
2235
|
+
adapterFactory: createAdapter,
|
|
2236
|
+
componentProps: props,
|
|
2237
|
+
};
|
|
2238
|
+
return createElement(ExternalComponentAdapterElement, adapterElementProps);
|
|
2121
2239
|
};
|
|
2122
2240
|
const customWidgetsMap = this.customWidgetsMap$.value;
|
|
2123
2241
|
if (!customWidgetsMap.has(customWidgetType)) {
|
|
2124
|
-
customWidgetsMap.set(customWidgetType,
|
|
2242
|
+
customWidgetsMap.set(customWidgetType, CustomWidgetWrapper);
|
|
2125
2243
|
this.customWidgetsMap$.next(customWidgetsMap);
|
|
2126
2244
|
}
|
|
2127
2245
|
}
|
|
@@ -2144,8 +2262,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2144
2262
|
}]
|
|
2145
2263
|
}], ctorParameters: function () { return [{ type: DynamicRenderer }]; } });
|
|
2146
2264
|
|
|
2147
|
-
function
|
|
2148
|
-
const { beforeRender, dataReady, beforeMenuOpen, dataPointClick, dataPointContextMenu, dataPointsSelect, ...commonWidgetProps } =
|
|
2265
|
+
function toPreactWidgetProps(angularProps) {
|
|
2266
|
+
const { beforeRender, dataReady, beforeMenuOpen, dataPointClick, dataPointContextMenu, dataPointsSelect, ...commonWidgetProps } = angularProps;
|
|
2149
2267
|
return {
|
|
2150
2268
|
...commonWidgetProps,
|
|
2151
2269
|
onBeforeRender: beforeRender,
|
|
@@ -2168,8 +2286,8 @@ function translateToPreactWidgetProps(widgetProps) {
|
|
|
2168
2286
|
: undefined,
|
|
2169
2287
|
};
|
|
2170
2288
|
}
|
|
2171
|
-
function
|
|
2172
|
-
const { onBeforeRender, onDataReady, onBeforeMenuOpen, onDataPointClick, onDataPointContextMenu, onDataPointsSelected, ...commonWidgetProps } =
|
|
2289
|
+
function toWidgetProps$1(preactProps) {
|
|
2290
|
+
const { onBeforeRender, onDataReady, onBeforeMenuOpen, onDataPointClick, onDataPointContextMenu, onDataPointsSelected, ...commonWidgetProps } = preactProps;
|
|
2173
2291
|
return {
|
|
2174
2292
|
...commonWidgetProps,
|
|
2175
2293
|
beforeRender: onBeforeRender,
|
|
@@ -2186,17 +2304,37 @@ function translateFromPreactWidgetProps(widgetProps) {
|
|
|
2186
2304
|
: undefined,
|
|
2187
2305
|
};
|
|
2188
2306
|
}
|
|
2307
|
+
function toChartWidgetProps$1(preactProps) {
|
|
2308
|
+
const { onBeforeRender, onDataReady, ...rest } = preactProps;
|
|
2309
|
+
return {
|
|
2310
|
+
...rest,
|
|
2311
|
+
beforeRender: onBeforeRender,
|
|
2312
|
+
dataReady: onDataReady,
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
function toPivotTableWidgetProps$1(preactProps) {
|
|
2316
|
+
const { ...rest } = preactProps;
|
|
2317
|
+
return {
|
|
2318
|
+
...rest,
|
|
2319
|
+
};
|
|
2320
|
+
}
|
|
2321
|
+
function toTextWidgetProps$1(preactProps) {
|
|
2322
|
+
const { ...rest } = preactProps;
|
|
2323
|
+
return {
|
|
2324
|
+
...rest,
|
|
2325
|
+
};
|
|
2326
|
+
}
|
|
2189
2327
|
|
|
2190
|
-
function
|
|
2328
|
+
function toPreactDashboardProps(angularProps) {
|
|
2191
2329
|
return {
|
|
2192
|
-
...
|
|
2193
|
-
widgets:
|
|
2330
|
+
...angularProps,
|
|
2331
|
+
widgets: angularProps.widgets.map(toPreactWidgetProps),
|
|
2194
2332
|
};
|
|
2195
2333
|
}
|
|
2196
|
-
function
|
|
2334
|
+
function toDashboardProps$1(preactProps) {
|
|
2197
2335
|
return {
|
|
2198
|
-
...
|
|
2199
|
-
widgets:
|
|
2336
|
+
...preactProps,
|
|
2337
|
+
widgets: preactProps.widgets.map(toWidgetProps$1),
|
|
2200
2338
|
};
|
|
2201
2339
|
}
|
|
2202
2340
|
|
|
@@ -2310,9 +2448,9 @@ let DashboardService = class DashboardService {
|
|
|
2310
2448
|
const hookAdapter = new HookAdapter((useComposedDashboardInternal), [createSisenseContextConnector(this.sisenseContextService)]);
|
|
2311
2449
|
const dashboard$ = new BehaviorSubject(initialDashboard);
|
|
2312
2450
|
hookAdapter.subscribe(({ dashboard }) => {
|
|
2313
|
-
dashboard$.next(
|
|
2451
|
+
dashboard$.next(toDashboardProps$1(dashboard));
|
|
2314
2452
|
});
|
|
2315
|
-
hookAdapter.run(
|
|
2453
|
+
hookAdapter.run(toPreactDashboardProps(initialDashboard), options);
|
|
2316
2454
|
const setFilters = createHookApiFacade(hookAdapter, 'setFilters', true);
|
|
2317
2455
|
const setWidgetsLayout = createHookApiFacade(hookAdapter, 'setWidgetsLayout', true);
|
|
2318
2456
|
const destroy = () => {
|
|
@@ -2406,6 +2544,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2406
2544
|
}]
|
|
2407
2545
|
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
2408
2546
|
|
|
2547
|
+
/**
|
|
2548
|
+
* Service for working with shared formulas.
|
|
2549
|
+
*
|
|
2550
|
+
* @group Fusion Assets
|
|
2551
|
+
* @fusionEmbed
|
|
2552
|
+
*/
|
|
2553
|
+
let FormulaService = class FormulaService {
|
|
2554
|
+
constructor(sisenseContextService) {
|
|
2555
|
+
this.sisenseContextService = sisenseContextService;
|
|
2556
|
+
}
|
|
2557
|
+
/**
|
|
2558
|
+
* Fetch a [shared formula](https://docs.sisense.com/main/SisenseLinux/shared-formulas.htm) from a Fusion instance.
|
|
2559
|
+
*
|
|
2560
|
+
* The formula can be identified either by `oid` or by `name` and `dataSource` pair.
|
|
2561
|
+
*
|
|
2562
|
+
* When the retrieval is successful but the shared formula is not found, the result is `null`. When the retrieval is not successful, the promise is rejected with an error.
|
|
2563
|
+
*
|
|
2564
|
+
* ## Example
|
|
2565
|
+
*
|
|
2566
|
+
* Retrieve a shared formula by oid:
|
|
2567
|
+
*
|
|
2568
|
+
* ```ts
|
|
2569
|
+
* try {
|
|
2570
|
+
* const formula = await formulaService.getSharedFormula({
|
|
2571
|
+
* oid: 'd61c337b-fabc-4e9e-b4cc-a30116857153',
|
|
2572
|
+
* });
|
|
2573
|
+
*
|
|
2574
|
+
* if (formula) {
|
|
2575
|
+
* console.log('Formula found:', formula);
|
|
2576
|
+
* } else {
|
|
2577
|
+
* console.log('Formula not found');
|
|
2578
|
+
* }
|
|
2579
|
+
* } catch (error) {
|
|
2580
|
+
* console.error('Error:', error);
|
|
2581
|
+
* }
|
|
2582
|
+
* ```
|
|
2583
|
+
*
|
|
2584
|
+
* ## Example
|
|
2585
|
+
*
|
|
2586
|
+
* Retrieve a shared formula by name and data source:
|
|
2587
|
+
*
|
|
2588
|
+
* ```ts
|
|
2589
|
+
* try {
|
|
2590
|
+
* const formula = await formulaService.getSharedFormula({
|
|
2591
|
+
* name: 'My Shared Formula',
|
|
2592
|
+
* dataSource: DM.DataSource,
|
|
2593
|
+
* });
|
|
2594
|
+
*
|
|
2595
|
+
* if (formula) {
|
|
2596
|
+
* console.log('Formula found:', formula);
|
|
2597
|
+
* } else {
|
|
2598
|
+
* console.log('Formula not found');
|
|
2599
|
+
* }
|
|
2600
|
+
* } catch (error) {
|
|
2601
|
+
* console.error('Error:', error);
|
|
2602
|
+
* }
|
|
2603
|
+
* ```
|
|
2604
|
+
*
|
|
2605
|
+
* @param params - Parameters for retrieving the shared formula. Must include either `oid` or both `name` and `dataSource`.
|
|
2606
|
+
* @returns Promise that resolves to the shared formula, or `null` if not found
|
|
2607
|
+
*/
|
|
2608
|
+
async getSharedFormula(params) {
|
|
2609
|
+
const hookAdapter = new HookAdapter(useGetSharedFormulaInternal, [
|
|
2610
|
+
createSisenseContextConnector(this.sisenseContextService),
|
|
2611
|
+
]);
|
|
2612
|
+
const resultPromise = new Promise((resolve, reject) => {
|
|
2613
|
+
hookAdapter.subscribe((res) => {
|
|
2614
|
+
const { formula, isError, isSuccess, error } = res;
|
|
2615
|
+
if (isError) {
|
|
2616
|
+
reject(error);
|
|
2617
|
+
}
|
|
2618
|
+
else if (isSuccess) {
|
|
2619
|
+
resolve(formula ?? null);
|
|
2620
|
+
}
|
|
2621
|
+
});
|
|
2622
|
+
});
|
|
2623
|
+
hookAdapter.run(params);
|
|
2624
|
+
return resultPromise.finally(() => {
|
|
2625
|
+
hookAdapter.destroy();
|
|
2626
|
+
});
|
|
2627
|
+
}
|
|
2628
|
+
};
|
|
2629
|
+
FormulaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormulaService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2630
|
+
FormulaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormulaService, providedIn: 'root' });
|
|
2631
|
+
FormulaService = __decorate([
|
|
2632
|
+
TrackableService(['getSharedFormula'])
|
|
2633
|
+
], FormulaService);
|
|
2634
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormulaService, decorators: [{
|
|
2635
|
+
type: Injectable,
|
|
2636
|
+
args: [{
|
|
2637
|
+
providedIn: 'root',
|
|
2638
|
+
}]
|
|
2639
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
2640
|
+
|
|
2409
2641
|
/**
|
|
2410
2642
|
* Service for working with Sisense Fusion hierarchies.
|
|
2411
2643
|
*
|
|
@@ -2716,12 +2948,12 @@ let WidgetService = class WidgetService {
|
|
|
2716
2948
|
createThemeContextConnector(this.themeService),
|
|
2717
2949
|
]);
|
|
2718
2950
|
// Convert Angular props to preact props
|
|
2719
|
-
const preactProps =
|
|
2951
|
+
const preactProps = toPreactWidgetProps(widgetProps);
|
|
2720
2952
|
// Subscribe to hook adapter results and capture the subscription
|
|
2721
2953
|
const hookAdapterSubscription = hookAdapter.subscribe((enhancedPreactProps) => {
|
|
2722
2954
|
if (enhancedPreactProps) {
|
|
2723
2955
|
// Convert back to Angular props
|
|
2724
|
-
const angularProps =
|
|
2956
|
+
const angularProps = toWidgetProps$1(enhancedPreactProps);
|
|
2725
2957
|
enhancedProps$.next(angularProps);
|
|
2726
2958
|
}
|
|
2727
2959
|
else {
|
|
@@ -3953,7 +4185,7 @@ class DashboardComponent {
|
|
|
3953
4185
|
}
|
|
3954
4186
|
}
|
|
3955
4187
|
getPreactComponentProps() {
|
|
3956
|
-
return
|
|
4188
|
+
return toPreactDashboardProps({
|
|
3957
4189
|
title: this.title,
|
|
3958
4190
|
layoutOptions: this.layoutOptions,
|
|
3959
4191
|
config: this.config,
|
|
@@ -5606,7 +5838,7 @@ class WidgetComponent {
|
|
|
5606
5838
|
}
|
|
5607
5839
|
}
|
|
5608
5840
|
getPreactComponentProps() {
|
|
5609
|
-
return
|
|
5841
|
+
return toPreactWidgetProps({
|
|
5610
5842
|
id: this.id,
|
|
5611
5843
|
widgetType: this.widgetType,
|
|
5612
5844
|
chartType: this.chartType,
|
|
@@ -6021,7 +6253,7 @@ export class DashboardComponent {
|
|
|
6021
6253
|
* ```
|
|
6022
6254
|
*/
|
|
6023
6255
|
function toDashboardProps(dashboardModel) {
|
|
6024
|
-
return dashboardModelTranslator$1.toDashboardProps(dashboardModel);
|
|
6256
|
+
return toDashboardProps$1(dashboardModelTranslator$1.toDashboardProps(dashboardModel));
|
|
6025
6257
|
}
|
|
6026
6258
|
|
|
6027
6259
|
var dashboardModelTranslator = /*#__PURE__*/Object.freeze({
|
|
@@ -6044,7 +6276,7 @@ var dashboardModelTranslator = /*#__PURE__*/Object.freeze({
|
|
|
6044
6276
|
* @returns A new dashboard instance with the updated filters.
|
|
6045
6277
|
*/
|
|
6046
6278
|
const replaceFilters = (dashboard, newFilters) => {
|
|
6047
|
-
return dashboardHelpers$1.replaceFilters(dashboard, newFilters);
|
|
6279
|
+
return toDashboardProps$1(dashboardHelpers$1.replaceFilters(toPreactDashboardProps(dashboard), newFilters));
|
|
6048
6280
|
};
|
|
6049
6281
|
/**
|
|
6050
6282
|
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.addFilter}
|
|
@@ -6061,7 +6293,7 @@ const replaceFilters = (dashboard, newFilters) => {
|
|
|
6061
6293
|
* @returns A new dashboard instance with the new filter added.
|
|
6062
6294
|
*/
|
|
6063
6295
|
const addFilter = (dashboard, newFilter) => {
|
|
6064
|
-
return dashboardHelpers$1.addFilter(dashboard, newFilter);
|
|
6296
|
+
return toDashboardProps$1(dashboardHelpers$1.addFilter(toPreactDashboardProps(dashboard), newFilter));
|
|
6065
6297
|
};
|
|
6066
6298
|
/**
|
|
6067
6299
|
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.addFilters}
|
|
@@ -6078,7 +6310,7 @@ const addFilter = (dashboard, newFilter) => {
|
|
|
6078
6310
|
* @returns A new dashboard instance with the new filters added.
|
|
6079
6311
|
*/
|
|
6080
6312
|
const addFilters = (dashboard, newFilters) => {
|
|
6081
|
-
return dashboardHelpers$1.addFilters(dashboard, newFilters);
|
|
6313
|
+
return toDashboardProps$1(dashboardHelpers$1.addFilters(toPreactDashboardProps(dashboard), newFilters));
|
|
6082
6314
|
};
|
|
6083
6315
|
/**
|
|
6084
6316
|
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.replaceFilter}
|
|
@@ -6097,7 +6329,7 @@ const addFilters = (dashboard, newFilters) => {
|
|
|
6097
6329
|
* @returns A new dashboard instance with the specified filter replaced.
|
|
6098
6330
|
*/
|
|
6099
6331
|
const replaceFilter = (dashboard, filterToReplace, newFilter) => {
|
|
6100
|
-
return dashboardHelpers$1.replaceFilter(dashboard, filterToReplace, newFilter);
|
|
6332
|
+
return toDashboardProps$1(dashboardHelpers$1.replaceFilter(toPreactDashboardProps(dashboard), filterToReplace, newFilter));
|
|
6101
6333
|
};
|
|
6102
6334
|
/**
|
|
6103
6335
|
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.removeFilter}
|
|
@@ -6114,7 +6346,7 @@ const replaceFilter = (dashboard, filterToReplace, newFilter) => {
|
|
|
6114
6346
|
* @returns A new dashboard instance with the specified filter removed.
|
|
6115
6347
|
*/
|
|
6116
6348
|
const removeFilter = (dashboard, filterToRemove) => {
|
|
6117
|
-
return dashboardHelpers$1.removeFilter(dashboard, filterToRemove);
|
|
6349
|
+
return toDashboardProps$1(dashboardHelpers$1.removeFilter(toPreactDashboardProps(dashboard), filterToRemove));
|
|
6118
6350
|
};
|
|
6119
6351
|
/**
|
|
6120
6352
|
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.removeFilters}
|
|
@@ -6131,7 +6363,7 @@ const removeFilter = (dashboard, filterToRemove) => {
|
|
|
6131
6363
|
* @returns A new dashboard instance with the specified filters removed.
|
|
6132
6364
|
*/
|
|
6133
6365
|
const removeFilters = (dashboard, filtersToRemove) => {
|
|
6134
|
-
return dashboardHelpers$1.removeFilters(dashboard, filtersToRemove);
|
|
6366
|
+
return toDashboardProps$1(dashboardHelpers$1.removeFilters(toPreactDashboardProps(dashboard), filtersToRemove));
|
|
6135
6367
|
};
|
|
6136
6368
|
|
|
6137
6369
|
var dashboardHelpers = /*#__PURE__*/Object.freeze({
|
|
@@ -6144,6 +6376,28 @@ var dashboardHelpers = /*#__PURE__*/Object.freeze({
|
|
|
6144
6376
|
replaceFilters: replaceFilters
|
|
6145
6377
|
});
|
|
6146
6378
|
|
|
6379
|
+
function toChartProps$1(preactProps) {
|
|
6380
|
+
const { onBeforeRender, onDataReady, ...rest } = preactProps;
|
|
6381
|
+
return {
|
|
6382
|
+
...rest,
|
|
6383
|
+
beforeRender: onBeforeRender,
|
|
6384
|
+
dataReady: onDataReady,
|
|
6385
|
+
};
|
|
6386
|
+
}
|
|
6387
|
+
function toTableProps$1(preactProps) {
|
|
6388
|
+
const { onDataReady, ...rest } = preactProps;
|
|
6389
|
+
return {
|
|
6390
|
+
...rest,
|
|
6391
|
+
dataReady: onDataReady,
|
|
6392
|
+
};
|
|
6393
|
+
}
|
|
6394
|
+
function toPivotTableProps$1(preactProps) {
|
|
6395
|
+
const { ...rest } = preactProps;
|
|
6396
|
+
return {
|
|
6397
|
+
...rest,
|
|
6398
|
+
};
|
|
6399
|
+
}
|
|
6400
|
+
|
|
6147
6401
|
/**
|
|
6148
6402
|
* Translates a {@link WidgetModel} to the parameters for executing a query for the widget.
|
|
6149
6403
|
*
|
|
@@ -6230,7 +6484,7 @@ export class ExampleComponent {
|
|
|
6230
6484
|
* Use {@link toPivotTableProps} instead for getting props for the {@link PivotTableComponent}.
|
|
6231
6485
|
*/
|
|
6232
6486
|
function toChartProps(widgetModel) {
|
|
6233
|
-
return widgetModelTranslator$1.toChartProps(widgetModel);
|
|
6487
|
+
return toChartProps$1(widgetModelTranslator$1.toChartProps(widgetModel));
|
|
6234
6488
|
}
|
|
6235
6489
|
/**
|
|
6236
6490
|
* Translates a {@link WidgetModel} to the props for rendering a table.
|
|
@@ -6279,7 +6533,7 @@ export class ExampleComponent {
|
|
|
6279
6533
|
* Use {@link toPivotTableProps} instead for getting props for the {@link PivotTableComponent}.
|
|
6280
6534
|
*/
|
|
6281
6535
|
function toTableProps(widgetModel) {
|
|
6282
|
-
return widgetModelTranslator$1.toTableProps(widgetModel);
|
|
6536
|
+
return toTableProps$1(widgetModelTranslator$1.toTableProps(widgetModel));
|
|
6283
6537
|
}
|
|
6284
6538
|
/**
|
|
6285
6539
|
* Translates a {@link WidgetModel} to the props for rendering a pivot table.
|
|
@@ -6328,7 +6582,7 @@ export class ExampleComponent {
|
|
|
6328
6582
|
* Use {@link toTableProps} instead for getting props for the {@link TableComponent}.
|
|
6329
6583
|
*/
|
|
6330
6584
|
function toPivotTableProps(widgetModel) {
|
|
6331
|
-
return widgetModelTranslator$1.toPivotTableProps(widgetModel);
|
|
6585
|
+
return toPivotTableProps$1(widgetModelTranslator$1.toPivotTableProps(widgetModel));
|
|
6332
6586
|
}
|
|
6333
6587
|
/**
|
|
6334
6588
|
* Translates a {@link WidgetModel} to the props for rendering a chart widget.
|
|
@@ -6377,7 +6631,7 @@ export class ExampleComponent {
|
|
|
6377
6631
|
* Note: this method is not supported for pivot widgets.
|
|
6378
6632
|
*/
|
|
6379
6633
|
function toChartWidgetProps(widgetModel) {
|
|
6380
|
-
return widgetModelTranslator$1.toChartWidgetProps(widgetModel);
|
|
6634
|
+
return toChartWidgetProps$1(widgetModelTranslator$1.toChartWidgetProps(widgetModel));
|
|
6381
6635
|
}
|
|
6382
6636
|
/**
|
|
6383
6637
|
* Translates a {@link WidgetModel} to the props for rendering a pivot table widget.
|
|
@@ -6425,7 +6679,7 @@ export class ExampleComponent {
|
|
|
6425
6679
|
* Use {@link toChartWidgetProps} instead for getting props for the {@link ChartWidgetComponent}.
|
|
6426
6680
|
*/
|
|
6427
6681
|
function toPivotTableWidgetProps(widgetModel) {
|
|
6428
|
-
return widgetModelTranslator$1.toPivotTableWidgetProps(widgetModel);
|
|
6682
|
+
return toPivotTableWidgetProps$1(widgetModelTranslator$1.toPivotTableWidgetProps(widgetModel));
|
|
6429
6683
|
}
|
|
6430
6684
|
/**
|
|
6431
6685
|
* Translates a {@link WidgetModel} to the props for rendering a text widget.
|
|
@@ -6444,7 +6698,7 @@ const textWidgetProps = widgetModelTranslator.toTextWidgetProps(widgetModel);
|
|
|
6444
6698
|
* Use {@link toPivotTableWidgetProps} instead for getting props for the pivot table widget.
|
|
6445
6699
|
*/
|
|
6446
6700
|
function toTextWidgetProps(widgetModel) {
|
|
6447
|
-
return widgetModelTranslator$1.toTextWidgetProps(widgetModel);
|
|
6701
|
+
return toTextWidgetProps$1(widgetModelTranslator$1.toTextWidgetProps(widgetModel));
|
|
6448
6702
|
}
|
|
6449
6703
|
/**
|
|
6450
6704
|
* Translates {@link WidgetModel} to {@link WidgetProps}.
|
|
@@ -6495,7 +6749,7 @@ function toTextWidgetProps(widgetModel) {
|
|
|
6495
6749
|
* ```
|
|
6496
6750
|
*/
|
|
6497
6751
|
function toWidgetProps(widgetModel) {
|
|
6498
|
-
return widgetModelTranslator$1.toWidgetProps(widgetModel);
|
|
6752
|
+
return toWidgetProps$1(widgetModelTranslator$1.toWidgetProps(widgetModel));
|
|
6499
6753
|
}
|
|
6500
6754
|
|
|
6501
6755
|
var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
@@ -6519,5 +6773,5 @@ var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
|
6519
6773
|
* Generated bundle index. Do not edit.
|
|
6520
6774
|
*/
|
|
6521
6775
|
|
|
6522
|
-
export { AreaChartComponent, AreaRangeChartComponent, AreamapChartComponent, BarChartComponent, BoxplotChartComponent, CalendarHeatmapChartComponent, ChartComponent, ChartWidgetComponent, ColumnChartComponent, ContextMenuComponent, CriteriaFilterTileComponent, CustomWidgetsService, DashboardByIdComponent, DashboardComponent, DashboardService, DateRangeFilterTileComponent, DrilldownBreadcrumbsComponent, DrilldownWidgetComponent, FilterService, FilterTileComponent, FiltersPanelComponent, FunnelChartComponent, HierarchyService, IndicatorChartComponent, LineChartComponent, MemberFilterTileComponent, PieChartComponent, PivotTableComponent, PivotTableWidgetComponent, PolarChartComponent, QueryService, RelativeDateFilterTileComponent, SISENSE_CONTEXT_CONFIG_TOKEN, ScatterChartComponent, ScattermapChartComponent, SdkUiModule, SisenseContextService, StreamgraphChartComponent, SunburstChartComponent, THEME_CONFIG_TOKEN, TableComponent, TableWidgetComponent, ThemeService, TrackableService, TreemapChartComponent, WidgetByIdComponent, WidgetComponent, WidgetService, createCustomWidgetsContextConnector, createSisenseContextConnector, createThemeContextConnector, dashboardHelpers, dashboardModelTranslator, widgetModelTranslator };
|
|
6776
|
+
export { AreaChartComponent, AreaRangeChartComponent, AreamapChartComponent, BarChartComponent, BoxplotChartComponent, CalendarHeatmapChartComponent, ChartComponent, ChartWidgetComponent, ColumnChartComponent, ContextMenuComponent, CriteriaFilterTileComponent, CustomWidgetsService, DashboardByIdComponent, DashboardComponent, DashboardService, DateRangeFilterTileComponent, DrilldownBreadcrumbsComponent, DrilldownWidgetComponent, FilterService, FilterTileComponent, FiltersPanelComponent, FormulaService, FunnelChartComponent, HierarchyService, IndicatorChartComponent, LineChartComponent, MemberFilterTileComponent, PieChartComponent, PivotTableComponent, PivotTableWidgetComponent, PolarChartComponent, QueryService, RelativeDateFilterTileComponent, SISENSE_CONTEXT_CONFIG_TOKEN, ScatterChartComponent, ScattermapChartComponent, SdkUiModule, SisenseContextService, StreamgraphChartComponent, SunburstChartComponent, THEME_CONFIG_TOKEN, TableComponent, TableWidgetComponent, ThemeService, TrackableService, TreemapChartComponent, WidgetByIdComponent, WidgetComponent, WidgetService, createCustomWidgetsContextConnector, createSisenseContextConnector, createThemeContextConnector, dashboardHelpers, dashboardModelTranslator, widgetModelTranslator };
|
|
6523
6777
|
//# sourceMappingURL=sisense-sdk-ui-angular.mjs.map
|