@sisense/sdk-ui-angular 2.20.0 → 2.22.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 { __awaiter, __decorate, __rest } from 'tslib';
|
|
6
6
|
import { ReplaySubject, firstValueFrom, concat, of, BehaviorSubject, skip } from 'rxjs';
|
|
@@ -287,7 +287,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
287
287
|
}] }];
|
|
288
288
|
} });
|
|
289
289
|
|
|
290
|
-
var packageVersion = '2.
|
|
290
|
+
var packageVersion = '2.22.0';
|
|
291
291
|
|
|
292
292
|
class DecoratorsModule {
|
|
293
293
|
constructor(sisenseContextService) {
|
|
@@ -2067,6 +2067,106 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2067
2067
|
type: Output
|
|
2068
2068
|
}] } });
|
|
2069
2069
|
|
|
2070
|
+
/**
|
|
2071
|
+
* Adapter class that manages the lifecycle of an Angular component
|
|
2072
|
+
* rendered within a Preact context. This provides efficient updates
|
|
2073
|
+
* by reusing the component instance instead of recreating it on every
|
|
2074
|
+
* props change.
|
|
2075
|
+
*
|
|
2076
|
+
* This pattern mirrors how `ComponentAdapter` works for regular Preact
|
|
2077
|
+
* components, ensuring consistent behavior between regular widgets
|
|
2078
|
+
* and custom Angular widgets.
|
|
2079
|
+
*
|
|
2080
|
+
* Implements ExternalComponentAdapter interface to be compatible with
|
|
2081
|
+
* the ExternalComponentAdapterElement in sdk-ui-preact.
|
|
2082
|
+
*
|
|
2083
|
+
* @internal
|
|
2084
|
+
*/
|
|
2085
|
+
class AngularComponentAdapter {
|
|
2086
|
+
constructor(dynamicRenderer, componentClass) {
|
|
2087
|
+
var _a;
|
|
2088
|
+
this.dynamicRenderer = dynamicRenderer;
|
|
2089
|
+
this.componentClass = componentClass;
|
|
2090
|
+
this.componentRef = null;
|
|
2091
|
+
this.element = null;
|
|
2092
|
+
this.isDestroyed = false;
|
|
2093
|
+
// Extract input names from component metadata (supports both property names and aliases)
|
|
2094
|
+
const mirror = reflectComponentType(componentClass);
|
|
2095
|
+
this.inputNames = new Set((_a = mirror === null || mirror === void 0 ? void 0 : mirror.inputs.flatMap((input) => [input.propName, input.templateName])) !== null && _a !== void 0 ? _a : []);
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* Mounts the Angular component into the container element.
|
|
2099
|
+
* This should only be called once when the Preact wrapper mounts.
|
|
2100
|
+
*
|
|
2101
|
+
* @param container - The DOM element to mount the Angular component into
|
|
2102
|
+
* @param props - Initial props to pass to the component
|
|
2103
|
+
*/
|
|
2104
|
+
mount(container, props) {
|
|
2105
|
+
if (this.componentRef || this.isDestroyed) {
|
|
2106
|
+
return;
|
|
2107
|
+
}
|
|
2108
|
+
const rendered = this.dynamicRenderer.renderComponent(this.componentClass, props);
|
|
2109
|
+
container.appendChild(rendered.element);
|
|
2110
|
+
this.componentRef = rendered.componentRef;
|
|
2111
|
+
this.element = rendered.element;
|
|
2112
|
+
}
|
|
2113
|
+
/**
|
|
2114
|
+
* Updates the props on the existing Angular component instance.
|
|
2115
|
+
* Uses ComponentRef.setInput() for @Input properties to ensure proper
|
|
2116
|
+
* change detection, OnPush component marking, and ngOnChanges lifecycle
|
|
2117
|
+
* hook execution. Uses direct assignment for non-input properties
|
|
2118
|
+
* (e.g., event callbacks).
|
|
2119
|
+
*
|
|
2120
|
+
* @param props - New props to apply to the component
|
|
2121
|
+
*/
|
|
2122
|
+
update(props) {
|
|
2123
|
+
if (!this.componentRef || this.isDestroyed) {
|
|
2124
|
+
return;
|
|
2125
|
+
}
|
|
2126
|
+
let hasDirectAssignments = false;
|
|
2127
|
+
Object.keys(props).forEach((key) => {
|
|
2128
|
+
const value = props[key];
|
|
2129
|
+
if (this.inputNames.has(key)) {
|
|
2130
|
+
// Use setInput() for @Input properties - triggers ngOnChanges and marks OnPush as dirty
|
|
2131
|
+
this.componentRef.setInput(key, value);
|
|
2132
|
+
}
|
|
2133
|
+
else {
|
|
2134
|
+
// Direct assignment for non-input properties (e.g., callbacks)
|
|
2135
|
+
this.componentRef.instance[key] = value;
|
|
2136
|
+
hasDirectAssignments = true;
|
|
2137
|
+
}
|
|
2138
|
+
});
|
|
2139
|
+
// Trigger change detection only if we had direct assignments
|
|
2140
|
+
if (hasDirectAssignments) {
|
|
2141
|
+
this.componentRef.changeDetectorRef.detectChanges();
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
/**
|
|
2145
|
+
* Destroys the Angular component and cleans up resources.
|
|
2146
|
+
* This should be called when the Preact wrapper unmounts.
|
|
2147
|
+
*/
|
|
2148
|
+
destroy() {
|
|
2149
|
+
if (this.isDestroyed) {
|
|
2150
|
+
return;
|
|
2151
|
+
}
|
|
2152
|
+
this.isDestroyed = true;
|
|
2153
|
+
if (this.componentRef) {
|
|
2154
|
+
this.componentRef.destroy();
|
|
2155
|
+
this.componentRef = null;
|
|
2156
|
+
}
|
|
2157
|
+
if (this.element && this.element.parentNode) {
|
|
2158
|
+
this.element.parentNode.removeChild(this.element);
|
|
2159
|
+
}
|
|
2160
|
+
this.element = null;
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* Returns whether the adapter has an active component instance.
|
|
2164
|
+
*/
|
|
2165
|
+
isActive() {
|
|
2166
|
+
return this.componentRef !== null && !this.isDestroyed;
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2070
2170
|
/**
|
|
2071
2171
|
* Service for rendering components dynamically.
|
|
2072
2172
|
*
|
|
@@ -2129,13 +2229,32 @@ class CustomWidgetsService {
|
|
|
2129
2229
|
* @param customWidget - The custom widget component class to register.
|
|
2130
2230
|
*/
|
|
2131
2231
|
registerCustomWidget(customWidgetType, customWidget) {
|
|
2132
|
-
const
|
|
2133
|
-
|
|
2134
|
-
|
|
2232
|
+
const dynamicRenderer = this.dynamicRenderer;
|
|
2233
|
+
/**
|
|
2234
|
+
* Factory function that creates an adapter for the Angular component.
|
|
2235
|
+
* This is called once per component mount by the ExternalComponentAdapterElement.
|
|
2236
|
+
*/
|
|
2237
|
+
const createAdapter = () => {
|
|
2238
|
+
return new AngularComponentAdapter(dynamicRenderer, customWidget);
|
|
2239
|
+
};
|
|
2240
|
+
/**
|
|
2241
|
+
* Preact wrapper component that manages the Angular component lifecycle.
|
|
2242
|
+
* Uses ExternalComponentAdapterElement (which uses hooks internally in the correct Preact context)
|
|
2243
|
+
* to ensure the Angular component is:
|
|
2244
|
+
* - Created once on mount
|
|
2245
|
+
* - Updated in-place on props changes (preserving state)
|
|
2246
|
+
* - Properly destroyed on unmount
|
|
2247
|
+
*/
|
|
2248
|
+
const CustomWidgetWrapper = (props) => {
|
|
2249
|
+
const adapterElementProps = {
|
|
2250
|
+
adapterFactory: createAdapter,
|
|
2251
|
+
componentProps: props,
|
|
2252
|
+
};
|
|
2253
|
+
return createElement(ExternalComponentAdapterElement, adapterElementProps);
|
|
2135
2254
|
};
|
|
2136
2255
|
const customWidgetsMap = this.customWidgetsMap$.value;
|
|
2137
2256
|
if (!customWidgetsMap.has(customWidgetType)) {
|
|
2138
|
-
customWidgetsMap.set(customWidgetType,
|
|
2257
|
+
customWidgetsMap.set(customWidgetType, CustomWidgetWrapper);
|
|
2139
2258
|
this.customWidgetsMap$.next(customWidgetsMap);
|
|
2140
2259
|
}
|
|
2141
2260
|
}
|
|
@@ -2158,8 +2277,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2158
2277
|
}]
|
|
2159
2278
|
}], ctorParameters: function () { return [{ type: DynamicRenderer }]; } });
|
|
2160
2279
|
|
|
2161
|
-
function
|
|
2162
|
-
const { beforeRender, dataReady, beforeMenuOpen, dataPointClick, dataPointContextMenu, dataPointsSelect } =
|
|
2280
|
+
function toPreactWidgetProps(angularProps) {
|
|
2281
|
+
const { beforeRender, dataReady, beforeMenuOpen, dataPointClick, dataPointContextMenu, dataPointsSelect } = angularProps, commonWidgetProps = __rest(angularProps, ["beforeRender", "dataReady", "beforeMenuOpen", "dataPointClick", "dataPointContextMenu", "dataPointsSelect"]);
|
|
2163
2282
|
return Object.assign(Object.assign({}, commonWidgetProps), { onBeforeRender: beforeRender, onDataReady: dataReady, onBeforeMenuOpen: beforeMenuOpen, onDataPointClick: dataPointClick
|
|
2164
2283
|
? (...[point, nativeEvent]) => dataPointClick({
|
|
2165
2284
|
point,
|
|
@@ -2174,8 +2293,8 @@ function translateToPreactWidgetProps(widgetProps) {
|
|
|
2174
2293
|
? (...[points, nativeEvent]) => dataPointsSelect({ points, nativeEvent })
|
|
2175
2294
|
: undefined });
|
|
2176
2295
|
}
|
|
2177
|
-
function
|
|
2178
|
-
const { onBeforeRender, onDataReady, onBeforeMenuOpen, onDataPointClick, onDataPointContextMenu, onDataPointsSelected } =
|
|
2296
|
+
function toWidgetProps$1(preactProps) {
|
|
2297
|
+
const { onBeforeRender, onDataReady, onBeforeMenuOpen, onDataPointClick, onDataPointContextMenu, onDataPointsSelected } = preactProps, commonWidgetProps = __rest(preactProps, ["onBeforeRender", "onDataReady", "onBeforeMenuOpen", "onDataPointClick", "onDataPointContextMenu", "onDataPointsSelected"]);
|
|
2179
2298
|
return Object.assign(Object.assign({}, commonWidgetProps), { beforeRender: onBeforeRender, dataReady: onDataReady, beforeMenuOpen: onBeforeMenuOpen, dataPointClick: onDataPointClick
|
|
2180
2299
|
? ({ point, nativeEvent }) => onDataPointClick(point, nativeEvent)
|
|
2181
2300
|
: undefined, dataPointContextMenu: onDataPointContextMenu
|
|
@@ -2184,12 +2303,24 @@ function translateFromPreactWidgetProps(widgetProps) {
|
|
|
2184
2303
|
? ({ points, nativeEvent }) => onDataPointsSelected(points, nativeEvent)
|
|
2185
2304
|
: undefined });
|
|
2186
2305
|
}
|
|
2306
|
+
function toChartWidgetProps$1(preactProps) {
|
|
2307
|
+
const { onBeforeRender, onDataReady } = preactProps, rest = __rest(preactProps, ["onBeforeRender", "onDataReady"]);
|
|
2308
|
+
return Object.assign(Object.assign({}, rest), { beforeRender: onBeforeRender, dataReady: onDataReady });
|
|
2309
|
+
}
|
|
2310
|
+
function toPivotTableWidgetProps$1(preactProps) {
|
|
2311
|
+
const rest = __rest(preactProps, []);
|
|
2312
|
+
return Object.assign({}, rest);
|
|
2313
|
+
}
|
|
2314
|
+
function toTextWidgetProps$1(preactProps) {
|
|
2315
|
+
const rest = __rest(preactProps, []);
|
|
2316
|
+
return Object.assign({}, rest);
|
|
2317
|
+
}
|
|
2187
2318
|
|
|
2188
|
-
function
|
|
2189
|
-
return Object.assign(Object.assign({},
|
|
2319
|
+
function toPreactDashboardProps(angularProps) {
|
|
2320
|
+
return Object.assign(Object.assign({}, angularProps), { widgets: angularProps.widgets.map(toPreactWidgetProps) });
|
|
2190
2321
|
}
|
|
2191
|
-
function
|
|
2192
|
-
return Object.assign(Object.assign({},
|
|
2322
|
+
function toDashboardProps$1(preactProps) {
|
|
2323
|
+
return Object.assign(Object.assign({}, preactProps), { widgets: preactProps.widgets.map(toWidgetProps$1) });
|
|
2193
2324
|
}
|
|
2194
2325
|
|
|
2195
2326
|
/**
|
|
@@ -2306,9 +2437,9 @@ let DashboardService = class DashboardService {
|
|
|
2306
2437
|
const hookAdapter = new HookAdapter((useComposedDashboardInternal), [createSisenseContextConnector(this.sisenseContextService)]);
|
|
2307
2438
|
const dashboard$ = new BehaviorSubject(initialDashboard);
|
|
2308
2439
|
hookAdapter.subscribe(({ dashboard }) => {
|
|
2309
|
-
dashboard$.next(
|
|
2440
|
+
dashboard$.next(toDashboardProps$1(dashboard));
|
|
2310
2441
|
});
|
|
2311
|
-
hookAdapter.run(
|
|
2442
|
+
hookAdapter.run(toPreactDashboardProps(initialDashboard), options);
|
|
2312
2443
|
const setFilters = createHookApiFacade(hookAdapter, 'setFilters', true);
|
|
2313
2444
|
const setWidgetsLayout = createHookApiFacade(hookAdapter, 'setWidgetsLayout', true);
|
|
2314
2445
|
const destroy = () => {
|
|
@@ -2404,6 +2535,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2404
2535
|
}]
|
|
2405
2536
|
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
2406
2537
|
|
|
2538
|
+
/**
|
|
2539
|
+
* Service for working with shared formulas.
|
|
2540
|
+
*
|
|
2541
|
+
* @group Fusion Assets
|
|
2542
|
+
* @fusionEmbed
|
|
2543
|
+
*/
|
|
2544
|
+
let FormulaService = class FormulaService {
|
|
2545
|
+
constructor(sisenseContextService) {
|
|
2546
|
+
this.sisenseContextService = sisenseContextService;
|
|
2547
|
+
}
|
|
2548
|
+
/**
|
|
2549
|
+
* Fetch a [shared formula](https://docs.sisense.com/main/SisenseLinux/shared-formulas.htm) from a Fusion instance.
|
|
2550
|
+
*
|
|
2551
|
+
* The formula can be identified either by `oid` or by `name` and `dataSource` pair.
|
|
2552
|
+
*
|
|
2553
|
+
* 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.
|
|
2554
|
+
*
|
|
2555
|
+
* ## Example
|
|
2556
|
+
*
|
|
2557
|
+
* Retrieve a shared formula by oid:
|
|
2558
|
+
*
|
|
2559
|
+
* ```ts
|
|
2560
|
+
* try {
|
|
2561
|
+
* const formula = await formulaService.getSharedFormula({
|
|
2562
|
+
* oid: 'd61c337b-fabc-4e9e-b4cc-a30116857153',
|
|
2563
|
+
* });
|
|
2564
|
+
*
|
|
2565
|
+
* if (formula) {
|
|
2566
|
+
* console.log('Formula found:', formula);
|
|
2567
|
+
* } else {
|
|
2568
|
+
* console.log('Formula not found');
|
|
2569
|
+
* }
|
|
2570
|
+
* } catch (error) {
|
|
2571
|
+
* console.error('Error:', error);
|
|
2572
|
+
* }
|
|
2573
|
+
* ```
|
|
2574
|
+
*
|
|
2575
|
+
* ## Example
|
|
2576
|
+
*
|
|
2577
|
+
* Retrieve a shared formula by name and data source:
|
|
2578
|
+
*
|
|
2579
|
+
* ```ts
|
|
2580
|
+
* try {
|
|
2581
|
+
* const formula = await formulaService.getSharedFormula({
|
|
2582
|
+
* name: 'My Shared Formula',
|
|
2583
|
+
* dataSource: DM.DataSource,
|
|
2584
|
+
* });
|
|
2585
|
+
*
|
|
2586
|
+
* if (formula) {
|
|
2587
|
+
* console.log('Formula found:', formula);
|
|
2588
|
+
* } else {
|
|
2589
|
+
* console.log('Formula not found');
|
|
2590
|
+
* }
|
|
2591
|
+
* } catch (error) {
|
|
2592
|
+
* console.error('Error:', error);
|
|
2593
|
+
* }
|
|
2594
|
+
* ```
|
|
2595
|
+
*
|
|
2596
|
+
* @param params - Parameters for retrieving the shared formula. Must include either `oid` or both `name` and `dataSource`.
|
|
2597
|
+
* @returns Promise that resolves to the shared formula, or `null` if not found
|
|
2598
|
+
*/
|
|
2599
|
+
getSharedFormula(params) {
|
|
2600
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2601
|
+
const hookAdapter = new HookAdapter(useGetSharedFormulaInternal, [
|
|
2602
|
+
createSisenseContextConnector(this.sisenseContextService),
|
|
2603
|
+
]);
|
|
2604
|
+
const resultPromise = new Promise((resolve, reject) => {
|
|
2605
|
+
hookAdapter.subscribe((res) => {
|
|
2606
|
+
const { formula, isError, isSuccess, error } = res;
|
|
2607
|
+
if (isError) {
|
|
2608
|
+
reject(error);
|
|
2609
|
+
}
|
|
2610
|
+
else if (isSuccess) {
|
|
2611
|
+
resolve(formula !== null && formula !== void 0 ? formula : null);
|
|
2612
|
+
}
|
|
2613
|
+
});
|
|
2614
|
+
});
|
|
2615
|
+
hookAdapter.run(params);
|
|
2616
|
+
return resultPromise.finally(() => {
|
|
2617
|
+
hookAdapter.destroy();
|
|
2618
|
+
});
|
|
2619
|
+
});
|
|
2620
|
+
}
|
|
2621
|
+
};
|
|
2622
|
+
FormulaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormulaService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2623
|
+
FormulaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormulaService, providedIn: 'root' });
|
|
2624
|
+
FormulaService = __decorate([
|
|
2625
|
+
TrackableService(['getSharedFormula'])
|
|
2626
|
+
], FormulaService);
|
|
2627
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormulaService, decorators: [{
|
|
2628
|
+
type: Injectable,
|
|
2629
|
+
args: [{
|
|
2630
|
+
providedIn: 'root',
|
|
2631
|
+
}]
|
|
2632
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
2633
|
+
|
|
2407
2634
|
/**
|
|
2408
2635
|
* Service for working with Sisense Fusion hierarchies.
|
|
2409
2636
|
*
|
|
@@ -2724,12 +2951,12 @@ let WidgetService = class WidgetService {
|
|
|
2724
2951
|
createThemeContextConnector(this.themeService),
|
|
2725
2952
|
]);
|
|
2726
2953
|
// Convert Angular props to preact props
|
|
2727
|
-
const preactProps =
|
|
2954
|
+
const preactProps = toPreactWidgetProps(widgetProps);
|
|
2728
2955
|
// Subscribe to hook adapter results and capture the subscription
|
|
2729
2956
|
const hookAdapterSubscription = hookAdapter.subscribe((enhancedPreactProps) => {
|
|
2730
2957
|
if (enhancedPreactProps) {
|
|
2731
2958
|
// Convert back to Angular props
|
|
2732
|
-
const angularProps =
|
|
2959
|
+
const angularProps = toWidgetProps$1(enhancedPreactProps);
|
|
2733
2960
|
enhancedProps$.next(angularProps);
|
|
2734
2961
|
}
|
|
2735
2962
|
else {
|
|
@@ -3961,7 +4188,7 @@ class DashboardComponent {
|
|
|
3961
4188
|
}
|
|
3962
4189
|
}
|
|
3963
4190
|
getPreactComponentProps() {
|
|
3964
|
-
return
|
|
4191
|
+
return toPreactDashboardProps({
|
|
3965
4192
|
title: this.title,
|
|
3966
4193
|
layoutOptions: this.layoutOptions,
|
|
3967
4194
|
config: this.config,
|
|
@@ -5604,7 +5831,7 @@ class WidgetComponent {
|
|
|
5604
5831
|
}
|
|
5605
5832
|
getPreactComponentProps() {
|
|
5606
5833
|
var _a, _b, _c;
|
|
5607
|
-
return
|
|
5834
|
+
return toPreactWidgetProps({
|
|
5608
5835
|
id: this.id,
|
|
5609
5836
|
widgetType: this.widgetType,
|
|
5610
5837
|
chartType: this.chartType,
|
|
@@ -6020,7 +6247,7 @@ export class DashboardComponent {
|
|
|
6020
6247
|
* ```
|
|
6021
6248
|
*/
|
|
6022
6249
|
function toDashboardProps(dashboardModel) {
|
|
6023
|
-
return dashboardModelTranslator$1.toDashboardProps(dashboardModel);
|
|
6250
|
+
return toDashboardProps$1(dashboardModelTranslator$1.toDashboardProps(dashboardModel));
|
|
6024
6251
|
}
|
|
6025
6252
|
|
|
6026
6253
|
var dashboardModelTranslator = /*#__PURE__*/Object.freeze({
|
|
@@ -6043,7 +6270,7 @@ var dashboardModelTranslator = /*#__PURE__*/Object.freeze({
|
|
|
6043
6270
|
* @returns A new dashboard instance with the updated filters.
|
|
6044
6271
|
*/
|
|
6045
6272
|
const replaceFilters = (dashboard, newFilters) => {
|
|
6046
|
-
return dashboardHelpers$1.replaceFilters(dashboard, newFilters);
|
|
6273
|
+
return toDashboardProps$1(dashboardHelpers$1.replaceFilters(toPreactDashboardProps(dashboard), newFilters));
|
|
6047
6274
|
};
|
|
6048
6275
|
/**
|
|
6049
6276
|
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.addFilter}
|
|
@@ -6060,7 +6287,7 @@ const replaceFilters = (dashboard, newFilters) => {
|
|
|
6060
6287
|
* @returns A new dashboard instance with the new filter added.
|
|
6061
6288
|
*/
|
|
6062
6289
|
const addFilter = (dashboard, newFilter) => {
|
|
6063
|
-
return dashboardHelpers$1.addFilter(dashboard, newFilter);
|
|
6290
|
+
return toDashboardProps$1(dashboardHelpers$1.addFilter(toPreactDashboardProps(dashboard), newFilter));
|
|
6064
6291
|
};
|
|
6065
6292
|
/**
|
|
6066
6293
|
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.addFilters}
|
|
@@ -6077,7 +6304,7 @@ const addFilter = (dashboard, newFilter) => {
|
|
|
6077
6304
|
* @returns A new dashboard instance with the new filters added.
|
|
6078
6305
|
*/
|
|
6079
6306
|
const addFilters = (dashboard, newFilters) => {
|
|
6080
|
-
return dashboardHelpers$1.addFilters(dashboard, newFilters);
|
|
6307
|
+
return toDashboardProps$1(dashboardHelpers$1.addFilters(toPreactDashboardProps(dashboard), newFilters));
|
|
6081
6308
|
};
|
|
6082
6309
|
/**
|
|
6083
6310
|
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.replaceFilter}
|
|
@@ -6096,7 +6323,7 @@ const addFilters = (dashboard, newFilters) => {
|
|
|
6096
6323
|
* @returns A new dashboard instance with the specified filter replaced.
|
|
6097
6324
|
*/
|
|
6098
6325
|
const replaceFilter = (dashboard, filterToReplace, newFilter) => {
|
|
6099
|
-
return dashboardHelpers$1.replaceFilter(dashboard, filterToReplace, newFilter);
|
|
6326
|
+
return toDashboardProps$1(dashboardHelpers$1.replaceFilter(toPreactDashboardProps(dashboard), filterToReplace, newFilter));
|
|
6100
6327
|
};
|
|
6101
6328
|
/**
|
|
6102
6329
|
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.removeFilter}
|
|
@@ -6113,7 +6340,7 @@ const replaceFilter = (dashboard, filterToReplace, newFilter) => {
|
|
|
6113
6340
|
* @returns A new dashboard instance with the specified filter removed.
|
|
6114
6341
|
*/
|
|
6115
6342
|
const removeFilter = (dashboard, filterToRemove) => {
|
|
6116
|
-
return dashboardHelpers$1.removeFilter(dashboard, filterToRemove);
|
|
6343
|
+
return toDashboardProps$1(dashboardHelpers$1.removeFilter(toPreactDashboardProps(dashboard), filterToRemove));
|
|
6117
6344
|
};
|
|
6118
6345
|
/**
|
|
6119
6346
|
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.removeFilters}
|
|
@@ -6130,7 +6357,7 @@ const removeFilter = (dashboard, filterToRemove) => {
|
|
|
6130
6357
|
* @returns A new dashboard instance with the specified filters removed.
|
|
6131
6358
|
*/
|
|
6132
6359
|
const removeFilters = (dashboard, filtersToRemove) => {
|
|
6133
|
-
return dashboardHelpers$1.removeFilters(dashboard, filtersToRemove);
|
|
6360
|
+
return toDashboardProps$1(dashboardHelpers$1.removeFilters(toPreactDashboardProps(dashboard), filtersToRemove));
|
|
6134
6361
|
};
|
|
6135
6362
|
|
|
6136
6363
|
var dashboardHelpers = /*#__PURE__*/Object.freeze({
|
|
@@ -6143,6 +6370,19 @@ var dashboardHelpers = /*#__PURE__*/Object.freeze({
|
|
|
6143
6370
|
replaceFilters: replaceFilters
|
|
6144
6371
|
});
|
|
6145
6372
|
|
|
6373
|
+
function toChartProps$1(preactProps) {
|
|
6374
|
+
const { onBeforeRender, onDataReady } = preactProps, rest = __rest(preactProps, ["onBeforeRender", "onDataReady"]);
|
|
6375
|
+
return Object.assign(Object.assign({}, rest), { beforeRender: onBeforeRender, dataReady: onDataReady });
|
|
6376
|
+
}
|
|
6377
|
+
function toTableProps$1(preactProps) {
|
|
6378
|
+
const { onDataReady } = preactProps, rest = __rest(preactProps, ["onDataReady"]);
|
|
6379
|
+
return Object.assign(Object.assign({}, rest), { dataReady: onDataReady });
|
|
6380
|
+
}
|
|
6381
|
+
function toPivotTableProps$1(preactProps) {
|
|
6382
|
+
const rest = __rest(preactProps, []);
|
|
6383
|
+
return Object.assign({}, rest);
|
|
6384
|
+
}
|
|
6385
|
+
|
|
6146
6386
|
/**
|
|
6147
6387
|
* Translates a {@link WidgetModel} to the parameters for executing a query for the widget.
|
|
6148
6388
|
*
|
|
@@ -6229,7 +6469,7 @@ export class ExampleComponent {
|
|
|
6229
6469
|
* Use {@link toPivotTableProps} instead for getting props for the {@link PivotTableComponent}.
|
|
6230
6470
|
*/
|
|
6231
6471
|
function toChartProps(widgetModel) {
|
|
6232
|
-
return widgetModelTranslator$1.toChartProps(widgetModel);
|
|
6472
|
+
return toChartProps$1(widgetModelTranslator$1.toChartProps(widgetModel));
|
|
6233
6473
|
}
|
|
6234
6474
|
/**
|
|
6235
6475
|
* Translates a {@link WidgetModel} to the props for rendering a table.
|
|
@@ -6278,7 +6518,7 @@ export class ExampleComponent {
|
|
|
6278
6518
|
* Use {@link toPivotTableProps} instead for getting props for the {@link PivotTableComponent}.
|
|
6279
6519
|
*/
|
|
6280
6520
|
function toTableProps(widgetModel) {
|
|
6281
|
-
return widgetModelTranslator$1.toTableProps(widgetModel);
|
|
6521
|
+
return toTableProps$1(widgetModelTranslator$1.toTableProps(widgetModel));
|
|
6282
6522
|
}
|
|
6283
6523
|
/**
|
|
6284
6524
|
* Translates a {@link WidgetModel} to the props for rendering a pivot table.
|
|
@@ -6327,7 +6567,7 @@ export class ExampleComponent {
|
|
|
6327
6567
|
* Use {@link toTableProps} instead for getting props for the {@link TableComponent}.
|
|
6328
6568
|
*/
|
|
6329
6569
|
function toPivotTableProps(widgetModel) {
|
|
6330
|
-
return widgetModelTranslator$1.toPivotTableProps(widgetModel);
|
|
6570
|
+
return toPivotTableProps$1(widgetModelTranslator$1.toPivotTableProps(widgetModel));
|
|
6331
6571
|
}
|
|
6332
6572
|
/**
|
|
6333
6573
|
* Translates a {@link WidgetModel} to the props for rendering a chart widget.
|
|
@@ -6376,7 +6616,7 @@ export class ExampleComponent {
|
|
|
6376
6616
|
* Note: this method is not supported for pivot widgets.
|
|
6377
6617
|
*/
|
|
6378
6618
|
function toChartWidgetProps(widgetModel) {
|
|
6379
|
-
return widgetModelTranslator$1.toChartWidgetProps(widgetModel);
|
|
6619
|
+
return toChartWidgetProps$1(widgetModelTranslator$1.toChartWidgetProps(widgetModel));
|
|
6380
6620
|
}
|
|
6381
6621
|
/**
|
|
6382
6622
|
* Translates a {@link WidgetModel} to the props for rendering a pivot table widget.
|
|
@@ -6424,7 +6664,7 @@ export class ExampleComponent {
|
|
|
6424
6664
|
* Use {@link toChartWidgetProps} instead for getting props for the {@link ChartWidgetComponent}.
|
|
6425
6665
|
*/
|
|
6426
6666
|
function toPivotTableWidgetProps(widgetModel) {
|
|
6427
|
-
return widgetModelTranslator$1.toPivotTableWidgetProps(widgetModel);
|
|
6667
|
+
return toPivotTableWidgetProps$1(widgetModelTranslator$1.toPivotTableWidgetProps(widgetModel));
|
|
6428
6668
|
}
|
|
6429
6669
|
/**
|
|
6430
6670
|
* Translates a {@link WidgetModel} to the props for rendering a text widget.
|
|
@@ -6443,7 +6683,7 @@ const textWidgetProps = widgetModelTranslator.toTextWidgetProps(widgetModel);
|
|
|
6443
6683
|
* Use {@link toPivotTableWidgetProps} instead for getting props for the pivot table widget.
|
|
6444
6684
|
*/
|
|
6445
6685
|
function toTextWidgetProps(widgetModel) {
|
|
6446
|
-
return widgetModelTranslator$1.toTextWidgetProps(widgetModel);
|
|
6686
|
+
return toTextWidgetProps$1(widgetModelTranslator$1.toTextWidgetProps(widgetModel));
|
|
6447
6687
|
}
|
|
6448
6688
|
/**
|
|
6449
6689
|
* Translates {@link WidgetModel} to {@link WidgetProps}.
|
|
@@ -6494,7 +6734,7 @@ function toTextWidgetProps(widgetModel) {
|
|
|
6494
6734
|
* ```
|
|
6495
6735
|
*/
|
|
6496
6736
|
function toWidgetProps(widgetModel) {
|
|
6497
|
-
return widgetModelTranslator$1.toWidgetProps(widgetModel);
|
|
6737
|
+
return toWidgetProps$1(widgetModelTranslator$1.toWidgetProps(widgetModel));
|
|
6498
6738
|
}
|
|
6499
6739
|
|
|
6500
6740
|
var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
@@ -6518,5 +6758,5 @@ var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
|
6518
6758
|
* Generated bundle index. Do not edit.
|
|
6519
6759
|
*/
|
|
6520
6760
|
|
|
6521
|
-
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 };
|
|
6761
|
+
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 };
|
|
6522
6762
|
//# sourceMappingURL=sisense-sdk-ui-angular.mjs.map
|