@luzmo/embed 6.1.0-beta.7 → 6.1.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/index.js CHANGED
@@ -10,1167 +10,285 @@ var __decorateClass = (decorators, target, key, kind) => {
10
10
  return result;
11
11
  };
12
12
 
13
- // libs/embed-libs/embed/src/index.ts
14
- import { selectedDataUtils } from "@luzmo/shared-embed";
15
-
16
- // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
17
- import {
18
- customElement
19
- } from "lit/decorators.js";
20
-
21
- // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
22
- import * as SharedLib2 from "@luzmo/shared-embed";
23
- import {
24
- html,
25
- LitElement
26
- } from "lit";
27
- import {
28
- property,
29
- query,
30
- state
31
- } from "lit/decorators.js";
32
- import {
33
- styleMap
34
- } from "lit/directives/style-map.js";
35
- import {
36
- luzmoEmbedContainerClass
37
- } from "@luzmo/shared-embed";
13
+ // libs/dashboard-contents-types/src/lib/column-chart/column-chart-options.ts
14
+ var ColumnChartModes = /* @__PURE__ */ ((ColumnChartModes2) => {
15
+ ColumnChartModes2["Grouped"] = "grouped";
16
+ ColumnChartModes2["Stacked"] = "stacked";
17
+ ColumnChartModes2["Percentage"] = "100";
18
+ return ColumnChartModes2;
19
+ })(ColumnChartModes || {});
38
20
 
39
- // libs/embed-libs/embed/package.json
40
- var version = "6.1.0-beta.7";
21
+ // libs/dashboard-contents-types/src/lib/regular-table/regular-table-options.ts
22
+ var RegularTableSortingMode = /* @__PURE__ */ ((RegularTableSortingMode2) => {
23
+ RegularTableSortingMode2["SingleColumn"] = "singleColumn";
24
+ RegularTableSortingMode2["MultiColumn"] = "multiColumn";
25
+ return RegularTableSortingMode2;
26
+ })(RegularTableSortingMode || {});
41
27
 
42
- // libs/embed-libs/embed/src/lib/luzmo-service.ts
43
- var LuzmoService = class {
44
- constructor() {
45
- this._components = [];
46
- }
28
+ // libs/dashboard-contents-types/assets/json-schemas/viz-item-type.schema.json
29
+ var viz_item_type_schema_default = {
30
+ $id: "https://developer.luzmo.com/assets/json-schemas/0.1.88/viz-item-type.schema.json",
31
+ $schema: "http://json-schema.org/draft-07/schema#",
32
+ enum: [
33
+ "area-chart",
34
+ "bar-chart",
35
+ "box-plot",
36
+ "bubble-chart",
37
+ "bullet-chart",
38
+ "choropleth-map",
39
+ "circle-pack-chart",
40
+ "circular-gauge",
41
+ "column-chart",
42
+ "combination-chart",
43
+ "conditional-number",
44
+ "date-filter",
45
+ "donut-chart",
46
+ "dropdown-filter",
47
+ "dynamic-imageobject",
48
+ "evolution-number",
49
+ "funnel-chart",
50
+ "heat-map",
51
+ "heat-table",
52
+ "hexbin-map",
53
+ "iframeobject",
54
+ "image",
55
+ "line-chart",
56
+ "line-chart-forecast",
57
+ "marker-map",
58
+ "ohlc-chart",
59
+ "parallel-coordinates-plot",
60
+ "pivot-table",
61
+ "pyramid-chart",
62
+ "radar-chart",
63
+ "regular-table",
64
+ "route-map",
65
+ "sankey-diagram",
66
+ "scatter-plot",
67
+ "slicer-filter",
68
+ "slider-filter",
69
+ "spacer",
70
+ "speedometer-chart",
71
+ "spike-map",
72
+ "strip-plot",
73
+ "sunburst-chart",
74
+ "symbol-map",
75
+ "text",
76
+ "treemap-chart",
77
+ "venn-diagram",
78
+ "video",
79
+ "wordcloud-chart"
80
+ ],
81
+ type: "string"
47
82
  };
48
- var luzmo_service_default = new LuzmoService();
49
83
 
50
- // libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
51
- import * as SharedLib from "@luzmo/shared-embed";
52
- var _setEventHandler = () => {
53
- if (typeof window.__luzmoMessageHandler === "function") {
54
- return;
55
- }
56
- window.__luzmoMessageHandler = (event) => {
57
- const dashboardComponent = luzmo_service_default._components.find(
58
- (c) => event.data.name === c._iframeId
59
- );
60
- if (!dashboardComponent) {
61
- return;
62
- }
63
- switch (event.data?.type) {
64
- case "load": {
65
- dashboardComponent.dispatchEvent(
66
- new CustomEvent("load", { detail: { data: event.data } })
67
- );
68
- if (dashboardComponent._loadTimeoutHandle) {
69
- clearTimeout(dashboardComponent._loadTimeoutHandle);
70
- dashboardComponent._loadTimeoutHandle = void 0;
71
- }
72
- dashboardComponent.iframeLoaded = true;
73
- dashboardComponent.dimensions = event.data.dimensions;
74
- dashboardComponent._calculateDimAfterDashboardLoaded();
75
- break;
76
- }
77
- case "error": {
78
- dashboardComponent.dashboardError = true;
79
- if (dashboardComponent._loadTimeoutHandle) {
80
- clearTimeout(dashboardComponent._loadTimeoutHandle);
81
- dashboardComponent._loadTimeoutHandle = void 0;
82
- }
83
- dashboardComponent.iframeLoaded = true;
84
- dashboardComponent._displayError();
85
- console.error("Dashboard error: ", event.data.errorMsg ?? event.data.error?.msg);
86
- break;
87
- }
88
- case "data": {
89
- SharedLib.resolvePromise(
90
- dashboardComponent,
91
- event.data.requestId,
92
- event.data.data
93
- );
94
- break;
95
- }
96
- case "filters": {
97
- SharedLib.resolvePromise(
98
- dashboardComponent,
99
- event.data.requestId,
100
- event.data.filters
101
- );
102
- break;
103
- }
104
- case "getAccessibleDashboards": {
105
- SharedLib.resolvePromise(
106
- dashboardComponent,
107
- event.data.requestId,
108
- event.data.accessibleDashboards
109
- );
110
- break;
111
- }
112
- case "dashboardAction": {
113
- dashboardComponent.dispatchEvent(
114
- new CustomEvent("dashboardAction", { detail: { data: event.data } })
115
- );
116
- break;
117
- }
118
- case "export": {
119
- if (event.data.error) {
120
- SharedLib.rejectPromise(
121
- dashboardComponent,
122
- event.data.requestId,
123
- event.data
124
- );
125
- } else {
126
- dashboardComponent.dispatchEvent(
127
- new CustomEvent("exported", { detail: { data: event.data } })
128
- );
129
- SharedLib.resolvePromise(
130
- dashboardComponent,
131
- event.data.requestId,
132
- event.data
133
- );
134
- }
135
- break;
136
- }
137
- case "changedFilters": {
138
- dashboardComponent.dispatchEvent(
139
- new CustomEvent("changedFilters", { detail: { data: event.data } })
140
- );
141
- break;
142
- }
143
- case "customEvent": {
144
- dashboardComponent.dispatchEvent(
145
- new CustomEvent("customEvent", { detail: { data: event.data } })
146
- );
147
- break;
148
- }
149
- case "chartsRendered":
150
- case "itemsRendered": {
151
- event.data.type = "itemsRendered";
152
- dashboardComponent.dispatchEvent(
153
- new CustomEvent("itemsRendered", { detail: { data: event.data } })
154
- );
155
- break;
156
- }
157
- case "setEditMode": {
158
- if (event.data.error) {
159
- SharedLib.rejectPromise(
160
- dashboardComponent,
161
- event.data.requestId,
162
- event.data
163
- );
164
- } else {
165
- SharedLib.resolvePromise(
166
- dashboardComponent,
167
- event.data.requestId,
168
- event.data
169
- );
170
- dashboardComponent.params.editMode = event.data.editMode;
171
- dashboardComponent._containerStyle = SharedLib.containerStyles(dashboardComponent);
172
- if (dashboardComponent.dimensions) {
173
- SharedLib._setCalculatedDimensions(dashboardComponent);
174
- }
175
- }
176
- break;
177
- }
178
- case "setSelectedData":
179
- case "setFilters": {
180
- event.data.error ? SharedLib.rejectPromise(
181
- dashboardComponent,
182
- event.data.requestId,
183
- event.data
184
- ) : SharedLib.resolvePromise(
185
- dashboardComponent,
186
- event.data.requestId,
187
- event.data
188
- );
189
- break;
190
- }
191
- case "setPreview": {
192
- event.data.error ? SharedLib.rejectPromise(
193
- dashboardComponent,
194
- event.data.requestId,
195
- event.data
196
- ) : SharedLib.resolvePromise(
197
- dashboardComponent,
198
- event.data.requestId,
199
- event.data
200
- );
201
- break;
202
- }
84
+ // libs/dashboard-contents-types/assets/json-schemas/options.schema.json
85
+ var options_schema_default = {
86
+ $id: "https://developer.luzmo.com/assets/json-schemas/0.1.88/options.schema.json",
87
+ $schema: "http://json-schema.org/draft-07/schema#",
88
+ anyOf: [
89
+ {
90
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/area-chart-options.schema.json"
91
+ },
92
+ {
93
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bar-chart-options.schema.json"
94
+ },
95
+ {
96
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/box-plot-options.schema.json"
97
+ },
98
+ {
99
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bubble-chart-options.schema.json"
100
+ },
101
+ {
102
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bullet-chart-options.schema.json"
103
+ },
104
+ {
105
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/choropleth-map-options.schema.json"
106
+ },
107
+ {
108
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/circular-gauge-options.schema.json"
109
+ },
110
+ {
111
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/column-chart-options.schema.json"
112
+ },
113
+ {
114
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/combination-chart-options.schema.json"
115
+ },
116
+ {
117
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/date-filter-options.schema.json"
118
+ },
119
+ {
120
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/donut-chart-options.schema.json"
121
+ },
122
+ {
123
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/dropdown-filter-options.schema.json"
124
+ },
125
+ {
126
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/evolution-number-options.schema.json"
127
+ },
128
+ {
129
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/funnel-chart-options.schema.json"
130
+ },
131
+ {
132
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/image-options.schema.json"
133
+ },
134
+ {
135
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/line-chart-options.schema.json"
136
+ },
137
+ {
138
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/pivot-table-options.schema.json"
139
+ },
140
+ {
141
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/regular-table-options.schema.json"
142
+ },
143
+ {
144
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/sankey-diagram-options.schema.json"
145
+ },
146
+ {
147
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/scatter-plot-options.schema.json"
148
+ },
149
+ {
150
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/slicer-filter-options.schema.json"
151
+ },
152
+ {
153
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/slider-filter-options.schema.json"
154
+ },
155
+ {
156
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/text-options.schema.json"
203
157
  }
204
- };
205
- window.addEventListener("message", window.__luzmoMessageHandler, false);
158
+ ]
206
159
  };
207
160
 
208
- // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-styles.ts
209
- import { css } from "lit";
210
- var dashboardStyles = css`
211
- :host {
212
- display: block;
213
- height: 100%;
214
- }
215
-
216
- @-webkit-keyframes spin {
217
- 0% {
218
- -webkit-transform: rotate(0deg);
219
- transform: rotate(0deg);
220
- }
221
- 100% {
222
- -webkit-transform: rotate(360deg);
223
- transform: rotate(360deg);
161
+ // libs/dashboard-contents-types/assets/json-schemas/slots.schema.json
162
+ var slots_schema_default = {
163
+ $id: "https://developer.luzmo.com/assets/json-schemas/0.1.88/slots.schema.json",
164
+ $schema: "http://json-schema.org/draft-07/schema#",
165
+ anyOf: [
166
+ {
167
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/area-chart-slots.schema.json"
168
+ },
169
+ {
170
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bar-chart-slots.schema.json"
171
+ },
172
+ {
173
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/box-plot-slots.schema.json"
174
+ },
175
+ {
176
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bubble-chart-slots.schema.json"
177
+ },
178
+ {
179
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bullet-chart-slots.schema.json"
180
+ },
181
+ {
182
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/choropleth-map-slots.schema.json"
183
+ },
184
+ {
185
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/circular-gauge-slots.schema.json"
186
+ },
187
+ {
188
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/column-chart-slots.schema.json"
189
+ },
190
+ {
191
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/combination-chart-slots.schema.json"
192
+ },
193
+ {
194
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/date-filter-slots.schema.json"
195
+ },
196
+ {
197
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/donut-chart-slots.schema.json"
198
+ },
199
+ {
200
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/dropdown-filter-slots.schema.json"
201
+ },
202
+ {
203
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/evolution-number-slots.schema.json"
204
+ },
205
+ {
206
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/funnel-chart-slots.schema.json"
207
+ },
208
+ {
209
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/line-chart-slots.schema.json"
210
+ },
211
+ {
212
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/pivot-table-slots.schema.json"
213
+ },
214
+ {
215
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/regular-table-slots.schema.json"
216
+ },
217
+ {
218
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/sankey-diagram-slots.schema.json"
219
+ },
220
+ {
221
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/scatter-plot-slots.schema.json"
222
+ },
223
+ {
224
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/slicer-filter-slots.schema.json"
225
+ },
226
+ {
227
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/slider-filter-slots.schema.json"
224
228
  }
225
- }
229
+ ]
230
+ };
226
231
 
227
- @keyframes spin {
228
- 0% {
229
- -webkit-transform: rotate(0deg);
230
- transform: rotate(0deg);
231
- }
232
- 100% {
233
- -webkit-transform: rotate(360deg);
234
- transform: rotate(360deg);
232
+ // libs/dashboard-contents-types/assets/json-schemas/area-chart.schema.json
233
+ var area_chart_schema_default = {
234
+ $schema: "http://json-schema.org/draft-07/schema#",
235
+ $id: "https://developer.luzmo.com/assets/json-schemas/0.1.88/area-chart.schema.json",
236
+ type: "object",
237
+ description: "Area Chart item",
238
+ properties: {
239
+ type: {
240
+ description: "Type of the item",
241
+ type: "string",
242
+ const: "area-chart"
243
+ },
244
+ options: {
245
+ description: "Options of the Area Chart item",
246
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/area-chart-options.schema.json"
247
+ },
248
+ slots: {
249
+ description: "Data definition of the Area Chart item",
250
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/area-chart-slots.schema.json"
235
251
  }
236
252
  }
237
- :host {
238
- position: relative;
239
- width: 100%;
240
- }
241
-
242
- .luzmo-embed-dashboard {
243
- background: transparent;
244
- padding: 0;
245
- border: 0;
246
- }
247
-
248
- .luzmo-embed-dashboard-ede {
249
- }
250
-
251
- .luzmo-embed-container-ede {
252
- width: 100%;
253
- height: 100%;
254
- }
255
-
256
- .luzmo-container-loader {
257
- width: 100%;
258
- position: relative;
259
- }
260
-
261
- .luzmo-lc {
262
- margin: 0 auto;
263
- }
264
-
265
- .luzmo-loading-message {
266
- width: 100%;
267
- height: 20px;
268
- text-align: center;
269
- margin-bottom: 16px;
270
- font-family: Helvetica, Arial, sans-serif;
271
- font-size: 14px;
272
- }
273
-
274
- .luzmo-loading-circle {
275
- box-sizing: border-box;
276
- margin: 16px auto;
277
- position: relative;
278
- text-indent: -9999em;
279
- animation: spin 0.6s infinite linear;
280
- }
281
-
282
- .luzmo-loading-circle,
283
- .luzmo-loading-circle:after {
284
- border-radius: 50%;
285
- width: 32px;
286
- height: 32px;
287
- }
288
-
289
- .itemEmbedding:after {
290
- width: 24px;
291
- height: 24px;
292
- }
293
-
294
- .luzmo-error {
295
- background: transparent;
296
- padding: 48px 0;
297
- margin: 0 auto;
298
- width: 80%;
299
- border: 0;
300
- text-align: center;
301
- min-height: 192px;
302
- }
303
-
304
- .dashboard-error {
305
- font-size: 30px;
306
- background: transparent;
307
- padding: 48px 0;
308
- margin: 0 auto;
309
- width: 80%;
310
- border: 0;
311
- text-align: center;
312
- min-height: 192px;
313
- }
314
-
315
- .luzmo-loader {
316
- top: 0;
317
- left: 0;
318
- width: 100%;
319
- min-height: 400px;
320
- position: absolute;
321
- transition-duration: 0.3s;
322
- }
323
- `;
253
+ };
324
254
 
325
- // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
326
- var LuzmoDashboard = class extends LitElement {
327
- constructor() {
328
- super();
329
- this.language = "auto";
330
- this.screenMode = "auto";
331
- this.switchScreenModeOnResize = true;
332
- this.editMode = "view";
333
- this.experimental = false;
334
- this.iframeStyle = {};
335
- this._containerStyle = {};
336
- this._loaderStyle = {};
337
- this._lcStyle = {};
338
- this._loadingCircleStyle = {};
339
- this._containerLoaderStyle = {};
340
- this._loaderMsg = "";
341
- this._itemEmbedding = false;
342
- this.browserError = false;
343
- this.browserErrorMsg = "";
344
- this.dashboardError = false;
345
- this.browserNotSupported = [];
346
- this.libVersion = version + "-wc-luzmo";
347
- this.isLibraryLoaded = false;
348
- this.currentAuthKey = null;
349
- this.currentAuthToken = null;
350
- this.isInitCalled = false;
351
- this.attributesMap = {
352
- dashboardId: "dashboard-id",
353
- dashboardSlug: "dashboard-slug",
354
- itemId: "item-id",
355
- language: "language",
356
- qeVersion: "qe-version",
357
- screenMode: "screen-mode",
358
- switchScreenModeOnResize: "switch-screen-mode-on-resize",
359
- authKey: "auth-key",
360
- authToken: "auth-token",
361
- editMode: "edit-mode",
362
- mainColor: "main-color",
363
- accentColor: "accent-color",
364
- loaderBackground: "loader-background",
365
- loaderFontColor: "loader-font-color",
366
- loaderSpinnerColor: "loader-spinner-color",
367
- loaderSpinnerBackground: "loader-spinner-background",
368
- appServer: "app-server",
369
- apiHost: "api-host",
370
- itemDimensions: "item-dimensions",
371
- timezoneId: "timezone-id"
372
- };
373
- this.loaderSize = 32;
374
- this.borderWidth = 3;
375
- this.minHeight = 400;
376
- this._containerId = SharedLib2.uuidv4();
377
- this._iframeId = `luzmo-dashboard-${this._containerId}`;
378
- this.iframeLoaded = false;
379
- this.promises = {};
380
- this.params = this._setOptions();
381
- this._onResize = () => {
382
- if (this.shadowRoot?.querySelector(".dashboard-container")) {
383
- this.containerWidth = this.luzmoEmbedContainer.offsetWidth;
384
- if (this.params.switchScreenModeOnResize && this.params.screenMode === "auto") {
385
- for (const d of SharedLib2.EXTENTS) {
386
- if (d.width[0] <= window.innerWidth && window.innerWidth <= d.width[1]) {
387
- this.currentScreenMode = d.mode;
388
- }
389
- }
390
- }
391
- if (this.iframeLoaded) {
392
- this._calculateDimAfterDashboardLoaded();
393
- } else {
394
- if (this.dimensions) {
395
- this.containerWidth = this.luzmoEmbedContainer.offsetWidth;
396
- SharedLib2._setCalculatedDimensions(this);
397
- }
398
- }
399
- }
400
- };
401
- this._resizeObserver = new ResizeObserver((entries) => {
402
- window.requestAnimationFrame(() => {
403
- if (!Array.isArray(entries) || entries.length === 0) {
404
- return;
405
- }
406
- this._onResize();
407
- });
408
- });
409
- }
410
- // Set resize event listener
411
- connectedCallback() {
412
- super.connectedCallback();
413
- }
414
- // Set resize event listener
415
- disconnectedCallback() {
416
- super.disconnectedCallback();
417
- this._resizeObserver.disconnect();
418
- for (const promiseKey of Object.keys(this.promises)) {
419
- this.promises[promiseKey].reject(
420
- new Error("Dashboard component was removed")
421
- );
422
- }
423
- }
424
- firstUpdated() {
425
- this._loaderMsg = SharedLib2.getLoader(this)?.loadingMsg;
426
- this._loaderStyles();
427
- luzmo_service_default._components.push(this);
428
- if (this.luzmoEmbedContainer) {
429
- this._resizeObserver.observe(this.luzmoEmbedContainer);
430
- }
431
- }
432
- initComponent() {
433
- this.params = this._setOptions();
434
- if (this.getIsViewMode()) {
435
- SharedLib2.loadLibrary(this.params.appServer).then(async () => {
436
- this.isLibraryLoaded = true;
437
- await this.updateComplete;
438
- const oldReference = this.renderRoot.querySelector("dashboard-component");
439
- this.dashboardReference = oldReference.cloneNode(true);
440
- oldReference.replaceWith(this.dashboardReference);
441
- this.dashboardReference.addEventListener("load", (payload) => {
442
- this.containerWidth = this.dashboardReference.offsetWidth;
443
- this.dimensions = payload.detail.dimensions;
444
- SharedLib2._setCalculatedDimensions(this);
445
- window.dispatchEvent(new Event("resize"));
446
- this.dispatchEvent(new CustomEvent("load", payload));
447
- });
448
- this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
449
- this.dashboardReference.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
450
- this.dashboardReference.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
451
- this.dashboardReference.addEventListener("dashboardAction", (payload) => this.dispatchEvent(new CustomEvent("dashboardAction", payload)));
452
- this.dashboardReference.addEventListener("export", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
453
- this.setAllAttributes();
454
- });
455
- } else {
456
- this.containerWidth = this.container?.clientWidth;
457
- SharedLib2._extendAndValidate(this);
458
- SharedLib2._browserCheck(this);
459
- this._setupLoader();
460
- if (!this.params.error) {
461
- this._loaderStyles();
462
- _setEventHandler();
463
- this._iframeUrl = SharedLib2.createIframeUrl(this);
464
- this.iframe?.setAttribute("src", this._iframeUrl);
465
- this.iframeStyle = SharedLib2.calculateIframeStyles(this);
466
- }
467
- }
468
- }
469
- setAllAttributes() {
470
- if (this.dashboardReference) {
471
- for (const key in this.attributesMap) {
472
- if (!["authKey", "authToken", "apiHost", "itemDimensions"].includes(key) && this.params[key]) {
473
- this.dashboardReference.setAttribute(this.attributesMap[key], this.params[key]);
474
- }
475
- }
476
- if (this.params.itemDimensions) {
477
- this.dashboardReference.setAttribute("item-dimensions", JSON.stringify(this.params.itemDimensions));
478
- }
479
- if (this.params.apiHost) {
480
- this.dashboardReference.setAttribute("api-host", SharedLib2.removeTrailingSlash(this.params.apiHost));
481
- }
482
- if (this.params.key) {
483
- this.dashboardReference.setAttribute("auth-key", this.params.key);
484
- }
485
- if (this.params.token) {
486
- this.dashboardReference.setAttribute("auth-token", this.params.token);
487
- }
488
- }
489
- }
490
- // Reload dashboard when triggerproperty changes
491
- updated(changedProperties) {
492
- const triggerProperties = /* @__PURE__ */ new Set([
493
- "dashboardId",
494
- "dashboardSlug",
495
- "itemId",
496
- "language",
497
- "qeVersion",
498
- "editMode",
499
- "screenMode",
500
- "switchScreenModeOnResize",
501
- "authToken",
502
- "authKey",
503
- "appServer",
504
- "timezoneId",
505
- "itemDimensions"
506
- ]);
507
- const conditionsToCheck = ["dashboardId", "dashboardSlug", "itemId"];
508
- let callInitComponent = false;
509
- for (const condition of conditionsToCheck) {
510
- callInitComponent = callInitComponent || changedProperties.get(condition) === void 0 && this[condition] !== void 0;
511
- }
512
- if (callInitComponent && !this.isInitCalled) {
513
- this.initComponent();
514
- this.isInitCalled = true;
515
- return;
516
- }
517
- if (this.getIsViewMode()) {
518
- if (this.dashboardReference) {
519
- for (const [propertyName] of changedProperties.entries()) {
520
- if (propertyName === "appSever") {
521
- SharedLib2.loadLibrary(changedProperties[propertyName]).then(async () => {
522
- this.isLibraryLoaded = true;
523
- await this.updateComplete;
524
- this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
525
- this.setAllAttributes();
526
- });
527
- } else if (this.attributesMap[propertyName]) {
528
- const mappedAttributeName = this.attributesMap[propertyName] ?? propertyName;
529
- const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() || this[propertyName];
530
- this.dashboardReference.setAttribute(mappedAttributeName, attributeValue);
531
- }
532
- }
533
- }
534
- } else {
535
- for (const [propertyName] of changedProperties.entries()) {
536
- if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
537
- this.iframeLoaded = false;
538
- if (this._loadTimeoutHandle) {
539
- clearTimeout(this._loadTimeoutHandle);
540
- }
541
- this._loadTimeoutHandle = setTimeout(() => {
542
- console.warn(
543
- "Failed to load dashboard, appServer is likely down or unreachable."
544
- );
545
- }, 15 * 1e3);
546
- this.params = this._setOptions();
547
- SharedLib2._extendAndValidate(this);
548
- this._setupLoader();
549
- this._loaderStyles();
550
- this._iframeUrl = SharedLib2.createIframeUrl(this);
551
- if (this.iframe) {
552
- this._updateIframeUrl();
553
- }
554
- this.iframeStyle = SharedLib2.calculateIframeStyles(this);
555
- } else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
556
- if (this.iframeLoaded) {
557
- this.setEditMode(this.editMode);
558
- }
559
- this.params = this._setOptions();
560
- }
561
- }
562
- }
563
- }
564
- // Set params
565
- _setOptions() {
566
- const defaultParameters = {
567
- dashboardId: this.dashboardId,
568
- dashboardSlug: this.dashboardSlug
569
- };
570
- if (this.itemId) {
571
- defaultParameters.itemId = this.itemId;
572
- this._itemEmbedding = true;
573
- } else {
574
- this._itemEmbedding = false;
575
- }
576
- if (this.language) {
577
- defaultParameters.language = this.language;
578
- }
579
- if (this.qeVersion) {
580
- defaultParameters.qeVersion = this.qeVersion;
581
- }
582
- if (this.screenMode) {
583
- defaultParameters.screenMode = this.screenMode;
584
- }
585
- defaultParameters.switchScreenModeOnResize = this.switchScreenModeOnResize;
586
- if (this.authToken) {
587
- defaultParameters.token = this.authToken;
588
- }
589
- if (this.authKey) {
590
- defaultParameters.key = this.authKey;
591
- }
592
- if (this.editMode) {
593
- defaultParameters.editMode = this.editMode;
594
- }
595
- if (this.mainColor) {
596
- defaultParameters.mainColor = this.mainColor;
597
- }
598
- if (this.accentColor) {
599
- defaultParameters.accentColor = this.accentColor;
600
- }
601
- if (this.loaderBackground) {
602
- defaultParameters.loaderBackground = this.loaderBackground;
603
- }
604
- if (this.loaderFontColor) {
605
- defaultParameters.loaderFontColor = this.loaderFontColor;
606
- }
607
- if (this.loaderSpinnerColor) {
608
- defaultParameters.loaderSpinnerColor = this.loaderSpinnerColor;
609
- }
610
- if (this.loaderSpinnerBackground) {
611
- defaultParameters.loaderSpinnerBackground = this.loaderSpinnerBackground;
612
- }
613
- if (this.timezoneId) {
614
- defaultParameters.timezoneId = this.timezoneId;
615
- }
616
- if (this.itemDimensions) {
617
- defaultParameters.itemDimensions = this.itemDimensions;
618
- }
619
- if (this.appServer) {
620
- this.appServer = this.getIsViewMode() ? SharedLib2.removeTrailingSlash(this.appServer) : SharedLib2.addTrailingSlash(this.appServer);
621
- defaultParameters.appServer = this.appServer;
622
- } else {
623
- this.appServer = SharedLib2.addTrailingSlash(
624
- SharedLib2.DEFAULT_PARAMETERS.appServer
625
- );
626
- defaultParameters.appServer = this.appServer;
627
- }
628
- if (this.apiHost) {
629
- this.apiHost = this.getIsViewMode() ? SharedLib2.removeTrailingSlash(this.apiHost) : SharedLib2.addTrailingSlash(this.apiHost);
630
- defaultParameters.apiHost = this.apiHost;
631
- } else {
632
- this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
633
- defaultParameters.apiHost = this.apiHost;
634
- }
635
- this.currentAuthKey = this.authKey;
636
- this.currentAuthToken = this.authToken;
637
- return defaultParameters;
638
- }
639
- _updateIframeUrl() {
640
- SharedLib2.updateIframeUrl(this.iframe, this._iframeUrl);
641
- }
642
- // Setup loader / browser error
643
- _setupLoader() {
644
- const data = SharedLib2.getLoader(this);
645
- this._loaderMsg = data.loadingMsg;
646
- if (data.errorMsg) {
647
- this.browserError = true;
648
- this.browserErrorMsg = data.errorMsg;
649
- this._displayError();
650
- }
651
- }
652
- _displayError() {
653
- if (this.dashboardError) {
654
- this._loaderStyles();
655
- this.iframeStyle.opacity = 1;
656
- }
657
- if (this.browserError) {
658
- this._containerStyle.display = "none";
659
- }
660
- }
661
- _calculateDimAfterDashboardLoaded() {
662
- this.dashboardError = false;
663
- this._loaderStyles();
664
- SharedLib2._setCalculatedDimensions(this);
665
- }
666
- // Set loader styles
667
- _loaderStyles() {
668
- this._containerStyle = SharedLib2.containerStyles(this);
669
- this._loaderStyle = SharedLib2.loaderStyles(this);
670
- this._loadingCircleStyle = SharedLib2.plStyles(this);
671
- this._containerLoaderStyle = SharedLib2.containerLoaderStyles(this);
672
- this._lcStyle = SharedLib2.lcStyles(this);
673
- }
674
- static get styles() {
675
- return [dashboardStyles];
676
- }
677
- render() {
678
- let toBeRenderedHTML;
679
- const loader = html`
680
- <div
681
- class="luzmo-container-loader"
682
- id="luzmo-container-loader-${this._containerId}"
683
- style=${styleMap(
684
- this._containerLoaderStyle
685
- )}
686
- >
687
- <div
688
- class="luzmo-loader"
689
- id="luzmo-loader-${this._containerId}"
690
- style=${styleMap(this._loaderStyle)}
691
- >
692
- <div
693
- class="luzmo-lc"
694
- style=${styleMap(this._lcStyle)}
695
- >
696
- <div
697
- class="luzmo-loading-circle"
698
- style=${styleMap(
699
- this._loadingCircleStyle
700
- )}
701
- ></div>
702
- ${this._itemEmbedding ? "" : html`
703
- <div
704
- class="luzmo-loading-message"
705
- style=${styleMap({ color: this.loaderFontColor })}
706
- >
707
- ${this._loaderMsg}
708
- </div>
709
- `}
710
- </div>
711
- </div>
712
- </div>
713
- `;
714
- if (this.getIsViewMode()) {
715
- toBeRenderedHTML = this.isLibraryLoaded ? html`
716
- ${this.dashboardId || this.dashboardSlug ? html`
717
- <dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
718
- api-host="${this.params.apiHost}"></dashboard-component>` : html`
719
- <div id="luzmo-error-${this._containerId}">
720
- <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
721
- </div>
722
- `}
723
- ` : html`${loader}`;
724
- } else {
725
- toBeRenderedHTML = html`
726
- ${this.dashboardId || this.dashboardSlug ? html`
727
- ${loader}
728
- <iframe
729
- class="luzmo-embed-dashboard ${!this.getIsViewMode() ? `luzmo-embed-dashboard-ede` : ""}"
730
- id="${this._iframeId}"
731
- name="${this._iframeId}"
732
- style=${styleMap(this.iframeStyle)}
733
- src="${this._iframeUrl}"
734
- frameborder="0"
735
- ></iframe>
736
- ` : html`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
737
- ${this.browserError ? html`
738
- <div id="luzmo-error-${this._containerId}">
739
- <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
740
- </div>
741
- ` : ""}
742
- `;
743
- }
744
- return html`
745
- <div class="${luzmoEmbedContainerClass} ${!this.getIsViewMode() ? `${luzmoEmbedContainerClass}-ede` : ""}">
746
- <div
747
- class="dashboard-container"
748
- style=${styleMap(Object.assign({}, this._containerStyle, {
749
- width: this.iframeStyle.width ?? "100%",
750
- height: this.iframeStyle.height ?? "100%"
751
- }))}
752
- >
753
- ${toBeRenderedHTML}
754
- </div>
755
- </div>
756
-
757
- `;
758
- }
759
- getDashboards() {
760
- return new Promise(
761
- (resolve) => resolve(luzmo_service_default._components)
762
- );
763
- }
764
- // Public methods
765
- getData(itemId) {
766
- if (this.getIsViewMode() && this.dashboardReference) {
767
- return this.dashboardReference.getData(itemId);
768
- }
769
- if (!this.getIsViewMode()) {
770
- return SharedLib2.getData(this, this.iframe, itemId);
771
- }
772
- return Promise.reject();
773
- }
774
- getFilters() {
775
- if (this.getIsViewMode() && this.dashboardReference) {
776
- return this.dashboardReference.getFilters();
777
- }
778
- if (!this.getIsViewMode()) {
779
- return SharedLib2.getFilters(this, this.iframe);
780
- }
781
- return Promise.reject();
782
- }
783
- setSelectedData(itemId, filters) {
784
- if (this.getIsViewMode() && this.dashboardReference) {
785
- return this.dashboardReference.setSelectedData(itemId, filters);
786
- }
787
- if (!this.getIsViewMode()) {
788
- return SharedLib2.setSelectedData(this, this.iframe, itemId, filters);
789
- }
790
- return Promise.reject();
791
- }
792
- setAuthorization(key, token) {
793
- this.currentAuthKey = key;
794
- this.currentAuthToken = token;
795
- if (this.getIsViewMode() && this.dashboardReference) {
796
- return this.dashboardReference.setAuthorization(key, token);
797
- }
798
- if (!this.getIsViewMode()) {
799
- return SharedLib2.setAuthorization(this, this.iframe, key, token);
800
- }
801
- return Promise.reject();
802
- }
803
- refreshData(itemId) {
804
- if (this.getIsViewMode() && this.dashboardReference) {
805
- return this.dashboardReference.refreshData(itemId);
806
- }
807
- if (!this.getIsViewMode()) {
808
- return itemId ? SharedLib2.refreshData(this, this.iframe, itemId) : SharedLib2.refreshData(this, this.iframe);
809
- }
810
- return Promise.reject();
811
- }
812
- reloadDashboard() {
813
- if (this.getIsViewMode() && this.dashboardReference) {
814
- return this.dashboardReference.reloadDashboard();
815
- }
816
- if (!this.getIsViewMode()) {
817
- return SharedLib2.reloadDashboard(this, this.iframe);
818
- }
819
- return Promise.reject();
820
- }
821
- exportDashboard(format) {
822
- if (this.getIsViewMode() && this.dashboardReference) {
823
- return this.dashboardReference.exportDashboard(format);
824
- }
825
- if (!this.getIsViewMode()) {
826
- return format ? SharedLib2.exportDashboard(this, this.iframe, format) : SharedLib2.exportDashboard(this, this.iframe);
827
- }
828
- return Promise.reject();
829
- }
830
- getAccessibleDashboards() {
831
- return SharedLib2.getAccessibleDashboards(this);
832
- }
833
- addFilters(itemId, filters) {
834
- return this.dashboardReference.addFilters(itemId, filters);
835
- }
836
- setEditMode(editMode) {
837
- if (this.dashboardReference && editMode === "view") {
838
- this.editMode = "view";
839
- this.params.editMode = "view";
840
- this.initComponent();
841
- return Promise.resolve({
842
- type: "setEditMode",
843
- editMode
844
- });
845
- }
846
- if (this.dashboardReference && ["editFull", "editLimited"].includes(editMode)) {
847
- this.editMode = editMode;
848
- this.params.editMode = editMode;
849
- this.initComponent();
850
- return Promise.resolve({
851
- type: "setEditMode",
852
- editMode
853
- });
854
- }
855
- if (this.getIsViewMode() && this.dashboardReference) {
856
- return this.dashboardReference.setEditMode(editMode);
857
- }
858
- if (!this.getIsViewMode()) {
859
- return SharedLib2.setEditMode(this, this.iframe, editMode);
860
- }
861
- return Promise.reject();
862
- }
863
- setPreview(preview) {
864
- if (this.getIsViewMode() && this.dashboardReference) {
865
- return this.dashboardReference.setPreview(preview);
866
- }
867
- return SharedLib2.setPreview(this, this.iframe, preview);
868
- }
869
- getIsViewMode() {
870
- return this.experimental && this.params.editMode === "view" || this.params.editMode === void 0;
871
- }
872
- };
873
- __decorateClass([
874
- query(".dashboard-container")
875
- ], LuzmoDashboard.prototype, "container", 2);
876
- __decorateClass([
877
- query(`.${luzmoEmbedContainerClass}`)
878
- ], LuzmoDashboard.prototype, "luzmoEmbedContainer", 2);
879
- __decorateClass([
880
- query("iframe")
881
- ], LuzmoDashboard.prototype, "iframe", 2);
882
- __decorateClass([
883
- property()
884
- ], LuzmoDashboard.prototype, "dashboardId", 2);
885
- __decorateClass([
886
- property()
887
- ], LuzmoDashboard.prototype, "dashboardSlug", 2);
888
- __decorateClass([
889
- property()
890
- ], LuzmoDashboard.prototype, "itemId", 2);
891
- __decorateClass([
892
- property()
893
- ], LuzmoDashboard.prototype, "language", 2);
894
- __decorateClass([
895
- property()
896
- ], LuzmoDashboard.prototype, "qeVersion", 2);
897
- __decorateClass([
898
- property()
899
- ], LuzmoDashboard.prototype, "screenMode", 2);
900
- __decorateClass([
901
- property({
902
- converter: {
903
- fromAttribute: (value) => value === "true",
904
- toAttribute: String
905
- }
906
- })
907
- ], LuzmoDashboard.prototype, "switchScreenModeOnResize", 2);
908
- __decorateClass([
909
- property()
910
- ], LuzmoDashboard.prototype, "editMode", 2);
911
- __decorateClass([
912
- property()
913
- ], LuzmoDashboard.prototype, "mainColor", 2);
914
- __decorateClass([
915
- property()
916
- ], LuzmoDashboard.prototype, "accentColor", 2);
917
- __decorateClass([
918
- property()
919
- ], LuzmoDashboard.prototype, "authToken", 2);
920
- __decorateClass([
921
- property()
922
- ], LuzmoDashboard.prototype, "authKey", 2);
923
- __decorateClass([
924
- property()
925
- ], LuzmoDashboard.prototype, "loaderBackground", 2);
926
- __decorateClass([
927
- property()
928
- ], LuzmoDashboard.prototype, "loaderFontColor", 2);
929
- __decorateClass([
930
- property()
931
- ], LuzmoDashboard.prototype, "loaderSpinnerColor", 2);
932
- __decorateClass([
933
- property()
934
- ], LuzmoDashboard.prototype, "loaderSpinnerBackground", 2);
935
- __decorateClass([
936
- property()
937
- ], LuzmoDashboard.prototype, "appServer", 2);
938
- __decorateClass([
939
- property()
940
- ], LuzmoDashboard.prototype, "timezoneId", 2);
941
- __decorateClass([
942
- property()
943
- ], LuzmoDashboard.prototype, "apiHost", 2);
944
- __decorateClass([
945
- property({ type: Object })
946
- ], LuzmoDashboard.prototype, "itemDimensions", 2);
947
- __decorateClass([
948
- property({
949
- converter: {
950
- fromAttribute: (value) => value === "true",
951
- toAttribute: String
952
- }
953
- })
954
- ], LuzmoDashboard.prototype, "experimental", 2);
955
- __decorateClass([
956
- property({ attribute: false })
957
- ], LuzmoDashboard.prototype, "_containerId", 2);
958
- __decorateClass([
959
- property({ attribute: false })
960
- ], LuzmoDashboard.prototype, "_iframeId", 2);
961
- __decorateClass([
962
- property({ attribute: false })
963
- ], LuzmoDashboard.prototype, "params", 2);
964
- __decorateClass([
965
- property({ attribute: false })
966
- ], LuzmoDashboard.prototype, "_iframeUrl", 2);
967
- __decorateClass([
968
- property({ attribute: false })
969
- ], LuzmoDashboard.prototype, "iframeLoaded", 2);
970
- __decorateClass([
971
- property({ attribute: false })
972
- ], LuzmoDashboard.prototype, "promises", 2);
973
- __decorateClass([
974
- property({ attribute: false })
975
- ], LuzmoDashboard.prototype, "iframeStyle", 2);
976
- __decorateClass([
977
- property({ attribute: false })
978
- ], LuzmoDashboard.prototype, "_containerStyle", 2);
979
- __decorateClass([
980
- property({ attribute: false })
981
- ], LuzmoDashboard.prototype, "_loaderStyle", 2);
982
- __decorateClass([
983
- property({ attribute: false })
984
- ], LuzmoDashboard.prototype, "_lcStyle", 2);
985
- __decorateClass([
986
- property({ attribute: false })
987
- ], LuzmoDashboard.prototype, "_loadingCircleStyle", 2);
988
- __decorateClass([
989
- property({ attribute: false })
990
- ], LuzmoDashboard.prototype, "_containerLoaderStyle", 2);
991
- __decorateClass([
992
- property({ attribute: false })
993
- ], LuzmoDashboard.prototype, "_loaderMsg", 2);
994
- __decorateClass([
995
- property({ attribute: false })
996
- ], LuzmoDashboard.prototype, "containerWidth", 2);
997
- __decorateClass([
998
- property({ attribute: false })
999
- ], LuzmoDashboard.prototype, "dimensions", 2);
1000
- __decorateClass([
1001
- property({ attribute: false })
1002
- ], LuzmoDashboard.prototype, "currentScreenMode", 2);
1003
- __decorateClass([
1004
- property({ attribute: false })
1005
- ], LuzmoDashboard.prototype, "_itemEmbedding", 2);
1006
- __decorateClass([
1007
- property({ attribute: false })
1008
- ], LuzmoDashboard.prototype, "browserError", 2);
1009
- __decorateClass([
1010
- property({ attribute: false })
1011
- ], LuzmoDashboard.prototype, "browserErrorMsg", 2);
1012
- __decorateClass([
1013
- property({ attribute: false })
1014
- ], LuzmoDashboard.prototype, "dashboardError", 2);
1015
- __decorateClass([
1016
- property({ attribute: false })
1017
- ], LuzmoDashboard.prototype, "browserNotSupported", 2);
1018
- __decorateClass([
1019
- property()
1020
- ], LuzmoDashboard.prototype, "libVersion", 2);
1021
- __decorateClass([
1022
- state()
1023
- ], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
1024
- __decorateClass([
1025
- state()
1026
- ], LuzmoDashboard.prototype, "dashboardReference", 2);
1027
- __decorateClass([
1028
- state()
1029
- ], LuzmoDashboard.prototype, "currentAuthKey", 2);
1030
- __decorateClass([
1031
- state()
1032
- ], LuzmoDashboard.prototype, "currentAuthToken", 2);
1033
- __decorateClass([
1034
- state()
1035
- ], LuzmoDashboard.prototype, "isInitCalled", 2);
1036
-
1037
- // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
1038
- var LuzmoEmbedDashboard = class extends LuzmoDashboard {
1039
- };
1040
- LuzmoEmbedDashboard = __decorateClass([
1041
- customElement("luzmo-embed-dashboard")
1042
- ], LuzmoEmbedDashboard);
1043
-
1044
- // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
1045
- import { customElement as customElement2 } from "lit/decorators.js";
1046
-
1047
- // libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
1048
- import { property as property2 } from "lit/decorators.js";
1049
- import { LitElement as LitElement2, html as html2, css as css2 } from "lit";
1050
- import Ajv from "ajv";
1051
- import ajvAddFormats from "ajv-formats";
1052
- import * as SharedLib3 from "@luzmo/shared-embed";
1053
-
1054
- // libs/dashboard-contents-types/assets/json-schemas/options.schema.json
1055
- var options_schema_default = {
1056
- $id: "https://developer.luzmo.com/assets/json-schemas/0.1.88/options.schema.json",
1057
- $schema: "http://json-schema.org/draft-07/schema#",
1058
- anyOf: [
1059
- { $ref: "area-chart-options.schema.json" },
1060
- { $ref: "bar-chart-options.schema.json" },
1061
- { $ref: "box-plot-options.schema.json" },
1062
- { $ref: "bubble-chart-options.schema.json" },
1063
- { $ref: "bullet-chart-options.schema.json" },
1064
- { $ref: "choropleth-map-options.schema.json" },
1065
- { $ref: "circular-gauge-options.schema.json" },
1066
- { $ref: "column-chart-options.schema.json" },
1067
- { $ref: "combination-chart-options.schema.json" },
1068
- { $ref: "date-filter-options.schema.json" },
1069
- { $ref: "donut-chart-options.schema.json" },
1070
- { $ref: "dropdown-filter-options.schema.json" },
1071
- { $ref: "evolution-number-options.schema.json" },
1072
- { $ref: "funnel-chart-options.schema.json" },
1073
- { $ref: "image-options.schema.json" },
1074
- { $ref: "line-chart-options.schema.json" },
1075
- { $ref: "pivot-table-options.schema.json" },
1076
- { $ref: "regular-table-options.schema.json" },
1077
- { $ref: "sankey-diagram-options.schema.json" },
1078
- { $ref: "scatter-plot-options.schema.json" },
1079
- { $ref: "slicer-filter-options.schema.json" },
1080
- { $ref: "slider-filter-options.schema.json" },
1081
- { $ref: "text-options.schema.json" }
1082
- ]
1083
- };
1084
-
1085
- // libs/dashboard-contents-types/assets/json-schemas/slots.schema.json
1086
- var slots_schema_default = {
1087
- $id: "https://developer.luzmo.com/assets/json-schemas/0.1.88/slots.schema.json",
1088
- $schema: "http://json-schema.org/draft-07/schema#",
1089
- anyOf: [
1090
- { $ref: "area-chart-slots.schema.json" },
1091
- { $ref: "bar-chart-slots.schema.json" },
1092
- { $ref: "box-plot-slots.schema.json" },
1093
- { $ref: "bubble-chart-slots.schema.json" },
1094
- { $ref: "bullet-chart-slots.schema.json" },
1095
- { $ref: "choropleth-map-slots.schema.json" },
1096
- { $ref: "circular-gauge-slots.schema.json" },
1097
- { $ref: "column-chart-slots.schema.json" },
1098
- { $ref: "combination-chart-slots.schema.json" },
1099
- { $ref: "date-filter-slots.schema.json" },
1100
- { $ref: "donut-chart-slots.schema.json" },
1101
- { $ref: "dropdown-filter-slots.schema.json" },
1102
- { $ref: "evolution-number-slots.schema.json" },
1103
- { $ref: "funnel-chart-slots.schema.json" },
1104
- { $ref: "line-chart-slots.schema.json" },
1105
- { $ref: "pivot-table-slots.schema.json" },
1106
- { $ref: "regular-table-slots.schema.json" },
1107
- { $ref: "sankey-diagram-slots.schema.json" },
1108
- { $ref: "scatter-plot-slots.schema.json" },
1109
- { $ref: "slicer-filter-slots.schema.json" },
1110
- { $ref: "slider-filter-slots.schema.json" }
1111
- ]
1112
- };
1113
-
1114
- // libs/dashboard-contents-types/assets/json-schemas/area-chart.schema.json
1115
- var area_chart_schema_default = {
1116
- $schema: "http://json-schema.org/draft-07/schema#",
1117
- $id: "https://developer.luzmo.com/assets/json-schemas/0.1.88/area-chart.schema.json",
1118
- type: "object",
1119
- description: "Area Chart item",
1120
- properties: {
1121
- type: {
1122
- description: "Type of the item",
1123
- type: "string",
1124
- const: "area-chart"
1125
- },
1126
- options: {
1127
- description: "Options of the Area Chart item",
1128
- $ref: "area-chart-options.schema.json"
1129
- },
1130
- slots: {
1131
- description: "Data definition of the Area Chart item",
1132
- $ref: "area-chart-slots.schema.json"
1133
- }
1134
- }
1135
- };
1136
-
1137
- // libs/dashboard-contents-types/assets/json-schemas/area-chart-options.schema.json
1138
- var area_chart_options_schema_default = {
1139
- $id: "https://developer.luzmo.com/assets/json-schemas/0.1.88/area-chart-options.schema.json",
1140
- $schema: "http://json-schema.org/draft-07/schema#",
1141
- properties: {
1142
- axis: {
1143
- description: "Axes options",
1144
- properties: {
1145
- x: {
1146
- description: "X-axis options",
1147
- properties: {
1148
- color: {
1149
- description: "X-axis color",
1150
- examples: [
1151
- "#000000",
1152
- "black",
1153
- "rgba(0,0,0,1)"
1154
- ],
1155
- type: "string"
1156
- },
1157
- ticksMode: {
1158
- default: "ticks",
1159
- description: "Ticks mode of the X-axis: hide, ticks, or gridlines",
1160
- enum: [
1161
- "gridlines",
1162
- "hide",
1163
- "ticks"
1164
- ],
1165
- type: "string"
1166
- },
1167
- ticksStyle: {
1168
- description: "Ticks style of the X-axis: auto or user defined",
1169
- enum: [
1170
- "auto",
1171
- "userDefined"
1172
- ],
1173
- type: "string"
255
+ // libs/dashboard-contents-types/assets/json-schemas/area-chart-options.schema.json
256
+ var area_chart_options_schema_default = {
257
+ $id: "https://developer.luzmo.com/assets/json-schemas/0.1.88/area-chart-options.schema.json",
258
+ $schema: "http://json-schema.org/draft-07/schema#",
259
+ properties: {
260
+ axis: {
261
+ description: "Axes options",
262
+ properties: {
263
+ x: {
264
+ description: "X-axis options",
265
+ properties: {
266
+ color: {
267
+ description: "X-axis color",
268
+ examples: [
269
+ "#000000",
270
+ "black",
271
+ "rgba(0,0,0,1)"
272
+ ],
273
+ type: "string"
274
+ },
275
+ ticksMode: {
276
+ default: "ticks",
277
+ description: "Ticks mode of the X-axis: hide, ticks, or gridlines",
278
+ enum: [
279
+ "gridlines",
280
+ "hide",
281
+ "ticks"
282
+ ],
283
+ type: "string"
284
+ },
285
+ ticksStyle: {
286
+ description: "Ticks style of the X-axis: auto or user defined",
287
+ enum: [
288
+ "auto",
289
+ "userDefined"
290
+ ],
291
+ type: "string"
1174
292
  }
1175
293
  },
1176
294
  type: "object"
@@ -3449,11 +2567,11 @@ var bar_chart_schema_default = {
3449
2567
  },
3450
2568
  options: {
3451
2569
  description: "Options of the Bar Chart item",
3452
- $ref: "bar-chart-options.schema.json"
2570
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bar-chart-options.schema.json"
3453
2571
  },
3454
2572
  slots: {
3455
2573
  description: "Data definition of the Bar Chart item",
3456
- $ref: "bar-chart-slots.schema.json"
2574
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bar-chart-slots.schema.json"
3457
2575
  }
3458
2576
  }
3459
2577
  };
@@ -7772,11 +6890,11 @@ var box_plot_schema_default = {
7772
6890
  },
7773
6891
  options: {
7774
6892
  description: "Options of the Box Plot item",
7775
- $ref: "box-plot-options.schema.json"
6893
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/box-plot-options.schema.json"
7776
6894
  },
7777
6895
  slots: {
7778
6896
  description: "Data definition of the Box Plot item",
7779
- $ref: "box-plot-slots.schema.json"
6897
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/box-plot-slots.schema.json"
7780
6898
  }
7781
6899
  }
7782
6900
  };
@@ -9899,11 +9017,11 @@ var bubble_chart_schema_default = {
9899
9017
  },
9900
9018
  options: {
9901
9019
  description: "Options of the Bubble Chart item",
9902
- $ref: "bubble-chart-options.schema.json"
9020
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bubble-chart-options.schema.json"
9903
9021
  },
9904
9022
  slots: {
9905
9023
  description: "Data definition of the Bubble Chart item",
9906
- $ref: "bubble-chart-slots.schema.json"
9024
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bubble-chart-slots.schema.json"
9907
9025
  }
9908
9026
  }
9909
9027
  };
@@ -13815,11 +12933,11 @@ var bullet_chart_schema_default = {
13815
12933
  },
13816
12934
  options: {
13817
12935
  description: "Options of the Bullet Chart item",
13818
- $ref: "bullet-chart-options.schema.json"
12936
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bullet-chart-options.schema.json"
13819
12937
  },
13820
12938
  slots: {
13821
12939
  description: "Data definition of the Bullet Chart item",
13822
- $ref: "bullet-chart-slots.schema.json"
12940
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/bullet-chart-slots.schema.json"
13823
12941
  }
13824
12942
  }
13825
12943
  };
@@ -15729,11 +14847,11 @@ var choropleth_map_schema_default = {
15729
14847
  },
15730
14848
  options: {
15731
14849
  description: "Options of the Choropleth Map item",
15732
- $ref: "choropleth-map-options.schema.json"
14850
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/choropleth-map-options.schema.json"
15733
14851
  },
15734
14852
  slots: {
15735
14853
  description: "Data definition of the Choropleth Map item",
15736
- $ref: "choropleth-map-slots.schema.json"
14854
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/choropleth-map-slots.schema.json"
15737
14855
  }
15738
14856
  }
15739
14857
  };
@@ -17820,11 +16938,11 @@ var circular_gauge_schema_default = {
17820
16938
  },
17821
16939
  options: {
17822
16940
  description: "Options of the Circular Gauge item",
17823
- $ref: "circular-gauge-options.schema.json"
16941
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/circular-gauge-options.schema.json"
17824
16942
  },
17825
16943
  slots: {
17826
16944
  description: "Data definition of the Circular Gauge item",
17827
- $ref: "circular-gauge-slots.schema.json"
16945
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/circular-gauge-slots.schema.json"
17828
16946
  }
17829
16947
  }
17830
16948
  };
@@ -19652,11 +18770,11 @@ var column_chart_schema_default = {
19652
18770
  },
19653
18771
  options: {
19654
18772
  description: "Options of the Column Chart item",
19655
- $ref: "column-chart-options.schema.json"
18773
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/column-chart-options.schema.json"
19656
18774
  },
19657
18775
  slots: {
19658
18776
  description: "Data definition of the Column Chart item",
19659
- $ref: "column-chart-slots.schema.json"
18777
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/column-chart-slots.schema.json"
19660
18778
  }
19661
18779
  }
19662
18780
  };
@@ -23974,11 +23092,11 @@ var combination_chart_schema_default = {
23974
23092
  },
23975
23093
  options: {
23976
23094
  description: "Options of the Combination Chart item",
23977
- $ref: "combination-chart-options.schema.json"
23095
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/combination-chart-options.schema.json"
23978
23096
  },
23979
23097
  slots: {
23980
23098
  description: "Data definition of the Combination Chart item",
23981
- $ref: "combination-chart-slots.schema.json"
23099
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/combination-chart-slots.schema.json"
23982
23100
  }
23983
23101
  }
23984
23102
  };
@@ -26350,11 +25468,11 @@ var date_filter_schema_default = {
26350
25468
  },
26351
25469
  options: {
26352
25470
  description: "Options of the Date Filter item",
26353
- $ref: "date-filter-options.schema.json"
25471
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/date-filter-options.schema.json"
26354
25472
  },
26355
25473
  slots: {
26356
25474
  description: "Data definition of the Date Filter item",
26357
- $ref: "date-filter-slots.schema.json"
25475
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/date-filter-slots.schema.json"
26358
25476
  }
26359
25477
  }
26360
25478
  };
@@ -27777,11 +26895,11 @@ var donut_chart_schema_default = {
27777
26895
  },
27778
26896
  options: {
27779
26897
  description: "Options of the Donut Chart item",
27780
- $ref: "donut-chart-options.schema.json"
26898
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/donut-chart-options.schema.json"
27781
26899
  },
27782
26900
  slots: {
27783
26901
  description: "Data definition of the Donut Chart item",
27784
- $ref: "donut-chart-slots.schema.json"
26902
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/donut-chart-slots.schema.json"
27785
26903
  }
27786
26904
  }
27787
26905
  };
@@ -31770,11 +30888,11 @@ var dropdown_filter_schema_default = {
31770
30888
  },
31771
30889
  options: {
31772
30890
  description: "Options of the Dropdown Filter item",
31773
- $ref: "dropdown-filter-options.schema.json"
30891
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/dropdown-filter-options.schema.json"
31774
30892
  },
31775
30893
  slots: {
31776
30894
  description: "Data definition of the Dropdown Filter item",
31777
- $ref: "dropdown-filter-slots.schema.json"
30895
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/dropdown-filter-slots.schema.json"
31778
30896
  }
31779
30897
  }
31780
30898
  };
@@ -33481,11 +32599,11 @@ var evolution_number_schema_default = {
33481
32599
  },
33482
32600
  options: {
33483
32601
  description: "Options of the Evolution Number item",
33484
- $ref: "evolution-number-options.schema.json"
32602
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/evolution-number-options.schema.json"
33485
32603
  },
33486
32604
  slots: {
33487
32605
  description: "Data definition of the Evolution Number item",
33488
- $ref: "evolution-number-slots.schema.json"
32606
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/evolution-number-slots.schema.json"
33489
32607
  }
33490
32608
  }
33491
32609
  };
@@ -35431,11 +34549,11 @@ var funnel_chart_schema_default = {
35431
34549
  },
35432
34550
  options: {
35433
34551
  description: "Options of the Funnel Chart item",
35434
- $ref: "funnel-chart-options.schema.json"
34552
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/funnel-chart-options.schema.json"
35435
34553
  },
35436
34554
  slots: {
35437
34555
  description: "Data definition of the Funnel Chart item",
35438
- $ref: "funnel-chart-slots.schema.json"
34556
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/funnel-chart-slots.schema.json"
35439
34557
  }
35440
34558
  }
35441
34559
  };
@@ -39410,7 +38528,7 @@ var image_schema_default = {
39410
38528
  },
39411
38529
  options: {
39412
38530
  description: "Options of the Image item",
39413
- $ref: "image-options.schema.json"
38531
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/image-options.schema.json"
39414
38532
  }
39415
38533
  }
39416
38534
  };
@@ -40006,11 +39124,11 @@ var line_chart_schema_default = {
40006
39124
  },
40007
39125
  options: {
40008
39126
  description: "Options of the Line Chart item",
40009
- $ref: "line-chart-options.schema.json"
39127
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/line-chart-options.schema.json"
40010
39128
  },
40011
39129
  slots: {
40012
39130
  description: "Data definition of the Line Chart item",
40013
- $ref: "line-chart-slots.schema.json"
39131
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/line-chart-slots.schema.json"
40014
39132
  }
40015
39133
  }
40016
39134
  };
@@ -42339,11 +41457,11 @@ var pivot_table_schema_default = {
42339
41457
  },
42340
41458
  options: {
42341
41459
  description: "Options of the Pivot Table item",
42342
- $ref: "pivot-table-options.schema.json"
41460
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/pivot-table-options.schema.json"
42343
41461
  },
42344
41462
  slots: {
42345
41463
  description: "Data definition of the Pivot Table item",
42346
- $ref: "pivot-table-slots.schema.json"
41464
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/pivot-table-slots.schema.json"
42347
41465
  }
42348
41466
  }
42349
41467
  };
@@ -44340,11 +43458,11 @@ var regular_table_schema_default = {
44340
43458
  },
44341
43459
  options: {
44342
43460
  description: "Options of the Regular Table item",
44343
- $ref: "regular-table-options.schema.json"
43461
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/regular-table-options.schema.json"
44344
43462
  },
44345
43463
  slots: {
44346
43464
  description: "Data definition of the Regular Table item",
44347
- $ref: "regular-table-slots.schema.json"
43465
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/regular-table-slots.schema.json"
44348
43466
  }
44349
43467
  }
44350
43468
  };
@@ -46309,11 +45427,11 @@ var sankey_diagram_schema_default = {
46309
45427
  },
46310
45428
  options: {
46311
45429
  description: "Options of the Sankey Diagram item",
46312
- $ref: "sankey-diagram-options.schema.json"
45430
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/sankey-diagram-options.schema.json"
46313
45431
  },
46314
45432
  slots: {
46315
45433
  description: "Data definition of the Sankey Diagram item",
46316
- $ref: "sankey-diagram-slots.schema.json"
45434
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/sankey-diagram-slots.schema.json"
46317
45435
  }
46318
45436
  }
46319
45437
  };
@@ -48206,11 +47324,11 @@ var scatter_plot_schema_default = {
48206
47324
  },
48207
47325
  options: {
48208
47326
  description: "Options of the Scatter Plot item",
48209
- $ref: "scatter-plot-options.schema.json"
47327
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/scatter-plot-options.schema.json"
48210
47328
  },
48211
47329
  slots: {
48212
47330
  description: "Data definition of the Scatter Plot item",
48213
- $ref: "scatter-plot-slots.schema.json"
47331
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/scatter-plot-slots.schema.json"
48214
47332
  }
48215
47333
  }
48216
47334
  };
@@ -50437,11 +49555,11 @@ var slicer_filter_schema_default = {
50437
49555
  },
50438
49556
  options: {
50439
49557
  description: "Options of the Slicer Filter item",
50440
- $ref: "slicer-filter-options.schema.json"
49558
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/slicer-filter-options.schema.json"
50441
49559
  },
50442
49560
  slots: {
50443
49561
  description: "Data definition of the Slicer Filter item",
50444
- $ref: "slicer-filter-slots.schema.json"
49562
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/slicer-filter-slots.schema.json"
50445
49563
  }
50446
49564
  }
50447
49565
  };
@@ -52345,11 +51463,11 @@ var slider_filter_schema_default = {
52345
51463
  },
52346
51464
  options: {
52347
51465
  description: "Options of the Slider Filter item",
52348
- $ref: "slider-filter-options.schema.json"
51466
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/slider-filter-options.schema.json"
52349
51467
  },
52350
51468
  slots: {
52351
51469
  description: "Data definition of the Slider Filter item",
52352
- $ref: "slider-filter-slots.schema.json"
51470
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/slider-filter-slots.schema.json"
52353
51471
  }
52354
51472
  }
52355
51473
  };
@@ -53839,7 +52957,7 @@ var text_schema_default = {
53839
52957
  },
53840
52958
  options: {
53841
52959
  description: "Options of the Text item",
53842
- $ref: "text-options.schema.json"
52960
+ $ref: "https://developer.luzmo.com/assets/json-schemas/0.1.88/text-options.schema.json"
53843
52961
  }
53844
52962
  }
53845
52963
  };
@@ -54347,109 +53465,1152 @@ var text_options_schema_default = {
54347
53465
  ],
54348
53466
  type: "number"
54349
53467
  }
54350
- },
54351
- type: "object"
54352
- },
54353
- type: {
54354
- description: "Theme type",
54355
- examples: [
54356
- "custom"
54357
- ],
54358
- type: "string"
53468
+ },
53469
+ type: "object"
53470
+ },
53471
+ type: {
53472
+ description: "Theme type",
53473
+ examples: [
53474
+ "custom"
53475
+ ],
53476
+ type: "string"
53477
+ }
53478
+ },
53479
+ type: "object"
53480
+ },
53481
+ title: {
53482
+ description: 'Title in format {locale: "title"}, for example, {en: "Title"}',
53483
+ examples: [
53484
+ {
53485
+ en: "Title"
53486
+ }
53487
+ ],
53488
+ type: "object"
53489
+ }
53490
+ },
53491
+ type: "object"
53492
+ };
53493
+
53494
+ // libs/dashboard-contents-types/json-schemas.ts
53495
+ var json_schemas_default = {
53496
+ "viz-item-type.schema.json": viz_item_type_schema_default,
53497
+ "options.schema.json": options_schema_default,
53498
+ "slots.schema.json": slots_schema_default,
53499
+ "area-chart.schema.json": area_chart_schema_default,
53500
+ "area-chart-options.schema.json": area_chart_options_schema_default,
53501
+ "area-chart-slots.schema.json": area_chart_slots_schema_default,
53502
+ "bar-chart.schema.json": bar_chart_schema_default,
53503
+ "bar-chart-options.schema.json": bar_chart_options_schema_default,
53504
+ "bar-chart-slots.schema.json": bar_chart_slots_schema_default,
53505
+ "box-plot.schema.json": box_plot_schema_default,
53506
+ "box-plot-options.schema.json": box_plot_options_schema_default,
53507
+ "box-plot-slots.schema.json": box_plot_slots_schema_default,
53508
+ "bubble-chart.schema.json": bubble_chart_schema_default,
53509
+ "bubble-chart-options.schema.json": bubble_chart_options_schema_default,
53510
+ "bubble-chart-slots.schema.json": bubble_chart_slots_schema_default,
53511
+ "bullet-chart.schema.json": bullet_chart_schema_default,
53512
+ "bullet-chart-options.schema.json": bullet_chart_options_schema_default,
53513
+ "bullet-chart-slots.schema.json": bullet_chart_slots_schema_default,
53514
+ "choropleth-map.schema.json": choropleth_map_schema_default,
53515
+ "choropleth-map-options.schema.json": choropleth_map_options_schema_default,
53516
+ "choropleth-map-slots.schema.json": choropleth_map_slots_schema_default,
53517
+ "circular-gauge.schema.json": circular_gauge_schema_default,
53518
+ "circular-gauge-options.schema.json": circular_gauge_options_schema_default,
53519
+ "circular-gauge-slots.schema.json": circular_gauge_slots_schema_default,
53520
+ "column-chart.schema.json": column_chart_schema_default,
53521
+ "column-chart-options.schema.json": column_chart_options_schema_default,
53522
+ "column-chart-slots.schema.json": column_chart_slots_schema_default,
53523
+ "combination-chart.schema.json": combination_chart_schema_default,
53524
+ "combination-chart-options.schema.json": combination_chart_options_schema_default,
53525
+ "combination-chart-slots.schema.json": combination_chart_slots_schema_default,
53526
+ "date-filter.schema.json": date_filter_schema_default,
53527
+ "date-filter-options.schema.json": date_filter_options_schema_default,
53528
+ "date-filter-slots.schema.json": date_filter_slots_schema_default,
53529
+ "donut-chart.schema.json": donut_chart_schema_default,
53530
+ "donut-chart-options.schema.json": donut_chart_options_schema_default,
53531
+ "donut-chart-slots.schema.json": donut_chart_slots_schema_default,
53532
+ "dropdown-filter.schema.json": dropdown_filter_schema_default,
53533
+ "dropdown-filter-options.schema.json": dropdown_filter_options_schema_default,
53534
+ "dropdown-filter-slots.schema.json": dropdown_filter_slots_schema_default,
53535
+ "evolution-number.schema.json": evolution_number_schema_default,
53536
+ "evolution-number-options.schema.json": evolution_number_options_schema_default,
53537
+ "evolution-number-slots.schema.json": evolution_number_slots_schema_default,
53538
+ "funnel-chart.schema.json": funnel_chart_schema_default,
53539
+ "funnel-chart-options.schema.json": funnel_chart_options_schema_default,
53540
+ "funnel-chart-slots.schema.json": funnel_chart_slots_schema_default,
53541
+ "image.schema.json": image_schema_default,
53542
+ "image-options.schema.json": image_options_schema_default,
53543
+ "line-chart.schema.json": line_chart_schema_default,
53544
+ "line-chart-options.schema.json": line_chart_options_schema_default,
53545
+ "line-chart-slots.schema.json": line_chart_slots_schema_default,
53546
+ "pivot-table.schema.json": pivot_table_schema_default,
53547
+ "pivot-table-options.schema.json": pivot_table_options_schema_default,
53548
+ "pivot-table-slots.schema.json": pivot_table_slots_schema_default,
53549
+ "regular-table.schema.json": regular_table_schema_default,
53550
+ "regular-table-options.schema.json": regular_table_options_schema_default,
53551
+ "regular-table-slots.schema.json": regular_table_slots_schema_default,
53552
+ "sankey-diagram.schema.json": sankey_diagram_schema_default,
53553
+ "sankey-diagram-options.schema.json": sankey_diagram_options_schema_default,
53554
+ "sankey-diagram-slots.schema.json": sankey_diagram_slots_schema_default,
53555
+ "scatter-plot.schema.json": scatter_plot_schema_default,
53556
+ "scatter-plot-options.schema.json": scatter_plot_options_schema_default,
53557
+ "scatter-plot-slots.schema.json": scatter_plot_slots_schema_default,
53558
+ "slicer-filter.schema.json": slicer_filter_schema_default,
53559
+ "slicer-filter-options.schema.json": slicer_filter_options_schema_default,
53560
+ "slicer-filter-slots.schema.json": slicer_filter_slots_schema_default,
53561
+ "slider-filter.schema.json": slider_filter_schema_default,
53562
+ "slider-filter-options.schema.json": slider_filter_options_schema_default,
53563
+ "slider-filter-slots.schema.json": slider_filter_slots_schema_default,
53564
+ "text.schema.json": text_schema_default,
53565
+ "text-options.schema.json": text_options_schema_default
53566
+ };
53567
+
53568
+ // libs/embed-libs/embed/src/index.ts
53569
+ import { selectedDataUtils } from "@luzmo/shared-embed";
53570
+
53571
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
53572
+ import {
53573
+ customElement
53574
+ } from "lit/decorators.js";
53575
+
53576
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
53577
+ import * as SharedLib2 from "@luzmo/shared-embed";
53578
+ import {
53579
+ html,
53580
+ LitElement
53581
+ } from "lit";
53582
+ import {
53583
+ property,
53584
+ query,
53585
+ state
53586
+ } from "lit/decorators.js";
53587
+ import {
53588
+ styleMap
53589
+ } from "lit/directives/style-map.js";
53590
+ import {
53591
+ luzmoEmbedContainerClass
53592
+ } from "@luzmo/shared-embed";
53593
+
53594
+ // libs/embed-libs/embed/package.json
53595
+ var version = "6.1.0";
53596
+
53597
+ // libs/embed-libs/embed/src/lib/luzmo-service.ts
53598
+ var LuzmoService = class {
53599
+ constructor() {
53600
+ this._components = [];
53601
+ }
53602
+ };
53603
+ var luzmo_service_default = new LuzmoService();
53604
+
53605
+ // libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
53606
+ import * as SharedLib from "@luzmo/shared-embed";
53607
+ var _setEventHandler = () => {
53608
+ if (typeof window.__luzmoMessageHandler === "function") {
53609
+ return;
53610
+ }
53611
+ window.__luzmoMessageHandler = (event) => {
53612
+ const dashboardComponent = luzmo_service_default._components.find(
53613
+ (c) => event.data.name === c._iframeId
53614
+ );
53615
+ if (!dashboardComponent) {
53616
+ return;
53617
+ }
53618
+ switch (event.data?.type) {
53619
+ case "load": {
53620
+ dashboardComponent.dispatchEvent(
53621
+ new CustomEvent("load", { detail: { data: event.data } })
53622
+ );
53623
+ if (dashboardComponent._loadTimeoutHandle) {
53624
+ clearTimeout(dashboardComponent._loadTimeoutHandle);
53625
+ dashboardComponent._loadTimeoutHandle = void 0;
53626
+ }
53627
+ dashboardComponent.iframeLoaded = true;
53628
+ dashboardComponent.dimensions = event.data.dimensions;
53629
+ dashboardComponent._calculateDimAfterDashboardLoaded();
53630
+ break;
53631
+ }
53632
+ case "error": {
53633
+ dashboardComponent.dashboardError = true;
53634
+ if (dashboardComponent._loadTimeoutHandle) {
53635
+ clearTimeout(dashboardComponent._loadTimeoutHandle);
53636
+ dashboardComponent._loadTimeoutHandle = void 0;
53637
+ }
53638
+ dashboardComponent.iframeLoaded = true;
53639
+ dashboardComponent._displayError();
53640
+ console.error("Dashboard error: ", event.data.errorMsg ?? event.data.error?.msg);
53641
+ break;
53642
+ }
53643
+ case "data": {
53644
+ SharedLib.resolvePromise(
53645
+ dashboardComponent,
53646
+ event.data.requestId,
53647
+ event.data.data
53648
+ );
53649
+ break;
53650
+ }
53651
+ case "filters": {
53652
+ SharedLib.resolvePromise(
53653
+ dashboardComponent,
53654
+ event.data.requestId,
53655
+ event.data.filters
53656
+ );
53657
+ break;
53658
+ }
53659
+ case "getAccessibleDashboards": {
53660
+ SharedLib.resolvePromise(
53661
+ dashboardComponent,
53662
+ event.data.requestId,
53663
+ event.data.accessibleDashboards
53664
+ );
53665
+ break;
53666
+ }
53667
+ case "dashboardAction": {
53668
+ dashboardComponent.dispatchEvent(
53669
+ new CustomEvent("dashboardAction", { detail: { data: event.data } })
53670
+ );
53671
+ break;
53672
+ }
53673
+ case "export": {
53674
+ if (event.data.error) {
53675
+ SharedLib.rejectPromise(
53676
+ dashboardComponent,
53677
+ event.data.requestId,
53678
+ event.data
53679
+ );
53680
+ } else {
53681
+ dashboardComponent.dispatchEvent(
53682
+ new CustomEvent("exported", { detail: { data: event.data } })
53683
+ );
53684
+ SharedLib.resolvePromise(
53685
+ dashboardComponent,
53686
+ event.data.requestId,
53687
+ event.data
53688
+ );
53689
+ }
53690
+ break;
53691
+ }
53692
+ case "changedFilters": {
53693
+ dashboardComponent.dispatchEvent(
53694
+ new CustomEvent("changedFilters", { detail: { data: event.data } })
53695
+ );
53696
+ break;
53697
+ }
53698
+ case "customEvent": {
53699
+ dashboardComponent.dispatchEvent(
53700
+ new CustomEvent("customEvent", { detail: { data: event.data } })
53701
+ );
53702
+ break;
53703
+ }
53704
+ case "chartsRendered":
53705
+ case "itemsRendered": {
53706
+ event.data.type = "itemsRendered";
53707
+ dashboardComponent.dispatchEvent(
53708
+ new CustomEvent("itemsRendered", { detail: { data: event.data } })
53709
+ );
53710
+ break;
53711
+ }
53712
+ case "setEditMode": {
53713
+ if (event.data.error) {
53714
+ SharedLib.rejectPromise(
53715
+ dashboardComponent,
53716
+ event.data.requestId,
53717
+ event.data
53718
+ );
53719
+ } else {
53720
+ SharedLib.resolvePromise(
53721
+ dashboardComponent,
53722
+ event.data.requestId,
53723
+ event.data
53724
+ );
53725
+ dashboardComponent.params.editMode = event.data.editMode;
53726
+ dashboardComponent._containerStyle = SharedLib.containerStyles(dashboardComponent);
53727
+ if (dashboardComponent.dimensions) {
53728
+ SharedLib._setCalculatedDimensions(dashboardComponent);
53729
+ }
53730
+ }
53731
+ break;
53732
+ }
53733
+ case "setSelectedData":
53734
+ case "setFilters": {
53735
+ event.data.error ? SharedLib.rejectPromise(
53736
+ dashboardComponent,
53737
+ event.data.requestId,
53738
+ event.data
53739
+ ) : SharedLib.resolvePromise(
53740
+ dashboardComponent,
53741
+ event.data.requestId,
53742
+ event.data
53743
+ );
53744
+ break;
53745
+ }
53746
+ case "setPreview": {
53747
+ event.data.error ? SharedLib.rejectPromise(
53748
+ dashboardComponent,
53749
+ event.data.requestId,
53750
+ event.data
53751
+ ) : SharedLib.resolvePromise(
53752
+ dashboardComponent,
53753
+ event.data.requestId,
53754
+ event.data
53755
+ );
53756
+ break;
53757
+ }
53758
+ }
53759
+ };
53760
+ window.addEventListener("message", window.__luzmoMessageHandler, false);
53761
+ };
53762
+
53763
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-styles.ts
53764
+ import { css } from "lit";
53765
+ var dashboardStyles = css`
53766
+ :host {
53767
+ display: block;
53768
+ height: 100%;
53769
+ }
53770
+
53771
+ @-webkit-keyframes spin {
53772
+ 0% {
53773
+ -webkit-transform: rotate(0deg);
53774
+ transform: rotate(0deg);
53775
+ }
53776
+ 100% {
53777
+ -webkit-transform: rotate(360deg);
53778
+ transform: rotate(360deg);
53779
+ }
53780
+ }
53781
+
53782
+ @keyframes spin {
53783
+ 0% {
53784
+ -webkit-transform: rotate(0deg);
53785
+ transform: rotate(0deg);
53786
+ }
53787
+ 100% {
53788
+ -webkit-transform: rotate(360deg);
53789
+ transform: rotate(360deg);
53790
+ }
53791
+ }
53792
+ :host {
53793
+ position: relative;
53794
+ width: 100%;
53795
+ }
53796
+
53797
+ .luzmo-embed-dashboard {
53798
+ background: transparent;
53799
+ padding: 0;
53800
+ border: 0;
53801
+ }
53802
+
53803
+ .luzmo-embed-dashboard-ede {
53804
+ }
53805
+
53806
+ .luzmo-embed-container-ede {
53807
+ width: 100%;
53808
+ height: 100%;
53809
+ }
53810
+
53811
+ .luzmo-container-loader {
53812
+ width: 100%;
53813
+ position: relative;
53814
+ }
53815
+
53816
+ .luzmo-lc {
53817
+ margin: 0 auto;
53818
+ }
53819
+
53820
+ .luzmo-loading-message {
53821
+ width: 100%;
53822
+ height: 20px;
53823
+ text-align: center;
53824
+ margin-bottom: 16px;
53825
+ font-family: Helvetica, Arial, sans-serif;
53826
+ font-size: 14px;
53827
+ }
53828
+
53829
+ .luzmo-loading-circle {
53830
+ box-sizing: border-box;
53831
+ margin: 16px auto;
53832
+ position: relative;
53833
+ text-indent: -9999em;
53834
+ animation: spin 0.6s infinite linear;
53835
+ }
53836
+
53837
+ .luzmo-loading-circle,
53838
+ .luzmo-loading-circle:after {
53839
+ border-radius: 50%;
53840
+ width: 32px;
53841
+ height: 32px;
53842
+ }
53843
+
53844
+ .itemEmbedding:after {
53845
+ width: 24px;
53846
+ height: 24px;
53847
+ }
53848
+
53849
+ .luzmo-error {
53850
+ background: transparent;
53851
+ padding: 48px 0;
53852
+ margin: 0 auto;
53853
+ width: 80%;
53854
+ border: 0;
53855
+ text-align: center;
53856
+ min-height: 192px;
53857
+ }
53858
+
53859
+ .dashboard-error {
53860
+ font-size: 30px;
53861
+ background: transparent;
53862
+ padding: 48px 0;
53863
+ margin: 0 auto;
53864
+ width: 80%;
53865
+ border: 0;
53866
+ text-align: center;
53867
+ min-height: 192px;
53868
+ }
53869
+
53870
+ .luzmo-loader {
53871
+ top: 0;
53872
+ left: 0;
53873
+ width: 100%;
53874
+ min-height: 400px;
53875
+ position: absolute;
53876
+ transition-duration: 0.3s;
53877
+ }
53878
+ `;
53879
+
53880
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
53881
+ var LuzmoDashboard = class extends LitElement {
53882
+ constructor() {
53883
+ super();
53884
+ this.language = "auto";
53885
+ this.screenMode = "auto";
53886
+ this.switchScreenModeOnResize = true;
53887
+ this.editMode = "view";
53888
+ this.experimental = false;
53889
+ this.iframeStyle = {};
53890
+ this._containerStyle = {};
53891
+ this._loaderStyle = {};
53892
+ this._lcStyle = {};
53893
+ this._loadingCircleStyle = {};
53894
+ this._containerLoaderStyle = {};
53895
+ this._loaderMsg = "";
53896
+ this._itemEmbedding = false;
53897
+ this.browserError = false;
53898
+ this.browserErrorMsg = "";
53899
+ this.dashboardError = false;
53900
+ this.browserNotSupported = [];
53901
+ this.libVersion = version + "-wc-luzmo";
53902
+ this.isLibraryLoaded = false;
53903
+ this.currentAuthKey = null;
53904
+ this.currentAuthToken = null;
53905
+ this.isInitCalled = false;
53906
+ this.attributesMap = {
53907
+ dashboardId: "dashboard-id",
53908
+ dashboardSlug: "dashboard-slug",
53909
+ itemId: "item-id",
53910
+ language: "language",
53911
+ qeVersion: "qe-version",
53912
+ screenMode: "screen-mode",
53913
+ switchScreenModeOnResize: "switch-screen-mode-on-resize",
53914
+ authKey: "auth-key",
53915
+ authToken: "auth-token",
53916
+ editMode: "edit-mode",
53917
+ mainColor: "main-color",
53918
+ accentColor: "accent-color",
53919
+ loaderBackground: "loader-background",
53920
+ loaderFontColor: "loader-font-color",
53921
+ loaderSpinnerColor: "loader-spinner-color",
53922
+ loaderSpinnerBackground: "loader-spinner-background",
53923
+ appServer: "app-server",
53924
+ apiHost: "api-host",
53925
+ itemDimensions: "item-dimensions",
53926
+ timezoneId: "timezone-id"
53927
+ };
53928
+ this.loaderSize = 32;
53929
+ this.borderWidth = 3;
53930
+ this.minHeight = 400;
53931
+ this._containerId = SharedLib2.uuidv4();
53932
+ this._iframeId = `luzmo-dashboard-${this._containerId}`;
53933
+ this.iframeLoaded = false;
53934
+ this.promises = {};
53935
+ this.params = this._setOptions();
53936
+ this._onResize = () => {
53937
+ if (this.shadowRoot?.querySelector(".dashboard-container")) {
53938
+ this.containerWidth = this.luzmoEmbedContainer.offsetWidth;
53939
+ if (this.params.switchScreenModeOnResize && this.params.screenMode === "auto") {
53940
+ for (const d of SharedLib2.EXTENTS) {
53941
+ if (d.width[0] <= window.innerWidth && window.innerWidth <= d.width[1]) {
53942
+ this.currentScreenMode = d.mode;
53943
+ }
53944
+ }
54359
53945
  }
54360
- },
54361
- type: "object"
54362
- },
54363
- title: {
54364
- description: 'Title in format {locale: "title"}, for example, {en: "Title"}',
54365
- examples: [
54366
- {
54367
- en: "Title"
53946
+ if (this.iframeLoaded) {
53947
+ this._calculateDimAfterDashboardLoaded();
53948
+ } else {
53949
+ if (this.dimensions) {
53950
+ this.containerWidth = this.luzmoEmbedContainer.offsetWidth;
53951
+ SharedLib2._setCalculatedDimensions(this);
53952
+ }
54368
53953
  }
54369
- ],
54370
- type: "object"
53954
+ }
53955
+ };
53956
+ this._resizeObserver = new ResizeObserver((entries) => {
53957
+ window.requestAnimationFrame(() => {
53958
+ if (!Array.isArray(entries) || entries.length === 0) {
53959
+ return;
53960
+ }
53961
+ this._onResize();
53962
+ });
53963
+ });
53964
+ }
53965
+ // Set resize event listener
53966
+ connectedCallback() {
53967
+ super.connectedCallback();
53968
+ }
53969
+ // Set resize event listener
53970
+ disconnectedCallback() {
53971
+ super.disconnectedCallback();
53972
+ this._resizeObserver.disconnect();
53973
+ for (const promiseKey of Object.keys(this.promises)) {
53974
+ this.promises[promiseKey].reject(
53975
+ new Error("Dashboard component was removed")
53976
+ );
53977
+ }
53978
+ }
53979
+ firstUpdated() {
53980
+ this._loaderMsg = SharedLib2.getLoader(this)?.loadingMsg;
53981
+ this._loaderStyles();
53982
+ luzmo_service_default._components.push(this);
53983
+ if (this.luzmoEmbedContainer) {
53984
+ this._resizeObserver.observe(this.luzmoEmbedContainer);
53985
+ }
53986
+ }
53987
+ initComponent() {
53988
+ this.params = this._setOptions();
53989
+ if (this.getIsViewMode()) {
53990
+ SharedLib2.loadLibrary(this.params.appServer).then(async () => {
53991
+ this.isLibraryLoaded = true;
53992
+ await this.updateComplete;
53993
+ const oldReference = this.renderRoot.querySelector("dashboard-component");
53994
+ this.dashboardReference = oldReference.cloneNode(true);
53995
+ oldReference.replaceWith(this.dashboardReference);
53996
+ this.dashboardReference.addEventListener("load", (payload) => {
53997
+ this.containerWidth = this.dashboardReference.offsetWidth;
53998
+ this.dimensions = payload.detail.dimensions;
53999
+ SharedLib2._setCalculatedDimensions(this);
54000
+ window.dispatchEvent(new Event("resize"));
54001
+ this.dispatchEvent(new CustomEvent("load", payload));
54002
+ });
54003
+ this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
54004
+ this.dashboardReference.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
54005
+ this.dashboardReference.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
54006
+ this.dashboardReference.addEventListener("dashboardAction", (payload) => this.dispatchEvent(new CustomEvent("dashboardAction", payload)));
54007
+ this.dashboardReference.addEventListener("export", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
54008
+ this.setAllAttributes();
54009
+ });
54010
+ } else {
54011
+ this.containerWidth = this.container?.clientWidth;
54012
+ SharedLib2._extendAndValidate(this);
54013
+ SharedLib2._browserCheck(this);
54014
+ this._setupLoader();
54015
+ if (!this.params.error) {
54016
+ this._loaderStyles();
54017
+ _setEventHandler();
54018
+ this._iframeUrl = SharedLib2.createIframeUrl(this);
54019
+ this.iframe?.setAttribute("src", this._iframeUrl);
54020
+ this.iframeStyle = SharedLib2.calculateIframeStyles(this);
54021
+ }
54022
+ }
54023
+ }
54024
+ setAllAttributes() {
54025
+ if (this.dashboardReference) {
54026
+ for (const key in this.attributesMap) {
54027
+ if (!["authKey", "authToken", "apiHost", "itemDimensions"].includes(key) && this.params[key]) {
54028
+ this.dashboardReference.setAttribute(this.attributesMap[key], this.params[key]);
54029
+ }
54030
+ }
54031
+ if (this.params.itemDimensions) {
54032
+ this.dashboardReference.setAttribute("item-dimensions", JSON.stringify(this.params.itemDimensions));
54033
+ }
54034
+ if (this.params.apiHost) {
54035
+ this.dashboardReference.setAttribute("api-host", SharedLib2.removeTrailingSlash(this.params.apiHost));
54036
+ }
54037
+ if (this.params.key) {
54038
+ this.dashboardReference.setAttribute("auth-key", this.params.key);
54039
+ }
54040
+ if (this.params.token) {
54041
+ this.dashboardReference.setAttribute("auth-token", this.params.token);
54042
+ }
54043
+ }
54044
+ }
54045
+ // Reload dashboard when triggerproperty changes
54046
+ updated(changedProperties) {
54047
+ const triggerProperties = /* @__PURE__ */ new Set([
54048
+ "dashboardId",
54049
+ "dashboardSlug",
54050
+ "itemId",
54051
+ "language",
54052
+ "qeVersion",
54053
+ "editMode",
54054
+ "screenMode",
54055
+ "switchScreenModeOnResize",
54056
+ "authToken",
54057
+ "authKey",
54058
+ "appServer",
54059
+ "timezoneId",
54060
+ "itemDimensions"
54061
+ ]);
54062
+ const conditionsToCheck = ["dashboardId", "dashboardSlug", "itemId"];
54063
+ let callInitComponent = false;
54064
+ for (const condition of conditionsToCheck) {
54065
+ callInitComponent = callInitComponent || changedProperties.get(condition) === void 0 && this[condition] !== void 0;
54066
+ }
54067
+ if (callInitComponent && !this.isInitCalled) {
54068
+ this.initComponent();
54069
+ this.isInitCalled = true;
54070
+ return;
54071
+ }
54072
+ if (this.getIsViewMode()) {
54073
+ if (this.dashboardReference) {
54074
+ for (const [propertyName] of changedProperties.entries()) {
54075
+ if (propertyName === "appSever") {
54076
+ SharedLib2.loadLibrary(changedProperties[propertyName]).then(async () => {
54077
+ this.isLibraryLoaded = true;
54078
+ await this.updateComplete;
54079
+ this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
54080
+ this.setAllAttributes();
54081
+ });
54082
+ } else if (this.attributesMap[propertyName]) {
54083
+ const mappedAttributeName = this.attributesMap[propertyName] ?? propertyName;
54084
+ const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() || this[propertyName];
54085
+ this.dashboardReference.setAttribute(mappedAttributeName, attributeValue);
54086
+ }
54087
+ }
54088
+ }
54089
+ } else {
54090
+ for (const [propertyName] of changedProperties.entries()) {
54091
+ if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
54092
+ this.iframeLoaded = false;
54093
+ if (this._loadTimeoutHandle) {
54094
+ clearTimeout(this._loadTimeoutHandle);
54095
+ }
54096
+ this._loadTimeoutHandle = setTimeout(() => {
54097
+ console.warn(
54098
+ "Failed to load dashboard, appServer is likely down or unreachable."
54099
+ );
54100
+ }, 15 * 1e3);
54101
+ this.params = this._setOptions();
54102
+ SharedLib2._extendAndValidate(this);
54103
+ this._setupLoader();
54104
+ this._loaderStyles();
54105
+ this._iframeUrl = SharedLib2.createIframeUrl(this);
54106
+ if (this.iframe) {
54107
+ this._updateIframeUrl();
54108
+ }
54109
+ this.iframeStyle = SharedLib2.calculateIframeStyles(this);
54110
+ } else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
54111
+ if (this.iframeLoaded) {
54112
+ this.setEditMode(this.editMode);
54113
+ }
54114
+ this.params = this._setOptions();
54115
+ }
54116
+ }
54117
+ }
54118
+ }
54119
+ // Set params
54120
+ _setOptions() {
54121
+ const defaultParameters = {
54122
+ dashboardId: this.dashboardId,
54123
+ dashboardSlug: this.dashboardSlug
54124
+ };
54125
+ if (this.itemId) {
54126
+ defaultParameters.itemId = this.itemId;
54127
+ this._itemEmbedding = true;
54128
+ } else {
54129
+ this._itemEmbedding = false;
54130
+ }
54131
+ if (this.language) {
54132
+ defaultParameters.language = this.language;
54133
+ }
54134
+ if (this.qeVersion) {
54135
+ defaultParameters.qeVersion = this.qeVersion;
54136
+ }
54137
+ if (this.screenMode) {
54138
+ defaultParameters.screenMode = this.screenMode;
54139
+ }
54140
+ defaultParameters.switchScreenModeOnResize = this.switchScreenModeOnResize;
54141
+ if (this.authToken) {
54142
+ defaultParameters.token = this.authToken;
54143
+ }
54144
+ if (this.authKey) {
54145
+ defaultParameters.key = this.authKey;
54146
+ }
54147
+ if (this.editMode) {
54148
+ defaultParameters.editMode = this.editMode;
54149
+ }
54150
+ if (this.mainColor) {
54151
+ defaultParameters.mainColor = this.mainColor;
54152
+ }
54153
+ if (this.accentColor) {
54154
+ defaultParameters.accentColor = this.accentColor;
54155
+ }
54156
+ if (this.loaderBackground) {
54157
+ defaultParameters.loaderBackground = this.loaderBackground;
54158
+ }
54159
+ if (this.loaderFontColor) {
54160
+ defaultParameters.loaderFontColor = this.loaderFontColor;
54161
+ }
54162
+ if (this.loaderSpinnerColor) {
54163
+ defaultParameters.loaderSpinnerColor = this.loaderSpinnerColor;
54371
54164
  }
54372
- },
54373
- type: "object"
54165
+ if (this.loaderSpinnerBackground) {
54166
+ defaultParameters.loaderSpinnerBackground = this.loaderSpinnerBackground;
54167
+ }
54168
+ if (this.timezoneId) {
54169
+ defaultParameters.timezoneId = this.timezoneId;
54170
+ }
54171
+ if (this.itemDimensions) {
54172
+ defaultParameters.itemDimensions = this.itemDimensions;
54173
+ }
54174
+ if (this.appServer) {
54175
+ this.appServer = this.getIsViewMode() ? SharedLib2.removeTrailingSlash(this.appServer) : SharedLib2.addTrailingSlash(this.appServer);
54176
+ defaultParameters.appServer = this.appServer;
54177
+ } else {
54178
+ this.appServer = SharedLib2.addTrailingSlash(
54179
+ SharedLib2.DEFAULT_PARAMETERS.appServer
54180
+ );
54181
+ defaultParameters.appServer = this.appServer;
54182
+ }
54183
+ if (this.apiHost) {
54184
+ this.apiHost = this.getIsViewMode() ? SharedLib2.removeTrailingSlash(this.apiHost) : SharedLib2.addTrailingSlash(this.apiHost);
54185
+ defaultParameters.apiHost = this.apiHost;
54186
+ } else {
54187
+ this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
54188
+ defaultParameters.apiHost = this.apiHost;
54189
+ }
54190
+ this.currentAuthKey = this.authKey;
54191
+ this.currentAuthToken = this.authToken;
54192
+ return defaultParameters;
54193
+ }
54194
+ _updateIframeUrl() {
54195
+ SharedLib2.updateIframeUrl(this.iframe, this._iframeUrl);
54196
+ }
54197
+ // Setup loader / browser error
54198
+ _setupLoader() {
54199
+ const data = SharedLib2.getLoader(this);
54200
+ this._loaderMsg = data.loadingMsg;
54201
+ if (data.errorMsg) {
54202
+ this.browserError = true;
54203
+ this.browserErrorMsg = data.errorMsg;
54204
+ this._displayError();
54205
+ }
54206
+ }
54207
+ _displayError() {
54208
+ if (this.dashboardError) {
54209
+ this._loaderStyles();
54210
+ this.iframeStyle.opacity = 1;
54211
+ }
54212
+ if (this.browserError) {
54213
+ this._containerStyle.display = "none";
54214
+ }
54215
+ }
54216
+ _calculateDimAfterDashboardLoaded() {
54217
+ this.dashboardError = false;
54218
+ this._loaderStyles();
54219
+ SharedLib2._setCalculatedDimensions(this);
54220
+ }
54221
+ // Set loader styles
54222
+ _loaderStyles() {
54223
+ this._containerStyle = SharedLib2.containerStyles(this);
54224
+ this._loaderStyle = SharedLib2.loaderStyles(this);
54225
+ this._loadingCircleStyle = SharedLib2.plStyles(this);
54226
+ this._containerLoaderStyle = SharedLib2.containerLoaderStyles(this);
54227
+ this._lcStyle = SharedLib2.lcStyles(this);
54228
+ }
54229
+ static get styles() {
54230
+ return [dashboardStyles];
54231
+ }
54232
+ render() {
54233
+ let toBeRenderedHTML;
54234
+ const loader = html`
54235
+ <div
54236
+ class="luzmo-container-loader"
54237
+ id="luzmo-container-loader-${this._containerId}"
54238
+ style=${styleMap(
54239
+ this._containerLoaderStyle
54240
+ )}
54241
+ >
54242
+ <div
54243
+ class="luzmo-loader"
54244
+ id="luzmo-loader-${this._containerId}"
54245
+ style=${styleMap(this._loaderStyle)}
54246
+ >
54247
+ <div
54248
+ class="luzmo-lc"
54249
+ style=${styleMap(this._lcStyle)}
54250
+ >
54251
+ <div
54252
+ class="luzmo-loading-circle"
54253
+ style=${styleMap(
54254
+ this._loadingCircleStyle
54255
+ )}
54256
+ ></div>
54257
+ ${this._itemEmbedding ? "" : html`
54258
+ <div
54259
+ class="luzmo-loading-message"
54260
+ style=${styleMap({ color: this.loaderFontColor })}
54261
+ >
54262
+ ${this._loaderMsg}
54263
+ </div>
54264
+ `}
54265
+ </div>
54266
+ </div>
54267
+ </div>
54268
+ `;
54269
+ if (this.getIsViewMode()) {
54270
+ toBeRenderedHTML = this.isLibraryLoaded ? html`
54271
+ ${this.dashboardId || this.dashboardSlug ? html`
54272
+ <dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
54273
+ api-host="${this.params.apiHost}"></dashboard-component>` : html`
54274
+ <div id="luzmo-error-${this._containerId}">
54275
+ <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
54276
+ </div>
54277
+ `}
54278
+ ` : html`${loader}`;
54279
+ } else {
54280
+ toBeRenderedHTML = html`
54281
+ ${this.dashboardId || this.dashboardSlug ? html`
54282
+ ${loader}
54283
+ <iframe
54284
+ class="luzmo-embed-dashboard ${!this.getIsViewMode() ? `luzmo-embed-dashboard-ede` : ""}"
54285
+ id="${this._iframeId}"
54286
+ name="${this._iframeId}"
54287
+ style=${styleMap(this.iframeStyle)}
54288
+ src="${this._iframeUrl}"
54289
+ frameborder="0"
54290
+ ></iframe>
54291
+ ` : html`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
54292
+ ${this.browserError ? html`
54293
+ <div id="luzmo-error-${this._containerId}">
54294
+ <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
54295
+ </div>
54296
+ ` : ""}
54297
+ `;
54298
+ }
54299
+ return html`
54300
+ <div class="${luzmoEmbedContainerClass} ${!this.getIsViewMode() ? `${luzmoEmbedContainerClass}-ede` : ""}">
54301
+ <div
54302
+ class="dashboard-container"
54303
+ style=${styleMap(Object.assign({}, this._containerStyle, {
54304
+ width: this.iframeStyle.width ?? "100%",
54305
+ height: this.iframeStyle.height ?? "100%"
54306
+ }))}
54307
+ >
54308
+ ${toBeRenderedHTML}
54309
+ </div>
54310
+ </div>
54311
+
54312
+ `;
54313
+ }
54314
+ getDashboards() {
54315
+ return new Promise(
54316
+ (resolve) => resolve(luzmo_service_default._components)
54317
+ );
54318
+ }
54319
+ // Public methods
54320
+ getData(itemId) {
54321
+ if (this.getIsViewMode() && this.dashboardReference) {
54322
+ return this.dashboardReference.getData(itemId);
54323
+ }
54324
+ if (!this.getIsViewMode()) {
54325
+ return SharedLib2.getData(this, this.iframe, itemId);
54326
+ }
54327
+ return Promise.reject();
54328
+ }
54329
+ getFilters() {
54330
+ if (this.getIsViewMode() && this.dashboardReference) {
54331
+ return this.dashboardReference.getFilters();
54332
+ }
54333
+ if (!this.getIsViewMode()) {
54334
+ return SharedLib2.getFilters(this, this.iframe);
54335
+ }
54336
+ return Promise.reject();
54337
+ }
54338
+ setSelectedData(itemId, filters) {
54339
+ if (this.getIsViewMode() && this.dashboardReference) {
54340
+ return this.dashboardReference.setSelectedData(itemId, filters);
54341
+ }
54342
+ if (!this.getIsViewMode()) {
54343
+ return SharedLib2.setSelectedData(this, this.iframe, itemId, filters);
54344
+ }
54345
+ return Promise.reject();
54346
+ }
54347
+ setAuthorization(key, token) {
54348
+ this.currentAuthKey = key;
54349
+ this.currentAuthToken = token;
54350
+ if (this.getIsViewMode() && this.dashboardReference) {
54351
+ return this.dashboardReference.setAuthorization(key, token);
54352
+ }
54353
+ if (!this.getIsViewMode()) {
54354
+ return SharedLib2.setAuthorization(this, this.iframe, key, token);
54355
+ }
54356
+ return Promise.reject();
54357
+ }
54358
+ refreshData(itemId) {
54359
+ if (this.getIsViewMode() && this.dashboardReference) {
54360
+ return this.dashboardReference.refreshData(itemId);
54361
+ }
54362
+ if (!this.getIsViewMode()) {
54363
+ return itemId ? SharedLib2.refreshData(this, this.iframe, itemId) : SharedLib2.refreshData(this, this.iframe);
54364
+ }
54365
+ return Promise.reject();
54366
+ }
54367
+ reloadDashboard() {
54368
+ if (this.getIsViewMode() && this.dashboardReference) {
54369
+ return this.dashboardReference.reloadDashboard();
54370
+ }
54371
+ if (!this.getIsViewMode()) {
54372
+ return SharedLib2.reloadDashboard(this, this.iframe);
54373
+ }
54374
+ return Promise.reject();
54375
+ }
54376
+ exportDashboard(format) {
54377
+ if (this.getIsViewMode() && this.dashboardReference) {
54378
+ return this.dashboardReference.exportDashboard(format);
54379
+ }
54380
+ if (!this.getIsViewMode()) {
54381
+ return format ? SharedLib2.exportDashboard(this, this.iframe, format) : SharedLib2.exportDashboard(this, this.iframe);
54382
+ }
54383
+ return Promise.reject();
54384
+ }
54385
+ getAccessibleDashboards() {
54386
+ return SharedLib2.getAccessibleDashboards(this);
54387
+ }
54388
+ addFilters(itemId, filters) {
54389
+ return this.dashboardReference.addFilters(itemId, filters);
54390
+ }
54391
+ setEditMode(editMode) {
54392
+ if (this.dashboardReference && editMode === "view") {
54393
+ this.editMode = "view";
54394
+ this.params.editMode = "view";
54395
+ this.initComponent();
54396
+ return Promise.resolve({
54397
+ type: "setEditMode",
54398
+ editMode
54399
+ });
54400
+ }
54401
+ if (this.dashboardReference && ["editFull", "editLimited"].includes(editMode)) {
54402
+ this.editMode = editMode;
54403
+ this.params.editMode = editMode;
54404
+ this.initComponent();
54405
+ return Promise.resolve({
54406
+ type: "setEditMode",
54407
+ editMode
54408
+ });
54409
+ }
54410
+ if (this.getIsViewMode() && this.dashboardReference) {
54411
+ return this.dashboardReference.setEditMode(editMode);
54412
+ }
54413
+ if (!this.getIsViewMode()) {
54414
+ return SharedLib2.setEditMode(this, this.iframe, editMode);
54415
+ }
54416
+ return Promise.reject();
54417
+ }
54418
+ setPreview(preview) {
54419
+ if (this.getIsViewMode() && this.dashboardReference) {
54420
+ return this.dashboardReference.setPreview(preview);
54421
+ }
54422
+ return SharedLib2.setPreview(this, this.iframe, preview);
54423
+ }
54424
+ getIsViewMode() {
54425
+ return this.experimental && this.params.editMode === "view" || this.params.editMode === void 0;
54426
+ }
54374
54427
  };
54428
+ __decorateClass([
54429
+ query(".dashboard-container")
54430
+ ], LuzmoDashboard.prototype, "container", 2);
54431
+ __decorateClass([
54432
+ query(`.${luzmoEmbedContainerClass}`)
54433
+ ], LuzmoDashboard.prototype, "luzmoEmbedContainer", 2);
54434
+ __decorateClass([
54435
+ query("iframe")
54436
+ ], LuzmoDashboard.prototype, "iframe", 2);
54437
+ __decorateClass([
54438
+ property()
54439
+ ], LuzmoDashboard.prototype, "dashboardId", 2);
54440
+ __decorateClass([
54441
+ property()
54442
+ ], LuzmoDashboard.prototype, "dashboardSlug", 2);
54443
+ __decorateClass([
54444
+ property()
54445
+ ], LuzmoDashboard.prototype, "itemId", 2);
54446
+ __decorateClass([
54447
+ property()
54448
+ ], LuzmoDashboard.prototype, "language", 2);
54449
+ __decorateClass([
54450
+ property()
54451
+ ], LuzmoDashboard.prototype, "qeVersion", 2);
54452
+ __decorateClass([
54453
+ property()
54454
+ ], LuzmoDashboard.prototype, "screenMode", 2);
54455
+ __decorateClass([
54456
+ property({
54457
+ converter: {
54458
+ fromAttribute: (value) => value === "true",
54459
+ toAttribute: String
54460
+ }
54461
+ })
54462
+ ], LuzmoDashboard.prototype, "switchScreenModeOnResize", 2);
54463
+ __decorateClass([
54464
+ property()
54465
+ ], LuzmoDashboard.prototype, "editMode", 2);
54466
+ __decorateClass([
54467
+ property()
54468
+ ], LuzmoDashboard.prototype, "mainColor", 2);
54469
+ __decorateClass([
54470
+ property()
54471
+ ], LuzmoDashboard.prototype, "accentColor", 2);
54472
+ __decorateClass([
54473
+ property()
54474
+ ], LuzmoDashboard.prototype, "authToken", 2);
54475
+ __decorateClass([
54476
+ property()
54477
+ ], LuzmoDashboard.prototype, "authKey", 2);
54478
+ __decorateClass([
54479
+ property()
54480
+ ], LuzmoDashboard.prototype, "loaderBackground", 2);
54481
+ __decorateClass([
54482
+ property()
54483
+ ], LuzmoDashboard.prototype, "loaderFontColor", 2);
54484
+ __decorateClass([
54485
+ property()
54486
+ ], LuzmoDashboard.prototype, "loaderSpinnerColor", 2);
54487
+ __decorateClass([
54488
+ property()
54489
+ ], LuzmoDashboard.prototype, "loaderSpinnerBackground", 2);
54490
+ __decorateClass([
54491
+ property()
54492
+ ], LuzmoDashboard.prototype, "appServer", 2);
54493
+ __decorateClass([
54494
+ property()
54495
+ ], LuzmoDashboard.prototype, "timezoneId", 2);
54496
+ __decorateClass([
54497
+ property()
54498
+ ], LuzmoDashboard.prototype, "apiHost", 2);
54499
+ __decorateClass([
54500
+ property({ type: Object })
54501
+ ], LuzmoDashboard.prototype, "itemDimensions", 2);
54502
+ __decorateClass([
54503
+ property({
54504
+ converter: {
54505
+ fromAttribute: (value) => value === "true",
54506
+ toAttribute: String
54507
+ }
54508
+ })
54509
+ ], LuzmoDashboard.prototype, "experimental", 2);
54510
+ __decorateClass([
54511
+ property({ attribute: false })
54512
+ ], LuzmoDashboard.prototype, "_containerId", 2);
54513
+ __decorateClass([
54514
+ property({ attribute: false })
54515
+ ], LuzmoDashboard.prototype, "_iframeId", 2);
54516
+ __decorateClass([
54517
+ property({ attribute: false })
54518
+ ], LuzmoDashboard.prototype, "params", 2);
54519
+ __decorateClass([
54520
+ property({ attribute: false })
54521
+ ], LuzmoDashboard.prototype, "_iframeUrl", 2);
54522
+ __decorateClass([
54523
+ property({ attribute: false })
54524
+ ], LuzmoDashboard.prototype, "iframeLoaded", 2);
54525
+ __decorateClass([
54526
+ property({ attribute: false })
54527
+ ], LuzmoDashboard.prototype, "promises", 2);
54528
+ __decorateClass([
54529
+ property({ attribute: false })
54530
+ ], LuzmoDashboard.prototype, "iframeStyle", 2);
54531
+ __decorateClass([
54532
+ property({ attribute: false })
54533
+ ], LuzmoDashboard.prototype, "_containerStyle", 2);
54534
+ __decorateClass([
54535
+ property({ attribute: false })
54536
+ ], LuzmoDashboard.prototype, "_loaderStyle", 2);
54537
+ __decorateClass([
54538
+ property({ attribute: false })
54539
+ ], LuzmoDashboard.prototype, "_lcStyle", 2);
54540
+ __decorateClass([
54541
+ property({ attribute: false })
54542
+ ], LuzmoDashboard.prototype, "_loadingCircleStyle", 2);
54543
+ __decorateClass([
54544
+ property({ attribute: false })
54545
+ ], LuzmoDashboard.prototype, "_containerLoaderStyle", 2);
54546
+ __decorateClass([
54547
+ property({ attribute: false })
54548
+ ], LuzmoDashboard.prototype, "_loaderMsg", 2);
54549
+ __decorateClass([
54550
+ property({ attribute: false })
54551
+ ], LuzmoDashboard.prototype, "containerWidth", 2);
54552
+ __decorateClass([
54553
+ property({ attribute: false })
54554
+ ], LuzmoDashboard.prototype, "dimensions", 2);
54555
+ __decorateClass([
54556
+ property({ attribute: false })
54557
+ ], LuzmoDashboard.prototype, "currentScreenMode", 2);
54558
+ __decorateClass([
54559
+ property({ attribute: false })
54560
+ ], LuzmoDashboard.prototype, "_itemEmbedding", 2);
54561
+ __decorateClass([
54562
+ property({ attribute: false })
54563
+ ], LuzmoDashboard.prototype, "browserError", 2);
54564
+ __decorateClass([
54565
+ property({ attribute: false })
54566
+ ], LuzmoDashboard.prototype, "browserErrorMsg", 2);
54567
+ __decorateClass([
54568
+ property({ attribute: false })
54569
+ ], LuzmoDashboard.prototype, "dashboardError", 2);
54570
+ __decorateClass([
54571
+ property({ attribute: false })
54572
+ ], LuzmoDashboard.prototype, "browserNotSupported", 2);
54573
+ __decorateClass([
54574
+ property()
54575
+ ], LuzmoDashboard.prototype, "libVersion", 2);
54576
+ __decorateClass([
54577
+ state()
54578
+ ], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
54579
+ __decorateClass([
54580
+ state()
54581
+ ], LuzmoDashboard.prototype, "dashboardReference", 2);
54582
+ __decorateClass([
54583
+ state()
54584
+ ], LuzmoDashboard.prototype, "currentAuthKey", 2);
54585
+ __decorateClass([
54586
+ state()
54587
+ ], LuzmoDashboard.prototype, "currentAuthToken", 2);
54588
+ __decorateClass([
54589
+ state()
54590
+ ], LuzmoDashboard.prototype, "isInitCalled", 2);
54375
54591
 
54376
- // libs/dashboard-contents-types/json-schemas.ts
54377
- var JSON_SCHEMAS = {
54378
- "options.schema.json": options_schema_default,
54379
- "slots.schema.json": slots_schema_default,
54380
- "area-chart.schema.json": area_chart_schema_default,
54381
- "area-chart-options.schema.json": area_chart_options_schema_default,
54382
- "area-chart-slots.schema.json": area_chart_slots_schema_default,
54383
- "bar-chart.schema.json": bar_chart_schema_default,
54384
- "bar-chart-options.schema.json": bar_chart_options_schema_default,
54385
- "bar-chart-slots.schema.json": bar_chart_slots_schema_default,
54386
- "box-plot.schema.json": box_plot_schema_default,
54387
- "box-plot-options.schema.json": box_plot_options_schema_default,
54388
- "box-plot-slots.schema.json": box_plot_slots_schema_default,
54389
- "bubble-chart.schema.json": bubble_chart_schema_default,
54390
- "bubble-chart-options.schema.json": bubble_chart_options_schema_default,
54391
- "bubble-chart-slots.schema.json": bubble_chart_slots_schema_default,
54392
- "bullet-chart.schema.json": bullet_chart_schema_default,
54393
- "bullet-chart-options.schema.json": bullet_chart_options_schema_default,
54394
- "bullet-chart-slots.schema.json": bullet_chart_slots_schema_default,
54395
- "choropleth-map.schema.json": choropleth_map_schema_default,
54396
- "choropleth-map-options.schema.json": choropleth_map_options_schema_default,
54397
- "choropleth-map-slots.schema.json": choropleth_map_slots_schema_default,
54398
- "circular-gauge.schema.json": circular_gauge_schema_default,
54399
- "circular-gauge-options.schema.json": circular_gauge_options_schema_default,
54400
- "circular-gauge-slots.schema.json": circular_gauge_slots_schema_default,
54401
- "column-chart.schema.json": column_chart_schema_default,
54402
- "column-chart-options.schema.json": column_chart_options_schema_default,
54403
- "column-chart-slots.schema.json": column_chart_slots_schema_default,
54404
- "combination-chart.schema.json": combination_chart_schema_default,
54405
- "combination-chart-options.schema.json": combination_chart_options_schema_default,
54406
- "combination-chart-slots.schema.json": combination_chart_slots_schema_default,
54407
- "date-filter.schema.json": date_filter_schema_default,
54408
- "date-filter-options.schema.json": date_filter_options_schema_default,
54409
- "date-filter-slots.schema.json": date_filter_slots_schema_default,
54410
- "donut-chart.schema.json": donut_chart_schema_default,
54411
- "donut-chart-options.schema.json": donut_chart_options_schema_default,
54412
- "donut-chart-slots.schema.json": donut_chart_slots_schema_default,
54413
- "dropdown-filter.schema.json": dropdown_filter_schema_default,
54414
- "dropdown-filter-options.schema.json": dropdown_filter_options_schema_default,
54415
- "dropdown-filter-slots.schema.json": dropdown_filter_slots_schema_default,
54416
- "evolution-number.schema.json": evolution_number_schema_default,
54417
- "evolution-number-options.schema.json": evolution_number_options_schema_default,
54418
- "evolution-number-slots.schema.json": evolution_number_slots_schema_default,
54419
- "funnel-chart.schema.json": funnel_chart_schema_default,
54420
- "funnel-chart-options.schema.json": funnel_chart_options_schema_default,
54421
- "funnel-chart-slots.schema.json": funnel_chart_slots_schema_default,
54422
- "image.schema.json": image_schema_default,
54423
- "image-options.schema.json": image_options_schema_default,
54424
- "line-chart.schema.json": line_chart_schema_default,
54425
- "line-chart-options.schema.json": line_chart_options_schema_default,
54426
- "line-chart-slots.schema.json": line_chart_slots_schema_default,
54427
- "pivot-table.schema.json": pivot_table_schema_default,
54428
- "pivot-table-options.schema.json": pivot_table_options_schema_default,
54429
- "pivot-table-slots.schema.json": pivot_table_slots_schema_default,
54430
- "regular-table.schema.json": regular_table_schema_default,
54431
- "regular-table-options.schema.json": regular_table_options_schema_default,
54432
- "regular-table-slots.schema.json": regular_table_slots_schema_default,
54433
- "sankey-diagram.schema.json": sankey_diagram_schema_default,
54434
- "sankey-diagram-options.schema.json": sankey_diagram_options_schema_default,
54435
- "sankey-diagram-slots.schema.json": sankey_diagram_slots_schema_default,
54436
- "scatter-plot.schema.json": scatter_plot_schema_default,
54437
- "scatter-plot-options.schema.json": scatter_plot_options_schema_default,
54438
- "scatter-plot-slots.schema.json": scatter_plot_slots_schema_default,
54439
- "slicer-filter.schema.json": slicer_filter_schema_default,
54440
- "slicer-filter-options.schema.json": slicer_filter_options_schema_default,
54441
- "slicer-filter-slots.schema.json": slicer_filter_slots_schema_default,
54442
- "slider-filter.schema.json": slider_filter_schema_default,
54443
- "slider-filter-options.schema.json": slider_filter_options_schema_default,
54444
- "slider-filter-slots.schema.json": slider_filter_slots_schema_default,
54445
- "text.schema.json": text_schema_default,
54446
- "text-options.schema.json": text_options_schema_default
54592
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
54593
+ var LuzmoEmbedDashboard = class extends LuzmoDashboard {
54447
54594
  };
54595
+ LuzmoEmbedDashboard = __decorateClass([
54596
+ customElement("luzmo-embed-dashboard")
54597
+ ], LuzmoEmbedDashboard);
54598
+
54599
+ // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
54600
+ import { customElement as customElement2 } from "lit/decorators.js";
54448
54601
 
54449
54602
  // libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
54603
+ import { property as property2 } from "lit/decorators.js";
54604
+ import { LitElement as LitElement2, html as html2, css as css2 } from "lit";
54605
+ import Ajv from "ajv";
54606
+ import ajvAddFormats from "ajv-formats";
54607
+ import * as SharedLib3 from "@luzmo/shared-embed";
54450
54608
  var dashboardContentsVersion = "0.1.88";
54609
+ if (!json_schemas_default || !Object.keys(json_schemas_default).length) {
54610
+ console.warn("Validation JSON schemas for charts are not found.");
54611
+ }
54451
54612
  var ajv = new Ajv({
54452
- schemas: Object.keys(JSON_SCHEMAS).map((key) => JSON_SCHEMAS[key]),
54613
+ schemas: Object.keys(json_schemas_default).map((key) => json_schemas_default[key]),
54453
54614
  allowUnionTypes: true,
54454
54615
  strictTuples: false
54455
54616
  });
@@ -54595,7 +54756,7 @@ var LuzmoBaseVizItem = class extends LitElement2 {
54595
54756
  }
54596
54757
  const validate = ajv.getSchema(jsonSchemaForValidation);
54597
54758
  if (!validate) {
54598
- console.error(`Validation JSON schema ${jsonSchemaForValidation} was not found.`);
54759
+ console.warn(`Validation JSON schema ${jsonSchemaForValidation} was not found.`);
54599
54760
  return;
54600
54761
  }
54601
54762
  const valid = validate(this[key]);
@@ -54603,7 +54764,7 @@ var LuzmoBaseVizItem = class extends LitElement2 {
54603
54764
  const humanReadableErrors = validate.errors.map((error, index) => {
54604
54765
  return `${index + 1}. Validation error at '${error.instancePath || "root"}': ${error.message}`;
54605
54766
  });
54606
- console.error(`<luzmo-viz-item> or <luzmo-embed-viz-item> has an invalid "${key}" value:`, humanReadableErrors.join(" "));
54767
+ console.warn(`<luzmo-viz-item> or <luzmo-embed-viz-item> has an invalid "${key}" value:`, humanReadableErrors.join(" "));
54607
54768
  }
54608
54769
  }
54609
54770
  }
@@ -54675,7 +54836,10 @@ LuzmoEmbedVizItem = __decorateClass([
54675
54836
  customElement2("luzmo-embed-viz-item")
54676
54837
  ], LuzmoEmbedVizItem);
54677
54838
  export {
54839
+ ColumnChartModes,
54840
+ json_schemas_default as JSON_SCHEMAS,
54678
54841
  LuzmoEmbedDashboard,
54679
54842
  LuzmoEmbedVizItem,
54843
+ RegularTableSortingMode,
54680
54844
  selectedDataUtils
54681
54845
  };